From ad88755634da42fcf65f4b5ad0992d4f28977b1f Mon Sep 17 00:00:00 2001 From: prince-deriv Date: Tue, 3 Sep 2024 17:12:33 +0400 Subject: [PATCH 01/57] chore: quick testing link generator --- package-lock.json | 1285 +++++++++++++++++++++++++++++++++++++++++---- package.json | 8 +- 2 files changed, 1202 insertions(+), 91 deletions(-) diff --git a/package-lock.json b/package-lock.json index 52505ac..7fa8821 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,9 @@ "@semantic-release/release-notes-generator": "^14.0.0", "autoprefixer": "^10.4.19", "cssnano": "^7.0.2", + "http-server": "^14.1.1", + "ngrok": "^5.0.0-beta.2", + "npm-run-all": "^4.1.5", "rollup-plugin-postcss": "^4.0.2", "rollup-plugin-terser": "^7.0.2", "vite": "^5.2.13" @@ -1265,7 +1268,6 @@ "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", "dev": true, - "peer": true, "engines": { "node": ">=10" }, @@ -1285,6 +1287,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@szmarczak/http-timer": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz", + "integrity": "sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==", + "dev": true, + "dependencies": { + "defer-to-connect": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@trysound/sax": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz", @@ -1294,12 +1308,39 @@ "node": ">=10.13.0" } }, + "node_modules/@types/cacheable-request": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.3.tgz", + "integrity": "sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==", + "dev": true, + "dependencies": { + "@types/http-cache-semantics": "*", + "@types/keyv": "^3.1.4", + "@types/node": "*", + "@types/responselike": "^1.0.0" + } + }, "node_modules/@types/estree": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", "dev": true }, + "node_modules/@types/http-cache-semantics": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", + "integrity": "sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==", + "dev": true + }, + "node_modules/@types/keyv": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz", + "integrity": "sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/node": { "version": "20.14.2", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.2.tgz", @@ -1315,12 +1356,31 @@ "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==", "dev": true }, + "node_modules/@types/responselike": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.3.tgz", + "integrity": "sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/semver": { "version": "7.5.8", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", "dev": true }, + "node_modules/@types/yauzl": { + "version": "2.10.3", + "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz", + "integrity": "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==", + "dev": true, + "optional": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/acorn": { "version": "8.11.3", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", @@ -1422,7 +1482,6 @@ "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", "dev": true, - "peer": true, "dependencies": { "call-bind": "^1.0.5", "is-array-buffer": "^3.0.4" @@ -1445,7 +1504,6 @@ "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", "dev": true, - "peer": true, "dependencies": { "array-buffer-byte-length": "^1.0.1", "call-bind": "^1.0.5", @@ -1463,6 +1521,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/async": { + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", + "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", + "dev": true, + "dependencies": { + "lodash": "^4.17.14" + } + }, "node_modules/autoprefixer": { "version": "10.4.19", "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.19.tgz", @@ -1505,7 +1572,6 @@ "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", "dev": true, - "peer": true, "dependencies": { "possible-typed-array-names": "^1.0.0" }, @@ -1516,6 +1582,30 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/basic-auth": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", + "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", + "dev": true, + "dependencies": { + "safe-buffer": "5.1.2" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/basic-auth/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, "node_modules/before-after-hook": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-3.0.2.tgz", @@ -1534,6 +1624,16 @@ "integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==", "dev": true }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "node_modules/braces": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", @@ -1578,18 +1678,68 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, + "node_modules/buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, + "node_modules/cacheable-lookup": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz", + "integrity": "sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==", + "dev": true, + "engines": { + "node": ">=10.6.0" + } + }, + "node_modules/cacheable-request": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.4.tgz", + "integrity": "sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg==", + "dev": true, + "dependencies": { + "clone-response": "^1.0.2", + "get-stream": "^5.1.0", + "http-cache-semantics": "^4.0.0", + "keyv": "^4.0.0", + "lowercase-keys": "^2.0.0", + "normalize-url": "^6.0.1", + "responselike": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cacheable-request/node_modules/get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/call-bind": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", "dev": true, - "peer": true, "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", @@ -1775,6 +1925,18 @@ "node": ">=12" } }, + "node_modules/clone-response": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.3.tgz", + "integrity": "sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==", + "dev": true, + "dependencies": { + "mimic-response": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -1818,6 +1980,12 @@ "dot-prop": "^5.1.0" } }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, "node_modules/concat-with-sourcemaps": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/concat-with-sourcemaps/-/concat-with-sourcemaps-1.1.0.tgz", @@ -1911,6 +2079,15 @@ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", "dev": true }, + "node_modules/corser": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz", + "integrity": "sha512-utCYNzRSQIZNPIcGZdQc92UVJYAhtGAteCFg0yRaFm8f0P+CPtyGyHXJcGXnffjCybUCEx3FQ2G7U3/o9eIkVQ==", + "dev": true, + "engines": { + "node": ">= 0.4.0" + } + }, "node_modules/cosmiconfig": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-9.0.0.tgz", @@ -2177,7 +2354,6 @@ "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", "dev": true, - "peer": true, "dependencies": { "call-bind": "^1.0.6", "es-errors": "^1.3.0", @@ -2195,7 +2371,6 @@ "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", "dev": true, - "peer": true, "dependencies": { "call-bind": "^1.0.7", "es-errors": "^1.3.0", @@ -2213,7 +2388,6 @@ "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", "dev": true, - "peer": true, "dependencies": { "call-bind": "^1.0.6", "es-errors": "^1.3.0", @@ -2243,6 +2417,33 @@ } } }, + "node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "dev": true, + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/decompress-response/node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/deep-extend": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", @@ -2252,12 +2453,20 @@ "node": ">=4.0.0" } }, + "node_modules/defer-to-connect": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", + "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/define-data-property": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", "dev": true, - "peer": true, "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", @@ -2275,7 +2484,6 @@ "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "dev": true, - "peer": true, "dependencies": { "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", @@ -2397,6 +2605,15 @@ "dev": true, "peer": true }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "dependencies": { + "once": "^1.4.0" + } + }, "node_modules/entities": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", @@ -2511,7 +2728,6 @@ "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, - "peer": true, "dependencies": { "is-arrayish": "^0.2.1" } @@ -2521,7 +2737,6 @@ "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", "dev": true, - "peer": true, "dependencies": { "array-buffer-byte-length": "^1.0.1", "arraybuffer.prototype.slice": "^1.0.3", @@ -2582,7 +2797,6 @@ "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", "dev": true, - "peer": true, "dependencies": { "get-intrinsic": "^1.2.4" }, @@ -2595,7 +2809,6 @@ "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", "dev": true, - "peer": true, "engines": { "node": ">= 0.4" } @@ -2605,7 +2818,6 @@ "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", "dev": true, - "peer": true, "dependencies": { "es-errors": "^1.3.0" }, @@ -2618,7 +2830,6 @@ "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", "dev": true, - "peer": true, "dependencies": { "get-intrinsic": "^1.2.4", "has-tostringtag": "^1.0.2", @@ -2633,7 +2844,6 @@ "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", "dev": true, - "peer": true, "dependencies": { "is-callable": "^1.1.4", "is-date-object": "^1.0.1", @@ -2768,6 +2978,41 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/extract-zip": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", + "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "get-stream": "^5.1.0", + "yauzl": "^2.10.0" + }, + "bin": { + "extract-zip": "cli.js" + }, + "engines": { + "node": ">= 10.17.0" + }, + "optionalDependencies": { + "@types/yauzl": "^2.9.1" + } + }, + "node_modules/extract-zip/node_modules/get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/fast-glob": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", @@ -2793,6 +3038,15 @@ "reusify": "^1.0.4" } }, + "node_modules/fd-slicer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", + "dev": true, + "dependencies": { + "pend": "~1.2.0" + } + }, "node_modules/figures": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/figures/-/figures-6.1.0.tgz", @@ -2862,12 +3116,31 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/follow-redirects": { + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, "node_modules/for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", "dev": true, - "peer": true, "dependencies": { "is-callable": "^1.1.3" } @@ -2950,7 +3223,6 @@ "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", "dev": true, - "peer": true, "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", @@ -2969,7 +3241,6 @@ "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", "dev": true, - "peer": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -2998,7 +3269,6 @@ "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dev": true, - "peer": true, "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2", @@ -3030,7 +3300,6 @@ "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", "dev": true, - "peer": true, "dependencies": { "call-bind": "^1.0.5", "es-errors": "^1.3.0", @@ -3075,7 +3344,6 @@ "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", "dev": true, - "peer": true, "dependencies": { "define-properties": "^1.2.1", "gopd": "^1.0.1" @@ -3124,7 +3392,6 @@ "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", "dev": true, - "peer": true, "dependencies": { "get-intrinsic": "^1.1.3" }, @@ -3132,6 +3399,31 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/got": { + "version": "11.8.6", + "resolved": "https://registry.npmjs.org/got/-/got-11.8.6.tgz", + "integrity": "sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==", + "dev": true, + "dependencies": { + "@sindresorhus/is": "^4.0.0", + "@szmarczak/http-timer": "^4.0.5", + "@types/cacheable-request": "^6.0.1", + "@types/responselike": "^1.0.0", + "cacheable-lookup": "^5.0.3", + "cacheable-request": "^7.0.2", + "decompress-response": "^6.0.0", + "http2-wrapper": "^1.0.0-beta.5.2", + "lowercase-keys": "^2.0.0", + "p-cancelable": "^2.0.0", + "responselike": "^2.0.0" + }, + "engines": { + "node": ">=10.19.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/got?sponsor=1" + } + }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -3164,7 +3456,6 @@ "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", "dev": true, - "peer": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -3183,7 +3474,6 @@ "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", "dev": true, - "peer": true, "dependencies": { "es-define-property": "^1.0.0" }, @@ -3196,7 +3486,6 @@ "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", "dev": true, - "peer": true, "engines": { "node": ">= 0.4" }, @@ -3209,7 +3498,6 @@ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", "dev": true, - "peer": true, "engines": { "node": ">= 0.4" }, @@ -3222,7 +3510,6 @@ "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "dev": true, - "peer": true, "dependencies": { "has-symbols": "^1.0.3" }, @@ -3245,6 +3532,15 @@ "node": ">= 0.4" } }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "bin": { + "he": "bin/he" + } + }, "node_modules/highlight.js": { "version": "10.7.3", "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", @@ -3280,6 +3576,45 @@ "node": "^16.14.0 || >=18.0.0" } }, + "node_modules/hpagent": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/hpagent/-/hpagent-0.1.2.tgz", + "integrity": "sha512-ePqFXHtSQWAFXYmj+JtOTHr84iNrII4/QRlAAPPE+zqnKy4xJo7Ie1Y4kC7AdB+LxLxSTTzBMASsEcy0q8YyvQ==", + "dev": true, + "optional": true + }, + "node_modules/html-encoding-sniffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", + "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", + "dev": true, + "dependencies": { + "whatwg-encoding": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/http-cache-semantics": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", + "dev": true + }, + "node_modules/http-proxy": { + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", + "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", + "dev": true, + "dependencies": { + "eventemitter3": "^4.0.0", + "follow-redirects": "^1.0.0", + "requires-port": "^1.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/http-proxy-agent": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", @@ -3293,32 +3628,102 @@ "node": ">= 14" } }, - "node_modules/https-proxy-agent": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", - "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", + "node_modules/http-server": { + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/http-server/-/http-server-14.1.1.tgz", + "integrity": "sha512-+cbxadF40UXd9T01zUHgA+rlo2Bg1Srer4+B4NwIHdaGxAGGv59nYRnGGDJ9LBk7alpS0US+J+bLLdQOOkJq4A==", "dev": true, "dependencies": { - "agent-base": "^7.0.2", - "debug": "4" + "basic-auth": "^2.0.1", + "chalk": "^4.1.2", + "corser": "^2.0.1", + "he": "^1.2.0", + "html-encoding-sniffer": "^3.0.0", + "http-proxy": "^1.18.1", + "mime": "^1.6.0", + "minimist": "^1.2.6", + "opener": "^1.5.1", + "portfinder": "^1.0.28", + "secure-compare": "3.0.1", + "union": "~0.5.0", + "url-join": "^4.0.1" + }, + "bin": { + "http-server": "bin/http-server" }, "engines": { - "node": ">= 14" + "node": ">=12" } }, - "node_modules/human-signals": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-7.0.0.tgz", - "integrity": "sha512-74kytxOUSvNbjrT9KisAbaTZ/eJwD/LrbM/kh5j0IhPuJzwuA19dWvniFGwBzN9rVjg+O/e+F310PjObDXS+9Q==", + "node_modules/http-server/node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", "dev": true, + "bin": { + "mime": "cli.js" + }, "engines": { - "node": ">=18.18.0" + "node": ">=4" } }, - "node_modules/icss-replace-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz", - "integrity": "sha512-chIaY3Vh2mh2Q3RGXttaDIzeiPvaVXJ+C4DAh/w3c37SKZ/U6PGMmuicR2EQQp9bKG8zLMCl7I+PtIoOOPp8Gg==", + "node_modules/http-server/node_modules/url-join": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz", + "integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==", + "dev": true + }, + "node_modules/http2-wrapper": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.3.tgz", + "integrity": "sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==", + "dev": true, + "dependencies": { + "quick-lru": "^5.1.1", + "resolve-alpn": "^1.0.0" + }, + "engines": { + "node": ">=10.19.0" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", + "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", + "dev": true, + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/human-signals": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-7.0.0.tgz", + "integrity": "sha512-74kytxOUSvNbjrT9KisAbaTZ/eJwD/LrbM/kh5j0IhPuJzwuA19dWvniFGwBzN9rVjg+O/e+F310PjObDXS+9Q==", + "dev": true, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/icss-replace-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz", + "integrity": "sha512-chIaY3Vh2mh2Q3RGXttaDIzeiPvaVXJ+C4DAh/w3c37SKZ/U6PGMmuicR2EQQp9bKG8zLMCl7I+PtIoOOPp8Gg==", "dev": true }, "node_modules/icss-utils": { @@ -3454,7 +3859,6 @@ "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", "dev": true, - "peer": true, "dependencies": { "es-errors": "^1.3.0", "hasown": "^2.0.0", @@ -3485,7 +3889,6 @@ "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", "dev": true, - "peer": true, "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.2.1" @@ -3501,15 +3904,13 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", - "dev": true, - "peer": true + "dev": true }, "node_modules/is-bigint": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", "dev": true, - "peer": true, "dependencies": { "has-bigints": "^1.0.1" }, @@ -3522,7 +3923,6 @@ "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", "dev": true, - "peer": true, "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -3539,7 +3939,6 @@ "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "dev": true, - "peer": true, "engines": { "node": ">= 0.4" }, @@ -3564,7 +3963,6 @@ "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", "dev": true, - "peer": true, "dependencies": { "is-typed-array": "^1.1.13" }, @@ -3580,7 +3978,6 @@ "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", "dev": true, - "peer": true, "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -3627,7 +4024,6 @@ "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", "dev": true, - "peer": true, "engines": { "node": ">= 0.4" }, @@ -3649,7 +4045,6 @@ "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", "dev": true, - "peer": true, "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -3686,7 +4081,6 @@ "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", "dev": true, - "peer": true, "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -3703,7 +4097,6 @@ "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", "dev": true, - "peer": true, "dependencies": { "call-bind": "^1.0.7" }, @@ -3731,7 +4124,6 @@ "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", "dev": true, - "peer": true, "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -3747,7 +4139,6 @@ "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", "dev": true, - "peer": true, "dependencies": { "has-symbols": "^1.0.2" }, @@ -3763,7 +4154,6 @@ "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", "dev": true, - "peer": true, "dependencies": { "which-typed-array": "^1.1.14" }, @@ -3791,7 +4181,6 @@ "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", "dev": true, - "peer": true, "dependencies": { "call-bind": "^1.0.2" }, @@ -3870,12 +4259,17 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, "node_modules/json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true, - "peer": true + "dev": true }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", @@ -3896,6 +4290,15 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, "node_modules/lilconfig": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.2.tgz", @@ -3920,7 +4323,6 @@ "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==", "dev": true, - "peer": true, "dependencies": { "graceful-fs": "^4.1.2", "parse-json": "^4.0.0", @@ -3936,7 +4338,6 @@ "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", "dev": true, - "peer": true, "dependencies": { "error-ex": "^1.3.1", "json-parse-better-errors": "^1.0.1" @@ -3950,7 +4351,6 @@ "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", "dev": true, - "peer": true, "engines": { "node": ">=4" } @@ -4002,6 +4402,12 @@ "integrity": "sha512-kZzYOKspf8XVX5AvmQF94gQW0lejFVgb80G85bU4ZWzoJ6C03PQg3coYAUpSTpQWelrZELd3XWgHzw4Ck5kaIw==", "dev": true }, + "node_modules/lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==", + "dev": true + }, "node_modules/lodash.escaperegexp": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz", @@ -4038,6 +4444,15 @@ "integrity": "sha512-e/zcLx6CSbmaEgFHCA7BnoQKyCtKMxnuWrJygbwPs/AIn+IMKl66L8/s+wBUn5LRw2pZx3bUHibiV1b6aTWIww==", "dev": true }, + "node_modules/lowercase-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", + "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/lru-cache": { "version": "10.2.2", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz", @@ -4100,6 +4515,15 @@ "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==", "dev": true }, + "node_modules/memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", + "dev": true, + "engines": { + "node": ">= 0.10.0" + } + }, "node_modules/meow": { "version": "13.2.0", "resolved": "https://registry.npmjs.org/meow/-/meow-13.2.0.tgz", @@ -4168,6 +4592,27 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/mimic-response": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/minimist": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", @@ -4177,6 +4622,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -4225,6 +4682,47 @@ "integrity": "sha512-EZSPZB70jiVsivaBLYDCyntd5eH8NTSMOn3rB+HxwdmKThGELLdYv8qVIMWvZEFy9w8ZZpW9h9OB32l1rGtj7g==", "dev": true }, + "node_modules/ngrok": { + "version": "5.0.0-beta.2", + "resolved": "https://registry.npmjs.org/ngrok/-/ngrok-5.0.0-beta.2.tgz", + "integrity": "sha512-UzsyGiJ4yTTQLCQD11k1DQaMwq2/SsztBg2b34zAqcyjS25qjDpogMKPaCKHwe/APRTHeel3iDXcVctk5CNaCQ==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "extract-zip": "^2.0.1", + "got": "^11.8.5", + "lodash.clonedeep": "^4.5.0", + "uuid": "^7.0.0 || ^8.0.0", + "yaml": "^2.2.2" + }, + "bin": { + "ngrok": "bin/ngrok" + }, + "engines": { + "node": ">=14.2" + }, + "optionalDependencies": { + "hpagent": "^0.1.2" + } + }, + "node_modules/ngrok/node_modules/yaml": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.0.tgz", + "integrity": "sha512-2wWLbGbYDiSqqIKoPjar3MPgB94ErzCtrNE1FdqGuaO0pi2JGjmE8aW8TDZwzU7vuxcGRdL/4gPQwQ7hD5AMSw==", + "dev": true, + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, "node_modules/node-emoji": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-2.1.3.tgz", @@ -4436,6 +4934,213 @@ "node": "^18.17.0 || >=20.5.0" } }, + "node_modules/npm-run-all": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz", + "integrity": "sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "chalk": "^2.4.1", + "cross-spawn": "^6.0.5", + "memorystream": "^0.3.1", + "minimatch": "^3.0.4", + "pidtree": "^0.3.0", + "read-pkg": "^3.0.0", + "shell-quote": "^1.6.1", + "string.prototype.padend": "^3.0.0" + }, + "bin": { + "npm-run-all": "bin/npm-run-all/index.js", + "run-p": "bin/run-p/index.js", + "run-s": "bin/run-s/index.js" + }, + "engines": { + "node": ">= 4" + } + }, + "node_modules/npm-run-all/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/npm-run-all/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/npm-run-all/node_modules/cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "dependencies": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "engines": { + "node": ">=4.8" + } + }, + "node_modules/npm-run-all/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "node_modules/npm-run-all/node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/npm-run-all/node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "dependencies": { + "pify": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==", + "dev": true, + "dependencies": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/npm-run-all/node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "dev": true, + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-all/node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-all/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, "node_modules/npm-run-path": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", @@ -4465,6 +5170,7 @@ }, "node_modules/npm/node_modules/@isaacs/cliui": { "version": "8.0.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -4481,6 +5187,7 @@ }, "node_modules/npm/node_modules/@isaacs/cliui/node_modules/ansi-regex": { "version": "6.0.1", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -4492,11 +5199,13 @@ }, "node_modules/npm/node_modules/@isaacs/cliui/node_modules/emoji-regex": { "version": "9.2.2", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/@isaacs/cliui/node_modules/string-width": { "version": "5.1.2", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -4513,6 +5222,7 @@ }, "node_modules/npm/node_modules/@isaacs/cliui/node_modules/strip-ansi": { "version": "7.1.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -4527,11 +5237,13 @@ }, "node_modules/npm/node_modules/@isaacs/string-locale-compare": { "version": "1.1.0", + "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/@npmcli/agent": { "version": "2.2.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -4547,6 +5259,7 @@ }, "node_modules/npm/node_modules/@npmcli/arborist": { "version": "7.5.3", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -4595,6 +5308,7 @@ }, "node_modules/npm/node_modules/@npmcli/config": { "version": "8.3.3", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -4613,6 +5327,7 @@ }, "node_modules/npm/node_modules/@npmcli/fs": { "version": "3.1.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -4624,6 +5339,7 @@ }, "node_modules/npm/node_modules/@npmcli/git": { "version": "5.0.7", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -4642,6 +5358,7 @@ }, "node_modules/npm/node_modules/@npmcli/installed-package-contents": { "version": "2.1.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -4657,6 +5374,7 @@ }, "node_modules/npm/node_modules/@npmcli/map-workspaces": { "version": "3.0.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -4671,6 +5389,7 @@ }, "node_modules/npm/node_modules/@npmcli/metavuln-calculator": { "version": "7.1.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -4686,6 +5405,7 @@ }, "node_modules/npm/node_modules/@npmcli/name-from-folder": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -4694,6 +5414,7 @@ }, "node_modules/npm/node_modules/@npmcli/node-gyp": { "version": "3.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -4702,6 +5423,7 @@ }, "node_modules/npm/node_modules/@npmcli/package-json": { "version": "5.1.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -4719,6 +5441,7 @@ }, "node_modules/npm/node_modules/@npmcli/promise-spawn": { "version": "7.0.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -4730,6 +5453,7 @@ }, "node_modules/npm/node_modules/@npmcli/query": { "version": "3.1.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -4741,6 +5465,7 @@ }, "node_modules/npm/node_modules/@npmcli/redact": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -4749,6 +5474,7 @@ }, "node_modules/npm/node_modules/@npmcli/run-script": { "version": "8.1.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -4765,6 +5491,7 @@ }, "node_modules/npm/node_modules/@pkgjs/parseargs": { "version": "0.11.0", + "dev": true, "inBundle": true, "license": "MIT", "optional": true, @@ -4774,6 +5501,7 @@ }, "node_modules/npm/node_modules/@sigstore/bundle": { "version": "2.3.2", + "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -4785,6 +5513,7 @@ }, "node_modules/npm/node_modules/@sigstore/core": { "version": "1.1.0", + "dev": true, "inBundle": true, "license": "Apache-2.0", "engines": { @@ -4793,6 +5522,7 @@ }, "node_modules/npm/node_modules/@sigstore/protobuf-specs": { "version": "0.3.2", + "dev": true, "inBundle": true, "license": "Apache-2.0", "engines": { @@ -4801,6 +5531,7 @@ }, "node_modules/npm/node_modules/@sigstore/sign": { "version": "2.3.2", + "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -4817,6 +5548,7 @@ }, "node_modules/npm/node_modules/@sigstore/tuf": { "version": "2.3.4", + "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -4829,6 +5561,7 @@ }, "node_modules/npm/node_modules/@sigstore/verify": { "version": "1.2.1", + "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -4842,6 +5575,7 @@ }, "node_modules/npm/node_modules/@tufjs/canonical-json": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -4850,6 +5584,7 @@ }, "node_modules/npm/node_modules/@tufjs/models": { "version": "2.0.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -4862,6 +5597,7 @@ }, "node_modules/npm/node_modules/abbrev": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -4870,6 +5606,7 @@ }, "node_modules/npm/node_modules/agent-base": { "version": "7.1.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -4881,6 +5618,7 @@ }, "node_modules/npm/node_modules/aggregate-error": { "version": "3.1.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -4893,6 +5631,7 @@ }, "node_modules/npm/node_modules/ansi-regex": { "version": "5.0.1", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -4901,6 +5640,7 @@ }, "node_modules/npm/node_modules/ansi-styles": { "version": "6.2.1", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -4912,21 +5652,25 @@ }, "node_modules/npm/node_modules/aproba": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/archy": { "version": "1.0.0", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/balanced-match": { "version": "1.0.2", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/bin-links": { "version": "4.0.4", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -4941,6 +5685,7 @@ }, "node_modules/npm/node_modules/binary-extensions": { "version": "2.3.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -4952,6 +5697,7 @@ }, "node_modules/npm/node_modules/brace-expansion": { "version": "2.0.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -4960,6 +5706,7 @@ }, "node_modules/npm/node_modules/cacache": { "version": "18.0.3", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -4982,6 +5729,7 @@ }, "node_modules/npm/node_modules/chalk": { "version": "5.3.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -4993,6 +5741,7 @@ }, "node_modules/npm/node_modules/chownr": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -5001,6 +5750,7 @@ }, "node_modules/npm/node_modules/ci-info": { "version": "4.0.0", + "dev": true, "funding": [ { "type": "github", @@ -5015,6 +5765,7 @@ }, "node_modules/npm/node_modules/cidr-regex": { "version": "4.1.1", + "dev": true, "inBundle": true, "license": "BSD-2-Clause", "dependencies": { @@ -5026,6 +5777,7 @@ }, "node_modules/npm/node_modules/clean-stack": { "version": "2.2.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -5034,6 +5786,7 @@ }, "node_modules/npm/node_modules/cli-columns": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -5046,6 +5799,7 @@ }, "node_modules/npm/node_modules/cmd-shim": { "version": "6.0.3", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -5054,6 +5808,7 @@ }, "node_modules/npm/node_modules/color-convert": { "version": "2.0.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -5065,16 +5820,19 @@ }, "node_modules/npm/node_modules/color-name": { "version": "1.1.4", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/common-ancestor-path": { "version": "1.0.1", + "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/cross-spawn": { "version": "7.0.3", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -5088,6 +5846,7 @@ }, "node_modules/npm/node_modules/cross-spawn/node_modules/which": { "version": "2.0.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5102,6 +5861,7 @@ }, "node_modules/npm/node_modules/cssesc": { "version": "3.0.0", + "dev": true, "inBundle": true, "license": "MIT", "bin": { @@ -5113,6 +5873,7 @@ }, "node_modules/npm/node_modules/debug": { "version": "4.3.4", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -5129,11 +5890,13 @@ }, "node_modules/npm/node_modules/debug/node_modules/ms": { "version": "2.1.2", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/diff": { "version": "5.2.0", + "dev": true, "inBundle": true, "license": "BSD-3-Clause", "engines": { @@ -5142,16 +5905,19 @@ }, "node_modules/npm/node_modules/eastasianwidth": { "version": "0.2.0", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/emoji-regex": { "version": "8.0.0", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/encoding": { "version": "0.1.13", + "dev": true, "inBundle": true, "license": "MIT", "optional": true, @@ -5161,6 +5927,7 @@ }, "node_modules/npm/node_modules/env-paths": { "version": "2.2.1", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -5169,16 +5936,19 @@ }, "node_modules/npm/node_modules/err-code": { "version": "2.0.3", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/exponential-backoff": { "version": "3.1.1", + "dev": true, "inBundle": true, "license": "Apache-2.0" }, "node_modules/npm/node_modules/fastest-levenshtein": { "version": "1.0.16", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -5187,6 +5957,7 @@ }, "node_modules/npm/node_modules/foreground-child": { "version": "3.1.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5202,6 +5973,7 @@ }, "node_modules/npm/node_modules/fs-minipass": { "version": "3.0.3", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5213,6 +5985,7 @@ }, "node_modules/npm/node_modules/function-bind": { "version": "1.1.2", + "dev": true, "inBundle": true, "license": "MIT", "funding": { @@ -5221,6 +5994,7 @@ }, "node_modules/npm/node_modules/glob": { "version": "10.4.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5242,11 +6016,13 @@ }, "node_modules/npm/node_modules/graceful-fs": { "version": "4.2.11", + "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/hasown": { "version": "2.0.2", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -5258,6 +6034,7 @@ }, "node_modules/npm/node_modules/hosted-git-info": { "version": "7.0.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5269,11 +6046,13 @@ }, "node_modules/npm/node_modules/http-cache-semantics": { "version": "4.1.1", + "dev": true, "inBundle": true, "license": "BSD-2-Clause" }, "node_modules/npm/node_modules/http-proxy-agent": { "version": "7.0.2", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -5286,6 +6065,7 @@ }, "node_modules/npm/node_modules/https-proxy-agent": { "version": "7.0.4", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -5298,6 +6078,7 @@ }, "node_modules/npm/node_modules/iconv-lite": { "version": "0.6.3", + "dev": true, "inBundle": true, "license": "MIT", "optional": true, @@ -5310,6 +6091,7 @@ }, "node_modules/npm/node_modules/ignore-walk": { "version": "6.0.5", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5321,6 +6103,7 @@ }, "node_modules/npm/node_modules/imurmurhash": { "version": "0.1.4", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -5329,6 +6112,7 @@ }, "node_modules/npm/node_modules/indent-string": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -5337,6 +6121,7 @@ }, "node_modules/npm/node_modules/ini": { "version": "4.1.3", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -5345,6 +6130,7 @@ }, "node_modules/npm/node_modules/init-package-json": { "version": "6.0.3", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5362,6 +6148,7 @@ }, "node_modules/npm/node_modules/ip-address": { "version": "9.0.5", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -5374,6 +6161,7 @@ }, "node_modules/npm/node_modules/ip-regex": { "version": "5.0.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -5385,6 +6173,7 @@ }, "node_modules/npm/node_modules/is-cidr": { "version": "5.1.0", + "dev": true, "inBundle": true, "license": "BSD-2-Clause", "dependencies": { @@ -5396,6 +6185,7 @@ }, "node_modules/npm/node_modules/is-core-module": { "version": "2.13.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -5407,6 +6197,7 @@ }, "node_modules/npm/node_modules/is-fullwidth-code-point": { "version": "3.0.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -5415,16 +6206,19 @@ }, "node_modules/npm/node_modules/is-lambda": { "version": "1.0.1", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/isexe": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/jackspeak": { "version": "3.1.2", + "dev": true, "inBundle": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -5442,11 +6236,13 @@ }, "node_modules/npm/node_modules/jsbn": { "version": "1.1.0", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/json-parse-even-better-errors": { "version": "3.0.2", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -5455,6 +6251,7 @@ }, "node_modules/npm/node_modules/json-stringify-nice": { "version": "1.1.4", + "dev": true, "inBundle": true, "license": "ISC", "funding": { @@ -5463,6 +6260,7 @@ }, "node_modules/npm/node_modules/jsonparse": { "version": "1.3.1", + "dev": true, "engines": [ "node >= 0.2.0" ], @@ -5471,16 +6269,19 @@ }, "node_modules/npm/node_modules/just-diff": { "version": "6.0.2", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/just-diff-apply": { "version": "5.5.0", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/libnpmaccess": { "version": "8.0.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5493,6 +6294,7 @@ }, "node_modules/npm/node_modules/libnpmdiff": { "version": "6.1.3", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5511,6 +6313,7 @@ }, "node_modules/npm/node_modules/libnpmexec": { "version": "8.1.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5531,6 +6334,7 @@ }, "node_modules/npm/node_modules/libnpmfund": { "version": "5.0.11", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5542,6 +6346,7 @@ }, "node_modules/npm/node_modules/libnpmhook": { "version": "10.0.5", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5554,6 +6359,7 @@ }, "node_modules/npm/node_modules/libnpmorg": { "version": "6.0.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5566,6 +6372,7 @@ }, "node_modules/npm/node_modules/libnpmpack": { "version": "7.0.3", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5580,6 +6387,7 @@ }, "node_modules/npm/node_modules/libnpmpublish": { "version": "9.0.9", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5598,6 +6406,7 @@ }, "node_modules/npm/node_modules/libnpmsearch": { "version": "7.0.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5609,6 +6418,7 @@ }, "node_modules/npm/node_modules/libnpmteam": { "version": "6.0.5", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5621,6 +6431,7 @@ }, "node_modules/npm/node_modules/libnpmversion": { "version": "6.0.3", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5636,6 +6447,7 @@ }, "node_modules/npm/node_modules/lru-cache": { "version": "10.2.2", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -5644,6 +6456,7 @@ }, "node_modules/npm/node_modules/make-fetch-happen": { "version": "13.0.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5666,6 +6479,7 @@ }, "node_modules/npm/node_modules/minimatch": { "version": "9.0.4", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5680,6 +6494,7 @@ }, "node_modules/npm/node_modules/minipass": { "version": "7.1.2", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -5688,6 +6503,7 @@ }, "node_modules/npm/node_modules/minipass-collect": { "version": "2.0.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5699,6 +6515,7 @@ }, "node_modules/npm/node_modules/minipass-fetch": { "version": "3.0.5", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -5715,6 +6532,7 @@ }, "node_modules/npm/node_modules/minipass-flush": { "version": "1.0.5", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5726,6 +6544,7 @@ }, "node_modules/npm/node_modules/minipass-flush/node_modules/minipass": { "version": "3.3.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5737,6 +6556,7 @@ }, "node_modules/npm/node_modules/minipass-json-stream": { "version": "1.0.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -5746,6 +6566,7 @@ }, "node_modules/npm/node_modules/minipass-json-stream/node_modules/minipass": { "version": "3.3.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5757,6 +6578,7 @@ }, "node_modules/npm/node_modules/minipass-pipeline": { "version": "1.2.4", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5768,6 +6590,7 @@ }, "node_modules/npm/node_modules/minipass-pipeline/node_modules/minipass": { "version": "3.3.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5779,6 +6602,7 @@ }, "node_modules/npm/node_modules/minipass-sized": { "version": "1.0.3", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5790,6 +6614,7 @@ }, "node_modules/npm/node_modules/minipass-sized/node_modules/minipass": { "version": "3.3.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5801,6 +6626,7 @@ }, "node_modules/npm/node_modules/minizlib": { "version": "2.1.2", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -5813,6 +6639,7 @@ }, "node_modules/npm/node_modules/minizlib/node_modules/minipass": { "version": "3.3.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5824,6 +6651,7 @@ }, "node_modules/npm/node_modules/mkdirp": { "version": "1.0.4", + "dev": true, "inBundle": true, "license": "MIT", "bin": { @@ -5835,11 +6663,13 @@ }, "node_modules/npm/node_modules/ms": { "version": "2.1.3", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/mute-stream": { "version": "1.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -5848,6 +6678,7 @@ }, "node_modules/npm/node_modules/negotiator": { "version": "0.6.3", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -5856,6 +6687,7 @@ }, "node_modules/npm/node_modules/node-gyp": { "version": "10.1.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -5879,6 +6711,7 @@ }, "node_modules/npm/node_modules/node-gyp/node_modules/proc-log": { "version": "3.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -5887,6 +6720,7 @@ }, "node_modules/npm/node_modules/nopt": { "version": "7.2.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5901,6 +6735,7 @@ }, "node_modules/npm/node_modules/normalize-package-data": { "version": "6.0.1", + "dev": true, "inBundle": true, "license": "BSD-2-Clause", "dependencies": { @@ -5915,6 +6750,7 @@ }, "node_modules/npm/node_modules/npm-audit-report": { "version": "5.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -5923,6 +6759,7 @@ }, "node_modules/npm/node_modules/npm-bundled": { "version": "3.0.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5934,6 +6771,7 @@ }, "node_modules/npm/node_modules/npm-install-checks": { "version": "6.3.0", + "dev": true, "inBundle": true, "license": "BSD-2-Clause", "dependencies": { @@ -5945,6 +6783,7 @@ }, "node_modules/npm/node_modules/npm-normalize-package-bin": { "version": "3.0.1", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -5953,6 +6792,7 @@ }, "node_modules/npm/node_modules/npm-package-arg": { "version": "11.0.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5967,6 +6807,7 @@ }, "node_modules/npm/node_modules/npm-packlist": { "version": "8.0.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5978,6 +6819,7 @@ }, "node_modules/npm/node_modules/npm-pick-manifest": { "version": "9.0.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -5992,6 +6834,7 @@ }, "node_modules/npm/node_modules/npm-profile": { "version": "10.0.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -6004,6 +6847,7 @@ }, "node_modules/npm/node_modules/npm-registry-fetch": { "version": "17.0.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -6022,6 +6866,7 @@ }, "node_modules/npm/node_modules/npm-user-validate": { "version": "2.0.1", + "dev": true, "inBundle": true, "license": "BSD-2-Clause", "engines": { @@ -6030,6 +6875,7 @@ }, "node_modules/npm/node_modules/p-map": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -6044,6 +6890,7 @@ }, "node_modules/npm/node_modules/pacote": { "version": "18.0.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -6074,6 +6921,7 @@ }, "node_modules/npm/node_modules/parse-conflict-json": { "version": "3.0.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -6087,6 +6935,7 @@ }, "node_modules/npm/node_modules/path-key": { "version": "3.1.1", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -6095,6 +6944,7 @@ }, "node_modules/npm/node_modules/path-scurry": { "version": "1.11.1", + "dev": true, "inBundle": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -6110,6 +6960,7 @@ }, "node_modules/npm/node_modules/postcss-selector-parser": { "version": "6.1.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -6122,6 +6973,7 @@ }, "node_modules/npm/node_modules/proc-log": { "version": "4.2.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -6130,6 +6982,7 @@ }, "node_modules/npm/node_modules/proggy": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -6138,6 +6991,7 @@ }, "node_modules/npm/node_modules/promise-all-reject-late": { "version": "1.0.1", + "dev": true, "inBundle": true, "license": "ISC", "funding": { @@ -6146,6 +7000,7 @@ }, "node_modules/npm/node_modules/promise-call-limit": { "version": "3.0.1", + "dev": true, "inBundle": true, "license": "ISC", "funding": { @@ -6154,11 +7009,13 @@ }, "node_modules/npm/node_modules/promise-inflight": { "version": "1.0.1", + "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/promise-retry": { "version": "2.0.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -6171,6 +7028,7 @@ }, "node_modules/npm/node_modules/promzard": { "version": "1.0.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -6182,6 +7040,7 @@ }, "node_modules/npm/node_modules/qrcode-terminal": { "version": "0.12.0", + "dev": true, "inBundle": true, "bin": { "qrcode-terminal": "bin/qrcode-terminal.js" @@ -6189,6 +7048,7 @@ }, "node_modules/npm/node_modules/read": { "version": "3.0.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -6200,6 +7060,7 @@ }, "node_modules/npm/node_modules/read-cmd-shim": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -6208,6 +7069,7 @@ }, "node_modules/npm/node_modules/read-package-json-fast": { "version": "3.0.2", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -6220,6 +7082,7 @@ }, "node_modules/npm/node_modules/retry": { "version": "0.12.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -6228,12 +7091,14 @@ }, "node_modules/npm/node_modules/safer-buffer": { "version": "2.1.2", + "dev": true, "inBundle": true, "license": "MIT", "optional": true }, "node_modules/npm/node_modules/semver": { "version": "7.6.2", + "dev": true, "inBundle": true, "license": "ISC", "bin": { @@ -6245,6 +7110,7 @@ }, "node_modules/npm/node_modules/shebang-command": { "version": "2.0.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -6256,6 +7122,7 @@ }, "node_modules/npm/node_modules/shebang-regex": { "version": "3.0.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -6264,6 +7131,7 @@ }, "node_modules/npm/node_modules/signal-exit": { "version": "4.1.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -6275,6 +7143,7 @@ }, "node_modules/npm/node_modules/sigstore": { "version": "2.3.1", + "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -6291,6 +7160,7 @@ }, "node_modules/npm/node_modules/smart-buffer": { "version": "4.2.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -6300,6 +7170,7 @@ }, "node_modules/npm/node_modules/socks": { "version": "2.8.3", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -6313,6 +7184,7 @@ }, "node_modules/npm/node_modules/socks-proxy-agent": { "version": "8.0.3", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -6326,6 +7198,7 @@ }, "node_modules/npm/node_modules/spdx-correct": { "version": "3.2.0", + "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -6335,6 +7208,7 @@ }, "node_modules/npm/node_modules/spdx-correct/node_modules/spdx-expression-parse": { "version": "3.0.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -6344,11 +7218,13 @@ }, "node_modules/npm/node_modules/spdx-exceptions": { "version": "2.5.0", + "dev": true, "inBundle": true, "license": "CC-BY-3.0" }, "node_modules/npm/node_modules/spdx-expression-parse": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -6358,16 +7234,19 @@ }, "node_modules/npm/node_modules/spdx-license-ids": { "version": "3.0.18", + "dev": true, "inBundle": true, "license": "CC0-1.0" }, "node_modules/npm/node_modules/sprintf-js": { "version": "1.1.3", + "dev": true, "inBundle": true, "license": "BSD-3-Clause" }, "node_modules/npm/node_modules/ssri": { "version": "10.0.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -6379,6 +7258,7 @@ }, "node_modules/npm/node_modules/string-width": { "version": "4.2.3", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -6393,6 +7273,7 @@ "node_modules/npm/node_modules/string-width-cjs": { "name": "string-width", "version": "4.2.3", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -6406,6 +7287,7 @@ }, "node_modules/npm/node_modules/strip-ansi": { "version": "6.0.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -6418,6 +7300,7 @@ "node_modules/npm/node_modules/strip-ansi-cjs": { "name": "strip-ansi", "version": "6.0.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -6429,6 +7312,7 @@ }, "node_modules/npm/node_modules/supports-color": { "version": "9.4.0", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -6440,6 +7324,7 @@ }, "node_modules/npm/node_modules/tar": { "version": "6.2.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -6456,6 +7341,7 @@ }, "node_modules/npm/node_modules/tar/node_modules/fs-minipass": { "version": "2.1.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -6467,6 +7353,7 @@ }, "node_modules/npm/node_modules/tar/node_modules/fs-minipass/node_modules/minipass": { "version": "3.3.6", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -6478,6 +7365,7 @@ }, "node_modules/npm/node_modules/tar/node_modules/minipass": { "version": "5.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -6486,16 +7374,19 @@ }, "node_modules/npm/node_modules/text-table": { "version": "0.2.0", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/tiny-relative-date": { "version": "1.3.0", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/treeverse": { "version": "3.0.0", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -6504,6 +7395,7 @@ }, "node_modules/npm/node_modules/tuf-js": { "version": "2.2.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -6517,6 +7409,7 @@ }, "node_modules/npm/node_modules/unique-filename": { "version": "3.0.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -6528,6 +7421,7 @@ }, "node_modules/npm/node_modules/unique-slug": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -6539,11 +7433,13 @@ }, "node_modules/npm/node_modules/util-deprecate": { "version": "1.0.2", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/validate-npm-package-license": { "version": "3.0.4", + "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { @@ -6553,6 +7449,7 @@ }, "node_modules/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse": { "version": "3.0.1", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -6562,6 +7459,7 @@ }, "node_modules/npm/node_modules/validate-npm-package-name": { "version": "5.0.1", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -6570,11 +7468,13 @@ }, "node_modules/npm/node_modules/walk-up-path": { "version": "3.0.1", + "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/which": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -6589,6 +7489,7 @@ }, "node_modules/npm/node_modules/which/node_modules/isexe": { "version": "3.1.1", + "dev": true, "inBundle": true, "license": "ISC", "engines": { @@ -6597,6 +7498,7 @@ }, "node_modules/npm/node_modules/wrap-ansi": { "version": "8.1.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -6614,6 +7516,7 @@ "node_modules/npm/node_modules/wrap-ansi-cjs": { "name": "wrap-ansi", "version": "7.0.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -6630,6 +7533,7 @@ }, "node_modules/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { "version": "4.3.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -6644,6 +7548,7 @@ }, "node_modules/npm/node_modules/wrap-ansi/node_modules/ansi-regex": { "version": "6.0.1", + "dev": true, "inBundle": true, "license": "MIT", "engines": { @@ -6655,11 +7560,13 @@ }, "node_modules/npm/node_modules/wrap-ansi/node_modules/emoji-regex": { "version": "9.2.2", + "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/wrap-ansi/node_modules/string-width": { "version": "5.1.2", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -6676,6 +7583,7 @@ }, "node_modules/npm/node_modules/wrap-ansi/node_modules/strip-ansi": { "version": "7.1.0", + "dev": true, "inBundle": true, "license": "MIT", "dependencies": { @@ -6690,6 +7598,7 @@ }, "node_modules/npm/node_modules/write-file-atomic": { "version": "5.0.1", + "dev": true, "inBundle": true, "license": "ISC", "dependencies": { @@ -6702,6 +7611,7 @@ }, "node_modules/npm/node_modules/yallist": { "version": "4.0.0", + "dev": true, "inBundle": true, "license": "ISC" }, @@ -6732,7 +7642,6 @@ "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", "dev": true, - "peer": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -6742,7 +7651,6 @@ "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true, - "peer": true, "engines": { "node": ">= 0.4" } @@ -6752,7 +7660,6 @@ "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", "dev": true, - "peer": true, "dependencies": { "call-bind": "^1.0.5", "define-properties": "^1.2.1", @@ -6766,6 +7673,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, "node_modules/onetime": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", @@ -6782,6 +7698,24 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/opener": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz", + "integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==", + "dev": true, + "bin": { + "opener": "bin/opener-bin.js" + } + }, + "node_modules/p-cancelable": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", + "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/p-each-series": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-3.0.0.tgz", @@ -7017,6 +7951,12 @@ "node": ">=8" } }, + "node_modules/pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", + "dev": true + }, "node_modules/picocolors": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", @@ -7035,6 +7975,18 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pidtree": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.1.tgz", + "integrity": "sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==", + "dev": true, + "bin": { + "pidtree": "bin/pidtree.js" + }, + "engines": { + "node": ">=0.10" + } + }, "node_modules/pify": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/pify/-/pify-5.0.0.tgz", @@ -7061,12 +8013,34 @@ "node": ">=4" } }, + "node_modules/portfinder": { + "version": "1.0.32", + "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.32.tgz", + "integrity": "sha512-on2ZJVVDXRADWE6jnQaX0ioEylzgBpQk8r55NE4wjXW1ZxO+BgDlY6DXwj20i0V8eB4SenDQ00WEaxfiIQPcxg==", + "dev": true, + "dependencies": { + "async": "^2.6.4", + "debug": "^3.2.7", + "mkdirp": "^0.5.6" + }, + "engines": { + "node": ">= 0.12.0" + } + }, + "node_modules/portfinder/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, "node_modules/possible-typed-array-names": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", "dev": true, - "peer": true, "engines": { "node": ">= 0.4" } @@ -7677,6 +8651,31 @@ "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", "dev": true }, + "node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "dev": true, + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -7697,6 +8696,18 @@ } ] }, + "node_modules/quick-lru": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", + "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -7802,7 +8813,6 @@ "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", "dev": true, - "peer": true, "dependencies": { "call-bind": "^1.0.6", "define-properties": "^1.2.1", @@ -7838,6 +8848,12 @@ "node": ">=0.10.0" } }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "dev": true + }, "node_modules/resolve": { "version": "1.22.8", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", @@ -7855,6 +8871,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/resolve-alpn": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", + "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==", + "dev": true + }, "node_modules/resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", @@ -7864,6 +8886,18 @@ "node": ">=8" } }, + "node_modules/responselike": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.1.tgz", + "integrity": "sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==", + "dev": true, + "dependencies": { + "lowercase-keys": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", @@ -8608,7 +9642,6 @@ "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", "dev": true, - "peer": true, "dependencies": { "call-bind": "^1.0.7", "get-intrinsic": "^1.2.4", @@ -8626,8 +9659,7 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "dev": true, - "peer": true + "dev": true }, "node_modules/safe-buffer": { "version": "5.2.1", @@ -8660,7 +9692,6 @@ "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", "dev": true, - "peer": true, "dependencies": { "call-bind": "^1.0.6", "es-errors": "^1.3.0", @@ -8673,6 +9704,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "node_modules/secure-compare": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/secure-compare/-/secure-compare-3.0.1.tgz", + "integrity": "sha512-AckIIV90rPDcBcglUwXPF3kg0P0qmPsPXAj6BBEENQE1p5yA1xfmDJzfi1Tappj37Pv2mVbKpL3Z1T+Nn7k1Qw==", + "dev": true + }, "node_modules/semantic-release": { "version": "24.0.0", "resolved": "https://registry.npmjs.org/semantic-release/-/semantic-release-24.0.0.tgz", @@ -8854,7 +9897,6 @@ "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", "dev": true, - "peer": true, "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", @@ -8872,7 +9914,6 @@ "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", "dev": true, - "peer": true, "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", @@ -8904,12 +9945,20 @@ "node": ">=8" } }, + "node_modules/shell-quote": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", + "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/side-channel": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", "dev": true, - "peer": true, "dependencies": { "call-bind": "^1.0.7", "es-errors": "^1.3.0", @@ -9187,12 +10236,29 @@ "node": ">=8" } }, + "node_modules/string.prototype.padend": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.6.tgz", + "integrity": "sha512-XZpspuSB7vJWhvJc9DLSlrXl1mcA2BdoY5jjnS135ydXqLoqhs96JjDtCkjJEQHvfqZIp9hBuBMgI589peyx9Q==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/string.prototype.trim": { "version": "1.2.9", "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", "dev": true, - "peer": true, "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", @@ -9211,7 +10277,6 @@ "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", "dev": true, - "peer": true, "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", @@ -9226,7 +10291,6 @@ "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", "dev": true, - "peer": true, "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", @@ -9257,7 +10321,6 @@ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "dev": true, - "peer": true, "engines": { "node": ">=4" } @@ -9557,7 +10620,6 @@ "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", "dev": true, - "peer": true, "dependencies": { "call-bind": "^1.0.7", "es-errors": "^1.3.0", @@ -9572,7 +10634,6 @@ "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", "dev": true, - "peer": true, "dependencies": { "call-bind": "^1.0.7", "for-each": "^0.3.3", @@ -9592,7 +10653,6 @@ "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", "dev": true, - "peer": true, "dependencies": { "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.7", @@ -9613,7 +10673,6 @@ "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", "dev": true, - "peer": true, "dependencies": { "call-bind": "^1.0.7", "for-each": "^0.3.3", @@ -9668,7 +10727,6 @@ "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", "dev": true, - "peer": true, "dependencies": { "call-bind": "^1.0.2", "has-bigints": "^1.0.2", @@ -9707,6 +10765,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/union": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/union/-/union-0.5.0.tgz", + "integrity": "sha512-N6uOhuW6zO95P3Mel2I2zMsbsanvvtgn6jVqJv4vbVcz/JN0OkL9suomjQGmWtxJQXOCqUJvquc1sMeNz/IwlA==", + "dev": true, + "dependencies": { + "qs": "^6.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/unique-string": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-3.0.0.tgz", @@ -9782,6 +10852,15 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "dev": true }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", @@ -9882,6 +10961,18 @@ "fsevents": "~2.3.2" } }, + "node_modules/whatwg-encoding": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", + "integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==", + "dev": true, + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -9902,7 +10993,6 @@ "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", "dev": true, - "peer": true, "dependencies": { "is-bigint": "^1.0.1", "is-boolean-object": "^1.1.0", @@ -9919,7 +11009,6 @@ "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", "dev": true, - "peer": true, "dependencies": { "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.7", @@ -9958,6 +11047,12 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, "node_modules/xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", @@ -10016,6 +11111,16 @@ "node": ">=12" } }, + "node_modules/yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", + "dev": true, + "dependencies": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } + }, "node_modules/yoctocolors": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/yoctocolors/-/yoctocolors-2.0.2.tgz", diff --git a/package.json b/package.json index 3c5d2bd..e6aa712 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,10 @@ "scripts": { "dev": "vite", "build": "vite build", - "preview": "vite preview" + "preview": "vite preview", + "serve": "http-server ./dist -p 3456", + "ngrok": "ngrok http 3456", + "test-bundle": "npm run build;npm-run-all --parallel serve ngrok" }, "devDependencies": { "@semantic-release/changelog": "^6.0.3", @@ -20,6 +23,9 @@ "@semantic-release/release-notes-generator": "^14.0.0", "autoprefixer": "^10.4.19", "cssnano": "^7.0.2", + "http-server": "^14.1.1", + "ngrok": "^5.0.0-beta.2", + "npm-run-all": "^4.1.5", "rollup-plugin-postcss": "^4.0.2", "rollup-plugin-terser": "^7.0.2", "vite": "^5.2.13" From 8ff312ca74bad8cacaa3e8572f768e760c1edb55 Mon Sep 17 00:00:00 2001 From: prince-deriv Date: Fri, 6 Sep 2024 10:12:23 +0400 Subject: [PATCH 02/57] chore: required js changes --- package.json | 2 +- src/js/footer/disclaimerAddClassname/index.js | 14 +++-- src/js/footer/dynamicCtaLabels/index.js | 53 +++++++++---------- src/js/footer/hide-deriv-go/index.js | 22 ++++---- src/js/footer/updateUrlAsPerLanguage/index.js | 4 +- 5 files changed, 44 insertions(+), 51 deletions(-) diff --git a/package.json b/package.json index e6aa712..d464c79 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "dev": "vite", "build": "vite build", "preview": "vite preview", - "serve": "http-server ./dist -p 3456", + "serve": "http-server ./dist -p 3456 --cors", "ngrok": "ngrok http 3456", "test-bundle": "npm run build;npm-run-all --parallel serve ngrok" }, diff --git a/src/js/footer/disclaimerAddClassname/index.js b/src/js/footer/disclaimerAddClassname/index.js index 4be9ac3..2b1ad40 100644 --- a/src/js/footer/disclaimerAddClassname/index.js +++ b/src/js/footer/disclaimerAddClassname/index.js @@ -1,9 +1,7 @@ -document.addEventListener("DOMContentLoaded", function () { - var hasBannerDisclaimer = document.querySelector(".banner_disclaimer"); +var hasBannerDisclaimer = document.querySelector(".banner_disclaimer"); - if (hasBannerDisclaimer) { - document.body.classList.add("disclaimer-visible"); - } else { - document.body.classList.remove("disclaimer-visible"); - } -}); +if (hasBannerDisclaimer) { + document.body.classList.add("disclaimer-visible"); +} else { + document.body.classList.remove("disclaimer-visible"); +} diff --git a/src/js/footer/dynamicCtaLabels/index.js b/src/js/footer/dynamicCtaLabels/index.js index c4ba47b..3ccc017 100644 --- a/src/js/footer/dynamicCtaLabels/index.js +++ b/src/js/footer/dynamicCtaLabels/index.js @@ -33,40 +33,39 @@ function useAuthCheck() { document.addEventListener("authStatusChange", callback), }; } -document.addEventListener("DOMContentLoaded", () => { - const authChecker = useAuthCheck(); - // Listen for authentication status changes - authChecker.onAuthStatusChange(() => { - if (authChecker.getAuthCheckedStatus() && authChecker.getLoggedInStatus()) { - const elements_logged_in = document.querySelectorAll(".logged-in-btn"); +const authChecker = useAuthCheck(); - elements_logged_in.forEach((elements_logged_in) => { - elements_logged_in.classList.remove("hide-element"); - }); +// Listen for authentication status changes +authChecker.onAuthStatusChange(() => { + if (authChecker.getAuthCheckedStatus() && authChecker.getLoggedInStatus()) { + const elements_logged_in = document.querySelectorAll(".logged-in-btn"); - const elements_logged_out = document.querySelectorAll(".logged-out-btn"); + elements_logged_in.forEach((elements_logged_in) => { + elements_logged_in.classList.remove("hide-element"); + }); - elements_logged_out.forEach((elements_logged_out) => { - elements_logged_out.classList.add("hide-element"); - }); - } else if ( - authChecker.getAuthCheckedStatus() && - !authChecker.getLoggedInStatus() - ) { - const elements_logged_out = document.querySelectorAll(".logged-out-btn"); + const elements_logged_out = document.querySelectorAll(".logged-out-btn"); - elements_logged_out.forEach((elements_logged_out) => { - elements_logged_out.classList.remove("hide-element"); - }); + elements_logged_out.forEach((elements_logged_out) => { + elements_logged_out.classList.add("hide-element"); + }); + } else if ( + authChecker.getAuthCheckedStatus() && + !authChecker.getLoggedInStatus() + ) { + const elements_logged_out = document.querySelectorAll(".logged-out-btn"); - const elements_logged_in = document.querySelectorAll(".logged-in-btn"); + elements_logged_out.forEach((elements_logged_out) => { + elements_logged_out.classList.remove("hide-element"); + }); - elements_logged_in.forEach((elements_logged_in) => { - elements_logged_in.classList.add("hide-element"); - }); - } - }); + const elements_logged_in = document.querySelectorAll(".logged-in-btn"); + + elements_logged_in.forEach((elements_logged_in) => { + elements_logged_in.classList.add("hide-element"); + }); + } }); //----- end of auth check ----- diff --git a/src/js/footer/hide-deriv-go/index.js b/src/js/footer/hide-deriv-go/index.js index 90447d5..c74faea 100644 --- a/src/js/footer/hide-deriv-go/index.js +++ b/src/js/footer/hide-deriv-go/index.js @@ -5,19 +5,17 @@ function hide_platform(selector) { }); } -document.addEventListener("DOMContentLoaded", () => { - const deriv_go_hide_pages = ["help-centre"]; - const url = window.location.href; +const deriv_go_hide_pages = ["help-centre"]; +const url = window.location.href; - // Check if the current URL matches any item in the deriv_go_hide_pages array - const isHideDerivGo = deriv_go_hide_pages.some((page) => url.includes(page)); +// Check if the current URL matches any item in the deriv_go_hide_pages array +const isHideDerivGo = deriv_go_hide_pages.some((page) => url.includes(page)); - if (isHideDerivGo) { - const url_obj = new URL(url); - const params = url_obj.searchParams; +if (isHideDerivGo) { + const url_obj = new URL(url); + const params = url_obj.searchParams; - if (params.has("platform") && params.get("platform") === "derivgo") { - hide_platform(".derivgo-query-element"); - } + if (params.has("platform") && params.get("platform") === "derivgo") { + hide_platform(".derivgo-query-element"); } -}); +} diff --git a/src/js/footer/updateUrlAsPerLanguage/index.js b/src/js/footer/updateUrlAsPerLanguage/index.js index dd396d5..d159feb 100644 --- a/src/js/footer/updateUrlAsPerLanguage/index.js +++ b/src/js/footer/updateUrlAsPerLanguage/index.js @@ -58,6 +58,4 @@ const updateURLAsPerUserLanguage = () => { } }; -document.addEventListener("DOMContentLoaded", function () { - updateURLAsPerUserLanguage(); -}); +updateURLAsPerUserLanguage(); From 7a04841c717aefe6d6b3efd7ec8a3caae91429ca Mon Sep 17 00:00:00 2001 From: moiz-deriv Date: Mon, 9 Sep 2024 14:47:37 +0800 Subject: [PATCH 03/57] feat: added preloading of traders hub for performance improvements --- src/js/footer/footerComponent/index.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/js/footer/footerComponent/index.js b/src/js/footer/footerComponent/index.js index 6b3ebc0..964b4e2 100644 --- a/src/js/footer/footerComponent/index.js +++ b/src/js/footer/footerComponent/index.js @@ -65,3 +65,12 @@ export default () => { } }); }; +//Pre Load Traders hub login url when user is not logged in +const isLoggedIn = !!getCookieByKey(document.cookie, "client_information"); +if (!isLoggedIn) { + const link = document.createElement("link"); + link.rel = "preload"; + link.href = "https://hub.deriv.com/tradershub/signup"; + link.as = "document"; + document.head.appendChild(link); +} From 6f2f260301013927dde9615ca8ec48cdd8a3c22e Mon Sep 17 00:00:00 2001 From: moiz-deriv Date: Mon, 9 Sep 2024 14:52:21 +0800 Subject: [PATCH 04/57] fix: moved block into domcontentloaded function --- src/js/footer/footerComponent/index.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/js/footer/footerComponent/index.js b/src/js/footer/footerComponent/index.js index 964b4e2..cdd4874 100644 --- a/src/js/footer/footerComponent/index.js +++ b/src/js/footer/footerComponent/index.js @@ -66,11 +66,13 @@ export default () => { }); }; //Pre Load Traders hub login url when user is not logged in -const isLoggedIn = !!getCookieByKey(document.cookie, "client_information"); -if (!isLoggedIn) { - const link = document.createElement("link"); - link.rel = "preload"; - link.href = "https://hub.deriv.com/tradershub/signup"; - link.as = "document"; - document.head.appendChild(link); -} +document.addEventListener("DOMContentLoaded", function () { + const isLoggedIn = !!getCookieByKey(document.cookie, "client_information"); + if (!isLoggedIn) { + const link = document.createElement("link"); + link.rel = "preload"; + link.href = "https://hub.deriv.com/tradershub/signup"; + link.as = "document"; + document.head.appendChild(link); + } +}); From a9865c2405423c66b6d27c25bbeba038099339c4 Mon Sep 17 00:00:00 2001 From: moiz-deriv Date: Mon, 9 Sep 2024 15:32:31 +0800 Subject: [PATCH 05/57] fix:added dyanmic fetching of login url for traders hub --- src/js/footer/footerComponent/index.js | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/js/footer/footerComponent/index.js b/src/js/footer/footerComponent/index.js index cdd4874..f228f3b 100644 --- a/src/js/footer/footerComponent/index.js +++ b/src/js/footer/footerComponent/index.js @@ -71,8 +71,32 @@ document.addEventListener("DOMContentLoaded", function () { if (!isLoggedIn) { const link = document.createElement("link"); link.rel = "preload"; - link.href = "https://hub.deriv.com/tradershub/signup"; + link.href = handleOutSystemsRedirection(); link.as = "document"; document.head.appendChild(link); } }); + +const handleOutSystemsRedirection = () => { + const currentDomain = window.location.hostname; + let env; + if ( + currentDomain === "deriv.com" || + currentDomain === "deriv.be" || + currentDomain === "deriv.me" + ) { + env = "production"; + } else if (currentDomain === "staging.deriv.com") { + env = "staging"; + } else { + env = "development"; + } + switch (env) { + case "production": + return "https://hub.deriv.com/tradershub/signup"; + case "staging": + return "https://staging-hub.deriv.com/tradershub/signup"; + default: + return "https://dev-hub.deriv.com/tradershub/signup"; + } +}; From f40399ce14f54379397906b1aeddb4f154d5e314 Mon Sep 17 00:00:00 2001 From: moiz-deriv Date: Mon, 9 Sep 2024 16:02:51 +0800 Subject: [PATCH 06/57] fix: trigger release --- src/js/footer/footerComponent/index.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/js/footer/footerComponent/index.js b/src/js/footer/footerComponent/index.js index f228f3b..e331bd9 100644 --- a/src/js/footer/footerComponent/index.js +++ b/src/js/footer/footerComponent/index.js @@ -65,7 +65,7 @@ export default () => { } }); }; -//Pre Load Traders hub login url when user is not logged in +//Pre Load Traders hub login url when user is not logged into the platform document.addEventListener("DOMContentLoaded", function () { const isLoggedIn = !!getCookieByKey(document.cookie, "client_information"); if (!isLoggedIn) { @@ -80,11 +80,7 @@ document.addEventListener("DOMContentLoaded", function () { const handleOutSystemsRedirection = () => { const currentDomain = window.location.hostname; let env; - if ( - currentDomain === "deriv.com" || - currentDomain === "deriv.be" || - currentDomain === "deriv.me" - ) { + if (currentDomain === "deriv.com") { env = "production"; } else if (currentDomain === "staging.deriv.com") { env = "staging"; From 66720e74a88e9a51832c052a89985a0b78801c17 Mon Sep 17 00:00:00 2001 From: moiz-deriv Date: Mon, 9 Sep 2024 16:04:04 +0800 Subject: [PATCH 07/57] fix: trigger --- src/js/footer/footerComponent/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/js/footer/footerComponent/index.js b/src/js/footer/footerComponent/index.js index e331bd9..f228f3b 100644 --- a/src/js/footer/footerComponent/index.js +++ b/src/js/footer/footerComponent/index.js @@ -65,7 +65,7 @@ export default () => { } }); }; -//Pre Load Traders hub login url when user is not logged into the platform +//Pre Load Traders hub login url when user is not logged in document.addEventListener("DOMContentLoaded", function () { const isLoggedIn = !!getCookieByKey(document.cookie, "client_information"); if (!isLoggedIn) { @@ -80,7 +80,11 @@ document.addEventListener("DOMContentLoaded", function () { const handleOutSystemsRedirection = () => { const currentDomain = window.location.hostname; let env; - if (currentDomain === "deriv.com") { + if ( + currentDomain === "deriv.com" || + currentDomain === "deriv.be" || + currentDomain === "deriv.me" + ) { env = "production"; } else if (currentDomain === "staging.deriv.com") { env = "staging"; From c86e14317349685d02916f6ed2d9e546ff62a1a3 Mon Sep 17 00:00:00 2001 From: prince-deriv Date: Mon, 9 Sep 2024 12:45:21 +0400 Subject: [PATCH 08/57] fix: indention --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d464c79..c3846e2 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "preview": "vite preview", "serve": "http-server ./dist -p 3456 --cors", "ngrok": "ngrok http 3456", - "test-bundle": "npm run build;npm-run-all --parallel serve ngrok" + "test-bundle": "npm run build; npm-run-all --parallel serve ngrok" }, "devDependencies": { "@semantic-release/changelog": "^6.0.3", From 11be013cc8b7213014b8ebbc8277b29ddce06d1f Mon Sep 17 00:00:00 2001 From: moiz-deriv Date: Tue, 10 Sep 2024 10:43:51 +0800 Subject: [PATCH 09/57] fix: updated link to iframe for tradershub prefetching --- src/js/footer/footerComponent/index.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/js/footer/footerComponent/index.js b/src/js/footer/footerComponent/index.js index f228f3b..96f1649 100644 --- a/src/js/footer/footerComponent/index.js +++ b/src/js/footer/footerComponent/index.js @@ -69,11 +69,13 @@ export default () => { document.addEventListener("DOMContentLoaded", function () { const isLoggedIn = !!getCookieByKey(document.cookie, "client_information"); if (!isLoggedIn) { - const link = document.createElement("link"); - link.rel = "preload"; - link.href = handleOutSystemsRedirection(); - link.as = "document"; - document.head.appendChild(link); + var iframe = document.createElement("iframe"); + iframe.src = handleOutSystemsRedirection(); + iframe.style.display = "none"; + iframe.style.width = "0"; + iframe.style.height = "0"; + iframe.style.border = "none"; + document.body.appendChild(iframe); } }); From 77b2df80ea1e22e5c526adde107e612bd03f0d51 Mon Sep 17 00:00:00 2001 From: moiz-deriv Date: Tue, 10 Sep 2024 10:52:07 +0800 Subject: [PATCH 10/57] fix: added sandbox attribute to iframe --- src/js/footer/footerComponent/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/js/footer/footerComponent/index.js b/src/js/footer/footerComponent/index.js index 96f1649..e4f06fc 100644 --- a/src/js/footer/footerComponent/index.js +++ b/src/js/footer/footerComponent/index.js @@ -75,6 +75,8 @@ document.addEventListener("DOMContentLoaded", function () { iframe.style.width = "0"; iframe.style.height = "0"; iframe.style.border = "none"; + iframe.style.visibility = "hidden"; + iframe.setAttribute("sandbox", "allow-same-origin allow-scripts"); document.body.appendChild(iframe); } }); From 03025c15b874fe6535e28ea06dac1f14aa420677 Mon Sep 17 00:00:00 2001 From: moiz-deriv Date: Tue, 10 Sep 2024 11:04:23 +0800 Subject: [PATCH 11/57] fix: added console for testing --- src/js/footer/footerComponent/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/js/footer/footerComponent/index.js b/src/js/footer/footerComponent/index.js index e4f06fc..7f6765c 100644 --- a/src/js/footer/footerComponent/index.js +++ b/src/js/footer/footerComponent/index.js @@ -77,6 +77,7 @@ document.addEventListener("DOMContentLoaded", function () { iframe.style.border = "none"; iframe.style.visibility = "hidden"; iframe.setAttribute("sandbox", "allow-same-origin allow-scripts"); + console.log("Invoked iframe generation"); document.body.appendChild(iframe); } }); From 213f9330fc58befaa156e069f76a6f425be46dc7 Mon Sep 17 00:00:00 2001 From: moiz-deriv Date: Tue, 10 Sep 2024 11:14:15 +0800 Subject: [PATCH 12/57] fix: moved snippet out of function declaration --- src/js/footer/footerComponent/index.js | 30 ++++++++++++-------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/js/footer/footerComponent/index.js b/src/js/footer/footerComponent/index.js index 7f6765c..c6e8088 100644 --- a/src/js/footer/footerComponent/index.js +++ b/src/js/footer/footerComponent/index.js @@ -66,22 +66,6 @@ export default () => { }); }; //Pre Load Traders hub login url when user is not logged in -document.addEventListener("DOMContentLoaded", function () { - const isLoggedIn = !!getCookieByKey(document.cookie, "client_information"); - if (!isLoggedIn) { - var iframe = document.createElement("iframe"); - iframe.src = handleOutSystemsRedirection(); - iframe.style.display = "none"; - iframe.style.width = "0"; - iframe.style.height = "0"; - iframe.style.border = "none"; - iframe.style.visibility = "hidden"; - iframe.setAttribute("sandbox", "allow-same-origin allow-scripts"); - console.log("Invoked iframe generation"); - document.body.appendChild(iframe); - } -}); - const handleOutSystemsRedirection = () => { const currentDomain = window.location.hostname; let env; @@ -105,3 +89,17 @@ const handleOutSystemsRedirection = () => { return "https://dev-hub.deriv.com/tradershub/signup"; } }; + +const isLoggedIn = !!getCookieByKey(document.cookie, "client_information"); +if (!isLoggedIn) { + var iframe = document.createElement("iframe"); + iframe.src = handleOutSystemsRedirection(); + iframe.style.display = "none"; + iframe.style.width = "0"; + iframe.style.height = "0"; + iframe.style.border = "none"; + iframe.style.visibility = "hidden"; + iframe.setAttribute("sandbox", "allow-same-origin allow-scripts"); + console.log("Invoked iframe generation"); + document.body.appendChild(iframe); +} From 9911a9d00518b1a10d926a1a7fb3f2980b4aa82c Mon Sep 17 00:00:00 2001 From: moiz-deriv Date: Tue, 10 Sep 2024 11:15:54 +0800 Subject: [PATCH 13/57] fix: removed display property for iframe --- src/js/footer/cfdCalculator/index.js | 183 +++++++++++++++++++++++++ src/js/footer/footerComponent/index.js | 1 - 2 files changed, 183 insertions(+), 1 deletion(-) create mode 100644 src/js/footer/cfdCalculator/index.js diff --git a/src/js/footer/cfdCalculator/index.js b/src/js/footer/cfdCalculator/index.js new file mode 100644 index 0000000..d75ab7f --- /dev/null +++ b/src/js/footer/cfdCalculator/index.js @@ -0,0 +1,183 @@ +if (window.location.pathname == "") { + //User Inputs + const volumeInLots = document.getElementById(""); + const assetPrice = document.getElementById(""); + //Display felids to be populated on symbol selection + const contractSize = document.getElementById(""); + const leverage = document.getElementById(""); + const pipSize = document.getElementById(""); + const pointSize = document.getElementById(""); + const threeDaySwap = document.getElementById(""); + const weekendSwap = document.getElementById(""); + const swapLongRate = documeent.getElementById(""); + const swapShortRate = document.getElementById(""); + //Display fields to be calculated on submit + const pipValue = document.getElementById(""); + const tradeVolume = document.getElementById(""); + const swapChargeLong = document.getElementById(""); + const swapChargeShort = document.getElementById(""); + const marginRequired = document.getElementById(""); + //intractable felids + const symbolsField = document.getElementById(""); + const submitBtn = document.getElementById(""); + + const resetBtn = document.getElementById(""); + + resetBtn.addEventListener("click", function () { + volumeInLots.innerHTML = ""; + assetPrice.innerHTML = ""; + contractSize.innerHTML = "-"; + leverage.innerHTML = "-"; + pipSize.innerHTML = "-"; + pointSize.innerHTML = "-"; + marginRequired.innerHTML = "-"; + tradeVolume.innerHTML = "-"; + pipValue.innerHTML = "-"; + swapChargeLong.innerHTML = "-"; + swapChargeShort.innerHTML = "-"; + threeDaySwap.innerHTML = "-"; + weekendSwap.innerHTML = "-"; + swapLongRate.innerHTML = ""; + swapShortRate.innerHTML = ""; + }); + + //Adding event for when symbols dropdown will appear + + symbolsField.addEventListener("change", calculateInitialDisplayFeilds); + + //data holding variables for use in logical functions + let allSymbols = []; + let selectedSymbol = {}; + + submitBtn.addEventListener("click", calculateFields); + + window + .socketMessageSend( + JSON.stringify({ + trading_platform_asset_listing: 1, + platform: "mt5", + account_type: "real", + landing_company_short: "bvi", + market_type: "financial", + server: "p01_ts01", + sub_account_category: "", + sub_account_type: "financial", + requested_fields: ["symbol"], + unique: true, + }), + "trading_platform_asset_listing" + ) + .then((data) => { + allSymbols = data.trading_platform_asset_listing.mt5.assets; + allSymbols.map((symb) => { + let opt = document.createElement("option"); + opt.value = symb.description; + opt.innerHTML = symb.description; + symbolsField.appendChild(opt); + }); + }); + + const filterSymbols = (searchFeild = () => { + const filteredData = allSymbols.filter((item) => { + if (item.description.includes(item)) { + return item; + } + }); + populateSymbol(filterSymbols); + }); + + const populateSymbol = (data) => {}; + + const calculateInitialDisplayFeilds = () => { + const selectSymb + contractSize.innerHTML = selectedSymbol.contract_size; + let pip = 10 ** -selectedSymbol.digits; + pipSize.innerHTML = pip; + pointSize.innerHTML = pip; + leverage.innerHTML = selectedSymbol.effective_leverage_long_at_one; + let weekdays = getActiveWeekdays( + selectedSymbol.swap_rate_per_weekday.slice(1, 6) + ); + let weekends = getActiveWeekEnds([ + selectedSymbol.swap_rate_per_weekday[0], + selectedSymbol.swap_rate_per_weekday[6], + ]); + threeDaySwap.innerHTML = weekdays.length > 0 ? weekdays : "No"; + weekendSwap.innerHTML = weekends.length > 0 ? weekends : "No"; + swapLongRate.innerHTML = selectedSymbol.swap_long_per_lot; + swapShortRate.innerHTML = selectedSymbol.swap_short_per_lot; + }; + + function getActiveWeekdays(weekdaysArray) { + const weekdays = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"]; + const activeDays = weekdaysArray + .map((value, index) => (value > 1 ? weekdays[index] : null)) + .filter((day) => day !== null); + return activeDays.join(", "); + } + + function getActiveWeekEnds(weekEndArray) { + const weekdays = ["Saturday", "Sunday"]; + const activeDays = weekEndArray + .map((value, index) => (value === 1 ? weekdays[index] : null)) + .filter((day) => day !== null); + return activeDays.join(", "); + } + + const calculateFields = () => { + let convertedRate = 0; + window + .socketMessageSend( + JSON.stringify({ + exchange_rates: 1, + base_currency: "USD", + }), + "exchange_rates" + ) + .then((data) => { + convertedRate = + 1 / data.exchange_rates.rates[selectedSymbol.profit_currency]; + let marginVolume = 0; + let margin = + marginVolume / selectedSymbol.effective_leverage_long_at_one; + let tradeVol = + pipSize.value * + volumeInLots * + selectedSymbol.contract_size * + convertedRate; + let swapLong = + volumeInLots * + selectedSymbol.contract_size * + pipSize.value * + selectedSymbol.swap_long_per_lot * + convertedRate; + let swapShort = + volumeInLots * + selectedSymbol.contract_size * + pipSize.value * + selectedSymbol.swap_short_per_lot * + convertedRate; + let pipVal = + pipSize.value * + volumeInLots * + selectedSymbol.contract_size * + convertedRate; + + if (selectedSymbol.calc_mode == "forex") { + marginVolume = + volumeInLots * selectedSymbol.contract_size * convertedRate; + } else { + marginVolume = + volumeInLots * + selectedSymbol.contract_size * + assetPrice * + convertedRate; + } + marginRequired.innerHTML = margin; + pipValue.innerHTML = pipVal; + swapChargeLong.innerHTML = swapLong; + swapChargeShort.innerHTML = swapShort; + tradeVolume.innerHTML = tradeVol; + }); + }; +} diff --git a/src/js/footer/footerComponent/index.js b/src/js/footer/footerComponent/index.js index c6e8088..0810c5c 100644 --- a/src/js/footer/footerComponent/index.js +++ b/src/js/footer/footerComponent/index.js @@ -94,7 +94,6 @@ const isLoggedIn = !!getCookieByKey(document.cookie, "client_information"); if (!isLoggedIn) { var iframe = document.createElement("iframe"); iframe.src = handleOutSystemsRedirection(); - iframe.style.display = "none"; iframe.style.width = "0"; iframe.style.height = "0"; iframe.style.border = "none"; From ab080e57f2de098e0d107125335a769407e71d3a Mon Sep 17 00:00:00 2001 From: moiz-deriv Date: Tue, 10 Sep 2024 11:17:52 +0800 Subject: [PATCH 14/57] fix: removed cfd merge --- src/js/footer/cfdCalculator/index.js | 183 --------------------------- 1 file changed, 183 deletions(-) delete mode 100644 src/js/footer/cfdCalculator/index.js diff --git a/src/js/footer/cfdCalculator/index.js b/src/js/footer/cfdCalculator/index.js deleted file mode 100644 index d75ab7f..0000000 --- a/src/js/footer/cfdCalculator/index.js +++ /dev/null @@ -1,183 +0,0 @@ -if (window.location.pathname == "") { - //User Inputs - const volumeInLots = document.getElementById(""); - const assetPrice = document.getElementById(""); - //Display felids to be populated on symbol selection - const contractSize = document.getElementById(""); - const leverage = document.getElementById(""); - const pipSize = document.getElementById(""); - const pointSize = document.getElementById(""); - const threeDaySwap = document.getElementById(""); - const weekendSwap = document.getElementById(""); - const swapLongRate = documeent.getElementById(""); - const swapShortRate = document.getElementById(""); - //Display fields to be calculated on submit - const pipValue = document.getElementById(""); - const tradeVolume = document.getElementById(""); - const swapChargeLong = document.getElementById(""); - const swapChargeShort = document.getElementById(""); - const marginRequired = document.getElementById(""); - //intractable felids - const symbolsField = document.getElementById(""); - const submitBtn = document.getElementById(""); - - const resetBtn = document.getElementById(""); - - resetBtn.addEventListener("click", function () { - volumeInLots.innerHTML = ""; - assetPrice.innerHTML = ""; - contractSize.innerHTML = "-"; - leverage.innerHTML = "-"; - pipSize.innerHTML = "-"; - pointSize.innerHTML = "-"; - marginRequired.innerHTML = "-"; - tradeVolume.innerHTML = "-"; - pipValue.innerHTML = "-"; - swapChargeLong.innerHTML = "-"; - swapChargeShort.innerHTML = "-"; - threeDaySwap.innerHTML = "-"; - weekendSwap.innerHTML = "-"; - swapLongRate.innerHTML = ""; - swapShortRate.innerHTML = ""; - }); - - //Adding event for when symbols dropdown will appear - - symbolsField.addEventListener("change", calculateInitialDisplayFeilds); - - //data holding variables for use in logical functions - let allSymbols = []; - let selectedSymbol = {}; - - submitBtn.addEventListener("click", calculateFields); - - window - .socketMessageSend( - JSON.stringify({ - trading_platform_asset_listing: 1, - platform: "mt5", - account_type: "real", - landing_company_short: "bvi", - market_type: "financial", - server: "p01_ts01", - sub_account_category: "", - sub_account_type: "financial", - requested_fields: ["symbol"], - unique: true, - }), - "trading_platform_asset_listing" - ) - .then((data) => { - allSymbols = data.trading_platform_asset_listing.mt5.assets; - allSymbols.map((symb) => { - let opt = document.createElement("option"); - opt.value = symb.description; - opt.innerHTML = symb.description; - symbolsField.appendChild(opt); - }); - }); - - const filterSymbols = (searchFeild = () => { - const filteredData = allSymbols.filter((item) => { - if (item.description.includes(item)) { - return item; - } - }); - populateSymbol(filterSymbols); - }); - - const populateSymbol = (data) => {}; - - const calculateInitialDisplayFeilds = () => { - const selectSymb - contractSize.innerHTML = selectedSymbol.contract_size; - let pip = 10 ** -selectedSymbol.digits; - pipSize.innerHTML = pip; - pointSize.innerHTML = pip; - leverage.innerHTML = selectedSymbol.effective_leverage_long_at_one; - let weekdays = getActiveWeekdays( - selectedSymbol.swap_rate_per_weekday.slice(1, 6) - ); - let weekends = getActiveWeekEnds([ - selectedSymbol.swap_rate_per_weekday[0], - selectedSymbol.swap_rate_per_weekday[6], - ]); - threeDaySwap.innerHTML = weekdays.length > 0 ? weekdays : "No"; - weekendSwap.innerHTML = weekends.length > 0 ? weekends : "No"; - swapLongRate.innerHTML = selectedSymbol.swap_long_per_lot; - swapShortRate.innerHTML = selectedSymbol.swap_short_per_lot; - }; - - function getActiveWeekdays(weekdaysArray) { - const weekdays = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"]; - const activeDays = weekdaysArray - .map((value, index) => (value > 1 ? weekdays[index] : null)) - .filter((day) => day !== null); - return activeDays.join(", "); - } - - function getActiveWeekEnds(weekEndArray) { - const weekdays = ["Saturday", "Sunday"]; - const activeDays = weekEndArray - .map((value, index) => (value === 1 ? weekdays[index] : null)) - .filter((day) => day !== null); - return activeDays.join(", "); - } - - const calculateFields = () => { - let convertedRate = 0; - window - .socketMessageSend( - JSON.stringify({ - exchange_rates: 1, - base_currency: "USD", - }), - "exchange_rates" - ) - .then((data) => { - convertedRate = - 1 / data.exchange_rates.rates[selectedSymbol.profit_currency]; - let marginVolume = 0; - let margin = - marginVolume / selectedSymbol.effective_leverage_long_at_one; - let tradeVol = - pipSize.value * - volumeInLots * - selectedSymbol.contract_size * - convertedRate; - let swapLong = - volumeInLots * - selectedSymbol.contract_size * - pipSize.value * - selectedSymbol.swap_long_per_lot * - convertedRate; - let swapShort = - volumeInLots * - selectedSymbol.contract_size * - pipSize.value * - selectedSymbol.swap_short_per_lot * - convertedRate; - let pipVal = - pipSize.value * - volumeInLots * - selectedSymbol.contract_size * - convertedRate; - - if (selectedSymbol.calc_mode == "forex") { - marginVolume = - volumeInLots * selectedSymbol.contract_size * convertedRate; - } else { - marginVolume = - volumeInLots * - selectedSymbol.contract_size * - assetPrice * - convertedRate; - } - marginRequired.innerHTML = margin; - pipValue.innerHTML = pipVal; - swapChargeLong.innerHTML = swapLong; - swapChargeShort.innerHTML = swapShort; - tradeVolume.innerHTML = tradeVol; - }); - }; -} From 3ef4cdda8018e3a5fa341171241ca1f25e239ccf Mon Sep 17 00:00:00 2001 From: moiz-deriv Date: Tue, 10 Sep 2024 11:27:19 +0800 Subject: [PATCH 15/57] fix: removed iframe block --- src/js/footer/footerComponent/index.js | 37 -------------------------- 1 file changed, 37 deletions(-) diff --git a/src/js/footer/footerComponent/index.js b/src/js/footer/footerComponent/index.js index 0810c5c..6b3ebc0 100644 --- a/src/js/footer/footerComponent/index.js +++ b/src/js/footer/footerComponent/index.js @@ -65,40 +65,3 @@ export default () => { } }); }; -//Pre Load Traders hub login url when user is not logged in -const handleOutSystemsRedirection = () => { - const currentDomain = window.location.hostname; - let env; - if ( - currentDomain === "deriv.com" || - currentDomain === "deriv.be" || - currentDomain === "deriv.me" - ) { - env = "production"; - } else if (currentDomain === "staging.deriv.com") { - env = "staging"; - } else { - env = "development"; - } - switch (env) { - case "production": - return "https://hub.deriv.com/tradershub/signup"; - case "staging": - return "https://staging-hub.deriv.com/tradershub/signup"; - default: - return "https://dev-hub.deriv.com/tradershub/signup"; - } -}; - -const isLoggedIn = !!getCookieByKey(document.cookie, "client_information"); -if (!isLoggedIn) { - var iframe = document.createElement("iframe"); - iframe.src = handleOutSystemsRedirection(); - iframe.style.width = "0"; - iframe.style.height = "0"; - iframe.style.border = "none"; - iframe.style.visibility = "hidden"; - iframe.setAttribute("sandbox", "allow-same-origin allow-scripts"); - console.log("Invoked iframe generation"); - document.body.appendChild(iframe); -} From 30e69d41e169c0a1e9e0a9c0ecc69cd07b17a48a Mon Sep 17 00:00:00 2001 From: "Ali(Ako) Hosseini" Date: Tue, 10 Sep 2024 12:51:46 +0800 Subject: [PATCH 16/57] ci: remove webflow subdomain --- .github/actions/publish_website/action.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/actions/publish_website/action.yml b/.github/actions/publish_website/action.yml index e7f546f..cfed17e 100644 --- a/.github/actions/publish_website/action.yml +++ b/.github/actions/publish_website/action.yml @@ -5,10 +5,6 @@ inputs: description: 'Publish to staging.deriv.com' required: true default: 'false' - site_label_webflow: - description: 'Publish to webflow.deriv.com' - required: true - default: 'false' site_label_deriv_com: description: 'Publish to deriv.com' required: true @@ -27,9 +23,6 @@ inputs: staging_site_id: description: 'Staging Site ID' required: true - webflow_site_id: - description: 'Webflow Site ID' - required: true deriv_com_site_id: description: 'Deriv.com Site ID' required: true @@ -59,10 +52,6 @@ runs: SITES_TO_PUBLISH+=("\"staging.deriv.com\"") SITES_DEPLOY_IDS+=("\"${{ inputs.staging_site_id }}\"") fi - if [ "${{ inputs.site_label_webflow }}" == "true" ]; then - SITES_TO_PUBLISH+=("\"webflow.deriv.com\"") - SITES_DEPLOY_IDS+=("\"${{ inputs.webflow_site_id }}\"") - fi if [ "${{ inputs.site_label_deriv_com }}" == "true" ]; then SITES_TO_PUBLISH+=("\"deriv.com\"") SITES_DEPLOY_IDS+=("\"${{ inputs.deriv_com_site_id }}\"") From 119e1dc631bdf27606b548a828358ed2e3a5df4e Mon Sep 17 00:00:00 2001 From: "Ali(Ako) Hosseini" Date: Tue, 10 Sep 2024 12:54:55 +0800 Subject: [PATCH 17/57] ci: remove the webflow domain from workflow --- .github/workflows/publish-website.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/publish-website.yml b/.github/workflows/publish-website.yml index 33cd944..6f818b0 100644 --- a/.github/workflows/publish-website.yml +++ b/.github/workflows/publish-website.yml @@ -7,10 +7,6 @@ on: type: boolean description: "staging.deriv.com" default: false - site_label_webflow: - type: boolean - description: "webflow.deriv.com" - default: false site_label_deriv_com: type: boolean description: "deriv.com" @@ -41,13 +37,11 @@ jobs: uses: ./.github/actions/publish_website with: site_label_staging: ${{ github.event.inputs.site_label_staging }} - site_label_webflow: ${{ github.event.inputs.site_label_webflow }} site_label_deriv_com: ${{ github.event.inputs.site_label_deriv_com }} site_label_deriv_me: ${{ github.event.inputs.site_label_deriv_me }} site_label_deriv_be: ${{ github.event.inputs.site_label_deriv_be }} webflow_api_token: ${{ secrets.WEBFLOW_API_TOKEN }} staging_site_id: ${{ secrets.STAGING_SITE_ID }} - webflow_site_id: ${{ secrets.WEBFLOW_SITE_ID }} deriv_com_site_id: ${{ secrets.DERIV_COM_SITE_ID }} deriv_me_site_id: ${{ secrets.DERIV_ME_SITE_ID }} deriv_be_site_id: ${{ secrets.DERIV_BE_SITE_ID }} @@ -76,7 +70,7 @@ jobs: generate_sitemap_and_robots: runs-on: ubuntu-latest needs: publish_site - if: ${{ needs.publish_site.result == 'success' && (github.event.inputs.site_label_webflow == 'true' || github.event.inputs.site_label_deriv_com == 'true' || github.event.inputs.site_label_deriv_me == 'true' || github.event.inputs.site_label_deriv_be == 'true') }} + if: ${{ needs.publish_site.result == 'success' && ( github.event.inputs.site_label_deriv_com == 'true' || github.event.inputs.site_label_deriv_me == 'true' || github.event.inputs.site_label_deriv_be == 'true') }} steps: - name: Checkout code uses: actions/checkout@v4 From f01e04f57f21e67a977b3d1e82d21b81d3945941 Mon Sep 17 00:00:00 2001 From: moiz-deriv Date: Tue, 10 Sep 2024 15:35:26 +0800 Subject: [PATCH 18/57] fix: added domain key to set cookie function --- src/js/footer/cookies/index.js | 55 ++++++++++++++----------- src/js/footer/partnerAffiliate/index.js | 2 +- 2 files changed, 31 insertions(+), 26 deletions(-) diff --git a/src/js/footer/cookies/index.js b/src/js/footer/cookies/index.js index 9a75518..cb9a065 100644 --- a/src/js/footer/cookies/index.js +++ b/src/js/footer/cookies/index.js @@ -1,33 +1,38 @@ -export function setCookie(name, value, days) { - let expires = ""; - if (days) { - let date = new Date(); - date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); - expires = "; expires=" + date.toUTCString(); - } - document.cookie = name + "=" + (value || "") + expires + "; path=/"; +export function setCookie(name, value, days, domain) { + let expires = ""; + if (days) { + let date = new Date(); + date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000); + expires = "; expires=" + date.toUTCString(); + } + if (domain) { + document.cookie = + name + "=" + (value || "") + expires + `;domain=${domain}` + `;path=/`; + } else { + document.cookie = name + "=" + (value || "") + expires + ";path=/"; + } } export function getCookie(name) { - let cookies = document.cookie.split(';'); - for (let i = 0; i < cookies.length; i++) { - let cookie = cookies[i].trim(); - if (cookie.startsWith(name + '=')) { - return cookie.substring(name.length + 1); - } + let cookies = document.cookie.split(";"); + for (let i = 0; i < cookies.length; i++) { + let cookie = cookies[i].trim(); + if (cookie.startsWith(name + "=")) { + return cookie.substring(name.length + 1); } - return null; + } + return null; } export function getCookieByKey(cookieString, key) { - const cookies = {}; - cookieString.split(';').forEach(cookie => { - const [key, val] = cookie.split('=').map(c => c.trim()); - cookies[key] = decodeURIComponent(val); - }); - return cookies[key]; - }; + const cookies = {}; + cookieString.split(";").forEach((cookie) => { + const [key, val] = cookie.split("=").map((c) => c.trim()); + cookies[key] = decodeURIComponent(val); + }); + return cookies[key]; +} export function setLanguageCookie(language) { - setCookie('webflow-user-language', language, 30); + setCookie("webflow-user-language", language, 30); } export function deleteCookie(name) { - document.cookie = name + '=; Max-Age=-99999999;'; -} \ No newline at end of file + document.cookie = name + "=; Max-Age=-99999999;"; +} diff --git a/src/js/footer/partnerAffiliate/index.js b/src/js/footer/partnerAffiliate/index.js index 49a1b57..7a8515b 100644 --- a/src/js/footer/partnerAffiliate/index.js +++ b/src/js/footer/partnerAffiliate/index.js @@ -8,6 +8,6 @@ if (params.has("referrer") && token != null) { const referrer_token = getCookieByKey(document.cookie, "referrer_token"); if (referrer_token !== token) { deleteCookie("referrer_token"); - setCookie("referrer_token", token, 365); + setCookie("referrer_token", token, 365, ".deriv.com"); } } From a726d63282c4b64b932d6386b2ece77f13ba45d5 Mon Sep 17 00:00:00 2001 From: moiz-deriv Date: Tue, 10 Sep 2024 16:33:39 +0800 Subject: [PATCH 19/57] fix: moved ifram logic to github --- src/js/footer/helper/index.js | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/js/footer/helper/index.js b/src/js/footer/helper/index.js index 5013df7..0d92112 100644 --- a/src/js/footer/helper/index.js +++ b/src/js/footer/helper/index.js @@ -191,3 +191,40 @@ export const loginUrl = () => { } return `${window.getOauthUrl()}/oauth2/authorize?app_id=${getDomainAppID()}&l=${language}&brand=deriv${affiliate_token_link}${cookies_link}&platform=${sub_url}`; }; + +const handleOutSystemsRedirection = () => { + const currentDomain = window.location.hostname; + let env; + if ( + currentDomain === "deriv.com" || + currentDomain === "deriv.be" || + currentDomain === "deriv.me" + ) { + env = "production"; + } else if (currentDomain === "staging.deriv.com") { + env = "staging"; + } else { + env = "development"; + } + switch (env) { + case "production": + return "https://hub.deriv.com/tradershub/signup"; + case "staging": + return "https://staging-hub.deriv.com/tradershub/signup"; + default: + return "https://dev-hub.deriv.com/tradershub/signup"; + } +}; + +const isUserLoggedIn = !!getCookieByKey(document.cookie, "client_information"); +if (!isUserLoggedIn) { + var iframe = document.createElement("iframe"); + iframe.src = handleOutSystemsRedirection(); + iframe.style.width = "0"; + iframe.style.height = "0"; + iframe.style.border = "none"; + iframe.style.visibility = "hidden"; + iframe.setAttribute("sandbox", "allow-same-origin allow-scripts"); + console.log("Invoked iframe generation"); + document.body.appendChild(iframe); +} From 833b2d3896efdcefbe7f360edcc8dbaf386db86b Mon Sep 17 00:00:00 2001 From: moiz-deriv Date: Tue, 10 Sep 2024 17:03:20 +0800 Subject: [PATCH 20/57] fix: temporarily removed iframe --- src/js/footer/helper/index.js | 72 +++++++++++++++++------------------ 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/src/js/footer/helper/index.js b/src/js/footer/helper/index.js index 0d92112..91fd3f1 100644 --- a/src/js/footer/helper/index.js +++ b/src/js/footer/helper/index.js @@ -192,39 +192,39 @@ export const loginUrl = () => { return `${window.getOauthUrl()}/oauth2/authorize?app_id=${getDomainAppID()}&l=${language}&brand=deriv${affiliate_token_link}${cookies_link}&platform=${sub_url}`; }; -const handleOutSystemsRedirection = () => { - const currentDomain = window.location.hostname; - let env; - if ( - currentDomain === "deriv.com" || - currentDomain === "deriv.be" || - currentDomain === "deriv.me" - ) { - env = "production"; - } else if (currentDomain === "staging.deriv.com") { - env = "staging"; - } else { - env = "development"; - } - switch (env) { - case "production": - return "https://hub.deriv.com/tradershub/signup"; - case "staging": - return "https://staging-hub.deriv.com/tradershub/signup"; - default: - return "https://dev-hub.deriv.com/tradershub/signup"; - } -}; - -const isUserLoggedIn = !!getCookieByKey(document.cookie, "client_information"); -if (!isUserLoggedIn) { - var iframe = document.createElement("iframe"); - iframe.src = handleOutSystemsRedirection(); - iframe.style.width = "0"; - iframe.style.height = "0"; - iframe.style.border = "none"; - iframe.style.visibility = "hidden"; - iframe.setAttribute("sandbox", "allow-same-origin allow-scripts"); - console.log("Invoked iframe generation"); - document.body.appendChild(iframe); -} +// const handleOutSystemsRedirection = () => { +// const currentDomain = window.location.hostname; +// let env; +// if ( +// currentDomain === "deriv.com" || +// currentDomain === "deriv.be" || +// currentDomain === "deriv.me" +// ) { +// env = "production"; +// } else if (currentDomain === "staging.deriv.com") { +// env = "staging"; +// } else { +// env = "development"; +// } +// switch (env) { +// case "production": +// return "https://hub.deriv.com/tradershub/signup"; +// case "staging": +// return "https://staging-hub.deriv.com/tradershub/signup"; +// default: +// return "https://dev-hub.deriv.com/tradershub/signup"; +// } +// }; + +// const isUserLoggedIn = !!getCookieByKey(document.cookie, "client_information"); +// if (!isUserLoggedIn) { +// var iframe = document.createElement("iframe"); +// iframe.src = handleOutSystemsRedirection(); +// iframe.style.width = "0"; +// iframe.style.height = "0"; +// iframe.style.border = "none"; +// iframe.style.visibility = "hidden"; +// iframe.setAttribute("sandbox", "allow-same-origin allow-scripts"); +// console.log("Invoked iframe generation"); +// document.body.appendChild(iframe); +// } From fcfb387f8a5984e01c371254b7391a1bbaef197c Mon Sep 17 00:00:00 2001 From: moiz-deriv Date: Wed, 11 Sep 2024 11:12:49 +0800 Subject: [PATCH 21/57] fix: readded ifram post release --- src/js/footer/helper/index.js | 72 +++++++++++++++++------------------ 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/src/js/footer/helper/index.js b/src/js/footer/helper/index.js index 91fd3f1..0d92112 100644 --- a/src/js/footer/helper/index.js +++ b/src/js/footer/helper/index.js @@ -192,39 +192,39 @@ export const loginUrl = () => { return `${window.getOauthUrl()}/oauth2/authorize?app_id=${getDomainAppID()}&l=${language}&brand=deriv${affiliate_token_link}${cookies_link}&platform=${sub_url}`; }; -// const handleOutSystemsRedirection = () => { -// const currentDomain = window.location.hostname; -// let env; -// if ( -// currentDomain === "deriv.com" || -// currentDomain === "deriv.be" || -// currentDomain === "deriv.me" -// ) { -// env = "production"; -// } else if (currentDomain === "staging.deriv.com") { -// env = "staging"; -// } else { -// env = "development"; -// } -// switch (env) { -// case "production": -// return "https://hub.deriv.com/tradershub/signup"; -// case "staging": -// return "https://staging-hub.deriv.com/tradershub/signup"; -// default: -// return "https://dev-hub.deriv.com/tradershub/signup"; -// } -// }; - -// const isUserLoggedIn = !!getCookieByKey(document.cookie, "client_information"); -// if (!isUserLoggedIn) { -// var iframe = document.createElement("iframe"); -// iframe.src = handleOutSystemsRedirection(); -// iframe.style.width = "0"; -// iframe.style.height = "0"; -// iframe.style.border = "none"; -// iframe.style.visibility = "hidden"; -// iframe.setAttribute("sandbox", "allow-same-origin allow-scripts"); -// console.log("Invoked iframe generation"); -// document.body.appendChild(iframe); -// } +const handleOutSystemsRedirection = () => { + const currentDomain = window.location.hostname; + let env; + if ( + currentDomain === "deriv.com" || + currentDomain === "deriv.be" || + currentDomain === "deriv.me" + ) { + env = "production"; + } else if (currentDomain === "staging.deriv.com") { + env = "staging"; + } else { + env = "development"; + } + switch (env) { + case "production": + return "https://hub.deriv.com/tradershub/signup"; + case "staging": + return "https://staging-hub.deriv.com/tradershub/signup"; + default: + return "https://dev-hub.deriv.com/tradershub/signup"; + } +}; + +const isUserLoggedIn = !!getCookieByKey(document.cookie, "client_information"); +if (!isUserLoggedIn) { + var iframe = document.createElement("iframe"); + iframe.src = handleOutSystemsRedirection(); + iframe.style.width = "0"; + iframe.style.height = "0"; + iframe.style.border = "none"; + iframe.style.visibility = "hidden"; + iframe.setAttribute("sandbox", "allow-same-origin allow-scripts"); + console.log("Invoked iframe generation"); + document.body.appendChild(iframe); +} From b8f8d4074903b6f58ca239df4180523be19f09a9 Mon Sep 17 00:00:00 2001 From: moiz-deriv Date: Wed, 11 Sep 2024 11:14:21 +0800 Subject: [PATCH 22/57] fix: removed console.log --- src/js/footer/helper/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/js/footer/helper/index.js b/src/js/footer/helper/index.js index 0d92112..67dee73 100644 --- a/src/js/footer/helper/index.js +++ b/src/js/footer/helper/index.js @@ -225,6 +225,5 @@ if (!isUserLoggedIn) { iframe.style.border = "none"; iframe.style.visibility = "hidden"; iframe.setAttribute("sandbox", "allow-same-origin allow-scripts"); - console.log("Invoked iframe generation"); document.body.appendChild(iframe); } From ed22f04c31f24b74cdd362982776cdc27850a607 Mon Sep 17 00:00:00 2001 From: moiz-deriv Date: Wed, 11 Sep 2024 13:38:04 +0800 Subject: [PATCH 23/57] fix: modified sitemap updater to remove all urls that contain eu --- .github/modify_sitemap.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/modify_sitemap.js b/.github/modify_sitemap.js index 7394613..80a8978 100644 --- a/.github/modify_sitemap.js +++ b/.github/modify_sitemap.js @@ -34,7 +34,7 @@ fs.readFile(inputFile, "utf8", (err, data) => { const urlBlockPattern = /([\s\S]*?<\/url>)/g; let filteredContent = newContent.replace(urlBlockPattern, (match) => { - if (/https:\/\/deriv\.com\/eu\//.test(match)) { + if (/https:\/\/deriv\.com.*\/eu\//.test(match)) { return ""; } return match; From 9dd88270d4f850ca9365a6642c932d3d207dc09a Mon Sep 17 00:00:00 2001 From: moiz-deriv Date: Wed, 11 Sep 2024 14:42:32 +0800 Subject: [PATCH 24/57] fix: Update .github/modify_sitemap.js Co-authored-by: Ali(Ako) Hosseini --- .github/modify_sitemap.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/modify_sitemap.js b/.github/modify_sitemap.js index 80a8978..5b22b4d 100644 --- a/.github/modify_sitemap.js +++ b/.github/modify_sitemap.js @@ -34,7 +34,7 @@ fs.readFile(inputFile, "utf8", (err, data) => { const urlBlockPattern = /([\s\S]*?<\/url>)/g; let filteredContent = newContent.replace(urlBlockPattern, (match) => { - if (/https:\/\/deriv\.com.*\/eu\//.test(match)) { + if (/https:\/\/deriv\.com(\/[a-z-]{2,5})?\/eu\//.test(match)) { return ""; } return match; From 4de74ccfa2719c48050271313588e6cdc6452da7 Mon Sep 17 00:00:00 2001 From: Prince Date: Mon, 16 Sep 2024 18:24:04 +0400 Subject: [PATCH 25/57] chore: custom script static --- package.json | 6 +- src/js/footer/index.js | 1 + src/js/footer/test.js | 327 +++++++++++++++++++++++++++++++++++++++++ src/temp-static.js | 1 + 4 files changed, 332 insertions(+), 3 deletions(-) create mode 100644 src/js/footer/test.js create mode 100644 src/temp-static.js diff --git a/package.json b/package.json index c3846e2..b378c27 100644 --- a/package.json +++ b/package.json @@ -12,9 +12,9 @@ "dev": "vite", "build": "vite build", "preview": "vite preview", - "serve": "http-server ./dist -p 3456 --cors", + "serve": "npm run build && http-server ./dist -p 3456 --cors", "ngrok": "ngrok http 3456", - "test-bundle": "npm run build; npm-run-all --parallel serve ngrok" + "ngrok-auth": "ngrok config add-authtoken $NGROK_TOKEN" }, "devDependencies": { "@semantic-release/changelog": "^6.0.3", @@ -30,4 +30,4 @@ "rollup-plugin-terser": "^7.0.2", "vite": "^5.2.13" } -} +} \ No newline at end of file diff --git a/src/js/footer/index.js b/src/js/footer/index.js index 25b2573..95cc809 100644 --- a/src/js/footer/index.js +++ b/src/js/footer/index.js @@ -16,3 +16,4 @@ import "./disclaimerAddClassname"; import "./mobileMenuAccordian"; import "./partnerAffiliate"; import "./loginFunctions"; +import "./test.js" \ No newline at end of file diff --git a/src/js/footer/test.js b/src/js/footer/test.js new file mode 100644 index 0000000..21257f5 --- /dev/null +++ b/src/js/footer/test.js @@ -0,0 +1,327 @@ +alert('test-2') + + + +// Listen for DOMContentLoaded event + +const clientsCountry = window.getClientCountry(); + +const getDateFirstContact = () => { + const dateFirstContactString = window.parseCookies( + document.cookie, + "date_first_contact" + ); + if (dateFirstContactString) { + const parsedData = JSON.parse(dateFirstContactString); + return parsedData.date_first_contact + ? { date_first_contact: parsedData.date_first_contact } + : null; + } + return null; +}; + +const getSignupDevice = () => { + const signupDeviceString = window.parseCookies( + document.cookie, + "signup_device" + ); + if (signupDeviceString) { + const parsedData = JSON.parse(signupDeviceString); + return parsedData.signup_device + ? { signup_device: parsedData.signup_device } + : null; + } + return null; +}; + +const lang = window.parseCookies(document.cookie, "webflow-user-language"); + +const countriesToRedirect = [ + "as", + "au", + "at", + "be", + "bg", + "ca", + "hr", + "cy", + "cz", + "dk", + "ee", + "fi", + "fr", + "gr", + "gu", + "gg", + "hk", + "hu", + "ir", + "ie", + "im", + "il", + "it", + "je", + "ng", + "mm", + "sy", + "kp", + "lv", + "lt", + "lu", + "my", + "mt", + "nl", + "nz", + "mp", + "py", + "pl", + "pt", + "pr", + "ro", + "rw", + "sk", + "si", + "es", + "se", + "ae", + "gb", + "us", + "um", + "vu", + "vi", + "ky", + "cu", + "de", +]; + +if ( + window.location.pathname.endsWith("p2p") && + !window.location.pathname.startsWith("/blog") +) { + const clientsCountry = window.getClientCountry(); + if (clientsCountry && countriesToRedirect.includes(clientsCountry)) { + if (lang === "en") { + window.location.replace("/404"); + } else { + window.location.replace(`/${lang}/404`); + } + } +} + +if ( + window.parseCookies(document.cookie, "client_information") !== undefined +) { + let purchaseButtons = document.querySelectorAll( + "a.live-markets_button.is-secondary.is-small.is-purchase.w-button" + ); + + let sellButtons = document.querySelectorAll( + "a.live-markets_button.is-secondary.is-small.is-sell.w-button" + ); + + function updateHref(buttons) { + buttons.forEach((button) => { + button.href = "https://app.deriv.com/appstore/traders-hub"; + }); + } + + updateHref(purchaseButtons); + updateHref(sellButtons); +} + +//live chat button hide on menu appear +const mobileMenu = document.getElementById("mobile-menu"); +const liveChatWrapper = document.getElementById("live_chat-wrapper"); + +let isLiveChatVisible = true; +let isLiveChatActivated = false; + +function fadeIn(element) { + var opacity = 0; + var timer = setInterval(function () { + if (opacity >= 1) { + clearInterval(timer); + } + element.style.opacity = opacity; + opacity += 0.1; + }, 30); +} + +function fadeOut(element) { + var opacity = 1; + var timer = setInterval(function () { + if (opacity <= 0) { + clearInterval(timer); + element.style.display = "none"; + } + element.style.opacity = opacity; + opacity -= 0.1; + }, 30); +} + + + +// + +const licenceKey = "12049137"; +const loadLiveChatScript = () => { + window.__lc = window.__lc || {}; + window.__lc.license = licenceKey; + window.LC_API = window.LC_API || { loaded: false }; + if (!window.LC_API.loaded) { + const lcScript = document.createElement("script"); + lcScript.async = true; + lcScript.src = "https://cdn.livechatinc.com/tracking.js"; + lcScript.onload = () => { + window.LC_API.loaded = true; // Mark as loaded + window.LC_API.on_after_load = function () { + performLiveChatAction( + !!window.parseCookies(document.cookie, "client_information") + ); + checkUrlForLiveChat(); + }; + if (typeof LiveChatWidget !== "undefined" && LiveChatWidget.init) { + LiveChatWidget.init(); + } + }; + document.body.appendChild(lcScript); + } else { + checkUrlForLiveChat(); + } +}; +const openLiveChat = () => { + if (window.LC_API && window.LC_API.open_chat_window) { + window.LC_API.open_chat_window(); + } +}; +const checkUrlForLiveChat = () => { + const urlParams = new URLSearchParams(window.location.search); + if (urlParams.get("is_livechat_open") === "true") { + openLiveChat(); + } +}; + +//dashboard send data +const performLiveChatAction = (is_logged_in) => { + window?.LiveChatWidget?.on("ready", () => { + // we open and close the window to trigger the widget to listen for new events + window.LC_API.open_chat_window(); + window.LC_API.hide_chat_window(); + checkUrlForLiveChat(); + + const utm_data_string = window.parseCookies(document.cookie, "utm_data"); + const utm_data = utm_data_string ? JSON.parse(utm_data_string) : {}; + const { utm_source, utm_medium, utm_campaign } = utm_data; + + const client_information = window.parseCookies( + document.cookie, + "client_information" + ); + const url_params = new URLSearchParams(window.location.search); + + const { + loginid, + email, + landing_company_shortcode, + currency, + residence, + first_name, + last_name, + } = client_information ? JSON.parse(client_information) : {}; + + /* the session variables are sent to CS team dashboard to notify user has logged in + and also acts as custom variables to trigger targeted engagement */ + const session_variables = { + is_logged_in: is_logged_in, + loginid: loginid ?? "", + landing_company_shortcode: landing_company_shortcode ?? "", + currency: currency ?? "", + residence: residence ?? "", + email: email ?? "", + platform: url_params.get("platform") ?? "", + utm_source: utm_source ?? "", + utm_medium: utm_medium ?? "", + utm_campaign: utm_campaign ?? "", + }; + + window.LiveChatWidget.call("set_session_variables", session_variables); + + if (is_logged_in) { + if (email) { + window.LiveChatWidget.call("set_customer_email", email); + } + if (first_name && last_name) { + window.LiveChatWidget.call( + "set_customer_name", + `${first_name} ${last_name}` + ); + } + } else { + // clear name and email fields after chat has ended + window.LC_API.on_chat_ended = () => { + window.LiveChatWidget.call("set_customer_email", " "); + window.LiveChatWidget.call("set_customer_name", " "); + }; + } + checkUrlForLiveChat(); + + // open chat widget when there is an incoming greeting/announcement + window.LiveChatWidget.on("new_event", (event) => { + if (event.greeting) { + window.LC_API.open_chat_window(); + } + }); + }); +}; +let is_logged_in = false; +let checkCookieInterval; + +const isLoggedIn = () => { + return !!window.parseCookies(document.cookie, "client_information"); +}; + +const checkLoggedIn = () => { + const new_login_status = isLoggedIn(); + if (new_login_status !== is_logged_in) { + performLiveChatAction(new_login_status); + is_logged_in = new_login_status; + } +}; + +// Perform initial authentication check +checkLoggedIn(); + +// Set interval to periodically check authentication status +checkCookieInterval = setInterval(checkLoggedIn, 2000); +//end of dashboard send data + + +loadLiveChatScript(); +const liveChatIcons = document.querySelectorAll(".livechatbtn"); +if (liveChatIcons.length > 0) { + liveChatIcons.forEach((liveChatIcon) => { + liveChatIcon.addEventListener("click", (event) => { + event.preventDefault(); + openLiveChat(); + }); + }); +} +const liveChatIconById = document.getElementById("liveChatBtn"); +if (liveChatIconById) { + liveChatIconById.addEventListener("click", (event) => { + event.preventDefault(); + openLiveChat(); + }); +} +const liveChatIconsByrel = document.querySelectorAll( + 'a[rel="liveChatBtn"]' +); +liveChatIconsByrel.forEach((liveChatIcon) => { + liveChatIcon?.addEventListener("click", (event) => { + event.preventDefault(); + openLiveChat(); + }); +}); + + +// \ No newline at end of file diff --git a/src/temp-static.js b/src/temp-static.js new file mode 100644 index 0000000..614cff1 --- /dev/null +++ b/src/temp-static.js @@ -0,0 +1 @@ +import{initializeApp as e}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-app.js";import{getDatabase as o,ref as n,onValue as i}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-database.js";function a(e,o,n,i){let a="";if(n){let e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),a="; expires="+e.toUTCString()}document.cookie=i?e+"="+(o||"")+a+`;domain=${i};path=/`:e+"="+(o||"")+a+";path=/"}function t(e,o){const n={};return e.split(";").forEach((e=>{const[o,i]=e.split("=").map((e=>e.trim()));n[o]=decodeURIComponent(i)})),n[o]}function r(e){a("webflow-user-language",e,30)}function d(e){document.cookie=e+"=; Max-Age=-99999999;"}window.emailRegex=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,window.toggleErrorField=(e,o)=>{o?e.classList.remove("error-field"):e.classList.add("error-field")},window.disableButton=function(e){e.disabled=!0,e.style.opacity="0.5"},window.isEuRegion=function(e){const o=e.replace(/\/$/,"");return/^\/(?:[^\/]+\/)?eu(?:\/|$)/.test(o)},window.enableButton=function(e){e.disabled=!1,e.style.opacity="1"},window.getOauthUrl=function(){var e=window.location.href,o=new URL(e).hostname,n=["deriv.com","deriv.be","deriv.me"].find((e=>o.endsWith(e)));return n?`https://oauth.${n}`:"https://oauth.deriv.com"},window.getClientCountry=function(){var e;const o=t(document.cookie,"clients_country"),n=t(document.cookie,"client_information");return n&&(null==(e=JSON.parse(n))?void 0:e.residence)||o},window.deriv_com_url="deriv.com",window.deriv_me_url="deriv.me",window.deriv_be_url="deriv.be",window.webflow_domain="webflow.deriv.com",window.staging_url="staging.deriv.com",window.staging_deriv_be_url="staging.deriv.be",window.domain_list_app_id={[window.deriv_com_url]:"16929",[window.deriv_me_url]:"1411",[window.deriv_be_url]:"30767",[window.webflow_domain]:"53503",[window.staging_url]:"16303"},window.getDomain=()=>{var e=window.location.href;return new URL(e).hostname},window.getAppId=()=>{const e=window.getDomain(),o=new URLSearchParams(window.location.search||"").get("app_id");if(o)return o;const n=localStorage.getItem("config.app_id");if(n)return n;const i={[window.webflow_domain]:window.domain_list_app_id[window.webflow_domain],[window.deriv_be_url]:window.domain_list_app_id[window.deriv_be_url],[window.deriv_me_url]:window.domain_list_app_id[window.deriv_me_url],[window.staging_url]:window.domain_list_app_id[window.staging_url]};return i[e]?i[e]:window.domain_list_app_id[window.deriv_com_url]};const s=()=>{const e=localStorage.getItem("config.server_url"),o=t(document.cookie,"webflow-user-language");let n=o?o.toLowerCase():"en";"zh-cn"!==n&&"zh-tw"!==n||(n=n.replace("-","_"));const i=(e=>{let o="";return e&&Object.keys(e).forEach((n=>{o+=`&${n}=${e[n]}`})),o})((()=>{const e=t(document.cookie,"utm_data");if(e){const o=JSON.parse(e),n={};return["utm_source","utm_ad_id","utm_adgroup_id","utm_adrollclk_id","utm_campaign","utm_campaign_id","utm_content","utm_fbcl_id","utm_gl_client_id","utm_medium","utm_msclk_id","utm_term"].forEach((e=>{o.hasOwnProperty(e)&&(n[e]=o[e])})),n}return null})()),a=t(document.cookie,"affiliate_tracking"),r=a?`&affiliate_token=${a}`:"",d=void["mt5","bot","derivx"].filter((e=>window.location.pathname.includes(e)&&e))||"";return e&&/qa/.test(e)?`https://${e}/oauth2/authorize?app_id=${window.getAppId()}&l=${n}&brand=deriv${r}${i}&platform=${d}`:`${window.getOauthUrl()}/oauth2/authorize?app_id=${(()=>{const e=window.getDomain();return e===window.deriv_me_url?window.domain_list_app_id[window.deriv_me_url]:e===window.deriv_be_url?window.domain_list_app_id[window.deriv_be_url]:e===window.webflow_domain?window.domain_list_app_id[window.webflow_domain]:window.domain_list_app_id[window.deriv_com_url]})()}&l=${n}&brand=deriv${r}${i}&platform=${d}`};if(!!!t(document.cookie,"client_information")){var c=document.createElement("iframe");c.src=(()=>{const e=window.location.hostname;let o;switch(o="deriv.com"===e||"deriv.be"===e||"deriv.me"===e?"production":"staging.deriv.com"===e?"staging":"development",o){case"production":return"https://hub.deriv.com/tradershub/signup";case"staging":return"https://staging-hub.deriv.com/tradershub/signup";default:return"https://dev-hub.deriv.com/tradershub/signup"}})(),c.style.width="0",c.style.height="0",c.style.border="none",c.style.visibility="hidden",c.setAttribute("sandbox","allow-same-origin allow-scripts"),document.body.appendChild(c)}window.establishWebSocketConnection=()=>new Promise(((e,o)=>{const n=t(document.cookie,"webflow-user-language"),i=n?n.toLowerCase():"en",a=localStorage.getItem("config.server_url")||"green.derivws.com";window.websocket=new WebSocket(`wss://${a}/websockets/v3?app_id=${window.getAppId()}&l=${i||"en"}&brand=deriv`),window.websocket.addEventListener("open",(o=>{window.websocket.addEventListener("close",(()=>{window.websocket.close()})),window.websocket.addEventListener("message",(e=>{JSON.parse(e.data)})),e(window.websocket)})),window.websocket.addEventListener("error",(e=>{var n;null==(n=null==window?void 0:window.websocket)||n.close(),o(e)}))})),window.socketMessageSend=async(e,o)=>{var n;try{return(null==window?void 0:window.websocket)&&(null==(n=null==window?void 0:window.websocket)?void 0:n.readyState)===(null==WebSocket?void 0:WebSocket.OPEN)?(window.websocket.send(e),new Promise(((e,n)=>{window.websocket.addEventListener("message",(i=>{const a=JSON.parse(i.data);o===a.msg_type&&(a.error?n(a.error):e(a))}))}))):establishWebSocketConnection().then((()=>(websocket.send(e),new Promise(((e,n)=>{websocket.addEventListener("message",(i=>{const a=JSON.parse(i.data);o===a.msg_type&&(a.error?n(a.error):e(a))}))}))))).catch((e=>Promise.reject(e)))}catch(i){return Promise.reject(i)}};const u=[{id:"appgallery",selectors:[".footer_banner-badge.gallery.w-inline-block",".app-download_link-wrapper.appgallery.w-inline-block"],countries:["af","ax","al","dz","as","ad","ao","aq","am","au","at","az","bh","bd","by","be","bj","bm","bt","bo","ba","bw","bv","br","io","bn","bg","bf","bi","kh","cm","ca","cv","bq","cf","td","cn","cx","cc","km","cg","cd","ck","ci","hr","cu","cw","cy","cz","dk","dj","dm","eg","gq","er","ee","et","fk","fo","fj","fi","fr","pf","tf","ga","gm","ge","de","gh","gi","gr","gl","gu","gg","gn","gw","hm","va","hu","is","in","id","ir","iq","ie","im","il","it","jp","je","jo","kz","ke","ki","kr","kp","kw","kg","la","lv","lb","ls","lr","ly","li","lt","lu","mo","mk","mg","mw","my","mv","ml","mt","mh","mr","mu","yt","mx","fm","md","mc","mn","me","ma","mz","mm","na","nr","np","nl","nc","nz","ne","ng","nu","nf","mp","no","om","pk","pw","ps","pg","pe","ph","pn","pl","pt","qa","re","ro","ru","rw","sh","kn","pm","bl","mf","ws","sm","st","sa","sn","rs","sc","sl","sg","sx","sk","si","sb","so","gs","ss","es","lk","sd","sj","sz","se","ch","sy","tw","tj","tz","th","tl","tg","tk","to","tn","tr","tm","tc","tv","ug","ua","ae","gb","um","us","uz","vu","vi","wf","eh","ye","zm","zw"]},{id:"googlePlay",selectors:[".footer_banner-badge.google.w-inline-block",".app-download_link-wrapper.google.w-inline-block"],countries:["af","ax","as","ad","ai","aq","au","bb","bt","bv","io","bn","bi","ca","bq","cf","cx","cc","cg","cd","ck","cw","gq","et","fk","fo","gf","pf","tf","gl","gp","gu","gg","gy","hm","va","hk","ir","im","jp","je","ki","kp","ls","ly","mg","mw","mh","mq","mr","yt","fm","mn","me","ms","nr","nc","nz","ng","nu","nf","mp","pw","ps","pn","pr","re","sh","kn","lc","pm","vc","bl","mf","st","sg","sx","gs","ss","sj","sz","sy","tl","tk","tc","tv","um","us","vg","vi","wf","eh"]},{id:"appstore",selectors:[".footer_banner-badge.store.w-inline-block",".app-download_link-wrapper.appstore.w-inline-block"],countries:["ax","al","as","ad","aq","aw","au","at","bd","be","bv","io","bg","bi","ca","bq","cf","cx","cc","km","ck","hr","cu","cw","cy","cz","dk","dj","gq","er","ee","et","fk","fo","fi","fr","gf","pf","tf","de","gi","gr","gl","gp","gu","gg","gn","ht","hm","va","hk","hu","is","ir","iq","ie","im","il","it","je","ki","kp","lv","ls","ly","li","lt","lu","mt","mh","mq","yt","fm","me","nl","nc","nz","ng","nu","nf","mp","no","ps","pn","pl","pt","pr","re","ro","sh","pm","bl","mf","ws","sm","sg","sx","sk","si","so","gs","ss","es","sd","sj","se","ch","sy","tw","tl","tg","tk","tr","tv","gb","um","us","vu","vi","wf","eh"]},{id:"p2p",selectors:["#p2payment.accordion_toggle-block","#p2component.section_dp2p","#card_block_p2p.help_category"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"w-dyn-item-p2p",selectors:["div.w-dyn-item"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"hideRow",selectors:["#footer_social-icons_row","#footer_text_row",".footer_risk-warning.w-richtext"],countries:["br","uy","lk","ch","za","ec"]},{id:"hideDiel",selectors:["#footer_text_diel","#footer_social-icons_diel"],countries:["br","uy","lk","ch","za","ec"]}],l=[{id:"showElems",selectors:[".banner_disclaimer"],countries:["br","uy","lk","ch","za","ec"]}],p=()=>{const e=window.getClientCountry();u.forEach((o=>{const n="hideDiel"===o.id?!o.countries.includes(e):o.countries.includes(e);if(e&&n)return o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((e=>{if(e)if("w-dyn-item-p2p"===o.id){e.querySelector("#card_block_p2p.help_category")&&(e.style.display="none")}else e.style.display="none"}))}));if(!n){const e=document.querySelector(".footer_social-icons.diel");e&&(e.style.display="flex")}})),l.forEach((o=>{e&&o.countries.includes(e)?o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{if(o){const n=document.querySelector(".page-wrapper");".banner_disclaimer"===e?(n.classList.add("disclaimer-show"),o.classList.remove("hide-element")):o.style.display="block"}}))})):o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{o&&(".banner_disclaimer"===e?o.classList.add("hide-element"):o.style.display="none")}))}))}))},w=JSON.stringify({website_status:1});!async function(){try{const e=await fetch("https://www.cloudflare.com/cdn-cgi/trace"),o=await e.text(),n=Object.fromEntries(o.split("\n").map((e=>e.split("=",2)))).loc.toLowerCase();n!==t(document.cookie,"clients_country")&&(d("clients_country"),a("clients_country",n,30)),p()}catch(e){p()}}();t(document.cookie,"clients_country")||window.socketMessageSend(w,"website_status").then((e=>{t(document.cookie,"clients_country")!==e.website_status.clients_country&&(d("clients_country"),a("clients_country",e.website_status.clients_country,30)),p()})).catch((e=>{}));const h=["ar","bn","de","en","es","fr","it","ko","pl","pt","ru","si","sw","th","tr","vi","zh_cn","zh_tw","zh-cn","zh-tw"];(()=>{var e;const o=window.location.pathname,n=window.location.hash,i=window.location.search,a=o.split("/"),d=a[1],s=h.includes(d||""),c=a.includes("careers")||a.includes("locations")||a.includes("derivtech")||a.includes("derivlife")||a.includes("eu-careers")||a.includes("our-locations");s&&r(d);const u=(null==(e=t(document.cookie,"webflow-user-language"))?void 0:e.toLowerCase())||"en",l=s?d:u;if((s||"en"!==u)&&d!==u)if(s&&d!==u)r(l);else if(!c){const e=(s?a.map((e=>e===d?l:e)).join("/"):l+a.join("/"))+i+n;window.location.href="/"+e}})();const y=function(){let e,o=!1,n=!1;const i=()=>{n=!0,o=!!t(document.cookie,"client_information"),o&&clearInterval(e),document.dispatchEvent(new Event("authStatusChange"))};return i(),e=setInterval(i,800),{getLoggedInStatus:()=>o,getAuthCheckedStatus:()=>n,onAuthStatusChange:e=>document.addEventListener("authStatusChange",e)}}();y.onAuthStatusChange((()=>{if(y.getAuthCheckedStatus()&&y.getLoggedInStatus()){document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.add("hide-element")}))}else if(y.getAuthCheckedStatus()&&!y.getLoggedInStatus()){document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.add("hide-element")}))}}));const m=window.location.href;if(["help-centre"].some((e=>m.includes(e)))){const e=new URL(m).searchParams;e.has("platform")&&"derivgo"===e.get("platform")&&(N=".derivgo-query-element",document.querySelectorAll(N).forEach((e=>{e.style.display="none"})))}var N;const Y=document.querySelector(".banner_disclaimer"),g=document.querySelector(".main-wrapper");if(Y){new ResizeObserver((e=>{for(let o of e)if(o.target===Y){let e=o.target.getBoundingClientRect();g&&(g.style.paddingTop=e.height+"px")}})).observe(Y)}window.addEventListener("pageshow",(function(e){if(e.persisted){const e=document.querySelector(".w-nav-overlay");e&&(e.style.display="none",document.querySelector("body").click())}}));const A=o(e({databaseURL:window.location.hostname.includes("staging")?"https://app-config-staging.firebaseio.com":"https://app-config-prod.firebaseio.com"}));let f=!1,_=!1;!function(){var e;const o=document.getElementById("live_chat-wrapper");try{const e=n(A,"remote_config/deriv-com/chat");i(e,(e=>{const n=e.val();f=n.live_chat,_=n.whatsapp_chat;const i=document.querySelector(".whatsapp_chat"),a=document.querySelector(".livechatbtn");i&&(i.style.visibility=_?"visible":"hidden"),a&&(a.style.visibility=f?"visible":"hidden");if(window.location.pathname.includes("/help-centre")){const e=document.querySelectorAll(".livechatbtn");f?e.forEach((e=>{e.style.visibility="visible"})):e.forEach((e=>{e.style.visibility="hidden"}));const o=document.querySelectorAll(".whatsapp_chat");_?o.forEach((e=>{e.style.visibility="visible"})):o.forEach((e=>{e.style.visibility="hidden"}))}window.addEventListener("scroll",(function(){var e,n;(f||_)&&(null==(e=null==o?void 0:o.classList)||e.remove("hide-element")),f||_||null==(n=null==o?void 0:o.classList)||n.add("hide-element")}))}),(e=>{var n;null==(n=null==o?void 0:o.classList)||n.remove("hide-element")}))}catch(a){null==(e=null==o?void 0:o.classList)||e.remove("hide-element")}}();new MutationObserver((function(e){for(const o of e)if(o.addedNodes.length)for(const e of o.addedNodes)e.nodeType===Node.ELEMENT_NODE&&"chat-widget-minimized"===e.id&&(e.style.opacity="0")})).observe(document.body,{childList:!0,subtree:!0});const v=window.getClientCountry();const b=[{country:"af",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"ax",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"al",apple:"No",android:"Yes",huawei:"No"},{country:"dz",apple:"Yes",android:"Yes",huawei:"No"},{country:"as",apple:"N/A",android:"No",huawei:"N/A"},{country:"ad",apple:"N/A",android:"N/A",huawei:"No"},{country:"ao",apple:"Yes",android:"Yes",huawei:"No"},{country:"ai",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"aq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ag",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ar",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"am",apple:"Yes",android:"Yes",huawei:"No"},{country:"aw",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"au",apple:"No",android:"No",huawei:"No"},{country:"at",apple:"No",android:"Yes",huawei:"No"},{country:"az",apple:"Yes",android:"Yes",huawei:"No"},{country:"bs",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bh",apple:"Yes",android:"Yes",huawei:"No"},{country:"bd",apple:"N/A",android:"Yes",huawei:"No"},{country:"bb",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"by",apple:"Yes",android:"Yes",huawei:"No"},{country:"be",apple:"No",android:"Yes",huawei:"No"},{country:"bz",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bj",apple:"Yes",android:"Yes",huawei:"No"},{country:"bm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"bt",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"bo",apple:"Yes",android:"Yes",huawei:"No"},{country:"ba",apple:"Yes",android:"Yes",huawei:"No"},{country:"bw",apple:"Yes",android:"Yes",huawei:"No"},{country:"bv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"br",apple:"Yes",android:"Yes",huawei:"No"},{country:"io",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"bn",apple:"Yes",android:"N/A",huawei:"No"},{country:"bg",apple:"No",android:"Yes",huawei:"No"},{country:"bf",apple:"Yes",android:"Yes",huawei:"No"},{country:"bi",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kh",apple:"Yes",android:"Yes",huawei:"No"},{country:"cm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ca",apple:"No",android:"No",huawei:"No"},{country:"cv",apple:"Yes",android:"Yes",huawei:"No"},{country:"bq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ky",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cf",apple:"N/A",android:"N/A",huawei:"No"},{country:"td",apple:"Yes",android:"Yes",huawei:"No"},{country:"cl",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cn",apple:"Yes",android:"Yes",huawei:"No"},{country:"cx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"co",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"km",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cg",apple:"Yes",android:"N/A",huawei:"No"},{country:"cd",apple:"Yes",android:"N/A",huawei:"No"},{country:"ck",apple:"N/A",android:"N/A",huawei:"No"},{country:"cr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ci",apple:"Yes",android:"Yes",huawei:"No"},{country:"hr",apple:"No",android:"Yes",huawei:"No"},{country:"cu",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cw",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cy",apple:"No",android:"Yes",huawei:"No"},{country:"cz",apple:"No",android:"Yes",huawei:"No"},{country:"dk",apple:"No",android:"Yes",huawei:"No"},{country:"dj",apple:"N/A",android:"Yes",huawei:"No"},{country:"dm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"do",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ec",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"eg",apple:"Yes",android:"Yes",huawei:"No"},{country:"sv",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gq",apple:"N/A",android:"N/A",huawei:"No"},{country:"er",apple:"N/A",android:"Yes",huawei:"No"},{country:"ee",apple:"No",android:"Yes",huawei:"No"},{country:"et",apple:"N/A",android:"N/A",huawei:"No"},{country:"fk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"fo",apple:"N/A",android:"N/A",huawei:"No"},{country:"fj",apple:"Yes",android:"Yes",huawei:"No"},{country:"fi",apple:"No",android:"Yes",huawei:"No"},{country:"fr",apple:"No",android:"Yes",huawei:"No"},{country:"gf",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"pf",apple:"N/A",android:"N/A",huawei:"No"},{country:"tf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ga",apple:"Yes",android:"Yes",huawei:"No"},{country:"gm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ge",apple:"Yes",android:"Yes",huawei:"No"},{country:"de",apple:"No",android:"Yes",huawei:"No"},{country:"gh",apple:"Yes",android:"Yes",huawei:"No"},{country:"gi",apple:"N/A",android:"Yes",huawei:"No"},{country:"gr",apple:"No",android:"Yes",huawei:"No"},{country:"gl",apple:"N/A",android:"N/A",huawei:"No"},{country:"gd",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gp",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"gu",apple:"N/A",android:"No",huawei:"N/A"},{country:"gt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gg",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"gn",apple:"N/A",android:"Yes",huawei:"No"},{country:"gw",apple:"Yes",android:"Yes",huawei:"No"},{country:"gy",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ht",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"hm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"va",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"hn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"hk",apple:"No",android:"No",huawei:"Yes"},{country:"hu",apple:"No",android:"Yes",huawei:"No"},{country:"is",apple:"No",android:"Yes",huawei:"No"},{country:"in",apple:"Yes",android:"Yes",huawei:"No"},{country:"id",apple:"Yes",android:"Yes",huawei:"No"},{country:"ir",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"iq",apple:"No",android:"Yes",huawei:"N/A"},{country:"ie",apple:"No",android:"Yes",huawei:"No"},{country:"im",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"il",apple:"No",android:"Yes",huawei:"No"},{country:"it",apple:"No",android:"Yes",huawei:"No"},{country:"jm",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"jp",apple:"Yes",android:"No",huawei:"No"},{country:"je",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"jo",apple:"Yes",android:"Yes",huawei:"No"},{country:"kz",apple:"Yes",android:"Yes",huawei:"No"},{country:"ke",apple:"Yes",android:"Yes",huawei:"No"},{country:"ki",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kr",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"kp",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kw",apple:"Yes",android:"Yes",huawei:"No"},{country:"kg",apple:"Yes",android:"Yes",huawei:"No"},{country:"la",apple:"Yes",android:"Yes",huawei:"No"},{country:"lv",apple:"No",android:"Yes",huawei:"No"},{country:"lb",apple:"Yes",android:"Yes",huawei:"No"},{country:"ls",apple:"N/A",android:"N/A",huawei:"No"},{country:"lr",apple:"Yes",android:"Yes",huawei:"No"},{country:"ly",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"li",apple:"N/A",android:"Yes",huawei:"No"},{country:"lt",apple:"No",android:"Yes",huawei:"No"},{country:"lu",apple:"No",android:"Yes",huawei:"No"},{country:"mo",apple:"Yes",android:"Yes",huawei:"No"},{country:"mk",apple:"Yes",android:"Yes",huawei:"No"},{country:"mg",apple:"Yes",android:"N/A",huawei:"No"},{country:"mw",apple:"Yes",android:"N/A",huawei:"No"},{country:"my",apple:"Yes",android:"Yes",huawei:"No"},{country:"mv",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"ml",apple:"Yes",android:"Yes",huawei:"No"},{country:"mt",apple:"No",android:"Yes",huawei:"No"},{country:"mh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mq",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"mr",apple:"Yes",android:"N/A",huawei:"No"},{country:"mu",apple:"Yes",android:"Yes",huawei:"No"},{country:"yt",apple:"N/A",android:"N/A",huawei:"No"},{country:"mx",apple:"Yes",android:"Yes",huawei:"No"},{country:"fm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"md",apple:"Yes",android:"Yes",huawei:"No"},{country:"mc",apple:"Yes",android:"Yes",huawei:"No"},{country:"mn",apple:"Yes",android:"N/A",huawei:"No"},{country:"me",apple:"No",android:"N/A",huawei:"No"},{country:"ms",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ma",apple:"Yes",android:"Yes",huawei:"No"},{country:"mz",apple:"Yes",android:"Yes",huawei:"No"},{country:"mm",apple:"Yes",android:"Yes",huawei:"No"},{country:"na",apple:"Yes",android:"Yes",huawei:"No"},{country:"nr",apple:"Yes",android:"N/A",huawei:"No"},{country:"np",apple:"Yes",android:"Yes",huawei:"No"},{country:"nl",apple:"No",android:"Yes",huawei:"No"},{country:"nc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nz",apple:"No",android:"No",huawei:"No"},{country:"ni",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ne",apple:"Yes",android:"Yes",huawei:"No"},{country:"ng",apple:"No",android:"No",huawei:"No"},{country:"nu",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mp",apple:"N/A",android:"No",huawei:"N/A"},{country:"no",apple:"No",android:"Yes",huawei:"No"},{country:"om",apple:"Yes",android:"Yes",huawei:"No"},{country:"pk",apple:"Yes",android:"Yes",huawei:"No"},{country:"pw",apple:"Yes",android:"No",huawei:"N/A"},{country:"ps",apple:"N/A",android:"N/A",huawei:"No"},{country:"pa",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pg",apple:"Yes",android:"Yes",huawei:"No"},{country:"py",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pe",apple:"Yes",android:"Yes",huawei:"No"},{country:"ph",apple:"Yes",android:"Yes",huawei:"No"},{country:"pn",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"pl",apple:"No",android:"Yes",huawei:"No"},{country:"pt",apple:"No",android:"Yes",huawei:"No"},{country:"pr",apple:"N/A",android:"No",huawei:"Yes"},{country:"qa",apple:"Yes",android:"Yes",huawei:"No"},{country:"re",apple:"N/A",android:"N/A",huawei:"No"},{country:"ro",apple:"No",android:"Yes",huawei:"No"},{country:"ru",apple:"Yes",android:"Yes",huawei:"No"},{country:"rw",apple:"Yes",android:"Yes",huawei:"No"},{country:"sh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kn",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"lc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"pm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"vc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"bl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ws",apple:"N/A",android:"Yes",huawei:"No"},{country:"sm",apple:"N/A",android:"Yes",huawei:"No"},{country:"st",apple:"Yes",android:"N/A",huawei:"No"},{country:"sa",apple:"Yes",android:"Yes",huawei:"No"},{country:"sn",apple:"Yes",android:"Yes",huawei:"No"},{country:"rs",apple:"Yes",android:"Yes",huawei:"No"},{country:"sc",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"sl",apple:"Yes",android:"Yes",huawei:"No"},{country:"sg",apple:"No",android:"No",huawei:"No"},{country:"sx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sk",apple:"No",android:"Yes",huawei:"No"},{country:"si",apple:"No",android:"Yes",huawei:"No"},{country:"sb",apple:"Yes",android:"Yes",huawei:"No"},{country:"so",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"za",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gs",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ss",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"es",apple:"No",android:"Yes",huawei:"No"},{country:"lk",apple:"Yes",android:"Yes",huawei:"No"},{country:"sd",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"sr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"sj",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sz",apple:"Yes",android:"N/A",huawei:"No"},{country:"se",apple:"No",android:"Yes",huawei:"No"},{country:"ch",apple:"No",android:"Yes",huawei:"No"},{country:"sy",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tw",apple:"No",android:"Yes",huawei:"No"},{country:"tj",apple:"Yes",android:"Yes",huawei:"No"},{country:"tz",apple:"Yes",android:"Yes",huawei:"No"},{country:"th",apple:"Yes",android:"Yes",huawei:"No"},{country:"tl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tg",apple:"N/A",android:"Yes",huawei:"No"},{country:"tk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"to",apple:"Yes",android:"Yes",huawei:"No"},{country:"tt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"tn",apple:"Yes",android:"Yes",huawei:"No"},{country:"tr",apple:"No",android:"Yes",huawei:"No"},{country:"tm",apple:"Yes",android:"Yes",huawei:"No"},{country:"tc",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"tv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ug",apple:"Yes",android:"Yes",huawei:"No"},{country:"ua",apple:"Yes",android:"Yes",huawei:"No"},{country:"ae",apple:"Yes",android:"Yes",huawei:"No"},{country:"gb",apple:"No",android:"Yes",huawei:"No"},{country:"um",apple:"N/A",android:"No",huawei:"N/A"},{country:"us",apple:"No",android:"No",huawei:"N/A"},{country:"uy",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"uz",apple:"Yes",android:"Yes",huawei:"No"},{country:"vu",apple:"No",android:"Yes",huawei:"N/A"},{country:"ve",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vg",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"vi",apple:"N/A",android:"No",huawei:"N/A"},{country:"wf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"eh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ye",apple:"Yes",android:"Yes",huawei:"No"},{country:"zm",apple:"Yes",android:"Yes",huawei:"No"},{country:"zw",apple:"Yes",android:"Yes",huawei:"No"}].find((e=>e.country===v)),k=b?function(e){const{apple:o,android:n,huawei:i}=e;return"Yes"===o&&"Yes"===n&&"Yes"===i?"Android, iOS & Huawei":"Yes"===o&&"Yes"===n&&"Yes"!==i?"Android, and iOS":"Yes"===o&&"Yes"===i&&"Yes"!==n?"iOS, and Huawei":"Yes"===n&&"Yes"!==o&&"Yes"!==i?"Android":"Yes"===o&&"Yes"===i&&"Yes"!==n?"iOS, and Huawei":"Yes"===o&&"Yes"!==n&&"Yes"!==i?"iOS":"Yes"!==o&&"Yes"!==n&&"Yes"===i?"Huawei":""}(b):"",L=document.getElementById("app-download-heading");L&&(L.innerText=k);const E=document.querySelector(".redirection_background-wrapper"),S=document.getElementById("cancel-redirect"),C=document.getElementById("proceed-redirect");if(window.isEuRegion(window.location.pathname)&&E&&S&&C){const e=["deriv.me","deriv.be","deriv.com","app.deriv.me","app.deriv.be","app.deriv.com","docs.deriv.com","community.deriv.com","deriv.statuspage.io","signup.deriv.com","login.deriv.com","api.deriv.com"];let o="",n="_self";document.querySelectorAll("a").forEach((function(i){const a=new URL(i.href,window.location.href),t=new URL(window.location.href);e.includes(a.host)||a.host===t.host||i.addEventListener("click",(function(e){e.preventDefault(),o=a.href,n=i.target||"_self",E.classList.remove("hide-element"),document.body.style.overflow="hidden"}))})),S.addEventListener("click",(function(){E.classList.add("hide-element"),document.body.style.overflow="auto",o=""})),C.addEventListener("click",(function(){o&&(window.open(o,n),o="",E.classList.add("hide-element"),document.body.style.overflow="auto")}))}document.querySelector(".banner_disclaimer")?document.body.classList.add("disclaimer-visible"):document.body.classList.remove("disclaimer-visible");const q=document.querySelectorAll(".navbar_accordion-item");function z(){const e=document.querySelector(".navbar_accordion-trigger.open");e&&e.scrollIntoView({behavior:"smooth",block:"start"})}q.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.overflow="hidden",o.style.transition="max-height 0.3s ease-in, opacity 0.3s ease-in",o.style.opacity="0"})),q.forEach((e=>{const o=e.querySelector(".navbar_accordion-trigger");o.addEventListener("click",(function(){const e=o.classList.contains("open");if(q.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.opacity="0"})),!e){o.classList.add("open");const e=o.nextElementSibling;e.classList.add("open"),e.style.maxHeight=e.scrollHeight+"px",e.style.opacity="1"}}))}));document.querySelectorAll(".navbar_accordion-trigger").forEach((e=>{e.addEventListener("click",(function(){setTimeout(z,300)}))}));const I=new MutationObserver((e=>{e.forEach((e=>{if("class"===e.attributeName){const o=e.target;o.classList.contains("open")&&o.scrollIntoView({behavior:"smooth",block:"start"})}}))}));document.querySelectorAll(".navbar_accordion-item").forEach((e=>{I.observe(e,{attributes:!0})}));const j=new URL(window.location.href),x=new URLSearchParams(j.search),$=x.get("t");if(x.has("referrer")&&null!=$){t(document.cookie,"referrer_token")!==$&&(d("referrer_token"),a("referrer_token",$,365,".deriv.com"))}const P=document.getElementById("navbar-home_login");P&&P.addEventListener("click",(function(e){e.preventDefault(),window.location.href=s()}));const O=document.getElementById("res-navbar-home_login");O&&O.addEventListener("click",(function(e){e.preventDefault(),window.location.href=s()}));const R=document.getElementById("white-navbar_login");R&&R.addEventListener("click",(function(e){e.preventDefault(),window.location.href=s()}));const W=document.getElementById("res-white-navbar_login");W&&W.addEventListener("click",(function(e){e.preventDefault(),window.location.href=s()})),alert("test-2"),window.parseCookies=function(e,o){const n={};return e.split(";").forEach((e=>{const[o,i]=e.split("=").map((e=>e.trim()));n[o]=decodeURIComponent(i)})),n[o]},window.getClientCountry();const B=window.parseCookies(document.cookie,"webflow-user-language"),U=["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"];if(window.location.pathname.endsWith("p2p")&&!window.location.pathname.startsWith("/blog")){const e=window.getClientCountry();e&&U.includes(e)&&("en"===B?window.location.replace("/404"):window.location.replace(`/${B}/404`))}if(void 0!==window.parseCookies(document.cookie,"client_information")){let e=function(e){e.forEach((e=>{e.href="https://app.deriv.com/appstore/traders-hub"}))},o=document.querySelectorAll("a.live-markets_button.is-secondary.is-small.is-purchase.w-button"),n=document.querySelectorAll("a.live-markets_button.is-secondary.is-small.is-sell.w-button");e(o),e(n)}document.getElementById("mobile-menu"),document.getElementById("live_chat-wrapper");const D=()=>{window.LC_API&&window.LC_API.open_chat_window&&window.LC_API.open_chat_window()},H=()=>{"true"===new URLSearchParams(window.location.search).get("is_livechat_open")&&D()},J=e=>{var o;null==(o=null==window?void 0:window.LiveChatWidget)||o.on("ready",(()=>{window.LC_API.open_chat_window(),window.LC_API.hide_chat_window(),H();const o=window.parseCookies(document.cookie,"utm_data"),n=o?JSON.parse(o):{},{utm_source:i,utm_medium:a,utm_campaign:t}=n,r=window.parseCookies(document.cookie,"client_information"),d=new URLSearchParams(window.location.search),{loginid:s,email:c,landing_company_shortcode:u,currency:l,residence:p,first_name:w,last_name:h}=r?JSON.parse(r):{},y={is_logged_in:e,loginid:s??"",landing_company_shortcode:u??"",currency:l??"",residence:p??"",email:c??"",platform:d.get("platform")??"",utm_source:i??"",utm_medium:a??"",utm_campaign:t??""};window.LiveChatWidget.call("set_session_variables",y),e?(c&&window.LiveChatWidget.call("set_customer_email",c),w&&h&&window.LiveChatWidget.call("set_customer_name",`${w} ${h}`)):window.LC_API.on_chat_ended=()=>{window.LiveChatWidget.call("set_customer_email"," "),window.LiveChatWidget.call("set_customer_name"," ")},H(),window.LiveChatWidget.on("new_event",(e=>{e.greeting&&window.LC_API.open_chat_window()}))}))};let T=!1;const M=()=>{const e=!!window.parseCookies(document.cookie,"client_information");e!==T&&(J(e),T=e)};M(),setInterval(M,2e3),(()=>{if(window.__lc=window.__lc||{},window.__lc.license="12049137",window.LC_API=window.LC_API||{loaded:!1},window.LC_API.loaded)H();else{const e=document.createElement("script");e.async=!0,e.src="https://cdn.livechatinc.com/tracking.js",e.onload=()=>{window.LC_API.loaded=!0,window.LC_API.on_after_load=function(){J(!!window.parseCookies(document.cookie,"client_information")),H()},"undefined"!=typeof LiveChatWidget&&LiveChatWidget.init&&LiveChatWidget.init()},document.body.appendChild(e)}})();const V=document.querySelectorAll(".livechatbtn");V.length>0&&V.forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault(),D()}))}));const F=document.getElementById("liveChatBtn");F&&F.addEventListener("click",(e=>{e.preventDefault(),D()}));document.querySelectorAll('a[rel="liveChatBtn"]').forEach((e=>{null==e||e.addEventListener("click",(e=>{e.preventDefault(),D()}))})); \ No newline at end of file From 03e927b5ea7e7966645d60608c33918c30c3a44a Mon Sep 17 00:00:00 2001 From: Prince Date: Mon, 16 Sep 2024 19:07:22 +0400 Subject: [PATCH 26/57] chore: fixed rendering condition --- src/js/footer/test.js | 4 +++- src/temp-static.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/js/footer/test.js b/src/js/footer/test.js index 21257f5..7068c72 100644 --- a/src/js/footer/test.js +++ b/src/js/footer/test.js @@ -1,7 +1,9 @@ -alert('test-2') + +window.customLoader = "static version" + // Listen for DOMContentLoaded event const clientsCountry = window.getClientCountry(); diff --git a/src/temp-static.js b/src/temp-static.js index 614cff1..a55e5bf 100644 --- a/src/temp-static.js +++ b/src/temp-static.js @@ -1 +1 @@ -import{initializeApp as e}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-app.js";import{getDatabase as o,ref as n,onValue as i}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-database.js";function a(e,o,n,i){let a="";if(n){let e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),a="; expires="+e.toUTCString()}document.cookie=i?e+"="+(o||"")+a+`;domain=${i};path=/`:e+"="+(o||"")+a+";path=/"}function t(e,o){const n={};return e.split(";").forEach((e=>{const[o,i]=e.split("=").map((e=>e.trim()));n[o]=decodeURIComponent(i)})),n[o]}function r(e){a("webflow-user-language",e,30)}function d(e){document.cookie=e+"=; Max-Age=-99999999;"}window.emailRegex=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,window.toggleErrorField=(e,o)=>{o?e.classList.remove("error-field"):e.classList.add("error-field")},window.disableButton=function(e){e.disabled=!0,e.style.opacity="0.5"},window.isEuRegion=function(e){const o=e.replace(/\/$/,"");return/^\/(?:[^\/]+\/)?eu(?:\/|$)/.test(o)},window.enableButton=function(e){e.disabled=!1,e.style.opacity="1"},window.getOauthUrl=function(){var e=window.location.href,o=new URL(e).hostname,n=["deriv.com","deriv.be","deriv.me"].find((e=>o.endsWith(e)));return n?`https://oauth.${n}`:"https://oauth.deriv.com"},window.getClientCountry=function(){var e;const o=t(document.cookie,"clients_country"),n=t(document.cookie,"client_information");return n&&(null==(e=JSON.parse(n))?void 0:e.residence)||o},window.deriv_com_url="deriv.com",window.deriv_me_url="deriv.me",window.deriv_be_url="deriv.be",window.webflow_domain="webflow.deriv.com",window.staging_url="staging.deriv.com",window.staging_deriv_be_url="staging.deriv.be",window.domain_list_app_id={[window.deriv_com_url]:"16929",[window.deriv_me_url]:"1411",[window.deriv_be_url]:"30767",[window.webflow_domain]:"53503",[window.staging_url]:"16303"},window.getDomain=()=>{var e=window.location.href;return new URL(e).hostname},window.getAppId=()=>{const e=window.getDomain(),o=new URLSearchParams(window.location.search||"").get("app_id");if(o)return o;const n=localStorage.getItem("config.app_id");if(n)return n;const i={[window.webflow_domain]:window.domain_list_app_id[window.webflow_domain],[window.deriv_be_url]:window.domain_list_app_id[window.deriv_be_url],[window.deriv_me_url]:window.domain_list_app_id[window.deriv_me_url],[window.staging_url]:window.domain_list_app_id[window.staging_url]};return i[e]?i[e]:window.domain_list_app_id[window.deriv_com_url]};const s=()=>{const e=localStorage.getItem("config.server_url"),o=t(document.cookie,"webflow-user-language");let n=o?o.toLowerCase():"en";"zh-cn"!==n&&"zh-tw"!==n||(n=n.replace("-","_"));const i=(e=>{let o="";return e&&Object.keys(e).forEach((n=>{o+=`&${n}=${e[n]}`})),o})((()=>{const e=t(document.cookie,"utm_data");if(e){const o=JSON.parse(e),n={};return["utm_source","utm_ad_id","utm_adgroup_id","utm_adrollclk_id","utm_campaign","utm_campaign_id","utm_content","utm_fbcl_id","utm_gl_client_id","utm_medium","utm_msclk_id","utm_term"].forEach((e=>{o.hasOwnProperty(e)&&(n[e]=o[e])})),n}return null})()),a=t(document.cookie,"affiliate_tracking"),r=a?`&affiliate_token=${a}`:"",d=void["mt5","bot","derivx"].filter((e=>window.location.pathname.includes(e)&&e))||"";return e&&/qa/.test(e)?`https://${e}/oauth2/authorize?app_id=${window.getAppId()}&l=${n}&brand=deriv${r}${i}&platform=${d}`:`${window.getOauthUrl()}/oauth2/authorize?app_id=${(()=>{const e=window.getDomain();return e===window.deriv_me_url?window.domain_list_app_id[window.deriv_me_url]:e===window.deriv_be_url?window.domain_list_app_id[window.deriv_be_url]:e===window.webflow_domain?window.domain_list_app_id[window.webflow_domain]:window.domain_list_app_id[window.deriv_com_url]})()}&l=${n}&brand=deriv${r}${i}&platform=${d}`};if(!!!t(document.cookie,"client_information")){var c=document.createElement("iframe");c.src=(()=>{const e=window.location.hostname;let o;switch(o="deriv.com"===e||"deriv.be"===e||"deriv.me"===e?"production":"staging.deriv.com"===e?"staging":"development",o){case"production":return"https://hub.deriv.com/tradershub/signup";case"staging":return"https://staging-hub.deriv.com/tradershub/signup";default:return"https://dev-hub.deriv.com/tradershub/signup"}})(),c.style.width="0",c.style.height="0",c.style.border="none",c.style.visibility="hidden",c.setAttribute("sandbox","allow-same-origin allow-scripts"),document.body.appendChild(c)}window.establishWebSocketConnection=()=>new Promise(((e,o)=>{const n=t(document.cookie,"webflow-user-language"),i=n?n.toLowerCase():"en",a=localStorage.getItem("config.server_url")||"green.derivws.com";window.websocket=new WebSocket(`wss://${a}/websockets/v3?app_id=${window.getAppId()}&l=${i||"en"}&brand=deriv`),window.websocket.addEventListener("open",(o=>{window.websocket.addEventListener("close",(()=>{window.websocket.close()})),window.websocket.addEventListener("message",(e=>{JSON.parse(e.data)})),e(window.websocket)})),window.websocket.addEventListener("error",(e=>{var n;null==(n=null==window?void 0:window.websocket)||n.close(),o(e)}))})),window.socketMessageSend=async(e,o)=>{var n;try{return(null==window?void 0:window.websocket)&&(null==(n=null==window?void 0:window.websocket)?void 0:n.readyState)===(null==WebSocket?void 0:WebSocket.OPEN)?(window.websocket.send(e),new Promise(((e,n)=>{window.websocket.addEventListener("message",(i=>{const a=JSON.parse(i.data);o===a.msg_type&&(a.error?n(a.error):e(a))}))}))):establishWebSocketConnection().then((()=>(websocket.send(e),new Promise(((e,n)=>{websocket.addEventListener("message",(i=>{const a=JSON.parse(i.data);o===a.msg_type&&(a.error?n(a.error):e(a))}))}))))).catch((e=>Promise.reject(e)))}catch(i){return Promise.reject(i)}};const u=[{id:"appgallery",selectors:[".footer_banner-badge.gallery.w-inline-block",".app-download_link-wrapper.appgallery.w-inline-block"],countries:["af","ax","al","dz","as","ad","ao","aq","am","au","at","az","bh","bd","by","be","bj","bm","bt","bo","ba","bw","bv","br","io","bn","bg","bf","bi","kh","cm","ca","cv","bq","cf","td","cn","cx","cc","km","cg","cd","ck","ci","hr","cu","cw","cy","cz","dk","dj","dm","eg","gq","er","ee","et","fk","fo","fj","fi","fr","pf","tf","ga","gm","ge","de","gh","gi","gr","gl","gu","gg","gn","gw","hm","va","hu","is","in","id","ir","iq","ie","im","il","it","jp","je","jo","kz","ke","ki","kr","kp","kw","kg","la","lv","lb","ls","lr","ly","li","lt","lu","mo","mk","mg","mw","my","mv","ml","mt","mh","mr","mu","yt","mx","fm","md","mc","mn","me","ma","mz","mm","na","nr","np","nl","nc","nz","ne","ng","nu","nf","mp","no","om","pk","pw","ps","pg","pe","ph","pn","pl","pt","qa","re","ro","ru","rw","sh","kn","pm","bl","mf","ws","sm","st","sa","sn","rs","sc","sl","sg","sx","sk","si","sb","so","gs","ss","es","lk","sd","sj","sz","se","ch","sy","tw","tj","tz","th","tl","tg","tk","to","tn","tr","tm","tc","tv","ug","ua","ae","gb","um","us","uz","vu","vi","wf","eh","ye","zm","zw"]},{id:"googlePlay",selectors:[".footer_banner-badge.google.w-inline-block",".app-download_link-wrapper.google.w-inline-block"],countries:["af","ax","as","ad","ai","aq","au","bb","bt","bv","io","bn","bi","ca","bq","cf","cx","cc","cg","cd","ck","cw","gq","et","fk","fo","gf","pf","tf","gl","gp","gu","gg","gy","hm","va","hk","ir","im","jp","je","ki","kp","ls","ly","mg","mw","mh","mq","mr","yt","fm","mn","me","ms","nr","nc","nz","ng","nu","nf","mp","pw","ps","pn","pr","re","sh","kn","lc","pm","vc","bl","mf","st","sg","sx","gs","ss","sj","sz","sy","tl","tk","tc","tv","um","us","vg","vi","wf","eh"]},{id:"appstore",selectors:[".footer_banner-badge.store.w-inline-block",".app-download_link-wrapper.appstore.w-inline-block"],countries:["ax","al","as","ad","aq","aw","au","at","bd","be","bv","io","bg","bi","ca","bq","cf","cx","cc","km","ck","hr","cu","cw","cy","cz","dk","dj","gq","er","ee","et","fk","fo","fi","fr","gf","pf","tf","de","gi","gr","gl","gp","gu","gg","gn","ht","hm","va","hk","hu","is","ir","iq","ie","im","il","it","je","ki","kp","lv","ls","ly","li","lt","lu","mt","mh","mq","yt","fm","me","nl","nc","nz","ng","nu","nf","mp","no","ps","pn","pl","pt","pr","re","ro","sh","pm","bl","mf","ws","sm","sg","sx","sk","si","so","gs","ss","es","sd","sj","se","ch","sy","tw","tl","tg","tk","tr","tv","gb","um","us","vu","vi","wf","eh"]},{id:"p2p",selectors:["#p2payment.accordion_toggle-block","#p2component.section_dp2p","#card_block_p2p.help_category"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"w-dyn-item-p2p",selectors:["div.w-dyn-item"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"hideRow",selectors:["#footer_social-icons_row","#footer_text_row",".footer_risk-warning.w-richtext"],countries:["br","uy","lk","ch","za","ec"]},{id:"hideDiel",selectors:["#footer_text_diel","#footer_social-icons_diel"],countries:["br","uy","lk","ch","za","ec"]}],l=[{id:"showElems",selectors:[".banner_disclaimer"],countries:["br","uy","lk","ch","za","ec"]}],p=()=>{const e=window.getClientCountry();u.forEach((o=>{const n="hideDiel"===o.id?!o.countries.includes(e):o.countries.includes(e);if(e&&n)return o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((e=>{if(e)if("w-dyn-item-p2p"===o.id){e.querySelector("#card_block_p2p.help_category")&&(e.style.display="none")}else e.style.display="none"}))}));if(!n){const e=document.querySelector(".footer_social-icons.diel");e&&(e.style.display="flex")}})),l.forEach((o=>{e&&o.countries.includes(e)?o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{if(o){const n=document.querySelector(".page-wrapper");".banner_disclaimer"===e?(n.classList.add("disclaimer-show"),o.classList.remove("hide-element")):o.style.display="block"}}))})):o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{o&&(".banner_disclaimer"===e?o.classList.add("hide-element"):o.style.display="none")}))}))}))},w=JSON.stringify({website_status:1});!async function(){try{const e=await fetch("https://www.cloudflare.com/cdn-cgi/trace"),o=await e.text(),n=Object.fromEntries(o.split("\n").map((e=>e.split("=",2)))).loc.toLowerCase();n!==t(document.cookie,"clients_country")&&(d("clients_country"),a("clients_country",n,30)),p()}catch(e){p()}}();t(document.cookie,"clients_country")||window.socketMessageSend(w,"website_status").then((e=>{t(document.cookie,"clients_country")!==e.website_status.clients_country&&(d("clients_country"),a("clients_country",e.website_status.clients_country,30)),p()})).catch((e=>{}));const h=["ar","bn","de","en","es","fr","it","ko","pl","pt","ru","si","sw","th","tr","vi","zh_cn","zh_tw","zh-cn","zh-tw"];(()=>{var e;const o=window.location.pathname,n=window.location.hash,i=window.location.search,a=o.split("/"),d=a[1],s=h.includes(d||""),c=a.includes("careers")||a.includes("locations")||a.includes("derivtech")||a.includes("derivlife")||a.includes("eu-careers")||a.includes("our-locations");s&&r(d);const u=(null==(e=t(document.cookie,"webflow-user-language"))?void 0:e.toLowerCase())||"en",l=s?d:u;if((s||"en"!==u)&&d!==u)if(s&&d!==u)r(l);else if(!c){const e=(s?a.map((e=>e===d?l:e)).join("/"):l+a.join("/"))+i+n;window.location.href="/"+e}})();const y=function(){let e,o=!1,n=!1;const i=()=>{n=!0,o=!!t(document.cookie,"client_information"),o&&clearInterval(e),document.dispatchEvent(new Event("authStatusChange"))};return i(),e=setInterval(i,800),{getLoggedInStatus:()=>o,getAuthCheckedStatus:()=>n,onAuthStatusChange:e=>document.addEventListener("authStatusChange",e)}}();y.onAuthStatusChange((()=>{if(y.getAuthCheckedStatus()&&y.getLoggedInStatus()){document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.add("hide-element")}))}else if(y.getAuthCheckedStatus()&&!y.getLoggedInStatus()){document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.add("hide-element")}))}}));const m=window.location.href;if(["help-centre"].some((e=>m.includes(e)))){const e=new URL(m).searchParams;e.has("platform")&&"derivgo"===e.get("platform")&&(N=".derivgo-query-element",document.querySelectorAll(N).forEach((e=>{e.style.display="none"})))}var N;const Y=document.querySelector(".banner_disclaimer"),g=document.querySelector(".main-wrapper");if(Y){new ResizeObserver((e=>{for(let o of e)if(o.target===Y){let e=o.target.getBoundingClientRect();g&&(g.style.paddingTop=e.height+"px")}})).observe(Y)}window.addEventListener("pageshow",(function(e){if(e.persisted){const e=document.querySelector(".w-nav-overlay");e&&(e.style.display="none",document.querySelector("body").click())}}));const A=o(e({databaseURL:window.location.hostname.includes("staging")?"https://app-config-staging.firebaseio.com":"https://app-config-prod.firebaseio.com"}));let f=!1,_=!1;!function(){var e;const o=document.getElementById("live_chat-wrapper");try{const e=n(A,"remote_config/deriv-com/chat");i(e,(e=>{const n=e.val();f=n.live_chat,_=n.whatsapp_chat;const i=document.querySelector(".whatsapp_chat"),a=document.querySelector(".livechatbtn");i&&(i.style.visibility=_?"visible":"hidden"),a&&(a.style.visibility=f?"visible":"hidden");if(window.location.pathname.includes("/help-centre")){const e=document.querySelectorAll(".livechatbtn");f?e.forEach((e=>{e.style.visibility="visible"})):e.forEach((e=>{e.style.visibility="hidden"}));const o=document.querySelectorAll(".whatsapp_chat");_?o.forEach((e=>{e.style.visibility="visible"})):o.forEach((e=>{e.style.visibility="hidden"}))}window.addEventListener("scroll",(function(){var e,n;(f||_)&&(null==(e=null==o?void 0:o.classList)||e.remove("hide-element")),f||_||null==(n=null==o?void 0:o.classList)||n.add("hide-element")}))}),(e=>{var n;null==(n=null==o?void 0:o.classList)||n.remove("hide-element")}))}catch(a){null==(e=null==o?void 0:o.classList)||e.remove("hide-element")}}();new MutationObserver((function(e){for(const o of e)if(o.addedNodes.length)for(const e of o.addedNodes)e.nodeType===Node.ELEMENT_NODE&&"chat-widget-minimized"===e.id&&(e.style.opacity="0")})).observe(document.body,{childList:!0,subtree:!0});const v=window.getClientCountry();const b=[{country:"af",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"ax",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"al",apple:"No",android:"Yes",huawei:"No"},{country:"dz",apple:"Yes",android:"Yes",huawei:"No"},{country:"as",apple:"N/A",android:"No",huawei:"N/A"},{country:"ad",apple:"N/A",android:"N/A",huawei:"No"},{country:"ao",apple:"Yes",android:"Yes",huawei:"No"},{country:"ai",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"aq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ag",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ar",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"am",apple:"Yes",android:"Yes",huawei:"No"},{country:"aw",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"au",apple:"No",android:"No",huawei:"No"},{country:"at",apple:"No",android:"Yes",huawei:"No"},{country:"az",apple:"Yes",android:"Yes",huawei:"No"},{country:"bs",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bh",apple:"Yes",android:"Yes",huawei:"No"},{country:"bd",apple:"N/A",android:"Yes",huawei:"No"},{country:"bb",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"by",apple:"Yes",android:"Yes",huawei:"No"},{country:"be",apple:"No",android:"Yes",huawei:"No"},{country:"bz",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bj",apple:"Yes",android:"Yes",huawei:"No"},{country:"bm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"bt",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"bo",apple:"Yes",android:"Yes",huawei:"No"},{country:"ba",apple:"Yes",android:"Yes",huawei:"No"},{country:"bw",apple:"Yes",android:"Yes",huawei:"No"},{country:"bv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"br",apple:"Yes",android:"Yes",huawei:"No"},{country:"io",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"bn",apple:"Yes",android:"N/A",huawei:"No"},{country:"bg",apple:"No",android:"Yes",huawei:"No"},{country:"bf",apple:"Yes",android:"Yes",huawei:"No"},{country:"bi",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kh",apple:"Yes",android:"Yes",huawei:"No"},{country:"cm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ca",apple:"No",android:"No",huawei:"No"},{country:"cv",apple:"Yes",android:"Yes",huawei:"No"},{country:"bq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ky",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cf",apple:"N/A",android:"N/A",huawei:"No"},{country:"td",apple:"Yes",android:"Yes",huawei:"No"},{country:"cl",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cn",apple:"Yes",android:"Yes",huawei:"No"},{country:"cx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"co",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"km",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cg",apple:"Yes",android:"N/A",huawei:"No"},{country:"cd",apple:"Yes",android:"N/A",huawei:"No"},{country:"ck",apple:"N/A",android:"N/A",huawei:"No"},{country:"cr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ci",apple:"Yes",android:"Yes",huawei:"No"},{country:"hr",apple:"No",android:"Yes",huawei:"No"},{country:"cu",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cw",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cy",apple:"No",android:"Yes",huawei:"No"},{country:"cz",apple:"No",android:"Yes",huawei:"No"},{country:"dk",apple:"No",android:"Yes",huawei:"No"},{country:"dj",apple:"N/A",android:"Yes",huawei:"No"},{country:"dm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"do",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ec",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"eg",apple:"Yes",android:"Yes",huawei:"No"},{country:"sv",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gq",apple:"N/A",android:"N/A",huawei:"No"},{country:"er",apple:"N/A",android:"Yes",huawei:"No"},{country:"ee",apple:"No",android:"Yes",huawei:"No"},{country:"et",apple:"N/A",android:"N/A",huawei:"No"},{country:"fk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"fo",apple:"N/A",android:"N/A",huawei:"No"},{country:"fj",apple:"Yes",android:"Yes",huawei:"No"},{country:"fi",apple:"No",android:"Yes",huawei:"No"},{country:"fr",apple:"No",android:"Yes",huawei:"No"},{country:"gf",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"pf",apple:"N/A",android:"N/A",huawei:"No"},{country:"tf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ga",apple:"Yes",android:"Yes",huawei:"No"},{country:"gm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ge",apple:"Yes",android:"Yes",huawei:"No"},{country:"de",apple:"No",android:"Yes",huawei:"No"},{country:"gh",apple:"Yes",android:"Yes",huawei:"No"},{country:"gi",apple:"N/A",android:"Yes",huawei:"No"},{country:"gr",apple:"No",android:"Yes",huawei:"No"},{country:"gl",apple:"N/A",android:"N/A",huawei:"No"},{country:"gd",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gp",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"gu",apple:"N/A",android:"No",huawei:"N/A"},{country:"gt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gg",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"gn",apple:"N/A",android:"Yes",huawei:"No"},{country:"gw",apple:"Yes",android:"Yes",huawei:"No"},{country:"gy",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ht",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"hm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"va",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"hn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"hk",apple:"No",android:"No",huawei:"Yes"},{country:"hu",apple:"No",android:"Yes",huawei:"No"},{country:"is",apple:"No",android:"Yes",huawei:"No"},{country:"in",apple:"Yes",android:"Yes",huawei:"No"},{country:"id",apple:"Yes",android:"Yes",huawei:"No"},{country:"ir",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"iq",apple:"No",android:"Yes",huawei:"N/A"},{country:"ie",apple:"No",android:"Yes",huawei:"No"},{country:"im",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"il",apple:"No",android:"Yes",huawei:"No"},{country:"it",apple:"No",android:"Yes",huawei:"No"},{country:"jm",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"jp",apple:"Yes",android:"No",huawei:"No"},{country:"je",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"jo",apple:"Yes",android:"Yes",huawei:"No"},{country:"kz",apple:"Yes",android:"Yes",huawei:"No"},{country:"ke",apple:"Yes",android:"Yes",huawei:"No"},{country:"ki",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kr",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"kp",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kw",apple:"Yes",android:"Yes",huawei:"No"},{country:"kg",apple:"Yes",android:"Yes",huawei:"No"},{country:"la",apple:"Yes",android:"Yes",huawei:"No"},{country:"lv",apple:"No",android:"Yes",huawei:"No"},{country:"lb",apple:"Yes",android:"Yes",huawei:"No"},{country:"ls",apple:"N/A",android:"N/A",huawei:"No"},{country:"lr",apple:"Yes",android:"Yes",huawei:"No"},{country:"ly",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"li",apple:"N/A",android:"Yes",huawei:"No"},{country:"lt",apple:"No",android:"Yes",huawei:"No"},{country:"lu",apple:"No",android:"Yes",huawei:"No"},{country:"mo",apple:"Yes",android:"Yes",huawei:"No"},{country:"mk",apple:"Yes",android:"Yes",huawei:"No"},{country:"mg",apple:"Yes",android:"N/A",huawei:"No"},{country:"mw",apple:"Yes",android:"N/A",huawei:"No"},{country:"my",apple:"Yes",android:"Yes",huawei:"No"},{country:"mv",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"ml",apple:"Yes",android:"Yes",huawei:"No"},{country:"mt",apple:"No",android:"Yes",huawei:"No"},{country:"mh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mq",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"mr",apple:"Yes",android:"N/A",huawei:"No"},{country:"mu",apple:"Yes",android:"Yes",huawei:"No"},{country:"yt",apple:"N/A",android:"N/A",huawei:"No"},{country:"mx",apple:"Yes",android:"Yes",huawei:"No"},{country:"fm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"md",apple:"Yes",android:"Yes",huawei:"No"},{country:"mc",apple:"Yes",android:"Yes",huawei:"No"},{country:"mn",apple:"Yes",android:"N/A",huawei:"No"},{country:"me",apple:"No",android:"N/A",huawei:"No"},{country:"ms",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ma",apple:"Yes",android:"Yes",huawei:"No"},{country:"mz",apple:"Yes",android:"Yes",huawei:"No"},{country:"mm",apple:"Yes",android:"Yes",huawei:"No"},{country:"na",apple:"Yes",android:"Yes",huawei:"No"},{country:"nr",apple:"Yes",android:"N/A",huawei:"No"},{country:"np",apple:"Yes",android:"Yes",huawei:"No"},{country:"nl",apple:"No",android:"Yes",huawei:"No"},{country:"nc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nz",apple:"No",android:"No",huawei:"No"},{country:"ni",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ne",apple:"Yes",android:"Yes",huawei:"No"},{country:"ng",apple:"No",android:"No",huawei:"No"},{country:"nu",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mp",apple:"N/A",android:"No",huawei:"N/A"},{country:"no",apple:"No",android:"Yes",huawei:"No"},{country:"om",apple:"Yes",android:"Yes",huawei:"No"},{country:"pk",apple:"Yes",android:"Yes",huawei:"No"},{country:"pw",apple:"Yes",android:"No",huawei:"N/A"},{country:"ps",apple:"N/A",android:"N/A",huawei:"No"},{country:"pa",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pg",apple:"Yes",android:"Yes",huawei:"No"},{country:"py",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pe",apple:"Yes",android:"Yes",huawei:"No"},{country:"ph",apple:"Yes",android:"Yes",huawei:"No"},{country:"pn",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"pl",apple:"No",android:"Yes",huawei:"No"},{country:"pt",apple:"No",android:"Yes",huawei:"No"},{country:"pr",apple:"N/A",android:"No",huawei:"Yes"},{country:"qa",apple:"Yes",android:"Yes",huawei:"No"},{country:"re",apple:"N/A",android:"N/A",huawei:"No"},{country:"ro",apple:"No",android:"Yes",huawei:"No"},{country:"ru",apple:"Yes",android:"Yes",huawei:"No"},{country:"rw",apple:"Yes",android:"Yes",huawei:"No"},{country:"sh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kn",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"lc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"pm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"vc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"bl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ws",apple:"N/A",android:"Yes",huawei:"No"},{country:"sm",apple:"N/A",android:"Yes",huawei:"No"},{country:"st",apple:"Yes",android:"N/A",huawei:"No"},{country:"sa",apple:"Yes",android:"Yes",huawei:"No"},{country:"sn",apple:"Yes",android:"Yes",huawei:"No"},{country:"rs",apple:"Yes",android:"Yes",huawei:"No"},{country:"sc",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"sl",apple:"Yes",android:"Yes",huawei:"No"},{country:"sg",apple:"No",android:"No",huawei:"No"},{country:"sx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sk",apple:"No",android:"Yes",huawei:"No"},{country:"si",apple:"No",android:"Yes",huawei:"No"},{country:"sb",apple:"Yes",android:"Yes",huawei:"No"},{country:"so",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"za",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gs",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ss",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"es",apple:"No",android:"Yes",huawei:"No"},{country:"lk",apple:"Yes",android:"Yes",huawei:"No"},{country:"sd",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"sr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"sj",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sz",apple:"Yes",android:"N/A",huawei:"No"},{country:"se",apple:"No",android:"Yes",huawei:"No"},{country:"ch",apple:"No",android:"Yes",huawei:"No"},{country:"sy",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tw",apple:"No",android:"Yes",huawei:"No"},{country:"tj",apple:"Yes",android:"Yes",huawei:"No"},{country:"tz",apple:"Yes",android:"Yes",huawei:"No"},{country:"th",apple:"Yes",android:"Yes",huawei:"No"},{country:"tl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tg",apple:"N/A",android:"Yes",huawei:"No"},{country:"tk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"to",apple:"Yes",android:"Yes",huawei:"No"},{country:"tt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"tn",apple:"Yes",android:"Yes",huawei:"No"},{country:"tr",apple:"No",android:"Yes",huawei:"No"},{country:"tm",apple:"Yes",android:"Yes",huawei:"No"},{country:"tc",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"tv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ug",apple:"Yes",android:"Yes",huawei:"No"},{country:"ua",apple:"Yes",android:"Yes",huawei:"No"},{country:"ae",apple:"Yes",android:"Yes",huawei:"No"},{country:"gb",apple:"No",android:"Yes",huawei:"No"},{country:"um",apple:"N/A",android:"No",huawei:"N/A"},{country:"us",apple:"No",android:"No",huawei:"N/A"},{country:"uy",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"uz",apple:"Yes",android:"Yes",huawei:"No"},{country:"vu",apple:"No",android:"Yes",huawei:"N/A"},{country:"ve",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vg",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"vi",apple:"N/A",android:"No",huawei:"N/A"},{country:"wf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"eh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ye",apple:"Yes",android:"Yes",huawei:"No"},{country:"zm",apple:"Yes",android:"Yes",huawei:"No"},{country:"zw",apple:"Yes",android:"Yes",huawei:"No"}].find((e=>e.country===v)),k=b?function(e){const{apple:o,android:n,huawei:i}=e;return"Yes"===o&&"Yes"===n&&"Yes"===i?"Android, iOS & Huawei":"Yes"===o&&"Yes"===n&&"Yes"!==i?"Android, and iOS":"Yes"===o&&"Yes"===i&&"Yes"!==n?"iOS, and Huawei":"Yes"===n&&"Yes"!==o&&"Yes"!==i?"Android":"Yes"===o&&"Yes"===i&&"Yes"!==n?"iOS, and Huawei":"Yes"===o&&"Yes"!==n&&"Yes"!==i?"iOS":"Yes"!==o&&"Yes"!==n&&"Yes"===i?"Huawei":""}(b):"",L=document.getElementById("app-download-heading");L&&(L.innerText=k);const E=document.querySelector(".redirection_background-wrapper"),S=document.getElementById("cancel-redirect"),C=document.getElementById("proceed-redirect");if(window.isEuRegion(window.location.pathname)&&E&&S&&C){const e=["deriv.me","deriv.be","deriv.com","app.deriv.me","app.deriv.be","app.deriv.com","docs.deriv.com","community.deriv.com","deriv.statuspage.io","signup.deriv.com","login.deriv.com","api.deriv.com"];let o="",n="_self";document.querySelectorAll("a").forEach((function(i){const a=new URL(i.href,window.location.href),t=new URL(window.location.href);e.includes(a.host)||a.host===t.host||i.addEventListener("click",(function(e){e.preventDefault(),o=a.href,n=i.target||"_self",E.classList.remove("hide-element"),document.body.style.overflow="hidden"}))})),S.addEventListener("click",(function(){E.classList.add("hide-element"),document.body.style.overflow="auto",o=""})),C.addEventListener("click",(function(){o&&(window.open(o,n),o="",E.classList.add("hide-element"),document.body.style.overflow="auto")}))}document.querySelector(".banner_disclaimer")?document.body.classList.add("disclaimer-visible"):document.body.classList.remove("disclaimer-visible");const q=document.querySelectorAll(".navbar_accordion-item");function z(){const e=document.querySelector(".navbar_accordion-trigger.open");e&&e.scrollIntoView({behavior:"smooth",block:"start"})}q.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.overflow="hidden",o.style.transition="max-height 0.3s ease-in, opacity 0.3s ease-in",o.style.opacity="0"})),q.forEach((e=>{const o=e.querySelector(".navbar_accordion-trigger");o.addEventListener("click",(function(){const e=o.classList.contains("open");if(q.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.opacity="0"})),!e){o.classList.add("open");const e=o.nextElementSibling;e.classList.add("open"),e.style.maxHeight=e.scrollHeight+"px",e.style.opacity="1"}}))}));document.querySelectorAll(".navbar_accordion-trigger").forEach((e=>{e.addEventListener("click",(function(){setTimeout(z,300)}))}));const I=new MutationObserver((e=>{e.forEach((e=>{if("class"===e.attributeName){const o=e.target;o.classList.contains("open")&&o.scrollIntoView({behavior:"smooth",block:"start"})}}))}));document.querySelectorAll(".navbar_accordion-item").forEach((e=>{I.observe(e,{attributes:!0})}));const j=new URL(window.location.href),x=new URLSearchParams(j.search),$=x.get("t");if(x.has("referrer")&&null!=$){t(document.cookie,"referrer_token")!==$&&(d("referrer_token"),a("referrer_token",$,365,".deriv.com"))}const P=document.getElementById("navbar-home_login");P&&P.addEventListener("click",(function(e){e.preventDefault(),window.location.href=s()}));const O=document.getElementById("res-navbar-home_login");O&&O.addEventListener("click",(function(e){e.preventDefault(),window.location.href=s()}));const R=document.getElementById("white-navbar_login");R&&R.addEventListener("click",(function(e){e.preventDefault(),window.location.href=s()}));const W=document.getElementById("res-white-navbar_login");W&&W.addEventListener("click",(function(e){e.preventDefault(),window.location.href=s()})),alert("test-2"),window.parseCookies=function(e,o){const n={};return e.split(";").forEach((e=>{const[o,i]=e.split("=").map((e=>e.trim()));n[o]=decodeURIComponent(i)})),n[o]},window.getClientCountry();const B=window.parseCookies(document.cookie,"webflow-user-language"),U=["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"];if(window.location.pathname.endsWith("p2p")&&!window.location.pathname.startsWith("/blog")){const e=window.getClientCountry();e&&U.includes(e)&&("en"===B?window.location.replace("/404"):window.location.replace(`/${B}/404`))}if(void 0!==window.parseCookies(document.cookie,"client_information")){let e=function(e){e.forEach((e=>{e.href="https://app.deriv.com/appstore/traders-hub"}))},o=document.querySelectorAll("a.live-markets_button.is-secondary.is-small.is-purchase.w-button"),n=document.querySelectorAll("a.live-markets_button.is-secondary.is-small.is-sell.w-button");e(o),e(n)}document.getElementById("mobile-menu"),document.getElementById("live_chat-wrapper");const D=()=>{window.LC_API&&window.LC_API.open_chat_window&&window.LC_API.open_chat_window()},H=()=>{"true"===new URLSearchParams(window.location.search).get("is_livechat_open")&&D()},J=e=>{var o;null==(o=null==window?void 0:window.LiveChatWidget)||o.on("ready",(()=>{window.LC_API.open_chat_window(),window.LC_API.hide_chat_window(),H();const o=window.parseCookies(document.cookie,"utm_data"),n=o?JSON.parse(o):{},{utm_source:i,utm_medium:a,utm_campaign:t}=n,r=window.parseCookies(document.cookie,"client_information"),d=new URLSearchParams(window.location.search),{loginid:s,email:c,landing_company_shortcode:u,currency:l,residence:p,first_name:w,last_name:h}=r?JSON.parse(r):{},y={is_logged_in:e,loginid:s??"",landing_company_shortcode:u??"",currency:l??"",residence:p??"",email:c??"",platform:d.get("platform")??"",utm_source:i??"",utm_medium:a??"",utm_campaign:t??""};window.LiveChatWidget.call("set_session_variables",y),e?(c&&window.LiveChatWidget.call("set_customer_email",c),w&&h&&window.LiveChatWidget.call("set_customer_name",`${w} ${h}`)):window.LC_API.on_chat_ended=()=>{window.LiveChatWidget.call("set_customer_email"," "),window.LiveChatWidget.call("set_customer_name"," ")},H(),window.LiveChatWidget.on("new_event",(e=>{e.greeting&&window.LC_API.open_chat_window()}))}))};let T=!1;const M=()=>{const e=!!window.parseCookies(document.cookie,"client_information");e!==T&&(J(e),T=e)};M(),setInterval(M,2e3),(()=>{if(window.__lc=window.__lc||{},window.__lc.license="12049137",window.LC_API=window.LC_API||{loaded:!1},window.LC_API.loaded)H();else{const e=document.createElement("script");e.async=!0,e.src="https://cdn.livechatinc.com/tracking.js",e.onload=()=>{window.LC_API.loaded=!0,window.LC_API.on_after_load=function(){J(!!window.parseCookies(document.cookie,"client_information")),H()},"undefined"!=typeof LiveChatWidget&&LiveChatWidget.init&&LiveChatWidget.init()},document.body.appendChild(e)}})();const V=document.querySelectorAll(".livechatbtn");V.length>0&&V.forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault(),D()}))}));const F=document.getElementById("liveChatBtn");F&&F.addEventListener("click",(e=>{e.preventDefault(),D()}));document.querySelectorAll('a[rel="liveChatBtn"]').forEach((e=>{null==e||e.addEventListener("click",(e=>{e.preventDefault(),D()}))})); \ No newline at end of file +import{initializeApp as e}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-app.js";import{getDatabase as o,ref as n,onValue as i}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-database.js";function a(e,o,n,i){let a="";if(n){let e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),a="; expires="+e.toUTCString()}document.cookie=i?e+"="+(o||"")+a+`;domain=${i};path=/`:e+"="+(o||"")+a+";path=/"}function t(e,o){const n={};return e.split(";").forEach((e=>{const[o,i]=e.split("=").map((e=>e.trim()));n[o]=decodeURIComponent(i)})),n[o]}function r(e){a("webflow-user-language",e,30)}function d(e){document.cookie=e+"=; Max-Age=-99999999;"}window.emailRegex=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,window.toggleErrorField=(e,o)=>{o?e.classList.remove("error-field"):e.classList.add("error-field")},window.disableButton=function(e){e.disabled=!0,e.style.opacity="0.5"},window.isEuRegion=function(e){const o=e.replace(/\/$/,"");return/^\/(?:[^\/]+\/)?eu(?:\/|$)/.test(o)},window.enableButton=function(e){e.disabled=!1,e.style.opacity="1"},window.getOauthUrl=function(){var e=window.location.href,o=new URL(e).hostname,n=["deriv.com","deriv.be","deriv.me"].find((e=>o.endsWith(e)));return n?`https://oauth.${n}`:"https://oauth.deriv.com"},window.getClientCountry=function(){var e;const o=t(document.cookie,"clients_country"),n=t(document.cookie,"client_information");return n&&(null==(e=JSON.parse(n))?void 0:e.residence)||o},window.deriv_com_url="deriv.com",window.deriv_me_url="deriv.me",window.deriv_be_url="deriv.be",window.webflow_domain="webflow.deriv.com",window.staging_url="staging.deriv.com",window.staging_deriv_be_url="staging.deriv.be",window.domain_list_app_id={[window.deriv_com_url]:"16929",[window.deriv_me_url]:"1411",[window.deriv_be_url]:"30767",[window.webflow_domain]:"53503",[window.staging_url]:"16303"},window.getDomain=()=>{var e=window.location.href;return new URL(e).hostname},window.getAppId=()=>{const e=window.getDomain(),o=new URLSearchParams(window.location.search||"").get("app_id");if(o)return o;const n=localStorage.getItem("config.app_id");if(n)return n;const i={[window.webflow_domain]:window.domain_list_app_id[window.webflow_domain],[window.deriv_be_url]:window.domain_list_app_id[window.deriv_be_url],[window.deriv_me_url]:window.domain_list_app_id[window.deriv_me_url],[window.staging_url]:window.domain_list_app_id[window.staging_url]};return i[e]?i[e]:window.domain_list_app_id[window.deriv_com_url]};const s=()=>{const e=localStorage.getItem("config.server_url"),o=t(document.cookie,"webflow-user-language");let n=o?o.toLowerCase():"en";"zh-cn"!==n&&"zh-tw"!==n||(n=n.replace("-","_"));const i=(e=>{let o="";return e&&Object.keys(e).forEach((n=>{o+=`&${n}=${e[n]}`})),o})((()=>{const e=t(document.cookie,"utm_data");if(e){const o=JSON.parse(e),n={};return["utm_source","utm_ad_id","utm_adgroup_id","utm_adrollclk_id","utm_campaign","utm_campaign_id","utm_content","utm_fbcl_id","utm_gl_client_id","utm_medium","utm_msclk_id","utm_term"].forEach((e=>{o.hasOwnProperty(e)&&(n[e]=o[e])})),n}return null})()),a=t(document.cookie,"affiliate_tracking"),r=a?`&affiliate_token=${a}`:"",d=void["mt5","bot","derivx"].filter((e=>window.location.pathname.includes(e)&&e))||"";return e&&/qa/.test(e)?`https://${e}/oauth2/authorize?app_id=${window.getAppId()}&l=${n}&brand=deriv${r}${i}&platform=${d}`:`${window.getOauthUrl()}/oauth2/authorize?app_id=${(()=>{const e=window.getDomain();return e===window.deriv_me_url?window.domain_list_app_id[window.deriv_me_url]:e===window.deriv_be_url?window.domain_list_app_id[window.deriv_be_url]:e===window.webflow_domain?window.domain_list_app_id[window.webflow_domain]:window.domain_list_app_id[window.deriv_com_url]})()}&l=${n}&brand=deriv${r}${i}&platform=${d}`};if(!!!t(document.cookie,"client_information")){var c=document.createElement("iframe");c.src=(()=>{const e=window.location.hostname;let o;switch(o="deriv.com"===e||"deriv.be"===e||"deriv.me"===e?"production":"staging.deriv.com"===e?"staging":"development",o){case"production":return"https://hub.deriv.com/tradershub/signup";case"staging":return"https://staging-hub.deriv.com/tradershub/signup";default:return"https://dev-hub.deriv.com/tradershub/signup"}})(),c.style.width="0",c.style.height="0",c.style.border="none",c.style.visibility="hidden",c.setAttribute("sandbox","allow-same-origin allow-scripts"),document.body.appendChild(c)}window.establishWebSocketConnection=()=>new Promise(((e,o)=>{const n=t(document.cookie,"webflow-user-language"),i=n?n.toLowerCase():"en",a=localStorage.getItem("config.server_url")||"green.derivws.com";window.websocket=new WebSocket(`wss://${a}/websockets/v3?app_id=${window.getAppId()}&l=${i||"en"}&brand=deriv`),window.websocket.addEventListener("open",(o=>{window.websocket.addEventListener("close",(()=>{window.websocket.close()})),window.websocket.addEventListener("message",(e=>{JSON.parse(e.data)})),e(window.websocket)})),window.websocket.addEventListener("error",(e=>{var n;null==(n=null==window?void 0:window.websocket)||n.close(),o(e)}))})),window.socketMessageSend=async(e,o)=>{var n;try{return(null==window?void 0:window.websocket)&&(null==(n=null==window?void 0:window.websocket)?void 0:n.readyState)===(null==WebSocket?void 0:WebSocket.OPEN)?(window.websocket.send(e),new Promise(((e,n)=>{window.websocket.addEventListener("message",(i=>{const a=JSON.parse(i.data);o===a.msg_type&&(a.error?n(a.error):e(a))}))}))):establishWebSocketConnection().then((()=>(websocket.send(e),new Promise(((e,n)=>{websocket.addEventListener("message",(i=>{const a=JSON.parse(i.data);o===a.msg_type&&(a.error?n(a.error):e(a))}))}))))).catch((e=>Promise.reject(e)))}catch(i){return Promise.reject(i)}};const u=[{id:"appgallery",selectors:[".footer_banner-badge.gallery.w-inline-block",".app-download_link-wrapper.appgallery.w-inline-block"],countries:["af","ax","al","dz","as","ad","ao","aq","am","au","at","az","bh","bd","by","be","bj","bm","bt","bo","ba","bw","bv","br","io","bn","bg","bf","bi","kh","cm","ca","cv","bq","cf","td","cn","cx","cc","km","cg","cd","ck","ci","hr","cu","cw","cy","cz","dk","dj","dm","eg","gq","er","ee","et","fk","fo","fj","fi","fr","pf","tf","ga","gm","ge","de","gh","gi","gr","gl","gu","gg","gn","gw","hm","va","hu","is","in","id","ir","iq","ie","im","il","it","jp","je","jo","kz","ke","ki","kr","kp","kw","kg","la","lv","lb","ls","lr","ly","li","lt","lu","mo","mk","mg","mw","my","mv","ml","mt","mh","mr","mu","yt","mx","fm","md","mc","mn","me","ma","mz","mm","na","nr","np","nl","nc","nz","ne","ng","nu","nf","mp","no","om","pk","pw","ps","pg","pe","ph","pn","pl","pt","qa","re","ro","ru","rw","sh","kn","pm","bl","mf","ws","sm","st","sa","sn","rs","sc","sl","sg","sx","sk","si","sb","so","gs","ss","es","lk","sd","sj","sz","se","ch","sy","tw","tj","tz","th","tl","tg","tk","to","tn","tr","tm","tc","tv","ug","ua","ae","gb","um","us","uz","vu","vi","wf","eh","ye","zm","zw"]},{id:"googlePlay",selectors:[".footer_banner-badge.google.w-inline-block",".app-download_link-wrapper.google.w-inline-block"],countries:["af","ax","as","ad","ai","aq","au","bb","bt","bv","io","bn","bi","ca","bq","cf","cx","cc","cg","cd","ck","cw","gq","et","fk","fo","gf","pf","tf","gl","gp","gu","gg","gy","hm","va","hk","ir","im","jp","je","ki","kp","ls","ly","mg","mw","mh","mq","mr","yt","fm","mn","me","ms","nr","nc","nz","ng","nu","nf","mp","pw","ps","pn","pr","re","sh","kn","lc","pm","vc","bl","mf","st","sg","sx","gs","ss","sj","sz","sy","tl","tk","tc","tv","um","us","vg","vi","wf","eh"]},{id:"appstore",selectors:[".footer_banner-badge.store.w-inline-block",".app-download_link-wrapper.appstore.w-inline-block"],countries:["ax","al","as","ad","aq","aw","au","at","bd","be","bv","io","bg","bi","ca","bq","cf","cx","cc","km","ck","hr","cu","cw","cy","cz","dk","dj","gq","er","ee","et","fk","fo","fi","fr","gf","pf","tf","de","gi","gr","gl","gp","gu","gg","gn","ht","hm","va","hk","hu","is","ir","iq","ie","im","il","it","je","ki","kp","lv","ls","ly","li","lt","lu","mt","mh","mq","yt","fm","me","nl","nc","nz","ng","nu","nf","mp","no","ps","pn","pl","pt","pr","re","ro","sh","pm","bl","mf","ws","sm","sg","sx","sk","si","so","gs","ss","es","sd","sj","se","ch","sy","tw","tl","tg","tk","tr","tv","gb","um","us","vu","vi","wf","eh"]},{id:"p2p",selectors:["#p2payment.accordion_toggle-block","#p2component.section_dp2p","#card_block_p2p.help_category"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"w-dyn-item-p2p",selectors:["div.w-dyn-item"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"hideRow",selectors:["#footer_social-icons_row","#footer_text_row",".footer_risk-warning.w-richtext"],countries:["br","uy","lk","ch","za","ec"]},{id:"hideDiel",selectors:["#footer_text_diel","#footer_social-icons_diel"],countries:["br","uy","lk","ch","za","ec"]}],l=[{id:"showElems",selectors:[".banner_disclaimer"],countries:["br","uy","lk","ch","za","ec"]}],p=()=>{const e=window.getClientCountry();u.forEach((o=>{const n="hideDiel"===o.id?!o.countries.includes(e):o.countries.includes(e);if(e&&n)return o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((e=>{if(e)if("w-dyn-item-p2p"===o.id){e.querySelector("#card_block_p2p.help_category")&&(e.style.display="none")}else e.style.display="none"}))}));if(!n){const e=document.querySelector(".footer_social-icons.diel");e&&(e.style.display="flex")}})),l.forEach((o=>{e&&o.countries.includes(e)?o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{if(o){const n=document.querySelector(".page-wrapper");".banner_disclaimer"===e?(n.classList.add("disclaimer-show"),o.classList.remove("hide-element")):o.style.display="block"}}))})):o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{o&&(".banner_disclaimer"===e?o.classList.add("hide-element"):o.style.display="none")}))}))}))},w=JSON.stringify({website_status:1});!async function(){try{const e=await fetch("https://www.cloudflare.com/cdn-cgi/trace"),o=await e.text(),n=Object.fromEntries(o.split("\n").map((e=>e.split("=",2)))).loc.toLowerCase();n!==t(document.cookie,"clients_country")&&(d("clients_country"),a("clients_country",n,30)),p()}catch(e){p()}}();t(document.cookie,"clients_country")||window.socketMessageSend(w,"website_status").then((e=>{t(document.cookie,"clients_country")!==e.website_status.clients_country&&(d("clients_country"),a("clients_country",e.website_status.clients_country,30)),p()})).catch((e=>{}));const h=["ar","bn","de","en","es","fr","it","ko","pl","pt","ru","si","sw","th","tr","vi","zh_cn","zh_tw","zh-cn","zh-tw"];(()=>{var e;const o=window.location.pathname,n=window.location.hash,i=window.location.search,a=o.split("/"),d=a[1],s=h.includes(d||""),c=a.includes("careers")||a.includes("locations")||a.includes("derivtech")||a.includes("derivlife")||a.includes("eu-careers")||a.includes("our-locations");s&&r(d);const u=(null==(e=t(document.cookie,"webflow-user-language"))?void 0:e.toLowerCase())||"en",l=s?d:u;if((s||"en"!==u)&&d!==u)if(s&&d!==u)r(l);else if(!c){const e=(s?a.map((e=>e===d?l:e)).join("/"):l+a.join("/"))+i+n;window.location.href="/"+e}})();const y=function(){let e,o=!1,n=!1;const i=()=>{n=!0,o=!!t(document.cookie,"client_information"),o&&clearInterval(e),document.dispatchEvent(new Event("authStatusChange"))};return i(),e=setInterval(i,800),{getLoggedInStatus:()=>o,getAuthCheckedStatus:()=>n,onAuthStatusChange:e=>document.addEventListener("authStatusChange",e)}}();y.onAuthStatusChange((()=>{if(y.getAuthCheckedStatus()&&y.getLoggedInStatus()){document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.add("hide-element")}))}else if(y.getAuthCheckedStatus()&&!y.getLoggedInStatus()){document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.add("hide-element")}))}}));const m=window.location.href;if(["help-centre"].some((e=>m.includes(e)))){const e=new URL(m).searchParams;e.has("platform")&&"derivgo"===e.get("platform")&&(N=".derivgo-query-element",document.querySelectorAll(N).forEach((e=>{e.style.display="none"})))}var N;const Y=document.querySelector(".banner_disclaimer"),g=document.querySelector(".main-wrapper");if(Y){new ResizeObserver((e=>{for(let o of e)if(o.target===Y){let e=o.target.getBoundingClientRect();g&&(g.style.paddingTop=e.height+"px")}})).observe(Y)}window.addEventListener("pageshow",(function(e){if(e.persisted){const e=document.querySelector(".w-nav-overlay");e&&(e.style.display="none",document.querySelector("body").click())}}));const A=o(e({databaseURL:window.location.hostname.includes("staging")?"https://app-config-staging.firebaseio.com":"https://app-config-prod.firebaseio.com"}));let f=!1,_=!1;!function(){var e;const o=document.getElementById("live_chat-wrapper");try{const e=n(A,"remote_config/deriv-com/chat");i(e,(e=>{const n=e.val();f=n.live_chat,_=n.whatsapp_chat;const i=document.querySelector(".whatsapp_chat"),a=document.querySelector(".livechatbtn");i&&(i.style.visibility=_?"visible":"hidden"),a&&(a.style.visibility=f?"visible":"hidden");if(window.location.pathname.includes("/help-centre")){const e=document.querySelectorAll(".livechatbtn");f?e.forEach((e=>{e.style.visibility="visible"})):e.forEach((e=>{e.style.visibility="hidden"}));const o=document.querySelectorAll(".whatsapp_chat");_?o.forEach((e=>{e.style.visibility="visible"})):o.forEach((e=>{e.style.visibility="hidden"}))}window.addEventListener("scroll",(function(){var e,n;(f||_)&&(null==(e=null==o?void 0:o.classList)||e.remove("hide-element")),f||_||null==(n=null==o?void 0:o.classList)||n.add("hide-element")}))}),(e=>{var n;null==(n=null==o?void 0:o.classList)||n.remove("hide-element")}))}catch(a){null==(e=null==o?void 0:o.classList)||e.remove("hide-element")}}();new MutationObserver((function(e){for(const o of e)if(o.addedNodes.length)for(const e of o.addedNodes)e.nodeType===Node.ELEMENT_NODE&&"chat-widget-minimized"===e.id&&(e.style.opacity="0")})).observe(document.body,{childList:!0,subtree:!0});const v=window.getClientCountry();const b=[{country:"af",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"ax",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"al",apple:"No",android:"Yes",huawei:"No"},{country:"dz",apple:"Yes",android:"Yes",huawei:"No"},{country:"as",apple:"N/A",android:"No",huawei:"N/A"},{country:"ad",apple:"N/A",android:"N/A",huawei:"No"},{country:"ao",apple:"Yes",android:"Yes",huawei:"No"},{country:"ai",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"aq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ag",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ar",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"am",apple:"Yes",android:"Yes",huawei:"No"},{country:"aw",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"au",apple:"No",android:"No",huawei:"No"},{country:"at",apple:"No",android:"Yes",huawei:"No"},{country:"az",apple:"Yes",android:"Yes",huawei:"No"},{country:"bs",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bh",apple:"Yes",android:"Yes",huawei:"No"},{country:"bd",apple:"N/A",android:"Yes",huawei:"No"},{country:"bb",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"by",apple:"Yes",android:"Yes",huawei:"No"},{country:"be",apple:"No",android:"Yes",huawei:"No"},{country:"bz",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bj",apple:"Yes",android:"Yes",huawei:"No"},{country:"bm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"bt",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"bo",apple:"Yes",android:"Yes",huawei:"No"},{country:"ba",apple:"Yes",android:"Yes",huawei:"No"},{country:"bw",apple:"Yes",android:"Yes",huawei:"No"},{country:"bv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"br",apple:"Yes",android:"Yes",huawei:"No"},{country:"io",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"bn",apple:"Yes",android:"N/A",huawei:"No"},{country:"bg",apple:"No",android:"Yes",huawei:"No"},{country:"bf",apple:"Yes",android:"Yes",huawei:"No"},{country:"bi",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kh",apple:"Yes",android:"Yes",huawei:"No"},{country:"cm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ca",apple:"No",android:"No",huawei:"No"},{country:"cv",apple:"Yes",android:"Yes",huawei:"No"},{country:"bq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ky",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cf",apple:"N/A",android:"N/A",huawei:"No"},{country:"td",apple:"Yes",android:"Yes",huawei:"No"},{country:"cl",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cn",apple:"Yes",android:"Yes",huawei:"No"},{country:"cx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"co",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"km",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cg",apple:"Yes",android:"N/A",huawei:"No"},{country:"cd",apple:"Yes",android:"N/A",huawei:"No"},{country:"ck",apple:"N/A",android:"N/A",huawei:"No"},{country:"cr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ci",apple:"Yes",android:"Yes",huawei:"No"},{country:"hr",apple:"No",android:"Yes",huawei:"No"},{country:"cu",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cw",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cy",apple:"No",android:"Yes",huawei:"No"},{country:"cz",apple:"No",android:"Yes",huawei:"No"},{country:"dk",apple:"No",android:"Yes",huawei:"No"},{country:"dj",apple:"N/A",android:"Yes",huawei:"No"},{country:"dm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"do",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ec",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"eg",apple:"Yes",android:"Yes",huawei:"No"},{country:"sv",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gq",apple:"N/A",android:"N/A",huawei:"No"},{country:"er",apple:"N/A",android:"Yes",huawei:"No"},{country:"ee",apple:"No",android:"Yes",huawei:"No"},{country:"et",apple:"N/A",android:"N/A",huawei:"No"},{country:"fk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"fo",apple:"N/A",android:"N/A",huawei:"No"},{country:"fj",apple:"Yes",android:"Yes",huawei:"No"},{country:"fi",apple:"No",android:"Yes",huawei:"No"},{country:"fr",apple:"No",android:"Yes",huawei:"No"},{country:"gf",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"pf",apple:"N/A",android:"N/A",huawei:"No"},{country:"tf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ga",apple:"Yes",android:"Yes",huawei:"No"},{country:"gm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ge",apple:"Yes",android:"Yes",huawei:"No"},{country:"de",apple:"No",android:"Yes",huawei:"No"},{country:"gh",apple:"Yes",android:"Yes",huawei:"No"},{country:"gi",apple:"N/A",android:"Yes",huawei:"No"},{country:"gr",apple:"No",android:"Yes",huawei:"No"},{country:"gl",apple:"N/A",android:"N/A",huawei:"No"},{country:"gd",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gp",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"gu",apple:"N/A",android:"No",huawei:"N/A"},{country:"gt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gg",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"gn",apple:"N/A",android:"Yes",huawei:"No"},{country:"gw",apple:"Yes",android:"Yes",huawei:"No"},{country:"gy",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ht",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"hm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"va",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"hn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"hk",apple:"No",android:"No",huawei:"Yes"},{country:"hu",apple:"No",android:"Yes",huawei:"No"},{country:"is",apple:"No",android:"Yes",huawei:"No"},{country:"in",apple:"Yes",android:"Yes",huawei:"No"},{country:"id",apple:"Yes",android:"Yes",huawei:"No"},{country:"ir",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"iq",apple:"No",android:"Yes",huawei:"N/A"},{country:"ie",apple:"No",android:"Yes",huawei:"No"},{country:"im",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"il",apple:"No",android:"Yes",huawei:"No"},{country:"it",apple:"No",android:"Yes",huawei:"No"},{country:"jm",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"jp",apple:"Yes",android:"No",huawei:"No"},{country:"je",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"jo",apple:"Yes",android:"Yes",huawei:"No"},{country:"kz",apple:"Yes",android:"Yes",huawei:"No"},{country:"ke",apple:"Yes",android:"Yes",huawei:"No"},{country:"ki",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kr",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"kp",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kw",apple:"Yes",android:"Yes",huawei:"No"},{country:"kg",apple:"Yes",android:"Yes",huawei:"No"},{country:"la",apple:"Yes",android:"Yes",huawei:"No"},{country:"lv",apple:"No",android:"Yes",huawei:"No"},{country:"lb",apple:"Yes",android:"Yes",huawei:"No"},{country:"ls",apple:"N/A",android:"N/A",huawei:"No"},{country:"lr",apple:"Yes",android:"Yes",huawei:"No"},{country:"ly",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"li",apple:"N/A",android:"Yes",huawei:"No"},{country:"lt",apple:"No",android:"Yes",huawei:"No"},{country:"lu",apple:"No",android:"Yes",huawei:"No"},{country:"mo",apple:"Yes",android:"Yes",huawei:"No"},{country:"mk",apple:"Yes",android:"Yes",huawei:"No"},{country:"mg",apple:"Yes",android:"N/A",huawei:"No"},{country:"mw",apple:"Yes",android:"N/A",huawei:"No"},{country:"my",apple:"Yes",android:"Yes",huawei:"No"},{country:"mv",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"ml",apple:"Yes",android:"Yes",huawei:"No"},{country:"mt",apple:"No",android:"Yes",huawei:"No"},{country:"mh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mq",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"mr",apple:"Yes",android:"N/A",huawei:"No"},{country:"mu",apple:"Yes",android:"Yes",huawei:"No"},{country:"yt",apple:"N/A",android:"N/A",huawei:"No"},{country:"mx",apple:"Yes",android:"Yes",huawei:"No"},{country:"fm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"md",apple:"Yes",android:"Yes",huawei:"No"},{country:"mc",apple:"Yes",android:"Yes",huawei:"No"},{country:"mn",apple:"Yes",android:"N/A",huawei:"No"},{country:"me",apple:"No",android:"N/A",huawei:"No"},{country:"ms",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ma",apple:"Yes",android:"Yes",huawei:"No"},{country:"mz",apple:"Yes",android:"Yes",huawei:"No"},{country:"mm",apple:"Yes",android:"Yes",huawei:"No"},{country:"na",apple:"Yes",android:"Yes",huawei:"No"},{country:"nr",apple:"Yes",android:"N/A",huawei:"No"},{country:"np",apple:"Yes",android:"Yes",huawei:"No"},{country:"nl",apple:"No",android:"Yes",huawei:"No"},{country:"nc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nz",apple:"No",android:"No",huawei:"No"},{country:"ni",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ne",apple:"Yes",android:"Yes",huawei:"No"},{country:"ng",apple:"No",android:"No",huawei:"No"},{country:"nu",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mp",apple:"N/A",android:"No",huawei:"N/A"},{country:"no",apple:"No",android:"Yes",huawei:"No"},{country:"om",apple:"Yes",android:"Yes",huawei:"No"},{country:"pk",apple:"Yes",android:"Yes",huawei:"No"},{country:"pw",apple:"Yes",android:"No",huawei:"N/A"},{country:"ps",apple:"N/A",android:"N/A",huawei:"No"},{country:"pa",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pg",apple:"Yes",android:"Yes",huawei:"No"},{country:"py",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pe",apple:"Yes",android:"Yes",huawei:"No"},{country:"ph",apple:"Yes",android:"Yes",huawei:"No"},{country:"pn",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"pl",apple:"No",android:"Yes",huawei:"No"},{country:"pt",apple:"No",android:"Yes",huawei:"No"},{country:"pr",apple:"N/A",android:"No",huawei:"Yes"},{country:"qa",apple:"Yes",android:"Yes",huawei:"No"},{country:"re",apple:"N/A",android:"N/A",huawei:"No"},{country:"ro",apple:"No",android:"Yes",huawei:"No"},{country:"ru",apple:"Yes",android:"Yes",huawei:"No"},{country:"rw",apple:"Yes",android:"Yes",huawei:"No"},{country:"sh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kn",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"lc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"pm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"vc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"bl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ws",apple:"N/A",android:"Yes",huawei:"No"},{country:"sm",apple:"N/A",android:"Yes",huawei:"No"},{country:"st",apple:"Yes",android:"N/A",huawei:"No"},{country:"sa",apple:"Yes",android:"Yes",huawei:"No"},{country:"sn",apple:"Yes",android:"Yes",huawei:"No"},{country:"rs",apple:"Yes",android:"Yes",huawei:"No"},{country:"sc",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"sl",apple:"Yes",android:"Yes",huawei:"No"},{country:"sg",apple:"No",android:"No",huawei:"No"},{country:"sx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sk",apple:"No",android:"Yes",huawei:"No"},{country:"si",apple:"No",android:"Yes",huawei:"No"},{country:"sb",apple:"Yes",android:"Yes",huawei:"No"},{country:"so",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"za",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gs",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ss",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"es",apple:"No",android:"Yes",huawei:"No"},{country:"lk",apple:"Yes",android:"Yes",huawei:"No"},{country:"sd",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"sr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"sj",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sz",apple:"Yes",android:"N/A",huawei:"No"},{country:"se",apple:"No",android:"Yes",huawei:"No"},{country:"ch",apple:"No",android:"Yes",huawei:"No"},{country:"sy",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tw",apple:"No",android:"Yes",huawei:"No"},{country:"tj",apple:"Yes",android:"Yes",huawei:"No"},{country:"tz",apple:"Yes",android:"Yes",huawei:"No"},{country:"th",apple:"Yes",android:"Yes",huawei:"No"},{country:"tl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tg",apple:"N/A",android:"Yes",huawei:"No"},{country:"tk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"to",apple:"Yes",android:"Yes",huawei:"No"},{country:"tt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"tn",apple:"Yes",android:"Yes",huawei:"No"},{country:"tr",apple:"No",android:"Yes",huawei:"No"},{country:"tm",apple:"Yes",android:"Yes",huawei:"No"},{country:"tc",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"tv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ug",apple:"Yes",android:"Yes",huawei:"No"},{country:"ua",apple:"Yes",android:"Yes",huawei:"No"},{country:"ae",apple:"Yes",android:"Yes",huawei:"No"},{country:"gb",apple:"No",android:"Yes",huawei:"No"},{country:"um",apple:"N/A",android:"No",huawei:"N/A"},{country:"us",apple:"No",android:"No",huawei:"N/A"},{country:"uy",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"uz",apple:"Yes",android:"Yes",huawei:"No"},{country:"vu",apple:"No",android:"Yes",huawei:"N/A"},{country:"ve",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vg",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"vi",apple:"N/A",android:"No",huawei:"N/A"},{country:"wf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"eh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ye",apple:"Yes",android:"Yes",huawei:"No"},{country:"zm",apple:"Yes",android:"Yes",huawei:"No"},{country:"zw",apple:"Yes",android:"Yes",huawei:"No"}].find((e=>e.country===v)),k=b?function(e){const{apple:o,android:n,huawei:i}=e;return"Yes"===o&&"Yes"===n&&"Yes"===i?"Android, iOS & Huawei":"Yes"===o&&"Yes"===n&&"Yes"!==i?"Android, and iOS":"Yes"===o&&"Yes"===i&&"Yes"!==n?"iOS, and Huawei":"Yes"===n&&"Yes"!==o&&"Yes"!==i?"Android":"Yes"===o&&"Yes"===i&&"Yes"!==n?"iOS, and Huawei":"Yes"===o&&"Yes"!==n&&"Yes"!==i?"iOS":"Yes"!==o&&"Yes"!==n&&"Yes"===i?"Huawei":""}(b):"",L=document.getElementById("app-download-heading");L&&(L.innerText=k);const E=document.querySelector(".redirection_background-wrapper"),S=document.getElementById("cancel-redirect"),C=document.getElementById("proceed-redirect");if(window.isEuRegion(window.location.pathname)&&E&&S&&C){const e=["deriv.me","deriv.be","deriv.com","app.deriv.me","app.deriv.be","app.deriv.com","docs.deriv.com","community.deriv.com","deriv.statuspage.io","signup.deriv.com","login.deriv.com","api.deriv.com"];let o="",n="_self";document.querySelectorAll("a").forEach((function(i){const a=new URL(i.href,window.location.href),t=new URL(window.location.href);e.includes(a.host)||a.host===t.host||i.addEventListener("click",(function(e){e.preventDefault(),o=a.href,n=i.target||"_self",E.classList.remove("hide-element"),document.body.style.overflow="hidden"}))})),S.addEventListener("click",(function(){E.classList.add("hide-element"),document.body.style.overflow="auto",o=""})),C.addEventListener("click",(function(){o&&(window.open(o,n),o="",E.classList.add("hide-element"),document.body.style.overflow="auto")}))}document.querySelector(".banner_disclaimer")?document.body.classList.add("disclaimer-visible"):document.body.classList.remove("disclaimer-visible");const q=document.querySelectorAll(".navbar_accordion-item");function z(){const e=document.querySelector(".navbar_accordion-trigger.open");e&&e.scrollIntoView({behavior:"smooth",block:"start"})}q.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.overflow="hidden",o.style.transition="max-height 0.3s ease-in, opacity 0.3s ease-in",o.style.opacity="0"})),q.forEach((e=>{const o=e.querySelector(".navbar_accordion-trigger");o.addEventListener("click",(function(){const e=o.classList.contains("open");if(q.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.opacity="0"})),!e){o.classList.add("open");const e=o.nextElementSibling;e.classList.add("open"),e.style.maxHeight=e.scrollHeight+"px",e.style.opacity="1"}}))}));document.querySelectorAll(".navbar_accordion-trigger").forEach((e=>{e.addEventListener("click",(function(){setTimeout(z,300)}))}));const I=new MutationObserver((e=>{e.forEach((e=>{if("class"===e.attributeName){const o=e.target;o.classList.contains("open")&&o.scrollIntoView({behavior:"smooth",block:"start"})}}))}));document.querySelectorAll(".navbar_accordion-item").forEach((e=>{I.observe(e,{attributes:!0})}));const j=new URL(window.location.href),x=new URLSearchParams(j.search),$=x.get("t");if(x.has("referrer")&&null!=$){t(document.cookie,"referrer_token")!==$&&(d("referrer_token"),a("referrer_token",$,365,".deriv.com"))}const P=document.getElementById("navbar-home_login");P&&P.addEventListener("click",(function(e){e.preventDefault(),window.location.href=s()}));const O=document.getElementById("res-navbar-home_login");O&&O.addEventListener("click",(function(e){e.preventDefault(),window.location.href=s()}));const R=document.getElementById("white-navbar_login");R&&R.addEventListener("click",(function(e){e.preventDefault(),window.location.href=s()}));const W=document.getElementById("res-white-navbar_login");W&&W.addEventListener("click",(function(e){e.preventDefault(),window.location.href=s()})),window.customLoader="static version",window.getClientCountry();const B=window.parseCookies(document.cookie,"webflow-user-language"),D=["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"];if(window.location.pathname.endsWith("p2p")&&!window.location.pathname.startsWith("/blog")){const e=window.getClientCountry();e&&D.includes(e)&&("en"===B?window.location.replace("/404"):window.location.replace(`/${B}/404`))}if(void 0!==window.parseCookies(document.cookie,"client_information")){let e=function(e){e.forEach((e=>{e.href="https://app.deriv.com/appstore/traders-hub"}))},o=document.querySelectorAll("a.live-markets_button.is-secondary.is-small.is-purchase.w-button"),n=document.querySelectorAll("a.live-markets_button.is-secondary.is-small.is-sell.w-button");e(o),e(n)}document.getElementById("mobile-menu"),document.getElementById("live_chat-wrapper");const U=()=>{window.LC_API&&window.LC_API.open_chat_window&&window.LC_API.open_chat_window()},H=()=>{"true"===new URLSearchParams(window.location.search).get("is_livechat_open")&&U()},J=e=>{var o;null==(o=null==window?void 0:window.LiveChatWidget)||o.on("ready",(()=>{window.LC_API.open_chat_window(),window.LC_API.hide_chat_window(),H();const o=window.parseCookies(document.cookie,"utm_data"),n=o?JSON.parse(o):{},{utm_source:i,utm_medium:a,utm_campaign:t}=n,r=window.parseCookies(document.cookie,"client_information"),d=new URLSearchParams(window.location.search),{loginid:s,email:c,landing_company_shortcode:u,currency:l,residence:p,first_name:w,last_name:h}=r?JSON.parse(r):{},y={is_logged_in:e,loginid:s??"",landing_company_shortcode:u??"",currency:l??"",residence:p??"",email:c??"",platform:d.get("platform")??"",utm_source:i??"",utm_medium:a??"",utm_campaign:t??""};window.LiveChatWidget.call("set_session_variables",y),e?(c&&window.LiveChatWidget.call("set_customer_email",c),w&&h&&window.LiveChatWidget.call("set_customer_name",`${w} ${h}`)):window.LC_API.on_chat_ended=()=>{window.LiveChatWidget.call("set_customer_email"," "),window.LiveChatWidget.call("set_customer_name"," ")},H(),window.LiveChatWidget.on("new_event",(e=>{e.greeting&&window.LC_API.open_chat_window()}))}))};let T=!1;const M=()=>{const e=!!window.parseCookies(document.cookie,"client_information");e!==T&&(J(e),T=e)};M(),setInterval(M,2e3),(()=>{if(window.__lc=window.__lc||{},window.__lc.license="12049137",window.LC_API=window.LC_API||{loaded:!1},window.LC_API.loaded)H();else{const e=document.createElement("script");e.async=!0,e.src="https://cdn.livechatinc.com/tracking.js",e.onload=()=>{window.LC_API.loaded=!0,window.LC_API.on_after_load=function(){J(!!window.parseCookies(document.cookie,"client_information")),H()},"undefined"!=typeof LiveChatWidget&&LiveChatWidget.init&&LiveChatWidget.init()},document.body.appendChild(e)}})();const V=document.querySelectorAll(".livechatbtn");V.length>0&&V.forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault(),U()}))}));const F=document.getElementById("liveChatBtn");F&&F.addEventListener("click",(e=>{e.preventDefault(),U()}));document.querySelectorAll('a[rel="liveChatBtn"]').forEach((e=>{null==e||e.addEventListener("click",(e=>{e.preventDefault(),U()}))})); \ No newline at end of file From b7b70542f2153e2ea39a36bfa029f53f13f5c4ad Mon Sep 17 00:00:00 2001 From: Prince Date: Tue, 17 Sep 2024 11:00:13 +0400 Subject: [PATCH 27/57] chore: migrated all --- src/js/footer/index.js | 2 +- src/js/footer/migration.js | 915 +++++++++++++++++++++++++++++++++++++ src/js/footer/test.js | 329 ------------- src/temp-static.js | 2 +- 4 files changed, 917 insertions(+), 331 deletions(-) create mode 100644 src/js/footer/migration.js delete mode 100644 src/js/footer/test.js diff --git a/src/js/footer/index.js b/src/js/footer/index.js index 95cc809..b936647 100644 --- a/src/js/footer/index.js +++ b/src/js/footer/index.js @@ -16,4 +16,4 @@ import "./disclaimerAddClassname"; import "./mobileMenuAccordian"; import "./partnerAffiliate"; import "./loginFunctions"; -import "./test.js" \ No newline at end of file +import "./migration.js" \ No newline at end of file diff --git a/src/js/footer/migration.js b/src/js/footer/migration.js new file mode 100644 index 0000000..88d55d5 --- /dev/null +++ b/src/js/footer/migration.js @@ -0,0 +1,915 @@ + + +alert('migrated scripts: all') + +window.customLoader = "static version all" + +// + +var Webflow = Webflow || []; +Webflow.push(function () { + let currentLocaleElement = document.querySelector( + ".locale > .new-navbar_dropdown-link.w--current" + ); + + if (currentLocaleElement) { + let currentLocaleIsoCode = currentLocaleElement.getAttribute("hreflang"); + + let currentLocaleIsoCodeTexts = document.querySelectorAll( + ".current-locale-iso-code" + ); + + if (currentLocaleIsoCode && currentLocaleIsoCodeTexts.length) { + for (let currentLocaleIsoCodeText of currentLocaleIsoCodeTexts) { + currentLocaleIsoCodeText.innerText = currentLocaleIsoCode; + } + } + } +}); + +// + + + +// Function for setting cookies when changing language and redirecting to the current language page + +function setCookie(name, value, days) { + let expires = ""; + if (days) { + let date = new Date(); + date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000); + expires = "; expires=" + date.toUTCString(); + } + document.cookie = name + "=" + (value || "") + expires + "; path=/"; +} + +function getCookie(name) { + let cookies = document.cookie.split(";"); + for (let i = 0; i < cookies.length; i++) { + let cookie = cookies[i].trim(); + if (cookie.startsWith(name + "=")) { + return cookie.substring(name.length + 1); + } + } + return null; +} + +let localeItems = document.querySelectorAll(".w-locales-items"); + +if (localeItems.length > 0) { + localeItems.forEach(function (item) { + let links = item.querySelectorAll("a"); + links.forEach(function (link) { + link.addEventListener("click", function (event) { + event.preventDefault(); + let language = link.getAttribute("hreflang"); + setCookie("webflow-user-language", language, 30); + window.location.href = link.href; + }); + }); + }); + + function clickLinkWithLanguage(language) { + let link = document.querySelector('a[hreflang="' + language + '"]'); + if (link && window.location.pathname !== link.getAttribute("href")) { + link.click(); + } + } + window.setLanguageCookie = (language) => { + setCookie("webflow-user-language", language, 30); + }; + + let languageCookie = getCookie("webflow-user-language"); + let targetPaths = [ + "/careers", + "/locations", + "/derivtech", + "/derivlife", + "/eu-careers", + "/our-locations", + ]; + let path = window.location.pathname; + let targetPathUrl = false; + + // Check if the current path matches any of the target paths + if (targetPaths.some((targetPath) => path.includes(targetPath))) { + targetPathUrl === true; + } + if (languageCookie && targetPathUrl) { + clickLinkWithLanguage(languageCookie); + } +} + + +var Webflow = Webflow || []; +Webflow.push(function () { + if (document.querySelector(".new-navbar_component")) { + // Find the .new-navbar_component element + const navbarComponent = document.querySelector(".new-navbar_component"); + + // Add event listeners for hover + navbarComponent.addEventListener("mouseenter", () => { + if (window.innerWidth > 991) { + disableScroll(); + } + }); + navbarComponent.addEventListener("mouseleave", () => { + if (window.innerWidth > 991) { + enableScroll(); + } + }); + + // Function to disable scroll + function disableScroll() { + document.body.classList.add("disable-scroll"); + } + + // Function to enable scroll + function enableScroll() { + document.body.classList.remove("disable-scroll"); + } + } +}); + + + +const clientsCountry = window.getClientCountry(); + +const getDateFirstContact = () => { + const dateFirstContactString = window.parseCookies( + document.cookie, + "date_first_contact" + ); + if (dateFirstContactString) { + const parsedData = JSON.parse(dateFirstContactString); + return parsedData.date_first_contact + ? { date_first_contact: parsedData.date_first_contact } + : null; + } + return null; +}; + +const getSignupDevice = () => { + const signupDeviceString = window.parseCookies( + document.cookie, + "signup_device" + ); + if (signupDeviceString) { + const parsedData = JSON.parse(signupDeviceString); + return parsedData.signup_device + ? { signup_device: parsedData.signup_device } + : null; + } + return null; +}; + +const lang = window.parseCookies(document.cookie, "webflow-user-language"); + +const countriesToRedirect = [ + "as", + "au", + "at", + "be", + "bg", + "ca", + "hr", + "cy", + "cz", + "dk", + "ee", + "fi", + "fr", + "gr", + "gu", + "gg", + "hk", + "hu", + "ir", + "ie", + "im", + "il", + "it", + "je", + "ng", + "mm", + "sy", + "kp", + "lv", + "lt", + "lu", + "my", + "mt", + "nl", + "nz", + "mp", + "py", + "pl", + "pt", + "pr", + "ro", + "rw", + "sk", + "si", + "es", + "se", + "ae", + "gb", + "us", + "um", + "vu", + "vi", + "ky", + "cu", + "de", +]; + +if ( + window.location.pathname.endsWith("p2p") && + !window.location.pathname.startsWith("/blog") +) { + const clientsCountry = window.getClientCountry(); + if (clientsCountry && countriesToRedirect.includes(clientsCountry)) { + if (lang === "en") { + window.location.replace("/404"); + } else { + window.location.replace(`/${lang}/404`); + } + } +} + +if ( + window.parseCookies(document.cookie, "client_information") !== undefined +) { + let purchaseButtons = document.querySelectorAll( + "a.live-markets_button.is-secondary.is-small.is-purchase.w-button" + ); + + let sellButtons = document.querySelectorAll( + "a.live-markets_button.is-secondary.is-small.is-sell.w-button" + ); + + function updateHref(buttons) { + buttons.forEach((button) => { + button.href = "https://app.deriv.com/appstore/traders-hub"; + }); + } + + updateHref(purchaseButtons); + updateHref(sellButtons); +} + +//live chat button hide on menu appear +const mobileMenu = document.getElementById("mobile-menu"); +const liveChatWrapper = document.getElementById("live_chat-wrapper"); + +let isLiveChatVisible = true; +let isLiveChatActivated = false; + +function fadeIn(element) { + var opacity = 0; + var timer = setInterval(function () { + if (opacity >= 1) { + clearInterval(timer); + } + element.style.opacity = opacity; + opacity += 0.1; + }, 30); +} + +function fadeOut(element) { + var opacity = 1; + var timer = setInterval(function () { + if (opacity <= 0) { + clearInterval(timer); + element.style.display = "none"; + } + element.style.opacity = opacity; + opacity -= 0.1; + }, 30); +} + + + +// + +const licenceKey = "12049137"; +const loadLiveChatScript = () => { + window.__lc = window.__lc || {}; + window.__lc.license = licenceKey; + window.LC_API = window.LC_API || { loaded: false }; + if (!window.LC_API.loaded) { + const lcScript = document.createElement("script"); + lcScript.async = true; + lcScript.src = "https://cdn.livechatinc.com/tracking.js"; + lcScript.onload = () => { + window.LC_API.loaded = true; // Mark as loaded + window.LC_API.on_after_load = function () { + performLiveChatAction( + !!window.parseCookies(document.cookie, "client_information") + ); + checkUrlForLiveChat(); + }; + if (typeof LiveChatWidget !== "undefined" && LiveChatWidget.init) { + LiveChatWidget.init(); + } + }; + document.body.appendChild(lcScript); + } else { + checkUrlForLiveChat(); + } +}; +const openLiveChat = () => { + if (window.LC_API && window.LC_API.open_chat_window) { + window.LC_API.open_chat_window(); + } +}; +const checkUrlForLiveChat = () => { + const urlParams = new URLSearchParams(window.location.search); + if (urlParams.get("is_livechat_open") === "true") { + openLiveChat(); + } +}; + +//dashboard send data +const performLiveChatAction = (is_logged_in) => { + window?.LiveChatWidget?.on("ready", () => { + // we open and close the window to trigger the widget to listen for new events + window.LC_API.open_chat_window(); + window.LC_API.hide_chat_window(); + checkUrlForLiveChat(); + + const utm_data_string = window.parseCookies(document.cookie, "utm_data"); + const utm_data = utm_data_string ? JSON.parse(utm_data_string) : {}; + const { utm_source, utm_medium, utm_campaign } = utm_data; + + const client_information = window.parseCookies( + document.cookie, + "client_information" + ); + const url_params = new URLSearchParams(window.location.search); + + const { + loginid, + email, + landing_company_shortcode, + currency, + residence, + first_name, + last_name, + } = client_information ? JSON.parse(client_information) : {}; + + /* the session variables are sent to CS team dashboard to notify user has logged in + and also acts as custom variables to trigger targeted engagement */ + const session_variables = { + is_logged_in: is_logged_in, + loginid: loginid ?? "", + landing_company_shortcode: landing_company_shortcode ?? "", + currency: currency ?? "", + residence: residence ?? "", + email: email ?? "", + platform: url_params.get("platform") ?? "", + utm_source: utm_source ?? "", + utm_medium: utm_medium ?? "", + utm_campaign: utm_campaign ?? "", + }; + + window.LiveChatWidget.call("set_session_variables", session_variables); + + if (is_logged_in) { + if (email) { + window.LiveChatWidget.call("set_customer_email", email); + } + if (first_name && last_name) { + window.LiveChatWidget.call( + "set_customer_name", + `${first_name} ${last_name}` + ); + } + } else { + // clear name and email fields after chat has ended + window.LC_API.on_chat_ended = () => { + window.LiveChatWidget.call("set_customer_email", " "); + window.LiveChatWidget.call("set_customer_name", " "); + }; + } + checkUrlForLiveChat(); + + // open chat widget when there is an incoming greeting/announcement + window.LiveChatWidget.on("new_event", (event) => { + if (event.greeting) { + window.LC_API.open_chat_window(); + } + }); + }); +}; +let is_logged_in = false; +let checkCookieInterval; + +const isLoggedIn = () => { + return !!window.parseCookies(document.cookie, "client_information"); +}; + +const checkLoggedIn = () => { + const new_login_status = isLoggedIn(); + if (new_login_status !== is_logged_in) { + performLiveChatAction(new_login_status); + is_logged_in = new_login_status; + } +}; + +// Perform initial authentication check +checkLoggedIn(); + +// Set interval to periodically check authentication status +checkCookieInterval = setInterval(checkLoggedIn, 2000); +//end of dashboard send data + + +loadLiveChatScript(); +const liveChatIcons = document.querySelectorAll(".livechatbtn"); +if (liveChatIcons.length > 0) { + liveChatIcons.forEach((liveChatIcon) => { + liveChatIcon.addEventListener("click", (event) => { + event.preventDefault(); + openLiveChat(); + }); + }); +} +const liveChatIconById = document.getElementById("liveChatBtn"); +if (liveChatIconById) { + liveChatIconById.addEventListener("click", (event) => { + event.preventDefault(); + openLiveChat(); + }); +} +const liveChatIconsByrel = document.querySelectorAll( + 'a[rel="liveChatBtn"]' +); +liveChatIconsByrel.forEach((liveChatIcon) => { + liveChatIcon?.addEventListener("click", (event) => { + event.preventDefault(); + openLiveChat(); + }); +}); + + +// + + +// +var Webflow = Webflow || []; +Webflow.push(function () { + let navbarMenuBtn = document.querySelector(".navbar_menu-button"); + + if (navbarMenuBtn) { + navbarMenuBtn.addEventListener("click", function () { + let windowHeight = window.innerHeight; + + let navbarWrapper = document.querySelector(".new-navbar_main-wrapper"); + + if (navbarWrapper) { + let navbarHeight = navbarWrapper.offsetHeight; + + let calculatedHeight = windowHeight - navbarHeight; + + let navbarMenu = document.querySelector(".new-navbar_menu"); + if (navbarMenu) { + navbarMenu.style.height = `${calculatedHeight}px`; + } + } + }); + } +}); +// + + +// +// this code ensures opening a list of languages on mobile starting from the top +var Webflow = Webflow || []; +Webflow.push(function () { + let langMobButton = document.querySelector(".lang-mob"); + + if (langMobButton) { + langMobButton.addEventListener("click", function () { + let mobileMenuWrapper = document.querySelector( + ".new-navbar_menu-wrapper" + ); + + if (mobileMenuWrapper) { + mobileMenuWrapper.scrollBy({ top: -3000 }); + } + }); + } +}); +// + + +// +class CookieStorage { + constructor(cookieName) { + this.cookieName = cookieName; + } + + setItem(value) { + const expiryDate = new Date(); + expiryDate.setDate(expiryDate.getDate() + 30); // 30 days from now + const expires = "expires=" + expiryDate.toUTCString(); + const cookieValue = encodeURIComponent(JSON.stringify(value)); + document.cookie = `${this.cookieName}=${cookieValue};${expires};path=/`; + } + getItem() { + const cookies = document.cookie.split(";"); + for (let i = 0; i < cookies.length; i++) { + let cookie = cookies[i].trim(); + if (cookie.startsWith(`${this.cookieName}=`)) { + let cookieValue = cookie.substring(`${this.cookieName}=`.length); + return JSON.parse(decodeURIComponent(cookieValue)); + } + } + return null; + } +} + +const tracking_status_cookie = new CookieStorage("tracking_status"); +const tracking_status_cookie_declined = new CookieStorage( + "tracking_status_decline" +); + +const popupElement = document.querySelector(".cookies_background-wrapper"); + +//set datalayer details +const has_dataLayer = window.dataLayer; +var client_information = window.parseCookies( + document.cookie, + "client_information" +); + +is_logged_in = !!client_information; +has_dataLayer && + window.dataLayer.push({ + loggedIn: is_logged_in, + language: + window.parseCookies(document.cookie, "webflow-user-language") || "en", + ...(is_logged_in && { + visitorId: client_information?.loginid, + currency: client_information?.currency, + email: client_information?.email, + }), + }); + +// Check if pathname contains "eu" and tracking_status_cookie is null + +if ( + window.location.pathname.includes("eu") && + !tracking_status_cookie.getItem() && + !tracking_status_cookie_declined.getItem() +) { + popupElement.classList.remove("hide-element"); + document.body.classList.add("show-cookie"); +} + +// Select the accept and decline buttons +const acceptButton = document.getElementById("accept-cookie"); +const declineButton = document.getElementById("dont-accept-cookie"); + +acceptButton?.addEventListener("click", function () { + tracking_status_cookie.setItem(true); + popupElement.classList.add("hide-element"); + document.body.classList.remove("show-cookie"); +}); + +declineButton?.addEventListener("click", function () { + tracking_status_cookie_declined.setItem(true); + tracking_status_cookie.setItem(false); + popupElement.classList.add("hide-element"); + document.body.classList.remove("show-cookie"); +}); + + + +// +var targetPaths = [ + "/careers", + "/locations", + "/derivtech", + "/derivlife", + "/eu-careers", + "/our-locations", +]; +var path = window.location.pathname; +if (targetPaths.some((targetPath) => path.includes(targetPath))) { + var headTag = document.head; + var linkElements = headTag.querySelectorAll("link"); + linkElements.forEach(function (linkElement) { + if (linkElement.hasAttribute("hreflang")) { + if (linkElement.getAttribute("hreflang") !== "x-default") { + linkElement.remove(); + } + } + }); +} +// + + + +// + +const setEvent = (event) => { + let storedEvents = []; + let cacheCookie = parseCookies(document.cookie, "cached_analytics_events"); + if (cacheCookie) storedEvents = JSON.parse(cacheCookie); + + storedEvents.push(event); + document.cookie = `cached_analytics_events=${JSON.stringify( + storedEvents + )}; path=/; Domain=.deriv.com`; +}; + +const trackEventWithCache = (event) => { + if (window.rudderanalytics) { + window.rudderanalytics.track(event.name, event.properties); + } else { + setEvent(event); + } +}; + +window.addClickListener = function (button, eventName, eventProperties) { + if (button) { + button.addEventListener("click", function () { + trackEventWithCache({ + name: eventName, + properties: eventProperties, + }); + }); + } +}; + +var btnLiveChat = document?.getElementsByClassName("livechatbtn"); +var btnWhatsapp = document?.getElementsByClassName("whatsapp_chat"); +var btnTradershub = document?.getElementsByClassName("tradershub-btn"); +var btnTryFreeDemo = document.querySelectorAll(".btn-free-demo .w-button"); +var btnTryFreeDemoFooter = document.querySelectorAll( + '.btn-free-demo [data-class="w-button"]' +); + +const btnNavbarPrimary = document.querySelectorAll( + '[data-attributes="btn-primary-nav"]' +); +const btnLoginNavbar = document.querySelectorAll( + '[data-attributes="btn-secondary-nav"]' +); + +if (btnLiveChat) { + Array.from(btnLiveChat).forEach((button) => { + window.addClickListener(button, "ce_widget_usage_form", { + action: "click", + widget_name: "livechat", + }); + }); +} +if (btnWhatsapp) { + Array.from(btnWhatsapp).forEach((button) => { + window.addClickListener(button, "ce_widget_usage_form", { + action: "click", + widget_name: "whatsapp", + }); + }); +} +if (btnTradershub) { + Array.from(btnTradershub).forEach((button) => { + window.addClickListener(button, "ce_cta_clicks", { + action: "click", + cta_name: "Traders Hub", + }); + }); +} +if (btnTryFreeDemo) { + Array.from(btnTryFreeDemo).forEach((button) => { + window.addClickListener(button, "ce_cta_clicks", { + action: "click", + cta_name: "Try free demo", + }); + }); +} +if (btnTryFreeDemoFooter) { + Array.from(btnTryFreeDemoFooter).forEach((button) => { + window.addClickListener(button, "ce_cta_clicks", { + action: "click", + cta_name: "Try free demo", + }); + }); +} + +if (btnNavbarPrimary) { + Array.from(btnNavbarPrimary).forEach((button) => { + if (!button.classList.contains("tradershub-btn")) { + window.addClickListener(button, "ce_cta_clicks", { + action: "click", + cta_name: "Try free demo", + }); + } + }); +} + +if (btnLoginNavbar) { + Array.from(btnLoginNavbar).forEach((button) => { + window.addClickListener(button, "ce_cta_clicks", { + action: "click", + cta_name: "Login", + }); + }); +} + +const RUDDERSTACK_STAGING_KEY = "1lN3tsFD2nruGFgM5F074DC2hMB"; +const RUDDERSTACK_PRODUCTION_KEY = "1oV5agvlcnCZ6IH94wCKM1oR8Pd"; +const GB_STAGING_CLIENT_KEY = "sdk-9wuqJ1mlcQsSyZQ"; +const GB_STAGING_DECRYPTION_KEY = ""; +const GB_PROD_CLIENT_KEY = "sdk-UhZV3cNEg5nLNLNS"; +const GB_PROD_DECRYPTION_KEY = "nre64BV0dNIa44zW4tz5ow=="; +var GB_CLIENT_KEY, RUDDERSTACK_KEY, GB_DECRYPTION_KEY; +if ( + window.location.hostname === "deriv.com" || + window.location.hostname === "deriv.be" || + window.location.hostname === "deriv.me" +) { + GB_CLIENT_KEY = GB_PROD_CLIENT_KEY; + GB_DECRYPTION_KEY = GB_PROD_DECRYPTION_KEY; + RUDDERSTACK_KEY = RUDDERSTACK_PRODUCTION_KEY; +} else { + GB_CLIENT_KEY = GB_STAGING_CLIENT_KEY; + GB_DECRYPTION_KEY = GB_STAGING_DECRYPTION_KEY; + RUDDERSTACK_KEY = RUDDERSTACK_STAGING_KEY; +} +client_information = window.parseCookies( + document.cookie, + "client_information" +); +const clientInfo = client_information + ? JSON.parse(client_information) + : null; +const utm_data_string = window.parseCookies(document.cookie, "utm_data"); +const utm_data = utm_data_string ? JSON.parse(utm_data_string) : {}; +const { utm_source, utm_medium, utm_campaign } = utm_data; +const cookies = window.parseCookies(document.cookie, "signup_device"); +let signupDevice = null; +const isBrowser = () => typeof window !== "undefined"; +const getLanguage = () => + isBrowser() ? localStorage.getItem("i18n") || navigator.language : null; +if (cookies) { + signupDevice = JSON.parse(cookies)?.signup_device || null; +} +const initialiseConfig = { + growthbookKey: GB_CLIENT_KEY, + growthbookDecryptionKey: GB_DECRYPTION_KEY, + rudderstackKey: RUDDERSTACK_KEY, + growthbookOptions: { + navigate: (url) => window.location.replace(url), + antiFlicker: false, + navigateDelay: 0, + attributes: { + country: + window.parseCookies(document.cookie, "clients_country") || + window.parseCookies(document.cookie, "website_status"), + user_language: + window.parseCookies(document.cookie, "user_language") || + getLanguage(), + device_language: + window.parseCookies(document.cookie, "language") || " ", + device_type: signupDevice, + utm_source: utm_data?.["utm_source"], + utm_medium: utm_data?.["utm_medium"], + utm_campaign: utm_data?.["utm_campaign"], + is_authorised: !!window.parseCookies( + document.cookie, + "client_information" + ), + loggedIn: !!window.parseCookies( + document.cookie, + "client_information" + ), + url: window.location.href, + }, + }, +}; +try { + Analytics?.Analytics.initialise(initialiseConfig); + // Analytics?.Analytics?.getInstances()?.ab?.GrowthBook?.loadFeatures(); + const userId = clientInfo?.user_id + ? clientInfo?.user_id + : Analytics?.Analytics?.getInstances?.().tracking?.getAnonymousId(); + Analytics?.Analytics?.identifyEvent(userId); +} catch (error) { + console.error("Error during initialisation:", error); +} +// Analytics?.Analytics?.getInstances()?.ab?.GrowthBook?.loadFeatures(); +Analytics?.Analytics?.pageView(location.pathname, "Deriv.com"); +// Analytics?.Analytics?.getInstances()?.ab?.GrowthBook?.setURL(window.location.href) +window.useGrowthbookFeatureFlag = function ({ featureFlag }) { + let featureFlagValue = Analytics?.Analytics?.getFeatureValue(featureFlag); + function updateFeatureFlagValue() { + const value = Analytics?.Analytics?.getFeatureValue(featureFlag); + featureFlagValue = value; + } + Analytics?.Analytics?.getInstances()?.ab?.GrowthBook?.setRenderer( + updateFeatureFlagValue + ); + return featureFlagValue; +}; + +// + + + +// Parse the cookies to get the 'client_information' cookie value +const cookieValue = window.parseCookies(document.cookie, "client_information") + ? JSON.parse(window.parseCookies(document.cookie, "client_information")) + : null; + +// Hotjar integration +if (cookieValue?.loginid) { + window?.hj("identify", cookieValue.loginid, { + is_logged_in: !!window.parseCookies( + document.cookie, + "client_information" + ), + landing_company_shortcode: + cookieValue.landing_company_shortcode || "null", + }); +} + + + +const updateLinkHrefs = () => { + const featureFlagValue = Analytics?.Analytics?.getFeatureValue( + "trigger_os_signup_wf" + ); + const handleOutSystemsRedirection = () => { + const currentDomain = window.location.hostname; + let env; + if ( + currentDomain === "deriv.com" || + currentDomain === "deriv.be" || + currentDomain === "deriv.me" + ) { + env = "production"; + } else if (currentDomain === "staging.deriv.com") { + env = "staging"; + } else { + env = "development"; + } + switch (env) { + case "production": + return "https://hub.deriv.com/tradershub/signup"; + case "staging": + return "https://staging-hub.deriv.com/tradershub/signup"; + default: + return "https://dev-hub.deriv.com/tradershub/signup"; + } + }; + + function isSafari() { + const ua = navigator.userAgent.toLowerCase(); + return /safari/.test(ua) && !/chrome/.test(ua) && !/crios/.test(ua); + } + + function isIOS() { + const ua = navigator.userAgent.toLowerCase(); + return /ipad|iphone|ipod/.test(ua); + } + + const newHref = featureFlagValue + ? isIOS() || isSafari() + ? `https://${window.location.host}/signup` + : handleOutSystemsRedirection() + : `https://${window.location.host}/signup`; + + // Update href attributes + const mainSignupButton = document.getElementById("cta-home-btn-navbar"); + if (mainSignupButton) { + mainSignupButton.href = newHref; + } + + const signupButtons = document.querySelectorAll(".logged-out-btn"); + signupButtons?.forEach((btn) => { + if (btn?.href?.indexOf("/signup") > 0) { + btn.href = newHref; + } + }); + + const signupButtonsPlatforms = + document.querySelectorAll(".logged-out-btn a"); + signupButtonsPlatforms?.forEach((btn) => { + if (btn?.href?.indexOf("/signup") > 0) { + btn.href = newHref; + } + }); +}; + +Analytics?.Analytics?.getInstances() + ?.ab?.GrowthBook?.loadFeatures() + .then(() => { + if (window.location.href.indexOf("/partners") > -1 === false) { + updateLinkHrefs(); + } + }); + diff --git a/src/js/footer/test.js b/src/js/footer/test.js deleted file mode 100644 index 7068c72..0000000 --- a/src/js/footer/test.js +++ /dev/null @@ -1,329 +0,0 @@ - - - - -window.customLoader = "static version" - -// Listen for DOMContentLoaded event - -const clientsCountry = window.getClientCountry(); - -const getDateFirstContact = () => { - const dateFirstContactString = window.parseCookies( - document.cookie, - "date_first_contact" - ); - if (dateFirstContactString) { - const parsedData = JSON.parse(dateFirstContactString); - return parsedData.date_first_contact - ? { date_first_contact: parsedData.date_first_contact } - : null; - } - return null; -}; - -const getSignupDevice = () => { - const signupDeviceString = window.parseCookies( - document.cookie, - "signup_device" - ); - if (signupDeviceString) { - const parsedData = JSON.parse(signupDeviceString); - return parsedData.signup_device - ? { signup_device: parsedData.signup_device } - : null; - } - return null; -}; - -const lang = window.parseCookies(document.cookie, "webflow-user-language"); - -const countriesToRedirect = [ - "as", - "au", - "at", - "be", - "bg", - "ca", - "hr", - "cy", - "cz", - "dk", - "ee", - "fi", - "fr", - "gr", - "gu", - "gg", - "hk", - "hu", - "ir", - "ie", - "im", - "il", - "it", - "je", - "ng", - "mm", - "sy", - "kp", - "lv", - "lt", - "lu", - "my", - "mt", - "nl", - "nz", - "mp", - "py", - "pl", - "pt", - "pr", - "ro", - "rw", - "sk", - "si", - "es", - "se", - "ae", - "gb", - "us", - "um", - "vu", - "vi", - "ky", - "cu", - "de", -]; - -if ( - window.location.pathname.endsWith("p2p") && - !window.location.pathname.startsWith("/blog") -) { - const clientsCountry = window.getClientCountry(); - if (clientsCountry && countriesToRedirect.includes(clientsCountry)) { - if (lang === "en") { - window.location.replace("/404"); - } else { - window.location.replace(`/${lang}/404`); - } - } -} - -if ( - window.parseCookies(document.cookie, "client_information") !== undefined -) { - let purchaseButtons = document.querySelectorAll( - "a.live-markets_button.is-secondary.is-small.is-purchase.w-button" - ); - - let sellButtons = document.querySelectorAll( - "a.live-markets_button.is-secondary.is-small.is-sell.w-button" - ); - - function updateHref(buttons) { - buttons.forEach((button) => { - button.href = "https://app.deriv.com/appstore/traders-hub"; - }); - } - - updateHref(purchaseButtons); - updateHref(sellButtons); -} - -//live chat button hide on menu appear -const mobileMenu = document.getElementById("mobile-menu"); -const liveChatWrapper = document.getElementById("live_chat-wrapper"); - -let isLiveChatVisible = true; -let isLiveChatActivated = false; - -function fadeIn(element) { - var opacity = 0; - var timer = setInterval(function () { - if (opacity >= 1) { - clearInterval(timer); - } - element.style.opacity = opacity; - opacity += 0.1; - }, 30); -} - -function fadeOut(element) { - var opacity = 1; - var timer = setInterval(function () { - if (opacity <= 0) { - clearInterval(timer); - element.style.display = "none"; - } - element.style.opacity = opacity; - opacity -= 0.1; - }, 30); -} - - - -// - -const licenceKey = "12049137"; -const loadLiveChatScript = () => { - window.__lc = window.__lc || {}; - window.__lc.license = licenceKey; - window.LC_API = window.LC_API || { loaded: false }; - if (!window.LC_API.loaded) { - const lcScript = document.createElement("script"); - lcScript.async = true; - lcScript.src = "https://cdn.livechatinc.com/tracking.js"; - lcScript.onload = () => { - window.LC_API.loaded = true; // Mark as loaded - window.LC_API.on_after_load = function () { - performLiveChatAction( - !!window.parseCookies(document.cookie, "client_information") - ); - checkUrlForLiveChat(); - }; - if (typeof LiveChatWidget !== "undefined" && LiveChatWidget.init) { - LiveChatWidget.init(); - } - }; - document.body.appendChild(lcScript); - } else { - checkUrlForLiveChat(); - } -}; -const openLiveChat = () => { - if (window.LC_API && window.LC_API.open_chat_window) { - window.LC_API.open_chat_window(); - } -}; -const checkUrlForLiveChat = () => { - const urlParams = new URLSearchParams(window.location.search); - if (urlParams.get("is_livechat_open") === "true") { - openLiveChat(); - } -}; - -//dashboard send data -const performLiveChatAction = (is_logged_in) => { - window?.LiveChatWidget?.on("ready", () => { - // we open and close the window to trigger the widget to listen for new events - window.LC_API.open_chat_window(); - window.LC_API.hide_chat_window(); - checkUrlForLiveChat(); - - const utm_data_string = window.parseCookies(document.cookie, "utm_data"); - const utm_data = utm_data_string ? JSON.parse(utm_data_string) : {}; - const { utm_source, utm_medium, utm_campaign } = utm_data; - - const client_information = window.parseCookies( - document.cookie, - "client_information" - ); - const url_params = new URLSearchParams(window.location.search); - - const { - loginid, - email, - landing_company_shortcode, - currency, - residence, - first_name, - last_name, - } = client_information ? JSON.parse(client_information) : {}; - - /* the session variables are sent to CS team dashboard to notify user has logged in - and also acts as custom variables to trigger targeted engagement */ - const session_variables = { - is_logged_in: is_logged_in, - loginid: loginid ?? "", - landing_company_shortcode: landing_company_shortcode ?? "", - currency: currency ?? "", - residence: residence ?? "", - email: email ?? "", - platform: url_params.get("platform") ?? "", - utm_source: utm_source ?? "", - utm_medium: utm_medium ?? "", - utm_campaign: utm_campaign ?? "", - }; - - window.LiveChatWidget.call("set_session_variables", session_variables); - - if (is_logged_in) { - if (email) { - window.LiveChatWidget.call("set_customer_email", email); - } - if (first_name && last_name) { - window.LiveChatWidget.call( - "set_customer_name", - `${first_name} ${last_name}` - ); - } - } else { - // clear name and email fields after chat has ended - window.LC_API.on_chat_ended = () => { - window.LiveChatWidget.call("set_customer_email", " "); - window.LiveChatWidget.call("set_customer_name", " "); - }; - } - checkUrlForLiveChat(); - - // open chat widget when there is an incoming greeting/announcement - window.LiveChatWidget.on("new_event", (event) => { - if (event.greeting) { - window.LC_API.open_chat_window(); - } - }); - }); -}; -let is_logged_in = false; -let checkCookieInterval; - -const isLoggedIn = () => { - return !!window.parseCookies(document.cookie, "client_information"); -}; - -const checkLoggedIn = () => { - const new_login_status = isLoggedIn(); - if (new_login_status !== is_logged_in) { - performLiveChatAction(new_login_status); - is_logged_in = new_login_status; - } -}; - -// Perform initial authentication check -checkLoggedIn(); - -// Set interval to periodically check authentication status -checkCookieInterval = setInterval(checkLoggedIn, 2000); -//end of dashboard send data - - -loadLiveChatScript(); -const liveChatIcons = document.querySelectorAll(".livechatbtn"); -if (liveChatIcons.length > 0) { - liveChatIcons.forEach((liveChatIcon) => { - liveChatIcon.addEventListener("click", (event) => { - event.preventDefault(); - openLiveChat(); - }); - }); -} -const liveChatIconById = document.getElementById("liveChatBtn"); -if (liveChatIconById) { - liveChatIconById.addEventListener("click", (event) => { - event.preventDefault(); - openLiveChat(); - }); -} -const liveChatIconsByrel = document.querySelectorAll( - 'a[rel="liveChatBtn"]' -); -liveChatIconsByrel.forEach((liveChatIcon) => { - liveChatIcon?.addEventListener("click", (event) => { - event.preventDefault(); - openLiveChat(); - }); -}); - - -// \ No newline at end of file diff --git a/src/temp-static.js b/src/temp-static.js index a55e5bf..2308602 100644 --- a/src/temp-static.js +++ b/src/temp-static.js @@ -1 +1 @@ -import{initializeApp as e}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-app.js";import{getDatabase as o,ref as n,onValue as i}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-database.js";function a(e,o,n,i){let a="";if(n){let e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),a="; expires="+e.toUTCString()}document.cookie=i?e+"="+(o||"")+a+`;domain=${i};path=/`:e+"="+(o||"")+a+";path=/"}function t(e,o){const n={};return e.split(";").forEach((e=>{const[o,i]=e.split("=").map((e=>e.trim()));n[o]=decodeURIComponent(i)})),n[o]}function r(e){a("webflow-user-language",e,30)}function d(e){document.cookie=e+"=; Max-Age=-99999999;"}window.emailRegex=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,window.toggleErrorField=(e,o)=>{o?e.classList.remove("error-field"):e.classList.add("error-field")},window.disableButton=function(e){e.disabled=!0,e.style.opacity="0.5"},window.isEuRegion=function(e){const o=e.replace(/\/$/,"");return/^\/(?:[^\/]+\/)?eu(?:\/|$)/.test(o)},window.enableButton=function(e){e.disabled=!1,e.style.opacity="1"},window.getOauthUrl=function(){var e=window.location.href,o=new URL(e).hostname,n=["deriv.com","deriv.be","deriv.me"].find((e=>o.endsWith(e)));return n?`https://oauth.${n}`:"https://oauth.deriv.com"},window.getClientCountry=function(){var e;const o=t(document.cookie,"clients_country"),n=t(document.cookie,"client_information");return n&&(null==(e=JSON.parse(n))?void 0:e.residence)||o},window.deriv_com_url="deriv.com",window.deriv_me_url="deriv.me",window.deriv_be_url="deriv.be",window.webflow_domain="webflow.deriv.com",window.staging_url="staging.deriv.com",window.staging_deriv_be_url="staging.deriv.be",window.domain_list_app_id={[window.deriv_com_url]:"16929",[window.deriv_me_url]:"1411",[window.deriv_be_url]:"30767",[window.webflow_domain]:"53503",[window.staging_url]:"16303"},window.getDomain=()=>{var e=window.location.href;return new URL(e).hostname},window.getAppId=()=>{const e=window.getDomain(),o=new URLSearchParams(window.location.search||"").get("app_id");if(o)return o;const n=localStorage.getItem("config.app_id");if(n)return n;const i={[window.webflow_domain]:window.domain_list_app_id[window.webflow_domain],[window.deriv_be_url]:window.domain_list_app_id[window.deriv_be_url],[window.deriv_me_url]:window.domain_list_app_id[window.deriv_me_url],[window.staging_url]:window.domain_list_app_id[window.staging_url]};return i[e]?i[e]:window.domain_list_app_id[window.deriv_com_url]};const s=()=>{const e=localStorage.getItem("config.server_url"),o=t(document.cookie,"webflow-user-language");let n=o?o.toLowerCase():"en";"zh-cn"!==n&&"zh-tw"!==n||(n=n.replace("-","_"));const i=(e=>{let o="";return e&&Object.keys(e).forEach((n=>{o+=`&${n}=${e[n]}`})),o})((()=>{const e=t(document.cookie,"utm_data");if(e){const o=JSON.parse(e),n={};return["utm_source","utm_ad_id","utm_adgroup_id","utm_adrollclk_id","utm_campaign","utm_campaign_id","utm_content","utm_fbcl_id","utm_gl_client_id","utm_medium","utm_msclk_id","utm_term"].forEach((e=>{o.hasOwnProperty(e)&&(n[e]=o[e])})),n}return null})()),a=t(document.cookie,"affiliate_tracking"),r=a?`&affiliate_token=${a}`:"",d=void["mt5","bot","derivx"].filter((e=>window.location.pathname.includes(e)&&e))||"";return e&&/qa/.test(e)?`https://${e}/oauth2/authorize?app_id=${window.getAppId()}&l=${n}&brand=deriv${r}${i}&platform=${d}`:`${window.getOauthUrl()}/oauth2/authorize?app_id=${(()=>{const e=window.getDomain();return e===window.deriv_me_url?window.domain_list_app_id[window.deriv_me_url]:e===window.deriv_be_url?window.domain_list_app_id[window.deriv_be_url]:e===window.webflow_domain?window.domain_list_app_id[window.webflow_domain]:window.domain_list_app_id[window.deriv_com_url]})()}&l=${n}&brand=deriv${r}${i}&platform=${d}`};if(!!!t(document.cookie,"client_information")){var c=document.createElement("iframe");c.src=(()=>{const e=window.location.hostname;let o;switch(o="deriv.com"===e||"deriv.be"===e||"deriv.me"===e?"production":"staging.deriv.com"===e?"staging":"development",o){case"production":return"https://hub.deriv.com/tradershub/signup";case"staging":return"https://staging-hub.deriv.com/tradershub/signup";default:return"https://dev-hub.deriv.com/tradershub/signup"}})(),c.style.width="0",c.style.height="0",c.style.border="none",c.style.visibility="hidden",c.setAttribute("sandbox","allow-same-origin allow-scripts"),document.body.appendChild(c)}window.establishWebSocketConnection=()=>new Promise(((e,o)=>{const n=t(document.cookie,"webflow-user-language"),i=n?n.toLowerCase():"en",a=localStorage.getItem("config.server_url")||"green.derivws.com";window.websocket=new WebSocket(`wss://${a}/websockets/v3?app_id=${window.getAppId()}&l=${i||"en"}&brand=deriv`),window.websocket.addEventListener("open",(o=>{window.websocket.addEventListener("close",(()=>{window.websocket.close()})),window.websocket.addEventListener("message",(e=>{JSON.parse(e.data)})),e(window.websocket)})),window.websocket.addEventListener("error",(e=>{var n;null==(n=null==window?void 0:window.websocket)||n.close(),o(e)}))})),window.socketMessageSend=async(e,o)=>{var n;try{return(null==window?void 0:window.websocket)&&(null==(n=null==window?void 0:window.websocket)?void 0:n.readyState)===(null==WebSocket?void 0:WebSocket.OPEN)?(window.websocket.send(e),new Promise(((e,n)=>{window.websocket.addEventListener("message",(i=>{const a=JSON.parse(i.data);o===a.msg_type&&(a.error?n(a.error):e(a))}))}))):establishWebSocketConnection().then((()=>(websocket.send(e),new Promise(((e,n)=>{websocket.addEventListener("message",(i=>{const a=JSON.parse(i.data);o===a.msg_type&&(a.error?n(a.error):e(a))}))}))))).catch((e=>Promise.reject(e)))}catch(i){return Promise.reject(i)}};const u=[{id:"appgallery",selectors:[".footer_banner-badge.gallery.w-inline-block",".app-download_link-wrapper.appgallery.w-inline-block"],countries:["af","ax","al","dz","as","ad","ao","aq","am","au","at","az","bh","bd","by","be","bj","bm","bt","bo","ba","bw","bv","br","io","bn","bg","bf","bi","kh","cm","ca","cv","bq","cf","td","cn","cx","cc","km","cg","cd","ck","ci","hr","cu","cw","cy","cz","dk","dj","dm","eg","gq","er","ee","et","fk","fo","fj","fi","fr","pf","tf","ga","gm","ge","de","gh","gi","gr","gl","gu","gg","gn","gw","hm","va","hu","is","in","id","ir","iq","ie","im","il","it","jp","je","jo","kz","ke","ki","kr","kp","kw","kg","la","lv","lb","ls","lr","ly","li","lt","lu","mo","mk","mg","mw","my","mv","ml","mt","mh","mr","mu","yt","mx","fm","md","mc","mn","me","ma","mz","mm","na","nr","np","nl","nc","nz","ne","ng","nu","nf","mp","no","om","pk","pw","ps","pg","pe","ph","pn","pl","pt","qa","re","ro","ru","rw","sh","kn","pm","bl","mf","ws","sm","st","sa","sn","rs","sc","sl","sg","sx","sk","si","sb","so","gs","ss","es","lk","sd","sj","sz","se","ch","sy","tw","tj","tz","th","tl","tg","tk","to","tn","tr","tm","tc","tv","ug","ua","ae","gb","um","us","uz","vu","vi","wf","eh","ye","zm","zw"]},{id:"googlePlay",selectors:[".footer_banner-badge.google.w-inline-block",".app-download_link-wrapper.google.w-inline-block"],countries:["af","ax","as","ad","ai","aq","au","bb","bt","bv","io","bn","bi","ca","bq","cf","cx","cc","cg","cd","ck","cw","gq","et","fk","fo","gf","pf","tf","gl","gp","gu","gg","gy","hm","va","hk","ir","im","jp","je","ki","kp","ls","ly","mg","mw","mh","mq","mr","yt","fm","mn","me","ms","nr","nc","nz","ng","nu","nf","mp","pw","ps","pn","pr","re","sh","kn","lc","pm","vc","bl","mf","st","sg","sx","gs","ss","sj","sz","sy","tl","tk","tc","tv","um","us","vg","vi","wf","eh"]},{id:"appstore",selectors:[".footer_banner-badge.store.w-inline-block",".app-download_link-wrapper.appstore.w-inline-block"],countries:["ax","al","as","ad","aq","aw","au","at","bd","be","bv","io","bg","bi","ca","bq","cf","cx","cc","km","ck","hr","cu","cw","cy","cz","dk","dj","gq","er","ee","et","fk","fo","fi","fr","gf","pf","tf","de","gi","gr","gl","gp","gu","gg","gn","ht","hm","va","hk","hu","is","ir","iq","ie","im","il","it","je","ki","kp","lv","ls","ly","li","lt","lu","mt","mh","mq","yt","fm","me","nl","nc","nz","ng","nu","nf","mp","no","ps","pn","pl","pt","pr","re","ro","sh","pm","bl","mf","ws","sm","sg","sx","sk","si","so","gs","ss","es","sd","sj","se","ch","sy","tw","tl","tg","tk","tr","tv","gb","um","us","vu","vi","wf","eh"]},{id:"p2p",selectors:["#p2payment.accordion_toggle-block","#p2component.section_dp2p","#card_block_p2p.help_category"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"w-dyn-item-p2p",selectors:["div.w-dyn-item"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"hideRow",selectors:["#footer_social-icons_row","#footer_text_row",".footer_risk-warning.w-richtext"],countries:["br","uy","lk","ch","za","ec"]},{id:"hideDiel",selectors:["#footer_text_diel","#footer_social-icons_diel"],countries:["br","uy","lk","ch","za","ec"]}],l=[{id:"showElems",selectors:[".banner_disclaimer"],countries:["br","uy","lk","ch","za","ec"]}],p=()=>{const e=window.getClientCountry();u.forEach((o=>{const n="hideDiel"===o.id?!o.countries.includes(e):o.countries.includes(e);if(e&&n)return o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((e=>{if(e)if("w-dyn-item-p2p"===o.id){e.querySelector("#card_block_p2p.help_category")&&(e.style.display="none")}else e.style.display="none"}))}));if(!n){const e=document.querySelector(".footer_social-icons.diel");e&&(e.style.display="flex")}})),l.forEach((o=>{e&&o.countries.includes(e)?o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{if(o){const n=document.querySelector(".page-wrapper");".banner_disclaimer"===e?(n.classList.add("disclaimer-show"),o.classList.remove("hide-element")):o.style.display="block"}}))})):o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{o&&(".banner_disclaimer"===e?o.classList.add("hide-element"):o.style.display="none")}))}))}))},w=JSON.stringify({website_status:1});!async function(){try{const e=await fetch("https://www.cloudflare.com/cdn-cgi/trace"),o=await e.text(),n=Object.fromEntries(o.split("\n").map((e=>e.split("=",2)))).loc.toLowerCase();n!==t(document.cookie,"clients_country")&&(d("clients_country"),a("clients_country",n,30)),p()}catch(e){p()}}();t(document.cookie,"clients_country")||window.socketMessageSend(w,"website_status").then((e=>{t(document.cookie,"clients_country")!==e.website_status.clients_country&&(d("clients_country"),a("clients_country",e.website_status.clients_country,30)),p()})).catch((e=>{}));const h=["ar","bn","de","en","es","fr","it","ko","pl","pt","ru","si","sw","th","tr","vi","zh_cn","zh_tw","zh-cn","zh-tw"];(()=>{var e;const o=window.location.pathname,n=window.location.hash,i=window.location.search,a=o.split("/"),d=a[1],s=h.includes(d||""),c=a.includes("careers")||a.includes("locations")||a.includes("derivtech")||a.includes("derivlife")||a.includes("eu-careers")||a.includes("our-locations");s&&r(d);const u=(null==(e=t(document.cookie,"webflow-user-language"))?void 0:e.toLowerCase())||"en",l=s?d:u;if((s||"en"!==u)&&d!==u)if(s&&d!==u)r(l);else if(!c){const e=(s?a.map((e=>e===d?l:e)).join("/"):l+a.join("/"))+i+n;window.location.href="/"+e}})();const y=function(){let e,o=!1,n=!1;const i=()=>{n=!0,o=!!t(document.cookie,"client_information"),o&&clearInterval(e),document.dispatchEvent(new Event("authStatusChange"))};return i(),e=setInterval(i,800),{getLoggedInStatus:()=>o,getAuthCheckedStatus:()=>n,onAuthStatusChange:e=>document.addEventListener("authStatusChange",e)}}();y.onAuthStatusChange((()=>{if(y.getAuthCheckedStatus()&&y.getLoggedInStatus()){document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.add("hide-element")}))}else if(y.getAuthCheckedStatus()&&!y.getLoggedInStatus()){document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.add("hide-element")}))}}));const m=window.location.href;if(["help-centre"].some((e=>m.includes(e)))){const e=new URL(m).searchParams;e.has("platform")&&"derivgo"===e.get("platform")&&(N=".derivgo-query-element",document.querySelectorAll(N).forEach((e=>{e.style.display="none"})))}var N;const Y=document.querySelector(".banner_disclaimer"),g=document.querySelector(".main-wrapper");if(Y){new ResizeObserver((e=>{for(let o of e)if(o.target===Y){let e=o.target.getBoundingClientRect();g&&(g.style.paddingTop=e.height+"px")}})).observe(Y)}window.addEventListener("pageshow",(function(e){if(e.persisted){const e=document.querySelector(".w-nav-overlay");e&&(e.style.display="none",document.querySelector("body").click())}}));const A=o(e({databaseURL:window.location.hostname.includes("staging")?"https://app-config-staging.firebaseio.com":"https://app-config-prod.firebaseio.com"}));let f=!1,_=!1;!function(){var e;const o=document.getElementById("live_chat-wrapper");try{const e=n(A,"remote_config/deriv-com/chat");i(e,(e=>{const n=e.val();f=n.live_chat,_=n.whatsapp_chat;const i=document.querySelector(".whatsapp_chat"),a=document.querySelector(".livechatbtn");i&&(i.style.visibility=_?"visible":"hidden"),a&&(a.style.visibility=f?"visible":"hidden");if(window.location.pathname.includes("/help-centre")){const e=document.querySelectorAll(".livechatbtn");f?e.forEach((e=>{e.style.visibility="visible"})):e.forEach((e=>{e.style.visibility="hidden"}));const o=document.querySelectorAll(".whatsapp_chat");_?o.forEach((e=>{e.style.visibility="visible"})):o.forEach((e=>{e.style.visibility="hidden"}))}window.addEventListener("scroll",(function(){var e,n;(f||_)&&(null==(e=null==o?void 0:o.classList)||e.remove("hide-element")),f||_||null==(n=null==o?void 0:o.classList)||n.add("hide-element")}))}),(e=>{var n;null==(n=null==o?void 0:o.classList)||n.remove("hide-element")}))}catch(a){null==(e=null==o?void 0:o.classList)||e.remove("hide-element")}}();new MutationObserver((function(e){for(const o of e)if(o.addedNodes.length)for(const e of o.addedNodes)e.nodeType===Node.ELEMENT_NODE&&"chat-widget-minimized"===e.id&&(e.style.opacity="0")})).observe(document.body,{childList:!0,subtree:!0});const v=window.getClientCountry();const b=[{country:"af",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"ax",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"al",apple:"No",android:"Yes",huawei:"No"},{country:"dz",apple:"Yes",android:"Yes",huawei:"No"},{country:"as",apple:"N/A",android:"No",huawei:"N/A"},{country:"ad",apple:"N/A",android:"N/A",huawei:"No"},{country:"ao",apple:"Yes",android:"Yes",huawei:"No"},{country:"ai",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"aq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ag",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ar",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"am",apple:"Yes",android:"Yes",huawei:"No"},{country:"aw",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"au",apple:"No",android:"No",huawei:"No"},{country:"at",apple:"No",android:"Yes",huawei:"No"},{country:"az",apple:"Yes",android:"Yes",huawei:"No"},{country:"bs",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bh",apple:"Yes",android:"Yes",huawei:"No"},{country:"bd",apple:"N/A",android:"Yes",huawei:"No"},{country:"bb",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"by",apple:"Yes",android:"Yes",huawei:"No"},{country:"be",apple:"No",android:"Yes",huawei:"No"},{country:"bz",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bj",apple:"Yes",android:"Yes",huawei:"No"},{country:"bm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"bt",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"bo",apple:"Yes",android:"Yes",huawei:"No"},{country:"ba",apple:"Yes",android:"Yes",huawei:"No"},{country:"bw",apple:"Yes",android:"Yes",huawei:"No"},{country:"bv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"br",apple:"Yes",android:"Yes",huawei:"No"},{country:"io",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"bn",apple:"Yes",android:"N/A",huawei:"No"},{country:"bg",apple:"No",android:"Yes",huawei:"No"},{country:"bf",apple:"Yes",android:"Yes",huawei:"No"},{country:"bi",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kh",apple:"Yes",android:"Yes",huawei:"No"},{country:"cm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ca",apple:"No",android:"No",huawei:"No"},{country:"cv",apple:"Yes",android:"Yes",huawei:"No"},{country:"bq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ky",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cf",apple:"N/A",android:"N/A",huawei:"No"},{country:"td",apple:"Yes",android:"Yes",huawei:"No"},{country:"cl",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cn",apple:"Yes",android:"Yes",huawei:"No"},{country:"cx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"co",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"km",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cg",apple:"Yes",android:"N/A",huawei:"No"},{country:"cd",apple:"Yes",android:"N/A",huawei:"No"},{country:"ck",apple:"N/A",android:"N/A",huawei:"No"},{country:"cr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ci",apple:"Yes",android:"Yes",huawei:"No"},{country:"hr",apple:"No",android:"Yes",huawei:"No"},{country:"cu",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cw",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cy",apple:"No",android:"Yes",huawei:"No"},{country:"cz",apple:"No",android:"Yes",huawei:"No"},{country:"dk",apple:"No",android:"Yes",huawei:"No"},{country:"dj",apple:"N/A",android:"Yes",huawei:"No"},{country:"dm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"do",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ec",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"eg",apple:"Yes",android:"Yes",huawei:"No"},{country:"sv",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gq",apple:"N/A",android:"N/A",huawei:"No"},{country:"er",apple:"N/A",android:"Yes",huawei:"No"},{country:"ee",apple:"No",android:"Yes",huawei:"No"},{country:"et",apple:"N/A",android:"N/A",huawei:"No"},{country:"fk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"fo",apple:"N/A",android:"N/A",huawei:"No"},{country:"fj",apple:"Yes",android:"Yes",huawei:"No"},{country:"fi",apple:"No",android:"Yes",huawei:"No"},{country:"fr",apple:"No",android:"Yes",huawei:"No"},{country:"gf",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"pf",apple:"N/A",android:"N/A",huawei:"No"},{country:"tf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ga",apple:"Yes",android:"Yes",huawei:"No"},{country:"gm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ge",apple:"Yes",android:"Yes",huawei:"No"},{country:"de",apple:"No",android:"Yes",huawei:"No"},{country:"gh",apple:"Yes",android:"Yes",huawei:"No"},{country:"gi",apple:"N/A",android:"Yes",huawei:"No"},{country:"gr",apple:"No",android:"Yes",huawei:"No"},{country:"gl",apple:"N/A",android:"N/A",huawei:"No"},{country:"gd",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gp",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"gu",apple:"N/A",android:"No",huawei:"N/A"},{country:"gt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gg",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"gn",apple:"N/A",android:"Yes",huawei:"No"},{country:"gw",apple:"Yes",android:"Yes",huawei:"No"},{country:"gy",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ht",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"hm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"va",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"hn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"hk",apple:"No",android:"No",huawei:"Yes"},{country:"hu",apple:"No",android:"Yes",huawei:"No"},{country:"is",apple:"No",android:"Yes",huawei:"No"},{country:"in",apple:"Yes",android:"Yes",huawei:"No"},{country:"id",apple:"Yes",android:"Yes",huawei:"No"},{country:"ir",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"iq",apple:"No",android:"Yes",huawei:"N/A"},{country:"ie",apple:"No",android:"Yes",huawei:"No"},{country:"im",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"il",apple:"No",android:"Yes",huawei:"No"},{country:"it",apple:"No",android:"Yes",huawei:"No"},{country:"jm",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"jp",apple:"Yes",android:"No",huawei:"No"},{country:"je",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"jo",apple:"Yes",android:"Yes",huawei:"No"},{country:"kz",apple:"Yes",android:"Yes",huawei:"No"},{country:"ke",apple:"Yes",android:"Yes",huawei:"No"},{country:"ki",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kr",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"kp",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kw",apple:"Yes",android:"Yes",huawei:"No"},{country:"kg",apple:"Yes",android:"Yes",huawei:"No"},{country:"la",apple:"Yes",android:"Yes",huawei:"No"},{country:"lv",apple:"No",android:"Yes",huawei:"No"},{country:"lb",apple:"Yes",android:"Yes",huawei:"No"},{country:"ls",apple:"N/A",android:"N/A",huawei:"No"},{country:"lr",apple:"Yes",android:"Yes",huawei:"No"},{country:"ly",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"li",apple:"N/A",android:"Yes",huawei:"No"},{country:"lt",apple:"No",android:"Yes",huawei:"No"},{country:"lu",apple:"No",android:"Yes",huawei:"No"},{country:"mo",apple:"Yes",android:"Yes",huawei:"No"},{country:"mk",apple:"Yes",android:"Yes",huawei:"No"},{country:"mg",apple:"Yes",android:"N/A",huawei:"No"},{country:"mw",apple:"Yes",android:"N/A",huawei:"No"},{country:"my",apple:"Yes",android:"Yes",huawei:"No"},{country:"mv",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"ml",apple:"Yes",android:"Yes",huawei:"No"},{country:"mt",apple:"No",android:"Yes",huawei:"No"},{country:"mh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mq",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"mr",apple:"Yes",android:"N/A",huawei:"No"},{country:"mu",apple:"Yes",android:"Yes",huawei:"No"},{country:"yt",apple:"N/A",android:"N/A",huawei:"No"},{country:"mx",apple:"Yes",android:"Yes",huawei:"No"},{country:"fm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"md",apple:"Yes",android:"Yes",huawei:"No"},{country:"mc",apple:"Yes",android:"Yes",huawei:"No"},{country:"mn",apple:"Yes",android:"N/A",huawei:"No"},{country:"me",apple:"No",android:"N/A",huawei:"No"},{country:"ms",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ma",apple:"Yes",android:"Yes",huawei:"No"},{country:"mz",apple:"Yes",android:"Yes",huawei:"No"},{country:"mm",apple:"Yes",android:"Yes",huawei:"No"},{country:"na",apple:"Yes",android:"Yes",huawei:"No"},{country:"nr",apple:"Yes",android:"N/A",huawei:"No"},{country:"np",apple:"Yes",android:"Yes",huawei:"No"},{country:"nl",apple:"No",android:"Yes",huawei:"No"},{country:"nc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nz",apple:"No",android:"No",huawei:"No"},{country:"ni",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ne",apple:"Yes",android:"Yes",huawei:"No"},{country:"ng",apple:"No",android:"No",huawei:"No"},{country:"nu",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mp",apple:"N/A",android:"No",huawei:"N/A"},{country:"no",apple:"No",android:"Yes",huawei:"No"},{country:"om",apple:"Yes",android:"Yes",huawei:"No"},{country:"pk",apple:"Yes",android:"Yes",huawei:"No"},{country:"pw",apple:"Yes",android:"No",huawei:"N/A"},{country:"ps",apple:"N/A",android:"N/A",huawei:"No"},{country:"pa",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pg",apple:"Yes",android:"Yes",huawei:"No"},{country:"py",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pe",apple:"Yes",android:"Yes",huawei:"No"},{country:"ph",apple:"Yes",android:"Yes",huawei:"No"},{country:"pn",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"pl",apple:"No",android:"Yes",huawei:"No"},{country:"pt",apple:"No",android:"Yes",huawei:"No"},{country:"pr",apple:"N/A",android:"No",huawei:"Yes"},{country:"qa",apple:"Yes",android:"Yes",huawei:"No"},{country:"re",apple:"N/A",android:"N/A",huawei:"No"},{country:"ro",apple:"No",android:"Yes",huawei:"No"},{country:"ru",apple:"Yes",android:"Yes",huawei:"No"},{country:"rw",apple:"Yes",android:"Yes",huawei:"No"},{country:"sh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kn",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"lc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"pm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"vc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"bl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ws",apple:"N/A",android:"Yes",huawei:"No"},{country:"sm",apple:"N/A",android:"Yes",huawei:"No"},{country:"st",apple:"Yes",android:"N/A",huawei:"No"},{country:"sa",apple:"Yes",android:"Yes",huawei:"No"},{country:"sn",apple:"Yes",android:"Yes",huawei:"No"},{country:"rs",apple:"Yes",android:"Yes",huawei:"No"},{country:"sc",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"sl",apple:"Yes",android:"Yes",huawei:"No"},{country:"sg",apple:"No",android:"No",huawei:"No"},{country:"sx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sk",apple:"No",android:"Yes",huawei:"No"},{country:"si",apple:"No",android:"Yes",huawei:"No"},{country:"sb",apple:"Yes",android:"Yes",huawei:"No"},{country:"so",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"za",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gs",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ss",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"es",apple:"No",android:"Yes",huawei:"No"},{country:"lk",apple:"Yes",android:"Yes",huawei:"No"},{country:"sd",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"sr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"sj",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sz",apple:"Yes",android:"N/A",huawei:"No"},{country:"se",apple:"No",android:"Yes",huawei:"No"},{country:"ch",apple:"No",android:"Yes",huawei:"No"},{country:"sy",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tw",apple:"No",android:"Yes",huawei:"No"},{country:"tj",apple:"Yes",android:"Yes",huawei:"No"},{country:"tz",apple:"Yes",android:"Yes",huawei:"No"},{country:"th",apple:"Yes",android:"Yes",huawei:"No"},{country:"tl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tg",apple:"N/A",android:"Yes",huawei:"No"},{country:"tk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"to",apple:"Yes",android:"Yes",huawei:"No"},{country:"tt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"tn",apple:"Yes",android:"Yes",huawei:"No"},{country:"tr",apple:"No",android:"Yes",huawei:"No"},{country:"tm",apple:"Yes",android:"Yes",huawei:"No"},{country:"tc",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"tv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ug",apple:"Yes",android:"Yes",huawei:"No"},{country:"ua",apple:"Yes",android:"Yes",huawei:"No"},{country:"ae",apple:"Yes",android:"Yes",huawei:"No"},{country:"gb",apple:"No",android:"Yes",huawei:"No"},{country:"um",apple:"N/A",android:"No",huawei:"N/A"},{country:"us",apple:"No",android:"No",huawei:"N/A"},{country:"uy",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"uz",apple:"Yes",android:"Yes",huawei:"No"},{country:"vu",apple:"No",android:"Yes",huawei:"N/A"},{country:"ve",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vg",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"vi",apple:"N/A",android:"No",huawei:"N/A"},{country:"wf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"eh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ye",apple:"Yes",android:"Yes",huawei:"No"},{country:"zm",apple:"Yes",android:"Yes",huawei:"No"},{country:"zw",apple:"Yes",android:"Yes",huawei:"No"}].find((e=>e.country===v)),k=b?function(e){const{apple:o,android:n,huawei:i}=e;return"Yes"===o&&"Yes"===n&&"Yes"===i?"Android, iOS & Huawei":"Yes"===o&&"Yes"===n&&"Yes"!==i?"Android, and iOS":"Yes"===o&&"Yes"===i&&"Yes"!==n?"iOS, and Huawei":"Yes"===n&&"Yes"!==o&&"Yes"!==i?"Android":"Yes"===o&&"Yes"===i&&"Yes"!==n?"iOS, and Huawei":"Yes"===o&&"Yes"!==n&&"Yes"!==i?"iOS":"Yes"!==o&&"Yes"!==n&&"Yes"===i?"Huawei":""}(b):"",L=document.getElementById("app-download-heading");L&&(L.innerText=k);const E=document.querySelector(".redirection_background-wrapper"),S=document.getElementById("cancel-redirect"),C=document.getElementById("proceed-redirect");if(window.isEuRegion(window.location.pathname)&&E&&S&&C){const e=["deriv.me","deriv.be","deriv.com","app.deriv.me","app.deriv.be","app.deriv.com","docs.deriv.com","community.deriv.com","deriv.statuspage.io","signup.deriv.com","login.deriv.com","api.deriv.com"];let o="",n="_self";document.querySelectorAll("a").forEach((function(i){const a=new URL(i.href,window.location.href),t=new URL(window.location.href);e.includes(a.host)||a.host===t.host||i.addEventListener("click",(function(e){e.preventDefault(),o=a.href,n=i.target||"_self",E.classList.remove("hide-element"),document.body.style.overflow="hidden"}))})),S.addEventListener("click",(function(){E.classList.add("hide-element"),document.body.style.overflow="auto",o=""})),C.addEventListener("click",(function(){o&&(window.open(o,n),o="",E.classList.add("hide-element"),document.body.style.overflow="auto")}))}document.querySelector(".banner_disclaimer")?document.body.classList.add("disclaimer-visible"):document.body.classList.remove("disclaimer-visible");const q=document.querySelectorAll(".navbar_accordion-item");function z(){const e=document.querySelector(".navbar_accordion-trigger.open");e&&e.scrollIntoView({behavior:"smooth",block:"start"})}q.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.overflow="hidden",o.style.transition="max-height 0.3s ease-in, opacity 0.3s ease-in",o.style.opacity="0"})),q.forEach((e=>{const o=e.querySelector(".navbar_accordion-trigger");o.addEventListener("click",(function(){const e=o.classList.contains("open");if(q.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.opacity="0"})),!e){o.classList.add("open");const e=o.nextElementSibling;e.classList.add("open"),e.style.maxHeight=e.scrollHeight+"px",e.style.opacity="1"}}))}));document.querySelectorAll(".navbar_accordion-trigger").forEach((e=>{e.addEventListener("click",(function(){setTimeout(z,300)}))}));const I=new MutationObserver((e=>{e.forEach((e=>{if("class"===e.attributeName){const o=e.target;o.classList.contains("open")&&o.scrollIntoView({behavior:"smooth",block:"start"})}}))}));document.querySelectorAll(".navbar_accordion-item").forEach((e=>{I.observe(e,{attributes:!0})}));const j=new URL(window.location.href),x=new URLSearchParams(j.search),$=x.get("t");if(x.has("referrer")&&null!=$){t(document.cookie,"referrer_token")!==$&&(d("referrer_token"),a("referrer_token",$,365,".deriv.com"))}const P=document.getElementById("navbar-home_login");P&&P.addEventListener("click",(function(e){e.preventDefault(),window.location.href=s()}));const O=document.getElementById("res-navbar-home_login");O&&O.addEventListener("click",(function(e){e.preventDefault(),window.location.href=s()}));const R=document.getElementById("white-navbar_login");R&&R.addEventListener("click",(function(e){e.preventDefault(),window.location.href=s()}));const W=document.getElementById("res-white-navbar_login");W&&W.addEventListener("click",(function(e){e.preventDefault(),window.location.href=s()})),window.customLoader="static version",window.getClientCountry();const B=window.parseCookies(document.cookie,"webflow-user-language"),D=["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"];if(window.location.pathname.endsWith("p2p")&&!window.location.pathname.startsWith("/blog")){const e=window.getClientCountry();e&&D.includes(e)&&("en"===B?window.location.replace("/404"):window.location.replace(`/${B}/404`))}if(void 0!==window.parseCookies(document.cookie,"client_information")){let e=function(e){e.forEach((e=>{e.href="https://app.deriv.com/appstore/traders-hub"}))},o=document.querySelectorAll("a.live-markets_button.is-secondary.is-small.is-purchase.w-button"),n=document.querySelectorAll("a.live-markets_button.is-secondary.is-small.is-sell.w-button");e(o),e(n)}document.getElementById("mobile-menu"),document.getElementById("live_chat-wrapper");const U=()=>{window.LC_API&&window.LC_API.open_chat_window&&window.LC_API.open_chat_window()},H=()=>{"true"===new URLSearchParams(window.location.search).get("is_livechat_open")&&U()},J=e=>{var o;null==(o=null==window?void 0:window.LiveChatWidget)||o.on("ready",(()=>{window.LC_API.open_chat_window(),window.LC_API.hide_chat_window(),H();const o=window.parseCookies(document.cookie,"utm_data"),n=o?JSON.parse(o):{},{utm_source:i,utm_medium:a,utm_campaign:t}=n,r=window.parseCookies(document.cookie,"client_information"),d=new URLSearchParams(window.location.search),{loginid:s,email:c,landing_company_shortcode:u,currency:l,residence:p,first_name:w,last_name:h}=r?JSON.parse(r):{},y={is_logged_in:e,loginid:s??"",landing_company_shortcode:u??"",currency:l??"",residence:p??"",email:c??"",platform:d.get("platform")??"",utm_source:i??"",utm_medium:a??"",utm_campaign:t??""};window.LiveChatWidget.call("set_session_variables",y),e?(c&&window.LiveChatWidget.call("set_customer_email",c),w&&h&&window.LiveChatWidget.call("set_customer_name",`${w} ${h}`)):window.LC_API.on_chat_ended=()=>{window.LiveChatWidget.call("set_customer_email"," "),window.LiveChatWidget.call("set_customer_name"," ")},H(),window.LiveChatWidget.on("new_event",(e=>{e.greeting&&window.LC_API.open_chat_window()}))}))};let T=!1;const M=()=>{const e=!!window.parseCookies(document.cookie,"client_information");e!==T&&(J(e),T=e)};M(),setInterval(M,2e3),(()=>{if(window.__lc=window.__lc||{},window.__lc.license="12049137",window.LC_API=window.LC_API||{loaded:!1},window.LC_API.loaded)H();else{const e=document.createElement("script");e.async=!0,e.src="https://cdn.livechatinc.com/tracking.js",e.onload=()=>{window.LC_API.loaded=!0,window.LC_API.on_after_load=function(){J(!!window.parseCookies(document.cookie,"client_information")),H()},"undefined"!=typeof LiveChatWidget&&LiveChatWidget.init&&LiveChatWidget.init()},document.body.appendChild(e)}})();const V=document.querySelectorAll(".livechatbtn");V.length>0&&V.forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault(),U()}))}));const F=document.getElementById("liveChatBtn");F&&F.addEventListener("click",(e=>{e.preventDefault(),U()}));document.querySelectorAll('a[rel="liveChatBtn"]').forEach((e=>{null==e||e.addEventListener("click",(e=>{e.preventDefault(),U()}))})); \ No newline at end of file +var e,o,n,i,t,a,r,d,c,s;import{initializeApp as l}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-app.js";import{getDatabase as u,ref as p,onValue as w}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-database.js";function h(e,o,n,i){let t="";if(n){let e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),t="; expires="+e.toUTCString()}document.cookie=i?e+"="+(o||"")+t+`;domain=${i};path=/`:e+"="+(o||"")+t+";path=/"}function m(e,o){const n={};return e.split(";").forEach((e=>{const[o,i]=e.split("=").map((e=>e.trim()));n[o]=decodeURIComponent(i)})),n[o]}function y(e){h("webflow-user-language",e,30)}function N(e){document.cookie=e+"=; Max-Age=-99999999;"}window.emailRegex=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,window.toggleErrorField=(e,o)=>{o?e.classList.remove("error-field"):e.classList.add("error-field")},window.disableButton=function(e){e.disabled=!0,e.style.opacity="0.5"},window.isEuRegion=function(e){const o=e.replace(/\/$/,"");return/^\/(?:[^\/]+\/)?eu(?:\/|$)/.test(o)},window.enableButton=function(e){e.disabled=!1,e.style.opacity="1"},window.getOauthUrl=function(){var e=window.location.href,o=new URL(e).hostname,n=["deriv.com","deriv.be","deriv.me"].find((e=>o.endsWith(e)));return n?`https://oauth.${n}`:"https://oauth.deriv.com"},window.getClientCountry=function(){var e;const o=m(document.cookie,"clients_country"),n=m(document.cookie,"client_information");return n&&(null==(e=JSON.parse(n))?void 0:e.residence)||o},window.deriv_com_url="deriv.com",window.deriv_me_url="deriv.me",window.deriv_be_url="deriv.be",window.webflow_domain="webflow.deriv.com",window.staging_url="staging.deriv.com",window.staging_deriv_be_url="staging.deriv.be",window.domain_list_app_id={[window.deriv_com_url]:"16929",[window.deriv_me_url]:"1411",[window.deriv_be_url]:"30767",[window.webflow_domain]:"53503",[window.staging_url]:"16303"},window.getDomain=()=>{var e=window.location.href;return new URL(e).hostname},window.getAppId=()=>{const e=window.getDomain(),o=new URLSearchParams(window.location.search||"").get("app_id");if(o)return o;const n=localStorage.getItem("config.app_id");if(n)return n;const i={[window.webflow_domain]:window.domain_list_app_id[window.webflow_domain],[window.deriv_be_url]:window.domain_list_app_id[window.deriv_be_url],[window.deriv_me_url]:window.domain_list_app_id[window.deriv_me_url],[window.staging_url]:window.domain_list_app_id[window.staging_url]};return i[e]?i[e]:window.domain_list_app_id[window.deriv_com_url]};const g=()=>{const e=localStorage.getItem("config.server_url"),o=m(document.cookie,"webflow-user-language");let n=o?o.toLowerCase():"en";"zh-cn"!==n&&"zh-tw"!==n||(n=n.replace("-","_"));const i=(e=>{let o="";return e&&Object.keys(e).forEach((n=>{o+=`&${n}=${e[n]}`})),o})((()=>{const e=m(document.cookie,"utm_data");if(e){const o=JSON.parse(e),n={};return["utm_source","utm_ad_id","utm_adgroup_id","utm_adrollclk_id","utm_campaign","utm_campaign_id","utm_content","utm_fbcl_id","utm_gl_client_id","utm_medium","utm_msclk_id","utm_term"].forEach((e=>{o.hasOwnProperty(e)&&(n[e]=o[e])})),n}return null})()),t=m(document.cookie,"affiliate_tracking"),a=t?`&affiliate_token=${t}`:"",r=void["mt5","bot","derivx"].filter((e=>window.location.pathname.includes(e)&&e))||"";return e&&/qa/.test(e)?`https://${e}/oauth2/authorize?app_id=${window.getAppId()}&l=${n}&brand=deriv${a}${i}&platform=${r}`:`${window.getOauthUrl()}/oauth2/authorize?app_id=${(()=>{const e=window.getDomain();return e===window.deriv_me_url?window.domain_list_app_id[window.deriv_me_url]:e===window.deriv_be_url?window.domain_list_app_id[window.deriv_be_url]:e===window.webflow_domain?window.domain_list_app_id[window.webflow_domain]:window.domain_list_app_id[window.deriv_com_url]})()}&l=${n}&brand=deriv${a}${i}&platform=${r}`};if(!!!m(document.cookie,"client_information")){var f=document.createElement("iframe");f.src=(()=>{const e=window.location.hostname;let o;switch(o="deriv.com"===e||"deriv.be"===e||"deriv.me"===e?"production":"staging.deriv.com"===e?"staging":"development",o){case"production":return"https://hub.deriv.com/tradershub/signup";case"staging":return"https://staging-hub.deriv.com/tradershub/signup";default:return"https://dev-hub.deriv.com/tradershub/signup"}})(),f.style.width="0",f.style.height="0",f.style.border="none",f.style.visibility="hidden",f.setAttribute("sandbox","allow-same-origin allow-scripts"),document.body.appendChild(f)}window.establishWebSocketConnection=()=>new Promise(((e,o)=>{const n=m(document.cookie,"webflow-user-language"),i=n?n.toLowerCase():"en",t=localStorage.getItem("config.server_url")||"green.derivws.com";window.websocket=new WebSocket(`wss://${t}/websockets/v3?app_id=${window.getAppId()}&l=${i||"en"}&brand=deriv`),window.websocket.addEventListener("open",(o=>{window.websocket.addEventListener("close",(()=>{window.websocket.close()})),window.websocket.addEventListener("message",(e=>{JSON.parse(e.data)})),e(window.websocket)})),window.websocket.addEventListener("error",(e=>{var n;null==(n=null==window?void 0:window.websocket)||n.close(),o(e)}))})),window.socketMessageSend=async(e,o)=>{var n;try{return(null==window?void 0:window.websocket)&&(null==(n=null==window?void 0:window.websocket)?void 0:n.readyState)===(null==WebSocket?void 0:WebSocket.OPEN)?(window.websocket.send(e),new Promise(((e,n)=>{window.websocket.addEventListener("message",(i=>{const t=JSON.parse(i.data);o===t.msg_type&&(t.error?n(t.error):e(t))}))}))):establishWebSocketConnection().then((()=>(websocket.send(e),new Promise(((e,n)=>{websocket.addEventListener("message",(i=>{const t=JSON.parse(i.data);o===t.msg_type&&(t.error?n(t.error):e(t))}))}))))).catch((e=>Promise.reject(e)))}catch(i){return Promise.reject(i)}};const v=[{id:"appgallery",selectors:[".footer_banner-badge.gallery.w-inline-block",".app-download_link-wrapper.appgallery.w-inline-block"],countries:["af","ax","al","dz","as","ad","ao","aq","am","au","at","az","bh","bd","by","be","bj","bm","bt","bo","ba","bw","bv","br","io","bn","bg","bf","bi","kh","cm","ca","cv","bq","cf","td","cn","cx","cc","km","cg","cd","ck","ci","hr","cu","cw","cy","cz","dk","dj","dm","eg","gq","er","ee","et","fk","fo","fj","fi","fr","pf","tf","ga","gm","ge","de","gh","gi","gr","gl","gu","gg","gn","gw","hm","va","hu","is","in","id","ir","iq","ie","im","il","it","jp","je","jo","kz","ke","ki","kr","kp","kw","kg","la","lv","lb","ls","lr","ly","li","lt","lu","mo","mk","mg","mw","my","mv","ml","mt","mh","mr","mu","yt","mx","fm","md","mc","mn","me","ma","mz","mm","na","nr","np","nl","nc","nz","ne","ng","nu","nf","mp","no","om","pk","pw","ps","pg","pe","ph","pn","pl","pt","qa","re","ro","ru","rw","sh","kn","pm","bl","mf","ws","sm","st","sa","sn","rs","sc","sl","sg","sx","sk","si","sb","so","gs","ss","es","lk","sd","sj","sz","se","ch","sy","tw","tj","tz","th","tl","tg","tk","to","tn","tr","tm","tc","tv","ug","ua","ae","gb","um","us","uz","vu","vi","wf","eh","ye","zm","zw"]},{id:"googlePlay",selectors:[".footer_banner-badge.google.w-inline-block",".app-download_link-wrapper.google.w-inline-block"],countries:["af","ax","as","ad","ai","aq","au","bb","bt","bv","io","bn","bi","ca","bq","cf","cx","cc","cg","cd","ck","cw","gq","et","fk","fo","gf","pf","tf","gl","gp","gu","gg","gy","hm","va","hk","ir","im","jp","je","ki","kp","ls","ly","mg","mw","mh","mq","mr","yt","fm","mn","me","ms","nr","nc","nz","ng","nu","nf","mp","pw","ps","pn","pr","re","sh","kn","lc","pm","vc","bl","mf","st","sg","sx","gs","ss","sj","sz","sy","tl","tk","tc","tv","um","us","vg","vi","wf","eh"]},{id:"appstore",selectors:[".footer_banner-badge.store.w-inline-block",".app-download_link-wrapper.appstore.w-inline-block"],countries:["ax","al","as","ad","aq","aw","au","at","bd","be","bv","io","bg","bi","ca","bq","cf","cx","cc","km","ck","hr","cu","cw","cy","cz","dk","dj","gq","er","ee","et","fk","fo","fi","fr","gf","pf","tf","de","gi","gr","gl","gp","gu","gg","gn","ht","hm","va","hk","hu","is","ir","iq","ie","im","il","it","je","ki","kp","lv","ls","ly","li","lt","lu","mt","mh","mq","yt","fm","me","nl","nc","nz","ng","nu","nf","mp","no","ps","pn","pl","pt","pr","re","ro","sh","pm","bl","mf","ws","sm","sg","sx","sk","si","so","gs","ss","es","sd","sj","se","ch","sy","tw","tl","tg","tk","tr","tv","gb","um","us","vu","vi","wf","eh"]},{id:"p2p",selectors:["#p2payment.accordion_toggle-block","#p2component.section_dp2p","#card_block_p2p.help_category"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"w-dyn-item-p2p",selectors:["div.w-dyn-item"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"hideRow",selectors:["#footer_social-icons_row","#footer_text_row",".footer_risk-warning.w-richtext"],countries:["br","uy","lk","ch","za","ec"]},{id:"hideDiel",selectors:["#footer_text_diel","#footer_social-icons_diel"],countries:["br","uy","lk","ch","za","ec"]}],Y=[{id:"showElems",selectors:[".banner_disclaimer"],countries:["br","uy","lk","ch","za","ec"]}],_=()=>{const e=window.getClientCountry();v.forEach((o=>{const n="hideDiel"===o.id?!o.countries.includes(e):o.countries.includes(e);if(e&&n)return o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((e=>{if(e)if("w-dyn-item-p2p"===o.id){e.querySelector("#card_block_p2p.help_category")&&(e.style.display="none")}else e.style.display="none"}))}));if(!n){const e=document.querySelector(".footer_social-icons.diel");e&&(e.style.display="flex")}})),Y.forEach((o=>{e&&o.countries.includes(e)?o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{if(o){const n=document.querySelector(".page-wrapper");".banner_disclaimer"===e?(n.classList.add("disclaimer-show"),o.classList.remove("hide-element")):o.style.display="block"}}))})):o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{o&&(".banner_disclaimer"===e?o.classList.add("hide-element"):o.style.display="none")}))}))}))},A=JSON.stringify({website_status:1});!async function(){try{const e=await fetch("https://www.cloudflare.com/cdn-cgi/trace"),o=await e.text(),n=Object.fromEntries(o.split("\n").map((e=>e.split("=",2)))).loc.toLowerCase();n!==m(document.cookie,"clients_country")&&(N("clients_country"),h("clients_country",n,30)),_()}catch(e){_()}}();m(document.cookie,"clients_country")||window.socketMessageSend(A,"website_status").then((e=>{m(document.cookie,"clients_country")!==e.website_status.clients_country&&(N("clients_country"),h("clients_country",e.website_status.clients_country,30)),_()})).catch((e=>{}));const b=["ar","bn","de","en","es","fr","it","ko","pl","pt","ru","si","sw","th","tr","vi","zh_cn","zh_tw","zh-cn","zh-tw"];(()=>{var e;const o=window.location.pathname,n=window.location.hash,i=window.location.search,t=o.split("/"),a=t[1],r=b.includes(a||""),d=t.includes("careers")||t.includes("locations")||t.includes("derivtech")||t.includes("derivlife")||t.includes("eu-careers")||t.includes("our-locations");r&&y(a);const c=(null==(e=m(document.cookie,"webflow-user-language"))?void 0:e.toLowerCase())||"en",s=r?a:c;if((r||"en"!==c)&&a!==c)if(r&&a!==c)y(s);else if(!d){const e=(r?t.map((e=>e===a?s:e)).join("/"):s+t.join("/"))+i+n;window.location.href="/"+e}})();const k=function(){let e,o=!1,n=!1;const i=()=>{n=!0,o=!!m(document.cookie,"client_information"),o&&clearInterval(e),document.dispatchEvent(new Event("authStatusChange"))};return i(),e=setInterval(i,800),{getLoggedInStatus:()=>o,getAuthCheckedStatus:()=>n,onAuthStatusChange:e=>document.addEventListener("authStatusChange",e)}}();k.onAuthStatusChange((()=>{if(k.getAuthCheckedStatus()&&k.getLoggedInStatus()){document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.add("hide-element")}))}else if(k.getAuthCheckedStatus()&&!k.getLoggedInStatus()){document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.add("hide-element")}))}}));const L=window.location.href;if(["help-centre"].some((e=>L.includes(e)))){const e=new URL(L).searchParams;e.has("platform")&&"derivgo"===e.get("platform")&&(S=".derivgo-query-element",document.querySelectorAll(S).forEach((e=>{e.style.display="none"})))}var S;const E=document.querySelector(".banner_disclaimer"),C=document.querySelector(".main-wrapper");if(E){new ResizeObserver((e=>{for(let o of e)if(o.target===E){let e=o.target.getBoundingClientRect();C&&(C.style.paddingTop=e.height+"px")}})).observe(E)}window.addEventListener("pageshow",(function(e){if(e.persisted){const e=document.querySelector(".w-nav-overlay");e&&(e.style.display="none",document.querySelector("body").click())}}));const q=u(l({databaseURL:window.location.hostname.includes("staging")?"https://app-config-staging.firebaseio.com":"https://app-config-prod.firebaseio.com"}));let I=!1,z=!1;!function(){var e;const o=document.getElementById("live_chat-wrapper");try{const e=p(q,"remote_config/deriv-com/chat");w(e,(e=>{const n=e.val();I=n.live_chat,z=n.whatsapp_chat;const i=document.querySelector(".whatsapp_chat"),t=document.querySelector(".livechatbtn");i&&(i.style.visibility=z?"visible":"hidden"),t&&(t.style.visibility=I?"visible":"hidden");if(window.location.pathname.includes("/help-centre")){const e=document.querySelectorAll(".livechatbtn");I?e.forEach((e=>{e.style.visibility="visible"})):e.forEach((e=>{e.style.visibility="hidden"}));const o=document.querySelectorAll(".whatsapp_chat");z?o.forEach((e=>{e.style.visibility="visible"})):o.forEach((e=>{e.style.visibility="hidden"}))}window.addEventListener("scroll",(function(){var e,n;(I||z)&&(null==(e=null==o?void 0:o.classList)||e.remove("hide-element")),I||z||null==(n=null==o?void 0:o.classList)||n.add("hide-element")}))}),(e=>{var n;null==(n=null==o?void 0:o.classList)||n.remove("hide-element")}))}catch(n){null==(e=null==o?void 0:o.classList)||e.remove("hide-element")}}();new MutationObserver((function(e){for(const o of e)if(o.addedNodes.length)for(const e of o.addedNodes)e.nodeType===Node.ELEMENT_NODE&&"chat-widget-minimized"===e.id&&(e.style.opacity="0")})).observe(document.body,{childList:!0,subtree:!0});const x=window.getClientCountry();const j=[{country:"af",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"ax",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"al",apple:"No",android:"Yes",huawei:"No"},{country:"dz",apple:"Yes",android:"Yes",huawei:"No"},{country:"as",apple:"N/A",android:"No",huawei:"N/A"},{country:"ad",apple:"N/A",android:"N/A",huawei:"No"},{country:"ao",apple:"Yes",android:"Yes",huawei:"No"},{country:"ai",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"aq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ag",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ar",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"am",apple:"Yes",android:"Yes",huawei:"No"},{country:"aw",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"au",apple:"No",android:"No",huawei:"No"},{country:"at",apple:"No",android:"Yes",huawei:"No"},{country:"az",apple:"Yes",android:"Yes",huawei:"No"},{country:"bs",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bh",apple:"Yes",android:"Yes",huawei:"No"},{country:"bd",apple:"N/A",android:"Yes",huawei:"No"},{country:"bb",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"by",apple:"Yes",android:"Yes",huawei:"No"},{country:"be",apple:"No",android:"Yes",huawei:"No"},{country:"bz",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bj",apple:"Yes",android:"Yes",huawei:"No"},{country:"bm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"bt",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"bo",apple:"Yes",android:"Yes",huawei:"No"},{country:"ba",apple:"Yes",android:"Yes",huawei:"No"},{country:"bw",apple:"Yes",android:"Yes",huawei:"No"},{country:"bv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"br",apple:"Yes",android:"Yes",huawei:"No"},{country:"io",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"bn",apple:"Yes",android:"N/A",huawei:"No"},{country:"bg",apple:"No",android:"Yes",huawei:"No"},{country:"bf",apple:"Yes",android:"Yes",huawei:"No"},{country:"bi",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kh",apple:"Yes",android:"Yes",huawei:"No"},{country:"cm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ca",apple:"No",android:"No",huawei:"No"},{country:"cv",apple:"Yes",android:"Yes",huawei:"No"},{country:"bq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ky",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cf",apple:"N/A",android:"N/A",huawei:"No"},{country:"td",apple:"Yes",android:"Yes",huawei:"No"},{country:"cl",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cn",apple:"Yes",android:"Yes",huawei:"No"},{country:"cx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"co",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"km",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cg",apple:"Yes",android:"N/A",huawei:"No"},{country:"cd",apple:"Yes",android:"N/A",huawei:"No"},{country:"ck",apple:"N/A",android:"N/A",huawei:"No"},{country:"cr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ci",apple:"Yes",android:"Yes",huawei:"No"},{country:"hr",apple:"No",android:"Yes",huawei:"No"},{country:"cu",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cw",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cy",apple:"No",android:"Yes",huawei:"No"},{country:"cz",apple:"No",android:"Yes",huawei:"No"},{country:"dk",apple:"No",android:"Yes",huawei:"No"},{country:"dj",apple:"N/A",android:"Yes",huawei:"No"},{country:"dm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"do",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ec",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"eg",apple:"Yes",android:"Yes",huawei:"No"},{country:"sv",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gq",apple:"N/A",android:"N/A",huawei:"No"},{country:"er",apple:"N/A",android:"Yes",huawei:"No"},{country:"ee",apple:"No",android:"Yes",huawei:"No"},{country:"et",apple:"N/A",android:"N/A",huawei:"No"},{country:"fk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"fo",apple:"N/A",android:"N/A",huawei:"No"},{country:"fj",apple:"Yes",android:"Yes",huawei:"No"},{country:"fi",apple:"No",android:"Yes",huawei:"No"},{country:"fr",apple:"No",android:"Yes",huawei:"No"},{country:"gf",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"pf",apple:"N/A",android:"N/A",huawei:"No"},{country:"tf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ga",apple:"Yes",android:"Yes",huawei:"No"},{country:"gm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ge",apple:"Yes",android:"Yes",huawei:"No"},{country:"de",apple:"No",android:"Yes",huawei:"No"},{country:"gh",apple:"Yes",android:"Yes",huawei:"No"},{country:"gi",apple:"N/A",android:"Yes",huawei:"No"},{country:"gr",apple:"No",android:"Yes",huawei:"No"},{country:"gl",apple:"N/A",android:"N/A",huawei:"No"},{country:"gd",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gp",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"gu",apple:"N/A",android:"No",huawei:"N/A"},{country:"gt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gg",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"gn",apple:"N/A",android:"Yes",huawei:"No"},{country:"gw",apple:"Yes",android:"Yes",huawei:"No"},{country:"gy",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ht",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"hm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"va",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"hn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"hk",apple:"No",android:"No",huawei:"Yes"},{country:"hu",apple:"No",android:"Yes",huawei:"No"},{country:"is",apple:"No",android:"Yes",huawei:"No"},{country:"in",apple:"Yes",android:"Yes",huawei:"No"},{country:"id",apple:"Yes",android:"Yes",huawei:"No"},{country:"ir",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"iq",apple:"No",android:"Yes",huawei:"N/A"},{country:"ie",apple:"No",android:"Yes",huawei:"No"},{country:"im",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"il",apple:"No",android:"Yes",huawei:"No"},{country:"it",apple:"No",android:"Yes",huawei:"No"},{country:"jm",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"jp",apple:"Yes",android:"No",huawei:"No"},{country:"je",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"jo",apple:"Yes",android:"Yes",huawei:"No"},{country:"kz",apple:"Yes",android:"Yes",huawei:"No"},{country:"ke",apple:"Yes",android:"Yes",huawei:"No"},{country:"ki",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kr",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"kp",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kw",apple:"Yes",android:"Yes",huawei:"No"},{country:"kg",apple:"Yes",android:"Yes",huawei:"No"},{country:"la",apple:"Yes",android:"Yes",huawei:"No"},{country:"lv",apple:"No",android:"Yes",huawei:"No"},{country:"lb",apple:"Yes",android:"Yes",huawei:"No"},{country:"ls",apple:"N/A",android:"N/A",huawei:"No"},{country:"lr",apple:"Yes",android:"Yes",huawei:"No"},{country:"ly",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"li",apple:"N/A",android:"Yes",huawei:"No"},{country:"lt",apple:"No",android:"Yes",huawei:"No"},{country:"lu",apple:"No",android:"Yes",huawei:"No"},{country:"mo",apple:"Yes",android:"Yes",huawei:"No"},{country:"mk",apple:"Yes",android:"Yes",huawei:"No"},{country:"mg",apple:"Yes",android:"N/A",huawei:"No"},{country:"mw",apple:"Yes",android:"N/A",huawei:"No"},{country:"my",apple:"Yes",android:"Yes",huawei:"No"},{country:"mv",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"ml",apple:"Yes",android:"Yes",huawei:"No"},{country:"mt",apple:"No",android:"Yes",huawei:"No"},{country:"mh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mq",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"mr",apple:"Yes",android:"N/A",huawei:"No"},{country:"mu",apple:"Yes",android:"Yes",huawei:"No"},{country:"yt",apple:"N/A",android:"N/A",huawei:"No"},{country:"mx",apple:"Yes",android:"Yes",huawei:"No"},{country:"fm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"md",apple:"Yes",android:"Yes",huawei:"No"},{country:"mc",apple:"Yes",android:"Yes",huawei:"No"},{country:"mn",apple:"Yes",android:"N/A",huawei:"No"},{country:"me",apple:"No",android:"N/A",huawei:"No"},{country:"ms",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ma",apple:"Yes",android:"Yes",huawei:"No"},{country:"mz",apple:"Yes",android:"Yes",huawei:"No"},{country:"mm",apple:"Yes",android:"Yes",huawei:"No"},{country:"na",apple:"Yes",android:"Yes",huawei:"No"},{country:"nr",apple:"Yes",android:"N/A",huawei:"No"},{country:"np",apple:"Yes",android:"Yes",huawei:"No"},{country:"nl",apple:"No",android:"Yes",huawei:"No"},{country:"nc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nz",apple:"No",android:"No",huawei:"No"},{country:"ni",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ne",apple:"Yes",android:"Yes",huawei:"No"},{country:"ng",apple:"No",android:"No",huawei:"No"},{country:"nu",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mp",apple:"N/A",android:"No",huawei:"N/A"},{country:"no",apple:"No",android:"Yes",huawei:"No"},{country:"om",apple:"Yes",android:"Yes",huawei:"No"},{country:"pk",apple:"Yes",android:"Yes",huawei:"No"},{country:"pw",apple:"Yes",android:"No",huawei:"N/A"},{country:"ps",apple:"N/A",android:"N/A",huawei:"No"},{country:"pa",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pg",apple:"Yes",android:"Yes",huawei:"No"},{country:"py",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pe",apple:"Yes",android:"Yes",huawei:"No"},{country:"ph",apple:"Yes",android:"Yes",huawei:"No"},{country:"pn",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"pl",apple:"No",android:"Yes",huawei:"No"},{country:"pt",apple:"No",android:"Yes",huawei:"No"},{country:"pr",apple:"N/A",android:"No",huawei:"Yes"},{country:"qa",apple:"Yes",android:"Yes",huawei:"No"},{country:"re",apple:"N/A",android:"N/A",huawei:"No"},{country:"ro",apple:"No",android:"Yes",huawei:"No"},{country:"ru",apple:"Yes",android:"Yes",huawei:"No"},{country:"rw",apple:"Yes",android:"Yes",huawei:"No"},{country:"sh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kn",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"lc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"pm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"vc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"bl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ws",apple:"N/A",android:"Yes",huawei:"No"},{country:"sm",apple:"N/A",android:"Yes",huawei:"No"},{country:"st",apple:"Yes",android:"N/A",huawei:"No"},{country:"sa",apple:"Yes",android:"Yes",huawei:"No"},{country:"sn",apple:"Yes",android:"Yes",huawei:"No"},{country:"rs",apple:"Yes",android:"Yes",huawei:"No"},{country:"sc",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"sl",apple:"Yes",android:"Yes",huawei:"No"},{country:"sg",apple:"No",android:"No",huawei:"No"},{country:"sx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sk",apple:"No",android:"Yes",huawei:"No"},{country:"si",apple:"No",android:"Yes",huawei:"No"},{country:"sb",apple:"Yes",android:"Yes",huawei:"No"},{country:"so",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"za",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gs",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ss",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"es",apple:"No",android:"Yes",huawei:"No"},{country:"lk",apple:"Yes",android:"Yes",huawei:"No"},{country:"sd",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"sr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"sj",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sz",apple:"Yes",android:"N/A",huawei:"No"},{country:"se",apple:"No",android:"Yes",huawei:"No"},{country:"ch",apple:"No",android:"Yes",huawei:"No"},{country:"sy",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tw",apple:"No",android:"Yes",huawei:"No"},{country:"tj",apple:"Yes",android:"Yes",huawei:"No"},{country:"tz",apple:"Yes",android:"Yes",huawei:"No"},{country:"th",apple:"Yes",android:"Yes",huawei:"No"},{country:"tl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tg",apple:"N/A",android:"Yes",huawei:"No"},{country:"tk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"to",apple:"Yes",android:"Yes",huawei:"No"},{country:"tt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"tn",apple:"Yes",android:"Yes",huawei:"No"},{country:"tr",apple:"No",android:"Yes",huawei:"No"},{country:"tm",apple:"Yes",android:"Yes",huawei:"No"},{country:"tc",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"tv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ug",apple:"Yes",android:"Yes",huawei:"No"},{country:"ua",apple:"Yes",android:"Yes",huawei:"No"},{country:"ae",apple:"Yes",android:"Yes",huawei:"No"},{country:"gb",apple:"No",android:"Yes",huawei:"No"},{country:"um",apple:"N/A",android:"No",huawei:"N/A"},{country:"us",apple:"No",android:"No",huawei:"N/A"},{country:"uy",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"uz",apple:"Yes",android:"Yes",huawei:"No"},{country:"vu",apple:"No",android:"Yes",huawei:"N/A"},{country:"ve",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vg",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"vi",apple:"N/A",android:"No",huawei:"N/A"},{country:"wf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"eh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ye",apple:"Yes",android:"Yes",huawei:"No"},{country:"zm",apple:"Yes",android:"Yes",huawei:"No"},{country:"zw",apple:"Yes",android:"Yes",huawei:"No"}].find((e=>e.country===x)),O=j?function(e){const{apple:o,android:n,huawei:i}=e;return"Yes"===o&&"Yes"===n&&"Yes"===i?"Android, iOS & Huawei":"Yes"===o&&"Yes"===n&&"Yes"!==i?"Android, and iOS":"Yes"===o&&"Yes"===i&&"Yes"!==n?"iOS, and Huawei":"Yes"===n&&"Yes"!==o&&"Yes"!==i?"Android":"Yes"===o&&"Yes"===i&&"Yes"!==n?"iOS, and Huawei":"Yes"===o&&"Yes"!==n&&"Yes"!==i?"iOS":"Yes"!==o&&"Yes"!==n&&"Yes"===i?"Huawei":""}(j):"",$=document.getElementById("app-download-heading");$&&($.innerText=O);const B=document.querySelector(".redirection_background-wrapper"),D=document.getElementById("cancel-redirect"),P=document.getElementById("proceed-redirect");if(window.isEuRegion(window.location.pathname)&&B&&D&&P){const e=["deriv.me","deriv.be","deriv.com","app.deriv.me","app.deriv.be","app.deriv.com","docs.deriv.com","community.deriv.com","deriv.statuspage.io","signup.deriv.com","login.deriv.com","api.deriv.com"];let o="",n="_self";document.querySelectorAll("a").forEach((function(i){const t=new URL(i.href,window.location.href),a=new URL(window.location.href);e.includes(t.host)||t.host===a.host||i.addEventListener("click",(function(e){e.preventDefault(),o=t.href,n=i.target||"_self",B.classList.remove("hide-element"),document.body.style.overflow="hidden"}))})),D.addEventListener("click",(function(){B.classList.add("hide-element"),document.body.style.overflow="auto",o=""})),P.addEventListener("click",(function(){o&&(window.open(o,n),o="",B.classList.add("hide-element"),document.body.style.overflow="auto")}))}document.querySelector(".banner_disclaimer")?document.body.classList.add("disclaimer-visible"):document.body.classList.remove("disclaimer-visible");const W=document.querySelectorAll(".navbar_accordion-item");function R(){const e=document.querySelector(".navbar_accordion-trigger.open");e&&e.scrollIntoView({behavior:"smooth",block:"start"})}W.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.overflow="hidden",o.style.transition="max-height 0.3s ease-in, opacity 0.3s ease-in",o.style.opacity="0"})),W.forEach((e=>{const o=e.querySelector(".navbar_accordion-trigger");o.addEventListener("click",(function(){const e=o.classList.contains("open");if(W.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.opacity="0"})),!e){o.classList.add("open");const e=o.nextElementSibling;e.classList.add("open"),e.style.maxHeight=e.scrollHeight+"px",e.style.opacity="1"}}))}));document.querySelectorAll(".navbar_accordion-trigger").forEach((e=>{e.addEventListener("click",(function(){setTimeout(R,300)}))}));const U=new MutationObserver((e=>{e.forEach((e=>{if("class"===e.attributeName){const o=e.target;o.classList.contains("open")&&o.scrollIntoView({behavior:"smooth",block:"start"})}}))}));document.querySelectorAll(".navbar_accordion-item").forEach((e=>{U.observe(e,{attributes:!0})}));const J=new URL(window.location.href),T=new URLSearchParams(J.search),F=T.get("t");if(T.has("referrer")&&null!=F){m(document.cookie,"referrer_token")!==F&&(N("referrer_token"),h("referrer_token",F,365,".deriv.com"))}const H=document.getElementById("navbar-home_login");H&&H.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const M=document.getElementById("res-navbar-home_login");M&&M.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const V=document.getElementById("white-navbar_login");V&&V.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const G=document.getElementById("res-white-navbar_login");function K(e,o,n){let i="";{let e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),i="; expires="+e.toUTCString()}document.cookie=e+"="+(o||"")+i+"; path=/"}G&&G.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()})),window.customLoader="static version all",(de=de||[]).push((function(){let e=document.querySelector(".locale > .new-navbar_dropdown-link.w--current");if(e){let o=e.getAttribute("hreflang"),n=document.querySelectorAll(".current-locale-iso-code");if(o&&n.length)for(let e of n)e.innerText=o}}));let Z=document.querySelectorAll(".w-locales-items");if(Z.length>0){let e=function(e){let o=document.querySelector('a[hreflang="'+e+'"]');o&&window.location.pathname!==o.getAttribute("href")&&o.click()};Z.forEach((function(e){e.querySelectorAll("a").forEach((function(e){e.addEventListener("click",(function(o){o.preventDefault(),K("webflow-user-language",e.getAttribute("hreflang"),30),window.location.href=e.href}))}))})),window.setLanguageCookie=e=>{K("webflow-user-language",e,30)};let o=function(e){let o=document.cookie.split(";");for(let n=0;ni.includes(e))),o&&t&&e(o)}(de=de||[]).push((function(){if(document.querySelector(".new-navbar_component")){let e=function(){document.body.classList.add("disable-scroll")},o=function(){document.body.classList.remove("disable-scroll")};const n=document.querySelector(".new-navbar_component");n.addEventListener("mouseenter",(()=>{window.innerWidth>991&&e()})),n.addEventListener("mouseleave",(()=>{window.innerWidth>991&&o()}))}})),window.getClientCountry();const Q=window.parseCookies(document.cookie,"webflow-user-language"),X=["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"];if(window.location.pathname.endsWith("p2p")&&!window.location.pathname.startsWith("/blog")){const e=window.getClientCountry();e&&X.includes(e)&&("en"===Q?window.location.replace("/404"):window.location.replace(`/${Q}/404`))}if(void 0!==window.parseCookies(document.cookie,"client_information")){let e=function(e){e.forEach((e=>{e.href="https://app.deriv.com/appstore/traders-hub"}))},o=document.querySelectorAll("a.live-markets_button.is-secondary.is-small.is-purchase.w-button"),n=document.querySelectorAll("a.live-markets_button.is-secondary.is-small.is-sell.w-button");e(o),e(n)}document.getElementById("mobile-menu"),document.getElementById("live_chat-wrapper");const ee=()=>{window.LC_API&&window.LC_API.open_chat_window&&window.LC_API.open_chat_window()},oe=()=>{"true"===new URLSearchParams(window.location.search).get("is_livechat_open")&&ee()},ne=e=>{var o;null==(o=null==window?void 0:window.LiveChatWidget)||o.on("ready",(()=>{window.LC_API.open_chat_window(),window.LC_API.hide_chat_window(),oe();const o=window.parseCookies(document.cookie,"utm_data"),n=o?JSON.parse(o):{},{utm_source:i,utm_medium:t,utm_campaign:a}=n,r=window.parseCookies(document.cookie,"client_information"),d=new URLSearchParams(window.location.search),{loginid:c,email:s,landing_company_shortcode:l,currency:u,residence:p,first_name:w,last_name:h}=r?JSON.parse(r):{},m={is_logged_in:e,loginid:c??"",landing_company_shortcode:l??"",currency:u??"",residence:p??"",email:s??"",platform:d.get("platform")??"",utm_source:i??"",utm_medium:t??"",utm_campaign:a??""};window.LiveChatWidget.call("set_session_variables",m),e?(s&&window.LiveChatWidget.call("set_customer_email",s),w&&h&&window.LiveChatWidget.call("set_customer_name",`${w} ${h}`)):window.LC_API.on_chat_ended=()=>{window.LiveChatWidget.call("set_customer_email"," "),window.LiveChatWidget.call("set_customer_name"," ")},oe(),window.LiveChatWidget.on("new_event",(e=>{e.greeting&&window.LC_API.open_chat_window()}))}))};let ie=!1;const te=()=>{const e=!!window.parseCookies(document.cookie,"client_information");e!==ie&&(ne(e),ie=e)};te(),setInterval(te,2e3),(()=>{if(window.__lc=window.__lc||{},window.__lc.license="12049137",window.LC_API=window.LC_API||{loaded:!1},window.LC_API.loaded)oe();else{const e=document.createElement("script");e.async=!0,e.src="https://cdn.livechatinc.com/tracking.js",e.onload=()=>{window.LC_API.loaded=!0,window.LC_API.on_after_load=function(){ne(!!window.parseCookies(document.cookie,"client_information")),oe()},"undefined"!=typeof LiveChatWidget&&LiveChatWidget.init&&LiveChatWidget.init()},document.body.appendChild(e)}})();const ae=document.querySelectorAll(".livechatbtn");ae.length>0&&ae.forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault(),ee()}))}));const re=document.getElementById("liveChatBtn");re&&re.addEventListener("click",(e=>{e.preventDefault(),ee()}));var de;document.querySelectorAll('a[rel="liveChatBtn"]').forEach((e=>{null==e||e.addEventListener("click",(e=>{e.preventDefault(),ee()}))})),(de=de||[]).push((function(){let e=document.querySelector(".navbar_menu-button");e&&e.addEventListener("click",(function(){let e=window.innerHeight,o=document.querySelector(".new-navbar_main-wrapper");if(o){let n=e-o.offsetHeight,i=document.querySelector(".new-navbar_menu");i&&(i.style.height=`${n}px`)}}))})),(de=de||[]).push((function(){let e=document.querySelector(".lang-mob");e&&e.addEventListener("click",(function(){let e=document.querySelector(".new-navbar_menu-wrapper");e&&e.scrollBy({top:-3e3})}))}));class ce{constructor(e){this.cookieName=e}setItem(e){const o=new Date;o.setDate(o.getDate()+30);const n="expires="+o.toUTCString(),i=encodeURIComponent(JSON.stringify(e));document.cookie=`${this.cookieName}=${i};${n};path=/`}getItem(){const e=document.cookie.split(";");for(let o=0;oye.includes(e)))&&document.head.querySelectorAll("link").forEach((function(e){e.hasAttribute("hreflang")&&"x-default"!==e.getAttribute("hreflang")&&e.remove()}));const Ne=e=>{window.rudderanalytics?window.rudderanalytics.track(e.name,e.properties):(e=>{let o=[],n=parseCookies(document.cookie,"cached_analytics_events");n&&(o=JSON.parse(n)),o.push(e),document.cookie=`cached_analytics_events=${JSON.stringify(o)}; path=/; Domain=.deriv.com`})(e)};window.addClickListener=function(e,o,n){e&&e.addEventListener("click",(function(){Ne({name:o,properties:n})}))};var ge=null==document?void 0:document.getElementsByClassName("livechatbtn"),fe=null==document?void 0:document.getElementsByClassName("whatsapp_chat"),ve=null==document?void 0:document.getElementsByClassName("tradershub-btn"),Ye=document.querySelectorAll(".btn-free-demo .w-button"),_e=document.querySelectorAll('.btn-free-demo [data-class="w-button"]');const Ae=document.querySelectorAll('[data-attributes="btn-primary-nav"]'),be=document.querySelectorAll('[data-attributes="btn-secondary-nav"]');ge&&Array.from(ge).forEach((e=>{window.addClickListener(e,"ce_widget_usage_form",{action:"click",widget_name:"livechat"})})),fe&&Array.from(fe).forEach((e=>{window.addClickListener(e,"ce_widget_usage_form",{action:"click",widget_name:"whatsapp"})})),ve&&Array.from(ve).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Traders Hub"})})),Ye&&Array.from(Ye).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),_e&&Array.from(_e).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),Ae&&Array.from(Ae).forEach((e=>{e.classList.contains("tradershub-btn")||window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),be&&Array.from(be).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Login"})}));var ke,Le,Se;"deriv.com"===window.location.hostname||"deriv.be"===window.location.hostname||"deriv.me"===window.location.hostname?(ke="sdk-UhZV3cNEg5nLNLNS",Se="nre64BV0dNIa44zW4tz5ow==",Le="1oV5agvlcnCZ6IH94wCKM1oR8Pd"):(ke="sdk-9wuqJ1mlcQsSyZQ",Se="",Le="1lN3tsFD2nruGFgM5F074DC2hMB");const Ee=(we=window.parseCookies(document.cookie,"client_information"))?JSON.parse(we):null,Ce=window.parseCookies(document.cookie,"utm_data"),qe=Ce?JSON.parse(Ce):{},Ie=window.parseCookies(document.cookie,"signup_device");let ze=null;Ie&&(ze=(null==(e=JSON.parse(Ie))?void 0:e.signup_device)||null);const xe={growthbookKey:ke,growthbookDecryptionKey:Se,rudderstackKey:Le,growthbookOptions:{navigate:e=>window.location.replace(e),antiFlicker:!1,navigateDelay:0,attributes:{country:window.parseCookies(document.cookie,"clients_country")||window.parseCookies(document.cookie,"website_status"),user_language:window.parseCookies(document.cookie,"user_language")||("undefined"!=typeof window?localStorage.getItem("i18n")||navigator.language:null),device_language:window.parseCookies(document.cookie,"language")||" ",device_type:ze,utm_source:null==qe?void 0:qe.utm_source,utm_medium:null==qe?void 0:qe.utm_medium,utm_campaign:null==qe?void 0:qe.utm_campaign,is_authorised:!!window.parseCookies(document.cookie,"client_information"),loggedIn:!!window.parseCookies(document.cookie,"client_information"),url:window.location.href}}};try{null==Analytics||Analytics.Analytics.initialise(xe);const e=(null==Ee?void 0:Ee.user_id)?null==Ee?void 0:Ee.user_id:null==(i=null==(n=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getInstances)?void 0:n.call(o).tracking)?void 0:i.getAnonymousId();null==(t=null==Analytics?void 0:Analytics.Analytics)||t.identifyEvent(e)}catch(Oe){}null==(a=null==Analytics?void 0:Analytics.Analytics)||a.pageView(location.pathname,"Deriv.com"),window.useGrowthbookFeatureFlag=function({featureFlag:e}){var o,n,i,t,a;let r=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getFeatureValue(e);return null==(a=null==(t=null==(i=null==(n=null==Analytics?void 0:Analytics.Analytics)?void 0:n.getInstances())?void 0:i.ab)?void 0:t.GrowthBook)||a.setRenderer((function(){var o;const n=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getFeatureValue(e);r=n})),r};const je=window.parseCookies(document.cookie,"client_information")?JSON.parse(window.parseCookies(document.cookie,"client_information")):null;(null==je?void 0:je.loginid)&&(null==window||window.hj("identify",je.loginid,{is_logged_in:!!window.parseCookies(document.cookie,"client_information"),landing_company_shortcode:je.landing_company_shortcode||"null"}));null==(s=null==(c=null==(d=null==(r=null==Analytics?void 0:Analytics.Analytics)?void 0:r.getInstances())?void 0:d.ab)?void 0:c.GrowthBook)||s.loadFeatures().then((()=>{window.location.href.indexOf("/partners")>-1==!1&&(()=>{var e;const o=(null==(e=null==Analytics?void 0:Analytics.Analytics)?void 0:e.getFeatureValue("trigger_os_signup_wf"))?function(){const e=navigator.userAgent.toLowerCase();return/ipad|iphone|ipod/.test(e)}()||function(){const e=navigator.userAgent.toLowerCase();return/safari/.test(e)&&!/chrome/.test(e)&&!/crios/.test(e)}()?`https://${window.location.host}/signup`:(()=>{const e=window.location.hostname;let o;switch(o="deriv.com"===e||"deriv.be"===e||"deriv.me"===e?"production":"staging.deriv.com"===e?"staging":"development",o){case"production":return"https://hub.deriv.com/tradershub/signup";case"staging":return"https://staging-hub.deriv.com/tradershub/signup";default:return"https://dev-hub.deriv.com/tradershub/signup"}})():`https://${window.location.host}/signup`,n=document.getElementById("cta-home-btn-navbar");n&&(n.href=o);const i=document.querySelectorAll(".logged-out-btn");null==i||i.forEach((e=>{var n;(null==(n=null==e?void 0:e.href)?void 0:n.indexOf("/signup"))>0&&(e.href=o)}));const t=document.querySelectorAll(".logged-out-btn a");null==t||t.forEach((e=>{var n;(null==(n=null==e?void 0:e.href)?void 0:n.indexOf("/signup"))>0&&(e.href=o)}))})()})); From 92e8fbb1250826714da20587c3567e90a25c1e38 Mon Sep 17 00:00:00 2001 From: Prince Date: Tue, 17 Sep 2024 11:04:19 +0400 Subject: [PATCH 28/57] chore: migrated all --- src/js/footer/migration.js | 42 +++++++++++++++++++++++++++++++++++++- src/temp-static.js | 2 +- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/src/js/footer/migration.js b/src/js/footer/migration.js index 88d55d5..12afd66 100644 --- a/src/js/footer/migration.js +++ b/src/js/footer/migration.js @@ -1,9 +1,49 @@ -alert('migrated scripts: all') +// alert('migrated scripts: everything') window.customLoader = "static version all" +// +// This function adds a red line to the current accordion trigger +var Webflow = Webflow || []; +Webflow.push(function () { + // Find all accordion triggers + let triggers = document.querySelectorAll(".navbar_accordion-trigger"); + + triggers.forEach((trigger) => { + trigger.addEventListener("click", function () { + // Remove the .current class from all triggers + triggers.forEach((t) => t.classList.remove("current")); + + // Add the .current class to the clicked trigger + this.classList.add("current"); + }); + }); + + // Find the current page link in Navbar + let currentLink = document.querySelector( + ".navbar_accordion-link.w--current" + ); + + if (currentLink) { + // Find the closest accordion item + let accordionItem = currentLink.closest(".navbar_accordion-item"); + + if (accordionItem) { + // Find the trigger element within the found parent + let trigger = accordionItem.querySelector(".navbar_accordion-trigger"); + + if (trigger) { + // Add the .current class to the trigger + trigger.classList.add("current"); + } + } + } +}); + +// + // var Webflow = Webflow || []; diff --git a/src/temp-static.js b/src/temp-static.js index 2308602..e839c1e 100644 --- a/src/temp-static.js +++ b/src/temp-static.js @@ -1 +1 @@ -var e,o,n,i,t,a,r,d,c,s;import{initializeApp as l}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-app.js";import{getDatabase as u,ref as p,onValue as w}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-database.js";function h(e,o,n,i){let t="";if(n){let e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),t="; expires="+e.toUTCString()}document.cookie=i?e+"="+(o||"")+t+`;domain=${i};path=/`:e+"="+(o||"")+t+";path=/"}function m(e,o){const n={};return e.split(";").forEach((e=>{const[o,i]=e.split("=").map((e=>e.trim()));n[o]=decodeURIComponent(i)})),n[o]}function y(e){h("webflow-user-language",e,30)}function N(e){document.cookie=e+"=; Max-Age=-99999999;"}window.emailRegex=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,window.toggleErrorField=(e,o)=>{o?e.classList.remove("error-field"):e.classList.add("error-field")},window.disableButton=function(e){e.disabled=!0,e.style.opacity="0.5"},window.isEuRegion=function(e){const o=e.replace(/\/$/,"");return/^\/(?:[^\/]+\/)?eu(?:\/|$)/.test(o)},window.enableButton=function(e){e.disabled=!1,e.style.opacity="1"},window.getOauthUrl=function(){var e=window.location.href,o=new URL(e).hostname,n=["deriv.com","deriv.be","deriv.me"].find((e=>o.endsWith(e)));return n?`https://oauth.${n}`:"https://oauth.deriv.com"},window.getClientCountry=function(){var e;const o=m(document.cookie,"clients_country"),n=m(document.cookie,"client_information");return n&&(null==(e=JSON.parse(n))?void 0:e.residence)||o},window.deriv_com_url="deriv.com",window.deriv_me_url="deriv.me",window.deriv_be_url="deriv.be",window.webflow_domain="webflow.deriv.com",window.staging_url="staging.deriv.com",window.staging_deriv_be_url="staging.deriv.be",window.domain_list_app_id={[window.deriv_com_url]:"16929",[window.deriv_me_url]:"1411",[window.deriv_be_url]:"30767",[window.webflow_domain]:"53503",[window.staging_url]:"16303"},window.getDomain=()=>{var e=window.location.href;return new URL(e).hostname},window.getAppId=()=>{const e=window.getDomain(),o=new URLSearchParams(window.location.search||"").get("app_id");if(o)return o;const n=localStorage.getItem("config.app_id");if(n)return n;const i={[window.webflow_domain]:window.domain_list_app_id[window.webflow_domain],[window.deriv_be_url]:window.domain_list_app_id[window.deriv_be_url],[window.deriv_me_url]:window.domain_list_app_id[window.deriv_me_url],[window.staging_url]:window.domain_list_app_id[window.staging_url]};return i[e]?i[e]:window.domain_list_app_id[window.deriv_com_url]};const g=()=>{const e=localStorage.getItem("config.server_url"),o=m(document.cookie,"webflow-user-language");let n=o?o.toLowerCase():"en";"zh-cn"!==n&&"zh-tw"!==n||(n=n.replace("-","_"));const i=(e=>{let o="";return e&&Object.keys(e).forEach((n=>{o+=`&${n}=${e[n]}`})),o})((()=>{const e=m(document.cookie,"utm_data");if(e){const o=JSON.parse(e),n={};return["utm_source","utm_ad_id","utm_adgroup_id","utm_adrollclk_id","utm_campaign","utm_campaign_id","utm_content","utm_fbcl_id","utm_gl_client_id","utm_medium","utm_msclk_id","utm_term"].forEach((e=>{o.hasOwnProperty(e)&&(n[e]=o[e])})),n}return null})()),t=m(document.cookie,"affiliate_tracking"),a=t?`&affiliate_token=${t}`:"",r=void["mt5","bot","derivx"].filter((e=>window.location.pathname.includes(e)&&e))||"";return e&&/qa/.test(e)?`https://${e}/oauth2/authorize?app_id=${window.getAppId()}&l=${n}&brand=deriv${a}${i}&platform=${r}`:`${window.getOauthUrl()}/oauth2/authorize?app_id=${(()=>{const e=window.getDomain();return e===window.deriv_me_url?window.domain_list_app_id[window.deriv_me_url]:e===window.deriv_be_url?window.domain_list_app_id[window.deriv_be_url]:e===window.webflow_domain?window.domain_list_app_id[window.webflow_domain]:window.domain_list_app_id[window.deriv_com_url]})()}&l=${n}&brand=deriv${a}${i}&platform=${r}`};if(!!!m(document.cookie,"client_information")){var f=document.createElement("iframe");f.src=(()=>{const e=window.location.hostname;let o;switch(o="deriv.com"===e||"deriv.be"===e||"deriv.me"===e?"production":"staging.deriv.com"===e?"staging":"development",o){case"production":return"https://hub.deriv.com/tradershub/signup";case"staging":return"https://staging-hub.deriv.com/tradershub/signup";default:return"https://dev-hub.deriv.com/tradershub/signup"}})(),f.style.width="0",f.style.height="0",f.style.border="none",f.style.visibility="hidden",f.setAttribute("sandbox","allow-same-origin allow-scripts"),document.body.appendChild(f)}window.establishWebSocketConnection=()=>new Promise(((e,o)=>{const n=m(document.cookie,"webflow-user-language"),i=n?n.toLowerCase():"en",t=localStorage.getItem("config.server_url")||"green.derivws.com";window.websocket=new WebSocket(`wss://${t}/websockets/v3?app_id=${window.getAppId()}&l=${i||"en"}&brand=deriv`),window.websocket.addEventListener("open",(o=>{window.websocket.addEventListener("close",(()=>{window.websocket.close()})),window.websocket.addEventListener("message",(e=>{JSON.parse(e.data)})),e(window.websocket)})),window.websocket.addEventListener("error",(e=>{var n;null==(n=null==window?void 0:window.websocket)||n.close(),o(e)}))})),window.socketMessageSend=async(e,o)=>{var n;try{return(null==window?void 0:window.websocket)&&(null==(n=null==window?void 0:window.websocket)?void 0:n.readyState)===(null==WebSocket?void 0:WebSocket.OPEN)?(window.websocket.send(e),new Promise(((e,n)=>{window.websocket.addEventListener("message",(i=>{const t=JSON.parse(i.data);o===t.msg_type&&(t.error?n(t.error):e(t))}))}))):establishWebSocketConnection().then((()=>(websocket.send(e),new Promise(((e,n)=>{websocket.addEventListener("message",(i=>{const t=JSON.parse(i.data);o===t.msg_type&&(t.error?n(t.error):e(t))}))}))))).catch((e=>Promise.reject(e)))}catch(i){return Promise.reject(i)}};const v=[{id:"appgallery",selectors:[".footer_banner-badge.gallery.w-inline-block",".app-download_link-wrapper.appgallery.w-inline-block"],countries:["af","ax","al","dz","as","ad","ao","aq","am","au","at","az","bh","bd","by","be","bj","bm","bt","bo","ba","bw","bv","br","io","bn","bg","bf","bi","kh","cm","ca","cv","bq","cf","td","cn","cx","cc","km","cg","cd","ck","ci","hr","cu","cw","cy","cz","dk","dj","dm","eg","gq","er","ee","et","fk","fo","fj","fi","fr","pf","tf","ga","gm","ge","de","gh","gi","gr","gl","gu","gg","gn","gw","hm","va","hu","is","in","id","ir","iq","ie","im","il","it","jp","je","jo","kz","ke","ki","kr","kp","kw","kg","la","lv","lb","ls","lr","ly","li","lt","lu","mo","mk","mg","mw","my","mv","ml","mt","mh","mr","mu","yt","mx","fm","md","mc","mn","me","ma","mz","mm","na","nr","np","nl","nc","nz","ne","ng","nu","nf","mp","no","om","pk","pw","ps","pg","pe","ph","pn","pl","pt","qa","re","ro","ru","rw","sh","kn","pm","bl","mf","ws","sm","st","sa","sn","rs","sc","sl","sg","sx","sk","si","sb","so","gs","ss","es","lk","sd","sj","sz","se","ch","sy","tw","tj","tz","th","tl","tg","tk","to","tn","tr","tm","tc","tv","ug","ua","ae","gb","um","us","uz","vu","vi","wf","eh","ye","zm","zw"]},{id:"googlePlay",selectors:[".footer_banner-badge.google.w-inline-block",".app-download_link-wrapper.google.w-inline-block"],countries:["af","ax","as","ad","ai","aq","au","bb","bt","bv","io","bn","bi","ca","bq","cf","cx","cc","cg","cd","ck","cw","gq","et","fk","fo","gf","pf","tf","gl","gp","gu","gg","gy","hm","va","hk","ir","im","jp","je","ki","kp","ls","ly","mg","mw","mh","mq","mr","yt","fm","mn","me","ms","nr","nc","nz","ng","nu","nf","mp","pw","ps","pn","pr","re","sh","kn","lc","pm","vc","bl","mf","st","sg","sx","gs","ss","sj","sz","sy","tl","tk","tc","tv","um","us","vg","vi","wf","eh"]},{id:"appstore",selectors:[".footer_banner-badge.store.w-inline-block",".app-download_link-wrapper.appstore.w-inline-block"],countries:["ax","al","as","ad","aq","aw","au","at","bd","be","bv","io","bg","bi","ca","bq","cf","cx","cc","km","ck","hr","cu","cw","cy","cz","dk","dj","gq","er","ee","et","fk","fo","fi","fr","gf","pf","tf","de","gi","gr","gl","gp","gu","gg","gn","ht","hm","va","hk","hu","is","ir","iq","ie","im","il","it","je","ki","kp","lv","ls","ly","li","lt","lu","mt","mh","mq","yt","fm","me","nl","nc","nz","ng","nu","nf","mp","no","ps","pn","pl","pt","pr","re","ro","sh","pm","bl","mf","ws","sm","sg","sx","sk","si","so","gs","ss","es","sd","sj","se","ch","sy","tw","tl","tg","tk","tr","tv","gb","um","us","vu","vi","wf","eh"]},{id:"p2p",selectors:["#p2payment.accordion_toggle-block","#p2component.section_dp2p","#card_block_p2p.help_category"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"w-dyn-item-p2p",selectors:["div.w-dyn-item"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"hideRow",selectors:["#footer_social-icons_row","#footer_text_row",".footer_risk-warning.w-richtext"],countries:["br","uy","lk","ch","za","ec"]},{id:"hideDiel",selectors:["#footer_text_diel","#footer_social-icons_diel"],countries:["br","uy","lk","ch","za","ec"]}],Y=[{id:"showElems",selectors:[".banner_disclaimer"],countries:["br","uy","lk","ch","za","ec"]}],_=()=>{const e=window.getClientCountry();v.forEach((o=>{const n="hideDiel"===o.id?!o.countries.includes(e):o.countries.includes(e);if(e&&n)return o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((e=>{if(e)if("w-dyn-item-p2p"===o.id){e.querySelector("#card_block_p2p.help_category")&&(e.style.display="none")}else e.style.display="none"}))}));if(!n){const e=document.querySelector(".footer_social-icons.diel");e&&(e.style.display="flex")}})),Y.forEach((o=>{e&&o.countries.includes(e)?o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{if(o){const n=document.querySelector(".page-wrapper");".banner_disclaimer"===e?(n.classList.add("disclaimer-show"),o.classList.remove("hide-element")):o.style.display="block"}}))})):o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{o&&(".banner_disclaimer"===e?o.classList.add("hide-element"):o.style.display="none")}))}))}))},A=JSON.stringify({website_status:1});!async function(){try{const e=await fetch("https://www.cloudflare.com/cdn-cgi/trace"),o=await e.text(),n=Object.fromEntries(o.split("\n").map((e=>e.split("=",2)))).loc.toLowerCase();n!==m(document.cookie,"clients_country")&&(N("clients_country"),h("clients_country",n,30)),_()}catch(e){_()}}();m(document.cookie,"clients_country")||window.socketMessageSend(A,"website_status").then((e=>{m(document.cookie,"clients_country")!==e.website_status.clients_country&&(N("clients_country"),h("clients_country",e.website_status.clients_country,30)),_()})).catch((e=>{}));const b=["ar","bn","de","en","es","fr","it","ko","pl","pt","ru","si","sw","th","tr","vi","zh_cn","zh_tw","zh-cn","zh-tw"];(()=>{var e;const o=window.location.pathname,n=window.location.hash,i=window.location.search,t=o.split("/"),a=t[1],r=b.includes(a||""),d=t.includes("careers")||t.includes("locations")||t.includes("derivtech")||t.includes("derivlife")||t.includes("eu-careers")||t.includes("our-locations");r&&y(a);const c=(null==(e=m(document.cookie,"webflow-user-language"))?void 0:e.toLowerCase())||"en",s=r?a:c;if((r||"en"!==c)&&a!==c)if(r&&a!==c)y(s);else if(!d){const e=(r?t.map((e=>e===a?s:e)).join("/"):s+t.join("/"))+i+n;window.location.href="/"+e}})();const k=function(){let e,o=!1,n=!1;const i=()=>{n=!0,o=!!m(document.cookie,"client_information"),o&&clearInterval(e),document.dispatchEvent(new Event("authStatusChange"))};return i(),e=setInterval(i,800),{getLoggedInStatus:()=>o,getAuthCheckedStatus:()=>n,onAuthStatusChange:e=>document.addEventListener("authStatusChange",e)}}();k.onAuthStatusChange((()=>{if(k.getAuthCheckedStatus()&&k.getLoggedInStatus()){document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.add("hide-element")}))}else if(k.getAuthCheckedStatus()&&!k.getLoggedInStatus()){document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.add("hide-element")}))}}));const L=window.location.href;if(["help-centre"].some((e=>L.includes(e)))){const e=new URL(L).searchParams;e.has("platform")&&"derivgo"===e.get("platform")&&(S=".derivgo-query-element",document.querySelectorAll(S).forEach((e=>{e.style.display="none"})))}var S;const E=document.querySelector(".banner_disclaimer"),C=document.querySelector(".main-wrapper");if(E){new ResizeObserver((e=>{for(let o of e)if(o.target===E){let e=o.target.getBoundingClientRect();C&&(C.style.paddingTop=e.height+"px")}})).observe(E)}window.addEventListener("pageshow",(function(e){if(e.persisted){const e=document.querySelector(".w-nav-overlay");e&&(e.style.display="none",document.querySelector("body").click())}}));const q=u(l({databaseURL:window.location.hostname.includes("staging")?"https://app-config-staging.firebaseio.com":"https://app-config-prod.firebaseio.com"}));let I=!1,z=!1;!function(){var e;const o=document.getElementById("live_chat-wrapper");try{const e=p(q,"remote_config/deriv-com/chat");w(e,(e=>{const n=e.val();I=n.live_chat,z=n.whatsapp_chat;const i=document.querySelector(".whatsapp_chat"),t=document.querySelector(".livechatbtn");i&&(i.style.visibility=z?"visible":"hidden"),t&&(t.style.visibility=I?"visible":"hidden");if(window.location.pathname.includes("/help-centre")){const e=document.querySelectorAll(".livechatbtn");I?e.forEach((e=>{e.style.visibility="visible"})):e.forEach((e=>{e.style.visibility="hidden"}));const o=document.querySelectorAll(".whatsapp_chat");z?o.forEach((e=>{e.style.visibility="visible"})):o.forEach((e=>{e.style.visibility="hidden"}))}window.addEventListener("scroll",(function(){var e,n;(I||z)&&(null==(e=null==o?void 0:o.classList)||e.remove("hide-element")),I||z||null==(n=null==o?void 0:o.classList)||n.add("hide-element")}))}),(e=>{var n;null==(n=null==o?void 0:o.classList)||n.remove("hide-element")}))}catch(n){null==(e=null==o?void 0:o.classList)||e.remove("hide-element")}}();new MutationObserver((function(e){for(const o of e)if(o.addedNodes.length)for(const e of o.addedNodes)e.nodeType===Node.ELEMENT_NODE&&"chat-widget-minimized"===e.id&&(e.style.opacity="0")})).observe(document.body,{childList:!0,subtree:!0});const x=window.getClientCountry();const j=[{country:"af",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"ax",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"al",apple:"No",android:"Yes",huawei:"No"},{country:"dz",apple:"Yes",android:"Yes",huawei:"No"},{country:"as",apple:"N/A",android:"No",huawei:"N/A"},{country:"ad",apple:"N/A",android:"N/A",huawei:"No"},{country:"ao",apple:"Yes",android:"Yes",huawei:"No"},{country:"ai",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"aq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ag",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ar",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"am",apple:"Yes",android:"Yes",huawei:"No"},{country:"aw",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"au",apple:"No",android:"No",huawei:"No"},{country:"at",apple:"No",android:"Yes",huawei:"No"},{country:"az",apple:"Yes",android:"Yes",huawei:"No"},{country:"bs",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bh",apple:"Yes",android:"Yes",huawei:"No"},{country:"bd",apple:"N/A",android:"Yes",huawei:"No"},{country:"bb",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"by",apple:"Yes",android:"Yes",huawei:"No"},{country:"be",apple:"No",android:"Yes",huawei:"No"},{country:"bz",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bj",apple:"Yes",android:"Yes",huawei:"No"},{country:"bm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"bt",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"bo",apple:"Yes",android:"Yes",huawei:"No"},{country:"ba",apple:"Yes",android:"Yes",huawei:"No"},{country:"bw",apple:"Yes",android:"Yes",huawei:"No"},{country:"bv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"br",apple:"Yes",android:"Yes",huawei:"No"},{country:"io",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"bn",apple:"Yes",android:"N/A",huawei:"No"},{country:"bg",apple:"No",android:"Yes",huawei:"No"},{country:"bf",apple:"Yes",android:"Yes",huawei:"No"},{country:"bi",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kh",apple:"Yes",android:"Yes",huawei:"No"},{country:"cm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ca",apple:"No",android:"No",huawei:"No"},{country:"cv",apple:"Yes",android:"Yes",huawei:"No"},{country:"bq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ky",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cf",apple:"N/A",android:"N/A",huawei:"No"},{country:"td",apple:"Yes",android:"Yes",huawei:"No"},{country:"cl",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cn",apple:"Yes",android:"Yes",huawei:"No"},{country:"cx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"co",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"km",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cg",apple:"Yes",android:"N/A",huawei:"No"},{country:"cd",apple:"Yes",android:"N/A",huawei:"No"},{country:"ck",apple:"N/A",android:"N/A",huawei:"No"},{country:"cr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ci",apple:"Yes",android:"Yes",huawei:"No"},{country:"hr",apple:"No",android:"Yes",huawei:"No"},{country:"cu",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cw",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cy",apple:"No",android:"Yes",huawei:"No"},{country:"cz",apple:"No",android:"Yes",huawei:"No"},{country:"dk",apple:"No",android:"Yes",huawei:"No"},{country:"dj",apple:"N/A",android:"Yes",huawei:"No"},{country:"dm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"do",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ec",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"eg",apple:"Yes",android:"Yes",huawei:"No"},{country:"sv",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gq",apple:"N/A",android:"N/A",huawei:"No"},{country:"er",apple:"N/A",android:"Yes",huawei:"No"},{country:"ee",apple:"No",android:"Yes",huawei:"No"},{country:"et",apple:"N/A",android:"N/A",huawei:"No"},{country:"fk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"fo",apple:"N/A",android:"N/A",huawei:"No"},{country:"fj",apple:"Yes",android:"Yes",huawei:"No"},{country:"fi",apple:"No",android:"Yes",huawei:"No"},{country:"fr",apple:"No",android:"Yes",huawei:"No"},{country:"gf",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"pf",apple:"N/A",android:"N/A",huawei:"No"},{country:"tf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ga",apple:"Yes",android:"Yes",huawei:"No"},{country:"gm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ge",apple:"Yes",android:"Yes",huawei:"No"},{country:"de",apple:"No",android:"Yes",huawei:"No"},{country:"gh",apple:"Yes",android:"Yes",huawei:"No"},{country:"gi",apple:"N/A",android:"Yes",huawei:"No"},{country:"gr",apple:"No",android:"Yes",huawei:"No"},{country:"gl",apple:"N/A",android:"N/A",huawei:"No"},{country:"gd",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gp",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"gu",apple:"N/A",android:"No",huawei:"N/A"},{country:"gt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gg",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"gn",apple:"N/A",android:"Yes",huawei:"No"},{country:"gw",apple:"Yes",android:"Yes",huawei:"No"},{country:"gy",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ht",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"hm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"va",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"hn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"hk",apple:"No",android:"No",huawei:"Yes"},{country:"hu",apple:"No",android:"Yes",huawei:"No"},{country:"is",apple:"No",android:"Yes",huawei:"No"},{country:"in",apple:"Yes",android:"Yes",huawei:"No"},{country:"id",apple:"Yes",android:"Yes",huawei:"No"},{country:"ir",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"iq",apple:"No",android:"Yes",huawei:"N/A"},{country:"ie",apple:"No",android:"Yes",huawei:"No"},{country:"im",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"il",apple:"No",android:"Yes",huawei:"No"},{country:"it",apple:"No",android:"Yes",huawei:"No"},{country:"jm",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"jp",apple:"Yes",android:"No",huawei:"No"},{country:"je",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"jo",apple:"Yes",android:"Yes",huawei:"No"},{country:"kz",apple:"Yes",android:"Yes",huawei:"No"},{country:"ke",apple:"Yes",android:"Yes",huawei:"No"},{country:"ki",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kr",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"kp",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kw",apple:"Yes",android:"Yes",huawei:"No"},{country:"kg",apple:"Yes",android:"Yes",huawei:"No"},{country:"la",apple:"Yes",android:"Yes",huawei:"No"},{country:"lv",apple:"No",android:"Yes",huawei:"No"},{country:"lb",apple:"Yes",android:"Yes",huawei:"No"},{country:"ls",apple:"N/A",android:"N/A",huawei:"No"},{country:"lr",apple:"Yes",android:"Yes",huawei:"No"},{country:"ly",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"li",apple:"N/A",android:"Yes",huawei:"No"},{country:"lt",apple:"No",android:"Yes",huawei:"No"},{country:"lu",apple:"No",android:"Yes",huawei:"No"},{country:"mo",apple:"Yes",android:"Yes",huawei:"No"},{country:"mk",apple:"Yes",android:"Yes",huawei:"No"},{country:"mg",apple:"Yes",android:"N/A",huawei:"No"},{country:"mw",apple:"Yes",android:"N/A",huawei:"No"},{country:"my",apple:"Yes",android:"Yes",huawei:"No"},{country:"mv",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"ml",apple:"Yes",android:"Yes",huawei:"No"},{country:"mt",apple:"No",android:"Yes",huawei:"No"},{country:"mh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mq",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"mr",apple:"Yes",android:"N/A",huawei:"No"},{country:"mu",apple:"Yes",android:"Yes",huawei:"No"},{country:"yt",apple:"N/A",android:"N/A",huawei:"No"},{country:"mx",apple:"Yes",android:"Yes",huawei:"No"},{country:"fm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"md",apple:"Yes",android:"Yes",huawei:"No"},{country:"mc",apple:"Yes",android:"Yes",huawei:"No"},{country:"mn",apple:"Yes",android:"N/A",huawei:"No"},{country:"me",apple:"No",android:"N/A",huawei:"No"},{country:"ms",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ma",apple:"Yes",android:"Yes",huawei:"No"},{country:"mz",apple:"Yes",android:"Yes",huawei:"No"},{country:"mm",apple:"Yes",android:"Yes",huawei:"No"},{country:"na",apple:"Yes",android:"Yes",huawei:"No"},{country:"nr",apple:"Yes",android:"N/A",huawei:"No"},{country:"np",apple:"Yes",android:"Yes",huawei:"No"},{country:"nl",apple:"No",android:"Yes",huawei:"No"},{country:"nc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nz",apple:"No",android:"No",huawei:"No"},{country:"ni",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ne",apple:"Yes",android:"Yes",huawei:"No"},{country:"ng",apple:"No",android:"No",huawei:"No"},{country:"nu",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mp",apple:"N/A",android:"No",huawei:"N/A"},{country:"no",apple:"No",android:"Yes",huawei:"No"},{country:"om",apple:"Yes",android:"Yes",huawei:"No"},{country:"pk",apple:"Yes",android:"Yes",huawei:"No"},{country:"pw",apple:"Yes",android:"No",huawei:"N/A"},{country:"ps",apple:"N/A",android:"N/A",huawei:"No"},{country:"pa",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pg",apple:"Yes",android:"Yes",huawei:"No"},{country:"py",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pe",apple:"Yes",android:"Yes",huawei:"No"},{country:"ph",apple:"Yes",android:"Yes",huawei:"No"},{country:"pn",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"pl",apple:"No",android:"Yes",huawei:"No"},{country:"pt",apple:"No",android:"Yes",huawei:"No"},{country:"pr",apple:"N/A",android:"No",huawei:"Yes"},{country:"qa",apple:"Yes",android:"Yes",huawei:"No"},{country:"re",apple:"N/A",android:"N/A",huawei:"No"},{country:"ro",apple:"No",android:"Yes",huawei:"No"},{country:"ru",apple:"Yes",android:"Yes",huawei:"No"},{country:"rw",apple:"Yes",android:"Yes",huawei:"No"},{country:"sh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kn",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"lc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"pm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"vc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"bl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ws",apple:"N/A",android:"Yes",huawei:"No"},{country:"sm",apple:"N/A",android:"Yes",huawei:"No"},{country:"st",apple:"Yes",android:"N/A",huawei:"No"},{country:"sa",apple:"Yes",android:"Yes",huawei:"No"},{country:"sn",apple:"Yes",android:"Yes",huawei:"No"},{country:"rs",apple:"Yes",android:"Yes",huawei:"No"},{country:"sc",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"sl",apple:"Yes",android:"Yes",huawei:"No"},{country:"sg",apple:"No",android:"No",huawei:"No"},{country:"sx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sk",apple:"No",android:"Yes",huawei:"No"},{country:"si",apple:"No",android:"Yes",huawei:"No"},{country:"sb",apple:"Yes",android:"Yes",huawei:"No"},{country:"so",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"za",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gs",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ss",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"es",apple:"No",android:"Yes",huawei:"No"},{country:"lk",apple:"Yes",android:"Yes",huawei:"No"},{country:"sd",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"sr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"sj",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sz",apple:"Yes",android:"N/A",huawei:"No"},{country:"se",apple:"No",android:"Yes",huawei:"No"},{country:"ch",apple:"No",android:"Yes",huawei:"No"},{country:"sy",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tw",apple:"No",android:"Yes",huawei:"No"},{country:"tj",apple:"Yes",android:"Yes",huawei:"No"},{country:"tz",apple:"Yes",android:"Yes",huawei:"No"},{country:"th",apple:"Yes",android:"Yes",huawei:"No"},{country:"tl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tg",apple:"N/A",android:"Yes",huawei:"No"},{country:"tk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"to",apple:"Yes",android:"Yes",huawei:"No"},{country:"tt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"tn",apple:"Yes",android:"Yes",huawei:"No"},{country:"tr",apple:"No",android:"Yes",huawei:"No"},{country:"tm",apple:"Yes",android:"Yes",huawei:"No"},{country:"tc",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"tv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ug",apple:"Yes",android:"Yes",huawei:"No"},{country:"ua",apple:"Yes",android:"Yes",huawei:"No"},{country:"ae",apple:"Yes",android:"Yes",huawei:"No"},{country:"gb",apple:"No",android:"Yes",huawei:"No"},{country:"um",apple:"N/A",android:"No",huawei:"N/A"},{country:"us",apple:"No",android:"No",huawei:"N/A"},{country:"uy",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"uz",apple:"Yes",android:"Yes",huawei:"No"},{country:"vu",apple:"No",android:"Yes",huawei:"N/A"},{country:"ve",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vg",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"vi",apple:"N/A",android:"No",huawei:"N/A"},{country:"wf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"eh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ye",apple:"Yes",android:"Yes",huawei:"No"},{country:"zm",apple:"Yes",android:"Yes",huawei:"No"},{country:"zw",apple:"Yes",android:"Yes",huawei:"No"}].find((e=>e.country===x)),O=j?function(e){const{apple:o,android:n,huawei:i}=e;return"Yes"===o&&"Yes"===n&&"Yes"===i?"Android, iOS & Huawei":"Yes"===o&&"Yes"===n&&"Yes"!==i?"Android, and iOS":"Yes"===o&&"Yes"===i&&"Yes"!==n?"iOS, and Huawei":"Yes"===n&&"Yes"!==o&&"Yes"!==i?"Android":"Yes"===o&&"Yes"===i&&"Yes"!==n?"iOS, and Huawei":"Yes"===o&&"Yes"!==n&&"Yes"!==i?"iOS":"Yes"!==o&&"Yes"!==n&&"Yes"===i?"Huawei":""}(j):"",$=document.getElementById("app-download-heading");$&&($.innerText=O);const B=document.querySelector(".redirection_background-wrapper"),D=document.getElementById("cancel-redirect"),P=document.getElementById("proceed-redirect");if(window.isEuRegion(window.location.pathname)&&B&&D&&P){const e=["deriv.me","deriv.be","deriv.com","app.deriv.me","app.deriv.be","app.deriv.com","docs.deriv.com","community.deriv.com","deriv.statuspage.io","signup.deriv.com","login.deriv.com","api.deriv.com"];let o="",n="_self";document.querySelectorAll("a").forEach((function(i){const t=new URL(i.href,window.location.href),a=new URL(window.location.href);e.includes(t.host)||t.host===a.host||i.addEventListener("click",(function(e){e.preventDefault(),o=t.href,n=i.target||"_self",B.classList.remove("hide-element"),document.body.style.overflow="hidden"}))})),D.addEventListener("click",(function(){B.classList.add("hide-element"),document.body.style.overflow="auto",o=""})),P.addEventListener("click",(function(){o&&(window.open(o,n),o="",B.classList.add("hide-element"),document.body.style.overflow="auto")}))}document.querySelector(".banner_disclaimer")?document.body.classList.add("disclaimer-visible"):document.body.classList.remove("disclaimer-visible");const W=document.querySelectorAll(".navbar_accordion-item");function R(){const e=document.querySelector(".navbar_accordion-trigger.open");e&&e.scrollIntoView({behavior:"smooth",block:"start"})}W.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.overflow="hidden",o.style.transition="max-height 0.3s ease-in, opacity 0.3s ease-in",o.style.opacity="0"})),W.forEach((e=>{const o=e.querySelector(".navbar_accordion-trigger");o.addEventListener("click",(function(){const e=o.classList.contains("open");if(W.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.opacity="0"})),!e){o.classList.add("open");const e=o.nextElementSibling;e.classList.add("open"),e.style.maxHeight=e.scrollHeight+"px",e.style.opacity="1"}}))}));document.querySelectorAll(".navbar_accordion-trigger").forEach((e=>{e.addEventListener("click",(function(){setTimeout(R,300)}))}));const U=new MutationObserver((e=>{e.forEach((e=>{if("class"===e.attributeName){const o=e.target;o.classList.contains("open")&&o.scrollIntoView({behavior:"smooth",block:"start"})}}))}));document.querySelectorAll(".navbar_accordion-item").forEach((e=>{U.observe(e,{attributes:!0})}));const J=new URL(window.location.href),T=new URLSearchParams(J.search),F=T.get("t");if(T.has("referrer")&&null!=F){m(document.cookie,"referrer_token")!==F&&(N("referrer_token"),h("referrer_token",F,365,".deriv.com"))}const H=document.getElementById("navbar-home_login");H&&H.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const M=document.getElementById("res-navbar-home_login");M&&M.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const V=document.getElementById("white-navbar_login");V&&V.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const G=document.getElementById("res-white-navbar_login");function K(e,o,n){let i="";{let e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),i="; expires="+e.toUTCString()}document.cookie=e+"="+(o||"")+i+"; path=/"}G&&G.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()})),window.customLoader="static version all",(de=de||[]).push((function(){let e=document.querySelector(".locale > .new-navbar_dropdown-link.w--current");if(e){let o=e.getAttribute("hreflang"),n=document.querySelectorAll(".current-locale-iso-code");if(o&&n.length)for(let e of n)e.innerText=o}}));let Z=document.querySelectorAll(".w-locales-items");if(Z.length>0){let e=function(e){let o=document.querySelector('a[hreflang="'+e+'"]');o&&window.location.pathname!==o.getAttribute("href")&&o.click()};Z.forEach((function(e){e.querySelectorAll("a").forEach((function(e){e.addEventListener("click",(function(o){o.preventDefault(),K("webflow-user-language",e.getAttribute("hreflang"),30),window.location.href=e.href}))}))})),window.setLanguageCookie=e=>{K("webflow-user-language",e,30)};let o=function(e){let o=document.cookie.split(";");for(let n=0;ni.includes(e))),o&&t&&e(o)}(de=de||[]).push((function(){if(document.querySelector(".new-navbar_component")){let e=function(){document.body.classList.add("disable-scroll")},o=function(){document.body.classList.remove("disable-scroll")};const n=document.querySelector(".new-navbar_component");n.addEventListener("mouseenter",(()=>{window.innerWidth>991&&e()})),n.addEventListener("mouseleave",(()=>{window.innerWidth>991&&o()}))}})),window.getClientCountry();const Q=window.parseCookies(document.cookie,"webflow-user-language"),X=["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"];if(window.location.pathname.endsWith("p2p")&&!window.location.pathname.startsWith("/blog")){const e=window.getClientCountry();e&&X.includes(e)&&("en"===Q?window.location.replace("/404"):window.location.replace(`/${Q}/404`))}if(void 0!==window.parseCookies(document.cookie,"client_information")){let e=function(e){e.forEach((e=>{e.href="https://app.deriv.com/appstore/traders-hub"}))},o=document.querySelectorAll("a.live-markets_button.is-secondary.is-small.is-purchase.w-button"),n=document.querySelectorAll("a.live-markets_button.is-secondary.is-small.is-sell.w-button");e(o),e(n)}document.getElementById("mobile-menu"),document.getElementById("live_chat-wrapper");const ee=()=>{window.LC_API&&window.LC_API.open_chat_window&&window.LC_API.open_chat_window()},oe=()=>{"true"===new URLSearchParams(window.location.search).get("is_livechat_open")&&ee()},ne=e=>{var o;null==(o=null==window?void 0:window.LiveChatWidget)||o.on("ready",(()=>{window.LC_API.open_chat_window(),window.LC_API.hide_chat_window(),oe();const o=window.parseCookies(document.cookie,"utm_data"),n=o?JSON.parse(o):{},{utm_source:i,utm_medium:t,utm_campaign:a}=n,r=window.parseCookies(document.cookie,"client_information"),d=new URLSearchParams(window.location.search),{loginid:c,email:s,landing_company_shortcode:l,currency:u,residence:p,first_name:w,last_name:h}=r?JSON.parse(r):{},m={is_logged_in:e,loginid:c??"",landing_company_shortcode:l??"",currency:u??"",residence:p??"",email:s??"",platform:d.get("platform")??"",utm_source:i??"",utm_medium:t??"",utm_campaign:a??""};window.LiveChatWidget.call("set_session_variables",m),e?(s&&window.LiveChatWidget.call("set_customer_email",s),w&&h&&window.LiveChatWidget.call("set_customer_name",`${w} ${h}`)):window.LC_API.on_chat_ended=()=>{window.LiveChatWidget.call("set_customer_email"," "),window.LiveChatWidget.call("set_customer_name"," ")},oe(),window.LiveChatWidget.on("new_event",(e=>{e.greeting&&window.LC_API.open_chat_window()}))}))};let ie=!1;const te=()=>{const e=!!window.parseCookies(document.cookie,"client_information");e!==ie&&(ne(e),ie=e)};te(),setInterval(te,2e3),(()=>{if(window.__lc=window.__lc||{},window.__lc.license="12049137",window.LC_API=window.LC_API||{loaded:!1},window.LC_API.loaded)oe();else{const e=document.createElement("script");e.async=!0,e.src="https://cdn.livechatinc.com/tracking.js",e.onload=()=>{window.LC_API.loaded=!0,window.LC_API.on_after_load=function(){ne(!!window.parseCookies(document.cookie,"client_information")),oe()},"undefined"!=typeof LiveChatWidget&&LiveChatWidget.init&&LiveChatWidget.init()},document.body.appendChild(e)}})();const ae=document.querySelectorAll(".livechatbtn");ae.length>0&&ae.forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault(),ee()}))}));const re=document.getElementById("liveChatBtn");re&&re.addEventListener("click",(e=>{e.preventDefault(),ee()}));var de;document.querySelectorAll('a[rel="liveChatBtn"]').forEach((e=>{null==e||e.addEventListener("click",(e=>{e.preventDefault(),ee()}))})),(de=de||[]).push((function(){let e=document.querySelector(".navbar_menu-button");e&&e.addEventListener("click",(function(){let e=window.innerHeight,o=document.querySelector(".new-navbar_main-wrapper");if(o){let n=e-o.offsetHeight,i=document.querySelector(".new-navbar_menu");i&&(i.style.height=`${n}px`)}}))})),(de=de||[]).push((function(){let e=document.querySelector(".lang-mob");e&&e.addEventListener("click",(function(){let e=document.querySelector(".new-navbar_menu-wrapper");e&&e.scrollBy({top:-3e3})}))}));class ce{constructor(e){this.cookieName=e}setItem(e){const o=new Date;o.setDate(o.getDate()+30);const n="expires="+o.toUTCString(),i=encodeURIComponent(JSON.stringify(e));document.cookie=`${this.cookieName}=${i};${n};path=/`}getItem(){const e=document.cookie.split(";");for(let o=0;oye.includes(e)))&&document.head.querySelectorAll("link").forEach((function(e){e.hasAttribute("hreflang")&&"x-default"!==e.getAttribute("hreflang")&&e.remove()}));const Ne=e=>{window.rudderanalytics?window.rudderanalytics.track(e.name,e.properties):(e=>{let o=[],n=parseCookies(document.cookie,"cached_analytics_events");n&&(o=JSON.parse(n)),o.push(e),document.cookie=`cached_analytics_events=${JSON.stringify(o)}; path=/; Domain=.deriv.com`})(e)};window.addClickListener=function(e,o,n){e&&e.addEventListener("click",(function(){Ne({name:o,properties:n})}))};var ge=null==document?void 0:document.getElementsByClassName("livechatbtn"),fe=null==document?void 0:document.getElementsByClassName("whatsapp_chat"),ve=null==document?void 0:document.getElementsByClassName("tradershub-btn"),Ye=document.querySelectorAll(".btn-free-demo .w-button"),_e=document.querySelectorAll('.btn-free-demo [data-class="w-button"]');const Ae=document.querySelectorAll('[data-attributes="btn-primary-nav"]'),be=document.querySelectorAll('[data-attributes="btn-secondary-nav"]');ge&&Array.from(ge).forEach((e=>{window.addClickListener(e,"ce_widget_usage_form",{action:"click",widget_name:"livechat"})})),fe&&Array.from(fe).forEach((e=>{window.addClickListener(e,"ce_widget_usage_form",{action:"click",widget_name:"whatsapp"})})),ve&&Array.from(ve).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Traders Hub"})})),Ye&&Array.from(Ye).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),_e&&Array.from(_e).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),Ae&&Array.from(Ae).forEach((e=>{e.classList.contains("tradershub-btn")||window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),be&&Array.from(be).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Login"})}));var ke,Le,Se;"deriv.com"===window.location.hostname||"deriv.be"===window.location.hostname||"deriv.me"===window.location.hostname?(ke="sdk-UhZV3cNEg5nLNLNS",Se="nre64BV0dNIa44zW4tz5ow==",Le="1oV5agvlcnCZ6IH94wCKM1oR8Pd"):(ke="sdk-9wuqJ1mlcQsSyZQ",Se="",Le="1lN3tsFD2nruGFgM5F074DC2hMB");const Ee=(we=window.parseCookies(document.cookie,"client_information"))?JSON.parse(we):null,Ce=window.parseCookies(document.cookie,"utm_data"),qe=Ce?JSON.parse(Ce):{},Ie=window.parseCookies(document.cookie,"signup_device");let ze=null;Ie&&(ze=(null==(e=JSON.parse(Ie))?void 0:e.signup_device)||null);const xe={growthbookKey:ke,growthbookDecryptionKey:Se,rudderstackKey:Le,growthbookOptions:{navigate:e=>window.location.replace(e),antiFlicker:!1,navigateDelay:0,attributes:{country:window.parseCookies(document.cookie,"clients_country")||window.parseCookies(document.cookie,"website_status"),user_language:window.parseCookies(document.cookie,"user_language")||("undefined"!=typeof window?localStorage.getItem("i18n")||navigator.language:null),device_language:window.parseCookies(document.cookie,"language")||" ",device_type:ze,utm_source:null==qe?void 0:qe.utm_source,utm_medium:null==qe?void 0:qe.utm_medium,utm_campaign:null==qe?void 0:qe.utm_campaign,is_authorised:!!window.parseCookies(document.cookie,"client_information"),loggedIn:!!window.parseCookies(document.cookie,"client_information"),url:window.location.href}}};try{null==Analytics||Analytics.Analytics.initialise(xe);const e=(null==Ee?void 0:Ee.user_id)?null==Ee?void 0:Ee.user_id:null==(i=null==(n=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getInstances)?void 0:n.call(o).tracking)?void 0:i.getAnonymousId();null==(t=null==Analytics?void 0:Analytics.Analytics)||t.identifyEvent(e)}catch(Oe){}null==(a=null==Analytics?void 0:Analytics.Analytics)||a.pageView(location.pathname,"Deriv.com"),window.useGrowthbookFeatureFlag=function({featureFlag:e}){var o,n,i,t,a;let r=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getFeatureValue(e);return null==(a=null==(t=null==(i=null==(n=null==Analytics?void 0:Analytics.Analytics)?void 0:n.getInstances())?void 0:i.ab)?void 0:t.GrowthBook)||a.setRenderer((function(){var o;const n=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getFeatureValue(e);r=n})),r};const je=window.parseCookies(document.cookie,"client_information")?JSON.parse(window.parseCookies(document.cookie,"client_information")):null;(null==je?void 0:je.loginid)&&(null==window||window.hj("identify",je.loginid,{is_logged_in:!!window.parseCookies(document.cookie,"client_information"),landing_company_shortcode:je.landing_company_shortcode||"null"}));null==(s=null==(c=null==(d=null==(r=null==Analytics?void 0:Analytics.Analytics)?void 0:r.getInstances())?void 0:d.ab)?void 0:c.GrowthBook)||s.loadFeatures().then((()=>{window.location.href.indexOf("/partners")>-1==!1&&(()=>{var e;const o=(null==(e=null==Analytics?void 0:Analytics.Analytics)?void 0:e.getFeatureValue("trigger_os_signup_wf"))?function(){const e=navigator.userAgent.toLowerCase();return/ipad|iphone|ipod/.test(e)}()||function(){const e=navigator.userAgent.toLowerCase();return/safari/.test(e)&&!/chrome/.test(e)&&!/crios/.test(e)}()?`https://${window.location.host}/signup`:(()=>{const e=window.location.hostname;let o;switch(o="deriv.com"===e||"deriv.be"===e||"deriv.me"===e?"production":"staging.deriv.com"===e?"staging":"development",o){case"production":return"https://hub.deriv.com/tradershub/signup";case"staging":return"https://staging-hub.deriv.com/tradershub/signup";default:return"https://dev-hub.deriv.com/tradershub/signup"}})():`https://${window.location.host}/signup`,n=document.getElementById("cta-home-btn-navbar");n&&(n.href=o);const i=document.querySelectorAll(".logged-out-btn");null==i||i.forEach((e=>{var n;(null==(n=null==e?void 0:e.href)?void 0:n.indexOf("/signup"))>0&&(e.href=o)}));const t=document.querySelectorAll(".logged-out-btn a");null==t||t.forEach((e=>{var n;(null==(n=null==e?void 0:e.href)?void 0:n.indexOf("/signup"))>0&&(e.href=o)}))})()})); +var e,o,n,i,t,a,r,d,c,s;import{initializeApp as l}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-app.js";import{getDatabase as u,ref as p,onValue as w}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-database.js";function h(e,o,n,i){let t="";if(n){let e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),t="; expires="+e.toUTCString()}document.cookie=i?e+"="+(o||"")+t+`;domain=${i};path=/`:e+"="+(o||"")+t+";path=/"}function m(e,o){const n={};return e.split(";").forEach((e=>{const[o,i]=e.split("=").map((e=>e.trim()));n[o]=decodeURIComponent(i)})),n[o]}function y(e){h("webflow-user-language",e,30)}function N(e){document.cookie=e+"=; Max-Age=-99999999;"}window.emailRegex=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,window.toggleErrorField=(e,o)=>{o?e.classList.remove("error-field"):e.classList.add("error-field")},window.disableButton=function(e){e.disabled=!0,e.style.opacity="0.5"},window.isEuRegion=function(e){const o=e.replace(/\/$/,"");return/^\/(?:[^\/]+\/)?eu(?:\/|$)/.test(o)},window.enableButton=function(e){e.disabled=!1,e.style.opacity="1"},window.getOauthUrl=function(){var e=window.location.href,o=new URL(e).hostname,n=["deriv.com","deriv.be","deriv.me"].find((e=>o.endsWith(e)));return n?`https://oauth.${n}`:"https://oauth.deriv.com"},window.getClientCountry=function(){var e;const o=m(document.cookie,"clients_country"),n=m(document.cookie,"client_information");return n&&(null==(e=JSON.parse(n))?void 0:e.residence)||o},window.deriv_com_url="deriv.com",window.deriv_me_url="deriv.me",window.deriv_be_url="deriv.be",window.webflow_domain="webflow.deriv.com",window.staging_url="staging.deriv.com",window.staging_deriv_be_url="staging.deriv.be",window.domain_list_app_id={[window.deriv_com_url]:"16929",[window.deriv_me_url]:"1411",[window.deriv_be_url]:"30767",[window.webflow_domain]:"53503",[window.staging_url]:"16303"},window.getDomain=()=>{var e=window.location.href;return new URL(e).hostname},window.getAppId=()=>{const e=window.getDomain(),o=new URLSearchParams(window.location.search||"").get("app_id");if(o)return o;const n=localStorage.getItem("config.app_id");if(n)return n;const i={[window.webflow_domain]:window.domain_list_app_id[window.webflow_domain],[window.deriv_be_url]:window.domain_list_app_id[window.deriv_be_url],[window.deriv_me_url]:window.domain_list_app_id[window.deriv_me_url],[window.staging_url]:window.domain_list_app_id[window.staging_url]};return i[e]?i[e]:window.domain_list_app_id[window.deriv_com_url]};const g=()=>{const e=localStorage.getItem("config.server_url"),o=m(document.cookie,"webflow-user-language");let n=o?o.toLowerCase():"en";"zh-cn"!==n&&"zh-tw"!==n||(n=n.replace("-","_"));const i=(e=>{let o="";return e&&Object.keys(e).forEach((n=>{o+=`&${n}=${e[n]}`})),o})((()=>{const e=m(document.cookie,"utm_data");if(e){const o=JSON.parse(e),n={};return["utm_source","utm_ad_id","utm_adgroup_id","utm_adrollclk_id","utm_campaign","utm_campaign_id","utm_content","utm_fbcl_id","utm_gl_client_id","utm_medium","utm_msclk_id","utm_term"].forEach((e=>{o.hasOwnProperty(e)&&(n[e]=o[e])})),n}return null})()),t=m(document.cookie,"affiliate_tracking"),a=t?`&affiliate_token=${t}`:"",r=void["mt5","bot","derivx"].filter((e=>window.location.pathname.includes(e)&&e))||"";return e&&/qa/.test(e)?`https://${e}/oauth2/authorize?app_id=${window.getAppId()}&l=${n}&brand=deriv${a}${i}&platform=${r}`:`${window.getOauthUrl()}/oauth2/authorize?app_id=${(()=>{const e=window.getDomain();return e===window.deriv_me_url?window.domain_list_app_id[window.deriv_me_url]:e===window.deriv_be_url?window.domain_list_app_id[window.deriv_be_url]:e===window.webflow_domain?window.domain_list_app_id[window.webflow_domain]:window.domain_list_app_id[window.deriv_com_url]})()}&l=${n}&brand=deriv${a}${i}&platform=${r}`};if(!!!m(document.cookie,"client_information")){var f=document.createElement("iframe");f.src=(()=>{const e=window.location.hostname;let o;switch(o="deriv.com"===e||"deriv.be"===e||"deriv.me"===e?"production":"staging.deriv.com"===e?"staging":"development",o){case"production":return"https://hub.deriv.com/tradershub/signup";case"staging":return"https://staging-hub.deriv.com/tradershub/signup";default:return"https://dev-hub.deriv.com/tradershub/signup"}})(),f.style.width="0",f.style.height="0",f.style.border="none",f.style.visibility="hidden",f.setAttribute("sandbox","allow-same-origin allow-scripts"),document.body.appendChild(f)}window.establishWebSocketConnection=()=>new Promise(((e,o)=>{const n=m(document.cookie,"webflow-user-language"),i=n?n.toLowerCase():"en",t=localStorage.getItem("config.server_url")||"green.derivws.com";window.websocket=new WebSocket(`wss://${t}/websockets/v3?app_id=${window.getAppId()}&l=${i||"en"}&brand=deriv`),window.websocket.addEventListener("open",(o=>{window.websocket.addEventListener("close",(()=>{window.websocket.close()})),window.websocket.addEventListener("message",(e=>{JSON.parse(e.data)})),e(window.websocket)})),window.websocket.addEventListener("error",(e=>{var n;null==(n=null==window?void 0:window.websocket)||n.close(),o(e)}))})),window.socketMessageSend=async(e,o)=>{var n;try{return(null==window?void 0:window.websocket)&&(null==(n=null==window?void 0:window.websocket)?void 0:n.readyState)===(null==WebSocket?void 0:WebSocket.OPEN)?(window.websocket.send(e),new Promise(((e,n)=>{window.websocket.addEventListener("message",(i=>{const t=JSON.parse(i.data);o===t.msg_type&&(t.error?n(t.error):e(t))}))}))):establishWebSocketConnection().then((()=>(websocket.send(e),new Promise(((e,n)=>{websocket.addEventListener("message",(i=>{const t=JSON.parse(i.data);o===t.msg_type&&(t.error?n(t.error):e(t))}))}))))).catch((e=>Promise.reject(e)))}catch(i){return Promise.reject(i)}};const v=[{id:"appgallery",selectors:[".footer_banner-badge.gallery.w-inline-block",".app-download_link-wrapper.appgallery.w-inline-block"],countries:["af","ax","al","dz","as","ad","ao","aq","am","au","at","az","bh","bd","by","be","bj","bm","bt","bo","ba","bw","bv","br","io","bn","bg","bf","bi","kh","cm","ca","cv","bq","cf","td","cn","cx","cc","km","cg","cd","ck","ci","hr","cu","cw","cy","cz","dk","dj","dm","eg","gq","er","ee","et","fk","fo","fj","fi","fr","pf","tf","ga","gm","ge","de","gh","gi","gr","gl","gu","gg","gn","gw","hm","va","hu","is","in","id","ir","iq","ie","im","il","it","jp","je","jo","kz","ke","ki","kr","kp","kw","kg","la","lv","lb","ls","lr","ly","li","lt","lu","mo","mk","mg","mw","my","mv","ml","mt","mh","mr","mu","yt","mx","fm","md","mc","mn","me","ma","mz","mm","na","nr","np","nl","nc","nz","ne","ng","nu","nf","mp","no","om","pk","pw","ps","pg","pe","ph","pn","pl","pt","qa","re","ro","ru","rw","sh","kn","pm","bl","mf","ws","sm","st","sa","sn","rs","sc","sl","sg","sx","sk","si","sb","so","gs","ss","es","lk","sd","sj","sz","se","ch","sy","tw","tj","tz","th","tl","tg","tk","to","tn","tr","tm","tc","tv","ug","ua","ae","gb","um","us","uz","vu","vi","wf","eh","ye","zm","zw"]},{id:"googlePlay",selectors:[".footer_banner-badge.google.w-inline-block",".app-download_link-wrapper.google.w-inline-block"],countries:["af","ax","as","ad","ai","aq","au","bb","bt","bv","io","bn","bi","ca","bq","cf","cx","cc","cg","cd","ck","cw","gq","et","fk","fo","gf","pf","tf","gl","gp","gu","gg","gy","hm","va","hk","ir","im","jp","je","ki","kp","ls","ly","mg","mw","mh","mq","mr","yt","fm","mn","me","ms","nr","nc","nz","ng","nu","nf","mp","pw","ps","pn","pr","re","sh","kn","lc","pm","vc","bl","mf","st","sg","sx","gs","ss","sj","sz","sy","tl","tk","tc","tv","um","us","vg","vi","wf","eh"]},{id:"appstore",selectors:[".footer_banner-badge.store.w-inline-block",".app-download_link-wrapper.appstore.w-inline-block"],countries:["ax","al","as","ad","aq","aw","au","at","bd","be","bv","io","bg","bi","ca","bq","cf","cx","cc","km","ck","hr","cu","cw","cy","cz","dk","dj","gq","er","ee","et","fk","fo","fi","fr","gf","pf","tf","de","gi","gr","gl","gp","gu","gg","gn","ht","hm","va","hk","hu","is","ir","iq","ie","im","il","it","je","ki","kp","lv","ls","ly","li","lt","lu","mt","mh","mq","yt","fm","me","nl","nc","nz","ng","nu","nf","mp","no","ps","pn","pl","pt","pr","re","ro","sh","pm","bl","mf","ws","sm","sg","sx","sk","si","so","gs","ss","es","sd","sj","se","ch","sy","tw","tl","tg","tk","tr","tv","gb","um","us","vu","vi","wf","eh"]},{id:"p2p",selectors:["#p2payment.accordion_toggle-block","#p2component.section_dp2p","#card_block_p2p.help_category"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"w-dyn-item-p2p",selectors:["div.w-dyn-item"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"hideRow",selectors:["#footer_social-icons_row","#footer_text_row",".footer_risk-warning.w-richtext"],countries:["br","uy","lk","ch","za","ec"]},{id:"hideDiel",selectors:["#footer_text_diel","#footer_social-icons_diel"],countries:["br","uy","lk","ch","za","ec"]}],Y=[{id:"showElems",selectors:[".banner_disclaimer"],countries:["br","uy","lk","ch","za","ec"]}],_=()=>{const e=window.getClientCountry();v.forEach((o=>{const n="hideDiel"===o.id?!o.countries.includes(e):o.countries.includes(e);if(e&&n)return o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((e=>{if(e)if("w-dyn-item-p2p"===o.id){e.querySelector("#card_block_p2p.help_category")&&(e.style.display="none")}else e.style.display="none"}))}));if(!n){const e=document.querySelector(".footer_social-icons.diel");e&&(e.style.display="flex")}})),Y.forEach((o=>{e&&o.countries.includes(e)?o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{if(o){const n=document.querySelector(".page-wrapper");".banner_disclaimer"===e?(n.classList.add("disclaimer-show"),o.classList.remove("hide-element")):o.style.display="block"}}))})):o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{o&&(".banner_disclaimer"===e?o.classList.add("hide-element"):o.style.display="none")}))}))}))},A=JSON.stringify({website_status:1});!async function(){try{const e=await fetch("https://www.cloudflare.com/cdn-cgi/trace"),o=await e.text(),n=Object.fromEntries(o.split("\n").map((e=>e.split("=",2)))).loc.toLowerCase();n!==m(document.cookie,"clients_country")&&(N("clients_country"),h("clients_country",n,30)),_()}catch(e){_()}}();m(document.cookie,"clients_country")||window.socketMessageSend(A,"website_status").then((e=>{m(document.cookie,"clients_country")!==e.website_status.clients_country&&(N("clients_country"),h("clients_country",e.website_status.clients_country,30)),_()})).catch((e=>{}));const b=["ar","bn","de","en","es","fr","it","ko","pl","pt","ru","si","sw","th","tr","vi","zh_cn","zh_tw","zh-cn","zh-tw"];(()=>{var e;const o=window.location.pathname,n=window.location.hash,i=window.location.search,t=o.split("/"),a=t[1],r=b.includes(a||""),d=t.includes("careers")||t.includes("locations")||t.includes("derivtech")||t.includes("derivlife")||t.includes("eu-careers")||t.includes("our-locations");r&&y(a);const c=(null==(e=m(document.cookie,"webflow-user-language"))?void 0:e.toLowerCase())||"en",s=r?a:c;if((r||"en"!==c)&&a!==c)if(r&&a!==c)y(s);else if(!d){const e=(r?t.map((e=>e===a?s:e)).join("/"):s+t.join("/"))+i+n;window.location.href="/"+e}})();const k=function(){let e,o=!1,n=!1;const i=()=>{n=!0,o=!!m(document.cookie,"client_information"),o&&clearInterval(e),document.dispatchEvent(new Event("authStatusChange"))};return i(),e=setInterval(i,800),{getLoggedInStatus:()=>o,getAuthCheckedStatus:()=>n,onAuthStatusChange:e=>document.addEventListener("authStatusChange",e)}}();k.onAuthStatusChange((()=>{if(k.getAuthCheckedStatus()&&k.getLoggedInStatus()){document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.add("hide-element")}))}else if(k.getAuthCheckedStatus()&&!k.getLoggedInStatus()){document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.add("hide-element")}))}}));const L=window.location.href;if(["help-centre"].some((e=>L.includes(e)))){const e=new URL(L).searchParams;e.has("platform")&&"derivgo"===e.get("platform")&&(S=".derivgo-query-element",document.querySelectorAll(S).forEach((e=>{e.style.display="none"})))}var S;const E=document.querySelector(".banner_disclaimer"),C=document.querySelector(".main-wrapper");if(E){new ResizeObserver((e=>{for(let o of e)if(o.target===E){let e=o.target.getBoundingClientRect();C&&(C.style.paddingTop=e.height+"px")}})).observe(E)}window.addEventListener("pageshow",(function(e){if(e.persisted){const e=document.querySelector(".w-nav-overlay");e&&(e.style.display="none",document.querySelector("body").click())}}));const q=u(l({databaseURL:window.location.hostname.includes("staging")?"https://app-config-staging.firebaseio.com":"https://app-config-prod.firebaseio.com"}));let I=!1,z=!1;!function(){var e;const o=document.getElementById("live_chat-wrapper");try{const e=p(q,"remote_config/deriv-com/chat");w(e,(e=>{const n=e.val();I=n.live_chat,z=n.whatsapp_chat;const i=document.querySelector(".whatsapp_chat"),t=document.querySelector(".livechatbtn");i&&(i.style.visibility=z?"visible":"hidden"),t&&(t.style.visibility=I?"visible":"hidden");if(window.location.pathname.includes("/help-centre")){const e=document.querySelectorAll(".livechatbtn");I?e.forEach((e=>{e.style.visibility="visible"})):e.forEach((e=>{e.style.visibility="hidden"}));const o=document.querySelectorAll(".whatsapp_chat");z?o.forEach((e=>{e.style.visibility="visible"})):o.forEach((e=>{e.style.visibility="hidden"}))}window.addEventListener("scroll",(function(){var e,n;(I||z)&&(null==(e=null==o?void 0:o.classList)||e.remove("hide-element")),I||z||null==(n=null==o?void 0:o.classList)||n.add("hide-element")}))}),(e=>{var n;null==(n=null==o?void 0:o.classList)||n.remove("hide-element")}))}catch(n){null==(e=null==o?void 0:o.classList)||e.remove("hide-element")}}();new MutationObserver((function(e){for(const o of e)if(o.addedNodes.length)for(const e of o.addedNodes)e.nodeType===Node.ELEMENT_NODE&&"chat-widget-minimized"===e.id&&(e.style.opacity="0")})).observe(document.body,{childList:!0,subtree:!0});const x=window.getClientCountry();const j=[{country:"af",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"ax",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"al",apple:"No",android:"Yes",huawei:"No"},{country:"dz",apple:"Yes",android:"Yes",huawei:"No"},{country:"as",apple:"N/A",android:"No",huawei:"N/A"},{country:"ad",apple:"N/A",android:"N/A",huawei:"No"},{country:"ao",apple:"Yes",android:"Yes",huawei:"No"},{country:"ai",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"aq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ag",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ar",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"am",apple:"Yes",android:"Yes",huawei:"No"},{country:"aw",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"au",apple:"No",android:"No",huawei:"No"},{country:"at",apple:"No",android:"Yes",huawei:"No"},{country:"az",apple:"Yes",android:"Yes",huawei:"No"},{country:"bs",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bh",apple:"Yes",android:"Yes",huawei:"No"},{country:"bd",apple:"N/A",android:"Yes",huawei:"No"},{country:"bb",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"by",apple:"Yes",android:"Yes",huawei:"No"},{country:"be",apple:"No",android:"Yes",huawei:"No"},{country:"bz",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bj",apple:"Yes",android:"Yes",huawei:"No"},{country:"bm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"bt",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"bo",apple:"Yes",android:"Yes",huawei:"No"},{country:"ba",apple:"Yes",android:"Yes",huawei:"No"},{country:"bw",apple:"Yes",android:"Yes",huawei:"No"},{country:"bv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"br",apple:"Yes",android:"Yes",huawei:"No"},{country:"io",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"bn",apple:"Yes",android:"N/A",huawei:"No"},{country:"bg",apple:"No",android:"Yes",huawei:"No"},{country:"bf",apple:"Yes",android:"Yes",huawei:"No"},{country:"bi",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kh",apple:"Yes",android:"Yes",huawei:"No"},{country:"cm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ca",apple:"No",android:"No",huawei:"No"},{country:"cv",apple:"Yes",android:"Yes",huawei:"No"},{country:"bq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ky",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cf",apple:"N/A",android:"N/A",huawei:"No"},{country:"td",apple:"Yes",android:"Yes",huawei:"No"},{country:"cl",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cn",apple:"Yes",android:"Yes",huawei:"No"},{country:"cx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"co",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"km",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cg",apple:"Yes",android:"N/A",huawei:"No"},{country:"cd",apple:"Yes",android:"N/A",huawei:"No"},{country:"ck",apple:"N/A",android:"N/A",huawei:"No"},{country:"cr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ci",apple:"Yes",android:"Yes",huawei:"No"},{country:"hr",apple:"No",android:"Yes",huawei:"No"},{country:"cu",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cw",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cy",apple:"No",android:"Yes",huawei:"No"},{country:"cz",apple:"No",android:"Yes",huawei:"No"},{country:"dk",apple:"No",android:"Yes",huawei:"No"},{country:"dj",apple:"N/A",android:"Yes",huawei:"No"},{country:"dm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"do",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ec",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"eg",apple:"Yes",android:"Yes",huawei:"No"},{country:"sv",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gq",apple:"N/A",android:"N/A",huawei:"No"},{country:"er",apple:"N/A",android:"Yes",huawei:"No"},{country:"ee",apple:"No",android:"Yes",huawei:"No"},{country:"et",apple:"N/A",android:"N/A",huawei:"No"},{country:"fk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"fo",apple:"N/A",android:"N/A",huawei:"No"},{country:"fj",apple:"Yes",android:"Yes",huawei:"No"},{country:"fi",apple:"No",android:"Yes",huawei:"No"},{country:"fr",apple:"No",android:"Yes",huawei:"No"},{country:"gf",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"pf",apple:"N/A",android:"N/A",huawei:"No"},{country:"tf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ga",apple:"Yes",android:"Yes",huawei:"No"},{country:"gm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ge",apple:"Yes",android:"Yes",huawei:"No"},{country:"de",apple:"No",android:"Yes",huawei:"No"},{country:"gh",apple:"Yes",android:"Yes",huawei:"No"},{country:"gi",apple:"N/A",android:"Yes",huawei:"No"},{country:"gr",apple:"No",android:"Yes",huawei:"No"},{country:"gl",apple:"N/A",android:"N/A",huawei:"No"},{country:"gd",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gp",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"gu",apple:"N/A",android:"No",huawei:"N/A"},{country:"gt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gg",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"gn",apple:"N/A",android:"Yes",huawei:"No"},{country:"gw",apple:"Yes",android:"Yes",huawei:"No"},{country:"gy",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ht",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"hm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"va",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"hn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"hk",apple:"No",android:"No",huawei:"Yes"},{country:"hu",apple:"No",android:"Yes",huawei:"No"},{country:"is",apple:"No",android:"Yes",huawei:"No"},{country:"in",apple:"Yes",android:"Yes",huawei:"No"},{country:"id",apple:"Yes",android:"Yes",huawei:"No"},{country:"ir",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"iq",apple:"No",android:"Yes",huawei:"N/A"},{country:"ie",apple:"No",android:"Yes",huawei:"No"},{country:"im",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"il",apple:"No",android:"Yes",huawei:"No"},{country:"it",apple:"No",android:"Yes",huawei:"No"},{country:"jm",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"jp",apple:"Yes",android:"No",huawei:"No"},{country:"je",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"jo",apple:"Yes",android:"Yes",huawei:"No"},{country:"kz",apple:"Yes",android:"Yes",huawei:"No"},{country:"ke",apple:"Yes",android:"Yes",huawei:"No"},{country:"ki",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kr",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"kp",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kw",apple:"Yes",android:"Yes",huawei:"No"},{country:"kg",apple:"Yes",android:"Yes",huawei:"No"},{country:"la",apple:"Yes",android:"Yes",huawei:"No"},{country:"lv",apple:"No",android:"Yes",huawei:"No"},{country:"lb",apple:"Yes",android:"Yes",huawei:"No"},{country:"ls",apple:"N/A",android:"N/A",huawei:"No"},{country:"lr",apple:"Yes",android:"Yes",huawei:"No"},{country:"ly",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"li",apple:"N/A",android:"Yes",huawei:"No"},{country:"lt",apple:"No",android:"Yes",huawei:"No"},{country:"lu",apple:"No",android:"Yes",huawei:"No"},{country:"mo",apple:"Yes",android:"Yes",huawei:"No"},{country:"mk",apple:"Yes",android:"Yes",huawei:"No"},{country:"mg",apple:"Yes",android:"N/A",huawei:"No"},{country:"mw",apple:"Yes",android:"N/A",huawei:"No"},{country:"my",apple:"Yes",android:"Yes",huawei:"No"},{country:"mv",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"ml",apple:"Yes",android:"Yes",huawei:"No"},{country:"mt",apple:"No",android:"Yes",huawei:"No"},{country:"mh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mq",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"mr",apple:"Yes",android:"N/A",huawei:"No"},{country:"mu",apple:"Yes",android:"Yes",huawei:"No"},{country:"yt",apple:"N/A",android:"N/A",huawei:"No"},{country:"mx",apple:"Yes",android:"Yes",huawei:"No"},{country:"fm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"md",apple:"Yes",android:"Yes",huawei:"No"},{country:"mc",apple:"Yes",android:"Yes",huawei:"No"},{country:"mn",apple:"Yes",android:"N/A",huawei:"No"},{country:"me",apple:"No",android:"N/A",huawei:"No"},{country:"ms",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ma",apple:"Yes",android:"Yes",huawei:"No"},{country:"mz",apple:"Yes",android:"Yes",huawei:"No"},{country:"mm",apple:"Yes",android:"Yes",huawei:"No"},{country:"na",apple:"Yes",android:"Yes",huawei:"No"},{country:"nr",apple:"Yes",android:"N/A",huawei:"No"},{country:"np",apple:"Yes",android:"Yes",huawei:"No"},{country:"nl",apple:"No",android:"Yes",huawei:"No"},{country:"nc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nz",apple:"No",android:"No",huawei:"No"},{country:"ni",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ne",apple:"Yes",android:"Yes",huawei:"No"},{country:"ng",apple:"No",android:"No",huawei:"No"},{country:"nu",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mp",apple:"N/A",android:"No",huawei:"N/A"},{country:"no",apple:"No",android:"Yes",huawei:"No"},{country:"om",apple:"Yes",android:"Yes",huawei:"No"},{country:"pk",apple:"Yes",android:"Yes",huawei:"No"},{country:"pw",apple:"Yes",android:"No",huawei:"N/A"},{country:"ps",apple:"N/A",android:"N/A",huawei:"No"},{country:"pa",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pg",apple:"Yes",android:"Yes",huawei:"No"},{country:"py",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pe",apple:"Yes",android:"Yes",huawei:"No"},{country:"ph",apple:"Yes",android:"Yes",huawei:"No"},{country:"pn",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"pl",apple:"No",android:"Yes",huawei:"No"},{country:"pt",apple:"No",android:"Yes",huawei:"No"},{country:"pr",apple:"N/A",android:"No",huawei:"Yes"},{country:"qa",apple:"Yes",android:"Yes",huawei:"No"},{country:"re",apple:"N/A",android:"N/A",huawei:"No"},{country:"ro",apple:"No",android:"Yes",huawei:"No"},{country:"ru",apple:"Yes",android:"Yes",huawei:"No"},{country:"rw",apple:"Yes",android:"Yes",huawei:"No"},{country:"sh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kn",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"lc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"pm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"vc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"bl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ws",apple:"N/A",android:"Yes",huawei:"No"},{country:"sm",apple:"N/A",android:"Yes",huawei:"No"},{country:"st",apple:"Yes",android:"N/A",huawei:"No"},{country:"sa",apple:"Yes",android:"Yes",huawei:"No"},{country:"sn",apple:"Yes",android:"Yes",huawei:"No"},{country:"rs",apple:"Yes",android:"Yes",huawei:"No"},{country:"sc",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"sl",apple:"Yes",android:"Yes",huawei:"No"},{country:"sg",apple:"No",android:"No",huawei:"No"},{country:"sx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sk",apple:"No",android:"Yes",huawei:"No"},{country:"si",apple:"No",android:"Yes",huawei:"No"},{country:"sb",apple:"Yes",android:"Yes",huawei:"No"},{country:"so",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"za",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gs",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ss",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"es",apple:"No",android:"Yes",huawei:"No"},{country:"lk",apple:"Yes",android:"Yes",huawei:"No"},{country:"sd",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"sr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"sj",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sz",apple:"Yes",android:"N/A",huawei:"No"},{country:"se",apple:"No",android:"Yes",huawei:"No"},{country:"ch",apple:"No",android:"Yes",huawei:"No"},{country:"sy",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tw",apple:"No",android:"Yes",huawei:"No"},{country:"tj",apple:"Yes",android:"Yes",huawei:"No"},{country:"tz",apple:"Yes",android:"Yes",huawei:"No"},{country:"th",apple:"Yes",android:"Yes",huawei:"No"},{country:"tl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tg",apple:"N/A",android:"Yes",huawei:"No"},{country:"tk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"to",apple:"Yes",android:"Yes",huawei:"No"},{country:"tt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"tn",apple:"Yes",android:"Yes",huawei:"No"},{country:"tr",apple:"No",android:"Yes",huawei:"No"},{country:"tm",apple:"Yes",android:"Yes",huawei:"No"},{country:"tc",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"tv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ug",apple:"Yes",android:"Yes",huawei:"No"},{country:"ua",apple:"Yes",android:"Yes",huawei:"No"},{country:"ae",apple:"Yes",android:"Yes",huawei:"No"},{country:"gb",apple:"No",android:"Yes",huawei:"No"},{country:"um",apple:"N/A",android:"No",huawei:"N/A"},{country:"us",apple:"No",android:"No",huawei:"N/A"},{country:"uy",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"uz",apple:"Yes",android:"Yes",huawei:"No"},{country:"vu",apple:"No",android:"Yes",huawei:"N/A"},{country:"ve",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vg",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"vi",apple:"N/A",android:"No",huawei:"N/A"},{country:"wf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"eh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ye",apple:"Yes",android:"Yes",huawei:"No"},{country:"zm",apple:"Yes",android:"Yes",huawei:"No"},{country:"zw",apple:"Yes",android:"Yes",huawei:"No"}].find((e=>e.country===x)),O=j?function(e){const{apple:o,android:n,huawei:i}=e;return"Yes"===o&&"Yes"===n&&"Yes"===i?"Android, iOS & Huawei":"Yes"===o&&"Yes"===n&&"Yes"!==i?"Android, and iOS":"Yes"===o&&"Yes"===i&&"Yes"!==n?"iOS, and Huawei":"Yes"===n&&"Yes"!==o&&"Yes"!==i?"Android":"Yes"===o&&"Yes"===i&&"Yes"!==n?"iOS, and Huawei":"Yes"===o&&"Yes"!==n&&"Yes"!==i?"iOS":"Yes"!==o&&"Yes"!==n&&"Yes"===i?"Huawei":""}(j):"",$=document.getElementById("app-download-heading");$&&($.innerText=O);const B=document.querySelector(".redirection_background-wrapper"),D=document.getElementById("cancel-redirect"),P=document.getElementById("proceed-redirect");if(window.isEuRegion(window.location.pathname)&&B&&D&&P){const e=["deriv.me","deriv.be","deriv.com","app.deriv.me","app.deriv.be","app.deriv.com","docs.deriv.com","community.deriv.com","deriv.statuspage.io","signup.deriv.com","login.deriv.com","api.deriv.com"];let o="",n="_self";document.querySelectorAll("a").forEach((function(i){const t=new URL(i.href,window.location.href),a=new URL(window.location.href);e.includes(t.host)||t.host===a.host||i.addEventListener("click",(function(e){e.preventDefault(),o=t.href,n=i.target||"_self",B.classList.remove("hide-element"),document.body.style.overflow="hidden"}))})),D.addEventListener("click",(function(){B.classList.add("hide-element"),document.body.style.overflow="auto",o=""})),P.addEventListener("click",(function(){o&&(window.open(o,n),o="",B.classList.add("hide-element"),document.body.style.overflow="auto")}))}document.querySelector(".banner_disclaimer")?document.body.classList.add("disclaimer-visible"):document.body.classList.remove("disclaimer-visible");const W=document.querySelectorAll(".navbar_accordion-item");function R(){const e=document.querySelector(".navbar_accordion-trigger.open");e&&e.scrollIntoView({behavior:"smooth",block:"start"})}W.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.overflow="hidden",o.style.transition="max-height 0.3s ease-in, opacity 0.3s ease-in",o.style.opacity="0"})),W.forEach((e=>{const o=e.querySelector(".navbar_accordion-trigger");o.addEventListener("click",(function(){const e=o.classList.contains("open");if(W.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.opacity="0"})),!e){o.classList.add("open");const e=o.nextElementSibling;e.classList.add("open"),e.style.maxHeight=e.scrollHeight+"px",e.style.opacity="1"}}))}));document.querySelectorAll(".navbar_accordion-trigger").forEach((e=>{e.addEventListener("click",(function(){setTimeout(R,300)}))}));const U=new MutationObserver((e=>{e.forEach((e=>{if("class"===e.attributeName){const o=e.target;o.classList.contains("open")&&o.scrollIntoView({behavior:"smooth",block:"start"})}}))}));document.querySelectorAll(".navbar_accordion-item").forEach((e=>{U.observe(e,{attributes:!0})}));const J=new URL(window.location.href),T=new URLSearchParams(J.search),F=T.get("t");if(T.has("referrer")&&null!=F){m(document.cookie,"referrer_token")!==F&&(N("referrer_token"),h("referrer_token",F,365,".deriv.com"))}const H=document.getElementById("navbar-home_login");H&&H.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const M=document.getElementById("res-navbar-home_login");M&&M.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const V=document.getElementById("white-navbar_login");V&&V.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const G=document.getElementById("res-white-navbar_login");function K(e,o,n){let i="";{let e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),i="; expires="+e.toUTCString()}document.cookie=e+"="+(o||"")+i+"; path=/"}G&&G.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()})),window.customLoader="static version all",(de=de||[]).push((function(){let e=document.querySelectorAll(".navbar_accordion-trigger");e.forEach((o=>{o.addEventListener("click",(function(){e.forEach((e=>e.classList.remove("current"))),this.classList.add("current")}))}));let o=document.querySelector(".navbar_accordion-link.w--current");if(o){let e=o.closest(".navbar_accordion-item");if(e){let o=e.querySelector(".navbar_accordion-trigger");o&&o.classList.add("current")}}})),(de=de||[]).push((function(){let e=document.querySelector(".locale > .new-navbar_dropdown-link.w--current");if(e){let o=e.getAttribute("hreflang"),n=document.querySelectorAll(".current-locale-iso-code");if(o&&n.length)for(let e of n)e.innerText=o}}));let Z=document.querySelectorAll(".w-locales-items");if(Z.length>0){let e=function(e){let o=document.querySelector('a[hreflang="'+e+'"]');o&&window.location.pathname!==o.getAttribute("href")&&o.click()};Z.forEach((function(e){e.querySelectorAll("a").forEach((function(e){e.addEventListener("click",(function(o){o.preventDefault(),K("webflow-user-language",e.getAttribute("hreflang"),30),window.location.href=e.href}))}))})),window.setLanguageCookie=e=>{K("webflow-user-language",e,30)};let o=function(e){let o=document.cookie.split(";");for(let n=0;ni.includes(e))),o&&t&&e(o)}(de=de||[]).push((function(){if(document.querySelector(".new-navbar_component")){let e=function(){document.body.classList.add("disable-scroll")},o=function(){document.body.classList.remove("disable-scroll")};const n=document.querySelector(".new-navbar_component");n.addEventListener("mouseenter",(()=>{window.innerWidth>991&&e()})),n.addEventListener("mouseleave",(()=>{window.innerWidth>991&&o()}))}})),window.getClientCountry();const Q=window.parseCookies(document.cookie,"webflow-user-language"),X=["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"];if(window.location.pathname.endsWith("p2p")&&!window.location.pathname.startsWith("/blog")){const e=window.getClientCountry();e&&X.includes(e)&&("en"===Q?window.location.replace("/404"):window.location.replace(`/${Q}/404`))}if(void 0!==window.parseCookies(document.cookie,"client_information")){let e=function(e){e.forEach((e=>{e.href="https://app.deriv.com/appstore/traders-hub"}))},o=document.querySelectorAll("a.live-markets_button.is-secondary.is-small.is-purchase.w-button"),n=document.querySelectorAll("a.live-markets_button.is-secondary.is-small.is-sell.w-button");e(o),e(n)}document.getElementById("mobile-menu"),document.getElementById("live_chat-wrapper");const ee=()=>{window.LC_API&&window.LC_API.open_chat_window&&window.LC_API.open_chat_window()},oe=()=>{"true"===new URLSearchParams(window.location.search).get("is_livechat_open")&&ee()},ne=e=>{var o;null==(o=null==window?void 0:window.LiveChatWidget)||o.on("ready",(()=>{window.LC_API.open_chat_window(),window.LC_API.hide_chat_window(),oe();const o=window.parseCookies(document.cookie,"utm_data"),n=o?JSON.parse(o):{},{utm_source:i,utm_medium:t,utm_campaign:a}=n,r=window.parseCookies(document.cookie,"client_information"),d=new URLSearchParams(window.location.search),{loginid:c,email:s,landing_company_shortcode:l,currency:u,residence:p,first_name:w,last_name:h}=r?JSON.parse(r):{},m={is_logged_in:e,loginid:c??"",landing_company_shortcode:l??"",currency:u??"",residence:p??"",email:s??"",platform:d.get("platform")??"",utm_source:i??"",utm_medium:t??"",utm_campaign:a??""};window.LiveChatWidget.call("set_session_variables",m),e?(s&&window.LiveChatWidget.call("set_customer_email",s),w&&h&&window.LiveChatWidget.call("set_customer_name",`${w} ${h}`)):window.LC_API.on_chat_ended=()=>{window.LiveChatWidget.call("set_customer_email"," "),window.LiveChatWidget.call("set_customer_name"," ")},oe(),window.LiveChatWidget.on("new_event",(e=>{e.greeting&&window.LC_API.open_chat_window()}))}))};let ie=!1;const te=()=>{const e=!!window.parseCookies(document.cookie,"client_information");e!==ie&&(ne(e),ie=e)};te(),setInterval(te,2e3),(()=>{if(window.__lc=window.__lc||{},window.__lc.license="12049137",window.LC_API=window.LC_API||{loaded:!1},window.LC_API.loaded)oe();else{const e=document.createElement("script");e.async=!0,e.src="https://cdn.livechatinc.com/tracking.js",e.onload=()=>{window.LC_API.loaded=!0,window.LC_API.on_after_load=function(){ne(!!window.parseCookies(document.cookie,"client_information")),oe()},"undefined"!=typeof LiveChatWidget&&LiveChatWidget.init&&LiveChatWidget.init()},document.body.appendChild(e)}})();const ae=document.querySelectorAll(".livechatbtn");ae.length>0&&ae.forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault(),ee()}))}));const re=document.getElementById("liveChatBtn");re&&re.addEventListener("click",(e=>{e.preventDefault(),ee()}));var de;document.querySelectorAll('a[rel="liveChatBtn"]').forEach((e=>{null==e||e.addEventListener("click",(e=>{e.preventDefault(),ee()}))})),(de=de||[]).push((function(){let e=document.querySelector(".navbar_menu-button");e&&e.addEventListener("click",(function(){let e=window.innerHeight,o=document.querySelector(".new-navbar_main-wrapper");if(o){let n=e-o.offsetHeight,i=document.querySelector(".new-navbar_menu");i&&(i.style.height=`${n}px`)}}))})),(de=de||[]).push((function(){let e=document.querySelector(".lang-mob");e&&e.addEventListener("click",(function(){let e=document.querySelector(".new-navbar_menu-wrapper");e&&e.scrollBy({top:-3e3})}))}));class ce{constructor(e){this.cookieName=e}setItem(e){const o=new Date;o.setDate(o.getDate()+30);const n="expires="+o.toUTCString(),i=encodeURIComponent(JSON.stringify(e));document.cookie=`${this.cookieName}=${i};${n};path=/`}getItem(){const e=document.cookie.split(";");for(let o=0;oye.includes(e)))&&document.head.querySelectorAll("link").forEach((function(e){e.hasAttribute("hreflang")&&"x-default"!==e.getAttribute("hreflang")&&e.remove()}));const Ne=e=>{window.rudderanalytics?window.rudderanalytics.track(e.name,e.properties):(e=>{let o=[],n=parseCookies(document.cookie,"cached_analytics_events");n&&(o=JSON.parse(n)),o.push(e),document.cookie=`cached_analytics_events=${JSON.stringify(o)}; path=/; Domain=.deriv.com`})(e)};window.addClickListener=function(e,o,n){e&&e.addEventListener("click",(function(){Ne({name:o,properties:n})}))};var ge=null==document?void 0:document.getElementsByClassName("livechatbtn"),fe=null==document?void 0:document.getElementsByClassName("whatsapp_chat"),ve=null==document?void 0:document.getElementsByClassName("tradershub-btn"),Ye=document.querySelectorAll(".btn-free-demo .w-button"),_e=document.querySelectorAll('.btn-free-demo [data-class="w-button"]');const Ae=document.querySelectorAll('[data-attributes="btn-primary-nav"]'),be=document.querySelectorAll('[data-attributes="btn-secondary-nav"]');ge&&Array.from(ge).forEach((e=>{window.addClickListener(e,"ce_widget_usage_form",{action:"click",widget_name:"livechat"})})),fe&&Array.from(fe).forEach((e=>{window.addClickListener(e,"ce_widget_usage_form",{action:"click",widget_name:"whatsapp"})})),ve&&Array.from(ve).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Traders Hub"})})),Ye&&Array.from(Ye).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),_e&&Array.from(_e).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),Ae&&Array.from(Ae).forEach((e=>{e.classList.contains("tradershub-btn")||window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),be&&Array.from(be).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Login"})}));var ke,Le,Se;"deriv.com"===window.location.hostname||"deriv.be"===window.location.hostname||"deriv.me"===window.location.hostname?(ke="sdk-UhZV3cNEg5nLNLNS",Se="nre64BV0dNIa44zW4tz5ow==",Le="1oV5agvlcnCZ6IH94wCKM1oR8Pd"):(ke="sdk-9wuqJ1mlcQsSyZQ",Se="",Le="1lN3tsFD2nruGFgM5F074DC2hMB");const Ee=(we=window.parseCookies(document.cookie,"client_information"))?JSON.parse(we):null,Ce=window.parseCookies(document.cookie,"utm_data"),qe=Ce?JSON.parse(Ce):{},Ie=window.parseCookies(document.cookie,"signup_device");let ze=null;Ie&&(ze=(null==(e=JSON.parse(Ie))?void 0:e.signup_device)||null);const xe={growthbookKey:ke,growthbookDecryptionKey:Se,rudderstackKey:Le,growthbookOptions:{navigate:e=>window.location.replace(e),antiFlicker:!1,navigateDelay:0,attributes:{country:window.parseCookies(document.cookie,"clients_country")||window.parseCookies(document.cookie,"website_status"),user_language:window.parseCookies(document.cookie,"user_language")||("undefined"!=typeof window?localStorage.getItem("i18n")||navigator.language:null),device_language:window.parseCookies(document.cookie,"language")||" ",device_type:ze,utm_source:null==qe?void 0:qe.utm_source,utm_medium:null==qe?void 0:qe.utm_medium,utm_campaign:null==qe?void 0:qe.utm_campaign,is_authorised:!!window.parseCookies(document.cookie,"client_information"),loggedIn:!!window.parseCookies(document.cookie,"client_information"),url:window.location.href}}};try{null==Analytics||Analytics.Analytics.initialise(xe);const e=(null==Ee?void 0:Ee.user_id)?null==Ee?void 0:Ee.user_id:null==(i=null==(n=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getInstances)?void 0:n.call(o).tracking)?void 0:i.getAnonymousId();null==(t=null==Analytics?void 0:Analytics.Analytics)||t.identifyEvent(e)}catch(Oe){}null==(a=null==Analytics?void 0:Analytics.Analytics)||a.pageView(location.pathname,"Deriv.com"),window.useGrowthbookFeatureFlag=function({featureFlag:e}){var o,n,i,t,a;let r=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getFeatureValue(e);return null==(a=null==(t=null==(i=null==(n=null==Analytics?void 0:Analytics.Analytics)?void 0:n.getInstances())?void 0:i.ab)?void 0:t.GrowthBook)||a.setRenderer((function(){var o;const n=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getFeatureValue(e);r=n})),r};const je=window.parseCookies(document.cookie,"client_information")?JSON.parse(window.parseCookies(document.cookie,"client_information")):null;(null==je?void 0:je.loginid)&&(null==window||window.hj("identify",je.loginid,{is_logged_in:!!window.parseCookies(document.cookie,"client_information"),landing_company_shortcode:je.landing_company_shortcode||"null"}));null==(s=null==(c=null==(d=null==(r=null==Analytics?void 0:Analytics.Analytics)?void 0:r.getInstances())?void 0:d.ab)?void 0:c.GrowthBook)||s.loadFeatures().then((()=>{window.location.href.indexOf("/partners")>-1==!1&&(()=>{var e;const o=(null==(e=null==Analytics?void 0:Analytics.Analytics)?void 0:e.getFeatureValue("trigger_os_signup_wf"))?function(){const e=navigator.userAgent.toLowerCase();return/ipad|iphone|ipod/.test(e)}()||function(){const e=navigator.userAgent.toLowerCase();return/safari/.test(e)&&!/chrome/.test(e)&&!/crios/.test(e)}()?`https://${window.location.host}/signup`:(()=>{const e=window.location.hostname;let o;switch(o="deriv.com"===e||"deriv.be"===e||"deriv.me"===e?"production":"staging.deriv.com"===e?"staging":"development",o){case"production":return"https://hub.deriv.com/tradershub/signup";case"staging":return"https://staging-hub.deriv.com/tradershub/signup";default:return"https://dev-hub.deriv.com/tradershub/signup"}})():`https://${window.location.host}/signup`,n=document.getElementById("cta-home-btn-navbar");n&&(n.href=o);const i=document.querySelectorAll(".logged-out-btn");null==i||i.forEach((e=>{var n;(null==(n=null==e?void 0:e.href)?void 0:n.indexOf("/signup"))>0&&(e.href=o)}));const t=document.querySelectorAll(".logged-out-btn a");null==t||t.forEach((e=>{var n;(null==(n=null==e?void 0:e.href)?void 0:n.indexOf("/signup"))>0&&(e.href=o)}))})()})); From ce12055f5bd66b535b3b80463de51f2508f9f9b4 Mon Sep 17 00:00:00 2001 From: Prince Date: Tue, 17 Sep 2024 11:13:40 +0400 Subject: [PATCH 29/57] chore: minify temp static --- src/{temp-static.js => temp-static.min.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/{temp-static.js => temp-static.min.js} (100%) diff --git a/src/temp-static.js b/src/temp-static.min.js similarity index 100% rename from src/temp-static.js rename to src/temp-static.min.js From 1ee72ca6ad4812f4ba66d5ccb67a967fa9723516 Mon Sep 17 00:00:00 2001 From: Prince Date: Tue, 17 Sep 2024 15:40:43 +0400 Subject: [PATCH 30/57] chore: revert and migrate minimum --- src/js/footer/migration.js | 954 +------------------------------------ src/temp-static.min.js | 2 +- 2 files changed, 3 insertions(+), 953 deletions(-) diff --git a/src/js/footer/migration.js b/src/js/footer/migration.js index 12afd66..daa72b5 100644 --- a/src/js/footer/migration.js +++ b/src/js/footer/migration.js @@ -1,955 +1,5 @@ -// alert('migrated scripts: everything') - -window.customLoader = "static version all" - -// -// This function adds a red line to the current accordion trigger -var Webflow = Webflow || []; -Webflow.push(function () { - // Find all accordion triggers - let triggers = document.querySelectorAll(".navbar_accordion-trigger"); - - triggers.forEach((trigger) => { - trigger.addEventListener("click", function () { - // Remove the .current class from all triggers - triggers.forEach((t) => t.classList.remove("current")); - - // Add the .current class to the clicked trigger - this.classList.add("current"); - }); - }); - - // Find the current page link in Navbar - let currentLink = document.querySelector( - ".navbar_accordion-link.w--current" - ); - - if (currentLink) { - // Find the closest accordion item - let accordionItem = currentLink.closest(".navbar_accordion-item"); - - if (accordionItem) { - // Find the trigger element within the found parent - let trigger = accordionItem.querySelector(".navbar_accordion-trigger"); - - if (trigger) { - // Add the .current class to the trigger - trigger.classList.add("current"); - } - } - } -}); - -// - -// - -var Webflow = Webflow || []; -Webflow.push(function () { - let currentLocaleElement = document.querySelector( - ".locale > .new-navbar_dropdown-link.w--current" - ); - - if (currentLocaleElement) { - let currentLocaleIsoCode = currentLocaleElement.getAttribute("hreflang"); - - let currentLocaleIsoCodeTexts = document.querySelectorAll( - ".current-locale-iso-code" - ); - - if (currentLocaleIsoCode && currentLocaleIsoCodeTexts.length) { - for (let currentLocaleIsoCodeText of currentLocaleIsoCodeTexts) { - currentLocaleIsoCodeText.innerText = currentLocaleIsoCode; - } - } - } -}); - -// - - - -// Function for setting cookies when changing language and redirecting to the current language page - -function setCookie(name, value, days) { - let expires = ""; - if (days) { - let date = new Date(); - date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000); - expires = "; expires=" + date.toUTCString(); - } - document.cookie = name + "=" + (value || "") + expires + "; path=/"; -} - -function getCookie(name) { - let cookies = document.cookie.split(";"); - for (let i = 0; i < cookies.length; i++) { - let cookie = cookies[i].trim(); - if (cookie.startsWith(name + "=")) { - return cookie.substring(name.length + 1); - } - } - return null; -} - -let localeItems = document.querySelectorAll(".w-locales-items"); - -if (localeItems.length > 0) { - localeItems.forEach(function (item) { - let links = item.querySelectorAll("a"); - links.forEach(function (link) { - link.addEventListener("click", function (event) { - event.preventDefault(); - let language = link.getAttribute("hreflang"); - setCookie("webflow-user-language", language, 30); - window.location.href = link.href; - }); - }); - }); - - function clickLinkWithLanguage(language) { - let link = document.querySelector('a[hreflang="' + language + '"]'); - if (link && window.location.pathname !== link.getAttribute("href")) { - link.click(); - } - } - window.setLanguageCookie = (language) => { - setCookie("webflow-user-language", language, 30); - }; - - let languageCookie = getCookie("webflow-user-language"); - let targetPaths = [ - "/careers", - "/locations", - "/derivtech", - "/derivlife", - "/eu-careers", - "/our-locations", - ]; - let path = window.location.pathname; - let targetPathUrl = false; - - // Check if the current path matches any of the target paths - if (targetPaths.some((targetPath) => path.includes(targetPath))) { - targetPathUrl === true; - } - if (languageCookie && targetPathUrl) { - clickLinkWithLanguage(languageCookie); - } -} - - -var Webflow = Webflow || []; -Webflow.push(function () { - if (document.querySelector(".new-navbar_component")) { - // Find the .new-navbar_component element - const navbarComponent = document.querySelector(".new-navbar_component"); - - // Add event listeners for hover - navbarComponent.addEventListener("mouseenter", () => { - if (window.innerWidth > 991) { - disableScroll(); - } - }); - navbarComponent.addEventListener("mouseleave", () => { - if (window.innerWidth > 991) { - enableScroll(); - } - }); - - // Function to disable scroll - function disableScroll() { - document.body.classList.add("disable-scroll"); - } - - // Function to enable scroll - function enableScroll() { - document.body.classList.remove("disable-scroll"); - } - } -}); - - - -const clientsCountry = window.getClientCountry(); - -const getDateFirstContact = () => { - const dateFirstContactString = window.parseCookies( - document.cookie, - "date_first_contact" - ); - if (dateFirstContactString) { - const parsedData = JSON.parse(dateFirstContactString); - return parsedData.date_first_contact - ? { date_first_contact: parsedData.date_first_contact } - : null; - } - return null; -}; - -const getSignupDevice = () => { - const signupDeviceString = window.parseCookies( - document.cookie, - "signup_device" - ); - if (signupDeviceString) { - const parsedData = JSON.parse(signupDeviceString); - return parsedData.signup_device - ? { signup_device: parsedData.signup_device } - : null; - } - return null; -}; - -const lang = window.parseCookies(document.cookie, "webflow-user-language"); - -const countriesToRedirect = [ - "as", - "au", - "at", - "be", - "bg", - "ca", - "hr", - "cy", - "cz", - "dk", - "ee", - "fi", - "fr", - "gr", - "gu", - "gg", - "hk", - "hu", - "ir", - "ie", - "im", - "il", - "it", - "je", - "ng", - "mm", - "sy", - "kp", - "lv", - "lt", - "lu", - "my", - "mt", - "nl", - "nz", - "mp", - "py", - "pl", - "pt", - "pr", - "ro", - "rw", - "sk", - "si", - "es", - "se", - "ae", - "gb", - "us", - "um", - "vu", - "vi", - "ky", - "cu", - "de", -]; - -if ( - window.location.pathname.endsWith("p2p") && - !window.location.pathname.startsWith("/blog") -) { - const clientsCountry = window.getClientCountry(); - if (clientsCountry && countriesToRedirect.includes(clientsCountry)) { - if (lang === "en") { - window.location.replace("/404"); - } else { - window.location.replace(`/${lang}/404`); - } - } -} - -if ( - window.parseCookies(document.cookie, "client_information") !== undefined -) { - let purchaseButtons = document.querySelectorAll( - "a.live-markets_button.is-secondary.is-small.is-purchase.w-button" - ); - - let sellButtons = document.querySelectorAll( - "a.live-markets_button.is-secondary.is-small.is-sell.w-button" - ); - - function updateHref(buttons) { - buttons.forEach((button) => { - button.href = "https://app.deriv.com/appstore/traders-hub"; - }); - } - - updateHref(purchaseButtons); - updateHref(sellButtons); -} - -//live chat button hide on menu appear -const mobileMenu = document.getElementById("mobile-menu"); -const liveChatWrapper = document.getElementById("live_chat-wrapper"); - -let isLiveChatVisible = true; -let isLiveChatActivated = false; - -function fadeIn(element) { - var opacity = 0; - var timer = setInterval(function () { - if (opacity >= 1) { - clearInterval(timer); - } - element.style.opacity = opacity; - opacity += 0.1; - }, 30); -} - -function fadeOut(element) { - var opacity = 1; - var timer = setInterval(function () { - if (opacity <= 0) { - clearInterval(timer); - element.style.display = "none"; - } - element.style.opacity = opacity; - opacity -= 0.1; - }, 30); -} - - - -// - -const licenceKey = "12049137"; -const loadLiveChatScript = () => { - window.__lc = window.__lc || {}; - window.__lc.license = licenceKey; - window.LC_API = window.LC_API || { loaded: false }; - if (!window.LC_API.loaded) { - const lcScript = document.createElement("script"); - lcScript.async = true; - lcScript.src = "https://cdn.livechatinc.com/tracking.js"; - lcScript.onload = () => { - window.LC_API.loaded = true; // Mark as loaded - window.LC_API.on_after_load = function () { - performLiveChatAction( - !!window.parseCookies(document.cookie, "client_information") - ); - checkUrlForLiveChat(); - }; - if (typeof LiveChatWidget !== "undefined" && LiveChatWidget.init) { - LiveChatWidget.init(); - } - }; - document.body.appendChild(lcScript); - } else { - checkUrlForLiveChat(); - } -}; -const openLiveChat = () => { - if (window.LC_API && window.LC_API.open_chat_window) { - window.LC_API.open_chat_window(); - } -}; -const checkUrlForLiveChat = () => { - const urlParams = new URLSearchParams(window.location.search); - if (urlParams.get("is_livechat_open") === "true") { - openLiveChat(); - } -}; - -//dashboard send data -const performLiveChatAction = (is_logged_in) => { - window?.LiveChatWidget?.on("ready", () => { - // we open and close the window to trigger the widget to listen for new events - window.LC_API.open_chat_window(); - window.LC_API.hide_chat_window(); - checkUrlForLiveChat(); - - const utm_data_string = window.parseCookies(document.cookie, "utm_data"); - const utm_data = utm_data_string ? JSON.parse(utm_data_string) : {}; - const { utm_source, utm_medium, utm_campaign } = utm_data; - - const client_information = window.parseCookies( - document.cookie, - "client_information" - ); - const url_params = new URLSearchParams(window.location.search); - - const { - loginid, - email, - landing_company_shortcode, - currency, - residence, - first_name, - last_name, - } = client_information ? JSON.parse(client_information) : {}; - - /* the session variables are sent to CS team dashboard to notify user has logged in - and also acts as custom variables to trigger targeted engagement */ - const session_variables = { - is_logged_in: is_logged_in, - loginid: loginid ?? "", - landing_company_shortcode: landing_company_shortcode ?? "", - currency: currency ?? "", - residence: residence ?? "", - email: email ?? "", - platform: url_params.get("platform") ?? "", - utm_source: utm_source ?? "", - utm_medium: utm_medium ?? "", - utm_campaign: utm_campaign ?? "", - }; - - window.LiveChatWidget.call("set_session_variables", session_variables); - - if (is_logged_in) { - if (email) { - window.LiveChatWidget.call("set_customer_email", email); - } - if (first_name && last_name) { - window.LiveChatWidget.call( - "set_customer_name", - `${first_name} ${last_name}` - ); - } - } else { - // clear name and email fields after chat has ended - window.LC_API.on_chat_ended = () => { - window.LiveChatWidget.call("set_customer_email", " "); - window.LiveChatWidget.call("set_customer_name", " "); - }; - } - checkUrlForLiveChat(); - - // open chat widget when there is an incoming greeting/announcement - window.LiveChatWidget.on("new_event", (event) => { - if (event.greeting) { - window.LC_API.open_chat_window(); - } - }); - }); -}; -let is_logged_in = false; -let checkCookieInterval; - -const isLoggedIn = () => { - return !!window.parseCookies(document.cookie, "client_information"); -}; - -const checkLoggedIn = () => { - const new_login_status = isLoggedIn(); - if (new_login_status !== is_logged_in) { - performLiveChatAction(new_login_status); - is_logged_in = new_login_status; - } -}; - -// Perform initial authentication check -checkLoggedIn(); - -// Set interval to periodically check authentication status -checkCookieInterval = setInterval(checkLoggedIn, 2000); -//end of dashboard send data - - -loadLiveChatScript(); -const liveChatIcons = document.querySelectorAll(".livechatbtn"); -if (liveChatIcons.length > 0) { - liveChatIcons.forEach((liveChatIcon) => { - liveChatIcon.addEventListener("click", (event) => { - event.preventDefault(); - openLiveChat(); - }); - }); -} -const liveChatIconById = document.getElementById("liveChatBtn"); -if (liveChatIconById) { - liveChatIconById.addEventListener("click", (event) => { - event.preventDefault(); - openLiveChat(); - }); -} -const liveChatIconsByrel = document.querySelectorAll( - 'a[rel="liveChatBtn"]' -); -liveChatIconsByrel.forEach((liveChatIcon) => { - liveChatIcon?.addEventListener("click", (event) => { - event.preventDefault(); - openLiveChat(); - }); -}); - - -// - - -// -var Webflow = Webflow || []; -Webflow.push(function () { - let navbarMenuBtn = document.querySelector(".navbar_menu-button"); - - if (navbarMenuBtn) { - navbarMenuBtn.addEventListener("click", function () { - let windowHeight = window.innerHeight; - - let navbarWrapper = document.querySelector(".new-navbar_main-wrapper"); - - if (navbarWrapper) { - let navbarHeight = navbarWrapper.offsetHeight; - - let calculatedHeight = windowHeight - navbarHeight; - - let navbarMenu = document.querySelector(".new-navbar_menu"); - if (navbarMenu) { - navbarMenu.style.height = `${calculatedHeight}px`; - } - } - }); - } -}); -// - - -// -// this code ensures opening a list of languages on mobile starting from the top -var Webflow = Webflow || []; -Webflow.push(function () { - let langMobButton = document.querySelector(".lang-mob"); - - if (langMobButton) { - langMobButton.addEventListener("click", function () { - let mobileMenuWrapper = document.querySelector( - ".new-navbar_menu-wrapper" - ); - - if (mobileMenuWrapper) { - mobileMenuWrapper.scrollBy({ top: -3000 }); - } - }); - } -}); -// - - -// -class CookieStorage { - constructor(cookieName) { - this.cookieName = cookieName; - } - - setItem(value) { - const expiryDate = new Date(); - expiryDate.setDate(expiryDate.getDate() + 30); // 30 days from now - const expires = "expires=" + expiryDate.toUTCString(); - const cookieValue = encodeURIComponent(JSON.stringify(value)); - document.cookie = `${this.cookieName}=${cookieValue};${expires};path=/`; - } - getItem() { - const cookies = document.cookie.split(";"); - for (let i = 0; i < cookies.length; i++) { - let cookie = cookies[i].trim(); - if (cookie.startsWith(`${this.cookieName}=`)) { - let cookieValue = cookie.substring(`${this.cookieName}=`.length); - return JSON.parse(decodeURIComponent(cookieValue)); - } - } - return null; - } -} - -const tracking_status_cookie = new CookieStorage("tracking_status"); -const tracking_status_cookie_declined = new CookieStorage( - "tracking_status_decline" -); - -const popupElement = document.querySelector(".cookies_background-wrapper"); - -//set datalayer details -const has_dataLayer = window.dataLayer; -var client_information = window.parseCookies( - document.cookie, - "client_information" -); - -is_logged_in = !!client_information; -has_dataLayer && - window.dataLayer.push({ - loggedIn: is_logged_in, - language: - window.parseCookies(document.cookie, "webflow-user-language") || "en", - ...(is_logged_in && { - visitorId: client_information?.loginid, - currency: client_information?.currency, - email: client_information?.email, - }), - }); - -// Check if pathname contains "eu" and tracking_status_cookie is null - -if ( - window.location.pathname.includes("eu") && - !tracking_status_cookie.getItem() && - !tracking_status_cookie_declined.getItem() -) { - popupElement.classList.remove("hide-element"); - document.body.classList.add("show-cookie"); -} - -// Select the accept and decline buttons -const acceptButton = document.getElementById("accept-cookie"); -const declineButton = document.getElementById("dont-accept-cookie"); - -acceptButton?.addEventListener("click", function () { - tracking_status_cookie.setItem(true); - popupElement.classList.add("hide-element"); - document.body.classList.remove("show-cookie"); -}); - -declineButton?.addEventListener("click", function () { - tracking_status_cookie_declined.setItem(true); - tracking_status_cookie.setItem(false); - popupElement.classList.add("hide-element"); - document.body.classList.remove("show-cookie"); -}); - - - -// -var targetPaths = [ - "/careers", - "/locations", - "/derivtech", - "/derivlife", - "/eu-careers", - "/our-locations", -]; -var path = window.location.pathname; -if (targetPaths.some((targetPath) => path.includes(targetPath))) { - var headTag = document.head; - var linkElements = headTag.querySelectorAll("link"); - linkElements.forEach(function (linkElement) { - if (linkElement.hasAttribute("hreflang")) { - if (linkElement.getAttribute("hreflang") !== "x-default") { - linkElement.remove(); - } - } - }); -} -// - - - -// - -const setEvent = (event) => { - let storedEvents = []; - let cacheCookie = parseCookies(document.cookie, "cached_analytics_events"); - if (cacheCookie) storedEvents = JSON.parse(cacheCookie); - - storedEvents.push(event); - document.cookie = `cached_analytics_events=${JSON.stringify( - storedEvents - )}; path=/; Domain=.deriv.com`; -}; - -const trackEventWithCache = (event) => { - if (window.rudderanalytics) { - window.rudderanalytics.track(event.name, event.properties); - } else { - setEvent(event); - } -}; - -window.addClickListener = function (button, eventName, eventProperties) { - if (button) { - button.addEventListener("click", function () { - trackEventWithCache({ - name: eventName, - properties: eventProperties, - }); - }); - } -}; - -var btnLiveChat = document?.getElementsByClassName("livechatbtn"); -var btnWhatsapp = document?.getElementsByClassName("whatsapp_chat"); -var btnTradershub = document?.getElementsByClassName("tradershub-btn"); -var btnTryFreeDemo = document.querySelectorAll(".btn-free-demo .w-button"); -var btnTryFreeDemoFooter = document.querySelectorAll( - '.btn-free-demo [data-class="w-button"]' -); - -const btnNavbarPrimary = document.querySelectorAll( - '[data-attributes="btn-primary-nav"]' -); -const btnLoginNavbar = document.querySelectorAll( - '[data-attributes="btn-secondary-nav"]' -); - -if (btnLiveChat) { - Array.from(btnLiveChat).forEach((button) => { - window.addClickListener(button, "ce_widget_usage_form", { - action: "click", - widget_name: "livechat", - }); - }); -} -if (btnWhatsapp) { - Array.from(btnWhatsapp).forEach((button) => { - window.addClickListener(button, "ce_widget_usage_form", { - action: "click", - widget_name: "whatsapp", - }); - }); -} -if (btnTradershub) { - Array.from(btnTradershub).forEach((button) => { - window.addClickListener(button, "ce_cta_clicks", { - action: "click", - cta_name: "Traders Hub", - }); - }); -} -if (btnTryFreeDemo) { - Array.from(btnTryFreeDemo).forEach((button) => { - window.addClickListener(button, "ce_cta_clicks", { - action: "click", - cta_name: "Try free demo", - }); - }); -} -if (btnTryFreeDemoFooter) { - Array.from(btnTryFreeDemoFooter).forEach((button) => { - window.addClickListener(button, "ce_cta_clicks", { - action: "click", - cta_name: "Try free demo", - }); - }); -} - -if (btnNavbarPrimary) { - Array.from(btnNavbarPrimary).forEach((button) => { - if (!button.classList.contains("tradershub-btn")) { - window.addClickListener(button, "ce_cta_clicks", { - action: "click", - cta_name: "Try free demo", - }); - } - }); -} - -if (btnLoginNavbar) { - Array.from(btnLoginNavbar).forEach((button) => { - window.addClickListener(button, "ce_cta_clicks", { - action: "click", - cta_name: "Login", - }); - }); -} - -const RUDDERSTACK_STAGING_KEY = "1lN3tsFD2nruGFgM5F074DC2hMB"; -const RUDDERSTACK_PRODUCTION_KEY = "1oV5agvlcnCZ6IH94wCKM1oR8Pd"; -const GB_STAGING_CLIENT_KEY = "sdk-9wuqJ1mlcQsSyZQ"; -const GB_STAGING_DECRYPTION_KEY = ""; -const GB_PROD_CLIENT_KEY = "sdk-UhZV3cNEg5nLNLNS"; -const GB_PROD_DECRYPTION_KEY = "nre64BV0dNIa44zW4tz5ow=="; -var GB_CLIENT_KEY, RUDDERSTACK_KEY, GB_DECRYPTION_KEY; -if ( - window.location.hostname === "deriv.com" || - window.location.hostname === "deriv.be" || - window.location.hostname === "deriv.me" -) { - GB_CLIENT_KEY = GB_PROD_CLIENT_KEY; - GB_DECRYPTION_KEY = GB_PROD_DECRYPTION_KEY; - RUDDERSTACK_KEY = RUDDERSTACK_PRODUCTION_KEY; -} else { - GB_CLIENT_KEY = GB_STAGING_CLIENT_KEY; - GB_DECRYPTION_KEY = GB_STAGING_DECRYPTION_KEY; - RUDDERSTACK_KEY = RUDDERSTACK_STAGING_KEY; -} -client_information = window.parseCookies( - document.cookie, - "client_information" -); -const clientInfo = client_information - ? JSON.parse(client_information) - : null; -const utm_data_string = window.parseCookies(document.cookie, "utm_data"); -const utm_data = utm_data_string ? JSON.parse(utm_data_string) : {}; -const { utm_source, utm_medium, utm_campaign } = utm_data; -const cookies = window.parseCookies(document.cookie, "signup_device"); -let signupDevice = null; -const isBrowser = () => typeof window !== "undefined"; -const getLanguage = () => - isBrowser() ? localStorage.getItem("i18n") || navigator.language : null; -if (cookies) { - signupDevice = JSON.parse(cookies)?.signup_device || null; -} -const initialiseConfig = { - growthbookKey: GB_CLIENT_KEY, - growthbookDecryptionKey: GB_DECRYPTION_KEY, - rudderstackKey: RUDDERSTACK_KEY, - growthbookOptions: { - navigate: (url) => window.location.replace(url), - antiFlicker: false, - navigateDelay: 0, - attributes: { - country: - window.parseCookies(document.cookie, "clients_country") || - window.parseCookies(document.cookie, "website_status"), - user_language: - window.parseCookies(document.cookie, "user_language") || - getLanguage(), - device_language: - window.parseCookies(document.cookie, "language") || " ", - device_type: signupDevice, - utm_source: utm_data?.["utm_source"], - utm_medium: utm_data?.["utm_medium"], - utm_campaign: utm_data?.["utm_campaign"], - is_authorised: !!window.parseCookies( - document.cookie, - "client_information" - ), - loggedIn: !!window.parseCookies( - document.cookie, - "client_information" - ), - url: window.location.href, - }, - }, -}; -try { - Analytics?.Analytics.initialise(initialiseConfig); - // Analytics?.Analytics?.getInstances()?.ab?.GrowthBook?.loadFeatures(); - const userId = clientInfo?.user_id - ? clientInfo?.user_id - : Analytics?.Analytics?.getInstances?.().tracking?.getAnonymousId(); - Analytics?.Analytics?.identifyEvent(userId); -} catch (error) { - console.error("Error during initialisation:", error); -} -// Analytics?.Analytics?.getInstances()?.ab?.GrowthBook?.loadFeatures(); -Analytics?.Analytics?.pageView(location.pathname, "Deriv.com"); -// Analytics?.Analytics?.getInstances()?.ab?.GrowthBook?.setURL(window.location.href) -window.useGrowthbookFeatureFlag = function ({ featureFlag }) { - let featureFlagValue = Analytics?.Analytics?.getFeatureValue(featureFlag); - function updateFeatureFlagValue() { - const value = Analytics?.Analytics?.getFeatureValue(featureFlag); - featureFlagValue = value; - } - Analytics?.Analytics?.getInstances()?.ab?.GrowthBook?.setRenderer( - updateFeatureFlagValue - ); - return featureFlagValue; -}; - -// - - - -// Parse the cookies to get the 'client_information' cookie value -const cookieValue = window.parseCookies(document.cookie, "client_information") - ? JSON.parse(window.parseCookies(document.cookie, "client_information")) - : null; - -// Hotjar integration -if (cookieValue?.loginid) { - window?.hj("identify", cookieValue.loginid, { - is_logged_in: !!window.parseCookies( - document.cookie, - "client_information" - ), - landing_company_shortcode: - cookieValue.landing_company_shortcode || "null", - }); -} - - - -const updateLinkHrefs = () => { - const featureFlagValue = Analytics?.Analytics?.getFeatureValue( - "trigger_os_signup_wf" - ); - const handleOutSystemsRedirection = () => { - const currentDomain = window.location.hostname; - let env; - if ( - currentDomain === "deriv.com" || - currentDomain === "deriv.be" || - currentDomain === "deriv.me" - ) { - env = "production"; - } else if (currentDomain === "staging.deriv.com") { - env = "staging"; - } else { - env = "development"; - } - switch (env) { - case "production": - return "https://hub.deriv.com/tradershub/signup"; - case "staging": - return "https://staging-hub.deriv.com/tradershub/signup"; - default: - return "https://dev-hub.deriv.com/tradershub/signup"; - } - }; - - function isSafari() { - const ua = navigator.userAgent.toLowerCase(); - return /safari/.test(ua) && !/chrome/.test(ua) && !/crios/.test(ua); - } - - function isIOS() { - const ua = navigator.userAgent.toLowerCase(); - return /ipad|iphone|ipod/.test(ua); - } - - const newHref = featureFlagValue - ? isIOS() || isSafari() - ? `https://${window.location.host}/signup` - : handleOutSystemsRedirection() - : `https://${window.location.host}/signup`; - - // Update href attributes - const mainSignupButton = document.getElementById("cta-home-btn-navbar"); - if (mainSignupButton) { - mainSignupButton.href = newHref; - } - - const signupButtons = document.querySelectorAll(".logged-out-btn"); - signupButtons?.forEach((btn) => { - if (btn?.href?.indexOf("/signup") > 0) { - btn.href = newHref; - } - }); - - const signupButtonsPlatforms = - document.querySelectorAll(".logged-out-btn a"); - signupButtonsPlatforms?.forEach((btn) => { - if (btn?.href?.indexOf("/signup") > 0) { - btn.href = newHref; - } - }); -}; - -Analytics?.Analytics?.getInstances() - ?.ab?.GrowthBook?.loadFeatures() - .then(() => { - if (window.location.href.indexOf("/partners") > -1 === false) { - updateLinkHrefs(); - } - }); +// alert('minimal migration') +window.customLoader = "Minimal Migration" diff --git a/src/temp-static.min.js b/src/temp-static.min.js index e839c1e..46fc7c6 100644 --- a/src/temp-static.min.js +++ b/src/temp-static.min.js @@ -1 +1 @@ -var e,o,n,i,t,a,r,d,c,s;import{initializeApp as l}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-app.js";import{getDatabase as u,ref as p,onValue as w}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-database.js";function h(e,o,n,i){let t="";if(n){let e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),t="; expires="+e.toUTCString()}document.cookie=i?e+"="+(o||"")+t+`;domain=${i};path=/`:e+"="+(o||"")+t+";path=/"}function m(e,o){const n={};return e.split(";").forEach((e=>{const[o,i]=e.split("=").map((e=>e.trim()));n[o]=decodeURIComponent(i)})),n[o]}function y(e){h("webflow-user-language",e,30)}function N(e){document.cookie=e+"=; Max-Age=-99999999;"}window.emailRegex=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,window.toggleErrorField=(e,o)=>{o?e.classList.remove("error-field"):e.classList.add("error-field")},window.disableButton=function(e){e.disabled=!0,e.style.opacity="0.5"},window.isEuRegion=function(e){const o=e.replace(/\/$/,"");return/^\/(?:[^\/]+\/)?eu(?:\/|$)/.test(o)},window.enableButton=function(e){e.disabled=!1,e.style.opacity="1"},window.getOauthUrl=function(){var e=window.location.href,o=new URL(e).hostname,n=["deriv.com","deriv.be","deriv.me"].find((e=>o.endsWith(e)));return n?`https://oauth.${n}`:"https://oauth.deriv.com"},window.getClientCountry=function(){var e;const o=m(document.cookie,"clients_country"),n=m(document.cookie,"client_information");return n&&(null==(e=JSON.parse(n))?void 0:e.residence)||o},window.deriv_com_url="deriv.com",window.deriv_me_url="deriv.me",window.deriv_be_url="deriv.be",window.webflow_domain="webflow.deriv.com",window.staging_url="staging.deriv.com",window.staging_deriv_be_url="staging.deriv.be",window.domain_list_app_id={[window.deriv_com_url]:"16929",[window.deriv_me_url]:"1411",[window.deriv_be_url]:"30767",[window.webflow_domain]:"53503",[window.staging_url]:"16303"},window.getDomain=()=>{var e=window.location.href;return new URL(e).hostname},window.getAppId=()=>{const e=window.getDomain(),o=new URLSearchParams(window.location.search||"").get("app_id");if(o)return o;const n=localStorage.getItem("config.app_id");if(n)return n;const i={[window.webflow_domain]:window.domain_list_app_id[window.webflow_domain],[window.deriv_be_url]:window.domain_list_app_id[window.deriv_be_url],[window.deriv_me_url]:window.domain_list_app_id[window.deriv_me_url],[window.staging_url]:window.domain_list_app_id[window.staging_url]};return i[e]?i[e]:window.domain_list_app_id[window.deriv_com_url]};const g=()=>{const e=localStorage.getItem("config.server_url"),o=m(document.cookie,"webflow-user-language");let n=o?o.toLowerCase():"en";"zh-cn"!==n&&"zh-tw"!==n||(n=n.replace("-","_"));const i=(e=>{let o="";return e&&Object.keys(e).forEach((n=>{o+=`&${n}=${e[n]}`})),o})((()=>{const e=m(document.cookie,"utm_data");if(e){const o=JSON.parse(e),n={};return["utm_source","utm_ad_id","utm_adgroup_id","utm_adrollclk_id","utm_campaign","utm_campaign_id","utm_content","utm_fbcl_id","utm_gl_client_id","utm_medium","utm_msclk_id","utm_term"].forEach((e=>{o.hasOwnProperty(e)&&(n[e]=o[e])})),n}return null})()),t=m(document.cookie,"affiliate_tracking"),a=t?`&affiliate_token=${t}`:"",r=void["mt5","bot","derivx"].filter((e=>window.location.pathname.includes(e)&&e))||"";return e&&/qa/.test(e)?`https://${e}/oauth2/authorize?app_id=${window.getAppId()}&l=${n}&brand=deriv${a}${i}&platform=${r}`:`${window.getOauthUrl()}/oauth2/authorize?app_id=${(()=>{const e=window.getDomain();return e===window.deriv_me_url?window.domain_list_app_id[window.deriv_me_url]:e===window.deriv_be_url?window.domain_list_app_id[window.deriv_be_url]:e===window.webflow_domain?window.domain_list_app_id[window.webflow_domain]:window.domain_list_app_id[window.deriv_com_url]})()}&l=${n}&brand=deriv${a}${i}&platform=${r}`};if(!!!m(document.cookie,"client_information")){var f=document.createElement("iframe");f.src=(()=>{const e=window.location.hostname;let o;switch(o="deriv.com"===e||"deriv.be"===e||"deriv.me"===e?"production":"staging.deriv.com"===e?"staging":"development",o){case"production":return"https://hub.deriv.com/tradershub/signup";case"staging":return"https://staging-hub.deriv.com/tradershub/signup";default:return"https://dev-hub.deriv.com/tradershub/signup"}})(),f.style.width="0",f.style.height="0",f.style.border="none",f.style.visibility="hidden",f.setAttribute("sandbox","allow-same-origin allow-scripts"),document.body.appendChild(f)}window.establishWebSocketConnection=()=>new Promise(((e,o)=>{const n=m(document.cookie,"webflow-user-language"),i=n?n.toLowerCase():"en",t=localStorage.getItem("config.server_url")||"green.derivws.com";window.websocket=new WebSocket(`wss://${t}/websockets/v3?app_id=${window.getAppId()}&l=${i||"en"}&brand=deriv`),window.websocket.addEventListener("open",(o=>{window.websocket.addEventListener("close",(()=>{window.websocket.close()})),window.websocket.addEventListener("message",(e=>{JSON.parse(e.data)})),e(window.websocket)})),window.websocket.addEventListener("error",(e=>{var n;null==(n=null==window?void 0:window.websocket)||n.close(),o(e)}))})),window.socketMessageSend=async(e,o)=>{var n;try{return(null==window?void 0:window.websocket)&&(null==(n=null==window?void 0:window.websocket)?void 0:n.readyState)===(null==WebSocket?void 0:WebSocket.OPEN)?(window.websocket.send(e),new Promise(((e,n)=>{window.websocket.addEventListener("message",(i=>{const t=JSON.parse(i.data);o===t.msg_type&&(t.error?n(t.error):e(t))}))}))):establishWebSocketConnection().then((()=>(websocket.send(e),new Promise(((e,n)=>{websocket.addEventListener("message",(i=>{const t=JSON.parse(i.data);o===t.msg_type&&(t.error?n(t.error):e(t))}))}))))).catch((e=>Promise.reject(e)))}catch(i){return Promise.reject(i)}};const v=[{id:"appgallery",selectors:[".footer_banner-badge.gallery.w-inline-block",".app-download_link-wrapper.appgallery.w-inline-block"],countries:["af","ax","al","dz","as","ad","ao","aq","am","au","at","az","bh","bd","by","be","bj","bm","bt","bo","ba","bw","bv","br","io","bn","bg","bf","bi","kh","cm","ca","cv","bq","cf","td","cn","cx","cc","km","cg","cd","ck","ci","hr","cu","cw","cy","cz","dk","dj","dm","eg","gq","er","ee","et","fk","fo","fj","fi","fr","pf","tf","ga","gm","ge","de","gh","gi","gr","gl","gu","gg","gn","gw","hm","va","hu","is","in","id","ir","iq","ie","im","il","it","jp","je","jo","kz","ke","ki","kr","kp","kw","kg","la","lv","lb","ls","lr","ly","li","lt","lu","mo","mk","mg","mw","my","mv","ml","mt","mh","mr","mu","yt","mx","fm","md","mc","mn","me","ma","mz","mm","na","nr","np","nl","nc","nz","ne","ng","nu","nf","mp","no","om","pk","pw","ps","pg","pe","ph","pn","pl","pt","qa","re","ro","ru","rw","sh","kn","pm","bl","mf","ws","sm","st","sa","sn","rs","sc","sl","sg","sx","sk","si","sb","so","gs","ss","es","lk","sd","sj","sz","se","ch","sy","tw","tj","tz","th","tl","tg","tk","to","tn","tr","tm","tc","tv","ug","ua","ae","gb","um","us","uz","vu","vi","wf","eh","ye","zm","zw"]},{id:"googlePlay",selectors:[".footer_banner-badge.google.w-inline-block",".app-download_link-wrapper.google.w-inline-block"],countries:["af","ax","as","ad","ai","aq","au","bb","bt","bv","io","bn","bi","ca","bq","cf","cx","cc","cg","cd","ck","cw","gq","et","fk","fo","gf","pf","tf","gl","gp","gu","gg","gy","hm","va","hk","ir","im","jp","je","ki","kp","ls","ly","mg","mw","mh","mq","mr","yt","fm","mn","me","ms","nr","nc","nz","ng","nu","nf","mp","pw","ps","pn","pr","re","sh","kn","lc","pm","vc","bl","mf","st","sg","sx","gs","ss","sj","sz","sy","tl","tk","tc","tv","um","us","vg","vi","wf","eh"]},{id:"appstore",selectors:[".footer_banner-badge.store.w-inline-block",".app-download_link-wrapper.appstore.w-inline-block"],countries:["ax","al","as","ad","aq","aw","au","at","bd","be","bv","io","bg","bi","ca","bq","cf","cx","cc","km","ck","hr","cu","cw","cy","cz","dk","dj","gq","er","ee","et","fk","fo","fi","fr","gf","pf","tf","de","gi","gr","gl","gp","gu","gg","gn","ht","hm","va","hk","hu","is","ir","iq","ie","im","il","it","je","ki","kp","lv","ls","ly","li","lt","lu","mt","mh","mq","yt","fm","me","nl","nc","nz","ng","nu","nf","mp","no","ps","pn","pl","pt","pr","re","ro","sh","pm","bl","mf","ws","sm","sg","sx","sk","si","so","gs","ss","es","sd","sj","se","ch","sy","tw","tl","tg","tk","tr","tv","gb","um","us","vu","vi","wf","eh"]},{id:"p2p",selectors:["#p2payment.accordion_toggle-block","#p2component.section_dp2p","#card_block_p2p.help_category"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"w-dyn-item-p2p",selectors:["div.w-dyn-item"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"hideRow",selectors:["#footer_social-icons_row","#footer_text_row",".footer_risk-warning.w-richtext"],countries:["br","uy","lk","ch","za","ec"]},{id:"hideDiel",selectors:["#footer_text_diel","#footer_social-icons_diel"],countries:["br","uy","lk","ch","za","ec"]}],Y=[{id:"showElems",selectors:[".banner_disclaimer"],countries:["br","uy","lk","ch","za","ec"]}],_=()=>{const e=window.getClientCountry();v.forEach((o=>{const n="hideDiel"===o.id?!o.countries.includes(e):o.countries.includes(e);if(e&&n)return o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((e=>{if(e)if("w-dyn-item-p2p"===o.id){e.querySelector("#card_block_p2p.help_category")&&(e.style.display="none")}else e.style.display="none"}))}));if(!n){const e=document.querySelector(".footer_social-icons.diel");e&&(e.style.display="flex")}})),Y.forEach((o=>{e&&o.countries.includes(e)?o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{if(o){const n=document.querySelector(".page-wrapper");".banner_disclaimer"===e?(n.classList.add("disclaimer-show"),o.classList.remove("hide-element")):o.style.display="block"}}))})):o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{o&&(".banner_disclaimer"===e?o.classList.add("hide-element"):o.style.display="none")}))}))}))},A=JSON.stringify({website_status:1});!async function(){try{const e=await fetch("https://www.cloudflare.com/cdn-cgi/trace"),o=await e.text(),n=Object.fromEntries(o.split("\n").map((e=>e.split("=",2)))).loc.toLowerCase();n!==m(document.cookie,"clients_country")&&(N("clients_country"),h("clients_country",n,30)),_()}catch(e){_()}}();m(document.cookie,"clients_country")||window.socketMessageSend(A,"website_status").then((e=>{m(document.cookie,"clients_country")!==e.website_status.clients_country&&(N("clients_country"),h("clients_country",e.website_status.clients_country,30)),_()})).catch((e=>{}));const b=["ar","bn","de","en","es","fr","it","ko","pl","pt","ru","si","sw","th","tr","vi","zh_cn","zh_tw","zh-cn","zh-tw"];(()=>{var e;const o=window.location.pathname,n=window.location.hash,i=window.location.search,t=o.split("/"),a=t[1],r=b.includes(a||""),d=t.includes("careers")||t.includes("locations")||t.includes("derivtech")||t.includes("derivlife")||t.includes("eu-careers")||t.includes("our-locations");r&&y(a);const c=(null==(e=m(document.cookie,"webflow-user-language"))?void 0:e.toLowerCase())||"en",s=r?a:c;if((r||"en"!==c)&&a!==c)if(r&&a!==c)y(s);else if(!d){const e=(r?t.map((e=>e===a?s:e)).join("/"):s+t.join("/"))+i+n;window.location.href="/"+e}})();const k=function(){let e,o=!1,n=!1;const i=()=>{n=!0,o=!!m(document.cookie,"client_information"),o&&clearInterval(e),document.dispatchEvent(new Event("authStatusChange"))};return i(),e=setInterval(i,800),{getLoggedInStatus:()=>o,getAuthCheckedStatus:()=>n,onAuthStatusChange:e=>document.addEventListener("authStatusChange",e)}}();k.onAuthStatusChange((()=>{if(k.getAuthCheckedStatus()&&k.getLoggedInStatus()){document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.add("hide-element")}))}else if(k.getAuthCheckedStatus()&&!k.getLoggedInStatus()){document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.add("hide-element")}))}}));const L=window.location.href;if(["help-centre"].some((e=>L.includes(e)))){const e=new URL(L).searchParams;e.has("platform")&&"derivgo"===e.get("platform")&&(S=".derivgo-query-element",document.querySelectorAll(S).forEach((e=>{e.style.display="none"})))}var S;const E=document.querySelector(".banner_disclaimer"),C=document.querySelector(".main-wrapper");if(E){new ResizeObserver((e=>{for(let o of e)if(o.target===E){let e=o.target.getBoundingClientRect();C&&(C.style.paddingTop=e.height+"px")}})).observe(E)}window.addEventListener("pageshow",(function(e){if(e.persisted){const e=document.querySelector(".w-nav-overlay");e&&(e.style.display="none",document.querySelector("body").click())}}));const q=u(l({databaseURL:window.location.hostname.includes("staging")?"https://app-config-staging.firebaseio.com":"https://app-config-prod.firebaseio.com"}));let I=!1,z=!1;!function(){var e;const o=document.getElementById("live_chat-wrapper");try{const e=p(q,"remote_config/deriv-com/chat");w(e,(e=>{const n=e.val();I=n.live_chat,z=n.whatsapp_chat;const i=document.querySelector(".whatsapp_chat"),t=document.querySelector(".livechatbtn");i&&(i.style.visibility=z?"visible":"hidden"),t&&(t.style.visibility=I?"visible":"hidden");if(window.location.pathname.includes("/help-centre")){const e=document.querySelectorAll(".livechatbtn");I?e.forEach((e=>{e.style.visibility="visible"})):e.forEach((e=>{e.style.visibility="hidden"}));const o=document.querySelectorAll(".whatsapp_chat");z?o.forEach((e=>{e.style.visibility="visible"})):o.forEach((e=>{e.style.visibility="hidden"}))}window.addEventListener("scroll",(function(){var e,n;(I||z)&&(null==(e=null==o?void 0:o.classList)||e.remove("hide-element")),I||z||null==(n=null==o?void 0:o.classList)||n.add("hide-element")}))}),(e=>{var n;null==(n=null==o?void 0:o.classList)||n.remove("hide-element")}))}catch(n){null==(e=null==o?void 0:o.classList)||e.remove("hide-element")}}();new MutationObserver((function(e){for(const o of e)if(o.addedNodes.length)for(const e of o.addedNodes)e.nodeType===Node.ELEMENT_NODE&&"chat-widget-minimized"===e.id&&(e.style.opacity="0")})).observe(document.body,{childList:!0,subtree:!0});const x=window.getClientCountry();const j=[{country:"af",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"ax",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"al",apple:"No",android:"Yes",huawei:"No"},{country:"dz",apple:"Yes",android:"Yes",huawei:"No"},{country:"as",apple:"N/A",android:"No",huawei:"N/A"},{country:"ad",apple:"N/A",android:"N/A",huawei:"No"},{country:"ao",apple:"Yes",android:"Yes",huawei:"No"},{country:"ai",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"aq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ag",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ar",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"am",apple:"Yes",android:"Yes",huawei:"No"},{country:"aw",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"au",apple:"No",android:"No",huawei:"No"},{country:"at",apple:"No",android:"Yes",huawei:"No"},{country:"az",apple:"Yes",android:"Yes",huawei:"No"},{country:"bs",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bh",apple:"Yes",android:"Yes",huawei:"No"},{country:"bd",apple:"N/A",android:"Yes",huawei:"No"},{country:"bb",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"by",apple:"Yes",android:"Yes",huawei:"No"},{country:"be",apple:"No",android:"Yes",huawei:"No"},{country:"bz",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bj",apple:"Yes",android:"Yes",huawei:"No"},{country:"bm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"bt",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"bo",apple:"Yes",android:"Yes",huawei:"No"},{country:"ba",apple:"Yes",android:"Yes",huawei:"No"},{country:"bw",apple:"Yes",android:"Yes",huawei:"No"},{country:"bv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"br",apple:"Yes",android:"Yes",huawei:"No"},{country:"io",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"bn",apple:"Yes",android:"N/A",huawei:"No"},{country:"bg",apple:"No",android:"Yes",huawei:"No"},{country:"bf",apple:"Yes",android:"Yes",huawei:"No"},{country:"bi",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kh",apple:"Yes",android:"Yes",huawei:"No"},{country:"cm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ca",apple:"No",android:"No",huawei:"No"},{country:"cv",apple:"Yes",android:"Yes",huawei:"No"},{country:"bq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ky",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cf",apple:"N/A",android:"N/A",huawei:"No"},{country:"td",apple:"Yes",android:"Yes",huawei:"No"},{country:"cl",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cn",apple:"Yes",android:"Yes",huawei:"No"},{country:"cx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"co",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"km",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cg",apple:"Yes",android:"N/A",huawei:"No"},{country:"cd",apple:"Yes",android:"N/A",huawei:"No"},{country:"ck",apple:"N/A",android:"N/A",huawei:"No"},{country:"cr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ci",apple:"Yes",android:"Yes",huawei:"No"},{country:"hr",apple:"No",android:"Yes",huawei:"No"},{country:"cu",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cw",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cy",apple:"No",android:"Yes",huawei:"No"},{country:"cz",apple:"No",android:"Yes",huawei:"No"},{country:"dk",apple:"No",android:"Yes",huawei:"No"},{country:"dj",apple:"N/A",android:"Yes",huawei:"No"},{country:"dm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"do",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ec",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"eg",apple:"Yes",android:"Yes",huawei:"No"},{country:"sv",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gq",apple:"N/A",android:"N/A",huawei:"No"},{country:"er",apple:"N/A",android:"Yes",huawei:"No"},{country:"ee",apple:"No",android:"Yes",huawei:"No"},{country:"et",apple:"N/A",android:"N/A",huawei:"No"},{country:"fk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"fo",apple:"N/A",android:"N/A",huawei:"No"},{country:"fj",apple:"Yes",android:"Yes",huawei:"No"},{country:"fi",apple:"No",android:"Yes",huawei:"No"},{country:"fr",apple:"No",android:"Yes",huawei:"No"},{country:"gf",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"pf",apple:"N/A",android:"N/A",huawei:"No"},{country:"tf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ga",apple:"Yes",android:"Yes",huawei:"No"},{country:"gm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ge",apple:"Yes",android:"Yes",huawei:"No"},{country:"de",apple:"No",android:"Yes",huawei:"No"},{country:"gh",apple:"Yes",android:"Yes",huawei:"No"},{country:"gi",apple:"N/A",android:"Yes",huawei:"No"},{country:"gr",apple:"No",android:"Yes",huawei:"No"},{country:"gl",apple:"N/A",android:"N/A",huawei:"No"},{country:"gd",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gp",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"gu",apple:"N/A",android:"No",huawei:"N/A"},{country:"gt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gg",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"gn",apple:"N/A",android:"Yes",huawei:"No"},{country:"gw",apple:"Yes",android:"Yes",huawei:"No"},{country:"gy",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ht",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"hm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"va",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"hn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"hk",apple:"No",android:"No",huawei:"Yes"},{country:"hu",apple:"No",android:"Yes",huawei:"No"},{country:"is",apple:"No",android:"Yes",huawei:"No"},{country:"in",apple:"Yes",android:"Yes",huawei:"No"},{country:"id",apple:"Yes",android:"Yes",huawei:"No"},{country:"ir",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"iq",apple:"No",android:"Yes",huawei:"N/A"},{country:"ie",apple:"No",android:"Yes",huawei:"No"},{country:"im",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"il",apple:"No",android:"Yes",huawei:"No"},{country:"it",apple:"No",android:"Yes",huawei:"No"},{country:"jm",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"jp",apple:"Yes",android:"No",huawei:"No"},{country:"je",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"jo",apple:"Yes",android:"Yes",huawei:"No"},{country:"kz",apple:"Yes",android:"Yes",huawei:"No"},{country:"ke",apple:"Yes",android:"Yes",huawei:"No"},{country:"ki",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kr",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"kp",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kw",apple:"Yes",android:"Yes",huawei:"No"},{country:"kg",apple:"Yes",android:"Yes",huawei:"No"},{country:"la",apple:"Yes",android:"Yes",huawei:"No"},{country:"lv",apple:"No",android:"Yes",huawei:"No"},{country:"lb",apple:"Yes",android:"Yes",huawei:"No"},{country:"ls",apple:"N/A",android:"N/A",huawei:"No"},{country:"lr",apple:"Yes",android:"Yes",huawei:"No"},{country:"ly",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"li",apple:"N/A",android:"Yes",huawei:"No"},{country:"lt",apple:"No",android:"Yes",huawei:"No"},{country:"lu",apple:"No",android:"Yes",huawei:"No"},{country:"mo",apple:"Yes",android:"Yes",huawei:"No"},{country:"mk",apple:"Yes",android:"Yes",huawei:"No"},{country:"mg",apple:"Yes",android:"N/A",huawei:"No"},{country:"mw",apple:"Yes",android:"N/A",huawei:"No"},{country:"my",apple:"Yes",android:"Yes",huawei:"No"},{country:"mv",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"ml",apple:"Yes",android:"Yes",huawei:"No"},{country:"mt",apple:"No",android:"Yes",huawei:"No"},{country:"mh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mq",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"mr",apple:"Yes",android:"N/A",huawei:"No"},{country:"mu",apple:"Yes",android:"Yes",huawei:"No"},{country:"yt",apple:"N/A",android:"N/A",huawei:"No"},{country:"mx",apple:"Yes",android:"Yes",huawei:"No"},{country:"fm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"md",apple:"Yes",android:"Yes",huawei:"No"},{country:"mc",apple:"Yes",android:"Yes",huawei:"No"},{country:"mn",apple:"Yes",android:"N/A",huawei:"No"},{country:"me",apple:"No",android:"N/A",huawei:"No"},{country:"ms",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ma",apple:"Yes",android:"Yes",huawei:"No"},{country:"mz",apple:"Yes",android:"Yes",huawei:"No"},{country:"mm",apple:"Yes",android:"Yes",huawei:"No"},{country:"na",apple:"Yes",android:"Yes",huawei:"No"},{country:"nr",apple:"Yes",android:"N/A",huawei:"No"},{country:"np",apple:"Yes",android:"Yes",huawei:"No"},{country:"nl",apple:"No",android:"Yes",huawei:"No"},{country:"nc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nz",apple:"No",android:"No",huawei:"No"},{country:"ni",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ne",apple:"Yes",android:"Yes",huawei:"No"},{country:"ng",apple:"No",android:"No",huawei:"No"},{country:"nu",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mp",apple:"N/A",android:"No",huawei:"N/A"},{country:"no",apple:"No",android:"Yes",huawei:"No"},{country:"om",apple:"Yes",android:"Yes",huawei:"No"},{country:"pk",apple:"Yes",android:"Yes",huawei:"No"},{country:"pw",apple:"Yes",android:"No",huawei:"N/A"},{country:"ps",apple:"N/A",android:"N/A",huawei:"No"},{country:"pa",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pg",apple:"Yes",android:"Yes",huawei:"No"},{country:"py",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pe",apple:"Yes",android:"Yes",huawei:"No"},{country:"ph",apple:"Yes",android:"Yes",huawei:"No"},{country:"pn",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"pl",apple:"No",android:"Yes",huawei:"No"},{country:"pt",apple:"No",android:"Yes",huawei:"No"},{country:"pr",apple:"N/A",android:"No",huawei:"Yes"},{country:"qa",apple:"Yes",android:"Yes",huawei:"No"},{country:"re",apple:"N/A",android:"N/A",huawei:"No"},{country:"ro",apple:"No",android:"Yes",huawei:"No"},{country:"ru",apple:"Yes",android:"Yes",huawei:"No"},{country:"rw",apple:"Yes",android:"Yes",huawei:"No"},{country:"sh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kn",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"lc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"pm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"vc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"bl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ws",apple:"N/A",android:"Yes",huawei:"No"},{country:"sm",apple:"N/A",android:"Yes",huawei:"No"},{country:"st",apple:"Yes",android:"N/A",huawei:"No"},{country:"sa",apple:"Yes",android:"Yes",huawei:"No"},{country:"sn",apple:"Yes",android:"Yes",huawei:"No"},{country:"rs",apple:"Yes",android:"Yes",huawei:"No"},{country:"sc",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"sl",apple:"Yes",android:"Yes",huawei:"No"},{country:"sg",apple:"No",android:"No",huawei:"No"},{country:"sx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sk",apple:"No",android:"Yes",huawei:"No"},{country:"si",apple:"No",android:"Yes",huawei:"No"},{country:"sb",apple:"Yes",android:"Yes",huawei:"No"},{country:"so",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"za",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gs",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ss",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"es",apple:"No",android:"Yes",huawei:"No"},{country:"lk",apple:"Yes",android:"Yes",huawei:"No"},{country:"sd",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"sr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"sj",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sz",apple:"Yes",android:"N/A",huawei:"No"},{country:"se",apple:"No",android:"Yes",huawei:"No"},{country:"ch",apple:"No",android:"Yes",huawei:"No"},{country:"sy",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tw",apple:"No",android:"Yes",huawei:"No"},{country:"tj",apple:"Yes",android:"Yes",huawei:"No"},{country:"tz",apple:"Yes",android:"Yes",huawei:"No"},{country:"th",apple:"Yes",android:"Yes",huawei:"No"},{country:"tl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tg",apple:"N/A",android:"Yes",huawei:"No"},{country:"tk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"to",apple:"Yes",android:"Yes",huawei:"No"},{country:"tt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"tn",apple:"Yes",android:"Yes",huawei:"No"},{country:"tr",apple:"No",android:"Yes",huawei:"No"},{country:"tm",apple:"Yes",android:"Yes",huawei:"No"},{country:"tc",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"tv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ug",apple:"Yes",android:"Yes",huawei:"No"},{country:"ua",apple:"Yes",android:"Yes",huawei:"No"},{country:"ae",apple:"Yes",android:"Yes",huawei:"No"},{country:"gb",apple:"No",android:"Yes",huawei:"No"},{country:"um",apple:"N/A",android:"No",huawei:"N/A"},{country:"us",apple:"No",android:"No",huawei:"N/A"},{country:"uy",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"uz",apple:"Yes",android:"Yes",huawei:"No"},{country:"vu",apple:"No",android:"Yes",huawei:"N/A"},{country:"ve",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vg",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"vi",apple:"N/A",android:"No",huawei:"N/A"},{country:"wf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"eh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ye",apple:"Yes",android:"Yes",huawei:"No"},{country:"zm",apple:"Yes",android:"Yes",huawei:"No"},{country:"zw",apple:"Yes",android:"Yes",huawei:"No"}].find((e=>e.country===x)),O=j?function(e){const{apple:o,android:n,huawei:i}=e;return"Yes"===o&&"Yes"===n&&"Yes"===i?"Android, iOS & Huawei":"Yes"===o&&"Yes"===n&&"Yes"!==i?"Android, and iOS":"Yes"===o&&"Yes"===i&&"Yes"!==n?"iOS, and Huawei":"Yes"===n&&"Yes"!==o&&"Yes"!==i?"Android":"Yes"===o&&"Yes"===i&&"Yes"!==n?"iOS, and Huawei":"Yes"===o&&"Yes"!==n&&"Yes"!==i?"iOS":"Yes"!==o&&"Yes"!==n&&"Yes"===i?"Huawei":""}(j):"",$=document.getElementById("app-download-heading");$&&($.innerText=O);const B=document.querySelector(".redirection_background-wrapper"),D=document.getElementById("cancel-redirect"),P=document.getElementById("proceed-redirect");if(window.isEuRegion(window.location.pathname)&&B&&D&&P){const e=["deriv.me","deriv.be","deriv.com","app.deriv.me","app.deriv.be","app.deriv.com","docs.deriv.com","community.deriv.com","deriv.statuspage.io","signup.deriv.com","login.deriv.com","api.deriv.com"];let o="",n="_self";document.querySelectorAll("a").forEach((function(i){const t=new URL(i.href,window.location.href),a=new URL(window.location.href);e.includes(t.host)||t.host===a.host||i.addEventListener("click",(function(e){e.preventDefault(),o=t.href,n=i.target||"_self",B.classList.remove("hide-element"),document.body.style.overflow="hidden"}))})),D.addEventListener("click",(function(){B.classList.add("hide-element"),document.body.style.overflow="auto",o=""})),P.addEventListener("click",(function(){o&&(window.open(o,n),o="",B.classList.add("hide-element"),document.body.style.overflow="auto")}))}document.querySelector(".banner_disclaimer")?document.body.classList.add("disclaimer-visible"):document.body.classList.remove("disclaimer-visible");const W=document.querySelectorAll(".navbar_accordion-item");function R(){const e=document.querySelector(".navbar_accordion-trigger.open");e&&e.scrollIntoView({behavior:"smooth",block:"start"})}W.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.overflow="hidden",o.style.transition="max-height 0.3s ease-in, opacity 0.3s ease-in",o.style.opacity="0"})),W.forEach((e=>{const o=e.querySelector(".navbar_accordion-trigger");o.addEventListener("click",(function(){const e=o.classList.contains("open");if(W.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.opacity="0"})),!e){o.classList.add("open");const e=o.nextElementSibling;e.classList.add("open"),e.style.maxHeight=e.scrollHeight+"px",e.style.opacity="1"}}))}));document.querySelectorAll(".navbar_accordion-trigger").forEach((e=>{e.addEventListener("click",(function(){setTimeout(R,300)}))}));const U=new MutationObserver((e=>{e.forEach((e=>{if("class"===e.attributeName){const o=e.target;o.classList.contains("open")&&o.scrollIntoView({behavior:"smooth",block:"start"})}}))}));document.querySelectorAll(".navbar_accordion-item").forEach((e=>{U.observe(e,{attributes:!0})}));const J=new URL(window.location.href),T=new URLSearchParams(J.search),F=T.get("t");if(T.has("referrer")&&null!=F){m(document.cookie,"referrer_token")!==F&&(N("referrer_token"),h("referrer_token",F,365,".deriv.com"))}const H=document.getElementById("navbar-home_login");H&&H.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const M=document.getElementById("res-navbar-home_login");M&&M.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const V=document.getElementById("white-navbar_login");V&&V.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const G=document.getElementById("res-white-navbar_login");function K(e,o,n){let i="";{let e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),i="; expires="+e.toUTCString()}document.cookie=e+"="+(o||"")+i+"; path=/"}G&&G.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()})),window.customLoader="static version all",(de=de||[]).push((function(){let e=document.querySelectorAll(".navbar_accordion-trigger");e.forEach((o=>{o.addEventListener("click",(function(){e.forEach((e=>e.classList.remove("current"))),this.classList.add("current")}))}));let o=document.querySelector(".navbar_accordion-link.w--current");if(o){let e=o.closest(".navbar_accordion-item");if(e){let o=e.querySelector(".navbar_accordion-trigger");o&&o.classList.add("current")}}})),(de=de||[]).push((function(){let e=document.querySelector(".locale > .new-navbar_dropdown-link.w--current");if(e){let o=e.getAttribute("hreflang"),n=document.querySelectorAll(".current-locale-iso-code");if(o&&n.length)for(let e of n)e.innerText=o}}));let Z=document.querySelectorAll(".w-locales-items");if(Z.length>0){let e=function(e){let o=document.querySelector('a[hreflang="'+e+'"]');o&&window.location.pathname!==o.getAttribute("href")&&o.click()};Z.forEach((function(e){e.querySelectorAll("a").forEach((function(e){e.addEventListener("click",(function(o){o.preventDefault(),K("webflow-user-language",e.getAttribute("hreflang"),30),window.location.href=e.href}))}))})),window.setLanguageCookie=e=>{K("webflow-user-language",e,30)};let o=function(e){let o=document.cookie.split(";");for(let n=0;ni.includes(e))),o&&t&&e(o)}(de=de||[]).push((function(){if(document.querySelector(".new-navbar_component")){let e=function(){document.body.classList.add("disable-scroll")},o=function(){document.body.classList.remove("disable-scroll")};const n=document.querySelector(".new-navbar_component");n.addEventListener("mouseenter",(()=>{window.innerWidth>991&&e()})),n.addEventListener("mouseleave",(()=>{window.innerWidth>991&&o()}))}})),window.getClientCountry();const Q=window.parseCookies(document.cookie,"webflow-user-language"),X=["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"];if(window.location.pathname.endsWith("p2p")&&!window.location.pathname.startsWith("/blog")){const e=window.getClientCountry();e&&X.includes(e)&&("en"===Q?window.location.replace("/404"):window.location.replace(`/${Q}/404`))}if(void 0!==window.parseCookies(document.cookie,"client_information")){let e=function(e){e.forEach((e=>{e.href="https://app.deriv.com/appstore/traders-hub"}))},o=document.querySelectorAll("a.live-markets_button.is-secondary.is-small.is-purchase.w-button"),n=document.querySelectorAll("a.live-markets_button.is-secondary.is-small.is-sell.w-button");e(o),e(n)}document.getElementById("mobile-menu"),document.getElementById("live_chat-wrapper");const ee=()=>{window.LC_API&&window.LC_API.open_chat_window&&window.LC_API.open_chat_window()},oe=()=>{"true"===new URLSearchParams(window.location.search).get("is_livechat_open")&&ee()},ne=e=>{var o;null==(o=null==window?void 0:window.LiveChatWidget)||o.on("ready",(()=>{window.LC_API.open_chat_window(),window.LC_API.hide_chat_window(),oe();const o=window.parseCookies(document.cookie,"utm_data"),n=o?JSON.parse(o):{},{utm_source:i,utm_medium:t,utm_campaign:a}=n,r=window.parseCookies(document.cookie,"client_information"),d=new URLSearchParams(window.location.search),{loginid:c,email:s,landing_company_shortcode:l,currency:u,residence:p,first_name:w,last_name:h}=r?JSON.parse(r):{},m={is_logged_in:e,loginid:c??"",landing_company_shortcode:l??"",currency:u??"",residence:p??"",email:s??"",platform:d.get("platform")??"",utm_source:i??"",utm_medium:t??"",utm_campaign:a??""};window.LiveChatWidget.call("set_session_variables",m),e?(s&&window.LiveChatWidget.call("set_customer_email",s),w&&h&&window.LiveChatWidget.call("set_customer_name",`${w} ${h}`)):window.LC_API.on_chat_ended=()=>{window.LiveChatWidget.call("set_customer_email"," "),window.LiveChatWidget.call("set_customer_name"," ")},oe(),window.LiveChatWidget.on("new_event",(e=>{e.greeting&&window.LC_API.open_chat_window()}))}))};let ie=!1;const te=()=>{const e=!!window.parseCookies(document.cookie,"client_information");e!==ie&&(ne(e),ie=e)};te(),setInterval(te,2e3),(()=>{if(window.__lc=window.__lc||{},window.__lc.license="12049137",window.LC_API=window.LC_API||{loaded:!1},window.LC_API.loaded)oe();else{const e=document.createElement("script");e.async=!0,e.src="https://cdn.livechatinc.com/tracking.js",e.onload=()=>{window.LC_API.loaded=!0,window.LC_API.on_after_load=function(){ne(!!window.parseCookies(document.cookie,"client_information")),oe()},"undefined"!=typeof LiveChatWidget&&LiveChatWidget.init&&LiveChatWidget.init()},document.body.appendChild(e)}})();const ae=document.querySelectorAll(".livechatbtn");ae.length>0&&ae.forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault(),ee()}))}));const re=document.getElementById("liveChatBtn");re&&re.addEventListener("click",(e=>{e.preventDefault(),ee()}));var de;document.querySelectorAll('a[rel="liveChatBtn"]').forEach((e=>{null==e||e.addEventListener("click",(e=>{e.preventDefault(),ee()}))})),(de=de||[]).push((function(){let e=document.querySelector(".navbar_menu-button");e&&e.addEventListener("click",(function(){let e=window.innerHeight,o=document.querySelector(".new-navbar_main-wrapper");if(o){let n=e-o.offsetHeight,i=document.querySelector(".new-navbar_menu");i&&(i.style.height=`${n}px`)}}))})),(de=de||[]).push((function(){let e=document.querySelector(".lang-mob");e&&e.addEventListener("click",(function(){let e=document.querySelector(".new-navbar_menu-wrapper");e&&e.scrollBy({top:-3e3})}))}));class ce{constructor(e){this.cookieName=e}setItem(e){const o=new Date;o.setDate(o.getDate()+30);const n="expires="+o.toUTCString(),i=encodeURIComponent(JSON.stringify(e));document.cookie=`${this.cookieName}=${i};${n};path=/`}getItem(){const e=document.cookie.split(";");for(let o=0;oye.includes(e)))&&document.head.querySelectorAll("link").forEach((function(e){e.hasAttribute("hreflang")&&"x-default"!==e.getAttribute("hreflang")&&e.remove()}));const Ne=e=>{window.rudderanalytics?window.rudderanalytics.track(e.name,e.properties):(e=>{let o=[],n=parseCookies(document.cookie,"cached_analytics_events");n&&(o=JSON.parse(n)),o.push(e),document.cookie=`cached_analytics_events=${JSON.stringify(o)}; path=/; Domain=.deriv.com`})(e)};window.addClickListener=function(e,o,n){e&&e.addEventListener("click",(function(){Ne({name:o,properties:n})}))};var ge=null==document?void 0:document.getElementsByClassName("livechatbtn"),fe=null==document?void 0:document.getElementsByClassName("whatsapp_chat"),ve=null==document?void 0:document.getElementsByClassName("tradershub-btn"),Ye=document.querySelectorAll(".btn-free-demo .w-button"),_e=document.querySelectorAll('.btn-free-demo [data-class="w-button"]');const Ae=document.querySelectorAll('[data-attributes="btn-primary-nav"]'),be=document.querySelectorAll('[data-attributes="btn-secondary-nav"]');ge&&Array.from(ge).forEach((e=>{window.addClickListener(e,"ce_widget_usage_form",{action:"click",widget_name:"livechat"})})),fe&&Array.from(fe).forEach((e=>{window.addClickListener(e,"ce_widget_usage_form",{action:"click",widget_name:"whatsapp"})})),ve&&Array.from(ve).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Traders Hub"})})),Ye&&Array.from(Ye).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),_e&&Array.from(_e).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),Ae&&Array.from(Ae).forEach((e=>{e.classList.contains("tradershub-btn")||window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),be&&Array.from(be).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Login"})}));var ke,Le,Se;"deriv.com"===window.location.hostname||"deriv.be"===window.location.hostname||"deriv.me"===window.location.hostname?(ke="sdk-UhZV3cNEg5nLNLNS",Se="nre64BV0dNIa44zW4tz5ow==",Le="1oV5agvlcnCZ6IH94wCKM1oR8Pd"):(ke="sdk-9wuqJ1mlcQsSyZQ",Se="",Le="1lN3tsFD2nruGFgM5F074DC2hMB");const Ee=(we=window.parseCookies(document.cookie,"client_information"))?JSON.parse(we):null,Ce=window.parseCookies(document.cookie,"utm_data"),qe=Ce?JSON.parse(Ce):{},Ie=window.parseCookies(document.cookie,"signup_device");let ze=null;Ie&&(ze=(null==(e=JSON.parse(Ie))?void 0:e.signup_device)||null);const xe={growthbookKey:ke,growthbookDecryptionKey:Se,rudderstackKey:Le,growthbookOptions:{navigate:e=>window.location.replace(e),antiFlicker:!1,navigateDelay:0,attributes:{country:window.parseCookies(document.cookie,"clients_country")||window.parseCookies(document.cookie,"website_status"),user_language:window.parseCookies(document.cookie,"user_language")||("undefined"!=typeof window?localStorage.getItem("i18n")||navigator.language:null),device_language:window.parseCookies(document.cookie,"language")||" ",device_type:ze,utm_source:null==qe?void 0:qe.utm_source,utm_medium:null==qe?void 0:qe.utm_medium,utm_campaign:null==qe?void 0:qe.utm_campaign,is_authorised:!!window.parseCookies(document.cookie,"client_information"),loggedIn:!!window.parseCookies(document.cookie,"client_information"),url:window.location.href}}};try{null==Analytics||Analytics.Analytics.initialise(xe);const e=(null==Ee?void 0:Ee.user_id)?null==Ee?void 0:Ee.user_id:null==(i=null==(n=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getInstances)?void 0:n.call(o).tracking)?void 0:i.getAnonymousId();null==(t=null==Analytics?void 0:Analytics.Analytics)||t.identifyEvent(e)}catch(Oe){}null==(a=null==Analytics?void 0:Analytics.Analytics)||a.pageView(location.pathname,"Deriv.com"),window.useGrowthbookFeatureFlag=function({featureFlag:e}){var o,n,i,t,a;let r=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getFeatureValue(e);return null==(a=null==(t=null==(i=null==(n=null==Analytics?void 0:Analytics.Analytics)?void 0:n.getInstances())?void 0:i.ab)?void 0:t.GrowthBook)||a.setRenderer((function(){var o;const n=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getFeatureValue(e);r=n})),r};const je=window.parseCookies(document.cookie,"client_information")?JSON.parse(window.parseCookies(document.cookie,"client_information")):null;(null==je?void 0:je.loginid)&&(null==window||window.hj("identify",je.loginid,{is_logged_in:!!window.parseCookies(document.cookie,"client_information"),landing_company_shortcode:je.landing_company_shortcode||"null"}));null==(s=null==(c=null==(d=null==(r=null==Analytics?void 0:Analytics.Analytics)?void 0:r.getInstances())?void 0:d.ab)?void 0:c.GrowthBook)||s.loadFeatures().then((()=>{window.location.href.indexOf("/partners")>-1==!1&&(()=>{var e;const o=(null==(e=null==Analytics?void 0:Analytics.Analytics)?void 0:e.getFeatureValue("trigger_os_signup_wf"))?function(){const e=navigator.userAgent.toLowerCase();return/ipad|iphone|ipod/.test(e)}()||function(){const e=navigator.userAgent.toLowerCase();return/safari/.test(e)&&!/chrome/.test(e)&&!/crios/.test(e)}()?`https://${window.location.host}/signup`:(()=>{const e=window.location.hostname;let o;switch(o="deriv.com"===e||"deriv.be"===e||"deriv.me"===e?"production":"staging.deriv.com"===e?"staging":"development",o){case"production":return"https://hub.deriv.com/tradershub/signup";case"staging":return"https://staging-hub.deriv.com/tradershub/signup";default:return"https://dev-hub.deriv.com/tradershub/signup"}})():`https://${window.location.host}/signup`,n=document.getElementById("cta-home-btn-navbar");n&&(n.href=o);const i=document.querySelectorAll(".logged-out-btn");null==i||i.forEach((e=>{var n;(null==(n=null==e?void 0:e.href)?void 0:n.indexOf("/signup"))>0&&(e.href=o)}));const t=document.querySelectorAll(".logged-out-btn a");null==t||t.forEach((e=>{var n;(null==(n=null==e?void 0:e.href)?void 0:n.indexOf("/signup"))>0&&(e.href=o)}))})()})); +import{initializeApp as e}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-app.js";import{getDatabase as o,ref as a,onValue as n}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-database.js";function i(e,o,a,n){let i="";if(a){let e=new Date;e.setTime(e.getTime()+24*a*60*60*1e3),i="; expires="+e.toUTCString()}document.cookie=n?e+"="+(o||"")+i+`;domain=${n};path=/`:e+"="+(o||"")+i+";path=/"}function t(e,o){const a={};return e.split(";").forEach((e=>{const[o,n]=e.split("=").map((e=>e.trim()));a[o]=decodeURIComponent(n)})),a[o]}function r(e){i("webflow-user-language",e,30)}function d(e){document.cookie=e+"=; Max-Age=-99999999;"}window.emailRegex=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,window.toggleErrorField=(e,o)=>{o?e.classList.remove("error-field"):e.classList.add("error-field")},window.disableButton=function(e){e.disabled=!0,e.style.opacity="0.5"},window.isEuRegion=function(e){const o=e.replace(/\/$/,"");return/^\/(?:[^\/]+\/)?eu(?:\/|$)/.test(o)},window.enableButton=function(e){e.disabled=!1,e.style.opacity="1"},window.getOauthUrl=function(){var e=window.location.href,o=new URL(e).hostname,a=["deriv.com","deriv.be","deriv.me"].find((e=>o.endsWith(e)));return a?`https://oauth.${a}`:"https://oauth.deriv.com"},window.getClientCountry=function(){var e;const o=t(document.cookie,"clients_country"),a=t(document.cookie,"client_information");return a&&(null==(e=JSON.parse(a))?void 0:e.residence)||o},window.deriv_com_url="deriv.com",window.deriv_me_url="deriv.me",window.deriv_be_url="deriv.be",window.webflow_domain="webflow.deriv.com",window.staging_url="staging.deriv.com",window.staging_deriv_be_url="staging.deriv.be",window.domain_list_app_id={[window.deriv_com_url]:"16929",[window.deriv_me_url]:"1411",[window.deriv_be_url]:"30767",[window.webflow_domain]:"53503",[window.staging_url]:"16303"},window.getDomain=()=>{var e=window.location.href;return new URL(e).hostname},window.getAppId=()=>{const e=window.getDomain(),o=new URLSearchParams(window.location.search||"").get("app_id");if(o)return o;const a=localStorage.getItem("config.app_id");if(a)return a;const n={[window.webflow_domain]:window.domain_list_app_id[window.webflow_domain],[window.deriv_be_url]:window.domain_list_app_id[window.deriv_be_url],[window.deriv_me_url]:window.domain_list_app_id[window.deriv_me_url],[window.staging_url]:window.domain_list_app_id[window.staging_url]};return n[e]?n[e]:window.domain_list_app_id[window.deriv_com_url]};const s=()=>{const e=localStorage.getItem("config.server_url"),o=t(document.cookie,"webflow-user-language");let a=o?o.toLowerCase():"en";"zh-cn"!==a&&"zh-tw"!==a||(a=a.replace("-","_"));const n=(e=>{let o="";return e&&Object.keys(e).forEach((a=>{o+=`&${a}=${e[a]}`})),o})((()=>{const e=t(document.cookie,"utm_data");if(e){const o=JSON.parse(e),a={};return["utm_source","utm_ad_id","utm_adgroup_id","utm_adrollclk_id","utm_campaign","utm_campaign_id","utm_content","utm_fbcl_id","utm_gl_client_id","utm_medium","utm_msclk_id","utm_term"].forEach((e=>{o.hasOwnProperty(e)&&(a[e]=o[e])})),a}return null})()),i=t(document.cookie,"affiliate_tracking"),r=i?`&affiliate_token=${i}`:"",d=void["mt5","bot","derivx"].filter((e=>window.location.pathname.includes(e)&&e))||"";return e&&/qa/.test(e)?`https://${e}/oauth2/authorize?app_id=${window.getAppId()}&l=${a}&brand=deriv${r}${n}&platform=${d}`:`${window.getOauthUrl()}/oauth2/authorize?app_id=${(()=>{const e=window.getDomain();return e===window.deriv_me_url?window.domain_list_app_id[window.deriv_me_url]:e===window.deriv_be_url?window.domain_list_app_id[window.deriv_be_url]:e===window.webflow_domain?window.domain_list_app_id[window.webflow_domain]:window.domain_list_app_id[window.deriv_com_url]})()}&l=${a}&brand=deriv${r}${n}&platform=${d}`};if(!!!t(document.cookie,"client_information")){var c=document.createElement("iframe");c.src=(()=>{const e=window.location.hostname;let o;switch(o="deriv.com"===e||"deriv.be"===e||"deriv.me"===e?"production":"staging.deriv.com"===e?"staging":"development",o){case"production":return"https://hub.deriv.com/tradershub/signup";case"staging":return"https://staging-hub.deriv.com/tradershub/signup";default:return"https://dev-hub.deriv.com/tradershub/signup"}})(),c.style.width="0",c.style.height="0",c.style.border="none",c.style.visibility="hidden",c.setAttribute("sandbox","allow-same-origin allow-scripts"),document.body.appendChild(c)}window.establishWebSocketConnection=()=>new Promise(((e,o)=>{const a=t(document.cookie,"webflow-user-language"),n=a?a.toLowerCase():"en",i=localStorage.getItem("config.server_url")||"green.derivws.com";window.websocket=new WebSocket(`wss://${i}/websockets/v3?app_id=${window.getAppId()}&l=${n||"en"}&brand=deriv`),window.websocket.addEventListener("open",(o=>{window.websocket.addEventListener("close",(()=>{window.websocket.close()})),window.websocket.addEventListener("message",(e=>{JSON.parse(e.data)})),e(window.websocket)})),window.websocket.addEventListener("error",(e=>{var a;null==(a=null==window?void 0:window.websocket)||a.close(),o(e)}))})),window.socketMessageSend=async(e,o)=>{var a;try{return(null==window?void 0:window.websocket)&&(null==(a=null==window?void 0:window.websocket)?void 0:a.readyState)===(null==WebSocket?void 0:WebSocket.OPEN)?(window.websocket.send(e),new Promise(((e,a)=>{window.websocket.addEventListener("message",(n=>{const i=JSON.parse(n.data);o===i.msg_type&&(i.error?a(i.error):e(i))}))}))):establishWebSocketConnection().then((()=>(websocket.send(e),new Promise(((e,a)=>{websocket.addEventListener("message",(n=>{const i=JSON.parse(n.data);o===i.msg_type&&(i.error?a(i.error):e(i))}))}))))).catch((e=>Promise.reject(e)))}catch(n){return Promise.reject(n)}};const u=[{id:"appgallery",selectors:[".footer_banner-badge.gallery.w-inline-block",".app-download_link-wrapper.appgallery.w-inline-block"],countries:["af","ax","al","dz","as","ad","ao","aq","am","au","at","az","bh","bd","by","be","bj","bm","bt","bo","ba","bw","bv","br","io","bn","bg","bf","bi","kh","cm","ca","cv","bq","cf","td","cn","cx","cc","km","cg","cd","ck","ci","hr","cu","cw","cy","cz","dk","dj","dm","eg","gq","er","ee","et","fk","fo","fj","fi","fr","pf","tf","ga","gm","ge","de","gh","gi","gr","gl","gu","gg","gn","gw","hm","va","hu","is","in","id","ir","iq","ie","im","il","it","jp","je","jo","kz","ke","ki","kr","kp","kw","kg","la","lv","lb","ls","lr","ly","li","lt","lu","mo","mk","mg","mw","my","mv","ml","mt","mh","mr","mu","yt","mx","fm","md","mc","mn","me","ma","mz","mm","na","nr","np","nl","nc","nz","ne","ng","nu","nf","mp","no","om","pk","pw","ps","pg","pe","ph","pn","pl","pt","qa","re","ro","ru","rw","sh","kn","pm","bl","mf","ws","sm","st","sa","sn","rs","sc","sl","sg","sx","sk","si","sb","so","gs","ss","es","lk","sd","sj","sz","se","ch","sy","tw","tj","tz","th","tl","tg","tk","to","tn","tr","tm","tc","tv","ug","ua","ae","gb","um","us","uz","vu","vi","wf","eh","ye","zm","zw"]},{id:"googlePlay",selectors:[".footer_banner-badge.google.w-inline-block",".app-download_link-wrapper.google.w-inline-block"],countries:["af","ax","as","ad","ai","aq","au","bb","bt","bv","io","bn","bi","ca","bq","cf","cx","cc","cg","cd","ck","cw","gq","et","fk","fo","gf","pf","tf","gl","gp","gu","gg","gy","hm","va","hk","ir","im","jp","je","ki","kp","ls","ly","mg","mw","mh","mq","mr","yt","fm","mn","me","ms","nr","nc","nz","ng","nu","nf","mp","pw","ps","pn","pr","re","sh","kn","lc","pm","vc","bl","mf","st","sg","sx","gs","ss","sj","sz","sy","tl","tk","tc","tv","um","us","vg","vi","wf","eh"]},{id:"appstore",selectors:[".footer_banner-badge.store.w-inline-block",".app-download_link-wrapper.appstore.w-inline-block"],countries:["ax","al","as","ad","aq","aw","au","at","bd","be","bv","io","bg","bi","ca","bq","cf","cx","cc","km","ck","hr","cu","cw","cy","cz","dk","dj","gq","er","ee","et","fk","fo","fi","fr","gf","pf","tf","de","gi","gr","gl","gp","gu","gg","gn","ht","hm","va","hk","hu","is","ir","iq","ie","im","il","it","je","ki","kp","lv","ls","ly","li","lt","lu","mt","mh","mq","yt","fm","me","nl","nc","nz","ng","nu","nf","mp","no","ps","pn","pl","pt","pr","re","ro","sh","pm","bl","mf","ws","sm","sg","sx","sk","si","so","gs","ss","es","sd","sj","se","ch","sy","tw","tl","tg","tk","tr","tv","gb","um","us","vu","vi","wf","eh"]},{id:"p2p",selectors:["#p2payment.accordion_toggle-block","#p2component.section_dp2p","#card_block_p2p.help_category"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"w-dyn-item-p2p",selectors:["div.w-dyn-item"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"hideRow",selectors:["#footer_social-icons_row","#footer_text_row",".footer_risk-warning.w-richtext"],countries:["br","uy","lk","ch","za","ec"]},{id:"hideDiel",selectors:["#footer_text_diel","#footer_social-icons_diel"],countries:["br","uy","lk","ch","za","ec"]}],l=[{id:"showElems",selectors:[".banner_disclaimer"],countries:["br","uy","lk","ch","za","ec"]}],p=()=>{const e=window.getClientCountry();u.forEach((o=>{const a="hideDiel"===o.id?!o.countries.includes(e):o.countries.includes(e);if(e&&a)return o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((e=>{if(e)if("w-dyn-item-p2p"===o.id){e.querySelector("#card_block_p2p.help_category")&&(e.style.display="none")}else e.style.display="none"}))}));if(!a){const e=document.querySelector(".footer_social-icons.diel");e&&(e.style.display="flex")}})),l.forEach((o=>{e&&o.countries.includes(e)?o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{if(o){const a=document.querySelector(".page-wrapper");".banner_disclaimer"===e?(a.classList.add("disclaimer-show"),o.classList.remove("hide-element")):o.style.display="block"}}))})):o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{o&&(".banner_disclaimer"===e?o.classList.add("hide-element"):o.style.display="none")}))}))}))},w=JSON.stringify({website_status:1});!async function(){try{const e=await fetch("https://www.cloudflare.com/cdn-cgi/trace"),o=await e.text(),a=Object.fromEntries(o.split("\n").map((e=>e.split("=",2)))).loc.toLowerCase();a!==t(document.cookie,"clients_country")&&(d("clients_country"),i("clients_country",a,30)),p()}catch(e){p()}}();t(document.cookie,"clients_country")||window.socketMessageSend(w,"website_status").then((e=>{t(document.cookie,"clients_country")!==e.website_status.clients_country&&(d("clients_country"),i("clients_country",e.website_status.clients_country,30)),p()})).catch((e=>{}));const h=["ar","bn","de","en","es","fr","it","ko","pl","pt","ru","si","sw","th","tr","vi","zh_cn","zh_tw","zh-cn","zh-tw"];(()=>{var e;const o=window.location.pathname,a=window.location.hash,n=window.location.search,i=o.split("/"),d=i[1],s=h.includes(d||""),c=i.includes("careers")||i.includes("locations")||i.includes("derivtech")||i.includes("derivlife")||i.includes("eu-careers")||i.includes("our-locations");s&&r(d);const u=(null==(e=t(document.cookie,"webflow-user-language"))?void 0:e.toLowerCase())||"en",l=s?d:u;if((s||"en"!==u)&&d!==u)if(s&&d!==u)r(l);else if(!c){const e=(s?i.map((e=>e===d?l:e)).join("/"):l+i.join("/"))+n+a;window.location.href="/"+e}})();const N=function(){let e,o=!1,a=!1;const n=()=>{a=!0,o=!!t(document.cookie,"client_information"),o&&clearInterval(e),document.dispatchEvent(new Event("authStatusChange"))};return n(),e=setInterval(n,800),{getLoggedInStatus:()=>o,getAuthCheckedStatus:()=>a,onAuthStatusChange:e=>document.addEventListener("authStatusChange",e)}}();N.onAuthStatusChange((()=>{if(N.getAuthCheckedStatus()&&N.getLoggedInStatus()){document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.add("hide-element")}))}else if(N.getAuthCheckedStatus()&&!N.getLoggedInStatus()){document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.add("hide-element")}))}}));const y=window.location.href;if(["help-centre"].some((e=>y.includes(e)))){const e=new URL(y).searchParams;e.has("platform")&&"derivgo"===e.get("platform")&&(m=".derivgo-query-element",document.querySelectorAll(m).forEach((e=>{e.style.display="none"})))}var m;const Y=document.querySelector(".banner_disclaimer"),g=document.querySelector(".main-wrapper");if(Y){new ResizeObserver((e=>{for(let o of e)if(o.target===Y){let e=o.target.getBoundingClientRect();g&&(g.style.paddingTop=e.height+"px")}})).observe(Y)}window.addEventListener("pageshow",(function(e){if(e.persisted){const e=document.querySelector(".w-nav-overlay");e&&(e.style.display="none",document.querySelector("body").click())}}));const A=o(e({databaseURL:window.location.hostname.includes("staging")?"https://app-config-staging.firebaseio.com":"https://app-config-prod.firebaseio.com"}));let f=!1,b=!1;!function(){var e;const o=document.getElementById("live_chat-wrapper");try{const e=a(A,"remote_config/deriv-com/chat");n(e,(e=>{const a=e.val();f=a.live_chat,b=a.whatsapp_chat;const n=document.querySelector(".whatsapp_chat"),i=document.querySelector(".livechatbtn");n&&(n.style.visibility=b?"visible":"hidden"),i&&(i.style.visibility=f?"visible":"hidden");if(window.location.pathname.includes("/help-centre")){const e=document.querySelectorAll(".livechatbtn");f?e.forEach((e=>{e.style.visibility="visible"})):e.forEach((e=>{e.style.visibility="hidden"}));const o=document.querySelectorAll(".whatsapp_chat");b?o.forEach((e=>{e.style.visibility="visible"})):o.forEach((e=>{e.style.visibility="hidden"}))}window.addEventListener("scroll",(function(){var e,a;(f||b)&&(null==(e=null==o?void 0:o.classList)||e.remove("hide-element")),f||b||null==(a=null==o?void 0:o.classList)||a.add("hide-element")}))}),(e=>{var a;null==(a=null==o?void 0:o.classList)||a.remove("hide-element")}))}catch(i){null==(e=null==o?void 0:o.classList)||e.remove("hide-element")}}();new MutationObserver((function(e){for(const o of e)if(o.addedNodes.length)for(const e of o.addedNodes)e.nodeType===Node.ELEMENT_NODE&&"chat-widget-minimized"===e.id&&(e.style.opacity="0")})).observe(document.body,{childList:!0,subtree:!0});const v=window.getClientCountry();const _=[{country:"af",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"ax",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"al",apple:"No",android:"Yes",huawei:"No"},{country:"dz",apple:"Yes",android:"Yes",huawei:"No"},{country:"as",apple:"N/A",android:"No",huawei:"N/A"},{country:"ad",apple:"N/A",android:"N/A",huawei:"No"},{country:"ao",apple:"Yes",android:"Yes",huawei:"No"},{country:"ai",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"aq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ag",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ar",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"am",apple:"Yes",android:"Yes",huawei:"No"},{country:"aw",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"au",apple:"No",android:"No",huawei:"No"},{country:"at",apple:"No",android:"Yes",huawei:"No"},{country:"az",apple:"Yes",android:"Yes",huawei:"No"},{country:"bs",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bh",apple:"Yes",android:"Yes",huawei:"No"},{country:"bd",apple:"N/A",android:"Yes",huawei:"No"},{country:"bb",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"by",apple:"Yes",android:"Yes",huawei:"No"},{country:"be",apple:"No",android:"Yes",huawei:"No"},{country:"bz",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bj",apple:"Yes",android:"Yes",huawei:"No"},{country:"bm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"bt",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"bo",apple:"Yes",android:"Yes",huawei:"No"},{country:"ba",apple:"Yes",android:"Yes",huawei:"No"},{country:"bw",apple:"Yes",android:"Yes",huawei:"No"},{country:"bv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"br",apple:"Yes",android:"Yes",huawei:"No"},{country:"io",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"bn",apple:"Yes",android:"N/A",huawei:"No"},{country:"bg",apple:"No",android:"Yes",huawei:"No"},{country:"bf",apple:"Yes",android:"Yes",huawei:"No"},{country:"bi",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kh",apple:"Yes",android:"Yes",huawei:"No"},{country:"cm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ca",apple:"No",android:"No",huawei:"No"},{country:"cv",apple:"Yes",android:"Yes",huawei:"No"},{country:"bq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ky",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cf",apple:"N/A",android:"N/A",huawei:"No"},{country:"td",apple:"Yes",android:"Yes",huawei:"No"},{country:"cl",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cn",apple:"Yes",android:"Yes",huawei:"No"},{country:"cx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"co",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"km",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cg",apple:"Yes",android:"N/A",huawei:"No"},{country:"cd",apple:"Yes",android:"N/A",huawei:"No"},{country:"ck",apple:"N/A",android:"N/A",huawei:"No"},{country:"cr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ci",apple:"Yes",android:"Yes",huawei:"No"},{country:"hr",apple:"No",android:"Yes",huawei:"No"},{country:"cu",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cw",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cy",apple:"No",android:"Yes",huawei:"No"},{country:"cz",apple:"No",android:"Yes",huawei:"No"},{country:"dk",apple:"No",android:"Yes",huawei:"No"},{country:"dj",apple:"N/A",android:"Yes",huawei:"No"},{country:"dm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"do",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ec",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"eg",apple:"Yes",android:"Yes",huawei:"No"},{country:"sv",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gq",apple:"N/A",android:"N/A",huawei:"No"},{country:"er",apple:"N/A",android:"Yes",huawei:"No"},{country:"ee",apple:"No",android:"Yes",huawei:"No"},{country:"et",apple:"N/A",android:"N/A",huawei:"No"},{country:"fk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"fo",apple:"N/A",android:"N/A",huawei:"No"},{country:"fj",apple:"Yes",android:"Yes",huawei:"No"},{country:"fi",apple:"No",android:"Yes",huawei:"No"},{country:"fr",apple:"No",android:"Yes",huawei:"No"},{country:"gf",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"pf",apple:"N/A",android:"N/A",huawei:"No"},{country:"tf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ga",apple:"Yes",android:"Yes",huawei:"No"},{country:"gm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ge",apple:"Yes",android:"Yes",huawei:"No"},{country:"de",apple:"No",android:"Yes",huawei:"No"},{country:"gh",apple:"Yes",android:"Yes",huawei:"No"},{country:"gi",apple:"N/A",android:"Yes",huawei:"No"},{country:"gr",apple:"No",android:"Yes",huawei:"No"},{country:"gl",apple:"N/A",android:"N/A",huawei:"No"},{country:"gd",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gp",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"gu",apple:"N/A",android:"No",huawei:"N/A"},{country:"gt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gg",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"gn",apple:"N/A",android:"Yes",huawei:"No"},{country:"gw",apple:"Yes",android:"Yes",huawei:"No"},{country:"gy",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ht",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"hm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"va",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"hn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"hk",apple:"No",android:"No",huawei:"Yes"},{country:"hu",apple:"No",android:"Yes",huawei:"No"},{country:"is",apple:"No",android:"Yes",huawei:"No"},{country:"in",apple:"Yes",android:"Yes",huawei:"No"},{country:"id",apple:"Yes",android:"Yes",huawei:"No"},{country:"ir",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"iq",apple:"No",android:"Yes",huawei:"N/A"},{country:"ie",apple:"No",android:"Yes",huawei:"No"},{country:"im",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"il",apple:"No",android:"Yes",huawei:"No"},{country:"it",apple:"No",android:"Yes",huawei:"No"},{country:"jm",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"jp",apple:"Yes",android:"No",huawei:"No"},{country:"je",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"jo",apple:"Yes",android:"Yes",huawei:"No"},{country:"kz",apple:"Yes",android:"Yes",huawei:"No"},{country:"ke",apple:"Yes",android:"Yes",huawei:"No"},{country:"ki",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kr",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"kp",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kw",apple:"Yes",android:"Yes",huawei:"No"},{country:"kg",apple:"Yes",android:"Yes",huawei:"No"},{country:"la",apple:"Yes",android:"Yes",huawei:"No"},{country:"lv",apple:"No",android:"Yes",huawei:"No"},{country:"lb",apple:"Yes",android:"Yes",huawei:"No"},{country:"ls",apple:"N/A",android:"N/A",huawei:"No"},{country:"lr",apple:"Yes",android:"Yes",huawei:"No"},{country:"ly",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"li",apple:"N/A",android:"Yes",huawei:"No"},{country:"lt",apple:"No",android:"Yes",huawei:"No"},{country:"lu",apple:"No",android:"Yes",huawei:"No"},{country:"mo",apple:"Yes",android:"Yes",huawei:"No"},{country:"mk",apple:"Yes",android:"Yes",huawei:"No"},{country:"mg",apple:"Yes",android:"N/A",huawei:"No"},{country:"mw",apple:"Yes",android:"N/A",huawei:"No"},{country:"my",apple:"Yes",android:"Yes",huawei:"No"},{country:"mv",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"ml",apple:"Yes",android:"Yes",huawei:"No"},{country:"mt",apple:"No",android:"Yes",huawei:"No"},{country:"mh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mq",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"mr",apple:"Yes",android:"N/A",huawei:"No"},{country:"mu",apple:"Yes",android:"Yes",huawei:"No"},{country:"yt",apple:"N/A",android:"N/A",huawei:"No"},{country:"mx",apple:"Yes",android:"Yes",huawei:"No"},{country:"fm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"md",apple:"Yes",android:"Yes",huawei:"No"},{country:"mc",apple:"Yes",android:"Yes",huawei:"No"},{country:"mn",apple:"Yes",android:"N/A",huawei:"No"},{country:"me",apple:"No",android:"N/A",huawei:"No"},{country:"ms",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ma",apple:"Yes",android:"Yes",huawei:"No"},{country:"mz",apple:"Yes",android:"Yes",huawei:"No"},{country:"mm",apple:"Yes",android:"Yes",huawei:"No"},{country:"na",apple:"Yes",android:"Yes",huawei:"No"},{country:"nr",apple:"Yes",android:"N/A",huawei:"No"},{country:"np",apple:"Yes",android:"Yes",huawei:"No"},{country:"nl",apple:"No",android:"Yes",huawei:"No"},{country:"nc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nz",apple:"No",android:"No",huawei:"No"},{country:"ni",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ne",apple:"Yes",android:"Yes",huawei:"No"},{country:"ng",apple:"No",android:"No",huawei:"No"},{country:"nu",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mp",apple:"N/A",android:"No",huawei:"N/A"},{country:"no",apple:"No",android:"Yes",huawei:"No"},{country:"om",apple:"Yes",android:"Yes",huawei:"No"},{country:"pk",apple:"Yes",android:"Yes",huawei:"No"},{country:"pw",apple:"Yes",android:"No",huawei:"N/A"},{country:"ps",apple:"N/A",android:"N/A",huawei:"No"},{country:"pa",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pg",apple:"Yes",android:"Yes",huawei:"No"},{country:"py",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pe",apple:"Yes",android:"Yes",huawei:"No"},{country:"ph",apple:"Yes",android:"Yes",huawei:"No"},{country:"pn",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"pl",apple:"No",android:"Yes",huawei:"No"},{country:"pt",apple:"No",android:"Yes",huawei:"No"},{country:"pr",apple:"N/A",android:"No",huawei:"Yes"},{country:"qa",apple:"Yes",android:"Yes",huawei:"No"},{country:"re",apple:"N/A",android:"N/A",huawei:"No"},{country:"ro",apple:"No",android:"Yes",huawei:"No"},{country:"ru",apple:"Yes",android:"Yes",huawei:"No"},{country:"rw",apple:"Yes",android:"Yes",huawei:"No"},{country:"sh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kn",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"lc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"pm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"vc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"bl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ws",apple:"N/A",android:"Yes",huawei:"No"},{country:"sm",apple:"N/A",android:"Yes",huawei:"No"},{country:"st",apple:"Yes",android:"N/A",huawei:"No"},{country:"sa",apple:"Yes",android:"Yes",huawei:"No"},{country:"sn",apple:"Yes",android:"Yes",huawei:"No"},{country:"rs",apple:"Yes",android:"Yes",huawei:"No"},{country:"sc",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"sl",apple:"Yes",android:"Yes",huawei:"No"},{country:"sg",apple:"No",android:"No",huawei:"No"},{country:"sx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sk",apple:"No",android:"Yes",huawei:"No"},{country:"si",apple:"No",android:"Yes",huawei:"No"},{country:"sb",apple:"Yes",android:"Yes",huawei:"No"},{country:"so",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"za",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gs",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ss",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"es",apple:"No",android:"Yes",huawei:"No"},{country:"lk",apple:"Yes",android:"Yes",huawei:"No"},{country:"sd",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"sr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"sj",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sz",apple:"Yes",android:"N/A",huawei:"No"},{country:"se",apple:"No",android:"Yes",huawei:"No"},{country:"ch",apple:"No",android:"Yes",huawei:"No"},{country:"sy",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tw",apple:"No",android:"Yes",huawei:"No"},{country:"tj",apple:"Yes",android:"Yes",huawei:"No"},{country:"tz",apple:"Yes",android:"Yes",huawei:"No"},{country:"th",apple:"Yes",android:"Yes",huawei:"No"},{country:"tl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tg",apple:"N/A",android:"Yes",huawei:"No"},{country:"tk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"to",apple:"Yes",android:"Yes",huawei:"No"},{country:"tt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"tn",apple:"Yes",android:"Yes",huawei:"No"},{country:"tr",apple:"No",android:"Yes",huawei:"No"},{country:"tm",apple:"Yes",android:"Yes",huawei:"No"},{country:"tc",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"tv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ug",apple:"Yes",android:"Yes",huawei:"No"},{country:"ua",apple:"Yes",android:"Yes",huawei:"No"},{country:"ae",apple:"Yes",android:"Yes",huawei:"No"},{country:"gb",apple:"No",android:"Yes",huawei:"No"},{country:"um",apple:"N/A",android:"No",huawei:"N/A"},{country:"us",apple:"No",android:"No",huawei:"N/A"},{country:"uy",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"uz",apple:"Yes",android:"Yes",huawei:"No"},{country:"vu",apple:"No",android:"Yes",huawei:"N/A"},{country:"ve",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vg",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"vi",apple:"N/A",android:"No",huawei:"N/A"},{country:"wf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"eh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ye",apple:"Yes",android:"Yes",huawei:"No"},{country:"zm",apple:"Yes",android:"Yes",huawei:"No"},{country:"zw",apple:"Yes",android:"Yes",huawei:"No"}].find((e=>e.country===v)),k=_?function(e){const{apple:o,android:a,huawei:n}=e;return"Yes"===o&&"Yes"===a&&"Yes"===n?"Android, iOS & Huawei":"Yes"===o&&"Yes"===a&&"Yes"!==n?"Android, and iOS":"Yes"===o&&"Yes"===n&&"Yes"!==a?"iOS, and Huawei":"Yes"===a&&"Yes"!==o&&"Yes"!==n?"Android":"Yes"===o&&"Yes"===n&&"Yes"!==a?"iOS, and Huawei":"Yes"===o&&"Yes"!==a&&"Yes"!==n?"iOS":"Yes"!==o&&"Yes"!==a&&"Yes"===n?"Huawei":""}(_):"",E=document.getElementById("app-download-heading");E&&(E.innerText=k);const S=document.querySelector(".redirection_background-wrapper"),L=document.getElementById("cancel-redirect"),q=document.getElementById("proceed-redirect");if(window.isEuRegion(window.location.pathname)&&S&&L&&q){const e=["deriv.me","deriv.be","deriv.com","app.deriv.me","app.deriv.be","app.deriv.com","docs.deriv.com","community.deriv.com","deriv.statuspage.io","signup.deriv.com","login.deriv.com","api.deriv.com"];let o="",a="_self";document.querySelectorAll("a").forEach((function(n){const i=new URL(n.href,window.location.href),t=new URL(window.location.href);e.includes(i.host)||i.host===t.host||n.addEventListener("click",(function(e){e.preventDefault(),o=i.href,a=n.target||"_self",S.classList.remove("hide-element"),document.body.style.overflow="hidden"}))})),L.addEventListener("click",(function(){S.classList.add("hide-element"),document.body.style.overflow="auto",o=""})),q.addEventListener("click",(function(){o&&(window.open(o,a),o="",S.classList.add("hide-element"),document.body.style.overflow="auto")}))}document.querySelector(".banner_disclaimer")?document.body.classList.add("disclaimer-visible"):document.body.classList.remove("disclaimer-visible");const z=document.querySelectorAll(".navbar_accordion-item");function j(){const e=document.querySelector(".navbar_accordion-trigger.open");e&&e.scrollIntoView({behavior:"smooth",block:"start"})}z.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.overflow="hidden",o.style.transition="max-height 0.3s ease-in, opacity 0.3s ease-in",o.style.opacity="0"})),z.forEach((e=>{const o=e.querySelector(".navbar_accordion-trigger");o.addEventListener("click",(function(){const e=o.classList.contains("open");if(z.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.opacity="0"})),!e){o.classList.add("open");const e=o.nextElementSibling;e.classList.add("open"),e.style.maxHeight=e.scrollHeight+"px",e.style.opacity="1"}}))}));document.querySelectorAll(".navbar_accordion-trigger").forEach((e=>{e.addEventListener("click",(function(){setTimeout(j,300)}))}));const x=new MutationObserver((e=>{e.forEach((e=>{if("class"===e.attributeName){const o=e.target;o.classList.contains("open")&&o.scrollIntoView({behavior:"smooth",block:"start"})}}))}));document.querySelectorAll(".navbar_accordion-item").forEach((e=>{x.observe(e,{attributes:!0})}));const C=new URL(window.location.href),$=new URLSearchParams(C.search),I=$.get("t");if($.has("referrer")&&null!=I){t(document.cookie,"referrer_token")!==I&&(d("referrer_token"),i("referrer_token",I,365,".deriv.com"))}const O=document.getElementById("navbar-home_login");O&&O.addEventListener("click",(function(e){e.preventDefault(),window.location.href=s()}));const R=document.getElementById("res-navbar-home_login");R&&R.addEventListener("click",(function(e){e.preventDefault(),window.location.href=s()}));const U=document.getElementById("white-navbar_login");U&&U.addEventListener("click",(function(e){e.preventDefault(),window.location.href=s()}));const D=document.getElementById("res-white-navbar_login");D&&D.addEventListener("click",(function(e){e.preventDefault(),window.location.href=s()})),window.customLoader="Minimal Migration"; From 0570129932465e5fa9b8611732ebcd6b74124b9b Mon Sep 17 00:00:00 2001 From: Prince Date: Tue, 17 Sep 2024 16:55:41 +0400 Subject: [PATCH 31/57] chore: migrate all --- src/js/footer/migration.js | 953 ++++++++++++++++++++++++++++++++++++- src/temp-static.min.js | 2 +- 2 files changed, 952 insertions(+), 3 deletions(-) diff --git a/src/js/footer/migration.js b/src/js/footer/migration.js index daa72b5..451ffad 100644 --- a/src/js/footer/migration.js +++ b/src/js/footer/migration.js @@ -1,5 +1,954 @@ -// alert('minimal migration') -window.customLoader = "Minimal Migration" + +window.fallbackLoader = "Migrated All" + +// +// This function adds a red line to the current accordion trigger +var Webflow = Webflow || []; +Webflow.push(function () { + // Find all accordion triggers + let triggers = document.querySelectorAll(".navbar_accordion-trigger"); + + triggers.forEach((trigger) => { + trigger.addEventListener("click", function () { + // Remove the .current class from all triggers + triggers.forEach((t) => t.classList.remove("current")); + + // Add the .current class to the clicked trigger + this.classList.add("current"); + }); + }); + + // Find the current page link in Navbar + let currentLink = document.querySelector( + ".navbar_accordion-link.w--current" + ); + + if (currentLink) { + // Find the closest accordion item + let accordionItem = currentLink.closest(".navbar_accordion-item"); + + if (accordionItem) { + // Find the trigger element within the found parent + let trigger = accordionItem.querySelector(".navbar_accordion-trigger"); + + if (trigger) { + // Add the .current class to the trigger + trigger.classList.add("current"); + } + } + } +}); + +// + +// + +var Webflow = Webflow || []; +Webflow.push(function () { + let currentLocaleElement = document.querySelector( + ".locale > .new-navbar_dropdown-link.w--current" + ); + + if (currentLocaleElement) { + let currentLocaleIsoCode = currentLocaleElement.getAttribute("hreflang"); + + let currentLocaleIsoCodeTexts = document.querySelectorAll( + ".current-locale-iso-code" + ); + + if (currentLocaleIsoCode && currentLocaleIsoCodeTexts.length) { + for (let currentLocaleIsoCodeText of currentLocaleIsoCodeTexts) { + currentLocaleIsoCodeText.innerText = currentLocaleIsoCode; + } + } + } +}); + +// + + + +// Function for setting cookies when changing language and redirecting to the current language page + +function setCookie(name, value, days) { + let expires = ""; + if (days) { + let date = new Date(); + date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000); + expires = "; expires=" + date.toUTCString(); + } + document.cookie = name + "=" + (value || "") + expires + "; path=/"; +} + +function getCookie(name) { + let cookies = document.cookie.split(";"); + for (let i = 0; i < cookies.length; i++) { + let cookie = cookies[i].trim(); + if (cookie.startsWith(name + "=")) { + return cookie.substring(name.length + 1); + } + } + return null; +} + +let localeItems = document.querySelectorAll(".w-locales-items"); + +if (localeItems.length > 0) { + localeItems.forEach(function (item) { + let links = item.querySelectorAll("a"); + links.forEach(function (link) { + link.addEventListener("click", function (event) { + event.preventDefault(); + let language = link.getAttribute("hreflang"); + setCookie("webflow-user-language", language, 30); + window.location.href = link.href; + }); + }); + }); + + function clickLinkWithLanguage(language) { + let link = document.querySelector('a[hreflang="' + language + '"]'); + if (link && window.location.pathname !== link.getAttribute("href")) { + link.click(); + } + } + window.setLanguageCookie = (language) => { + setCookie("webflow-user-language", language, 30); + }; + + let languageCookie = getCookie("webflow-user-language"); + let targetPaths = [ + "/careers", + "/locations", + "/derivtech", + "/derivlife", + "/eu-careers", + "/our-locations", + ]; + let path = window.location.pathname; + let targetPathUrl = false; + + // Check if the current path matches any of the target paths + if (targetPaths.some((targetPath) => path.includes(targetPath))) { + targetPathUrl === true; + } + if (languageCookie && targetPathUrl) { + clickLinkWithLanguage(languageCookie); + } +} + + +var Webflow = Webflow || []; +Webflow.push(function () { + if (document.querySelector(".new-navbar_component")) { + // Find the .new-navbar_component element + const navbarComponent = document.querySelector(".new-navbar_component"); + + // Add event listeners for hover + navbarComponent.addEventListener("mouseenter", () => { + if (window.innerWidth > 991) { + disableScroll(); + } + }); + navbarComponent.addEventListener("mouseleave", () => { + if (window.innerWidth > 991) { + enableScroll(); + } + }); + + // Function to disable scroll + function disableScroll() { + document.body.classList.add("disable-scroll"); + } + + // Function to enable scroll + function enableScroll() { + document.body.classList.remove("disable-scroll"); + } + } +}); + + + +const clientsCountry = window.getClientCountry(); + +const getDateFirstContact = () => { + const dateFirstContactString = window.parseCookies( + document.cookie, + "date_first_contact" + ); + if (dateFirstContactString) { + const parsedData = JSON.parse(dateFirstContactString); + return parsedData.date_first_contact + ? { date_first_contact: parsedData.date_first_contact } + : null; + } + return null; +}; + +const getSignupDevice = () => { + const signupDeviceString = window.parseCookies( + document.cookie, + "signup_device" + ); + if (signupDeviceString) { + const parsedData = JSON.parse(signupDeviceString); + return parsedData.signup_device + ? { signup_device: parsedData.signup_device } + : null; + } + return null; +}; + +const lang = window.parseCookies(document.cookie, "webflow-user-language"); + +const countriesToRedirect = [ + "as", + "au", + "at", + "be", + "bg", + "ca", + "hr", + "cy", + "cz", + "dk", + "ee", + "fi", + "fr", + "gr", + "gu", + "gg", + "hk", + "hu", + "ir", + "ie", + "im", + "il", + "it", + "je", + "ng", + "mm", + "sy", + "kp", + "lv", + "lt", + "lu", + "my", + "mt", + "nl", + "nz", + "mp", + "py", + "pl", + "pt", + "pr", + "ro", + "rw", + "sk", + "si", + "es", + "se", + "ae", + "gb", + "us", + "um", + "vu", + "vi", + "ky", + "cu", + "de", +]; + +if ( + window.location.pathname.endsWith("p2p") && + !window.location.pathname.startsWith("/blog") +) { + const clientsCountry = window.getClientCountry(); + if (clientsCountry && countriesToRedirect.includes(clientsCountry)) { + if (lang === "en") { + window.location.replace("/404"); + } else { + window.location.replace(`/${lang}/404`); + } + } +} + +if ( + window.parseCookies(document.cookie, "client_information") !== undefined +) { + let purchaseButtons = document.querySelectorAll( + "a.live-markets_button.is-secondary.is-small.is-purchase.w-button" + ); + + let sellButtons = document.querySelectorAll( + "a.live-markets_button.is-secondary.is-small.is-sell.w-button" + ); + + function updateHref(buttons) { + buttons.forEach((button) => { + button.href = "https://app.deriv.com/appstore/traders-hub"; + }); + } + + updateHref(purchaseButtons); + updateHref(sellButtons); +} + +//live chat button hide on menu appear +const mobileMenu = document.getElementById("mobile-menu"); +const liveChatWrapper = document.getElementById("live_chat-wrapper"); + +let isLiveChatVisible = true; +let isLiveChatActivated = false; + +function fadeIn(element) { + var opacity = 0; + var timer = setInterval(function () { + if (opacity >= 1) { + clearInterval(timer); + } + element.style.opacity = opacity; + opacity += 0.1; + }, 30); +} + +function fadeOut(element) { + var opacity = 1; + var timer = setInterval(function () { + if (opacity <= 0) { + clearInterval(timer); + element.style.display = "none"; + } + element.style.opacity = opacity; + opacity -= 0.1; + }, 30); +} + + + +// + +const licenceKey = "12049137"; +const loadLiveChatScript = () => { + window.__lc = window.__lc || {}; + window.__lc.license = licenceKey; + window.LC_API = window.LC_API || { loaded: false }; + if (!window.LC_API.loaded) { + const lcScript = document.createElement("script"); + lcScript.async = true; + lcScript.src = "https://cdn.livechatinc.com/tracking.js"; + lcScript.onload = () => { + window.LC_API.loaded = true; // Mark as loaded + window.LC_API.on_after_load = function () { + performLiveChatAction( + !!window.parseCookies(document.cookie, "client_information") + ); + checkUrlForLiveChat(); + }; + if (typeof LiveChatWidget !== "undefined" && LiveChatWidget.init) { + LiveChatWidget.init(); + } + }; + document.body.appendChild(lcScript); + } else { + checkUrlForLiveChat(); + } +}; +const openLiveChat = () => { + if (window.LC_API && window.LC_API.open_chat_window) { + window.LC_API.open_chat_window(); + } +}; +const checkUrlForLiveChat = () => { + const urlParams = new URLSearchParams(window.location.search); + if (urlParams.get("is_livechat_open") === "true") { + openLiveChat(); + } +}; + +//dashboard send data +const performLiveChatAction = (is_logged_in) => { + window?.LiveChatWidget?.on("ready", () => { + // we open and close the window to trigger the widget to listen for new events + window.LC_API.open_chat_window(); + window.LC_API.hide_chat_window(); + checkUrlForLiveChat(); + + const utm_data_string = window.parseCookies(document.cookie, "utm_data"); + const utm_data = utm_data_string ? JSON.parse(utm_data_string) : {}; + const { utm_source, utm_medium, utm_campaign } = utm_data; + + const client_information = window.parseCookies( + document.cookie, + "client_information" + ); + const url_params = new URLSearchParams(window.location.search); + + const { + loginid, + email, + landing_company_shortcode, + currency, + residence, + first_name, + last_name, + } = client_information ? JSON.parse(client_information) : {}; + + /* the session variables are sent to CS team dashboard to notify user has logged in + and also acts as custom variables to trigger targeted engagement */ + const session_variables = { + is_logged_in: is_logged_in, + loginid: loginid ?? "", + landing_company_shortcode: landing_company_shortcode ?? "", + currency: currency ?? "", + residence: residence ?? "", + email: email ?? "", + platform: url_params.get("platform") ?? "", + utm_source: utm_source ?? "", + utm_medium: utm_medium ?? "", + utm_campaign: utm_campaign ?? "", + }; + + window.LiveChatWidget.call("set_session_variables", session_variables); + + if (is_logged_in) { + if (email) { + window.LiveChatWidget.call("set_customer_email", email); + } + if (first_name && last_name) { + window.LiveChatWidget.call( + "set_customer_name", + `${first_name} ${last_name}` + ); + } + } else { + // clear name and email fields after chat has ended + window.LC_API.on_chat_ended = () => { + window.LiveChatWidget.call("set_customer_email", " "); + window.LiveChatWidget.call("set_customer_name", " "); + }; + } + checkUrlForLiveChat(); + + // open chat widget when there is an incoming greeting/announcement + window.LiveChatWidget.on("new_event", (event) => { + if (event.greeting) { + window.LC_API.open_chat_window(); + } + }); + }); +}; +let is_logged_in = false; +let checkCookieInterval; + +const isLoggedIn = () => { + return !!window.parseCookies(document.cookie, "client_information"); +}; + +const checkLoggedIn = () => { + const new_login_status = isLoggedIn(); + if (new_login_status !== is_logged_in) { + performLiveChatAction(new_login_status); + is_logged_in = new_login_status; + } +}; + +// Perform initial authentication check +checkLoggedIn(); + +// Set interval to periodically check authentication status +checkCookieInterval = setInterval(checkLoggedIn, 2000); +//end of dashboard send data + + +loadLiveChatScript(); +const liveChatIcons = document.querySelectorAll(".livechatbtn"); +if (liveChatIcons.length > 0) { + liveChatIcons.forEach((liveChatIcon) => { + liveChatIcon.addEventListener("click", (event) => { + event.preventDefault(); + openLiveChat(); + }); + }); +} +const liveChatIconById = document.getElementById("liveChatBtn"); +if (liveChatIconById) { + liveChatIconById.addEventListener("click", (event) => { + event.preventDefault(); + openLiveChat(); + }); +} +const liveChatIconsByrel = document.querySelectorAll( + 'a[rel="liveChatBtn"]' +); +liveChatIconsByrel.forEach((liveChatIcon) => { + liveChatIcon?.addEventListener("click", (event) => { + event.preventDefault(); + openLiveChat(); + }); +}); + + +// + + +// +var Webflow = Webflow || []; +Webflow.push(function () { + let navbarMenuBtn = document.querySelector(".navbar_menu-button"); + + if (navbarMenuBtn) { + navbarMenuBtn.addEventListener("click", function () { + let windowHeight = window.innerHeight; + + let navbarWrapper = document.querySelector(".new-navbar_main-wrapper"); + + if (navbarWrapper) { + let navbarHeight = navbarWrapper.offsetHeight; + + let calculatedHeight = windowHeight - navbarHeight; + + let navbarMenu = document.querySelector(".new-navbar_menu"); + if (navbarMenu) { + navbarMenu.style.height = `${calculatedHeight}px`; + } + } + }); + } +}); +// + + +// +// this code ensures opening a list of languages on mobile starting from the top +var Webflow = Webflow || []; +Webflow.push(function () { + let langMobButton = document.querySelector(".lang-mob"); + + if (langMobButton) { + langMobButton.addEventListener("click", function () { + let mobileMenuWrapper = document.querySelector( + ".new-navbar_menu-wrapper" + ); + + if (mobileMenuWrapper) { + mobileMenuWrapper.scrollBy({ top: -3000 }); + } + }); + } +}); +// + + +// +class CookieStorage { + constructor(cookieName) { + this.cookieName = cookieName; + } + + setItem(value) { + const expiryDate = new Date(); + expiryDate.setDate(expiryDate.getDate() + 30); // 30 days from now + const expires = "expires=" + expiryDate.toUTCString(); + const cookieValue = encodeURIComponent(JSON.stringify(value)); + document.cookie = `${this.cookieName}=${cookieValue};${expires};path=/`; + } + getItem() { + const cookies = document.cookie.split(";"); + for (let i = 0; i < cookies.length; i++) { + let cookie = cookies[i].trim(); + if (cookie.startsWith(`${this.cookieName}=`)) { + let cookieValue = cookie.substring(`${this.cookieName}=`.length); + return JSON.parse(decodeURIComponent(cookieValue)); + } + } + return null; + } +} + +const tracking_status_cookie = new CookieStorage("tracking_status"); +const tracking_status_cookie_declined = new CookieStorage( + "tracking_status_decline" +); + +const popupElement = document.querySelector(".cookies_background-wrapper"); + +//set datalayer details +const has_dataLayer = window.dataLayer; +var client_information = window.parseCookies( + document.cookie, + "client_information" +); + +is_logged_in = !!client_information; +has_dataLayer && + window.dataLayer.push({ + loggedIn: is_logged_in, + language: + window.parseCookies(document.cookie, "webflow-user-language") || "en", + ...(is_logged_in && { + visitorId: client_information?.loginid, + currency: client_information?.currency, + email: client_information?.email, + }), + }); + +// Check if pathname contains "eu" and tracking_status_cookie is null + +if ( + window.location.pathname.includes("eu") && + !tracking_status_cookie.getItem() && + !tracking_status_cookie_declined.getItem() +) { + popupElement.classList.remove("hide-element"); + document.body.classList.add("show-cookie"); +} + +// Select the accept and decline buttons +const acceptButton = document.getElementById("accept-cookie"); +const declineButton = document.getElementById("dont-accept-cookie"); + +acceptButton?.addEventListener("click", function () { + tracking_status_cookie.setItem(true); + popupElement.classList.add("hide-element"); + document.body.classList.remove("show-cookie"); +}); + +declineButton?.addEventListener("click", function () { + tracking_status_cookie_declined.setItem(true); + tracking_status_cookie.setItem(false); + popupElement.classList.add("hide-element"); + document.body.classList.remove("show-cookie"); +}); + + + +// +var targetPaths = [ + "/careers", + "/locations", + "/derivtech", + "/derivlife", + "/eu-careers", + "/our-locations", +]; +var path = window.location.pathname; +if (targetPaths.some((targetPath) => path.includes(targetPath))) { + var headTag = document.head; + var linkElements = headTag.querySelectorAll("link"); + linkElements.forEach(function (linkElement) { + if (linkElement.hasAttribute("hreflang")) { + if (linkElement.getAttribute("hreflang") !== "x-default") { + linkElement.remove(); + } + } + }); +} +// + + + +// + +const setEvent = (event) => { + let storedEvents = []; + let cacheCookie = parseCookies(document.cookie, "cached_analytics_events"); + if (cacheCookie) storedEvents = JSON.parse(cacheCookie); + + storedEvents.push(event); + document.cookie = `cached_analytics_events=${JSON.stringify( + storedEvents + )}; path=/; Domain=.deriv.com`; +}; + +const trackEventWithCache = (event) => { + if (window.rudderanalytics) { + window.rudderanalytics.track(event.name, event.properties); + } else { + setEvent(event); + } +}; + +window.addClickListener = function (button, eventName, eventProperties) { + if (button) { + button.addEventListener("click", function () { + trackEventWithCache({ + name: eventName, + properties: eventProperties, + }); + }); + } +}; + +var btnLiveChat = document?.getElementsByClassName("livechatbtn"); +var btnWhatsapp = document?.getElementsByClassName("whatsapp_chat"); +var btnTradershub = document?.getElementsByClassName("tradershub-btn"); +var btnTryFreeDemo = document.querySelectorAll(".btn-free-demo .w-button"); +var btnTryFreeDemoFooter = document.querySelectorAll( + '.btn-free-demo [data-class="w-button"]' +); + +const btnNavbarPrimary = document.querySelectorAll( + '[data-attributes="btn-primary-nav"]' +); +const btnLoginNavbar = document.querySelectorAll( + '[data-attributes="btn-secondary-nav"]' +); + +if (btnLiveChat) { + Array.from(btnLiveChat).forEach((button) => { + window.addClickListener(button, "ce_widget_usage_form", { + action: "click", + widget_name: "livechat", + }); + }); +} +if (btnWhatsapp) { + Array.from(btnWhatsapp).forEach((button) => { + window.addClickListener(button, "ce_widget_usage_form", { + action: "click", + widget_name: "whatsapp", + }); + }); +} +if (btnTradershub) { + Array.from(btnTradershub).forEach((button) => { + window.addClickListener(button, "ce_cta_clicks", { + action: "click", + cta_name: "Traders Hub", + }); + }); +} +if (btnTryFreeDemo) { + Array.from(btnTryFreeDemo).forEach((button) => { + window.addClickListener(button, "ce_cta_clicks", { + action: "click", + cta_name: "Try free demo", + }); + }); +} +if (btnTryFreeDemoFooter) { + Array.from(btnTryFreeDemoFooter).forEach((button) => { + window.addClickListener(button, "ce_cta_clicks", { + action: "click", + cta_name: "Try free demo", + }); + }); +} + +if (btnNavbarPrimary) { + Array.from(btnNavbarPrimary).forEach((button) => { + if (!button.classList.contains("tradershub-btn")) { + window.addClickListener(button, "ce_cta_clicks", { + action: "click", + cta_name: "Try free demo", + }); + } + }); +} + +if (btnLoginNavbar) { + Array.from(btnLoginNavbar).forEach((button) => { + window.addClickListener(button, "ce_cta_clicks", { + action: "click", + cta_name: "Login", + }); + }); +} + +const RUDDERSTACK_STAGING_KEY = "1lN3tsFD2nruGFgM5F074DC2hMB"; +const RUDDERSTACK_PRODUCTION_KEY = "1oV5agvlcnCZ6IH94wCKM1oR8Pd"; +const GB_STAGING_CLIENT_KEY = "sdk-9wuqJ1mlcQsSyZQ"; +const GB_STAGING_DECRYPTION_KEY = ""; +const GB_PROD_CLIENT_KEY = "sdk-UhZV3cNEg5nLNLNS"; +const GB_PROD_DECRYPTION_KEY = "nre64BV0dNIa44zW4tz5ow=="; +var GB_CLIENT_KEY, RUDDERSTACK_KEY, GB_DECRYPTION_KEY; +if ( + window.location.hostname === "deriv.com" || + window.location.hostname === "deriv.be" || + window.location.hostname === "deriv.me" +) { + GB_CLIENT_KEY = GB_PROD_CLIENT_KEY; + GB_DECRYPTION_KEY = GB_PROD_DECRYPTION_KEY; + RUDDERSTACK_KEY = RUDDERSTACK_PRODUCTION_KEY; +} else { + GB_CLIENT_KEY = GB_STAGING_CLIENT_KEY; + GB_DECRYPTION_KEY = GB_STAGING_DECRYPTION_KEY; + RUDDERSTACK_KEY = RUDDERSTACK_STAGING_KEY; +} +client_information = window.parseCookies( + document.cookie, + "client_information" +); +const clientInfo = client_information + ? JSON.parse(client_information) + : null; +const utm_data_string = window.parseCookies(document.cookie, "utm_data"); +const utm_data = utm_data_string ? JSON.parse(utm_data_string) : {}; +const { utm_source, utm_medium, utm_campaign } = utm_data; +const cookies = window.parseCookies(document.cookie, "signup_device"); +let signupDevice = null; +const isBrowser = () => typeof window !== "undefined"; +const getLanguage = () => + isBrowser() ? localStorage.getItem("i18n") || navigator.language : null; +if (cookies) { + signupDevice = JSON.parse(cookies)?.signup_device || null; +} +const initialiseConfig = { + growthbookKey: GB_CLIENT_KEY, + growthbookDecryptionKey: GB_DECRYPTION_KEY, + rudderstackKey: RUDDERSTACK_KEY, + growthbookOptions: { + navigate: (url) => window.location.replace(url), + antiFlicker: false, + navigateDelay: 0, + attributes: { + country: + window.parseCookies(document.cookie, "clients_country") || + window.parseCookies(document.cookie, "website_status"), + user_language: + window.parseCookies(document.cookie, "user_language") || + getLanguage(), + device_language: + window.parseCookies(document.cookie, "language") || " ", + device_type: signupDevice, + utm_source: utm_data?.["utm_source"], + utm_medium: utm_data?.["utm_medium"], + utm_campaign: utm_data?.["utm_campaign"], + is_authorised: !!window.parseCookies( + document.cookie, + "client_information" + ), + loggedIn: !!window.parseCookies( + document.cookie, + "client_information" + ), + url: window.location.href, + }, + }, +}; +try { + Analytics?.Analytics.initialise(initialiseConfig); + // Analytics?.Analytics?.getInstances()?.ab?.GrowthBook?.loadFeatures(); + const userId = clientInfo?.user_id + ? clientInfo?.user_id + : Analytics?.Analytics?.getInstances?.().tracking?.getAnonymousId(); + Analytics?.Analytics?.identifyEvent(userId); +} catch (error) { + console.error("Error during initialisation:", error); +} +// Analytics?.Analytics?.getInstances()?.ab?.GrowthBook?.loadFeatures(); +Analytics?.Analytics?.pageView(location.pathname, "Deriv.com"); +// Analytics?.Analytics?.getInstances()?.ab?.GrowthBook?.setURL(window.location.href) +window.useGrowthbookFeatureFlag = function ({ featureFlag }) { + let featureFlagValue = Analytics?.Analytics?.getFeatureValue(featureFlag); + function updateFeatureFlagValue() { + const value = Analytics?.Analytics?.getFeatureValue(featureFlag); + featureFlagValue = value; + } + Analytics?.Analytics?.getInstances()?.ab?.GrowthBook?.setRenderer( + updateFeatureFlagValue + ); + return featureFlagValue; +}; + +// + + + +// Parse the cookies to get the 'client_information' cookie value +const cookieValue = window.parseCookies(document.cookie, "client_information") + ? JSON.parse(window.parseCookies(document.cookie, "client_information")) + : null; + +// Hotjar integration +if (cookieValue?.loginid) { + window?.hj("identify", cookieValue.loginid, { + is_logged_in: !!window.parseCookies( + document.cookie, + "client_information" + ), + landing_company_shortcode: + cookieValue.landing_company_shortcode || "null", + }); +} + + + +const updateLinkHrefs = () => { + const featureFlagValue = Analytics?.Analytics?.getFeatureValue( + "trigger_os_signup_wf" + ); + const handleOutSystemsRedirection = () => { + const currentDomain = window.location.hostname; + let env; + if ( + currentDomain === "deriv.com" || + currentDomain === "deriv.be" || + currentDomain === "deriv.me" + ) { + env = "production"; + } else if (currentDomain === "staging.deriv.com") { + env = "staging"; + } else { + env = "development"; + } + switch (env) { + case "production": + return "https://hub.deriv.com/tradershub/signup"; + case "staging": + return "https://staging-hub.deriv.com/tradershub/signup"; + default: + return "https://dev-hub.deriv.com/tradershub/signup"; + } + }; + + function isSafari() { + const ua = navigator.userAgent.toLowerCase(); + return /safari/.test(ua) && !/chrome/.test(ua) && !/crios/.test(ua); + } + + function isIOS() { + const ua = navigator.userAgent.toLowerCase(); + return /ipad|iphone|ipod/.test(ua); + } + + const newHref = featureFlagValue + ? isIOS() || isSafari() + ? `https://${window.location.host}/signup` + : handleOutSystemsRedirection() + : `https://${window.location.host}/signup`; + + // Update href attributes + const mainSignupButton = document.getElementById("cta-home-btn-navbar"); + if (mainSignupButton) { + mainSignupButton.href = newHref; + } + + const signupButtons = document.querySelectorAll(".logged-out-btn"); + signupButtons?.forEach((btn) => { + if (btn?.href?.indexOf("/signup") > 0) { + btn.href = newHref; + } + }); + + const signupButtonsPlatforms = + document.querySelectorAll(".logged-out-btn a"); + signupButtonsPlatforms?.forEach((btn) => { + if (btn?.href?.indexOf("/signup") > 0) { + btn.href = newHref; + } + }); +}; + +Analytics?.Analytics?.getInstances() + ?.ab?.GrowthBook?.loadFeatures() + .then(() => { + if (window.location.href.indexOf("/partners") > -1 === false) { + updateLinkHrefs(); + } + }); diff --git a/src/temp-static.min.js b/src/temp-static.min.js index 46fc7c6..77d5b71 100644 --- a/src/temp-static.min.js +++ b/src/temp-static.min.js @@ -1 +1 @@ -import{initializeApp as e}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-app.js";import{getDatabase as o,ref as a,onValue as n}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-database.js";function i(e,o,a,n){let i="";if(a){let e=new Date;e.setTime(e.getTime()+24*a*60*60*1e3),i="; expires="+e.toUTCString()}document.cookie=n?e+"="+(o||"")+i+`;domain=${n};path=/`:e+"="+(o||"")+i+";path=/"}function t(e,o){const a={};return e.split(";").forEach((e=>{const[o,n]=e.split("=").map((e=>e.trim()));a[o]=decodeURIComponent(n)})),a[o]}function r(e){i("webflow-user-language",e,30)}function d(e){document.cookie=e+"=; Max-Age=-99999999;"}window.emailRegex=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,window.toggleErrorField=(e,o)=>{o?e.classList.remove("error-field"):e.classList.add("error-field")},window.disableButton=function(e){e.disabled=!0,e.style.opacity="0.5"},window.isEuRegion=function(e){const o=e.replace(/\/$/,"");return/^\/(?:[^\/]+\/)?eu(?:\/|$)/.test(o)},window.enableButton=function(e){e.disabled=!1,e.style.opacity="1"},window.getOauthUrl=function(){var e=window.location.href,o=new URL(e).hostname,a=["deriv.com","deriv.be","deriv.me"].find((e=>o.endsWith(e)));return a?`https://oauth.${a}`:"https://oauth.deriv.com"},window.getClientCountry=function(){var e;const o=t(document.cookie,"clients_country"),a=t(document.cookie,"client_information");return a&&(null==(e=JSON.parse(a))?void 0:e.residence)||o},window.deriv_com_url="deriv.com",window.deriv_me_url="deriv.me",window.deriv_be_url="deriv.be",window.webflow_domain="webflow.deriv.com",window.staging_url="staging.deriv.com",window.staging_deriv_be_url="staging.deriv.be",window.domain_list_app_id={[window.deriv_com_url]:"16929",[window.deriv_me_url]:"1411",[window.deriv_be_url]:"30767",[window.webflow_domain]:"53503",[window.staging_url]:"16303"},window.getDomain=()=>{var e=window.location.href;return new URL(e).hostname},window.getAppId=()=>{const e=window.getDomain(),o=new URLSearchParams(window.location.search||"").get("app_id");if(o)return o;const a=localStorage.getItem("config.app_id");if(a)return a;const n={[window.webflow_domain]:window.domain_list_app_id[window.webflow_domain],[window.deriv_be_url]:window.domain_list_app_id[window.deriv_be_url],[window.deriv_me_url]:window.domain_list_app_id[window.deriv_me_url],[window.staging_url]:window.domain_list_app_id[window.staging_url]};return n[e]?n[e]:window.domain_list_app_id[window.deriv_com_url]};const s=()=>{const e=localStorage.getItem("config.server_url"),o=t(document.cookie,"webflow-user-language");let a=o?o.toLowerCase():"en";"zh-cn"!==a&&"zh-tw"!==a||(a=a.replace("-","_"));const n=(e=>{let o="";return e&&Object.keys(e).forEach((a=>{o+=`&${a}=${e[a]}`})),o})((()=>{const e=t(document.cookie,"utm_data");if(e){const o=JSON.parse(e),a={};return["utm_source","utm_ad_id","utm_adgroup_id","utm_adrollclk_id","utm_campaign","utm_campaign_id","utm_content","utm_fbcl_id","utm_gl_client_id","utm_medium","utm_msclk_id","utm_term"].forEach((e=>{o.hasOwnProperty(e)&&(a[e]=o[e])})),a}return null})()),i=t(document.cookie,"affiliate_tracking"),r=i?`&affiliate_token=${i}`:"",d=void["mt5","bot","derivx"].filter((e=>window.location.pathname.includes(e)&&e))||"";return e&&/qa/.test(e)?`https://${e}/oauth2/authorize?app_id=${window.getAppId()}&l=${a}&brand=deriv${r}${n}&platform=${d}`:`${window.getOauthUrl()}/oauth2/authorize?app_id=${(()=>{const e=window.getDomain();return e===window.deriv_me_url?window.domain_list_app_id[window.deriv_me_url]:e===window.deriv_be_url?window.domain_list_app_id[window.deriv_be_url]:e===window.webflow_domain?window.domain_list_app_id[window.webflow_domain]:window.domain_list_app_id[window.deriv_com_url]})()}&l=${a}&brand=deriv${r}${n}&platform=${d}`};if(!!!t(document.cookie,"client_information")){var c=document.createElement("iframe");c.src=(()=>{const e=window.location.hostname;let o;switch(o="deriv.com"===e||"deriv.be"===e||"deriv.me"===e?"production":"staging.deriv.com"===e?"staging":"development",o){case"production":return"https://hub.deriv.com/tradershub/signup";case"staging":return"https://staging-hub.deriv.com/tradershub/signup";default:return"https://dev-hub.deriv.com/tradershub/signup"}})(),c.style.width="0",c.style.height="0",c.style.border="none",c.style.visibility="hidden",c.setAttribute("sandbox","allow-same-origin allow-scripts"),document.body.appendChild(c)}window.establishWebSocketConnection=()=>new Promise(((e,o)=>{const a=t(document.cookie,"webflow-user-language"),n=a?a.toLowerCase():"en",i=localStorage.getItem("config.server_url")||"green.derivws.com";window.websocket=new WebSocket(`wss://${i}/websockets/v3?app_id=${window.getAppId()}&l=${n||"en"}&brand=deriv`),window.websocket.addEventListener("open",(o=>{window.websocket.addEventListener("close",(()=>{window.websocket.close()})),window.websocket.addEventListener("message",(e=>{JSON.parse(e.data)})),e(window.websocket)})),window.websocket.addEventListener("error",(e=>{var a;null==(a=null==window?void 0:window.websocket)||a.close(),o(e)}))})),window.socketMessageSend=async(e,o)=>{var a;try{return(null==window?void 0:window.websocket)&&(null==(a=null==window?void 0:window.websocket)?void 0:a.readyState)===(null==WebSocket?void 0:WebSocket.OPEN)?(window.websocket.send(e),new Promise(((e,a)=>{window.websocket.addEventListener("message",(n=>{const i=JSON.parse(n.data);o===i.msg_type&&(i.error?a(i.error):e(i))}))}))):establishWebSocketConnection().then((()=>(websocket.send(e),new Promise(((e,a)=>{websocket.addEventListener("message",(n=>{const i=JSON.parse(n.data);o===i.msg_type&&(i.error?a(i.error):e(i))}))}))))).catch((e=>Promise.reject(e)))}catch(n){return Promise.reject(n)}};const u=[{id:"appgallery",selectors:[".footer_banner-badge.gallery.w-inline-block",".app-download_link-wrapper.appgallery.w-inline-block"],countries:["af","ax","al","dz","as","ad","ao","aq","am","au","at","az","bh","bd","by","be","bj","bm","bt","bo","ba","bw","bv","br","io","bn","bg","bf","bi","kh","cm","ca","cv","bq","cf","td","cn","cx","cc","km","cg","cd","ck","ci","hr","cu","cw","cy","cz","dk","dj","dm","eg","gq","er","ee","et","fk","fo","fj","fi","fr","pf","tf","ga","gm","ge","de","gh","gi","gr","gl","gu","gg","gn","gw","hm","va","hu","is","in","id","ir","iq","ie","im","il","it","jp","je","jo","kz","ke","ki","kr","kp","kw","kg","la","lv","lb","ls","lr","ly","li","lt","lu","mo","mk","mg","mw","my","mv","ml","mt","mh","mr","mu","yt","mx","fm","md","mc","mn","me","ma","mz","mm","na","nr","np","nl","nc","nz","ne","ng","nu","nf","mp","no","om","pk","pw","ps","pg","pe","ph","pn","pl","pt","qa","re","ro","ru","rw","sh","kn","pm","bl","mf","ws","sm","st","sa","sn","rs","sc","sl","sg","sx","sk","si","sb","so","gs","ss","es","lk","sd","sj","sz","se","ch","sy","tw","tj","tz","th","tl","tg","tk","to","tn","tr","tm","tc","tv","ug","ua","ae","gb","um","us","uz","vu","vi","wf","eh","ye","zm","zw"]},{id:"googlePlay",selectors:[".footer_banner-badge.google.w-inline-block",".app-download_link-wrapper.google.w-inline-block"],countries:["af","ax","as","ad","ai","aq","au","bb","bt","bv","io","bn","bi","ca","bq","cf","cx","cc","cg","cd","ck","cw","gq","et","fk","fo","gf","pf","tf","gl","gp","gu","gg","gy","hm","va","hk","ir","im","jp","je","ki","kp","ls","ly","mg","mw","mh","mq","mr","yt","fm","mn","me","ms","nr","nc","nz","ng","nu","nf","mp","pw","ps","pn","pr","re","sh","kn","lc","pm","vc","bl","mf","st","sg","sx","gs","ss","sj","sz","sy","tl","tk","tc","tv","um","us","vg","vi","wf","eh"]},{id:"appstore",selectors:[".footer_banner-badge.store.w-inline-block",".app-download_link-wrapper.appstore.w-inline-block"],countries:["ax","al","as","ad","aq","aw","au","at","bd","be","bv","io","bg","bi","ca","bq","cf","cx","cc","km","ck","hr","cu","cw","cy","cz","dk","dj","gq","er","ee","et","fk","fo","fi","fr","gf","pf","tf","de","gi","gr","gl","gp","gu","gg","gn","ht","hm","va","hk","hu","is","ir","iq","ie","im","il","it","je","ki","kp","lv","ls","ly","li","lt","lu","mt","mh","mq","yt","fm","me","nl","nc","nz","ng","nu","nf","mp","no","ps","pn","pl","pt","pr","re","ro","sh","pm","bl","mf","ws","sm","sg","sx","sk","si","so","gs","ss","es","sd","sj","se","ch","sy","tw","tl","tg","tk","tr","tv","gb","um","us","vu","vi","wf","eh"]},{id:"p2p",selectors:["#p2payment.accordion_toggle-block","#p2component.section_dp2p","#card_block_p2p.help_category"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"w-dyn-item-p2p",selectors:["div.w-dyn-item"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"hideRow",selectors:["#footer_social-icons_row","#footer_text_row",".footer_risk-warning.w-richtext"],countries:["br","uy","lk","ch","za","ec"]},{id:"hideDiel",selectors:["#footer_text_diel","#footer_social-icons_diel"],countries:["br","uy","lk","ch","za","ec"]}],l=[{id:"showElems",selectors:[".banner_disclaimer"],countries:["br","uy","lk","ch","za","ec"]}],p=()=>{const e=window.getClientCountry();u.forEach((o=>{const a="hideDiel"===o.id?!o.countries.includes(e):o.countries.includes(e);if(e&&a)return o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((e=>{if(e)if("w-dyn-item-p2p"===o.id){e.querySelector("#card_block_p2p.help_category")&&(e.style.display="none")}else e.style.display="none"}))}));if(!a){const e=document.querySelector(".footer_social-icons.diel");e&&(e.style.display="flex")}})),l.forEach((o=>{e&&o.countries.includes(e)?o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{if(o){const a=document.querySelector(".page-wrapper");".banner_disclaimer"===e?(a.classList.add("disclaimer-show"),o.classList.remove("hide-element")):o.style.display="block"}}))})):o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{o&&(".banner_disclaimer"===e?o.classList.add("hide-element"):o.style.display="none")}))}))}))},w=JSON.stringify({website_status:1});!async function(){try{const e=await fetch("https://www.cloudflare.com/cdn-cgi/trace"),o=await e.text(),a=Object.fromEntries(o.split("\n").map((e=>e.split("=",2)))).loc.toLowerCase();a!==t(document.cookie,"clients_country")&&(d("clients_country"),i("clients_country",a,30)),p()}catch(e){p()}}();t(document.cookie,"clients_country")||window.socketMessageSend(w,"website_status").then((e=>{t(document.cookie,"clients_country")!==e.website_status.clients_country&&(d("clients_country"),i("clients_country",e.website_status.clients_country,30)),p()})).catch((e=>{}));const h=["ar","bn","de","en","es","fr","it","ko","pl","pt","ru","si","sw","th","tr","vi","zh_cn","zh_tw","zh-cn","zh-tw"];(()=>{var e;const o=window.location.pathname,a=window.location.hash,n=window.location.search,i=o.split("/"),d=i[1],s=h.includes(d||""),c=i.includes("careers")||i.includes("locations")||i.includes("derivtech")||i.includes("derivlife")||i.includes("eu-careers")||i.includes("our-locations");s&&r(d);const u=(null==(e=t(document.cookie,"webflow-user-language"))?void 0:e.toLowerCase())||"en",l=s?d:u;if((s||"en"!==u)&&d!==u)if(s&&d!==u)r(l);else if(!c){const e=(s?i.map((e=>e===d?l:e)).join("/"):l+i.join("/"))+n+a;window.location.href="/"+e}})();const N=function(){let e,o=!1,a=!1;const n=()=>{a=!0,o=!!t(document.cookie,"client_information"),o&&clearInterval(e),document.dispatchEvent(new Event("authStatusChange"))};return n(),e=setInterval(n,800),{getLoggedInStatus:()=>o,getAuthCheckedStatus:()=>a,onAuthStatusChange:e=>document.addEventListener("authStatusChange",e)}}();N.onAuthStatusChange((()=>{if(N.getAuthCheckedStatus()&&N.getLoggedInStatus()){document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.add("hide-element")}))}else if(N.getAuthCheckedStatus()&&!N.getLoggedInStatus()){document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.add("hide-element")}))}}));const y=window.location.href;if(["help-centre"].some((e=>y.includes(e)))){const e=new URL(y).searchParams;e.has("platform")&&"derivgo"===e.get("platform")&&(m=".derivgo-query-element",document.querySelectorAll(m).forEach((e=>{e.style.display="none"})))}var m;const Y=document.querySelector(".banner_disclaimer"),g=document.querySelector(".main-wrapper");if(Y){new ResizeObserver((e=>{for(let o of e)if(o.target===Y){let e=o.target.getBoundingClientRect();g&&(g.style.paddingTop=e.height+"px")}})).observe(Y)}window.addEventListener("pageshow",(function(e){if(e.persisted){const e=document.querySelector(".w-nav-overlay");e&&(e.style.display="none",document.querySelector("body").click())}}));const A=o(e({databaseURL:window.location.hostname.includes("staging")?"https://app-config-staging.firebaseio.com":"https://app-config-prod.firebaseio.com"}));let f=!1,b=!1;!function(){var e;const o=document.getElementById("live_chat-wrapper");try{const e=a(A,"remote_config/deriv-com/chat");n(e,(e=>{const a=e.val();f=a.live_chat,b=a.whatsapp_chat;const n=document.querySelector(".whatsapp_chat"),i=document.querySelector(".livechatbtn");n&&(n.style.visibility=b?"visible":"hidden"),i&&(i.style.visibility=f?"visible":"hidden");if(window.location.pathname.includes("/help-centre")){const e=document.querySelectorAll(".livechatbtn");f?e.forEach((e=>{e.style.visibility="visible"})):e.forEach((e=>{e.style.visibility="hidden"}));const o=document.querySelectorAll(".whatsapp_chat");b?o.forEach((e=>{e.style.visibility="visible"})):o.forEach((e=>{e.style.visibility="hidden"}))}window.addEventListener("scroll",(function(){var e,a;(f||b)&&(null==(e=null==o?void 0:o.classList)||e.remove("hide-element")),f||b||null==(a=null==o?void 0:o.classList)||a.add("hide-element")}))}),(e=>{var a;null==(a=null==o?void 0:o.classList)||a.remove("hide-element")}))}catch(i){null==(e=null==o?void 0:o.classList)||e.remove("hide-element")}}();new MutationObserver((function(e){for(const o of e)if(o.addedNodes.length)for(const e of o.addedNodes)e.nodeType===Node.ELEMENT_NODE&&"chat-widget-minimized"===e.id&&(e.style.opacity="0")})).observe(document.body,{childList:!0,subtree:!0});const v=window.getClientCountry();const _=[{country:"af",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"ax",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"al",apple:"No",android:"Yes",huawei:"No"},{country:"dz",apple:"Yes",android:"Yes",huawei:"No"},{country:"as",apple:"N/A",android:"No",huawei:"N/A"},{country:"ad",apple:"N/A",android:"N/A",huawei:"No"},{country:"ao",apple:"Yes",android:"Yes",huawei:"No"},{country:"ai",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"aq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ag",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ar",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"am",apple:"Yes",android:"Yes",huawei:"No"},{country:"aw",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"au",apple:"No",android:"No",huawei:"No"},{country:"at",apple:"No",android:"Yes",huawei:"No"},{country:"az",apple:"Yes",android:"Yes",huawei:"No"},{country:"bs",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bh",apple:"Yes",android:"Yes",huawei:"No"},{country:"bd",apple:"N/A",android:"Yes",huawei:"No"},{country:"bb",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"by",apple:"Yes",android:"Yes",huawei:"No"},{country:"be",apple:"No",android:"Yes",huawei:"No"},{country:"bz",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bj",apple:"Yes",android:"Yes",huawei:"No"},{country:"bm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"bt",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"bo",apple:"Yes",android:"Yes",huawei:"No"},{country:"ba",apple:"Yes",android:"Yes",huawei:"No"},{country:"bw",apple:"Yes",android:"Yes",huawei:"No"},{country:"bv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"br",apple:"Yes",android:"Yes",huawei:"No"},{country:"io",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"bn",apple:"Yes",android:"N/A",huawei:"No"},{country:"bg",apple:"No",android:"Yes",huawei:"No"},{country:"bf",apple:"Yes",android:"Yes",huawei:"No"},{country:"bi",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kh",apple:"Yes",android:"Yes",huawei:"No"},{country:"cm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ca",apple:"No",android:"No",huawei:"No"},{country:"cv",apple:"Yes",android:"Yes",huawei:"No"},{country:"bq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ky",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cf",apple:"N/A",android:"N/A",huawei:"No"},{country:"td",apple:"Yes",android:"Yes",huawei:"No"},{country:"cl",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cn",apple:"Yes",android:"Yes",huawei:"No"},{country:"cx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"co",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"km",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cg",apple:"Yes",android:"N/A",huawei:"No"},{country:"cd",apple:"Yes",android:"N/A",huawei:"No"},{country:"ck",apple:"N/A",android:"N/A",huawei:"No"},{country:"cr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ci",apple:"Yes",android:"Yes",huawei:"No"},{country:"hr",apple:"No",android:"Yes",huawei:"No"},{country:"cu",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cw",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cy",apple:"No",android:"Yes",huawei:"No"},{country:"cz",apple:"No",android:"Yes",huawei:"No"},{country:"dk",apple:"No",android:"Yes",huawei:"No"},{country:"dj",apple:"N/A",android:"Yes",huawei:"No"},{country:"dm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"do",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ec",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"eg",apple:"Yes",android:"Yes",huawei:"No"},{country:"sv",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gq",apple:"N/A",android:"N/A",huawei:"No"},{country:"er",apple:"N/A",android:"Yes",huawei:"No"},{country:"ee",apple:"No",android:"Yes",huawei:"No"},{country:"et",apple:"N/A",android:"N/A",huawei:"No"},{country:"fk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"fo",apple:"N/A",android:"N/A",huawei:"No"},{country:"fj",apple:"Yes",android:"Yes",huawei:"No"},{country:"fi",apple:"No",android:"Yes",huawei:"No"},{country:"fr",apple:"No",android:"Yes",huawei:"No"},{country:"gf",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"pf",apple:"N/A",android:"N/A",huawei:"No"},{country:"tf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ga",apple:"Yes",android:"Yes",huawei:"No"},{country:"gm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ge",apple:"Yes",android:"Yes",huawei:"No"},{country:"de",apple:"No",android:"Yes",huawei:"No"},{country:"gh",apple:"Yes",android:"Yes",huawei:"No"},{country:"gi",apple:"N/A",android:"Yes",huawei:"No"},{country:"gr",apple:"No",android:"Yes",huawei:"No"},{country:"gl",apple:"N/A",android:"N/A",huawei:"No"},{country:"gd",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gp",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"gu",apple:"N/A",android:"No",huawei:"N/A"},{country:"gt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gg",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"gn",apple:"N/A",android:"Yes",huawei:"No"},{country:"gw",apple:"Yes",android:"Yes",huawei:"No"},{country:"gy",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ht",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"hm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"va",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"hn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"hk",apple:"No",android:"No",huawei:"Yes"},{country:"hu",apple:"No",android:"Yes",huawei:"No"},{country:"is",apple:"No",android:"Yes",huawei:"No"},{country:"in",apple:"Yes",android:"Yes",huawei:"No"},{country:"id",apple:"Yes",android:"Yes",huawei:"No"},{country:"ir",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"iq",apple:"No",android:"Yes",huawei:"N/A"},{country:"ie",apple:"No",android:"Yes",huawei:"No"},{country:"im",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"il",apple:"No",android:"Yes",huawei:"No"},{country:"it",apple:"No",android:"Yes",huawei:"No"},{country:"jm",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"jp",apple:"Yes",android:"No",huawei:"No"},{country:"je",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"jo",apple:"Yes",android:"Yes",huawei:"No"},{country:"kz",apple:"Yes",android:"Yes",huawei:"No"},{country:"ke",apple:"Yes",android:"Yes",huawei:"No"},{country:"ki",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kr",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"kp",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kw",apple:"Yes",android:"Yes",huawei:"No"},{country:"kg",apple:"Yes",android:"Yes",huawei:"No"},{country:"la",apple:"Yes",android:"Yes",huawei:"No"},{country:"lv",apple:"No",android:"Yes",huawei:"No"},{country:"lb",apple:"Yes",android:"Yes",huawei:"No"},{country:"ls",apple:"N/A",android:"N/A",huawei:"No"},{country:"lr",apple:"Yes",android:"Yes",huawei:"No"},{country:"ly",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"li",apple:"N/A",android:"Yes",huawei:"No"},{country:"lt",apple:"No",android:"Yes",huawei:"No"},{country:"lu",apple:"No",android:"Yes",huawei:"No"},{country:"mo",apple:"Yes",android:"Yes",huawei:"No"},{country:"mk",apple:"Yes",android:"Yes",huawei:"No"},{country:"mg",apple:"Yes",android:"N/A",huawei:"No"},{country:"mw",apple:"Yes",android:"N/A",huawei:"No"},{country:"my",apple:"Yes",android:"Yes",huawei:"No"},{country:"mv",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"ml",apple:"Yes",android:"Yes",huawei:"No"},{country:"mt",apple:"No",android:"Yes",huawei:"No"},{country:"mh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mq",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"mr",apple:"Yes",android:"N/A",huawei:"No"},{country:"mu",apple:"Yes",android:"Yes",huawei:"No"},{country:"yt",apple:"N/A",android:"N/A",huawei:"No"},{country:"mx",apple:"Yes",android:"Yes",huawei:"No"},{country:"fm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"md",apple:"Yes",android:"Yes",huawei:"No"},{country:"mc",apple:"Yes",android:"Yes",huawei:"No"},{country:"mn",apple:"Yes",android:"N/A",huawei:"No"},{country:"me",apple:"No",android:"N/A",huawei:"No"},{country:"ms",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ma",apple:"Yes",android:"Yes",huawei:"No"},{country:"mz",apple:"Yes",android:"Yes",huawei:"No"},{country:"mm",apple:"Yes",android:"Yes",huawei:"No"},{country:"na",apple:"Yes",android:"Yes",huawei:"No"},{country:"nr",apple:"Yes",android:"N/A",huawei:"No"},{country:"np",apple:"Yes",android:"Yes",huawei:"No"},{country:"nl",apple:"No",android:"Yes",huawei:"No"},{country:"nc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nz",apple:"No",android:"No",huawei:"No"},{country:"ni",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ne",apple:"Yes",android:"Yes",huawei:"No"},{country:"ng",apple:"No",android:"No",huawei:"No"},{country:"nu",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mp",apple:"N/A",android:"No",huawei:"N/A"},{country:"no",apple:"No",android:"Yes",huawei:"No"},{country:"om",apple:"Yes",android:"Yes",huawei:"No"},{country:"pk",apple:"Yes",android:"Yes",huawei:"No"},{country:"pw",apple:"Yes",android:"No",huawei:"N/A"},{country:"ps",apple:"N/A",android:"N/A",huawei:"No"},{country:"pa",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pg",apple:"Yes",android:"Yes",huawei:"No"},{country:"py",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pe",apple:"Yes",android:"Yes",huawei:"No"},{country:"ph",apple:"Yes",android:"Yes",huawei:"No"},{country:"pn",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"pl",apple:"No",android:"Yes",huawei:"No"},{country:"pt",apple:"No",android:"Yes",huawei:"No"},{country:"pr",apple:"N/A",android:"No",huawei:"Yes"},{country:"qa",apple:"Yes",android:"Yes",huawei:"No"},{country:"re",apple:"N/A",android:"N/A",huawei:"No"},{country:"ro",apple:"No",android:"Yes",huawei:"No"},{country:"ru",apple:"Yes",android:"Yes",huawei:"No"},{country:"rw",apple:"Yes",android:"Yes",huawei:"No"},{country:"sh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kn",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"lc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"pm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"vc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"bl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ws",apple:"N/A",android:"Yes",huawei:"No"},{country:"sm",apple:"N/A",android:"Yes",huawei:"No"},{country:"st",apple:"Yes",android:"N/A",huawei:"No"},{country:"sa",apple:"Yes",android:"Yes",huawei:"No"},{country:"sn",apple:"Yes",android:"Yes",huawei:"No"},{country:"rs",apple:"Yes",android:"Yes",huawei:"No"},{country:"sc",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"sl",apple:"Yes",android:"Yes",huawei:"No"},{country:"sg",apple:"No",android:"No",huawei:"No"},{country:"sx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sk",apple:"No",android:"Yes",huawei:"No"},{country:"si",apple:"No",android:"Yes",huawei:"No"},{country:"sb",apple:"Yes",android:"Yes",huawei:"No"},{country:"so",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"za",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gs",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ss",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"es",apple:"No",android:"Yes",huawei:"No"},{country:"lk",apple:"Yes",android:"Yes",huawei:"No"},{country:"sd",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"sr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"sj",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sz",apple:"Yes",android:"N/A",huawei:"No"},{country:"se",apple:"No",android:"Yes",huawei:"No"},{country:"ch",apple:"No",android:"Yes",huawei:"No"},{country:"sy",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tw",apple:"No",android:"Yes",huawei:"No"},{country:"tj",apple:"Yes",android:"Yes",huawei:"No"},{country:"tz",apple:"Yes",android:"Yes",huawei:"No"},{country:"th",apple:"Yes",android:"Yes",huawei:"No"},{country:"tl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tg",apple:"N/A",android:"Yes",huawei:"No"},{country:"tk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"to",apple:"Yes",android:"Yes",huawei:"No"},{country:"tt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"tn",apple:"Yes",android:"Yes",huawei:"No"},{country:"tr",apple:"No",android:"Yes",huawei:"No"},{country:"tm",apple:"Yes",android:"Yes",huawei:"No"},{country:"tc",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"tv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ug",apple:"Yes",android:"Yes",huawei:"No"},{country:"ua",apple:"Yes",android:"Yes",huawei:"No"},{country:"ae",apple:"Yes",android:"Yes",huawei:"No"},{country:"gb",apple:"No",android:"Yes",huawei:"No"},{country:"um",apple:"N/A",android:"No",huawei:"N/A"},{country:"us",apple:"No",android:"No",huawei:"N/A"},{country:"uy",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"uz",apple:"Yes",android:"Yes",huawei:"No"},{country:"vu",apple:"No",android:"Yes",huawei:"N/A"},{country:"ve",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vg",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"vi",apple:"N/A",android:"No",huawei:"N/A"},{country:"wf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"eh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ye",apple:"Yes",android:"Yes",huawei:"No"},{country:"zm",apple:"Yes",android:"Yes",huawei:"No"},{country:"zw",apple:"Yes",android:"Yes",huawei:"No"}].find((e=>e.country===v)),k=_?function(e){const{apple:o,android:a,huawei:n}=e;return"Yes"===o&&"Yes"===a&&"Yes"===n?"Android, iOS & Huawei":"Yes"===o&&"Yes"===a&&"Yes"!==n?"Android, and iOS":"Yes"===o&&"Yes"===n&&"Yes"!==a?"iOS, and Huawei":"Yes"===a&&"Yes"!==o&&"Yes"!==n?"Android":"Yes"===o&&"Yes"===n&&"Yes"!==a?"iOS, and Huawei":"Yes"===o&&"Yes"!==a&&"Yes"!==n?"iOS":"Yes"!==o&&"Yes"!==a&&"Yes"===n?"Huawei":""}(_):"",E=document.getElementById("app-download-heading");E&&(E.innerText=k);const S=document.querySelector(".redirection_background-wrapper"),L=document.getElementById("cancel-redirect"),q=document.getElementById("proceed-redirect");if(window.isEuRegion(window.location.pathname)&&S&&L&&q){const e=["deriv.me","deriv.be","deriv.com","app.deriv.me","app.deriv.be","app.deriv.com","docs.deriv.com","community.deriv.com","deriv.statuspage.io","signup.deriv.com","login.deriv.com","api.deriv.com"];let o="",a="_self";document.querySelectorAll("a").forEach((function(n){const i=new URL(n.href,window.location.href),t=new URL(window.location.href);e.includes(i.host)||i.host===t.host||n.addEventListener("click",(function(e){e.preventDefault(),o=i.href,a=n.target||"_self",S.classList.remove("hide-element"),document.body.style.overflow="hidden"}))})),L.addEventListener("click",(function(){S.classList.add("hide-element"),document.body.style.overflow="auto",o=""})),q.addEventListener("click",(function(){o&&(window.open(o,a),o="",S.classList.add("hide-element"),document.body.style.overflow="auto")}))}document.querySelector(".banner_disclaimer")?document.body.classList.add("disclaimer-visible"):document.body.classList.remove("disclaimer-visible");const z=document.querySelectorAll(".navbar_accordion-item");function j(){const e=document.querySelector(".navbar_accordion-trigger.open");e&&e.scrollIntoView({behavior:"smooth",block:"start"})}z.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.overflow="hidden",o.style.transition="max-height 0.3s ease-in, opacity 0.3s ease-in",o.style.opacity="0"})),z.forEach((e=>{const o=e.querySelector(".navbar_accordion-trigger");o.addEventListener("click",(function(){const e=o.classList.contains("open");if(z.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.opacity="0"})),!e){o.classList.add("open");const e=o.nextElementSibling;e.classList.add("open"),e.style.maxHeight=e.scrollHeight+"px",e.style.opacity="1"}}))}));document.querySelectorAll(".navbar_accordion-trigger").forEach((e=>{e.addEventListener("click",(function(){setTimeout(j,300)}))}));const x=new MutationObserver((e=>{e.forEach((e=>{if("class"===e.attributeName){const o=e.target;o.classList.contains("open")&&o.scrollIntoView({behavior:"smooth",block:"start"})}}))}));document.querySelectorAll(".navbar_accordion-item").forEach((e=>{x.observe(e,{attributes:!0})}));const C=new URL(window.location.href),$=new URLSearchParams(C.search),I=$.get("t");if($.has("referrer")&&null!=I){t(document.cookie,"referrer_token")!==I&&(d("referrer_token"),i("referrer_token",I,365,".deriv.com"))}const O=document.getElementById("navbar-home_login");O&&O.addEventListener("click",(function(e){e.preventDefault(),window.location.href=s()}));const R=document.getElementById("res-navbar-home_login");R&&R.addEventListener("click",(function(e){e.preventDefault(),window.location.href=s()}));const U=document.getElementById("white-navbar_login");U&&U.addEventListener("click",(function(e){e.preventDefault(),window.location.href=s()}));const D=document.getElementById("res-white-navbar_login");D&&D.addEventListener("click",(function(e){e.preventDefault(),window.location.href=s()})),window.customLoader="Minimal Migration"; +var e,o,n,i,t,a,r,d,c,s;import{initializeApp as l}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-app.js";import{getDatabase as u,ref as p,onValue as w}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-database.js";function h(e,o,n,i){let t="";if(n){let e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),t="; expires="+e.toUTCString()}document.cookie=i?e+"="+(o||"")+t+`;domain=${i};path=/`:e+"="+(o||"")+t+";path=/"}function m(e,o){const n={};return e.split(";").forEach((e=>{const[o,i]=e.split("=").map((e=>e.trim()));n[o]=decodeURIComponent(i)})),n[o]}function y(e){h("webflow-user-language",e,30)}function N(e){document.cookie=e+"=; Max-Age=-99999999;"}window.emailRegex=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,window.toggleErrorField=(e,o)=>{o?e.classList.remove("error-field"):e.classList.add("error-field")},window.disableButton=function(e){e.disabled=!0,e.style.opacity="0.5"},window.isEuRegion=function(e){const o=e.replace(/\/$/,"");return/^\/(?:[^\/]+\/)?eu(?:\/|$)/.test(o)},window.enableButton=function(e){e.disabled=!1,e.style.opacity="1"},window.getOauthUrl=function(){var e=window.location.href,o=new URL(e).hostname,n=["deriv.com","deriv.be","deriv.me"].find((e=>o.endsWith(e)));return n?`https://oauth.${n}`:"https://oauth.deriv.com"},window.getClientCountry=function(){var e;const o=m(document.cookie,"clients_country"),n=m(document.cookie,"client_information");return n&&(null==(e=JSON.parse(n))?void 0:e.residence)||o},window.deriv_com_url="deriv.com",window.deriv_me_url="deriv.me",window.deriv_be_url="deriv.be",window.webflow_domain="webflow.deriv.com",window.staging_url="staging.deriv.com",window.staging_deriv_be_url="staging.deriv.be",window.domain_list_app_id={[window.deriv_com_url]:"16929",[window.deriv_me_url]:"1411",[window.deriv_be_url]:"30767",[window.webflow_domain]:"53503",[window.staging_url]:"16303"},window.getDomain=()=>{var e=window.location.href;return new URL(e).hostname},window.getAppId=()=>{const e=window.getDomain(),o=new URLSearchParams(window.location.search||"").get("app_id");if(o)return o;const n=localStorage.getItem("config.app_id");if(n)return n;const i={[window.webflow_domain]:window.domain_list_app_id[window.webflow_domain],[window.deriv_be_url]:window.domain_list_app_id[window.deriv_be_url],[window.deriv_me_url]:window.domain_list_app_id[window.deriv_me_url],[window.staging_url]:window.domain_list_app_id[window.staging_url]};return i[e]?i[e]:window.domain_list_app_id[window.deriv_com_url]};const g=()=>{const e=localStorage.getItem("config.server_url"),o=m(document.cookie,"webflow-user-language");let n=o?o.toLowerCase():"en";"zh-cn"!==n&&"zh-tw"!==n||(n=n.replace("-","_"));const i=(e=>{let o="";return e&&Object.keys(e).forEach((n=>{o+=`&${n}=${e[n]}`})),o})((()=>{const e=m(document.cookie,"utm_data");if(e){const o=JSON.parse(e),n={};return["utm_source","utm_ad_id","utm_adgroup_id","utm_adrollclk_id","utm_campaign","utm_campaign_id","utm_content","utm_fbcl_id","utm_gl_client_id","utm_medium","utm_msclk_id","utm_term"].forEach((e=>{o.hasOwnProperty(e)&&(n[e]=o[e])})),n}return null})()),t=m(document.cookie,"affiliate_tracking"),a=t?`&affiliate_token=${t}`:"",r=void["mt5","bot","derivx"].filter((e=>window.location.pathname.includes(e)&&e))||"";return e&&/qa/.test(e)?`https://${e}/oauth2/authorize?app_id=${window.getAppId()}&l=${n}&brand=deriv${a}${i}&platform=${r}`:`${window.getOauthUrl()}/oauth2/authorize?app_id=${(()=>{const e=window.getDomain();return e===window.deriv_me_url?window.domain_list_app_id[window.deriv_me_url]:e===window.deriv_be_url?window.domain_list_app_id[window.deriv_be_url]:e===window.webflow_domain?window.domain_list_app_id[window.webflow_domain]:window.domain_list_app_id[window.deriv_com_url]})()}&l=${n}&brand=deriv${a}${i}&platform=${r}`};if(!!!m(document.cookie,"client_information")){var f=document.createElement("iframe");f.src=(()=>{const e=window.location.hostname;let o;switch(o="deriv.com"===e||"deriv.be"===e||"deriv.me"===e?"production":"staging.deriv.com"===e?"staging":"development",o){case"production":return"https://hub.deriv.com/tradershub/signup";case"staging":return"https://staging-hub.deriv.com/tradershub/signup";default:return"https://dev-hub.deriv.com/tradershub/signup"}})(),f.style.width="0",f.style.height="0",f.style.border="none",f.style.visibility="hidden",f.setAttribute("sandbox","allow-same-origin allow-scripts"),document.body.appendChild(f)}window.establishWebSocketConnection=()=>new Promise(((e,o)=>{const n=m(document.cookie,"webflow-user-language"),i=n?n.toLowerCase():"en",t=localStorage.getItem("config.server_url")||"green.derivws.com";window.websocket=new WebSocket(`wss://${t}/websockets/v3?app_id=${window.getAppId()}&l=${i||"en"}&brand=deriv`),window.websocket.addEventListener("open",(o=>{window.websocket.addEventListener("close",(()=>{window.websocket.close()})),window.websocket.addEventListener("message",(e=>{JSON.parse(e.data)})),e(window.websocket)})),window.websocket.addEventListener("error",(e=>{var n;null==(n=null==window?void 0:window.websocket)||n.close(),o(e)}))})),window.socketMessageSend=async(e,o)=>{var n;try{return(null==window?void 0:window.websocket)&&(null==(n=null==window?void 0:window.websocket)?void 0:n.readyState)===(null==WebSocket?void 0:WebSocket.OPEN)?(window.websocket.send(e),new Promise(((e,n)=>{window.websocket.addEventListener("message",(i=>{const t=JSON.parse(i.data);o===t.msg_type&&(t.error?n(t.error):e(t))}))}))):establishWebSocketConnection().then((()=>(websocket.send(e),new Promise(((e,n)=>{websocket.addEventListener("message",(i=>{const t=JSON.parse(i.data);o===t.msg_type&&(t.error?n(t.error):e(t))}))}))))).catch((e=>Promise.reject(e)))}catch(i){return Promise.reject(i)}};const v=[{id:"appgallery",selectors:[".footer_banner-badge.gallery.w-inline-block",".app-download_link-wrapper.appgallery.w-inline-block"],countries:["af","ax","al","dz","as","ad","ao","aq","am","au","at","az","bh","bd","by","be","bj","bm","bt","bo","ba","bw","bv","br","io","bn","bg","bf","bi","kh","cm","ca","cv","bq","cf","td","cn","cx","cc","km","cg","cd","ck","ci","hr","cu","cw","cy","cz","dk","dj","dm","eg","gq","er","ee","et","fk","fo","fj","fi","fr","pf","tf","ga","gm","ge","de","gh","gi","gr","gl","gu","gg","gn","gw","hm","va","hu","is","in","id","ir","iq","ie","im","il","it","jp","je","jo","kz","ke","ki","kr","kp","kw","kg","la","lv","lb","ls","lr","ly","li","lt","lu","mo","mk","mg","mw","my","mv","ml","mt","mh","mr","mu","yt","mx","fm","md","mc","mn","me","ma","mz","mm","na","nr","np","nl","nc","nz","ne","ng","nu","nf","mp","no","om","pk","pw","ps","pg","pe","ph","pn","pl","pt","qa","re","ro","ru","rw","sh","kn","pm","bl","mf","ws","sm","st","sa","sn","rs","sc","sl","sg","sx","sk","si","sb","so","gs","ss","es","lk","sd","sj","sz","se","ch","sy","tw","tj","tz","th","tl","tg","tk","to","tn","tr","tm","tc","tv","ug","ua","ae","gb","um","us","uz","vu","vi","wf","eh","ye","zm","zw"]},{id:"googlePlay",selectors:[".footer_banner-badge.google.w-inline-block",".app-download_link-wrapper.google.w-inline-block"],countries:["af","ax","as","ad","ai","aq","au","bb","bt","bv","io","bn","bi","ca","bq","cf","cx","cc","cg","cd","ck","cw","gq","et","fk","fo","gf","pf","tf","gl","gp","gu","gg","gy","hm","va","hk","ir","im","jp","je","ki","kp","ls","ly","mg","mw","mh","mq","mr","yt","fm","mn","me","ms","nr","nc","nz","ng","nu","nf","mp","pw","ps","pn","pr","re","sh","kn","lc","pm","vc","bl","mf","st","sg","sx","gs","ss","sj","sz","sy","tl","tk","tc","tv","um","us","vg","vi","wf","eh"]},{id:"appstore",selectors:[".footer_banner-badge.store.w-inline-block",".app-download_link-wrapper.appstore.w-inline-block"],countries:["ax","al","as","ad","aq","aw","au","at","bd","be","bv","io","bg","bi","ca","bq","cf","cx","cc","km","ck","hr","cu","cw","cy","cz","dk","dj","gq","er","ee","et","fk","fo","fi","fr","gf","pf","tf","de","gi","gr","gl","gp","gu","gg","gn","ht","hm","va","hk","hu","is","ir","iq","ie","im","il","it","je","ki","kp","lv","ls","ly","li","lt","lu","mt","mh","mq","yt","fm","me","nl","nc","nz","ng","nu","nf","mp","no","ps","pn","pl","pt","pr","re","ro","sh","pm","bl","mf","ws","sm","sg","sx","sk","si","so","gs","ss","es","sd","sj","se","ch","sy","tw","tl","tg","tk","tr","tv","gb","um","us","vu","vi","wf","eh"]},{id:"p2p",selectors:["#p2payment.accordion_toggle-block","#p2component.section_dp2p","#card_block_p2p.help_category"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"w-dyn-item-p2p",selectors:["div.w-dyn-item"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"hideRow",selectors:["#footer_social-icons_row","#footer_text_row",".footer_risk-warning.w-richtext"],countries:["br","uy","lk","ch","za","ec"]},{id:"hideDiel",selectors:["#footer_text_diel","#footer_social-icons_diel"],countries:["br","uy","lk","ch","za","ec"]}],Y=[{id:"showElems",selectors:[".banner_disclaimer"],countries:["br","uy","lk","ch","za","ec"]}],_=()=>{const e=window.getClientCountry();v.forEach((o=>{const n="hideDiel"===o.id?!o.countries.includes(e):o.countries.includes(e);if(e&&n)return o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((e=>{if(e)if("w-dyn-item-p2p"===o.id){e.querySelector("#card_block_p2p.help_category")&&(e.style.display="none")}else e.style.display="none"}))}));if(!n){const e=document.querySelector(".footer_social-icons.diel");e&&(e.style.display="flex")}})),Y.forEach((o=>{e&&o.countries.includes(e)?o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{if(o){const n=document.querySelector(".page-wrapper");".banner_disclaimer"===e?(n.classList.add("disclaimer-show"),o.classList.remove("hide-element")):o.style.display="block"}}))})):o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{o&&(".banner_disclaimer"===e?o.classList.add("hide-element"):o.style.display="none")}))}))}))},A=JSON.stringify({website_status:1});!async function(){try{const e=await fetch("https://www.cloudflare.com/cdn-cgi/trace"),o=await e.text(),n=Object.fromEntries(o.split("\n").map((e=>e.split("=",2)))).loc.toLowerCase();n!==m(document.cookie,"clients_country")&&(N("clients_country"),h("clients_country",n,30)),_()}catch(e){_()}}();m(document.cookie,"clients_country")||window.socketMessageSend(A,"website_status").then((e=>{m(document.cookie,"clients_country")!==e.website_status.clients_country&&(N("clients_country"),h("clients_country",e.website_status.clients_country,30)),_()})).catch((e=>{}));const b=["ar","bn","de","en","es","fr","it","ko","pl","pt","ru","si","sw","th","tr","vi","zh_cn","zh_tw","zh-cn","zh-tw"];(()=>{var e;const o=window.location.pathname,n=window.location.hash,i=window.location.search,t=o.split("/"),a=t[1],r=b.includes(a||""),d=t.includes("careers")||t.includes("locations")||t.includes("derivtech")||t.includes("derivlife")||t.includes("eu-careers")||t.includes("our-locations");r&&y(a);const c=(null==(e=m(document.cookie,"webflow-user-language"))?void 0:e.toLowerCase())||"en",s=r?a:c;if((r||"en"!==c)&&a!==c)if(r&&a!==c)y(s);else if(!d){const e=(r?t.map((e=>e===a?s:e)).join("/"):s+t.join("/"))+i+n;window.location.href="/"+e}})();const k=function(){let e,o=!1,n=!1;const i=()=>{n=!0,o=!!m(document.cookie,"client_information"),o&&clearInterval(e),document.dispatchEvent(new Event("authStatusChange"))};return i(),e=setInterval(i,800),{getLoggedInStatus:()=>o,getAuthCheckedStatus:()=>n,onAuthStatusChange:e=>document.addEventListener("authStatusChange",e)}}();k.onAuthStatusChange((()=>{if(k.getAuthCheckedStatus()&&k.getLoggedInStatus()){document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.add("hide-element")}))}else if(k.getAuthCheckedStatus()&&!k.getLoggedInStatus()){document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.add("hide-element")}))}}));const L=window.location.href;if(["help-centre"].some((e=>L.includes(e)))){const e=new URL(L).searchParams;e.has("platform")&&"derivgo"===e.get("platform")&&(S=".derivgo-query-element",document.querySelectorAll(S).forEach((e=>{e.style.display="none"})))}var S;const E=document.querySelector(".banner_disclaimer"),C=document.querySelector(".main-wrapper");if(E){new ResizeObserver((e=>{for(let o of e)if(o.target===E){let e=o.target.getBoundingClientRect();C&&(C.style.paddingTop=e.height+"px")}})).observe(E)}window.addEventListener("pageshow",(function(e){if(e.persisted){const e=document.querySelector(".w-nav-overlay");e&&(e.style.display="none",document.querySelector("body").click())}}));const q=u(l({databaseURL:window.location.hostname.includes("staging")?"https://app-config-staging.firebaseio.com":"https://app-config-prod.firebaseio.com"}));let I=!1,z=!1;!function(){var e;const o=document.getElementById("live_chat-wrapper");try{const e=p(q,"remote_config/deriv-com/chat");w(e,(e=>{const n=e.val();I=n.live_chat,z=n.whatsapp_chat;const i=document.querySelector(".whatsapp_chat"),t=document.querySelector(".livechatbtn");i&&(i.style.visibility=z?"visible":"hidden"),t&&(t.style.visibility=I?"visible":"hidden");if(window.location.pathname.includes("/help-centre")){const e=document.querySelectorAll(".livechatbtn");I?e.forEach((e=>{e.style.visibility="visible"})):e.forEach((e=>{e.style.visibility="hidden"}));const o=document.querySelectorAll(".whatsapp_chat");z?o.forEach((e=>{e.style.visibility="visible"})):o.forEach((e=>{e.style.visibility="hidden"}))}window.addEventListener("scroll",(function(){var e,n;(I||z)&&(null==(e=null==o?void 0:o.classList)||e.remove("hide-element")),I||z||null==(n=null==o?void 0:o.classList)||n.add("hide-element")}))}),(e=>{var n;null==(n=null==o?void 0:o.classList)||n.remove("hide-element")}))}catch(n){null==(e=null==o?void 0:o.classList)||e.remove("hide-element")}}();new MutationObserver((function(e){for(const o of e)if(o.addedNodes.length)for(const e of o.addedNodes)e.nodeType===Node.ELEMENT_NODE&&"chat-widget-minimized"===e.id&&(e.style.opacity="0")})).observe(document.body,{childList:!0,subtree:!0});const x=window.getClientCountry();const j=[{country:"af",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"ax",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"al",apple:"No",android:"Yes",huawei:"No"},{country:"dz",apple:"Yes",android:"Yes",huawei:"No"},{country:"as",apple:"N/A",android:"No",huawei:"N/A"},{country:"ad",apple:"N/A",android:"N/A",huawei:"No"},{country:"ao",apple:"Yes",android:"Yes",huawei:"No"},{country:"ai",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"aq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ag",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ar",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"am",apple:"Yes",android:"Yes",huawei:"No"},{country:"aw",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"au",apple:"No",android:"No",huawei:"No"},{country:"at",apple:"No",android:"Yes",huawei:"No"},{country:"az",apple:"Yes",android:"Yes",huawei:"No"},{country:"bs",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bh",apple:"Yes",android:"Yes",huawei:"No"},{country:"bd",apple:"N/A",android:"Yes",huawei:"No"},{country:"bb",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"by",apple:"Yes",android:"Yes",huawei:"No"},{country:"be",apple:"No",android:"Yes",huawei:"No"},{country:"bz",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bj",apple:"Yes",android:"Yes",huawei:"No"},{country:"bm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"bt",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"bo",apple:"Yes",android:"Yes",huawei:"No"},{country:"ba",apple:"Yes",android:"Yes",huawei:"No"},{country:"bw",apple:"Yes",android:"Yes",huawei:"No"},{country:"bv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"br",apple:"Yes",android:"Yes",huawei:"No"},{country:"io",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"bn",apple:"Yes",android:"N/A",huawei:"No"},{country:"bg",apple:"No",android:"Yes",huawei:"No"},{country:"bf",apple:"Yes",android:"Yes",huawei:"No"},{country:"bi",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kh",apple:"Yes",android:"Yes",huawei:"No"},{country:"cm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ca",apple:"No",android:"No",huawei:"No"},{country:"cv",apple:"Yes",android:"Yes",huawei:"No"},{country:"bq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ky",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cf",apple:"N/A",android:"N/A",huawei:"No"},{country:"td",apple:"Yes",android:"Yes",huawei:"No"},{country:"cl",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cn",apple:"Yes",android:"Yes",huawei:"No"},{country:"cx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"co",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"km",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cg",apple:"Yes",android:"N/A",huawei:"No"},{country:"cd",apple:"Yes",android:"N/A",huawei:"No"},{country:"ck",apple:"N/A",android:"N/A",huawei:"No"},{country:"cr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ci",apple:"Yes",android:"Yes",huawei:"No"},{country:"hr",apple:"No",android:"Yes",huawei:"No"},{country:"cu",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cw",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cy",apple:"No",android:"Yes",huawei:"No"},{country:"cz",apple:"No",android:"Yes",huawei:"No"},{country:"dk",apple:"No",android:"Yes",huawei:"No"},{country:"dj",apple:"N/A",android:"Yes",huawei:"No"},{country:"dm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"do",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ec",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"eg",apple:"Yes",android:"Yes",huawei:"No"},{country:"sv",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gq",apple:"N/A",android:"N/A",huawei:"No"},{country:"er",apple:"N/A",android:"Yes",huawei:"No"},{country:"ee",apple:"No",android:"Yes",huawei:"No"},{country:"et",apple:"N/A",android:"N/A",huawei:"No"},{country:"fk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"fo",apple:"N/A",android:"N/A",huawei:"No"},{country:"fj",apple:"Yes",android:"Yes",huawei:"No"},{country:"fi",apple:"No",android:"Yes",huawei:"No"},{country:"fr",apple:"No",android:"Yes",huawei:"No"},{country:"gf",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"pf",apple:"N/A",android:"N/A",huawei:"No"},{country:"tf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ga",apple:"Yes",android:"Yes",huawei:"No"},{country:"gm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ge",apple:"Yes",android:"Yes",huawei:"No"},{country:"de",apple:"No",android:"Yes",huawei:"No"},{country:"gh",apple:"Yes",android:"Yes",huawei:"No"},{country:"gi",apple:"N/A",android:"Yes",huawei:"No"},{country:"gr",apple:"No",android:"Yes",huawei:"No"},{country:"gl",apple:"N/A",android:"N/A",huawei:"No"},{country:"gd",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gp",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"gu",apple:"N/A",android:"No",huawei:"N/A"},{country:"gt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gg",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"gn",apple:"N/A",android:"Yes",huawei:"No"},{country:"gw",apple:"Yes",android:"Yes",huawei:"No"},{country:"gy",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ht",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"hm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"va",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"hn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"hk",apple:"No",android:"No",huawei:"Yes"},{country:"hu",apple:"No",android:"Yes",huawei:"No"},{country:"is",apple:"No",android:"Yes",huawei:"No"},{country:"in",apple:"Yes",android:"Yes",huawei:"No"},{country:"id",apple:"Yes",android:"Yes",huawei:"No"},{country:"ir",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"iq",apple:"No",android:"Yes",huawei:"N/A"},{country:"ie",apple:"No",android:"Yes",huawei:"No"},{country:"im",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"il",apple:"No",android:"Yes",huawei:"No"},{country:"it",apple:"No",android:"Yes",huawei:"No"},{country:"jm",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"jp",apple:"Yes",android:"No",huawei:"No"},{country:"je",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"jo",apple:"Yes",android:"Yes",huawei:"No"},{country:"kz",apple:"Yes",android:"Yes",huawei:"No"},{country:"ke",apple:"Yes",android:"Yes",huawei:"No"},{country:"ki",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kr",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"kp",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kw",apple:"Yes",android:"Yes",huawei:"No"},{country:"kg",apple:"Yes",android:"Yes",huawei:"No"},{country:"la",apple:"Yes",android:"Yes",huawei:"No"},{country:"lv",apple:"No",android:"Yes",huawei:"No"},{country:"lb",apple:"Yes",android:"Yes",huawei:"No"},{country:"ls",apple:"N/A",android:"N/A",huawei:"No"},{country:"lr",apple:"Yes",android:"Yes",huawei:"No"},{country:"ly",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"li",apple:"N/A",android:"Yes",huawei:"No"},{country:"lt",apple:"No",android:"Yes",huawei:"No"},{country:"lu",apple:"No",android:"Yes",huawei:"No"},{country:"mo",apple:"Yes",android:"Yes",huawei:"No"},{country:"mk",apple:"Yes",android:"Yes",huawei:"No"},{country:"mg",apple:"Yes",android:"N/A",huawei:"No"},{country:"mw",apple:"Yes",android:"N/A",huawei:"No"},{country:"my",apple:"Yes",android:"Yes",huawei:"No"},{country:"mv",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"ml",apple:"Yes",android:"Yes",huawei:"No"},{country:"mt",apple:"No",android:"Yes",huawei:"No"},{country:"mh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mq",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"mr",apple:"Yes",android:"N/A",huawei:"No"},{country:"mu",apple:"Yes",android:"Yes",huawei:"No"},{country:"yt",apple:"N/A",android:"N/A",huawei:"No"},{country:"mx",apple:"Yes",android:"Yes",huawei:"No"},{country:"fm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"md",apple:"Yes",android:"Yes",huawei:"No"},{country:"mc",apple:"Yes",android:"Yes",huawei:"No"},{country:"mn",apple:"Yes",android:"N/A",huawei:"No"},{country:"me",apple:"No",android:"N/A",huawei:"No"},{country:"ms",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ma",apple:"Yes",android:"Yes",huawei:"No"},{country:"mz",apple:"Yes",android:"Yes",huawei:"No"},{country:"mm",apple:"Yes",android:"Yes",huawei:"No"},{country:"na",apple:"Yes",android:"Yes",huawei:"No"},{country:"nr",apple:"Yes",android:"N/A",huawei:"No"},{country:"np",apple:"Yes",android:"Yes",huawei:"No"},{country:"nl",apple:"No",android:"Yes",huawei:"No"},{country:"nc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nz",apple:"No",android:"No",huawei:"No"},{country:"ni",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ne",apple:"Yes",android:"Yes",huawei:"No"},{country:"ng",apple:"No",android:"No",huawei:"No"},{country:"nu",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mp",apple:"N/A",android:"No",huawei:"N/A"},{country:"no",apple:"No",android:"Yes",huawei:"No"},{country:"om",apple:"Yes",android:"Yes",huawei:"No"},{country:"pk",apple:"Yes",android:"Yes",huawei:"No"},{country:"pw",apple:"Yes",android:"No",huawei:"N/A"},{country:"ps",apple:"N/A",android:"N/A",huawei:"No"},{country:"pa",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pg",apple:"Yes",android:"Yes",huawei:"No"},{country:"py",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pe",apple:"Yes",android:"Yes",huawei:"No"},{country:"ph",apple:"Yes",android:"Yes",huawei:"No"},{country:"pn",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"pl",apple:"No",android:"Yes",huawei:"No"},{country:"pt",apple:"No",android:"Yes",huawei:"No"},{country:"pr",apple:"N/A",android:"No",huawei:"Yes"},{country:"qa",apple:"Yes",android:"Yes",huawei:"No"},{country:"re",apple:"N/A",android:"N/A",huawei:"No"},{country:"ro",apple:"No",android:"Yes",huawei:"No"},{country:"ru",apple:"Yes",android:"Yes",huawei:"No"},{country:"rw",apple:"Yes",android:"Yes",huawei:"No"},{country:"sh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kn",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"lc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"pm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"vc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"bl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ws",apple:"N/A",android:"Yes",huawei:"No"},{country:"sm",apple:"N/A",android:"Yes",huawei:"No"},{country:"st",apple:"Yes",android:"N/A",huawei:"No"},{country:"sa",apple:"Yes",android:"Yes",huawei:"No"},{country:"sn",apple:"Yes",android:"Yes",huawei:"No"},{country:"rs",apple:"Yes",android:"Yes",huawei:"No"},{country:"sc",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"sl",apple:"Yes",android:"Yes",huawei:"No"},{country:"sg",apple:"No",android:"No",huawei:"No"},{country:"sx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sk",apple:"No",android:"Yes",huawei:"No"},{country:"si",apple:"No",android:"Yes",huawei:"No"},{country:"sb",apple:"Yes",android:"Yes",huawei:"No"},{country:"so",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"za",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gs",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ss",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"es",apple:"No",android:"Yes",huawei:"No"},{country:"lk",apple:"Yes",android:"Yes",huawei:"No"},{country:"sd",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"sr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"sj",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sz",apple:"Yes",android:"N/A",huawei:"No"},{country:"se",apple:"No",android:"Yes",huawei:"No"},{country:"ch",apple:"No",android:"Yes",huawei:"No"},{country:"sy",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tw",apple:"No",android:"Yes",huawei:"No"},{country:"tj",apple:"Yes",android:"Yes",huawei:"No"},{country:"tz",apple:"Yes",android:"Yes",huawei:"No"},{country:"th",apple:"Yes",android:"Yes",huawei:"No"},{country:"tl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tg",apple:"N/A",android:"Yes",huawei:"No"},{country:"tk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"to",apple:"Yes",android:"Yes",huawei:"No"},{country:"tt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"tn",apple:"Yes",android:"Yes",huawei:"No"},{country:"tr",apple:"No",android:"Yes",huawei:"No"},{country:"tm",apple:"Yes",android:"Yes",huawei:"No"},{country:"tc",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"tv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ug",apple:"Yes",android:"Yes",huawei:"No"},{country:"ua",apple:"Yes",android:"Yes",huawei:"No"},{country:"ae",apple:"Yes",android:"Yes",huawei:"No"},{country:"gb",apple:"No",android:"Yes",huawei:"No"},{country:"um",apple:"N/A",android:"No",huawei:"N/A"},{country:"us",apple:"No",android:"No",huawei:"N/A"},{country:"uy",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"uz",apple:"Yes",android:"Yes",huawei:"No"},{country:"vu",apple:"No",android:"Yes",huawei:"N/A"},{country:"ve",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vg",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"vi",apple:"N/A",android:"No",huawei:"N/A"},{country:"wf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"eh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ye",apple:"Yes",android:"Yes",huawei:"No"},{country:"zm",apple:"Yes",android:"Yes",huawei:"No"},{country:"zw",apple:"Yes",android:"Yes",huawei:"No"}].find((e=>e.country===x)),O=j?function(e){const{apple:o,android:n,huawei:i}=e;return"Yes"===o&&"Yes"===n&&"Yes"===i?"Android, iOS & Huawei":"Yes"===o&&"Yes"===n&&"Yes"!==i?"Android, and iOS":"Yes"===o&&"Yes"===i&&"Yes"!==n?"iOS, and Huawei":"Yes"===n&&"Yes"!==o&&"Yes"!==i?"Android":"Yes"===o&&"Yes"===i&&"Yes"!==n?"iOS, and Huawei":"Yes"===o&&"Yes"!==n&&"Yes"!==i?"iOS":"Yes"!==o&&"Yes"!==n&&"Yes"===i?"Huawei":""}(j):"",$=document.getElementById("app-download-heading");$&&($.innerText=O);const B=document.querySelector(".redirection_background-wrapper"),D=document.getElementById("cancel-redirect"),P=document.getElementById("proceed-redirect");if(window.isEuRegion(window.location.pathname)&&B&&D&&P){const e=["deriv.me","deriv.be","deriv.com","app.deriv.me","app.deriv.be","app.deriv.com","docs.deriv.com","community.deriv.com","deriv.statuspage.io","signup.deriv.com","login.deriv.com","api.deriv.com"];let o="",n="_self";document.querySelectorAll("a").forEach((function(i){const t=new URL(i.href,window.location.href),a=new URL(window.location.href);e.includes(t.host)||t.host===a.host||i.addEventListener("click",(function(e){e.preventDefault(),o=t.href,n=i.target||"_self",B.classList.remove("hide-element"),document.body.style.overflow="hidden"}))})),D.addEventListener("click",(function(){B.classList.add("hide-element"),document.body.style.overflow="auto",o=""})),P.addEventListener("click",(function(){o&&(window.open(o,n),o="",B.classList.add("hide-element"),document.body.style.overflow="auto")}))}document.querySelector(".banner_disclaimer")?document.body.classList.add("disclaimer-visible"):document.body.classList.remove("disclaimer-visible");const W=document.querySelectorAll(".navbar_accordion-item");function R(){const e=document.querySelector(".navbar_accordion-trigger.open");e&&e.scrollIntoView({behavior:"smooth",block:"start"})}W.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.overflow="hidden",o.style.transition="max-height 0.3s ease-in, opacity 0.3s ease-in",o.style.opacity="0"})),W.forEach((e=>{const o=e.querySelector(".navbar_accordion-trigger");o.addEventListener("click",(function(){const e=o.classList.contains("open");if(W.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.opacity="0"})),!e){o.classList.add("open");const e=o.nextElementSibling;e.classList.add("open"),e.style.maxHeight=e.scrollHeight+"px",e.style.opacity="1"}}))}));document.querySelectorAll(".navbar_accordion-trigger").forEach((e=>{e.addEventListener("click",(function(){setTimeout(R,300)}))}));const U=new MutationObserver((e=>{e.forEach((e=>{if("class"===e.attributeName){const o=e.target;o.classList.contains("open")&&o.scrollIntoView({behavior:"smooth",block:"start"})}}))}));document.querySelectorAll(".navbar_accordion-item").forEach((e=>{U.observe(e,{attributes:!0})}));const J=new URL(window.location.href),T=new URLSearchParams(J.search),F=T.get("t");if(T.has("referrer")&&null!=F){m(document.cookie,"referrer_token")!==F&&(N("referrer_token"),h("referrer_token",F,365,".deriv.com"))}const H=document.getElementById("navbar-home_login");H&&H.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const M=document.getElementById("res-navbar-home_login");M&&M.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const V=document.getElementById("white-navbar_login");V&&V.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const G=document.getElementById("res-white-navbar_login");function K(e,o,n){let i="";{let e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),i="; expires="+e.toUTCString()}document.cookie=e+"="+(o||"")+i+"; path=/"}G&&G.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()})),window.fallbackLoader="Migrated All",(de=de||[]).push((function(){let e=document.querySelectorAll(".navbar_accordion-trigger");e.forEach((o=>{o.addEventListener("click",(function(){e.forEach((e=>e.classList.remove("current"))),this.classList.add("current")}))}));let o=document.querySelector(".navbar_accordion-link.w--current");if(o){let e=o.closest(".navbar_accordion-item");if(e){let o=e.querySelector(".navbar_accordion-trigger");o&&o.classList.add("current")}}})),(de=de||[]).push((function(){let e=document.querySelector(".locale > .new-navbar_dropdown-link.w--current");if(e){let o=e.getAttribute("hreflang"),n=document.querySelectorAll(".current-locale-iso-code");if(o&&n.length)for(let e of n)e.innerText=o}}));let Z=document.querySelectorAll(".w-locales-items");if(Z.length>0){let e=function(e){let o=document.querySelector('a[hreflang="'+e+'"]');o&&window.location.pathname!==o.getAttribute("href")&&o.click()};Z.forEach((function(e){e.querySelectorAll("a").forEach((function(e){e.addEventListener("click",(function(o){o.preventDefault(),K("webflow-user-language",e.getAttribute("hreflang"),30),window.location.href=e.href}))}))})),window.setLanguageCookie=e=>{K("webflow-user-language",e,30)};let o=function(e){let o=document.cookie.split(";");for(let n=0;ni.includes(e))),o&&t&&e(o)}(de=de||[]).push((function(){if(document.querySelector(".new-navbar_component")){let e=function(){document.body.classList.add("disable-scroll")},o=function(){document.body.classList.remove("disable-scroll")};const n=document.querySelector(".new-navbar_component");n.addEventListener("mouseenter",(()=>{window.innerWidth>991&&e()})),n.addEventListener("mouseleave",(()=>{window.innerWidth>991&&o()}))}})),window.getClientCountry();const Q=window.parseCookies(document.cookie,"webflow-user-language"),X=["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"];if(window.location.pathname.endsWith("p2p")&&!window.location.pathname.startsWith("/blog")){const e=window.getClientCountry();e&&X.includes(e)&&("en"===Q?window.location.replace("/404"):window.location.replace(`/${Q}/404`))}if(void 0!==window.parseCookies(document.cookie,"client_information")){let e=function(e){e.forEach((e=>{e.href="https://app.deriv.com/appstore/traders-hub"}))},o=document.querySelectorAll("a.live-markets_button.is-secondary.is-small.is-purchase.w-button"),n=document.querySelectorAll("a.live-markets_button.is-secondary.is-small.is-sell.w-button");e(o),e(n)}document.getElementById("mobile-menu"),document.getElementById("live_chat-wrapper");const ee=()=>{window.LC_API&&window.LC_API.open_chat_window&&window.LC_API.open_chat_window()},oe=()=>{"true"===new URLSearchParams(window.location.search).get("is_livechat_open")&&ee()},ne=e=>{var o;null==(o=null==window?void 0:window.LiveChatWidget)||o.on("ready",(()=>{window.LC_API.open_chat_window(),window.LC_API.hide_chat_window(),oe();const o=window.parseCookies(document.cookie,"utm_data"),n=o?JSON.parse(o):{},{utm_source:i,utm_medium:t,utm_campaign:a}=n,r=window.parseCookies(document.cookie,"client_information"),d=new URLSearchParams(window.location.search),{loginid:c,email:s,landing_company_shortcode:l,currency:u,residence:p,first_name:w,last_name:h}=r?JSON.parse(r):{},m={is_logged_in:e,loginid:c??"",landing_company_shortcode:l??"",currency:u??"",residence:p??"",email:s??"",platform:d.get("platform")??"",utm_source:i??"",utm_medium:t??"",utm_campaign:a??""};window.LiveChatWidget.call("set_session_variables",m),e?(s&&window.LiveChatWidget.call("set_customer_email",s),w&&h&&window.LiveChatWidget.call("set_customer_name",`${w} ${h}`)):window.LC_API.on_chat_ended=()=>{window.LiveChatWidget.call("set_customer_email"," "),window.LiveChatWidget.call("set_customer_name"," ")},oe(),window.LiveChatWidget.on("new_event",(e=>{e.greeting&&window.LC_API.open_chat_window()}))}))};let ie=!1;const te=()=>{const e=!!window.parseCookies(document.cookie,"client_information");e!==ie&&(ne(e),ie=e)};te(),setInterval(te,2e3),(()=>{if(window.__lc=window.__lc||{},window.__lc.license="12049137",window.LC_API=window.LC_API||{loaded:!1},window.LC_API.loaded)oe();else{const e=document.createElement("script");e.async=!0,e.src="https://cdn.livechatinc.com/tracking.js",e.onload=()=>{window.LC_API.loaded=!0,window.LC_API.on_after_load=function(){ne(!!window.parseCookies(document.cookie,"client_information")),oe()},"undefined"!=typeof LiveChatWidget&&LiveChatWidget.init&&LiveChatWidget.init()},document.body.appendChild(e)}})();const ae=document.querySelectorAll(".livechatbtn");ae.length>0&&ae.forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault(),ee()}))}));const re=document.getElementById("liveChatBtn");re&&re.addEventListener("click",(e=>{e.preventDefault(),ee()}));var de;document.querySelectorAll('a[rel="liveChatBtn"]').forEach((e=>{null==e||e.addEventListener("click",(e=>{e.preventDefault(),ee()}))})),(de=de||[]).push((function(){let e=document.querySelector(".navbar_menu-button");e&&e.addEventListener("click",(function(){let e=window.innerHeight,o=document.querySelector(".new-navbar_main-wrapper");if(o){let n=e-o.offsetHeight,i=document.querySelector(".new-navbar_menu");i&&(i.style.height=`${n}px`)}}))})),(de=de||[]).push((function(){let e=document.querySelector(".lang-mob");e&&e.addEventListener("click",(function(){let e=document.querySelector(".new-navbar_menu-wrapper");e&&e.scrollBy({top:-3e3})}))}));class ce{constructor(e){this.cookieName=e}setItem(e){const o=new Date;o.setDate(o.getDate()+30);const n="expires="+o.toUTCString(),i=encodeURIComponent(JSON.stringify(e));document.cookie=`${this.cookieName}=${i};${n};path=/`}getItem(){const e=document.cookie.split(";");for(let o=0;oye.includes(e)))&&document.head.querySelectorAll("link").forEach((function(e){e.hasAttribute("hreflang")&&"x-default"!==e.getAttribute("hreflang")&&e.remove()}));const Ne=e=>{window.rudderanalytics?window.rudderanalytics.track(e.name,e.properties):(e=>{let o=[],n=parseCookies(document.cookie,"cached_analytics_events");n&&(o=JSON.parse(n)),o.push(e),document.cookie=`cached_analytics_events=${JSON.stringify(o)}; path=/; Domain=.deriv.com`})(e)};window.addClickListener=function(e,o,n){e&&e.addEventListener("click",(function(){Ne({name:o,properties:n})}))};var ge=null==document?void 0:document.getElementsByClassName("livechatbtn"),fe=null==document?void 0:document.getElementsByClassName("whatsapp_chat"),ve=null==document?void 0:document.getElementsByClassName("tradershub-btn"),Ye=document.querySelectorAll(".btn-free-demo .w-button"),_e=document.querySelectorAll('.btn-free-demo [data-class="w-button"]');const Ae=document.querySelectorAll('[data-attributes="btn-primary-nav"]'),be=document.querySelectorAll('[data-attributes="btn-secondary-nav"]');ge&&Array.from(ge).forEach((e=>{window.addClickListener(e,"ce_widget_usage_form",{action:"click",widget_name:"livechat"})})),fe&&Array.from(fe).forEach((e=>{window.addClickListener(e,"ce_widget_usage_form",{action:"click",widget_name:"whatsapp"})})),ve&&Array.from(ve).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Traders Hub"})})),Ye&&Array.from(Ye).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),_e&&Array.from(_e).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),Ae&&Array.from(Ae).forEach((e=>{e.classList.contains("tradershub-btn")||window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),be&&Array.from(be).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Login"})}));var ke,Le,Se;"deriv.com"===window.location.hostname||"deriv.be"===window.location.hostname||"deriv.me"===window.location.hostname?(ke="sdk-UhZV3cNEg5nLNLNS",Se="nre64BV0dNIa44zW4tz5ow==",Le="1oV5agvlcnCZ6IH94wCKM1oR8Pd"):(ke="sdk-9wuqJ1mlcQsSyZQ",Se="",Le="1lN3tsFD2nruGFgM5F074DC2hMB");const Ee=(we=window.parseCookies(document.cookie,"client_information"))?JSON.parse(we):null,Ce=window.parseCookies(document.cookie,"utm_data"),qe=Ce?JSON.parse(Ce):{},Ie=window.parseCookies(document.cookie,"signup_device");let ze=null;Ie&&(ze=(null==(e=JSON.parse(Ie))?void 0:e.signup_device)||null);const xe={growthbookKey:ke,growthbookDecryptionKey:Se,rudderstackKey:Le,growthbookOptions:{navigate:e=>window.location.replace(e),antiFlicker:!1,navigateDelay:0,attributes:{country:window.parseCookies(document.cookie,"clients_country")||window.parseCookies(document.cookie,"website_status"),user_language:window.parseCookies(document.cookie,"user_language")||("undefined"!=typeof window?localStorage.getItem("i18n")||navigator.language:null),device_language:window.parseCookies(document.cookie,"language")||" ",device_type:ze,utm_source:null==qe?void 0:qe.utm_source,utm_medium:null==qe?void 0:qe.utm_medium,utm_campaign:null==qe?void 0:qe.utm_campaign,is_authorised:!!window.parseCookies(document.cookie,"client_information"),loggedIn:!!window.parseCookies(document.cookie,"client_information"),url:window.location.href}}};try{null==Analytics||Analytics.Analytics.initialise(xe);const e=(null==Ee?void 0:Ee.user_id)?null==Ee?void 0:Ee.user_id:null==(i=null==(n=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getInstances)?void 0:n.call(o).tracking)?void 0:i.getAnonymousId();null==(t=null==Analytics?void 0:Analytics.Analytics)||t.identifyEvent(e)}catch(Oe){}null==(a=null==Analytics?void 0:Analytics.Analytics)||a.pageView(location.pathname,"Deriv.com"),window.useGrowthbookFeatureFlag=function({featureFlag:e}){var o,n,i,t,a;let r=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getFeatureValue(e);return null==(a=null==(t=null==(i=null==(n=null==Analytics?void 0:Analytics.Analytics)?void 0:n.getInstances())?void 0:i.ab)?void 0:t.GrowthBook)||a.setRenderer((function(){var o;const n=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getFeatureValue(e);r=n})),r};const je=window.parseCookies(document.cookie,"client_information")?JSON.parse(window.parseCookies(document.cookie,"client_information")):null;(null==je?void 0:je.loginid)&&(null==window||window.hj("identify",je.loginid,{is_logged_in:!!window.parseCookies(document.cookie,"client_information"),landing_company_shortcode:je.landing_company_shortcode||"null"}));null==(s=null==(c=null==(d=null==(r=null==Analytics?void 0:Analytics.Analytics)?void 0:r.getInstances())?void 0:d.ab)?void 0:c.GrowthBook)||s.loadFeatures().then((()=>{window.location.href.indexOf("/partners")>-1==!1&&(()=>{var e;const o=(null==(e=null==Analytics?void 0:Analytics.Analytics)?void 0:e.getFeatureValue("trigger_os_signup_wf"))?function(){const e=navigator.userAgent.toLowerCase();return/ipad|iphone|ipod/.test(e)}()||function(){const e=navigator.userAgent.toLowerCase();return/safari/.test(e)&&!/chrome/.test(e)&&!/crios/.test(e)}()?`https://${window.location.host}/signup`:(()=>{const e=window.location.hostname;let o;switch(o="deriv.com"===e||"deriv.be"===e||"deriv.me"===e?"production":"staging.deriv.com"===e?"staging":"development",o){case"production":return"https://hub.deriv.com/tradershub/signup";case"staging":return"https://staging-hub.deriv.com/tradershub/signup";default:return"https://dev-hub.deriv.com/tradershub/signup"}})():`https://${window.location.host}/signup`,n=document.getElementById("cta-home-btn-navbar");n&&(n.href=o);const i=document.querySelectorAll(".logged-out-btn");null==i||i.forEach((e=>{var n;(null==(n=null==e?void 0:e.href)?void 0:n.indexOf("/signup"))>0&&(e.href=o)}));const t=document.querySelectorAll(".logged-out-btn a");null==t||t.forEach((e=>{var n;(null==(n=null==e?void 0:e.href)?void 0:n.indexOf("/signup"))>0&&(e.href=o)}))})()})); From 741e79bde1088c2b4155690c65fbd2ed3def7660 Mon Sep 17 00:00:00 2001 From: Prince Date: Tue, 17 Sep 2024 18:01:49 +0400 Subject: [PATCH 32/57] chore: remove webflow array functions --- src/js/footer/migration.js | 1299 +++++++++++++++++------------------- src/temp-static.min.js | 2 +- 2 files changed, 625 insertions(+), 676 deletions(-) diff --git a/src/js/footer/migration.js b/src/js/footer/migration.js index 451ffad..d087f33 100644 --- a/src/js/footer/migration.js +++ b/src/js/footer/migration.js @@ -1,301 +1,280 @@ +window.fallbackLoader = "Migrated All + Removal of Webflow array functions"; +// +// This function adds a red line to the current accordion trigger +// Find all accordion triggers +let triggers = document.querySelectorAll(".navbar_accordion-trigger"); +triggers.forEach((trigger) => { + trigger.addEventListener("click", function () { + // Remove the .current class from all triggers + triggers.forEach((t) => t.classList.remove("current")); -window.fallbackLoader = "Migrated All" - -// -// This function adds a red line to the current accordion trigger -var Webflow = Webflow || []; -Webflow.push(function () { - // Find all accordion triggers - let triggers = document.querySelectorAll(".navbar_accordion-trigger"); - - triggers.forEach((trigger) => { - trigger.addEventListener("click", function () { - // Remove the .current class from all triggers - triggers.forEach((t) => t.classList.remove("current")); - - // Add the .current class to the clicked trigger - this.classList.add("current"); - }); - }); + // Add the .current class to the clicked trigger + this.classList.add("current"); + }); +}); - // Find the current page link in Navbar - let currentLink = document.querySelector( - ".navbar_accordion-link.w--current" - ); +// Find the current page link in Navbar +let currentLink = document.querySelector(".navbar_accordion-link.w--current"); - if (currentLink) { - // Find the closest accordion item - let accordionItem = currentLink.closest(".navbar_accordion-item"); +if (currentLink) { + // Find the closest accordion item + let accordionItem = currentLink.closest(".navbar_accordion-item"); - if (accordionItem) { - // Find the trigger element within the found parent - let trigger = accordionItem.querySelector(".navbar_accordion-trigger"); + if (accordionItem) { + // Find the trigger element within the found parent + let trigger = accordionItem.querySelector(".navbar_accordion-trigger"); - if (trigger) { - // Add the .current class to the trigger - trigger.classList.add("current"); - } - } + if (trigger) { + // Add the .current class to the trigger + trigger.classList.add("current"); } -}); + } +} // // -var Webflow = Webflow || []; -Webflow.push(function () { - let currentLocaleElement = document.querySelector( - ".locale > .new-navbar_dropdown-link.w--current" - ); +let currentLocaleElement = document.querySelector( + ".locale > .new-navbar_dropdown-link.w--current" +); - if (currentLocaleElement) { - let currentLocaleIsoCode = currentLocaleElement.getAttribute("hreflang"); +if (currentLocaleElement) { + let currentLocaleIsoCode = currentLocaleElement.getAttribute("hreflang"); - let currentLocaleIsoCodeTexts = document.querySelectorAll( - ".current-locale-iso-code" - ); + let currentLocaleIsoCodeTexts = document.querySelectorAll( + ".current-locale-iso-code" + ); - if (currentLocaleIsoCode && currentLocaleIsoCodeTexts.length) { - for (let currentLocaleIsoCodeText of currentLocaleIsoCodeTexts) { - currentLocaleIsoCodeText.innerText = currentLocaleIsoCode; - } - } + if (currentLocaleIsoCode && currentLocaleIsoCodeTexts.length) { + for (let currentLocaleIsoCodeText of currentLocaleIsoCodeTexts) { + currentLocaleIsoCodeText.innerText = currentLocaleIsoCode; } -}); + } +} // - - // Function for setting cookies when changing language and redirecting to the current language page function setCookie(name, value, days) { - let expires = ""; - if (days) { - let date = new Date(); - date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000); - expires = "; expires=" + date.toUTCString(); - } - document.cookie = name + "=" + (value || "") + expires + "; path=/"; + let expires = ""; + if (days) { + let date = new Date(); + date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000); + expires = "; expires=" + date.toUTCString(); + } + document.cookie = name + "=" + (value || "") + expires + "; path=/"; } function getCookie(name) { - let cookies = document.cookie.split(";"); - for (let i = 0; i < cookies.length; i++) { - let cookie = cookies[i].trim(); - if (cookie.startsWith(name + "=")) { - return cookie.substring(name.length + 1); - } + let cookies = document.cookie.split(";"); + for (let i = 0; i < cookies.length; i++) { + let cookie = cookies[i].trim(); + if (cookie.startsWith(name + "=")) { + return cookie.substring(name.length + 1); } - return null; + } + return null; } let localeItems = document.querySelectorAll(".w-locales-items"); if (localeItems.length > 0) { - localeItems.forEach(function (item) { - let links = item.querySelectorAll("a"); - links.forEach(function (link) { - link.addEventListener("click", function (event) { - event.preventDefault(); - let language = link.getAttribute("hreflang"); - setCookie("webflow-user-language", language, 30); - window.location.href = link.href; - }); - }); + localeItems.forEach(function (item) { + let links = item.querySelectorAll("a"); + links.forEach(function (link) { + link.addEventListener("click", function (event) { + event.preventDefault(); + let language = link.getAttribute("hreflang"); + setCookie("webflow-user-language", language, 30); + window.location.href = link.href; + }); }); + }); - function clickLinkWithLanguage(language) { - let link = document.querySelector('a[hreflang="' + language + '"]'); - if (link && window.location.pathname !== link.getAttribute("href")) { - link.click(); - } + function clickLinkWithLanguage(language) { + let link = document.querySelector('a[hreflang="' + language + '"]'); + if (link && window.location.pathname !== link.getAttribute("href")) { + link.click(); } - window.setLanguageCookie = (language) => { - setCookie("webflow-user-language", language, 30); - }; + } + window.setLanguageCookie = (language) => { + setCookie("webflow-user-language", language, 30); + }; - let languageCookie = getCookie("webflow-user-language"); - let targetPaths = [ - "/careers", - "/locations", - "/derivtech", - "/derivlife", - "/eu-careers", - "/our-locations", - ]; - let path = window.location.pathname; - let targetPathUrl = false; - - // Check if the current path matches any of the target paths - if (targetPaths.some((targetPath) => path.includes(targetPath))) { - targetPathUrl === true; - } - if (languageCookie && targetPathUrl) { - clickLinkWithLanguage(languageCookie); - } + let languageCookie = getCookie("webflow-user-language"); + let targetPaths = [ + "/careers", + "/locations", + "/derivtech", + "/derivlife", + "/eu-careers", + "/our-locations", + ]; + let path = window.location.pathname; + let targetPathUrl = false; + + // Check if the current path matches any of the target paths + if (targetPaths.some((targetPath) => path.includes(targetPath))) { + targetPathUrl === true; + } + if (languageCookie && targetPathUrl) { + clickLinkWithLanguage(languageCookie); + } } +if (document.querySelector(".new-navbar_component")) { + // Find the .new-navbar_component element + const navbarComponent = document.querySelector(".new-navbar_component"); -var Webflow = Webflow || []; -Webflow.push(function () { - if (document.querySelector(".new-navbar_component")) { - // Find the .new-navbar_component element - const navbarComponent = document.querySelector(".new-navbar_component"); - - // Add event listeners for hover - navbarComponent.addEventListener("mouseenter", () => { - if (window.innerWidth > 991) { - disableScroll(); - } - }); - navbarComponent.addEventListener("mouseleave", () => { - if (window.innerWidth > 991) { - enableScroll(); - } - }); - - // Function to disable scroll - function disableScroll() { - document.body.classList.add("disable-scroll"); - } - - // Function to enable scroll - function enableScroll() { - document.body.classList.remove("disable-scroll"); - } + // Add event listeners for hover + navbarComponent.addEventListener("mouseenter", () => { + if (window.innerWidth > 991) { + disableScroll(); } -}); + }); + navbarComponent.addEventListener("mouseleave", () => { + if (window.innerWidth > 991) { + enableScroll(); + } + }); + // Function to disable scroll + function disableScroll() { + document.body.classList.add("disable-scroll"); + } + // Function to enable scroll + function enableScroll() { + document.body.classList.remove("disable-scroll"); + } +} const clientsCountry = window.getClientCountry(); const getDateFirstContact = () => { - const dateFirstContactString = window.parseCookies( - document.cookie, - "date_first_contact" - ); - if (dateFirstContactString) { - const parsedData = JSON.parse(dateFirstContactString); - return parsedData.date_first_contact - ? { date_first_contact: parsedData.date_first_contact } - : null; - } - return null; + const dateFirstContactString = window.parseCookies( + document.cookie, + "date_first_contact" + ); + if (dateFirstContactString) { + const parsedData = JSON.parse(dateFirstContactString); + return parsedData.date_first_contact + ? { date_first_contact: parsedData.date_first_contact } + : null; + } + return null; }; const getSignupDevice = () => { - const signupDeviceString = window.parseCookies( - document.cookie, - "signup_device" - ); - if (signupDeviceString) { - const parsedData = JSON.parse(signupDeviceString); - return parsedData.signup_device - ? { signup_device: parsedData.signup_device } - : null; - } - return null; + const signupDeviceString = window.parseCookies( + document.cookie, + "signup_device" + ); + if (signupDeviceString) { + const parsedData = JSON.parse(signupDeviceString); + return parsedData.signup_device + ? { signup_device: parsedData.signup_device } + : null; + } + return null; }; const lang = window.parseCookies(document.cookie, "webflow-user-language"); const countriesToRedirect = [ - "as", - "au", - "at", - "be", - "bg", - "ca", - "hr", - "cy", - "cz", - "dk", - "ee", - "fi", - "fr", - "gr", - "gu", - "gg", - "hk", - "hu", - "ir", - "ie", - "im", - "il", - "it", - "je", - "ng", - "mm", - "sy", - "kp", - "lv", - "lt", - "lu", - "my", - "mt", - "nl", - "nz", - "mp", - "py", - "pl", - "pt", - "pr", - "ro", - "rw", - "sk", - "si", - "es", - "se", - "ae", - "gb", - "us", - "um", - "vu", - "vi", - "ky", - "cu", - "de", + "as", + "au", + "at", + "be", + "bg", + "ca", + "hr", + "cy", + "cz", + "dk", + "ee", + "fi", + "fr", + "gr", + "gu", + "gg", + "hk", + "hu", + "ir", + "ie", + "im", + "il", + "it", + "je", + "ng", + "mm", + "sy", + "kp", + "lv", + "lt", + "lu", + "my", + "mt", + "nl", + "nz", + "mp", + "py", + "pl", + "pt", + "pr", + "ro", + "rw", + "sk", + "si", + "es", + "se", + "ae", + "gb", + "us", + "um", + "vu", + "vi", + "ky", + "cu", + "de", ]; if ( - window.location.pathname.endsWith("p2p") && - !window.location.pathname.startsWith("/blog") + window.location.pathname.endsWith("p2p") && + !window.location.pathname.startsWith("/blog") ) { - const clientsCountry = window.getClientCountry(); - if (clientsCountry && countriesToRedirect.includes(clientsCountry)) { - if (lang === "en") { - window.location.replace("/404"); - } else { - window.location.replace(`/${lang}/404`); - } + const clientsCountry = window.getClientCountry(); + if (clientsCountry && countriesToRedirect.includes(clientsCountry)) { + if (lang === "en") { + window.location.replace("/404"); + } else { + window.location.replace(`/${lang}/404`); } + } } -if ( - window.parseCookies(document.cookie, "client_information") !== undefined -) { - let purchaseButtons = document.querySelectorAll( - "a.live-markets_button.is-secondary.is-small.is-purchase.w-button" - ); +if (window.parseCookies(document.cookie, "client_information") !== undefined) { + let purchaseButtons = document.querySelectorAll( + "a.live-markets_button.is-secondary.is-small.is-purchase.w-button" + ); - let sellButtons = document.querySelectorAll( - "a.live-markets_button.is-secondary.is-small.is-sell.w-button" - ); + let sellButtons = document.querySelectorAll( + "a.live-markets_button.is-secondary.is-small.is-sell.w-button" + ); - function updateHref(buttons) { - buttons.forEach((button) => { - button.href = "https://app.deriv.com/appstore/traders-hub"; - }); - } + function updateHref(buttons) { + buttons.forEach((button) => { + button.href = "https://app.deriv.com/appstore/traders-hub"; + }); + } - updateHref(purchaseButtons); - updateHref(sellButtons); + updateHref(purchaseButtons); + updateHref(sellButtons); } //live chat button hide on menu appear @@ -306,155 +285,153 @@ let isLiveChatVisible = true; let isLiveChatActivated = false; function fadeIn(element) { - var opacity = 0; - var timer = setInterval(function () { - if (opacity >= 1) { - clearInterval(timer); - } - element.style.opacity = opacity; - opacity += 0.1; - }, 30); + var opacity = 0; + var timer = setInterval(function () { + if (opacity >= 1) { + clearInterval(timer); + } + element.style.opacity = opacity; + opacity += 0.1; + }, 30); } function fadeOut(element) { - var opacity = 1; - var timer = setInterval(function () { - if (opacity <= 0) { - clearInterval(timer); - element.style.display = "none"; - } - element.style.opacity = opacity; - opacity -= 0.1; - }, 30); + var opacity = 1; + var timer = setInterval(function () { + if (opacity <= 0) { + clearInterval(timer); + element.style.display = "none"; + } + element.style.opacity = opacity; + opacity -= 0.1; + }, 30); } - - // const licenceKey = "12049137"; const loadLiveChatScript = () => { - window.__lc = window.__lc || {}; - window.__lc.license = licenceKey; - window.LC_API = window.LC_API || { loaded: false }; - if (!window.LC_API.loaded) { - const lcScript = document.createElement("script"); - lcScript.async = true; - lcScript.src = "https://cdn.livechatinc.com/tracking.js"; - lcScript.onload = () => { - window.LC_API.loaded = true; // Mark as loaded - window.LC_API.on_after_load = function () { - performLiveChatAction( - !!window.parseCookies(document.cookie, "client_information") - ); - checkUrlForLiveChat(); - }; - if (typeof LiveChatWidget !== "undefined" && LiveChatWidget.init) { - LiveChatWidget.init(); - } - }; - document.body.appendChild(lcScript); - } else { + window.__lc = window.__lc || {}; + window.__lc.license = licenceKey; + window.LC_API = window.LC_API || { loaded: false }; + if (!window.LC_API.loaded) { + const lcScript = document.createElement("script"); + lcScript.async = true; + lcScript.src = "https://cdn.livechatinc.com/tracking.js"; + lcScript.onload = () => { + window.LC_API.loaded = true; // Mark as loaded + window.LC_API.on_after_load = function () { + performLiveChatAction( + !!window.parseCookies(document.cookie, "client_information") + ); checkUrlForLiveChat(); - } + }; + if (typeof LiveChatWidget !== "undefined" && LiveChatWidget.init) { + LiveChatWidget.init(); + } + }; + document.body.appendChild(lcScript); + } else { + checkUrlForLiveChat(); + } }; const openLiveChat = () => { - if (window.LC_API && window.LC_API.open_chat_window) { - window.LC_API.open_chat_window(); - } + if (window.LC_API && window.LC_API.open_chat_window) { + window.LC_API.open_chat_window(); + } }; const checkUrlForLiveChat = () => { - const urlParams = new URLSearchParams(window.location.search); - if (urlParams.get("is_livechat_open") === "true") { - openLiveChat(); - } + const urlParams = new URLSearchParams(window.location.search); + if (urlParams.get("is_livechat_open") === "true") { + openLiveChat(); + } }; //dashboard send data const performLiveChatAction = (is_logged_in) => { - window?.LiveChatWidget?.on("ready", () => { - // we open and close the window to trigger the widget to listen for new events - window.LC_API.open_chat_window(); - window.LC_API.hide_chat_window(); - checkUrlForLiveChat(); + window?.LiveChatWidget?.on("ready", () => { + // we open and close the window to trigger the widget to listen for new events + window.LC_API.open_chat_window(); + window.LC_API.hide_chat_window(); + checkUrlForLiveChat(); + + const utm_data_string = window.parseCookies(document.cookie, "utm_data"); + const utm_data = utm_data_string ? JSON.parse(utm_data_string) : {}; + const { utm_source, utm_medium, utm_campaign } = utm_data; + + const client_information = window.parseCookies( + document.cookie, + "client_information" + ); + const url_params = new URLSearchParams(window.location.search); + + const { + loginid, + email, + landing_company_shortcode, + currency, + residence, + first_name, + last_name, + } = client_information ? JSON.parse(client_information) : {}; + + /* the session variables are sent to CS team dashboard to notify user has logged in + and also acts as custom variables to trigger targeted engagement */ + const session_variables = { + is_logged_in: is_logged_in, + loginid: loginid ?? "", + landing_company_shortcode: landing_company_shortcode ?? "", + currency: currency ?? "", + residence: residence ?? "", + email: email ?? "", + platform: url_params.get("platform") ?? "", + utm_source: utm_source ?? "", + utm_medium: utm_medium ?? "", + utm_campaign: utm_campaign ?? "", + }; - const utm_data_string = window.parseCookies(document.cookie, "utm_data"); - const utm_data = utm_data_string ? JSON.parse(utm_data_string) : {}; - const { utm_source, utm_medium, utm_campaign } = utm_data; + window.LiveChatWidget.call("set_session_variables", session_variables); - const client_information = window.parseCookies( - document.cookie, - "client_information" + if (is_logged_in) { + if (email) { + window.LiveChatWidget.call("set_customer_email", email); + } + if (first_name && last_name) { + window.LiveChatWidget.call( + "set_customer_name", + `${first_name} ${last_name}` ); - const url_params = new URLSearchParams(window.location.search); - - const { - loginid, - email, - landing_company_shortcode, - currency, - residence, - first_name, - last_name, - } = client_information ? JSON.parse(client_information) : {}; - - /* the session variables are sent to CS team dashboard to notify user has logged in - and also acts as custom variables to trigger targeted engagement */ - const session_variables = { - is_logged_in: is_logged_in, - loginid: loginid ?? "", - landing_company_shortcode: landing_company_shortcode ?? "", - currency: currency ?? "", - residence: residence ?? "", - email: email ?? "", - platform: url_params.get("platform") ?? "", - utm_source: utm_source ?? "", - utm_medium: utm_medium ?? "", - utm_campaign: utm_campaign ?? "", - }; - - window.LiveChatWidget.call("set_session_variables", session_variables); - - if (is_logged_in) { - if (email) { - window.LiveChatWidget.call("set_customer_email", email); - } - if (first_name && last_name) { - window.LiveChatWidget.call( - "set_customer_name", - `${first_name} ${last_name}` - ); - } - } else { - // clear name and email fields after chat has ended - window.LC_API.on_chat_ended = () => { - window.LiveChatWidget.call("set_customer_email", " "); - window.LiveChatWidget.call("set_customer_name", " "); - }; - } - checkUrlForLiveChat(); + } + } else { + // clear name and email fields after chat has ended + window.LC_API.on_chat_ended = () => { + window.LiveChatWidget.call("set_customer_email", " "); + window.LiveChatWidget.call("set_customer_name", " "); + }; + } + checkUrlForLiveChat(); - // open chat widget when there is an incoming greeting/announcement - window.LiveChatWidget.on("new_event", (event) => { - if (event.greeting) { - window.LC_API.open_chat_window(); - } - }); + // open chat widget when there is an incoming greeting/announcement + window.LiveChatWidget.on("new_event", (event) => { + if (event.greeting) { + window.LC_API.open_chat_window(); + } }); + }); }; let is_logged_in = false; let checkCookieInterval; const isLoggedIn = () => { - return !!window.parseCookies(document.cookie, "client_information"); + return !!window.parseCookies(document.cookie, "client_information"); }; const checkLoggedIn = () => { - const new_login_status = isLoggedIn(); - if (new_login_status !== is_logged_in) { - performLiveChatAction(new_login_status); - is_logged_in = new_login_status; - } + const new_login_status = isLoggedIn(); + if (new_login_status !== is_logged_in) { + performLiveChatAction(new_login_status); + is_logged_in = new_login_status; + } }; // Perform initial authentication check @@ -464,115 +441,108 @@ checkLoggedIn(); checkCookieInterval = setInterval(checkLoggedIn, 2000); //end of dashboard send data - loadLiveChatScript(); const liveChatIcons = document.querySelectorAll(".livechatbtn"); if (liveChatIcons.length > 0) { - liveChatIcons.forEach((liveChatIcon) => { - liveChatIcon.addEventListener("click", (event) => { - event.preventDefault(); - openLiveChat(); - }); + liveChatIcons.forEach((liveChatIcon) => { + liveChatIcon.addEventListener("click", (event) => { + event.preventDefault(); + openLiveChat(); }); + }); } const liveChatIconById = document.getElementById("liveChatBtn"); if (liveChatIconById) { - liveChatIconById.addEventListener("click", (event) => { - event.preventDefault(); - openLiveChat(); - }); + liveChatIconById.addEventListener("click", (event) => { + event.preventDefault(); + openLiveChat(); + }); } -const liveChatIconsByrel = document.querySelectorAll( - 'a[rel="liveChatBtn"]' -); +const liveChatIconsByrel = document.querySelectorAll('a[rel="liveChatBtn"]'); liveChatIconsByrel.forEach((liveChatIcon) => { - liveChatIcon?.addEventListener("click", (event) => { - event.preventDefault(); - openLiveChat(); - }); + liveChatIcon?.addEventListener("click", (event) => { + event.preventDefault(); + openLiveChat(); + }); }); - // - // -var Webflow = Webflow || []; -Webflow.push(function () { - let navbarMenuBtn = document.querySelector(".navbar_menu-button"); - if (navbarMenuBtn) { - navbarMenuBtn.addEventListener("click", function () { - let windowHeight = window.innerHeight; +let navbarMenuBtn = document.querySelector(".navbar_menu-button"); + +if (navbarMenuBtn) { + navbarMenuBtn.addEventListener("click", function () { + let windowHeight = window.innerHeight; - let navbarWrapper = document.querySelector(".new-navbar_main-wrapper"); + let navbarWrapper = document.querySelector(".new-navbar_main-wrapper"); - if (navbarWrapper) { - let navbarHeight = navbarWrapper.offsetHeight; + if (navbarWrapper) { + let navbarHeight = navbarWrapper.offsetHeight; - let calculatedHeight = windowHeight - navbarHeight; + let calculatedHeight = windowHeight - navbarHeight; - let navbarMenu = document.querySelector(".new-navbar_menu"); - if (navbarMenu) { - navbarMenu.style.height = `${calculatedHeight}px`; - } - } - }); + let navbarMenu = document.querySelector(".new-navbar_menu"); + if (navbarMenu) { + navbarMenu.style.height = `${calculatedHeight}px`; + } } -}); -// + }); +} +// + // // this code ensures opening a list of languages on mobile starting from the top -var Webflow = Webflow || []; -Webflow.push(function () { - let langMobButton = document.querySelector(".lang-mob"); - - if (langMobButton) { - langMobButton.addEventListener("click", function () { - let mobileMenuWrapper = document.querySelector( - ".new-navbar_menu-wrapper" - ); - - if (mobileMenuWrapper) { - mobileMenuWrapper.scrollBy({ top: -3000 }); - } - }); - } -}); -// + let langMobButton = document.querySelector(".lang-mob"); + + if (langMobButton) { + langMobButton.addEventListener("click", function () { + let mobileMenuWrapper = document.querySelector( + ".new-navbar_menu-wrapper" + ); + + if (mobileMenuWrapper) { + mobileMenuWrapper.scrollBy({ top: -3000 }); + } + }); + } + + +// // class CookieStorage { - constructor(cookieName) { - this.cookieName = cookieName; - } - - setItem(value) { - const expiryDate = new Date(); - expiryDate.setDate(expiryDate.getDate() + 30); // 30 days from now - const expires = "expires=" + expiryDate.toUTCString(); - const cookieValue = encodeURIComponent(JSON.stringify(value)); - document.cookie = `${this.cookieName}=${cookieValue};${expires};path=/`; - } - getItem() { - const cookies = document.cookie.split(";"); - for (let i = 0; i < cookies.length; i++) { - let cookie = cookies[i].trim(); - if (cookie.startsWith(`${this.cookieName}=`)) { - let cookieValue = cookie.substring(`${this.cookieName}=`.length); - return JSON.parse(decodeURIComponent(cookieValue)); - } - } - return null; + constructor(cookieName) { + this.cookieName = cookieName; + } + + setItem(value) { + const expiryDate = new Date(); + expiryDate.setDate(expiryDate.getDate() + 30); // 30 days from now + const expires = "expires=" + expiryDate.toUTCString(); + const cookieValue = encodeURIComponent(JSON.stringify(value)); + document.cookie = `${this.cookieName}=${cookieValue};${expires};path=/`; + } + getItem() { + const cookies = document.cookie.split(";"); + for (let i = 0; i < cookies.length; i++) { + let cookie = cookies[i].trim(); + if (cookie.startsWith(`${this.cookieName}=`)) { + let cookieValue = cookie.substring(`${this.cookieName}=`.length); + return JSON.parse(decodeURIComponent(cookieValue)); + } } + return null; + } } const tracking_status_cookie = new CookieStorage("tracking_status"); const tracking_status_cookie_declined = new CookieStorage( - "tracking_status_decline" + "tracking_status_decline" ); const popupElement = document.querySelector(".cookies_background-wrapper"); @@ -580,32 +550,32 @@ const popupElement = document.querySelector(".cookies_background-wrapper"); //set datalayer details const has_dataLayer = window.dataLayer; var client_information = window.parseCookies( - document.cookie, - "client_information" + document.cookie, + "client_information" ); is_logged_in = !!client_information; has_dataLayer && - window.dataLayer.push({ - loggedIn: is_logged_in, - language: - window.parseCookies(document.cookie, "webflow-user-language") || "en", - ...(is_logged_in && { - visitorId: client_information?.loginid, - currency: client_information?.currency, - email: client_information?.email, - }), - }); + window.dataLayer.push({ + loggedIn: is_logged_in, + language: + window.parseCookies(document.cookie, "webflow-user-language") || "en", + ...(is_logged_in && { + visitorId: client_information?.loginid, + currency: client_information?.currency, + email: client_information?.email, + }), + }); // Check if pathname contains "eu" and tracking_status_cookie is null if ( - window.location.pathname.includes("eu") && - !tracking_status_cookie.getItem() && - !tracking_status_cookie_declined.getItem() + window.location.pathname.includes("eu") && + !tracking_status_cookie.getItem() && + !tracking_status_cookie_declined.getItem() ) { - popupElement.classList.remove("hide-element"); - document.body.classList.add("show-cookie"); + popupElement.classList.remove("hide-element"); + document.body.classList.add("show-cookie"); } // Select the accept and decline buttons @@ -613,75 +583,71 @@ const acceptButton = document.getElementById("accept-cookie"); const declineButton = document.getElementById("dont-accept-cookie"); acceptButton?.addEventListener("click", function () { - tracking_status_cookie.setItem(true); - popupElement.classList.add("hide-element"); - document.body.classList.remove("show-cookie"); + tracking_status_cookie.setItem(true); + popupElement.classList.add("hide-element"); + document.body.classList.remove("show-cookie"); }); declineButton?.addEventListener("click", function () { - tracking_status_cookie_declined.setItem(true); - tracking_status_cookie.setItem(false); - popupElement.classList.add("hide-element"); - document.body.classList.remove("show-cookie"); + tracking_status_cookie_declined.setItem(true); + tracking_status_cookie.setItem(false); + popupElement.classList.add("hide-element"); + document.body.classList.remove("show-cookie"); }); - - // var targetPaths = [ - "/careers", - "/locations", - "/derivtech", - "/derivlife", - "/eu-careers", - "/our-locations", + "/careers", + "/locations", + "/derivtech", + "/derivlife", + "/eu-careers", + "/our-locations", ]; var path = window.location.pathname; if (targetPaths.some((targetPath) => path.includes(targetPath))) { - var headTag = document.head; - var linkElements = headTag.querySelectorAll("link"); - linkElements.forEach(function (linkElement) { - if (linkElement.hasAttribute("hreflang")) { - if (linkElement.getAttribute("hreflang") !== "x-default") { - linkElement.remove(); - } - } - }); + var headTag = document.head; + var linkElements = headTag.querySelectorAll("link"); + linkElements.forEach(function (linkElement) { + if (linkElement.hasAttribute("hreflang")) { + if (linkElement.getAttribute("hreflang") !== "x-default") { + linkElement.remove(); + } + } + }); } // - - // const setEvent = (event) => { - let storedEvents = []; - let cacheCookie = parseCookies(document.cookie, "cached_analytics_events"); - if (cacheCookie) storedEvents = JSON.parse(cacheCookie); - - storedEvents.push(event); - document.cookie = `cached_analytics_events=${JSON.stringify( - storedEvents - )}; path=/; Domain=.deriv.com`; + let storedEvents = []; + let cacheCookie = parseCookies(document.cookie, "cached_analytics_events"); + if (cacheCookie) storedEvents = JSON.parse(cacheCookie); + + storedEvents.push(event); + document.cookie = `cached_analytics_events=${JSON.stringify( + storedEvents + )}; path=/; Domain=.deriv.com`; }; const trackEventWithCache = (event) => { - if (window.rudderanalytics) { - window.rudderanalytics.track(event.name, event.properties); - } else { - setEvent(event); - } + if (window.rudderanalytics) { + window.rudderanalytics.track(event.name, event.properties); + } else { + setEvent(event); + } }; window.addClickListener = function (button, eventName, eventProperties) { - if (button) { - button.addEventListener("click", function () { - trackEventWithCache({ - name: eventName, - properties: eventProperties, - }); - }); - } + if (button) { + button.addEventListener("click", function () { + trackEventWithCache({ + name: eventName, + properties: eventProperties, + }); + }); + } }; var btnLiveChat = document?.getElementsByClassName("livechatbtn"); @@ -689,75 +655,75 @@ var btnWhatsapp = document?.getElementsByClassName("whatsapp_chat"); var btnTradershub = document?.getElementsByClassName("tradershub-btn"); var btnTryFreeDemo = document.querySelectorAll(".btn-free-demo .w-button"); var btnTryFreeDemoFooter = document.querySelectorAll( - '.btn-free-demo [data-class="w-button"]' + '.btn-free-demo [data-class="w-button"]' ); const btnNavbarPrimary = document.querySelectorAll( - '[data-attributes="btn-primary-nav"]' + '[data-attributes="btn-primary-nav"]' ); const btnLoginNavbar = document.querySelectorAll( - '[data-attributes="btn-secondary-nav"]' + '[data-attributes="btn-secondary-nav"]' ); if (btnLiveChat) { - Array.from(btnLiveChat).forEach((button) => { - window.addClickListener(button, "ce_widget_usage_form", { - action: "click", - widget_name: "livechat", - }); + Array.from(btnLiveChat).forEach((button) => { + window.addClickListener(button, "ce_widget_usage_form", { + action: "click", + widget_name: "livechat", }); + }); } if (btnWhatsapp) { - Array.from(btnWhatsapp).forEach((button) => { - window.addClickListener(button, "ce_widget_usage_form", { - action: "click", - widget_name: "whatsapp", - }); + Array.from(btnWhatsapp).forEach((button) => { + window.addClickListener(button, "ce_widget_usage_form", { + action: "click", + widget_name: "whatsapp", }); + }); } if (btnTradershub) { - Array.from(btnTradershub).forEach((button) => { - window.addClickListener(button, "ce_cta_clicks", { - action: "click", - cta_name: "Traders Hub", - }); + Array.from(btnTradershub).forEach((button) => { + window.addClickListener(button, "ce_cta_clicks", { + action: "click", + cta_name: "Traders Hub", }); + }); } if (btnTryFreeDemo) { - Array.from(btnTryFreeDemo).forEach((button) => { - window.addClickListener(button, "ce_cta_clicks", { - action: "click", - cta_name: "Try free demo", - }); + Array.from(btnTryFreeDemo).forEach((button) => { + window.addClickListener(button, "ce_cta_clicks", { + action: "click", + cta_name: "Try free demo", }); + }); } if (btnTryFreeDemoFooter) { - Array.from(btnTryFreeDemoFooter).forEach((button) => { - window.addClickListener(button, "ce_cta_clicks", { - action: "click", - cta_name: "Try free demo", - }); + Array.from(btnTryFreeDemoFooter).forEach((button) => { + window.addClickListener(button, "ce_cta_clicks", { + action: "click", + cta_name: "Try free demo", }); + }); } if (btnNavbarPrimary) { - Array.from(btnNavbarPrimary).forEach((button) => { - if (!button.classList.contains("tradershub-btn")) { - window.addClickListener(button, "ce_cta_clicks", { - action: "click", - cta_name: "Try free demo", - }); - } - }); + Array.from(btnNavbarPrimary).forEach((button) => { + if (!button.classList.contains("tradershub-btn")) { + window.addClickListener(button, "ce_cta_clicks", { + action: "click", + cta_name: "Try free demo", + }); + } + }); } if (btnLoginNavbar) { - Array.from(btnLoginNavbar).forEach((button) => { - window.addClickListener(button, "ce_cta_clicks", { - action: "click", - cta_name: "Login", - }); + Array.from(btnLoginNavbar).forEach((button) => { + window.addClickListener(button, "ce_cta_clicks", { + action: "click", + cta_name: "Login", }); + }); } const RUDDERSTACK_STAGING_KEY = "1lN3tsFD2nruGFgM5F074DC2hMB"; @@ -768,25 +734,20 @@ const GB_PROD_CLIENT_KEY = "sdk-UhZV3cNEg5nLNLNS"; const GB_PROD_DECRYPTION_KEY = "nre64BV0dNIa44zW4tz5ow=="; var GB_CLIENT_KEY, RUDDERSTACK_KEY, GB_DECRYPTION_KEY; if ( - window.location.hostname === "deriv.com" || - window.location.hostname === "deriv.be" || - window.location.hostname === "deriv.me" + window.location.hostname === "deriv.com" || + window.location.hostname === "deriv.be" || + window.location.hostname === "deriv.me" ) { - GB_CLIENT_KEY = GB_PROD_CLIENT_KEY; - GB_DECRYPTION_KEY = GB_PROD_DECRYPTION_KEY; - RUDDERSTACK_KEY = RUDDERSTACK_PRODUCTION_KEY; + GB_CLIENT_KEY = GB_PROD_CLIENT_KEY; + GB_DECRYPTION_KEY = GB_PROD_DECRYPTION_KEY; + RUDDERSTACK_KEY = RUDDERSTACK_PRODUCTION_KEY; } else { - GB_CLIENT_KEY = GB_STAGING_CLIENT_KEY; - GB_DECRYPTION_KEY = GB_STAGING_DECRYPTION_KEY; - RUDDERSTACK_KEY = RUDDERSTACK_STAGING_KEY; + GB_CLIENT_KEY = GB_STAGING_CLIENT_KEY; + GB_DECRYPTION_KEY = GB_STAGING_DECRYPTION_KEY; + RUDDERSTACK_KEY = RUDDERSTACK_STAGING_KEY; } -client_information = window.parseCookies( - document.cookie, - "client_information" -); -const clientInfo = client_information - ? JSON.parse(client_information) - : null; +client_information = window.parseCookies(document.cookie, "client_information"); +const clientInfo = client_information ? JSON.parse(client_information) : null; const utm_data_string = window.parseCookies(document.cookie, "utm_data"); const utm_data = utm_data_string ? JSON.parse(utm_data_string) : {}; const { utm_source, utm_medium, utm_campaign } = utm_data; @@ -794,161 +755,149 @@ const cookies = window.parseCookies(document.cookie, "signup_device"); let signupDevice = null; const isBrowser = () => typeof window !== "undefined"; const getLanguage = () => - isBrowser() ? localStorage.getItem("i18n") || navigator.language : null; + isBrowser() ? localStorage.getItem("i18n") || navigator.language : null; if (cookies) { - signupDevice = JSON.parse(cookies)?.signup_device || null; + signupDevice = JSON.parse(cookies)?.signup_device || null; } const initialiseConfig = { - growthbookKey: GB_CLIENT_KEY, - growthbookDecryptionKey: GB_DECRYPTION_KEY, - rudderstackKey: RUDDERSTACK_KEY, - growthbookOptions: { - navigate: (url) => window.location.replace(url), - antiFlicker: false, - navigateDelay: 0, - attributes: { - country: - window.parseCookies(document.cookie, "clients_country") || - window.parseCookies(document.cookie, "website_status"), - user_language: - window.parseCookies(document.cookie, "user_language") || - getLanguage(), - device_language: - window.parseCookies(document.cookie, "language") || " ", - device_type: signupDevice, - utm_source: utm_data?.["utm_source"], - utm_medium: utm_data?.["utm_medium"], - utm_campaign: utm_data?.["utm_campaign"], - is_authorised: !!window.parseCookies( - document.cookie, - "client_information" - ), - loggedIn: !!window.parseCookies( - document.cookie, - "client_information" - ), - url: window.location.href, - }, + growthbookKey: GB_CLIENT_KEY, + growthbookDecryptionKey: GB_DECRYPTION_KEY, + rudderstackKey: RUDDERSTACK_KEY, + growthbookOptions: { + navigate: (url) => window.location.replace(url), + antiFlicker: false, + navigateDelay: 0, + attributes: { + country: + window.parseCookies(document.cookie, "clients_country") || + window.parseCookies(document.cookie, "website_status"), + user_language: + window.parseCookies(document.cookie, "user_language") || getLanguage(), + device_language: window.parseCookies(document.cookie, "language") || " ", + device_type: signupDevice, + utm_source: utm_data?.["utm_source"], + utm_medium: utm_data?.["utm_medium"], + utm_campaign: utm_data?.["utm_campaign"], + is_authorised: !!window.parseCookies( + document.cookie, + "client_information" + ), + loggedIn: !!window.parseCookies(document.cookie, "client_information"), + url: window.location.href, }, + }, }; try { - Analytics?.Analytics.initialise(initialiseConfig); - // Analytics?.Analytics?.getInstances()?.ab?.GrowthBook?.loadFeatures(); - const userId = clientInfo?.user_id - ? clientInfo?.user_id - : Analytics?.Analytics?.getInstances?.().tracking?.getAnonymousId(); - Analytics?.Analytics?.identifyEvent(userId); + Analytics?.Analytics.initialise(initialiseConfig); + // Analytics?.Analytics?.getInstances()?.ab?.GrowthBook?.loadFeatures(); + const userId = clientInfo?.user_id + ? clientInfo?.user_id + : Analytics?.Analytics?.getInstances?.().tracking?.getAnonymousId(); + Analytics?.Analytics?.identifyEvent(userId); } catch (error) { - console.error("Error during initialisation:", error); + console.error("Error during initialisation:", error); } // Analytics?.Analytics?.getInstances()?.ab?.GrowthBook?.loadFeatures(); Analytics?.Analytics?.pageView(location.pathname, "Deriv.com"); // Analytics?.Analytics?.getInstances()?.ab?.GrowthBook?.setURL(window.location.href) window.useGrowthbookFeatureFlag = function ({ featureFlag }) { - let featureFlagValue = Analytics?.Analytics?.getFeatureValue(featureFlag); - function updateFeatureFlagValue() { - const value = Analytics?.Analytics?.getFeatureValue(featureFlag); - featureFlagValue = value; - } - Analytics?.Analytics?.getInstances()?.ab?.GrowthBook?.setRenderer( - updateFeatureFlagValue - ); - return featureFlagValue; + let featureFlagValue = Analytics?.Analytics?.getFeatureValue(featureFlag); + function updateFeatureFlagValue() { + const value = Analytics?.Analytics?.getFeatureValue(featureFlag); + featureFlagValue = value; + } + Analytics?.Analytics?.getInstances()?.ab?.GrowthBook?.setRenderer( + updateFeatureFlagValue + ); + return featureFlagValue; }; // - - // Parse the cookies to get the 'client_information' cookie value const cookieValue = window.parseCookies(document.cookie, "client_information") - ? JSON.parse(window.parseCookies(document.cookie, "client_information")) - : null; + ? JSON.parse(window.parseCookies(document.cookie, "client_information")) + : null; // Hotjar integration if (cookieValue?.loginid) { - window?.hj("identify", cookieValue.loginid, { - is_logged_in: !!window.parseCookies( - document.cookie, - "client_information" - ), - landing_company_shortcode: - cookieValue.landing_company_shortcode || "null", - }); + window?.hj("identify", cookieValue.loginid, { + is_logged_in: !!window.parseCookies(document.cookie, "client_information"), + landing_company_shortcode: cookieValue.landing_company_shortcode || "null", + }); } - - const updateLinkHrefs = () => { - const featureFlagValue = Analytics?.Analytics?.getFeatureValue( - "trigger_os_signup_wf" - ); - const handleOutSystemsRedirection = () => { - const currentDomain = window.location.hostname; - let env; - if ( - currentDomain === "deriv.com" || - currentDomain === "deriv.be" || - currentDomain === "deriv.me" - ) { - env = "production"; - } else if (currentDomain === "staging.deriv.com") { - env = "staging"; - } else { - env = "development"; - } - switch (env) { - case "production": - return "https://hub.deriv.com/tradershub/signup"; - case "staging": - return "https://staging-hub.deriv.com/tradershub/signup"; - default: - return "https://dev-hub.deriv.com/tradershub/signup"; - } - }; - - function isSafari() { - const ua = navigator.userAgent.toLowerCase(); - return /safari/.test(ua) && !/chrome/.test(ua) && !/crios/.test(ua); + const featureFlagValue = Analytics?.Analytics?.getFeatureValue( + "trigger_os_signup_wf" + ); + const handleOutSystemsRedirection = () => { + const currentDomain = window.location.hostname; + let env; + if ( + currentDomain === "deriv.com" || + currentDomain === "deriv.be" || + currentDomain === "deriv.me" + ) { + env = "production"; + } else if (currentDomain === "staging.deriv.com") { + env = "staging"; + } else { + env = "development"; } - - function isIOS() { - const ua = navigator.userAgent.toLowerCase(); - return /ipad|iphone|ipod/.test(ua); + switch (env) { + case "production": + return "https://hub.deriv.com/tradershub/signup"; + case "staging": + return "https://staging-hub.deriv.com/tradershub/signup"; + default: + return "https://dev-hub.deriv.com/tradershub/signup"; } - - const newHref = featureFlagValue - ? isIOS() || isSafari() - ? `https://${window.location.host}/signup` - : handleOutSystemsRedirection() - : `https://${window.location.host}/signup`; - - // Update href attributes - const mainSignupButton = document.getElementById("cta-home-btn-navbar"); - if (mainSignupButton) { - mainSignupButton.href = newHref; + }; + + function isSafari() { + const ua = navigator.userAgent.toLowerCase(); + return /safari/.test(ua) && !/chrome/.test(ua) && !/crios/.test(ua); + } + + function isIOS() { + const ua = navigator.userAgent.toLowerCase(); + return /ipad|iphone|ipod/.test(ua); + } + + const newHref = featureFlagValue + ? isIOS() || isSafari() + ? `https://${window.location.host}/signup` + : handleOutSystemsRedirection() + : `https://${window.location.host}/signup`; + + // Update href attributes + const mainSignupButton = document.getElementById("cta-home-btn-navbar"); + if (mainSignupButton) { + mainSignupButton.href = newHref; + } + + const signupButtons = document.querySelectorAll(".logged-out-btn"); + signupButtons?.forEach((btn) => { + if (btn?.href?.indexOf("/signup") > 0) { + btn.href = newHref; } + }); - const signupButtons = document.querySelectorAll(".logged-out-btn"); - signupButtons?.forEach((btn) => { - if (btn?.href?.indexOf("/signup") > 0) { - btn.href = newHref; - } - }); - - const signupButtonsPlatforms = - document.querySelectorAll(".logged-out-btn a"); - signupButtonsPlatforms?.forEach((btn) => { - if (btn?.href?.indexOf("/signup") > 0) { - btn.href = newHref; - } - }); + const signupButtonsPlatforms = document.querySelectorAll(".logged-out-btn a"); + signupButtonsPlatforms?.forEach((btn) => { + if (btn?.href?.indexOf("/signup") > 0) { + btn.href = newHref; + } + }); }; Analytics?.Analytics?.getInstances() - ?.ab?.GrowthBook?.loadFeatures() - .then(() => { - if (window.location.href.indexOf("/partners") > -1 === false) { - updateLinkHrefs(); - } - }); + ?.ab?.GrowthBook?.loadFeatures() + .then(() => { + if (window.location.href.indexOf("/partners") > -1 === false) { + updateLinkHrefs(); + } + }); + + diff --git a/src/temp-static.min.js b/src/temp-static.min.js index 77d5b71..ba4230c 100644 --- a/src/temp-static.min.js +++ b/src/temp-static.min.js @@ -1 +1 @@ -var e,o,n,i,t,a,r,d,c,s;import{initializeApp as l}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-app.js";import{getDatabase as u,ref as p,onValue as w}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-database.js";function h(e,o,n,i){let t="";if(n){let e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),t="; expires="+e.toUTCString()}document.cookie=i?e+"="+(o||"")+t+`;domain=${i};path=/`:e+"="+(o||"")+t+";path=/"}function m(e,o){const n={};return e.split(";").forEach((e=>{const[o,i]=e.split("=").map((e=>e.trim()));n[o]=decodeURIComponent(i)})),n[o]}function y(e){h("webflow-user-language",e,30)}function N(e){document.cookie=e+"=; Max-Age=-99999999;"}window.emailRegex=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,window.toggleErrorField=(e,o)=>{o?e.classList.remove("error-field"):e.classList.add("error-field")},window.disableButton=function(e){e.disabled=!0,e.style.opacity="0.5"},window.isEuRegion=function(e){const o=e.replace(/\/$/,"");return/^\/(?:[^\/]+\/)?eu(?:\/|$)/.test(o)},window.enableButton=function(e){e.disabled=!1,e.style.opacity="1"},window.getOauthUrl=function(){var e=window.location.href,o=new URL(e).hostname,n=["deriv.com","deriv.be","deriv.me"].find((e=>o.endsWith(e)));return n?`https://oauth.${n}`:"https://oauth.deriv.com"},window.getClientCountry=function(){var e;const o=m(document.cookie,"clients_country"),n=m(document.cookie,"client_information");return n&&(null==(e=JSON.parse(n))?void 0:e.residence)||o},window.deriv_com_url="deriv.com",window.deriv_me_url="deriv.me",window.deriv_be_url="deriv.be",window.webflow_domain="webflow.deriv.com",window.staging_url="staging.deriv.com",window.staging_deriv_be_url="staging.deriv.be",window.domain_list_app_id={[window.deriv_com_url]:"16929",[window.deriv_me_url]:"1411",[window.deriv_be_url]:"30767",[window.webflow_domain]:"53503",[window.staging_url]:"16303"},window.getDomain=()=>{var e=window.location.href;return new URL(e).hostname},window.getAppId=()=>{const e=window.getDomain(),o=new URLSearchParams(window.location.search||"").get("app_id");if(o)return o;const n=localStorage.getItem("config.app_id");if(n)return n;const i={[window.webflow_domain]:window.domain_list_app_id[window.webflow_domain],[window.deriv_be_url]:window.domain_list_app_id[window.deriv_be_url],[window.deriv_me_url]:window.domain_list_app_id[window.deriv_me_url],[window.staging_url]:window.domain_list_app_id[window.staging_url]};return i[e]?i[e]:window.domain_list_app_id[window.deriv_com_url]};const g=()=>{const e=localStorage.getItem("config.server_url"),o=m(document.cookie,"webflow-user-language");let n=o?o.toLowerCase():"en";"zh-cn"!==n&&"zh-tw"!==n||(n=n.replace("-","_"));const i=(e=>{let o="";return e&&Object.keys(e).forEach((n=>{o+=`&${n}=${e[n]}`})),o})((()=>{const e=m(document.cookie,"utm_data");if(e){const o=JSON.parse(e),n={};return["utm_source","utm_ad_id","utm_adgroup_id","utm_adrollclk_id","utm_campaign","utm_campaign_id","utm_content","utm_fbcl_id","utm_gl_client_id","utm_medium","utm_msclk_id","utm_term"].forEach((e=>{o.hasOwnProperty(e)&&(n[e]=o[e])})),n}return null})()),t=m(document.cookie,"affiliate_tracking"),a=t?`&affiliate_token=${t}`:"",r=void["mt5","bot","derivx"].filter((e=>window.location.pathname.includes(e)&&e))||"";return e&&/qa/.test(e)?`https://${e}/oauth2/authorize?app_id=${window.getAppId()}&l=${n}&brand=deriv${a}${i}&platform=${r}`:`${window.getOauthUrl()}/oauth2/authorize?app_id=${(()=>{const e=window.getDomain();return e===window.deriv_me_url?window.domain_list_app_id[window.deriv_me_url]:e===window.deriv_be_url?window.domain_list_app_id[window.deriv_be_url]:e===window.webflow_domain?window.domain_list_app_id[window.webflow_domain]:window.domain_list_app_id[window.deriv_com_url]})()}&l=${n}&brand=deriv${a}${i}&platform=${r}`};if(!!!m(document.cookie,"client_information")){var f=document.createElement("iframe");f.src=(()=>{const e=window.location.hostname;let o;switch(o="deriv.com"===e||"deriv.be"===e||"deriv.me"===e?"production":"staging.deriv.com"===e?"staging":"development",o){case"production":return"https://hub.deriv.com/tradershub/signup";case"staging":return"https://staging-hub.deriv.com/tradershub/signup";default:return"https://dev-hub.deriv.com/tradershub/signup"}})(),f.style.width="0",f.style.height="0",f.style.border="none",f.style.visibility="hidden",f.setAttribute("sandbox","allow-same-origin allow-scripts"),document.body.appendChild(f)}window.establishWebSocketConnection=()=>new Promise(((e,o)=>{const n=m(document.cookie,"webflow-user-language"),i=n?n.toLowerCase():"en",t=localStorage.getItem("config.server_url")||"green.derivws.com";window.websocket=new WebSocket(`wss://${t}/websockets/v3?app_id=${window.getAppId()}&l=${i||"en"}&brand=deriv`),window.websocket.addEventListener("open",(o=>{window.websocket.addEventListener("close",(()=>{window.websocket.close()})),window.websocket.addEventListener("message",(e=>{JSON.parse(e.data)})),e(window.websocket)})),window.websocket.addEventListener("error",(e=>{var n;null==(n=null==window?void 0:window.websocket)||n.close(),o(e)}))})),window.socketMessageSend=async(e,o)=>{var n;try{return(null==window?void 0:window.websocket)&&(null==(n=null==window?void 0:window.websocket)?void 0:n.readyState)===(null==WebSocket?void 0:WebSocket.OPEN)?(window.websocket.send(e),new Promise(((e,n)=>{window.websocket.addEventListener("message",(i=>{const t=JSON.parse(i.data);o===t.msg_type&&(t.error?n(t.error):e(t))}))}))):establishWebSocketConnection().then((()=>(websocket.send(e),new Promise(((e,n)=>{websocket.addEventListener("message",(i=>{const t=JSON.parse(i.data);o===t.msg_type&&(t.error?n(t.error):e(t))}))}))))).catch((e=>Promise.reject(e)))}catch(i){return Promise.reject(i)}};const v=[{id:"appgallery",selectors:[".footer_banner-badge.gallery.w-inline-block",".app-download_link-wrapper.appgallery.w-inline-block"],countries:["af","ax","al","dz","as","ad","ao","aq","am","au","at","az","bh","bd","by","be","bj","bm","bt","bo","ba","bw","bv","br","io","bn","bg","bf","bi","kh","cm","ca","cv","bq","cf","td","cn","cx","cc","km","cg","cd","ck","ci","hr","cu","cw","cy","cz","dk","dj","dm","eg","gq","er","ee","et","fk","fo","fj","fi","fr","pf","tf","ga","gm","ge","de","gh","gi","gr","gl","gu","gg","gn","gw","hm","va","hu","is","in","id","ir","iq","ie","im","il","it","jp","je","jo","kz","ke","ki","kr","kp","kw","kg","la","lv","lb","ls","lr","ly","li","lt","lu","mo","mk","mg","mw","my","mv","ml","mt","mh","mr","mu","yt","mx","fm","md","mc","mn","me","ma","mz","mm","na","nr","np","nl","nc","nz","ne","ng","nu","nf","mp","no","om","pk","pw","ps","pg","pe","ph","pn","pl","pt","qa","re","ro","ru","rw","sh","kn","pm","bl","mf","ws","sm","st","sa","sn","rs","sc","sl","sg","sx","sk","si","sb","so","gs","ss","es","lk","sd","sj","sz","se","ch","sy","tw","tj","tz","th","tl","tg","tk","to","tn","tr","tm","tc","tv","ug","ua","ae","gb","um","us","uz","vu","vi","wf","eh","ye","zm","zw"]},{id:"googlePlay",selectors:[".footer_banner-badge.google.w-inline-block",".app-download_link-wrapper.google.w-inline-block"],countries:["af","ax","as","ad","ai","aq","au","bb","bt","bv","io","bn","bi","ca","bq","cf","cx","cc","cg","cd","ck","cw","gq","et","fk","fo","gf","pf","tf","gl","gp","gu","gg","gy","hm","va","hk","ir","im","jp","je","ki","kp","ls","ly","mg","mw","mh","mq","mr","yt","fm","mn","me","ms","nr","nc","nz","ng","nu","nf","mp","pw","ps","pn","pr","re","sh","kn","lc","pm","vc","bl","mf","st","sg","sx","gs","ss","sj","sz","sy","tl","tk","tc","tv","um","us","vg","vi","wf","eh"]},{id:"appstore",selectors:[".footer_banner-badge.store.w-inline-block",".app-download_link-wrapper.appstore.w-inline-block"],countries:["ax","al","as","ad","aq","aw","au","at","bd","be","bv","io","bg","bi","ca","bq","cf","cx","cc","km","ck","hr","cu","cw","cy","cz","dk","dj","gq","er","ee","et","fk","fo","fi","fr","gf","pf","tf","de","gi","gr","gl","gp","gu","gg","gn","ht","hm","va","hk","hu","is","ir","iq","ie","im","il","it","je","ki","kp","lv","ls","ly","li","lt","lu","mt","mh","mq","yt","fm","me","nl","nc","nz","ng","nu","nf","mp","no","ps","pn","pl","pt","pr","re","ro","sh","pm","bl","mf","ws","sm","sg","sx","sk","si","so","gs","ss","es","sd","sj","se","ch","sy","tw","tl","tg","tk","tr","tv","gb","um","us","vu","vi","wf","eh"]},{id:"p2p",selectors:["#p2payment.accordion_toggle-block","#p2component.section_dp2p","#card_block_p2p.help_category"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"w-dyn-item-p2p",selectors:["div.w-dyn-item"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"hideRow",selectors:["#footer_social-icons_row","#footer_text_row",".footer_risk-warning.w-richtext"],countries:["br","uy","lk","ch","za","ec"]},{id:"hideDiel",selectors:["#footer_text_diel","#footer_social-icons_diel"],countries:["br","uy","lk","ch","za","ec"]}],Y=[{id:"showElems",selectors:[".banner_disclaimer"],countries:["br","uy","lk","ch","za","ec"]}],_=()=>{const e=window.getClientCountry();v.forEach((o=>{const n="hideDiel"===o.id?!o.countries.includes(e):o.countries.includes(e);if(e&&n)return o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((e=>{if(e)if("w-dyn-item-p2p"===o.id){e.querySelector("#card_block_p2p.help_category")&&(e.style.display="none")}else e.style.display="none"}))}));if(!n){const e=document.querySelector(".footer_social-icons.diel");e&&(e.style.display="flex")}})),Y.forEach((o=>{e&&o.countries.includes(e)?o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{if(o){const n=document.querySelector(".page-wrapper");".banner_disclaimer"===e?(n.classList.add("disclaimer-show"),o.classList.remove("hide-element")):o.style.display="block"}}))})):o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{o&&(".banner_disclaimer"===e?o.classList.add("hide-element"):o.style.display="none")}))}))}))},A=JSON.stringify({website_status:1});!async function(){try{const e=await fetch("https://www.cloudflare.com/cdn-cgi/trace"),o=await e.text(),n=Object.fromEntries(o.split("\n").map((e=>e.split("=",2)))).loc.toLowerCase();n!==m(document.cookie,"clients_country")&&(N("clients_country"),h("clients_country",n,30)),_()}catch(e){_()}}();m(document.cookie,"clients_country")||window.socketMessageSend(A,"website_status").then((e=>{m(document.cookie,"clients_country")!==e.website_status.clients_country&&(N("clients_country"),h("clients_country",e.website_status.clients_country,30)),_()})).catch((e=>{}));const b=["ar","bn","de","en","es","fr","it","ko","pl","pt","ru","si","sw","th","tr","vi","zh_cn","zh_tw","zh-cn","zh-tw"];(()=>{var e;const o=window.location.pathname,n=window.location.hash,i=window.location.search,t=o.split("/"),a=t[1],r=b.includes(a||""),d=t.includes("careers")||t.includes("locations")||t.includes("derivtech")||t.includes("derivlife")||t.includes("eu-careers")||t.includes("our-locations");r&&y(a);const c=(null==(e=m(document.cookie,"webflow-user-language"))?void 0:e.toLowerCase())||"en",s=r?a:c;if((r||"en"!==c)&&a!==c)if(r&&a!==c)y(s);else if(!d){const e=(r?t.map((e=>e===a?s:e)).join("/"):s+t.join("/"))+i+n;window.location.href="/"+e}})();const k=function(){let e,o=!1,n=!1;const i=()=>{n=!0,o=!!m(document.cookie,"client_information"),o&&clearInterval(e),document.dispatchEvent(new Event("authStatusChange"))};return i(),e=setInterval(i,800),{getLoggedInStatus:()=>o,getAuthCheckedStatus:()=>n,onAuthStatusChange:e=>document.addEventListener("authStatusChange",e)}}();k.onAuthStatusChange((()=>{if(k.getAuthCheckedStatus()&&k.getLoggedInStatus()){document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.add("hide-element")}))}else if(k.getAuthCheckedStatus()&&!k.getLoggedInStatus()){document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.add("hide-element")}))}}));const L=window.location.href;if(["help-centre"].some((e=>L.includes(e)))){const e=new URL(L).searchParams;e.has("platform")&&"derivgo"===e.get("platform")&&(S=".derivgo-query-element",document.querySelectorAll(S).forEach((e=>{e.style.display="none"})))}var S;const E=document.querySelector(".banner_disclaimer"),C=document.querySelector(".main-wrapper");if(E){new ResizeObserver((e=>{for(let o of e)if(o.target===E){let e=o.target.getBoundingClientRect();C&&(C.style.paddingTop=e.height+"px")}})).observe(E)}window.addEventListener("pageshow",(function(e){if(e.persisted){const e=document.querySelector(".w-nav-overlay");e&&(e.style.display="none",document.querySelector("body").click())}}));const q=u(l({databaseURL:window.location.hostname.includes("staging")?"https://app-config-staging.firebaseio.com":"https://app-config-prod.firebaseio.com"}));let I=!1,z=!1;!function(){var e;const o=document.getElementById("live_chat-wrapper");try{const e=p(q,"remote_config/deriv-com/chat");w(e,(e=>{const n=e.val();I=n.live_chat,z=n.whatsapp_chat;const i=document.querySelector(".whatsapp_chat"),t=document.querySelector(".livechatbtn");i&&(i.style.visibility=z?"visible":"hidden"),t&&(t.style.visibility=I?"visible":"hidden");if(window.location.pathname.includes("/help-centre")){const e=document.querySelectorAll(".livechatbtn");I?e.forEach((e=>{e.style.visibility="visible"})):e.forEach((e=>{e.style.visibility="hidden"}));const o=document.querySelectorAll(".whatsapp_chat");z?o.forEach((e=>{e.style.visibility="visible"})):o.forEach((e=>{e.style.visibility="hidden"}))}window.addEventListener("scroll",(function(){var e,n;(I||z)&&(null==(e=null==o?void 0:o.classList)||e.remove("hide-element")),I||z||null==(n=null==o?void 0:o.classList)||n.add("hide-element")}))}),(e=>{var n;null==(n=null==o?void 0:o.classList)||n.remove("hide-element")}))}catch(n){null==(e=null==o?void 0:o.classList)||e.remove("hide-element")}}();new MutationObserver((function(e){for(const o of e)if(o.addedNodes.length)for(const e of o.addedNodes)e.nodeType===Node.ELEMENT_NODE&&"chat-widget-minimized"===e.id&&(e.style.opacity="0")})).observe(document.body,{childList:!0,subtree:!0});const x=window.getClientCountry();const j=[{country:"af",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"ax",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"al",apple:"No",android:"Yes",huawei:"No"},{country:"dz",apple:"Yes",android:"Yes",huawei:"No"},{country:"as",apple:"N/A",android:"No",huawei:"N/A"},{country:"ad",apple:"N/A",android:"N/A",huawei:"No"},{country:"ao",apple:"Yes",android:"Yes",huawei:"No"},{country:"ai",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"aq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ag",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ar",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"am",apple:"Yes",android:"Yes",huawei:"No"},{country:"aw",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"au",apple:"No",android:"No",huawei:"No"},{country:"at",apple:"No",android:"Yes",huawei:"No"},{country:"az",apple:"Yes",android:"Yes",huawei:"No"},{country:"bs",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bh",apple:"Yes",android:"Yes",huawei:"No"},{country:"bd",apple:"N/A",android:"Yes",huawei:"No"},{country:"bb",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"by",apple:"Yes",android:"Yes",huawei:"No"},{country:"be",apple:"No",android:"Yes",huawei:"No"},{country:"bz",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bj",apple:"Yes",android:"Yes",huawei:"No"},{country:"bm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"bt",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"bo",apple:"Yes",android:"Yes",huawei:"No"},{country:"ba",apple:"Yes",android:"Yes",huawei:"No"},{country:"bw",apple:"Yes",android:"Yes",huawei:"No"},{country:"bv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"br",apple:"Yes",android:"Yes",huawei:"No"},{country:"io",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"bn",apple:"Yes",android:"N/A",huawei:"No"},{country:"bg",apple:"No",android:"Yes",huawei:"No"},{country:"bf",apple:"Yes",android:"Yes",huawei:"No"},{country:"bi",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kh",apple:"Yes",android:"Yes",huawei:"No"},{country:"cm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ca",apple:"No",android:"No",huawei:"No"},{country:"cv",apple:"Yes",android:"Yes",huawei:"No"},{country:"bq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ky",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cf",apple:"N/A",android:"N/A",huawei:"No"},{country:"td",apple:"Yes",android:"Yes",huawei:"No"},{country:"cl",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cn",apple:"Yes",android:"Yes",huawei:"No"},{country:"cx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"co",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"km",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cg",apple:"Yes",android:"N/A",huawei:"No"},{country:"cd",apple:"Yes",android:"N/A",huawei:"No"},{country:"ck",apple:"N/A",android:"N/A",huawei:"No"},{country:"cr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ci",apple:"Yes",android:"Yes",huawei:"No"},{country:"hr",apple:"No",android:"Yes",huawei:"No"},{country:"cu",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cw",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cy",apple:"No",android:"Yes",huawei:"No"},{country:"cz",apple:"No",android:"Yes",huawei:"No"},{country:"dk",apple:"No",android:"Yes",huawei:"No"},{country:"dj",apple:"N/A",android:"Yes",huawei:"No"},{country:"dm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"do",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ec",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"eg",apple:"Yes",android:"Yes",huawei:"No"},{country:"sv",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gq",apple:"N/A",android:"N/A",huawei:"No"},{country:"er",apple:"N/A",android:"Yes",huawei:"No"},{country:"ee",apple:"No",android:"Yes",huawei:"No"},{country:"et",apple:"N/A",android:"N/A",huawei:"No"},{country:"fk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"fo",apple:"N/A",android:"N/A",huawei:"No"},{country:"fj",apple:"Yes",android:"Yes",huawei:"No"},{country:"fi",apple:"No",android:"Yes",huawei:"No"},{country:"fr",apple:"No",android:"Yes",huawei:"No"},{country:"gf",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"pf",apple:"N/A",android:"N/A",huawei:"No"},{country:"tf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ga",apple:"Yes",android:"Yes",huawei:"No"},{country:"gm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ge",apple:"Yes",android:"Yes",huawei:"No"},{country:"de",apple:"No",android:"Yes",huawei:"No"},{country:"gh",apple:"Yes",android:"Yes",huawei:"No"},{country:"gi",apple:"N/A",android:"Yes",huawei:"No"},{country:"gr",apple:"No",android:"Yes",huawei:"No"},{country:"gl",apple:"N/A",android:"N/A",huawei:"No"},{country:"gd",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gp",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"gu",apple:"N/A",android:"No",huawei:"N/A"},{country:"gt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gg",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"gn",apple:"N/A",android:"Yes",huawei:"No"},{country:"gw",apple:"Yes",android:"Yes",huawei:"No"},{country:"gy",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ht",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"hm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"va",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"hn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"hk",apple:"No",android:"No",huawei:"Yes"},{country:"hu",apple:"No",android:"Yes",huawei:"No"},{country:"is",apple:"No",android:"Yes",huawei:"No"},{country:"in",apple:"Yes",android:"Yes",huawei:"No"},{country:"id",apple:"Yes",android:"Yes",huawei:"No"},{country:"ir",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"iq",apple:"No",android:"Yes",huawei:"N/A"},{country:"ie",apple:"No",android:"Yes",huawei:"No"},{country:"im",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"il",apple:"No",android:"Yes",huawei:"No"},{country:"it",apple:"No",android:"Yes",huawei:"No"},{country:"jm",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"jp",apple:"Yes",android:"No",huawei:"No"},{country:"je",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"jo",apple:"Yes",android:"Yes",huawei:"No"},{country:"kz",apple:"Yes",android:"Yes",huawei:"No"},{country:"ke",apple:"Yes",android:"Yes",huawei:"No"},{country:"ki",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kr",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"kp",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kw",apple:"Yes",android:"Yes",huawei:"No"},{country:"kg",apple:"Yes",android:"Yes",huawei:"No"},{country:"la",apple:"Yes",android:"Yes",huawei:"No"},{country:"lv",apple:"No",android:"Yes",huawei:"No"},{country:"lb",apple:"Yes",android:"Yes",huawei:"No"},{country:"ls",apple:"N/A",android:"N/A",huawei:"No"},{country:"lr",apple:"Yes",android:"Yes",huawei:"No"},{country:"ly",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"li",apple:"N/A",android:"Yes",huawei:"No"},{country:"lt",apple:"No",android:"Yes",huawei:"No"},{country:"lu",apple:"No",android:"Yes",huawei:"No"},{country:"mo",apple:"Yes",android:"Yes",huawei:"No"},{country:"mk",apple:"Yes",android:"Yes",huawei:"No"},{country:"mg",apple:"Yes",android:"N/A",huawei:"No"},{country:"mw",apple:"Yes",android:"N/A",huawei:"No"},{country:"my",apple:"Yes",android:"Yes",huawei:"No"},{country:"mv",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"ml",apple:"Yes",android:"Yes",huawei:"No"},{country:"mt",apple:"No",android:"Yes",huawei:"No"},{country:"mh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mq",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"mr",apple:"Yes",android:"N/A",huawei:"No"},{country:"mu",apple:"Yes",android:"Yes",huawei:"No"},{country:"yt",apple:"N/A",android:"N/A",huawei:"No"},{country:"mx",apple:"Yes",android:"Yes",huawei:"No"},{country:"fm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"md",apple:"Yes",android:"Yes",huawei:"No"},{country:"mc",apple:"Yes",android:"Yes",huawei:"No"},{country:"mn",apple:"Yes",android:"N/A",huawei:"No"},{country:"me",apple:"No",android:"N/A",huawei:"No"},{country:"ms",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ma",apple:"Yes",android:"Yes",huawei:"No"},{country:"mz",apple:"Yes",android:"Yes",huawei:"No"},{country:"mm",apple:"Yes",android:"Yes",huawei:"No"},{country:"na",apple:"Yes",android:"Yes",huawei:"No"},{country:"nr",apple:"Yes",android:"N/A",huawei:"No"},{country:"np",apple:"Yes",android:"Yes",huawei:"No"},{country:"nl",apple:"No",android:"Yes",huawei:"No"},{country:"nc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nz",apple:"No",android:"No",huawei:"No"},{country:"ni",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ne",apple:"Yes",android:"Yes",huawei:"No"},{country:"ng",apple:"No",android:"No",huawei:"No"},{country:"nu",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mp",apple:"N/A",android:"No",huawei:"N/A"},{country:"no",apple:"No",android:"Yes",huawei:"No"},{country:"om",apple:"Yes",android:"Yes",huawei:"No"},{country:"pk",apple:"Yes",android:"Yes",huawei:"No"},{country:"pw",apple:"Yes",android:"No",huawei:"N/A"},{country:"ps",apple:"N/A",android:"N/A",huawei:"No"},{country:"pa",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pg",apple:"Yes",android:"Yes",huawei:"No"},{country:"py",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pe",apple:"Yes",android:"Yes",huawei:"No"},{country:"ph",apple:"Yes",android:"Yes",huawei:"No"},{country:"pn",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"pl",apple:"No",android:"Yes",huawei:"No"},{country:"pt",apple:"No",android:"Yes",huawei:"No"},{country:"pr",apple:"N/A",android:"No",huawei:"Yes"},{country:"qa",apple:"Yes",android:"Yes",huawei:"No"},{country:"re",apple:"N/A",android:"N/A",huawei:"No"},{country:"ro",apple:"No",android:"Yes",huawei:"No"},{country:"ru",apple:"Yes",android:"Yes",huawei:"No"},{country:"rw",apple:"Yes",android:"Yes",huawei:"No"},{country:"sh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kn",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"lc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"pm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"vc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"bl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ws",apple:"N/A",android:"Yes",huawei:"No"},{country:"sm",apple:"N/A",android:"Yes",huawei:"No"},{country:"st",apple:"Yes",android:"N/A",huawei:"No"},{country:"sa",apple:"Yes",android:"Yes",huawei:"No"},{country:"sn",apple:"Yes",android:"Yes",huawei:"No"},{country:"rs",apple:"Yes",android:"Yes",huawei:"No"},{country:"sc",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"sl",apple:"Yes",android:"Yes",huawei:"No"},{country:"sg",apple:"No",android:"No",huawei:"No"},{country:"sx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sk",apple:"No",android:"Yes",huawei:"No"},{country:"si",apple:"No",android:"Yes",huawei:"No"},{country:"sb",apple:"Yes",android:"Yes",huawei:"No"},{country:"so",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"za",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gs",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ss",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"es",apple:"No",android:"Yes",huawei:"No"},{country:"lk",apple:"Yes",android:"Yes",huawei:"No"},{country:"sd",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"sr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"sj",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sz",apple:"Yes",android:"N/A",huawei:"No"},{country:"se",apple:"No",android:"Yes",huawei:"No"},{country:"ch",apple:"No",android:"Yes",huawei:"No"},{country:"sy",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tw",apple:"No",android:"Yes",huawei:"No"},{country:"tj",apple:"Yes",android:"Yes",huawei:"No"},{country:"tz",apple:"Yes",android:"Yes",huawei:"No"},{country:"th",apple:"Yes",android:"Yes",huawei:"No"},{country:"tl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tg",apple:"N/A",android:"Yes",huawei:"No"},{country:"tk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"to",apple:"Yes",android:"Yes",huawei:"No"},{country:"tt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"tn",apple:"Yes",android:"Yes",huawei:"No"},{country:"tr",apple:"No",android:"Yes",huawei:"No"},{country:"tm",apple:"Yes",android:"Yes",huawei:"No"},{country:"tc",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"tv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ug",apple:"Yes",android:"Yes",huawei:"No"},{country:"ua",apple:"Yes",android:"Yes",huawei:"No"},{country:"ae",apple:"Yes",android:"Yes",huawei:"No"},{country:"gb",apple:"No",android:"Yes",huawei:"No"},{country:"um",apple:"N/A",android:"No",huawei:"N/A"},{country:"us",apple:"No",android:"No",huawei:"N/A"},{country:"uy",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"uz",apple:"Yes",android:"Yes",huawei:"No"},{country:"vu",apple:"No",android:"Yes",huawei:"N/A"},{country:"ve",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vg",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"vi",apple:"N/A",android:"No",huawei:"N/A"},{country:"wf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"eh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ye",apple:"Yes",android:"Yes",huawei:"No"},{country:"zm",apple:"Yes",android:"Yes",huawei:"No"},{country:"zw",apple:"Yes",android:"Yes",huawei:"No"}].find((e=>e.country===x)),O=j?function(e){const{apple:o,android:n,huawei:i}=e;return"Yes"===o&&"Yes"===n&&"Yes"===i?"Android, iOS & Huawei":"Yes"===o&&"Yes"===n&&"Yes"!==i?"Android, and iOS":"Yes"===o&&"Yes"===i&&"Yes"!==n?"iOS, and Huawei":"Yes"===n&&"Yes"!==o&&"Yes"!==i?"Android":"Yes"===o&&"Yes"===i&&"Yes"!==n?"iOS, and Huawei":"Yes"===o&&"Yes"!==n&&"Yes"!==i?"iOS":"Yes"!==o&&"Yes"!==n&&"Yes"===i?"Huawei":""}(j):"",$=document.getElementById("app-download-heading");$&&($.innerText=O);const B=document.querySelector(".redirection_background-wrapper"),D=document.getElementById("cancel-redirect"),P=document.getElementById("proceed-redirect");if(window.isEuRegion(window.location.pathname)&&B&&D&&P){const e=["deriv.me","deriv.be","deriv.com","app.deriv.me","app.deriv.be","app.deriv.com","docs.deriv.com","community.deriv.com","deriv.statuspage.io","signup.deriv.com","login.deriv.com","api.deriv.com"];let o="",n="_self";document.querySelectorAll("a").forEach((function(i){const t=new URL(i.href,window.location.href),a=new URL(window.location.href);e.includes(t.host)||t.host===a.host||i.addEventListener("click",(function(e){e.preventDefault(),o=t.href,n=i.target||"_self",B.classList.remove("hide-element"),document.body.style.overflow="hidden"}))})),D.addEventListener("click",(function(){B.classList.add("hide-element"),document.body.style.overflow="auto",o=""})),P.addEventListener("click",(function(){o&&(window.open(o,n),o="",B.classList.add("hide-element"),document.body.style.overflow="auto")}))}document.querySelector(".banner_disclaimer")?document.body.classList.add("disclaimer-visible"):document.body.classList.remove("disclaimer-visible");const W=document.querySelectorAll(".navbar_accordion-item");function R(){const e=document.querySelector(".navbar_accordion-trigger.open");e&&e.scrollIntoView({behavior:"smooth",block:"start"})}W.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.overflow="hidden",o.style.transition="max-height 0.3s ease-in, opacity 0.3s ease-in",o.style.opacity="0"})),W.forEach((e=>{const o=e.querySelector(".navbar_accordion-trigger");o.addEventListener("click",(function(){const e=o.classList.contains("open");if(W.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.opacity="0"})),!e){o.classList.add("open");const e=o.nextElementSibling;e.classList.add("open"),e.style.maxHeight=e.scrollHeight+"px",e.style.opacity="1"}}))}));document.querySelectorAll(".navbar_accordion-trigger").forEach((e=>{e.addEventListener("click",(function(){setTimeout(R,300)}))}));const U=new MutationObserver((e=>{e.forEach((e=>{if("class"===e.attributeName){const o=e.target;o.classList.contains("open")&&o.scrollIntoView({behavior:"smooth",block:"start"})}}))}));document.querySelectorAll(".navbar_accordion-item").forEach((e=>{U.observe(e,{attributes:!0})}));const J=new URL(window.location.href),T=new URLSearchParams(J.search),F=T.get("t");if(T.has("referrer")&&null!=F){m(document.cookie,"referrer_token")!==F&&(N("referrer_token"),h("referrer_token",F,365,".deriv.com"))}const H=document.getElementById("navbar-home_login");H&&H.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const M=document.getElementById("res-navbar-home_login");M&&M.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const V=document.getElementById("white-navbar_login");V&&V.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const G=document.getElementById("res-white-navbar_login");function K(e,o,n){let i="";{let e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),i="; expires="+e.toUTCString()}document.cookie=e+"="+(o||"")+i+"; path=/"}G&&G.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()})),window.fallbackLoader="Migrated All",(de=de||[]).push((function(){let e=document.querySelectorAll(".navbar_accordion-trigger");e.forEach((o=>{o.addEventListener("click",(function(){e.forEach((e=>e.classList.remove("current"))),this.classList.add("current")}))}));let o=document.querySelector(".navbar_accordion-link.w--current");if(o){let e=o.closest(".navbar_accordion-item");if(e){let o=e.querySelector(".navbar_accordion-trigger");o&&o.classList.add("current")}}})),(de=de||[]).push((function(){let e=document.querySelector(".locale > .new-navbar_dropdown-link.w--current");if(e){let o=e.getAttribute("hreflang"),n=document.querySelectorAll(".current-locale-iso-code");if(o&&n.length)for(let e of n)e.innerText=o}}));let Z=document.querySelectorAll(".w-locales-items");if(Z.length>0){let e=function(e){let o=document.querySelector('a[hreflang="'+e+'"]');o&&window.location.pathname!==o.getAttribute("href")&&o.click()};Z.forEach((function(e){e.querySelectorAll("a").forEach((function(e){e.addEventListener("click",(function(o){o.preventDefault(),K("webflow-user-language",e.getAttribute("hreflang"),30),window.location.href=e.href}))}))})),window.setLanguageCookie=e=>{K("webflow-user-language",e,30)};let o=function(e){let o=document.cookie.split(";");for(let n=0;ni.includes(e))),o&&t&&e(o)}(de=de||[]).push((function(){if(document.querySelector(".new-navbar_component")){let e=function(){document.body.classList.add("disable-scroll")},o=function(){document.body.classList.remove("disable-scroll")};const n=document.querySelector(".new-navbar_component");n.addEventListener("mouseenter",(()=>{window.innerWidth>991&&e()})),n.addEventListener("mouseleave",(()=>{window.innerWidth>991&&o()}))}})),window.getClientCountry();const Q=window.parseCookies(document.cookie,"webflow-user-language"),X=["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"];if(window.location.pathname.endsWith("p2p")&&!window.location.pathname.startsWith("/blog")){const e=window.getClientCountry();e&&X.includes(e)&&("en"===Q?window.location.replace("/404"):window.location.replace(`/${Q}/404`))}if(void 0!==window.parseCookies(document.cookie,"client_information")){let e=function(e){e.forEach((e=>{e.href="https://app.deriv.com/appstore/traders-hub"}))},o=document.querySelectorAll("a.live-markets_button.is-secondary.is-small.is-purchase.w-button"),n=document.querySelectorAll("a.live-markets_button.is-secondary.is-small.is-sell.w-button");e(o),e(n)}document.getElementById("mobile-menu"),document.getElementById("live_chat-wrapper");const ee=()=>{window.LC_API&&window.LC_API.open_chat_window&&window.LC_API.open_chat_window()},oe=()=>{"true"===new URLSearchParams(window.location.search).get("is_livechat_open")&&ee()},ne=e=>{var o;null==(o=null==window?void 0:window.LiveChatWidget)||o.on("ready",(()=>{window.LC_API.open_chat_window(),window.LC_API.hide_chat_window(),oe();const o=window.parseCookies(document.cookie,"utm_data"),n=o?JSON.parse(o):{},{utm_source:i,utm_medium:t,utm_campaign:a}=n,r=window.parseCookies(document.cookie,"client_information"),d=new URLSearchParams(window.location.search),{loginid:c,email:s,landing_company_shortcode:l,currency:u,residence:p,first_name:w,last_name:h}=r?JSON.parse(r):{},m={is_logged_in:e,loginid:c??"",landing_company_shortcode:l??"",currency:u??"",residence:p??"",email:s??"",platform:d.get("platform")??"",utm_source:i??"",utm_medium:t??"",utm_campaign:a??""};window.LiveChatWidget.call("set_session_variables",m),e?(s&&window.LiveChatWidget.call("set_customer_email",s),w&&h&&window.LiveChatWidget.call("set_customer_name",`${w} ${h}`)):window.LC_API.on_chat_ended=()=>{window.LiveChatWidget.call("set_customer_email"," "),window.LiveChatWidget.call("set_customer_name"," ")},oe(),window.LiveChatWidget.on("new_event",(e=>{e.greeting&&window.LC_API.open_chat_window()}))}))};let ie=!1;const te=()=>{const e=!!window.parseCookies(document.cookie,"client_information");e!==ie&&(ne(e),ie=e)};te(),setInterval(te,2e3),(()=>{if(window.__lc=window.__lc||{},window.__lc.license="12049137",window.LC_API=window.LC_API||{loaded:!1},window.LC_API.loaded)oe();else{const e=document.createElement("script");e.async=!0,e.src="https://cdn.livechatinc.com/tracking.js",e.onload=()=>{window.LC_API.loaded=!0,window.LC_API.on_after_load=function(){ne(!!window.parseCookies(document.cookie,"client_information")),oe()},"undefined"!=typeof LiveChatWidget&&LiveChatWidget.init&&LiveChatWidget.init()},document.body.appendChild(e)}})();const ae=document.querySelectorAll(".livechatbtn");ae.length>0&&ae.forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault(),ee()}))}));const re=document.getElementById("liveChatBtn");re&&re.addEventListener("click",(e=>{e.preventDefault(),ee()}));var de;document.querySelectorAll('a[rel="liveChatBtn"]').forEach((e=>{null==e||e.addEventListener("click",(e=>{e.preventDefault(),ee()}))})),(de=de||[]).push((function(){let e=document.querySelector(".navbar_menu-button");e&&e.addEventListener("click",(function(){let e=window.innerHeight,o=document.querySelector(".new-navbar_main-wrapper");if(o){let n=e-o.offsetHeight,i=document.querySelector(".new-navbar_menu");i&&(i.style.height=`${n}px`)}}))})),(de=de||[]).push((function(){let e=document.querySelector(".lang-mob");e&&e.addEventListener("click",(function(){let e=document.querySelector(".new-navbar_menu-wrapper");e&&e.scrollBy({top:-3e3})}))}));class ce{constructor(e){this.cookieName=e}setItem(e){const o=new Date;o.setDate(o.getDate()+30);const n="expires="+o.toUTCString(),i=encodeURIComponent(JSON.stringify(e));document.cookie=`${this.cookieName}=${i};${n};path=/`}getItem(){const e=document.cookie.split(";");for(let o=0;oye.includes(e)))&&document.head.querySelectorAll("link").forEach((function(e){e.hasAttribute("hreflang")&&"x-default"!==e.getAttribute("hreflang")&&e.remove()}));const Ne=e=>{window.rudderanalytics?window.rudderanalytics.track(e.name,e.properties):(e=>{let o=[],n=parseCookies(document.cookie,"cached_analytics_events");n&&(o=JSON.parse(n)),o.push(e),document.cookie=`cached_analytics_events=${JSON.stringify(o)}; path=/; Domain=.deriv.com`})(e)};window.addClickListener=function(e,o,n){e&&e.addEventListener("click",(function(){Ne({name:o,properties:n})}))};var ge=null==document?void 0:document.getElementsByClassName("livechatbtn"),fe=null==document?void 0:document.getElementsByClassName("whatsapp_chat"),ve=null==document?void 0:document.getElementsByClassName("tradershub-btn"),Ye=document.querySelectorAll(".btn-free-demo .w-button"),_e=document.querySelectorAll('.btn-free-demo [data-class="w-button"]');const Ae=document.querySelectorAll('[data-attributes="btn-primary-nav"]'),be=document.querySelectorAll('[data-attributes="btn-secondary-nav"]');ge&&Array.from(ge).forEach((e=>{window.addClickListener(e,"ce_widget_usage_form",{action:"click",widget_name:"livechat"})})),fe&&Array.from(fe).forEach((e=>{window.addClickListener(e,"ce_widget_usage_form",{action:"click",widget_name:"whatsapp"})})),ve&&Array.from(ve).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Traders Hub"})})),Ye&&Array.from(Ye).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),_e&&Array.from(_e).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),Ae&&Array.from(Ae).forEach((e=>{e.classList.contains("tradershub-btn")||window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),be&&Array.from(be).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Login"})}));var ke,Le,Se;"deriv.com"===window.location.hostname||"deriv.be"===window.location.hostname||"deriv.me"===window.location.hostname?(ke="sdk-UhZV3cNEg5nLNLNS",Se="nre64BV0dNIa44zW4tz5ow==",Le="1oV5agvlcnCZ6IH94wCKM1oR8Pd"):(ke="sdk-9wuqJ1mlcQsSyZQ",Se="",Le="1lN3tsFD2nruGFgM5F074DC2hMB");const Ee=(we=window.parseCookies(document.cookie,"client_information"))?JSON.parse(we):null,Ce=window.parseCookies(document.cookie,"utm_data"),qe=Ce?JSON.parse(Ce):{},Ie=window.parseCookies(document.cookie,"signup_device");let ze=null;Ie&&(ze=(null==(e=JSON.parse(Ie))?void 0:e.signup_device)||null);const xe={growthbookKey:ke,growthbookDecryptionKey:Se,rudderstackKey:Le,growthbookOptions:{navigate:e=>window.location.replace(e),antiFlicker:!1,navigateDelay:0,attributes:{country:window.parseCookies(document.cookie,"clients_country")||window.parseCookies(document.cookie,"website_status"),user_language:window.parseCookies(document.cookie,"user_language")||("undefined"!=typeof window?localStorage.getItem("i18n")||navigator.language:null),device_language:window.parseCookies(document.cookie,"language")||" ",device_type:ze,utm_source:null==qe?void 0:qe.utm_source,utm_medium:null==qe?void 0:qe.utm_medium,utm_campaign:null==qe?void 0:qe.utm_campaign,is_authorised:!!window.parseCookies(document.cookie,"client_information"),loggedIn:!!window.parseCookies(document.cookie,"client_information"),url:window.location.href}}};try{null==Analytics||Analytics.Analytics.initialise(xe);const e=(null==Ee?void 0:Ee.user_id)?null==Ee?void 0:Ee.user_id:null==(i=null==(n=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getInstances)?void 0:n.call(o).tracking)?void 0:i.getAnonymousId();null==(t=null==Analytics?void 0:Analytics.Analytics)||t.identifyEvent(e)}catch(Oe){}null==(a=null==Analytics?void 0:Analytics.Analytics)||a.pageView(location.pathname,"Deriv.com"),window.useGrowthbookFeatureFlag=function({featureFlag:e}){var o,n,i,t,a;let r=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getFeatureValue(e);return null==(a=null==(t=null==(i=null==(n=null==Analytics?void 0:Analytics.Analytics)?void 0:n.getInstances())?void 0:i.ab)?void 0:t.GrowthBook)||a.setRenderer((function(){var o;const n=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getFeatureValue(e);r=n})),r};const je=window.parseCookies(document.cookie,"client_information")?JSON.parse(window.parseCookies(document.cookie,"client_information")):null;(null==je?void 0:je.loginid)&&(null==window||window.hj("identify",je.loginid,{is_logged_in:!!window.parseCookies(document.cookie,"client_information"),landing_company_shortcode:je.landing_company_shortcode||"null"}));null==(s=null==(c=null==(d=null==(r=null==Analytics?void 0:Analytics.Analytics)?void 0:r.getInstances())?void 0:d.ab)?void 0:c.GrowthBook)||s.loadFeatures().then((()=>{window.location.href.indexOf("/partners")>-1==!1&&(()=>{var e;const o=(null==(e=null==Analytics?void 0:Analytics.Analytics)?void 0:e.getFeatureValue("trigger_os_signup_wf"))?function(){const e=navigator.userAgent.toLowerCase();return/ipad|iphone|ipod/.test(e)}()||function(){const e=navigator.userAgent.toLowerCase();return/safari/.test(e)&&!/chrome/.test(e)&&!/crios/.test(e)}()?`https://${window.location.host}/signup`:(()=>{const e=window.location.hostname;let o;switch(o="deriv.com"===e||"deriv.be"===e||"deriv.me"===e?"production":"staging.deriv.com"===e?"staging":"development",o){case"production":return"https://hub.deriv.com/tradershub/signup";case"staging":return"https://staging-hub.deriv.com/tradershub/signup";default:return"https://dev-hub.deriv.com/tradershub/signup"}})():`https://${window.location.host}/signup`,n=document.getElementById("cta-home-btn-navbar");n&&(n.href=o);const i=document.querySelectorAll(".logged-out-btn");null==i||i.forEach((e=>{var n;(null==(n=null==e?void 0:e.href)?void 0:n.indexOf("/signup"))>0&&(e.href=o)}));const t=document.querySelectorAll(".logged-out-btn a");null==t||t.forEach((e=>{var n;(null==(n=null==e?void 0:e.href)?void 0:n.indexOf("/signup"))>0&&(e.href=o)}))})()})); +var e,o,n,i,t,a,r,d,c,s;import{initializeApp as l}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-app.js";import{getDatabase as u,ref as p,onValue as w}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-database.js";function h(e,o,n,i){let t="";if(n){let e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),t="; expires="+e.toUTCString()}document.cookie=i?e+"="+(o||"")+t+`;domain=${i};path=/`:e+"="+(o||"")+t+";path=/"}function m(e,o){const n={};return e.split(";").forEach((e=>{const[o,i]=e.split("=").map((e=>e.trim()));n[o]=decodeURIComponent(i)})),n[o]}function y(e){h("webflow-user-language",e,30)}function N(e){document.cookie=e+"=; Max-Age=-99999999;"}window.emailRegex=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,window.toggleErrorField=(e,o)=>{o?e.classList.remove("error-field"):e.classList.add("error-field")},window.disableButton=function(e){e.disabled=!0,e.style.opacity="0.5"},window.isEuRegion=function(e){const o=e.replace(/\/$/,"");return/^\/(?:[^\/]+\/)?eu(?:\/|$)/.test(o)},window.enableButton=function(e){e.disabled=!1,e.style.opacity="1"},window.getOauthUrl=function(){var e=window.location.href,o=new URL(e).hostname,n=["deriv.com","deriv.be","deriv.me"].find((e=>o.endsWith(e)));return n?`https://oauth.${n}`:"https://oauth.deriv.com"},window.getClientCountry=function(){var e;const o=m(document.cookie,"clients_country"),n=m(document.cookie,"client_information");return n&&(null==(e=JSON.parse(n))?void 0:e.residence)||o},window.deriv_com_url="deriv.com",window.deriv_me_url="deriv.me",window.deriv_be_url="deriv.be",window.webflow_domain="webflow.deriv.com",window.staging_url="staging.deriv.com",window.staging_deriv_be_url="staging.deriv.be",window.domain_list_app_id={[window.deriv_com_url]:"16929",[window.deriv_me_url]:"1411",[window.deriv_be_url]:"30767",[window.webflow_domain]:"53503",[window.staging_url]:"16303"},window.getDomain=()=>{var e=window.location.href;return new URL(e).hostname},window.getAppId=()=>{const e=window.getDomain(),o=new URLSearchParams(window.location.search||"").get("app_id");if(o)return o;const n=localStorage.getItem("config.app_id");if(n)return n;const i={[window.webflow_domain]:window.domain_list_app_id[window.webflow_domain],[window.deriv_be_url]:window.domain_list_app_id[window.deriv_be_url],[window.deriv_me_url]:window.domain_list_app_id[window.deriv_me_url],[window.staging_url]:window.domain_list_app_id[window.staging_url]};return i[e]?i[e]:window.domain_list_app_id[window.deriv_com_url]};const g=()=>{const e=localStorage.getItem("config.server_url"),o=m(document.cookie,"webflow-user-language");let n=o?o.toLowerCase():"en";"zh-cn"!==n&&"zh-tw"!==n||(n=n.replace("-","_"));const i=(e=>{let o="";return e&&Object.keys(e).forEach((n=>{o+=`&${n}=${e[n]}`})),o})((()=>{const e=m(document.cookie,"utm_data");if(e){const o=JSON.parse(e),n={};return["utm_source","utm_ad_id","utm_adgroup_id","utm_adrollclk_id","utm_campaign","utm_campaign_id","utm_content","utm_fbcl_id","utm_gl_client_id","utm_medium","utm_msclk_id","utm_term"].forEach((e=>{o.hasOwnProperty(e)&&(n[e]=o[e])})),n}return null})()),t=m(document.cookie,"affiliate_tracking"),a=t?`&affiliate_token=${t}`:"",r=void["mt5","bot","derivx"].filter((e=>window.location.pathname.includes(e)&&e))||"";return e&&/qa/.test(e)?`https://${e}/oauth2/authorize?app_id=${window.getAppId()}&l=${n}&brand=deriv${a}${i}&platform=${r}`:`${window.getOauthUrl()}/oauth2/authorize?app_id=${(()=>{const e=window.getDomain();return e===window.deriv_me_url?window.domain_list_app_id[window.deriv_me_url]:e===window.deriv_be_url?window.domain_list_app_id[window.deriv_be_url]:e===window.webflow_domain?window.domain_list_app_id[window.webflow_domain]:window.domain_list_app_id[window.deriv_com_url]})()}&l=${n}&brand=deriv${a}${i}&platform=${r}`};if(!!!m(document.cookie,"client_information")){var f=document.createElement("iframe");f.src=(()=>{const e=window.location.hostname;let o;switch(o="deriv.com"===e||"deriv.be"===e||"deriv.me"===e?"production":"staging.deriv.com"===e?"staging":"development",o){case"production":return"https://hub.deriv.com/tradershub/signup";case"staging":return"https://staging-hub.deriv.com/tradershub/signup";default:return"https://dev-hub.deriv.com/tradershub/signup"}})(),f.style.width="0",f.style.height="0",f.style.border="none",f.style.visibility="hidden",f.setAttribute("sandbox","allow-same-origin allow-scripts"),document.body.appendChild(f)}window.establishWebSocketConnection=()=>new Promise(((e,o)=>{const n=m(document.cookie,"webflow-user-language"),i=n?n.toLowerCase():"en",t=localStorage.getItem("config.server_url")||"green.derivws.com";window.websocket=new WebSocket(`wss://${t}/websockets/v3?app_id=${window.getAppId()}&l=${i||"en"}&brand=deriv`),window.websocket.addEventListener("open",(o=>{window.websocket.addEventListener("close",(()=>{window.websocket.close()})),window.websocket.addEventListener("message",(e=>{JSON.parse(e.data)})),e(window.websocket)})),window.websocket.addEventListener("error",(e=>{var n;null==(n=null==window?void 0:window.websocket)||n.close(),o(e)}))})),window.socketMessageSend=async(e,o)=>{var n;try{return(null==window?void 0:window.websocket)&&(null==(n=null==window?void 0:window.websocket)?void 0:n.readyState)===(null==WebSocket?void 0:WebSocket.OPEN)?(window.websocket.send(e),new Promise(((e,n)=>{window.websocket.addEventListener("message",(i=>{const t=JSON.parse(i.data);o===t.msg_type&&(t.error?n(t.error):e(t))}))}))):establishWebSocketConnection().then((()=>(websocket.send(e),new Promise(((e,n)=>{websocket.addEventListener("message",(i=>{const t=JSON.parse(i.data);o===t.msg_type&&(t.error?n(t.error):e(t))}))}))))).catch((e=>Promise.reject(e)))}catch(i){return Promise.reject(i)}};const v=[{id:"appgallery",selectors:[".footer_banner-badge.gallery.w-inline-block",".app-download_link-wrapper.appgallery.w-inline-block"],countries:["af","ax","al","dz","as","ad","ao","aq","am","au","at","az","bh","bd","by","be","bj","bm","bt","bo","ba","bw","bv","br","io","bn","bg","bf","bi","kh","cm","ca","cv","bq","cf","td","cn","cx","cc","km","cg","cd","ck","ci","hr","cu","cw","cy","cz","dk","dj","dm","eg","gq","er","ee","et","fk","fo","fj","fi","fr","pf","tf","ga","gm","ge","de","gh","gi","gr","gl","gu","gg","gn","gw","hm","va","hu","is","in","id","ir","iq","ie","im","il","it","jp","je","jo","kz","ke","ki","kr","kp","kw","kg","la","lv","lb","ls","lr","ly","li","lt","lu","mo","mk","mg","mw","my","mv","ml","mt","mh","mr","mu","yt","mx","fm","md","mc","mn","me","ma","mz","mm","na","nr","np","nl","nc","nz","ne","ng","nu","nf","mp","no","om","pk","pw","ps","pg","pe","ph","pn","pl","pt","qa","re","ro","ru","rw","sh","kn","pm","bl","mf","ws","sm","st","sa","sn","rs","sc","sl","sg","sx","sk","si","sb","so","gs","ss","es","lk","sd","sj","sz","se","ch","sy","tw","tj","tz","th","tl","tg","tk","to","tn","tr","tm","tc","tv","ug","ua","ae","gb","um","us","uz","vu","vi","wf","eh","ye","zm","zw"]},{id:"googlePlay",selectors:[".footer_banner-badge.google.w-inline-block",".app-download_link-wrapper.google.w-inline-block"],countries:["af","ax","as","ad","ai","aq","au","bb","bt","bv","io","bn","bi","ca","bq","cf","cx","cc","cg","cd","ck","cw","gq","et","fk","fo","gf","pf","tf","gl","gp","gu","gg","gy","hm","va","hk","ir","im","jp","je","ki","kp","ls","ly","mg","mw","mh","mq","mr","yt","fm","mn","me","ms","nr","nc","nz","ng","nu","nf","mp","pw","ps","pn","pr","re","sh","kn","lc","pm","vc","bl","mf","st","sg","sx","gs","ss","sj","sz","sy","tl","tk","tc","tv","um","us","vg","vi","wf","eh"]},{id:"appstore",selectors:[".footer_banner-badge.store.w-inline-block",".app-download_link-wrapper.appstore.w-inline-block"],countries:["ax","al","as","ad","aq","aw","au","at","bd","be","bv","io","bg","bi","ca","bq","cf","cx","cc","km","ck","hr","cu","cw","cy","cz","dk","dj","gq","er","ee","et","fk","fo","fi","fr","gf","pf","tf","de","gi","gr","gl","gp","gu","gg","gn","ht","hm","va","hk","hu","is","ir","iq","ie","im","il","it","je","ki","kp","lv","ls","ly","li","lt","lu","mt","mh","mq","yt","fm","me","nl","nc","nz","ng","nu","nf","mp","no","ps","pn","pl","pt","pr","re","ro","sh","pm","bl","mf","ws","sm","sg","sx","sk","si","so","gs","ss","es","sd","sj","se","ch","sy","tw","tl","tg","tk","tr","tv","gb","um","us","vu","vi","wf","eh"]},{id:"p2p",selectors:["#p2payment.accordion_toggle-block","#p2component.section_dp2p","#card_block_p2p.help_category"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"w-dyn-item-p2p",selectors:["div.w-dyn-item"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"hideRow",selectors:["#footer_social-icons_row","#footer_text_row",".footer_risk-warning.w-richtext"],countries:["br","uy","lk","ch","za","ec"]},{id:"hideDiel",selectors:["#footer_text_diel","#footer_social-icons_diel"],countries:["br","uy","lk","ch","za","ec"]}],Y=[{id:"showElems",selectors:[".banner_disclaimer"],countries:["br","uy","lk","ch","za","ec"]}],_=()=>{const e=window.getClientCountry();v.forEach((o=>{const n="hideDiel"===o.id?!o.countries.includes(e):o.countries.includes(e);if(e&&n)return o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((e=>{if(e)if("w-dyn-item-p2p"===o.id){e.querySelector("#card_block_p2p.help_category")&&(e.style.display="none")}else e.style.display="none"}))}));if(!n){const e=document.querySelector(".footer_social-icons.diel");e&&(e.style.display="flex")}})),Y.forEach((o=>{e&&o.countries.includes(e)?o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{if(o){const n=document.querySelector(".page-wrapper");".banner_disclaimer"===e?(n.classList.add("disclaimer-show"),o.classList.remove("hide-element")):o.style.display="block"}}))})):o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{o&&(".banner_disclaimer"===e?o.classList.add("hide-element"):o.style.display="none")}))}))}))},A=JSON.stringify({website_status:1});!async function(){try{const e=await fetch("https://www.cloudflare.com/cdn-cgi/trace"),o=await e.text(),n=Object.fromEntries(o.split("\n").map((e=>e.split("=",2)))).loc.toLowerCase();n!==m(document.cookie,"clients_country")&&(N("clients_country"),h("clients_country",n,30)),_()}catch(e){_()}}();m(document.cookie,"clients_country")||window.socketMessageSend(A,"website_status").then((e=>{m(document.cookie,"clients_country")!==e.website_status.clients_country&&(N("clients_country"),h("clients_country",e.website_status.clients_country,30)),_()})).catch((e=>{}));const b=["ar","bn","de","en","es","fr","it","ko","pl","pt","ru","si","sw","th","tr","vi","zh_cn","zh_tw","zh-cn","zh-tw"];(()=>{var e;const o=window.location.pathname,n=window.location.hash,i=window.location.search,t=o.split("/"),a=t[1],r=b.includes(a||""),d=t.includes("careers")||t.includes("locations")||t.includes("derivtech")||t.includes("derivlife")||t.includes("eu-careers")||t.includes("our-locations");r&&y(a);const c=(null==(e=m(document.cookie,"webflow-user-language"))?void 0:e.toLowerCase())||"en",s=r?a:c;if((r||"en"!==c)&&a!==c)if(r&&a!==c)y(s);else if(!d){const e=(r?t.map((e=>e===a?s:e)).join("/"):s+t.join("/"))+i+n;window.location.href="/"+e}})();const k=function(){let e,o=!1,n=!1;const i=()=>{n=!0,o=!!m(document.cookie,"client_information"),o&&clearInterval(e),document.dispatchEvent(new Event("authStatusChange"))};return i(),e=setInterval(i,800),{getLoggedInStatus:()=>o,getAuthCheckedStatus:()=>n,onAuthStatusChange:e=>document.addEventListener("authStatusChange",e)}}();k.onAuthStatusChange((()=>{if(k.getAuthCheckedStatus()&&k.getLoggedInStatus()){document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.add("hide-element")}))}else if(k.getAuthCheckedStatus()&&!k.getLoggedInStatus()){document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.add("hide-element")}))}}));const L=window.location.href;if(["help-centre"].some((e=>L.includes(e)))){const e=new URL(L).searchParams;e.has("platform")&&"derivgo"===e.get("platform")&&(S=".derivgo-query-element",document.querySelectorAll(S).forEach((e=>{e.style.display="none"})))}var S;const E=document.querySelector(".banner_disclaimer"),C=document.querySelector(".main-wrapper");if(E){new ResizeObserver((e=>{for(let o of e)if(o.target===E){let e=o.target.getBoundingClientRect();C&&(C.style.paddingTop=e.height+"px")}})).observe(E)}window.addEventListener("pageshow",(function(e){if(e.persisted){const e=document.querySelector(".w-nav-overlay");e&&(e.style.display="none",document.querySelector("body").click())}}));const q=u(l({databaseURL:window.location.hostname.includes("staging")?"https://app-config-staging.firebaseio.com":"https://app-config-prod.firebaseio.com"}));let I=!1,z=!1;!function(){var e;const o=document.getElementById("live_chat-wrapper");try{const e=p(q,"remote_config/deriv-com/chat");w(e,(e=>{const n=e.val();I=n.live_chat,z=n.whatsapp_chat;const i=document.querySelector(".whatsapp_chat"),t=document.querySelector(".livechatbtn");i&&(i.style.visibility=z?"visible":"hidden"),t&&(t.style.visibility=I?"visible":"hidden");if(window.location.pathname.includes("/help-centre")){const e=document.querySelectorAll(".livechatbtn");I?e.forEach((e=>{e.style.visibility="visible"})):e.forEach((e=>{e.style.visibility="hidden"}));const o=document.querySelectorAll(".whatsapp_chat");z?o.forEach((e=>{e.style.visibility="visible"})):o.forEach((e=>{e.style.visibility="hidden"}))}window.addEventListener("scroll",(function(){var e,n;(I||z)&&(null==(e=null==o?void 0:o.classList)||e.remove("hide-element")),I||z||null==(n=null==o?void 0:o.classList)||n.add("hide-element")}))}),(e=>{var n;null==(n=null==o?void 0:o.classList)||n.remove("hide-element")}))}catch(n){null==(e=null==o?void 0:o.classList)||e.remove("hide-element")}}();new MutationObserver((function(e){for(const o of e)if(o.addedNodes.length)for(const e of o.addedNodes)e.nodeType===Node.ELEMENT_NODE&&"chat-widget-minimized"===e.id&&(e.style.opacity="0")})).observe(document.body,{childList:!0,subtree:!0});const x=window.getClientCountry();const j=[{country:"af",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"ax",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"al",apple:"No",android:"Yes",huawei:"No"},{country:"dz",apple:"Yes",android:"Yes",huawei:"No"},{country:"as",apple:"N/A",android:"No",huawei:"N/A"},{country:"ad",apple:"N/A",android:"N/A",huawei:"No"},{country:"ao",apple:"Yes",android:"Yes",huawei:"No"},{country:"ai",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"aq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ag",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ar",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"am",apple:"Yes",android:"Yes",huawei:"No"},{country:"aw",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"au",apple:"No",android:"No",huawei:"No"},{country:"at",apple:"No",android:"Yes",huawei:"No"},{country:"az",apple:"Yes",android:"Yes",huawei:"No"},{country:"bs",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bh",apple:"Yes",android:"Yes",huawei:"No"},{country:"bd",apple:"N/A",android:"Yes",huawei:"No"},{country:"bb",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"by",apple:"Yes",android:"Yes",huawei:"No"},{country:"be",apple:"No",android:"Yes",huawei:"No"},{country:"bz",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bj",apple:"Yes",android:"Yes",huawei:"No"},{country:"bm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"bt",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"bo",apple:"Yes",android:"Yes",huawei:"No"},{country:"ba",apple:"Yes",android:"Yes",huawei:"No"},{country:"bw",apple:"Yes",android:"Yes",huawei:"No"},{country:"bv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"br",apple:"Yes",android:"Yes",huawei:"No"},{country:"io",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"bn",apple:"Yes",android:"N/A",huawei:"No"},{country:"bg",apple:"No",android:"Yes",huawei:"No"},{country:"bf",apple:"Yes",android:"Yes",huawei:"No"},{country:"bi",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kh",apple:"Yes",android:"Yes",huawei:"No"},{country:"cm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ca",apple:"No",android:"No",huawei:"No"},{country:"cv",apple:"Yes",android:"Yes",huawei:"No"},{country:"bq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ky",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cf",apple:"N/A",android:"N/A",huawei:"No"},{country:"td",apple:"Yes",android:"Yes",huawei:"No"},{country:"cl",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cn",apple:"Yes",android:"Yes",huawei:"No"},{country:"cx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"co",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"km",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cg",apple:"Yes",android:"N/A",huawei:"No"},{country:"cd",apple:"Yes",android:"N/A",huawei:"No"},{country:"ck",apple:"N/A",android:"N/A",huawei:"No"},{country:"cr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ci",apple:"Yes",android:"Yes",huawei:"No"},{country:"hr",apple:"No",android:"Yes",huawei:"No"},{country:"cu",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cw",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cy",apple:"No",android:"Yes",huawei:"No"},{country:"cz",apple:"No",android:"Yes",huawei:"No"},{country:"dk",apple:"No",android:"Yes",huawei:"No"},{country:"dj",apple:"N/A",android:"Yes",huawei:"No"},{country:"dm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"do",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ec",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"eg",apple:"Yes",android:"Yes",huawei:"No"},{country:"sv",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gq",apple:"N/A",android:"N/A",huawei:"No"},{country:"er",apple:"N/A",android:"Yes",huawei:"No"},{country:"ee",apple:"No",android:"Yes",huawei:"No"},{country:"et",apple:"N/A",android:"N/A",huawei:"No"},{country:"fk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"fo",apple:"N/A",android:"N/A",huawei:"No"},{country:"fj",apple:"Yes",android:"Yes",huawei:"No"},{country:"fi",apple:"No",android:"Yes",huawei:"No"},{country:"fr",apple:"No",android:"Yes",huawei:"No"},{country:"gf",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"pf",apple:"N/A",android:"N/A",huawei:"No"},{country:"tf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ga",apple:"Yes",android:"Yes",huawei:"No"},{country:"gm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ge",apple:"Yes",android:"Yes",huawei:"No"},{country:"de",apple:"No",android:"Yes",huawei:"No"},{country:"gh",apple:"Yes",android:"Yes",huawei:"No"},{country:"gi",apple:"N/A",android:"Yes",huawei:"No"},{country:"gr",apple:"No",android:"Yes",huawei:"No"},{country:"gl",apple:"N/A",android:"N/A",huawei:"No"},{country:"gd",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gp",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"gu",apple:"N/A",android:"No",huawei:"N/A"},{country:"gt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gg",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"gn",apple:"N/A",android:"Yes",huawei:"No"},{country:"gw",apple:"Yes",android:"Yes",huawei:"No"},{country:"gy",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ht",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"hm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"va",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"hn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"hk",apple:"No",android:"No",huawei:"Yes"},{country:"hu",apple:"No",android:"Yes",huawei:"No"},{country:"is",apple:"No",android:"Yes",huawei:"No"},{country:"in",apple:"Yes",android:"Yes",huawei:"No"},{country:"id",apple:"Yes",android:"Yes",huawei:"No"},{country:"ir",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"iq",apple:"No",android:"Yes",huawei:"N/A"},{country:"ie",apple:"No",android:"Yes",huawei:"No"},{country:"im",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"il",apple:"No",android:"Yes",huawei:"No"},{country:"it",apple:"No",android:"Yes",huawei:"No"},{country:"jm",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"jp",apple:"Yes",android:"No",huawei:"No"},{country:"je",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"jo",apple:"Yes",android:"Yes",huawei:"No"},{country:"kz",apple:"Yes",android:"Yes",huawei:"No"},{country:"ke",apple:"Yes",android:"Yes",huawei:"No"},{country:"ki",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kr",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"kp",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kw",apple:"Yes",android:"Yes",huawei:"No"},{country:"kg",apple:"Yes",android:"Yes",huawei:"No"},{country:"la",apple:"Yes",android:"Yes",huawei:"No"},{country:"lv",apple:"No",android:"Yes",huawei:"No"},{country:"lb",apple:"Yes",android:"Yes",huawei:"No"},{country:"ls",apple:"N/A",android:"N/A",huawei:"No"},{country:"lr",apple:"Yes",android:"Yes",huawei:"No"},{country:"ly",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"li",apple:"N/A",android:"Yes",huawei:"No"},{country:"lt",apple:"No",android:"Yes",huawei:"No"},{country:"lu",apple:"No",android:"Yes",huawei:"No"},{country:"mo",apple:"Yes",android:"Yes",huawei:"No"},{country:"mk",apple:"Yes",android:"Yes",huawei:"No"},{country:"mg",apple:"Yes",android:"N/A",huawei:"No"},{country:"mw",apple:"Yes",android:"N/A",huawei:"No"},{country:"my",apple:"Yes",android:"Yes",huawei:"No"},{country:"mv",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"ml",apple:"Yes",android:"Yes",huawei:"No"},{country:"mt",apple:"No",android:"Yes",huawei:"No"},{country:"mh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mq",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"mr",apple:"Yes",android:"N/A",huawei:"No"},{country:"mu",apple:"Yes",android:"Yes",huawei:"No"},{country:"yt",apple:"N/A",android:"N/A",huawei:"No"},{country:"mx",apple:"Yes",android:"Yes",huawei:"No"},{country:"fm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"md",apple:"Yes",android:"Yes",huawei:"No"},{country:"mc",apple:"Yes",android:"Yes",huawei:"No"},{country:"mn",apple:"Yes",android:"N/A",huawei:"No"},{country:"me",apple:"No",android:"N/A",huawei:"No"},{country:"ms",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ma",apple:"Yes",android:"Yes",huawei:"No"},{country:"mz",apple:"Yes",android:"Yes",huawei:"No"},{country:"mm",apple:"Yes",android:"Yes",huawei:"No"},{country:"na",apple:"Yes",android:"Yes",huawei:"No"},{country:"nr",apple:"Yes",android:"N/A",huawei:"No"},{country:"np",apple:"Yes",android:"Yes",huawei:"No"},{country:"nl",apple:"No",android:"Yes",huawei:"No"},{country:"nc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nz",apple:"No",android:"No",huawei:"No"},{country:"ni",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ne",apple:"Yes",android:"Yes",huawei:"No"},{country:"ng",apple:"No",android:"No",huawei:"No"},{country:"nu",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mp",apple:"N/A",android:"No",huawei:"N/A"},{country:"no",apple:"No",android:"Yes",huawei:"No"},{country:"om",apple:"Yes",android:"Yes",huawei:"No"},{country:"pk",apple:"Yes",android:"Yes",huawei:"No"},{country:"pw",apple:"Yes",android:"No",huawei:"N/A"},{country:"ps",apple:"N/A",android:"N/A",huawei:"No"},{country:"pa",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pg",apple:"Yes",android:"Yes",huawei:"No"},{country:"py",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pe",apple:"Yes",android:"Yes",huawei:"No"},{country:"ph",apple:"Yes",android:"Yes",huawei:"No"},{country:"pn",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"pl",apple:"No",android:"Yes",huawei:"No"},{country:"pt",apple:"No",android:"Yes",huawei:"No"},{country:"pr",apple:"N/A",android:"No",huawei:"Yes"},{country:"qa",apple:"Yes",android:"Yes",huawei:"No"},{country:"re",apple:"N/A",android:"N/A",huawei:"No"},{country:"ro",apple:"No",android:"Yes",huawei:"No"},{country:"ru",apple:"Yes",android:"Yes",huawei:"No"},{country:"rw",apple:"Yes",android:"Yes",huawei:"No"},{country:"sh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kn",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"lc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"pm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"vc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"bl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ws",apple:"N/A",android:"Yes",huawei:"No"},{country:"sm",apple:"N/A",android:"Yes",huawei:"No"},{country:"st",apple:"Yes",android:"N/A",huawei:"No"},{country:"sa",apple:"Yes",android:"Yes",huawei:"No"},{country:"sn",apple:"Yes",android:"Yes",huawei:"No"},{country:"rs",apple:"Yes",android:"Yes",huawei:"No"},{country:"sc",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"sl",apple:"Yes",android:"Yes",huawei:"No"},{country:"sg",apple:"No",android:"No",huawei:"No"},{country:"sx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sk",apple:"No",android:"Yes",huawei:"No"},{country:"si",apple:"No",android:"Yes",huawei:"No"},{country:"sb",apple:"Yes",android:"Yes",huawei:"No"},{country:"so",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"za",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gs",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ss",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"es",apple:"No",android:"Yes",huawei:"No"},{country:"lk",apple:"Yes",android:"Yes",huawei:"No"},{country:"sd",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"sr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"sj",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sz",apple:"Yes",android:"N/A",huawei:"No"},{country:"se",apple:"No",android:"Yes",huawei:"No"},{country:"ch",apple:"No",android:"Yes",huawei:"No"},{country:"sy",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tw",apple:"No",android:"Yes",huawei:"No"},{country:"tj",apple:"Yes",android:"Yes",huawei:"No"},{country:"tz",apple:"Yes",android:"Yes",huawei:"No"},{country:"th",apple:"Yes",android:"Yes",huawei:"No"},{country:"tl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tg",apple:"N/A",android:"Yes",huawei:"No"},{country:"tk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"to",apple:"Yes",android:"Yes",huawei:"No"},{country:"tt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"tn",apple:"Yes",android:"Yes",huawei:"No"},{country:"tr",apple:"No",android:"Yes",huawei:"No"},{country:"tm",apple:"Yes",android:"Yes",huawei:"No"},{country:"tc",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"tv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ug",apple:"Yes",android:"Yes",huawei:"No"},{country:"ua",apple:"Yes",android:"Yes",huawei:"No"},{country:"ae",apple:"Yes",android:"Yes",huawei:"No"},{country:"gb",apple:"No",android:"Yes",huawei:"No"},{country:"um",apple:"N/A",android:"No",huawei:"N/A"},{country:"us",apple:"No",android:"No",huawei:"N/A"},{country:"uy",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"uz",apple:"Yes",android:"Yes",huawei:"No"},{country:"vu",apple:"No",android:"Yes",huawei:"N/A"},{country:"ve",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vg",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"vi",apple:"N/A",android:"No",huawei:"N/A"},{country:"wf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"eh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ye",apple:"Yes",android:"Yes",huawei:"No"},{country:"zm",apple:"Yes",android:"Yes",huawei:"No"},{country:"zw",apple:"Yes",android:"Yes",huawei:"No"}].find((e=>e.country===x)),O=j?function(e){const{apple:o,android:n,huawei:i}=e;return"Yes"===o&&"Yes"===n&&"Yes"===i?"Android, iOS & Huawei":"Yes"===o&&"Yes"===n&&"Yes"!==i?"Android, and iOS":"Yes"===o&&"Yes"===i&&"Yes"!==n?"iOS, and Huawei":"Yes"===n&&"Yes"!==o&&"Yes"!==i?"Android":"Yes"===o&&"Yes"===i&&"Yes"!==n?"iOS, and Huawei":"Yes"===o&&"Yes"!==n&&"Yes"!==i?"iOS":"Yes"!==o&&"Yes"!==n&&"Yes"===i?"Huawei":""}(j):"",$=document.getElementById("app-download-heading");$&&($.innerText=O);const B=document.querySelector(".redirection_background-wrapper"),D=document.getElementById("cancel-redirect"),P=document.getElementById("proceed-redirect");if(window.isEuRegion(window.location.pathname)&&B&&D&&P){const e=["deriv.me","deriv.be","deriv.com","app.deriv.me","app.deriv.be","app.deriv.com","docs.deriv.com","community.deriv.com","deriv.statuspage.io","signup.deriv.com","login.deriv.com","api.deriv.com"];let o="",n="_self";document.querySelectorAll("a").forEach((function(i){const t=new URL(i.href,window.location.href),a=new URL(window.location.href);e.includes(t.host)||t.host===a.host||i.addEventListener("click",(function(e){e.preventDefault(),o=t.href,n=i.target||"_self",B.classList.remove("hide-element"),document.body.style.overflow="hidden"}))})),D.addEventListener("click",(function(){B.classList.add("hide-element"),document.body.style.overflow="auto",o=""})),P.addEventListener("click",(function(){o&&(window.open(o,n),o="",B.classList.add("hide-element"),document.body.style.overflow="auto")}))}document.querySelector(".banner_disclaimer")?document.body.classList.add("disclaimer-visible"):document.body.classList.remove("disclaimer-visible");const W=document.querySelectorAll(".navbar_accordion-item");function R(){const e=document.querySelector(".navbar_accordion-trigger.open");e&&e.scrollIntoView({behavior:"smooth",block:"start"})}W.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.overflow="hidden",o.style.transition="max-height 0.3s ease-in, opacity 0.3s ease-in",o.style.opacity="0"})),W.forEach((e=>{const o=e.querySelector(".navbar_accordion-trigger");o.addEventListener("click",(function(){const e=o.classList.contains("open");if(W.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.opacity="0"})),!e){o.classList.add("open");const e=o.nextElementSibling;e.classList.add("open"),e.style.maxHeight=e.scrollHeight+"px",e.style.opacity="1"}}))}));document.querySelectorAll(".navbar_accordion-trigger").forEach((e=>{e.addEventListener("click",(function(){setTimeout(R,300)}))}));const U=new MutationObserver((e=>{e.forEach((e=>{if("class"===e.attributeName){const o=e.target;o.classList.contains("open")&&o.scrollIntoView({behavior:"smooth",block:"start"})}}))}));document.querySelectorAll(".navbar_accordion-item").forEach((e=>{U.observe(e,{attributes:!0})}));const J=new URL(window.location.href),T=new URLSearchParams(J.search),F=T.get("t");if(T.has("referrer")&&null!=F){m(document.cookie,"referrer_token")!==F&&(N("referrer_token"),h("referrer_token",F,365,".deriv.com"))}const H=document.getElementById("navbar-home_login");H&&H.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const M=document.getElementById("res-navbar-home_login");M&&M.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const V=document.getElementById("white-navbar_login");V&&V.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const G=document.getElementById("res-white-navbar_login");G&&G.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()})),window.fallbackLoader="Migrated All + Removal of Webflow array functions";let K=document.querySelectorAll(".navbar_accordion-trigger");K.forEach((e=>{e.addEventListener("click",(function(){K.forEach((e=>e.classList.remove("current"))),this.classList.add("current")}))}));let Z=document.querySelector(".navbar_accordion-link.w--current");if(Z){let e=Z.closest(".navbar_accordion-item");if(e){let o=e.querySelector(".navbar_accordion-trigger");o&&o.classList.add("current")}}let Q=document.querySelector(".locale > .new-navbar_dropdown-link.w--current");if(Q){let e=Q.getAttribute("hreflang"),o=document.querySelectorAll(".current-locale-iso-code");if(e&&o.length)for(let n of o)n.innerText=e}function X(e,o,n){let i="";{let e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),i="; expires="+e.toUTCString()}document.cookie=e+"="+(o||"")+i+"; path=/"}let ee=document.querySelectorAll(".w-locales-items");if(ee.length>0){let e=function(e){let o=document.querySelector('a[hreflang="'+e+'"]');o&&window.location.pathname!==o.getAttribute("href")&&o.click()};ee.forEach((function(e){e.querySelectorAll("a").forEach((function(e){e.addEventListener("click",(function(o){o.preventDefault(),X("webflow-user-language",e.getAttribute("hreflang"),30),window.location.href=e.href}))}))})),window.setLanguageCookie=e=>{X("webflow-user-language",e,30)};let o=function(e){let o=document.cookie.split(";");for(let n=0;ni.includes(e))),o&&t&&e(o)}if(document.querySelector(".new-navbar_component")){let e=function(){document.body.classList.add("disable-scroll")},o=function(){document.body.classList.remove("disable-scroll")};const n=document.querySelector(".new-navbar_component");n.addEventListener("mouseenter",(()=>{window.innerWidth>991&&e()})),n.addEventListener("mouseleave",(()=>{window.innerWidth>991&&o()}))}window.getClientCountry();const oe=window.parseCookies(document.cookie,"webflow-user-language"),ne=["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"];if(window.location.pathname.endsWith("p2p")&&!window.location.pathname.startsWith("/blog")){const e=window.getClientCountry();e&&ne.includes(e)&&("en"===oe?window.location.replace("/404"):window.location.replace(`/${oe}/404`))}if(void 0!==window.parseCookies(document.cookie,"client_information")){let e=function(e){e.forEach((e=>{e.href="https://app.deriv.com/appstore/traders-hub"}))},o=document.querySelectorAll("a.live-markets_button.is-secondary.is-small.is-purchase.w-button"),n=document.querySelectorAll("a.live-markets_button.is-secondary.is-small.is-sell.w-button");e(o),e(n)}document.getElementById("mobile-menu"),document.getElementById("live_chat-wrapper");const ie=()=>{window.LC_API&&window.LC_API.open_chat_window&&window.LC_API.open_chat_window()},te=()=>{"true"===new URLSearchParams(window.location.search).get("is_livechat_open")&&ie()},ae=e=>{var o;null==(o=null==window?void 0:window.LiveChatWidget)||o.on("ready",(()=>{window.LC_API.open_chat_window(),window.LC_API.hide_chat_window(),te();const o=window.parseCookies(document.cookie,"utm_data"),n=o?JSON.parse(o):{},{utm_source:i,utm_medium:t,utm_campaign:a}=n,r=window.parseCookies(document.cookie,"client_information"),d=new URLSearchParams(window.location.search),{loginid:c,email:s,landing_company_shortcode:l,currency:u,residence:p,first_name:w,last_name:h}=r?JSON.parse(r):{},m={is_logged_in:e,loginid:c??"",landing_company_shortcode:l??"",currency:u??"",residence:p??"",email:s??"",platform:d.get("platform")??"",utm_source:i??"",utm_medium:t??"",utm_campaign:a??""};window.LiveChatWidget.call("set_session_variables",m),e?(s&&window.LiveChatWidget.call("set_customer_email",s),w&&h&&window.LiveChatWidget.call("set_customer_name",`${w} ${h}`)):window.LC_API.on_chat_ended=()=>{window.LiveChatWidget.call("set_customer_email"," "),window.LiveChatWidget.call("set_customer_name"," ")},te(),window.LiveChatWidget.on("new_event",(e=>{e.greeting&&window.LC_API.open_chat_window()}))}))};let re=!1;const de=()=>{const e=!!window.parseCookies(document.cookie,"client_information");e!==re&&(ae(e),re=e)};de(),setInterval(de,2e3),(()=>{if(window.__lc=window.__lc||{},window.__lc.license="12049137",window.LC_API=window.LC_API||{loaded:!1},window.LC_API.loaded)te();else{const e=document.createElement("script");e.async=!0,e.src="https://cdn.livechatinc.com/tracking.js",e.onload=()=>{window.LC_API.loaded=!0,window.LC_API.on_after_load=function(){ae(!!window.parseCookies(document.cookie,"client_information")),te()},"undefined"!=typeof LiveChatWidget&&LiveChatWidget.init&&LiveChatWidget.init()},document.body.appendChild(e)}})();const ce=document.querySelectorAll(".livechatbtn");ce.length>0&&ce.forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault(),ie()}))}));const se=document.getElementById("liveChatBtn");se&&se.addEventListener("click",(e=>{e.preventDefault(),ie()}));document.querySelectorAll('a[rel="liveChatBtn"]').forEach((e=>{null==e||e.addEventListener("click",(e=>{e.preventDefault(),ie()}))}));let le=document.querySelector(".navbar_menu-button");le&&le.addEventListener("click",(function(){let e=window.innerHeight,o=document.querySelector(".new-navbar_main-wrapper");if(o){let n=e-o.offsetHeight,i=document.querySelector(".new-navbar_menu");i&&(i.style.height=`${n}px`)}}));let ue=document.querySelector(".lang-mob");ue&&ue.addEventListener("click",(function(){let e=document.querySelector(".new-navbar_menu-wrapper");e&&e.scrollBy({top:-3e3})}));class pe{constructor(e){this.cookieName=e}setItem(e){const o=new Date;o.setDate(o.getDate()+30);const n="expires="+o.toUTCString(),i=encodeURIComponent(JSON.stringify(e));document.cookie=`${this.cookieName}=${i};${n};path=/`}getItem(){const e=document.cookie.split(";");for(let o=0;ove.includes(e)))&&document.head.querySelectorAll("link").forEach((function(e){e.hasAttribute("hreflang")&&"x-default"!==e.getAttribute("hreflang")&&e.remove()}));const Ye=e=>{window.rudderanalytics?window.rudderanalytics.track(e.name,e.properties):(e=>{let o=[],n=parseCookies(document.cookie,"cached_analytics_events");n&&(o=JSON.parse(n)),o.push(e),document.cookie=`cached_analytics_events=${JSON.stringify(o)}; path=/; Domain=.deriv.com`})(e)};window.addClickListener=function(e,o,n){e&&e.addEventListener("click",(function(){Ye({name:o,properties:n})}))};var _e=null==document?void 0:document.getElementsByClassName("livechatbtn"),Ae=null==document?void 0:document.getElementsByClassName("whatsapp_chat"),be=null==document?void 0:document.getElementsByClassName("tradershub-btn"),ke=document.querySelectorAll(".btn-free-demo .w-button"),Le=document.querySelectorAll('.btn-free-demo [data-class="w-button"]');const Se=document.querySelectorAll('[data-attributes="btn-primary-nav"]'),Ee=document.querySelectorAll('[data-attributes="btn-secondary-nav"]');_e&&Array.from(_e).forEach((e=>{window.addClickListener(e,"ce_widget_usage_form",{action:"click",widget_name:"livechat"})})),Ae&&Array.from(Ae).forEach((e=>{window.addClickListener(e,"ce_widget_usage_form",{action:"click",widget_name:"whatsapp"})})),be&&Array.from(be).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Traders Hub"})})),ke&&Array.from(ke).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),Le&&Array.from(Le).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),Se&&Array.from(Se).forEach((e=>{e.classList.contains("tradershub-btn")||window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),Ee&&Array.from(Ee).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Login"})}));var Ce,qe,Ie;"deriv.com"===window.location.hostname||"deriv.be"===window.location.hostname||"deriv.me"===window.location.hostname?(Ce="sdk-UhZV3cNEg5nLNLNS",Ie="nre64BV0dNIa44zW4tz5ow==",qe="1oV5agvlcnCZ6IH94wCKM1oR8Pd"):(Ce="sdk-9wuqJ1mlcQsSyZQ",Ie="",qe="1lN3tsFD2nruGFgM5F074DC2hMB");const ze=(Ne=window.parseCookies(document.cookie,"client_information"))?JSON.parse(Ne):null,xe=window.parseCookies(document.cookie,"utm_data"),je=xe?JSON.parse(xe):{},Oe=window.parseCookies(document.cookie,"signup_device");let $e=null;Oe&&($e=(null==(e=JSON.parse(Oe))?void 0:e.signup_device)||null);const Be={growthbookKey:Ce,growthbookDecryptionKey:Ie,rudderstackKey:qe,growthbookOptions:{navigate:e=>window.location.replace(e),antiFlicker:!1,navigateDelay:0,attributes:{country:window.parseCookies(document.cookie,"clients_country")||window.parseCookies(document.cookie,"website_status"),user_language:window.parseCookies(document.cookie,"user_language")||("undefined"!=typeof window?localStorage.getItem("i18n")||navigator.language:null),device_language:window.parseCookies(document.cookie,"language")||" ",device_type:$e,utm_source:null==je?void 0:je.utm_source,utm_medium:null==je?void 0:je.utm_medium,utm_campaign:null==je?void 0:je.utm_campaign,is_authorised:!!window.parseCookies(document.cookie,"client_information"),loggedIn:!!window.parseCookies(document.cookie,"client_information"),url:window.location.href}}};try{null==Analytics||Analytics.Analytics.initialise(Be);const e=(null==ze?void 0:ze.user_id)?null==ze?void 0:ze.user_id:null==(i=null==(n=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getInstances)?void 0:n.call(o).tracking)?void 0:i.getAnonymousId();null==(t=null==Analytics?void 0:Analytics.Analytics)||t.identifyEvent(e)}catch(Pe){}null==(a=null==Analytics?void 0:Analytics.Analytics)||a.pageView(location.pathname,"Deriv.com"),window.useGrowthbookFeatureFlag=function({featureFlag:e}){var o,n,i,t,a;let r=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getFeatureValue(e);return null==(a=null==(t=null==(i=null==(n=null==Analytics?void 0:Analytics.Analytics)?void 0:n.getInstances())?void 0:i.ab)?void 0:t.GrowthBook)||a.setRenderer((function(){var o;const n=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getFeatureValue(e);r=n})),r};const De=window.parseCookies(document.cookie,"client_information")?JSON.parse(window.parseCookies(document.cookie,"client_information")):null;(null==De?void 0:De.loginid)&&(null==window||window.hj("identify",De.loginid,{is_logged_in:!!window.parseCookies(document.cookie,"client_information"),landing_company_shortcode:De.landing_company_shortcode||"null"}));null==(s=null==(c=null==(d=null==(r=null==Analytics?void 0:Analytics.Analytics)?void 0:r.getInstances())?void 0:d.ab)?void 0:c.GrowthBook)||s.loadFeatures().then((()=>{window.location.href.indexOf("/partners")>-1==!1&&(()=>{var e;const o=(null==(e=null==Analytics?void 0:Analytics.Analytics)?void 0:e.getFeatureValue("trigger_os_signup_wf"))?function(){const e=navigator.userAgent.toLowerCase();return/ipad|iphone|ipod/.test(e)}()||function(){const e=navigator.userAgent.toLowerCase();return/safari/.test(e)&&!/chrome/.test(e)&&!/crios/.test(e)}()?`https://${window.location.host}/signup`:(()=>{const e=window.location.hostname;let o;switch(o="deriv.com"===e||"deriv.be"===e||"deriv.me"===e?"production":"staging.deriv.com"===e?"staging":"development",o){case"production":return"https://hub.deriv.com/tradershub/signup";case"staging":return"https://staging-hub.deriv.com/tradershub/signup";default:return"https://dev-hub.deriv.com/tradershub/signup"}})():`https://${window.location.host}/signup`,n=document.getElementById("cta-home-btn-navbar");n&&(n.href=o);const i=document.querySelectorAll(".logged-out-btn");null==i||i.forEach((e=>{var n;(null==(n=null==e?void 0:e.href)?void 0:n.indexOf("/signup"))>0&&(e.href=o)}));const t=document.querySelectorAll(".logged-out-btn a");null==t||t.forEach((e=>{var n;(null==(n=null==e?void 0:e.href)?void 0:n.indexOf("/signup"))>0&&(e.href=o)}))})()})); From dd683bdfc4acc72b945e57d31e314b0e28c6eda6 Mon Sep 17 00:00:00 2001 From: Prince Date: Wed, 18 Sep 2024 15:43:09 +0400 Subject: [PATCH 33/57] chore: bundle generator --- .github/hooks/pre-commit | 0 .github/workflows/generate-bundle-url.yml | 41 +++++++++++++++++++++++ scripts/generate-bundle-script.js | 36 ++++++++++++++++++++ scripts/generate-bundle-url.js | 20 +++++++++++ src/bundle-script.min.js | 1 + 5 files changed, 98 insertions(+) create mode 100644 .github/hooks/pre-commit create mode 100644 .github/workflows/generate-bundle-url.yml create mode 100644 scripts/generate-bundle-script.js create mode 100644 scripts/generate-bundle-url.js create mode 100644 src/bundle-script.min.js diff --git a/.github/hooks/pre-commit b/.github/hooks/pre-commit new file mode 100644 index 0000000..e69de29 diff --git a/.github/workflows/generate-bundle-url.yml b/.github/workflows/generate-bundle-url.yml new file mode 100644 index 0000000..f9957c7 --- /dev/null +++ b/.github/workflows/generate-bundle-url.yml @@ -0,0 +1,41 @@ +name: Generate Bundle CDN URL + +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + generate-url: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '18' + + - name: Install dependencies + run: npm install + + - name: Generate CDN URL + id: generate-url + run: | + node scripts/generate-bundle-url.js > url.txt + cat url.txt + + - name: Update PR with CDN URL + uses: actions/github-script@v6 + with: + script: | + const fs = require('fs'); + const url = fs.readFileSync('url.txt', 'utf8').trim(); + const pr_number = process.env.GITHUB_REF.split('/').pop(); + const octokit = github.getOctokit(process.env.GITHUB_TOKEN); + await octokit.rest.issues.update({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: pr_number, + body: `### Test Bundle URL: \n\n[Preview script bundle](${url})\n\n${context.payload.pull_request.body}` + }); diff --git a/scripts/generate-bundle-script.js b/scripts/generate-bundle-script.js new file mode 100644 index 0000000..c9ff084 --- /dev/null +++ b/scripts/generate-bundle-script.js @@ -0,0 +1,36 @@ +// scripts/build-and-copy.js +const { exec } = require('child_process'); +const fs = require('fs'); +const path = require('path'); + +// Define paths relative to the root directory +const rootDir = path.resolve(__dirname, '..'); +const srcFile = path.join(rootDir, 'dist/js/footer_scripts.min.js'); +const destFile = path.join(rootDir, 'src/bundle-script.min.js'); + +// Step 1: Run the build command +exec('npm run build', { cwd: rootDir }, (err, stdout, stderr) => { + if (err) { + console.error(`Error during build: ${stderr}`); + process.exit(1); + } + console.log(stdout); + + // Step 2: Copy the file from dist/js/footer_scripts.min.js to src/bundle-script.min.js + fs.copyFile(srcFile, destFile, (copyErr) => { + if (copyErr) { + console.error(`Error copying file: ${copyErr.message}`); + process.exit(1); + } + console.log(`File copied to ${destFile}`); + + // Step 3: Add the file to git + exec(`git add ${destFile}`, { cwd: rootDir }, (gitErr, gitStdout, gitStderr) => { + if (gitErr) { + console.error(`Error adding file to git: ${gitStderr}`); + process.exit(1); + } + console.log(`File added to git: ${destFile}`); + }); + }); +}); diff --git a/scripts/generate-bundle-url.js b/scripts/generate-bundle-url.js new file mode 100644 index 0000000..866b9cb --- /dev/null +++ b/scripts/generate-bundle-url.js @@ -0,0 +1,20 @@ +// scripts/generate-latest-url.js +const { exec } = require('child_process'); + +// Define your GitHub repository details +const repoName = 'deriv-com/webflow-deriv-com-scripts'; +const filePath = 'src/bundle-script.min.js'; + +// Step 1: Get the latest commit hash +exec('git rev-parse HEAD', (err, stdout, stderr) => { + if (err) { + console.error(`Error getting latest commit hash: ${stderr}`); + process.exit(1); + } + + const latestCommitHash = stdout.trim(); + + // Step 2: Generate the URL with the latest commit hash + const generatedUrl = `https://cdn.jsdelivr.net/gh/${repoName}@${latestCommitHash}/${filePath}`; + console.log(`Generated URL: ${generatedUrl}`); +}); diff --git a/src/bundle-script.min.js b/src/bundle-script.min.js new file mode 100644 index 0000000..d6620c9 --- /dev/null +++ b/src/bundle-script.min.js @@ -0,0 +1 @@ +var e,o,n,i,t,a,r,d,c,s;import{initializeApp as l}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-app.js";import{getDatabase as u,ref as p,onValue as w}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-database.js";function h(e,o,n,i){let t="";if(n){let e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),t="; expires="+e.toUTCString()}document.cookie=i?e+"="+(o||"")+t+`;domain=${i};path=/`:e+"="+(o||"")+t+";path=/"}function m(e,o){const n={};return e.split(";").forEach((e=>{const[o,i]=e.split("=").map((e=>e.trim()));n[o]=decodeURIComponent(i)})),n[o]}function y(e){h("webflow-user-language",e,30)}function N(e){document.cookie=e+"=; Max-Age=-99999999;"}window.emailRegex=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,window.toggleErrorField=(e,o)=>{o?e.classList.remove("error-field"):e.classList.add("error-field")},window.disableButton=function(e){e.disabled=!0,e.style.opacity="0.5"},window.isEuRegion=function(e){const o=e.replace(/\/$/,"");return/^\/(?:[^\/]+\/)?eu(?:\/|$)/.test(o)},window.enableButton=function(e){e.disabled=!1,e.style.opacity="1"},window.getOauthUrl=function(){var e=window.location.href,o=new URL(e).hostname,n=["deriv.com","deriv.be","deriv.me"].find((e=>o.endsWith(e)));return n?`https://oauth.${n}`:"https://oauth.deriv.com"},window.getClientCountry=function(){var e;const o=m(document.cookie,"clients_country"),n=m(document.cookie,"client_information");return n&&(null==(e=JSON.parse(n))?void 0:e.residence)||o},window.deriv_com_url="deriv.com",window.deriv_me_url="deriv.me",window.deriv_be_url="deriv.be",window.webflow_domain="webflow.deriv.com",window.staging_url="staging.deriv.com",window.staging_deriv_be_url="staging.deriv.be",window.domain_list_app_id={[window.deriv_com_url]:"16929",[window.deriv_me_url]:"1411",[window.deriv_be_url]:"30767",[window.webflow_domain]:"53503",[window.staging_url]:"16303"},window.getDomain=()=>{var e=window.location.href;return new URL(e).hostname},window.getAppId=()=>{const e=window.getDomain(),o=new URLSearchParams(window.location.search||"").get("app_id");if(o)return o;const n=localStorage.getItem("config.app_id");if(n)return n;const i={[window.webflow_domain]:window.domain_list_app_id[window.webflow_domain],[window.deriv_be_url]:window.domain_list_app_id[window.deriv_be_url],[window.deriv_me_url]:window.domain_list_app_id[window.deriv_me_url],[window.staging_url]:window.domain_list_app_id[window.staging_url]};return i[e]?i[e]:window.domain_list_app_id[window.deriv_com_url]};const g=()=>{const e=localStorage.getItem("config.server_url"),o=m(document.cookie,"webflow-user-language");let n=o?o.toLowerCase():"en";"zh-cn"!==n&&"zh-tw"!==n||(n=n.replace("-","_"));const i=(e=>{let o="";return e&&Object.keys(e).forEach((n=>{o+=`&${n}=${e[n]}`})),o})((()=>{const e=m(document.cookie,"utm_data");if(e){const o=JSON.parse(e),n={};return["utm_source","utm_ad_id","utm_adgroup_id","utm_adrollclk_id","utm_campaign","utm_campaign_id","utm_content","utm_fbcl_id","utm_gl_client_id","utm_medium","utm_msclk_id","utm_term"].forEach((e=>{o.hasOwnProperty(e)&&(n[e]=o[e])})),n}return null})()),t=m(document.cookie,"affiliate_tracking"),a=t?`&affiliate_token=${t}`:"",r=void["mt5","bot","derivx"].filter((e=>window.location.pathname.includes(e)&&e))||"";return e&&/qa/.test(e)?`https://${e}/oauth2/authorize?app_id=${window.getAppId()}&l=${n}&brand=deriv${a}${i}&platform=${r}`:`${window.getOauthUrl()}/oauth2/authorize?app_id=${(()=>{const e=window.getDomain();return e===window.deriv_me_url?window.domain_list_app_id[window.deriv_me_url]:e===window.deriv_be_url?window.domain_list_app_id[window.deriv_be_url]:e===window.webflow_domain?window.domain_list_app_id[window.webflow_domain]:window.domain_list_app_id[window.deriv_com_url]})()}&l=${n}&brand=deriv${a}${i}&platform=${r}`};if(!!!m(document.cookie,"client_information")){var f=document.createElement("iframe");f.src=(()=>{const e=window.location.hostname;let o;switch(o="deriv.com"===e||"deriv.be"===e||"deriv.me"===e?"production":"staging.deriv.com"===e?"staging":"development",o){case"production":return"https://hub.deriv.com/tradershub/signup";case"staging":return"https://staging-hub.deriv.com/tradershub/signup";default:return"https://dev-hub.deriv.com/tradershub/signup"}})(),f.style.width="0",f.style.height="0",f.style.border="none",f.style.visibility="hidden",f.setAttribute("sandbox","allow-same-origin allow-scripts"),document.body.appendChild(f)}window.establishWebSocketConnection=()=>new Promise(((e,o)=>{const n=m(document.cookie,"webflow-user-language"),i=n?n.toLowerCase():"en",t=localStorage.getItem("config.server_url")||"green.derivws.com";window.websocket=new WebSocket(`wss://${t}/websockets/v3?app_id=${window.getAppId()}&l=${i||"en"}&brand=deriv`),window.websocket.addEventListener("open",(o=>{window.websocket.addEventListener("close",(()=>{window.websocket.close()})),window.websocket.addEventListener("message",(e=>{JSON.parse(e.data)})),e(window.websocket)})),window.websocket.addEventListener("error",(e=>{var n;null==(n=null==window?void 0:window.websocket)||n.close(),o(e)}))})),window.socketMessageSend=async(e,o)=>{var n;try{return(null==window?void 0:window.websocket)&&(null==(n=null==window?void 0:window.websocket)?void 0:n.readyState)===(null==WebSocket?void 0:WebSocket.OPEN)?(window.websocket.send(e),new Promise(((e,n)=>{window.websocket.addEventListener("message",(i=>{const t=JSON.parse(i.data);o===t.msg_type&&(t.error?n(t.error):e(t))}))}))):establishWebSocketConnection().then((()=>(websocket.send(e),new Promise(((e,n)=>{websocket.addEventListener("message",(i=>{const t=JSON.parse(i.data);o===t.msg_type&&(t.error?n(t.error):e(t))}))}))))).catch((e=>Promise.reject(e)))}catch(i){return Promise.reject(i)}};const v=[{id:"appgallery",selectors:[".footer_banner-badge.gallery.w-inline-block",".app-download_link-wrapper.appgallery.w-inline-block"],countries:["af","ax","al","dz","as","ad","ao","aq","am","au","at","az","bh","bd","by","be","bj","bm","bt","bo","ba","bw","bv","br","io","bn","bg","bf","bi","kh","cm","ca","cv","bq","cf","td","cn","cx","cc","km","cg","cd","ck","ci","hr","cu","cw","cy","cz","dk","dj","dm","eg","gq","er","ee","et","fk","fo","fj","fi","fr","pf","tf","ga","gm","ge","de","gh","gi","gr","gl","gu","gg","gn","gw","hm","va","hu","is","in","id","ir","iq","ie","im","il","it","jp","je","jo","kz","ke","ki","kr","kp","kw","kg","la","lv","lb","ls","lr","ly","li","lt","lu","mo","mk","mg","mw","my","mv","ml","mt","mh","mr","mu","yt","mx","fm","md","mc","mn","me","ma","mz","mm","na","nr","np","nl","nc","nz","ne","ng","nu","nf","mp","no","om","pk","pw","ps","pg","pe","ph","pn","pl","pt","qa","re","ro","ru","rw","sh","kn","pm","bl","mf","ws","sm","st","sa","sn","rs","sc","sl","sg","sx","sk","si","sb","so","gs","ss","es","lk","sd","sj","sz","se","ch","sy","tw","tj","tz","th","tl","tg","tk","to","tn","tr","tm","tc","tv","ug","ua","ae","gb","um","us","uz","vu","vi","wf","eh","ye","zm","zw"]},{id:"googlePlay",selectors:[".footer_banner-badge.google.w-inline-block",".app-download_link-wrapper.google.w-inline-block"],countries:["af","ax","as","ad","ai","aq","au","bb","bt","bv","io","bn","bi","ca","bq","cf","cx","cc","cg","cd","ck","cw","gq","et","fk","fo","gf","pf","tf","gl","gp","gu","gg","gy","hm","va","hk","ir","im","jp","je","ki","kp","ls","ly","mg","mw","mh","mq","mr","yt","fm","mn","me","ms","nr","nc","nz","ng","nu","nf","mp","pw","ps","pn","pr","re","sh","kn","lc","pm","vc","bl","mf","st","sg","sx","gs","ss","sj","sz","sy","tl","tk","tc","tv","um","us","vg","vi","wf","eh"]},{id:"appstore",selectors:[".footer_banner-badge.store.w-inline-block",".app-download_link-wrapper.appstore.w-inline-block"],countries:["ax","al","as","ad","aq","aw","au","at","bd","be","bv","io","bg","bi","ca","bq","cf","cx","cc","km","ck","hr","cu","cw","cy","cz","dk","dj","gq","er","ee","et","fk","fo","fi","fr","gf","pf","tf","de","gi","gr","gl","gp","gu","gg","gn","ht","hm","va","hk","hu","is","ir","iq","ie","im","il","it","je","ki","kp","lv","ls","ly","li","lt","lu","mt","mh","mq","yt","fm","me","nl","nc","nz","ng","nu","nf","mp","no","ps","pn","pl","pt","pr","re","ro","sh","pm","bl","mf","ws","sm","sg","sx","sk","si","so","gs","ss","es","sd","sj","se","ch","sy","tw","tl","tg","tk","tr","tv","gb","um","us","vu","vi","wf","eh"]},{id:"p2p",selectors:["#p2payment.accordion_toggle-block","#p2component.section_dp2p","#card_block_p2p.help_category"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"w-dyn-item-p2p",selectors:["div.w-dyn-item"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"hideRow",selectors:["#footer_social-icons_row","#footer_text_row",".footer_risk-warning.w-richtext"],countries:["br","uy","lk","ch","za","ec"]},{id:"hideDiel",selectors:["#footer_text_diel","#footer_social-icons_diel"],countries:["br","uy","lk","ch","za","ec"]}],Y=[{id:"showElems",selectors:[".banner_disclaimer"],countries:["br","uy","lk","ch","za","ec"]}],_=()=>{const e=window.getClientCountry();v.forEach((o=>{const n="hideDiel"===o.id?!o.countries.includes(e):o.countries.includes(e);if(e&&n)return o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((e=>{if(e)if("w-dyn-item-p2p"===o.id){e.querySelector("#card_block_p2p.help_category")&&(e.style.display="none")}else e.style.display="none"}))}));if(!n){const e=document.querySelector(".footer_social-icons.diel");e&&(e.style.display="flex")}})),Y.forEach((o=>{e&&o.countries.includes(e)?o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{if(o){const n=document.querySelector(".page-wrapper");".banner_disclaimer"===e?(n.classList.add("disclaimer-show"),o.classList.remove("hide-element")):o.style.display="block"}}))})):o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{o&&(".banner_disclaimer"===e?o.classList.add("hide-element"):o.style.display="none")}))}))}))},A=JSON.stringify({website_status:1});!async function(){try{const e=await fetch("https://www.cloudflare.com/cdn-cgi/trace"),o=await e.text(),n=Object.fromEntries(o.split("\n").map((e=>e.split("=",2)))).loc.toLowerCase();n!==m(document.cookie,"clients_country")&&(N("clients_country"),h("clients_country",n,30)),_()}catch(e){_()}}();m(document.cookie,"clients_country")||window.socketMessageSend(A,"website_status").then((e=>{m(document.cookie,"clients_country")!==e.website_status.clients_country&&(N("clients_country"),h("clients_country",e.website_status.clients_country,30)),_()})).catch((e=>{}));const b=["ar","bn","de","en","es","fr","it","ko","pl","pt","ru","si","sw","th","tr","vi","zh_cn","zh_tw","zh-cn","zh-tw"];(()=>{var e;const o=window.location.pathname,n=window.location.hash,i=window.location.search,t=o.split("/"),a=t[1],r=b.includes(a||""),d=t.includes("careers")||t.includes("locations")||t.includes("derivtech")||t.includes("derivlife")||t.includes("eu-careers")||t.includes("our-locations");r&&y(a);const c=(null==(e=m(document.cookie,"webflow-user-language"))?void 0:e.toLowerCase())||"en",s=r?a:c;if((r||"en"!==c)&&a!==c)if(r&&a!==c)y(s);else if(!d){const e=(r?t.map((e=>e===a?s:e)).join("/"):s+t.join("/"))+i+n;window.location.href="/"+e}})();const k=function(){let e,o=!1,n=!1;const i=()=>{n=!0,o=!!m(document.cookie,"client_information"),o&&clearInterval(e),document.dispatchEvent(new Event("authStatusChange"))};return i(),e=setInterval(i,800),{getLoggedInStatus:()=>o,getAuthCheckedStatus:()=>n,onAuthStatusChange:e=>document.addEventListener("authStatusChange",e)}}();k.onAuthStatusChange((()=>{if(k.getAuthCheckedStatus()&&k.getLoggedInStatus()){document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.add("hide-element")}))}else if(k.getAuthCheckedStatus()&&!k.getLoggedInStatus()){document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.add("hide-element")}))}}));const L=window.location.href;if(["help-centre"].some((e=>L.includes(e)))){const e=new URL(L).searchParams;e.has("platform")&&"derivgo"===e.get("platform")&&(S=".derivgo-query-element",document.querySelectorAll(S).forEach((e=>{e.style.display="none"})))}var S;const E=document.querySelector(".banner_disclaimer"),C=document.querySelector(".main-wrapper");if(E){new ResizeObserver((e=>{for(let o of e)if(o.target===E){let e=o.target.getBoundingClientRect();C&&(C.style.paddingTop=e.height+"px")}})).observe(E)}window.addEventListener("pageshow",(function(e){if(e.persisted){const e=document.querySelector(".w-nav-overlay");e&&(e.style.display="none",document.querySelector("body").click())}}));const q=u(l({databaseURL:window.location.hostname.includes("staging")?"https://app-config-staging.firebaseio.com":"https://app-config-prod.firebaseio.com"}));let I=!1,z=!1;!function(){var e;const o=document.getElementById("live_chat-wrapper");try{const e=p(q,"remote_config/deriv-com/chat");w(e,(e=>{const n=e.val();I=n.live_chat,z=n.whatsapp_chat;const i=document.querySelector(".whatsapp_chat"),t=document.querySelector(".livechatbtn");i&&(i.style.visibility=z?"visible":"hidden"),t&&(t.style.visibility=I?"visible":"hidden");if(window.location.pathname.includes("/help-centre")){const e=document.querySelectorAll(".livechatbtn");I?e.forEach((e=>{e.style.visibility="visible"})):e.forEach((e=>{e.style.visibility="hidden"}));const o=document.querySelectorAll(".whatsapp_chat");z?o.forEach((e=>{e.style.visibility="visible"})):o.forEach((e=>{e.style.visibility="hidden"}))}window.addEventListener("scroll",(function(){var e,n;(I||z)&&(null==(e=null==o?void 0:o.classList)||e.remove("hide-element")),I||z||null==(n=null==o?void 0:o.classList)||n.add("hide-element")}))}),(e=>{var n;null==(n=null==o?void 0:o.classList)||n.remove("hide-element")}))}catch(n){null==(e=null==o?void 0:o.classList)||e.remove("hide-element")}}();new MutationObserver((function(e){for(const o of e)if(o.addedNodes.length)for(const e of o.addedNodes)e.nodeType===Node.ELEMENT_NODE&&"chat-widget-minimized"===e.id&&(e.style.opacity="0")})).observe(document.body,{childList:!0,subtree:!0});const x=window.getClientCountry();const j=[{country:"af",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"ax",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"al",apple:"No",android:"Yes",huawei:"No"},{country:"dz",apple:"Yes",android:"Yes",huawei:"No"},{country:"as",apple:"N/A",android:"No",huawei:"N/A"},{country:"ad",apple:"N/A",android:"N/A",huawei:"No"},{country:"ao",apple:"Yes",android:"Yes",huawei:"No"},{country:"ai",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"aq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ag",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ar",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"am",apple:"Yes",android:"Yes",huawei:"No"},{country:"aw",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"au",apple:"No",android:"No",huawei:"No"},{country:"at",apple:"No",android:"Yes",huawei:"No"},{country:"az",apple:"Yes",android:"Yes",huawei:"No"},{country:"bs",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bh",apple:"Yes",android:"Yes",huawei:"No"},{country:"bd",apple:"N/A",android:"Yes",huawei:"No"},{country:"bb",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"by",apple:"Yes",android:"Yes",huawei:"No"},{country:"be",apple:"No",android:"Yes",huawei:"No"},{country:"bz",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bj",apple:"Yes",android:"Yes",huawei:"No"},{country:"bm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"bt",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"bo",apple:"Yes",android:"Yes",huawei:"No"},{country:"ba",apple:"Yes",android:"Yes",huawei:"No"},{country:"bw",apple:"Yes",android:"Yes",huawei:"No"},{country:"bv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"br",apple:"Yes",android:"Yes",huawei:"No"},{country:"io",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"bn",apple:"Yes",android:"N/A",huawei:"No"},{country:"bg",apple:"No",android:"Yes",huawei:"No"},{country:"bf",apple:"Yes",android:"Yes",huawei:"No"},{country:"bi",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kh",apple:"Yes",android:"Yes",huawei:"No"},{country:"cm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ca",apple:"No",android:"No",huawei:"No"},{country:"cv",apple:"Yes",android:"Yes",huawei:"No"},{country:"bq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ky",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cf",apple:"N/A",android:"N/A",huawei:"No"},{country:"td",apple:"Yes",android:"Yes",huawei:"No"},{country:"cl",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cn",apple:"Yes",android:"Yes",huawei:"No"},{country:"cx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"co",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"km",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cg",apple:"Yes",android:"N/A",huawei:"No"},{country:"cd",apple:"Yes",android:"N/A",huawei:"No"},{country:"ck",apple:"N/A",android:"N/A",huawei:"No"},{country:"cr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ci",apple:"Yes",android:"Yes",huawei:"No"},{country:"hr",apple:"No",android:"Yes",huawei:"No"},{country:"cu",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cw",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cy",apple:"No",android:"Yes",huawei:"No"},{country:"cz",apple:"No",android:"Yes",huawei:"No"},{country:"dk",apple:"No",android:"Yes",huawei:"No"},{country:"dj",apple:"N/A",android:"Yes",huawei:"No"},{country:"dm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"do",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ec",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"eg",apple:"Yes",android:"Yes",huawei:"No"},{country:"sv",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gq",apple:"N/A",android:"N/A",huawei:"No"},{country:"er",apple:"N/A",android:"Yes",huawei:"No"},{country:"ee",apple:"No",android:"Yes",huawei:"No"},{country:"et",apple:"N/A",android:"N/A",huawei:"No"},{country:"fk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"fo",apple:"N/A",android:"N/A",huawei:"No"},{country:"fj",apple:"Yes",android:"Yes",huawei:"No"},{country:"fi",apple:"No",android:"Yes",huawei:"No"},{country:"fr",apple:"No",android:"Yes",huawei:"No"},{country:"gf",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"pf",apple:"N/A",android:"N/A",huawei:"No"},{country:"tf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ga",apple:"Yes",android:"Yes",huawei:"No"},{country:"gm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ge",apple:"Yes",android:"Yes",huawei:"No"},{country:"de",apple:"No",android:"Yes",huawei:"No"},{country:"gh",apple:"Yes",android:"Yes",huawei:"No"},{country:"gi",apple:"N/A",android:"Yes",huawei:"No"},{country:"gr",apple:"No",android:"Yes",huawei:"No"},{country:"gl",apple:"N/A",android:"N/A",huawei:"No"},{country:"gd",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gp",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"gu",apple:"N/A",android:"No",huawei:"N/A"},{country:"gt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gg",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"gn",apple:"N/A",android:"Yes",huawei:"No"},{country:"gw",apple:"Yes",android:"Yes",huawei:"No"},{country:"gy",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ht",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"hm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"va",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"hn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"hk",apple:"No",android:"No",huawei:"Yes"},{country:"hu",apple:"No",android:"Yes",huawei:"No"},{country:"is",apple:"No",android:"Yes",huawei:"No"},{country:"in",apple:"Yes",android:"Yes",huawei:"No"},{country:"id",apple:"Yes",android:"Yes",huawei:"No"},{country:"ir",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"iq",apple:"No",android:"Yes",huawei:"N/A"},{country:"ie",apple:"No",android:"Yes",huawei:"No"},{country:"im",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"il",apple:"No",android:"Yes",huawei:"No"},{country:"it",apple:"No",android:"Yes",huawei:"No"},{country:"jm",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"jp",apple:"Yes",android:"No",huawei:"No"},{country:"je",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"jo",apple:"Yes",android:"Yes",huawei:"No"},{country:"kz",apple:"Yes",android:"Yes",huawei:"No"},{country:"ke",apple:"Yes",android:"Yes",huawei:"No"},{country:"ki",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kr",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"kp",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kw",apple:"Yes",android:"Yes",huawei:"No"},{country:"kg",apple:"Yes",android:"Yes",huawei:"No"},{country:"la",apple:"Yes",android:"Yes",huawei:"No"},{country:"lv",apple:"No",android:"Yes",huawei:"No"},{country:"lb",apple:"Yes",android:"Yes",huawei:"No"},{country:"ls",apple:"N/A",android:"N/A",huawei:"No"},{country:"lr",apple:"Yes",android:"Yes",huawei:"No"},{country:"ly",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"li",apple:"N/A",android:"Yes",huawei:"No"},{country:"lt",apple:"No",android:"Yes",huawei:"No"},{country:"lu",apple:"No",android:"Yes",huawei:"No"},{country:"mo",apple:"Yes",android:"Yes",huawei:"No"},{country:"mk",apple:"Yes",android:"Yes",huawei:"No"},{country:"mg",apple:"Yes",android:"N/A",huawei:"No"},{country:"mw",apple:"Yes",android:"N/A",huawei:"No"},{country:"my",apple:"Yes",android:"Yes",huawei:"No"},{country:"mv",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"ml",apple:"Yes",android:"Yes",huawei:"No"},{country:"mt",apple:"No",android:"Yes",huawei:"No"},{country:"mh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mq",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"mr",apple:"Yes",android:"N/A",huawei:"No"},{country:"mu",apple:"Yes",android:"Yes",huawei:"No"},{country:"yt",apple:"N/A",android:"N/A",huawei:"No"},{country:"mx",apple:"Yes",android:"Yes",huawei:"No"},{country:"fm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"md",apple:"Yes",android:"Yes",huawei:"No"},{country:"mc",apple:"Yes",android:"Yes",huawei:"No"},{country:"mn",apple:"Yes",android:"N/A",huawei:"No"},{country:"me",apple:"No",android:"N/A",huawei:"No"},{country:"ms",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ma",apple:"Yes",android:"Yes",huawei:"No"},{country:"mz",apple:"Yes",android:"Yes",huawei:"No"},{country:"mm",apple:"Yes",android:"Yes",huawei:"No"},{country:"na",apple:"Yes",android:"Yes",huawei:"No"},{country:"nr",apple:"Yes",android:"N/A",huawei:"No"},{country:"np",apple:"Yes",android:"Yes",huawei:"No"},{country:"nl",apple:"No",android:"Yes",huawei:"No"},{country:"nc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nz",apple:"No",android:"No",huawei:"No"},{country:"ni",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ne",apple:"Yes",android:"Yes",huawei:"No"},{country:"ng",apple:"No",android:"No",huawei:"No"},{country:"nu",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mp",apple:"N/A",android:"No",huawei:"N/A"},{country:"no",apple:"No",android:"Yes",huawei:"No"},{country:"om",apple:"Yes",android:"Yes",huawei:"No"},{country:"pk",apple:"Yes",android:"Yes",huawei:"No"},{country:"pw",apple:"Yes",android:"No",huawei:"N/A"},{country:"ps",apple:"N/A",android:"N/A",huawei:"No"},{country:"pa",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pg",apple:"Yes",android:"Yes",huawei:"No"},{country:"py",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pe",apple:"Yes",android:"Yes",huawei:"No"},{country:"ph",apple:"Yes",android:"Yes",huawei:"No"},{country:"pn",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"pl",apple:"No",android:"Yes",huawei:"No"},{country:"pt",apple:"No",android:"Yes",huawei:"No"},{country:"pr",apple:"N/A",android:"No",huawei:"Yes"},{country:"qa",apple:"Yes",android:"Yes",huawei:"No"},{country:"re",apple:"N/A",android:"N/A",huawei:"No"},{country:"ro",apple:"No",android:"Yes",huawei:"No"},{country:"ru",apple:"Yes",android:"Yes",huawei:"No"},{country:"rw",apple:"Yes",android:"Yes",huawei:"No"},{country:"sh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kn",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"lc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"pm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"vc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"bl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ws",apple:"N/A",android:"Yes",huawei:"No"},{country:"sm",apple:"N/A",android:"Yes",huawei:"No"},{country:"st",apple:"Yes",android:"N/A",huawei:"No"},{country:"sa",apple:"Yes",android:"Yes",huawei:"No"},{country:"sn",apple:"Yes",android:"Yes",huawei:"No"},{country:"rs",apple:"Yes",android:"Yes",huawei:"No"},{country:"sc",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"sl",apple:"Yes",android:"Yes",huawei:"No"},{country:"sg",apple:"No",android:"No",huawei:"No"},{country:"sx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sk",apple:"No",android:"Yes",huawei:"No"},{country:"si",apple:"No",android:"Yes",huawei:"No"},{country:"sb",apple:"Yes",android:"Yes",huawei:"No"},{country:"so",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"za",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gs",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ss",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"es",apple:"No",android:"Yes",huawei:"No"},{country:"lk",apple:"Yes",android:"Yes",huawei:"No"},{country:"sd",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"sr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"sj",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sz",apple:"Yes",android:"N/A",huawei:"No"},{country:"se",apple:"No",android:"Yes",huawei:"No"},{country:"ch",apple:"No",android:"Yes",huawei:"No"},{country:"sy",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tw",apple:"No",android:"Yes",huawei:"No"},{country:"tj",apple:"Yes",android:"Yes",huawei:"No"},{country:"tz",apple:"Yes",android:"Yes",huawei:"No"},{country:"th",apple:"Yes",android:"Yes",huawei:"No"},{country:"tl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tg",apple:"N/A",android:"Yes",huawei:"No"},{country:"tk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"to",apple:"Yes",android:"Yes",huawei:"No"},{country:"tt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"tn",apple:"Yes",android:"Yes",huawei:"No"},{country:"tr",apple:"No",android:"Yes",huawei:"No"},{country:"tm",apple:"Yes",android:"Yes",huawei:"No"},{country:"tc",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"tv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ug",apple:"Yes",android:"Yes",huawei:"No"},{country:"ua",apple:"Yes",android:"Yes",huawei:"No"},{country:"ae",apple:"Yes",android:"Yes",huawei:"No"},{country:"gb",apple:"No",android:"Yes",huawei:"No"},{country:"um",apple:"N/A",android:"No",huawei:"N/A"},{country:"us",apple:"No",android:"No",huawei:"N/A"},{country:"uy",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"uz",apple:"Yes",android:"Yes",huawei:"No"},{country:"vu",apple:"No",android:"Yes",huawei:"N/A"},{country:"ve",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vg",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"vi",apple:"N/A",android:"No",huawei:"N/A"},{country:"wf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"eh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ye",apple:"Yes",android:"Yes",huawei:"No"},{country:"zm",apple:"Yes",android:"Yes",huawei:"No"},{country:"zw",apple:"Yes",android:"Yes",huawei:"No"}].find((e=>e.country===x)),O=j?function(e){const{apple:o,android:n,huawei:i}=e;return"Yes"===o&&"Yes"===n&&"Yes"===i?"Android, iOS & Huawei":"Yes"===o&&"Yes"===n&&"Yes"!==i?"Android, and iOS":"Yes"===o&&"Yes"===i&&"Yes"!==n?"iOS, and Huawei":"Yes"===n&&"Yes"!==o&&"Yes"!==i?"Android":"Yes"===o&&"Yes"===i&&"Yes"!==n?"iOS, and Huawei":"Yes"===o&&"Yes"!==n&&"Yes"!==i?"iOS":"Yes"!==o&&"Yes"!==n&&"Yes"===i?"Huawei":""}(j):"",$=document.getElementById("app-download-heading");$&&($.innerText=O);const B=document.querySelector(".redirection_background-wrapper"),D=document.getElementById("cancel-redirect"),P=document.getElementById("proceed-redirect");if(window.isEuRegion(window.location.pathname)&&B&&D&&P){const e=["deriv.me","deriv.be","deriv.com","app.deriv.me","app.deriv.be","app.deriv.com","docs.deriv.com","community.deriv.com","deriv.statuspage.io","signup.deriv.com","login.deriv.com","api.deriv.com"];let o="",n="_self";document.querySelectorAll("a").forEach((function(i){const t=new URL(i.href,window.location.href),a=new URL(window.location.href);e.includes(t.host)||t.host===a.host||i.addEventListener("click",(function(e){e.preventDefault(),o=t.href,n=i.target||"_self",B.classList.remove("hide-element"),document.body.style.overflow="hidden"}))})),D.addEventListener("click",(function(){B.classList.add("hide-element"),document.body.style.overflow="auto",o=""})),P.addEventListener("click",(function(){o&&(window.open(o,n),o="",B.classList.add("hide-element"),document.body.style.overflow="auto")}))}document.querySelector(".banner_disclaimer")?document.body.classList.add("disclaimer-visible"):document.body.classList.remove("disclaimer-visible");const W=document.querySelectorAll(".navbar_accordion-item");function R(){const e=document.querySelector(".navbar_accordion-trigger.open");e&&e.scrollIntoView({behavior:"smooth",block:"start"})}W.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.overflow="hidden",o.style.transition="max-height 0.3s ease-in, opacity 0.3s ease-in",o.style.opacity="0"})),W.forEach((e=>{const o=e.querySelector(".navbar_accordion-trigger");o.addEventListener("click",(function(){const e=o.classList.contains("open");if(W.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.opacity="0"})),!e){o.classList.add("open");const e=o.nextElementSibling;e.classList.add("open"),e.style.maxHeight=e.scrollHeight+"px",e.style.opacity="1"}}))}));document.querySelectorAll(".navbar_accordion-trigger").forEach((e=>{e.addEventListener("click",(function(){setTimeout(R,300)}))}));const U=new MutationObserver((e=>{e.forEach((e=>{if("class"===e.attributeName){const o=e.target;o.classList.contains("open")&&o.scrollIntoView({behavior:"smooth",block:"start"})}}))}));document.querySelectorAll(".navbar_accordion-item").forEach((e=>{U.observe(e,{attributes:!0})}));const T=new URL(window.location.href),J=new URLSearchParams(T.search),F=J.get("t");if(J.has("referrer")&&null!=F){m(document.cookie,"referrer_token")!==F&&(N("referrer_token"),h("referrer_token",F,365,".deriv.com"))}const H=document.getElementById("navbar-home_login");H&&H.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const M=document.getElementById("res-navbar-home_login");M&&M.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const V=document.getElementById("white-navbar_login");V&&V.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const G=document.getElementById("res-white-navbar_login");G&&G.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()})),alert("Test"),window.fallbackLoader="Migrated All + Removal of Webflow array functions";let K=document.querySelectorAll(".navbar_accordion-trigger");K.forEach((e=>{e.addEventListener("click",(function(){K.forEach((e=>e.classList.remove("current"))),this.classList.add("current")}))}));let Z=document.querySelector(".navbar_accordion-link.w--current");if(Z){let e=Z.closest(".navbar_accordion-item");if(e){let o=e.querySelector(".navbar_accordion-trigger");o&&o.classList.add("current")}}let Q=document.querySelector(".locale > .new-navbar_dropdown-link.w--current");if(Q){let e=Q.getAttribute("hreflang"),o=document.querySelectorAll(".current-locale-iso-code");if(e&&o.length)for(let n of o)n.innerText=e}function X(e,o,n){let i="";{let e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),i="; expires="+e.toUTCString()}document.cookie=e+"="+(o||"")+i+"; path=/"}let ee=document.querySelectorAll(".w-locales-items");if(ee.length>0){let e=function(e){let o=document.querySelector('a[hreflang="'+e+'"]');o&&window.location.pathname!==o.getAttribute("href")&&o.click()};ee.forEach((function(e){e.querySelectorAll("a").forEach((function(e){e.addEventListener("click",(function(o){o.preventDefault(),X("webflow-user-language",e.getAttribute("hreflang"),30),window.location.href=e.href}))}))})),window.setLanguageCookie=e=>{X("webflow-user-language",e,30)};let o=function(e){let o=document.cookie.split(";");for(let n=0;ni.includes(e))),o&&t&&e(o)}if(document.querySelector(".new-navbar_component")){let e=function(){document.body.classList.add("disable-scroll")},o=function(){document.body.classList.remove("disable-scroll")};const n=document.querySelector(".new-navbar_component");n.addEventListener("mouseenter",(()=>{window.innerWidth>991&&e()})),n.addEventListener("mouseleave",(()=>{window.innerWidth>991&&o()}))}window.getClientCountry();const oe=window.parseCookies(document.cookie,"webflow-user-language"),ne=["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"];if(window.location.pathname.endsWith("p2p")&&!window.location.pathname.startsWith("/blog")){const e=window.getClientCountry();e&&ne.includes(e)&&("en"===oe?window.location.replace("/404"):window.location.replace(`/${oe}/404`))}if(void 0!==window.parseCookies(document.cookie,"client_information")){let e=function(e){e.forEach((e=>{e.href="https://app.deriv.com/appstore/traders-hub"}))},o=document.querySelectorAll("a.live-markets_button.is-secondary.is-small.is-purchase.w-button"),n=document.querySelectorAll("a.live-markets_button.is-secondary.is-small.is-sell.w-button");e(o),e(n)}document.getElementById("mobile-menu"),document.getElementById("live_chat-wrapper");const ie=()=>{window.LC_API&&window.LC_API.open_chat_window&&window.LC_API.open_chat_window()},te=()=>{"true"===new URLSearchParams(window.location.search).get("is_livechat_open")&&ie()},ae=e=>{var o;null==(o=null==window?void 0:window.LiveChatWidget)||o.on("ready",(()=>{window.LC_API.open_chat_window(),window.LC_API.hide_chat_window(),te();const o=window.parseCookies(document.cookie,"utm_data"),n=o?JSON.parse(o):{},{utm_source:i,utm_medium:t,utm_campaign:a}=n,r=window.parseCookies(document.cookie,"client_information"),d=new URLSearchParams(window.location.search),{loginid:c,email:s,landing_company_shortcode:l,currency:u,residence:p,first_name:w,last_name:h}=r?JSON.parse(r):{},m={is_logged_in:e,loginid:c??"",landing_company_shortcode:l??"",currency:u??"",residence:p??"",email:s??"",platform:d.get("platform")??"",utm_source:i??"",utm_medium:t??"",utm_campaign:a??""};window.LiveChatWidget.call("set_session_variables",m),e?(s&&window.LiveChatWidget.call("set_customer_email",s),w&&h&&window.LiveChatWidget.call("set_customer_name",`${w} ${h}`)):window.LC_API.on_chat_ended=()=>{window.LiveChatWidget.call("set_customer_email"," "),window.LiveChatWidget.call("set_customer_name"," ")},te(),window.LiveChatWidget.on("new_event",(e=>{e.greeting&&window.LC_API.open_chat_window()}))}))};let re=!1;const de=()=>{const e=!!window.parseCookies(document.cookie,"client_information");e!==re&&(ae(e),re=e)};de(),setInterval(de,2e3),(()=>{if(window.__lc=window.__lc||{},window.__lc.license="12049137",window.LC_API=window.LC_API||{loaded:!1},window.LC_API.loaded)te();else{const e=document.createElement("script");e.async=!0,e.src="https://cdn.livechatinc.com/tracking.js",e.onload=()=>{window.LC_API.loaded=!0,window.LC_API.on_after_load=function(){ae(!!window.parseCookies(document.cookie,"client_information")),te()},"undefined"!=typeof LiveChatWidget&&LiveChatWidget.init&&LiveChatWidget.init()},document.body.appendChild(e)}})();const ce=document.querySelectorAll(".livechatbtn");ce.length>0&&ce.forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault(),ie()}))}));const se=document.getElementById("liveChatBtn");se&&se.addEventListener("click",(e=>{e.preventDefault(),ie()}));document.querySelectorAll('a[rel="liveChatBtn"]').forEach((e=>{null==e||e.addEventListener("click",(e=>{e.preventDefault(),ie()}))}));let le=document.querySelector(".navbar_menu-button");le&&le.addEventListener("click",(function(){let e=window.innerHeight,o=document.querySelector(".new-navbar_main-wrapper");if(o){let n=e-o.offsetHeight,i=document.querySelector(".new-navbar_menu");i&&(i.style.height=`${n}px`)}}));let ue=document.querySelector(".lang-mob");ue&&ue.addEventListener("click",(function(){let e=document.querySelector(".new-navbar_menu-wrapper");e&&e.scrollBy({top:-3e3})}));class pe{constructor(e){this.cookieName=e}setItem(e){const o=new Date;o.setDate(o.getDate()+30);const n="expires="+o.toUTCString(),i=encodeURIComponent(JSON.stringify(e));document.cookie=`${this.cookieName}=${i};${n};path=/`}getItem(){const e=document.cookie.split(";");for(let o=0;ove.includes(e)))&&document.head.querySelectorAll("link").forEach((function(e){e.hasAttribute("hreflang")&&"x-default"!==e.getAttribute("hreflang")&&e.remove()}));const Ye=e=>{window.rudderanalytics?window.rudderanalytics.track(e.name,e.properties):(e=>{let o=[],n=parseCookies(document.cookie,"cached_analytics_events");n&&(o=JSON.parse(n)),o.push(e),document.cookie=`cached_analytics_events=${JSON.stringify(o)}; path=/; Domain=.deriv.com`})(e)};window.addClickListener=function(e,o,n){e&&e.addEventListener("click",(function(){Ye({name:o,properties:n})}))};var _e=null==document?void 0:document.getElementsByClassName("livechatbtn"),Ae=null==document?void 0:document.getElementsByClassName("whatsapp_chat"),be=null==document?void 0:document.getElementsByClassName("tradershub-btn"),ke=document.querySelectorAll(".btn-free-demo .w-button"),Le=document.querySelectorAll('.btn-free-demo [data-class="w-button"]');const Se=document.querySelectorAll('[data-attributes="btn-primary-nav"]'),Ee=document.querySelectorAll('[data-attributes="btn-secondary-nav"]');_e&&Array.from(_e).forEach((e=>{window.addClickListener(e,"ce_widget_usage_form",{action:"click",widget_name:"livechat"})})),Ae&&Array.from(Ae).forEach((e=>{window.addClickListener(e,"ce_widget_usage_form",{action:"click",widget_name:"whatsapp"})})),be&&Array.from(be).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Traders Hub"})})),ke&&Array.from(ke).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),Le&&Array.from(Le).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),Se&&Array.from(Se).forEach((e=>{e.classList.contains("tradershub-btn")||window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),Ee&&Array.from(Ee).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Login"})}));var Ce,qe,Ie;"deriv.com"===window.location.hostname||"deriv.be"===window.location.hostname||"deriv.me"===window.location.hostname?(Ce="sdk-UhZV3cNEg5nLNLNS",Ie="nre64BV0dNIa44zW4tz5ow==",qe="1oV5agvlcnCZ6IH94wCKM1oR8Pd"):(Ce="sdk-9wuqJ1mlcQsSyZQ",Ie="",qe="1lN3tsFD2nruGFgM5F074DC2hMB");const ze=(Ne=window.parseCookies(document.cookie,"client_information"))?JSON.parse(Ne):null,xe=window.parseCookies(document.cookie,"utm_data"),je=xe?JSON.parse(xe):{},Oe=window.parseCookies(document.cookie,"signup_device");let $e=null;Oe&&($e=(null==(e=JSON.parse(Oe))?void 0:e.signup_device)||null);const Be={growthbookKey:Ce,growthbookDecryptionKey:Ie,rudderstackKey:qe,growthbookOptions:{navigate:e=>window.location.replace(e),antiFlicker:!1,navigateDelay:0,attributes:{country:window.parseCookies(document.cookie,"clients_country")||window.parseCookies(document.cookie,"website_status"),user_language:window.parseCookies(document.cookie,"user_language")||("undefined"!=typeof window?localStorage.getItem("i18n")||navigator.language:null),device_language:window.parseCookies(document.cookie,"language")||" ",device_type:$e,utm_source:null==je?void 0:je.utm_source,utm_medium:null==je?void 0:je.utm_medium,utm_campaign:null==je?void 0:je.utm_campaign,is_authorised:!!window.parseCookies(document.cookie,"client_information"),loggedIn:!!window.parseCookies(document.cookie,"client_information"),url:window.location.href}}};try{null==Analytics||Analytics.Analytics.initialise(Be);const e=(null==ze?void 0:ze.user_id)?null==ze?void 0:ze.user_id:null==(i=null==(n=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getInstances)?void 0:n.call(o).tracking)?void 0:i.getAnonymousId();null==(t=null==Analytics?void 0:Analytics.Analytics)||t.identifyEvent(e)}catch(Pe){}null==(a=null==Analytics?void 0:Analytics.Analytics)||a.pageView(location.pathname,"Deriv.com"),window.useGrowthbookFeatureFlag=function({featureFlag:e}){var o,n,i,t,a;let r=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getFeatureValue(e);return null==(a=null==(t=null==(i=null==(n=null==Analytics?void 0:Analytics.Analytics)?void 0:n.getInstances())?void 0:i.ab)?void 0:t.GrowthBook)||a.setRenderer((function(){var o;const n=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getFeatureValue(e);r=n})),r};const De=window.parseCookies(document.cookie,"client_information")?JSON.parse(window.parseCookies(document.cookie,"client_information")):null;(null==De?void 0:De.loginid)&&(null==window||window.hj("identify",De.loginid,{is_logged_in:!!window.parseCookies(document.cookie,"client_information"),landing_company_shortcode:De.landing_company_shortcode||"null"}));null==(s=null==(c=null==(d=null==(r=null==Analytics?void 0:Analytics.Analytics)?void 0:r.getInstances())?void 0:d.ab)?void 0:c.GrowthBook)||s.loadFeatures().then((()=>{window.location.href.indexOf("/partners")>-1==!1&&(()=>{var e;const o=(null==(e=null==Analytics?void 0:Analytics.Analytics)?void 0:e.getFeatureValue("trigger_os_signup_wf"))?function(){const e=navigator.userAgent.toLowerCase();return/ipad|iphone|ipod/.test(e)}()||function(){const e=navigator.userAgent.toLowerCase();return/safari/.test(e)&&!/chrome/.test(e)&&!/crios/.test(e)}()?`https://${window.location.host}/signup`:(()=>{const e=window.location.hostname;let o;switch(o="deriv.com"===e||"deriv.be"===e||"deriv.me"===e?"production":"staging.deriv.com"===e?"staging":"development",o){case"production":return"https://hub.deriv.com/tradershub/signup";case"staging":return"https://staging-hub.deriv.com/tradershub/signup";default:return"https://dev-hub.deriv.com/tradershub/signup"}})():`https://${window.location.host}/signup`,n=document.getElementById("cta-home-btn-navbar");n&&(n.href=o);const i=document.querySelectorAll(".logged-out-btn");null==i||i.forEach((e=>{var n;(null==(n=null==e?void 0:e.href)?void 0:n.indexOf("/signup"))>0&&(e.href=o)}));const t=document.querySelectorAll(".logged-out-btn a");null==t||t.forEach((e=>{var n;(null==(n=null==e?void 0:e.href)?void 0:n.indexOf("/signup"))>0&&(e.href=o)}))})()})); From f94bd4370404498608f27eb428eb8d91cedcdea3 Mon Sep 17 00:00:00 2001 From: Prince Date: Wed, 18 Sep 2024 15:46:22 +0400 Subject: [PATCH 34/57] chore: update workflow --- .github/workflows/generate-bundle-url.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/generate-bundle-url.yml b/.github/workflows/generate-bundle-url.yml index f9957c7..2dda154 100644 --- a/.github/workflows/generate-bundle-url.yml +++ b/.github/workflows/generate-bundle-url.yml @@ -3,6 +3,9 @@ name: Generate Bundle CDN URL on: pull_request: types: [opened, synchronize, reopened] + push: + branches: + - '**' # This will trigger the workflow for commits to any branch jobs: generate-url: @@ -32,10 +35,12 @@ jobs: const fs = require('fs'); const url = fs.readFileSync('url.txt', 'utf8').trim(); const pr_number = process.env.GITHUB_REF.split('/').pop(); - const octokit = github.getOctokit(process.env.GITHUB_TOKEN); + const octokit = require('@actions/github').getOctokit(process.env.GITHUB_TOKEN); await octokit.rest.issues.update({ owner: context.repo.owner, repo: context.repo.repo, issue_number: pr_number, - body: `### Test Bundle URL: \n\n[Preview script bundle](${url})\n\n${context.payload.pull_request.body}` + body: `### Test Bundle URL:\n\n[Preview script bundle](${url})\n\n${context.payload.pull_request.body}` }); + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 0f59e5244e82bd40637288bde72b6f66153bd25b Mon Sep 17 00:00:00 2001 From: Prince Date: Wed, 18 Sep 2024 15:47:27 +0400 Subject: [PATCH 35/57] chore: update workflow --- .github/workflows/generate-bundle-url.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/generate-bundle-url.yml b/.github/workflows/generate-bundle-url.yml index 2dda154..0668be7 100644 --- a/.github/workflows/generate-bundle-url.yml +++ b/.github/workflows/generate-bundle-url.yml @@ -27,7 +27,7 @@ jobs: run: | node scripts/generate-bundle-url.js > url.txt cat url.txt - + - name: Update PR with CDN URL uses: actions/github-script@v6 with: @@ -35,7 +35,8 @@ jobs: const fs = require('fs'); const url = fs.readFileSync('url.txt', 'utf8').trim(); const pr_number = process.env.GITHUB_REF.split('/').pop(); - const octokit = require('@actions/github').getOctokit(process.env.GITHUB_TOKEN); + const { getOctokit } = require('@actions/github'); + const octokit = getOctokit(process.env.GITHUB_TOKEN); await octokit.rest.issues.update({ owner: context.repo.owner, repo: context.repo.repo, From ca661783d355399074ac51eb59004e4ca91362f1 Mon Sep 17 00:00:00 2001 From: Prince Date: Wed, 18 Sep 2024 15:50:43 +0400 Subject: [PATCH 36/57] chore: update workflow --- .github/workflows/generate-bundle-url.yml | 30 ++++++++++------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/.github/workflows/generate-bundle-url.yml b/.github/workflows/generate-bundle-url.yml index 0668be7..cb2dc1e 100644 --- a/.github/workflows/generate-bundle-url.yml +++ b/.github/workflows/generate-bundle-url.yml @@ -5,7 +5,7 @@ on: types: [opened, synchronize, reopened] push: branches: - - '**' # This will trigger the workflow for commits to any branch + - '**' # Trigger workflow for commits to any branch jobs: generate-url: @@ -27,21 +27,17 @@ jobs: run: | node scripts/generate-bundle-url.js > url.txt cat url.txt - - - name: Update PR with CDN URL - uses: actions/github-script@v6 + + - name: Create or update PR comment with CDN URL + uses: peter-evans/create-or-update-comment@v3 with: - script: | - const fs = require('fs'); - const url = fs.readFileSync('url.txt', 'utf8').trim(); - const pr_number = process.env.GITHUB_REF.split('/').pop(); - const { getOctokit } = require('@actions/github'); - const octokit = getOctokit(process.env.GITHUB_TOKEN); - await octokit.rest.issues.update({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: pr_number, - body: `### Test Bundle URL:\n\n[Preview script bundle](${url})\n\n${context.payload.pull_request.body}` - }); + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.pull_request.number }} + body: | + ### Test Bundle URL: + + [Preview script bundle](${{ steps.generate-url.outputs.url }}) + + ${GITHUB_EVENT_PULL_REQUEST_BODY} env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_EVENT_PULL_REQUEST_BODY: ${{ github.event.pull_request.body }} From b3c469006bb4785def42a05cf7988a99155dc82c Mon Sep 17 00:00:00 2001 From: Prince Date: Wed, 18 Sep 2024 15:56:20 +0400 Subject: [PATCH 37/57] chore: update workflow --- .github/workflows/generate-bundle-url.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/generate-bundle-url.yml b/.github/workflows/generate-bundle-url.yml index cb2dc1e..f1edf2b 100644 --- a/.github/workflows/generate-bundle-url.yml +++ b/.github/workflows/generate-bundle-url.yml @@ -7,6 +7,9 @@ on: branches: - '**' # Trigger workflow for commits to any branch +permissions: + pull-requests: write # Ensure the token has write access to PRs + jobs: generate-url: runs-on: ubuntu-latest @@ -27,7 +30,7 @@ jobs: run: | node scripts/generate-bundle-url.js > url.txt cat url.txt - + - name: Create or update PR comment with CDN URL uses: peter-evans/create-or-update-comment@v3 with: From 92e653bcc1d8c8e2d42fc8beda529c4adede817c Mon Sep 17 00:00:00 2001 From: Prince Date: Wed, 18 Sep 2024 15:58:38 +0400 Subject: [PATCH 38/57] chore: update workflow --- .github/workflows/generate-bundle-url.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/generate-bundle-url.yml b/.github/workflows/generate-bundle-url.yml index f1edf2b..adfd0b9 100644 --- a/.github/workflows/generate-bundle-url.yml +++ b/.github/workflows/generate-bundle-url.yml @@ -3,9 +3,6 @@ name: Generate Bundle CDN URL on: pull_request: types: [opened, synchronize, reopened] - push: - branches: - - '**' # Trigger workflow for commits to any branch permissions: pull-requests: write # Ensure the token has write access to PRs From 5836f68dc3211f0ff526d8e95eb70e0ceef3779d Mon Sep 17 00:00:00 2001 From: Prince Date: Wed, 18 Sep 2024 16:00:29 +0400 Subject: [PATCH 39/57] chore: update workflow --- .github/workflows/generate-bundle-url.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/generate-bundle-url.yml b/.github/workflows/generate-bundle-url.yml index adfd0b9..e68066b 100644 --- a/.github/workflows/generate-bundle-url.yml +++ b/.github/workflows/generate-bundle-url.yml @@ -36,8 +36,8 @@ jobs: body: | ### Test Bundle URL: - [Preview script bundle](${{ steps.generate-url.outputs.url }}) + [Preview script bundle](${ { steps.generate-url.outputs.url }}) - ${GITHUB_EVENT_PULL_REQUEST_BODY} + ${ { github.event.pull_request.body }} env: GITHUB_EVENT_PULL_REQUEST_BODY: ${{ github.event.pull_request.body }} From cc745f57ee22a3bfc927e86ddbc0f4fd061787a3 Mon Sep 17 00:00:00 2001 From: Prince Date: Wed, 18 Sep 2024 16:06:41 +0400 Subject: [PATCH 40/57] chore: update workflow --- .github/workflows/generate-bundle-url.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/generate-bundle-url.yml b/.github/workflows/generate-bundle-url.yml index e68066b..0abf010 100644 --- a/.github/workflows/generate-bundle-url.yml +++ b/.github/workflows/generate-bundle-url.yml @@ -25,8 +25,9 @@ jobs: - name: Generate CDN URL id: generate-url run: | - node scripts/generate-bundle-url.js > url.txt - cat url.txt + # Generate the URL and capture it as an output + URL=$(node scripts/generate-bundle-url.js) + echo "URL=$URL" >> $GITHUB_ENV - name: Create or update PR comment with CDN URL uses: peter-evans/create-or-update-comment@v3 @@ -36,8 +37,6 @@ jobs: body: | ### Test Bundle URL: - [Preview script bundle](${ { steps.generate-url.outputs.url }}) + [Preview script bundle](${ { env.URL }}) ${ { github.event.pull_request.body }} - env: - GITHUB_EVENT_PULL_REQUEST_BODY: ${{ github.event.pull_request.body }} From fe4be9741639357daf1a18aa81ab7c2988589958 Mon Sep 17 00:00:00 2001 From: Prince Date: Wed, 18 Sep 2024 16:09:47 +0400 Subject: [PATCH 41/57] chore: update workflow --- .github/workflows/generate-bundle-url.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/generate-bundle-url.yml b/.github/workflows/generate-bundle-url.yml index 0abf010..7f70aa0 100644 --- a/.github/workflows/generate-bundle-url.yml +++ b/.github/workflows/generate-bundle-url.yml @@ -37,6 +37,8 @@ jobs: body: | ### Test Bundle URL: - [Preview script bundle](${ { env.URL }}) + [Preview script bundle](${{ env.URL }}) - ${ { github.event.pull_request.body }} + ${{ + github.event.pull_request.body + }} From 70f59f161ea9e5be7acc226aa43e463da4182da2 Mon Sep 17 00:00:00 2001 From: Prince Date: Wed, 18 Sep 2024 16:12:05 +0400 Subject: [PATCH 42/57] chore: update workflow --- .github/workflows/generate-bundle-url.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/generate-bundle-url.yml b/.github/workflows/generate-bundle-url.yml index 7f70aa0..c317979 100644 --- a/.github/workflows/generate-bundle-url.yml +++ b/.github/workflows/generate-bundle-url.yml @@ -37,8 +37,5 @@ jobs: body: | ### Test Bundle URL: - [Preview script bundle](${{ env.URL }}) + ${{ env.URL }} - ${{ - github.event.pull_request.body - }} From dd45926df6b55ecab486d8915eed26ddd392739e Mon Sep 17 00:00:00 2001 From: Prince Date: Wed, 18 Sep 2024 16:13:29 +0400 Subject: [PATCH 43/57] chore: update workflow --- .github/workflows/generate-bundle-url.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate-bundle-url.yml b/.github/workflows/generate-bundle-url.yml index c317979..76e1e18 100644 --- a/.github/workflows/generate-bundle-url.yml +++ b/.github/workflows/generate-bundle-url.yml @@ -35,7 +35,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.pull_request.number }} body: | - ### Test Bundle URL: + ### CUSTOM FOOTER SCRIPT ${{ env.URL }} From 0b562d34eed43b155d08d03a699ed27a7fdc8306 Mon Sep 17 00:00:00 2001 From: Prince Date: Wed, 18 Sep 2024 16:14:46 +0400 Subject: [PATCH 44/57] chore: removed ngrok --- package-lock.json | 426 +--------------------------------------------- package.json | 7 +- 2 files changed, 3 insertions(+), 430 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7fa8821..a591f3d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,6 @@ "autoprefixer": "^10.4.19", "cssnano": "^7.0.2", "http-server": "^14.1.1", - "ngrok": "^5.0.0-beta.2", "npm-run-all": "^4.1.5", "rollup-plugin-postcss": "^4.0.2", "rollup-plugin-terser": "^7.0.2", @@ -1268,6 +1267,7 @@ "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", "dev": true, + "peer": true, "engines": { "node": ">=10" }, @@ -1287,18 +1287,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@szmarczak/http-timer": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz", - "integrity": "sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==", - "dev": true, - "dependencies": { - "defer-to-connect": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/@trysound/sax": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz", @@ -1308,39 +1296,12 @@ "node": ">=10.13.0" } }, - "node_modules/@types/cacheable-request": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.3.tgz", - "integrity": "sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==", - "dev": true, - "dependencies": { - "@types/http-cache-semantics": "*", - "@types/keyv": "^3.1.4", - "@types/node": "*", - "@types/responselike": "^1.0.0" - } - }, "node_modules/@types/estree": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", "dev": true }, - "node_modules/@types/http-cache-semantics": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", - "integrity": "sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==", - "dev": true - }, - "node_modules/@types/keyv": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz", - "integrity": "sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/node": { "version": "20.14.2", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.2.tgz", @@ -1356,31 +1317,12 @@ "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==", "dev": true }, - "node_modules/@types/responselike": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.3.tgz", - "integrity": "sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/semver": { "version": "7.5.8", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", "dev": true }, - "node_modules/@types/yauzl": { - "version": "2.10.3", - "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz", - "integrity": "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==", - "dev": true, - "optional": true, - "dependencies": { - "@types/node": "*" - } - }, "node_modules/acorn": { "version": "8.11.3", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", @@ -1678,63 +1620,12 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, - "node_modules/buffer-crc32": { - "version": "0.2.13", - "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", - "dev": true, - "engines": { - "node": "*" - } - }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, - "node_modules/cacheable-lookup": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz", - "integrity": "sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==", - "dev": true, - "engines": { - "node": ">=10.6.0" - } - }, - "node_modules/cacheable-request": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.4.tgz", - "integrity": "sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg==", - "dev": true, - "dependencies": { - "clone-response": "^1.0.2", - "get-stream": "^5.1.0", - "http-cache-semantics": "^4.0.0", - "keyv": "^4.0.0", - "lowercase-keys": "^2.0.0", - "normalize-url": "^6.0.1", - "responselike": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cacheable-request/node_modules/get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dev": true, - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/call-bind": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", @@ -1925,18 +1816,6 @@ "node": ">=12" } }, - "node_modules/clone-response": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.3.tgz", - "integrity": "sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==", - "dev": true, - "dependencies": { - "mimic-response": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -2417,33 +2296,6 @@ } } }, - "node_modules/decompress-response": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", - "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", - "dev": true, - "dependencies": { - "mimic-response": "^3.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/decompress-response/node_modules/mimic-response": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", - "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/deep-extend": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", @@ -2453,15 +2305,6 @@ "node": ">=4.0.0" } }, - "node_modules/defer-to-connect": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", - "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/define-data-property": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", @@ -2605,15 +2448,6 @@ "dev": true, "peer": true }, - "node_modules/end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dev": true, - "dependencies": { - "once": "^1.4.0" - } - }, "node_modules/entities": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", @@ -2978,41 +2812,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/extract-zip": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", - "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", - "dev": true, - "dependencies": { - "debug": "^4.1.1", - "get-stream": "^5.1.0", - "yauzl": "^2.10.0" - }, - "bin": { - "extract-zip": "cli.js" - }, - "engines": { - "node": ">= 10.17.0" - }, - "optionalDependencies": { - "@types/yauzl": "^2.9.1" - } - }, - "node_modules/extract-zip/node_modules/get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dev": true, - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/fast-glob": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", @@ -3038,15 +2837,6 @@ "reusify": "^1.0.4" } }, - "node_modules/fd-slicer": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", - "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", - "dev": true, - "dependencies": { - "pend": "~1.2.0" - } - }, "node_modules/figures": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/figures/-/figures-6.1.0.tgz", @@ -3399,31 +3189,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/got": { - "version": "11.8.6", - "resolved": "https://registry.npmjs.org/got/-/got-11.8.6.tgz", - "integrity": "sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==", - "dev": true, - "dependencies": { - "@sindresorhus/is": "^4.0.0", - "@szmarczak/http-timer": "^4.0.5", - "@types/cacheable-request": "^6.0.1", - "@types/responselike": "^1.0.0", - "cacheable-lookup": "^5.0.3", - "cacheable-request": "^7.0.2", - "decompress-response": "^6.0.0", - "http2-wrapper": "^1.0.0-beta.5.2", - "lowercase-keys": "^2.0.0", - "p-cancelable": "^2.0.0", - "responselike": "^2.0.0" - }, - "engines": { - "node": ">=10.19.0" - }, - "funding": { - "url": "https://github.com/sindresorhus/got?sponsor=1" - } - }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -3576,13 +3341,6 @@ "node": "^16.14.0 || >=18.0.0" } }, - "node_modules/hpagent": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/hpagent/-/hpagent-0.1.2.tgz", - "integrity": "sha512-ePqFXHtSQWAFXYmj+JtOTHr84iNrII4/QRlAAPPE+zqnKy4xJo7Ie1Y4kC7AdB+LxLxSTTzBMASsEcy0q8YyvQ==", - "dev": true, - "optional": true - }, "node_modules/html-encoding-sniffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", @@ -3595,12 +3353,6 @@ "node": ">=12" } }, - "node_modules/http-cache-semantics": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", - "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", - "dev": true - }, "node_modules/http-proxy": { "version": "1.18.1", "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", @@ -3673,19 +3425,6 @@ "integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==", "dev": true }, - "node_modules/http2-wrapper": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.3.tgz", - "integrity": "sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==", - "dev": true, - "dependencies": { - "quick-lru": "^5.1.1", - "resolve-alpn": "^1.0.0" - }, - "engines": { - "node": ">=10.19.0" - } - }, "node_modules/https-proxy-agent": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", @@ -4259,12 +3998,6 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/json-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "dev": true - }, "node_modules/json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", @@ -4290,15 +4023,6 @@ "graceful-fs": "^4.1.6" } }, - "node_modules/keyv": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", - "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", - "dev": true, - "dependencies": { - "json-buffer": "3.0.1" - } - }, "node_modules/lilconfig": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.2.tgz", @@ -4402,12 +4126,6 @@ "integrity": "sha512-kZzYOKspf8XVX5AvmQF94gQW0lejFVgb80G85bU4ZWzoJ6C03PQg3coYAUpSTpQWelrZELd3XWgHzw4Ck5kaIw==", "dev": true }, - "node_modules/lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==", - "dev": true - }, "node_modules/lodash.escaperegexp": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz", @@ -4444,15 +4162,6 @@ "integrity": "sha512-e/zcLx6CSbmaEgFHCA7BnoQKyCtKMxnuWrJygbwPs/AIn+IMKl66L8/s+wBUn5LRw2pZx3bUHibiV1b6aTWIww==", "dev": true }, - "node_modules/lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/lru-cache": { "version": "10.2.2", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz", @@ -4592,15 +4301,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/mimic-response": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -4682,41 +4382,6 @@ "integrity": "sha512-EZSPZB70jiVsivaBLYDCyntd5eH8NTSMOn3rB+HxwdmKThGELLdYv8qVIMWvZEFy9w8ZZpW9h9OB32l1rGtj7g==", "dev": true }, - "node_modules/ngrok": { - "version": "5.0.0-beta.2", - "resolved": "https://registry.npmjs.org/ngrok/-/ngrok-5.0.0-beta.2.tgz", - "integrity": "sha512-UzsyGiJ4yTTQLCQD11k1DQaMwq2/SsztBg2b34zAqcyjS25qjDpogMKPaCKHwe/APRTHeel3iDXcVctk5CNaCQ==", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "extract-zip": "^2.0.1", - "got": "^11.8.5", - "lodash.clonedeep": "^4.5.0", - "uuid": "^7.0.0 || ^8.0.0", - "yaml": "^2.2.2" - }, - "bin": { - "ngrok": "bin/ngrok" - }, - "engines": { - "node": ">=14.2" - }, - "optionalDependencies": { - "hpagent": "^0.1.2" - } - }, - "node_modules/ngrok/node_modules/yaml": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.0.tgz", - "integrity": "sha512-2wWLbGbYDiSqqIKoPjar3MPgB94ErzCtrNE1FdqGuaO0pi2JGjmE8aW8TDZwzU7vuxcGRdL/4gPQwQ7hD5AMSw==", - "dev": true, - "bin": { - "yaml": "bin.mjs" - }, - "engines": { - "node": ">= 14" - } - }, "node_modules/nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", @@ -7673,15 +7338,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "dependencies": { - "wrappy": "1" - } - }, "node_modules/onetime": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", @@ -7707,15 +7363,6 @@ "opener": "bin/opener-bin.js" } }, - "node_modules/p-cancelable": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", - "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/p-each-series": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-3.0.0.tgz", @@ -7951,12 +7598,6 @@ "node": ">=8" } }, - "node_modules/pend": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", - "dev": true - }, "node_modules/picocolors": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", @@ -8651,16 +8292,6 @@ "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", "dev": true }, - "node_modules/pump": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, "node_modules/qs": { "version": "6.13.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", @@ -8696,18 +8327,6 @@ } ] }, - "node_modules/quick-lru": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", - "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -8871,12 +8490,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/resolve-alpn": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", - "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==", - "dev": true - }, "node_modules/resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", @@ -8886,18 +8499,6 @@ "node": ">=8" } }, - "node_modules/responselike": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.1.tgz", - "integrity": "sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==", - "dev": true, - "dependencies": { - "lowercase-keys": "^2.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", @@ -10852,15 +10453,6 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "dev": true }, - "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true, - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", @@ -11047,12 +10639,6 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true - }, "node_modules/xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", @@ -11111,16 +10697,6 @@ "node": ">=12" } }, - "node_modules/yauzl": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", - "dev": true, - "dependencies": { - "buffer-crc32": "~0.2.3", - "fd-slicer": "~1.1.0" - } - }, "node_modules/yoctocolors": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/yoctocolors/-/yoctocolors-2.0.2.tgz", diff --git a/package.json b/package.json index b378c27..f5eb6fd 100644 --- a/package.json +++ b/package.json @@ -12,9 +12,7 @@ "dev": "vite", "build": "vite build", "preview": "vite preview", - "serve": "npm run build && http-server ./dist -p 3456 --cors", - "ngrok": "ngrok http 3456", - "ngrok-auth": "ngrok config add-authtoken $NGROK_TOKEN" + "serve": "npm run build && http-server ./dist -p 3456 --cors" }, "devDependencies": { "@semantic-release/changelog": "^6.0.3", @@ -24,10 +22,9 @@ "autoprefixer": "^10.4.19", "cssnano": "^7.0.2", "http-server": "^14.1.1", - "ngrok": "^5.0.0-beta.2", "npm-run-all": "^4.1.5", "rollup-plugin-postcss": "^4.0.2", "rollup-plugin-terser": "^7.0.2", "vite": "^5.2.13" } -} \ No newline at end of file +} From d0567d7d9132b0a7a0c210e4aef4c74017097b45 Mon Sep 17 00:00:00 2001 From: Prince Date: Wed, 18 Sep 2024 16:25:50 +0400 Subject: [PATCH 45/57] chore: added pre commit --- .github/hooks/pre-commit | 0 .github/hooks/precommit | 1 + package.json | 3 ++- 3 files changed, 3 insertions(+), 1 deletion(-) delete mode 100644 .github/hooks/pre-commit create mode 100644 .github/hooks/precommit diff --git a/.github/hooks/pre-commit b/.github/hooks/pre-commit deleted file mode 100644 index e69de29..0000000 diff --git a/.github/hooks/precommit b/.github/hooks/precommit new file mode 100644 index 0000000..ee2c3e7 --- /dev/null +++ b/.github/hooks/precommit @@ -0,0 +1 @@ +npm run precommit:generate-bundle \ No newline at end of file diff --git a/package.json b/package.json index f5eb6fd..e340fe8 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "dev": "vite", "build": "vite build", "preview": "vite preview", - "serve": "npm run build && http-server ./dist -p 3456 --cors" + "serve": "npm run build && http-server ./dist -p 3456 --cors", + "precommit:generate-bundle": "node scripts/generate-bundle-script.js" }, "devDependencies": { "@semantic-release/changelog": "^6.0.3", From 972aaab3a6b43dc5c1ccfc006284726e046f0c2d Mon Sep 17 00:00:00 2001 From: Prince Date: Wed, 18 Sep 2024 16:27:39 +0400 Subject: [PATCH 46/57] chore: added pre commit --- .github/hooks/pre-commit | 1 + .github/hooks/precommit | 1 - package.json | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 .github/hooks/pre-commit delete mode 100644 .github/hooks/precommit diff --git a/.github/hooks/pre-commit b/.github/hooks/pre-commit new file mode 100644 index 0000000..6f1adbe --- /dev/null +++ b/.github/hooks/pre-commit @@ -0,0 +1 @@ +npm run pre-commit:generate-bundle \ No newline at end of file diff --git a/.github/hooks/precommit b/.github/hooks/precommit deleted file mode 100644 index ee2c3e7..0000000 --- a/.github/hooks/precommit +++ /dev/null @@ -1 +0,0 @@ -npm run precommit:generate-bundle \ No newline at end of file diff --git a/package.json b/package.json index e340fe8..fe8650f 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "build": "vite build", "preview": "vite preview", "serve": "npm run build && http-server ./dist -p 3456 --cors", - "precommit:generate-bundle": "node scripts/generate-bundle-script.js" + "pre-commit:generate-bundle": "node scripts/generate-bundle-script.js" }, "devDependencies": { "@semantic-release/changelog": "^6.0.3", From 1d6ceb768fc6fd4165a56fb4488e48a11219f290 Mon Sep 17 00:00:00 2001 From: Prince Date: Wed, 18 Sep 2024 16:32:12 +0400 Subject: [PATCH 47/57] chore: added pre commit --- .github/hooks/pre-commit | 1 - .husky/pre-commit | 5 +++++ package-lock.json | 17 +++++++++++++++++ package.json | 2 ++ 4 files changed, 24 insertions(+), 1 deletion(-) delete mode 100644 .github/hooks/pre-commit create mode 100644 .husky/pre-commit diff --git a/.github/hooks/pre-commit b/.github/hooks/pre-commit deleted file mode 100644 index 6f1adbe..0000000 --- a/.github/hooks/pre-commit +++ /dev/null @@ -1 +0,0 @@ -npm run pre-commit:generate-bundle \ No newline at end of file diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..b7fffad --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,5 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +# Run the precommit:generate-bundle script +npm run pre-commit:generate-bundle \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index a591f3d..5b05cad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ "autoprefixer": "^10.4.19", "cssnano": "^7.0.2", "http-server": "^14.1.1", + "husky": "^9.1.6", "npm-run-all": "^4.1.5", "rollup-plugin-postcss": "^4.0.2", "rollup-plugin-terser": "^7.0.2", @@ -3447,6 +3448,22 @@ "node": ">=18.18.0" } }, + "node_modules/husky": { + "version": "9.1.6", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.6.tgz", + "integrity": "sha512-sqbjZKK7kf44hfdE94EoX8MZNk0n7HeW37O4YrVGCF4wzgQjp+akPAkfUK5LZ6KuR/6sqeAVuXHji+RzQgOn5A==", + "dev": true, + "license": "MIT", + "bin": { + "husky": "bin.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/typicode" + } + }, "node_modules/iconv-lite": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", diff --git a/package.json b/package.json index fe8650f..631548d 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "build": "vite build", "preview": "vite preview", "serve": "npm run build && http-server ./dist -p 3456 --cors", + "prepare": "husky install", "pre-commit:generate-bundle": "node scripts/generate-bundle-script.js" }, "devDependencies": { @@ -23,6 +24,7 @@ "autoprefixer": "^10.4.19", "cssnano": "^7.0.2", "http-server": "^14.1.1", + "husky": "^9.1.6", "npm-run-all": "^4.1.5", "rollup-plugin-postcss": "^4.0.2", "rollup-plugin-terser": "^7.0.2", From 1edcab0d039221af30a7ed5f13bef88f122b77a7 Mon Sep 17 00:00:00 2001 From: Prince Date: Wed, 18 Sep 2024 16:33:30 +0400 Subject: [PATCH 48/57] chore: test pre-commit --- scripts/generate-bundle-script.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/generate-bundle-script.js b/scripts/generate-bundle-script.js index c9ff084..9dd6219 100644 --- a/scripts/generate-bundle-script.js +++ b/scripts/generate-bundle-script.js @@ -34,3 +34,5 @@ exec('npm run build', { cwd: rootDir }, (err, stdout, stderr) => { }); }); }); + +throw new Error('Simulated error for testing purposes'); From 028eb70b6d571fe02e37b890a12f1d77ddb4c4eb Mon Sep 17 00:00:00 2001 From: Prince Date: Wed, 18 Sep 2024 16:37:21 +0400 Subject: [PATCH 49/57] chore: test pre-commit --- scripts/generate-bundle-script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/generate-bundle-script.js b/scripts/generate-bundle-script.js index 9dd6219..71b21e8 100644 --- a/scripts/generate-bundle-script.js +++ b/scripts/generate-bundle-script.js @@ -35,4 +35,4 @@ exec('npm run build', { cwd: rootDir }, (err, stdout, stderr) => { }); }); -throw new Error('Simulated error for testing purposes'); + From 17c1fa9abe1806f1e1ac06cdbe522da1341bb957 Mon Sep 17 00:00:00 2001 From: Prince Date: Wed, 18 Sep 2024 16:38:12 +0400 Subject: [PATCH 50/57] chore: test pre-commit --- .husky/pre-commit | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index b7fffad..ccb398e 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,5 +1,15 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" +echo "Running pre-commit hook..." + # Run the precommit:generate-bundle script -npm run pre-commit:generate-bundle \ No newline at end of file +npm run pre-commit:generate-bundle + +# Check if the script ran successfully +if [ $? -ne 0 ]; then + echo "Pre-commit hook failed." + exit 1 +fi + +echo "Pre-commit hook completed successfully." From a4c5a45642fbdae4fc87554f83014a61cceaa315 Mon Sep 17 00:00:00 2001 From: Prince Date: Wed, 18 Sep 2024 16:46:57 +0400 Subject: [PATCH 51/57] chore: test pre-commit --- .github/hooks/pre-commit | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/hooks/pre-commit diff --git a/.github/hooks/pre-commit b/.github/hooks/pre-commit new file mode 100644 index 0000000..ccb398e --- /dev/null +++ b/.github/hooks/pre-commit @@ -0,0 +1,15 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +echo "Running pre-commit hook..." + +# Run the precommit:generate-bundle script +npm run pre-commit:generate-bundle + +# Check if the script ran successfully +if [ $? -ne 0 ]; then + echo "Pre-commit hook failed." + exit 1 +fi + +echo "Pre-commit hook completed successfully." From f0637ac443a67ce7b570a23ca1f7ebd659a6e6c8 Mon Sep 17 00:00:00 2001 From: Prince Date: Wed, 18 Sep 2024 16:59:18 +0400 Subject: [PATCH 52/57] chore: test pre-commit --- .github/hooks/pre-commit | 15 --------------- .husky/pre-commit | 11 ----------- src/bundle-script.min.js | 2 +- 3 files changed, 1 insertion(+), 27 deletions(-) delete mode 100644 .github/hooks/pre-commit mode change 100644 => 100755 .husky/pre-commit diff --git a/.github/hooks/pre-commit b/.github/hooks/pre-commit deleted file mode 100644 index ccb398e..0000000 --- a/.github/hooks/pre-commit +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -echo "Running pre-commit hook..." - -# Run the precommit:generate-bundle script -npm run pre-commit:generate-bundle - -# Check if the script ran successfully -if [ $? -ne 0 ]; then - echo "Pre-commit hook failed." - exit 1 -fi - -echo "Pre-commit hook completed successfully." diff --git a/.husky/pre-commit b/.husky/pre-commit old mode 100644 new mode 100755 index ccb398e..98781a5 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,15 +1,4 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -echo "Running pre-commit hook..." - -# Run the precommit:generate-bundle script npm run pre-commit:generate-bundle - -# Check if the script ran successfully -if [ $? -ne 0 ]; then - echo "Pre-commit hook failed." - exit 1 -fi - -echo "Pre-commit hook completed successfully." diff --git a/src/bundle-script.min.js b/src/bundle-script.min.js index d6620c9..ba4230c 100644 --- a/src/bundle-script.min.js +++ b/src/bundle-script.min.js @@ -1 +1 @@ -var e,o,n,i,t,a,r,d,c,s;import{initializeApp as l}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-app.js";import{getDatabase as u,ref as p,onValue as w}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-database.js";function h(e,o,n,i){let t="";if(n){let e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),t="; expires="+e.toUTCString()}document.cookie=i?e+"="+(o||"")+t+`;domain=${i};path=/`:e+"="+(o||"")+t+";path=/"}function m(e,o){const n={};return e.split(";").forEach((e=>{const[o,i]=e.split("=").map((e=>e.trim()));n[o]=decodeURIComponent(i)})),n[o]}function y(e){h("webflow-user-language",e,30)}function N(e){document.cookie=e+"=; Max-Age=-99999999;"}window.emailRegex=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,window.toggleErrorField=(e,o)=>{o?e.classList.remove("error-field"):e.classList.add("error-field")},window.disableButton=function(e){e.disabled=!0,e.style.opacity="0.5"},window.isEuRegion=function(e){const o=e.replace(/\/$/,"");return/^\/(?:[^\/]+\/)?eu(?:\/|$)/.test(o)},window.enableButton=function(e){e.disabled=!1,e.style.opacity="1"},window.getOauthUrl=function(){var e=window.location.href,o=new URL(e).hostname,n=["deriv.com","deriv.be","deriv.me"].find((e=>o.endsWith(e)));return n?`https://oauth.${n}`:"https://oauth.deriv.com"},window.getClientCountry=function(){var e;const o=m(document.cookie,"clients_country"),n=m(document.cookie,"client_information");return n&&(null==(e=JSON.parse(n))?void 0:e.residence)||o},window.deriv_com_url="deriv.com",window.deriv_me_url="deriv.me",window.deriv_be_url="deriv.be",window.webflow_domain="webflow.deriv.com",window.staging_url="staging.deriv.com",window.staging_deriv_be_url="staging.deriv.be",window.domain_list_app_id={[window.deriv_com_url]:"16929",[window.deriv_me_url]:"1411",[window.deriv_be_url]:"30767",[window.webflow_domain]:"53503",[window.staging_url]:"16303"},window.getDomain=()=>{var e=window.location.href;return new URL(e).hostname},window.getAppId=()=>{const e=window.getDomain(),o=new URLSearchParams(window.location.search||"").get("app_id");if(o)return o;const n=localStorage.getItem("config.app_id");if(n)return n;const i={[window.webflow_domain]:window.domain_list_app_id[window.webflow_domain],[window.deriv_be_url]:window.domain_list_app_id[window.deriv_be_url],[window.deriv_me_url]:window.domain_list_app_id[window.deriv_me_url],[window.staging_url]:window.domain_list_app_id[window.staging_url]};return i[e]?i[e]:window.domain_list_app_id[window.deriv_com_url]};const g=()=>{const e=localStorage.getItem("config.server_url"),o=m(document.cookie,"webflow-user-language");let n=o?o.toLowerCase():"en";"zh-cn"!==n&&"zh-tw"!==n||(n=n.replace("-","_"));const i=(e=>{let o="";return e&&Object.keys(e).forEach((n=>{o+=`&${n}=${e[n]}`})),o})((()=>{const e=m(document.cookie,"utm_data");if(e){const o=JSON.parse(e),n={};return["utm_source","utm_ad_id","utm_adgroup_id","utm_adrollclk_id","utm_campaign","utm_campaign_id","utm_content","utm_fbcl_id","utm_gl_client_id","utm_medium","utm_msclk_id","utm_term"].forEach((e=>{o.hasOwnProperty(e)&&(n[e]=o[e])})),n}return null})()),t=m(document.cookie,"affiliate_tracking"),a=t?`&affiliate_token=${t}`:"",r=void["mt5","bot","derivx"].filter((e=>window.location.pathname.includes(e)&&e))||"";return e&&/qa/.test(e)?`https://${e}/oauth2/authorize?app_id=${window.getAppId()}&l=${n}&brand=deriv${a}${i}&platform=${r}`:`${window.getOauthUrl()}/oauth2/authorize?app_id=${(()=>{const e=window.getDomain();return e===window.deriv_me_url?window.domain_list_app_id[window.deriv_me_url]:e===window.deriv_be_url?window.domain_list_app_id[window.deriv_be_url]:e===window.webflow_domain?window.domain_list_app_id[window.webflow_domain]:window.domain_list_app_id[window.deriv_com_url]})()}&l=${n}&brand=deriv${a}${i}&platform=${r}`};if(!!!m(document.cookie,"client_information")){var f=document.createElement("iframe");f.src=(()=>{const e=window.location.hostname;let o;switch(o="deriv.com"===e||"deriv.be"===e||"deriv.me"===e?"production":"staging.deriv.com"===e?"staging":"development",o){case"production":return"https://hub.deriv.com/tradershub/signup";case"staging":return"https://staging-hub.deriv.com/tradershub/signup";default:return"https://dev-hub.deriv.com/tradershub/signup"}})(),f.style.width="0",f.style.height="0",f.style.border="none",f.style.visibility="hidden",f.setAttribute("sandbox","allow-same-origin allow-scripts"),document.body.appendChild(f)}window.establishWebSocketConnection=()=>new Promise(((e,o)=>{const n=m(document.cookie,"webflow-user-language"),i=n?n.toLowerCase():"en",t=localStorage.getItem("config.server_url")||"green.derivws.com";window.websocket=new WebSocket(`wss://${t}/websockets/v3?app_id=${window.getAppId()}&l=${i||"en"}&brand=deriv`),window.websocket.addEventListener("open",(o=>{window.websocket.addEventListener("close",(()=>{window.websocket.close()})),window.websocket.addEventListener("message",(e=>{JSON.parse(e.data)})),e(window.websocket)})),window.websocket.addEventListener("error",(e=>{var n;null==(n=null==window?void 0:window.websocket)||n.close(),o(e)}))})),window.socketMessageSend=async(e,o)=>{var n;try{return(null==window?void 0:window.websocket)&&(null==(n=null==window?void 0:window.websocket)?void 0:n.readyState)===(null==WebSocket?void 0:WebSocket.OPEN)?(window.websocket.send(e),new Promise(((e,n)=>{window.websocket.addEventListener("message",(i=>{const t=JSON.parse(i.data);o===t.msg_type&&(t.error?n(t.error):e(t))}))}))):establishWebSocketConnection().then((()=>(websocket.send(e),new Promise(((e,n)=>{websocket.addEventListener("message",(i=>{const t=JSON.parse(i.data);o===t.msg_type&&(t.error?n(t.error):e(t))}))}))))).catch((e=>Promise.reject(e)))}catch(i){return Promise.reject(i)}};const v=[{id:"appgallery",selectors:[".footer_banner-badge.gallery.w-inline-block",".app-download_link-wrapper.appgallery.w-inline-block"],countries:["af","ax","al","dz","as","ad","ao","aq","am","au","at","az","bh","bd","by","be","bj","bm","bt","bo","ba","bw","bv","br","io","bn","bg","bf","bi","kh","cm","ca","cv","bq","cf","td","cn","cx","cc","km","cg","cd","ck","ci","hr","cu","cw","cy","cz","dk","dj","dm","eg","gq","er","ee","et","fk","fo","fj","fi","fr","pf","tf","ga","gm","ge","de","gh","gi","gr","gl","gu","gg","gn","gw","hm","va","hu","is","in","id","ir","iq","ie","im","il","it","jp","je","jo","kz","ke","ki","kr","kp","kw","kg","la","lv","lb","ls","lr","ly","li","lt","lu","mo","mk","mg","mw","my","mv","ml","mt","mh","mr","mu","yt","mx","fm","md","mc","mn","me","ma","mz","mm","na","nr","np","nl","nc","nz","ne","ng","nu","nf","mp","no","om","pk","pw","ps","pg","pe","ph","pn","pl","pt","qa","re","ro","ru","rw","sh","kn","pm","bl","mf","ws","sm","st","sa","sn","rs","sc","sl","sg","sx","sk","si","sb","so","gs","ss","es","lk","sd","sj","sz","se","ch","sy","tw","tj","tz","th","tl","tg","tk","to","tn","tr","tm","tc","tv","ug","ua","ae","gb","um","us","uz","vu","vi","wf","eh","ye","zm","zw"]},{id:"googlePlay",selectors:[".footer_banner-badge.google.w-inline-block",".app-download_link-wrapper.google.w-inline-block"],countries:["af","ax","as","ad","ai","aq","au","bb","bt","bv","io","bn","bi","ca","bq","cf","cx","cc","cg","cd","ck","cw","gq","et","fk","fo","gf","pf","tf","gl","gp","gu","gg","gy","hm","va","hk","ir","im","jp","je","ki","kp","ls","ly","mg","mw","mh","mq","mr","yt","fm","mn","me","ms","nr","nc","nz","ng","nu","nf","mp","pw","ps","pn","pr","re","sh","kn","lc","pm","vc","bl","mf","st","sg","sx","gs","ss","sj","sz","sy","tl","tk","tc","tv","um","us","vg","vi","wf","eh"]},{id:"appstore",selectors:[".footer_banner-badge.store.w-inline-block",".app-download_link-wrapper.appstore.w-inline-block"],countries:["ax","al","as","ad","aq","aw","au","at","bd","be","bv","io","bg","bi","ca","bq","cf","cx","cc","km","ck","hr","cu","cw","cy","cz","dk","dj","gq","er","ee","et","fk","fo","fi","fr","gf","pf","tf","de","gi","gr","gl","gp","gu","gg","gn","ht","hm","va","hk","hu","is","ir","iq","ie","im","il","it","je","ki","kp","lv","ls","ly","li","lt","lu","mt","mh","mq","yt","fm","me","nl","nc","nz","ng","nu","nf","mp","no","ps","pn","pl","pt","pr","re","ro","sh","pm","bl","mf","ws","sm","sg","sx","sk","si","so","gs","ss","es","sd","sj","se","ch","sy","tw","tl","tg","tk","tr","tv","gb","um","us","vu","vi","wf","eh"]},{id:"p2p",selectors:["#p2payment.accordion_toggle-block","#p2component.section_dp2p","#card_block_p2p.help_category"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"w-dyn-item-p2p",selectors:["div.w-dyn-item"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"hideRow",selectors:["#footer_social-icons_row","#footer_text_row",".footer_risk-warning.w-richtext"],countries:["br","uy","lk","ch","za","ec"]},{id:"hideDiel",selectors:["#footer_text_diel","#footer_social-icons_diel"],countries:["br","uy","lk","ch","za","ec"]}],Y=[{id:"showElems",selectors:[".banner_disclaimer"],countries:["br","uy","lk","ch","za","ec"]}],_=()=>{const e=window.getClientCountry();v.forEach((o=>{const n="hideDiel"===o.id?!o.countries.includes(e):o.countries.includes(e);if(e&&n)return o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((e=>{if(e)if("w-dyn-item-p2p"===o.id){e.querySelector("#card_block_p2p.help_category")&&(e.style.display="none")}else e.style.display="none"}))}));if(!n){const e=document.querySelector(".footer_social-icons.diel");e&&(e.style.display="flex")}})),Y.forEach((o=>{e&&o.countries.includes(e)?o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{if(o){const n=document.querySelector(".page-wrapper");".banner_disclaimer"===e?(n.classList.add("disclaimer-show"),o.classList.remove("hide-element")):o.style.display="block"}}))})):o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{o&&(".banner_disclaimer"===e?o.classList.add("hide-element"):o.style.display="none")}))}))}))},A=JSON.stringify({website_status:1});!async function(){try{const e=await fetch("https://www.cloudflare.com/cdn-cgi/trace"),o=await e.text(),n=Object.fromEntries(o.split("\n").map((e=>e.split("=",2)))).loc.toLowerCase();n!==m(document.cookie,"clients_country")&&(N("clients_country"),h("clients_country",n,30)),_()}catch(e){_()}}();m(document.cookie,"clients_country")||window.socketMessageSend(A,"website_status").then((e=>{m(document.cookie,"clients_country")!==e.website_status.clients_country&&(N("clients_country"),h("clients_country",e.website_status.clients_country,30)),_()})).catch((e=>{}));const b=["ar","bn","de","en","es","fr","it","ko","pl","pt","ru","si","sw","th","tr","vi","zh_cn","zh_tw","zh-cn","zh-tw"];(()=>{var e;const o=window.location.pathname,n=window.location.hash,i=window.location.search,t=o.split("/"),a=t[1],r=b.includes(a||""),d=t.includes("careers")||t.includes("locations")||t.includes("derivtech")||t.includes("derivlife")||t.includes("eu-careers")||t.includes("our-locations");r&&y(a);const c=(null==(e=m(document.cookie,"webflow-user-language"))?void 0:e.toLowerCase())||"en",s=r?a:c;if((r||"en"!==c)&&a!==c)if(r&&a!==c)y(s);else if(!d){const e=(r?t.map((e=>e===a?s:e)).join("/"):s+t.join("/"))+i+n;window.location.href="/"+e}})();const k=function(){let e,o=!1,n=!1;const i=()=>{n=!0,o=!!m(document.cookie,"client_information"),o&&clearInterval(e),document.dispatchEvent(new Event("authStatusChange"))};return i(),e=setInterval(i,800),{getLoggedInStatus:()=>o,getAuthCheckedStatus:()=>n,onAuthStatusChange:e=>document.addEventListener("authStatusChange",e)}}();k.onAuthStatusChange((()=>{if(k.getAuthCheckedStatus()&&k.getLoggedInStatus()){document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.add("hide-element")}))}else if(k.getAuthCheckedStatus()&&!k.getLoggedInStatus()){document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.add("hide-element")}))}}));const L=window.location.href;if(["help-centre"].some((e=>L.includes(e)))){const e=new URL(L).searchParams;e.has("platform")&&"derivgo"===e.get("platform")&&(S=".derivgo-query-element",document.querySelectorAll(S).forEach((e=>{e.style.display="none"})))}var S;const E=document.querySelector(".banner_disclaimer"),C=document.querySelector(".main-wrapper");if(E){new ResizeObserver((e=>{for(let o of e)if(o.target===E){let e=o.target.getBoundingClientRect();C&&(C.style.paddingTop=e.height+"px")}})).observe(E)}window.addEventListener("pageshow",(function(e){if(e.persisted){const e=document.querySelector(".w-nav-overlay");e&&(e.style.display="none",document.querySelector("body").click())}}));const q=u(l({databaseURL:window.location.hostname.includes("staging")?"https://app-config-staging.firebaseio.com":"https://app-config-prod.firebaseio.com"}));let I=!1,z=!1;!function(){var e;const o=document.getElementById("live_chat-wrapper");try{const e=p(q,"remote_config/deriv-com/chat");w(e,(e=>{const n=e.val();I=n.live_chat,z=n.whatsapp_chat;const i=document.querySelector(".whatsapp_chat"),t=document.querySelector(".livechatbtn");i&&(i.style.visibility=z?"visible":"hidden"),t&&(t.style.visibility=I?"visible":"hidden");if(window.location.pathname.includes("/help-centre")){const e=document.querySelectorAll(".livechatbtn");I?e.forEach((e=>{e.style.visibility="visible"})):e.forEach((e=>{e.style.visibility="hidden"}));const o=document.querySelectorAll(".whatsapp_chat");z?o.forEach((e=>{e.style.visibility="visible"})):o.forEach((e=>{e.style.visibility="hidden"}))}window.addEventListener("scroll",(function(){var e,n;(I||z)&&(null==(e=null==o?void 0:o.classList)||e.remove("hide-element")),I||z||null==(n=null==o?void 0:o.classList)||n.add("hide-element")}))}),(e=>{var n;null==(n=null==o?void 0:o.classList)||n.remove("hide-element")}))}catch(n){null==(e=null==o?void 0:o.classList)||e.remove("hide-element")}}();new MutationObserver((function(e){for(const o of e)if(o.addedNodes.length)for(const e of o.addedNodes)e.nodeType===Node.ELEMENT_NODE&&"chat-widget-minimized"===e.id&&(e.style.opacity="0")})).observe(document.body,{childList:!0,subtree:!0});const x=window.getClientCountry();const j=[{country:"af",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"ax",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"al",apple:"No",android:"Yes",huawei:"No"},{country:"dz",apple:"Yes",android:"Yes",huawei:"No"},{country:"as",apple:"N/A",android:"No",huawei:"N/A"},{country:"ad",apple:"N/A",android:"N/A",huawei:"No"},{country:"ao",apple:"Yes",android:"Yes",huawei:"No"},{country:"ai",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"aq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ag",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ar",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"am",apple:"Yes",android:"Yes",huawei:"No"},{country:"aw",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"au",apple:"No",android:"No",huawei:"No"},{country:"at",apple:"No",android:"Yes",huawei:"No"},{country:"az",apple:"Yes",android:"Yes",huawei:"No"},{country:"bs",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bh",apple:"Yes",android:"Yes",huawei:"No"},{country:"bd",apple:"N/A",android:"Yes",huawei:"No"},{country:"bb",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"by",apple:"Yes",android:"Yes",huawei:"No"},{country:"be",apple:"No",android:"Yes",huawei:"No"},{country:"bz",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bj",apple:"Yes",android:"Yes",huawei:"No"},{country:"bm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"bt",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"bo",apple:"Yes",android:"Yes",huawei:"No"},{country:"ba",apple:"Yes",android:"Yes",huawei:"No"},{country:"bw",apple:"Yes",android:"Yes",huawei:"No"},{country:"bv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"br",apple:"Yes",android:"Yes",huawei:"No"},{country:"io",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"bn",apple:"Yes",android:"N/A",huawei:"No"},{country:"bg",apple:"No",android:"Yes",huawei:"No"},{country:"bf",apple:"Yes",android:"Yes",huawei:"No"},{country:"bi",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kh",apple:"Yes",android:"Yes",huawei:"No"},{country:"cm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ca",apple:"No",android:"No",huawei:"No"},{country:"cv",apple:"Yes",android:"Yes",huawei:"No"},{country:"bq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ky",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cf",apple:"N/A",android:"N/A",huawei:"No"},{country:"td",apple:"Yes",android:"Yes",huawei:"No"},{country:"cl",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cn",apple:"Yes",android:"Yes",huawei:"No"},{country:"cx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"co",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"km",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cg",apple:"Yes",android:"N/A",huawei:"No"},{country:"cd",apple:"Yes",android:"N/A",huawei:"No"},{country:"ck",apple:"N/A",android:"N/A",huawei:"No"},{country:"cr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ci",apple:"Yes",android:"Yes",huawei:"No"},{country:"hr",apple:"No",android:"Yes",huawei:"No"},{country:"cu",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cw",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cy",apple:"No",android:"Yes",huawei:"No"},{country:"cz",apple:"No",android:"Yes",huawei:"No"},{country:"dk",apple:"No",android:"Yes",huawei:"No"},{country:"dj",apple:"N/A",android:"Yes",huawei:"No"},{country:"dm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"do",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ec",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"eg",apple:"Yes",android:"Yes",huawei:"No"},{country:"sv",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gq",apple:"N/A",android:"N/A",huawei:"No"},{country:"er",apple:"N/A",android:"Yes",huawei:"No"},{country:"ee",apple:"No",android:"Yes",huawei:"No"},{country:"et",apple:"N/A",android:"N/A",huawei:"No"},{country:"fk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"fo",apple:"N/A",android:"N/A",huawei:"No"},{country:"fj",apple:"Yes",android:"Yes",huawei:"No"},{country:"fi",apple:"No",android:"Yes",huawei:"No"},{country:"fr",apple:"No",android:"Yes",huawei:"No"},{country:"gf",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"pf",apple:"N/A",android:"N/A",huawei:"No"},{country:"tf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ga",apple:"Yes",android:"Yes",huawei:"No"},{country:"gm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ge",apple:"Yes",android:"Yes",huawei:"No"},{country:"de",apple:"No",android:"Yes",huawei:"No"},{country:"gh",apple:"Yes",android:"Yes",huawei:"No"},{country:"gi",apple:"N/A",android:"Yes",huawei:"No"},{country:"gr",apple:"No",android:"Yes",huawei:"No"},{country:"gl",apple:"N/A",android:"N/A",huawei:"No"},{country:"gd",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gp",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"gu",apple:"N/A",android:"No",huawei:"N/A"},{country:"gt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gg",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"gn",apple:"N/A",android:"Yes",huawei:"No"},{country:"gw",apple:"Yes",android:"Yes",huawei:"No"},{country:"gy",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ht",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"hm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"va",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"hn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"hk",apple:"No",android:"No",huawei:"Yes"},{country:"hu",apple:"No",android:"Yes",huawei:"No"},{country:"is",apple:"No",android:"Yes",huawei:"No"},{country:"in",apple:"Yes",android:"Yes",huawei:"No"},{country:"id",apple:"Yes",android:"Yes",huawei:"No"},{country:"ir",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"iq",apple:"No",android:"Yes",huawei:"N/A"},{country:"ie",apple:"No",android:"Yes",huawei:"No"},{country:"im",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"il",apple:"No",android:"Yes",huawei:"No"},{country:"it",apple:"No",android:"Yes",huawei:"No"},{country:"jm",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"jp",apple:"Yes",android:"No",huawei:"No"},{country:"je",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"jo",apple:"Yes",android:"Yes",huawei:"No"},{country:"kz",apple:"Yes",android:"Yes",huawei:"No"},{country:"ke",apple:"Yes",android:"Yes",huawei:"No"},{country:"ki",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kr",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"kp",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kw",apple:"Yes",android:"Yes",huawei:"No"},{country:"kg",apple:"Yes",android:"Yes",huawei:"No"},{country:"la",apple:"Yes",android:"Yes",huawei:"No"},{country:"lv",apple:"No",android:"Yes",huawei:"No"},{country:"lb",apple:"Yes",android:"Yes",huawei:"No"},{country:"ls",apple:"N/A",android:"N/A",huawei:"No"},{country:"lr",apple:"Yes",android:"Yes",huawei:"No"},{country:"ly",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"li",apple:"N/A",android:"Yes",huawei:"No"},{country:"lt",apple:"No",android:"Yes",huawei:"No"},{country:"lu",apple:"No",android:"Yes",huawei:"No"},{country:"mo",apple:"Yes",android:"Yes",huawei:"No"},{country:"mk",apple:"Yes",android:"Yes",huawei:"No"},{country:"mg",apple:"Yes",android:"N/A",huawei:"No"},{country:"mw",apple:"Yes",android:"N/A",huawei:"No"},{country:"my",apple:"Yes",android:"Yes",huawei:"No"},{country:"mv",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"ml",apple:"Yes",android:"Yes",huawei:"No"},{country:"mt",apple:"No",android:"Yes",huawei:"No"},{country:"mh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mq",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"mr",apple:"Yes",android:"N/A",huawei:"No"},{country:"mu",apple:"Yes",android:"Yes",huawei:"No"},{country:"yt",apple:"N/A",android:"N/A",huawei:"No"},{country:"mx",apple:"Yes",android:"Yes",huawei:"No"},{country:"fm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"md",apple:"Yes",android:"Yes",huawei:"No"},{country:"mc",apple:"Yes",android:"Yes",huawei:"No"},{country:"mn",apple:"Yes",android:"N/A",huawei:"No"},{country:"me",apple:"No",android:"N/A",huawei:"No"},{country:"ms",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ma",apple:"Yes",android:"Yes",huawei:"No"},{country:"mz",apple:"Yes",android:"Yes",huawei:"No"},{country:"mm",apple:"Yes",android:"Yes",huawei:"No"},{country:"na",apple:"Yes",android:"Yes",huawei:"No"},{country:"nr",apple:"Yes",android:"N/A",huawei:"No"},{country:"np",apple:"Yes",android:"Yes",huawei:"No"},{country:"nl",apple:"No",android:"Yes",huawei:"No"},{country:"nc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nz",apple:"No",android:"No",huawei:"No"},{country:"ni",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ne",apple:"Yes",android:"Yes",huawei:"No"},{country:"ng",apple:"No",android:"No",huawei:"No"},{country:"nu",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mp",apple:"N/A",android:"No",huawei:"N/A"},{country:"no",apple:"No",android:"Yes",huawei:"No"},{country:"om",apple:"Yes",android:"Yes",huawei:"No"},{country:"pk",apple:"Yes",android:"Yes",huawei:"No"},{country:"pw",apple:"Yes",android:"No",huawei:"N/A"},{country:"ps",apple:"N/A",android:"N/A",huawei:"No"},{country:"pa",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pg",apple:"Yes",android:"Yes",huawei:"No"},{country:"py",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pe",apple:"Yes",android:"Yes",huawei:"No"},{country:"ph",apple:"Yes",android:"Yes",huawei:"No"},{country:"pn",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"pl",apple:"No",android:"Yes",huawei:"No"},{country:"pt",apple:"No",android:"Yes",huawei:"No"},{country:"pr",apple:"N/A",android:"No",huawei:"Yes"},{country:"qa",apple:"Yes",android:"Yes",huawei:"No"},{country:"re",apple:"N/A",android:"N/A",huawei:"No"},{country:"ro",apple:"No",android:"Yes",huawei:"No"},{country:"ru",apple:"Yes",android:"Yes",huawei:"No"},{country:"rw",apple:"Yes",android:"Yes",huawei:"No"},{country:"sh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kn",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"lc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"pm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"vc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"bl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ws",apple:"N/A",android:"Yes",huawei:"No"},{country:"sm",apple:"N/A",android:"Yes",huawei:"No"},{country:"st",apple:"Yes",android:"N/A",huawei:"No"},{country:"sa",apple:"Yes",android:"Yes",huawei:"No"},{country:"sn",apple:"Yes",android:"Yes",huawei:"No"},{country:"rs",apple:"Yes",android:"Yes",huawei:"No"},{country:"sc",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"sl",apple:"Yes",android:"Yes",huawei:"No"},{country:"sg",apple:"No",android:"No",huawei:"No"},{country:"sx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sk",apple:"No",android:"Yes",huawei:"No"},{country:"si",apple:"No",android:"Yes",huawei:"No"},{country:"sb",apple:"Yes",android:"Yes",huawei:"No"},{country:"so",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"za",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gs",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ss",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"es",apple:"No",android:"Yes",huawei:"No"},{country:"lk",apple:"Yes",android:"Yes",huawei:"No"},{country:"sd",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"sr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"sj",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sz",apple:"Yes",android:"N/A",huawei:"No"},{country:"se",apple:"No",android:"Yes",huawei:"No"},{country:"ch",apple:"No",android:"Yes",huawei:"No"},{country:"sy",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tw",apple:"No",android:"Yes",huawei:"No"},{country:"tj",apple:"Yes",android:"Yes",huawei:"No"},{country:"tz",apple:"Yes",android:"Yes",huawei:"No"},{country:"th",apple:"Yes",android:"Yes",huawei:"No"},{country:"tl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tg",apple:"N/A",android:"Yes",huawei:"No"},{country:"tk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"to",apple:"Yes",android:"Yes",huawei:"No"},{country:"tt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"tn",apple:"Yes",android:"Yes",huawei:"No"},{country:"tr",apple:"No",android:"Yes",huawei:"No"},{country:"tm",apple:"Yes",android:"Yes",huawei:"No"},{country:"tc",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"tv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ug",apple:"Yes",android:"Yes",huawei:"No"},{country:"ua",apple:"Yes",android:"Yes",huawei:"No"},{country:"ae",apple:"Yes",android:"Yes",huawei:"No"},{country:"gb",apple:"No",android:"Yes",huawei:"No"},{country:"um",apple:"N/A",android:"No",huawei:"N/A"},{country:"us",apple:"No",android:"No",huawei:"N/A"},{country:"uy",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"uz",apple:"Yes",android:"Yes",huawei:"No"},{country:"vu",apple:"No",android:"Yes",huawei:"N/A"},{country:"ve",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vg",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"vi",apple:"N/A",android:"No",huawei:"N/A"},{country:"wf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"eh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ye",apple:"Yes",android:"Yes",huawei:"No"},{country:"zm",apple:"Yes",android:"Yes",huawei:"No"},{country:"zw",apple:"Yes",android:"Yes",huawei:"No"}].find((e=>e.country===x)),O=j?function(e){const{apple:o,android:n,huawei:i}=e;return"Yes"===o&&"Yes"===n&&"Yes"===i?"Android, iOS & Huawei":"Yes"===o&&"Yes"===n&&"Yes"!==i?"Android, and iOS":"Yes"===o&&"Yes"===i&&"Yes"!==n?"iOS, and Huawei":"Yes"===n&&"Yes"!==o&&"Yes"!==i?"Android":"Yes"===o&&"Yes"===i&&"Yes"!==n?"iOS, and Huawei":"Yes"===o&&"Yes"!==n&&"Yes"!==i?"iOS":"Yes"!==o&&"Yes"!==n&&"Yes"===i?"Huawei":""}(j):"",$=document.getElementById("app-download-heading");$&&($.innerText=O);const B=document.querySelector(".redirection_background-wrapper"),D=document.getElementById("cancel-redirect"),P=document.getElementById("proceed-redirect");if(window.isEuRegion(window.location.pathname)&&B&&D&&P){const e=["deriv.me","deriv.be","deriv.com","app.deriv.me","app.deriv.be","app.deriv.com","docs.deriv.com","community.deriv.com","deriv.statuspage.io","signup.deriv.com","login.deriv.com","api.deriv.com"];let o="",n="_self";document.querySelectorAll("a").forEach((function(i){const t=new URL(i.href,window.location.href),a=new URL(window.location.href);e.includes(t.host)||t.host===a.host||i.addEventListener("click",(function(e){e.preventDefault(),o=t.href,n=i.target||"_self",B.classList.remove("hide-element"),document.body.style.overflow="hidden"}))})),D.addEventListener("click",(function(){B.classList.add("hide-element"),document.body.style.overflow="auto",o=""})),P.addEventListener("click",(function(){o&&(window.open(o,n),o="",B.classList.add("hide-element"),document.body.style.overflow="auto")}))}document.querySelector(".banner_disclaimer")?document.body.classList.add("disclaimer-visible"):document.body.classList.remove("disclaimer-visible");const W=document.querySelectorAll(".navbar_accordion-item");function R(){const e=document.querySelector(".navbar_accordion-trigger.open");e&&e.scrollIntoView({behavior:"smooth",block:"start"})}W.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.overflow="hidden",o.style.transition="max-height 0.3s ease-in, opacity 0.3s ease-in",o.style.opacity="0"})),W.forEach((e=>{const o=e.querySelector(".navbar_accordion-trigger");o.addEventListener("click",(function(){const e=o.classList.contains("open");if(W.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.opacity="0"})),!e){o.classList.add("open");const e=o.nextElementSibling;e.classList.add("open"),e.style.maxHeight=e.scrollHeight+"px",e.style.opacity="1"}}))}));document.querySelectorAll(".navbar_accordion-trigger").forEach((e=>{e.addEventListener("click",(function(){setTimeout(R,300)}))}));const U=new MutationObserver((e=>{e.forEach((e=>{if("class"===e.attributeName){const o=e.target;o.classList.contains("open")&&o.scrollIntoView({behavior:"smooth",block:"start"})}}))}));document.querySelectorAll(".navbar_accordion-item").forEach((e=>{U.observe(e,{attributes:!0})}));const T=new URL(window.location.href),J=new URLSearchParams(T.search),F=J.get("t");if(J.has("referrer")&&null!=F){m(document.cookie,"referrer_token")!==F&&(N("referrer_token"),h("referrer_token",F,365,".deriv.com"))}const H=document.getElementById("navbar-home_login");H&&H.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const M=document.getElementById("res-navbar-home_login");M&&M.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const V=document.getElementById("white-navbar_login");V&&V.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const G=document.getElementById("res-white-navbar_login");G&&G.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()})),alert("Test"),window.fallbackLoader="Migrated All + Removal of Webflow array functions";let K=document.querySelectorAll(".navbar_accordion-trigger");K.forEach((e=>{e.addEventListener("click",(function(){K.forEach((e=>e.classList.remove("current"))),this.classList.add("current")}))}));let Z=document.querySelector(".navbar_accordion-link.w--current");if(Z){let e=Z.closest(".navbar_accordion-item");if(e){let o=e.querySelector(".navbar_accordion-trigger");o&&o.classList.add("current")}}let Q=document.querySelector(".locale > .new-navbar_dropdown-link.w--current");if(Q){let e=Q.getAttribute("hreflang"),o=document.querySelectorAll(".current-locale-iso-code");if(e&&o.length)for(let n of o)n.innerText=e}function X(e,o,n){let i="";{let e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),i="; expires="+e.toUTCString()}document.cookie=e+"="+(o||"")+i+"; path=/"}let ee=document.querySelectorAll(".w-locales-items");if(ee.length>0){let e=function(e){let o=document.querySelector('a[hreflang="'+e+'"]');o&&window.location.pathname!==o.getAttribute("href")&&o.click()};ee.forEach((function(e){e.querySelectorAll("a").forEach((function(e){e.addEventListener("click",(function(o){o.preventDefault(),X("webflow-user-language",e.getAttribute("hreflang"),30),window.location.href=e.href}))}))})),window.setLanguageCookie=e=>{X("webflow-user-language",e,30)};let o=function(e){let o=document.cookie.split(";");for(let n=0;ni.includes(e))),o&&t&&e(o)}if(document.querySelector(".new-navbar_component")){let e=function(){document.body.classList.add("disable-scroll")},o=function(){document.body.classList.remove("disable-scroll")};const n=document.querySelector(".new-navbar_component");n.addEventListener("mouseenter",(()=>{window.innerWidth>991&&e()})),n.addEventListener("mouseleave",(()=>{window.innerWidth>991&&o()}))}window.getClientCountry();const oe=window.parseCookies(document.cookie,"webflow-user-language"),ne=["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"];if(window.location.pathname.endsWith("p2p")&&!window.location.pathname.startsWith("/blog")){const e=window.getClientCountry();e&&ne.includes(e)&&("en"===oe?window.location.replace("/404"):window.location.replace(`/${oe}/404`))}if(void 0!==window.parseCookies(document.cookie,"client_information")){let e=function(e){e.forEach((e=>{e.href="https://app.deriv.com/appstore/traders-hub"}))},o=document.querySelectorAll("a.live-markets_button.is-secondary.is-small.is-purchase.w-button"),n=document.querySelectorAll("a.live-markets_button.is-secondary.is-small.is-sell.w-button");e(o),e(n)}document.getElementById("mobile-menu"),document.getElementById("live_chat-wrapper");const ie=()=>{window.LC_API&&window.LC_API.open_chat_window&&window.LC_API.open_chat_window()},te=()=>{"true"===new URLSearchParams(window.location.search).get("is_livechat_open")&&ie()},ae=e=>{var o;null==(o=null==window?void 0:window.LiveChatWidget)||o.on("ready",(()=>{window.LC_API.open_chat_window(),window.LC_API.hide_chat_window(),te();const o=window.parseCookies(document.cookie,"utm_data"),n=o?JSON.parse(o):{},{utm_source:i,utm_medium:t,utm_campaign:a}=n,r=window.parseCookies(document.cookie,"client_information"),d=new URLSearchParams(window.location.search),{loginid:c,email:s,landing_company_shortcode:l,currency:u,residence:p,first_name:w,last_name:h}=r?JSON.parse(r):{},m={is_logged_in:e,loginid:c??"",landing_company_shortcode:l??"",currency:u??"",residence:p??"",email:s??"",platform:d.get("platform")??"",utm_source:i??"",utm_medium:t??"",utm_campaign:a??""};window.LiveChatWidget.call("set_session_variables",m),e?(s&&window.LiveChatWidget.call("set_customer_email",s),w&&h&&window.LiveChatWidget.call("set_customer_name",`${w} ${h}`)):window.LC_API.on_chat_ended=()=>{window.LiveChatWidget.call("set_customer_email"," "),window.LiveChatWidget.call("set_customer_name"," ")},te(),window.LiveChatWidget.on("new_event",(e=>{e.greeting&&window.LC_API.open_chat_window()}))}))};let re=!1;const de=()=>{const e=!!window.parseCookies(document.cookie,"client_information");e!==re&&(ae(e),re=e)};de(),setInterval(de,2e3),(()=>{if(window.__lc=window.__lc||{},window.__lc.license="12049137",window.LC_API=window.LC_API||{loaded:!1},window.LC_API.loaded)te();else{const e=document.createElement("script");e.async=!0,e.src="https://cdn.livechatinc.com/tracking.js",e.onload=()=>{window.LC_API.loaded=!0,window.LC_API.on_after_load=function(){ae(!!window.parseCookies(document.cookie,"client_information")),te()},"undefined"!=typeof LiveChatWidget&&LiveChatWidget.init&&LiveChatWidget.init()},document.body.appendChild(e)}})();const ce=document.querySelectorAll(".livechatbtn");ce.length>0&&ce.forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault(),ie()}))}));const se=document.getElementById("liveChatBtn");se&&se.addEventListener("click",(e=>{e.preventDefault(),ie()}));document.querySelectorAll('a[rel="liveChatBtn"]').forEach((e=>{null==e||e.addEventListener("click",(e=>{e.preventDefault(),ie()}))}));let le=document.querySelector(".navbar_menu-button");le&&le.addEventListener("click",(function(){let e=window.innerHeight,o=document.querySelector(".new-navbar_main-wrapper");if(o){let n=e-o.offsetHeight,i=document.querySelector(".new-navbar_menu");i&&(i.style.height=`${n}px`)}}));let ue=document.querySelector(".lang-mob");ue&&ue.addEventListener("click",(function(){let e=document.querySelector(".new-navbar_menu-wrapper");e&&e.scrollBy({top:-3e3})}));class pe{constructor(e){this.cookieName=e}setItem(e){const o=new Date;o.setDate(o.getDate()+30);const n="expires="+o.toUTCString(),i=encodeURIComponent(JSON.stringify(e));document.cookie=`${this.cookieName}=${i};${n};path=/`}getItem(){const e=document.cookie.split(";");for(let o=0;ove.includes(e)))&&document.head.querySelectorAll("link").forEach((function(e){e.hasAttribute("hreflang")&&"x-default"!==e.getAttribute("hreflang")&&e.remove()}));const Ye=e=>{window.rudderanalytics?window.rudderanalytics.track(e.name,e.properties):(e=>{let o=[],n=parseCookies(document.cookie,"cached_analytics_events");n&&(o=JSON.parse(n)),o.push(e),document.cookie=`cached_analytics_events=${JSON.stringify(o)}; path=/; Domain=.deriv.com`})(e)};window.addClickListener=function(e,o,n){e&&e.addEventListener("click",(function(){Ye({name:o,properties:n})}))};var _e=null==document?void 0:document.getElementsByClassName("livechatbtn"),Ae=null==document?void 0:document.getElementsByClassName("whatsapp_chat"),be=null==document?void 0:document.getElementsByClassName("tradershub-btn"),ke=document.querySelectorAll(".btn-free-demo .w-button"),Le=document.querySelectorAll('.btn-free-demo [data-class="w-button"]');const Se=document.querySelectorAll('[data-attributes="btn-primary-nav"]'),Ee=document.querySelectorAll('[data-attributes="btn-secondary-nav"]');_e&&Array.from(_e).forEach((e=>{window.addClickListener(e,"ce_widget_usage_form",{action:"click",widget_name:"livechat"})})),Ae&&Array.from(Ae).forEach((e=>{window.addClickListener(e,"ce_widget_usage_form",{action:"click",widget_name:"whatsapp"})})),be&&Array.from(be).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Traders Hub"})})),ke&&Array.from(ke).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),Le&&Array.from(Le).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),Se&&Array.from(Se).forEach((e=>{e.classList.contains("tradershub-btn")||window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),Ee&&Array.from(Ee).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Login"})}));var Ce,qe,Ie;"deriv.com"===window.location.hostname||"deriv.be"===window.location.hostname||"deriv.me"===window.location.hostname?(Ce="sdk-UhZV3cNEg5nLNLNS",Ie="nre64BV0dNIa44zW4tz5ow==",qe="1oV5agvlcnCZ6IH94wCKM1oR8Pd"):(Ce="sdk-9wuqJ1mlcQsSyZQ",Ie="",qe="1lN3tsFD2nruGFgM5F074DC2hMB");const ze=(Ne=window.parseCookies(document.cookie,"client_information"))?JSON.parse(Ne):null,xe=window.parseCookies(document.cookie,"utm_data"),je=xe?JSON.parse(xe):{},Oe=window.parseCookies(document.cookie,"signup_device");let $e=null;Oe&&($e=(null==(e=JSON.parse(Oe))?void 0:e.signup_device)||null);const Be={growthbookKey:Ce,growthbookDecryptionKey:Ie,rudderstackKey:qe,growthbookOptions:{navigate:e=>window.location.replace(e),antiFlicker:!1,navigateDelay:0,attributes:{country:window.parseCookies(document.cookie,"clients_country")||window.parseCookies(document.cookie,"website_status"),user_language:window.parseCookies(document.cookie,"user_language")||("undefined"!=typeof window?localStorage.getItem("i18n")||navigator.language:null),device_language:window.parseCookies(document.cookie,"language")||" ",device_type:$e,utm_source:null==je?void 0:je.utm_source,utm_medium:null==je?void 0:je.utm_medium,utm_campaign:null==je?void 0:je.utm_campaign,is_authorised:!!window.parseCookies(document.cookie,"client_information"),loggedIn:!!window.parseCookies(document.cookie,"client_information"),url:window.location.href}}};try{null==Analytics||Analytics.Analytics.initialise(Be);const e=(null==ze?void 0:ze.user_id)?null==ze?void 0:ze.user_id:null==(i=null==(n=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getInstances)?void 0:n.call(o).tracking)?void 0:i.getAnonymousId();null==(t=null==Analytics?void 0:Analytics.Analytics)||t.identifyEvent(e)}catch(Pe){}null==(a=null==Analytics?void 0:Analytics.Analytics)||a.pageView(location.pathname,"Deriv.com"),window.useGrowthbookFeatureFlag=function({featureFlag:e}){var o,n,i,t,a;let r=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getFeatureValue(e);return null==(a=null==(t=null==(i=null==(n=null==Analytics?void 0:Analytics.Analytics)?void 0:n.getInstances())?void 0:i.ab)?void 0:t.GrowthBook)||a.setRenderer((function(){var o;const n=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getFeatureValue(e);r=n})),r};const De=window.parseCookies(document.cookie,"client_information")?JSON.parse(window.parseCookies(document.cookie,"client_information")):null;(null==De?void 0:De.loginid)&&(null==window||window.hj("identify",De.loginid,{is_logged_in:!!window.parseCookies(document.cookie,"client_information"),landing_company_shortcode:De.landing_company_shortcode||"null"}));null==(s=null==(c=null==(d=null==(r=null==Analytics?void 0:Analytics.Analytics)?void 0:r.getInstances())?void 0:d.ab)?void 0:c.GrowthBook)||s.loadFeatures().then((()=>{window.location.href.indexOf("/partners")>-1==!1&&(()=>{var e;const o=(null==(e=null==Analytics?void 0:Analytics.Analytics)?void 0:e.getFeatureValue("trigger_os_signup_wf"))?function(){const e=navigator.userAgent.toLowerCase();return/ipad|iphone|ipod/.test(e)}()||function(){const e=navigator.userAgent.toLowerCase();return/safari/.test(e)&&!/chrome/.test(e)&&!/crios/.test(e)}()?`https://${window.location.host}/signup`:(()=>{const e=window.location.hostname;let o;switch(o="deriv.com"===e||"deriv.be"===e||"deriv.me"===e?"production":"staging.deriv.com"===e?"staging":"development",o){case"production":return"https://hub.deriv.com/tradershub/signup";case"staging":return"https://staging-hub.deriv.com/tradershub/signup";default:return"https://dev-hub.deriv.com/tradershub/signup"}})():`https://${window.location.host}/signup`,n=document.getElementById("cta-home-btn-navbar");n&&(n.href=o);const i=document.querySelectorAll(".logged-out-btn");null==i||i.forEach((e=>{var n;(null==(n=null==e?void 0:e.href)?void 0:n.indexOf("/signup"))>0&&(e.href=o)}));const t=document.querySelectorAll(".logged-out-btn a");null==t||t.forEach((e=>{var n;(null==(n=null==e?void 0:e.href)?void 0:n.indexOf("/signup"))>0&&(e.href=o)}))})()})); +var e,o,n,i,t,a,r,d,c,s;import{initializeApp as l}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-app.js";import{getDatabase as u,ref as p,onValue as w}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-database.js";function h(e,o,n,i){let t="";if(n){let e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),t="; expires="+e.toUTCString()}document.cookie=i?e+"="+(o||"")+t+`;domain=${i};path=/`:e+"="+(o||"")+t+";path=/"}function m(e,o){const n={};return e.split(";").forEach((e=>{const[o,i]=e.split("=").map((e=>e.trim()));n[o]=decodeURIComponent(i)})),n[o]}function y(e){h("webflow-user-language",e,30)}function N(e){document.cookie=e+"=; Max-Age=-99999999;"}window.emailRegex=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,window.toggleErrorField=(e,o)=>{o?e.classList.remove("error-field"):e.classList.add("error-field")},window.disableButton=function(e){e.disabled=!0,e.style.opacity="0.5"},window.isEuRegion=function(e){const o=e.replace(/\/$/,"");return/^\/(?:[^\/]+\/)?eu(?:\/|$)/.test(o)},window.enableButton=function(e){e.disabled=!1,e.style.opacity="1"},window.getOauthUrl=function(){var e=window.location.href,o=new URL(e).hostname,n=["deriv.com","deriv.be","deriv.me"].find((e=>o.endsWith(e)));return n?`https://oauth.${n}`:"https://oauth.deriv.com"},window.getClientCountry=function(){var e;const o=m(document.cookie,"clients_country"),n=m(document.cookie,"client_information");return n&&(null==(e=JSON.parse(n))?void 0:e.residence)||o},window.deriv_com_url="deriv.com",window.deriv_me_url="deriv.me",window.deriv_be_url="deriv.be",window.webflow_domain="webflow.deriv.com",window.staging_url="staging.deriv.com",window.staging_deriv_be_url="staging.deriv.be",window.domain_list_app_id={[window.deriv_com_url]:"16929",[window.deriv_me_url]:"1411",[window.deriv_be_url]:"30767",[window.webflow_domain]:"53503",[window.staging_url]:"16303"},window.getDomain=()=>{var e=window.location.href;return new URL(e).hostname},window.getAppId=()=>{const e=window.getDomain(),o=new URLSearchParams(window.location.search||"").get("app_id");if(o)return o;const n=localStorage.getItem("config.app_id");if(n)return n;const i={[window.webflow_domain]:window.domain_list_app_id[window.webflow_domain],[window.deriv_be_url]:window.domain_list_app_id[window.deriv_be_url],[window.deriv_me_url]:window.domain_list_app_id[window.deriv_me_url],[window.staging_url]:window.domain_list_app_id[window.staging_url]};return i[e]?i[e]:window.domain_list_app_id[window.deriv_com_url]};const g=()=>{const e=localStorage.getItem("config.server_url"),o=m(document.cookie,"webflow-user-language");let n=o?o.toLowerCase():"en";"zh-cn"!==n&&"zh-tw"!==n||(n=n.replace("-","_"));const i=(e=>{let o="";return e&&Object.keys(e).forEach((n=>{o+=`&${n}=${e[n]}`})),o})((()=>{const e=m(document.cookie,"utm_data");if(e){const o=JSON.parse(e),n={};return["utm_source","utm_ad_id","utm_adgroup_id","utm_adrollclk_id","utm_campaign","utm_campaign_id","utm_content","utm_fbcl_id","utm_gl_client_id","utm_medium","utm_msclk_id","utm_term"].forEach((e=>{o.hasOwnProperty(e)&&(n[e]=o[e])})),n}return null})()),t=m(document.cookie,"affiliate_tracking"),a=t?`&affiliate_token=${t}`:"",r=void["mt5","bot","derivx"].filter((e=>window.location.pathname.includes(e)&&e))||"";return e&&/qa/.test(e)?`https://${e}/oauth2/authorize?app_id=${window.getAppId()}&l=${n}&brand=deriv${a}${i}&platform=${r}`:`${window.getOauthUrl()}/oauth2/authorize?app_id=${(()=>{const e=window.getDomain();return e===window.deriv_me_url?window.domain_list_app_id[window.deriv_me_url]:e===window.deriv_be_url?window.domain_list_app_id[window.deriv_be_url]:e===window.webflow_domain?window.domain_list_app_id[window.webflow_domain]:window.domain_list_app_id[window.deriv_com_url]})()}&l=${n}&brand=deriv${a}${i}&platform=${r}`};if(!!!m(document.cookie,"client_information")){var f=document.createElement("iframe");f.src=(()=>{const e=window.location.hostname;let o;switch(o="deriv.com"===e||"deriv.be"===e||"deriv.me"===e?"production":"staging.deriv.com"===e?"staging":"development",o){case"production":return"https://hub.deriv.com/tradershub/signup";case"staging":return"https://staging-hub.deriv.com/tradershub/signup";default:return"https://dev-hub.deriv.com/tradershub/signup"}})(),f.style.width="0",f.style.height="0",f.style.border="none",f.style.visibility="hidden",f.setAttribute("sandbox","allow-same-origin allow-scripts"),document.body.appendChild(f)}window.establishWebSocketConnection=()=>new Promise(((e,o)=>{const n=m(document.cookie,"webflow-user-language"),i=n?n.toLowerCase():"en",t=localStorage.getItem("config.server_url")||"green.derivws.com";window.websocket=new WebSocket(`wss://${t}/websockets/v3?app_id=${window.getAppId()}&l=${i||"en"}&brand=deriv`),window.websocket.addEventListener("open",(o=>{window.websocket.addEventListener("close",(()=>{window.websocket.close()})),window.websocket.addEventListener("message",(e=>{JSON.parse(e.data)})),e(window.websocket)})),window.websocket.addEventListener("error",(e=>{var n;null==(n=null==window?void 0:window.websocket)||n.close(),o(e)}))})),window.socketMessageSend=async(e,o)=>{var n;try{return(null==window?void 0:window.websocket)&&(null==(n=null==window?void 0:window.websocket)?void 0:n.readyState)===(null==WebSocket?void 0:WebSocket.OPEN)?(window.websocket.send(e),new Promise(((e,n)=>{window.websocket.addEventListener("message",(i=>{const t=JSON.parse(i.data);o===t.msg_type&&(t.error?n(t.error):e(t))}))}))):establishWebSocketConnection().then((()=>(websocket.send(e),new Promise(((e,n)=>{websocket.addEventListener("message",(i=>{const t=JSON.parse(i.data);o===t.msg_type&&(t.error?n(t.error):e(t))}))}))))).catch((e=>Promise.reject(e)))}catch(i){return Promise.reject(i)}};const v=[{id:"appgallery",selectors:[".footer_banner-badge.gallery.w-inline-block",".app-download_link-wrapper.appgallery.w-inline-block"],countries:["af","ax","al","dz","as","ad","ao","aq","am","au","at","az","bh","bd","by","be","bj","bm","bt","bo","ba","bw","bv","br","io","bn","bg","bf","bi","kh","cm","ca","cv","bq","cf","td","cn","cx","cc","km","cg","cd","ck","ci","hr","cu","cw","cy","cz","dk","dj","dm","eg","gq","er","ee","et","fk","fo","fj","fi","fr","pf","tf","ga","gm","ge","de","gh","gi","gr","gl","gu","gg","gn","gw","hm","va","hu","is","in","id","ir","iq","ie","im","il","it","jp","je","jo","kz","ke","ki","kr","kp","kw","kg","la","lv","lb","ls","lr","ly","li","lt","lu","mo","mk","mg","mw","my","mv","ml","mt","mh","mr","mu","yt","mx","fm","md","mc","mn","me","ma","mz","mm","na","nr","np","nl","nc","nz","ne","ng","nu","nf","mp","no","om","pk","pw","ps","pg","pe","ph","pn","pl","pt","qa","re","ro","ru","rw","sh","kn","pm","bl","mf","ws","sm","st","sa","sn","rs","sc","sl","sg","sx","sk","si","sb","so","gs","ss","es","lk","sd","sj","sz","se","ch","sy","tw","tj","tz","th","tl","tg","tk","to","tn","tr","tm","tc","tv","ug","ua","ae","gb","um","us","uz","vu","vi","wf","eh","ye","zm","zw"]},{id:"googlePlay",selectors:[".footer_banner-badge.google.w-inline-block",".app-download_link-wrapper.google.w-inline-block"],countries:["af","ax","as","ad","ai","aq","au","bb","bt","bv","io","bn","bi","ca","bq","cf","cx","cc","cg","cd","ck","cw","gq","et","fk","fo","gf","pf","tf","gl","gp","gu","gg","gy","hm","va","hk","ir","im","jp","je","ki","kp","ls","ly","mg","mw","mh","mq","mr","yt","fm","mn","me","ms","nr","nc","nz","ng","nu","nf","mp","pw","ps","pn","pr","re","sh","kn","lc","pm","vc","bl","mf","st","sg","sx","gs","ss","sj","sz","sy","tl","tk","tc","tv","um","us","vg","vi","wf","eh"]},{id:"appstore",selectors:[".footer_banner-badge.store.w-inline-block",".app-download_link-wrapper.appstore.w-inline-block"],countries:["ax","al","as","ad","aq","aw","au","at","bd","be","bv","io","bg","bi","ca","bq","cf","cx","cc","km","ck","hr","cu","cw","cy","cz","dk","dj","gq","er","ee","et","fk","fo","fi","fr","gf","pf","tf","de","gi","gr","gl","gp","gu","gg","gn","ht","hm","va","hk","hu","is","ir","iq","ie","im","il","it","je","ki","kp","lv","ls","ly","li","lt","lu","mt","mh","mq","yt","fm","me","nl","nc","nz","ng","nu","nf","mp","no","ps","pn","pl","pt","pr","re","ro","sh","pm","bl","mf","ws","sm","sg","sx","sk","si","so","gs","ss","es","sd","sj","se","ch","sy","tw","tl","tg","tk","tr","tv","gb","um","us","vu","vi","wf","eh"]},{id:"p2p",selectors:["#p2payment.accordion_toggle-block","#p2component.section_dp2p","#card_block_p2p.help_category"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"w-dyn-item-p2p",selectors:["div.w-dyn-item"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"hideRow",selectors:["#footer_social-icons_row","#footer_text_row",".footer_risk-warning.w-richtext"],countries:["br","uy","lk","ch","za","ec"]},{id:"hideDiel",selectors:["#footer_text_diel","#footer_social-icons_diel"],countries:["br","uy","lk","ch","za","ec"]}],Y=[{id:"showElems",selectors:[".banner_disclaimer"],countries:["br","uy","lk","ch","za","ec"]}],_=()=>{const e=window.getClientCountry();v.forEach((o=>{const n="hideDiel"===o.id?!o.countries.includes(e):o.countries.includes(e);if(e&&n)return o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((e=>{if(e)if("w-dyn-item-p2p"===o.id){e.querySelector("#card_block_p2p.help_category")&&(e.style.display="none")}else e.style.display="none"}))}));if(!n){const e=document.querySelector(".footer_social-icons.diel");e&&(e.style.display="flex")}})),Y.forEach((o=>{e&&o.countries.includes(e)?o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{if(o){const n=document.querySelector(".page-wrapper");".banner_disclaimer"===e?(n.classList.add("disclaimer-show"),o.classList.remove("hide-element")):o.style.display="block"}}))})):o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{o&&(".banner_disclaimer"===e?o.classList.add("hide-element"):o.style.display="none")}))}))}))},A=JSON.stringify({website_status:1});!async function(){try{const e=await fetch("https://www.cloudflare.com/cdn-cgi/trace"),o=await e.text(),n=Object.fromEntries(o.split("\n").map((e=>e.split("=",2)))).loc.toLowerCase();n!==m(document.cookie,"clients_country")&&(N("clients_country"),h("clients_country",n,30)),_()}catch(e){_()}}();m(document.cookie,"clients_country")||window.socketMessageSend(A,"website_status").then((e=>{m(document.cookie,"clients_country")!==e.website_status.clients_country&&(N("clients_country"),h("clients_country",e.website_status.clients_country,30)),_()})).catch((e=>{}));const b=["ar","bn","de","en","es","fr","it","ko","pl","pt","ru","si","sw","th","tr","vi","zh_cn","zh_tw","zh-cn","zh-tw"];(()=>{var e;const o=window.location.pathname,n=window.location.hash,i=window.location.search,t=o.split("/"),a=t[1],r=b.includes(a||""),d=t.includes("careers")||t.includes("locations")||t.includes("derivtech")||t.includes("derivlife")||t.includes("eu-careers")||t.includes("our-locations");r&&y(a);const c=(null==(e=m(document.cookie,"webflow-user-language"))?void 0:e.toLowerCase())||"en",s=r?a:c;if((r||"en"!==c)&&a!==c)if(r&&a!==c)y(s);else if(!d){const e=(r?t.map((e=>e===a?s:e)).join("/"):s+t.join("/"))+i+n;window.location.href="/"+e}})();const k=function(){let e,o=!1,n=!1;const i=()=>{n=!0,o=!!m(document.cookie,"client_information"),o&&clearInterval(e),document.dispatchEvent(new Event("authStatusChange"))};return i(),e=setInterval(i,800),{getLoggedInStatus:()=>o,getAuthCheckedStatus:()=>n,onAuthStatusChange:e=>document.addEventListener("authStatusChange",e)}}();k.onAuthStatusChange((()=>{if(k.getAuthCheckedStatus()&&k.getLoggedInStatus()){document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.add("hide-element")}))}else if(k.getAuthCheckedStatus()&&!k.getLoggedInStatus()){document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.add("hide-element")}))}}));const L=window.location.href;if(["help-centre"].some((e=>L.includes(e)))){const e=new URL(L).searchParams;e.has("platform")&&"derivgo"===e.get("platform")&&(S=".derivgo-query-element",document.querySelectorAll(S).forEach((e=>{e.style.display="none"})))}var S;const E=document.querySelector(".banner_disclaimer"),C=document.querySelector(".main-wrapper");if(E){new ResizeObserver((e=>{for(let o of e)if(o.target===E){let e=o.target.getBoundingClientRect();C&&(C.style.paddingTop=e.height+"px")}})).observe(E)}window.addEventListener("pageshow",(function(e){if(e.persisted){const e=document.querySelector(".w-nav-overlay");e&&(e.style.display="none",document.querySelector("body").click())}}));const q=u(l({databaseURL:window.location.hostname.includes("staging")?"https://app-config-staging.firebaseio.com":"https://app-config-prod.firebaseio.com"}));let I=!1,z=!1;!function(){var e;const o=document.getElementById("live_chat-wrapper");try{const e=p(q,"remote_config/deriv-com/chat");w(e,(e=>{const n=e.val();I=n.live_chat,z=n.whatsapp_chat;const i=document.querySelector(".whatsapp_chat"),t=document.querySelector(".livechatbtn");i&&(i.style.visibility=z?"visible":"hidden"),t&&(t.style.visibility=I?"visible":"hidden");if(window.location.pathname.includes("/help-centre")){const e=document.querySelectorAll(".livechatbtn");I?e.forEach((e=>{e.style.visibility="visible"})):e.forEach((e=>{e.style.visibility="hidden"}));const o=document.querySelectorAll(".whatsapp_chat");z?o.forEach((e=>{e.style.visibility="visible"})):o.forEach((e=>{e.style.visibility="hidden"}))}window.addEventListener("scroll",(function(){var e,n;(I||z)&&(null==(e=null==o?void 0:o.classList)||e.remove("hide-element")),I||z||null==(n=null==o?void 0:o.classList)||n.add("hide-element")}))}),(e=>{var n;null==(n=null==o?void 0:o.classList)||n.remove("hide-element")}))}catch(n){null==(e=null==o?void 0:o.classList)||e.remove("hide-element")}}();new MutationObserver((function(e){for(const o of e)if(o.addedNodes.length)for(const e of o.addedNodes)e.nodeType===Node.ELEMENT_NODE&&"chat-widget-minimized"===e.id&&(e.style.opacity="0")})).observe(document.body,{childList:!0,subtree:!0});const x=window.getClientCountry();const j=[{country:"af",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"ax",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"al",apple:"No",android:"Yes",huawei:"No"},{country:"dz",apple:"Yes",android:"Yes",huawei:"No"},{country:"as",apple:"N/A",android:"No",huawei:"N/A"},{country:"ad",apple:"N/A",android:"N/A",huawei:"No"},{country:"ao",apple:"Yes",android:"Yes",huawei:"No"},{country:"ai",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"aq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ag",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ar",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"am",apple:"Yes",android:"Yes",huawei:"No"},{country:"aw",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"au",apple:"No",android:"No",huawei:"No"},{country:"at",apple:"No",android:"Yes",huawei:"No"},{country:"az",apple:"Yes",android:"Yes",huawei:"No"},{country:"bs",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bh",apple:"Yes",android:"Yes",huawei:"No"},{country:"bd",apple:"N/A",android:"Yes",huawei:"No"},{country:"bb",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"by",apple:"Yes",android:"Yes",huawei:"No"},{country:"be",apple:"No",android:"Yes",huawei:"No"},{country:"bz",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bj",apple:"Yes",android:"Yes",huawei:"No"},{country:"bm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"bt",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"bo",apple:"Yes",android:"Yes",huawei:"No"},{country:"ba",apple:"Yes",android:"Yes",huawei:"No"},{country:"bw",apple:"Yes",android:"Yes",huawei:"No"},{country:"bv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"br",apple:"Yes",android:"Yes",huawei:"No"},{country:"io",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"bn",apple:"Yes",android:"N/A",huawei:"No"},{country:"bg",apple:"No",android:"Yes",huawei:"No"},{country:"bf",apple:"Yes",android:"Yes",huawei:"No"},{country:"bi",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kh",apple:"Yes",android:"Yes",huawei:"No"},{country:"cm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ca",apple:"No",android:"No",huawei:"No"},{country:"cv",apple:"Yes",android:"Yes",huawei:"No"},{country:"bq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ky",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cf",apple:"N/A",android:"N/A",huawei:"No"},{country:"td",apple:"Yes",android:"Yes",huawei:"No"},{country:"cl",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cn",apple:"Yes",android:"Yes",huawei:"No"},{country:"cx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"co",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"km",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cg",apple:"Yes",android:"N/A",huawei:"No"},{country:"cd",apple:"Yes",android:"N/A",huawei:"No"},{country:"ck",apple:"N/A",android:"N/A",huawei:"No"},{country:"cr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ci",apple:"Yes",android:"Yes",huawei:"No"},{country:"hr",apple:"No",android:"Yes",huawei:"No"},{country:"cu",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cw",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cy",apple:"No",android:"Yes",huawei:"No"},{country:"cz",apple:"No",android:"Yes",huawei:"No"},{country:"dk",apple:"No",android:"Yes",huawei:"No"},{country:"dj",apple:"N/A",android:"Yes",huawei:"No"},{country:"dm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"do",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ec",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"eg",apple:"Yes",android:"Yes",huawei:"No"},{country:"sv",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gq",apple:"N/A",android:"N/A",huawei:"No"},{country:"er",apple:"N/A",android:"Yes",huawei:"No"},{country:"ee",apple:"No",android:"Yes",huawei:"No"},{country:"et",apple:"N/A",android:"N/A",huawei:"No"},{country:"fk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"fo",apple:"N/A",android:"N/A",huawei:"No"},{country:"fj",apple:"Yes",android:"Yes",huawei:"No"},{country:"fi",apple:"No",android:"Yes",huawei:"No"},{country:"fr",apple:"No",android:"Yes",huawei:"No"},{country:"gf",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"pf",apple:"N/A",android:"N/A",huawei:"No"},{country:"tf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ga",apple:"Yes",android:"Yes",huawei:"No"},{country:"gm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ge",apple:"Yes",android:"Yes",huawei:"No"},{country:"de",apple:"No",android:"Yes",huawei:"No"},{country:"gh",apple:"Yes",android:"Yes",huawei:"No"},{country:"gi",apple:"N/A",android:"Yes",huawei:"No"},{country:"gr",apple:"No",android:"Yes",huawei:"No"},{country:"gl",apple:"N/A",android:"N/A",huawei:"No"},{country:"gd",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gp",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"gu",apple:"N/A",android:"No",huawei:"N/A"},{country:"gt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gg",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"gn",apple:"N/A",android:"Yes",huawei:"No"},{country:"gw",apple:"Yes",android:"Yes",huawei:"No"},{country:"gy",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ht",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"hm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"va",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"hn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"hk",apple:"No",android:"No",huawei:"Yes"},{country:"hu",apple:"No",android:"Yes",huawei:"No"},{country:"is",apple:"No",android:"Yes",huawei:"No"},{country:"in",apple:"Yes",android:"Yes",huawei:"No"},{country:"id",apple:"Yes",android:"Yes",huawei:"No"},{country:"ir",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"iq",apple:"No",android:"Yes",huawei:"N/A"},{country:"ie",apple:"No",android:"Yes",huawei:"No"},{country:"im",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"il",apple:"No",android:"Yes",huawei:"No"},{country:"it",apple:"No",android:"Yes",huawei:"No"},{country:"jm",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"jp",apple:"Yes",android:"No",huawei:"No"},{country:"je",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"jo",apple:"Yes",android:"Yes",huawei:"No"},{country:"kz",apple:"Yes",android:"Yes",huawei:"No"},{country:"ke",apple:"Yes",android:"Yes",huawei:"No"},{country:"ki",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kr",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"kp",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kw",apple:"Yes",android:"Yes",huawei:"No"},{country:"kg",apple:"Yes",android:"Yes",huawei:"No"},{country:"la",apple:"Yes",android:"Yes",huawei:"No"},{country:"lv",apple:"No",android:"Yes",huawei:"No"},{country:"lb",apple:"Yes",android:"Yes",huawei:"No"},{country:"ls",apple:"N/A",android:"N/A",huawei:"No"},{country:"lr",apple:"Yes",android:"Yes",huawei:"No"},{country:"ly",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"li",apple:"N/A",android:"Yes",huawei:"No"},{country:"lt",apple:"No",android:"Yes",huawei:"No"},{country:"lu",apple:"No",android:"Yes",huawei:"No"},{country:"mo",apple:"Yes",android:"Yes",huawei:"No"},{country:"mk",apple:"Yes",android:"Yes",huawei:"No"},{country:"mg",apple:"Yes",android:"N/A",huawei:"No"},{country:"mw",apple:"Yes",android:"N/A",huawei:"No"},{country:"my",apple:"Yes",android:"Yes",huawei:"No"},{country:"mv",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"ml",apple:"Yes",android:"Yes",huawei:"No"},{country:"mt",apple:"No",android:"Yes",huawei:"No"},{country:"mh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mq",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"mr",apple:"Yes",android:"N/A",huawei:"No"},{country:"mu",apple:"Yes",android:"Yes",huawei:"No"},{country:"yt",apple:"N/A",android:"N/A",huawei:"No"},{country:"mx",apple:"Yes",android:"Yes",huawei:"No"},{country:"fm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"md",apple:"Yes",android:"Yes",huawei:"No"},{country:"mc",apple:"Yes",android:"Yes",huawei:"No"},{country:"mn",apple:"Yes",android:"N/A",huawei:"No"},{country:"me",apple:"No",android:"N/A",huawei:"No"},{country:"ms",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ma",apple:"Yes",android:"Yes",huawei:"No"},{country:"mz",apple:"Yes",android:"Yes",huawei:"No"},{country:"mm",apple:"Yes",android:"Yes",huawei:"No"},{country:"na",apple:"Yes",android:"Yes",huawei:"No"},{country:"nr",apple:"Yes",android:"N/A",huawei:"No"},{country:"np",apple:"Yes",android:"Yes",huawei:"No"},{country:"nl",apple:"No",android:"Yes",huawei:"No"},{country:"nc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nz",apple:"No",android:"No",huawei:"No"},{country:"ni",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ne",apple:"Yes",android:"Yes",huawei:"No"},{country:"ng",apple:"No",android:"No",huawei:"No"},{country:"nu",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mp",apple:"N/A",android:"No",huawei:"N/A"},{country:"no",apple:"No",android:"Yes",huawei:"No"},{country:"om",apple:"Yes",android:"Yes",huawei:"No"},{country:"pk",apple:"Yes",android:"Yes",huawei:"No"},{country:"pw",apple:"Yes",android:"No",huawei:"N/A"},{country:"ps",apple:"N/A",android:"N/A",huawei:"No"},{country:"pa",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pg",apple:"Yes",android:"Yes",huawei:"No"},{country:"py",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pe",apple:"Yes",android:"Yes",huawei:"No"},{country:"ph",apple:"Yes",android:"Yes",huawei:"No"},{country:"pn",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"pl",apple:"No",android:"Yes",huawei:"No"},{country:"pt",apple:"No",android:"Yes",huawei:"No"},{country:"pr",apple:"N/A",android:"No",huawei:"Yes"},{country:"qa",apple:"Yes",android:"Yes",huawei:"No"},{country:"re",apple:"N/A",android:"N/A",huawei:"No"},{country:"ro",apple:"No",android:"Yes",huawei:"No"},{country:"ru",apple:"Yes",android:"Yes",huawei:"No"},{country:"rw",apple:"Yes",android:"Yes",huawei:"No"},{country:"sh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kn",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"lc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"pm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"vc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"bl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ws",apple:"N/A",android:"Yes",huawei:"No"},{country:"sm",apple:"N/A",android:"Yes",huawei:"No"},{country:"st",apple:"Yes",android:"N/A",huawei:"No"},{country:"sa",apple:"Yes",android:"Yes",huawei:"No"},{country:"sn",apple:"Yes",android:"Yes",huawei:"No"},{country:"rs",apple:"Yes",android:"Yes",huawei:"No"},{country:"sc",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"sl",apple:"Yes",android:"Yes",huawei:"No"},{country:"sg",apple:"No",android:"No",huawei:"No"},{country:"sx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sk",apple:"No",android:"Yes",huawei:"No"},{country:"si",apple:"No",android:"Yes",huawei:"No"},{country:"sb",apple:"Yes",android:"Yes",huawei:"No"},{country:"so",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"za",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gs",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ss",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"es",apple:"No",android:"Yes",huawei:"No"},{country:"lk",apple:"Yes",android:"Yes",huawei:"No"},{country:"sd",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"sr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"sj",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sz",apple:"Yes",android:"N/A",huawei:"No"},{country:"se",apple:"No",android:"Yes",huawei:"No"},{country:"ch",apple:"No",android:"Yes",huawei:"No"},{country:"sy",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tw",apple:"No",android:"Yes",huawei:"No"},{country:"tj",apple:"Yes",android:"Yes",huawei:"No"},{country:"tz",apple:"Yes",android:"Yes",huawei:"No"},{country:"th",apple:"Yes",android:"Yes",huawei:"No"},{country:"tl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tg",apple:"N/A",android:"Yes",huawei:"No"},{country:"tk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"to",apple:"Yes",android:"Yes",huawei:"No"},{country:"tt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"tn",apple:"Yes",android:"Yes",huawei:"No"},{country:"tr",apple:"No",android:"Yes",huawei:"No"},{country:"tm",apple:"Yes",android:"Yes",huawei:"No"},{country:"tc",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"tv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ug",apple:"Yes",android:"Yes",huawei:"No"},{country:"ua",apple:"Yes",android:"Yes",huawei:"No"},{country:"ae",apple:"Yes",android:"Yes",huawei:"No"},{country:"gb",apple:"No",android:"Yes",huawei:"No"},{country:"um",apple:"N/A",android:"No",huawei:"N/A"},{country:"us",apple:"No",android:"No",huawei:"N/A"},{country:"uy",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"uz",apple:"Yes",android:"Yes",huawei:"No"},{country:"vu",apple:"No",android:"Yes",huawei:"N/A"},{country:"ve",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vg",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"vi",apple:"N/A",android:"No",huawei:"N/A"},{country:"wf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"eh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ye",apple:"Yes",android:"Yes",huawei:"No"},{country:"zm",apple:"Yes",android:"Yes",huawei:"No"},{country:"zw",apple:"Yes",android:"Yes",huawei:"No"}].find((e=>e.country===x)),O=j?function(e){const{apple:o,android:n,huawei:i}=e;return"Yes"===o&&"Yes"===n&&"Yes"===i?"Android, iOS & Huawei":"Yes"===o&&"Yes"===n&&"Yes"!==i?"Android, and iOS":"Yes"===o&&"Yes"===i&&"Yes"!==n?"iOS, and Huawei":"Yes"===n&&"Yes"!==o&&"Yes"!==i?"Android":"Yes"===o&&"Yes"===i&&"Yes"!==n?"iOS, and Huawei":"Yes"===o&&"Yes"!==n&&"Yes"!==i?"iOS":"Yes"!==o&&"Yes"!==n&&"Yes"===i?"Huawei":""}(j):"",$=document.getElementById("app-download-heading");$&&($.innerText=O);const B=document.querySelector(".redirection_background-wrapper"),D=document.getElementById("cancel-redirect"),P=document.getElementById("proceed-redirect");if(window.isEuRegion(window.location.pathname)&&B&&D&&P){const e=["deriv.me","deriv.be","deriv.com","app.deriv.me","app.deriv.be","app.deriv.com","docs.deriv.com","community.deriv.com","deriv.statuspage.io","signup.deriv.com","login.deriv.com","api.deriv.com"];let o="",n="_self";document.querySelectorAll("a").forEach((function(i){const t=new URL(i.href,window.location.href),a=new URL(window.location.href);e.includes(t.host)||t.host===a.host||i.addEventListener("click",(function(e){e.preventDefault(),o=t.href,n=i.target||"_self",B.classList.remove("hide-element"),document.body.style.overflow="hidden"}))})),D.addEventListener("click",(function(){B.classList.add("hide-element"),document.body.style.overflow="auto",o=""})),P.addEventListener("click",(function(){o&&(window.open(o,n),o="",B.classList.add("hide-element"),document.body.style.overflow="auto")}))}document.querySelector(".banner_disclaimer")?document.body.classList.add("disclaimer-visible"):document.body.classList.remove("disclaimer-visible");const W=document.querySelectorAll(".navbar_accordion-item");function R(){const e=document.querySelector(".navbar_accordion-trigger.open");e&&e.scrollIntoView({behavior:"smooth",block:"start"})}W.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.overflow="hidden",o.style.transition="max-height 0.3s ease-in, opacity 0.3s ease-in",o.style.opacity="0"})),W.forEach((e=>{const o=e.querySelector(".navbar_accordion-trigger");o.addEventListener("click",(function(){const e=o.classList.contains("open");if(W.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.opacity="0"})),!e){o.classList.add("open");const e=o.nextElementSibling;e.classList.add("open"),e.style.maxHeight=e.scrollHeight+"px",e.style.opacity="1"}}))}));document.querySelectorAll(".navbar_accordion-trigger").forEach((e=>{e.addEventListener("click",(function(){setTimeout(R,300)}))}));const U=new MutationObserver((e=>{e.forEach((e=>{if("class"===e.attributeName){const o=e.target;o.classList.contains("open")&&o.scrollIntoView({behavior:"smooth",block:"start"})}}))}));document.querySelectorAll(".navbar_accordion-item").forEach((e=>{U.observe(e,{attributes:!0})}));const J=new URL(window.location.href),T=new URLSearchParams(J.search),F=T.get("t");if(T.has("referrer")&&null!=F){m(document.cookie,"referrer_token")!==F&&(N("referrer_token"),h("referrer_token",F,365,".deriv.com"))}const H=document.getElementById("navbar-home_login");H&&H.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const M=document.getElementById("res-navbar-home_login");M&&M.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const V=document.getElementById("white-navbar_login");V&&V.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const G=document.getElementById("res-white-navbar_login");G&&G.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()})),window.fallbackLoader="Migrated All + Removal of Webflow array functions";let K=document.querySelectorAll(".navbar_accordion-trigger");K.forEach((e=>{e.addEventListener("click",(function(){K.forEach((e=>e.classList.remove("current"))),this.classList.add("current")}))}));let Z=document.querySelector(".navbar_accordion-link.w--current");if(Z){let e=Z.closest(".navbar_accordion-item");if(e){let o=e.querySelector(".navbar_accordion-trigger");o&&o.classList.add("current")}}let Q=document.querySelector(".locale > .new-navbar_dropdown-link.w--current");if(Q){let e=Q.getAttribute("hreflang"),o=document.querySelectorAll(".current-locale-iso-code");if(e&&o.length)for(let n of o)n.innerText=e}function X(e,o,n){let i="";{let e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),i="; expires="+e.toUTCString()}document.cookie=e+"="+(o||"")+i+"; path=/"}let ee=document.querySelectorAll(".w-locales-items");if(ee.length>0){let e=function(e){let o=document.querySelector('a[hreflang="'+e+'"]');o&&window.location.pathname!==o.getAttribute("href")&&o.click()};ee.forEach((function(e){e.querySelectorAll("a").forEach((function(e){e.addEventListener("click",(function(o){o.preventDefault(),X("webflow-user-language",e.getAttribute("hreflang"),30),window.location.href=e.href}))}))})),window.setLanguageCookie=e=>{X("webflow-user-language",e,30)};let o=function(e){let o=document.cookie.split(";");for(let n=0;ni.includes(e))),o&&t&&e(o)}if(document.querySelector(".new-navbar_component")){let e=function(){document.body.classList.add("disable-scroll")},o=function(){document.body.classList.remove("disable-scroll")};const n=document.querySelector(".new-navbar_component");n.addEventListener("mouseenter",(()=>{window.innerWidth>991&&e()})),n.addEventListener("mouseleave",(()=>{window.innerWidth>991&&o()}))}window.getClientCountry();const oe=window.parseCookies(document.cookie,"webflow-user-language"),ne=["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"];if(window.location.pathname.endsWith("p2p")&&!window.location.pathname.startsWith("/blog")){const e=window.getClientCountry();e&&ne.includes(e)&&("en"===oe?window.location.replace("/404"):window.location.replace(`/${oe}/404`))}if(void 0!==window.parseCookies(document.cookie,"client_information")){let e=function(e){e.forEach((e=>{e.href="https://app.deriv.com/appstore/traders-hub"}))},o=document.querySelectorAll("a.live-markets_button.is-secondary.is-small.is-purchase.w-button"),n=document.querySelectorAll("a.live-markets_button.is-secondary.is-small.is-sell.w-button");e(o),e(n)}document.getElementById("mobile-menu"),document.getElementById("live_chat-wrapper");const ie=()=>{window.LC_API&&window.LC_API.open_chat_window&&window.LC_API.open_chat_window()},te=()=>{"true"===new URLSearchParams(window.location.search).get("is_livechat_open")&&ie()},ae=e=>{var o;null==(o=null==window?void 0:window.LiveChatWidget)||o.on("ready",(()=>{window.LC_API.open_chat_window(),window.LC_API.hide_chat_window(),te();const o=window.parseCookies(document.cookie,"utm_data"),n=o?JSON.parse(o):{},{utm_source:i,utm_medium:t,utm_campaign:a}=n,r=window.parseCookies(document.cookie,"client_information"),d=new URLSearchParams(window.location.search),{loginid:c,email:s,landing_company_shortcode:l,currency:u,residence:p,first_name:w,last_name:h}=r?JSON.parse(r):{},m={is_logged_in:e,loginid:c??"",landing_company_shortcode:l??"",currency:u??"",residence:p??"",email:s??"",platform:d.get("platform")??"",utm_source:i??"",utm_medium:t??"",utm_campaign:a??""};window.LiveChatWidget.call("set_session_variables",m),e?(s&&window.LiveChatWidget.call("set_customer_email",s),w&&h&&window.LiveChatWidget.call("set_customer_name",`${w} ${h}`)):window.LC_API.on_chat_ended=()=>{window.LiveChatWidget.call("set_customer_email"," "),window.LiveChatWidget.call("set_customer_name"," ")},te(),window.LiveChatWidget.on("new_event",(e=>{e.greeting&&window.LC_API.open_chat_window()}))}))};let re=!1;const de=()=>{const e=!!window.parseCookies(document.cookie,"client_information");e!==re&&(ae(e),re=e)};de(),setInterval(de,2e3),(()=>{if(window.__lc=window.__lc||{},window.__lc.license="12049137",window.LC_API=window.LC_API||{loaded:!1},window.LC_API.loaded)te();else{const e=document.createElement("script");e.async=!0,e.src="https://cdn.livechatinc.com/tracking.js",e.onload=()=>{window.LC_API.loaded=!0,window.LC_API.on_after_load=function(){ae(!!window.parseCookies(document.cookie,"client_information")),te()},"undefined"!=typeof LiveChatWidget&&LiveChatWidget.init&&LiveChatWidget.init()},document.body.appendChild(e)}})();const ce=document.querySelectorAll(".livechatbtn");ce.length>0&&ce.forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault(),ie()}))}));const se=document.getElementById("liveChatBtn");se&&se.addEventListener("click",(e=>{e.preventDefault(),ie()}));document.querySelectorAll('a[rel="liveChatBtn"]').forEach((e=>{null==e||e.addEventListener("click",(e=>{e.preventDefault(),ie()}))}));let le=document.querySelector(".navbar_menu-button");le&&le.addEventListener("click",(function(){let e=window.innerHeight,o=document.querySelector(".new-navbar_main-wrapper");if(o){let n=e-o.offsetHeight,i=document.querySelector(".new-navbar_menu");i&&(i.style.height=`${n}px`)}}));let ue=document.querySelector(".lang-mob");ue&&ue.addEventListener("click",(function(){let e=document.querySelector(".new-navbar_menu-wrapper");e&&e.scrollBy({top:-3e3})}));class pe{constructor(e){this.cookieName=e}setItem(e){const o=new Date;o.setDate(o.getDate()+30);const n="expires="+o.toUTCString(),i=encodeURIComponent(JSON.stringify(e));document.cookie=`${this.cookieName}=${i};${n};path=/`}getItem(){const e=document.cookie.split(";");for(let o=0;ove.includes(e)))&&document.head.querySelectorAll("link").forEach((function(e){e.hasAttribute("hreflang")&&"x-default"!==e.getAttribute("hreflang")&&e.remove()}));const Ye=e=>{window.rudderanalytics?window.rudderanalytics.track(e.name,e.properties):(e=>{let o=[],n=parseCookies(document.cookie,"cached_analytics_events");n&&(o=JSON.parse(n)),o.push(e),document.cookie=`cached_analytics_events=${JSON.stringify(o)}; path=/; Domain=.deriv.com`})(e)};window.addClickListener=function(e,o,n){e&&e.addEventListener("click",(function(){Ye({name:o,properties:n})}))};var _e=null==document?void 0:document.getElementsByClassName("livechatbtn"),Ae=null==document?void 0:document.getElementsByClassName("whatsapp_chat"),be=null==document?void 0:document.getElementsByClassName("tradershub-btn"),ke=document.querySelectorAll(".btn-free-demo .w-button"),Le=document.querySelectorAll('.btn-free-demo [data-class="w-button"]');const Se=document.querySelectorAll('[data-attributes="btn-primary-nav"]'),Ee=document.querySelectorAll('[data-attributes="btn-secondary-nav"]');_e&&Array.from(_e).forEach((e=>{window.addClickListener(e,"ce_widget_usage_form",{action:"click",widget_name:"livechat"})})),Ae&&Array.from(Ae).forEach((e=>{window.addClickListener(e,"ce_widget_usage_form",{action:"click",widget_name:"whatsapp"})})),be&&Array.from(be).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Traders Hub"})})),ke&&Array.from(ke).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),Le&&Array.from(Le).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),Se&&Array.from(Se).forEach((e=>{e.classList.contains("tradershub-btn")||window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),Ee&&Array.from(Ee).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Login"})}));var Ce,qe,Ie;"deriv.com"===window.location.hostname||"deriv.be"===window.location.hostname||"deriv.me"===window.location.hostname?(Ce="sdk-UhZV3cNEg5nLNLNS",Ie="nre64BV0dNIa44zW4tz5ow==",qe="1oV5agvlcnCZ6IH94wCKM1oR8Pd"):(Ce="sdk-9wuqJ1mlcQsSyZQ",Ie="",qe="1lN3tsFD2nruGFgM5F074DC2hMB");const ze=(Ne=window.parseCookies(document.cookie,"client_information"))?JSON.parse(Ne):null,xe=window.parseCookies(document.cookie,"utm_data"),je=xe?JSON.parse(xe):{},Oe=window.parseCookies(document.cookie,"signup_device");let $e=null;Oe&&($e=(null==(e=JSON.parse(Oe))?void 0:e.signup_device)||null);const Be={growthbookKey:Ce,growthbookDecryptionKey:Ie,rudderstackKey:qe,growthbookOptions:{navigate:e=>window.location.replace(e),antiFlicker:!1,navigateDelay:0,attributes:{country:window.parseCookies(document.cookie,"clients_country")||window.parseCookies(document.cookie,"website_status"),user_language:window.parseCookies(document.cookie,"user_language")||("undefined"!=typeof window?localStorage.getItem("i18n")||navigator.language:null),device_language:window.parseCookies(document.cookie,"language")||" ",device_type:$e,utm_source:null==je?void 0:je.utm_source,utm_medium:null==je?void 0:je.utm_medium,utm_campaign:null==je?void 0:je.utm_campaign,is_authorised:!!window.parseCookies(document.cookie,"client_information"),loggedIn:!!window.parseCookies(document.cookie,"client_information"),url:window.location.href}}};try{null==Analytics||Analytics.Analytics.initialise(Be);const e=(null==ze?void 0:ze.user_id)?null==ze?void 0:ze.user_id:null==(i=null==(n=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getInstances)?void 0:n.call(o).tracking)?void 0:i.getAnonymousId();null==(t=null==Analytics?void 0:Analytics.Analytics)||t.identifyEvent(e)}catch(Pe){}null==(a=null==Analytics?void 0:Analytics.Analytics)||a.pageView(location.pathname,"Deriv.com"),window.useGrowthbookFeatureFlag=function({featureFlag:e}){var o,n,i,t,a;let r=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getFeatureValue(e);return null==(a=null==(t=null==(i=null==(n=null==Analytics?void 0:Analytics.Analytics)?void 0:n.getInstances())?void 0:i.ab)?void 0:t.GrowthBook)||a.setRenderer((function(){var o;const n=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getFeatureValue(e);r=n})),r};const De=window.parseCookies(document.cookie,"client_information")?JSON.parse(window.parseCookies(document.cookie,"client_information")):null;(null==De?void 0:De.loginid)&&(null==window||window.hj("identify",De.loginid,{is_logged_in:!!window.parseCookies(document.cookie,"client_information"),landing_company_shortcode:De.landing_company_shortcode||"null"}));null==(s=null==(c=null==(d=null==(r=null==Analytics?void 0:Analytics.Analytics)?void 0:r.getInstances())?void 0:d.ab)?void 0:c.GrowthBook)||s.loadFeatures().then((()=>{window.location.href.indexOf("/partners")>-1==!1&&(()=>{var e;const o=(null==(e=null==Analytics?void 0:Analytics.Analytics)?void 0:e.getFeatureValue("trigger_os_signup_wf"))?function(){const e=navigator.userAgent.toLowerCase();return/ipad|iphone|ipod/.test(e)}()||function(){const e=navigator.userAgent.toLowerCase();return/safari/.test(e)&&!/chrome/.test(e)&&!/crios/.test(e)}()?`https://${window.location.host}/signup`:(()=>{const e=window.location.hostname;let o;switch(o="deriv.com"===e||"deriv.be"===e||"deriv.me"===e?"production":"staging.deriv.com"===e?"staging":"development",o){case"production":return"https://hub.deriv.com/tradershub/signup";case"staging":return"https://staging-hub.deriv.com/tradershub/signup";default:return"https://dev-hub.deriv.com/tradershub/signup"}})():`https://${window.location.host}/signup`,n=document.getElementById("cta-home-btn-navbar");n&&(n.href=o);const i=document.querySelectorAll(".logged-out-btn");null==i||i.forEach((e=>{var n;(null==(n=null==e?void 0:e.href)?void 0:n.indexOf("/signup"))>0&&(e.href=o)}));const t=document.querySelectorAll(".logged-out-btn a");null==t||t.forEach((e=>{var n;(null==(n=null==e?void 0:e.href)?void 0:n.indexOf("/signup"))>0&&(e.href=o)}))})()})); From ac6c3cac3813e22955018181e5c615805742e58f Mon Sep 17 00:00:00 2001 From: Prince Date: Wed, 18 Sep 2024 16:59:50 +0400 Subject: [PATCH 53/57] chore: test pre-commit --- .husky/pre-commit | 2 -- 1 file changed, 2 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 98781a5..906da39 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,2 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" npm run pre-commit:generate-bundle From 7714a2a513080d46ce21ba384f178cdd24029ca6 Mon Sep 17 00:00:00 2001 From: Prince Date: Wed, 18 Sep 2024 17:00:49 +0400 Subject: [PATCH 54/57] chore: test pre-commit --- scripts/generate-bundle-script.js | 35 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/scripts/generate-bundle-script.js b/scripts/generate-bundle-script.js index 71b21e8..83dd142 100644 --- a/scripts/generate-bundle-script.js +++ b/scripts/generate-bundle-script.js @@ -1,15 +1,14 @@ -// scripts/build-and-copy.js -const { exec } = require('child_process'); -const fs = require('fs'); -const path = require('path'); -// Define paths relative to the root directory -const rootDir = path.resolve(__dirname, '..'); -const srcFile = path.join(rootDir, 'dist/js/footer_scripts.min.js'); -const destFile = path.join(rootDir, 'src/bundle-script.min.js'); +const { exec } = require("child_process"); +const fs = require("fs"); +const path = require("path"); + +const rootDir = path.resolve(__dirname, ".."); +const srcFile = path.join(rootDir, "dist/js/footer_scripts.min.js"); +const destFile = path.join(rootDir, "src/bundle-script.min.js"); // Step 1: Run the build command -exec('npm run build', { cwd: rootDir }, (err, stdout, stderr) => { +exec("npm run build", { cwd: rootDir }, (err, stdout, stderr) => { if (err) { console.error(`Error during build: ${stderr}`); process.exit(1); @@ -22,17 +21,17 @@ exec('npm run build', { cwd: rootDir }, (err, stdout, stderr) => { console.error(`Error copying file: ${copyErr.message}`); process.exit(1); } - console.log(`File copied to ${destFile}`); // Step 3: Add the file to git - exec(`git add ${destFile}`, { cwd: rootDir }, (gitErr, gitStdout, gitStderr) => { - if (gitErr) { - console.error(`Error adding file to git: ${gitStderr}`); - process.exit(1); + exec( + `git add ${destFile}`, + { cwd: rootDir }, + (gitErr, gitStdout, gitStderr) => { + if (gitErr) { + console.error(`Error adding file to git: ${gitStderr}`); + process.exit(1); + } } - console.log(`File added to git: ${destFile}`); - }); + ); }); }); - - From 392c018835e036caf5d44b4f17e0fc28fcbc73e7 Mon Sep 17 00:00:00 2001 From: moiz-deriv Date: Thu, 19 Sep 2024 12:24:27 +0800 Subject: [PATCH 55/57] fix: updated traders hub pre load url --- src/js/footer/helper/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/js/footer/helper/index.js b/src/js/footer/helper/index.js index 67dee73..de3ce65 100644 --- a/src/js/footer/helper/index.js +++ b/src/js/footer/helper/index.js @@ -208,11 +208,11 @@ const handleOutSystemsRedirection = () => { } switch (env) { case "production": - return "https://hub.deriv.com/tradershub/signup"; + return "https://hub.deriv.com/tradershub/preload-helper"; case "staging": - return "https://staging-hub.deriv.com/tradershub/signup"; + return "https://staging-hub.deriv.com/tradershub/preload-helper"; default: - return "https://dev-hub.deriv.com/tradershub/signup"; + return "https://staging-hub.deriv.com/tradershub/preload-helper"; } }; From a9c6950c88946f967a2c79e6e313fb72b6c57ba4 Mon Sep 17 00:00:00 2001 From: moiz-deriv Date: Thu, 19 Sep 2024 13:36:58 +0800 Subject: [PATCH 56/57] fix: updated traders hub prefetch url --- src/js/footer/helper/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/js/footer/helper/index.js b/src/js/footer/helper/index.js index de3ce65..9500b4a 100644 --- a/src/js/footer/helper/index.js +++ b/src/js/footer/helper/index.js @@ -208,11 +208,11 @@ const handleOutSystemsRedirection = () => { } switch (env) { case "production": - return "https://hub.deriv.com/tradershub/preload-helper"; + return "https://hub.deriv.com/tradershub/hub"; case "staging": - return "https://staging-hub.deriv.com/tradershub/preload-helper"; + return "https://hub.deriv.com/tradershub/hub"; default: - return "https://staging-hub.deriv.com/tradershub/preload-helper"; + return "https://hub.deriv.com/tradershub/hub"; } }; From 38bfa7076614124d4ee2f1eced175caa011a8492 Mon Sep 17 00:00:00 2001 From: Prince Date: Mon, 23 Sep 2024 16:57:39 +0400 Subject: [PATCH 57/57] chore: migrated script revert and experiment js added --- scripts/generate-bundle-script.js | 4 +- scripts/generate-bundle-url.js | 2 +- src/bundle-script.min.js | 1 - src/experiment-script.min.js | 1 + src/js/experiment/index.js | 1 + src/js/footer/index.js | 1 - src/js/footer/migration.js | 903 ------------------------------ src/temp-static.min.js | 1 - vite.config.js | 1 + 9 files changed, 6 insertions(+), 909 deletions(-) delete mode 100644 src/bundle-script.min.js create mode 100644 src/experiment-script.min.js create mode 100644 src/js/experiment/index.js delete mode 100644 src/js/footer/migration.js delete mode 100644 src/temp-static.min.js diff --git a/scripts/generate-bundle-script.js b/scripts/generate-bundle-script.js index 83dd142..55b8255 100644 --- a/scripts/generate-bundle-script.js +++ b/scripts/generate-bundle-script.js @@ -4,8 +4,8 @@ const fs = require("fs"); const path = require("path"); const rootDir = path.resolve(__dirname, ".."); -const srcFile = path.join(rootDir, "dist/js/footer_scripts.min.js"); -const destFile = path.join(rootDir, "src/bundle-script.min.js"); +const srcFile = path.join(rootDir, "dist/js/experiment_scripts.min.js"); +const destFile = path.join(rootDir, "src/experiment-script.min.js"); // Step 1: Run the build command exec("npm run build", { cwd: rootDir }, (err, stdout, stderr) => { diff --git a/scripts/generate-bundle-url.js b/scripts/generate-bundle-url.js index 866b9cb..b9ac7de 100644 --- a/scripts/generate-bundle-url.js +++ b/scripts/generate-bundle-url.js @@ -3,7 +3,7 @@ const { exec } = require('child_process'); // Define your GitHub repository details const repoName = 'deriv-com/webflow-deriv-com-scripts'; -const filePath = 'src/bundle-script.min.js'; +const filePath = 'src/experiment-script.min.js'; // Step 1: Get the latest commit hash exec('git rev-parse HEAD', (err, stdout, stderr) => { diff --git a/src/bundle-script.min.js b/src/bundle-script.min.js deleted file mode 100644 index ba4230c..0000000 --- a/src/bundle-script.min.js +++ /dev/null @@ -1 +0,0 @@ -var e,o,n,i,t,a,r,d,c,s;import{initializeApp as l}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-app.js";import{getDatabase as u,ref as p,onValue as w}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-database.js";function h(e,o,n,i){let t="";if(n){let e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),t="; expires="+e.toUTCString()}document.cookie=i?e+"="+(o||"")+t+`;domain=${i};path=/`:e+"="+(o||"")+t+";path=/"}function m(e,o){const n={};return e.split(";").forEach((e=>{const[o,i]=e.split("=").map((e=>e.trim()));n[o]=decodeURIComponent(i)})),n[o]}function y(e){h("webflow-user-language",e,30)}function N(e){document.cookie=e+"=; Max-Age=-99999999;"}window.emailRegex=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,window.toggleErrorField=(e,o)=>{o?e.classList.remove("error-field"):e.classList.add("error-field")},window.disableButton=function(e){e.disabled=!0,e.style.opacity="0.5"},window.isEuRegion=function(e){const o=e.replace(/\/$/,"");return/^\/(?:[^\/]+\/)?eu(?:\/|$)/.test(o)},window.enableButton=function(e){e.disabled=!1,e.style.opacity="1"},window.getOauthUrl=function(){var e=window.location.href,o=new URL(e).hostname,n=["deriv.com","deriv.be","deriv.me"].find((e=>o.endsWith(e)));return n?`https://oauth.${n}`:"https://oauth.deriv.com"},window.getClientCountry=function(){var e;const o=m(document.cookie,"clients_country"),n=m(document.cookie,"client_information");return n&&(null==(e=JSON.parse(n))?void 0:e.residence)||o},window.deriv_com_url="deriv.com",window.deriv_me_url="deriv.me",window.deriv_be_url="deriv.be",window.webflow_domain="webflow.deriv.com",window.staging_url="staging.deriv.com",window.staging_deriv_be_url="staging.deriv.be",window.domain_list_app_id={[window.deriv_com_url]:"16929",[window.deriv_me_url]:"1411",[window.deriv_be_url]:"30767",[window.webflow_domain]:"53503",[window.staging_url]:"16303"},window.getDomain=()=>{var e=window.location.href;return new URL(e).hostname},window.getAppId=()=>{const e=window.getDomain(),o=new URLSearchParams(window.location.search||"").get("app_id");if(o)return o;const n=localStorage.getItem("config.app_id");if(n)return n;const i={[window.webflow_domain]:window.domain_list_app_id[window.webflow_domain],[window.deriv_be_url]:window.domain_list_app_id[window.deriv_be_url],[window.deriv_me_url]:window.domain_list_app_id[window.deriv_me_url],[window.staging_url]:window.domain_list_app_id[window.staging_url]};return i[e]?i[e]:window.domain_list_app_id[window.deriv_com_url]};const g=()=>{const e=localStorage.getItem("config.server_url"),o=m(document.cookie,"webflow-user-language");let n=o?o.toLowerCase():"en";"zh-cn"!==n&&"zh-tw"!==n||(n=n.replace("-","_"));const i=(e=>{let o="";return e&&Object.keys(e).forEach((n=>{o+=`&${n}=${e[n]}`})),o})((()=>{const e=m(document.cookie,"utm_data");if(e){const o=JSON.parse(e),n={};return["utm_source","utm_ad_id","utm_adgroup_id","utm_adrollclk_id","utm_campaign","utm_campaign_id","utm_content","utm_fbcl_id","utm_gl_client_id","utm_medium","utm_msclk_id","utm_term"].forEach((e=>{o.hasOwnProperty(e)&&(n[e]=o[e])})),n}return null})()),t=m(document.cookie,"affiliate_tracking"),a=t?`&affiliate_token=${t}`:"",r=void["mt5","bot","derivx"].filter((e=>window.location.pathname.includes(e)&&e))||"";return e&&/qa/.test(e)?`https://${e}/oauth2/authorize?app_id=${window.getAppId()}&l=${n}&brand=deriv${a}${i}&platform=${r}`:`${window.getOauthUrl()}/oauth2/authorize?app_id=${(()=>{const e=window.getDomain();return e===window.deriv_me_url?window.domain_list_app_id[window.deriv_me_url]:e===window.deriv_be_url?window.domain_list_app_id[window.deriv_be_url]:e===window.webflow_domain?window.domain_list_app_id[window.webflow_domain]:window.domain_list_app_id[window.deriv_com_url]})()}&l=${n}&brand=deriv${a}${i}&platform=${r}`};if(!!!m(document.cookie,"client_information")){var f=document.createElement("iframe");f.src=(()=>{const e=window.location.hostname;let o;switch(o="deriv.com"===e||"deriv.be"===e||"deriv.me"===e?"production":"staging.deriv.com"===e?"staging":"development",o){case"production":return"https://hub.deriv.com/tradershub/signup";case"staging":return"https://staging-hub.deriv.com/tradershub/signup";default:return"https://dev-hub.deriv.com/tradershub/signup"}})(),f.style.width="0",f.style.height="0",f.style.border="none",f.style.visibility="hidden",f.setAttribute("sandbox","allow-same-origin allow-scripts"),document.body.appendChild(f)}window.establishWebSocketConnection=()=>new Promise(((e,o)=>{const n=m(document.cookie,"webflow-user-language"),i=n?n.toLowerCase():"en",t=localStorage.getItem("config.server_url")||"green.derivws.com";window.websocket=new WebSocket(`wss://${t}/websockets/v3?app_id=${window.getAppId()}&l=${i||"en"}&brand=deriv`),window.websocket.addEventListener("open",(o=>{window.websocket.addEventListener("close",(()=>{window.websocket.close()})),window.websocket.addEventListener("message",(e=>{JSON.parse(e.data)})),e(window.websocket)})),window.websocket.addEventListener("error",(e=>{var n;null==(n=null==window?void 0:window.websocket)||n.close(),o(e)}))})),window.socketMessageSend=async(e,o)=>{var n;try{return(null==window?void 0:window.websocket)&&(null==(n=null==window?void 0:window.websocket)?void 0:n.readyState)===(null==WebSocket?void 0:WebSocket.OPEN)?(window.websocket.send(e),new Promise(((e,n)=>{window.websocket.addEventListener("message",(i=>{const t=JSON.parse(i.data);o===t.msg_type&&(t.error?n(t.error):e(t))}))}))):establishWebSocketConnection().then((()=>(websocket.send(e),new Promise(((e,n)=>{websocket.addEventListener("message",(i=>{const t=JSON.parse(i.data);o===t.msg_type&&(t.error?n(t.error):e(t))}))}))))).catch((e=>Promise.reject(e)))}catch(i){return Promise.reject(i)}};const v=[{id:"appgallery",selectors:[".footer_banner-badge.gallery.w-inline-block",".app-download_link-wrapper.appgallery.w-inline-block"],countries:["af","ax","al","dz","as","ad","ao","aq","am","au","at","az","bh","bd","by","be","bj","bm","bt","bo","ba","bw","bv","br","io","bn","bg","bf","bi","kh","cm","ca","cv","bq","cf","td","cn","cx","cc","km","cg","cd","ck","ci","hr","cu","cw","cy","cz","dk","dj","dm","eg","gq","er","ee","et","fk","fo","fj","fi","fr","pf","tf","ga","gm","ge","de","gh","gi","gr","gl","gu","gg","gn","gw","hm","va","hu","is","in","id","ir","iq","ie","im","il","it","jp","je","jo","kz","ke","ki","kr","kp","kw","kg","la","lv","lb","ls","lr","ly","li","lt","lu","mo","mk","mg","mw","my","mv","ml","mt","mh","mr","mu","yt","mx","fm","md","mc","mn","me","ma","mz","mm","na","nr","np","nl","nc","nz","ne","ng","nu","nf","mp","no","om","pk","pw","ps","pg","pe","ph","pn","pl","pt","qa","re","ro","ru","rw","sh","kn","pm","bl","mf","ws","sm","st","sa","sn","rs","sc","sl","sg","sx","sk","si","sb","so","gs","ss","es","lk","sd","sj","sz","se","ch","sy","tw","tj","tz","th","tl","tg","tk","to","tn","tr","tm","tc","tv","ug","ua","ae","gb","um","us","uz","vu","vi","wf","eh","ye","zm","zw"]},{id:"googlePlay",selectors:[".footer_banner-badge.google.w-inline-block",".app-download_link-wrapper.google.w-inline-block"],countries:["af","ax","as","ad","ai","aq","au","bb","bt","bv","io","bn","bi","ca","bq","cf","cx","cc","cg","cd","ck","cw","gq","et","fk","fo","gf","pf","tf","gl","gp","gu","gg","gy","hm","va","hk","ir","im","jp","je","ki","kp","ls","ly","mg","mw","mh","mq","mr","yt","fm","mn","me","ms","nr","nc","nz","ng","nu","nf","mp","pw","ps","pn","pr","re","sh","kn","lc","pm","vc","bl","mf","st","sg","sx","gs","ss","sj","sz","sy","tl","tk","tc","tv","um","us","vg","vi","wf","eh"]},{id:"appstore",selectors:[".footer_banner-badge.store.w-inline-block",".app-download_link-wrapper.appstore.w-inline-block"],countries:["ax","al","as","ad","aq","aw","au","at","bd","be","bv","io","bg","bi","ca","bq","cf","cx","cc","km","ck","hr","cu","cw","cy","cz","dk","dj","gq","er","ee","et","fk","fo","fi","fr","gf","pf","tf","de","gi","gr","gl","gp","gu","gg","gn","ht","hm","va","hk","hu","is","ir","iq","ie","im","il","it","je","ki","kp","lv","ls","ly","li","lt","lu","mt","mh","mq","yt","fm","me","nl","nc","nz","ng","nu","nf","mp","no","ps","pn","pl","pt","pr","re","ro","sh","pm","bl","mf","ws","sm","sg","sx","sk","si","so","gs","ss","es","sd","sj","se","ch","sy","tw","tl","tg","tk","tr","tv","gb","um","us","vu","vi","wf","eh"]},{id:"p2p",selectors:["#p2payment.accordion_toggle-block","#p2component.section_dp2p","#card_block_p2p.help_category"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"w-dyn-item-p2p",selectors:["div.w-dyn-item"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"hideRow",selectors:["#footer_social-icons_row","#footer_text_row",".footer_risk-warning.w-richtext"],countries:["br","uy","lk","ch","za","ec"]},{id:"hideDiel",selectors:["#footer_text_diel","#footer_social-icons_diel"],countries:["br","uy","lk","ch","za","ec"]}],Y=[{id:"showElems",selectors:[".banner_disclaimer"],countries:["br","uy","lk","ch","za","ec"]}],_=()=>{const e=window.getClientCountry();v.forEach((o=>{const n="hideDiel"===o.id?!o.countries.includes(e):o.countries.includes(e);if(e&&n)return o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((e=>{if(e)if("w-dyn-item-p2p"===o.id){e.querySelector("#card_block_p2p.help_category")&&(e.style.display="none")}else e.style.display="none"}))}));if(!n){const e=document.querySelector(".footer_social-icons.diel");e&&(e.style.display="flex")}})),Y.forEach((o=>{e&&o.countries.includes(e)?o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{if(o){const n=document.querySelector(".page-wrapper");".banner_disclaimer"===e?(n.classList.add("disclaimer-show"),o.classList.remove("hide-element")):o.style.display="block"}}))})):o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{o&&(".banner_disclaimer"===e?o.classList.add("hide-element"):o.style.display="none")}))}))}))},A=JSON.stringify({website_status:1});!async function(){try{const e=await fetch("https://www.cloudflare.com/cdn-cgi/trace"),o=await e.text(),n=Object.fromEntries(o.split("\n").map((e=>e.split("=",2)))).loc.toLowerCase();n!==m(document.cookie,"clients_country")&&(N("clients_country"),h("clients_country",n,30)),_()}catch(e){_()}}();m(document.cookie,"clients_country")||window.socketMessageSend(A,"website_status").then((e=>{m(document.cookie,"clients_country")!==e.website_status.clients_country&&(N("clients_country"),h("clients_country",e.website_status.clients_country,30)),_()})).catch((e=>{}));const b=["ar","bn","de","en","es","fr","it","ko","pl","pt","ru","si","sw","th","tr","vi","zh_cn","zh_tw","zh-cn","zh-tw"];(()=>{var e;const o=window.location.pathname,n=window.location.hash,i=window.location.search,t=o.split("/"),a=t[1],r=b.includes(a||""),d=t.includes("careers")||t.includes("locations")||t.includes("derivtech")||t.includes("derivlife")||t.includes("eu-careers")||t.includes("our-locations");r&&y(a);const c=(null==(e=m(document.cookie,"webflow-user-language"))?void 0:e.toLowerCase())||"en",s=r?a:c;if((r||"en"!==c)&&a!==c)if(r&&a!==c)y(s);else if(!d){const e=(r?t.map((e=>e===a?s:e)).join("/"):s+t.join("/"))+i+n;window.location.href="/"+e}})();const k=function(){let e,o=!1,n=!1;const i=()=>{n=!0,o=!!m(document.cookie,"client_information"),o&&clearInterval(e),document.dispatchEvent(new Event("authStatusChange"))};return i(),e=setInterval(i,800),{getLoggedInStatus:()=>o,getAuthCheckedStatus:()=>n,onAuthStatusChange:e=>document.addEventListener("authStatusChange",e)}}();k.onAuthStatusChange((()=>{if(k.getAuthCheckedStatus()&&k.getLoggedInStatus()){document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.add("hide-element")}))}else if(k.getAuthCheckedStatus()&&!k.getLoggedInStatus()){document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.add("hide-element")}))}}));const L=window.location.href;if(["help-centre"].some((e=>L.includes(e)))){const e=new URL(L).searchParams;e.has("platform")&&"derivgo"===e.get("platform")&&(S=".derivgo-query-element",document.querySelectorAll(S).forEach((e=>{e.style.display="none"})))}var S;const E=document.querySelector(".banner_disclaimer"),C=document.querySelector(".main-wrapper");if(E){new ResizeObserver((e=>{for(let o of e)if(o.target===E){let e=o.target.getBoundingClientRect();C&&(C.style.paddingTop=e.height+"px")}})).observe(E)}window.addEventListener("pageshow",(function(e){if(e.persisted){const e=document.querySelector(".w-nav-overlay");e&&(e.style.display="none",document.querySelector("body").click())}}));const q=u(l({databaseURL:window.location.hostname.includes("staging")?"https://app-config-staging.firebaseio.com":"https://app-config-prod.firebaseio.com"}));let I=!1,z=!1;!function(){var e;const o=document.getElementById("live_chat-wrapper");try{const e=p(q,"remote_config/deriv-com/chat");w(e,(e=>{const n=e.val();I=n.live_chat,z=n.whatsapp_chat;const i=document.querySelector(".whatsapp_chat"),t=document.querySelector(".livechatbtn");i&&(i.style.visibility=z?"visible":"hidden"),t&&(t.style.visibility=I?"visible":"hidden");if(window.location.pathname.includes("/help-centre")){const e=document.querySelectorAll(".livechatbtn");I?e.forEach((e=>{e.style.visibility="visible"})):e.forEach((e=>{e.style.visibility="hidden"}));const o=document.querySelectorAll(".whatsapp_chat");z?o.forEach((e=>{e.style.visibility="visible"})):o.forEach((e=>{e.style.visibility="hidden"}))}window.addEventListener("scroll",(function(){var e,n;(I||z)&&(null==(e=null==o?void 0:o.classList)||e.remove("hide-element")),I||z||null==(n=null==o?void 0:o.classList)||n.add("hide-element")}))}),(e=>{var n;null==(n=null==o?void 0:o.classList)||n.remove("hide-element")}))}catch(n){null==(e=null==o?void 0:o.classList)||e.remove("hide-element")}}();new MutationObserver((function(e){for(const o of e)if(o.addedNodes.length)for(const e of o.addedNodes)e.nodeType===Node.ELEMENT_NODE&&"chat-widget-minimized"===e.id&&(e.style.opacity="0")})).observe(document.body,{childList:!0,subtree:!0});const x=window.getClientCountry();const j=[{country:"af",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"ax",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"al",apple:"No",android:"Yes",huawei:"No"},{country:"dz",apple:"Yes",android:"Yes",huawei:"No"},{country:"as",apple:"N/A",android:"No",huawei:"N/A"},{country:"ad",apple:"N/A",android:"N/A",huawei:"No"},{country:"ao",apple:"Yes",android:"Yes",huawei:"No"},{country:"ai",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"aq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ag",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ar",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"am",apple:"Yes",android:"Yes",huawei:"No"},{country:"aw",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"au",apple:"No",android:"No",huawei:"No"},{country:"at",apple:"No",android:"Yes",huawei:"No"},{country:"az",apple:"Yes",android:"Yes",huawei:"No"},{country:"bs",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bh",apple:"Yes",android:"Yes",huawei:"No"},{country:"bd",apple:"N/A",android:"Yes",huawei:"No"},{country:"bb",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"by",apple:"Yes",android:"Yes",huawei:"No"},{country:"be",apple:"No",android:"Yes",huawei:"No"},{country:"bz",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bj",apple:"Yes",android:"Yes",huawei:"No"},{country:"bm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"bt",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"bo",apple:"Yes",android:"Yes",huawei:"No"},{country:"ba",apple:"Yes",android:"Yes",huawei:"No"},{country:"bw",apple:"Yes",android:"Yes",huawei:"No"},{country:"bv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"br",apple:"Yes",android:"Yes",huawei:"No"},{country:"io",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"bn",apple:"Yes",android:"N/A",huawei:"No"},{country:"bg",apple:"No",android:"Yes",huawei:"No"},{country:"bf",apple:"Yes",android:"Yes",huawei:"No"},{country:"bi",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kh",apple:"Yes",android:"Yes",huawei:"No"},{country:"cm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ca",apple:"No",android:"No",huawei:"No"},{country:"cv",apple:"Yes",android:"Yes",huawei:"No"},{country:"bq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ky",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cf",apple:"N/A",android:"N/A",huawei:"No"},{country:"td",apple:"Yes",android:"Yes",huawei:"No"},{country:"cl",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cn",apple:"Yes",android:"Yes",huawei:"No"},{country:"cx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"co",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"km",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cg",apple:"Yes",android:"N/A",huawei:"No"},{country:"cd",apple:"Yes",android:"N/A",huawei:"No"},{country:"ck",apple:"N/A",android:"N/A",huawei:"No"},{country:"cr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ci",apple:"Yes",android:"Yes",huawei:"No"},{country:"hr",apple:"No",android:"Yes",huawei:"No"},{country:"cu",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cw",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cy",apple:"No",android:"Yes",huawei:"No"},{country:"cz",apple:"No",android:"Yes",huawei:"No"},{country:"dk",apple:"No",android:"Yes",huawei:"No"},{country:"dj",apple:"N/A",android:"Yes",huawei:"No"},{country:"dm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"do",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ec",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"eg",apple:"Yes",android:"Yes",huawei:"No"},{country:"sv",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gq",apple:"N/A",android:"N/A",huawei:"No"},{country:"er",apple:"N/A",android:"Yes",huawei:"No"},{country:"ee",apple:"No",android:"Yes",huawei:"No"},{country:"et",apple:"N/A",android:"N/A",huawei:"No"},{country:"fk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"fo",apple:"N/A",android:"N/A",huawei:"No"},{country:"fj",apple:"Yes",android:"Yes",huawei:"No"},{country:"fi",apple:"No",android:"Yes",huawei:"No"},{country:"fr",apple:"No",android:"Yes",huawei:"No"},{country:"gf",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"pf",apple:"N/A",android:"N/A",huawei:"No"},{country:"tf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ga",apple:"Yes",android:"Yes",huawei:"No"},{country:"gm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ge",apple:"Yes",android:"Yes",huawei:"No"},{country:"de",apple:"No",android:"Yes",huawei:"No"},{country:"gh",apple:"Yes",android:"Yes",huawei:"No"},{country:"gi",apple:"N/A",android:"Yes",huawei:"No"},{country:"gr",apple:"No",android:"Yes",huawei:"No"},{country:"gl",apple:"N/A",android:"N/A",huawei:"No"},{country:"gd",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gp",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"gu",apple:"N/A",android:"No",huawei:"N/A"},{country:"gt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gg",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"gn",apple:"N/A",android:"Yes",huawei:"No"},{country:"gw",apple:"Yes",android:"Yes",huawei:"No"},{country:"gy",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ht",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"hm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"va",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"hn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"hk",apple:"No",android:"No",huawei:"Yes"},{country:"hu",apple:"No",android:"Yes",huawei:"No"},{country:"is",apple:"No",android:"Yes",huawei:"No"},{country:"in",apple:"Yes",android:"Yes",huawei:"No"},{country:"id",apple:"Yes",android:"Yes",huawei:"No"},{country:"ir",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"iq",apple:"No",android:"Yes",huawei:"N/A"},{country:"ie",apple:"No",android:"Yes",huawei:"No"},{country:"im",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"il",apple:"No",android:"Yes",huawei:"No"},{country:"it",apple:"No",android:"Yes",huawei:"No"},{country:"jm",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"jp",apple:"Yes",android:"No",huawei:"No"},{country:"je",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"jo",apple:"Yes",android:"Yes",huawei:"No"},{country:"kz",apple:"Yes",android:"Yes",huawei:"No"},{country:"ke",apple:"Yes",android:"Yes",huawei:"No"},{country:"ki",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kr",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"kp",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kw",apple:"Yes",android:"Yes",huawei:"No"},{country:"kg",apple:"Yes",android:"Yes",huawei:"No"},{country:"la",apple:"Yes",android:"Yes",huawei:"No"},{country:"lv",apple:"No",android:"Yes",huawei:"No"},{country:"lb",apple:"Yes",android:"Yes",huawei:"No"},{country:"ls",apple:"N/A",android:"N/A",huawei:"No"},{country:"lr",apple:"Yes",android:"Yes",huawei:"No"},{country:"ly",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"li",apple:"N/A",android:"Yes",huawei:"No"},{country:"lt",apple:"No",android:"Yes",huawei:"No"},{country:"lu",apple:"No",android:"Yes",huawei:"No"},{country:"mo",apple:"Yes",android:"Yes",huawei:"No"},{country:"mk",apple:"Yes",android:"Yes",huawei:"No"},{country:"mg",apple:"Yes",android:"N/A",huawei:"No"},{country:"mw",apple:"Yes",android:"N/A",huawei:"No"},{country:"my",apple:"Yes",android:"Yes",huawei:"No"},{country:"mv",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"ml",apple:"Yes",android:"Yes",huawei:"No"},{country:"mt",apple:"No",android:"Yes",huawei:"No"},{country:"mh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mq",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"mr",apple:"Yes",android:"N/A",huawei:"No"},{country:"mu",apple:"Yes",android:"Yes",huawei:"No"},{country:"yt",apple:"N/A",android:"N/A",huawei:"No"},{country:"mx",apple:"Yes",android:"Yes",huawei:"No"},{country:"fm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"md",apple:"Yes",android:"Yes",huawei:"No"},{country:"mc",apple:"Yes",android:"Yes",huawei:"No"},{country:"mn",apple:"Yes",android:"N/A",huawei:"No"},{country:"me",apple:"No",android:"N/A",huawei:"No"},{country:"ms",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ma",apple:"Yes",android:"Yes",huawei:"No"},{country:"mz",apple:"Yes",android:"Yes",huawei:"No"},{country:"mm",apple:"Yes",android:"Yes",huawei:"No"},{country:"na",apple:"Yes",android:"Yes",huawei:"No"},{country:"nr",apple:"Yes",android:"N/A",huawei:"No"},{country:"np",apple:"Yes",android:"Yes",huawei:"No"},{country:"nl",apple:"No",android:"Yes",huawei:"No"},{country:"nc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nz",apple:"No",android:"No",huawei:"No"},{country:"ni",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ne",apple:"Yes",android:"Yes",huawei:"No"},{country:"ng",apple:"No",android:"No",huawei:"No"},{country:"nu",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mp",apple:"N/A",android:"No",huawei:"N/A"},{country:"no",apple:"No",android:"Yes",huawei:"No"},{country:"om",apple:"Yes",android:"Yes",huawei:"No"},{country:"pk",apple:"Yes",android:"Yes",huawei:"No"},{country:"pw",apple:"Yes",android:"No",huawei:"N/A"},{country:"ps",apple:"N/A",android:"N/A",huawei:"No"},{country:"pa",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pg",apple:"Yes",android:"Yes",huawei:"No"},{country:"py",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pe",apple:"Yes",android:"Yes",huawei:"No"},{country:"ph",apple:"Yes",android:"Yes",huawei:"No"},{country:"pn",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"pl",apple:"No",android:"Yes",huawei:"No"},{country:"pt",apple:"No",android:"Yes",huawei:"No"},{country:"pr",apple:"N/A",android:"No",huawei:"Yes"},{country:"qa",apple:"Yes",android:"Yes",huawei:"No"},{country:"re",apple:"N/A",android:"N/A",huawei:"No"},{country:"ro",apple:"No",android:"Yes",huawei:"No"},{country:"ru",apple:"Yes",android:"Yes",huawei:"No"},{country:"rw",apple:"Yes",android:"Yes",huawei:"No"},{country:"sh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kn",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"lc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"pm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"vc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"bl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ws",apple:"N/A",android:"Yes",huawei:"No"},{country:"sm",apple:"N/A",android:"Yes",huawei:"No"},{country:"st",apple:"Yes",android:"N/A",huawei:"No"},{country:"sa",apple:"Yes",android:"Yes",huawei:"No"},{country:"sn",apple:"Yes",android:"Yes",huawei:"No"},{country:"rs",apple:"Yes",android:"Yes",huawei:"No"},{country:"sc",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"sl",apple:"Yes",android:"Yes",huawei:"No"},{country:"sg",apple:"No",android:"No",huawei:"No"},{country:"sx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sk",apple:"No",android:"Yes",huawei:"No"},{country:"si",apple:"No",android:"Yes",huawei:"No"},{country:"sb",apple:"Yes",android:"Yes",huawei:"No"},{country:"so",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"za",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gs",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ss",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"es",apple:"No",android:"Yes",huawei:"No"},{country:"lk",apple:"Yes",android:"Yes",huawei:"No"},{country:"sd",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"sr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"sj",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sz",apple:"Yes",android:"N/A",huawei:"No"},{country:"se",apple:"No",android:"Yes",huawei:"No"},{country:"ch",apple:"No",android:"Yes",huawei:"No"},{country:"sy",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tw",apple:"No",android:"Yes",huawei:"No"},{country:"tj",apple:"Yes",android:"Yes",huawei:"No"},{country:"tz",apple:"Yes",android:"Yes",huawei:"No"},{country:"th",apple:"Yes",android:"Yes",huawei:"No"},{country:"tl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tg",apple:"N/A",android:"Yes",huawei:"No"},{country:"tk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"to",apple:"Yes",android:"Yes",huawei:"No"},{country:"tt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"tn",apple:"Yes",android:"Yes",huawei:"No"},{country:"tr",apple:"No",android:"Yes",huawei:"No"},{country:"tm",apple:"Yes",android:"Yes",huawei:"No"},{country:"tc",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"tv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ug",apple:"Yes",android:"Yes",huawei:"No"},{country:"ua",apple:"Yes",android:"Yes",huawei:"No"},{country:"ae",apple:"Yes",android:"Yes",huawei:"No"},{country:"gb",apple:"No",android:"Yes",huawei:"No"},{country:"um",apple:"N/A",android:"No",huawei:"N/A"},{country:"us",apple:"No",android:"No",huawei:"N/A"},{country:"uy",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"uz",apple:"Yes",android:"Yes",huawei:"No"},{country:"vu",apple:"No",android:"Yes",huawei:"N/A"},{country:"ve",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vg",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"vi",apple:"N/A",android:"No",huawei:"N/A"},{country:"wf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"eh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ye",apple:"Yes",android:"Yes",huawei:"No"},{country:"zm",apple:"Yes",android:"Yes",huawei:"No"},{country:"zw",apple:"Yes",android:"Yes",huawei:"No"}].find((e=>e.country===x)),O=j?function(e){const{apple:o,android:n,huawei:i}=e;return"Yes"===o&&"Yes"===n&&"Yes"===i?"Android, iOS & Huawei":"Yes"===o&&"Yes"===n&&"Yes"!==i?"Android, and iOS":"Yes"===o&&"Yes"===i&&"Yes"!==n?"iOS, and Huawei":"Yes"===n&&"Yes"!==o&&"Yes"!==i?"Android":"Yes"===o&&"Yes"===i&&"Yes"!==n?"iOS, and Huawei":"Yes"===o&&"Yes"!==n&&"Yes"!==i?"iOS":"Yes"!==o&&"Yes"!==n&&"Yes"===i?"Huawei":""}(j):"",$=document.getElementById("app-download-heading");$&&($.innerText=O);const B=document.querySelector(".redirection_background-wrapper"),D=document.getElementById("cancel-redirect"),P=document.getElementById("proceed-redirect");if(window.isEuRegion(window.location.pathname)&&B&&D&&P){const e=["deriv.me","deriv.be","deriv.com","app.deriv.me","app.deriv.be","app.deriv.com","docs.deriv.com","community.deriv.com","deriv.statuspage.io","signup.deriv.com","login.deriv.com","api.deriv.com"];let o="",n="_self";document.querySelectorAll("a").forEach((function(i){const t=new URL(i.href,window.location.href),a=new URL(window.location.href);e.includes(t.host)||t.host===a.host||i.addEventListener("click",(function(e){e.preventDefault(),o=t.href,n=i.target||"_self",B.classList.remove("hide-element"),document.body.style.overflow="hidden"}))})),D.addEventListener("click",(function(){B.classList.add("hide-element"),document.body.style.overflow="auto",o=""})),P.addEventListener("click",(function(){o&&(window.open(o,n),o="",B.classList.add("hide-element"),document.body.style.overflow="auto")}))}document.querySelector(".banner_disclaimer")?document.body.classList.add("disclaimer-visible"):document.body.classList.remove("disclaimer-visible");const W=document.querySelectorAll(".navbar_accordion-item");function R(){const e=document.querySelector(".navbar_accordion-trigger.open");e&&e.scrollIntoView({behavior:"smooth",block:"start"})}W.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.overflow="hidden",o.style.transition="max-height 0.3s ease-in, opacity 0.3s ease-in",o.style.opacity="0"})),W.forEach((e=>{const o=e.querySelector(".navbar_accordion-trigger");o.addEventListener("click",(function(){const e=o.classList.contains("open");if(W.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.opacity="0"})),!e){o.classList.add("open");const e=o.nextElementSibling;e.classList.add("open"),e.style.maxHeight=e.scrollHeight+"px",e.style.opacity="1"}}))}));document.querySelectorAll(".navbar_accordion-trigger").forEach((e=>{e.addEventListener("click",(function(){setTimeout(R,300)}))}));const U=new MutationObserver((e=>{e.forEach((e=>{if("class"===e.attributeName){const o=e.target;o.classList.contains("open")&&o.scrollIntoView({behavior:"smooth",block:"start"})}}))}));document.querySelectorAll(".navbar_accordion-item").forEach((e=>{U.observe(e,{attributes:!0})}));const J=new URL(window.location.href),T=new URLSearchParams(J.search),F=T.get("t");if(T.has("referrer")&&null!=F){m(document.cookie,"referrer_token")!==F&&(N("referrer_token"),h("referrer_token",F,365,".deriv.com"))}const H=document.getElementById("navbar-home_login");H&&H.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const M=document.getElementById("res-navbar-home_login");M&&M.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const V=document.getElementById("white-navbar_login");V&&V.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const G=document.getElementById("res-white-navbar_login");G&&G.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()})),window.fallbackLoader="Migrated All + Removal of Webflow array functions";let K=document.querySelectorAll(".navbar_accordion-trigger");K.forEach((e=>{e.addEventListener("click",(function(){K.forEach((e=>e.classList.remove("current"))),this.classList.add("current")}))}));let Z=document.querySelector(".navbar_accordion-link.w--current");if(Z){let e=Z.closest(".navbar_accordion-item");if(e){let o=e.querySelector(".navbar_accordion-trigger");o&&o.classList.add("current")}}let Q=document.querySelector(".locale > .new-navbar_dropdown-link.w--current");if(Q){let e=Q.getAttribute("hreflang"),o=document.querySelectorAll(".current-locale-iso-code");if(e&&o.length)for(let n of o)n.innerText=e}function X(e,o,n){let i="";{let e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),i="; expires="+e.toUTCString()}document.cookie=e+"="+(o||"")+i+"; path=/"}let ee=document.querySelectorAll(".w-locales-items");if(ee.length>0){let e=function(e){let o=document.querySelector('a[hreflang="'+e+'"]');o&&window.location.pathname!==o.getAttribute("href")&&o.click()};ee.forEach((function(e){e.querySelectorAll("a").forEach((function(e){e.addEventListener("click",(function(o){o.preventDefault(),X("webflow-user-language",e.getAttribute("hreflang"),30),window.location.href=e.href}))}))})),window.setLanguageCookie=e=>{X("webflow-user-language",e,30)};let o=function(e){let o=document.cookie.split(";");for(let n=0;ni.includes(e))),o&&t&&e(o)}if(document.querySelector(".new-navbar_component")){let e=function(){document.body.classList.add("disable-scroll")},o=function(){document.body.classList.remove("disable-scroll")};const n=document.querySelector(".new-navbar_component");n.addEventListener("mouseenter",(()=>{window.innerWidth>991&&e()})),n.addEventListener("mouseleave",(()=>{window.innerWidth>991&&o()}))}window.getClientCountry();const oe=window.parseCookies(document.cookie,"webflow-user-language"),ne=["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"];if(window.location.pathname.endsWith("p2p")&&!window.location.pathname.startsWith("/blog")){const e=window.getClientCountry();e&&ne.includes(e)&&("en"===oe?window.location.replace("/404"):window.location.replace(`/${oe}/404`))}if(void 0!==window.parseCookies(document.cookie,"client_information")){let e=function(e){e.forEach((e=>{e.href="https://app.deriv.com/appstore/traders-hub"}))},o=document.querySelectorAll("a.live-markets_button.is-secondary.is-small.is-purchase.w-button"),n=document.querySelectorAll("a.live-markets_button.is-secondary.is-small.is-sell.w-button");e(o),e(n)}document.getElementById("mobile-menu"),document.getElementById("live_chat-wrapper");const ie=()=>{window.LC_API&&window.LC_API.open_chat_window&&window.LC_API.open_chat_window()},te=()=>{"true"===new URLSearchParams(window.location.search).get("is_livechat_open")&&ie()},ae=e=>{var o;null==(o=null==window?void 0:window.LiveChatWidget)||o.on("ready",(()=>{window.LC_API.open_chat_window(),window.LC_API.hide_chat_window(),te();const o=window.parseCookies(document.cookie,"utm_data"),n=o?JSON.parse(o):{},{utm_source:i,utm_medium:t,utm_campaign:a}=n,r=window.parseCookies(document.cookie,"client_information"),d=new URLSearchParams(window.location.search),{loginid:c,email:s,landing_company_shortcode:l,currency:u,residence:p,first_name:w,last_name:h}=r?JSON.parse(r):{},m={is_logged_in:e,loginid:c??"",landing_company_shortcode:l??"",currency:u??"",residence:p??"",email:s??"",platform:d.get("platform")??"",utm_source:i??"",utm_medium:t??"",utm_campaign:a??""};window.LiveChatWidget.call("set_session_variables",m),e?(s&&window.LiveChatWidget.call("set_customer_email",s),w&&h&&window.LiveChatWidget.call("set_customer_name",`${w} ${h}`)):window.LC_API.on_chat_ended=()=>{window.LiveChatWidget.call("set_customer_email"," "),window.LiveChatWidget.call("set_customer_name"," ")},te(),window.LiveChatWidget.on("new_event",(e=>{e.greeting&&window.LC_API.open_chat_window()}))}))};let re=!1;const de=()=>{const e=!!window.parseCookies(document.cookie,"client_information");e!==re&&(ae(e),re=e)};de(),setInterval(de,2e3),(()=>{if(window.__lc=window.__lc||{},window.__lc.license="12049137",window.LC_API=window.LC_API||{loaded:!1},window.LC_API.loaded)te();else{const e=document.createElement("script");e.async=!0,e.src="https://cdn.livechatinc.com/tracking.js",e.onload=()=>{window.LC_API.loaded=!0,window.LC_API.on_after_load=function(){ae(!!window.parseCookies(document.cookie,"client_information")),te()},"undefined"!=typeof LiveChatWidget&&LiveChatWidget.init&&LiveChatWidget.init()},document.body.appendChild(e)}})();const ce=document.querySelectorAll(".livechatbtn");ce.length>0&&ce.forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault(),ie()}))}));const se=document.getElementById("liveChatBtn");se&&se.addEventListener("click",(e=>{e.preventDefault(),ie()}));document.querySelectorAll('a[rel="liveChatBtn"]').forEach((e=>{null==e||e.addEventListener("click",(e=>{e.preventDefault(),ie()}))}));let le=document.querySelector(".navbar_menu-button");le&&le.addEventListener("click",(function(){let e=window.innerHeight,o=document.querySelector(".new-navbar_main-wrapper");if(o){let n=e-o.offsetHeight,i=document.querySelector(".new-navbar_menu");i&&(i.style.height=`${n}px`)}}));let ue=document.querySelector(".lang-mob");ue&&ue.addEventListener("click",(function(){let e=document.querySelector(".new-navbar_menu-wrapper");e&&e.scrollBy({top:-3e3})}));class pe{constructor(e){this.cookieName=e}setItem(e){const o=new Date;o.setDate(o.getDate()+30);const n="expires="+o.toUTCString(),i=encodeURIComponent(JSON.stringify(e));document.cookie=`${this.cookieName}=${i};${n};path=/`}getItem(){const e=document.cookie.split(";");for(let o=0;ove.includes(e)))&&document.head.querySelectorAll("link").forEach((function(e){e.hasAttribute("hreflang")&&"x-default"!==e.getAttribute("hreflang")&&e.remove()}));const Ye=e=>{window.rudderanalytics?window.rudderanalytics.track(e.name,e.properties):(e=>{let o=[],n=parseCookies(document.cookie,"cached_analytics_events");n&&(o=JSON.parse(n)),o.push(e),document.cookie=`cached_analytics_events=${JSON.stringify(o)}; path=/; Domain=.deriv.com`})(e)};window.addClickListener=function(e,o,n){e&&e.addEventListener("click",(function(){Ye({name:o,properties:n})}))};var _e=null==document?void 0:document.getElementsByClassName("livechatbtn"),Ae=null==document?void 0:document.getElementsByClassName("whatsapp_chat"),be=null==document?void 0:document.getElementsByClassName("tradershub-btn"),ke=document.querySelectorAll(".btn-free-demo .w-button"),Le=document.querySelectorAll('.btn-free-demo [data-class="w-button"]');const Se=document.querySelectorAll('[data-attributes="btn-primary-nav"]'),Ee=document.querySelectorAll('[data-attributes="btn-secondary-nav"]');_e&&Array.from(_e).forEach((e=>{window.addClickListener(e,"ce_widget_usage_form",{action:"click",widget_name:"livechat"})})),Ae&&Array.from(Ae).forEach((e=>{window.addClickListener(e,"ce_widget_usage_form",{action:"click",widget_name:"whatsapp"})})),be&&Array.from(be).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Traders Hub"})})),ke&&Array.from(ke).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),Le&&Array.from(Le).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),Se&&Array.from(Se).forEach((e=>{e.classList.contains("tradershub-btn")||window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),Ee&&Array.from(Ee).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Login"})}));var Ce,qe,Ie;"deriv.com"===window.location.hostname||"deriv.be"===window.location.hostname||"deriv.me"===window.location.hostname?(Ce="sdk-UhZV3cNEg5nLNLNS",Ie="nre64BV0dNIa44zW4tz5ow==",qe="1oV5agvlcnCZ6IH94wCKM1oR8Pd"):(Ce="sdk-9wuqJ1mlcQsSyZQ",Ie="",qe="1lN3tsFD2nruGFgM5F074DC2hMB");const ze=(Ne=window.parseCookies(document.cookie,"client_information"))?JSON.parse(Ne):null,xe=window.parseCookies(document.cookie,"utm_data"),je=xe?JSON.parse(xe):{},Oe=window.parseCookies(document.cookie,"signup_device");let $e=null;Oe&&($e=(null==(e=JSON.parse(Oe))?void 0:e.signup_device)||null);const Be={growthbookKey:Ce,growthbookDecryptionKey:Ie,rudderstackKey:qe,growthbookOptions:{navigate:e=>window.location.replace(e),antiFlicker:!1,navigateDelay:0,attributes:{country:window.parseCookies(document.cookie,"clients_country")||window.parseCookies(document.cookie,"website_status"),user_language:window.parseCookies(document.cookie,"user_language")||("undefined"!=typeof window?localStorage.getItem("i18n")||navigator.language:null),device_language:window.parseCookies(document.cookie,"language")||" ",device_type:$e,utm_source:null==je?void 0:je.utm_source,utm_medium:null==je?void 0:je.utm_medium,utm_campaign:null==je?void 0:je.utm_campaign,is_authorised:!!window.parseCookies(document.cookie,"client_information"),loggedIn:!!window.parseCookies(document.cookie,"client_information"),url:window.location.href}}};try{null==Analytics||Analytics.Analytics.initialise(Be);const e=(null==ze?void 0:ze.user_id)?null==ze?void 0:ze.user_id:null==(i=null==(n=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getInstances)?void 0:n.call(o).tracking)?void 0:i.getAnonymousId();null==(t=null==Analytics?void 0:Analytics.Analytics)||t.identifyEvent(e)}catch(Pe){}null==(a=null==Analytics?void 0:Analytics.Analytics)||a.pageView(location.pathname,"Deriv.com"),window.useGrowthbookFeatureFlag=function({featureFlag:e}){var o,n,i,t,a;let r=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getFeatureValue(e);return null==(a=null==(t=null==(i=null==(n=null==Analytics?void 0:Analytics.Analytics)?void 0:n.getInstances())?void 0:i.ab)?void 0:t.GrowthBook)||a.setRenderer((function(){var o;const n=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getFeatureValue(e);r=n})),r};const De=window.parseCookies(document.cookie,"client_information")?JSON.parse(window.parseCookies(document.cookie,"client_information")):null;(null==De?void 0:De.loginid)&&(null==window||window.hj("identify",De.loginid,{is_logged_in:!!window.parseCookies(document.cookie,"client_information"),landing_company_shortcode:De.landing_company_shortcode||"null"}));null==(s=null==(c=null==(d=null==(r=null==Analytics?void 0:Analytics.Analytics)?void 0:r.getInstances())?void 0:d.ab)?void 0:c.GrowthBook)||s.loadFeatures().then((()=>{window.location.href.indexOf("/partners")>-1==!1&&(()=>{var e;const o=(null==(e=null==Analytics?void 0:Analytics.Analytics)?void 0:e.getFeatureValue("trigger_os_signup_wf"))?function(){const e=navigator.userAgent.toLowerCase();return/ipad|iphone|ipod/.test(e)}()||function(){const e=navigator.userAgent.toLowerCase();return/safari/.test(e)&&!/chrome/.test(e)&&!/crios/.test(e)}()?`https://${window.location.host}/signup`:(()=>{const e=window.location.hostname;let o;switch(o="deriv.com"===e||"deriv.be"===e||"deriv.me"===e?"production":"staging.deriv.com"===e?"staging":"development",o){case"production":return"https://hub.deriv.com/tradershub/signup";case"staging":return"https://staging-hub.deriv.com/tradershub/signup";default:return"https://dev-hub.deriv.com/tradershub/signup"}})():`https://${window.location.host}/signup`,n=document.getElementById("cta-home-btn-navbar");n&&(n.href=o);const i=document.querySelectorAll(".logged-out-btn");null==i||i.forEach((e=>{var n;(null==(n=null==e?void 0:e.href)?void 0:n.indexOf("/signup"))>0&&(e.href=o)}));const t=document.querySelectorAll(".logged-out-btn a");null==t||t.forEach((e=>{var n;(null==(n=null==e?void 0:e.href)?void 0:n.indexOf("/signup"))>0&&(e.href=o)}))})()})); diff --git a/src/experiment-script.min.js b/src/experiment-script.min.js new file mode 100644 index 0000000..b5c5330 --- /dev/null +++ b/src/experiment-script.min.js @@ -0,0 +1 @@ +alert("asdsadasdsa"); diff --git a/src/js/experiment/index.js b/src/js/experiment/index.js new file mode 100644 index 0000000..f1d5675 --- /dev/null +++ b/src/js/experiment/index.js @@ -0,0 +1 @@ +alert('asdsadasdsa') \ No newline at end of file diff --git a/src/js/footer/index.js b/src/js/footer/index.js index b936647..25b2573 100644 --- a/src/js/footer/index.js +++ b/src/js/footer/index.js @@ -16,4 +16,3 @@ import "./disclaimerAddClassname"; import "./mobileMenuAccordian"; import "./partnerAffiliate"; import "./loginFunctions"; -import "./migration.js" \ No newline at end of file diff --git a/src/js/footer/migration.js b/src/js/footer/migration.js deleted file mode 100644 index d087f33..0000000 --- a/src/js/footer/migration.js +++ /dev/null @@ -1,903 +0,0 @@ -window.fallbackLoader = "Migrated All + Removal of Webflow array functions"; - -// -// This function adds a red line to the current accordion trigger - -// Find all accordion triggers -let triggers = document.querySelectorAll(".navbar_accordion-trigger"); - -triggers.forEach((trigger) => { - trigger.addEventListener("click", function () { - // Remove the .current class from all triggers - triggers.forEach((t) => t.classList.remove("current")); - - // Add the .current class to the clicked trigger - this.classList.add("current"); - }); -}); - -// Find the current page link in Navbar -let currentLink = document.querySelector(".navbar_accordion-link.w--current"); - -if (currentLink) { - // Find the closest accordion item - let accordionItem = currentLink.closest(".navbar_accordion-item"); - - if (accordionItem) { - // Find the trigger element within the found parent - let trigger = accordionItem.querySelector(".navbar_accordion-trigger"); - - if (trigger) { - // Add the .current class to the trigger - trigger.classList.add("current"); - } - } -} - -// - -// - -let currentLocaleElement = document.querySelector( - ".locale > .new-navbar_dropdown-link.w--current" -); - -if (currentLocaleElement) { - let currentLocaleIsoCode = currentLocaleElement.getAttribute("hreflang"); - - let currentLocaleIsoCodeTexts = document.querySelectorAll( - ".current-locale-iso-code" - ); - - if (currentLocaleIsoCode && currentLocaleIsoCodeTexts.length) { - for (let currentLocaleIsoCodeText of currentLocaleIsoCodeTexts) { - currentLocaleIsoCodeText.innerText = currentLocaleIsoCode; - } - } -} - -// - -// Function for setting cookies when changing language and redirecting to the current language page - -function setCookie(name, value, days) { - let expires = ""; - if (days) { - let date = new Date(); - date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000); - expires = "; expires=" + date.toUTCString(); - } - document.cookie = name + "=" + (value || "") + expires + "; path=/"; -} - -function getCookie(name) { - let cookies = document.cookie.split(";"); - for (let i = 0; i < cookies.length; i++) { - let cookie = cookies[i].trim(); - if (cookie.startsWith(name + "=")) { - return cookie.substring(name.length + 1); - } - } - return null; -} - -let localeItems = document.querySelectorAll(".w-locales-items"); - -if (localeItems.length > 0) { - localeItems.forEach(function (item) { - let links = item.querySelectorAll("a"); - links.forEach(function (link) { - link.addEventListener("click", function (event) { - event.preventDefault(); - let language = link.getAttribute("hreflang"); - setCookie("webflow-user-language", language, 30); - window.location.href = link.href; - }); - }); - }); - - function clickLinkWithLanguage(language) { - let link = document.querySelector('a[hreflang="' + language + '"]'); - if (link && window.location.pathname !== link.getAttribute("href")) { - link.click(); - } - } - window.setLanguageCookie = (language) => { - setCookie("webflow-user-language", language, 30); - }; - - let languageCookie = getCookie("webflow-user-language"); - let targetPaths = [ - "/careers", - "/locations", - "/derivtech", - "/derivlife", - "/eu-careers", - "/our-locations", - ]; - let path = window.location.pathname; - let targetPathUrl = false; - - // Check if the current path matches any of the target paths - if (targetPaths.some((targetPath) => path.includes(targetPath))) { - targetPathUrl === true; - } - if (languageCookie && targetPathUrl) { - clickLinkWithLanguage(languageCookie); - } -} - -if (document.querySelector(".new-navbar_component")) { - // Find the .new-navbar_component element - const navbarComponent = document.querySelector(".new-navbar_component"); - - // Add event listeners for hover - navbarComponent.addEventListener("mouseenter", () => { - if (window.innerWidth > 991) { - disableScroll(); - } - }); - navbarComponent.addEventListener("mouseleave", () => { - if (window.innerWidth > 991) { - enableScroll(); - } - }); - - // Function to disable scroll - function disableScroll() { - document.body.classList.add("disable-scroll"); - } - - // Function to enable scroll - function enableScroll() { - document.body.classList.remove("disable-scroll"); - } -} - -const clientsCountry = window.getClientCountry(); - -const getDateFirstContact = () => { - const dateFirstContactString = window.parseCookies( - document.cookie, - "date_first_contact" - ); - if (dateFirstContactString) { - const parsedData = JSON.parse(dateFirstContactString); - return parsedData.date_first_contact - ? { date_first_contact: parsedData.date_first_contact } - : null; - } - return null; -}; - -const getSignupDevice = () => { - const signupDeviceString = window.parseCookies( - document.cookie, - "signup_device" - ); - if (signupDeviceString) { - const parsedData = JSON.parse(signupDeviceString); - return parsedData.signup_device - ? { signup_device: parsedData.signup_device } - : null; - } - return null; -}; - -const lang = window.parseCookies(document.cookie, "webflow-user-language"); - -const countriesToRedirect = [ - "as", - "au", - "at", - "be", - "bg", - "ca", - "hr", - "cy", - "cz", - "dk", - "ee", - "fi", - "fr", - "gr", - "gu", - "gg", - "hk", - "hu", - "ir", - "ie", - "im", - "il", - "it", - "je", - "ng", - "mm", - "sy", - "kp", - "lv", - "lt", - "lu", - "my", - "mt", - "nl", - "nz", - "mp", - "py", - "pl", - "pt", - "pr", - "ro", - "rw", - "sk", - "si", - "es", - "se", - "ae", - "gb", - "us", - "um", - "vu", - "vi", - "ky", - "cu", - "de", -]; - -if ( - window.location.pathname.endsWith("p2p") && - !window.location.pathname.startsWith("/blog") -) { - const clientsCountry = window.getClientCountry(); - if (clientsCountry && countriesToRedirect.includes(clientsCountry)) { - if (lang === "en") { - window.location.replace("/404"); - } else { - window.location.replace(`/${lang}/404`); - } - } -} - -if (window.parseCookies(document.cookie, "client_information") !== undefined) { - let purchaseButtons = document.querySelectorAll( - "a.live-markets_button.is-secondary.is-small.is-purchase.w-button" - ); - - let sellButtons = document.querySelectorAll( - "a.live-markets_button.is-secondary.is-small.is-sell.w-button" - ); - - function updateHref(buttons) { - buttons.forEach((button) => { - button.href = "https://app.deriv.com/appstore/traders-hub"; - }); - } - - updateHref(purchaseButtons); - updateHref(sellButtons); -} - -//live chat button hide on menu appear -const mobileMenu = document.getElementById("mobile-menu"); -const liveChatWrapper = document.getElementById("live_chat-wrapper"); - -let isLiveChatVisible = true; -let isLiveChatActivated = false; - -function fadeIn(element) { - var opacity = 0; - var timer = setInterval(function () { - if (opacity >= 1) { - clearInterval(timer); - } - element.style.opacity = opacity; - opacity += 0.1; - }, 30); -} - -function fadeOut(element) { - var opacity = 1; - var timer = setInterval(function () { - if (opacity <= 0) { - clearInterval(timer); - element.style.display = "none"; - } - element.style.opacity = opacity; - opacity -= 0.1; - }, 30); -} - -// - -const licenceKey = "12049137"; -const loadLiveChatScript = () => { - window.__lc = window.__lc || {}; - window.__lc.license = licenceKey; - window.LC_API = window.LC_API || { loaded: false }; - if (!window.LC_API.loaded) { - const lcScript = document.createElement("script"); - lcScript.async = true; - lcScript.src = "https://cdn.livechatinc.com/tracking.js"; - lcScript.onload = () => { - window.LC_API.loaded = true; // Mark as loaded - window.LC_API.on_after_load = function () { - performLiveChatAction( - !!window.parseCookies(document.cookie, "client_information") - ); - checkUrlForLiveChat(); - }; - if (typeof LiveChatWidget !== "undefined" && LiveChatWidget.init) { - LiveChatWidget.init(); - } - }; - document.body.appendChild(lcScript); - } else { - checkUrlForLiveChat(); - } -}; -const openLiveChat = () => { - if (window.LC_API && window.LC_API.open_chat_window) { - window.LC_API.open_chat_window(); - } -}; -const checkUrlForLiveChat = () => { - const urlParams = new URLSearchParams(window.location.search); - if (urlParams.get("is_livechat_open") === "true") { - openLiveChat(); - } -}; - -//dashboard send data -const performLiveChatAction = (is_logged_in) => { - window?.LiveChatWidget?.on("ready", () => { - // we open and close the window to trigger the widget to listen for new events - window.LC_API.open_chat_window(); - window.LC_API.hide_chat_window(); - checkUrlForLiveChat(); - - const utm_data_string = window.parseCookies(document.cookie, "utm_data"); - const utm_data = utm_data_string ? JSON.parse(utm_data_string) : {}; - const { utm_source, utm_medium, utm_campaign } = utm_data; - - const client_information = window.parseCookies( - document.cookie, - "client_information" - ); - const url_params = new URLSearchParams(window.location.search); - - const { - loginid, - email, - landing_company_shortcode, - currency, - residence, - first_name, - last_name, - } = client_information ? JSON.parse(client_information) : {}; - - /* the session variables are sent to CS team dashboard to notify user has logged in - and also acts as custom variables to trigger targeted engagement */ - const session_variables = { - is_logged_in: is_logged_in, - loginid: loginid ?? "", - landing_company_shortcode: landing_company_shortcode ?? "", - currency: currency ?? "", - residence: residence ?? "", - email: email ?? "", - platform: url_params.get("platform") ?? "", - utm_source: utm_source ?? "", - utm_medium: utm_medium ?? "", - utm_campaign: utm_campaign ?? "", - }; - - window.LiveChatWidget.call("set_session_variables", session_variables); - - if (is_logged_in) { - if (email) { - window.LiveChatWidget.call("set_customer_email", email); - } - if (first_name && last_name) { - window.LiveChatWidget.call( - "set_customer_name", - `${first_name} ${last_name}` - ); - } - } else { - // clear name and email fields after chat has ended - window.LC_API.on_chat_ended = () => { - window.LiveChatWidget.call("set_customer_email", " "); - window.LiveChatWidget.call("set_customer_name", " "); - }; - } - checkUrlForLiveChat(); - - // open chat widget when there is an incoming greeting/announcement - window.LiveChatWidget.on("new_event", (event) => { - if (event.greeting) { - window.LC_API.open_chat_window(); - } - }); - }); -}; -let is_logged_in = false; -let checkCookieInterval; - -const isLoggedIn = () => { - return !!window.parseCookies(document.cookie, "client_information"); -}; - -const checkLoggedIn = () => { - const new_login_status = isLoggedIn(); - if (new_login_status !== is_logged_in) { - performLiveChatAction(new_login_status); - is_logged_in = new_login_status; - } -}; - -// Perform initial authentication check -checkLoggedIn(); - -// Set interval to periodically check authentication status -checkCookieInterval = setInterval(checkLoggedIn, 2000); -//end of dashboard send data - -loadLiveChatScript(); -const liveChatIcons = document.querySelectorAll(".livechatbtn"); -if (liveChatIcons.length > 0) { - liveChatIcons.forEach((liveChatIcon) => { - liveChatIcon.addEventListener("click", (event) => { - event.preventDefault(); - openLiveChat(); - }); - }); -} -const liveChatIconById = document.getElementById("liveChatBtn"); -if (liveChatIconById) { - liveChatIconById.addEventListener("click", (event) => { - event.preventDefault(); - openLiveChat(); - }); -} -const liveChatIconsByrel = document.querySelectorAll('a[rel="liveChatBtn"]'); -liveChatIconsByrel.forEach((liveChatIcon) => { - liveChatIcon?.addEventListener("click", (event) => { - event.preventDefault(); - openLiveChat(); - }); -}); - -// - -// - -let navbarMenuBtn = document.querySelector(".navbar_menu-button"); - -if (navbarMenuBtn) { - navbarMenuBtn.addEventListener("click", function () { - let windowHeight = window.innerHeight; - - let navbarWrapper = document.querySelector(".new-navbar_main-wrapper"); - - if (navbarWrapper) { - let navbarHeight = navbarWrapper.offsetHeight; - - let calculatedHeight = windowHeight - navbarHeight; - - let navbarMenu = document.querySelector(".new-navbar_menu"); - if (navbarMenu) { - navbarMenu.style.height = `${calculatedHeight}px`; - } - } - }); -} - - -// - -// -// this code ensures opening a list of languages on mobile starting from the top - - let langMobButton = document.querySelector(".lang-mob"); - - if (langMobButton) { - langMobButton.addEventListener("click", function () { - let mobileMenuWrapper = document.querySelector( - ".new-navbar_menu-wrapper" - ); - - if (mobileMenuWrapper) { - mobileMenuWrapper.scrollBy({ top: -3000 }); - } - }); - } - - -// - -// -class CookieStorage { - constructor(cookieName) { - this.cookieName = cookieName; - } - - setItem(value) { - const expiryDate = new Date(); - expiryDate.setDate(expiryDate.getDate() + 30); // 30 days from now - const expires = "expires=" + expiryDate.toUTCString(); - const cookieValue = encodeURIComponent(JSON.stringify(value)); - document.cookie = `${this.cookieName}=${cookieValue};${expires};path=/`; - } - getItem() { - const cookies = document.cookie.split(";"); - for (let i = 0; i < cookies.length; i++) { - let cookie = cookies[i].trim(); - if (cookie.startsWith(`${this.cookieName}=`)) { - let cookieValue = cookie.substring(`${this.cookieName}=`.length); - return JSON.parse(decodeURIComponent(cookieValue)); - } - } - return null; - } -} - -const tracking_status_cookie = new CookieStorage("tracking_status"); -const tracking_status_cookie_declined = new CookieStorage( - "tracking_status_decline" -); - -const popupElement = document.querySelector(".cookies_background-wrapper"); - -//set datalayer details -const has_dataLayer = window.dataLayer; -var client_information = window.parseCookies( - document.cookie, - "client_information" -); - -is_logged_in = !!client_information; -has_dataLayer && - window.dataLayer.push({ - loggedIn: is_logged_in, - language: - window.parseCookies(document.cookie, "webflow-user-language") || "en", - ...(is_logged_in && { - visitorId: client_information?.loginid, - currency: client_information?.currency, - email: client_information?.email, - }), - }); - -// Check if pathname contains "eu" and tracking_status_cookie is null - -if ( - window.location.pathname.includes("eu") && - !tracking_status_cookie.getItem() && - !tracking_status_cookie_declined.getItem() -) { - popupElement.classList.remove("hide-element"); - document.body.classList.add("show-cookie"); -} - -// Select the accept and decline buttons -const acceptButton = document.getElementById("accept-cookie"); -const declineButton = document.getElementById("dont-accept-cookie"); - -acceptButton?.addEventListener("click", function () { - tracking_status_cookie.setItem(true); - popupElement.classList.add("hide-element"); - document.body.classList.remove("show-cookie"); -}); - -declineButton?.addEventListener("click", function () { - tracking_status_cookie_declined.setItem(true); - tracking_status_cookie.setItem(false); - popupElement.classList.add("hide-element"); - document.body.classList.remove("show-cookie"); -}); - -// -var targetPaths = [ - "/careers", - "/locations", - "/derivtech", - "/derivlife", - "/eu-careers", - "/our-locations", -]; -var path = window.location.pathname; -if (targetPaths.some((targetPath) => path.includes(targetPath))) { - var headTag = document.head; - var linkElements = headTag.querySelectorAll("link"); - linkElements.forEach(function (linkElement) { - if (linkElement.hasAttribute("hreflang")) { - if (linkElement.getAttribute("hreflang") !== "x-default") { - linkElement.remove(); - } - } - }); -} -// - -// - -const setEvent = (event) => { - let storedEvents = []; - let cacheCookie = parseCookies(document.cookie, "cached_analytics_events"); - if (cacheCookie) storedEvents = JSON.parse(cacheCookie); - - storedEvents.push(event); - document.cookie = `cached_analytics_events=${JSON.stringify( - storedEvents - )}; path=/; Domain=.deriv.com`; -}; - -const trackEventWithCache = (event) => { - if (window.rudderanalytics) { - window.rudderanalytics.track(event.name, event.properties); - } else { - setEvent(event); - } -}; - -window.addClickListener = function (button, eventName, eventProperties) { - if (button) { - button.addEventListener("click", function () { - trackEventWithCache({ - name: eventName, - properties: eventProperties, - }); - }); - } -}; - -var btnLiveChat = document?.getElementsByClassName("livechatbtn"); -var btnWhatsapp = document?.getElementsByClassName("whatsapp_chat"); -var btnTradershub = document?.getElementsByClassName("tradershub-btn"); -var btnTryFreeDemo = document.querySelectorAll(".btn-free-demo .w-button"); -var btnTryFreeDemoFooter = document.querySelectorAll( - '.btn-free-demo [data-class="w-button"]' -); - -const btnNavbarPrimary = document.querySelectorAll( - '[data-attributes="btn-primary-nav"]' -); -const btnLoginNavbar = document.querySelectorAll( - '[data-attributes="btn-secondary-nav"]' -); - -if (btnLiveChat) { - Array.from(btnLiveChat).forEach((button) => { - window.addClickListener(button, "ce_widget_usage_form", { - action: "click", - widget_name: "livechat", - }); - }); -} -if (btnWhatsapp) { - Array.from(btnWhatsapp).forEach((button) => { - window.addClickListener(button, "ce_widget_usage_form", { - action: "click", - widget_name: "whatsapp", - }); - }); -} -if (btnTradershub) { - Array.from(btnTradershub).forEach((button) => { - window.addClickListener(button, "ce_cta_clicks", { - action: "click", - cta_name: "Traders Hub", - }); - }); -} -if (btnTryFreeDemo) { - Array.from(btnTryFreeDemo).forEach((button) => { - window.addClickListener(button, "ce_cta_clicks", { - action: "click", - cta_name: "Try free demo", - }); - }); -} -if (btnTryFreeDemoFooter) { - Array.from(btnTryFreeDemoFooter).forEach((button) => { - window.addClickListener(button, "ce_cta_clicks", { - action: "click", - cta_name: "Try free demo", - }); - }); -} - -if (btnNavbarPrimary) { - Array.from(btnNavbarPrimary).forEach((button) => { - if (!button.classList.contains("tradershub-btn")) { - window.addClickListener(button, "ce_cta_clicks", { - action: "click", - cta_name: "Try free demo", - }); - } - }); -} - -if (btnLoginNavbar) { - Array.from(btnLoginNavbar).forEach((button) => { - window.addClickListener(button, "ce_cta_clicks", { - action: "click", - cta_name: "Login", - }); - }); -} - -const RUDDERSTACK_STAGING_KEY = "1lN3tsFD2nruGFgM5F074DC2hMB"; -const RUDDERSTACK_PRODUCTION_KEY = "1oV5agvlcnCZ6IH94wCKM1oR8Pd"; -const GB_STAGING_CLIENT_KEY = "sdk-9wuqJ1mlcQsSyZQ"; -const GB_STAGING_DECRYPTION_KEY = ""; -const GB_PROD_CLIENT_KEY = "sdk-UhZV3cNEg5nLNLNS"; -const GB_PROD_DECRYPTION_KEY = "nre64BV0dNIa44zW4tz5ow=="; -var GB_CLIENT_KEY, RUDDERSTACK_KEY, GB_DECRYPTION_KEY; -if ( - window.location.hostname === "deriv.com" || - window.location.hostname === "deriv.be" || - window.location.hostname === "deriv.me" -) { - GB_CLIENT_KEY = GB_PROD_CLIENT_KEY; - GB_DECRYPTION_KEY = GB_PROD_DECRYPTION_KEY; - RUDDERSTACK_KEY = RUDDERSTACK_PRODUCTION_KEY; -} else { - GB_CLIENT_KEY = GB_STAGING_CLIENT_KEY; - GB_DECRYPTION_KEY = GB_STAGING_DECRYPTION_KEY; - RUDDERSTACK_KEY = RUDDERSTACK_STAGING_KEY; -} -client_information = window.parseCookies(document.cookie, "client_information"); -const clientInfo = client_information ? JSON.parse(client_information) : null; -const utm_data_string = window.parseCookies(document.cookie, "utm_data"); -const utm_data = utm_data_string ? JSON.parse(utm_data_string) : {}; -const { utm_source, utm_medium, utm_campaign } = utm_data; -const cookies = window.parseCookies(document.cookie, "signup_device"); -let signupDevice = null; -const isBrowser = () => typeof window !== "undefined"; -const getLanguage = () => - isBrowser() ? localStorage.getItem("i18n") || navigator.language : null; -if (cookies) { - signupDevice = JSON.parse(cookies)?.signup_device || null; -} -const initialiseConfig = { - growthbookKey: GB_CLIENT_KEY, - growthbookDecryptionKey: GB_DECRYPTION_KEY, - rudderstackKey: RUDDERSTACK_KEY, - growthbookOptions: { - navigate: (url) => window.location.replace(url), - antiFlicker: false, - navigateDelay: 0, - attributes: { - country: - window.parseCookies(document.cookie, "clients_country") || - window.parseCookies(document.cookie, "website_status"), - user_language: - window.parseCookies(document.cookie, "user_language") || getLanguage(), - device_language: window.parseCookies(document.cookie, "language") || " ", - device_type: signupDevice, - utm_source: utm_data?.["utm_source"], - utm_medium: utm_data?.["utm_medium"], - utm_campaign: utm_data?.["utm_campaign"], - is_authorised: !!window.parseCookies( - document.cookie, - "client_information" - ), - loggedIn: !!window.parseCookies(document.cookie, "client_information"), - url: window.location.href, - }, - }, -}; -try { - Analytics?.Analytics.initialise(initialiseConfig); - // Analytics?.Analytics?.getInstances()?.ab?.GrowthBook?.loadFeatures(); - const userId = clientInfo?.user_id - ? clientInfo?.user_id - : Analytics?.Analytics?.getInstances?.().tracking?.getAnonymousId(); - Analytics?.Analytics?.identifyEvent(userId); -} catch (error) { - console.error("Error during initialisation:", error); -} -// Analytics?.Analytics?.getInstances()?.ab?.GrowthBook?.loadFeatures(); -Analytics?.Analytics?.pageView(location.pathname, "Deriv.com"); -// Analytics?.Analytics?.getInstances()?.ab?.GrowthBook?.setURL(window.location.href) -window.useGrowthbookFeatureFlag = function ({ featureFlag }) { - let featureFlagValue = Analytics?.Analytics?.getFeatureValue(featureFlag); - function updateFeatureFlagValue() { - const value = Analytics?.Analytics?.getFeatureValue(featureFlag); - featureFlagValue = value; - } - Analytics?.Analytics?.getInstances()?.ab?.GrowthBook?.setRenderer( - updateFeatureFlagValue - ); - return featureFlagValue; -}; - -// - -// Parse the cookies to get the 'client_information' cookie value -const cookieValue = window.parseCookies(document.cookie, "client_information") - ? JSON.parse(window.parseCookies(document.cookie, "client_information")) - : null; - -// Hotjar integration -if (cookieValue?.loginid) { - window?.hj("identify", cookieValue.loginid, { - is_logged_in: !!window.parseCookies(document.cookie, "client_information"), - landing_company_shortcode: cookieValue.landing_company_shortcode || "null", - }); -} - -const updateLinkHrefs = () => { - const featureFlagValue = Analytics?.Analytics?.getFeatureValue( - "trigger_os_signup_wf" - ); - const handleOutSystemsRedirection = () => { - const currentDomain = window.location.hostname; - let env; - if ( - currentDomain === "deriv.com" || - currentDomain === "deriv.be" || - currentDomain === "deriv.me" - ) { - env = "production"; - } else if (currentDomain === "staging.deriv.com") { - env = "staging"; - } else { - env = "development"; - } - switch (env) { - case "production": - return "https://hub.deriv.com/tradershub/signup"; - case "staging": - return "https://staging-hub.deriv.com/tradershub/signup"; - default: - return "https://dev-hub.deriv.com/tradershub/signup"; - } - }; - - function isSafari() { - const ua = navigator.userAgent.toLowerCase(); - return /safari/.test(ua) && !/chrome/.test(ua) && !/crios/.test(ua); - } - - function isIOS() { - const ua = navigator.userAgent.toLowerCase(); - return /ipad|iphone|ipod/.test(ua); - } - - const newHref = featureFlagValue - ? isIOS() || isSafari() - ? `https://${window.location.host}/signup` - : handleOutSystemsRedirection() - : `https://${window.location.host}/signup`; - - // Update href attributes - const mainSignupButton = document.getElementById("cta-home-btn-navbar"); - if (mainSignupButton) { - mainSignupButton.href = newHref; - } - - const signupButtons = document.querySelectorAll(".logged-out-btn"); - signupButtons?.forEach((btn) => { - if (btn?.href?.indexOf("/signup") > 0) { - btn.href = newHref; - } - }); - - const signupButtonsPlatforms = document.querySelectorAll(".logged-out-btn a"); - signupButtonsPlatforms?.forEach((btn) => { - if (btn?.href?.indexOf("/signup") > 0) { - btn.href = newHref; - } - }); -}; - -Analytics?.Analytics?.getInstances() - ?.ab?.GrowthBook?.loadFeatures() - .then(() => { - if (window.location.href.indexOf("/partners") > -1 === false) { - updateLinkHrefs(); - } - }); - - diff --git a/src/temp-static.min.js b/src/temp-static.min.js deleted file mode 100644 index ba4230c..0000000 --- a/src/temp-static.min.js +++ /dev/null @@ -1 +0,0 @@ -var e,o,n,i,t,a,r,d,c,s;import{initializeApp as l}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-app.js";import{getDatabase as u,ref as p,onValue as w}from"https://www.gstatic.com/firebasejs/10.8.1/firebase-database.js";function h(e,o,n,i){let t="";if(n){let e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),t="; expires="+e.toUTCString()}document.cookie=i?e+"="+(o||"")+t+`;domain=${i};path=/`:e+"="+(o||"")+t+";path=/"}function m(e,o){const n={};return e.split(";").forEach((e=>{const[o,i]=e.split("=").map((e=>e.trim()));n[o]=decodeURIComponent(i)})),n[o]}function y(e){h("webflow-user-language",e,30)}function N(e){document.cookie=e+"=; Max-Age=-99999999;"}window.emailRegex=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,window.toggleErrorField=(e,o)=>{o?e.classList.remove("error-field"):e.classList.add("error-field")},window.disableButton=function(e){e.disabled=!0,e.style.opacity="0.5"},window.isEuRegion=function(e){const o=e.replace(/\/$/,"");return/^\/(?:[^\/]+\/)?eu(?:\/|$)/.test(o)},window.enableButton=function(e){e.disabled=!1,e.style.opacity="1"},window.getOauthUrl=function(){var e=window.location.href,o=new URL(e).hostname,n=["deriv.com","deriv.be","deriv.me"].find((e=>o.endsWith(e)));return n?`https://oauth.${n}`:"https://oauth.deriv.com"},window.getClientCountry=function(){var e;const o=m(document.cookie,"clients_country"),n=m(document.cookie,"client_information");return n&&(null==(e=JSON.parse(n))?void 0:e.residence)||o},window.deriv_com_url="deriv.com",window.deriv_me_url="deriv.me",window.deriv_be_url="deriv.be",window.webflow_domain="webflow.deriv.com",window.staging_url="staging.deriv.com",window.staging_deriv_be_url="staging.deriv.be",window.domain_list_app_id={[window.deriv_com_url]:"16929",[window.deriv_me_url]:"1411",[window.deriv_be_url]:"30767",[window.webflow_domain]:"53503",[window.staging_url]:"16303"},window.getDomain=()=>{var e=window.location.href;return new URL(e).hostname},window.getAppId=()=>{const e=window.getDomain(),o=new URLSearchParams(window.location.search||"").get("app_id");if(o)return o;const n=localStorage.getItem("config.app_id");if(n)return n;const i={[window.webflow_domain]:window.domain_list_app_id[window.webflow_domain],[window.deriv_be_url]:window.domain_list_app_id[window.deriv_be_url],[window.deriv_me_url]:window.domain_list_app_id[window.deriv_me_url],[window.staging_url]:window.domain_list_app_id[window.staging_url]};return i[e]?i[e]:window.domain_list_app_id[window.deriv_com_url]};const g=()=>{const e=localStorage.getItem("config.server_url"),o=m(document.cookie,"webflow-user-language");let n=o?o.toLowerCase():"en";"zh-cn"!==n&&"zh-tw"!==n||(n=n.replace("-","_"));const i=(e=>{let o="";return e&&Object.keys(e).forEach((n=>{o+=`&${n}=${e[n]}`})),o})((()=>{const e=m(document.cookie,"utm_data");if(e){const o=JSON.parse(e),n={};return["utm_source","utm_ad_id","utm_adgroup_id","utm_adrollclk_id","utm_campaign","utm_campaign_id","utm_content","utm_fbcl_id","utm_gl_client_id","utm_medium","utm_msclk_id","utm_term"].forEach((e=>{o.hasOwnProperty(e)&&(n[e]=o[e])})),n}return null})()),t=m(document.cookie,"affiliate_tracking"),a=t?`&affiliate_token=${t}`:"",r=void["mt5","bot","derivx"].filter((e=>window.location.pathname.includes(e)&&e))||"";return e&&/qa/.test(e)?`https://${e}/oauth2/authorize?app_id=${window.getAppId()}&l=${n}&brand=deriv${a}${i}&platform=${r}`:`${window.getOauthUrl()}/oauth2/authorize?app_id=${(()=>{const e=window.getDomain();return e===window.deriv_me_url?window.domain_list_app_id[window.deriv_me_url]:e===window.deriv_be_url?window.domain_list_app_id[window.deriv_be_url]:e===window.webflow_domain?window.domain_list_app_id[window.webflow_domain]:window.domain_list_app_id[window.deriv_com_url]})()}&l=${n}&brand=deriv${a}${i}&platform=${r}`};if(!!!m(document.cookie,"client_information")){var f=document.createElement("iframe");f.src=(()=>{const e=window.location.hostname;let o;switch(o="deriv.com"===e||"deriv.be"===e||"deriv.me"===e?"production":"staging.deriv.com"===e?"staging":"development",o){case"production":return"https://hub.deriv.com/tradershub/signup";case"staging":return"https://staging-hub.deriv.com/tradershub/signup";default:return"https://dev-hub.deriv.com/tradershub/signup"}})(),f.style.width="0",f.style.height="0",f.style.border="none",f.style.visibility="hidden",f.setAttribute("sandbox","allow-same-origin allow-scripts"),document.body.appendChild(f)}window.establishWebSocketConnection=()=>new Promise(((e,o)=>{const n=m(document.cookie,"webflow-user-language"),i=n?n.toLowerCase():"en",t=localStorage.getItem("config.server_url")||"green.derivws.com";window.websocket=new WebSocket(`wss://${t}/websockets/v3?app_id=${window.getAppId()}&l=${i||"en"}&brand=deriv`),window.websocket.addEventListener("open",(o=>{window.websocket.addEventListener("close",(()=>{window.websocket.close()})),window.websocket.addEventListener("message",(e=>{JSON.parse(e.data)})),e(window.websocket)})),window.websocket.addEventListener("error",(e=>{var n;null==(n=null==window?void 0:window.websocket)||n.close(),o(e)}))})),window.socketMessageSend=async(e,o)=>{var n;try{return(null==window?void 0:window.websocket)&&(null==(n=null==window?void 0:window.websocket)?void 0:n.readyState)===(null==WebSocket?void 0:WebSocket.OPEN)?(window.websocket.send(e),new Promise(((e,n)=>{window.websocket.addEventListener("message",(i=>{const t=JSON.parse(i.data);o===t.msg_type&&(t.error?n(t.error):e(t))}))}))):establishWebSocketConnection().then((()=>(websocket.send(e),new Promise(((e,n)=>{websocket.addEventListener("message",(i=>{const t=JSON.parse(i.data);o===t.msg_type&&(t.error?n(t.error):e(t))}))}))))).catch((e=>Promise.reject(e)))}catch(i){return Promise.reject(i)}};const v=[{id:"appgallery",selectors:[".footer_banner-badge.gallery.w-inline-block",".app-download_link-wrapper.appgallery.w-inline-block"],countries:["af","ax","al","dz","as","ad","ao","aq","am","au","at","az","bh","bd","by","be","bj","bm","bt","bo","ba","bw","bv","br","io","bn","bg","bf","bi","kh","cm","ca","cv","bq","cf","td","cn","cx","cc","km","cg","cd","ck","ci","hr","cu","cw","cy","cz","dk","dj","dm","eg","gq","er","ee","et","fk","fo","fj","fi","fr","pf","tf","ga","gm","ge","de","gh","gi","gr","gl","gu","gg","gn","gw","hm","va","hu","is","in","id","ir","iq","ie","im","il","it","jp","je","jo","kz","ke","ki","kr","kp","kw","kg","la","lv","lb","ls","lr","ly","li","lt","lu","mo","mk","mg","mw","my","mv","ml","mt","mh","mr","mu","yt","mx","fm","md","mc","mn","me","ma","mz","mm","na","nr","np","nl","nc","nz","ne","ng","nu","nf","mp","no","om","pk","pw","ps","pg","pe","ph","pn","pl","pt","qa","re","ro","ru","rw","sh","kn","pm","bl","mf","ws","sm","st","sa","sn","rs","sc","sl","sg","sx","sk","si","sb","so","gs","ss","es","lk","sd","sj","sz","se","ch","sy","tw","tj","tz","th","tl","tg","tk","to","tn","tr","tm","tc","tv","ug","ua","ae","gb","um","us","uz","vu","vi","wf","eh","ye","zm","zw"]},{id:"googlePlay",selectors:[".footer_banner-badge.google.w-inline-block",".app-download_link-wrapper.google.w-inline-block"],countries:["af","ax","as","ad","ai","aq","au","bb","bt","bv","io","bn","bi","ca","bq","cf","cx","cc","cg","cd","ck","cw","gq","et","fk","fo","gf","pf","tf","gl","gp","gu","gg","gy","hm","va","hk","ir","im","jp","je","ki","kp","ls","ly","mg","mw","mh","mq","mr","yt","fm","mn","me","ms","nr","nc","nz","ng","nu","nf","mp","pw","ps","pn","pr","re","sh","kn","lc","pm","vc","bl","mf","st","sg","sx","gs","ss","sj","sz","sy","tl","tk","tc","tv","um","us","vg","vi","wf","eh"]},{id:"appstore",selectors:[".footer_banner-badge.store.w-inline-block",".app-download_link-wrapper.appstore.w-inline-block"],countries:["ax","al","as","ad","aq","aw","au","at","bd","be","bv","io","bg","bi","ca","bq","cf","cx","cc","km","ck","hr","cu","cw","cy","cz","dk","dj","gq","er","ee","et","fk","fo","fi","fr","gf","pf","tf","de","gi","gr","gl","gp","gu","gg","gn","ht","hm","va","hk","hu","is","ir","iq","ie","im","il","it","je","ki","kp","lv","ls","ly","li","lt","lu","mt","mh","mq","yt","fm","me","nl","nc","nz","ng","nu","nf","mp","no","ps","pn","pl","pt","pr","re","ro","sh","pm","bl","mf","ws","sm","sg","sx","sk","si","so","gs","ss","es","sd","sj","se","ch","sy","tw","tl","tg","tk","tr","tv","gb","um","us","vu","vi","wf","eh"]},{id:"p2p",selectors:["#p2payment.accordion_toggle-block","#p2component.section_dp2p","#card_block_p2p.help_category"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"w-dyn-item-p2p",selectors:["div.w-dyn-item"],countries:["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"]},{id:"hideRow",selectors:["#footer_social-icons_row","#footer_text_row",".footer_risk-warning.w-richtext"],countries:["br","uy","lk","ch","za","ec"]},{id:"hideDiel",selectors:["#footer_text_diel","#footer_social-icons_diel"],countries:["br","uy","lk","ch","za","ec"]}],Y=[{id:"showElems",selectors:[".banner_disclaimer"],countries:["br","uy","lk","ch","za","ec"]}],_=()=>{const e=window.getClientCountry();v.forEach((o=>{const n="hideDiel"===o.id?!o.countries.includes(e):o.countries.includes(e);if(e&&n)return o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((e=>{if(e)if("w-dyn-item-p2p"===o.id){e.querySelector("#card_block_p2p.help_category")&&(e.style.display="none")}else e.style.display="none"}))}));if(!n){const e=document.querySelector(".footer_social-icons.diel");e&&(e.style.display="flex")}})),Y.forEach((o=>{e&&o.countries.includes(e)?o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{if(o){const n=document.querySelector(".page-wrapper");".banner_disclaimer"===e?(n.classList.add("disclaimer-show"),o.classList.remove("hide-element")):o.style.display="block"}}))})):o.selectors.forEach((e=>{document.querySelectorAll(e).forEach((o=>{o&&(".banner_disclaimer"===e?o.classList.add("hide-element"):o.style.display="none")}))}))}))},A=JSON.stringify({website_status:1});!async function(){try{const e=await fetch("https://www.cloudflare.com/cdn-cgi/trace"),o=await e.text(),n=Object.fromEntries(o.split("\n").map((e=>e.split("=",2)))).loc.toLowerCase();n!==m(document.cookie,"clients_country")&&(N("clients_country"),h("clients_country",n,30)),_()}catch(e){_()}}();m(document.cookie,"clients_country")||window.socketMessageSend(A,"website_status").then((e=>{m(document.cookie,"clients_country")!==e.website_status.clients_country&&(N("clients_country"),h("clients_country",e.website_status.clients_country,30)),_()})).catch((e=>{}));const b=["ar","bn","de","en","es","fr","it","ko","pl","pt","ru","si","sw","th","tr","vi","zh_cn","zh_tw","zh-cn","zh-tw"];(()=>{var e;const o=window.location.pathname,n=window.location.hash,i=window.location.search,t=o.split("/"),a=t[1],r=b.includes(a||""),d=t.includes("careers")||t.includes("locations")||t.includes("derivtech")||t.includes("derivlife")||t.includes("eu-careers")||t.includes("our-locations");r&&y(a);const c=(null==(e=m(document.cookie,"webflow-user-language"))?void 0:e.toLowerCase())||"en",s=r?a:c;if((r||"en"!==c)&&a!==c)if(r&&a!==c)y(s);else if(!d){const e=(r?t.map((e=>e===a?s:e)).join("/"):s+t.join("/"))+i+n;window.location.href="/"+e}})();const k=function(){let e,o=!1,n=!1;const i=()=>{n=!0,o=!!m(document.cookie,"client_information"),o&&clearInterval(e),document.dispatchEvent(new Event("authStatusChange"))};return i(),e=setInterval(i,800),{getLoggedInStatus:()=>o,getAuthCheckedStatus:()=>n,onAuthStatusChange:e=>document.addEventListener("authStatusChange",e)}}();k.onAuthStatusChange((()=>{if(k.getAuthCheckedStatus()&&k.getLoggedInStatus()){document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.add("hide-element")}))}else if(k.getAuthCheckedStatus()&&!k.getLoggedInStatus()){document.querySelectorAll(".logged-out-btn").forEach((e=>{e.classList.remove("hide-element")}));document.querySelectorAll(".logged-in-btn").forEach((e=>{e.classList.add("hide-element")}))}}));const L=window.location.href;if(["help-centre"].some((e=>L.includes(e)))){const e=new URL(L).searchParams;e.has("platform")&&"derivgo"===e.get("platform")&&(S=".derivgo-query-element",document.querySelectorAll(S).forEach((e=>{e.style.display="none"})))}var S;const E=document.querySelector(".banner_disclaimer"),C=document.querySelector(".main-wrapper");if(E){new ResizeObserver((e=>{for(let o of e)if(o.target===E){let e=o.target.getBoundingClientRect();C&&(C.style.paddingTop=e.height+"px")}})).observe(E)}window.addEventListener("pageshow",(function(e){if(e.persisted){const e=document.querySelector(".w-nav-overlay");e&&(e.style.display="none",document.querySelector("body").click())}}));const q=u(l({databaseURL:window.location.hostname.includes("staging")?"https://app-config-staging.firebaseio.com":"https://app-config-prod.firebaseio.com"}));let I=!1,z=!1;!function(){var e;const o=document.getElementById("live_chat-wrapper");try{const e=p(q,"remote_config/deriv-com/chat");w(e,(e=>{const n=e.val();I=n.live_chat,z=n.whatsapp_chat;const i=document.querySelector(".whatsapp_chat"),t=document.querySelector(".livechatbtn");i&&(i.style.visibility=z?"visible":"hidden"),t&&(t.style.visibility=I?"visible":"hidden");if(window.location.pathname.includes("/help-centre")){const e=document.querySelectorAll(".livechatbtn");I?e.forEach((e=>{e.style.visibility="visible"})):e.forEach((e=>{e.style.visibility="hidden"}));const o=document.querySelectorAll(".whatsapp_chat");z?o.forEach((e=>{e.style.visibility="visible"})):o.forEach((e=>{e.style.visibility="hidden"}))}window.addEventListener("scroll",(function(){var e,n;(I||z)&&(null==(e=null==o?void 0:o.classList)||e.remove("hide-element")),I||z||null==(n=null==o?void 0:o.classList)||n.add("hide-element")}))}),(e=>{var n;null==(n=null==o?void 0:o.classList)||n.remove("hide-element")}))}catch(n){null==(e=null==o?void 0:o.classList)||e.remove("hide-element")}}();new MutationObserver((function(e){for(const o of e)if(o.addedNodes.length)for(const e of o.addedNodes)e.nodeType===Node.ELEMENT_NODE&&"chat-widget-minimized"===e.id&&(e.style.opacity="0")})).observe(document.body,{childList:!0,subtree:!0});const x=window.getClientCountry();const j=[{country:"af",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"ax",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"al",apple:"No",android:"Yes",huawei:"No"},{country:"dz",apple:"Yes",android:"Yes",huawei:"No"},{country:"as",apple:"N/A",android:"No",huawei:"N/A"},{country:"ad",apple:"N/A",android:"N/A",huawei:"No"},{country:"ao",apple:"Yes",android:"Yes",huawei:"No"},{country:"ai",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"aq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ag",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ar",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"am",apple:"Yes",android:"Yes",huawei:"No"},{country:"aw",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"au",apple:"No",android:"No",huawei:"No"},{country:"at",apple:"No",android:"Yes",huawei:"No"},{country:"az",apple:"Yes",android:"Yes",huawei:"No"},{country:"bs",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bh",apple:"Yes",android:"Yes",huawei:"No"},{country:"bd",apple:"N/A",android:"Yes",huawei:"No"},{country:"bb",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"by",apple:"Yes",android:"Yes",huawei:"No"},{country:"be",apple:"No",android:"Yes",huawei:"No"},{country:"bz",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"bj",apple:"Yes",android:"Yes",huawei:"No"},{country:"bm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"bt",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"bo",apple:"Yes",android:"Yes",huawei:"No"},{country:"ba",apple:"Yes",android:"Yes",huawei:"No"},{country:"bw",apple:"Yes",android:"Yes",huawei:"No"},{country:"bv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"br",apple:"Yes",android:"Yes",huawei:"No"},{country:"io",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"bn",apple:"Yes",android:"N/A",huawei:"No"},{country:"bg",apple:"No",android:"Yes",huawei:"No"},{country:"bf",apple:"Yes",android:"Yes",huawei:"No"},{country:"bi",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kh",apple:"Yes",android:"Yes",huawei:"No"},{country:"cm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ca",apple:"No",android:"No",huawei:"No"},{country:"cv",apple:"Yes",android:"Yes",huawei:"No"},{country:"bq",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ky",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cf",apple:"N/A",android:"N/A",huawei:"No"},{country:"td",apple:"Yes",android:"Yes",huawei:"No"},{country:"cl",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"cn",apple:"Yes",android:"Yes",huawei:"No"},{country:"cx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"co",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"km",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cg",apple:"Yes",android:"N/A",huawei:"No"},{country:"cd",apple:"Yes",android:"N/A",huawei:"No"},{country:"ck",apple:"N/A",android:"N/A",huawei:"No"},{country:"cr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ci",apple:"Yes",android:"Yes",huawei:"No"},{country:"hr",apple:"No",android:"Yes",huawei:"No"},{country:"cu",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"cw",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"cy",apple:"No",android:"Yes",huawei:"No"},{country:"cz",apple:"No",android:"Yes",huawei:"No"},{country:"dk",apple:"No",android:"Yes",huawei:"No"},{country:"dj",apple:"N/A",android:"Yes",huawei:"No"},{country:"dm",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"do",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ec",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"eg",apple:"Yes",android:"Yes",huawei:"No"},{country:"sv",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gq",apple:"N/A",android:"N/A",huawei:"No"},{country:"er",apple:"N/A",android:"Yes",huawei:"No"},{country:"ee",apple:"No",android:"Yes",huawei:"No"},{country:"et",apple:"N/A",android:"N/A",huawei:"No"},{country:"fk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"fo",apple:"N/A",android:"N/A",huawei:"No"},{country:"fj",apple:"Yes",android:"Yes",huawei:"No"},{country:"fi",apple:"No",android:"Yes",huawei:"No"},{country:"fr",apple:"No",android:"Yes",huawei:"No"},{country:"gf",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"pf",apple:"N/A",android:"N/A",huawei:"No"},{country:"tf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ga",apple:"Yes",android:"Yes",huawei:"No"},{country:"gm",apple:"Yes",android:"Yes",huawei:"No"},{country:"ge",apple:"Yes",android:"Yes",huawei:"No"},{country:"de",apple:"No",android:"Yes",huawei:"No"},{country:"gh",apple:"Yes",android:"Yes",huawei:"No"},{country:"gi",apple:"N/A",android:"Yes",huawei:"No"},{country:"gr",apple:"No",android:"Yes",huawei:"No"},{country:"gl",apple:"N/A",android:"N/A",huawei:"No"},{country:"gd",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gp",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"gu",apple:"N/A",android:"No",huawei:"N/A"},{country:"gt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gg",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"gn",apple:"N/A",android:"Yes",huawei:"No"},{country:"gw",apple:"Yes",android:"Yes",huawei:"No"},{country:"gy",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ht",apple:"N/A",android:"Yes",huawei:"Yes"},{country:"hm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"va",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"hn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"hk",apple:"No",android:"No",huawei:"Yes"},{country:"hu",apple:"No",android:"Yes",huawei:"No"},{country:"is",apple:"No",android:"Yes",huawei:"No"},{country:"in",apple:"Yes",android:"Yes",huawei:"No"},{country:"id",apple:"Yes",android:"Yes",huawei:"No"},{country:"ir",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"iq",apple:"No",android:"Yes",huawei:"N/A"},{country:"ie",apple:"No",android:"Yes",huawei:"No"},{country:"im",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"il",apple:"No",android:"Yes",huawei:"No"},{country:"it",apple:"No",android:"Yes",huawei:"No"},{country:"jm",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"jp",apple:"Yes",android:"No",huawei:"No"},{country:"je",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"jo",apple:"Yes",android:"Yes",huawei:"No"},{country:"kz",apple:"Yes",android:"Yes",huawei:"No"},{country:"ke",apple:"Yes",android:"Yes",huawei:"No"},{country:"ki",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kr",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"kp",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kw",apple:"Yes",android:"Yes",huawei:"No"},{country:"kg",apple:"Yes",android:"Yes",huawei:"No"},{country:"la",apple:"Yes",android:"Yes",huawei:"No"},{country:"lv",apple:"No",android:"Yes",huawei:"No"},{country:"lb",apple:"Yes",android:"Yes",huawei:"No"},{country:"ls",apple:"N/A",android:"N/A",huawei:"No"},{country:"lr",apple:"Yes",android:"Yes",huawei:"No"},{country:"ly",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"li",apple:"N/A",android:"Yes",huawei:"No"},{country:"lt",apple:"No",android:"Yes",huawei:"No"},{country:"lu",apple:"No",android:"Yes",huawei:"No"},{country:"mo",apple:"Yes",android:"Yes",huawei:"No"},{country:"mk",apple:"Yes",android:"Yes",huawei:"No"},{country:"mg",apple:"Yes",android:"N/A",huawei:"No"},{country:"mw",apple:"Yes",android:"N/A",huawei:"No"},{country:"my",apple:"Yes",android:"Yes",huawei:"No"},{country:"mv",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"ml",apple:"Yes",android:"Yes",huawei:"No"},{country:"mt",apple:"No",android:"Yes",huawei:"No"},{country:"mh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mq",apple:"N/A",android:"N/A",huawei:"Yes"},{country:"mr",apple:"Yes",android:"N/A",huawei:"No"},{country:"mu",apple:"Yes",android:"Yes",huawei:"No"},{country:"yt",apple:"N/A",android:"N/A",huawei:"No"},{country:"mx",apple:"Yes",android:"Yes",huawei:"No"},{country:"fm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"md",apple:"Yes",android:"Yes",huawei:"No"},{country:"mc",apple:"Yes",android:"Yes",huawei:"No"},{country:"mn",apple:"Yes",android:"N/A",huawei:"No"},{country:"me",apple:"No",android:"N/A",huawei:"No"},{country:"ms",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"ma",apple:"Yes",android:"Yes",huawei:"No"},{country:"mz",apple:"Yes",android:"Yes",huawei:"No"},{country:"mm",apple:"Yes",android:"Yes",huawei:"No"},{country:"na",apple:"Yes",android:"Yes",huawei:"No"},{country:"nr",apple:"Yes",android:"N/A",huawei:"No"},{country:"np",apple:"Yes",android:"Yes",huawei:"No"},{country:"nl",apple:"No",android:"Yes",huawei:"No"},{country:"nc",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nz",apple:"No",android:"No",huawei:"No"},{country:"ni",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"ne",apple:"Yes",android:"Yes",huawei:"No"},{country:"ng",apple:"No",android:"No",huawei:"No"},{country:"nu",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"nf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mp",apple:"N/A",android:"No",huawei:"N/A"},{country:"no",apple:"No",android:"Yes",huawei:"No"},{country:"om",apple:"Yes",android:"Yes",huawei:"No"},{country:"pk",apple:"Yes",android:"Yes",huawei:"No"},{country:"pw",apple:"Yes",android:"No",huawei:"N/A"},{country:"ps",apple:"N/A",android:"N/A",huawei:"No"},{country:"pa",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pg",apple:"Yes",android:"Yes",huawei:"No"},{country:"py",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"pe",apple:"Yes",android:"Yes",huawei:"No"},{country:"ph",apple:"Yes",android:"Yes",huawei:"No"},{country:"pn",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"pl",apple:"No",android:"Yes",huawei:"No"},{country:"pt",apple:"No",android:"Yes",huawei:"No"},{country:"pr",apple:"N/A",android:"No",huawei:"Yes"},{country:"qa",apple:"Yes",android:"Yes",huawei:"No"},{country:"re",apple:"N/A",android:"N/A",huawei:"No"},{country:"ro",apple:"No",android:"Yes",huawei:"No"},{country:"ru",apple:"Yes",android:"Yes",huawei:"No"},{country:"rw",apple:"Yes",android:"Yes",huawei:"No"},{country:"sh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"kn",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"lc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"pm",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"vc",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"bl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"mf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ws",apple:"N/A",android:"Yes",huawei:"No"},{country:"sm",apple:"N/A",android:"Yes",huawei:"No"},{country:"st",apple:"Yes",android:"N/A",huawei:"No"},{country:"sa",apple:"Yes",android:"Yes",huawei:"No"},{country:"sn",apple:"Yes",android:"Yes",huawei:"No"},{country:"rs",apple:"Yes",android:"Yes",huawei:"No"},{country:"sc",apple:"Yes",android:"Yes",huawei:"N/A"},{country:"sl",apple:"Yes",android:"Yes",huawei:"No"},{country:"sg",apple:"No",android:"No",huawei:"No"},{country:"sx",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sk",apple:"No",android:"Yes",huawei:"No"},{country:"si",apple:"No",android:"Yes",huawei:"No"},{country:"sb",apple:"Yes",android:"Yes",huawei:"No"},{country:"so",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"za",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"gs",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ss",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"es",apple:"No",android:"Yes",huawei:"No"},{country:"lk",apple:"Yes",android:"Yes",huawei:"No"},{country:"sd",apple:"N/A",android:"Yes",huawei:"N/A"},{country:"sr",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"sj",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"sz",apple:"Yes",android:"N/A",huawei:"No"},{country:"se",apple:"No",android:"Yes",huawei:"No"},{country:"ch",apple:"No",android:"Yes",huawei:"No"},{country:"sy",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tw",apple:"No",android:"Yes",huawei:"No"},{country:"tj",apple:"Yes",android:"Yes",huawei:"No"},{country:"tz",apple:"Yes",android:"Yes",huawei:"No"},{country:"th",apple:"Yes",android:"Yes",huawei:"No"},{country:"tl",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"tg",apple:"N/A",android:"Yes",huawei:"No"},{country:"tk",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"to",apple:"Yes",android:"Yes",huawei:"No"},{country:"tt",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"tn",apple:"Yes",android:"Yes",huawei:"No"},{country:"tr",apple:"No",android:"Yes",huawei:"No"},{country:"tm",apple:"Yes",android:"Yes",huawei:"No"},{country:"tc",apple:"Yes",android:"N/A",huawei:"N/A"},{country:"tv",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ug",apple:"Yes",android:"Yes",huawei:"No"},{country:"ua",apple:"Yes",android:"Yes",huawei:"No"},{country:"ae",apple:"Yes",android:"Yes",huawei:"No"},{country:"gb",apple:"No",android:"Yes",huawei:"No"},{country:"um",apple:"N/A",android:"No",huawei:"N/A"},{country:"us",apple:"No",android:"No",huawei:"N/A"},{country:"uy",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"uz",apple:"Yes",android:"Yes",huawei:"No"},{country:"vu",apple:"No",android:"Yes",huawei:"N/A"},{country:"ve",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vn",apple:"Yes",android:"Yes",huawei:"Yes"},{country:"vg",apple:"Yes",android:"N/A",huawei:"Yes"},{country:"vi",apple:"N/A",android:"No",huawei:"N/A"},{country:"wf",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"eh",apple:"N/A",android:"N/A",huawei:"N/A"},{country:"ye",apple:"Yes",android:"Yes",huawei:"No"},{country:"zm",apple:"Yes",android:"Yes",huawei:"No"},{country:"zw",apple:"Yes",android:"Yes",huawei:"No"}].find((e=>e.country===x)),O=j?function(e){const{apple:o,android:n,huawei:i}=e;return"Yes"===o&&"Yes"===n&&"Yes"===i?"Android, iOS & Huawei":"Yes"===o&&"Yes"===n&&"Yes"!==i?"Android, and iOS":"Yes"===o&&"Yes"===i&&"Yes"!==n?"iOS, and Huawei":"Yes"===n&&"Yes"!==o&&"Yes"!==i?"Android":"Yes"===o&&"Yes"===i&&"Yes"!==n?"iOS, and Huawei":"Yes"===o&&"Yes"!==n&&"Yes"!==i?"iOS":"Yes"!==o&&"Yes"!==n&&"Yes"===i?"Huawei":""}(j):"",$=document.getElementById("app-download-heading");$&&($.innerText=O);const B=document.querySelector(".redirection_background-wrapper"),D=document.getElementById("cancel-redirect"),P=document.getElementById("proceed-redirect");if(window.isEuRegion(window.location.pathname)&&B&&D&&P){const e=["deriv.me","deriv.be","deriv.com","app.deriv.me","app.deriv.be","app.deriv.com","docs.deriv.com","community.deriv.com","deriv.statuspage.io","signup.deriv.com","login.deriv.com","api.deriv.com"];let o="",n="_self";document.querySelectorAll("a").forEach((function(i){const t=new URL(i.href,window.location.href),a=new URL(window.location.href);e.includes(t.host)||t.host===a.host||i.addEventListener("click",(function(e){e.preventDefault(),o=t.href,n=i.target||"_self",B.classList.remove("hide-element"),document.body.style.overflow="hidden"}))})),D.addEventListener("click",(function(){B.classList.add("hide-element"),document.body.style.overflow="auto",o=""})),P.addEventListener("click",(function(){o&&(window.open(o,n),o="",B.classList.add("hide-element"),document.body.style.overflow="auto")}))}document.querySelector(".banner_disclaimer")?document.body.classList.add("disclaimer-visible"):document.body.classList.remove("disclaimer-visible");const W=document.querySelectorAll(".navbar_accordion-item");function R(){const e=document.querySelector(".navbar_accordion-trigger.open");e&&e.scrollIntoView({behavior:"smooth",block:"start"})}W.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.overflow="hidden",o.style.transition="max-height 0.3s ease-in, opacity 0.3s ease-in",o.style.opacity="0"})),W.forEach((e=>{const o=e.querySelector(".navbar_accordion-trigger");o.addEventListener("click",(function(){const e=o.classList.contains("open");if(W.forEach((e=>{e.querySelector(".navbar_accordion-trigger").classList.remove("open");const o=e.querySelector(".navbar_accordion-content");o.classList.remove("open"),o.style.maxHeight="0px",o.style.opacity="0"})),!e){o.classList.add("open");const e=o.nextElementSibling;e.classList.add("open"),e.style.maxHeight=e.scrollHeight+"px",e.style.opacity="1"}}))}));document.querySelectorAll(".navbar_accordion-trigger").forEach((e=>{e.addEventListener("click",(function(){setTimeout(R,300)}))}));const U=new MutationObserver((e=>{e.forEach((e=>{if("class"===e.attributeName){const o=e.target;o.classList.contains("open")&&o.scrollIntoView({behavior:"smooth",block:"start"})}}))}));document.querySelectorAll(".navbar_accordion-item").forEach((e=>{U.observe(e,{attributes:!0})}));const J=new URL(window.location.href),T=new URLSearchParams(J.search),F=T.get("t");if(T.has("referrer")&&null!=F){m(document.cookie,"referrer_token")!==F&&(N("referrer_token"),h("referrer_token",F,365,".deriv.com"))}const H=document.getElementById("navbar-home_login");H&&H.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const M=document.getElementById("res-navbar-home_login");M&&M.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const V=document.getElementById("white-navbar_login");V&&V.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()}));const G=document.getElementById("res-white-navbar_login");G&&G.addEventListener("click",(function(e){e.preventDefault(),window.location.href=g()})),window.fallbackLoader="Migrated All + Removal of Webflow array functions";let K=document.querySelectorAll(".navbar_accordion-trigger");K.forEach((e=>{e.addEventListener("click",(function(){K.forEach((e=>e.classList.remove("current"))),this.classList.add("current")}))}));let Z=document.querySelector(".navbar_accordion-link.w--current");if(Z){let e=Z.closest(".navbar_accordion-item");if(e){let o=e.querySelector(".navbar_accordion-trigger");o&&o.classList.add("current")}}let Q=document.querySelector(".locale > .new-navbar_dropdown-link.w--current");if(Q){let e=Q.getAttribute("hreflang"),o=document.querySelectorAll(".current-locale-iso-code");if(e&&o.length)for(let n of o)n.innerText=e}function X(e,o,n){let i="";{let e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),i="; expires="+e.toUTCString()}document.cookie=e+"="+(o||"")+i+"; path=/"}let ee=document.querySelectorAll(".w-locales-items");if(ee.length>0){let e=function(e){let o=document.querySelector('a[hreflang="'+e+'"]');o&&window.location.pathname!==o.getAttribute("href")&&o.click()};ee.forEach((function(e){e.querySelectorAll("a").forEach((function(e){e.addEventListener("click",(function(o){o.preventDefault(),X("webflow-user-language",e.getAttribute("hreflang"),30),window.location.href=e.href}))}))})),window.setLanguageCookie=e=>{X("webflow-user-language",e,30)};let o=function(e){let o=document.cookie.split(";");for(let n=0;ni.includes(e))),o&&t&&e(o)}if(document.querySelector(".new-navbar_component")){let e=function(){document.body.classList.add("disable-scroll")},o=function(){document.body.classList.remove("disable-scroll")};const n=document.querySelector(".new-navbar_component");n.addEventListener("mouseenter",(()=>{window.innerWidth>991&&e()})),n.addEventListener("mouseleave",(()=>{window.innerWidth>991&&o()}))}window.getClientCountry();const oe=window.parseCookies(document.cookie,"webflow-user-language"),ne=["as","au","at","be","bg","ca","hr","cy","cz","dk","ee","fi","fr","gr","gu","gg","hk","hu","ir","ie","im","il","it","je","ng","mm","sy","kp","lv","lt","lu","my","mt","nl","nz","mp","py","pl","pt","pr","ro","rw","sk","si","es","se","ae","gb","us","um","vu","vi","ky","cu","de"];if(window.location.pathname.endsWith("p2p")&&!window.location.pathname.startsWith("/blog")){const e=window.getClientCountry();e&&ne.includes(e)&&("en"===oe?window.location.replace("/404"):window.location.replace(`/${oe}/404`))}if(void 0!==window.parseCookies(document.cookie,"client_information")){let e=function(e){e.forEach((e=>{e.href="https://app.deriv.com/appstore/traders-hub"}))},o=document.querySelectorAll("a.live-markets_button.is-secondary.is-small.is-purchase.w-button"),n=document.querySelectorAll("a.live-markets_button.is-secondary.is-small.is-sell.w-button");e(o),e(n)}document.getElementById("mobile-menu"),document.getElementById("live_chat-wrapper");const ie=()=>{window.LC_API&&window.LC_API.open_chat_window&&window.LC_API.open_chat_window()},te=()=>{"true"===new URLSearchParams(window.location.search).get("is_livechat_open")&&ie()},ae=e=>{var o;null==(o=null==window?void 0:window.LiveChatWidget)||o.on("ready",(()=>{window.LC_API.open_chat_window(),window.LC_API.hide_chat_window(),te();const o=window.parseCookies(document.cookie,"utm_data"),n=o?JSON.parse(o):{},{utm_source:i,utm_medium:t,utm_campaign:a}=n,r=window.parseCookies(document.cookie,"client_information"),d=new URLSearchParams(window.location.search),{loginid:c,email:s,landing_company_shortcode:l,currency:u,residence:p,first_name:w,last_name:h}=r?JSON.parse(r):{},m={is_logged_in:e,loginid:c??"",landing_company_shortcode:l??"",currency:u??"",residence:p??"",email:s??"",platform:d.get("platform")??"",utm_source:i??"",utm_medium:t??"",utm_campaign:a??""};window.LiveChatWidget.call("set_session_variables",m),e?(s&&window.LiveChatWidget.call("set_customer_email",s),w&&h&&window.LiveChatWidget.call("set_customer_name",`${w} ${h}`)):window.LC_API.on_chat_ended=()=>{window.LiveChatWidget.call("set_customer_email"," "),window.LiveChatWidget.call("set_customer_name"," ")},te(),window.LiveChatWidget.on("new_event",(e=>{e.greeting&&window.LC_API.open_chat_window()}))}))};let re=!1;const de=()=>{const e=!!window.parseCookies(document.cookie,"client_information");e!==re&&(ae(e),re=e)};de(),setInterval(de,2e3),(()=>{if(window.__lc=window.__lc||{},window.__lc.license="12049137",window.LC_API=window.LC_API||{loaded:!1},window.LC_API.loaded)te();else{const e=document.createElement("script");e.async=!0,e.src="https://cdn.livechatinc.com/tracking.js",e.onload=()=>{window.LC_API.loaded=!0,window.LC_API.on_after_load=function(){ae(!!window.parseCookies(document.cookie,"client_information")),te()},"undefined"!=typeof LiveChatWidget&&LiveChatWidget.init&&LiveChatWidget.init()},document.body.appendChild(e)}})();const ce=document.querySelectorAll(".livechatbtn");ce.length>0&&ce.forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault(),ie()}))}));const se=document.getElementById("liveChatBtn");se&&se.addEventListener("click",(e=>{e.preventDefault(),ie()}));document.querySelectorAll('a[rel="liveChatBtn"]').forEach((e=>{null==e||e.addEventListener("click",(e=>{e.preventDefault(),ie()}))}));let le=document.querySelector(".navbar_menu-button");le&&le.addEventListener("click",(function(){let e=window.innerHeight,o=document.querySelector(".new-navbar_main-wrapper");if(o){let n=e-o.offsetHeight,i=document.querySelector(".new-navbar_menu");i&&(i.style.height=`${n}px`)}}));let ue=document.querySelector(".lang-mob");ue&&ue.addEventListener("click",(function(){let e=document.querySelector(".new-navbar_menu-wrapper");e&&e.scrollBy({top:-3e3})}));class pe{constructor(e){this.cookieName=e}setItem(e){const o=new Date;o.setDate(o.getDate()+30);const n="expires="+o.toUTCString(),i=encodeURIComponent(JSON.stringify(e));document.cookie=`${this.cookieName}=${i};${n};path=/`}getItem(){const e=document.cookie.split(";");for(let o=0;ove.includes(e)))&&document.head.querySelectorAll("link").forEach((function(e){e.hasAttribute("hreflang")&&"x-default"!==e.getAttribute("hreflang")&&e.remove()}));const Ye=e=>{window.rudderanalytics?window.rudderanalytics.track(e.name,e.properties):(e=>{let o=[],n=parseCookies(document.cookie,"cached_analytics_events");n&&(o=JSON.parse(n)),o.push(e),document.cookie=`cached_analytics_events=${JSON.stringify(o)}; path=/; Domain=.deriv.com`})(e)};window.addClickListener=function(e,o,n){e&&e.addEventListener("click",(function(){Ye({name:o,properties:n})}))};var _e=null==document?void 0:document.getElementsByClassName("livechatbtn"),Ae=null==document?void 0:document.getElementsByClassName("whatsapp_chat"),be=null==document?void 0:document.getElementsByClassName("tradershub-btn"),ke=document.querySelectorAll(".btn-free-demo .w-button"),Le=document.querySelectorAll('.btn-free-demo [data-class="w-button"]');const Se=document.querySelectorAll('[data-attributes="btn-primary-nav"]'),Ee=document.querySelectorAll('[data-attributes="btn-secondary-nav"]');_e&&Array.from(_e).forEach((e=>{window.addClickListener(e,"ce_widget_usage_form",{action:"click",widget_name:"livechat"})})),Ae&&Array.from(Ae).forEach((e=>{window.addClickListener(e,"ce_widget_usage_form",{action:"click",widget_name:"whatsapp"})})),be&&Array.from(be).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Traders Hub"})})),ke&&Array.from(ke).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),Le&&Array.from(Le).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),Se&&Array.from(Se).forEach((e=>{e.classList.contains("tradershub-btn")||window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Try free demo"})})),Ee&&Array.from(Ee).forEach((e=>{window.addClickListener(e,"ce_cta_clicks",{action:"click",cta_name:"Login"})}));var Ce,qe,Ie;"deriv.com"===window.location.hostname||"deriv.be"===window.location.hostname||"deriv.me"===window.location.hostname?(Ce="sdk-UhZV3cNEg5nLNLNS",Ie="nre64BV0dNIa44zW4tz5ow==",qe="1oV5agvlcnCZ6IH94wCKM1oR8Pd"):(Ce="sdk-9wuqJ1mlcQsSyZQ",Ie="",qe="1lN3tsFD2nruGFgM5F074DC2hMB");const ze=(Ne=window.parseCookies(document.cookie,"client_information"))?JSON.parse(Ne):null,xe=window.parseCookies(document.cookie,"utm_data"),je=xe?JSON.parse(xe):{},Oe=window.parseCookies(document.cookie,"signup_device");let $e=null;Oe&&($e=(null==(e=JSON.parse(Oe))?void 0:e.signup_device)||null);const Be={growthbookKey:Ce,growthbookDecryptionKey:Ie,rudderstackKey:qe,growthbookOptions:{navigate:e=>window.location.replace(e),antiFlicker:!1,navigateDelay:0,attributes:{country:window.parseCookies(document.cookie,"clients_country")||window.parseCookies(document.cookie,"website_status"),user_language:window.parseCookies(document.cookie,"user_language")||("undefined"!=typeof window?localStorage.getItem("i18n")||navigator.language:null),device_language:window.parseCookies(document.cookie,"language")||" ",device_type:$e,utm_source:null==je?void 0:je.utm_source,utm_medium:null==je?void 0:je.utm_medium,utm_campaign:null==je?void 0:je.utm_campaign,is_authorised:!!window.parseCookies(document.cookie,"client_information"),loggedIn:!!window.parseCookies(document.cookie,"client_information"),url:window.location.href}}};try{null==Analytics||Analytics.Analytics.initialise(Be);const e=(null==ze?void 0:ze.user_id)?null==ze?void 0:ze.user_id:null==(i=null==(n=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getInstances)?void 0:n.call(o).tracking)?void 0:i.getAnonymousId();null==(t=null==Analytics?void 0:Analytics.Analytics)||t.identifyEvent(e)}catch(Pe){}null==(a=null==Analytics?void 0:Analytics.Analytics)||a.pageView(location.pathname,"Deriv.com"),window.useGrowthbookFeatureFlag=function({featureFlag:e}){var o,n,i,t,a;let r=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getFeatureValue(e);return null==(a=null==(t=null==(i=null==(n=null==Analytics?void 0:Analytics.Analytics)?void 0:n.getInstances())?void 0:i.ab)?void 0:t.GrowthBook)||a.setRenderer((function(){var o;const n=null==(o=null==Analytics?void 0:Analytics.Analytics)?void 0:o.getFeatureValue(e);r=n})),r};const De=window.parseCookies(document.cookie,"client_information")?JSON.parse(window.parseCookies(document.cookie,"client_information")):null;(null==De?void 0:De.loginid)&&(null==window||window.hj("identify",De.loginid,{is_logged_in:!!window.parseCookies(document.cookie,"client_information"),landing_company_shortcode:De.landing_company_shortcode||"null"}));null==(s=null==(c=null==(d=null==(r=null==Analytics?void 0:Analytics.Analytics)?void 0:r.getInstances())?void 0:d.ab)?void 0:c.GrowthBook)||s.loadFeatures().then((()=>{window.location.href.indexOf("/partners")>-1==!1&&(()=>{var e;const o=(null==(e=null==Analytics?void 0:Analytics.Analytics)?void 0:e.getFeatureValue("trigger_os_signup_wf"))?function(){const e=navigator.userAgent.toLowerCase();return/ipad|iphone|ipod/.test(e)}()||function(){const e=navigator.userAgent.toLowerCase();return/safari/.test(e)&&!/chrome/.test(e)&&!/crios/.test(e)}()?`https://${window.location.host}/signup`:(()=>{const e=window.location.hostname;let o;switch(o="deriv.com"===e||"deriv.be"===e||"deriv.me"===e?"production":"staging.deriv.com"===e?"staging":"development",o){case"production":return"https://hub.deriv.com/tradershub/signup";case"staging":return"https://staging-hub.deriv.com/tradershub/signup";default:return"https://dev-hub.deriv.com/tradershub/signup"}})():`https://${window.location.host}/signup`,n=document.getElementById("cta-home-btn-navbar");n&&(n.href=o);const i=document.querySelectorAll(".logged-out-btn");null==i||i.forEach((e=>{var n;(null==(n=null==e?void 0:e.href)?void 0:n.indexOf("/signup"))>0&&(e.href=o)}));const t=document.querySelectorAll(".logged-out-btn a");null==t||t.forEach((e=>{var n;(null==(n=null==e?void 0:e.href)?void 0:n.indexOf("/signup"))>0&&(e.href=o)}))})()})); diff --git a/vite.config.js b/vite.config.js index e88d002..c9c48e9 100644 --- a/vite.config.js +++ b/vite.config.js @@ -13,6 +13,7 @@ export default defineConfig({ input: { head_scripts: resolve(__dirname, "src/js/head/index.js"), footer_scripts: resolve(__dirname, "src/js/footer/index.js"), + experiment_scripts: resolve(__dirname, "src/js/experiment/index.js"), styles: resolve(__dirname, "src/css/index.css"), }, output: {