From bd7971aca9b7787adb306cd1b3c71287679ff4ec Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Thu, 17 Feb 2022 19:32:34 +0800 Subject: [PATCH 1/5] MDL-73915 js: Upgrade node-sass --- npm-shrinkwrap.json | 1573 ++++++++++++++++++++++++++++--------------- package.json | 2 +- 2 files changed, 1018 insertions(+), 557 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index aeeacc6a744..01dc5af838a 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -2456,6 +2456,12 @@ "to-fast-properties": "^2.0.0" } }, + "@gar/promisify": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", + "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==", + "dev": true + }, "@nodelib/fs.scandir": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", @@ -2482,6 +2488,54 @@ "fastq": "^1.6.0" } }, + "@npmcli/fs": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-1.1.1.tgz", + "integrity": "sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==", + "dev": true, + "requires": { + "@gar/promisify": "^1.0.1", + "semver": "^7.3.5" + }, + "dependencies": { + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, + "@npmcli/move-file": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz", + "integrity": "sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==", + "dev": true, + "requires": { + "mkdirp": "^1.0.4", + "rimraf": "^3.0.2" + }, + "dependencies": { + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, "@protobufjs/aspromise": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", @@ -2619,6 +2673,12 @@ } } }, + "@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "dev": true + }, "@types/color-name": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", @@ -2694,6 +2754,36 @@ "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", "dev": true }, + "agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "requires": { + "debug": "4" + } + }, + "agentkeepalive": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.2.0.tgz", + "integrity": "sha512-0PhAp58jZNw13UJv7NVdTGb0ZcghHUb3DrZ046JiiJY/BOaTTpbwdHq2VObPCBV8M2GPh7sgrJ3AQ8Ey468LJw==", + "dev": true, + "requires": { + "debug": "^4.1.0", + "depd": "^1.1.2", + "humanize-ms": "^1.2.1" + } + }, + "aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, "ajv": { "version": "6.12.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz", @@ -2748,19 +2838,19 @@ "dev": true }, "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", "dev": true }, "are-we-there-yet": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.0.tgz", + "integrity": "sha512-0GWpv50YSOcLXaN6/FAKY3vfRbllXWV2xvfA/oKJF8pzFhWXPV+yjhJXDBbjscDYowv7Yw1A3uigpzn5iEGTyw==", "dev": true, "requires": { "delegates": "^1.0.0", - "readable-stream": "^2.0.6" + "readable-stream": "^3.6.0" } }, "argparse": { @@ -2778,12 +2868,6 @@ "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=", "dev": true }, - "array-find-index": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", - "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", - "dev": true - }, "array-slice": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz", @@ -2803,9 +2887,9 @@ "dev": true }, "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", + "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", "dev": true, "requires": { "safer-buffer": "~2.1.0" @@ -2863,9 +2947,9 @@ "dev": true }, "aws4": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.1.tgz", - "integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", "dev": true }, "babel-eslint": { @@ -3205,15 +3289,6 @@ "tweetnacl": "^0.14.3" } }, - "block-stream": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", - "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", - "dev": true, - "requires": { - "inherits": "~2.0.0" - } - }, "body": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/body/-/body-5.1.0.tgz", @@ -3309,6 +3384,49 @@ "integrity": "sha1-NWnt6Lo0MV+rmcPpLLBMciDeH6g=", "dev": true }, + "cacache": { + "version": "15.3.0", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz", + "integrity": "sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==", + "dev": true, + "requires": { + "@npmcli/fs": "^1.0.0", + "@npmcli/move-file": "^1.0.1", + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "glob": "^7.1.4", + "infer-owner": "^1.0.4", + "lru-cache": "^6.0.0", + "minipass": "^3.1.1", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.2", + "mkdirp": "^1.0.3", + "p-map": "^4.0.0", + "promise-inflight": "^1.0.1", + "rimraf": "^3.0.2", + "ssri": "^8.0.1", + "tar": "^6.0.2", + "unique-filename": "^1.1.1" + }, + "dependencies": { + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -3316,19 +3434,28 @@ "dev": true }, "camelcase": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", - "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true }, "camelcase-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", - "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", + "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", "dev": true, "requires": { - "camelcase": "^2.0.0", - "map-obj": "^1.0.0" + "camelcase": "^5.3.1", + "map-obj": "^4.0.0", + "quick-lru": "^4.0.1" + }, + "dependencies": { + "map-obj": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", + "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", + "dev": true + } } }, "caniuse-lite": { @@ -3398,6 +3525,12 @@ "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, + "chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "dev": true + }, "clean-css": { "version": "2.2.23", "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-2.2.23.tgz", @@ -3417,6 +3550,12 @@ } } }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true + }, "cli": { "version": "0.6.6", "resolved": "https://registry.npmjs.org/cli/-/cli-0.6.6.tgz", @@ -3470,6 +3609,17 @@ "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", "dev": true }, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, "clone-regexp": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clone-regexp/-/clone-regexp-2.2.0.tgz", @@ -3479,12 +3629,6 @@ "is-regexp": "^2.0.0" } }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true - }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -3500,6 +3644,12 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "dev": true + }, "colorette": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz", @@ -3748,15 +3898,6 @@ "uuid": "^3.3.3" } }, - "currently-unhandled": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", - "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", - "dev": true, - "requires": { - "array-find-index": "^1.0.1" - } - }, "dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", @@ -3830,6 +3971,12 @@ "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "dev": true }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true + }, "detect-file": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", @@ -3927,12 +4074,46 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, + "encoding": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", + "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "dev": true, + "optional": true, + "requires": { + "iconv-lite": "^0.6.2" + }, + "dependencies": { + "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, + "optional": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } + } + } + }, "entities": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=", "dev": true }, + "env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "dev": true + }, + "err-code": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", + "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", + "dev": true + }, "error": { "version": "7.2.1", "resolved": "https://registry.npmjs.org/error/-/error-7.2.1.tgz", @@ -4324,13 +4505,13 @@ } }, "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" } }, "findup-sync": { @@ -4425,24 +4606,21 @@ "mime-types": "^2.1.12" } }, + "fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dev": true, + "requires": { + "minipass": "^3.0.0" + } + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, - "fstream": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", - "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "inherits": "~2.0.0", - "mkdirp": ">=0.5 0", - "rimraf": "2" - } - }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -4456,49 +4634,27 @@ "dev": true }, "gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.1.tgz", + "integrity": "sha512-zJ4jePUHR8cceduZ53b6temRalyGpkC2Kc2r3ecNphmL+uWNoJ3YcOcUjpbG6WwoE/Ef6/+aEZz63neI2WIa1Q==", "dev": true, "requires": { - "aproba": "^1.0.3", + "ansi-regex": "^5.0.1", + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", + "has-unicode": "^2.0.1", "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" }, "dependencies": { - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true } } }, @@ -4664,9 +4820,9 @@ "dev": true }, "get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, "get-stdin": { @@ -4838,9 +4994,9 @@ } }, "graceful-fs": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", - "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", + "version": "4.2.9", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", + "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==", "dev": true }, "grunt": { @@ -5206,13 +5362,27 @@ "dev": true }, "har-validator": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", "dev": true, "requires": { - "ajv": "^6.5.5", + "ajv": "^6.12.3", "har-schema": "^2.0.0" + }, + "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + } } }, "hard-rejection": { @@ -5343,12 +5513,29 @@ } } }, + "http-cache-semantics": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", + "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", + "dev": true + }, "http-parser-js": { "version": "0.4.10", "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.4.10.tgz", "integrity": "sha1-ksnBN0w1CF912zWexWzCV8u5P6Q=", "dev": true }, + "http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "dev": true, + "requires": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + } + }, "http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", @@ -5360,6 +5547,25 @@ "sshpk": "^1.7.0" } }, + "https-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", + "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "dev": true, + "requires": { + "agent-base": "6", + "debug": "4" + } + }, + "humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=", + "dev": true, + "requires": { + "ms": "^2.0.0" + } + }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -5397,20 +5603,11 @@ "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", "dev": true }, - "in-publish": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/in-publish/-/in-publish-2.0.1.tgz", - "integrity": "sha512-oDM0kUSNFC31ShNxHKUyfZKy8ZeXZBWMjMdZHKLOk13uvT27VTL/QzRGfRUcevJhpkZAvlhPYuXkF7eNWrtyxQ==", - "dev": true - }, "indent-string": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", - "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", - "dev": true, - "requires": { - "repeating": "^2.0.0" - } + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true }, "indexes-of": { "version": "1.0.1", @@ -5418,6 +5615,12 @@ "integrity": "sha1-8w9xbI4r00bHtn0985FVZqfAVgc=", "dev": true }, + "infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "dev": true + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -5566,10 +5769,10 @@ "loose-envify": "^1.0.0" } }, - "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "ip": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", + "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=", "dev": true }, "is-absolute": { @@ -5631,15 +5834,6 @@ "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true }, - "is-finite": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", - "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", @@ -5661,6 +5855,12 @@ "integrity": "sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==", "dev": true }, + "is-lambda": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", + "integrity": "sha1-PZh3iZ5qU+/AFgUEzeFfgubwYdU=", + "dev": true + }, "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -5718,12 +5918,6 @@ "unc-path-regex": "^0.1.2" } }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", - "dev": true - }, "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", @@ -5861,9 +6055,9 @@ } }, "js-base64": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.5.1.tgz", - "integrity": "sha512-M7kLczedRMYX4L8Mdh4MzyAMM9O5osx+4FcOQuTvr3A9F2D9S5JXheN0ewNbrvK2UatkTRhL5ejGmGSjNMiZuw==", + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.6.4.tgz", + "integrity": "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==", "dev": true }, "js-tokens": { @@ -5984,10 +6178,16 @@ "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "dev": true }, + "json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", "dev": true }, "json-schema-traverse": { @@ -6026,14 +6226,14 @@ } }, "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", + "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", "dev": true, "requires": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", - "json-schema": "0.2.3", + "json-schema": "0.4.0", "verror": "1.10.0" } }, @@ -6069,15 +6269,6 @@ } } }, - "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "dev": true, - "requires": { - "invert-kv": "^1.0.0" - } - }, "less": { "version": "1.7.5", "resolved": "https://registry.npmjs.org/less/-/less-1.7.5.tgz", @@ -6331,17 +6522,13 @@ "integrity": "sha512-XPQH8Z2GDP/Hwz2PCDrh2mth4yFejwA1OZ/81Ti3LgKyhDcEjsSsqFWZojHG0va/duGd+WyosY7eXLDoOyqcPw==", "dev": true }, - "load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" + "p-locate": "^4.1.0" } }, "lodash": { @@ -6380,24 +6567,37 @@ "js-tokens": "^3.0.0 || ^4.0.0" } }, - "loud-rejection": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", - "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "requires": { - "currently-unhandled": "^0.4.1", - "signal-exit": "^3.0.0" + "yallist": "^4.0.0" } }, - "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "make-fetch-happen": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz", + "integrity": "sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==", "dev": true, "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" + "agentkeepalive": "^4.1.3", + "cacache": "^15.2.0", + "http-cache-semantics": "^4.1.0", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^6.0.0", + "minipass": "^3.1.3", + "minipass-collect": "^1.0.2", + "minipass-fetch": "^1.3.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.2", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^6.0.0", + "ssri": "^8.0.0" } }, "make-iterator": { @@ -6513,27 +6713,76 @@ "dev": true }, "meow": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", - "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-9.0.0.tgz", + "integrity": "sha512-+obSblOQmRhcyBt62furQqRAQpNyWXo8BuQ5bN7dG8wmwQ+vwHKp/rCFD4CrTP8CsDQD1sjoZ94K417XEUk8IQ==", "dev": true, "requires": { - "camelcase-keys": "^2.0.0", - "decamelize": "^1.1.2", - "loud-rejection": "^1.0.0", - "map-obj": "^1.0.1", - "minimist": "^1.1.3", - "normalize-package-data": "^2.3.4", - "object-assign": "^4.0.1", - "read-pkg-up": "^1.0.1", - "redent": "^1.0.0", - "trim-newlines": "^1.0.0" + "@types/minimist": "^1.2.0", + "camelcase-keys": "^6.2.2", + "decamelize": "^1.2.0", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "4.1.0", + "normalize-package-data": "^3.0.0", + "read-pkg-up": "^7.0.1", + "redent": "^3.0.0", + "trim-newlines": "^3.0.0", + "type-fest": "^0.18.0", + "yargs-parser": "^20.2.3" }, "dependencies": { - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "hosted-git-info": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true + }, + "minimist-options": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" + } + }, + "normalize-package-data": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", + "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", + "dev": true, + "requires": { + "hosted-git-info": "^4.0.1", + "is-core-module": "^2.5.0", + "semver": "^7.3.4", + "validate-npm-package-license": "^3.0.1" + } + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "type-fest": { + "version": "0.18.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz", + "integrity": "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==", "dev": true } } @@ -6571,18 +6820,18 @@ "dev": true }, "mime-db": { - "version": "1.38.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz", - "integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==", + "version": "1.51.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", + "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==", "dev": true }, "mime-types": { - "version": "2.1.22", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.22.tgz", - "integrity": "sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==", + "version": "2.1.34", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", + "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", "dev": true, "requires": { - "mime-db": "~1.38.0" + "mime-db": "1.51.0" } }, "mimic-fn": { @@ -6624,6 +6873,73 @@ } } }, + "minipass": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.6.tgz", + "integrity": "sha512-rty5kpw9/z8SX9dmxblFA6edItUmwJgMeYDZRrwlIVN27i8gysGbznJwUggw2V/FVqFSDdWy040ZPS811DYAqQ==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "minipass-collect": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", + "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", + "dev": true, + "requires": { + "minipass": "^3.0.0" + } + }, + "minipass-fetch": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz", + "integrity": "sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==", + "dev": true, + "requires": { + "encoding": "^0.1.12", + "minipass": "^3.1.0", + "minipass-sized": "^1.0.3", + "minizlib": "^2.0.0" + } + }, + "minipass-flush": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", + "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "dev": true, + "requires": { + "minipass": "^3.0.0" + } + }, + "minipass-pipeline": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", + "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "dev": true, + "requires": { + "minipass": "^3.0.0" + } + }, + "minipass-sized": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", + "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", + "dev": true, + "requires": { + "minipass": "^3.0.0" + } + }, + "minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dev": true, + "requires": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + } + }, "mkdirp": { "version": "0.5.5", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", @@ -6654,9 +6970,9 @@ "dev": true }, "nan": { - "version": "2.14.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", - "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==", + "version": "2.15.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz", + "integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==", "dev": true }, "natives": { @@ -6672,6 +6988,12 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, + "negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "dev": true + }, "neo-async": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", @@ -6685,30 +7007,70 @@ "dev": true }, "node-gyp": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.8.0.tgz", - "integrity": "sha512-3g8lYefrRRzvGeSowdJKAKyks8oUpLEd/DyPV4eMhVlhJ0aNaZqIrNUIPuEWWTAoPqyFkfGrM67MC69baqn6vA==", + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz", + "integrity": "sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==", "dev": true, "requires": { - "fstream": "^1.0.0", - "glob": "^7.0.3", - "graceful-fs": "^4.1.2", - "mkdirp": "^0.5.0", - "nopt": "2 || 3", - "npmlog": "0 || 1 || 2 || 3 || 4", - "osenv": "0", - "request": "^2.87.0", - "rimraf": "2", - "semver": "~5.3.0", - "tar": "^2.0.0", - "which": "1" + "env-paths": "^2.2.0", + "glob": "^7.1.4", + "graceful-fs": "^4.2.6", + "make-fetch-happen": "^9.1.0", + "nopt": "^5.0.0", + "npmlog": "^6.0.0", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.2", + "which": "^2.0.2" }, "dependencies": { + "nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "dev": true, + "requires": { + "abbrev": "1" + } + }, + "npmlog": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.1.tgz", + "integrity": "sha512-BTHDvY6nrRHuRfyjt1MAufLxYdVXZfd099H4+i1f0lPywNQyI4foeNXJRObB/uy+TYqUW0vAD9gbdSOXPst7Eg==", + "dev": true, + "requires": { + "are-we-there-yet": "^3.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^4.0.0", + "set-blocking": "^2.0.0" + } + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, "semver": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", - "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", - "dev": true + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } } } }, @@ -6719,66 +7081,116 @@ "dev": true }, "node-sass": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.14.0.tgz", - "integrity": "sha512-AxqU+DFpk0lEz95sI6jO0hU0Rwyw7BXVEv6o9OItoXLyeygPeaSpiV4rwQb10JiTghHaa0gZeD21sz+OsQluaw==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-7.0.1.tgz", + "integrity": "sha512-uMy+Xt29NlqKCFdFRZyXKOTqGt+QaKHexv9STj2WeLottnlqZEEWx6Bj0MXNthmFRRdM/YwyNo/8Tr46TOM0jQ==", "dev": true, "requires": { "async-foreach": "^0.1.3", - "chalk": "^1.1.1", - "cross-spawn": "^3.0.0", + "chalk": "^4.1.2", + "cross-spawn": "^7.0.3", "gaze": "^1.0.0", "get-stdin": "^4.0.1", "glob": "^7.0.3", - "in-publish": "^2.0.0", "lodash": "^4.17.15", - "meow": "^3.7.0", - "mkdirp": "^0.5.1", + "meow": "^9.0.0", "nan": "^2.13.2", - "node-gyp": "^3.8.0", - "npmlog": "^4.0.0", + "node-gyp": "^8.4.1", + "npmlog": "^5.0.0", "request": "^2.88.0", - "sass-graph": "^2.2.4", + "sass-graph": "4.0.0", "stdout-stream": "^1.4.0", "true-case-path": "^1.0.2" }, "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" } }, - "cross-spawn": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-3.0.1.tgz", - "integrity": "sha1-ElYDfsufDF9549bvE14wdwGEuYI=", + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "requires": { - "lru-cache": "^4.0.1", - "which": "^1.2.9" + "color-name": "~1.1.4" } }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, "requires": { - "ansi-regex": "^2.0.0" + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" } } } @@ -6825,15 +7237,44 @@ "dev": true }, "npmlog": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", "dev": true, "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" + }, + "dependencies": { + "are-we-there-yet": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "dev": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + } + }, + "gauge": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "dev": true, + "requires": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + } + } } }, "num2fraction": { @@ -6956,15 +7397,6 @@ "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true }, - "os-locale": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", - "dev": true, - "requires": { - "lcid": "^1.0.0" - } - }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", @@ -6981,6 +7413,39 @@ "os-tmpdir": "^1.0.0" } }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, "parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -7016,12 +7481,15 @@ } }, "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", "dev": true, "requires": { - "error-ex": "^1.2.0" + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" } }, "parse-passwd": { @@ -7037,13 +7505,10 @@ "dev": true }, "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "dev": true, - "requires": { - "pinkie-promise": "^2.0.0" - } + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true }, "path-is-absolute": { "version": "1.0.1", @@ -7078,17 +7543,6 @@ "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=", "dev": true }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", @@ -7101,27 +7555,6 @@ "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", "dev": true }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", - "dev": true - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "dev": true, - "requires": { - "pinkie": "^2.0.0" - } - }, "postcss": { "version": "7.0.36", "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", @@ -7309,9 +7742,9 @@ "dev": true }, "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true }, "progress": { @@ -7320,6 +7753,22 @@ "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true }, + "promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", + "dev": true + }, + "promise-retry": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", + "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", + "dev": true, + "requires": { + "err-code": "^2.0.2", + "retry": "^0.12.0" + } + }, "protobufjs": { "version": "6.11.2", "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.2.tgz", @@ -7341,12 +7790,6 @@ "long": "^4.0.0" } }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", - "dev": true - }, "psl": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", @@ -7390,39 +7833,45 @@ } }, "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", "dev": true, "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "dependencies": { + "type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "dev": true + } } }, "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", "dev": true, "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" } }, "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", "dev": true, "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" } }, "rechoir": { @@ -7435,13 +7884,13 @@ } }, "redent": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", - "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", "dev": true, "requires": { - "indent-string": "^2.1.0", - "strip-indent": "^1.0.1" + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" } }, "regenerate": { @@ -7524,15 +7973,6 @@ "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", "dev": true }, - "repeating": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", - "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", - "dev": true, - "requires": { - "is-finite": "^1.0.0" - } - }, "replace-ext": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", @@ -7568,9 +8008,9 @@ }, "dependencies": { "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", + "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", "dev": true } } @@ -7581,12 +8021,6 @@ "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true }, - "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", - "dev": true - }, "resolve": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", @@ -7648,6 +8082,12 @@ "signal-exit": "^3.0.2" } }, + "retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=", + "dev": true + }, "reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", @@ -7706,91 +8146,37 @@ "dev": true }, "sass-graph": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.4.tgz", - "integrity": "sha1-E/vWPNHK8JCLn9k0dq1DpR0eC0k=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-4.0.0.tgz", + "integrity": "sha512-WSO/MfXqKH7/TS8RdkCX3lVkPFQzCgbqdGsmSKq6tlPU+GpGEsa/5aW18JqItnqh+lPtcjifqdZ/VmiILkKckQ==", "dev": true, "requires": { "glob": "^7.0.0", - "lodash": "^4.0.0", - "scss-tokenizer": "^0.2.3", - "yargs": "^7.0.0" + "lodash": "^4.17.11", + "scss-tokenizer": "^0.3.0", + "yargs": "^17.2.1" }, "dependencies": { - "camelcase": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", - "dev": true - }, - "cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", - "dev": true, - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wrap-ansi": "^2.0.0" - } - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, "yargs": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", - "integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=", + "version": "17.3.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.3.1.tgz", + "integrity": "sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA==", "dev": true, "requires": { - "camelcase": "^3.0.0", - "cliui": "^3.2.0", - "decamelize": "^1.1.1", - "get-caller-file": "^1.0.1", - "os-locale": "^1.4.0", - "read-pkg-up": "^1.0.1", + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^1.0.2", - "which-module": "^1.0.0", - "y18n": "^3.2.1", - "yargs-parser": "^5.0.0" - }, - "dependencies": { - "y18n": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz", - "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==", - "dev": true - } + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.0.0" } + }, + "yargs-parser": { + "version": "21.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.0.tgz", + "integrity": "sha512-z9kApYUOCwoeZ78rfRYYWdiU/iNL6mwwYlkkZfJoyMR1xps+NEBX5X7XmRpxkZHhXJ6+Ey00IwKxBBSW9FIjyA==", + "dev": true } } }, @@ -7801,23 +8187,20 @@ "dev": true }, "scss-tokenizer": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/scss-tokenizer/-/scss-tokenizer-0.2.3.tgz", - "integrity": "sha1-jrBtualyMzOCTT9VMGQRSYR85dE=", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/scss-tokenizer/-/scss-tokenizer-0.3.0.tgz", + "integrity": "sha512-14Zl9GcbBvOT9057ZKjpz5yPOyUWG2ojd9D5io28wHRYsOrs7U95Q+KNL87+32p8rc+LvDpbu/i9ZYjM9Q+FsQ==", "dev": true, "requires": { - "js-base64": "^2.1.8", - "source-map": "^0.4.2" + "js-base64": "^2.4.3", + "source-map": "^0.7.1" }, "dependencies": { "source-map": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", - "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", - "dev": true, - "requires": { - "amdefine": ">=0.0.4" - } + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "dev": true } } }, @@ -7928,6 +8311,12 @@ } } }, + "smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "dev": true + }, "sntp": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/sntp/-/sntp-0.2.4.tgz", @@ -7938,6 +8327,38 @@ "hoek": "0.9.x" } }, + "socks": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.6.2.tgz", + "integrity": "sha512-zDZhHhZRY9PxRruRMR7kMhnf3I8hDs4S3f9RecfnGxvcBHQcKcIH/oUcEWffsfl1XxdYlA7nnlGbbTvPz9D8gA==", + "dev": true, + "requires": { + "ip": "^1.1.5", + "smart-buffer": "^4.2.0" + } + }, + "socks-proxy-agent": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.1.1.tgz", + "integrity": "sha512-t8J0kG3csjA4g6FTbsMOWws+7R7vuRC8aQ/wy3/1OWmsgwA68zs/+cExQ0koSitUDXqhufF/YJr9wtNMZHw5Ew==", + "dev": true, + "requires": { + "agent-base": "^6.0.2", + "debug": "^4.3.1", + "socks": "^2.6.1" + }, + "dependencies": { + "debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + } + } + }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", @@ -8007,9 +8428,9 @@ "dev": true }, "sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", + "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", "dev": true, "requires": { "asn1": "~0.2.3", @@ -8023,6 +8444,15 @@ "tweetnacl": "~0.14.0" } }, + "ssri": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", + "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", + "dev": true, + "requires": { + "minipass": "^3.1.1" + } + }, "stdout-stream": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/stdout-stream/-/stdout-stream-1.4.1.tgz", @@ -8030,6 +8460,23 @@ "dev": true, "requires": { "readable-stream": "^2.0.1" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + } } }, "stream-counter": { @@ -8074,13 +8521,22 @@ "dev": true }, "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha1-q5Pyeo3BPSjKyBXEYhQ6bZASrp4=", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + } } }, "string_decoder": { @@ -8100,38 +8556,29 @@ "optional": true }, "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "requires": { - "ansi-regex": "^3.0.0" + "ansi-regex": "^5.0.1" }, "dependencies": { "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true } } }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "dev": true, - "requires": { - "is-utf8": "^0.2.0" - } - }, "strip-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", - "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", "dev": true, "requires": { - "get-stdin": "^4.0.1" + "min-indent": "^1.0.0" } }, "strip-json-comments": { @@ -8577,14 +9024,25 @@ } }, "tar": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.2.tgz", - "integrity": "sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==", + "version": "6.1.11", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", + "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", "dev": true, "requires": { - "block-stream": "*", - "fstream": "^1.0.12", - "inherits": "2" + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^3.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "dependencies": { + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + } } }, "text-table": { @@ -8665,9 +9123,9 @@ } }, "trim-newlines": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", - "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", + "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==", "dev": true }, "trough": { @@ -8809,6 +9267,24 @@ "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=", "dev": true }, + "unique-filename": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", + "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "dev": true, + "requires": { + "unique-slug": "^2.0.0" + } + }, + "unique-slug": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", + "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4" + } + }, "unist-util-is": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.0.2.tgz", @@ -8948,19 +9424,13 @@ "isexe": "^2.0.0" } }, - "which-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", - "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", - "dev": true - }, "wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", "dev": true, "requires": { - "string-width": "^1.0.2 || 2" + "string-width": "^1.0.2 || 2 || 3 || 4" } }, "window-size": { @@ -8982,43 +9452,39 @@ "dev": true }, "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" }, "dependencies": { - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "requires": { - "number-is-nan": "^1.0.0" + "color-convert": "^2.0.1" } }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" + "color-name": "~1.1.4" } }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true } } }, @@ -9087,10 +9553,16 @@ "integrity": "sha512-fg03WRxtkCV6ohClePNAECYsmpKKTv5L8y/X3Dn1hQrec3POx2jHZ/0P2qQ6HvsrU1BmeqXcof3NGGueG6LxwQ==", "dev": true }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true + }, "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, "yaml": { @@ -9129,21 +9601,10 @@ } }, "yargs-parser": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0.tgz", - "integrity": "sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo=", - "dev": true, - "requires": { - "camelcase": "^3.0.0" - }, - "dependencies": { - "camelcase": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", - "dev": true - } - } + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true }, "ycssmin": { "version": "1.0.1", diff --git a/package.json b/package.json index 79d6cbd366e..e02f1a6a81f 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "grunt-sass": "3.1.0", "grunt-stylelint": "0.15.0", "jshint": "^2.11.0", - "node-sass": "^4.14.0", + "node-sass": "^7.0.1", "semver": "7.3.2", "shifter": "https://github.com/andrewnicols/shifter/archive/v1.2.0_moodle-0.tar.gz", "stylelint": "13.3.3", From de97a73ede4d2e5b45a657e13617a8b36e732e65 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Fri, 18 Feb 2022 08:07:49 +0800 Subject: [PATCH 2/5] MDL-73915 js: Switch to nodejs lts/gallium --- .nvmrc | 2 +- npm-shrinkwrap.json | 11717 +++++++++++++++++++++++++++++++++++++++++- package.json | 2 +- 3 files changed, 11705 insertions(+), 16 deletions(-) diff --git a/.nvmrc b/.nvmrc index b2d264b67df..53d838af215 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v14.18.0 +lts/gallium diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 01dc5af838a..814e797be4d 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,7 +1,11692 @@ { "name": "Moodle", + "lockfileVersion": 2, "requires": true, - "lockfileVersion": 1, + "packages": { + "": { + "name": "Moodle", + "devDependencies": { + "@babel/core": "7.9.0", + "@babel/plugin-proposal-class-properties": "7.8.3", + "@babel/plugin-proposal-json-strings": "7.8.3", + "@babel/plugin-syntax-dynamic-import": "7.8.3", + "@babel/plugin-syntax-import-meta": "7.8.3", + "@babel/preset-env": "7.9.5", + "ajv": "6.12.2", + "async": "3.2.0", + "babel-eslint": "10.1.0", + "babel-plugin-system-import-transformer": "^4.0.0", + "babel-plugin-transform-es2015-modules-amd-lazy": "2.0.1", + "babel-preset-minify": "0.5.1", + "eslint": "6.8.0", + "eslint-plugin-babel": "5.3.0", + "eslint-plugin-promise": "4.2.1", + "fb-watchman": "2.0.1", + "gherkin-lint": "^4.2.2", + "glob": "7.1.6", + "grunt": "^1.4.1", + "grunt-babel": "8.0.0", + "grunt-contrib-uglify": "4.0.1", + "grunt-contrib-watch": "1.1.0", + "grunt-eslint": "22.0.0", + "grunt-sass": "3.1.0", + "grunt-stylelint": "0.15.0", + "jshint": "^2.11.0", + "node-sass": "^7.0.1", + "semver": "7.3.2", + "shifter": "https://github.com/andrewnicols/shifter/archive/v1.2.0_moodle-0.tar.gz", + "stylelint": "13.3.3", + "stylelint-checkstyle-formatter": "0.1.2", + "stylelint-csstree-validator": "1.8.0", + "xmldom": "^0.6.0", + "xpath": "0.0.27" + }, + "engines": { + "node": ">=16.14.0 <17" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", + "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.0.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.9.0.tgz", + "integrity": "sha512-zeFQrr+284Ekvd9e7KAX954LkapWiOmQtsfHirhxqfdlX6MEC32iRE+pqUGlYIBchdevaCwvzxWGSy/YBNI85g==", + "dev": true, + "dependencies": { + "browserslist": "^4.9.1", + "invariant": "^2.2.4", + "semver": "^5.5.0" + } + }, + "node_modules/@babel/compat-data/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/@babel/core": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.9.0.tgz", + "integrity": "sha512-kWc7L0fw1xwvI0zi8OKVBuxRVefwGOrKSQMvrQ3dW+bIIavBY3/NpXmpjMy7bQnLgwgzWQZ8TlM57YHpHNHz4w==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.8.3", + "@babel/generator": "^7.9.0", + "@babel/helper-module-transforms": "^7.9.0", + "@babel/helpers": "^7.9.0", + "@babel/parser": "^7.9.0", + "@babel/template": "^7.8.6", + "@babel/traverse": "^7.9.0", + "@babel/types": "^7.9.0", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.1", + "json5": "^2.1.2", + "lodash": "^4.17.13", + "resolve": "^1.3.2", + "semver": "^5.4.1", + "source-map": "^0.5.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/@babel/code-frame": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", + "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.8.3" + } + }, + "node_modules/@babel/core/node_modules/@babel/helper-module-imports": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.8.3.tgz", + "integrity": "sha512-R0Bx3jippsbAEtzkpZ/6FIiuzOURPcMjHp+Z6xPe6DtApDJx+w7UYyOLanZqO8+wKR9G10s/FmHXvxaMd9s6Kg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.8.3" + } + }, + "node_modules/@babel/core/node_modules/@babel/helper-module-transforms": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.9.0.tgz", + "integrity": "sha512-0FvKyu0gpPfIQ8EkxlrAydOWROdHpBmiCiRwLkUiBGhCUPRRbVD2/tm3sFr/c/GWFrQ/ffutGUAnx7V0FzT2wA==", + "dev": true, + "dependencies": { + "@babel/helper-module-imports": "^7.8.3", + "@babel/helper-replace-supers": "^7.8.6", + "@babel/helper-simple-access": "^7.8.3", + "@babel/helper-split-export-declaration": "^7.8.3", + "@babel/template": "^7.8.6", + "@babel/types": "^7.9.0", + "lodash": "^4.17.13" + } + }, + "node_modules/@babel/core/node_modules/@babel/helper-simple-access": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.8.3.tgz", + "integrity": "sha512-VNGUDjx5cCWg4vvCTR8qQ7YJYZ+HBjxOgXEl7ounz+4Sn7+LMD3CFrCTEU6/qXKbA2nKg21CwhhBzO0RpRbdCw==", + "dev": true, + "dependencies": { + "@babel/template": "^7.8.3", + "@babel/types": "^7.8.3" + } + }, + "node_modules/@babel/core/node_modules/@babel/helper-split-export-declaration": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", + "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.8.3" + } + }, + "node_modules/@babel/core/node_modules/@babel/highlight": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", + "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "node_modules/@babel/core/node_modules/@babel/parser": { + "version": "7.9.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz", + "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/core/node_modules/@babel/template": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz", + "integrity": "sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.8.3", + "@babel/parser": "^7.8.6", + "@babel/types": "^7.8.6" + } + }, + "node_modules/@babel/core/node_modules/@babel/types": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", + "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.5", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/core/node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/@babel/core/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/@babel/generator": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.9.5.tgz", + "integrity": "sha512-GbNIxVB3ZJe3tLeDm1HSn2AhuD/mVcyLDpgtLXa5tplmWrJdF/elxB56XNqCuD6szyNkDi6wuoKXln3QeBmCHQ==", + "dev": true, + "dependencies": { + "@babel/types": "^7.9.5", + "jsesc": "^2.5.1", + "lodash": "^4.17.13", + "source-map": "^0.5.0" + } + }, + "node_modules/@babel/generator/node_modules/@babel/types": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", + "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.5", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/generator/node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/@babel/helper-annotate-as-pure": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.8.3.tgz", + "integrity": "sha512-6o+mJrZBxOoEX77Ezv9zwW7WV8DdluouRKNY/IR5u/YTMuKHgugHOzYWlYvYLpLA9nPsQCAAASpCIbjI9Mv+Uw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.8.3" + } + }, + "node_modules/@babel/helper-annotate-as-pure/node_modules/@babel/types": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", + "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.5", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/helper-annotate-as-pure/node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/@babel/helper-builder-binary-assignment-operator-visitor": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.8.3.tgz", + "integrity": "sha512-5eFOm2SyFPK4Rh3XMMRDjN7lBH0orh3ss0g3rTYZnBQ+r6YPj7lgDyCvPphynHvUrobJmeMignBr6Acw9mAPlw==", + "dev": true, + "dependencies": { + "@babel/helper-explode-assignable-expression": "^7.8.3", + "@babel/types": "^7.8.3" + } + }, + "node_modules/@babel/helper-builder-binary-assignment-operator-visitor/node_modules/@babel/types": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", + "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.5", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/helper-builder-binary-assignment-operator-visitor/node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.8.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.8.7.tgz", + "integrity": "sha512-4mWm8DCK2LugIS+p1yArqvG1Pf162upsIsjE7cNBjez+NjliQpVhj20obE520nao0o14DaTnFJv+Fw5a0JpoUw==", + "dev": true, + "dependencies": { + "@babel/compat-data": "^7.8.6", + "browserslist": "^4.9.1", + "invariant": "^2.2.4", + "levenary": "^1.1.1", + "semver": "^5.5.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/@babel/helper-create-class-features-plugin": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.9.5.tgz", + "integrity": "sha512-IipaxGaQmW4TfWoXdqjY0TzoXQ1HRS0kPpEgvjosb3u7Uedcq297xFqDQiCcQtRRwzIMif+N1MLVI8C5a4/PAA==", + "dev": true, + "dependencies": { + "@babel/helper-function-name": "^7.9.5", + "@babel/helper-member-expression-to-functions": "^7.8.3", + "@babel/helper-optimise-call-expression": "^7.8.3", + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/helper-replace-supers": "^7.8.6", + "@babel/helper-split-export-declaration": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/helper-split-export-declaration": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", + "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.8.3" + } + }, + "node_modules/@babel/helper-create-class-features-plugin/node_modules/@babel/types": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", + "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.5", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/helper-create-class-features-plugin/node_modules/lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, + "node_modules/@babel/helper-create-regexp-features-plugin": { + "version": "7.8.8", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.8.8.tgz", + "integrity": "sha512-LYVPdwkrQEiX9+1R29Ld/wTrmQu1SSKYnuOk3g0CkcZMA1p0gsNxJFj/3gBdaJ7Cg0Fnek5z0DsMULePP7Lrqg==", + "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.8.3", + "@babel/helper-regex": "^7.8.3", + "regexpu-core": "^4.7.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-define-map": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.8.3.tgz", + "integrity": "sha512-PoeBYtxoZGtct3md6xZOCWPcKuMuk3IHhgxsRRNtnNShebf4C8YonTSblsK4tvDbm+eJAw2HAPOfCr+Q/YRG/g==", + "dev": true, + "dependencies": { + "@babel/helper-function-name": "^7.8.3", + "@babel/types": "^7.8.3", + "lodash": "^4.17.13" + } + }, + "node_modules/@babel/helper-define-map/node_modules/@babel/types": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", + "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.5", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/helper-define-map/node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/@babel/helper-explode-assignable-expression": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.8.3.tgz", + "integrity": "sha512-N+8eW86/Kj147bO9G2uclsg5pwfs/fqqY5rwgIL7eTBklgXjcOJ3btzS5iM6AitJcftnY7pm2lGsrJVYLGjzIw==", + "dev": true, + "dependencies": { + "@babel/traverse": "^7.8.3", + "@babel/types": "^7.8.3" + } + }, + "node_modules/@babel/helper-explode-assignable-expression/node_modules/@babel/types": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", + "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.5", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/helper-explode-assignable-expression/node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/@babel/helper-function-name": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.9.5.tgz", + "integrity": "sha512-JVcQZeXM59Cd1qanDUxv9fgJpt3NeKUaqBqUEvfmQ+BCOKq2xUgaWZW2hr0dkbyJgezYuplEoh5knmrnS68efw==", + "dev": true, + "dependencies": { + "@babel/helper-get-function-arity": "^7.8.3", + "@babel/template": "^7.8.3", + "@babel/types": "^7.9.5" + } + }, + "node_modules/@babel/helper-function-name/node_modules/@babel/code-frame": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", + "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.8.3" + } + }, + "node_modules/@babel/helper-function-name/node_modules/@babel/highlight": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", + "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "node_modules/@babel/helper-function-name/node_modules/@babel/parser": { + "version": "7.9.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz", + "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/helper-function-name/node_modules/@babel/template": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz", + "integrity": "sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.8.3", + "@babel/parser": "^7.8.6", + "@babel/types": "^7.8.6" + } + }, + "node_modules/@babel/helper-function-name/node_modules/@babel/types": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", + "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.5", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/helper-function-name/node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/@babel/helper-get-function-arity": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz", + "integrity": "sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.8.3" + } + }, + "node_modules/@babel/helper-get-function-arity/node_modules/@babel/types": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", + "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.5", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/helper-get-function-arity/node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/@babel/helper-hoist-variables": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.8.3.tgz", + "integrity": "sha512-ky1JLOjcDUtSc+xkt0xhYff7Z6ILTAHKmZLHPxAhOP0Nd77O+3nCsd6uSVYur6nJnCI029CrNbYlc0LoPfAPQg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.8.3" + } + }, + "node_modules/@babel/helper-hoist-variables/node_modules/@babel/types": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", + "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.5", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/helper-hoist-variables/node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/@babel/helper-member-expression-to-functions": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.8.3.tgz", + "integrity": "sha512-fO4Egq88utkQFjbPrSHGmGLFqmrshs11d46WI+WZDESt7Wu7wN2G2Iu+NMMZJFDOVRHAMIkB5SNh30NtwCA7RA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.8.3" + } + }, + "node_modules/@babel/helper-member-expression-to-functions/node_modules/@babel/types": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", + "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.5", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/helper-member-expression-to-functions/node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.0.0.tgz", + "integrity": "sha512-aP/hlLq01DWNEiDg4Jn23i+CXxW/owM4WpDLFUbpjxe4NS3BhLVZQ5i7E0ZrxuQ/vwekIeciyamgB1UIYxxM6A==", + "dev": true, + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.4.4.tgz", + "integrity": "sha512-3Z1yp8TVQf+B4ynN7WoHPKS8EkdTbgAEy0nU0rs/1Kw4pDgmvYH3rz3aI11KgxKCba2cn7N+tqzV1mY2HMN96w==", + "dev": true, + "dependencies": { + "@babel/helper-module-imports": "^7.0.0", + "@babel/helper-simple-access": "^7.1.0", + "@babel/helper-split-export-declaration": "^7.4.4", + "@babel/template": "^7.4.4", + "@babel/types": "^7.4.4", + "lodash": "^4.17.11" + } + }, + "node_modules/@babel/helper-optimise-call-expression": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.8.3.tgz", + "integrity": "sha512-Kag20n86cbO2AvHca6EJsvqAd82gc6VMGule4HwebwMlwkpXuVqrNRj6CkCV2sKxgi9MyAUnZVnZ6lJ1/vKhHQ==", + "dev": true, + "dependencies": { + "@babel/types": "^7.8.3" + } + }, + "node_modules/@babel/helper-optimise-call-expression/node_modules/@babel/types": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", + "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.5", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/helper-optimise-call-expression/node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz", + "integrity": "sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA==", + "dev": true + }, + "node_modules/@babel/helper-regex": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.8.3.tgz", + "integrity": "sha512-BWt0QtYv/cg/NecOAZMdcn/waj/5P26DR4mVLXfFtDokSR6fyuG0Pj+e2FqtSME+MqED1khnSMulkmGl8qWiUQ==", + "dev": true, + "dependencies": { + "lodash": "^4.17.13" + } + }, + "node_modules/@babel/helper-regex/node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/@babel/helper-remap-async-to-generator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.8.3.tgz", + "integrity": "sha512-kgwDmw4fCg7AVgS4DukQR/roGp+jP+XluJE5hsRZwxCYGg+Rv9wSGErDWhlI90FODdYfd4xG4AQRiMDjjN0GzA==", + "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.8.3", + "@babel/helper-wrap-function": "^7.8.3", + "@babel/template": "^7.8.3", + "@babel/traverse": "^7.8.3", + "@babel/types": "^7.8.3" + } + }, + "node_modules/@babel/helper-remap-async-to-generator/node_modules/@babel/code-frame": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", + "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.8.3" + } + }, + "node_modules/@babel/helper-remap-async-to-generator/node_modules/@babel/highlight": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", + "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "node_modules/@babel/helper-remap-async-to-generator/node_modules/@babel/parser": { + "version": "7.9.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz", + "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/helper-remap-async-to-generator/node_modules/@babel/template": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz", + "integrity": "sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.8.3", + "@babel/parser": "^7.8.6", + "@babel/types": "^7.8.6" + } + }, + "node_modules/@babel/helper-remap-async-to-generator/node_modules/@babel/types": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", + "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.5", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/helper-remap-async-to-generator/node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/@babel/helper-replace-supers": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.8.6.tgz", + "integrity": "sha512-PeMArdA4Sv/Wf4zXwBKPqVj7n9UF/xg6slNRtZW84FM7JpE1CbG8B612FyM4cxrf4fMAMGO0kR7voy1ForHHFA==", + "dev": true, + "dependencies": { + "@babel/helper-member-expression-to-functions": "^7.8.3", + "@babel/helper-optimise-call-expression": "^7.8.3", + "@babel/traverse": "^7.8.6", + "@babel/types": "^7.8.6" + } + }, + "node_modules/@babel/helper-replace-supers/node_modules/@babel/types": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", + "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.5", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/helper-replace-supers/node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/@babel/helper-simple-access": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.1.0.tgz", + "integrity": "sha512-Vk+78hNjRbsiu49zAPALxTb+JUQCz1aolpd8osOF16BGnLtseD21nbHgLPGUwrXEurZgiCOUmvs3ExTu4F5x6w==", + "dev": true, + "dependencies": { + "@babel/template": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@babel/helper-split-export-declaration": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz", + "integrity": "sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==", + "dev": true, + "dependencies": { + "@babel/types": "^7.4.4" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz", + "integrity": "sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g==", + "dev": true + }, + "node_modules/@babel/helper-wrap-function": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.8.3.tgz", + "integrity": "sha512-LACJrbUET9cQDzb6kG7EeD7+7doC3JNvUgTEQOx2qaO1fKlzE/Bf05qs9w1oXQMmXlPO65lC3Tq9S6gZpTErEQ==", + "dev": true, + "dependencies": { + "@babel/helper-function-name": "^7.8.3", + "@babel/template": "^7.8.3", + "@babel/traverse": "^7.8.3", + "@babel/types": "^7.8.3" + } + }, + "node_modules/@babel/helper-wrap-function/node_modules/@babel/code-frame": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", + "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.8.3" + } + }, + "node_modules/@babel/helper-wrap-function/node_modules/@babel/highlight": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", + "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "node_modules/@babel/helper-wrap-function/node_modules/@babel/parser": { + "version": "7.9.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz", + "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/helper-wrap-function/node_modules/@babel/template": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz", + "integrity": "sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.8.3", + "@babel/parser": "^7.8.6", + "@babel/types": "^7.8.6" + } + }, + "node_modules/@babel/helper-wrap-function/node_modules/@babel/types": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", + "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.5", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/helper-wrap-function/node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/@babel/helpers": { + "version": "7.9.2", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.9.2.tgz", + "integrity": "sha512-JwLvzlXVPjO8eU9c/wF9/zOIN7X6h8DYf7mG4CiFRZRvZNKEF5dQ3H3V+ASkHoIB3mWhatgl5ONhyqHRI6MppA==", + "dev": true, + "dependencies": { + "@babel/template": "^7.8.3", + "@babel/traverse": "^7.9.0", + "@babel/types": "^7.9.0" + } + }, + "node_modules/@babel/helpers/node_modules/@babel/code-frame": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", + "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.8.3" + } + }, + "node_modules/@babel/helpers/node_modules/@babel/highlight": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", + "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "node_modules/@babel/helpers/node_modules/@babel/parser": { + "version": "7.9.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz", + "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/helpers/node_modules/@babel/template": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz", + "integrity": "sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.8.3", + "@babel/parser": "^7.8.6", + "@babel/types": "^7.8.6" + } + }, + "node_modules/@babel/helpers/node_modules/@babel/types": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", + "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.5", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/helpers/node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/@babel/highlight": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", + "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", + "dev": true, + "dependencies": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + } + }, + "node_modules/@babel/highlight/node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/@babel/parser": { + "version": "7.4.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.4.5.tgz", + "integrity": "sha512-9mUqkL1FF5T7f0WDFfAoDdiMVPWsdD1gZYzSnaXsxUCUqzuch/8of9G3VUSNiZmMBoRxT3neyVsqeiL/ZPcjew==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-proposal-async-generator-functions": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.8.3.tgz", + "integrity": "sha512-NZ9zLv848JsV3hs8ryEh7Uaz/0KsmPLqv0+PdkDJL1cJy0K4kOCFa8zc1E3mp+RHPQcpdfb/6GovEsW4VDrOMw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/helper-remap-async-to-generator": "^7.8.3", + "@babel/plugin-syntax-async-generators": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-async-generator-functions/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-proposal-class-properties": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.8.3.tgz", + "integrity": "sha512-EqFhbo7IosdgPgZggHaNObkmO1kNUe3slaKu54d5OWvy+p9QIKOzK1GAEpAIsZtWVtPXUHSMcT4smvDrCfY4AA==", + "dev": true, + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.8.3", + "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-class-properties/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-proposal-dynamic-import": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.8.3.tgz", + "integrity": "sha512-NyaBbyLFXFLT9FP+zk0kYlUlA8XtCUbehs67F0nnEg7KICgMc2mNkIeu9TYhKzyXMkrapZFwAhXLdnt4IYHy1w==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/plugin-syntax-dynamic-import": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-dynamic-import/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-proposal-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.8.3.tgz", + "integrity": "sha512-KGhQNZ3TVCQG/MjRbAUwuH+14y9q0tpxs1nWWs3pbSleRdDro9SAMMDyye8HhY1gqZ7/NqIc8SKhya0wRDgP1Q==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/plugin-syntax-json-strings": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-json-strings/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-proposal-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-TS9MlfzXpXKt6YYomudb/KU7nQI6/xnapG6in1uZxoxDghuSMZsPb6D2fyUwNYSAp4l1iR7QtFOjkqcRYcUsfw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-nullish-coalescing-operator/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-proposal-numeric-separator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.8.3.tgz", + "integrity": "sha512-jWioO1s6R/R+wEHizfaScNsAx+xKgwTLNXSh7tTC4Usj3ItsPEhYkEpU4h+lpnBwq7NBVOJXfO6cRFYcX69JUQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-numeric-separator/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-proposal-object-rest-spread": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.9.5.tgz", + "integrity": "sha512-VP2oXvAf7KCYTthbUHwBlewbl1Iq059f6seJGsxMizaCdgHIeczOr7FBqELhSqfkIl04Fi8okzWzl63UKbQmmg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/plugin-syntax-object-rest-spread": "^7.8.0", + "@babel/plugin-transform-parameters": "^7.9.5" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-object-rest-spread/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-proposal-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-0gkX7J7E+AtAw9fcwlVQj8peP61qhdg/89D5swOkjYbkboA2CVckn3kiyum1DE0wskGb7KJJxBdyEBApDLLVdw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-optional-catch-binding/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-proposal-optional-chaining": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.9.0.tgz", + "integrity": "sha512-NDn5tu3tcv4W30jNhmc2hyD5c56G6cXx4TesJubhxrJeCvuuMpttxr0OnNCqbZGhFjLrg+NIhxxC+BK5F6yS3w==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-optional-chaining/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-proposal-unicode-property-regex": { + "version": "7.8.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.8.8.tgz", + "integrity": "sha512-EVhjVsMpbhLw9ZfHWSx2iy13Q8Z/eg8e8ccVWt23sWQK5l1UdkoLJPN5w69UA4uITGBnEZD2JOe4QOHycYKv8A==", + "dev": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.8.8", + "@babel/helper-plugin-utils": "^7.8.3" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-unicode-property-regex/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-async-generators/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-syntax-dynamic-import": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", + "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-dynamic-import/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-syntax-import-meta": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.8.3.tgz", + "integrity": "sha512-vYiGd4wQ9gx0Lngb7+bPCwQXGK/PR6FeTIJ+TIOlq+OfOKG/kCAOO2+IBac3oMM9qV7/fU76hfcqxUaLKZf1hQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-meta/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-json-strings/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.8.3.tgz", + "integrity": "sha512-H7dCMAdN83PcCmqmkHB5dtp+Xa9a6LKSvA2hiFBC/5alSHxM5VgWZXFqDi0YFe8XNGT6iCa+z4V4zSt/PdZ7Dw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-numeric-separator/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-object-rest-spread/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-catch-binding/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-chaining/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-syntax-top-level-await": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.8.3.tgz", + "integrity": "sha512-kwj1j9lL/6Wd0hROD3b/OZZ7MSrZLqqn9RAZ5+cYYsflQ9HZBIKCUkr3+uL1MEJ1NePiUbf98jjiMQSv0NMR9g==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-top-level-await/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-arrow-functions": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.8.3.tgz", + "integrity": "sha512-0MRF+KC8EqH4dbuITCWwPSzsyO3HIWWlm30v8BbbpOrS1B++isGxPnnuq/IZvOX5J2D/p7DQalQm+/2PnlKGxg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-arrow-functions/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-async-to-generator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.8.3.tgz", + "integrity": "sha512-imt9tFLD9ogt56Dd5CI/6XgpukMwd/fLGSrix2httihVe7LOGVPhyhMh1BU5kDM7iHD08i8uUtmV2sWaBFlHVQ==", + "dev": true, + "dependencies": { + "@babel/helper-module-imports": "^7.8.3", + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/helper-remap-async-to-generator": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-async-to-generator/node_modules/@babel/helper-module-imports": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.8.3.tgz", + "integrity": "sha512-R0Bx3jippsbAEtzkpZ/6FIiuzOURPcMjHp+Z6xPe6DtApDJx+w7UYyOLanZqO8+wKR9G10s/FmHXvxaMd9s6Kg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.8.3" + } + }, + "node_modules/@babel/plugin-transform-async-to-generator/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-async-to-generator/node_modules/@babel/types": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", + "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.5", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/plugin-transform-async-to-generator/node_modules/lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, + "node_modules/@babel/plugin-transform-block-scoped-functions": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.8.3.tgz", + "integrity": "sha512-vo4F2OewqjbB1+yaJ7k2EJFHlTP3jR634Z9Cj9itpqNjuLXvhlVxgnjsHsdRgASR8xYDrx6onw4vW5H6We0Jmg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-block-scoped-functions/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-block-scoping": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.8.3.tgz", + "integrity": "sha512-pGnYfm7RNRgYRi7bids5bHluENHqJhrV4bCZRwc5GamaWIIs07N4rZECcmJL6ZClwjDz1GbdMZFtPs27hTB06w==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3", + "lodash": "^4.17.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-block-scoping/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-block-scoping/node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/@babel/plugin-transform-classes": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.9.5.tgz", + "integrity": "sha512-x2kZoIuLC//O5iA7PEvecB105o7TLzZo8ofBVhP79N+DO3jaX+KYfww9TQcfBEZD0nikNyYcGB1IKtRq36rdmg==", + "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.8.3", + "@babel/helper-define-map": "^7.8.3", + "@babel/helper-function-name": "^7.9.5", + "@babel/helper-optimise-call-expression": "^7.8.3", + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/helper-replace-supers": "^7.8.6", + "@babel/helper-split-export-declaration": "^7.8.3", + "globals": "^11.1.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-classes/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-classes/node_modules/@babel/helper-split-export-declaration": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", + "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.8.3" + } + }, + "node_modules/@babel/plugin-transform-classes/node_modules/@babel/types": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", + "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.5", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/plugin-transform-classes/node_modules/lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, + "node_modules/@babel/plugin-transform-computed-properties": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.8.3.tgz", + "integrity": "sha512-O5hiIpSyOGdrQZRQ2ccwtTVkgUDBBiCuK//4RJ6UfePllUTCENOzKxfh6ulckXKc0DixTFLCfb2HVkNA7aDpzA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-computed-properties/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-destructuring": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.9.5.tgz", + "integrity": "sha512-j3OEsGel8nHL/iusv/mRd5fYZ3DrOxWC82x0ogmdN/vHfAP4MYw+AFKYanzWlktNwikKvlzUV//afBW5FTp17Q==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-destructuring/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-dotall-regex": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.8.3.tgz", + "integrity": "sha512-kLs1j9Nn4MQoBYdRXH6AeaXMbEJFaFu/v1nQkvib6QzTj8MZI5OQzqmD83/2jEM1z0DLilra5aWO5YpyC0ALIw==", + "dev": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.8.3", + "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-dotall-regex/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-duplicate-keys": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.8.3.tgz", + "integrity": "sha512-s8dHiBUbcbSgipS4SMFuWGqCvyge5V2ZeAWzR6INTVC3Ltjig/Vw1G2Gztv0vU/hRG9X8IvKvYdoksnUfgXOEQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-duplicate-keys/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-exponentiation-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.8.3.tgz", + "integrity": "sha512-zwIpuIymb3ACcInbksHaNcR12S++0MDLKkiqXHl3AzpgdKlFNhog+z/K0+TGW+b0w5pgTq4H6IwV/WhxbGYSjQ==", + "dev": true, + "dependencies": { + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.8.3", + "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-exponentiation-operator/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-for-of": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.9.0.tgz", + "integrity": "sha512-lTAnWOpMwOXpyDx06N+ywmF3jNbafZEqZ96CGYabxHrxNX8l5ny7dt4bK/rGwAh9utyP2b2Hv7PlZh1AAS54FQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-for-of/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-function-name": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.8.3.tgz", + "integrity": "sha512-rO/OnDS78Eifbjn5Py9v8y0aR+aSYhDhqAwVfsTl0ERuMZyr05L1aFSCJnbv2mmsLkit/4ReeQ9N2BgLnOcPCQ==", + "dev": true, + "dependencies": { + "@babel/helper-function-name": "^7.8.3", + "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-function-name/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-literals": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.8.3.tgz", + "integrity": "sha512-3Tqf8JJ/qB7TeldGl+TT55+uQei9JfYaregDcEAyBZ7akutriFrt6C/wLYIer6OYhleVQvH/ntEhjE/xMmy10A==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-literals/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-member-expression-literals": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.8.3.tgz", + "integrity": "sha512-3Wk2EXhnw+rP+IDkK6BdtPKsUE5IeZ6QOGrPYvw52NwBStw9V1ZVzxgK6fSKSxqUvH9eQPR3tm3cOq79HlsKYA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-member-expression-literals/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-modules-amd": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.9.0.tgz", + "integrity": "sha512-vZgDDF003B14O8zJy0XXLnPH4sg+9X5hFBBGN1V+B2rgrB+J2xIypSN6Rk9imB2hSTHQi5OHLrFWsZab1GMk+Q==", + "dev": true, + "dependencies": { + "@babel/helper-module-transforms": "^7.9.0", + "@babel/helper-plugin-utils": "^7.8.3", + "babel-plugin-dynamic-import-node": "^2.3.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/code-frame": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", + "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.8.3" + } + }, + "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/helper-module-imports": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.8.3.tgz", + "integrity": "sha512-R0Bx3jippsbAEtzkpZ/6FIiuzOURPcMjHp+Z6xPe6DtApDJx+w7UYyOLanZqO8+wKR9G10s/FmHXvxaMd9s6Kg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.8.3" + } + }, + "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/helper-module-transforms": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.9.0.tgz", + "integrity": "sha512-0FvKyu0gpPfIQ8EkxlrAydOWROdHpBmiCiRwLkUiBGhCUPRRbVD2/tm3sFr/c/GWFrQ/ffutGUAnx7V0FzT2wA==", + "dev": true, + "dependencies": { + "@babel/helper-module-imports": "^7.8.3", + "@babel/helper-replace-supers": "^7.8.6", + "@babel/helper-simple-access": "^7.8.3", + "@babel/helper-split-export-declaration": "^7.8.3", + "@babel/template": "^7.8.6", + "@babel/types": "^7.9.0", + "lodash": "^4.17.13" + } + }, + "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/helper-simple-access": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.8.3.tgz", + "integrity": "sha512-VNGUDjx5cCWg4vvCTR8qQ7YJYZ+HBjxOgXEl7ounz+4Sn7+LMD3CFrCTEU6/qXKbA2nKg21CwhhBzO0RpRbdCw==", + "dev": true, + "dependencies": { + "@babel/template": "^7.8.3", + "@babel/types": "^7.8.3" + } + }, + "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/helper-split-export-declaration": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", + "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.8.3" + } + }, + "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/highlight": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", + "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/parser": { + "version": "7.9.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz", + "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/template": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz", + "integrity": "sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.8.3", + "@babel/parser": "^7.8.6", + "@babel/types": "^7.8.6" + } + }, + "node_modules/@babel/plugin-transform-modules-amd/node_modules/@babel/types": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", + "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.5", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/plugin-transform-modules-amd/node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/@babel/plugin-transform-modules-commonjs": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.9.0.tgz", + "integrity": "sha512-qzlCrLnKqio4SlgJ6FMMLBe4bySNis8DFn1VkGmOcxG9gqEyPIOzeQrA//u0HAKrWpJlpZbZMPB1n/OPa4+n8g==", + "dev": true, + "dependencies": { + "@babel/helper-module-transforms": "^7.9.0", + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/helper-simple-access": "^7.8.3", + "babel-plugin-dynamic-import-node": "^2.3.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/code-frame": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", + "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.8.3" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/helper-module-imports": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.8.3.tgz", + "integrity": "sha512-R0Bx3jippsbAEtzkpZ/6FIiuzOURPcMjHp+Z6xPe6DtApDJx+w7UYyOLanZqO8+wKR9G10s/FmHXvxaMd9s6Kg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.8.3" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/helper-module-transforms": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.9.0.tgz", + "integrity": "sha512-0FvKyu0gpPfIQ8EkxlrAydOWROdHpBmiCiRwLkUiBGhCUPRRbVD2/tm3sFr/c/GWFrQ/ffutGUAnx7V0FzT2wA==", + "dev": true, + "dependencies": { + "@babel/helper-module-imports": "^7.8.3", + "@babel/helper-replace-supers": "^7.8.6", + "@babel/helper-simple-access": "^7.8.3", + "@babel/helper-split-export-declaration": "^7.8.3", + "@babel/template": "^7.8.6", + "@babel/types": "^7.9.0", + "lodash": "^4.17.13" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/helper-simple-access": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.8.3.tgz", + "integrity": "sha512-VNGUDjx5cCWg4vvCTR8qQ7YJYZ+HBjxOgXEl7ounz+4Sn7+LMD3CFrCTEU6/qXKbA2nKg21CwhhBzO0RpRbdCw==", + "dev": true, + "dependencies": { + "@babel/template": "^7.8.3", + "@babel/types": "^7.8.3" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/helper-split-export-declaration": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", + "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.8.3" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/highlight": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", + "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/parser": { + "version": "7.9.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz", + "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/template": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz", + "integrity": "sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.8.3", + "@babel/parser": "^7.8.6", + "@babel/types": "^7.8.6" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/@babel/types": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", + "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.5", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs/node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/@babel/plugin-transform-modules-systemjs": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.9.0.tgz", + "integrity": "sha512-FsiAv/nao/ud2ZWy4wFacoLOm5uxl0ExSQ7ErvP7jpoihLR6Cq90ilOFyX9UXct3rbtKsAiZ9kFt5XGfPe/5SQ==", + "dev": true, + "dependencies": { + "@babel/helper-hoist-variables": "^7.8.3", + "@babel/helper-module-transforms": "^7.9.0", + "@babel/helper-plugin-utils": "^7.8.3", + "babel-plugin-dynamic-import-node": "^2.3.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/code-frame": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", + "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.8.3" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/helper-module-imports": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.8.3.tgz", + "integrity": "sha512-R0Bx3jippsbAEtzkpZ/6FIiuzOURPcMjHp+Z6xPe6DtApDJx+w7UYyOLanZqO8+wKR9G10s/FmHXvxaMd9s6Kg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.8.3" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/helper-module-transforms": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.9.0.tgz", + "integrity": "sha512-0FvKyu0gpPfIQ8EkxlrAydOWROdHpBmiCiRwLkUiBGhCUPRRbVD2/tm3sFr/c/GWFrQ/ffutGUAnx7V0FzT2wA==", + "dev": true, + "dependencies": { + "@babel/helper-module-imports": "^7.8.3", + "@babel/helper-replace-supers": "^7.8.6", + "@babel/helper-simple-access": "^7.8.3", + "@babel/helper-split-export-declaration": "^7.8.3", + "@babel/template": "^7.8.6", + "@babel/types": "^7.9.0", + "lodash": "^4.17.13" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/helper-simple-access": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.8.3.tgz", + "integrity": "sha512-VNGUDjx5cCWg4vvCTR8qQ7YJYZ+HBjxOgXEl7ounz+4Sn7+LMD3CFrCTEU6/qXKbA2nKg21CwhhBzO0RpRbdCw==", + "dev": true, + "dependencies": { + "@babel/template": "^7.8.3", + "@babel/types": "^7.8.3" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/helper-split-export-declaration": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", + "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.8.3" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/highlight": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", + "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/parser": { + "version": "7.9.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz", + "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/template": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz", + "integrity": "sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.8.3", + "@babel/parser": "^7.8.6", + "@babel/types": "^7.8.6" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/@babel/types": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", + "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.5", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs/node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/@babel/plugin-transform-modules-umd": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.9.0.tgz", + "integrity": "sha512-uTWkXkIVtg/JGRSIABdBoMsoIeoHQHPTL0Y2E7xf5Oj7sLqwVsNXOkNk0VJc7vF0IMBsPeikHxFjGe+qmwPtTQ==", + "dev": true, + "dependencies": { + "@babel/helper-module-transforms": "^7.9.0", + "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/code-frame": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", + "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.8.3" + } + }, + "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/helper-module-imports": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.8.3.tgz", + "integrity": "sha512-R0Bx3jippsbAEtzkpZ/6FIiuzOURPcMjHp+Z6xPe6DtApDJx+w7UYyOLanZqO8+wKR9G10s/FmHXvxaMd9s6Kg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.8.3" + } + }, + "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/helper-module-transforms": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.9.0.tgz", + "integrity": "sha512-0FvKyu0gpPfIQ8EkxlrAydOWROdHpBmiCiRwLkUiBGhCUPRRbVD2/tm3sFr/c/GWFrQ/ffutGUAnx7V0FzT2wA==", + "dev": true, + "dependencies": { + "@babel/helper-module-imports": "^7.8.3", + "@babel/helper-replace-supers": "^7.8.6", + "@babel/helper-simple-access": "^7.8.3", + "@babel/helper-split-export-declaration": "^7.8.3", + "@babel/template": "^7.8.6", + "@babel/types": "^7.9.0", + "lodash": "^4.17.13" + } + }, + "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/helper-simple-access": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.8.3.tgz", + "integrity": "sha512-VNGUDjx5cCWg4vvCTR8qQ7YJYZ+HBjxOgXEl7ounz+4Sn7+LMD3CFrCTEU6/qXKbA2nKg21CwhhBzO0RpRbdCw==", + "dev": true, + "dependencies": { + "@babel/template": "^7.8.3", + "@babel/types": "^7.8.3" + } + }, + "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/helper-split-export-declaration": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", + "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.8.3" + } + }, + "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/highlight": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", + "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/parser": { + "version": "7.9.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz", + "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/template": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz", + "integrity": "sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.8.3", + "@babel/parser": "^7.8.6", + "@babel/types": "^7.8.6" + } + }, + "node_modules/@babel/plugin-transform-modules-umd/node_modules/@babel/types": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", + "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.5", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/plugin-transform-modules-umd/node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.8.3.tgz", + "integrity": "sha512-f+tF/8UVPU86TrCb06JoPWIdDpTNSGGcAtaD9mLP0aYGA0OS0j7j7DHJR0GTFrUZPUU6loZhbsVZgTh0N+Qdnw==", + "dev": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-transform-new-target": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.8.3.tgz", + "integrity": "sha512-QuSGysibQpyxexRyui2vca+Cmbljo8bcRckgzYV4kRIsHpVeyeC3JDO63pY+xFZ6bWOBn7pfKZTqV4o/ix9sFw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-new-target/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-object-super": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.8.3.tgz", + "integrity": "sha512-57FXk+gItG/GejofIyLIgBKTas4+pEU47IXKDBWFTxdPd7F80H8zybyAY7UoblVfBhBGs2EKM+bJUu2+iUYPDQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/helper-replace-supers": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-object-super/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-parameters": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.9.5.tgz", + "integrity": "sha512-0+1FhHnMfj6lIIhVvS4KGQJeuhe1GI//h5uptK4PvLt+BGBxsoUJbd3/IW002yk//6sZPlFgsG1hY6OHLcy6kA==", + "dev": true, + "dependencies": { + "@babel/helper-get-function-arity": "^7.8.3", + "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-parameters/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-property-literals": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.8.3.tgz", + "integrity": "sha512-uGiiXAZMqEoQhRWMK17VospMZh5sXWg+dlh2soffpkAl96KAm+WZuJfa6lcELotSRmooLqg0MWdH6UUq85nmmg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-property-literals/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-regenerator": { + "version": "7.8.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.8.7.tgz", + "integrity": "sha512-TIg+gAl4Z0a3WmD3mbYSk+J9ZUH6n/Yc57rtKRnlA/7rcCvpekHXe0CMZHP1gYp7/KLe9GHTuIba0vXmls6drA==", + "dev": true, + "dependencies": { + "regenerator-transform": "^0.14.2" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-reserved-words": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.8.3.tgz", + "integrity": "sha512-mwMxcycN3omKFDjDQUl+8zyMsBfjRFr0Zn/64I41pmjv4NJuqcYlEtezwYtw9TFd9WR1vN5kiM+O0gMZzO6L0A==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-reserved-words/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-shorthand-properties": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.8.3.tgz", + "integrity": "sha512-I9DI6Odg0JJwxCHzbzW08ggMdCezoWcuQRz3ptdudgwaHxTjxw5HgdFJmZIkIMlRymL6YiZcped4TTCB0JcC8w==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-shorthand-properties/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.8.3.tgz", + "integrity": "sha512-CkuTU9mbmAoFOI1tklFWYYbzX5qCIZVXPVy0jpXgGwkplCndQAa58s2jr66fTeQnA64bDox0HL4U56CFYoyC7g==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-spread/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-sticky-regex": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.8.3.tgz", + "integrity": "sha512-9Spq0vGCD5Bb4Z/ZXXSK5wbbLFMG085qd2vhL1JYu1WcQ5bXqZBAYRzU1d+p79GcHs2szYv5pVQCX13QgldaWw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/helper-regex": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-sticky-regex/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-template-literals": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.8.3.tgz", + "integrity": "sha512-820QBtykIQOLFT8NZOcTRJ1UNuztIELe4p9DCgvj4NK+PwluSJ49we7s9FB1HIGNIYT7wFUJ0ar2QpCDj0escQ==", + "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.8.3", + "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-template-literals/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-typeof-symbol": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.8.4.tgz", + "integrity": "sha512-2QKyfjGdvuNfHsb7qnBBlKclbD4CfshH2KvDabiijLMGXPHJXGxtDzwIF7bQP+T0ysw8fYTtxPafgfs/c1Lrqg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-typeof-symbol/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/plugin-transform-unicode-regex": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.8.3.tgz", + "integrity": "sha512-+ufgJjYdmWfSQ+6NS9VGUR2ns8cjJjYbrbi11mZBTaWm+Fui/ncTLFF28Ei1okavY+xkojGr1eJxNsWYeA5aZw==", + "dev": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.8.3", + "@babel/helper-plugin-utils": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-regex/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/preset-env": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.9.5.tgz", + "integrity": "sha512-eWGYeADTlPJH+wq1F0wNfPbVS1w1wtmMJiYk55Td5Yu28AsdR9AsC97sZ0Qq8fHqQuslVSIYSGJMcblr345GfQ==", + "dev": true, + "dependencies": { + "@babel/compat-data": "^7.9.0", + "@babel/helper-compilation-targets": "^7.8.7", + "@babel/helper-module-imports": "^7.8.3", + "@babel/helper-plugin-utils": "^7.8.3", + "@babel/plugin-proposal-async-generator-functions": "^7.8.3", + "@babel/plugin-proposal-dynamic-import": "^7.8.3", + "@babel/plugin-proposal-json-strings": "^7.8.3", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-proposal-numeric-separator": "^7.8.3", + "@babel/plugin-proposal-object-rest-spread": "^7.9.5", + "@babel/plugin-proposal-optional-catch-binding": "^7.8.3", + "@babel/plugin-proposal-optional-chaining": "^7.9.0", + "@babel/plugin-proposal-unicode-property-regex": "^7.8.3", + "@babel/plugin-syntax-async-generators": "^7.8.0", + "@babel/plugin-syntax-dynamic-import": "^7.8.0", + "@babel/plugin-syntax-json-strings": "^7.8.0", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0", + "@babel/plugin-syntax-numeric-separator": "^7.8.0", + "@babel/plugin-syntax-object-rest-spread": "^7.8.0", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.0", + "@babel/plugin-syntax-optional-chaining": "^7.8.0", + "@babel/plugin-syntax-top-level-await": "^7.8.3", + "@babel/plugin-transform-arrow-functions": "^7.8.3", + "@babel/plugin-transform-async-to-generator": "^7.8.3", + "@babel/plugin-transform-block-scoped-functions": "^7.8.3", + "@babel/plugin-transform-block-scoping": "^7.8.3", + "@babel/plugin-transform-classes": "^7.9.5", + "@babel/plugin-transform-computed-properties": "^7.8.3", + "@babel/plugin-transform-destructuring": "^7.9.5", + "@babel/plugin-transform-dotall-regex": "^7.8.3", + "@babel/plugin-transform-duplicate-keys": "^7.8.3", + "@babel/plugin-transform-exponentiation-operator": "^7.8.3", + "@babel/plugin-transform-for-of": "^7.9.0", + "@babel/plugin-transform-function-name": "^7.8.3", + "@babel/plugin-transform-literals": "^7.8.3", + "@babel/plugin-transform-member-expression-literals": "^7.8.3", + "@babel/plugin-transform-modules-amd": "^7.9.0", + "@babel/plugin-transform-modules-commonjs": "^7.9.0", + "@babel/plugin-transform-modules-systemjs": "^7.9.0", + "@babel/plugin-transform-modules-umd": "^7.9.0", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.8.3", + "@babel/plugin-transform-new-target": "^7.8.3", + "@babel/plugin-transform-object-super": "^7.8.3", + "@babel/plugin-transform-parameters": "^7.9.5", + "@babel/plugin-transform-property-literals": "^7.8.3", + "@babel/plugin-transform-regenerator": "^7.8.7", + "@babel/plugin-transform-reserved-words": "^7.8.3", + "@babel/plugin-transform-shorthand-properties": "^7.8.3", + "@babel/plugin-transform-spread": "^7.8.3", + "@babel/plugin-transform-sticky-regex": "^7.8.3", + "@babel/plugin-transform-template-literals": "^7.8.3", + "@babel/plugin-transform-typeof-symbol": "^7.8.4", + "@babel/plugin-transform-unicode-regex": "^7.8.3", + "@babel/preset-modules": "^0.1.3", + "@babel/types": "^7.9.5", + "browserslist": "^4.9.1", + "core-js-compat": "^3.6.2", + "invariant": "^2.2.2", + "levenary": "^1.1.1", + "semver": "^5.5.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/preset-env/node_modules/@babel/helper-module-imports": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.8.3.tgz", + "integrity": "sha512-R0Bx3jippsbAEtzkpZ/6FIiuzOURPcMjHp+Z6xPe6DtApDJx+w7UYyOLanZqO8+wKR9G10s/FmHXvxaMd9s6Kg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.8.3" + } + }, + "node_modules/@babel/preset-env/node_modules/@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "node_modules/@babel/preset-env/node_modules/@babel/types": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", + "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.5", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/preset-env/node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/@babel/preset-env/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/@babel/preset-modules": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.3.tgz", + "integrity": "sha512-Ra3JXOHBq2xd56xSF7lMKXdjBn3T772Y1Wet3yWnkDly9zHvJki029tAFzvAAK5cf4YV3yoxuP61crYRol6SVg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", + "@babel/plugin-transform-dotall-regex": "^7.4.4", + "@babel/types": "^7.4.4", + "esutils": "^2.0.2" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.9.2", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.9.2.tgz", + "integrity": "sha512-NE2DtOdufG7R5vnfQUTehdTfNycfUANEtCa9PssN9O/xmTzP4E08UI797ixaei6hBEVL9BI/PsdJS5x7mWoB9Q==", + "dev": true, + "dependencies": { + "regenerator-runtime": "^0.13.4" + } + }, + "node_modules/@babel/template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.4.4.tgz", + "integrity": "sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.4.4", + "@babel/types": "^7.4.4" + } + }, + "node_modules/@babel/traverse": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.9.5.tgz", + "integrity": "sha512-c4gH3jsvSuGUezlP6rzSJ6jf8fYjLj3hsMZRx/nX0h+fmHN0w+ekubRrHPqnMec0meycA2nwCsJ7dC8IPem2FQ==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.8.3", + "@babel/generator": "^7.9.5", + "@babel/helper-function-name": "^7.9.5", + "@babel/helper-split-export-declaration": "^7.8.3", + "@babel/parser": "^7.9.0", + "@babel/types": "^7.9.5", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.13" + } + }, + "node_modules/@babel/traverse/node_modules/@babel/code-frame": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", + "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.8.3" + } + }, + "node_modules/@babel/traverse/node_modules/@babel/helper-split-export-declaration": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", + "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.8.3" + } + }, + "node_modules/@babel/traverse/node_modules/@babel/highlight": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", + "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "node_modules/@babel/traverse/node_modules/@babel/parser": { + "version": "7.9.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz", + "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/traverse/node_modules/@babel/types": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", + "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.5", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@babel/traverse/node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/@babel/types": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.4.4.tgz", + "integrity": "sha512-dOllgYdnEFOebhkKCjzSVFqw/PmmB8pH6RGOWkY4GsboQNd47b1fBThBSwlHAq9alF9vc1M3+6oqR47R50L0tQ==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2", + "lodash": "^4.17.11", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@gar/promisify": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", + "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==", + "dev": true + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", + "integrity": "sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.3", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", + "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz", + "integrity": "sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.3", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@npmcli/fs": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-1.1.1.tgz", + "integrity": "sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==", + "dev": true, + "dependencies": { + "@gar/promisify": "^1.0.1", + "semver": "^7.3.5" + } + }, + "node_modules/@npmcli/fs/node_modules/semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@npmcli/move-file": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz", + "integrity": "sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==", + "dev": true, + "dependencies": { + "mkdirp": "^1.0.4", + "rimraf": "^3.0.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@npmcli/move-file/node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@npmcli/move-file/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=", + "dev": true + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", + "dev": true + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", + "dev": true + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=", + "dev": true + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", + "dev": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=", + "dev": true + }, + "node_modules/@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=", + "dev": true + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=", + "dev": true + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=", + "dev": true + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=", + "dev": true + }, + "node_modules/@stylelint/postcss-css-in-js": { + "version": "0.37.1", + "resolved": "https://registry.npmjs.org/@stylelint/postcss-css-in-js/-/postcss-css-in-js-0.37.1.tgz", + "integrity": "sha512-UMf2Rni3JGKi3ZwYRGMYJ5ipOA5ENJSKMtYA/pE1ZLURwdh7B5+z2r73RmWvub+N0UuH1Lo+TGfCgYwPvqpXNw==", + "dev": true, + "dependencies": { + "@babel/core": ">=7.9.0" + }, + "peerDependencies": { + "postcss": ">=7.0.0", + "postcss-syntax": ">=0.36.2" + } + }, + "node_modules/@stylelint/postcss-markdown": { + "version": "0.36.2", + "resolved": "https://registry.npmjs.org/@stylelint/postcss-markdown/-/postcss-markdown-0.36.2.tgz", + "integrity": "sha512-2kGbqUVJUGE8dM+bMzXG/PYUWKkjLIkRLWNh39OaADkiabDRdw8ATFCgbMz5xdIcvwspPAluSL7uY+ZiTWdWmQ==", + "deprecated": "Use the original unforked package instead: postcss-markdown", + "dev": true, + "dependencies": { + "remark": "^13.0.0", + "unist-util-find-all-after": "^3.0.2" + }, + "peerDependencies": { + "postcss": ">=7.0.0", + "postcss-syntax": ">=0.36.2" + } + }, + "node_modules/@stylelint/postcss-markdown/node_modules/remark": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/remark/-/remark-13.0.0.tgz", + "integrity": "sha512-HDz1+IKGtOyWN+QgBiAT0kn+2s6ovOxHyPAFGKVE81VSzJ+mq7RwHFledEvB5F1p4iJvOah/LOKdFuzvRnNLCA==", + "dev": true, + "dependencies": { + "remark-parse": "^9.0.0", + "remark-stringify": "^9.0.0", + "unified": "^9.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@stylelint/postcss-markdown/node_modules/remark-parse": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-9.0.0.tgz", + "integrity": "sha512-geKatMwSzEXKHuzBNU1z676sGcDcFoChMK38TgdHJNAYfFtsfHDQG7MoJAjs6sgYMqyLduCYWDIWZIxiPeafEw==", + "dev": true, + "dependencies": { + "mdast-util-from-markdown": "^0.8.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@stylelint/postcss-markdown/node_modules/remark-stringify": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-9.0.1.tgz", + "integrity": "sha512-mWmNg3ZtESvZS8fv5PTvaPckdL4iNlCHTt8/e/8oN08nArHRHjNZMKzA/YW3+p7/lYqIw4nx1XsjCBo/AxNChg==", + "dev": true, + "dependencies": { + "mdast-util-to-markdown": "^0.6.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@stylelint/postcss-markdown/node_modules/unified": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/unified/-/unified-9.2.2.tgz", + "integrity": "sha512-Sg7j110mtefBD+qunSLO1lqOEKdrwBFBrR6Qd8f4uwkhWNlbkaqwHse6e7QvD3AP/MNoJdEDLaf8OxYyoWgorQ==", + "dev": true, + "dependencies": { + "bail": "^1.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^2.0.0", + "trough": "^1.0.0", + "vfile": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@stylelint/postcss-markdown/node_modules/unist-util-find-all-after": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/unist-util-find-all-after/-/unist-util-find-all-after-3.0.2.tgz", + "integrity": "sha512-xaTC/AGZ0rIM2gM28YVRAFPIZpzbpDtU3dRmp7EXlNVA8ziQc4hY3H7BHXM1J49nEmiqc3svnqMReW+PGqbZKQ==", + "dev": true, + "dependencies": { + "unist-util-is": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", + "dev": true + }, + "node_modules/@types/long": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz", + "integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w==", + "dev": true + }, + "node_modules/@types/mdast": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.7.tgz", + "integrity": "sha512-YwR7OK8aPmaBvMMUi+pZXBNoW2unbVbfok4YRqGMJBe1dpDlzpRkJrYEYmvjxgs5JhuQmKfDexrN98u941Zasg==", + "dev": true, + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/@types/minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY=", + "dev": true + }, + "node_modules/@types/node": { + "version": "16.4.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.4.10.tgz", + "integrity": "sha512-TmVHsm43br64js9BqHWqiDZA+xMtbUpI1MBIA0EyiBmoV9pcEYFOSdj5fr6enZNfh4fChh+AGOLIzGwJnkshyQ==", + "dev": true + }, + "node_modules/@types/normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==", + "dev": true + }, + "node_modules/@types/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", + "dev": true + }, + "node_modules/@types/unist": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.3.tgz", + "integrity": "sha512-FvUupuM3rlRsRtCN+fDudtmytGO6iHJuuRKS1Ss0pG5z8oX0diNEw94UEL7hgDbpN94rgaK5R7sWm6RrSkZuAQ==", + "dev": true + }, + "node_modules/@types/uuid": { + "version": "3.4.10", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-3.4.10.tgz", + "integrity": "sha512-BgeaZuElf7DEYZhWYDTc/XcLZXdVgFkVSTa13BqKvbnmUrxr3TJFKofUxCtDO9UQOdhnV+HPOESdHiHKZOJV1A==", + "dev": true + }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true + }, + "node_modules/acorn": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", + "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", + "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0" + } + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/agentkeepalive": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.2.0.tgz", + "integrity": "sha512-0PhAp58jZNw13UJv7NVdTGb0ZcghHUb3DrZ046JiiJY/BOaTTpbwdHq2VObPCBV8M2GPh7sgrJ3AQ8Ey468LJw==", + "dev": true, + "dependencies": { + "debug": "^4.1.0", + "depd": "^1.1.2", + "humanize-ms": "^1.2.1" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ajv": { + "version": "6.12.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz", + "integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "node_modules/amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "dev": true, + "engines": { + "node": ">=0.4.2" + } + }, + "node_modules/ansi-color": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/ansi-color/-/ansi-color-0.2.1.tgz", + "integrity": "sha1-PnXAN0dSF1RO12Oo21cJ+prlv5o=", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", + "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", + "dev": true, + "dependencies": { + "type-fest": "^0.11.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", + "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/aproba": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "dev": true + }, + "node_modules/are-we-there-yet": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.0.tgz", + "integrity": "sha512-0GWpv50YSOcLXaN6/FAKY3vfRbllXWV2xvfA/oKJF8pzFhWXPV+yjhJXDBbjscDYowv7Yw1A3uigpzn5iEGTyw==", + "dev": true, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16" + } + }, + "node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/array-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", + "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-slice": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz", + "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/asn1": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", + "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", + "dev": true, + "dependencies": { + "safer-buffer": "~2.1.0" + } + }, + "node_modules/assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/async": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz", + "integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==", + "dev": true + }, + "node_modules/async-foreach": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/async-foreach/-/async-foreach-0.1.3.tgz", + "integrity": "sha1-NhIfhFwFeBct5Bmpfb6x0W7DRUI=", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "node_modules/autoprefixer": { + "version": "9.7.6", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.7.6.tgz", + "integrity": "sha512-F7cYpbN7uVVhACZTeeIeealwdGM6wMtfWARVLTy5xmKtgVdBNJvbDRoCK3YO1orcs7gv/KwYlb3iXwu9Ug9BkQ==", + "dev": true, + "dependencies": { + "browserslist": "^4.11.1", + "caniuse-lite": "^1.0.30001039", + "chalk": "^2.4.2", + "normalize-range": "^0.1.2", + "num2fraction": "^1.2.2", + "postcss": "^7.0.27", + "postcss-value-parser": "^4.0.3" + }, + "bin": { + "autoprefixer": "bin/autoprefixer" + }, + "engines": { + "node": ">=6.0.0" + }, + "funding": { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/autoprefixer" + } + }, + "node_modules/aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/aws4": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", + "dev": true + }, + "node_modules/babel-eslint": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.1.0.tgz", + "integrity": "sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg==", + "deprecated": "babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.7.0", + "@babel/traverse": "^7.7.0", + "@babel/types": "^7.7.0", + "eslint-visitor-keys": "^1.0.0", + "resolve": "^1.12.0" + }, + "engines": { + "node": ">=6" + }, + "peerDependencies": { + "eslint": ">= 4.12.1" + } + }, + "node_modules/babel-eslint/node_modules/@babel/parser": { + "version": "7.9.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.4.tgz", + "integrity": "sha512-bC49otXX6N0/VYhgOMh4gnP26E9xnDZK3TmbNpxYzzz9BQLBosQwfyOe9/cXUU3txYhTzLCbcqd5c8y/OmCjHA==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/babel-eslint/node_modules/@babel/types": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", + "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.9.5", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/babel-eslint/node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/babel-eslint/node_modules/resolve": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.16.1.tgz", + "integrity": "sha512-rmAglCSqWWMrrBv/XM6sW0NuRFiKViw/W4d9EbC4pt+49H8JwHy+mcGmALTEg504AUDcLTvb1T2q3E9AnmY+ig==", + "dev": true, + "dependencies": { + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/babel-helper-evaluate-path": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.5.0.tgz", + "integrity": "sha512-mUh0UhS607bGh5wUMAQfOpt2JX2ThXMtppHRdRU1kL7ZLRWIXxoV2UIV1r2cAeeNeU1M5SB5/RSUgUxrK8yOkA==", + "dev": true + }, + "node_modules/babel-helper-flip-expressions": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-helper-flip-expressions/-/babel-helper-flip-expressions-0.4.3.tgz", + "integrity": "sha1-NpZzahKKwYvCUlS19AoizrPB0/0=", + "dev": true + }, + "node_modules/babel-helper-is-nodes-equiv": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/babel-helper-is-nodes-equiv/-/babel-helper-is-nodes-equiv-0.0.1.tgz", + "integrity": "sha1-NOmzALFHnd2Y7HfqC76TQt/jloQ=", + "dev": true + }, + "node_modules/babel-helper-is-void-0": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-helper-is-void-0/-/babel-helper-is-void-0-0.4.3.tgz", + "integrity": "sha1-fZwBtFYee5Xb2g9u7kj1tg5nMT4=", + "dev": true + }, + "node_modules/babel-helper-mark-eval-scopes": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-helper-mark-eval-scopes/-/babel-helper-mark-eval-scopes-0.4.3.tgz", + "integrity": "sha1-0kSjvvmESHJgP/tG4izorN9VFWI=", + "dev": true + }, + "node_modules/babel-helper-remove-or-void": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-helper-remove-or-void/-/babel-helper-remove-or-void-0.4.3.tgz", + "integrity": "sha1-pPA7QAd6D/6I5F0HAQ3uJB/1rmA=", + "dev": true + }, + "node_modules/babel-helper-to-multiple-sequence-expressions": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/babel-helper-to-multiple-sequence-expressions/-/babel-helper-to-multiple-sequence-expressions-0.5.0.tgz", + "integrity": "sha512-m2CvfDW4+1qfDdsrtf4dwOslQC3yhbgyBFptncp4wvtdrDHqueW7slsYv4gArie056phvQFhT2nRcGS4bnm6mA==", + "dev": true + }, + "node_modules/babel-plugin-dynamic-import-node": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.2.tgz", + "integrity": "sha512-yvczAMjbc73xira9yTyF1XnEmkX8QwlUhmxuhimeMUeAaA6s7busTPRVDzhVG7eeBdNcRiZ/mAwFrJ9It4vQcg==", + "dev": true, + "dependencies": { + "object.assign": "^4.1.0" + } + }, + "node_modules/babel-plugin-minify-builtins": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-builtins/-/babel-plugin-minify-builtins-0.5.0.tgz", + "integrity": "sha512-wpqbN7Ov5hsNwGdzuzvFcjgRlzbIeVv1gMIlICbPj0xkexnfoIDe7q+AZHMkQmAE/F9R5jkrB6TLfTegImlXag==", + "dev": true + }, + "node_modules/babel-plugin-minify-constant-folding": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-constant-folding/-/babel-plugin-minify-constant-folding-0.5.0.tgz", + "integrity": "sha512-Vj97CTn/lE9hR1D+jKUeHfNy+m1baNiJ1wJvoGyOBUx7F7kJqDZxr9nCHjO/Ad+irbR3HzR6jABpSSA29QsrXQ==", + "dev": true, + "dependencies": { + "babel-helper-evaluate-path": "^0.5.0" + } + }, + "node_modules/babel-plugin-minify-dead-code-elimination": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-dead-code-elimination/-/babel-plugin-minify-dead-code-elimination-0.5.1.tgz", + "integrity": "sha512-x8OJOZIrRmQBcSqxBcLbMIK8uPmTvNWPXH2bh5MDCW1latEqYiRMuUkPImKcfpo59pTUB2FT7HfcgtG8ZlR5Qg==", + "dev": true, + "dependencies": { + "babel-helper-evaluate-path": "^0.5.0", + "babel-helper-mark-eval-scopes": "^0.4.3", + "babel-helper-remove-or-void": "^0.4.3", + "lodash": "^4.17.11" + } + }, + "node_modules/babel-plugin-minify-flip-comparisons": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-flip-comparisons/-/babel-plugin-minify-flip-comparisons-0.4.3.tgz", + "integrity": "sha1-AMqHDLjxO0XAOLPB68DyJyk8llo=", + "dev": true, + "dependencies": { + "babel-helper-is-void-0": "^0.4.3" + } + }, + "node_modules/babel-plugin-minify-guarded-expressions": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-guarded-expressions/-/babel-plugin-minify-guarded-expressions-0.4.4.tgz", + "integrity": "sha512-RMv0tM72YuPPfLT9QLr3ix9nwUIq+sHT6z8Iu3sLbqldzC1Dls8DPCywzUIzkTx9Zh1hWX4q/m9BPoPed9GOfA==", + "dev": true, + "dependencies": { + "babel-helper-evaluate-path": "^0.5.0", + "babel-helper-flip-expressions": "^0.4.3" + } + }, + "node_modules/babel-plugin-minify-infinity": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-infinity/-/babel-plugin-minify-infinity-0.4.3.tgz", + "integrity": "sha1-37h2obCKBldjhO8/kuZTumB7Oco=", + "dev": true + }, + "node_modules/babel-plugin-minify-mangle-names": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-mangle-names/-/babel-plugin-minify-mangle-names-0.5.0.tgz", + "integrity": "sha512-3jdNv6hCAw6fsX1p2wBGPfWuK69sfOjfd3zjUXkbq8McbohWy23tpXfy5RnToYWggvqzuMOwlId1PhyHOfgnGw==", + "dev": true, + "dependencies": { + "babel-helper-mark-eval-scopes": "^0.4.3" + } + }, + "node_modules/babel-plugin-minify-numeric-literals": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-numeric-literals/-/babel-plugin-minify-numeric-literals-0.4.3.tgz", + "integrity": "sha1-jk/VYcefeAEob/YOjF/Z3u6TwLw=", + "dev": true + }, + "node_modules/babel-plugin-minify-replace": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-replace/-/babel-plugin-minify-replace-0.5.0.tgz", + "integrity": "sha512-aXZiaqWDNUbyNNNpWs/8NyST+oU7QTpK7J9zFEFSA0eOmtUNMU3fczlTTTlnCxHmq/jYNFEmkkSG3DDBtW3Y4Q==", + "dev": true + }, + "node_modules/babel-plugin-minify-simplify": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-simplify/-/babel-plugin-minify-simplify-0.5.1.tgz", + "integrity": "sha512-OSYDSnoCxP2cYDMk9gxNAed6uJDiDz65zgL6h8d3tm8qXIagWGMLWhqysT6DY3Vs7Fgq7YUDcjOomhVUb+xX6A==", + "dev": true, + "dependencies": { + "babel-helper-evaluate-path": "^0.5.0", + "babel-helper-flip-expressions": "^0.4.3", + "babel-helper-is-nodes-equiv": "^0.0.1", + "babel-helper-to-multiple-sequence-expressions": "^0.5.0" + } + }, + "node_modules/babel-plugin-minify-type-constructors": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-plugin-minify-type-constructors/-/babel-plugin-minify-type-constructors-0.4.3.tgz", + "integrity": "sha1-G8bxW4f3qxCF1CszC3F2V6IVZQA=", + "dev": true, + "dependencies": { + "babel-helper-is-void-0": "^0.4.3" + } + }, + "node_modules/babel-plugin-system-import-transformer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/babel-plugin-system-import-transformer/-/babel-plugin-system-import-transformer-4.0.0.tgz", + "integrity": "sha512-l+xJk+z1U8tWX1FZfBCd/ebKOZa7JLAQ91YBmtNO0e/e5v/RwIM+8IGBkliXcSoP7xd+CF7L6Yu4O3wmQrya8g==", + "dev": true, + "dependencies": { + "@babel/core": "^7.0.0", + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-dynamic-import": "^7.0.0" + } + }, + "node_modules/babel-plugin-transform-es2015-modules-amd-lazy": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd-lazy/-/babel-plugin-transform-es2015-modules-amd-lazy-2.0.1.tgz", + "integrity": "sha512-GGUvH+zwajFsdxE1x3XteBHIFVcbcM20S00ZIF7MH7LuL8KLFl/Giu8knxdgXl6NE69gZwXGTYQESX5Uk1fixA==", + "dev": true, + "dependencies": { + "@babel/helper-module-transforms": "^7.0.0-beta.45" + }, + "peerDependencies": { + "@babel/core": "^7.0.0 || ^7.0.0-beta" + } + }, + "node_modules/babel-plugin-transform-inline-consecutive-adds": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-inline-consecutive-adds/-/babel-plugin-transform-inline-consecutive-adds-0.4.3.tgz", + "integrity": "sha1-Mj1Ho+pjqDp6w8gRro5pQfrysNE=", + "dev": true + }, + "node_modules/babel-plugin-transform-member-expression-literals": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-member-expression-literals/-/babel-plugin-transform-member-expression-literals-6.9.4.tgz", + "integrity": "sha1-NwOcmgwzE6OUlfqsL/OmtbnQOL8=", + "dev": true + }, + "node_modules/babel-plugin-transform-merge-sibling-variables": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-merge-sibling-variables/-/babel-plugin-transform-merge-sibling-variables-6.9.4.tgz", + "integrity": "sha1-hbQi/DN3tEnJ0c3kQIcgNTJAHa4=", + "dev": true + }, + "node_modules/babel-plugin-transform-minify-booleans": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-minify-booleans/-/babel-plugin-transform-minify-booleans-6.9.4.tgz", + "integrity": "sha1-rLs+VqNVXdI5KOS1gtKFFi3SsZg=", + "dev": true + }, + "node_modules/babel-plugin-transform-property-literals": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-property-literals/-/babel-plugin-transform-property-literals-6.9.4.tgz", + "integrity": "sha1-mMHSHiVXNlc/k+zlRFn2ziSYXTk=", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + } + }, + "node_modules/babel-plugin-transform-regexp-constructors": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-regexp-constructors/-/babel-plugin-transform-regexp-constructors-0.4.3.tgz", + "integrity": "sha1-WLd3W2OvzzMyj66aX4j71PsLSWU=", + "dev": true + }, + "node_modules/babel-plugin-transform-remove-console": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-remove-console/-/babel-plugin-transform-remove-console-6.9.4.tgz", + "integrity": "sha1-uYA2DAZzhOJLNXpYjYB9PINSd4A=", + "dev": true + }, + "node_modules/babel-plugin-transform-remove-debugger": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-remove-debugger/-/babel-plugin-transform-remove-debugger-6.9.4.tgz", + "integrity": "sha1-QrcnYxyXl44estGZp67IShgznvI=", + "dev": true + }, + "node_modules/babel-plugin-transform-remove-undefined": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-remove-undefined/-/babel-plugin-transform-remove-undefined-0.5.0.tgz", + "integrity": "sha512-+M7fJYFaEE/M9CXa0/IRkDbiV3wRELzA1kKQFCJ4ifhrzLKn/9VCCgj9OFmYWwBd8IB48YdgPkHYtbYq+4vtHQ==", + "dev": true, + "dependencies": { + "babel-helper-evaluate-path": "^0.5.0" + } + }, + "node_modules/babel-plugin-transform-simplify-comparison-operators": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-simplify-comparison-operators/-/babel-plugin-transform-simplify-comparison-operators-6.9.4.tgz", + "integrity": "sha1-9ir+CWyrDh9ootdT/fKDiIRxzrk=", + "dev": true + }, + "node_modules/babel-plugin-transform-undefined-to-void": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-undefined-to-void/-/babel-plugin-transform-undefined-to-void-6.9.4.tgz", + "integrity": "sha1-viQcqBQEAwZ4t0hxcyK4nQyP4oA=", + "dev": true + }, + "node_modules/babel-preset-minify": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/babel-preset-minify/-/babel-preset-minify-0.5.1.tgz", + "integrity": "sha512-1IajDumYOAPYImkHbrKeiN5AKKP9iOmRoO2IPbIuVp0j2iuCcj0n7P260z38siKMZZ+85d3mJZdtW8IgOv+Tzg==", + "dev": true, + "dependencies": { + "babel-plugin-minify-builtins": "^0.5.0", + "babel-plugin-minify-constant-folding": "^0.5.0", + "babel-plugin-minify-dead-code-elimination": "^0.5.1", + "babel-plugin-minify-flip-comparisons": "^0.4.3", + "babel-plugin-minify-guarded-expressions": "^0.4.4", + "babel-plugin-minify-infinity": "^0.4.3", + "babel-plugin-minify-mangle-names": "^0.5.0", + "babel-plugin-minify-numeric-literals": "^0.4.3", + "babel-plugin-minify-replace": "^0.5.0", + "babel-plugin-minify-simplify": "^0.5.1", + "babel-plugin-minify-type-constructors": "^0.4.3", + "babel-plugin-transform-inline-consecutive-adds": "^0.4.3", + "babel-plugin-transform-member-expression-literals": "^6.9.4", + "babel-plugin-transform-merge-sibling-variables": "^6.9.4", + "babel-plugin-transform-minify-booleans": "^6.9.4", + "babel-plugin-transform-property-literals": "^6.9.4", + "babel-plugin-transform-regexp-constructors": "^0.4.3", + "babel-plugin-transform-remove-console": "^6.9.4", + "babel-plugin-transform-remove-debugger": "^6.9.4", + "babel-plugin-transform-remove-undefined": "^0.5.0", + "babel-plugin-transform-simplify-comparison-operators": "^6.9.4", + "babel-plugin-transform-undefined-to-void": "^6.9.4", + "lodash": "^4.17.11" + } + }, + "node_modules/bail": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/bail/-/bail-1.0.5.tgz", + "integrity": "sha512-xFbRxM1tahm08yHBP16MMjVUAvDaBMD38zsM9EMAUN61omwLmKlOpB/Zku5QkjZ8TZ4vn53pj+t518cH0S03RQ==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "node_modules/bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, + "dependencies": { + "tweetnacl": "^0.14.3" + } + }, + "node_modules/body": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/body/-/body-5.1.0.tgz", + "integrity": "sha1-5LoM5BCkaTYyM2dgnstOZVMSUGk=", + "dev": true, + "dependencies": { + "continuable-cache": "^0.3.1", + "error": "^7.0.0", + "raw-body": "~1.1.0", + "safe-json-parse": "~1.0.1" + } + }, + "node_modules/boom": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/boom/-/boom-0.4.2.tgz", + "integrity": "sha1-emNune1O/O+xnO9JR6PGffrukRs=", + "deprecated": "This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).", + "dev": true, + "optional": true, + "dependencies": { + "hoek": "0.9.x" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "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.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.16.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz", + "integrity": "sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==", + "dev": true, + "dependencies": { + "caniuse-lite": "^1.0.30001219", + "colorette": "^1.2.2", + "electron-to-chromium": "^1.3.723", + "escalade": "^3.1.1", + "node-releases": "^1.1.71" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + } + }, + "node_modules/browserslist/node_modules/caniuse-lite": { + "version": "1.0.30001248", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001248.tgz", + "integrity": "sha512-NwlQbJkxUFJ8nMErnGtT0QTM2TJ33xgz4KXJSMIrjXIbDVdaYueGyjOrLKRtJC+rTiWfi6j5cnZN1NBiSBJGNw==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + } + }, + "node_modules/browserslist/node_modules/electron-to-chromium": { + "version": "1.3.792", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.792.tgz", + "integrity": "sha512-RM2O2xrNarM7Cs+XF/OE2qX/aBROyOZqqgP+8FXMXSuWuUqCfUUzg7NytQrzZU3aSqk1Qq6zqnVkJsbfMkIatg==", + "dev": true + }, + "node_modules/browserslist/node_modules/node-releases": { + "version": "1.1.73", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.73.tgz", + "integrity": "sha512-uW7fodD6pyW2FZNZnp/Z3hvWKeEW1Y8R1+1CnErE8cXFXzl5blBOoVB41CvMer6P6Q0S5FXDwcHgFd1Wj0U9zg==", + "dev": true + }, + "node_modules/bser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", + "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "dev": true, + "dependencies": { + "node-int64": "^0.4.0" + } + }, + "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/bytes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-1.0.0.tgz", + "integrity": "sha1-NWnt6Lo0MV+rmcPpLLBMciDeH6g=", + "dev": true + }, + "node_modules/cacache": { + "version": "15.3.0", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz", + "integrity": "sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==", + "dev": true, + "dependencies": { + "@npmcli/fs": "^1.0.0", + "@npmcli/move-file": "^1.0.1", + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "glob": "^7.1.4", + "infer-owner": "^1.0.4", + "lru-cache": "^6.0.0", + "minipass": "^3.1.1", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.2", + "mkdirp": "^1.0.3", + "p-map": "^4.0.0", + "promise-inflight": "^1.0.1", + "rimraf": "^3.0.2", + "ssri": "^8.0.1", + "tar": "^6.0.2", + "unique-filename": "^1.1.1" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/cacache/node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/cacache/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase-keys": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", + "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", + "dev": true, + "dependencies": { + "camelcase": "^5.3.1", + "map-obj": "^4.0.0", + "quick-lru": "^4.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/camelcase-keys/node_modules/map-obj": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", + "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001045", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001045.tgz", + "integrity": "sha512-Y8o2Iz1KPcD6FjySbk1sPpvJqchgxk/iow0DABpGyzA1UeQAuxh63Xh0Enj5/BrsYbXtCN32JmR4ZxQTCQ6E6A==", + "dev": true + }, + "node_modules/caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "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/chalk/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/chalk/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/character-entities": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-1.2.4.tgz", + "integrity": "sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities-legacy": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz", + "integrity": "sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-reference-invalid": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz", + "integrity": "sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/clean-css": { + "version": "2.2.23", + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-2.2.23.tgz", + "integrity": "sha1-BZC1R4tRbEkD7cLYm9P9vdKGMow=", + "dev": true, + "optional": true, + "dependencies": { + "commander": "2.2.x" + }, + "bin": { + "cleancss": "bin/cleancss" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/clean-css/node_modules/commander": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.2.0.tgz", + "integrity": "sha1-F1rUuTF/P/YV8gHB5XIk9Vo+kd8=", + "dev": true, + "optional": true, + "engines": { + "node": ">= 0.6.x" + } + }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/cli": { + "version": "0.6.6", + "resolved": "https://registry.npmjs.org/cli/-/cli-0.6.6.tgz", + "integrity": "sha1-Aq1Eo4Cr8nraxebwzdewQ9dMU+M=", + "dev": true, + "dependencies": { + "exit": "0.1.2", + "glob": "~ 3.2.1" + }, + "engines": { + "node": ">=0.2.5" + } + }, + "node_modules/cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "dependencies": { + "restore-cursor": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-width": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", + "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", + "dev": true + }, + "node_modules/cli/node_modules/glob": { + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz", + "integrity": "sha1-Spc/Y1uRkPcV0QmH1cAP0oFevj0=", + "dev": true, + "dependencies": { + "inherits": "2", + "minimatch": "0.3" + }, + "engines": { + "node": "*" + } + }, + "node_modules/cli/node_modules/lru-cache": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", + "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=", + "dev": true + }, + "node_modules/cli/node_modules/minimatch": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz", + "integrity": "sha1-J12O2qxPG7MyZHIInnlJyDlGmd0=", + "deprecated": "Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue", + "dev": true, + "dependencies": { + "lru-cache": "2", + "sigmund": "~1.0.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/clone-regexp": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clone-regexp/-/clone-regexp-2.2.0.tgz", + "integrity": "sha512-beMpP7BOtTipFuW8hrJvREQ2DrRu3BE7by0ZpibtfBA+qfHYvMGTc2Yb1JMYPKg/JUw0CHYvpg796aNTSW9z7Q==", + "dev": true, + "dependencies": { + "is-regexp": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "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/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "dev": true, + "bin": { + "color-support": "bin.js" + } + }, + "node_modules/colorette": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz", + "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==", + "dev": true + }, + "node_modules/colors": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", + "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", + "dev": true, + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commander": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-5.0.0.tgz", + "integrity": "sha512-JrDGPAKjMGSP1G0DUoaceEJ3DZgAfr/q6X7FVk4+U5KxUSKviYGM2k6zWkfyyBHy5rAtzgYJFa1ro2O9PtoxwQ==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "node_modules/console-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", + "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", + "dev": true, + "dependencies": { + "date-now": "^0.1.4" + } + }, + "node_modules/console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "dev": true + }, + "node_modules/continuable-cache": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/continuable-cache/-/continuable-cache-0.3.1.tgz", + "integrity": "sha1-vXJ6f67XfnH/OYWskzUakSczrQ8=", + "dev": true + }, + "node_modules/convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.1" + } + }, + "node_modules/core-js": { + "version": "3.6.4", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.4.tgz", + "integrity": "sha512-4paDGScNgZP2IXXilaffL9X7968RuvwlkK3xWtZRVqgd8SYNiVKRJvkFd1aqqEuPfN7E68ZHEp9hDj6lHj4Hyw==", + "dev": true, + "hasInstallScript": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, + "node_modules/core-js-compat": { + "version": "3.6.5", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.6.5.tgz", + "integrity": "sha512-7ItTKOhOZbznhXAQ2g/slGg1PJV5zDO/WdkTwi7UEOJmkvsE32PWvx6mKtDjiMpjnR2CNf6BAD6sSxIlv7ptng==", + "dev": true, + "dependencies": { + "browserslist": "^4.8.5", + "semver": "7.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, + "node_modules/core-js-compat/node_modules/semver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "node_modules/cosmiconfig": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", + "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", + "dev": true, + "dependencies": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.1.0", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.7.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cosmiconfig/node_modules/parse-json": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.0.tgz", + "integrity": "sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cosmiconfig/node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cpr": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/cpr/-/cpr-0.0.6.tgz", + "integrity": "sha1-U43SYnolrlDtoNwPgyKfuWDQhrM=", + "dev": true, + "dependencies": { + "graceful-fs": "~1.1.14", + "mkdirp": "~0.3.4", + "rimraf": "~2.0.2" + } + }, + "node_modules/cpr/node_modules/graceful-fs": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.1.14.tgz", + "integrity": "sha1-BweNtfY3f2Mh/Oqu30l94STclGU=", + "deprecated": "please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/cpr/node_modules/mkdirp": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz", + "integrity": "sha1-3j5fiWHIjHh+4TaN+EmsRBPsqNc=", + "deprecated": "Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)", + "dev": true + }, + "node_modules/cpr/node_modules/rimraf": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.0.3.tgz", + "integrity": "sha1-9QopZecUTpr9mYmC8V33BnMPVqk=", + "dev": true, + "optionalDependencies": { + "graceful-fs": "~1.1" + } + }, + "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/cross-spawn/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/cryptiles": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz", + "integrity": "sha1-7ZH/HxetE9N0gohZT4pIoNJvMlw=", + "deprecated": "This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).", + "dev": true, + "optional": true, + "dependencies": { + "boom": "0.4.x" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/css-tree": { + "version": "1.0.0-alpha.38", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.0.0-alpha.38.tgz", + "integrity": "sha512-pWuxS4kaECFopOc1NZff+dYdw+brc1Tt0UAuTiw56/Trtae4NdHtbDH24311UWfMmcpZe7jLy0e64ZeJg9t7bQ==", + "dev": true, + "dependencies": { + "mdn-data": "2.0.6", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/css-tree/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true, + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/csslint": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/csslint/-/csslint-0.10.0.tgz", + "integrity": "sha1-OmoE51Zcjp0ZvrSXZ8fslug2WAU=", + "dev": true, + "dependencies": { + "parserlib": "~0.2.2" + }, + "bin": { + "csslint": "cli.js" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/cssproc": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/cssproc/-/cssproc-0.0.7.tgz", + "integrity": "sha1-+Ch4pPhKvpcxVUK5ln9mUNhdPf4=", + "dev": true + }, + "node_modules/ctype": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.3.tgz", + "integrity": "sha1-gsGMJGH3QRTvFsE1IkrQuRRMoS8=", + "dev": true, + "optional": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/cucumber-messages": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/cucumber-messages/-/cucumber-messages-8.0.0.tgz", + "integrity": "sha512-lUnWRMjwA9+KhDec/5xRZV3Du67ISumHnVLywWQXyvzmc4P+Eqx8CoeQrBQoau3Pw1hs4kJLTDyV85hFBF00SQ==", + "dev": true, + "dependencies": { + "@types/uuid": "^3.4.6", + "protobufjs": "^6.8.8", + "uuid": "^3.3.3" + } + }, + "node_modules/dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "dependencies": { + "assert-plus": "^1.0.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/date-now": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", + "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", + "dev": true + }, + "node_modules/dateformat": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", + "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decamelize-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", + "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", + "dev": true, + "dependencies": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "node_modules/define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "dependencies": { + "object-keys": "^1.0.12" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "dev": true + }, + "node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/detect-file": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", + "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/dir-glob/node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/dom-serializer": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz", + "integrity": "sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA==", + "dev": true, + "dependencies": { + "domelementtype": "^1.3.0", + "entities": "^1.1.1" + } + }, + "node_modules/dom-serializer/node_modules/entities": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", + "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==", + "dev": true + }, + "node_modules/domelementtype": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", + "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==", + "dev": true + }, + "node_modules/domhandler": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.3.0.tgz", + "integrity": "sha1-LeWaCCLVAn+r/28DLCsloqir5zg=", + "dev": true, + "dependencies": { + "domelementtype": "1" + } + }, + "node_modules/domutils": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", + "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", + "dev": true, + "dependencies": { + "dom-serializer": "0", + "domelementtype": "1" + } + }, + "node_modules/duplexer": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", + "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", + "dev": true + }, + "node_modules/ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, + "dependencies": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/encoding": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", + "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "dev": true, + "optional": true, + "dependencies": { + "iconv-lite": "^0.6.2" + } + }, + "node_modules/encoding/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, + "optional": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/entities": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", + "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=", + "dev": true + }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/err-code": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", + "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", + "dev": true + }, + "node_modules/error": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/error/-/error-7.2.1.tgz", + "integrity": "sha512-fo9HBvWnx3NGUKMvMwB/CBCMMrfEJgbDTVDEkPygA3Bdd3lM1OyCd+rbQ8BwnpF6GdVeOLDNmyL4N5Bg80ZvdA==", + "dev": true, + "dependencies": { + "string-template": "~0.2.1" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/escodegen": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", + "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", + "dev": true, + "dependencies": { + "esprima": "^2.7.1", + "estraverse": "^1.9.1", + "esutils": "^2.0.2", + "optionator": "^0.8.1" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=0.12.0" + }, + "optionalDependencies": { + "source-map": "~0.2.0" + } + }, + "node_modules/escodegen/node_modules/esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/escodegen/node_modules/estraverse": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", + "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/escodegen/node_modules/source-map": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", + "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", + "dev": true, + "optional": true, + "dependencies": { + "amdefine": ">=0.0.4" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/eslint": { + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", + "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.10.0", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^1.4.3", + "eslint-visitor-keys": "^1.1.0", + "espree": "^6.1.2", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "inquirer": "^7.0.0", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.14", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.3", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "semver": "^6.1.2", + "strip-ansi": "^5.2.0", + "strip-json-comments": "^3.0.1", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^8.10.0 || ^10.13.0 || >=11.10.1" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-plugin-babel": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-babel/-/eslint-plugin-babel-5.3.0.tgz", + "integrity": "sha512-HPuNzSPE75O+SnxHIafbW5QB45r2w78fxqwK3HmjqIUoPfPzVrq6rD+CINU3yzoDSzEhUkX07VUphbF73Lth/w==", + "dev": true, + "dependencies": { + "eslint-rule-composer": "^0.3.0" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": ">=4.0.0" + } + }, + "node_modules/eslint-plugin-promise": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-4.2.1.tgz", + "integrity": "sha512-VoM09vT7bfA7D+upt+FjeBO5eHIJQBUWki1aPvB+vbNiHS3+oGIJGIeyBtKQTME6UPXXy3vV07OL1tHd3ANuDw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/eslint-rule-composer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz", + "integrity": "sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==", + "dev": true, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/eslint-scope": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", + "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==", + "dev": true, + "dependencies": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/eslint-utils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", + "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^1.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", + "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint/node_modules/ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/eslint/node_modules/globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "dependencies": { + "type-fest": "^0.8.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/eslint/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/eslint/node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/espree": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", + "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", + "dev": true, + "dependencies": { + "acorn": "^7.1.1", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.1.0" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esquery": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", + "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esquery/node_modules/estraverse": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.1.0.tgz", + "integrity": "sha512-FyohXK+R0vE+y1nHLoBM7ZTyqRpqAlhdZHCWIWEviFLiGB8b04H6bQs8G+XTthacvT8VuwvteiP7RJSxMs8UEw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "dependencies": { + "estraverse": "^4.1.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eventemitter2": { + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz", + "integrity": "sha1-j2G3XN4BKy6esoTUVFWDtWQ7Yas=", + "dev": true + }, + "node_modules/execall": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/execall/-/execall-2.0.0.tgz", + "integrity": "sha512-0FU2hZ5Hh6iQnarpRtQurM/aAvp3RIbfvgLHrcqJYzhXyV2KFruhuChf9NC6waAhiUR7FFtlugkI4p7f2Fqlow==", + "dev": true, + "dependencies": { + "clone-regexp": "^2.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/expand-tilde": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", + "dev": true, + "dependencies": { + "homedir-polyfill": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "node_modules/external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dev": true, + "dependencies": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true, + "engines": [ + "node >=0.6.0" + ] + }, + "node_modules/fast-deep-equal": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", + "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.2.tgz", + "integrity": "sha512-UDV82o4uQyljznxwMxyVRJgZZt3O5wENYojjzbaGEGZgeOxkLFf+V4cnUD+krzb2F72E18RhamkMZ7AdeggF7A==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2", + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "node_modules/fastq": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.7.0.tgz", + "integrity": "sha512-YOadQRnHd5q6PogvAR/x62BGituF2ufiEA6s8aavQANw5YKHERI4AREboX6KotzP8oX2klxYF2wcV/7bn1clfQ==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/faye-websocket": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.10.0.tgz", + "integrity": "sha1-TkkvjQTftviQA1B/btvy1QHnxvQ=", + "dev": true, + "dependencies": { + "websocket-driver": ">=0.5.1" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/fb-watchman": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz", + "integrity": "sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg==", + "dev": true, + "dependencies": { + "bser": "2.1.1" + } + }, + "node_modules/figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "dev": true, + "dependencies": { + "flat-cache": "^2.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/findup-sync": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz", + "integrity": "sha1-N5MKpdgWt3fANEXhlmzGeQpMCxY=", + "dev": true, + "dependencies": { + "glob": "~5.0.0" + }, + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/findup-sync/node_modules/glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, + "dependencies": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/fined": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fined/-/fined-1.2.0.tgz", + "integrity": "sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng==", + "dev": true, + "dependencies": { + "expand-tilde": "^2.0.2", + "is-plain-object": "^2.0.3", + "object.defaults": "^1.1.0", + "object.pick": "^1.2.0", + "parse-filepath": "^1.0.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/flagged-respawn": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz", + "integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "dependencies": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/flatted": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "dev": true + }, + "node_modules/for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/for-own": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", + "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", + "dev": true, + "dependencies": { + "for-in": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 0.12" + } + }, + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "node_modules/functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "node_modules/gauge": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.1.tgz", + "integrity": "sha512-zJ4jePUHR8cceduZ53b6temRalyGpkC2Kc2r3ecNphmL+uWNoJ3YcOcUjpbG6WwoE/Ef6/+aEZz63neI2WIa1Q==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1", + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16" + } + }, + "node_modules/gauge/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/gaze": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/gaze/-/gaze-1.1.3.tgz", + "integrity": "sha512-BRdNm8hbWzFzWHERTrejLqwHDfS4GibPoq5wjTPIoJHoBtKGPg3xAFfxmM+9ztbXelxcf2hwQcaz1PtmFeue8g==", + "dev": true, + "dependencies": { + "globule": "^1.0.0" + }, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/gear": { + "version": "0.8.18", + "resolved": "https://registry.npmjs.org/gear/-/gear-0.8.18.tgz", + "integrity": "sha1-JVft8B/2FFNYrfyoyBonzuik3Do=", + "dev": true, + "dependencies": { + "async": "0.2.x", + "mkdirp": "0.3.x" + }, + "bin": { + "gear": "bin/gear.js" + } + }, + "node_modules/gear-lib": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/gear-lib/-/gear-lib-0.9.2.tgz", + "integrity": "sha1-vI1GHryB7K/+mcHagqvg9W65NUA=", + "dev": true, + "dependencies": { + "async": "0.8.x", + "csslint": "0.10.x", + "gear": ">= 0.8.x", + "glob": "3.2.x", + "handlebars": "2.0.x", + "jshint": "2.5.x", + "jslint": "0.3.x", + "knox": "0.8.x", + "less": "1.7.x", + "mime": "1.2.x", + "uglify-js": "2.4.x" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gear-lib/node_modules/async": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/async/-/async-0.8.0.tgz", + "integrity": "sha1-7mXsdymML/FFa8RBigUtDwZDURI=", + "dev": true + }, + "node_modules/gear-lib/node_modules/glob": { + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz", + "integrity": "sha1-Spc/Y1uRkPcV0QmH1cAP0oFevj0=", + "dev": true, + "dependencies": { + "inherits": "2", + "minimatch": "0.3" + }, + "engines": { + "node": "*" + } + }, + "node_modules/gear-lib/node_modules/jshint": { + "version": "2.5.11", + "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.5.11.tgz", + "integrity": "sha1-4tlYWLuxqngwAQii6BCZ+wlWIuA=", + "dev": true, + "dependencies": { + "cli": "0.6.x", + "console-browserify": "1.1.x", + "exit": "0.1.x", + "htmlparser2": "3.8.x", + "minimatch": "1.0.x", + "shelljs": "0.3.x", + "strip-json-comments": "1.0.x", + "underscore": "1.6.x" + }, + "bin": { + "jshint": "bin/jshint" + } + }, + "node_modules/gear-lib/node_modules/jshint/node_modules/minimatch": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz", + "integrity": "sha1-4N0hILSeG3JM6NcUxSCCKpQ4V20=", + "deprecated": "Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue", + "dev": true, + "dependencies": { + "lru-cache": "2", + "sigmund": "~1.0.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/gear-lib/node_modules/lru-cache": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", + "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=", + "dev": true + }, + "node_modules/gear-lib/node_modules/mime": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz", + "integrity": "sha1-WCA+7Ybjpe8XrtK32evUfwpg3RA=", + "dev": true + }, + "node_modules/gear-lib/node_modules/minimatch": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz", + "integrity": "sha1-J12O2qxPG7MyZHIInnlJyDlGmd0=", + "deprecated": "Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue", + "dev": true, + "dependencies": { + "lru-cache": "2", + "sigmund": "~1.0.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/gear-lib/node_modules/source-map": { + "version": "0.1.34", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.34.tgz", + "integrity": "sha1-p8/omux7FoLDsZjQrPtH19CQVms=", + "dev": true, + "dependencies": { + "amdefine": ">=0.0.4" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/gear-lib/node_modules/strip-json-comments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz", + "integrity": "sha1-HhX7ysl9Pumb8tc7TGVrCCu6+5E=", + "dev": true, + "bin": { + "strip-json-comments": "cli.js" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/gear-lib/node_modules/uglify-js": { + "version": "2.4.24", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.4.24.tgz", + "integrity": "sha1-+tV1XB4Vd2WLsG/5q25UjJW+vW4=", + "dev": true, + "dependencies": { + "async": "~0.2.6", + "source-map": "0.1.34", + "uglify-to-browserify": "~1.0.0", + "yargs": "~3.5.4" + }, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/gear-lib/node_modules/uglify-js/node_modules/async": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", + "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=", + "dev": true + }, + "node_modules/gear/node_modules/async": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", + "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=", + "dev": true + }, + "node_modules/gear/node_modules/mkdirp": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz", + "integrity": "sha1-3j5fiWHIjHh+4TaN+EmsRBPsqNc=", + "deprecated": "Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)", + "dev": true + }, + "node_modules/gensync": { + "version": "1.0.0-beta.1", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", + "integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/getobject": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/getobject/-/getobject-1.0.1.tgz", + "integrity": "sha512-tj18lLe+917AACr6BdVoUuHnBPTVd9BEJp1vxnMZ58ztNvuxz9Ufa+wf3g37tlGITH35jggwZ2d9lcgHJJgXfQ==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "dependencies": { + "assert-plus": "^1.0.0" + } + }, + "node_modules/gherkin": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/gherkin/-/gherkin-9.0.0.tgz", + "integrity": "sha512-6xoAepoxo5vhkBXjB4RCfVnSKHu5z9SqXIQVUyj+Jw8BQX8odATlee5otXgdN8llZvyvHokuvNiBeB3naEnnIQ==", + "dev": true, + "dependencies": { + "commander": "^4.0.1", + "cucumber-messages": "8.0.0", + "source-map-support": "^0.5.16" + }, + "bin": { + "gherkin-javascript": "bin/gherkin" + } + }, + "node_modules/gherkin-lint": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/gherkin-lint/-/gherkin-lint-4.2.2.tgz", + "integrity": "sha512-+vu0wbrwxaaEdrheU9pH2MYR6zk38u2IkrCIg6IETUw1lkrNVAfIfOCihwrrL2NTJv5Iia/C7hZEBNwjGSkL2Q==", + "dev": true, + "dependencies": { + "commander": "5.0.0", + "core-js": "3.6.4", + "gherkin": "9.0.0", + "glob": "7.1.6", + "lodash": "4.17.21", + "strip-json-comments": "3.0.1", + "xml-js": "^1.6.11" + }, + "bin": { + "gherkin-lint": "dist/main.js" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/gherkin-lint/node_modules/strip-json-comments": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", + "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/gherkin/node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/global-modules": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", + "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", + "dev": true, + "dependencies": { + "global-prefix": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/global-prefix": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", + "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", + "dev": true, + "dependencies": { + "ini": "^1.3.5", + "kind-of": "^6.0.2", + "which": "^1.3.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/globby": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.0.tgz", + "integrity": "sha512-iuehFnR3xu5wBBtm4xi0dMe92Ob87ufyu/dHwpDYfbcpYpIbrO5OnS8M1vWvrBhSGEJ3/Ecj7gnX76P8YxpPEg==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby/node_modules/ignore": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.4.tgz", + "integrity": "sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/globjoin": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/globjoin/-/globjoin-0.1.4.tgz", + "integrity": "sha1-L0SUrIkZ43Z8XLtpHp9GMyQoXUM=", + "dev": true + }, + "node_modules/globule": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/globule/-/globule-1.2.1.tgz", + "integrity": "sha512-g7QtgWF4uYSL5/dn71WxubOrS7JVGCnFPEnoeChJmBnyR9Mw8nGoEwOgJL/RC2Te0WhbsEUCejfH8SZNJ+adYQ==", + "dev": true, + "dependencies": { + "glob": "~7.1.1", + "lodash": "~4.17.10", + "minimatch": "~3.0.2" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/gonzales-pe": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/gonzales-pe/-/gonzales-pe-4.3.0.tgz", + "integrity": "sha512-otgSPpUmdWJ43VXyiNgEYE4luzHCL2pz4wQ0OnDluC6Eg4Ko3Vexy/SrSynglw/eR+OhkzmqFCZa/OFa/RgAOQ==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "gonzales": "bin/gonzales.js" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/gonzales-pe/node_modules/minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "node_modules/graceful-fs": { + "version": "4.2.9", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz", + "integrity": "sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==", + "dev": true + }, + "node_modules/grunt": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.4.1.tgz", + "integrity": "sha512-ZXIYXTsAVrA7sM+jZxjQdrBOAg7DyMUplOMhTaspMRExei+fD0BTwdWXnn0W5SXqhb/Q/nlkzXclSi3IH55PIA==", + "dev": true, + "dependencies": { + "dateformat": "~3.0.3", + "eventemitter2": "~0.4.13", + "exit": "~0.1.2", + "findup-sync": "~0.3.0", + "glob": "~7.1.6", + "grunt-cli": "~1.4.2", + "grunt-known-options": "~2.0.0", + "grunt-legacy-log": "~3.0.0", + "grunt-legacy-util": "~2.0.1", + "iconv-lite": "~0.4.13", + "js-yaml": "~3.14.0", + "minimatch": "~3.0.4", + "mkdirp": "~1.0.4", + "nopt": "~3.0.6", + "rimraf": "~3.0.2" + }, + "bin": { + "grunt": "bin/grunt" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/grunt-babel": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/grunt-babel/-/grunt-babel-8.0.0.tgz", + "integrity": "sha512-WuiZFvGzcyzlEoPIcY1snI234ydDWeWWV5bpnB7PZsOLHcDsxWKnrR1rMWEUsbdVPPjvIirwFNsuo4CbJmsdFQ==", + "dev": true, + "engines": { + "node": ">=6.9" + }, + "peerDependencies": { + "@babel/core": "^7.0.0", + "grunt": ">=0.4.0" + } + }, + "node_modules/grunt-contrib-uglify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/grunt-contrib-uglify/-/grunt-contrib-uglify-4.0.1.tgz", + "integrity": "sha512-dwf8/+4uW1+7pH72WButOEnzErPGmtUvc8p08B0eQS/6ON0WdeQu0+WFeafaPTbbY1GqtS25lsHWaDeiTQNWPg==", + "dev": true, + "dependencies": { + "chalk": "^2.4.1", + "maxmin": "^2.1.0", + "uglify-js": "^3.5.0", + "uri-path": "^1.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/grunt-contrib-watch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/grunt-contrib-watch/-/grunt-contrib-watch-1.1.0.tgz", + "integrity": "sha512-yGweN+0DW5yM+oo58fRu/XIRrPcn3r4tQx+nL7eMRwjpvk+rQY6R8o94BPK0i2UhTg9FN21hS+m8vR8v9vXfeg==", + "dev": true, + "dependencies": { + "async": "^2.6.0", + "gaze": "^1.1.0", + "lodash": "^4.17.10", + "tiny-lr": "^1.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/grunt-contrib-watch/node_modules/async": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "dev": true, + "dependencies": { + "lodash": "^4.17.14" + } + }, + "node_modules/grunt-contrib-watch/node_modules/async/node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/grunt-eslint": { + "version": "22.0.0", + "resolved": "https://registry.npmjs.org/grunt-eslint/-/grunt-eslint-22.0.0.tgz", + "integrity": "sha512-I7vIU4x/mb20fmA6TAmLx6Wzn7mfs8ZXeuk7LbP2ujKVFV7KZmJ3qXUyqe2wnD+v/74Rs5uYOZrLL8EoBmlG9Q==", + "dev": true, + "dependencies": { + "chalk": "^2.1.0", + "eslint": "^6.0.1" + }, + "engines": { + "node": ">=8" + }, + "peerDependencies": { + "grunt": ">=1" + } + }, + "node_modules/grunt-known-options": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-2.0.0.tgz", + "integrity": "sha512-GD7cTz0I4SAede1/+pAbmJRG44zFLPipVtdL9o3vqx9IEyb7b4/Y3s7r6ofI3CchR5GvYJ+8buCSioDv5dQLiA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/grunt-legacy-log": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/grunt-legacy-log/-/grunt-legacy-log-3.0.0.tgz", + "integrity": "sha512-GHZQzZmhyq0u3hr7aHW4qUH0xDzwp2YXldLPZTCjlOeGscAOWWPftZG3XioW8MasGp+OBRIu39LFx14SLjXRcA==", + "dev": true, + "dependencies": { + "colors": "~1.1.2", + "grunt-legacy-log-utils": "~2.1.0", + "hooker": "~0.2.3", + "lodash": "~4.17.19" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/grunt-legacy-log-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/grunt-legacy-log-utils/-/grunt-legacy-log-utils-2.1.0.tgz", + "integrity": "sha512-lwquaPXJtKQk0rUM1IQAop5noEpwFqOXasVoedLeNzaibf/OPWjKYvvdqnEHNmU+0T0CaReAXIbGo747ZD+Aaw==", + "dev": true, + "dependencies": { + "chalk": "~4.1.0", + "lodash": "~4.17.19" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/grunt-legacy-log-utils/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/grunt-legacy-log-utils/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/grunt-legacy-log-utils/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/grunt-legacy-log-utils/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/grunt-legacy-log-utils/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/grunt-legacy-log-utils/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/grunt-legacy-util": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/grunt-legacy-util/-/grunt-legacy-util-2.0.1.tgz", + "integrity": "sha512-2bQiD4fzXqX8rhNdXkAywCadeqiPiay0oQny77wA2F3WF4grPJXCvAcyoWUJV+po/b15glGkxuSiQCK299UC2w==", + "dev": true, + "dependencies": { + "async": "~3.2.0", + "exit": "~0.1.2", + "getobject": "~1.0.0", + "hooker": "~0.2.3", + "lodash": "~4.17.21", + "underscore.string": "~3.3.5", + "which": "~2.0.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/grunt-legacy-util/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/grunt-sass": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/grunt-sass/-/grunt-sass-3.1.0.tgz", + "integrity": "sha512-90s27H7FoCDcA8C8+R0GwC+ntYD3lG6S/jqcavWm3bn9RiJTmSfOvfbFa1PXx4NbBWuiGQMLfQTj/JvvqT5w6A==", + "dev": true, + "engines": { + "node": ">=8" + }, + "peerDependencies": { + "grunt": ">=1" + } + }, + "node_modules/grunt-stylelint": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/grunt-stylelint/-/grunt-stylelint-0.15.0.tgz", + "integrity": "sha512-1G5kbT3Y6OtAqgIv/XErtI6ai1t1UdtQWXxUV5Gd900PQoEzu/WrBYhGNAXdb/9nAsNWNjFHQjtdXQtZcDmobA==", + "dev": true, + "dependencies": { + "chalk": "^3.0.0" + }, + "peerDependencies": { + "stylelint": "^13.3.2" + } + }, + "node_modules/grunt-stylelint/node_modules/ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "dependencies": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/grunt-stylelint/node_modules/chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/grunt-stylelint/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/grunt-stylelint/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/grunt-stylelint/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/grunt-stylelint/node_modules/supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/grunt/node_modules/grunt-cli": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.4.3.tgz", + "integrity": "sha512-9Dtx/AhVeB4LYzsViCjUQkd0Kw0McN2gYpdmGYKtE2a5Yt7v1Q+HYZVWhqXc/kGnxlMtqKDxSwotiGeFmkrCoQ==", + "dev": true, + "dependencies": { + "grunt-known-options": "~2.0.0", + "interpret": "~1.1.0", + "liftup": "~3.0.1", + "nopt": "~4.0.1", + "v8flags": "~3.2.0" + }, + "bin": { + "grunt": "bin/grunt" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/grunt/node_modules/grunt-cli/node_modules/nopt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", + "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", + "dev": true, + "dependencies": { + "abbrev": "1", + "osenv": "^0.1.4" + }, + "bin": { + "nopt": "bin/nopt.js" + } + }, + "node_modules/grunt/node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/grunt/node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/grunt/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/gzip-size": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-3.0.0.tgz", + "integrity": "sha1-VGGI6b3DN/Zzdy+BZgRks4nc5SA=", + "dev": true, + "dependencies": { + "duplexer": "^0.1.1" + }, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/handlebars": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-2.0.0.tgz", + "integrity": "sha1-bp1/hRSjRn+l6fgswVjs/B1ax28=", + "dev": true, + "dependencies": { + "optimist": "~0.3" + }, + "bin": { + "handlebars": "bin/handlebars" + }, + "engines": { + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "~2.3" + } + }, + "node_modules/handlebars/node_modules/async": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", + "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=", + "dev": true, + "optional": true + }, + "node_modules/handlebars/node_modules/source-map": { + "version": "0.1.43", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", + "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", + "dev": true, + "optional": true, + "dependencies": { + "amdefine": ">=0.0.4" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/handlebars/node_modules/uglify-js": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.3.6.tgz", + "integrity": "sha1-+gmEdwtCi3qbKoBY9GNV0U/vIRo=", + "dev": true, + "optional": true, + "dependencies": { + "async": "~0.2.6", + "optimist": "~0.3.5", + "source-map": "~0.1.7" + }, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/har-validator": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "deprecated": "this library is no longer supported", + "dev": true, + "dependencies": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/har-validator/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/hard-rejection": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", + "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "dev": true + }, + "node_modules/hawk": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-1.1.1.tgz", + "integrity": "sha1-h81JH5tG5OKurKM1QWdmiF0tHtk=", + "deprecated": "This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.", + "dev": true, + "optional": true, + "dependencies": { + "boom": "0.4.x", + "cryptiles": "0.2.x", + "hoek": "0.9.x", + "sntp": "0.2.x" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/hoek": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz", + "integrity": "sha1-PTIkYrrfB3Fup+uFuviAec3c5QU=", + "deprecated": "This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/homedir-polyfill": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", + "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", + "dev": true, + "dependencies": { + "parse-passwd": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/hooker": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/hooker/-/hooker-0.2.3.tgz", + "integrity": "sha1-uDT3I8xKJCqmWWNFnfbZhMXT2Vk=", + "dev": true, + "engines": { + "node": "*" + } + }, + "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/html-tags": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/html-tags/-/html-tags-3.1.0.tgz", + "integrity": "sha512-1qYz89hW3lFDEazhjW0yVAV87lw8lVkrJocr72XmBkMKsoSVJCQx3W8BXsC7hO2qAt8BoVjYjtAcZ9perqGnNg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/htmlparser2": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", + "integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=", + "dev": true, + "dependencies": { + "domelementtype": "1", + "domhandler": "2.3", + "domutils": "1.5", + "entities": "1.0", + "readable-stream": "1.1" + } + }, + "node_modules/htmlparser2/node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "node_modules/htmlparser2/node_modules/readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "node_modules/htmlparser2/node_modules/string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + }, + "node_modules/http-cache-semantics": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", + "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", + "dev": true + }, + "node_modules/http-parser-js": { + "version": "0.4.10", + "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.4.10.tgz", + "integrity": "sha1-ksnBN0w1CF912zWexWzCV8u5P6Q=", + "dev": true + }, + "node_modules/http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "dev": true, + "dependencies": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "dependencies": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + }, + "engines": { + "node": ">=0.8", + "npm": ">=1.3.7" + } + }, + "node_modules/https-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", + "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "dev": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=", + "dev": true, + "dependencies": { + "ms": "^2.0.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/import-lazy": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", + "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/indexes-of": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz", + "integrity": "sha1-8w9xbI4r00bHtn0985FVZqfAVgc=", + "dev": true + }, + "node_modules/infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "dev": true + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, + "node_modules/inquirer": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.1.0.tgz", + "integrity": "sha512-5fJMWEmikSYu0nv/flMc475MhGbB7TSPd/2IpFV4I4rMklboCH2rQjYY5kKiYGHqUF9gvaambupcJFFG9dvReg==", + "dev": true, + "dependencies": { + "ansi-escapes": "^4.2.1", + "chalk": "^3.0.0", + "cli-cursor": "^3.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.15", + "mute-stream": "0.0.8", + "run-async": "^2.4.0", + "rxjs": "^6.5.3", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/inquirer/node_modules/ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/inquirer/node_modules/ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "dependencies": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/inquirer/node_modules/chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/inquirer/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/inquirer/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/inquirer/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/inquirer/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/inquirer/node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/inquirer/node_modules/string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/inquirer/node_modules/strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/inquirer/node_modules/supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/interpret": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", + "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=", + "dev": true + }, + "node_modules/invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "dev": true, + "dependencies": { + "loose-envify": "^1.0.0" + } + }, + "node_modules/ip": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", + "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=", + "dev": true + }, + "node_modules/is-absolute": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", + "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", + "dev": true, + "dependencies": { + "is-relative": "^1.0.0", + "is-windows": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-alphabetical": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.4.tgz", + "integrity": "sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-alphanumerical": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-1.0.4.tgz", + "integrity": "sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A==", + "dev": true, + "dependencies": { + "is-alphabetical": "^1.0.0", + "is-decimal": "^1.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "node_modules/is-buffer": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", + "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/is-core-module": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.5.0.tgz", + "integrity": "sha512-TXCMSDsEHMEEZ6eCA8rwRDbLu55MRGmrctljsBX/2v1d9/GzqHOxW5c5oPSgrUt2vBFXebu9rGqckXGPWOlYpg==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-decimal": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.4.tgz", + "integrity": "sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-hexadecimal": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz", + "integrity": "sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-lambda": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", + "integrity": "sha1-PZh3iZ5qU+/AFgUEzeFfgubwYdU=", + "dev": true + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, + "node_modules/is-regexp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-2.1.0.tgz", + "integrity": "sha512-OZ4IlER3zmRIoB9AqNhEggVxqIH4ofDns5nRrPS6yQxXE1TPCUpFznBfRQmQa8uC+pXqjMnukiJBxCisIxiLGA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/is-relative": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", + "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", + "dev": true, + "dependencies": { + "is-unc-path": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "node_modules/is-unc-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", + "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", + "dev": true, + "dependencies": { + "unc-path-regex": "^0.1.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "node_modules/istanbul": { + "version": "0.4.5", + "resolved": "https://github.com/andrewnicols/istanbul/archive/v0.4.5_moodle-0.tar.gz", + "integrity": "sha512-/cUwJCicWFnJrjYPFy51m0xauDlTUZNztxjYE5oaLuLvCASTv4gFYsjwoEqMQAe0fYRBIRnwcag7KjPXQnpSsw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "abbrev": "1.0.x", + "async": "1.x", + "escodegen": "1.8.x", + "esprima": "2.7.x", + "glob": "^5.0.15", + "handlebars": "^4.0.1", + "js-yaml": "3.x", + "mkdirp": "0.5.x", + "nopt": "3.x", + "once": "1.x", + "resolve": "1.1.x", + "supports-color": "^3.1.0", + "which": "^1.1.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "istanbul": "lib/cli.js" + } + }, + "node_modules/istanbul/node_modules/abbrev": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", + "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", + "dev": true + }, + "node_modules/istanbul/node_modules/async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "node_modules/istanbul/node_modules/esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/istanbul/node_modules/glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, + "dependencies": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/istanbul/node_modules/handlebars": { + "version": "4.7.6", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.6.tgz", + "integrity": "sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5", + "neo-async": "^2.6.0", + "source-map": "^0.6.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" + }, + "engines": { + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" + } + }, + "node_modules/istanbul/node_modules/has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/istanbul/node_modules/minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "node_modules/istanbul/node_modules/resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true + }, + "node_modules/istanbul/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/istanbul/node_modules/supports-color": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "dev": true, + "dependencies": { + "has-flag": "^1.0.0" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/istanbul/node_modules/wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, + "node_modules/js-base64": { + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.6.4.tgz", + "integrity": "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==", + "dev": true + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true + }, + "node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/jshint": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.11.0.tgz", + "integrity": "sha512-ooaD/hrBPhu35xXW4gn+o3SOuzht73gdBuffgJzrZBJZPGgGiiTvJEgTyxFvBO2nz0+X1G6etF8SzUODTlLY6Q==", + "dev": true, + "dependencies": { + "cli": "~1.0.0", + "console-browserify": "1.1.x", + "exit": "0.1.x", + "htmlparser2": "3.8.x", + "lodash": "~4.17.11", + "minimatch": "~3.0.2", + "shelljs": "0.3.x", + "strip-json-comments": "1.0.x" + }, + "bin": { + "jshint": "bin/jshint" + } + }, + "node_modules/jshint/node_modules/cli": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cli/-/cli-1.0.1.tgz", + "integrity": "sha1-IoF1NPJL+klQw01TLUjsvGIbjBQ=", + "dev": true, + "dependencies": { + "exit": "0.1.2", + "glob": "^7.1.1" + }, + "engines": { + "node": ">=0.2.5" + } + }, + "node_modules/jshint/node_modules/strip-json-comments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz", + "integrity": "sha1-HhX7ysl9Pumb8tc7TGVrCCu6+5E=", + "dev": true, + "bin": { + "strip-json-comments": "cli.js" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/jslint": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/jslint/-/jslint-0.3.4.tgz", + "integrity": "sha1-+3aKyN4GQfzFcMh8ofvSjik8jXU=", + "dev": true, + "dependencies": { + "nopt": "~1.0.0" + }, + "bin": { + "jslint": "bin/jslint.js" + }, + "engines": { + "node": ">=0.4.12" + }, + "optionalDependencies": { + "glob": "~3.2.8" + } + }, + "node_modules/jslint/node_modules/glob": { + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz", + "integrity": "sha1-Spc/Y1uRkPcV0QmH1cAP0oFevj0=", + "dev": true, + "optional": true, + "dependencies": { + "inherits": "2", + "minimatch": "0.3" + }, + "engines": { + "node": "*" + } + }, + "node_modules/jslint/node_modules/lru-cache": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", + "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=", + "dev": true, + "optional": true + }, + "node_modules/jslint/node_modules/minimatch": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz", + "integrity": "sha1-J12O2qxPG7MyZHIInnlJyDlGmd0=", + "deprecated": "Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue", + "dev": true, + "optional": true, + "dependencies": { + "lru-cache": "2", + "sigmund": "~1.0.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/jslint/node_modules/nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", + "dev": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": "*" + } + }, + "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 + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "node_modules/json-schema": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "node_modules/json5": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", + "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json5/node_modules/minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "node_modules/jsprim": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", + "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", + "dev": true, + "dependencies": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.4.0", + "verror": "1.10.0" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/known-css-properties": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.18.0.tgz", + "integrity": "sha512-69AgJ1rQa7VvUsd2kpvVq+VeObDuo3zrj0CzM5Slmf6yduQFAI2kXPDQJR2IE/u6MSAUOJrwSzjg5vlz8qcMiw==", + "dev": true + }, + "node_modules/knox": { + "version": "0.8.10", + "resolved": "https://registry.npmjs.org/knox/-/knox-0.8.10.tgz", + "integrity": "sha1-ai7c2sHSrjedHhmU1Vm5XCg7JYg=", + "dev": true, + "dependencies": { + "debug": "~0.7.0", + "mime": "*", + "stream-counter": "~0.1.0", + "xml2js": "0.2.x" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/knox/node_modules/debug": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-0.7.4.tgz", + "integrity": "sha1-BuHqgILCyxTjmAbiLi9vdX+Srzk=", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/less": { + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/less/-/less-1.7.5.tgz", + "integrity": "sha1-TyIM9yiKJ+rKc5325ICKLUwNV1Y=", + "dev": true, + "bin": { + "lessc": "bin/lessc" + }, + "engines": { + "node": ">=0.8.0" + }, + "optionalDependencies": { + "clean-css": "2.2.x", + "graceful-fs": "~3.0.2", + "mime": "~1.2.11", + "mkdirp": "~0.5.0", + "request": "~2.40.0", + "source-map": "0.1.x" + } + }, + "node_modules/less/node_modules/asn1": { + "version": "0.1.11", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz", + "integrity": "sha1-VZvhg3bQik7E2+gId9J4GGObLfc=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.4.9" + } + }, + "node_modules/less/node_modules/assert-plus": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.5.tgz", + "integrity": "sha1-7nQAlBMALYTOxyGcasgRgS5yMWA=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/less/node_modules/async": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", + "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=", + "dev": true, + "optional": true + }, + "node_modules/less/node_modules/aws-sign2": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz", + "integrity": "sha1-xXED96F/wDfwLXwuZLYC6iI/fWM=", + "dev": true, + "optional": true, + "engines": { + "node": "*" + } + }, + "node_modules/less/node_modules/combined-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz", + "integrity": "sha1-ATfmV7qlp1QcV6w3rF/AfXO03B8=", + "dev": true, + "optional": true, + "dependencies": { + "delayed-stream": "0.0.5" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/less/node_modules/delayed-stream": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz", + "integrity": "sha1-1LH0OpPoKW3+AmlPRoC8N6MTxz8=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/less/node_modules/forever-agent": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.5.2.tgz", + "integrity": "sha1-bQ4JxJIflKJ/Y9O0nF/v8epMUTA=", + "dev": true, + "optional": true, + "engines": { + "node": "*" + } + }, + "node_modules/less/node_modules/form-data": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-0.1.4.tgz", + "integrity": "sha1-kavXiKupcCsaq/qLwBAxoqyeOxI=", + "dev": true, + "optional": true, + "dependencies": { + "async": "~0.9.0", + "combined-stream": "~0.0.4", + "mime": "~1.2.11" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/less/node_modules/graceful-fs": { + "version": "3.0.12", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.12.tgz", + "integrity": "sha512-J55gaCS4iTTJfTXIxSVw3EMQckcqkpdRv3IR7gu6sq0+tbC363Zx6KH/SEwXASK9JRbhyZmVjJEVJIOxYsB3Qg==", + "dev": true, + "optional": true, + "dependencies": { + "natives": "^1.1.3" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/less/node_modules/http-signature": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-0.10.1.tgz", + "integrity": "sha1-T72sEyVZqoMjEh5UB3nAoBKyfmY=", + "dev": true, + "optional": true, + "dependencies": { + "asn1": "0.1.11", + "assert-plus": "^0.1.5", + "ctype": "0.5.3" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/less/node_modules/mime": { + "version": "1.2.11", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz", + "integrity": "sha1-WCA+7Ybjpe8XrtK32evUfwpg3RA=", + "dev": true, + "optional": true + }, + "node_modules/less/node_modules/mime-types": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-1.0.2.tgz", + "integrity": "sha1-mVrhOSq4r/y/yyZB3QVOlDwNXc4=", + "dev": true, + "optional": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/less/node_modules/node-uuid": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.8.tgz", + "integrity": "sha1-sEDrCSOWivq/jTL7HxfxFn/auQc=", + "deprecated": "Use uuid module instead", + "dev": true, + "optional": true, + "bin": { + "uuid": "bin/uuid" + } + }, + "node_modules/less/node_modules/oauth-sign": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.3.0.tgz", + "integrity": "sha1-y1QPk7srIqfVlBaRoojWDo6pOG4=", + "dev": true, + "optional": true, + "engines": { + "node": "*" + } + }, + "node_modules/less/node_modules/qs": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-1.0.2.tgz", + "integrity": "sha1-UKk+K1r2aRwxvOpdrnjubqGQN2g=", + "dev": true, + "optional": true + }, + "node_modules/less/node_modules/request": { + "version": "2.40.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.40.0.tgz", + "integrity": "sha1-TdZw9pbx5uhC5mtLXoOTAaub62c=", + "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", + "dev": true, + "engines": [ + "node >= 0.8.0" + ], + "optional": true, + "dependencies": { + "forever-agent": "~0.5.0", + "json-stringify-safe": "~5.0.0", + "mime-types": "~1.0.1", + "node-uuid": "~1.4.0", + "qs": "~1.0.0" + }, + "optionalDependencies": { + "aws-sign2": "~0.5.0", + "form-data": "~0.1.0", + "hawk": "1.1.1", + "http-signature": "~0.10.0", + "oauth-sign": "~0.3.0", + "stringstream": "~0.0.4", + "tough-cookie": ">=0.12.0", + "tunnel-agent": "~0.4.0" + } + }, + "node_modules/less/node_modules/source-map": { + "version": "0.1.43", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", + "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", + "dev": true, + "optional": true, + "dependencies": { + "amdefine": ">=0.0.4" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/less/node_modules/tunnel-agent": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", + "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=", + "dev": true, + "optional": true, + "engines": { + "node": "*" + } + }, + "node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/levenary": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/levenary/-/levenary-1.1.1.tgz", + "integrity": "sha512-mkAdOIt79FD6irqjYSs4rdbnlT5vRonMEvBVPVb3XmevfS8kgRXwfes0dhPdEtzTWD/1eNE/Bm/G1iRt6DcnQQ==", + "dev": true, + "dependencies": { + "leven": "^3.1.0" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "dependencies": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/liftup": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/liftup/-/liftup-3.0.1.tgz", + "integrity": "sha512-yRHaiQDizWSzoXk3APcA71eOI/UuhEkNN9DiW2Tt44mhYzX4joFoCZlxsSOF7RyeLlfqzFLQI1ngFq3ggMPhOw==", + "dev": true, + "dependencies": { + "extend": "^3.0.2", + "findup-sync": "^4.0.0", + "fined": "^1.2.0", + "flagged-respawn": "^1.0.1", + "is-plain-object": "^2.0.4", + "object.map": "^1.0.1", + "rechoir": "^0.7.0", + "resolve": "^1.19.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/liftup/node_modules/findup-sync": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-4.0.0.tgz", + "integrity": "sha512-6jvvn/12IC4quLBL1KNokxC7wWTvYncaVUYSoxWw7YykPLuRrnv4qdHcSOywOI5RpkOVGeQRtWM8/q+G6W6qfQ==", + "dev": true, + "dependencies": { + "detect-file": "^1.0.0", + "is-glob": "^4.0.0", + "micromatch": "^4.0.2", + "resolve-dir": "^1.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/liftup/node_modules/resolve": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "dev": true, + "dependencies": { + "is-core-module": "^2.2.0", + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/lines-and-columns": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", + "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", + "dev": true + }, + "node_modules/livereload-js": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/livereload-js/-/livereload-js-2.4.0.tgz", + "integrity": "sha512-XPQH8Z2GDP/Hwz2PCDrh2mth4yFejwA1OZ/81Ti3LgKyhDcEjsSsqFWZojHG0va/duGd+WyosY7eXLDoOyqcPw==", + "dev": true + }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/log-symbols": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", + "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", + "dev": true, + "dependencies": { + "chalk": "^2.4.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==", + "dev": true + }, + "node_modules/longest-streak": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-2.0.4.tgz", + "integrity": "sha512-vM6rUVCVUJJt33bnmHiZEvr7wPT78ztX7rojL+LW51bHtLh6HTjx84LA5W4+oa6aKEJA7jJu5LR6vQRBpA5DVg==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/make-fetch-happen": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz", + "integrity": "sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==", + "dev": true, + "dependencies": { + "agentkeepalive": "^4.1.3", + "cacache": "^15.2.0", + "http-cache-semantics": "^4.1.0", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^6.0.0", + "minipass": "^3.1.3", + "minipass-collect": "^1.0.2", + "minipass-fetch": "^1.3.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.2", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^6.0.0", + "ssri": "^8.0.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/make-iterator": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", + "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/mathml-tag-names": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz", + "integrity": "sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/maxmin": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/maxmin/-/maxmin-2.1.0.tgz", + "integrity": "sha1-TTsiCQPZXu5+t6x/qGTnLcCaMWY=", + "dev": true, + "dependencies": { + "chalk": "^1.0.0", + "figures": "^1.0.1", + "gzip-size": "^3.0.0", + "pretty-bytes": "^3.0.0" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/maxmin/node_modules/chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "dependencies": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/maxmin/node_modules/figures": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "dev": true, + "dependencies": { + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/maxmin/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/mdast-util-from-markdown": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-0.8.5.tgz", + "integrity": "sha512-2hkTXtYYnr+NubD/g6KGBS/0mFmBcifAsI0yIWRiRo0PjVs6SSOSOdtzbp6kSGnShDN6G5aWZpKQ2lWRy27mWQ==", + "dev": true, + "dependencies": { + "@types/mdast": "^3.0.0", + "mdast-util-to-string": "^2.0.0", + "micromark": "~2.11.0", + "parse-entities": "^2.0.0", + "unist-util-stringify-position": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-markdown": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-0.6.5.tgz", + "integrity": "sha512-XeV9sDE7ZlOQvs45C9UKMtfTcctcaj/pGwH8YLbMHoMOXNNCn2LsqVQOqrF1+/NU8lKDAqozme9SCXWyo9oAcQ==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "longest-streak": "^2.0.0", + "mdast-util-to-string": "^2.0.0", + "parse-entities": "^2.0.0", + "repeat-string": "^1.0.0", + "zwitch": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-2.0.0.tgz", + "integrity": "sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdn-data": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.6.tgz", + "integrity": "sha512-rQvjv71olwNHgiTbfPZFkJtjNMciWgswYeciZhtvWLO8bmX3TnhyA62I6sTWOyZssWHJJjY6/KiWwqQsWWsqOA==", + "dev": true + }, + "node_modules/meow": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-9.0.0.tgz", + "integrity": "sha512-+obSblOQmRhcyBt62furQqRAQpNyWXo8BuQ5bN7dG8wmwQ+vwHKp/rCFD4CrTP8CsDQD1sjoZ94K417XEUk8IQ==", + "dev": true, + "dependencies": { + "@types/minimist": "^1.2.0", + "camelcase-keys": "^6.2.2", + "decamelize": "^1.2.0", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "4.1.0", + "normalize-package-data": "^3.0.0", + "read-pkg-up": "^7.0.1", + "redent": "^3.0.0", + "trim-newlines": "^3.0.0", + "type-fest": "^0.18.0", + "yargs-parser": "^20.2.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/meow/node_modules/hosted-git-info": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/meow/node_modules/is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/meow/node_modules/minimist-options": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", + "dev": true, + "dependencies": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/meow/node_modules/normalize-package-data": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", + "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^4.0.1", + "is-core-module": "^2.5.0", + "semver": "^7.3.4", + "validate-npm-package-license": "^3.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/meow/node_modules/semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/meow/node_modules/type-fest": { + "version": "0.18.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz", + "integrity": "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/merge2": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.3.0.tgz", + "integrity": "sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/micromark": { + "version": "2.11.4", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-2.11.4.tgz", + "integrity": "sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==", + "dev": true, + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "dependencies": { + "debug": "^4.0.0", + "parse-entities": "^2.0.0" + } + }, + "node_modules/micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "dev": true, + "dependencies": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/mime": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.5.2.tgz", + "integrity": "sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg==", + "dev": true, + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/mime-db": { + "version": "1.51.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", + "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.34", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", + "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", + "dev": true, + "dependencies": { + "mime-db": "1.51.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/min-indent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.0.tgz", + "integrity": "sha1-z8RcN+nsDY8KDsPdTvf3w6vjklY=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist-options": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.0.2.tgz", + "integrity": "sha512-seq4hpWkYSUh1y7NXxzucwAN9yVlBc3Upgdjz8vLCP97jG8kaOmzYrVH/m7tQ1NYD1wdtZbSLfdy4zFmRWuc/w==", + "dev": true, + "dependencies": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/minimist-options/node_modules/is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/minipass": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.6.tgz", + "integrity": "sha512-rty5kpw9/z8SX9dmxblFA6edItUmwJgMeYDZRrwlIVN27i8gysGbznJwUggw2V/FVqFSDdWy040ZPS811DYAqQ==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-collect": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", + "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minipass-fetch": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz", + "integrity": "sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==", + "dev": true, + "dependencies": { + "minipass": "^3.1.0", + "minipass-sized": "^1.0.3", + "minizlib": "^2.0.0" + }, + "engines": { + "node": ">=8" + }, + "optionalDependencies": { + "encoding": "^0.1.12" + } + }, + "node_modules/minipass-flush": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", + "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minipass-pipeline": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", + "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-sized": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", + "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/mkdirp/node_modules/minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "dev": true + }, + "node_modules/nan": { + "version": "2.15.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz", + "integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==", + "dev": true + }, + "node_modules/natives": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/natives/-/natives-1.1.6.tgz", + "integrity": "sha512-6+TDFewD4yxY14ptjKaS63GVdtKiES1pTPyxn9Jb0rBqPMZ7VcCiooEhPNsr+mqHtMGxa/5c/HhcC4uPEUw/nA==", + "deprecated": "This module relies on Node.js's internals and will break at some point. Do not use it, and update to graceful-fs@4.x.", + "dev": true, + "optional": true + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/neo-async": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", + "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==", + "dev": true + }, + "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-gyp": { + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz", + "integrity": "sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==", + "dev": true, + "dependencies": { + "env-paths": "^2.2.0", + "glob": "^7.1.4", + "graceful-fs": "^4.2.6", + "make-fetch-happen": "^9.1.0", + "nopt": "^5.0.0", + "npmlog": "^6.0.0", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.2", + "which": "^2.0.2" + }, + "bin": { + "node-gyp": "bin/node-gyp.js" + }, + "engines": { + "node": ">= 10.12.0" + } + }, + "node_modules/node-gyp/node_modules/nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "dev": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/node-gyp/node_modules/npmlog": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.1.tgz", + "integrity": "sha512-BTHDvY6nrRHuRfyjt1MAufLxYdVXZfd099H4+i1f0lPywNQyI4foeNXJRObB/uy+TYqUW0vAD9gbdSOXPst7Eg==", + "dev": true, + "dependencies": { + "are-we-there-yet": "^3.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^4.0.0", + "set-blocking": "^2.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16" + } + }, + "node_modules/node-gyp/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/node-gyp/node_modules/semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-gyp/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", + "dev": true + }, + "node_modules/node-sass": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-7.0.1.tgz", + "integrity": "sha512-uMy+Xt29NlqKCFdFRZyXKOTqGt+QaKHexv9STj2WeLottnlqZEEWx6Bj0MXNthmFRRdM/YwyNo/8Tr46TOM0jQ==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "async-foreach": "^0.1.3", + "chalk": "^4.1.2", + "cross-spawn": "^7.0.3", + "gaze": "^1.0.0", + "get-stdin": "^4.0.1", + "glob": "^7.0.3", + "lodash": "^4.17.15", + "meow": "^9.0.0", + "nan": "^2.13.2", + "node-gyp": "^8.4.1", + "npmlog": "^5.0.0", + "request": "^2.88.0", + "sass-graph": "4.0.0", + "stdout-stream": "^1.4.0", + "true-case-path": "^1.0.2" + }, + "bin": { + "node-sass": "bin/node-sass" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/node-sass/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/node-sass/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/node-sass/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/node-sass/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/node-sass/node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/node-sass/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/node-sass/node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/node-sass/node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/node-sass/node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/node-sass/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/node-sass/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "dev": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + } + }, + "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/normalize-package-data/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/normalize-range": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz", + "integrity": "sha1-LRDAa9/TEuqXd2laTShDlFa3WUI=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/normalize-selector": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/normalize-selector/-/normalize-selector-0.2.0.tgz", + "integrity": "sha1-0LFF62kRicY6eNIB3E/bEpPvDAM=", + "dev": true + }, + "node_modules/npmlog": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "dev": true, + "dependencies": { + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" + } + }, + "node_modules/npmlog/node_modules/are-we-there-yet": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "dev": true, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/npmlog/node_modules/gauge": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "dev": true, + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/num2fraction": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/num2fraction/-/num2fraction-1.2.2.tgz", + "integrity": "sha1-b2gragJ6Tp3fpFZM0lidHU5mnt4=", + "dev": true + }, + "node_modules/number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "dependencies": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.defaults": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", + "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=", + "dev": true, + "dependencies": { + "array-each": "^1.0.1", + "array-slice": "^1.0.0", + "for-own": "^1.0.0", + "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object.map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz", + "integrity": "sha1-z4Plncj8wK1fQlDh94s7gb2AHTc=", + "dev": true, + "dependencies": { + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz", + "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==", + "dev": true, + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/optimist": { + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz", + "integrity": "sha1-yQlBrVnkJzMokjB00s8ufLxuwNk=", + "dev": true, + "dependencies": { + "wordwrap": "~0.0.2" + } + }, + "node_modules/optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, + "dependencies": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/osenv": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", + "dev": true, + "dependencies": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-entities": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-2.0.0.tgz", + "integrity": "sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ==", + "dev": true, + "dependencies": { + "character-entities": "^1.0.0", + "character-entities-legacy": "^1.0.0", + "character-reference-invalid": "^1.0.0", + "is-alphanumerical": "^1.0.0", + "is-decimal": "^1.0.0", + "is-hexadecimal": "^1.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/parse-filepath": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", + "integrity": "sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE=", + "dev": true, + "dependencies": { + "is-absolute": "^1.0.0", + "map-cache": "^0.2.0", + "path-root": "^0.1.1" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parse-passwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/parserlib": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/parserlib/-/parserlib-0.2.5.tgz", + "integrity": "sha1-hZB92GBaoGq7PdKV1QuyuPpN0Rc=", + "dev": true + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "node_modules/path-root": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz", + "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=", + "dev": true, + "dependencies": { + "path-root-regex": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-root-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz", + "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", + "dev": true, + "dependencies": { + "chalk": "^2.4.2", + "source-map": "^0.6.1", + "supports-color": "^6.1.0" + }, + "engines": { + "node": ">=6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + } + }, + "node_modules/postcss-html": { + "version": "0.36.0", + "resolved": "https://registry.npmjs.org/postcss-html/-/postcss-html-0.36.0.tgz", + "integrity": "sha512-HeiOxGcuwID0AFsNAL0ox3mW6MHH5cstWN1Z3Y+n6H+g12ih7LHdYxWwEA/QmrebctLjo79xz9ouK3MroHwOJw==", + "dev": true, + "dependencies": { + "htmlparser2": "^3.10.0" + }, + "peerDependencies": { + "postcss": ">=5.0.0", + "postcss-syntax": ">=0.36.0" + } + }, + "node_modules/postcss-html/node_modules/entities": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", + "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==", + "dev": true + }, + "node_modules/postcss-html/node_modules/htmlparser2": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz", + "integrity": "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==", + "dev": true, + "dependencies": { + "domelementtype": "^1.3.1", + "domhandler": "^2.3.0", + "domutils": "^1.5.1", + "entities": "^1.1.1", + "inherits": "^2.0.1", + "readable-stream": "^3.1.1" + } + }, + "node_modules/postcss-html/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/postcss-less": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/postcss-less/-/postcss-less-3.1.4.tgz", + "integrity": "sha512-7TvleQWNM2QLcHqvudt3VYjULVB49uiW6XzEUFmvwHzvsOEF5MwBrIXZDJQvJNFGjJQTzSzZnDoCJ8h/ljyGXA==", + "dev": true, + "dependencies": { + "postcss": "^7.0.14" + }, + "engines": { + "node": ">=6.14.4" + } + }, + "node_modules/postcss-media-query-parser": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/postcss-media-query-parser/-/postcss-media-query-parser-0.2.3.tgz", + "integrity": "sha1-J7Ocb02U+Bsac7j3Y1HGCeXO8kQ=", + "dev": true + }, + "node_modules/postcss-reporter": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-reporter/-/postcss-reporter-6.0.1.tgz", + "integrity": "sha512-LpmQjfRWyabc+fRygxZjpRxfhRf9u/fdlKf4VHG4TSPbV2XNsuISzYW1KL+1aQzx53CAppa1bKG4APIB/DOXXw==", + "dev": true, + "dependencies": { + "chalk": "^2.4.1", + "lodash": "^4.17.11", + "log-symbols": "^2.2.0", + "postcss": "^7.0.7" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/postcss-reporter/node_modules/log-symbols": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", + "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", + "dev": true, + "dependencies": { + "chalk": "^2.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/postcss-resolve-nested-selector": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.1.tgz", + "integrity": "sha1-Kcy8fDfe36wwTp//C/FZaz9qDk4=", + "dev": true + }, + "node_modules/postcss-safe-parser": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-safe-parser/-/postcss-safe-parser-4.0.2.tgz", + "integrity": "sha512-Uw6ekxSWNLCPesSv/cmqf2bY/77z11O7jZGPax3ycZMFU/oi2DMH9i89AdHc1tRwFg/arFoEwX0IS3LCUxJh1g==", + "dev": true, + "dependencies": { + "postcss": "^7.0.26" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/postcss-sass": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/postcss-sass/-/postcss-sass-0.4.4.tgz", + "integrity": "sha512-BYxnVYx4mQooOhr+zer0qWbSPYnarAy8ZT7hAQtbxtgVf8gy+LSLT/hHGe35h14/pZDTw1DsxdbrwxBN++H+fg==", + "dev": true, + "dependencies": { + "gonzales-pe": "^4.3.0", + "postcss": "^7.0.21" + } + }, + "node_modules/postcss-scss": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postcss-scss/-/postcss-scss-2.0.0.tgz", + "integrity": "sha512-um9zdGKaDZirMm+kZFKKVsnKPF7zF7qBAtIfTSnZXD1jZ0JNZIxdB6TxQOjCnlSzLRInVl2v3YdBh/M881C4ug==", + "dev": true, + "dependencies": { + "postcss": "^7.0.0" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/postcss-selector-parser": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.2.tgz", + "integrity": "sha512-36P2QR59jDTOAiIkqEprfJDsoNrvwFei3eCqKd1Y0tUsBimsq39BLp7RD+JWny3WgB1zGhJX8XVePwm9k4wdBg==", + "dev": true, + "dependencies": { + "cssesc": "^3.0.0", + "indexes-of": "^1.0.1", + "uniq": "^1.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/postcss-syntax": { + "version": "0.36.2", + "resolved": "https://registry.npmjs.org/postcss-syntax/-/postcss-syntax-0.36.2.tgz", + "integrity": "sha512-nBRg/i7E3SOHWxF3PpF5WnJM/jQ1YpY9000OaVXlAQj6Zp/kIqJxEDWIZ67tAd7NLuk7zqN4yqe9nc0oNAOs1w==", + "dev": true, + "peerDependencies": { + "postcss": ">=5.0.0" + } + }, + "node_modules/postcss-value-parser": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.0.3.tgz", + "integrity": "sha512-N7h4pG+Nnu5BEIzyeaaIYWs0LI5XC40OrRh5L60z0QjFsqGWcHcbkBvpe1WYpcIS9yQ8sOi/vIPt1ejQCrMVrg==", + "dev": true + }, + "node_modules/postcss/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/postcss/node_modules/supports-color": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", + "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/pretty-bytes": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-3.0.1.tgz", + "integrity": "sha1-J9AAjXeAY6C0gRuzXHnxvV1fvM8=", + "dev": true, + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/private": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", + "dev": true + }, + "node_modules/promise-retry": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", + "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", + "dev": true, + "dependencies": { + "err-code": "^2.0.2", + "retry": "^0.12.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/protobufjs": { + "version": "6.11.2", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.2.tgz", + "integrity": "sha512-4BQJoPooKJl2G9j3XftkIXjoC9C0Av2NOrWmbLWT1vH32GcSUHjM0Arra6UfTsVyfMAuFzaLucXn1sadxJydAw==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.1", + "@types/node": ">=13.7.0", + "long": "^4.0.0" + }, + "bin": { + "pbjs": "bin/pbjs", + "pbts": "bin/pbts" + } + }, + "node_modules/psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", + "dev": true + }, + "node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/qs": { + "version": "6.9.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.3.tgz", + "integrity": "sha512-EbZYNarm6138UKKq46tdx08Yo/q9ZhFoAXAI1meAFd2GtbRDhbZY2WQSICskT0c5q99aFzLG1D4nvTk9tqfXIw==", + "dev": true, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/quick-lru": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", + "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/raw-body": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-1.1.7.tgz", + "integrity": "sha1-HQJ8K/oRasxmI7yo8AAWVyqH1CU=", + "dev": true, + "dependencies": { + "bytes": "1", + "string_decoder": "0.10" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/raw-body/node_modules/string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + }, + "node_modules/read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "dev": true, + "dependencies": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "dev": true, + "dependencies": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg/node_modules/type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/rechoir": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz", + "integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==", + "dev": true, + "dependencies": { + "resolve": "^1.9.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "dev": true, + "dependencies": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/regenerate": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", + "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", + "dev": true + }, + "node_modules/regenerate-unicode-properties": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz", + "integrity": "sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==", + "dev": true, + "dependencies": { + "regenerate": "^1.4.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/regenerator-runtime": { + "version": "0.13.5", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz", + "integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==", + "dev": true + }, + "node_modules/regenerator-transform": { + "version": "0.14.4", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.4.tgz", + "integrity": "sha512-EaJaKPBI9GvKpvUz2mz4fhx7WPgvwRLY9v3hlNHWmAuJHI13T4nwKnNvm5RWJzEdnI5g5UwtOww+S8IdoUC2bw==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.8.4", + "private": "^0.1.8" + } + }, + "node_modules/regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "dev": true, + "engines": { + "node": ">=6.5.0" + } + }, + "node_modules/regexpu-core": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.7.0.tgz", + "integrity": "sha512-TQ4KXRnIn6tz6tjnrXEkD/sshygKH/j5KzK86X8MkeHyZ8qst/LZ89j3X4/8HEIfHANTFIP/AbXakeRhWIl5YQ==", + "dev": true, + "dependencies": { + "regenerate": "^1.4.0", + "regenerate-unicode-properties": "^8.2.0", + "regjsgen": "^0.5.1", + "regjsparser": "^0.6.4", + "unicode-match-property-ecmascript": "^1.0.4", + "unicode-match-property-value-ecmascript": "^1.2.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/regjsgen": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.1.tgz", + "integrity": "sha512-5qxzGZjDs9w4tzT3TPhCJqWdCc3RLYwy9J2NB0nm5Lz+S273lvWcpjaTGHsT1dc6Hhfq41uSEOw8wBmxrKOuyg==", + "dev": true + }, + "node_modules/regjsparser": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.4.tgz", + "integrity": "sha512-64O87/dPDgfk8/RQqC4gkZoGyyWFIEUTTh80CU6CWuK5vkCGyekIx+oKcEIYtP/RAxSQltCZHCNu/mdd7fqlJw==", + "dev": true, + "dependencies": { + "jsesc": "~0.5.0" + }, + "bin": { + "regjsparser": "bin/parser" + } + }, + "node_modules/regjsparser/node_modules/jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + } + }, + "node_modules/repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/replace-ext": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", + "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", + "dev": true, + "dependencies": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/request/node_modules/qs": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", + "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", + "dev": true, + "engines": { + "node": ">=0.6" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", + "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", + "dev": true, + "dependencies": { + "path-parse": "^1.0.6" + } + }, + "node_modules/resolve-dir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", + "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", + "dev": true, + "dependencies": { + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve-dir/node_modules/global-modules": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "dev": true, + "dependencies": { + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve-dir/node_modules/global-prefix": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", + "dev": true, + "dependencies": { + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "node_modules/run-async": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.0.tgz", + "integrity": "sha512-xJTbh/d7Lm7SBhc1tNvTpeCHaEzoyxPrqNlvSdMfBTYwaY++UJFyXUOxAtsRUXjlqOfj8luNaR9vjCh4KeV+pg==", + "dev": true, + "dependencies": { + "is-promise": "^2.1.0" + }, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/run-parallel": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", + "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==", + "dev": true + }, + "node_modules/rxjs": { + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.5.tgz", + "integrity": "sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ==", + "dev": true, + "dependencies": { + "tslib": "^1.9.0" + }, + "engines": { + "npm": ">=2.0.0" + } + }, + "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/safe-json-parse": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/safe-json-parse/-/safe-json-parse-1.0.1.tgz", + "integrity": "sha1-PnZyPjjf3aE8mx0poeB//uSzC1c=", + "dev": true + }, + "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/sass-graph": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-4.0.0.tgz", + "integrity": "sha512-WSO/MfXqKH7/TS8RdkCX3lVkPFQzCgbqdGsmSKq6tlPU+GpGEsa/5aW18JqItnqh+lPtcjifqdZ/VmiILkKckQ==", + "dev": true, + "dependencies": { + "glob": "^7.0.0", + "lodash": "^4.17.11", + "scss-tokenizer": "^0.3.0", + "yargs": "^17.2.1" + }, + "bin": { + "sassgraph": "bin/sassgraph" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/sass-graph/node_modules/yargs": { + "version": "17.3.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.3.1.tgz", + "integrity": "sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/sass-graph/node_modules/yargs-parser": { + "version": "21.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.0.tgz", + "integrity": "sha512-z9kApYUOCwoeZ78rfRYYWdiU/iNL6mwwYlkkZfJoyMR1xps+NEBX5X7XmRpxkZHhXJ6+Ey00IwKxBBSW9FIjyA==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/sax": { + "version": "0.5.8", + "resolved": "https://registry.npmjs.org/sax/-/sax-0.5.8.tgz", + "integrity": "sha1-1HLbIo6zMcJQaw6MFVJK25OdEsE=", + "dev": true + }, + "node_modules/scss-tokenizer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/scss-tokenizer/-/scss-tokenizer-0.3.0.tgz", + "integrity": "sha512-14Zl9GcbBvOT9057ZKjpz5yPOyUWG2ojd9D5io28wHRYsOrs7U95Q+KNL87+32p8rc+LvDpbu/i9ZYjM9Q+FsQ==", + "dev": true, + "dependencies": { + "js-base64": "^2.4.3", + "source-map": "^0.7.1" + } + }, + "node_modules/scss-tokenizer/node_modules/source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/semver": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/shelljs": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.3.0.tgz", + "integrity": "sha1-NZbmMHp4FUT1kfN9phg2DzHbV7E=", + "dev": true, + "bin": { + "shjs": "bin/shjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/shifter": { + "version": "1.2.0", + "resolved": "https://github.com/andrewnicols/shifter/archive/v1.2.0_moodle-0.tar.gz", + "integrity": "sha512-zIR5WQqJcNP52vcIqFql2/wXm6nLHW4DsLZyfr6wZ0vfOuqDaYiwB6J7/WYvfjgL2pvvTtSo3pySUYRmrOP3lQ==", + "dev": true, + "dependencies": { + "ansi-color": "*", + "cpr": "~0.0.6", + "cssproc": "~0.0.1", + "gear": "~0.8.0", + "gear-lib": "^0.9.2", + "istanbul": "https://github.com/andrewnicols/istanbul/archive/v0.4.5_moodle-0.tar.gz", + "jshint": "^2.9.5", + "mkdirp": "*", + "nopt": "*", + "progress": "~0.1.0", + "rimraf": "*", + "timethat": "~0.0.1", + "walkdir": "~0.0.5", + "watch": "~0.8.0", + "which": "*", + "yuglify": "^2.0.0", + "yui-lint": "~0.2.0", + "yuicompressor": "2.4.7", + "yuitest-coverage": ">=0.0.5" + }, + "bin": { + "shifter": "bin/shifter" + } + }, + "node_modules/shifter/node_modules/progress": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/progress/-/progress-0.1.0.tgz", + "integrity": "sha1-2+wMmfvC97liPhMxY75jYdXp5Ec=", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/sigmund": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", + "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=", + "dev": true + }, + "node_modules/signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/slice-ansi/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/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "dev": true, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/sntp": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-0.2.4.tgz", + "integrity": "sha1-+4hfGLDzqtGJ+CSGJTa87ux1CQA=", + "deprecated": "This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.", + "dev": true, + "optional": true, + "dependencies": { + "hoek": "0.9.x" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/socks": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.6.2.tgz", + "integrity": "sha512-zDZhHhZRY9PxRruRMR7kMhnf3I8hDs4S3f9RecfnGxvcBHQcKcIH/oUcEWffsfl1XxdYlA7nnlGbbTvPz9D8gA==", + "dev": true, + "dependencies": { + "ip": "^1.1.5", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.13.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.1.1.tgz", + "integrity": "sha512-t8J0kG3csjA4g6FTbsMOWws+7R7vuRC8aQ/wy3/1OWmsgwA68zs/+cExQ0koSitUDXqhufF/YJr9wtNMZHw5Ew==", + "dev": true, + "dependencies": { + "agent-base": "^6.0.2", + "debug": "^4.3.1", + "socks": "^2.6.1" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/socks-proxy-agent/node_modules/debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/source-map-support/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/spdx-correct": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", + "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "dev": true, + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", + "dev": true + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz", + "integrity": "sha512-uBIcIl3Ih6Phe3XHK1NqboJLdGfwr1UN3k6wSD1dZpmPsIkb8AGNbZYJ1fOBk834+Gxy8rpfDxrS6XLEMZMY2g==", + "dev": true + }, + "node_modules/specificity": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/specificity/-/specificity-0.4.1.tgz", + "integrity": "sha512-1klA3Gi5PD1Wv9Q0wUoOQN1IWAuPu0D1U03ThXTr0cJ20+/iq2tHSDnK7Kk/0LXJ1ztUB2/1Os0wKmfyNgUQfg==", + "dev": true, + "bin": { + "specificity": "bin/specificity" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "node_modules/sshpk": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", + "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", + "dev": true, + "dependencies": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + }, + "bin": { + "sshpk-conv": "bin/sshpk-conv", + "sshpk-sign": "bin/sshpk-sign", + "sshpk-verify": "bin/sshpk-verify" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ssri": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", + "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", + "dev": true, + "dependencies": { + "minipass": "^3.1.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/stdout-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/stdout-stream/-/stdout-stream-1.4.1.tgz", + "integrity": "sha512-j4emi03KXqJWcIeF8eIXkjMFN1Cmb8gUlDYGeBALLPo5qdyTfA9bOtl8m33lRoC+vFMkP3gl0WsDr6+gzxbbTA==", + "dev": true, + "dependencies": { + "readable-stream": "^2.0.1" + } + }, + "node_modules/stdout-stream/node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/stream-counter": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/stream-counter/-/stream-counter-0.1.0.tgz", + "integrity": "sha1-oDXkKTYftX82Fgbhf82Ki5Z3Mns=", + "dev": true, + "dependencies": { + "readable-stream": "~1.0.2" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/stream-counter/node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "node_modules/stream-counter/node_modules/readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "node_modules/stream-counter/node_modules/string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + }, + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/string-template": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/string-template/-/string-template-0.2.1.tgz", + "integrity": "sha1-QpMuWYo1LQH8IuwzZ9nYTuxsmt0=", + "dev": true + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/stringstream": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.6.tgz", + "integrity": "sha512-87GEBAkegbBcweToUrdzf3eLhWNg06FJTebl4BVJz/JgWy8CvEr9dRtX5qWphiynMSQlxxi+QqN0z5T32SLlhA==", + "dev": true, + "optional": true + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "dev": true, + "dependencies": { + "min-indent": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.0.tgz", + "integrity": "sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/style-search": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/style-search/-/style-search-0.1.0.tgz", + "integrity": "sha1-eVjHk+R+MuB9K1yv5cC/jhLneQI=", + "dev": true + }, + "node_modules/stylelint": { + "version": "13.3.3", + "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-13.3.3.tgz", + "integrity": "sha512-j8Oio2T1YNiJc6iXDaPYd74Jg4zOa1bByNm/g9/Nvnq4tDPsIjMi46jhRZyPPktGPwjJ5FwcmCqIRlH6PVP8mA==", + "dev": true, + "dependencies": { + "@stylelint/postcss-css-in-js": "^0.37.1", + "@stylelint/postcss-markdown": "^0.36.1", + "autoprefixer": "^9.7.6", + "balanced-match": "^1.0.0", + "chalk": "^4.0.0", + "cosmiconfig": "^6.0.0", + "debug": "^4.1.1", + "execall": "^2.0.0", + "file-entry-cache": "^5.0.1", + "get-stdin": "^7.0.0", + "global-modules": "^2.0.0", + "globby": "^11.0.0", + "globjoin": "^0.1.4", + "html-tags": "^3.1.0", + "ignore": "^5.1.4", + "import-lazy": "^4.0.0", + "imurmurhash": "^0.1.4", + "known-css-properties": "^0.18.0", + "leven": "^3.1.0", + "lodash": "^4.17.15", + "log-symbols": "^3.0.0", + "mathml-tag-names": "^2.1.3", + "meow": "^6.1.0", + "micromatch": "^4.0.2", + "normalize-selector": "^0.2.0", + "postcss": "^7.0.27", + "postcss-html": "^0.36.0", + "postcss-less": "^3.1.4", + "postcss-media-query-parser": "^0.2.3", + "postcss-reporter": "^6.0.1", + "postcss-resolve-nested-selector": "^0.1.1", + "postcss-safe-parser": "^4.0.2", + "postcss-sass": "^0.4.4", + "postcss-scss": "^2.0.0", + "postcss-selector-parser": "^6.0.2", + "postcss-syntax": "^0.36.2", + "postcss-value-parser": "^4.0.3", + "resolve-from": "^5.0.0", + "slash": "^3.0.0", + "specificity": "^0.4.1", + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "style-search": "^0.1.0", + "sugarss": "^2.0.0", + "svg-tags": "^1.0.0", + "table": "^5.4.6", + "v8-compile-cache": "^2.1.0", + "write-file-atomic": "^3.0.3" + }, + "bin": { + "stylelint": "bin/stylelint.js" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/stylelint" + } + }, + "node_modules/stylelint-checkstyle-formatter": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/stylelint-checkstyle-formatter/-/stylelint-checkstyle-formatter-0.1.2.tgz", + "integrity": "sha512-bePbF16ei9dCza2SlExRCGYMLVWsw0uQ2WJ5bakuL7lyprlENWz5/3qCZpneRMsFJkq+qtYuvomMoY/VI3AbPw==", + "dev": true, + "dependencies": { + "lodash": "^4.17.10" + } + }, + "node_modules/stylelint-csstree-validator": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/stylelint-csstree-validator/-/stylelint-csstree-validator-1.8.0.tgz", + "integrity": "sha512-S9PAu3/HTkRstKOHgD6Bm6pgf2u/u0jwCOFEq4tmnnvlHchL2SGFgifPl4gTDOQwMxcV12WmXMgsn8NH+2ttRw==", + "dev": true, + "dependencies": { + "css-tree": "1.0.0-alpha.38" + }, + "peerDependencies": { + "stylelint": ">=7.0.0 <14.0.0" + } + }, + "node_modules/stylelint/node_modules/ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/stylelint/node_modules/ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "dependencies": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/stylelint/node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/stylelint/node_modules/camelcase-keys": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", + "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", + "dev": true, + "dependencies": { + "camelcase": "^5.3.1", + "map-obj": "^4.0.0", + "quick-lru": "^4.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/stylelint/node_modules/chalk": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", + "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/stylelint/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/stylelint/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/stylelint/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/stylelint/node_modules/get-stdin": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-7.0.0.tgz", + "integrity": "sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/stylelint/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/stylelint/node_modules/ignore": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.4.tgz", + "integrity": "sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/stylelint/node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/stylelint/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/stylelint/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/stylelint/node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/stylelint/node_modules/map-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.1.0.tgz", + "integrity": "sha512-glc9y00wgtwcDmp7GaE/0b0OnxpNJsVf3ael/An6Fe2Q51LLwN1er6sdomLRzz5h0+yMpiYLhWYF5R7HeqVd4g==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/stylelint/node_modules/meow": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-6.1.0.tgz", + "integrity": "sha512-iIAoeI01v6pmSfObAAWFoITAA4GgiT45m4SmJgoxtZfvI0fyZwhV4d0lTwiUXvAKIPlma05Feb2Xngl52Mj5Cg==", + "dev": true, + "dependencies": { + "@types/minimist": "^1.2.0", + "camelcase-keys": "^6.1.1", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.0.0", + "minimist-options": "^4.0.1", + "normalize-package-data": "^2.5.0", + "read-pkg-up": "^7.0.0", + "redent": "^3.0.0", + "trim-newlines": "^3.0.0", + "type-fest": "^0.8.1", + "yargs-parser": "^18.1.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/stylelint/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/stylelint/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/stylelint/node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/stylelint/node_modules/parse-json": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.0.tgz", + "integrity": "sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/stylelint/node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/stylelint/node_modules/read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "dev": true, + "dependencies": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/stylelint/node_modules/read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "dev": true, + "dependencies": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/stylelint/node_modules/read-pkg/node_modules/type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/stylelint/node_modules/redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "dev": true, + "dependencies": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/stylelint/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/stylelint/node_modules/string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/stylelint/node_modules/strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/stylelint/node_modules/strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "dev": true, + "dependencies": { + "min-indent": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/stylelint/node_modules/supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/stylelint/node_modules/trim-newlines": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", + "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/stylelint/node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/sugarss": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/sugarss/-/sugarss-2.0.0.tgz", + "integrity": "sha512-WfxjozUk0UVA4jm+U1d736AUpzSrNsQcIbyOkoE364GrtWmIrFdk5lksEupgWMD4VaT/0kVx1dobpiDumSgmJQ==", + "dev": true, + "dependencies": { + "postcss": "^7.0.2" + } + }, + "node_modules/supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/svg-tags": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/svg-tags/-/svg-tags-1.0.0.tgz", + "integrity": "sha1-WPcc7jvVGbWdSyqEO2x95krAR2Q=", + "dev": true + }, + "node_modules/table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "dev": true, + "dependencies": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/table/node_modules/ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/table/node_modules/emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "node_modules/table/node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/table/node_modules/string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "dependencies": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/table/node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tar": { + "version": "6.1.11", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", + "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", + "dev": true, + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^3.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/tar/node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "node_modules/timethat": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/timethat/-/timethat-0.0.3.tgz", + "integrity": "sha1-OoRUYguF5vnLS2f43TTciA1JrtA=", + "dev": true + }, + "node_modules/tiny-lr": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/tiny-lr/-/tiny-lr-1.1.1.tgz", + "integrity": "sha512-44yhA3tsaRoMOjQQ+5v5mVdqef+kH6Qze9jTpqtVufgYjYt08zyZAwNwwVBj3i1rJMnR52IxOW0LK0vBzgAkuA==", + "dev": true, + "dependencies": { + "body": "^5.1.0", + "debug": "^3.1.0", + "faye-websocket": "~0.10.0", + "livereload-js": "^2.3.0", + "object-assign": "^4.1.0", + "qs": "^6.4.0" + } + }, + "node_modules/tiny-lr/node_modules/debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dev": true, + "dependencies": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/trim-newlines": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", + "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/trough": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/trough/-/trough-1.0.5.tgz", + "integrity": "sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/true-case-path": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/true-case-path/-/true-case-path-1.0.3.tgz", + "integrity": "sha512-m6s2OdQe5wgpFMC+pAJ+q9djG82O2jcHPOI6RNg1yy9rCYR+WD6Nbpl32fDpfC56nirdRy+opFa/Vk7HYhqaew==", + "dev": true, + "dependencies": { + "glob": "^7.1.2" + } + }, + "node_modules/tslib": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", + "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==", + "dev": true + }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true + }, + "node_modules/type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "dependencies": { + "prelude-ls": "~1.1.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "dependencies": { + "is-typedarray": "^1.0.0" + } + }, + "node_modules/uglify-js": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.9.1.tgz", + "integrity": "sha512-JUPoL1jHsc9fOjVFHdQIhqEEJsQvfKDjlubcCilu8U26uZ73qOg8VsN8O1jbuei44ZPlwL7kmbAdM4tzaUvqnA==", + "dev": true, + "dependencies": { + "commander": "~2.20.3" + }, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/uglify-js/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "node_modules/uglify-to-browserify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "dev": true + }, + "node_modules/unc-path-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/underscore": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", + "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=", + "dev": true + }, + "node_modules/underscore.string": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.3.5.tgz", + "integrity": "sha512-g+dpmgn+XBneLmXXo+sGlW5xQEt4ErkS3mgeN2GFbremYeMBSJKr9Wf2KJplQVaiPY/f7FN6atosWYNm9ovrYg==", + "dev": true, + "dependencies": { + "sprintf-js": "^1.0.3", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": "*" + } + }, + "node_modules/unicode-canonical-property-names-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", + "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-match-property-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", + "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", + "dev": true, + "dependencies": { + "unicode-canonical-property-names-ecmascript": "^1.0.4", + "unicode-property-aliases-ecmascript": "^1.0.4" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-match-property-value-ecmascript": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", + "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-property-aliases-ecmascript": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz", + "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/uniq": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", + "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=", + "dev": true + }, + "node_modules/unique-filename": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", + "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "dev": true, + "dependencies": { + "unique-slug": "^2.0.0" + } + }, + "node_modules/unique-slug": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", + "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", + "dev": true, + "dependencies": { + "imurmurhash": "^0.1.4" + } + }, + "node_modules/unist-util-is": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.0.2.tgz", + "integrity": "sha512-Ofx8uf6haexJwI1gxWMGg6I/dLnF2yE+KibhD3/diOqY2TinLcqHXCV6OI5gFVn3xQqDH+u0M625pfKwIwgBKQ==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-stringify-position": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz", + "integrity": "sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.2" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/uri-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/uri-path/-/uri-path-1.0.0.tgz", + "integrity": "sha1-l0fwGDWJM8Md4PzP2C0TjmcmLjI=", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "node_modules/uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", + "dev": true, + "bin": { + "uuid": "bin/uuid" + } + }, + "node_modules/v8-compile-cache": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz", + "integrity": "sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g==", + "dev": true + }, + "node_modules/v8flags": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.2.0.tgz", + "integrity": "sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==", + "dev": true, + "dependencies": { + "homedir-polyfill": "^1.0.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "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", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "engines": [ + "node >=0.6.0" + ], + "dependencies": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "node_modules/vfile": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-4.1.0.tgz", + "integrity": "sha512-BaTPalregj++64xbGK6uIlsurN3BCRNM/P2Pg8HezlGzKd1O9PrwIac6bd9Pdx2uTb0QHoioZ+rXKolbVXEgJg==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "replace-ext": "1.0.0", + "unist-util-stringify-position": "^2.0.0", + "vfile-message": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-message": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-2.0.4.tgz", + "integrity": "sha512-DjssxRGkMvifUOJre00juHoP9DPWuzjxKuMDrhNbk2TdaYYBNMStsNhEOt3idrtI12VQYM/1+iM0KOzXi4pxwQ==", + "dev": true, + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/walkdir": { + "version": "0.0.12", + "resolved": "https://registry.npmjs.org/walkdir/-/walkdir-0.0.12.tgz", + "integrity": "sha512-HFhaD4mMWPzFSqhpyDG48KDdrjfn409YQuVW7ckZYhW4sE87mYtWifdB/+73RA7+p4s4K18n5Jfx1kHthE1gBw==", + "dev": true, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/watch": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/watch/-/watch-0.8.0.tgz", + "integrity": "sha1-G7DupT3v5uYh6cjGPANYAH7L28w=", + "dev": true, + "engines": [ + "node >=0.1.95" + ] + }, + "node_modules/websocket-driver": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.3.tgz", + "integrity": "sha512-bpxWlvbbB459Mlipc5GBzzZwhoZgGEZLuqPaR0INBGnPAY1vdBX6hPnoFXiw+3yWxDuHyQjO2oXTMyS8A5haFg==", + "dev": true, + "dependencies": { + "http-parser-js": ">=0.4.0 <0.4.11", + "safe-buffer": ">=5.1.0", + "websocket-extensions": ">=0.1.1" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/websocket-extensions": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz", + "integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "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/wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "dev": true, + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, + "node_modules/window-size": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "node_modules/write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "dev": true, + "dependencies": { + "mkdirp": "^0.5.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "dependencies": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "node_modules/xml-js": { + "version": "1.6.11", + "resolved": "https://registry.npmjs.org/xml-js/-/xml-js-1.6.11.tgz", + "integrity": "sha512-7rVi2KMfwfWFl+GpPg6m80IVMWXLRjO+PxTq7V2CDhoGak0wzYzFgUY2m4XJ47OGdXd8eLE8EmwfAmdjw7lC1g==", + "dev": true, + "dependencies": { + "sax": "^1.2.4" + }, + "bin": { + "xml-js": "bin/cli.js" + } + }, + "node_modules/xml-js/node_modules/sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true + }, + "node_modules/xml2js": { + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.2.8.tgz", + "integrity": "sha1-m4FpCTFjH/CdGVdUn69U9PmAs8I=", + "dev": true, + "dependencies": { + "sax": "0.5.x" + } + }, + "node_modules/xmldom": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.6.0.tgz", + "integrity": "sha512-iAcin401y58LckRZ0TkI4k0VSM1Qg0KGSc3i8rU+xrxe19A/BN1zHyVSJY7uoutVlaTSzYyk/v5AmkewAP7jtg==", + "dev": true, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/xpath": { + "version": "0.0.27", + "resolved": "https://registry.npmjs.org/xpath/-/xpath-0.0.27.tgz", + "integrity": "sha512-fg03WRxtkCV6ohClePNAECYsmpKKTv5L8y/X3Dn1hQrec3POx2jHZ/0P2qQ6HvsrU1BmeqXcof3NGGueG6LxwQ==", + "dev": true, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/yaml": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.9.2.tgz", + "integrity": "sha512-HPT7cGGI0DuRcsO51qC1j9O16Dh1mZ2bnXwsi0jrSpsLz0WxOLSLXfkABVl6bZO629py3CU+OMJtpNHDLB97kg==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.9.2" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/yargs": { + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.5.4.tgz", + "integrity": "sha1-2K/49mXpTDS9JZvevRv68N3TU2E=", + "dev": true, + "dependencies": { + "camelcase": "^1.0.2", + "decamelize": "^1.0.0", + "window-size": "0.1.0", + "wordwrap": "0.0.2" + } + }, + "node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs/node_modules/camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/yargs/node_modules/wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/ycssmin": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ycssmin/-/ycssmin-1.0.1.tgz", + "integrity": "sha1-fN3o23jPqwDSkBw7IwHjBPr03xY=", + "dev": true, + "bin": { + "ycssmin": "bin/cssmin" + } + }, + "node_modules/yuglify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yuglify/-/yuglify-2.0.0.tgz", + "integrity": "sha1-nU5a3c4g9B7fIkhuIxG2HWo/jSE=", + "dev": true, + "dependencies": { + "nopt": "~2.1.1", + "uglify-js": "^3.1.4", + "ycssmin": "~1.0.1" + }, + "bin": { + "yuglify": "bin/yuglify" + } + }, + "node_modules/yuglify/node_modules/nopt": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-2.1.2.tgz", + "integrity": "sha1-bMzZd7gBMqB3MdbozljCyDA8+a8=", + "dev": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + } + }, + "node_modules/yui-lint": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/yui-lint/-/yui-lint-0.2.0.tgz", + "integrity": "sha1-6RPadPqgZPtTwDdxstMSk4ZfAYU=", + "dev": true + }, + "node_modules/yuicompressor": { + "version": "2.4.7", + "resolved": "https://registry.npmjs.org/yuicompressor/-/yuicompressor-2.4.7.tgz", + "integrity": "sha1-GAyheDRsb+MrbuilCyrrV+TUWEQ=", + "dev": true, + "bin": { + "yuicompressor": "nodejs/cli.js" + } + }, + "node_modules/yuitest-coverage": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/yuitest-coverage/-/yuitest-coverage-0.0.6.tgz", + "integrity": "sha1-+DnXLTStIzZxlDfKvK5ahcO/XKg=", + "dev": true + }, + "node_modules/zwitch": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-1.0.5.tgz", + "integrity": "sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + } + }, "dependencies": { "@babel/code-frame": { "version": "7.0.0", @@ -2752,7 +14437,8 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", - "dev": true + "dev": true, + "requires": {} }, "agent-base": { "version": "6.0.2", @@ -5078,7 +16764,8 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/grunt-babel/-/grunt-babel-8.0.0.tgz", "integrity": "sha512-WuiZFvGzcyzlEoPIcY1snI234ydDWeWWV5bpnB7PZsOLHcDsxWKnrR1rMWEUsbdVPPjvIirwFNsuo4CbJmsdFQ==", - "dev": true + "dev": true, + "requires": {} }, "grunt-contrib-uglify": { "version": "4.0.1", @@ -5242,7 +16929,8 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/grunt-sass/-/grunt-sass-3.1.0.tgz", "integrity": "sha512-90s27H7FoCDcA8C8+R0GwC+ntYD3lG6S/jqcavWm3bn9RiJTmSfOvfbFa1PXx4NbBWuiGQMLfQTj/JvvqT5w6A==", - "dev": true + "dev": true, + "requires": {} }, "grunt-stylelint": { "version": "0.15.0", @@ -7712,7 +19400,8 @@ "version": "0.36.2", "resolved": "https://registry.npmjs.org/postcss-syntax/-/postcss-syntax-0.36.2.tgz", "integrity": "sha512-nBRg/i7E3SOHWxF3PpF5WnJM/jQ1YpY9000OaVXlAQj6Zp/kIqJxEDWIZ67tAd7NLuk7zqN4yqe9nc0oNAOs1w==", - "dev": true + "dev": true, + "requires": {} }, "postcss-value-parser": { "version": "4.0.3", @@ -8514,6 +20203,15 @@ } } }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, "string-template": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/string-template/-/string-template-0.2.1.tgz", @@ -8539,15 +20237,6 @@ } } }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, "stringstream": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.6.tgz", diff --git a/package.json b/package.json index e02f1a6a81f..d716f7ff301 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,6 @@ "xpath": "0.0.27" }, "engines": { - "node": ">=14.18.0 <15" + "node": ">=16.14.0 <17" } } From 97e9f81aa090561cb07fa81ed8017555f94ea47c Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Fri, 18 Feb 2022 08:29:59 +0800 Subject: [PATCH 3/5] MDL-73915 js: Upgrade packages --- npm-shrinkwrap.json | 387 ++++++++++++++++++++++++++++---------------- package.json | 12 +- 2 files changed, 254 insertions(+), 145 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 814e797be4d..6f905d58036 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -12,8 +12,8 @@ "@babel/plugin-syntax-dynamic-import": "7.8.3", "@babel/plugin-syntax-import-meta": "7.8.3", "@babel/preset-env": "7.9.5", - "ajv": "6.12.2", - "async": "3.2.0", + "ajv": "8.10.0", + "async": "3.2.3", "babel-eslint": "10.1.0", "babel-plugin-system-import-transformer": "^4.0.0", "babel-plugin-transform-es2015-modules-amd-lazy": "2.0.1", @@ -23,7 +23,7 @@ "eslint-plugin-promise": "4.2.1", "fb-watchman": "2.0.1", "gherkin-lint": "^4.2.2", - "glob": "7.1.6", + "glob": "7.2.0", "grunt": "^1.4.1", "grunt-babel": "8.0.0", "grunt-contrib-uglify": "4.0.1", @@ -31,15 +31,15 @@ "grunt-eslint": "22.0.0", "grunt-sass": "3.1.0", "grunt-stylelint": "0.15.0", - "jshint": "^2.11.0", + "jshint": "^2.13.4", "node-sass": "^7.0.1", - "semver": "7.3.2", + "semver": "7.3.5", "shifter": "https://github.com/andrewnicols/shifter/archive/v1.2.0_moodle-0.tar.gz", "stylelint": "13.3.3", "stylelint-checkstyle-formatter": "0.1.2", "stylelint-csstree-validator": "1.8.0", "xmldom": "^0.6.0", - "xpath": "0.0.27" + "xpath": "0.0.32" }, "engines": { "node": ">=16.14.0 <17" @@ -2663,21 +2663,6 @@ "semver": "^7.3.5" } }, - "node_modules/@npmcli/fs/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/@npmcli/move-file": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz", @@ -3015,17 +3000,27 @@ } }, "node_modules/ajv": { - "version": "6.12.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz", - "integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.10.0.tgz", + "integrity": "sha512-bzqAEZOjkrUMl2afH8dknrq5KEk2SrwdBROR+vH1EKVQTqaUbJVPdc/gEdggTMM0Se+s+Ja4ju4TlNcStKl2Hw==", "dev": true, "dependencies": { "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/ajv/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, "node_modules/amdefine": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", @@ -3181,9 +3176,9 @@ } }, "node_modules/async": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz", - "integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==", + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz", + "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==", "dev": true }, "node_modules/async-foreach": { @@ -4825,6 +4820,22 @@ "node": ">=4" } }, + "node_modules/eslint/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/eslint/node_modules/ansi-regex": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", @@ -5581,6 +5592,26 @@ "node": ">=10.0.0" } }, + "node_modules/gherkin-lint/node_modules/glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/gherkin-lint/node_modules/strip-json-comments": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", @@ -5600,9 +5631,9 @@ } }, "node_modules/glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -5715,6 +5746,26 @@ "node": ">= 0.10" } }, + "node_modules/globule/node_modules/glob": { + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/gonzales-pe": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/gonzales-pe/-/gonzales-pe-4.3.0.tgz", @@ -5823,12 +5874,6 @@ "lodash": "^4.17.14" } }, - "node_modules/grunt-contrib-watch/node_modules/async/node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, "node_modules/grunt-eslint": { "version": "22.0.0", "resolved": "https://registry.npmjs.org/grunt-eslint/-/grunt-eslint-22.0.0.tgz", @@ -6077,6 +6122,26 @@ "node": ">=8" } }, + "node_modules/grunt/node_modules/glob": { + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/grunt/node_modules/grunt-cli": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.4.3.tgz", @@ -7149,18 +7214,17 @@ } }, "node_modules/jshint": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.11.0.tgz", - "integrity": "sha512-ooaD/hrBPhu35xXW4gn+o3SOuzht73gdBuffgJzrZBJZPGgGiiTvJEgTyxFvBO2nz0+X1G6etF8SzUODTlLY6Q==", + "version": "2.13.4", + "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.13.4.tgz", + "integrity": "sha512-HO3bosL84b2qWqI0q+kpT/OpRJwo0R4ivgmxaO848+bo10rc50SkPnrtwSFXttW0ym4np8jbJvLwk5NziB7jIw==", "dev": true, "dependencies": { "cli": "~1.0.0", "console-browserify": "1.1.x", "exit": "0.1.x", "htmlparser2": "3.8.x", - "lodash": "~4.17.11", + "lodash": "~4.17.21", "minimatch": "~3.0.2", - "shelljs": "0.3.x", "strip-json-comments": "1.0.x" }, "bin": { @@ -8014,21 +8078,6 @@ "node": ">=10" } }, - "node_modules/meow/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/meow/node_modules/type-fest": { "version": "0.18.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz", @@ -8398,21 +8447,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/node-gyp/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/node-gyp/node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -9638,6 +9672,15 @@ "node": ">=0.10.0" } }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/resolve": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", @@ -9862,10 +9905,13 @@ } }, "node_modules/semver": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", - "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, "bin": { "semver": "bin/semver.js" }, @@ -10845,6 +10891,22 @@ "node": ">=6.0.0" } }, + "node_modules/table/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/table/node_modules/ansi-regex": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", @@ -11546,9 +11608,9 @@ } }, "node_modules/xpath": { - "version": "0.0.27", - "resolved": "https://registry.npmjs.org/xpath/-/xpath-0.0.27.tgz", - "integrity": "sha512-fg03WRxtkCV6ohClePNAECYsmpKKTv5L8y/X3Dn1hQrec3POx2jHZ/0P2qQ6HvsrU1BmeqXcof3NGGueG6LxwQ==", + "version": "0.0.32", + "resolved": "https://registry.npmjs.org/xpath/-/xpath-0.0.32.tgz", + "integrity": "sha512-rxMJhSIoiO8vXcWvSifKqhvV96GjiD5wYb8/QHdoRyQvraTpp4IEv944nhGausZZ3u7dhQXteZuZbaqfpB7uYw==", "dev": true, "engines": { "node": ">=0.6.0" @@ -14181,17 +14243,6 @@ "requires": { "@gar/promisify": "^1.0.1", "semver": "^7.3.5" - }, - "dependencies": { - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - } } }, "@npmcli/move-file": { @@ -14471,15 +14522,23 @@ } }, "ajv": { - "version": "6.12.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz", - "integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.10.0.tgz", + "integrity": "sha512-bzqAEZOjkrUMl2afH8dknrq5KEk2SrwdBROR+vH1EKVQTqaUbJVPdc/gEdggTMM0Se+s+Ja4ju4TlNcStKl2Hw==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", "uri-js": "^4.2.2" + }, + "dependencies": { + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + } } }, "amdefine": { @@ -14594,9 +14653,9 @@ "dev": true }, "async": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz", - "integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==", + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz", + "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==", "dev": true }, "async-foreach": { @@ -15912,6 +15971,18 @@ "v8-compile-cache": "^2.0.3" }, "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, "ansi-regex": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", @@ -16566,6 +16637,20 @@ "xml-js": "^1.6.11" }, "dependencies": { + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, "strip-json-comments": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", @@ -16575,9 +16660,9 @@ } }, "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -16660,6 +16745,22 @@ "glob": "~7.1.1", "lodash": "~4.17.10", "minimatch": "~3.0.2" + }, + "dependencies": { + "glob": { + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } } }, "gonzales-pe": { @@ -16708,6 +16809,20 @@ "rimraf": "~3.0.2" }, "dependencies": { + "glob": { + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, "grunt-cli": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.4.3.tgz", @@ -16798,14 +16913,6 @@ "dev": true, "requires": { "lodash": "^4.17.14" - }, - "dependencies": { - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - } } } } @@ -17777,18 +17884,17 @@ "dev": true }, "jshint": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.11.0.tgz", - "integrity": "sha512-ooaD/hrBPhu35xXW4gn+o3SOuzht73gdBuffgJzrZBJZPGgGiiTvJEgTyxFvBO2nz0+X1G6etF8SzUODTlLY6Q==", + "version": "2.13.4", + "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.13.4.tgz", + "integrity": "sha512-HO3bosL84b2qWqI0q+kpT/OpRJwo0R4ivgmxaO848+bo10rc50SkPnrtwSFXttW0ym4np8jbJvLwk5NziB7jIw==", "dev": true, "requires": { "cli": "~1.0.0", "console-browserify": "1.1.x", "exit": "0.1.x", "htmlparser2": "3.8.x", - "lodash": "~4.17.11", + "lodash": "~4.17.21", "minimatch": "~3.0.2", - "shelljs": "0.3.x", "strip-json-comments": "1.0.x" }, "dependencies": { @@ -18458,15 +18564,6 @@ "validate-npm-package-license": "^3.0.1" } }, - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - }, "type-fest": { "version": "0.18.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz", @@ -18742,15 +18839,6 @@ "glob": "^7.1.3" } }, - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -19710,6 +19798,12 @@ "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true + }, "resolve": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", @@ -19894,10 +19988,13 @@ } }, "semver": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", - "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", - "dev": true + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } }, "set-blocking": { "version": "2.0.0", @@ -20672,6 +20769,18 @@ "string-width": "^3.0.0" }, "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, "ansi-regex": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", @@ -21237,9 +21346,9 @@ "dev": true }, "xpath": { - "version": "0.0.27", - "resolved": "https://registry.npmjs.org/xpath/-/xpath-0.0.27.tgz", - "integrity": "sha512-fg03WRxtkCV6ohClePNAECYsmpKKTv5L8y/X3Dn1hQrec3POx2jHZ/0P2qQ6HvsrU1BmeqXcof3NGGueG6LxwQ==", + "version": "0.0.32", + "resolved": "https://registry.npmjs.org/xpath/-/xpath-0.0.32.tgz", + "integrity": "sha512-rxMJhSIoiO8vXcWvSifKqhvV96GjiD5wYb8/QHdoRyQvraTpp4IEv944nhGausZZ3u7dhQXteZuZbaqfpB7uYw==", "dev": true }, "y18n": { diff --git a/package.json b/package.json index d716f7ff301..22aa2dc897e 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,8 @@ "@babel/plugin-syntax-dynamic-import": "7.8.3", "@babel/plugin-syntax-import-meta": "7.8.3", "@babel/preset-env": "7.9.5", - "ajv": "6.12.2", - "async": "3.2.0", + "ajv": "8.10.0", + "async": "3.2.3", "babel-eslint": "10.1.0", "babel-plugin-system-import-transformer": "^4.0.0", "babel-plugin-transform-es2015-modules-amd-lazy": "2.0.1", @@ -20,7 +20,7 @@ "eslint-plugin-promise": "4.2.1", "fb-watchman": "2.0.1", "gherkin-lint": "^4.2.2", - "glob": "7.1.6", + "glob": "7.2.0", "grunt": "^1.4.1", "grunt-babel": "8.0.0", "grunt-contrib-uglify": "4.0.1", @@ -28,15 +28,15 @@ "grunt-eslint": "22.0.0", "grunt-sass": "3.1.0", "grunt-stylelint": "0.15.0", - "jshint": "^2.11.0", + "jshint": "^2.13.4", "node-sass": "^7.0.1", - "semver": "7.3.2", + "semver": "7.3.5", "shifter": "https://github.com/andrewnicols/shifter/archive/v1.2.0_moodle-0.tar.gz", "stylelint": "13.3.3", "stylelint-checkstyle-formatter": "0.1.2", "stylelint-csstree-validator": "1.8.0", "xmldom": "^0.6.0", - "xpath": "0.0.27" + "xpath": "0.0.32" }, "engines": { "node": ">=16.14.0 <17" From 466ca1079df4b81a7ec02bde94adda75345e8e70 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Fri, 18 Feb 2022 08:52:45 +0800 Subject: [PATCH 4/5] MDL-73915 js: Upgrade babel and eslint --- .eslintrc | 5 +- .../moodle-tool_capability-search-min.js | 2 +- .../amd/build/data_deletion.min.js | 2 +- .../amd/build/defaultsactions.min.js | 2 +- .../amd/build/myrequestactions.min.js | 2 +- .../amd/build/requestactions.min.js | 2 +- .../moodle-tool_monitor-dropdown-min.js | 2 +- .../policy/amd/build/managedocsactions.min.js | 2 +- admin/tool/usertours/amd/build/tour.min.js | 2 +- .../tool/usertours/amd/build/tour.min.js.map | 2 +- ...moodle-availability_completion-form-min.js | 2 +- .../moodle-availability_date-form-min.js | 2 +- .../moodle-availability_grade-form-min.js | 2 +- .../moodle-availability_group-form-min.js | 2 +- .../moodle-availability_grouping-form-min.js | 2 +- .../moodle-availability_profile-form-min.js | 2 +- .../moodle-core_availability-form-min.js | 6 +- backup/util/ui/amd/build/async_backup.min.js | 2 +- .../moodle-backup-backupselectall-min.js | 2 +- .../moodle-backup-confirmcancel-min.js | 2 +- badges/amd/build/backpackactions.min.js | 2 +- .../amd/build/ajax_response_renderer.min.js | 2 +- .../build/ajax_response_renderer.min.js.map | 2 +- blocks/navigation/amd/build/nav_loader.min.js | 2 +- calendar/amd/build/repository.min.js | 2 +- calendar/amd/build/view_manager.min.js | 2 +- calendar/amd/build/view_manager.min.js.map | 2 +- contentbank/amd/build/actions.min.js | 2 +- contentbank/amd/build/search.min.js | 2 +- course/amd/build/activitychooser.min.js | 2 +- course/amd/build/activitychooser.min.js.map | 2 +- course/amd/build/copy_modal.min.js | 2 +- .../local/activitychooser/dialogue.min.js | 2 +- .../local/activitychooser/dialogue.min.js.map | 2 +- .../local/activitychooser/repository.min.js | 2 +- .../moodle-course-categoryexpander-min.js | 2 +- .../moodle-course-coursebase-min.js | 2 +- .../moodle-course-dragdrop-min.js | 4 +- .../moodle-course-formatchooser-min.js | 2 +- .../moodle-course-management-min.js | 8 +- .../moodle-course-util-cm-min.js | 2 +- .../moodle-course-util-section-min.js | 2 +- enrol/manual/amd/build/quickenrolment.min.js | 2 +- .../amd/build/quickenrolment.min.js.map | 2 +- .../moodle-filter_glossary-autolinker-min.js | 2 +- .../moodle-filter_mathjaxloader-loader-min.js | 2 +- .../grader/gradingpanel/comparison.min.js | 2 +- .../grader/gradingpanel/normalise.min.js | 2 +- .../grades/grader/gradingpanel/point.min.js | 2 +- .../grader/gradingpanel/repository.min.js | 2 +- .../build/grades/grader/gradingpanel.min.js | 2 +- .../build/grades/grader/gradingpanel.min.js | 2 +- ...gradereport_grader-gradereporttable-min.js | 4 +- ...le-gradereport_history-userselector-min.js | 4 +- lib/amd/build/adapter.min.js | 2 +- lib/amd/build/adapter.min.js.map | 2 +- lib/amd/build/chart_base.min.js | 2 +- lib/amd/build/chart_base.min.js.map | 2 +- lib/amd/build/chart_output_chartjs.min.js | 2 +- lib/amd/build/chart_series.min.js | 2 +- lib/amd/build/chart_series.min.js.map | 2 +- lib/amd/build/chartjs-lazy.min.js | 2 +- lib/amd/build/chartjs-lazy.min.js.map | 2 +- lib/amd/build/drawer.min.js | 2 +- lib/amd/build/drawer.min.js.map | 2 +- lib/amd/build/emoji/auto_complete.min.js | 2 +- lib/amd/build/emoji/auto_complete.min.js.map | 2 +- lib/amd/build/emoji/picker.min.js | 2 +- lib/amd/build/emoji/picker.min.js.map | 2 +- lib/amd/build/local/modal/alert.min.js | 2 +- lib/amd/build/local/modal/alert.min.js.map | 2 +- lib/amd/build/loglevel.min.js | 2 +- lib/amd/build/loglevel.min.js.map | 2 +- lib/amd/build/modal.min.js | 2 +- lib/amd/build/modal.min.js.map | 2 +- lib/amd/build/modal_cancel.min.js | 2 +- lib/amd/build/modal_cancel.min.js.map | 2 +- lib/amd/build/modal_factory.min.js | 2 +- lib/amd/build/modal_factory.min.js.map | 2 +- lib/amd/build/modal_save_cancel.min.js | 2 +- lib/amd/build/modal_save_cancel.min.js.map | 2 +- lib/amd/build/mustache.min.js | 2 +- lib/amd/build/mustache.min.js.map | 2 +- lib/amd/build/notification.min.js | 2 +- lib/amd/build/notification.min.js.map | 2 +- lib/amd/build/popper.min.js | 2 +- lib/amd/build/popper.min.js.map | 2 +- lib/amd/build/prefetch.min.js | 2 +- lib/amd/build/prefetch.min.js.map | 2 +- lib/amd/build/pubsub.min.js | 2 +- lib/amd/build/showhidesettings.min.js | 2 +- lib/amd/build/sortable_list.min.js | 2 +- lib/amd/build/sortable_list.min.js.map | 2 +- lib/amd/build/str.min.js | 2 +- lib/amd/build/str.min.js.map | 2 +- lib/amd/build/toast.min.js | 2 +- lib/amd/build/toast.min.js.map | 2 +- lib/amd/build/utils.min.js | 2 +- ...le-atto_accessibilitychecker-button-min.js | 2 +- ...dle-atto_accessibilityhelper-button-min.js | 2 +- .../moodle-atto_align-button-min.js | 2 +- .../moodle-atto_charmap-button-min.js | 4 +- .../moodle-atto_collapse-button-min.js | 2 +- .../moodle-atto_emoticon-button-min.js | 2 +- .../moodle-atto_equation-button-min.js | 4 +- .../moodle-atto_h5p-button-min.js | 4 +- .../moodle-atto_html-beautify-min.js | 20 +- .../moodle-atto_html-codemirror-min.js | 74 +- .../moodle-atto_image-button-min.js | 6 +- .../moodle-atto_link-button-min.js | 2 +- .../moodle-atto_managefiles-button-min.js | 2 +- .../moodle-atto_managefiles-usedfiles-min.js | 2 +- .../moodle-atto_media-button-min.js | 8 +- .../moodle-atto_recordrtc-button-min.js | 2 +- .../moodle-atto_recordrtc-recording-min.js | 4 +- .../moodle-atto_rtl-button-min.js | 2 +- .../moodle-atto_table-button-min.js | 8 +- .../moodle-atto_undo-button-min.js | 2 +- .../moodle-editor_atto-editor-min.js | 10 +- .../moodle-editor_atto-menu-min.js | 2 +- .../moodle-editor_atto-plugin-min.js | 4 +- .../moodle-editor_atto-rangy-min.js | 33 +- lib/form/amd/build/events.min.js | 2 +- .../moodle-form-dateselector-min.js | 4 +- .../moodle-form-shortforms-min.js | 2 +- lib/table/amd/build/dynamic.min.js | 2 +- lib/table/amd/build/dynamic.min.js.map | 2 +- .../moodle-core-actionmenu-min.js | 4 +- .../moodle-core-blocks-min.js | 4 +- .../moodle-core-chooserdialogue-min.js | 2 +- .../moodle-core-dragdrop-min.js | 4 +- .../moodle-core-formchangechecker-min.js | 2 +- .../moodle-core-languninstallconfirm-min.js | 2 +- .../moodle-core-lockscroll-min.js | 2 +- .../moodle-core-maintenancemodetimer-min.js | 2 +- ...dle-core-notification-ajaxexception-min.js | 2 +- .../moodle-core-notification-alert-min.js | 2 +- .../moodle-core-notification-confirm-min.js | 2 +- .../moodle-core-notification-dialogue-min.js | 4 +- .../moodle-core-notification-exception-min.js | 2 +- .../moodle-core-tooltip-min.js | 2 +- .../moodle-core-widget-focusafterclose-min.js | 2 +- .../videojs/amd/build/Youtube-lazy.min.js | 2 +- .../videojs/amd/build/Youtube-lazy.min.js.map | 2 +- .../videojs/amd/build/video-lazy.min.js | 2 +- .../videojs/amd/build/video-lazy.min.js.map | 2 +- .../amd/build/videojs-flash-lazy.min.js | 2 +- .../amd/build/videojs-flash-lazy.min.js.map | 2 +- .../amd/build/message_drawer_router.min.js | 2 +- .../build/message_drawer_router.min.js.map | 2 +- .../message_drawer_view_conversation.min.js | 2 +- ...essage_drawer_view_conversation.min.js.map | 2 +- ...ge_drawer_view_conversation_patcher.min.js | 2 +- ...rawer_view_conversation_patcher.min.js.map | 2 +- ...essage_drawer_view_overview_section.min.js | 2 +- .../build/message_drawer_view_search.min.js | 2 +- .../message_drawer_view_search.min.js.map | 2 +- message/amd/build/message_send_bulk.min.js | 2 +- ...oodle-message_airnotifier-toolboxes-min.js | 2 +- .../notification_area_control_area.min.js | 2 +- .../notification_area_control_area.min.js.map | 2 +- ...oodle-assignfeedback_editpdf-editor-min.js | 18 +- .../moodle-mod_assign-history-min.js | 2 +- .../amd/build/discussion_nested_v2.min.js | 2 +- .../amd/build/discussion_nested_v2.min.js.map | 2 +- .../build/grades/expandconversation.min.js | 2 +- .../grades/expandconversation.min.js.map | 2 +- mod/forum/amd/build/grades/grader.min.js | 2 +- mod/forum/amd/build/grades/grader.min.js.map | 2 +- .../amd/build/local/grades/grader.min.js | 2 +- .../amd/build/local/grades/grader.min.js.map | 2 +- .../grades/local/grader/gradingpanel.min.js | 2 +- .../grades/local/grader/user_picker.min.js | 2 +- .../local/grader/user_picker.min.js.map | 2 +- .../amd/build/local/layout/fullscreen.min.js | 2 +- .../build/local/layout/fullscreen.min.js.map | 2 +- .../moodle-mod_quiz-autosave-min.js | 2 +- .../moodle-mod_quiz-dragdrop-min.js | 4 +- .../moodle-mod_quiz-questionchooser-min.js | 2 +- .../moodle-mod_quiz-quizbase-min.js | 2 +- .../moodle-mod_quiz-toolboxes-min.js | 6 +- .../moodle-mod_quiz-util-page-min.js | 2 +- .../moodle-mod_quiz-util-slot-min.js | 2 +- mod/workshop/amd/build/modform.min.js | 2 +- npm-shrinkwrap.json | 8711 ++++++----------- package.json | 23 +- .../moodle-question-chooser-min.js | 2 +- .../moodle-question-searchform-min.js | 2 +- ...moodle-report_eventlist-eventfilter-min.js | 2 +- .../moodle-report_loglive-fetchlogs-min.js | 2 +- theme/boost/amd/build/bootstrap/alert.min.js | 2 +- .../amd/build/bootstrap/alert.min.js.map | 2 +- theme/boost/amd/build/bootstrap/button.min.js | 2 +- .../amd/build/bootstrap/button.min.js.map | 2 +- .../boost/amd/build/bootstrap/carousel.min.js | 2 +- .../amd/build/bootstrap/carousel.min.js.map | 2 +- .../boost/amd/build/bootstrap/collapse.min.js | 2 +- .../amd/build/bootstrap/collapse.min.js.map | 2 +- .../boost/amd/build/bootstrap/dropdown.min.js | 2 +- .../amd/build/bootstrap/dropdown.min.js.map | 2 +- theme/boost/amd/build/bootstrap/modal.min.js | 2 +- .../amd/build/bootstrap/modal.min.js.map | 2 +- .../boost/amd/build/bootstrap/popover.min.js | 2 +- .../amd/build/bootstrap/popover.min.js.map | 2 +- .../amd/build/bootstrap/scrollspy.min.js | 2 +- .../amd/build/bootstrap/scrollspy.min.js.map | 2 +- theme/boost/amd/build/bootstrap/tab.min.js | 2 +- .../boost/amd/build/bootstrap/tab.min.js.map | 2 +- theme/boost/amd/build/bootstrap/toast.min.js | 2 +- .../amd/build/bootstrap/toast.min.js.map | 2 +- .../build/bootstrap/tools/sanitizer.min.js | 2 +- .../bootstrap/tools/sanitizer.min.js.map | 2 +- .../boost/amd/build/bootstrap/tooltip.min.js | 2 +- .../amd/build/bootstrap/tooltip.min.js.map | 2 +- theme/boost/amd/build/loader.min.js | 2 +- theme/boost/amd/build/loader.min.js.map | 2 +- theme/boost/amd/build/pending.min.js | 2 +- theme/boost/amd/build/pending.min.js.map | 2 +- theme/boost/amd/build/scroll.min.js | 2 +- theme/boost/amd/build/scroll.min.js.map | 2 +- .../local/participants/bulkactions.min.js | 2 +- .../local/participants/bulkactions.min.js.map | 2 +- .../local/participantsfilter/filter.min.js | 2 +- .../participantsfilter/filter.min.js.map | 2 +- .../filtertypes/courseid.min.js | 2 +- .../filtertypes/courseid.min.js.map | 2 +- .../filtertypes/keyword.min.js | 2 +- .../filtertypes/keyword.min.js.map | 2 +- user/amd/build/participants.min.js | 2 +- user/amd/build/participants.min.js.map | 2 +- user/amd/build/participantsfilter.min.js | 2 +- user/amd/build/participantsfilter.min.js.map | 2 +- user/amd/build/repository.min.js | 2 +- user/amd/build/status_field.min.js | 2 +- user/amd/build/status_field.min.js.map | 2 +- 235 files changed, 3458 insertions(+), 5948 deletions(-) diff --git a/.eslintrc b/.eslintrc index e44591a3b8d..3e3a87b06d1 100644 --- a/.eslintrc +++ b/.eslintrc @@ -211,7 +211,7 @@ }, // We're using babel transpiling so use their parser // for linting. - parser: 'babel-eslint', + parser: '@babel/eslint-parser', // Check AMD with some slightly stricter rules. rules: { 'no-unused-vars': 'error', @@ -242,7 +242,8 @@ }, parserOptions: { 'ecmaVersion': 9, - 'sourceType': 'module' + 'sourceType': 'module', + 'requireConfigFile': false, } } ] diff --git a/admin/tool/capability/yui/build/moodle-tool_capability-search/moodle-tool_capability-search-min.js b/admin/tool/capability/yui/build/moodle-tool_capability-search/moodle-tool_capability-search-min.js index 6520ca28100..43c93e0b5cc 100644 --- a/admin/tool/capability/yui/build/moodle-tool_capability-search/moodle-tool_capability-search-min.js +++ b/admin/tool/capability/yui/build/moodle-tool_capability-search/moodle-tool_capability-search-min.js @@ -1 +1 @@ -YUI.add("moodle-tool_capability-search",function(i,t){var e=function(){e.superclass.constructor.apply(this,arguments)};e.prototype={form:null,select:null,selectoptions:{},input:null,button:null,lastsearch:null,initializer:function(){this.form=i.one("#capability-overview-form"),this.select=this.form.one("select[data-search=capability]"),this.select.setStyle("minWidth",this.select.get("offsetWidth")),this.select.get("options").each(function(t){var e=t.get("value");this.selectoptions[e]=t},this),this.button=this.form.all("input[type=submit]"),this.lastsearch=this.form.one("input[name=search]");var t=i.Node.create('
'),e=i.Node.create('");this.input=i.Node.create(''),t.append(e).append(this.input),this.select.insert(t,"before"),this.input.on("keyup",this.typed,this),this.select.on("change",this.validate,this),this.lastsearch&&(this.input.set("value",this.lastsearch.get("value")),this.typed(),this.select.one("option[selected]")&&this.select.set("scrollTop",this.select.one("option[selected]").get("getX"))),this.validate()},validate:function(){this.button.set("disabled",""===this.select.get("value"))},typed:function(){var t,e=this.input.get("value"),i=0,s=null;for(t in this.lastsearch&&this.lastsearch.set("value",e),this.select.all("option").remove(),this.selectoptions)0<=t.indexOf(e)&&(i++,s=this.selectoptions[t],this.select.append(this.selectoptions[t]));0===i?this.input.addClass("error"):(this.input.removeClass("error"),1===i&&s.set("selected",!0)),this.validate()}},i.extend(e,i.Base,e.prototype,{NAME:"tool_capability-search",ATTRS:{strsearch:{}}}),M.tool_capability=M.tool_capability||{},M.tool_capability.init_capability_search=function(t){new e(t)}},"@VERSION@",{requires:["base","node"]}); \ No newline at end of file +YUI.add("moodle-tool_capability-search",function(i,t){var e=function(){e.superclass.constructor.apply(this,arguments)};i.extend(e,i.Base,e.prototype={form:null,select:null,selectoptions:{},input:null,button:null,lastsearch:null,initializer:function(){this.form=i.one("#capability-overview-form"),this.select=this.form.one("select[data-search=capability]"),this.select.setStyle("minWidth",this.select.get("offsetWidth")),this.select.get("options").each(function(t){var e=t.get("value");this.selectoptions[e]=t},this),this.button=this.form.all("input[type=submit]"),this.lastsearch=this.form.one("input[name=search]");var t=i.Node.create('
'),e=i.Node.create('");this.input=i.Node.create(''),t.append(e).append(this.input),this.select.insert(t,"before"),this.input.on("keyup",this.typed,this),this.select.on("change",this.validate,this),this.lastsearch&&(this.input.set("value",this.lastsearch.get("value")),this.typed(),this.select.one("option[selected]")&&this.select.set("scrollTop",this.select.one("option[selected]").get("getX"))),this.validate()},validate:function(){this.button.set("disabled",""===this.select.get("value"))},typed:function(){var t,e=this.input.get("value"),i=0,s=null;for(t in this.lastsearch&&this.lastsearch.set("value",e),this.select.all("option").remove(),this.selectoptions)0<=t.indexOf(e)&&(i++,s=this.selectoptions[t],this.select.append(this.selectoptions[t]));0===i?this.input.addClass("error"):(this.input.removeClass("error"),1===i&&s.set("selected",!0)),this.validate()}},{NAME:"tool_capability-search",ATTRS:{strsearch:{}}}),M.tool_capability=M.tool_capability||{},M.tool_capability.init_capability_search=function(t){new e(t)}},"@VERSION@",{requires:["base","node"]}); \ No newline at end of file diff --git a/admin/tool/dataprivacy/amd/build/data_deletion.min.js b/admin/tool/dataprivacy/amd/build/data_deletion.min.js index 88f9f42ce41..fe2296d9825 100644 --- a/admin/tool/dataprivacy/amd/build/data_deletion.min.js +++ b/admin/tool/dataprivacy/amd/build/data_deletion.min.js @@ -1,2 +1,2 @@ -define ("tool_dataprivacy/data_deletion",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f){var h={MARK_FOR_DELETION:"[data-action=\"markfordeletion\"]",SELECT_ALL:"[data-action=\"selectall\"]"},i={SELECTCONTEXT:".selectcontext"},j=function(){this.registerEvents()};j.prototype.registerEvents=function(){a(h.MARK_FOR_DELETION).click(function(b){b.preventDefault();var c=[];a(i.SELECTCONTEXT).each(function(){var b=a(this);if(b.is(":checked")){c.push(b.val())}});g(c)});a(h.SELECT_ALL).change(function(b){b.preventDefault();var c=a(this);if(c.is(":checked")){a(i.SELECTCONTEXT).attr("checked","checked")}else{a(i.SELECTCONTEXT).removeAttr("checked")}})};function g(a){var g="";d.get_strings([{key:"confirm",component:"moodle"},{key:"confirmcontextdeletion",component:"tool_dataprivacy"}]).then(function(a){g=a[0];var b=a[1];return e.create({title:g,body:b,type:e.types.SAVE_CANCEL})}).then(function(d){d.setSaveButtonText(g);d.getRoot().on(f.save,function(){b.call([{methodname:"tool_dataprivacy_confirm_contexts_for_deletion",args:{ids:a}}])[0].done(function(a){if(a.result){window.location.reload()}else{c.addNotification({message:a.warnings[0].message,type:"error"})}}).fail(c.exception)});d.getRoot().on(f.hidden,function(){d.destroy()});return d}).done(function(a){a.show()}).fail(c.exception)}return j}); +define ("tool_dataprivacy/data_deletion",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f){var g={MARK_FOR_DELETION:"[data-action=\"markfordeletion\"]",SELECT_ALL:"[data-action=\"selectall\"]"},h={SELECTCONTEXT:".selectcontext"},i=function(){this.registerEvents()};i.prototype.registerEvents=function(){a(g.MARK_FOR_DELETION).click(function(b){b.preventDefault();var c=[];a(h.SELECTCONTEXT).each(function(){var b=a(this);if(b.is(":checked")){c.push(b.val())}});j(c)});a(g.SELECT_ALL).change(function(b){b.preventDefault();var c=a(this);if(c.is(":checked")){a(h.SELECTCONTEXT).attr("checked","checked")}else{a(h.SELECTCONTEXT).removeAttr("checked")}})};function j(a){var g="";d.get_strings([{key:"confirm",component:"moodle"},{key:"confirmcontextdeletion",component:"tool_dataprivacy"}]).then(function(a){g=a[0];var b=a[1];return e.create({title:g,body:b,type:e.types.SAVE_CANCEL})}).then(function(d){d.setSaveButtonText(g);d.getRoot().on(f.save,function(){b.call([{methodname:"tool_dataprivacy_confirm_contexts_for_deletion",args:{ids:a}}])[0].done(function(a){if(a.result){window.location.reload()}else{c.addNotification({message:a.warnings[0].message,type:"error"})}}).fail(c.exception)});d.getRoot().on(f.hidden,function(){d.destroy()});return d}).done(function(a){a.show()}).fail(c.exception)}return i}); //# sourceMappingURL=data_deletion.min.js.map diff --git a/admin/tool/dataprivacy/amd/build/defaultsactions.min.js b/admin/tool/dataprivacy/amd/build/defaultsactions.min.js index fa8e7fcac27..e65b6b7ffa4 100644 --- a/admin/tool/dataprivacy/amd/build/defaultsactions.min.js +++ b/admin/tool/dataprivacy/amd/build/defaultsactions.min.js @@ -1,2 +1,2 @@ -define ("tool_dataprivacy/defaultsactions",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events","core/templates"],function(a,b,c,d,f,g,h){var k={EDIT_LEVEL_DEFAULTS:"[data-action=\"edit-level-defaults\"]",NEW_ACTIVITY_DEFAULTS:"[data-action=\"new-activity-defaults\"]",EDIT_ACTIVITY_DEFAULTS:"[data-action=\"edit-activity-defaults\"]",DELETE_ACTIVITY_DEFAULTS:"[data-action=\"delete-activity-defaults\"]"},l=-1,m=function(){this.registerEvents()};m.prototype.registerEvents=function(){a(k.EDIT_LEVEL_DEFAULTS).click(function(f){f.preventDefault();var e=a(this),g=e.data("contextlevel"),h=e.data("category"),j=e.data("purpose"),k=b.call([{methodname:"tool_dataprivacy_get_category_options",args:{}},{methodname:"tool_dataprivacy_get_purpose_options",args:{}}]),l=d.get_string("editdefaults","tool_dataprivacy",a("#defaults-header").text());a.when(k[0],k[1],l).then(function(a,b,c){var d=a.options,e=b.options;i(c,g,h,j,null,d,e,null);return!0}).catch(c.exception)});a(k.NEW_ACTIVITY_DEFAULTS).click(function(f){f.preventDefault();var e=a(this),g=e.data("contextlevel"),h=b.call([{methodname:"tool_dataprivacy_get_category_options",args:{}},{methodname:"tool_dataprivacy_get_purpose_options",args:{}},{methodname:"tool_dataprivacy_get_activity_options",args:{nodefaults:!0}}]),j=d.get_string("addnewdefaults","tool_dataprivacy");a.when(h[0],h[1],h[2],j).then(function(a,b,c,d){var e=a.options,f=b.options,h=c.options;i(d,g,null,null,null,e,f,h);return!0}).catch(c.exception)});a(k.EDIT_ACTIVITY_DEFAULTS).click(function(f){f.preventDefault();var e=a(this),g=e.data("contextlevel"),h=e.data("category"),j=e.data("purpose"),k=e.data("activityname"),l=b.call([{methodname:"tool_dataprivacy_get_category_options",args:{}},{methodname:"tool_dataprivacy_get_purpose_options",args:{}},{methodname:"tool_dataprivacy_get_activity_options",args:{}}]),m=d.get_string("editmoduledefaults","tool_dataprivacy");a.when(l[0],l[1],l[2],m).then(function(a,b,c,d){var e=a.options,f=b.options,l=c.options;i(d,g,h,j,k,e,f,l);return!0}).catch(c.exception)});a(k.DELETE_ACTIVITY_DEFAULTS).click(function(b){b.preventDefault();var e=a(this),i=e.data("contextlevel"),k=e.data("activityname"),m=e.data("activitydisplayname");f.create({title:d.get_string("deletedefaults","tool_dataprivacy",m),body:h.render("tool_dataprivacy/delete_activity_defaults",{activityname:m}),type:f.types.SAVE_CANCEL,large:!0}).then(function(a){a.setSaveButtonText(d.get_string("delete"));a.getRoot().on(g.save,function(){j(i,l,l,k,!1)});a.getRoot().on(g.hidden,function(){a.destroy()});a.show();return!0}).catch(c.exception)})};function i(b,d,e,i,k,l,m,n){if(null!==e){l.forEach(function(a){if(a.id===e){a.selected=!0}})}if(null!==i){m.forEach(function(a){if(a.id===i){a.selected=!0}})}var o={contextlevel:d,categoryoptions:l,purposeoptions:m};if(null!==n&&n.length){if(null===k){o.newactivitydefaults=!0}else{n.forEach(function(a){if(k===a.name){a.selected=!0}})}o.modemodule=!0;o.activityoptions=n}f.create({title:b,body:h.render("tool_dataprivacy/category_purpose_form",o),type:f.types.SAVE_CANCEL,large:!0}).then(function(b){b.getRoot().on(g.save,function(){var b=a("#activity"),c="undefined"!=typeof b?b.val():null,d=a("#override"),e="undefined"!=typeof d?d.is(":checked"):!1;j(a("#contextlevel").val(),a("#category").val(),a("#purpose").val(),c,e)});b.getRoot().on(g.hidden,function(){b.destroy()});b.show();return b}).catch(c.exception)}function j(a,c,d,e,f){b.call([{methodname:"tool_dataprivacy_set_context_defaults",args:{contextlevel:a,category:c,purpose:d,override:f,activity:e}}])[0].done(function(a){if(a.result){window.location.reload()}})}return{init:function init(){return new m}}}); +define ("tool_dataprivacy/defaultsactions",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events","core/templates"],function(a,b,c,d,f,g,h){var i={EDIT_LEVEL_DEFAULTS:"[data-action=\"edit-level-defaults\"]",NEW_ACTIVITY_DEFAULTS:"[data-action=\"new-activity-defaults\"]",EDIT_ACTIVITY_DEFAULTS:"[data-action=\"edit-activity-defaults\"]",DELETE_ACTIVITY_DEFAULTS:"[data-action=\"delete-activity-defaults\"]"},j=-1,k=function(){this.registerEvents()};k.prototype.registerEvents=function(){a(i.EDIT_LEVEL_DEFAULTS).click(function(f){f.preventDefault();var e=a(this),g=e.data("contextlevel"),h=e.data("category"),i=e.data("purpose"),j=b.call([{methodname:"tool_dataprivacy_get_category_options",args:{}},{methodname:"tool_dataprivacy_get_purpose_options",args:{}}]),k=d.get_string("editdefaults","tool_dataprivacy",a("#defaults-header").text());a.when(j[0],j[1],k).then(function(a,b,c){var d=a.options,e=b.options;l(c,g,h,i,null,d,e,null);return!0}).catch(c.exception)});a(i.NEW_ACTIVITY_DEFAULTS).click(function(f){f.preventDefault();var e=a(this),g=e.data("contextlevel"),h=b.call([{methodname:"tool_dataprivacy_get_category_options",args:{}},{methodname:"tool_dataprivacy_get_purpose_options",args:{}},{methodname:"tool_dataprivacy_get_activity_options",args:{nodefaults:!0}}]),i=d.get_string("addnewdefaults","tool_dataprivacy");a.when(h[0],h[1],h[2],i).then(function(a,b,c,d){var e=a.options,f=b.options,h=c.options;l(d,g,null,null,null,e,f,h);return!0}).catch(c.exception)});a(i.EDIT_ACTIVITY_DEFAULTS).click(function(f){f.preventDefault();var e=a(this),g=e.data("contextlevel"),h=e.data("category"),i=e.data("purpose"),j=e.data("activityname"),k=b.call([{methodname:"tool_dataprivacy_get_category_options",args:{}},{methodname:"tool_dataprivacy_get_purpose_options",args:{}},{methodname:"tool_dataprivacy_get_activity_options",args:{}}]),m=d.get_string("editmoduledefaults","tool_dataprivacy");a.when(k[0],k[1],k[2],m).then(function(a,b,c,d){var e=a.options,f=b.options,k=c.options;l(d,g,h,i,j,e,f,k);return!0}).catch(c.exception)});a(i.DELETE_ACTIVITY_DEFAULTS).click(function(b){b.preventDefault();var e=a(this),i=e.data("contextlevel"),k=e.data("activityname"),l=e.data("activitydisplayname");f.create({title:d.get_string("deletedefaults","tool_dataprivacy",l),body:h.render("tool_dataprivacy/delete_activity_defaults",{activityname:l}),type:f.types.SAVE_CANCEL,large:!0}).then(function(a){a.setSaveButtonText(d.get_string("delete"));a.getRoot().on(g.save,function(){m(i,j,j,k,!1)});a.getRoot().on(g.hidden,function(){a.destroy()});a.show();return!0}).catch(c.exception)})};function l(b,d,e,i,j,k,l,n){if(null!==e){k.forEach(function(a){if(a.id===e){a.selected=!0}})}if(null!==i){l.forEach(function(a){if(a.id===i){a.selected=!0}})}var o={contextlevel:d,categoryoptions:k,purposeoptions:l};if(null!==n&&n.length){if(null===j){o.newactivitydefaults=!0}else{n.forEach(function(a){if(j===a.name){a.selected=!0}})}o.modemodule=!0;o.activityoptions=n}f.create({title:b,body:h.render("tool_dataprivacy/category_purpose_form",o),type:f.types.SAVE_CANCEL,large:!0}).then(function(b){b.getRoot().on(g.save,function(){var b=a("#activity"),c="undefined"!=typeof b?b.val():null,d=a("#override"),e="undefined"!=typeof d?d.is(":checked"):!1;m(a("#contextlevel").val(),a("#category").val(),a("#purpose").val(),c,e)});b.getRoot().on(g.hidden,function(){b.destroy()});b.show();return b}).catch(c.exception)}function m(a,c,d,e,f){b.call([{methodname:"tool_dataprivacy_set_context_defaults",args:{contextlevel:a,category:c,purpose:d,override:f,activity:e}}])[0].done(function(a){if(a.result){window.location.reload()}})}return{init:function init(){return new k}}}); //# sourceMappingURL=defaultsactions.min.js.map diff --git a/admin/tool/dataprivacy/amd/build/myrequestactions.min.js b/admin/tool/dataprivacy/amd/build/myrequestactions.min.js index a6ba75991d1..393feb16c39 100644 --- a/admin/tool/dataprivacy/amd/build/myrequestactions.min.js +++ b/admin/tool/dataprivacy/amd/build/myrequestactions.min.js @@ -1,2 +1,2 @@ -define ("tool_dataprivacy/myrequestactions",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events","core/templates","core/pending"],function(a,b,c,d,e,f,g,h){var j={CANCEL_REQUEST:"[data-action=\"cancel\"]",CONTACT_DPO:"[data-action=\"contactdpo\"]"},k=function(){this.registerEvents()};k.prototype.registerEvents=function(){a(j.CANCEL_REQUEST).click(function(g){g.preventDefault();var h=a(this).data("requestid");d.get_strings([{key:"cancelrequest",component:"tool_dataprivacy"},{key:"cancelrequestconfirmation",component:"tool_dataprivacy"}]).then(function(a){var d=a[0],g=a[1];return e.create({title:d,body:g,type:e.types.SAVE_CANCEL}).then(function(a){a.setSaveButtonText(d);a.getRoot().on(f.save,function(){b.call([{methodname:"tool_dataprivacy_cancel_data_request",args:{requestid:h}}])[0].done(function(a){if(a.result){window.location.reload()}else{c.addNotification({message:a.warnings[0].message,type:"error"})}}).fail(c.exception)});a.getRoot().on(f.hidden,function(){a.destroy()});return a})}).done(function(a){a.show()}).fail(c.exception)});a(j.CONTACT_DPO).click(function(b){var j=new h("dataprivacy/crud:initModal:contactdpo");b.preventDefault();var k=a(this).data("replytoemail"),l="";d.get_strings([{key:"contactdataprotectionofficer",component:"tool_dataprivacy"},{key:"send",component:"tool_dataprivacy"}]).then(function(a){var b=a[0];l=a[1];return e.create({title:b,body:g.render("tool_dataprivacy/contact_dpo",{replytoemail:k}),type:e.types.SAVE_CANCEL,large:!0})}).then(function(b){b.setSaveButtonText(l);b.show();b.getRoot().on(f.save,function(b){var c=a("#message").val().trim();if(0===c.length){b.preventDefault();a("[data-region=\"messageinput\"]").addClass("has-danger notifyproblem");a("#id_error_message").removeAttr("hidden")}else{i(c)}});b.getRoot().on(f.hidden,function(){b.destroy()})}).then(j.resolve).catch(c.exception)})};function i(a){var e="success";b.call([{methodname:"tool_dataprivacy_contact_dpo",args:{message:a}}])[0].then(function(a){if(a.result){return d.get_string("requestsubmitted","tool_dataprivacy")}e="error";return a.warnings.join("
")}).done(function(a){c.addNotification({message:a,type:e})}).fail(c.exception)}return{init:function init(){return new k}}}); +define ("tool_dataprivacy/myrequestactions",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events","core/templates","core/pending"],function(a,b,c,d,e,f,g,h){var i={CANCEL_REQUEST:"[data-action=\"cancel\"]",CONTACT_DPO:"[data-action=\"contactdpo\"]"},j=function(){this.registerEvents()};j.prototype.registerEvents=function(){a(i.CANCEL_REQUEST).click(function(g){g.preventDefault();var h=a(this).data("requestid");d.get_strings([{key:"cancelrequest",component:"tool_dataprivacy"},{key:"cancelrequestconfirmation",component:"tool_dataprivacy"}]).then(function(a){var d=a[0],g=a[1];return e.create({title:d,body:g,type:e.types.SAVE_CANCEL}).then(function(a){a.setSaveButtonText(d);a.getRoot().on(f.save,function(){b.call([{methodname:"tool_dataprivacy_cancel_data_request",args:{requestid:h}}])[0].done(function(a){if(a.result){window.location.reload()}else{c.addNotification({message:a.warnings[0].message,type:"error"})}}).fail(c.exception)});a.getRoot().on(f.hidden,function(){a.destroy()});return a})}).done(function(a){a.show()}).fail(c.exception)});a(i.CONTACT_DPO).click(function(b){var i=new h("dataprivacy/crud:initModal:contactdpo");b.preventDefault();var j=a(this).data("replytoemail"),l="";d.get_strings([{key:"contactdataprotectionofficer",component:"tool_dataprivacy"},{key:"send",component:"tool_dataprivacy"}]).then(function(a){var b=a[0];l=a[1];return e.create({title:b,body:g.render("tool_dataprivacy/contact_dpo",{replytoemail:j}),type:e.types.SAVE_CANCEL,large:!0})}).then(function(b){b.setSaveButtonText(l);b.show();b.getRoot().on(f.save,function(b){var c=a("#message").val().trim();if(0===c.length){b.preventDefault();a("[data-region=\"messageinput\"]").addClass("has-danger notifyproblem");a("#id_error_message").removeAttr("hidden")}else{k(c)}});b.getRoot().on(f.hidden,function(){b.destroy()})}).then(i.resolve).catch(c.exception)})};function k(a){var e="success";b.call([{methodname:"tool_dataprivacy_contact_dpo",args:{message:a}}])[0].then(function(a){if(a.result){return d.get_string("requestsubmitted","tool_dataprivacy")}e="error";return a.warnings.join("
")}).done(function(a){c.addNotification({message:a,type:e})}).fail(c.exception)}return{init:function init(){return new j}}}); //# sourceMappingURL=myrequestactions.min.js.map diff --git a/admin/tool/dataprivacy/amd/build/requestactions.min.js b/admin/tool/dataprivacy/amd/build/requestactions.min.js index 3c081e89dda..a15474f55f7 100644 --- a/admin/tool/dataprivacy/amd/build/requestactions.min.js +++ b/admin/tool/dataprivacy/amd/build/requestactions.min.js @@ -1,2 +1,2 @@ -define ("tool_dataprivacy/requestactions",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events","core/templates","tool_dataprivacy/data_request_modal","tool_dataprivacy/events"],function(a,b,c,d,e,f,g,h,i){var q={APPROVE_REQUEST:"[data-action=\"approve\"]",DENY_REQUEST:"[data-action=\"deny\"]",VIEW_REQUEST:"[data-action=\"view\"]",MARK_COMPLETE:"[data-action=\"complete\"]",CHANGE_BULK_ACTION:"[id=\"bulk-action\"]",CONFIRM_BULK_ACTION:"[id=\"confirm-bulk-action\"]",SELECT_ALL:"[data-action=\"selectall\"]"},r={APPROVE:1,DENY:2},s={SELECT_REQUEST:".selectrequests"},t=function(){this.registerEvents()};t.prototype.registerEvents=function(){a(q.VIEW_REQUEST).click(function(d){d.preventDefault();var k=a(this).data("requestid"),m=b.call([{methodname:"tool_dataprivacy_get_data_request",args:{requestid:k}}]);a.when(m[0]).then(function(a){if(a.result){return a.result}c.addNotification({message:a.warnings[0].message,type:"error"});return!1}).then(function(a){var b=g.render("tool_dataprivacy/request_details",a),c={approvedeny:a.approvedeny,canmarkcomplete:a.canmarkcomplete};return e.create({title:a.typename,body:b,type:h.TYPE,large:!0,templateContext:c})}).then(function(a){a.getRoot().on(i.approve,function(){o(i.approve,j(k))});a.getRoot().on(i.deny,function(){o(i.deny,l(k))});a.getRoot().on(i.complete,function(){p("tool_dataprivacy_mark_complete",{requestid:k})});a.getRoot().on(f.hidden,function(){a.destroy()});a.show()}).catch(c.exception)});a(q.APPROVE_REQUEST).click(function(b){b.preventDefault();var c=a(this).data("requestid");o(i.approve,j(c))});a(q.DENY_REQUEST).click(function(b){b.preventDefault();var c=a(this).data("requestid");o(i.deny,l(c))});a(q.MARK_COMPLETE).click(function(b){b.preventDefault();var c=a(this).data("requestid");o(i.complete,n(c))});a(q.CONFIRM_BULK_ACTION).click(function(){var b=[],e="",f={},g=[{key:"selectbulkaction",component:"tool_dataprivacy"},{key:"selectdatarequests",component:"tool_dataprivacy"},{key:"ok"}],h=parseInt(a("#bulk-action").val());if(h!=r.APPROVE&&h!=r.DENY){d.get_strings(g).done(function(a){c.alert("",a[0],a[2])}).fail(c.exception);return}a(".selectrequests:checked").each(function(){b.push(a(this).val())});if(1>b.length){d.get_strings(g).done(function(a){c.alert("",a[1],a[2])}).fail(c.exception);return}switch(h){case r.APPROVE:e=i.bulkApprove;f=k(b);break;case r.DENY:e=i.bulkDeny;f=m(b);}o(e,f)});a(q.SELECT_ALL).change(function(b){b.preventDefault();var c=a(this).is(":checked");a(s.SELECT_REQUEST).prop("checked",c)})};function j(a){return{wsfunction:"tool_dataprivacy_approve_data_request",wsparams:{requestid:a}}}function k(a){return{wsfunction:"tool_dataprivacy_bulk_approve_data_requests",wsparams:{requestids:a}}}function l(a){return{wsfunction:"tool_dataprivacy_deny_data_request",wsparams:{requestid:a}}}function m(a){return{wsfunction:"tool_dataprivacy_bulk_deny_data_requests",wsparams:{requestids:a}}}function n(a){return{wsfunction:"tool_dataprivacy_mark_complete",wsparams:{requestid:a}}}function o(a,b){var g=[];switch(a){case i.approve:g=[{key:"approverequest",component:"tool_dataprivacy"},{key:"confirmapproval",component:"tool_dataprivacy"}];break;case i.bulkApprove:g=[{key:"bulkapproverequests",component:"tool_dataprivacy"},{key:"confirmbulkapproval",component:"tool_dataprivacy"}];break;case i.deny:g=[{key:"denyrequest",component:"tool_dataprivacy"},{key:"confirmdenial",component:"tool_dataprivacy"}];break;case i.bulkDeny:g=[{key:"bulkdenyrequests",component:"tool_dataprivacy"},{key:"confirmbulkdenial",component:"tool_dataprivacy"}];break;case i.complete:g=[{key:"markcomplete",component:"tool_dataprivacy"},{key:"confirmcompletion",component:"tool_dataprivacy"}];break;}var h="";d.get_strings(g).then(function(a){h=a[0];var b=a[1];return e.create({title:h,body:b,type:e.types.SAVE_CANCEL})}).then(function(a){a.setSaveButtonText(h);a.getRoot().on(f.save,function(){p(b.wsfunction,b.wsparams)});a.getRoot().on(f.hidden,function(){a.destroy()});a.show()}).catch(c.exception)}function p(a,d){b.call([{methodname:a,args:d}])[0].done(function(a){if(a.result){window.location.reload()}else{c.addNotification({message:a.warnings[0].message,type:"error"})}}).fail(c.exception)}return t}); +define ("tool_dataprivacy/requestactions",["jquery","core/ajax","core/notification","core/str","core/modal_factory","core/modal_events","core/templates","tool_dataprivacy/data_request_modal","tool_dataprivacy/events"],function(a,b,c,d,e,f,g,h,i){var j={APPROVE_REQUEST:"[data-action=\"approve\"]",DENY_REQUEST:"[data-action=\"deny\"]",VIEW_REQUEST:"[data-action=\"view\"]",MARK_COMPLETE:"[data-action=\"complete\"]",CHANGE_BULK_ACTION:"[id=\"bulk-action\"]",CONFIRM_BULK_ACTION:"[id=\"confirm-bulk-action\"]",SELECT_ALL:"[data-action=\"selectall\"]"},k={APPROVE:1,DENY:2},l={SELECT_REQUEST:".selectrequests"},m=function(){this.registerEvents()};m.prototype.registerEvents=function(){a(j.VIEW_REQUEST).click(function(d){d.preventDefault();var j=a(this).data("requestid"),k=b.call([{methodname:"tool_dataprivacy_get_data_request",args:{requestid:j}}]);a.when(k[0]).then(function(a){if(a.result){return a.result}c.addNotification({message:a.warnings[0].message,type:"error"});return!1}).then(function(a){var b=g.render("tool_dataprivacy/request_details",a),c={approvedeny:a.approvedeny,canmarkcomplete:a.canmarkcomplete};return e.create({title:a.typename,body:b,type:h.TYPE,large:!0,templateContext:c})}).then(function(a){a.getRoot().on(i.approve,function(){s(i.approve,n(j))});a.getRoot().on(i.deny,function(){s(i.deny,p(j))});a.getRoot().on(i.complete,function(){t("tool_dataprivacy_mark_complete",{requestid:j})});a.getRoot().on(f.hidden,function(){a.destroy()});a.show()}).catch(c.exception)});a(j.APPROVE_REQUEST).click(function(b){b.preventDefault();var c=a(this).data("requestid");s(i.approve,n(c))});a(j.DENY_REQUEST).click(function(b){b.preventDefault();var c=a(this).data("requestid");s(i.deny,p(c))});a(j.MARK_COMPLETE).click(function(b){b.preventDefault();var c=a(this).data("requestid");s(i.complete,r(c))});a(j.CONFIRM_BULK_ACTION).click(function(){var b=[],e="",f={},g=[{key:"selectbulkaction",component:"tool_dataprivacy"},{key:"selectdatarequests",component:"tool_dataprivacy"},{key:"ok"}],h=parseInt(a("#bulk-action").val());if(h!=k.APPROVE&&h!=k.DENY){d.get_strings(g).done(function(a){c.alert("",a[0],a[2])}).fail(c.exception);return}a(".selectrequests:checked").each(function(){b.push(a(this).val())});if(1>b.length){d.get_strings(g).done(function(a){c.alert("",a[1],a[2])}).fail(c.exception);return}switch(h){case k.APPROVE:e=i.bulkApprove;f=o(b);break;case k.DENY:e=i.bulkDeny;f=q(b);}s(e,f)});a(j.SELECT_ALL).change(function(b){b.preventDefault();var c=a(this).is(":checked");a(l.SELECT_REQUEST).prop("checked",c)})};function n(a){return{wsfunction:"tool_dataprivacy_approve_data_request",wsparams:{requestid:a}}}function o(a){return{wsfunction:"tool_dataprivacy_bulk_approve_data_requests",wsparams:{requestids:a}}}function p(a){return{wsfunction:"tool_dataprivacy_deny_data_request",wsparams:{requestid:a}}}function q(a){return{wsfunction:"tool_dataprivacy_bulk_deny_data_requests",wsparams:{requestids:a}}}function r(a){return{wsfunction:"tool_dataprivacy_mark_complete",wsparams:{requestid:a}}}function s(a,b){var g=[];switch(a){case i.approve:g=[{key:"approverequest",component:"tool_dataprivacy"},{key:"confirmapproval",component:"tool_dataprivacy"}];break;case i.bulkApprove:g=[{key:"bulkapproverequests",component:"tool_dataprivacy"},{key:"confirmbulkapproval",component:"tool_dataprivacy"}];break;case i.deny:g=[{key:"denyrequest",component:"tool_dataprivacy"},{key:"confirmdenial",component:"tool_dataprivacy"}];break;case i.bulkDeny:g=[{key:"bulkdenyrequests",component:"tool_dataprivacy"},{key:"confirmbulkdenial",component:"tool_dataprivacy"}];break;case i.complete:g=[{key:"markcomplete",component:"tool_dataprivacy"},{key:"confirmcompletion",component:"tool_dataprivacy"}];break;}var h="";d.get_strings(g).then(function(a){h=a[0];var b=a[1];return e.create({title:h,body:b,type:e.types.SAVE_CANCEL})}).then(function(a){a.setSaveButtonText(h);a.getRoot().on(f.save,function(){t(b.wsfunction,b.wsparams)});a.getRoot().on(f.hidden,function(){a.destroy()});a.show()}).catch(c.exception)}function t(a,d){b.call([{methodname:a,args:d}])[0].done(function(a){if(a.result){window.location.reload()}else{c.addNotification({message:a.warnings[0].message,type:"error"})}}).fail(c.exception)}return m}); //# sourceMappingURL=requestactions.min.js.map diff --git a/admin/tool/monitor/yui/build/moodle-tool_monitor-dropdown/moodle-tool_monitor-dropdown-min.js b/admin/tool/monitor/yui/build/moodle-tool_monitor-dropdown/moodle-tool_monitor-dropdown-min.js index 2e8537e4ccb..d30bd3f47fd 100644 --- a/admin/tool/monitor/yui/build/moodle-tool_monitor-dropdown/moodle-tool_monitor-dropdown-min.js +++ b/admin/tool/monitor/yui/build/moodle-tool_monitor-dropdown/moodle-tool_monitor-dropdown-min.js @@ -1 +1 @@ -YUI.add("moodle-tool_monitor-dropdown",function(s,e){function t(){t.superclass.constructor.apply(this,arguments)}var n="#id_plugin",i="#id_eventname",a="option";s.extend(t,s.Base,{plugin:null,eventname:null,initializer:function(){this.plugin=s.one(n),this.eventname=s.one(i);var e=this.eventname.get("value");this.updateEventsList(),this.updateSelection(e),this.plugin.on("change",this.updateEventsList,this)},updateEventsList:function(){var n,e,t,i=this.plugin.get("value"),o="\\"+i+"\\";this.eventname.all(a).remove(!0),e=this.get("eventlist"),(t=s.Node.create('")).set("selected","selected"),this.eventname.appendChild(t),s.Object.each(e,function(e,t){t.substring(0,o.length)===o&&(n=s.Node.create('"),this.eventname.appendChild(n))},this)},updateSelection:function(t){this.eventname.get("options").each(function(e){e.get("value")===t&&e.set("selected","selected")},this)}},{NAME:"dropDown",ATTRS:{eventlist:null}}),s.namespace("M.tool_monitor.DropDown").init=function(e){return new t(e)}},"@VERSION@",{requires:["base","event","node"]}); \ No newline at end of file +YUI.add("moodle-tool_monitor-dropdown",function(o,e){function t(){t.superclass.constructor.apply(this,arguments)}var n="#id_plugin",i="#id_eventname",s="option";o.extend(t,o.Base,{plugin:null,eventname:null,initializer:function(){this.plugin=o.one(n),this.eventname=o.one(i);var e=this.eventname.get("value");this.updateEventsList(),this.updateSelection(e),this.plugin.on("change",this.updateEventsList,this)},updateEventsList:function(){var n,e,t=this.plugin.get("value"),i="\\"+t+"\\";this.eventname.all(s).remove(!0),t=this.get("eventlist"),(e=o.Node.create('")).set("selected","selected"),this.eventname.appendChild(e),o.Object.each(t,function(e,t){t.substring(0,i.length)===i&&(n=o.Node.create('"),this.eventname.appendChild(n))},this)},updateSelection:function(t){this.eventname.get("options").each(function(e){e.get("value")===t&&e.set("selected","selected")},this)}},{NAME:"dropDown",ATTRS:{eventlist:null}}),o.namespace("M.tool_monitor.DropDown").init=function(e){return new t(e)}},"@VERSION@",{requires:["base","event","node"]}); \ No newline at end of file diff --git a/admin/tool/policy/amd/build/managedocsactions.min.js b/admin/tool/policy/amd/build/managedocsactions.min.js index e5a1692f384..01ff00fb88d 100644 --- a/admin/tool/policy/amd/build/managedocsactions.min.js +++ b/admin/tool/policy/amd/build/managedocsactions.min.js @@ -1,2 +1,2 @@ -define ("tool_policy/managedocsactions",["jquery","core/log","core/config","core/str","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f){"use strict";var h={LINKS:"[data-action]",MAKE_CURRENT:"[data-action=\"makecurrent\"]",INACTIVATE:"[data-action=\"inactivate\"]",DELETE:"[data-action=\"delete\"]"};function g(a){this.base=a;this.initEvents()}g.prototype.initEvents=function(){var g=this;g.base.on("click",h.LINKS,function(g){g.stopPropagation();var i=a(g.currentTarget),j,k;if(i.is(h.MAKE_CURRENT)){j=d.get_strings([{key:"activating",component:"tool_policy"},{key:"activateconfirm",component:"tool_policy",param:{name:i.closest("[data-policy-name]").attr("data-policy-name"),revision:i.closest("[data-policy-revision]").attr("data-policy-revision")}},{key:"activateconfirmyes",component:"tool_policy"}])}else if(i.is(h.INACTIVATE)){j=d.get_strings([{key:"inactivating",component:"tool_policy"},{key:"inactivatingconfirm",component:"tool_policy",param:{name:i.closest("[data-policy-name]").attr("data-policy-name"),revision:i.closest("[data-policy-revision]").attr("data-policy-revision")}},{key:"inactivatingconfirmyes",component:"tool_policy"}])}else if(i.is(h.DELETE)){j=d.get_strings([{key:"deleting",component:"tool_policy"},{key:"deleteconfirm",component:"tool_policy",param:{name:i.closest("[data-policy-name]").attr("data-policy-name"),revision:i.closest("[data-policy-revision]").attr("data-policy-revision")}},{key:"delete",component:"core"}])}else{b.error("unknown action type detected","tool_policy/managedocsactions");return}g.preventDefault();j.then(function(a){k=a;return e.create({title:k[0],body:k[1],type:e.types.SAVE_CANCEL})}).then(function(a){a.setSaveButtonText(k[2]);a.getRoot().on(f.save,function(){window.location.href=i.attr("href")+"&sesskey="+c.sesskey+"&confirm=1"});a.getRoot().on(f.hidden,function(){a.destroy()});a.show();return!0}).catch(function(a){b.error(a);return!1})})};return{init:function init(b){var c=a(document.getElementById(b));if(c.length){return new g(c)}else{throw new Error("managedocsactions: Invalid base element identifier")}}}}); +define ("tool_policy/managedocsactions",["jquery","core/log","core/config","core/str","core/modal_factory","core/modal_events"],function(a,b,c,d,e,f){"use strict";var g={LINKS:"[data-action]",MAKE_CURRENT:"[data-action=\"makecurrent\"]",INACTIVATE:"[data-action=\"inactivate\"]",DELETE:"[data-action=\"delete\"]"};function h(a){this.base=a;this.initEvents()}h.prototype.initEvents=function(){var h=this;h.base.on("click",g.LINKS,function(h){h.stopPropagation();var i=a(h.currentTarget),j,k;if(i.is(g.MAKE_CURRENT)){j=d.get_strings([{key:"activating",component:"tool_policy"},{key:"activateconfirm",component:"tool_policy",param:{name:i.closest("[data-policy-name]").attr("data-policy-name"),revision:i.closest("[data-policy-revision]").attr("data-policy-revision")}},{key:"activateconfirmyes",component:"tool_policy"}])}else if(i.is(g.INACTIVATE)){j=d.get_strings([{key:"inactivating",component:"tool_policy"},{key:"inactivatingconfirm",component:"tool_policy",param:{name:i.closest("[data-policy-name]").attr("data-policy-name"),revision:i.closest("[data-policy-revision]").attr("data-policy-revision")}},{key:"inactivatingconfirmyes",component:"tool_policy"}])}else if(i.is(g.DELETE)){j=d.get_strings([{key:"deleting",component:"tool_policy"},{key:"deleteconfirm",component:"tool_policy",param:{name:i.closest("[data-policy-name]").attr("data-policy-name"),revision:i.closest("[data-policy-revision]").attr("data-policy-revision")}},{key:"delete",component:"core"}])}else{b.error("unknown action type detected","tool_policy/managedocsactions");return}h.preventDefault();j.then(function(a){k=a;return e.create({title:k[0],body:k[1],type:e.types.SAVE_CANCEL})}).then(function(a){a.setSaveButtonText(k[2]);a.getRoot().on(f.save,function(){window.location.href=i.attr("href")+"&sesskey="+c.sesskey+"&confirm=1"});a.getRoot().on(f.hidden,function(){a.destroy()});a.show();return!0}).catch(function(a){b.error(a);return!1})})};return{init:function init(b){var c=a(document.getElementById(b));if(c.length){return new h(c)}else{throw new Error("managedocsactions: Invalid base element identifier")}}}}); //# sourceMappingURL=managedocsactions.min.js.map diff --git a/admin/tool/usertours/amd/build/tour.min.js b/admin/tool/usertours/amd/build/tour.min.js index 5be936aef0f..e7ce9378a8a 100644 --- a/admin/tool/usertours/amd/build/tour.min.js +++ b/admin/tool/usertours/amd/build/tour.min.js @@ -1,2 +1,2 @@ -define ("tool_usertours/tour",["exports","jquery","core/popper"],function(a,b,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=d(b);c=d(c);function d(a){return a&&a.__esModule?a:{default:a}}function e(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){e=function(a){return typeof a}}else{e=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return e(a)}function f(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function g(a,b){for(var c=0,d;ca){return this.endTour()}var c=this.getStepConfig(a);if(null===c){return this.endTour()}return this._gotoStep(c,b)}},{key:"_gotoStep",value:function _gotoStep(a,b){if(!a){return this.endTour()}if("undefined"!=typeof a.delay&&a.delay&&!a.delayed){a.delayed=!0;window.setTimeout(this._gotoStep.bind(this),a.delay,a,b);return this}else if(!a.orphan&&!this.isStepActuallyVisible(a)){var c=-1==b?"getPreviousStepNumber":"getNextStepNumber";return this.gotoStep(this[c](a.stepNumber),b)}this.hide();this.fireEventHandlers("beforeRender",a);this.renderStep(a);this.fireEventHandlers("afterRender",a);return this}},{key:"getStepConfig",value:function getStepConfig(a){if(null===a||0>a||a>=this.steps.length){return null}var c=this.normalizeStepConfig(this.steps[a]);c=b.default.extend(c,{stepNumber:a});return c}},{key:"normalizeStepConfig",value:function normalizeStepConfig(a){if("undefined"!=typeof a.reflex&&"undefined"==typeof a.moveAfterClick){a.moveAfterClick=a.reflex}if("undefined"!=typeof a.element&&"undefined"==typeof a.target){a.target=a.element}if("undefined"!=typeof a.content&&"undefined"==typeof a.body){a.body=a.content}a=b.default.extend({},this.stepDefaults,a);a=b.default.extend({},{attachTo:a.target,attachPoint:"after"},a);if(a.attachTo){a.attachTo=(0,b.default)(a.attachTo).first()}return a}},{key:"getStepTarget",value:function getStepTarget(a){if(a.target){return(0,b.default)(a.target)}return null}},{key:"fireEventHandlers",value:function fireEventHandlers(a,b){if("undefined"==typeof this.eventHandlers[a]){return this}this.eventHandlers[a].forEach(function(a){a.call(this,b)},this);return this}},{key:"addEventHandler",value:function addEventHandler(a,b){if("undefined"==typeof this.eventHandlers[a]){this.eventHandlers[a]=[]}this.eventHandlers[a].push(b);return this}},{key:"processStepListeners",value:function processStepListeners(a){this.listeners.push({node:this.currentStepNode,args:["click","[data-role=\"next\"]",b.default.proxy(this.next,this)]},{node:this.currentStepNode,args:["click","[data-role=\"previous\"]",b.default.proxy(this.previous,this)]},{node:this.currentStepNode,args:["click","[data-role=\"end\"]",b.default.proxy(this.endTour,this)]},{node:(0,b.default)("[data-flexitour=\"backdrop\"]"),args:["click",b.default.proxy(this.hide,this)]},{node:(0,b.default)("body"),args:["keydown",b.default.proxy(this.handleKeyDown,this)]});if(a.moveOnClick){var c=this.getStepTarget(a);this.listeners.push({node:c,args:["click",b.default.proxy(function(a){if(0===(0,b.default)(a.target).parents("[data-flexitour=\"container\"]").length){window.setTimeout(b.default.proxy(this.next,this),500)}},this)]})}this.listeners.forEach(function(a){a.node.on.apply(a.node,a.args)});return this}},{key:"resetStepListeners",value:function resetStepListeners(){if(this.listeners){this.listeners.forEach(function(a){a.node.off.apply(a.node,a.args)})}this.listeners=[];return this}},{key:"renderStep",value:function renderStep(a){this.currentStepConfig=a;this.setCurrentStepNumber(a.stepNumber);var c=(0,b.default)(this.getTemplateContent());c.find("[data-placeholder=\"title\"]").html(a.title);c.find("[data-placeholder=\"body\"]").html(a.body);if(this.isFirstStep(a.stepNumber)){c.find("[data-role=\"previous\"]").hide()}else{c.find("[data-role=\"previous\"]").prop("disabled",!1)}if(this.isLastStep(a.stepNumber)){c.find("[data-role=\"next\"]").hide();c.find("[data-role=\"end\"]").removeClass("btn-secondary").addClass("btn-primary")}else{c.find("[data-role=\"next\"]").prop("disabled",!1)}c.find("[data-role=\"previous\"]").attr("role","button");c.find("[data-role=\"next\"]").attr("role","button");c.find("[data-role=\"end\"]").attr("role","button");a.template=c;this.addStepToPage(a);this.processStepListeners(a);return this}},{key:"getTemplateContent",value:function getTemplateContent(){return(0,b.default)(this.templateContent).clone()}},{key:"addStepToPage",value:function addStepToPage(a){var d=(0,b.default)("").html(a.template).hide(),e=(0,b.default)("body, html").stop(!0,!0);if(this.isStepActuallyVisible(a)){var f=this.getStepTarget(a);f.data("flexitour","target");var g=this.calculateZIndex(f);if(g){a.zIndex=g+1}if(a.zIndex){d.css("zIndex",a.zIndex+1)}this.positionBackdrop(a);(0,b.default)(document.body).append(d);this.currentStepNode=d;this.currentStepNode.css({top:0,left:0});e.animate({scrollTop:this.calculateScrollTop(a)}).promise().then(function(){this.positionStep(a);this.revealStep(a)}.bind(this)).catch(function(){})}else if(a.orphan){a.isOrphan=!0;a.attachTo=(0,b.default)("body").first();a.attachPoint="append";this.positionBackdrop(a);d.addClass("orphan");(0,b.default)(document.body).append(d);this.currentStepNode=d;this.currentStepNode.offset(this.calculateStepPositionInPage());this.currentStepNode.css("position","fixed");this.currentStepPopper=new c.default((0,b.default)("body"),this.currentStepNode[0],{removeOnDestroy:!0,placement:a.placement+"-start",arrowElement:"[data-role=\"arrow\"]",modifiers:{hide:{enabled:!1},applyStyle:{onLoad:null,enabled:!1}}});this.revealStep(a)}return this}},{key:"revealStep",value:function revealStep(a){this.currentStepNode.fadeIn("",b.default.proxy(function(){this.announceStep(a);this.currentStepNode.focus();window.setTimeout(b.default.proxy(function(){if(this.currentStepNode){this.currentStepNode.focus()}},this),100)},this));return this}},{key:"announceStep",value:function announceStep(a){var b="tour-step-"+this.tourName+"-"+a.stepNumber;this.currentStepNode.attr("id",b);var c=this.currentStepNode.find("[data-placeholder=\"body\"]").first();c.attr("id",b+"-body");c.attr("role","document");var d=this.currentStepNode.find("[data-placeholder=\"title\"]").first();d.attr("id",b+"-title");d.attr("aria-labelledby",b+"-body");this.currentStepNode.attr("role","dialog");this.currentStepNode.attr("tabindex",0);this.currentStepNode.attr("aria-labelledby",b+"-title");this.currentStepNode.attr("aria-describedby",b+"-body");var e=this.getStepTarget(a);if(e){if(!e.attr("tabindex")){e.attr("tabindex",0)}e.data("original-describedby",e.attr("aria-describedby")).attr("aria-describedby",b+"-body")}this.accessibilityShow(a);return this}},{key:"handleKeyDown",value:function handleKeyDown(a){var c="a[href], link[href], [draggable=true], [contenteditable=true], ";c+=":input:enabled, [tabindex], button:enabled";switch(a.keyCode){case 27:this.endTour();break;case 9:(function(){if(!this.currentStepConfig.hasBackdrop){return}var d=(0,b.default)(document.activeElement),e=this.getStepTarget(this.currentStepConfig),f=(0,b.default)(c),g=(0,b.default)("span[data-flexitour=\"container\"]"),h;if(e){f=f.filter(function(a,b){return null!==e&&(e.has(b).length||g.has(b).length||e.is(b)||g.is(b))})}f.each(function(a,b){if(d.is(b)){h=a;return!1}return!0});var i,j,k;if(void 0!=h){var l=1;if(a.shiftKey){l=-1}i=h;do{i+=l;j=(0,b.default)(f[i])}while(j.length&&j.is(":disabled")||j.is(":hidden"));if(j.length){k=j.closest(e).length;k=k||j.closest(this.currentStepNode).length}else{k=!1}}if(k){j.focus()}else{if(a.shiftKey){this.currentStepNode.find(c).last().focus()}else{if(this.currentStepConfig.isOrphan){this.currentStepNode.focus()}else{e.focus()}}}a.preventDefault()}).call(this);break;}}},{key:"startTour",value:function startTour(a){if(this.storage&&"undefined"==typeof a){var b=this.storage.getItem(this.storageKey);if(b){var c=parseInt(b,10);if(c<=this.steps.length){a=c}}}if("undefined"==typeof a){a=this.getCurrentStepNumber()}this.fireEventHandlers("beforeStart",a);this.gotoStep(a);this.fireEventHandlers("afterStart",a);return this}},{key:"restartTour",value:function restartTour(){return this.startTour(0)}},{key:"endTour",value:function endTour(){this.fireEventHandlers("beforeEnd");if(this.currentStepConfig){var a=this.getStepTarget(this.currentStepConfig);if(a){if(!a.attr("tabindex")){a.attr("tabindex","-1")}a.focus()}}this.hide(!0);this.fireEventHandlers("afterEnd");return this}},{key:"hide",value:function hide(a){this.fireEventHandlers("beforeHide");if(this.currentStepNode&&this.currentStepNode.length){this.currentStepNode.hide();if(this.currentStepPopper){this.currentStepPopper.destroy()}}if(this.currentStepConfig){var d=this.getStepTarget(this.currentStepConfig);if(d){if(d.data("original-labelledby")){d.attr("aria-labelledby",d.data("original-labelledby"))}if(d.data("original-describedby")){d.attr("aria-describedby",d.data("original-describedby"))}if(d.data("original-tabindex")){d.attr("tabindex",d.data("tabindex"))}}this.currentStepConfig=null}var c=0;if(a){c=400}(0,b.default)("[data-flexitour=\"step-background\"]").remove();(0,b.default)("[data-flexitour=\"step-backdrop\"]").removeAttr("data-flexitour");(0,b.default)("[data-flexitour=\"backdrop\"]").fadeOut(c,function(){(0,b.default)(this).remove()});if(this.currentStepNode&&this.currentStepNode.length){var e=this.currentStepNode.attr("id");if(e){var f="[aria-describedby=\""+e+"-body\"]";(0,b.default)(f).removeAttr("tabindex");(0,b.default)(f).removeAttr("aria-describedby")}}this.resetStepListeners();this.accessibilityHide();this.fireEventHandlers("afterHide");this.currentStepNode=null;this.currentStepPopper=null;return this}},{key:"show",value:function show(){var a=this.getCurrentStepNumber();return this.gotoStep(a)}},{key:"getStepContainer",value:function getStepContainer(){return(0,b.default)(this.currentStepNode)}},{key:"calculateScrollTop",value:function calculateScrollTop(a){var c=(0,b.default)(window).scrollTop(),d=(0,b.default)(window).height(),e=this.getStepTarget(a);if("top"===a.placement){c=e.offset().top-d/2}else if("bottom"===a.placement){c=e.offset().top+e.height()-d/2}else if(e.height()<=.8*d){c=e.offset().top-(d-e.height())/2}else{c=e.offset().top-.2*d}c=Math.max(0,c);c=Math.min((0,b.default)(document).height()-d,c);return Math.ceil(c)}},{key:"calculateStepPositionInPage",value:function calculateStepPositionInPage(){var a=(0,b.default)(window).height(),c=this.currentStepNode.height(),d=(0,b.default)(window).width(),e=this.currentStepNode.width();return{top:Math.ceil((a-c)/2),left:Math.ceil((d-e)/2)}}},{key:"positionStep",value:function positionStep(a){var d=this.currentStepNode;if(!d||!d.length){return this}var e;switch(a.placement){case"left":e=["left","right","top","bottom"];break;case"right":e=["right","left","top","bottom"];break;case"top":e=["top","bottom","right","left"];break;case"bottom":e=["bottom","top","right","left"];break;default:e="flip";break;}var f=this.getStepTarget(a),g={placement:a.placement+"-start",removeOnDestroy:!0,modifiers:{flip:{behaviour:e},arrow:{element:"[data-role=\"arrow\"]"}},onCreate:function onCreate(a){h(a)},onUpdate:function onUpdate(a){h(a)}},h=function(a){var c=a.placement.split("-")[0],d=-1!==["left","right"].indexOf(c),e=a.instance.popper.querySelector("[data-role=\"arrow\"]"),f=(0,b.default)(a.instance.popper.querySelector("[data-role=\"flexitour-step\"]"));if(d){var g=parseFloat(window.getComputedStyle(e).height),h=parseFloat(window.getComputedStyle(e).top),i=parseFloat(window.getComputedStyle(a.instance.popper).height),j=parseFloat(window.getComputedStyle(a.instance.popper).top),k=parseFloat(f.css("borderTopWidth")),l=2*parseFloat(f.css("borderTopLeftRadius")),m=h+g/2,n=i+j-k-l,o=j+k+l;if(m>=n||m<=o){var y=0;if(m>i/2){y=n-g}else{y=o+g}(0,b.default)(e).css("top",y)}}else{var p=parseFloat(window.getComputedStyle(e).width),q=parseFloat(window.getComputedStyle(e).left),r=parseFloat(window.getComputedStyle(a.instance.popper).width),s=parseFloat(window.getComputedStyle(a.instance.popper).left),t=parseFloat(f.css("borderTopWidth")),u=2*parseFloat(f.css("borderTopLeftRadius")),v=q+p/2,w=r+s-t-u,x=s+t+u;if(v>=w||v<=x){var z=0;if(v>r/2){z=w-p}else{z=x+p}(0,b.default)(e).css("left",z)}}},i=(0,b.default)("[data-flexitour=\"step-background\"]");if(i.length){f=i}this.currentStepPopper=new c.default(f,d[0],g);return this}},{key:"positionBackdrop",value:function positionBackdrop(a){if(a.backdrop){this.currentStepConfig.hasBackdrop=!0;var g=(0,b.default)("
");if(a.zIndex){if("append"===a.attachPoint){a.attachTo.append(g)}else{g.insertAfter(a.attachTo)}}else{(0,b.default)("body").append(g)}if(this.isStepActuallyVisible(a)){var c=(0,b.default)("
"),d=this.getStepTarget(a),e=10,f=d;if(e){f=(0,b.default)("body")}c.css({width:d.outerWidth()+e+e,height:d.outerHeight()+e+e,left:d.offset().left-e,top:d.offset().top-e,backgroundColor:this.calculateInherittedBackgroundColor(f)});if(d.offset().left").hide();(0,b.default)("body").append(c);var d=c.css("backgroundColor");c.remove();a=(0,b.default)(a);while(a.length&&a[0]!==document){var e=a.css("backgroundColor");if(e!==d){return e}a=a.parent()}return null}},{key:"calculatePosition",value:function calculatePosition(a){a=(0,b.default)(a);while(a.length&&a[0]!==document){var c=a.css("position");if("static"!==c){return c}a=a.parent()}return null}},{key:"accessibilityShow",value:function accessibilityShow(){var a="aria-hidden",c=function(b){var c=b.data("flexitour");if(c){switch(c){case"container":case"target":return;}}var d=b.attr(a);if(!d){b.attr("data-has-hidden",!0);b.attr(a,!0)}};this.currentStepNode.siblings().each(function(a,d){c((0,b.default)(d))});this.currentStepNode.parentsUntil("body").siblings().each(function(a,d){c((0,b.default)(d))})}},{key:"accessibilityHide",value:function accessibilityHide(){var a=function(a){var b=a.attr("data-has-hidden");if("undefined"!=typeof b){a.removeAttr("data-has-hidden");a.removeAttr("aria-hidden")}};(0,b.default)("[data-has-hidden]").each(function(c,d){a((0,b.default)(d))})}}]);return a}();a.default=i;return a.default}); +define ("tool_usertours/tour",["exports","jquery","core/popper"],function(a,b,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=d(b);c=d(c);function d(a){return a&&a.__esModule?a:{default:a}}function e(a){"@babel/helpers - typeof";return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},e(a)}function f(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function g(a,b){for(var c=0,d;ca){return this.endTour()}var c=this.getStepConfig(a);if(null===c){return this.endTour()}return this._gotoStep(c,b)}},{key:"_gotoStep",value:function _gotoStep(a,b){if(!a){return this.endTour()}if("undefined"!=typeof a.delay&&a.delay&&!a.delayed){a.delayed=!0;window.setTimeout(this._gotoStep.bind(this),a.delay,a,b);return this}else if(!a.orphan&&!this.isStepActuallyVisible(a)){var c=-1==b?"getPreviousStepNumber":"getNextStepNumber";return this.gotoStep(this[c](a.stepNumber),b)}this.hide();this.fireEventHandlers("beforeRender",a);this.renderStep(a);this.fireEventHandlers("afterRender",a);return this}},{key:"getStepConfig",value:function getStepConfig(a){if(null===a||0>a||a>=this.steps.length){return null}var c=this.normalizeStepConfig(this.steps[a]);c=b.default.extend(c,{stepNumber:a});return c}},{key:"normalizeStepConfig",value:function normalizeStepConfig(a){if("undefined"!=typeof a.reflex&&"undefined"==typeof a.moveAfterClick){a.moveAfterClick=a.reflex}if("undefined"!=typeof a.element&&"undefined"==typeof a.target){a.target=a.element}if("undefined"!=typeof a.content&&"undefined"==typeof a.body){a.body=a.content}a=b.default.extend({},this.stepDefaults,a);a=b.default.extend({},{attachTo:a.target,attachPoint:"after"},a);if(a.attachTo){a.attachTo=(0,b.default)(a.attachTo).first()}return a}},{key:"getStepTarget",value:function getStepTarget(a){if(a.target){return(0,b.default)(a.target)}return null}},{key:"fireEventHandlers",value:function fireEventHandlers(a,b){if("undefined"==typeof this.eventHandlers[a]){return this}this.eventHandlers[a].forEach(function(a){a.call(this,b)},this);return this}},{key:"addEventHandler",value:function addEventHandler(a,b){if("undefined"==typeof this.eventHandlers[a]){this.eventHandlers[a]=[]}this.eventHandlers[a].push(b);return this}},{key:"processStepListeners",value:function processStepListeners(a){this.listeners.push({node:this.currentStepNode,args:["click","[data-role=\"next\"]",b.default.proxy(this.next,this)]},{node:this.currentStepNode,args:["click","[data-role=\"previous\"]",b.default.proxy(this.previous,this)]},{node:this.currentStepNode,args:["click","[data-role=\"end\"]",b.default.proxy(this.endTour,this)]},{node:(0,b.default)("[data-flexitour=\"backdrop\"]"),args:["click",b.default.proxy(this.hide,this)]},{node:(0,b.default)("body"),args:["keydown",b.default.proxy(this.handleKeyDown,this)]});if(a.moveOnClick){var c=this.getStepTarget(a);this.listeners.push({node:c,args:["click",b.default.proxy(function(a){if(0===(0,b.default)(a.target).parents("[data-flexitour=\"container\"]").length){window.setTimeout(b.default.proxy(this.next,this),500)}},this)]})}this.listeners.forEach(function(a){a.node.on.apply(a.node,a.args)});return this}},{key:"resetStepListeners",value:function resetStepListeners(){if(this.listeners){this.listeners.forEach(function(a){a.node.off.apply(a.node,a.args)})}this.listeners=[];return this}},{key:"renderStep",value:function renderStep(a){this.currentStepConfig=a;this.setCurrentStepNumber(a.stepNumber);var c=(0,b.default)(this.getTemplateContent());c.find("[data-placeholder=\"title\"]").html(a.title);c.find("[data-placeholder=\"body\"]").html(a.body);if(this.isFirstStep(a.stepNumber)){c.find("[data-role=\"previous\"]").hide()}else{c.find("[data-role=\"previous\"]").prop("disabled",!1)}if(this.isLastStep(a.stepNumber)){c.find("[data-role=\"next\"]").hide();c.find("[data-role=\"end\"]").removeClass("btn-secondary").addClass("btn-primary")}else{c.find("[data-role=\"next\"]").prop("disabled",!1)}c.find("[data-role=\"previous\"]").attr("role","button");c.find("[data-role=\"next\"]").attr("role","button");c.find("[data-role=\"end\"]").attr("role","button");a.template=c;this.addStepToPage(a);this.processStepListeners(a);return this}},{key:"getTemplateContent",value:function getTemplateContent(){return(0,b.default)(this.templateContent).clone()}},{key:"addStepToPage",value:function addStepToPage(a){var d=(0,b.default)("").html(a.template).hide(),e=(0,b.default)("body, html").stop(!0,!0);if(this.isStepActuallyVisible(a)){var f=this.getStepTarget(a);f.data("flexitour","target");var g=this.calculateZIndex(f);if(g){a.zIndex=g+1}if(a.zIndex){d.css("zIndex",a.zIndex+1)}this.positionBackdrop(a);(0,b.default)(document.body).append(d);this.currentStepNode=d;this.currentStepNode.css({top:0,left:0});e.animate({scrollTop:this.calculateScrollTop(a)}).promise().then(function(){this.positionStep(a);this.revealStep(a)}.bind(this)).catch(function(){})}else if(a.orphan){a.isOrphan=!0;a.attachTo=(0,b.default)("body").first();a.attachPoint="append";this.positionBackdrop(a);d.addClass("orphan");(0,b.default)(document.body).append(d);this.currentStepNode=d;this.currentStepNode.offset(this.calculateStepPositionInPage());this.currentStepNode.css("position","fixed");this.currentStepPopper=new c.default((0,b.default)("body"),this.currentStepNode[0],{removeOnDestroy:!0,placement:a.placement+"-start",arrowElement:"[data-role=\"arrow\"]",modifiers:{hide:{enabled:!1},applyStyle:{onLoad:null,enabled:!1}}});this.revealStep(a)}return this}},{key:"revealStep",value:function revealStep(a){this.currentStepNode.fadeIn("",b.default.proxy(function(){this.announceStep(a);this.currentStepNode.focus();window.setTimeout(b.default.proxy(function(){if(this.currentStepNode){this.currentStepNode.focus()}},this),100)},this));return this}},{key:"announceStep",value:function announceStep(a){var b="tour-step-"+this.tourName+"-"+a.stepNumber;this.currentStepNode.attr("id",b);var c=this.currentStepNode.find("[data-placeholder=\"body\"]").first();c.attr("id",b+"-body");c.attr("role","document");var d=this.currentStepNode.find("[data-placeholder=\"title\"]").first();d.attr("id",b+"-title");d.attr("aria-labelledby",b+"-body");this.currentStepNode.attr("role","dialog");this.currentStepNode.attr("tabindex",0);this.currentStepNode.attr("aria-labelledby",b+"-title");this.currentStepNode.attr("aria-describedby",b+"-body");var e=this.getStepTarget(a);if(e){if(!e.attr("tabindex")){e.attr("tabindex",0)}e.data("original-describedby",e.attr("aria-describedby")).attr("aria-describedby",b+"-body")}this.accessibilityShow(a);return this}},{key:"handleKeyDown",value:function handleKeyDown(a){var c="a[href], link[href], [draggable=true], [contenteditable=true], ";c+=":input:enabled, [tabindex], button:enabled";switch(a.keyCode){case 27:this.endTour();break;case 9:(function(){if(!this.currentStepConfig.hasBackdrop){return}var d=(0,b.default)(document.activeElement),e=this.getStepTarget(this.currentStepConfig),f=(0,b.default)(c),g=(0,b.default)("span[data-flexitour=\"container\"]"),h;if(e){f=f.filter(function(a,b){return null!==e&&(e.has(b).length||g.has(b).length||e.is(b)||g.is(b))})}f.each(function(a,b){if(d.is(b)){h=a;return!1}return!0});var i,j,k;if(void 0!=h){var l=1;if(a.shiftKey){l=-1}i=h;do{i+=l;j=(0,b.default)(f[i])}while(j.length&&j.is(":disabled")||j.is(":hidden"));if(j.length){k=j.closest(e).length;k=k||j.closest(this.currentStepNode).length}else{k=!1}}if(k){j.focus()}else{if(a.shiftKey){this.currentStepNode.find(c).last().focus()}else{if(this.currentStepConfig.isOrphan){this.currentStepNode.focus()}else{e.focus()}}}a.preventDefault()}).call(this);break;}}},{key:"startTour",value:function startTour(a){if(this.storage&&"undefined"==typeof a){var b=this.storage.getItem(this.storageKey);if(b){var c=parseInt(b,10);if(c<=this.steps.length){a=c}}}if("undefined"==typeof a){a=this.getCurrentStepNumber()}this.fireEventHandlers("beforeStart",a);this.gotoStep(a);this.fireEventHandlers("afterStart",a);return this}},{key:"restartTour",value:function restartTour(){return this.startTour(0)}},{key:"endTour",value:function endTour(){this.fireEventHandlers("beforeEnd");if(this.currentStepConfig){var a=this.getStepTarget(this.currentStepConfig);if(a){if(!a.attr("tabindex")){a.attr("tabindex","-1")}a.focus()}}this.hide(!0);this.fireEventHandlers("afterEnd");return this}},{key:"hide",value:function hide(a){this.fireEventHandlers("beforeHide");if(this.currentStepNode&&this.currentStepNode.length){this.currentStepNode.hide();if(this.currentStepPopper){this.currentStepPopper.destroy()}}if(this.currentStepConfig){var d=this.getStepTarget(this.currentStepConfig);if(d){if(d.data("original-labelledby")){d.attr("aria-labelledby",d.data("original-labelledby"))}if(d.data("original-describedby")){d.attr("aria-describedby",d.data("original-describedby"))}if(d.data("original-tabindex")){d.attr("tabindex",d.data("tabindex"))}}this.currentStepConfig=null}var c=0;if(a){c=400}(0,b.default)("[data-flexitour=\"step-background\"]").remove();(0,b.default)("[data-flexitour=\"step-backdrop\"]").removeAttr("data-flexitour");(0,b.default)("[data-flexitour=\"backdrop\"]").fadeOut(c,function(){(0,b.default)(this).remove()});if(this.currentStepNode&&this.currentStepNode.length){var e=this.currentStepNode.attr("id");if(e){var f="[aria-describedby=\""+e+"-body\"]";(0,b.default)(f).removeAttr("tabindex");(0,b.default)(f).removeAttr("aria-describedby")}}this.resetStepListeners();this.accessibilityHide();this.fireEventHandlers("afterHide");this.currentStepNode=null;this.currentStepPopper=null;return this}},{key:"show",value:function show(){var a=this.getCurrentStepNumber();return this.gotoStep(a)}},{key:"getStepContainer",value:function getStepContainer(){return(0,b.default)(this.currentStepNode)}},{key:"calculateScrollTop",value:function calculateScrollTop(a){var c=(0,b.default)(window).scrollTop(),d=(0,b.default)(window).height(),e=this.getStepTarget(a);if("top"===a.placement){c=e.offset().top-d/2}else if("bottom"===a.placement){c=e.offset().top+e.height()-d/2}else if(e.height()<=.8*d){c=e.offset().top-(d-e.height())/2}else{c=e.offset().top-.2*d}c=Math.max(0,c);c=Math.min((0,b.default)(document).height()-d,c);return Math.ceil(c)}},{key:"calculateStepPositionInPage",value:function calculateStepPositionInPage(){var a=(0,b.default)(window).height(),c=this.currentStepNode.height(),d=(0,b.default)(window).width(),e=this.currentStepNode.width();return{top:Math.ceil((a-c)/2),left:Math.ceil((d-e)/2)}}},{key:"positionStep",value:function positionStep(a){var d=this.currentStepNode;if(!d||!d.length){return this}var e;switch(a.placement){case"left":e=["left","right","top","bottom"];break;case"right":e=["right","left","top","bottom"];break;case"top":e=["top","bottom","right","left"];break;case"bottom":e=["bottom","top","right","left"];break;default:e="flip";break;}var f=this.getStepTarget(a),g={placement:a.placement+"-start",removeOnDestroy:!0,modifiers:{flip:{behaviour:e},arrow:{element:"[data-role=\"arrow\"]"}},onCreate:function onCreate(a){h(a)},onUpdate:function onUpdate(a){h(a)}},h=function(a){var c=a.placement.split("-")[0],d=-1!==["left","right"].indexOf(c),e=a.instance.popper.querySelector("[data-role=\"arrow\"]"),f=(0,b.default)(a.instance.popper.querySelector("[data-role=\"flexitour-step\"]"));if(d){var g=parseFloat(window.getComputedStyle(e).height),h=parseFloat(window.getComputedStyle(e).top),i=parseFloat(window.getComputedStyle(a.instance.popper).height),j=parseFloat(window.getComputedStyle(a.instance.popper).top),k=parseFloat(f.css("borderTopWidth")),l=2*parseFloat(f.css("borderTopLeftRadius")),m=h+g/2,n=i+j-k-l,o=j+k+l;if(m>=n||m<=o){var y=0;if(m>i/2){y=n-g}else{y=o+g}(0,b.default)(e).css("top",y)}}else{var p=parseFloat(window.getComputedStyle(e).width),q=parseFloat(window.getComputedStyle(e).left),r=parseFloat(window.getComputedStyle(a.instance.popper).width),s=parseFloat(window.getComputedStyle(a.instance.popper).left),t=parseFloat(f.css("borderTopWidth")),u=2*parseFloat(f.css("borderTopLeftRadius")),v=q+p/2,w=r+s-t-u,x=s+t+u;if(v>=w||v<=x){var z=0;if(v>r/2){z=w-p}else{z=x+p}(0,b.default)(e).css("left",z)}}},i=(0,b.default)("[data-flexitour=\"step-background\"]");if(i.length){f=i}this.currentStepPopper=new c.default(f,d[0],g);return this}},{key:"positionBackdrop",value:function positionBackdrop(a){if(a.backdrop){this.currentStepConfig.hasBackdrop=!0;var g=(0,b.default)("
");if(a.zIndex){if("append"===a.attachPoint){a.attachTo.append(g)}else{g.insertAfter(a.attachTo)}}else{(0,b.default)("body").append(g)}if(this.isStepActuallyVisible(a)){var c=(0,b.default)("
"),d=this.getStepTarget(a),e=10,f=d;if(e){f=(0,b.default)("body")}c.css({width:d.outerWidth()+e+e,height:d.outerHeight()+e+e,left:d.offset().left-e,top:d.offset().top-e,backgroundColor:this.calculateInherittedBackgroundColor(f)});if(d.offset().left").hide();(0,b.default)("body").append(c);var d=c.css("backgroundColor");c.remove();a=(0,b.default)(a);while(a.length&&a[0]!==document){var e=a.css("backgroundColor");if(e!==d){return e}a=a.parent()}return null}},{key:"calculatePosition",value:function calculatePosition(a){a=(0,b.default)(a);while(a.length&&a[0]!==document){var c=a.css("position");if("static"!==c){return c}a=a.parent()}return null}},{key:"accessibilityShow",value:function accessibilityShow(){var a="aria-hidden",c=function(b){var c=b.data("flexitour");if(c){switch(c){case"container":case"target":return;}}var d=b.attr(a);if(!d){b.attr("data-has-hidden",!0);b.attr(a,!0)}};this.currentStepNode.siblings().each(function(a,d){c((0,b.default)(d))});this.currentStepNode.parentsUntil("body").siblings().each(function(a,d){c((0,b.default)(d))})}},{key:"accessibilityHide",value:function accessibilityHide(){var a=function(a){var b=a.attr("data-has-hidden");if("undefined"!=typeof b){a.removeAttr("data-has-hidden");a.removeAttr("aria-hidden")}};(0,b.default)("[data-has-hidden]").each(function(c,d){a((0,b.default)(d))})}}]);return a}();a.default=i;return a.default}); //# sourceMappingURL=tour.min.js.map diff --git a/admin/tool/usertours/amd/build/tour.min.js.map b/admin/tool/usertours/amd/build/tour.min.js.map index bc48f5c2787..ec4113fd15e 100644 --- a/admin/tool/usertours/amd/build/tour.min.js.map +++ b/admin/tool/usertours/amd/build/tour.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/tour.js"],"names":["Tour","config","init","eventHandlers","reset","originalConfiguration","configure","apply","arguments","storage","window","sessionStorage","storageKey","tourName","e","hide","resetStepListeners","steps","currentStepNumber","eventName","forEach","handler","addEventHandler","resetStepDefaults","template","templateContent","checkMinimumRequirements","Error","length","loadOriginalConfiguration","stepDefaults","setStepDefaults","$","extend","element","placement","delay","moveOnClick","moveAfterTime","orphan","direction","parseInt","stepNumber","setItem","code","DOMException","QUOTA_EXCEEDED_ERR","removeItem","getCurrentStepNumber","nextStepNumber","isStepPotentiallyVisible","getStepConfig","previousStepNumber","getNextStepNumber","getPreviousStepNumber","stepConfig","isStepActuallyVisible","target","getStepTarget","is","gotoStep","endTour","_gotoStep","delayed","setTimeout","bind","fn","fireEventHandlers","renderStep","normalizeStepConfig","reflex","moveAfterClick","content","body","attachTo","attachPoint","first","data","thisEvent","call","push","listeners","node","currentStepNode","args","proxy","next","previous","handleKeyDown","targetNode","parents","listener","on","off","currentStepConfig","setCurrentStepNumber","getTemplateContent","find","html","title","isFirstStep","prop","isLastStep","removeClass","addClass","attr","addStepToPage","processStepListeners","clone","animationTarget","stop","zIndex","calculateZIndex","css","positionBackdrop","document","append","top","left","animate","scrollTop","calculateScrollTop","promise","then","positionStep","revealStep","catch","isOrphan","offset","calculateStepPositionInPage","currentStepPopper","Popper","removeOnDestroy","arrowElement","modifiers","enabled","applyStyle","onLoad","fadeIn","announceStep","focus","stepId","bodyRegion","headerRegion","accessibilityShow","tabbableSelector","keyCode","hasBackdrop","activeElement","stepTarget","tabbableNodes","dialogContainer","currentIndex","filter","index","has","each","nextIndex","nextNode","focusRelevant","shiftKey","closest","last","preventDefault","startAt","storageStartValue","getItem","storageStartAt","startTour","previousTarget","transition","destroy","fadeTime","remove","removeAttr","fadeOut","currentStepElement","accessibilityHide","viewportHeight","height","Math","max","min","ceil","stepHeight","viewportWidth","width","stepWidth","flipBehavior","flip","behaviour","arrow","onCreate","recalculateArrowPosition","onUpdate","split","isVertical","indexOf","instance","popper","querySelector","stepElement","arrowHeight","parseFloat","getComputedStyle","arrowOffset","popperHeight","popperOffset","popperBorderWidth","popperBorderRadiusWidth","arrowPos","maxPos","minPos","newArrowPos","arrowWidth","popperWidth","background","backdrop","insertAfter","buffer","colorNode","outerWidth","outerHeight","backgroundColor","calculateInherittedBackgroundColor","targetRadius","targetPosition","calculatePosition","fader","opacity","elem","position","value","isNaN","parent","fakeNode","fakeElemColor","color","attrName","hideFunction","child","flexitourRole","hidden","siblings","parentsUntil","showFunction"],"mappings":"gKAsBA,OACA,O,koBAOqBA,CAAAA,C,YAIjB,WAAYC,CAAZ,CAAoB,WAChB,KAAKC,IAAL,CAAUD,CAAV,CACH,C,qCAUIA,C,C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AAL,CAAqBiK,YAArB,CAAkC,MAAlC,EAA0CD,QAA1C,GAAqDvF,IAArD,CAA0D,SAASF,CAAT,CAAgBxE,CAAhB,CAAsB,CAC5E6J,CAAY,CAAC,cAAE7J,CAAF,CAAD,CACf,CAFD,CAGH,C,6DASmB,IAGZmK,CAAAA,CAAY,CAAG,SAASL,CAAT,CAAgB,CAC/B,GAAIE,CAAAA,CAAM,CAAGF,CAAK,CAACvI,IAAN,mBAAb,CACA,GAAsB,WAAlB,QAAOyI,CAAAA,CAAX,CAAmC,CAC/BF,CAAK,CAAClE,UAAN,oBACAkE,CAAK,CAAClE,UAAN,CALO,aAKP,CACH,CACJ,CATe,CAWhB,mCAA2BlB,IAA3B,CAAgC,SAASF,CAAT,CAAgBxE,CAAhB,CAAsB,CAClDmK,CAAY,CAAC,cAAEnK,CAAF,CAAD,CACf,CAFD,CAGH,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Manage user tours in Moodle.\n *\n * @copyright 2018 Andrew Nicols \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport $ from 'jquery';\nimport Popper from 'core/popper';\n\n/**\n * A Tour.\n *\n * @class Tour\n */\nexport default class Tour {\n /**\n * @param {object} config The configuration object.\n */\n constructor(config) {\n this.init(config);\n }\n\n /**\n * Initialise the tour.\n *\n * @method init\n * @param {Object} config The configuration object.\n * @chainable\n * @return {Object} this.\n */\n init(config) {\n // Unset all handlers.\n this.eventHandlers = {};\n\n // Reset the current tour states.\n this.reset();\n\n // Store the initial configuration.\n this.originalConfiguration = config || {};\n\n // Apply configuration.\n this.configure.apply(this, arguments);\n\n try {\n this.storage = window.sessionStorage;\n this.storageKey = 'tourstate_' + this.tourName;\n } catch (e) {\n this.storage = false;\n this.storageKey = '';\n }\n\n return this;\n }\n\n /**\n * Reset the current tour state.\n *\n * @method reset\n * @chainable\n * @return {Object} this.\n */\n reset() {\n // Hide the current step.\n this.hide();\n\n // Unset all handlers.\n this.eventHandlers = [];\n\n // Unset all listeners.\n this.resetStepListeners();\n\n // Unset the original configuration.\n this.originalConfiguration = {};\n\n // Reset the current step number and list of steps.\n this.steps = [];\n\n // Reset the current step number.\n this.currentStepNumber = 0;\n\n return this;\n }\n\n /**\n * Prepare tour configuration.\n *\n * @method configure\n * @param {Object} config The configuration object.\n * @chainable\n * @return {Object} this.\n */\n configure(config) {\n if (typeof config === 'object') {\n // Tour name.\n if (typeof config.tourName !== 'undefined') {\n this.tourName = config.tourName;\n }\n\n // Set up eventHandlers.\n if (config.eventHandlers) {\n for (let eventName in config.eventHandlers) {\n config.eventHandlers[eventName].forEach(function(handler) {\n this.addEventHandler(eventName, handler);\n }, this);\n }\n }\n\n // Reset the step configuration.\n this.resetStepDefaults(true);\n\n // Configure the steps.\n if (typeof config.steps === 'object') {\n this.steps = config.steps;\n }\n\n if (typeof config.template !== 'undefined') {\n this.templateContent = config.template;\n }\n }\n\n // Check that we have enough to start the tour.\n this.checkMinimumRequirements();\n\n return this;\n }\n\n /**\n * Check that the configuration meets the minimum requirements.\n *\n * @method checkMinimumRequirements\n */\n checkMinimumRequirements() {\n // Need a tourName.\n if (!this.tourName) {\n throw new Error(\"Tour Name required\");\n }\n\n // Need a minimum of one step.\n if (!this.steps || !this.steps.length) {\n throw new Error(\"Steps must be specified\");\n }\n }\n\n /**\n * Reset step default configuration.\n *\n * @method resetStepDefaults\n * @param {Boolean} loadOriginalConfiguration Whether to load the original configuration supplied with the Tour.\n * @chainable\n * @return {Object} this.\n */\n resetStepDefaults(loadOriginalConfiguration) {\n if (typeof loadOriginalConfiguration === 'undefined') {\n loadOriginalConfiguration = true;\n }\n\n this.stepDefaults = {};\n if (!loadOriginalConfiguration || typeof this.originalConfiguration.stepDefaults === 'undefined') {\n this.setStepDefaults({});\n } else {\n this.setStepDefaults(this.originalConfiguration.stepDefaults);\n }\n\n return this;\n }\n\n /**\n * Set the step defaults.\n *\n * @method setStepDefaults\n * @param {Object} stepDefaults The step defaults to apply to all steps\n * @chainable\n * @return {Object} this.\n */\n setStepDefaults(stepDefaults) {\n if (!this.stepDefaults) {\n this.stepDefaults = {};\n }\n $.extend(\n this.stepDefaults,\n {\n element: '',\n placement: 'top',\n delay: 0,\n moveOnClick: false,\n moveAfterTime: 0,\n orphan: false,\n direction: 1,\n },\n stepDefaults\n );\n\n return this;\n }\n\n /**\n * Retrieve the current step number.\n *\n * @method getCurrentStepNumber\n * @return {Integer} The current step number\n */\n getCurrentStepNumber() {\n return parseInt(this.currentStepNumber, 10);\n }\n\n /**\n * Store the current step number.\n *\n * @method setCurrentStepNumber\n * @param {Integer} stepNumber The current step number\n * @chainable\n */\n setCurrentStepNumber(stepNumber) {\n this.currentStepNumber = stepNumber;\n if (this.storage) {\n try {\n this.storage.setItem(this.storageKey, stepNumber);\n } catch (e) {\n if (e.code === DOMException.QUOTA_EXCEEDED_ERR) {\n this.storage.removeItem(this.storageKey);\n }\n }\n }\n }\n\n /**\n * Get the next step number after the currently displayed step.\n *\n * @method getNextStepNumber\n * @param {Integer} stepNumber The current step number\n * @return {Integer} The next step number to display\n */\n getNextStepNumber(stepNumber) {\n if (typeof stepNumber === 'undefined') {\n stepNumber = this.getCurrentStepNumber();\n }\n let nextStepNumber = stepNumber + 1;\n\n // Keep checking the remaining steps.\n while (nextStepNumber <= this.steps.length) {\n if (this.isStepPotentiallyVisible(this.getStepConfig(nextStepNumber))) {\n return nextStepNumber;\n }\n nextStepNumber++;\n }\n\n return null;\n }\n\n /**\n * Get the previous step number before the currently displayed step.\n *\n * @method getPreviousStepNumber\n * @param {Integer} stepNumber The current step number\n * @return {Integer} The previous step number to display\n */\n getPreviousStepNumber(stepNumber) {\n if (typeof stepNumber === 'undefined') {\n stepNumber = this.getCurrentStepNumber();\n }\n let previousStepNumber = stepNumber - 1;\n\n // Keep checking the remaining steps.\n while (previousStepNumber >= 0) {\n if (this.isStepPotentiallyVisible(this.getStepConfig(previousStepNumber))) {\n return previousStepNumber;\n }\n previousStepNumber--;\n }\n\n return null;\n }\n\n /**\n * Is the step the final step number?\n *\n * @method isLastStep\n * @param {Integer} stepNumber Step number to test\n * @return {Boolean} Whether the step is the final step\n */\n isLastStep(stepNumber) {\n let nextStepNumber = this.getNextStepNumber(stepNumber);\n\n return nextStepNumber === null;\n }\n\n /**\n * Is the step the first step number?\n *\n * @method isFirstStep\n * @param {Integer} stepNumber Step number to test\n * @return {Boolean} Whether the step is the first step\n */\n isFirstStep(stepNumber) {\n let previousStepNumber = this.getPreviousStepNumber(stepNumber);\n\n return previousStepNumber === null;\n }\n\n /**\n * Is this step potentially visible?\n *\n * @method isStepPotentiallyVisible\n * @param {Object} stepConfig The step configuration to normalise\n * @return {Boolean} Whether the step is the potentially visible\n */\n isStepPotentiallyVisible(stepConfig) {\n if (!stepConfig) {\n // Without step config, there can be no step.\n return false;\n }\n\n if (this.isStepActuallyVisible(stepConfig)) {\n // If it is actually visible, it is already potentially visible.\n return true;\n }\n\n if (typeof stepConfig.orphan !== 'undefined' && stepConfig.orphan) {\n // Orphan steps have no target. They are always visible.\n return true;\n }\n\n if (typeof stepConfig.delay !== 'undefined' && stepConfig.delay) {\n // Only return true if the activated has not been used yet.\n return true;\n }\n\n // Not theoretically, or actually visible.\n return false;\n }\n\n /**\n * Is this step actually visible?\n *\n * @method isStepActuallyVisible\n * @param {Object} stepConfig The step configuration to normalise\n * @return {Boolean} Whether the step is actually visible\n */\n isStepActuallyVisible(stepConfig) {\n if (!stepConfig) {\n // Without step config, there can be no step.\n return false;\n }\n\n let target = this.getStepTarget(stepConfig);\n if (target && target.length && target.is(':visible')) {\n // Without a target, there can be no step.\n return !!target.length;\n }\n\n return false;\n }\n\n /**\n * Go to the next step in the tour.\n *\n * @method next\n * @chainable\n * @return {Object} this.\n */\n next() {\n return this.gotoStep(this.getNextStepNumber());\n }\n\n /**\n * Go to the previous step in the tour.\n *\n * @method previous\n * @chainable\n * @return {Object} this.\n */\n previous() {\n return this.gotoStep(this.getPreviousStepNumber(), -1);\n }\n\n /**\n * Go to the specified step in the tour.\n *\n * @method gotoStep\n * @param {Integer} stepNumber The step number to display\n * @param {Integer} direction Next or previous step\n * @chainable\n * @return {Object} this.\n */\n gotoStep(stepNumber, direction) {\n if (stepNumber < 0) {\n return this.endTour();\n }\n\n let stepConfig = this.getStepConfig(stepNumber);\n if (stepConfig === null) {\n return this.endTour();\n }\n\n return this._gotoStep(stepConfig, direction);\n }\n\n _gotoStep(stepConfig, direction) {\n if (!stepConfig) {\n return this.endTour();\n }\n\n if (typeof stepConfig.delay !== 'undefined' && stepConfig.delay && !stepConfig.delayed) {\n stepConfig.delayed = true;\n window.setTimeout(this._gotoStep.bind(this), stepConfig.delay, stepConfig, direction);\n\n return this;\n } else if (!stepConfig.orphan && !this.isStepActuallyVisible(stepConfig)) {\n let fn = direction == -1 ? 'getPreviousStepNumber' : 'getNextStepNumber';\n return this.gotoStep(this[fn](stepConfig.stepNumber), direction);\n }\n\n this.hide();\n\n this.fireEventHandlers('beforeRender', stepConfig);\n this.renderStep(stepConfig);\n this.fireEventHandlers('afterRender', stepConfig);\n\n return this;\n }\n\n /**\n * Fetch the normalised step configuration for the specified step number.\n *\n * @method getStepConfig\n * @param {Integer} stepNumber The step number to fetch configuration for\n * @return {Object} The step configuration\n */\n getStepConfig(stepNumber) {\n if (stepNumber === null || stepNumber < 0 || stepNumber >= this.steps.length) {\n return null;\n }\n\n // Normalise the step configuration.\n let stepConfig = this.normalizeStepConfig(this.steps[stepNumber]);\n\n // Add the stepNumber to the stepConfig.\n stepConfig = $.extend(stepConfig, {stepNumber: stepNumber});\n\n return stepConfig;\n }\n\n /**\n * Normalise the supplied step configuration.\n *\n * @method normalizeStepConfig\n * @param {Object} stepConfig The step configuration to normalise\n * @return {Object} The normalised step configuration\n */\n normalizeStepConfig(stepConfig) {\n\n if (typeof stepConfig.reflex !== 'undefined' && typeof stepConfig.moveAfterClick === 'undefined') {\n stepConfig.moveAfterClick = stepConfig.reflex;\n }\n\n if (typeof stepConfig.element !== 'undefined' && typeof stepConfig.target === 'undefined') {\n stepConfig.target = stepConfig.element;\n }\n\n if (typeof stepConfig.content !== 'undefined' && typeof stepConfig.body === 'undefined') {\n stepConfig.body = stepConfig.content;\n }\n\n stepConfig = $.extend({}, this.stepDefaults, stepConfig);\n\n stepConfig = $.extend({}, {\n attachTo: stepConfig.target,\n attachPoint: 'after',\n }, stepConfig);\n\n if (stepConfig.attachTo) {\n stepConfig.attachTo = $(stepConfig.attachTo).first();\n }\n\n return stepConfig;\n }\n\n /**\n * Fetch the actual step target from the selector.\n *\n * This should not be called until after any delay has completed.\n *\n * @method getStepTarget\n * @param {Object} stepConfig The step configuration\n * @return {$}\n */\n getStepTarget(stepConfig) {\n if (stepConfig.target) {\n return $(stepConfig.target);\n }\n\n return null;\n }\n\n /**\n * Fire any event handlers for the specified event.\n *\n * @param {String} eventName The name of the event to handle\n * @param {Object} data Any data to pass to the event\n * @chainable\n * @return {Object} this.\n */\n fireEventHandlers(eventName, data) {\n if (typeof this.eventHandlers[eventName] === 'undefined') {\n return this;\n }\n\n this.eventHandlers[eventName].forEach(function(thisEvent) {\n thisEvent.call(this, data);\n }, this);\n\n return this;\n }\n\n /**\n * @method addEventHandler\n * @param {string} eventName The name of the event to listen for\n * @param {function} handler The event handler to call\n * @return {Object} this.\n */\n addEventHandler(eventName, handler) {\n if (typeof this.eventHandlers[eventName] === 'undefined') {\n this.eventHandlers[eventName] = [];\n }\n\n this.eventHandlers[eventName].push(handler);\n\n return this;\n }\n\n /**\n * Process listeners for the step being shown.\n *\n * @method processStepListeners\n * @param {object} stepConfig The configuration for the step\n * @chainable\n * @return {Object} this.\n */\n processStepListeners(stepConfig) {\n this.listeners.push(\n // Next/Previous buttons.\n {\n node: this.currentStepNode,\n args: ['click', '[data-role=\"next\"]', $.proxy(this.next, this)]\n }, {\n node: this.currentStepNode,\n args: ['click', '[data-role=\"previous\"]', $.proxy(this.previous, this)]\n },\n\n // Close and end tour buttons.\n {\n node: this.currentStepNode,\n args: ['click', '[data-role=\"end\"]', $.proxy(this.endTour, this)]\n },\n\n // Click backdrop and hide tour.\n {\n node: $('[data-flexitour=\"backdrop\"]'),\n args: ['click', $.proxy(this.hide, this)]\n },\n\n // Keypresses.\n {\n node: $('body'),\n args: ['keydown', $.proxy(this.handleKeyDown, this)]\n });\n\n if (stepConfig.moveOnClick) {\n var targetNode = this.getStepTarget(stepConfig);\n this.listeners.push({\n node: targetNode,\n args: ['click', $.proxy(function(e) {\n if ($(e.target).parents('[data-flexitour=\"container\"]').length === 0) {\n // Ignore clicks when they are in the flexitour.\n window.setTimeout($.proxy(this.next, this), 500);\n }\n }, this)]\n });\n }\n\n this.listeners.forEach(function (listener) {\n listener.node.on.apply(listener.node, listener.args);\n });\n\n return this;\n }\n\n /**\n * Reset step listeners.\n *\n * @method resetStepListeners\n * @chainable\n * @return {Object} this.\n */\n resetStepListeners() {\n // Stop listening to all external handlers.\n if (this.listeners) {\n this.listeners.forEach(function(listener) {\n listener.node.off.apply(listener.node, listener.args);\n });\n }\n this.listeners = [];\n\n return this;\n }\n\n /**\n * The standard step renderer.\n *\n * @method renderStep\n * @param {Object} stepConfig The step configuration of the step\n * @chainable\n * @return {Object} this.\n */\n renderStep(stepConfig) {\n // Store the current step configuration for later.\n this.currentStepConfig = stepConfig;\n this.setCurrentStepNumber(stepConfig.stepNumber);\n\n // Fetch the template and convert it to a $ object.\n let template = $(this.getTemplateContent());\n\n // Title.\n template.find('[data-placeholder=\"title\"]')\n .html(stepConfig.title);\n\n // Body.\n template.find('[data-placeholder=\"body\"]')\n .html(stepConfig.body);\n\n // Is this the first step?\n if (this.isFirstStep(stepConfig.stepNumber)) {\n template.find('[data-role=\"previous\"]').hide();\n } else {\n template.find('[data-role=\"previous\"]').prop('disabled', false);\n }\n\n // Is this the final step?\n if (this.isLastStep(stepConfig.stepNumber)) {\n template.find('[data-role=\"next\"]').hide();\n template.find('[data-role=\"end\"]').removeClass(\"btn-secondary\").addClass(\"btn-primary\");\n } else {\n template.find('[data-role=\"next\"]').prop('disabled', false);\n }\n\n template.find('[data-role=\"previous\"]').attr('role', 'button');\n template.find('[data-role=\"next\"]').attr('role', 'button');\n template.find('[data-role=\"end\"]').attr('role', 'button');\n\n // Replace the template with the updated version.\n stepConfig.template = template;\n\n // Add to the page.\n this.addStepToPage(stepConfig);\n\n // Process step listeners after adding to the page.\n // This uses the currentNode.\n this.processStepListeners(stepConfig);\n\n return this;\n }\n\n /**\n * Getter for the template content.\n *\n * @method getTemplateContent\n * @return {$}\n */\n getTemplateContent() {\n return $(this.templateContent).clone();\n }\n\n /**\n * Helper to add a step to the page.\n *\n * @method addStepToPage\n * @param {Object} stepConfig The step configuration of the step\n * @chainable\n * @return {Object} this.\n */\n addStepToPage(stepConfig) {\n // Create the stepNode from the template data.\n let currentStepNode = $('')\n .html(stepConfig.template)\n .hide();\n\n // The scroll animation occurs on the body or html.\n let animationTarget = $('body, html')\n .stop(true, true);\n\n if (this.isStepActuallyVisible(stepConfig)) {\n let targetNode = this.getStepTarget(stepConfig);\n\n targetNode.data('flexitour', 'target');\n\n let zIndex = this.calculateZIndex(targetNode);\n if (zIndex) {\n stepConfig.zIndex = zIndex + 1;\n }\n\n if (stepConfig.zIndex) {\n currentStepNode.css('zIndex', stepConfig.zIndex + 1);\n }\n\n // Add the backdrop.\n this.positionBackdrop(stepConfig);\n\n $(document.body).append(currentStepNode);\n this.currentStepNode = currentStepNode;\n\n // Ensure that the step node is positioned.\n // Some situations mean that the value is not properly calculated without this step.\n this.currentStepNode.css({\n top: 0,\n left: 0,\n });\n\n animationTarget\n .animate({\n scrollTop: this.calculateScrollTop(stepConfig),\n }).promise().then(function() {\n this.positionStep(stepConfig);\n this.revealStep(stepConfig);\n return;\n }.bind(this))\n .catch(function() {\n // Silently fail.\n });\n\n } else if (stepConfig.orphan) {\n stepConfig.isOrphan = true;\n\n // This will be appended to the body instead.\n stepConfig.attachTo = $('body').first();\n stepConfig.attachPoint = 'append';\n\n // Add the backdrop.\n this.positionBackdrop(stepConfig);\n\n // This is an orphaned step.\n currentStepNode.addClass('orphan');\n\n // It lives in the body.\n $(document.body).append(currentStepNode);\n this.currentStepNode = currentStepNode;\n\n this.currentStepNode.offset(this.calculateStepPositionInPage());\n this.currentStepNode.css('position', 'fixed');\n\n this.currentStepPopper = new Popper(\n $('body'),\n this.currentStepNode[0], {\n removeOnDestroy: true,\n placement: stepConfig.placement + '-start',\n arrowElement: '[data-role=\"arrow\"]',\n // Empty the modifiers. We've already placed the step and don't want it moved.\n modifiers: {\n hide: {\n enabled: false,\n },\n applyStyle: {\n onLoad: null,\n enabled: false,\n },\n }\n }\n );\n\n this.revealStep(stepConfig);\n }\n\n return this;\n }\n\n /**\n * Make the given step visible.\n *\n * @method revealStep\n * @param {Object} stepConfig The step configuration of the step\n * @chainable\n * @return {Object} this.\n */\n revealStep(stepConfig) {\n // Fade the step in.\n this.currentStepNode.fadeIn('', $.proxy(function() {\n // Announce via ARIA.\n this.announceStep(stepConfig);\n\n // Focus on the current step Node.\n this.currentStepNode.focus();\n window.setTimeout($.proxy(function() {\n // After a brief delay, focus again.\n // There seems to be an issue with Jaws where it only reads the dialogue title initially.\n // This second focus helps it to read the full dialogue.\n if (this.currentStepNode) {\n this.currentStepNode.focus();\n }\n }, this), 100);\n\n }, this));\n\n return this;\n }\n\n /**\n * Helper to announce the step on the page.\n *\n * @method announceStep\n * @param {Object} stepConfig The step configuration of the step\n * @chainable\n * @return {Object} this.\n */\n announceStep(stepConfig) {\n // Setup the step Dialogue as per:\n // * https://www.w3.org/TR/wai-aria-practices/#dialog_nonmodal\n // * https://www.w3.org/TR/wai-aria-practices/#dialog_modal\n\n // Generate an ID for the current step node.\n let stepId = 'tour-step-' + this.tourName + '-' + stepConfig.stepNumber;\n this.currentStepNode.attr('id', stepId);\n\n let bodyRegion = this.currentStepNode.find('[data-placeholder=\"body\"]').first();\n bodyRegion.attr('id', stepId + '-body');\n bodyRegion.attr('role', 'document');\n\n let headerRegion = this.currentStepNode.find('[data-placeholder=\"title\"]').first();\n headerRegion.attr('id', stepId + '-title');\n headerRegion.attr('aria-labelledby', stepId + '-body');\n\n // Generally, a modal dialog has a role of dialog.\n this.currentStepNode.attr('role', 'dialog');\n this.currentStepNode.attr('tabindex', 0);\n this.currentStepNode.attr('aria-labelledby', stepId + '-title');\n this.currentStepNode.attr('aria-describedby', stepId + '-body');\n\n // Configure ARIA attributes on the target.\n let target = this.getStepTarget(stepConfig);\n if (target) {\n if (!target.attr('tabindex')) {\n target.attr('tabindex', 0);\n }\n\n target\n .data('original-describedby', target.attr('aria-describedby'))\n .attr('aria-describedby', stepId + '-body')\n ;\n }\n\n this.accessibilityShow(stepConfig);\n\n return this;\n }\n\n /**\n * Handle key down events.\n *\n * @method handleKeyDown\n * @param {EventFacade} e\n */\n handleKeyDown(e) {\n let tabbableSelector = 'a[href], link[href], [draggable=true], [contenteditable=true], ';\n tabbableSelector += ':input:enabled, [tabindex], button:enabled';\n switch (e.keyCode) {\n case 27:\n this.endTour();\n break;\n\n // 9 == Tab - trap focus for items with a backdrop.\n case 9:\n // Tab must be handled on key up only in this instance.\n (function() {\n if (!this.currentStepConfig.hasBackdrop) {\n // Trapping tab focus is only handled for those steps with a backdrop.\n return;\n }\n\n // Find all tabbable locations.\n let activeElement = $(document.activeElement);\n let stepTarget = this.getStepTarget(this.currentStepConfig);\n let tabbableNodes = $(tabbableSelector);\n let dialogContainer = $('span[data-flexitour=\"container\"]');\n let currentIndex;\n // Filter out element which is not belong to target section or dialogue.\n if (stepTarget) {\n tabbableNodes = tabbableNodes.filter(function(index, element) {\n return stepTarget !== null\n && (stepTarget.has(element).length\n || dialogContainer.has(element).length\n || stepTarget.is(element)\n || dialogContainer.is(element));\n });\n }\n\n // Find index of focusing element.\n tabbableNodes.each(function(index, element) {\n if (activeElement.is(element)) {\n currentIndex = index;\n return false;\n }\n // Keep looping.\n return true;\n });\n\n let nextIndex;\n let nextNode;\n let focusRelevant;\n if (currentIndex != void 0) {\n let direction = 1;\n if (e.shiftKey) {\n direction = -1;\n }\n nextIndex = currentIndex;\n do {\n nextIndex += direction;\n nextNode = $(tabbableNodes[nextIndex]);\n } while (nextNode.length && nextNode.is(':disabled') || nextNode.is(':hidden'));\n if (nextNode.length) {\n // A new f\n focusRelevant = nextNode.closest(stepTarget).length;\n focusRelevant = focusRelevant || nextNode.closest(this.currentStepNode).length;\n } else {\n // Unable to find the target somehow.\n focusRelevant = false;\n }\n }\n\n if (focusRelevant) {\n nextNode.focus();\n } else {\n if (e.shiftKey) {\n // Focus on the last tabbable node in the step.\n this.currentStepNode.find(tabbableSelector).last().focus();\n } else {\n if (this.currentStepConfig.isOrphan) {\n // Focus on the step - there is no target.\n this.currentStepNode.focus();\n } else {\n // Focus on the step target.\n stepTarget.focus();\n }\n }\n }\n e.preventDefault();\n }).call(this);\n break;\n }\n }\n\n /**\n * Start the current tour.\n *\n * @method startTour\n * @param {Integer} startAt Which step number to start at. If not specified, starts at the last point.\n * @chainable\n * @return {Object} this.\n */\n startTour(startAt) {\n if (this.storage && typeof startAt === 'undefined') {\n let storageStartValue = this.storage.getItem(this.storageKey);\n if (storageStartValue) {\n let storageStartAt = parseInt(storageStartValue, 10);\n if (storageStartAt <= this.steps.length) {\n startAt = storageStartAt;\n }\n }\n }\n\n if (typeof startAt === 'undefined') {\n startAt = this.getCurrentStepNumber();\n }\n\n this.fireEventHandlers('beforeStart', startAt);\n this.gotoStep(startAt);\n this.fireEventHandlers('afterStart', startAt);\n\n return this;\n }\n\n /**\n * Restart the tour from the beginning, resetting the completionlag.\n *\n * @method restartTour\n * @chainable\n * @return {Object} this.\n */\n restartTour() {\n return this.startTour(0);\n }\n\n /**\n * End the current tour.\n *\n * @method endTour\n * @chainable\n * @return {Object} this.\n */\n endTour() {\n this.fireEventHandlers('beforeEnd');\n\n if (this.currentStepConfig) {\n let previousTarget = this.getStepTarget(this.currentStepConfig);\n if (previousTarget) {\n if (!previousTarget.attr('tabindex')) {\n previousTarget.attr('tabindex', '-1');\n }\n previousTarget.focus();\n }\n }\n\n this.hide(true);\n\n this.fireEventHandlers('afterEnd');\n\n return this;\n }\n\n /**\n * Hide any currently visible steps.\n *\n * @method hide\n * @param {Bool} transition Animate the visibility change\n * @chainable\n * @return {Object} this.\n */\n hide(transition) {\n this.fireEventHandlers('beforeHide');\n\n if (this.currentStepNode && this.currentStepNode.length) {\n this.currentStepNode.hide();\n if (this.currentStepPopper) {\n this.currentStepPopper.destroy();\n }\n }\n\n // Restore original target configuration.\n if (this.currentStepConfig) {\n let target = this.getStepTarget(this.currentStepConfig);\n if (target) {\n if (target.data('original-labelledby')) {\n target.attr('aria-labelledby', target.data('original-labelledby'));\n }\n\n if (target.data('original-describedby')) {\n target.attr('aria-describedby', target.data('original-describedby'));\n }\n\n if (target.data('original-tabindex')) {\n target.attr('tabindex', target.data('tabindex'));\n }\n }\n\n // Clear the step configuration.\n this.currentStepConfig = null;\n }\n\n let fadeTime = 0;\n if (transition) {\n fadeTime = 400;\n }\n\n // Remove the backdrop features.\n $('[data-flexitour=\"step-background\"]').remove();\n $('[data-flexitour=\"step-backdrop\"]').removeAttr('data-flexitour');\n $('[data-flexitour=\"backdrop\"]').fadeOut(fadeTime, function() {\n $(this).remove();\n });\n\n // Remove aria-describedby and tabindex attributes.\n if (this.currentStepNode && this.currentStepNode.length) {\n let stepId = this.currentStepNode.attr('id');\n if (stepId) {\n let currentStepElement = '[aria-describedby=\"' + stepId + '-body\"]';\n $(currentStepElement).removeAttr('tabindex');\n $(currentStepElement).removeAttr('aria-describedby');\n }\n }\n\n // Reset the listeners.\n this.resetStepListeners();\n\n this.accessibilityHide();\n\n this.fireEventHandlers('afterHide');\n\n this.currentStepNode = null;\n this.currentStepPopper = null;\n return this;\n }\n\n /**\n * Show the current steps.\n *\n * @method show\n * @chainable\n * @return {Object} this.\n */\n show() {\n // Show the current step.\n let startAt = this.getCurrentStepNumber();\n\n return this.gotoStep(startAt);\n }\n\n /**\n * Return the current step node.\n *\n * @method getStepContainer\n * @return {jQuery}\n */\n getStepContainer() {\n return $(this.currentStepNode);\n }\n\n /**\n * Calculate scrollTop.\n *\n * @method calculateScrollTop\n * @param {Object} stepConfig The step configuration of the step\n * @return {Number}\n */\n calculateScrollTop(stepConfig) {\n let scrollTop = $(window).scrollTop();\n let viewportHeight = $(window).height();\n let targetNode = this.getStepTarget(stepConfig);\n\n if (stepConfig.placement === 'top') {\n // If the placement is top, center scroll at the top of the target.\n scrollTop = targetNode.offset().top - (viewportHeight / 2);\n } else if (stepConfig.placement === 'bottom') {\n // If the placement is bottom, center scroll at the bottom of the target.\n scrollTop = targetNode.offset().top + targetNode.height() - (viewportHeight / 2);\n } else if (targetNode.height() <= (viewportHeight * 0.8)) {\n // If the placement is left/right, and the target fits in the viewport, centre screen on the target\n scrollTop = targetNode.offset().top - ((viewportHeight - targetNode.height()) / 2);\n } else {\n // If the placement is left/right, and the target is bigger than the viewport, set scrollTop to target.top + buffer\n // and change step attachmentTarget to top+.\n scrollTop = targetNode.offset().top - (viewportHeight * 0.2);\n }\n\n // Never scroll over the top.\n scrollTop = Math.max(0, scrollTop);\n\n // Never scroll beyond the bottom.\n scrollTop = Math.min($(document).height() - viewportHeight, scrollTop);\n\n return Math.ceil(scrollTop);\n }\n\n /**\n * Calculate dialogue position for page middle.\n *\n * @method calculateScrollTop\n * @return {Number}\n */\n calculateStepPositionInPage() {\n let viewportHeight = $(window).height();\n let stepHeight = this.currentStepNode.height();\n\n let viewportWidth = $(window).width();\n let stepWidth = this.currentStepNode.width();\n\n return {\n top: Math.ceil((viewportHeight - stepHeight) / 2),\n left: Math.ceil((viewportWidth - stepWidth) / 2)\n };\n }\n\n /**\n * Position the step on the page.\n *\n * @method positionStep\n * @param {Object} stepConfig The step configuration of the step\n * @chainable\n * @return {Object} this.\n */\n positionStep(stepConfig) {\n let content = this.currentStepNode;\n if (!content || !content.length) {\n // Unable to find the step node.\n return this;\n }\n\n let flipBehavior;\n switch (stepConfig.placement) {\n case 'left':\n flipBehavior = ['left', 'right', 'top', 'bottom'];\n break;\n case 'right':\n flipBehavior = ['right', 'left', 'top', 'bottom'];\n break;\n case 'top':\n flipBehavior = ['top', 'bottom', 'right', 'left'];\n break;\n case 'bottom':\n flipBehavior = ['bottom', 'top', 'right', 'left'];\n break;\n default:\n flipBehavior = 'flip';\n break;\n }\n\n let target = this.getStepTarget(stepConfig);\n var config = {\n placement: stepConfig.placement + '-start',\n removeOnDestroy: true,\n modifiers: {\n flip: {\n behaviour: flipBehavior,\n },\n arrow: {\n element: '[data-role=\"arrow\"]',\n },\n },\n onCreate: function(data) {\n recalculateArrowPosition(data);\n },\n onUpdate: function(data) {\n recalculateArrowPosition(data);\n },\n };\n\n let recalculateArrowPosition = function(data) {\n let placement = data.placement.split('-')[0];\n const isVertical = ['left', 'right'].indexOf(placement) !== -1;\n const arrowElement = data.instance.popper.querySelector('[data-role=\"arrow\"]');\n const stepElement = $(data.instance.popper.querySelector('[data-role=\"flexitour-step\"]'));\n if (isVertical) {\n let arrowHeight = parseFloat(window.getComputedStyle(arrowElement).height);\n let arrowOffset = parseFloat(window.getComputedStyle(arrowElement).top);\n let popperHeight = parseFloat(window.getComputedStyle(data.instance.popper).height);\n let popperOffset = parseFloat(window.getComputedStyle(data.instance.popper).top);\n let popperBorderWidth = parseFloat(stepElement.css('borderTopWidth'));\n let popperBorderRadiusWidth = parseFloat(stepElement.css('borderTopLeftRadius')) * 2;\n let arrowPos = arrowOffset + (arrowHeight / 2);\n let maxPos = popperHeight + popperOffset - popperBorderWidth - popperBorderRadiusWidth;\n let minPos = popperOffset + popperBorderWidth + popperBorderRadiusWidth;\n if (arrowPos >= maxPos || arrowPos <= minPos) {\n let newArrowPos = 0;\n if (arrowPos > (popperHeight / 2)) {\n newArrowPos = maxPos - arrowHeight;\n } else {\n newArrowPos = minPos + arrowHeight;\n }\n $(arrowElement).css('top', newArrowPos);\n }\n } else {\n let arrowWidth = parseFloat(window.getComputedStyle(arrowElement).width);\n let arrowOffset = parseFloat(window.getComputedStyle(arrowElement).left);\n let popperWidth = parseFloat(window.getComputedStyle(data.instance.popper).width);\n let popperOffset = parseFloat(window.getComputedStyle(data.instance.popper).left);\n let popperBorderWidth = parseFloat(stepElement.css('borderTopWidth'));\n let popperBorderRadiusWidth = parseFloat(stepElement.css('borderTopLeftRadius')) * 2;\n let arrowPos = arrowOffset + (arrowWidth / 2);\n let maxPos = popperWidth + popperOffset - popperBorderWidth - popperBorderRadiusWidth;\n let minPos = popperOffset + popperBorderWidth + popperBorderRadiusWidth;\n if (arrowPos >= maxPos || arrowPos <= minPos) {\n let newArrowPos = 0;\n if (arrowPos > (popperWidth / 2)) {\n newArrowPos = maxPos - arrowWidth;\n } else {\n newArrowPos = minPos + arrowWidth;\n }\n $(arrowElement).css('left', newArrowPos);\n }\n }\n };\n\n let background = $('[data-flexitour=\"step-background\"]');\n if (background.length) {\n target = background;\n }\n this.currentStepPopper = new Popper(target, content[0], config);\n\n return this;\n }\n\n /**\n * Add the backdrop.\n *\n * @method positionBackdrop\n * @param {Object} stepConfig The step configuration of the step\n * @chainable\n * @return {Object} this.\n */\n positionBackdrop(stepConfig) {\n if (stepConfig.backdrop) {\n this.currentStepConfig.hasBackdrop = true;\n let backdrop = $('
');\n\n if (stepConfig.zIndex) {\n if (stepConfig.attachPoint === 'append') {\n stepConfig.attachTo.append(backdrop);\n } else {\n backdrop.insertAfter(stepConfig.attachTo);\n }\n } else {\n $('body').append(backdrop);\n }\n\n if (this.isStepActuallyVisible(stepConfig)) {\n // The step has a visible target.\n // Punch a hole through the backdrop.\n let background = $('
');\n\n let targetNode = this.getStepTarget(stepConfig);\n\n let buffer = 10;\n\n let colorNode = targetNode;\n if (buffer) {\n colorNode = $('body');\n }\n\n background.css({\n width: targetNode.outerWidth() + buffer + buffer,\n height: targetNode.outerHeight() + buffer + buffer,\n left: targetNode.offset().left - buffer,\n top: targetNode.offset().top - buffer,\n backgroundColor: this.calculateInherittedBackgroundColor(colorNode),\n });\n\n if (targetNode.offset().left < buffer) {\n background.css({\n width: targetNode.outerWidth() + targetNode.offset().left + buffer,\n left: targetNode.offset().left,\n });\n }\n\n if (targetNode.offset().top < buffer) {\n background.css({\n height: targetNode.outerHeight() + targetNode.offset().top + buffer,\n top: targetNode.offset().top,\n });\n }\n\n let targetRadius = targetNode.css('borderRadius');\n if (targetRadius && targetRadius !== $('body').css('borderRadius')) {\n background.css('borderRadius', targetRadius);\n }\n\n let targetPosition = this.calculatePosition(targetNode);\n if (targetPosition === 'fixed') {\n background.css('top', 0);\n } else if (targetPosition === 'absolute') {\n background.css('position', 'fixed');\n }\n\n let fader = background.clone();\n fader.css({\n backgroundColor: backdrop.css('backgroundColor'),\n opacity: backdrop.css('opacity'),\n });\n fader.attr('data-flexitour', 'step-background-fader');\n\n if (stepConfig.zIndex) {\n if (stepConfig.attachPoint === 'append') {\n stepConfig.attachTo.append(background);\n } else {\n fader.insertAfter(stepConfig.attachTo);\n background.insertAfter(stepConfig.attachTo);\n }\n } else {\n $('body').append(fader);\n $('body').append(background);\n }\n\n // Add the backdrop data to the actual target.\n // This is the part which actually does the work.\n targetNode.attr('data-flexitour', 'step-backdrop');\n\n if (stepConfig.zIndex) {\n backdrop.css('zIndex', stepConfig.zIndex);\n background.css('zIndex', stepConfig.zIndex + 1);\n targetNode.css('zIndex', stepConfig.zIndex + 2);\n }\n\n fader.fadeOut('2000', function() {\n $(this).remove();\n });\n }\n }\n return this;\n }\n\n /**\n * Calculate the inheritted z-index.\n *\n * @method calculateZIndex\n * @param {jQuery} elem The element to calculate z-index for\n * @return {Number} Calculated z-index\n */\n calculateZIndex(elem) {\n elem = $(elem);\n while (elem.length && elem[0] !== document) {\n // Ignore z-index if position is set to a value where z-index is ignored by the browser\n // This makes behavior of this function consistent across browsers\n // WebKit always returns auto if the element is positioned.\n let position = elem.css(\"position\");\n if (position === \"absolute\" || position === \"relative\" || position === \"fixed\") {\n // IE returns 0 when zIndex is not specified\n // other browsers return a string\n // we ignore the case of nested elements with an explicit value of 0\n //
\n let value = parseInt(elem.css(\"zIndex\"), 10);\n if (!isNaN(value) && value !== 0) {\n return value;\n }\n }\n elem = elem.parent();\n }\n\n return 0;\n }\n\n /**\n * Calculate the inheritted background colour.\n *\n * @method calculateInherittedBackgroundColor\n * @param {jQuery} elem The element to calculate colour for\n * @return {String} Calculated background colour\n */\n calculateInherittedBackgroundColor(elem) {\n // Use a fake node to compare each element against.\n let fakeNode = $('
').hide();\n $('body').append(fakeNode);\n let fakeElemColor = fakeNode.css('backgroundColor');\n fakeNode.remove();\n\n elem = $(elem);\n while (elem.length && elem[0] !== document) {\n let color = elem.css('backgroundColor');\n if (color !== fakeElemColor) {\n return color;\n }\n elem = elem.parent();\n }\n\n return null;\n }\n\n /**\n * Calculate the inheritted position.\n *\n * @method calculatePosition\n * @param {jQuery} elem The element to calculate position for\n * @return {String} Calculated position\n */\n calculatePosition(elem) {\n elem = $(elem);\n while (elem.length && elem[0] !== document) {\n let position = elem.css('position');\n if (position !== 'static') {\n return position;\n }\n elem = elem.parent();\n }\n\n return null;\n }\n\n /**\n * Perform accessibility changes for step shown.\n *\n * This will add aria-hidden=\"true\" to all siblings and parent siblings.\n *\n * @method accessibilityShow\n */\n accessibilityShow() {\n let stateHolder = 'data-has-hidden';\n let attrName = 'aria-hidden';\n let hideFunction = function(child) {\n let flexitourRole = child.data('flexitour');\n if (flexitourRole) {\n switch (flexitourRole) {\n case 'container':\n case 'target':\n return;\n }\n }\n\n let hidden = child.attr(attrName);\n if (!hidden) {\n child.attr(stateHolder, true);\n child.attr(attrName, true);\n }\n };\n\n this.currentStepNode.siblings().each(function(index, node) {\n hideFunction($(node));\n });\n this.currentStepNode.parentsUntil('body').siblings().each(function(index, node) {\n hideFunction($(node));\n });\n }\n\n /**\n * Perform accessibility changes for step hidden.\n *\n * This will remove any newly added aria-hidden=\"true\".\n *\n * @method accessibilityHide\n */\n accessibilityHide() {\n let stateHolder = 'data-has-hidden';\n let attrName = 'aria-hidden';\n let showFunction = function(child) {\n let hidden = child.attr(stateHolder);\n if (typeof hidden !== 'undefined') {\n child.removeAttr(stateHolder);\n child.removeAttr(attrName);\n }\n };\n\n $('[' + stateHolder + ']').each(function(index, node) {\n showFunction($(node));\n });\n }\n}\n"],"file":"tour.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/tour.js"],"names":["Tour","config","init","eventHandlers","reset","originalConfiguration","configure","apply","arguments","storage","window","sessionStorage","storageKey","tourName","e","hide","resetStepListeners","steps","currentStepNumber","eventName","forEach","handler","addEventHandler","resetStepDefaults","template","templateContent","checkMinimumRequirements","Error","length","loadOriginalConfiguration","stepDefaults","setStepDefaults","$","extend","element","placement","delay","moveOnClick","moveAfterTime","orphan","direction","parseInt","stepNumber","setItem","code","DOMException","QUOTA_EXCEEDED_ERR","removeItem","getCurrentStepNumber","nextStepNumber","isStepPotentiallyVisible","getStepConfig","previousStepNumber","getNextStepNumber","getPreviousStepNumber","stepConfig","isStepActuallyVisible","target","getStepTarget","is","gotoStep","endTour","_gotoStep","delayed","setTimeout","bind","fn","fireEventHandlers","renderStep","normalizeStepConfig","reflex","moveAfterClick","content","body","attachTo","attachPoint","first","data","thisEvent","call","push","listeners","node","currentStepNode","args","proxy","next","previous","handleKeyDown","targetNode","parents","listener","on","off","currentStepConfig","setCurrentStepNumber","getTemplateContent","find","html","title","isFirstStep","prop","isLastStep","removeClass","addClass","attr","addStepToPage","processStepListeners","clone","animationTarget","stop","zIndex","calculateZIndex","css","positionBackdrop","document","append","top","left","animate","scrollTop","calculateScrollTop","promise","then","positionStep","revealStep","catch","isOrphan","offset","calculateStepPositionInPage","currentStepPopper","Popper","removeOnDestroy","arrowElement","modifiers","enabled","applyStyle","onLoad","fadeIn","announceStep","focus","stepId","bodyRegion","headerRegion","accessibilityShow","tabbableSelector","keyCode","hasBackdrop","activeElement","stepTarget","tabbableNodes","dialogContainer","currentIndex","filter","index","has","each","nextIndex","nextNode","focusRelevant","shiftKey","closest","last","preventDefault","startAt","storageStartValue","getItem","storageStartAt","startTour","previousTarget","transition","destroy","fadeTime","remove","removeAttr","fadeOut","currentStepElement","accessibilityHide","viewportHeight","height","Math","max","min","ceil","stepHeight","viewportWidth","width","stepWidth","flipBehavior","flip","behaviour","arrow","onCreate","recalculateArrowPosition","onUpdate","split","isVertical","indexOf","instance","popper","querySelector","stepElement","arrowHeight","parseFloat","getComputedStyle","arrowOffset","popperHeight","popperOffset","popperBorderWidth","popperBorderRadiusWidth","arrowPos","maxPos","minPos","newArrowPos","arrowWidth","popperWidth","background","backdrop","insertAfter","buffer","colorNode","outerWidth","outerHeight","backgroundColor","calculateInherittedBackgroundColor","targetRadius","targetPosition","calculatePosition","fader","opacity","elem","position","value","isNaN","parent","fakeNode","fakeElemColor","color","attrName","hideFunction","child","flexitourRole","hidden","siblings","parentsUntil","showFunction"],"mappings":"gKAsBA,OACA,O,0qBAOqBA,CAAAA,C,YAIjB,WAAYC,CAAZ,CAAoB,WAChB,KAAKC,IAAL,CAAUD,CAAV,CACH,C,uBAUD,cAAKA,CAAL,CAAa,CAET,KAAKE,aAAL,CAAqB,EAArB,CAGA,KAAKC,KAAL,GAGA,KAAKC,qBAAL,CAA6BJ,CAAM,EAAI,EAAvC,CAGA,KAAKK,SAAL,CAAeC,KAAf,CAAqB,IAArB,CAA2BC,SAA3B,EAEA,GAAI,CACA,KAAKC,OAAL,CAAeC,MAAM,CAACC,cAAtB,CACA,KAAKC,UAAL,CAAkB,aAAe,KAAKC,QACzC,CAAC,MAAOC,CAAP,CAAU,CACR,KAAKL,OAAL,IACA,KAAKG,UAAL,CAAkB,EACrB,CAED,MAAO,KACV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L,CAAqBgK,QAArB,GAAgCvF,IAAhC,CAAqC,SAASF,CAAT,CAAgBxE,CAAhB,CAAsB,CACvD6J,CAAY,CAAC,cAAE7J,CAAF,CAAD,CACf,CAFD,EAGA,KAAKC,eAAL,CAAqBiK,YAArB,CAAkC,MAAlC,EAA0CD,QAA1C,GAAqDvF,IAArD,CAA0D,SAASF,CAAT,CAAgBxE,CAAhB,CAAsB,CAC5E6J,CAAY,CAAC,cAAE7J,CAAF,CAAD,CACf,CAFD,CAGH,C,iCASD,4BAAoB,IAGZmK,CAAAA,CAAY,CAAG,SAASL,CAAT,CAAgB,CAC/B,GAAIE,CAAAA,CAAM,CAAGF,CAAK,CAACvI,IAAN,mBAAb,CACA,GAAsB,WAAlB,QAAOyI,CAAAA,CAAX,CAAmC,CAC/BF,CAAK,CAAClE,UAAN,oBACAkE,CAAK,CAAClE,UAAN,CALO,aAKP,CACH,CACJ,CATe,CAWhB,mCAA2BlB,IAA3B,CAAgC,SAASF,CAAT,CAAgBxE,CAAhB,CAAsB,CAClDmK,CAAY,CAAC,cAAEnK,CAAF,CAAD,CACf,CAFD,CAGH,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Manage user tours in Moodle.\n *\n * @copyright 2018 Andrew Nicols \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport $ from 'jquery';\nimport Popper from 'core/popper';\n\n/**\n * A Tour.\n *\n * @class Tour\n */\nexport default class Tour {\n /**\n * @param {object} config The configuration object.\n */\n constructor(config) {\n this.init(config);\n }\n\n /**\n * Initialise the tour.\n *\n * @method init\n * @param {Object} config The configuration object.\n * @chainable\n * @return {Object} this.\n */\n init(config) {\n // Unset all handlers.\n this.eventHandlers = {};\n\n // Reset the current tour states.\n this.reset();\n\n // Store the initial configuration.\n this.originalConfiguration = config || {};\n\n // Apply configuration.\n this.configure.apply(this, arguments);\n\n try {\n this.storage = window.sessionStorage;\n this.storageKey = 'tourstate_' + this.tourName;\n } catch (e) {\n this.storage = false;\n this.storageKey = '';\n }\n\n return this;\n }\n\n /**\n * Reset the current tour state.\n *\n * @method reset\n * @chainable\n * @return {Object} this.\n */\n reset() {\n // Hide the current step.\n this.hide();\n\n // Unset all handlers.\n this.eventHandlers = [];\n\n // Unset all listeners.\n this.resetStepListeners();\n\n // Unset the original configuration.\n this.originalConfiguration = {};\n\n // Reset the current step number and list of steps.\n this.steps = [];\n\n // Reset the current step number.\n this.currentStepNumber = 0;\n\n return this;\n }\n\n /**\n * Prepare tour configuration.\n *\n * @method configure\n * @param {Object} config The configuration object.\n * @chainable\n * @return {Object} this.\n */\n configure(config) {\n if (typeof config === 'object') {\n // Tour name.\n if (typeof config.tourName !== 'undefined') {\n this.tourName = config.tourName;\n }\n\n // Set up eventHandlers.\n if (config.eventHandlers) {\n for (let eventName in config.eventHandlers) {\n config.eventHandlers[eventName].forEach(function(handler) {\n this.addEventHandler(eventName, handler);\n }, this);\n }\n }\n\n // Reset the step configuration.\n this.resetStepDefaults(true);\n\n // Configure the steps.\n if (typeof config.steps === 'object') {\n this.steps = config.steps;\n }\n\n if (typeof config.template !== 'undefined') {\n this.templateContent = config.template;\n }\n }\n\n // Check that we have enough to start the tour.\n this.checkMinimumRequirements();\n\n return this;\n }\n\n /**\n * Check that the configuration meets the minimum requirements.\n *\n * @method checkMinimumRequirements\n */\n checkMinimumRequirements() {\n // Need a tourName.\n if (!this.tourName) {\n throw new Error(\"Tour Name required\");\n }\n\n // Need a minimum of one step.\n if (!this.steps || !this.steps.length) {\n throw new Error(\"Steps must be specified\");\n }\n }\n\n /**\n * Reset step default configuration.\n *\n * @method resetStepDefaults\n * @param {Boolean} loadOriginalConfiguration Whether to load the original configuration supplied with the Tour.\n * @chainable\n * @return {Object} this.\n */\n resetStepDefaults(loadOriginalConfiguration) {\n if (typeof loadOriginalConfiguration === 'undefined') {\n loadOriginalConfiguration = true;\n }\n\n this.stepDefaults = {};\n if (!loadOriginalConfiguration || typeof this.originalConfiguration.stepDefaults === 'undefined') {\n this.setStepDefaults({});\n } else {\n this.setStepDefaults(this.originalConfiguration.stepDefaults);\n }\n\n return this;\n }\n\n /**\n * Set the step defaults.\n *\n * @method setStepDefaults\n * @param {Object} stepDefaults The step defaults to apply to all steps\n * @chainable\n * @return {Object} this.\n */\n setStepDefaults(stepDefaults) {\n if (!this.stepDefaults) {\n this.stepDefaults = {};\n }\n $.extend(\n this.stepDefaults,\n {\n element: '',\n placement: 'top',\n delay: 0,\n moveOnClick: false,\n moveAfterTime: 0,\n orphan: false,\n direction: 1,\n },\n stepDefaults\n );\n\n return this;\n }\n\n /**\n * Retrieve the current step number.\n *\n * @method getCurrentStepNumber\n * @return {Integer} The current step number\n */\n getCurrentStepNumber() {\n return parseInt(this.currentStepNumber, 10);\n }\n\n /**\n * Store the current step number.\n *\n * @method setCurrentStepNumber\n * @param {Integer} stepNumber The current step number\n * @chainable\n */\n setCurrentStepNumber(stepNumber) {\n this.currentStepNumber = stepNumber;\n if (this.storage) {\n try {\n this.storage.setItem(this.storageKey, stepNumber);\n } catch (e) {\n if (e.code === DOMException.QUOTA_EXCEEDED_ERR) {\n this.storage.removeItem(this.storageKey);\n }\n }\n }\n }\n\n /**\n * Get the next step number after the currently displayed step.\n *\n * @method getNextStepNumber\n * @param {Integer} stepNumber The current step number\n * @return {Integer} The next step number to display\n */\n getNextStepNumber(stepNumber) {\n if (typeof stepNumber === 'undefined') {\n stepNumber = this.getCurrentStepNumber();\n }\n let nextStepNumber = stepNumber + 1;\n\n // Keep checking the remaining steps.\n while (nextStepNumber <= this.steps.length) {\n if (this.isStepPotentiallyVisible(this.getStepConfig(nextStepNumber))) {\n return nextStepNumber;\n }\n nextStepNumber++;\n }\n\n return null;\n }\n\n /**\n * Get the previous step number before the currently displayed step.\n *\n * @method getPreviousStepNumber\n * @param {Integer} stepNumber The current step number\n * @return {Integer} The previous step number to display\n */\n getPreviousStepNumber(stepNumber) {\n if (typeof stepNumber === 'undefined') {\n stepNumber = this.getCurrentStepNumber();\n }\n let previousStepNumber = stepNumber - 1;\n\n // Keep checking the remaining steps.\n while (previousStepNumber >= 0) {\n if (this.isStepPotentiallyVisible(this.getStepConfig(previousStepNumber))) {\n return previousStepNumber;\n }\n previousStepNumber--;\n }\n\n return null;\n }\n\n /**\n * Is the step the final step number?\n *\n * @method isLastStep\n * @param {Integer} stepNumber Step number to test\n * @return {Boolean} Whether the step is the final step\n */\n isLastStep(stepNumber) {\n let nextStepNumber = this.getNextStepNumber(stepNumber);\n\n return nextStepNumber === null;\n }\n\n /**\n * Is the step the first step number?\n *\n * @method isFirstStep\n * @param {Integer} stepNumber Step number to test\n * @return {Boolean} Whether the step is the first step\n */\n isFirstStep(stepNumber) {\n let previousStepNumber = this.getPreviousStepNumber(stepNumber);\n\n return previousStepNumber === null;\n }\n\n /**\n * Is this step potentially visible?\n *\n * @method isStepPotentiallyVisible\n * @param {Object} stepConfig The step configuration to normalise\n * @return {Boolean} Whether the step is the potentially visible\n */\n isStepPotentiallyVisible(stepConfig) {\n if (!stepConfig) {\n // Without step config, there can be no step.\n return false;\n }\n\n if (this.isStepActuallyVisible(stepConfig)) {\n // If it is actually visible, it is already potentially visible.\n return true;\n }\n\n if (typeof stepConfig.orphan !== 'undefined' && stepConfig.orphan) {\n // Orphan steps have no target. They are always visible.\n return true;\n }\n\n if (typeof stepConfig.delay !== 'undefined' && stepConfig.delay) {\n // Only return true if the activated has not been used yet.\n return true;\n }\n\n // Not theoretically, or actually visible.\n return false;\n }\n\n /**\n * Is this step actually visible?\n *\n * @method isStepActuallyVisible\n * @param {Object} stepConfig The step configuration to normalise\n * @return {Boolean} Whether the step is actually visible\n */\n isStepActuallyVisible(stepConfig) {\n if (!stepConfig) {\n // Without step config, there can be no step.\n return false;\n }\n\n let target = this.getStepTarget(stepConfig);\n if (target && target.length && target.is(':visible')) {\n // Without a target, there can be no step.\n return !!target.length;\n }\n\n return false;\n }\n\n /**\n * Go to the next step in the tour.\n *\n * @method next\n * @chainable\n * @return {Object} this.\n */\n next() {\n return this.gotoStep(this.getNextStepNumber());\n }\n\n /**\n * Go to the previous step in the tour.\n *\n * @method previous\n * @chainable\n * @return {Object} this.\n */\n previous() {\n return this.gotoStep(this.getPreviousStepNumber(), -1);\n }\n\n /**\n * Go to the specified step in the tour.\n *\n * @method gotoStep\n * @param {Integer} stepNumber The step number to display\n * @param {Integer} direction Next or previous step\n * @chainable\n * @return {Object} this.\n */\n gotoStep(stepNumber, direction) {\n if (stepNumber < 0) {\n return this.endTour();\n }\n\n let stepConfig = this.getStepConfig(stepNumber);\n if (stepConfig === null) {\n return this.endTour();\n }\n\n return this._gotoStep(stepConfig, direction);\n }\n\n _gotoStep(stepConfig, direction) {\n if (!stepConfig) {\n return this.endTour();\n }\n\n if (typeof stepConfig.delay !== 'undefined' && stepConfig.delay && !stepConfig.delayed) {\n stepConfig.delayed = true;\n window.setTimeout(this._gotoStep.bind(this), stepConfig.delay, stepConfig, direction);\n\n return this;\n } else if (!stepConfig.orphan && !this.isStepActuallyVisible(stepConfig)) {\n let fn = direction == -1 ? 'getPreviousStepNumber' : 'getNextStepNumber';\n return this.gotoStep(this[fn](stepConfig.stepNumber), direction);\n }\n\n this.hide();\n\n this.fireEventHandlers('beforeRender', stepConfig);\n this.renderStep(stepConfig);\n this.fireEventHandlers('afterRender', stepConfig);\n\n return this;\n }\n\n /**\n * Fetch the normalised step configuration for the specified step number.\n *\n * @method getStepConfig\n * @param {Integer} stepNumber The step number to fetch configuration for\n * @return {Object} The step configuration\n */\n getStepConfig(stepNumber) {\n if (stepNumber === null || stepNumber < 0 || stepNumber >= this.steps.length) {\n return null;\n }\n\n // Normalise the step configuration.\n let stepConfig = this.normalizeStepConfig(this.steps[stepNumber]);\n\n // Add the stepNumber to the stepConfig.\n stepConfig = $.extend(stepConfig, {stepNumber: stepNumber});\n\n return stepConfig;\n }\n\n /**\n * Normalise the supplied step configuration.\n *\n * @method normalizeStepConfig\n * @param {Object} stepConfig The step configuration to normalise\n * @return {Object} The normalised step configuration\n */\n normalizeStepConfig(stepConfig) {\n\n if (typeof stepConfig.reflex !== 'undefined' && typeof stepConfig.moveAfterClick === 'undefined') {\n stepConfig.moveAfterClick = stepConfig.reflex;\n }\n\n if (typeof stepConfig.element !== 'undefined' && typeof stepConfig.target === 'undefined') {\n stepConfig.target = stepConfig.element;\n }\n\n if (typeof stepConfig.content !== 'undefined' && typeof stepConfig.body === 'undefined') {\n stepConfig.body = stepConfig.content;\n }\n\n stepConfig = $.extend({}, this.stepDefaults, stepConfig);\n\n stepConfig = $.extend({}, {\n attachTo: stepConfig.target,\n attachPoint: 'after',\n }, stepConfig);\n\n if (stepConfig.attachTo) {\n stepConfig.attachTo = $(stepConfig.attachTo).first();\n }\n\n return stepConfig;\n }\n\n /**\n * Fetch the actual step target from the selector.\n *\n * This should not be called until after any delay has completed.\n *\n * @method getStepTarget\n * @param {Object} stepConfig The step configuration\n * @return {$}\n */\n getStepTarget(stepConfig) {\n if (stepConfig.target) {\n return $(stepConfig.target);\n }\n\n return null;\n }\n\n /**\n * Fire any event handlers for the specified event.\n *\n * @param {String} eventName The name of the event to handle\n * @param {Object} data Any data to pass to the event\n * @chainable\n * @return {Object} this.\n */\n fireEventHandlers(eventName, data) {\n if (typeof this.eventHandlers[eventName] === 'undefined') {\n return this;\n }\n\n this.eventHandlers[eventName].forEach(function(thisEvent) {\n thisEvent.call(this, data);\n }, this);\n\n return this;\n }\n\n /**\n * @method addEventHandler\n * @param {string} eventName The name of the event to listen for\n * @param {function} handler The event handler to call\n * @return {Object} this.\n */\n addEventHandler(eventName, handler) {\n if (typeof this.eventHandlers[eventName] === 'undefined') {\n this.eventHandlers[eventName] = [];\n }\n\n this.eventHandlers[eventName].push(handler);\n\n return this;\n }\n\n /**\n * Process listeners for the step being shown.\n *\n * @method processStepListeners\n * @param {object} stepConfig The configuration for the step\n * @chainable\n * @return {Object} this.\n */\n processStepListeners(stepConfig) {\n this.listeners.push(\n // Next/Previous buttons.\n {\n node: this.currentStepNode,\n args: ['click', '[data-role=\"next\"]', $.proxy(this.next, this)]\n }, {\n node: this.currentStepNode,\n args: ['click', '[data-role=\"previous\"]', $.proxy(this.previous, this)]\n },\n\n // Close and end tour buttons.\n {\n node: this.currentStepNode,\n args: ['click', '[data-role=\"end\"]', $.proxy(this.endTour, this)]\n },\n\n // Click backdrop and hide tour.\n {\n node: $('[data-flexitour=\"backdrop\"]'),\n args: ['click', $.proxy(this.hide, this)]\n },\n\n // Keypresses.\n {\n node: $('body'),\n args: ['keydown', $.proxy(this.handleKeyDown, this)]\n });\n\n if (stepConfig.moveOnClick) {\n var targetNode = this.getStepTarget(stepConfig);\n this.listeners.push({\n node: targetNode,\n args: ['click', $.proxy(function(e) {\n if ($(e.target).parents('[data-flexitour=\"container\"]').length === 0) {\n // Ignore clicks when they are in the flexitour.\n window.setTimeout($.proxy(this.next, this), 500);\n }\n }, this)]\n });\n }\n\n this.listeners.forEach(function (listener) {\n listener.node.on.apply(listener.node, listener.args);\n });\n\n return this;\n }\n\n /**\n * Reset step listeners.\n *\n * @method resetStepListeners\n * @chainable\n * @return {Object} this.\n */\n resetStepListeners() {\n // Stop listening to all external handlers.\n if (this.listeners) {\n this.listeners.forEach(function(listener) {\n listener.node.off.apply(listener.node, listener.args);\n });\n }\n this.listeners = [];\n\n return this;\n }\n\n /**\n * The standard step renderer.\n *\n * @method renderStep\n * @param {Object} stepConfig The step configuration of the step\n * @chainable\n * @return {Object} this.\n */\n renderStep(stepConfig) {\n // Store the current step configuration for later.\n this.currentStepConfig = stepConfig;\n this.setCurrentStepNumber(stepConfig.stepNumber);\n\n // Fetch the template and convert it to a $ object.\n let template = $(this.getTemplateContent());\n\n // Title.\n template.find('[data-placeholder=\"title\"]')\n .html(stepConfig.title);\n\n // Body.\n template.find('[data-placeholder=\"body\"]')\n .html(stepConfig.body);\n\n // Is this the first step?\n if (this.isFirstStep(stepConfig.stepNumber)) {\n template.find('[data-role=\"previous\"]').hide();\n } else {\n template.find('[data-role=\"previous\"]').prop('disabled', false);\n }\n\n // Is this the final step?\n if (this.isLastStep(stepConfig.stepNumber)) {\n template.find('[data-role=\"next\"]').hide();\n template.find('[data-role=\"end\"]').removeClass(\"btn-secondary\").addClass(\"btn-primary\");\n } else {\n template.find('[data-role=\"next\"]').prop('disabled', false);\n }\n\n template.find('[data-role=\"previous\"]').attr('role', 'button');\n template.find('[data-role=\"next\"]').attr('role', 'button');\n template.find('[data-role=\"end\"]').attr('role', 'button');\n\n // Replace the template with the updated version.\n stepConfig.template = template;\n\n // Add to the page.\n this.addStepToPage(stepConfig);\n\n // Process step listeners after adding to the page.\n // This uses the currentNode.\n this.processStepListeners(stepConfig);\n\n return this;\n }\n\n /**\n * Getter for the template content.\n *\n * @method getTemplateContent\n * @return {$}\n */\n getTemplateContent() {\n return $(this.templateContent).clone();\n }\n\n /**\n * Helper to add a step to the page.\n *\n * @method addStepToPage\n * @param {Object} stepConfig The step configuration of the step\n * @chainable\n * @return {Object} this.\n */\n addStepToPage(stepConfig) {\n // Create the stepNode from the template data.\n let currentStepNode = $('')\n .html(stepConfig.template)\n .hide();\n\n // The scroll animation occurs on the body or html.\n let animationTarget = $('body, html')\n .stop(true, true);\n\n if (this.isStepActuallyVisible(stepConfig)) {\n let targetNode = this.getStepTarget(stepConfig);\n\n targetNode.data('flexitour', 'target');\n\n let zIndex = this.calculateZIndex(targetNode);\n if (zIndex) {\n stepConfig.zIndex = zIndex + 1;\n }\n\n if (stepConfig.zIndex) {\n currentStepNode.css('zIndex', stepConfig.zIndex + 1);\n }\n\n // Add the backdrop.\n this.positionBackdrop(stepConfig);\n\n $(document.body).append(currentStepNode);\n this.currentStepNode = currentStepNode;\n\n // Ensure that the step node is positioned.\n // Some situations mean that the value is not properly calculated without this step.\n this.currentStepNode.css({\n top: 0,\n left: 0,\n });\n\n animationTarget\n .animate({\n scrollTop: this.calculateScrollTop(stepConfig),\n }).promise().then(function() {\n this.positionStep(stepConfig);\n this.revealStep(stepConfig);\n return;\n }.bind(this))\n .catch(function() {\n // Silently fail.\n });\n\n } else if (stepConfig.orphan) {\n stepConfig.isOrphan = true;\n\n // This will be appended to the body instead.\n stepConfig.attachTo = $('body').first();\n stepConfig.attachPoint = 'append';\n\n // Add the backdrop.\n this.positionBackdrop(stepConfig);\n\n // This is an orphaned step.\n currentStepNode.addClass('orphan');\n\n // It lives in the body.\n $(document.body).append(currentStepNode);\n this.currentStepNode = currentStepNode;\n\n this.currentStepNode.offset(this.calculateStepPositionInPage());\n this.currentStepNode.css('position', 'fixed');\n\n this.currentStepPopper = new Popper(\n $('body'),\n this.currentStepNode[0], {\n removeOnDestroy: true,\n placement: stepConfig.placement + '-start',\n arrowElement: '[data-role=\"arrow\"]',\n // Empty the modifiers. We've already placed the step and don't want it moved.\n modifiers: {\n hide: {\n enabled: false,\n },\n applyStyle: {\n onLoad: null,\n enabled: false,\n },\n }\n }\n );\n\n this.revealStep(stepConfig);\n }\n\n return this;\n }\n\n /**\n * Make the given step visible.\n *\n * @method revealStep\n * @param {Object} stepConfig The step configuration of the step\n * @chainable\n * @return {Object} this.\n */\n revealStep(stepConfig) {\n // Fade the step in.\n this.currentStepNode.fadeIn('', $.proxy(function() {\n // Announce via ARIA.\n this.announceStep(stepConfig);\n\n // Focus on the current step Node.\n this.currentStepNode.focus();\n window.setTimeout($.proxy(function() {\n // After a brief delay, focus again.\n // There seems to be an issue with Jaws where it only reads the dialogue title initially.\n // This second focus helps it to read the full dialogue.\n if (this.currentStepNode) {\n this.currentStepNode.focus();\n }\n }, this), 100);\n\n }, this));\n\n return this;\n }\n\n /**\n * Helper to announce the step on the page.\n *\n * @method announceStep\n * @param {Object} stepConfig The step configuration of the step\n * @chainable\n * @return {Object} this.\n */\n announceStep(stepConfig) {\n // Setup the step Dialogue as per:\n // * https://www.w3.org/TR/wai-aria-practices/#dialog_nonmodal\n // * https://www.w3.org/TR/wai-aria-practices/#dialog_modal\n\n // Generate an ID for the current step node.\n let stepId = 'tour-step-' + this.tourName + '-' + stepConfig.stepNumber;\n this.currentStepNode.attr('id', stepId);\n\n let bodyRegion = this.currentStepNode.find('[data-placeholder=\"body\"]').first();\n bodyRegion.attr('id', stepId + '-body');\n bodyRegion.attr('role', 'document');\n\n let headerRegion = this.currentStepNode.find('[data-placeholder=\"title\"]').first();\n headerRegion.attr('id', stepId + '-title');\n headerRegion.attr('aria-labelledby', stepId + '-body');\n\n // Generally, a modal dialog has a role of dialog.\n this.currentStepNode.attr('role', 'dialog');\n this.currentStepNode.attr('tabindex', 0);\n this.currentStepNode.attr('aria-labelledby', stepId + '-title');\n this.currentStepNode.attr('aria-describedby', stepId + '-body');\n\n // Configure ARIA attributes on the target.\n let target = this.getStepTarget(stepConfig);\n if (target) {\n if (!target.attr('tabindex')) {\n target.attr('tabindex', 0);\n }\n\n target\n .data('original-describedby', target.attr('aria-describedby'))\n .attr('aria-describedby', stepId + '-body')\n ;\n }\n\n this.accessibilityShow(stepConfig);\n\n return this;\n }\n\n /**\n * Handle key down events.\n *\n * @method handleKeyDown\n * @param {EventFacade} e\n */\n handleKeyDown(e) {\n let tabbableSelector = 'a[href], link[href], [draggable=true], [contenteditable=true], ';\n tabbableSelector += ':input:enabled, [tabindex], button:enabled';\n switch (e.keyCode) {\n case 27:\n this.endTour();\n break;\n\n // 9 == Tab - trap focus for items with a backdrop.\n case 9:\n // Tab must be handled on key up only in this instance.\n (function() {\n if (!this.currentStepConfig.hasBackdrop) {\n // Trapping tab focus is only handled for those steps with a backdrop.\n return;\n }\n\n // Find all tabbable locations.\n let activeElement = $(document.activeElement);\n let stepTarget = this.getStepTarget(this.currentStepConfig);\n let tabbableNodes = $(tabbableSelector);\n let dialogContainer = $('span[data-flexitour=\"container\"]');\n let currentIndex;\n // Filter out element which is not belong to target section or dialogue.\n if (stepTarget) {\n tabbableNodes = tabbableNodes.filter(function(index, element) {\n return stepTarget !== null\n && (stepTarget.has(element).length\n || dialogContainer.has(element).length\n || stepTarget.is(element)\n || dialogContainer.is(element));\n });\n }\n\n // Find index of focusing element.\n tabbableNodes.each(function(index, element) {\n if (activeElement.is(element)) {\n currentIndex = index;\n return false;\n }\n // Keep looping.\n return true;\n });\n\n let nextIndex;\n let nextNode;\n let focusRelevant;\n if (currentIndex != void 0) {\n let direction = 1;\n if (e.shiftKey) {\n direction = -1;\n }\n nextIndex = currentIndex;\n do {\n nextIndex += direction;\n nextNode = $(tabbableNodes[nextIndex]);\n } while (nextNode.length && nextNode.is(':disabled') || nextNode.is(':hidden'));\n if (nextNode.length) {\n // A new f\n focusRelevant = nextNode.closest(stepTarget).length;\n focusRelevant = focusRelevant || nextNode.closest(this.currentStepNode).length;\n } else {\n // Unable to find the target somehow.\n focusRelevant = false;\n }\n }\n\n if (focusRelevant) {\n nextNode.focus();\n } else {\n if (e.shiftKey) {\n // Focus on the last tabbable node in the step.\n this.currentStepNode.find(tabbableSelector).last().focus();\n } else {\n if (this.currentStepConfig.isOrphan) {\n // Focus on the step - there is no target.\n this.currentStepNode.focus();\n } else {\n // Focus on the step target.\n stepTarget.focus();\n }\n }\n }\n e.preventDefault();\n }).call(this);\n break;\n }\n }\n\n /**\n * Start the current tour.\n *\n * @method startTour\n * @param {Integer} startAt Which step number to start at. If not specified, starts at the last point.\n * @chainable\n * @return {Object} this.\n */\n startTour(startAt) {\n if (this.storage && typeof startAt === 'undefined') {\n let storageStartValue = this.storage.getItem(this.storageKey);\n if (storageStartValue) {\n let storageStartAt = parseInt(storageStartValue, 10);\n if (storageStartAt <= this.steps.length) {\n startAt = storageStartAt;\n }\n }\n }\n\n if (typeof startAt === 'undefined') {\n startAt = this.getCurrentStepNumber();\n }\n\n this.fireEventHandlers('beforeStart', startAt);\n this.gotoStep(startAt);\n this.fireEventHandlers('afterStart', startAt);\n\n return this;\n }\n\n /**\n * Restart the tour from the beginning, resetting the completionlag.\n *\n * @method restartTour\n * @chainable\n * @return {Object} this.\n */\n restartTour() {\n return this.startTour(0);\n }\n\n /**\n * End the current tour.\n *\n * @method endTour\n * @chainable\n * @return {Object} this.\n */\n endTour() {\n this.fireEventHandlers('beforeEnd');\n\n if (this.currentStepConfig) {\n let previousTarget = this.getStepTarget(this.currentStepConfig);\n if (previousTarget) {\n if (!previousTarget.attr('tabindex')) {\n previousTarget.attr('tabindex', '-1');\n }\n previousTarget.focus();\n }\n }\n\n this.hide(true);\n\n this.fireEventHandlers('afterEnd');\n\n return this;\n }\n\n /**\n * Hide any currently visible steps.\n *\n * @method hide\n * @param {Bool} transition Animate the visibility change\n * @chainable\n * @return {Object} this.\n */\n hide(transition) {\n this.fireEventHandlers('beforeHide');\n\n if (this.currentStepNode && this.currentStepNode.length) {\n this.currentStepNode.hide();\n if (this.currentStepPopper) {\n this.currentStepPopper.destroy();\n }\n }\n\n // Restore original target configuration.\n if (this.currentStepConfig) {\n let target = this.getStepTarget(this.currentStepConfig);\n if (target) {\n if (target.data('original-labelledby')) {\n target.attr('aria-labelledby', target.data('original-labelledby'));\n }\n\n if (target.data('original-describedby')) {\n target.attr('aria-describedby', target.data('original-describedby'));\n }\n\n if (target.data('original-tabindex')) {\n target.attr('tabindex', target.data('tabindex'));\n }\n }\n\n // Clear the step configuration.\n this.currentStepConfig = null;\n }\n\n let fadeTime = 0;\n if (transition) {\n fadeTime = 400;\n }\n\n // Remove the backdrop features.\n $('[data-flexitour=\"step-background\"]').remove();\n $('[data-flexitour=\"step-backdrop\"]').removeAttr('data-flexitour');\n $('[data-flexitour=\"backdrop\"]').fadeOut(fadeTime, function() {\n $(this).remove();\n });\n\n // Remove aria-describedby and tabindex attributes.\n if (this.currentStepNode && this.currentStepNode.length) {\n let stepId = this.currentStepNode.attr('id');\n if (stepId) {\n let currentStepElement = '[aria-describedby=\"' + stepId + '-body\"]';\n $(currentStepElement).removeAttr('tabindex');\n $(currentStepElement).removeAttr('aria-describedby');\n }\n }\n\n // Reset the listeners.\n this.resetStepListeners();\n\n this.accessibilityHide();\n\n this.fireEventHandlers('afterHide');\n\n this.currentStepNode = null;\n this.currentStepPopper = null;\n return this;\n }\n\n /**\n * Show the current steps.\n *\n * @method show\n * @chainable\n * @return {Object} this.\n */\n show() {\n // Show the current step.\n let startAt = this.getCurrentStepNumber();\n\n return this.gotoStep(startAt);\n }\n\n /**\n * Return the current step node.\n *\n * @method getStepContainer\n * @return {jQuery}\n */\n getStepContainer() {\n return $(this.currentStepNode);\n }\n\n /**\n * Calculate scrollTop.\n *\n * @method calculateScrollTop\n * @param {Object} stepConfig The step configuration of the step\n * @return {Number}\n */\n calculateScrollTop(stepConfig) {\n let scrollTop = $(window).scrollTop();\n let viewportHeight = $(window).height();\n let targetNode = this.getStepTarget(stepConfig);\n\n if (stepConfig.placement === 'top') {\n // If the placement is top, center scroll at the top of the target.\n scrollTop = targetNode.offset().top - (viewportHeight / 2);\n } else if (stepConfig.placement === 'bottom') {\n // If the placement is bottom, center scroll at the bottom of the target.\n scrollTop = targetNode.offset().top + targetNode.height() - (viewportHeight / 2);\n } else if (targetNode.height() <= (viewportHeight * 0.8)) {\n // If the placement is left/right, and the target fits in the viewport, centre screen on the target\n scrollTop = targetNode.offset().top - ((viewportHeight - targetNode.height()) / 2);\n } else {\n // If the placement is left/right, and the target is bigger than the viewport, set scrollTop to target.top + buffer\n // and change step attachmentTarget to top+.\n scrollTop = targetNode.offset().top - (viewportHeight * 0.2);\n }\n\n // Never scroll over the top.\n scrollTop = Math.max(0, scrollTop);\n\n // Never scroll beyond the bottom.\n scrollTop = Math.min($(document).height() - viewportHeight, scrollTop);\n\n return Math.ceil(scrollTop);\n }\n\n /**\n * Calculate dialogue position for page middle.\n *\n * @method calculateScrollTop\n * @return {Number}\n */\n calculateStepPositionInPage() {\n let viewportHeight = $(window).height();\n let stepHeight = this.currentStepNode.height();\n\n let viewportWidth = $(window).width();\n let stepWidth = this.currentStepNode.width();\n\n return {\n top: Math.ceil((viewportHeight - stepHeight) / 2),\n left: Math.ceil((viewportWidth - stepWidth) / 2)\n };\n }\n\n /**\n * Position the step on the page.\n *\n * @method positionStep\n * @param {Object} stepConfig The step configuration of the step\n * @chainable\n * @return {Object} this.\n */\n positionStep(stepConfig) {\n let content = this.currentStepNode;\n if (!content || !content.length) {\n // Unable to find the step node.\n return this;\n }\n\n let flipBehavior;\n switch (stepConfig.placement) {\n case 'left':\n flipBehavior = ['left', 'right', 'top', 'bottom'];\n break;\n case 'right':\n flipBehavior = ['right', 'left', 'top', 'bottom'];\n break;\n case 'top':\n flipBehavior = ['top', 'bottom', 'right', 'left'];\n break;\n case 'bottom':\n flipBehavior = ['bottom', 'top', 'right', 'left'];\n break;\n default:\n flipBehavior = 'flip';\n break;\n }\n\n let target = this.getStepTarget(stepConfig);\n var config = {\n placement: stepConfig.placement + '-start',\n removeOnDestroy: true,\n modifiers: {\n flip: {\n behaviour: flipBehavior,\n },\n arrow: {\n element: '[data-role=\"arrow\"]',\n },\n },\n onCreate: function(data) {\n recalculateArrowPosition(data);\n },\n onUpdate: function(data) {\n recalculateArrowPosition(data);\n },\n };\n\n let recalculateArrowPosition = function(data) {\n let placement = data.placement.split('-')[0];\n const isVertical = ['left', 'right'].indexOf(placement) !== -1;\n const arrowElement = data.instance.popper.querySelector('[data-role=\"arrow\"]');\n const stepElement = $(data.instance.popper.querySelector('[data-role=\"flexitour-step\"]'));\n if (isVertical) {\n let arrowHeight = parseFloat(window.getComputedStyle(arrowElement).height);\n let arrowOffset = parseFloat(window.getComputedStyle(arrowElement).top);\n let popperHeight = parseFloat(window.getComputedStyle(data.instance.popper).height);\n let popperOffset = parseFloat(window.getComputedStyle(data.instance.popper).top);\n let popperBorderWidth = parseFloat(stepElement.css('borderTopWidth'));\n let popperBorderRadiusWidth = parseFloat(stepElement.css('borderTopLeftRadius')) * 2;\n let arrowPos = arrowOffset + (arrowHeight / 2);\n let maxPos = popperHeight + popperOffset - popperBorderWidth - popperBorderRadiusWidth;\n let minPos = popperOffset + popperBorderWidth + popperBorderRadiusWidth;\n if (arrowPos >= maxPos || arrowPos <= minPos) {\n let newArrowPos = 0;\n if (arrowPos > (popperHeight / 2)) {\n newArrowPos = maxPos - arrowHeight;\n } else {\n newArrowPos = minPos + arrowHeight;\n }\n $(arrowElement).css('top', newArrowPos);\n }\n } else {\n let arrowWidth = parseFloat(window.getComputedStyle(arrowElement).width);\n let arrowOffset = parseFloat(window.getComputedStyle(arrowElement).left);\n let popperWidth = parseFloat(window.getComputedStyle(data.instance.popper).width);\n let popperOffset = parseFloat(window.getComputedStyle(data.instance.popper).left);\n let popperBorderWidth = parseFloat(stepElement.css('borderTopWidth'));\n let popperBorderRadiusWidth = parseFloat(stepElement.css('borderTopLeftRadius')) * 2;\n let arrowPos = arrowOffset + (arrowWidth / 2);\n let maxPos = popperWidth + popperOffset - popperBorderWidth - popperBorderRadiusWidth;\n let minPos = popperOffset + popperBorderWidth + popperBorderRadiusWidth;\n if (arrowPos >= maxPos || arrowPos <= minPos) {\n let newArrowPos = 0;\n if (arrowPos > (popperWidth / 2)) {\n newArrowPos = maxPos - arrowWidth;\n } else {\n newArrowPos = minPos + arrowWidth;\n }\n $(arrowElement).css('left', newArrowPos);\n }\n }\n };\n\n let background = $('[data-flexitour=\"step-background\"]');\n if (background.length) {\n target = background;\n }\n this.currentStepPopper = new Popper(target, content[0], config);\n\n return this;\n }\n\n /**\n * Add the backdrop.\n *\n * @method positionBackdrop\n * @param {Object} stepConfig The step configuration of the step\n * @chainable\n * @return {Object} this.\n */\n positionBackdrop(stepConfig) {\n if (stepConfig.backdrop) {\n this.currentStepConfig.hasBackdrop = true;\n let backdrop = $('
');\n\n if (stepConfig.zIndex) {\n if (stepConfig.attachPoint === 'append') {\n stepConfig.attachTo.append(backdrop);\n } else {\n backdrop.insertAfter(stepConfig.attachTo);\n }\n } else {\n $('body').append(backdrop);\n }\n\n if (this.isStepActuallyVisible(stepConfig)) {\n // The step has a visible target.\n // Punch a hole through the backdrop.\n let background = $('
');\n\n let targetNode = this.getStepTarget(stepConfig);\n\n let buffer = 10;\n\n let colorNode = targetNode;\n if (buffer) {\n colorNode = $('body');\n }\n\n background.css({\n width: targetNode.outerWidth() + buffer + buffer,\n height: targetNode.outerHeight() + buffer + buffer,\n left: targetNode.offset().left - buffer,\n top: targetNode.offset().top - buffer,\n backgroundColor: this.calculateInherittedBackgroundColor(colorNode),\n });\n\n if (targetNode.offset().left < buffer) {\n background.css({\n width: targetNode.outerWidth() + targetNode.offset().left + buffer,\n left: targetNode.offset().left,\n });\n }\n\n if (targetNode.offset().top < buffer) {\n background.css({\n height: targetNode.outerHeight() + targetNode.offset().top + buffer,\n top: targetNode.offset().top,\n });\n }\n\n let targetRadius = targetNode.css('borderRadius');\n if (targetRadius && targetRadius !== $('body').css('borderRadius')) {\n background.css('borderRadius', targetRadius);\n }\n\n let targetPosition = this.calculatePosition(targetNode);\n if (targetPosition === 'fixed') {\n background.css('top', 0);\n } else if (targetPosition === 'absolute') {\n background.css('position', 'fixed');\n }\n\n let fader = background.clone();\n fader.css({\n backgroundColor: backdrop.css('backgroundColor'),\n opacity: backdrop.css('opacity'),\n });\n fader.attr('data-flexitour', 'step-background-fader');\n\n if (stepConfig.zIndex) {\n if (stepConfig.attachPoint === 'append') {\n stepConfig.attachTo.append(background);\n } else {\n fader.insertAfter(stepConfig.attachTo);\n background.insertAfter(stepConfig.attachTo);\n }\n } else {\n $('body').append(fader);\n $('body').append(background);\n }\n\n // Add the backdrop data to the actual target.\n // This is the part which actually does the work.\n targetNode.attr('data-flexitour', 'step-backdrop');\n\n if (stepConfig.zIndex) {\n backdrop.css('zIndex', stepConfig.zIndex);\n background.css('zIndex', stepConfig.zIndex + 1);\n targetNode.css('zIndex', stepConfig.zIndex + 2);\n }\n\n fader.fadeOut('2000', function() {\n $(this).remove();\n });\n }\n }\n return this;\n }\n\n /**\n * Calculate the inheritted z-index.\n *\n * @method calculateZIndex\n * @param {jQuery} elem The element to calculate z-index for\n * @return {Number} Calculated z-index\n */\n calculateZIndex(elem) {\n elem = $(elem);\n while (elem.length && elem[0] !== document) {\n // Ignore z-index if position is set to a value where z-index is ignored by the browser\n // This makes behavior of this function consistent across browsers\n // WebKit always returns auto if the element is positioned.\n let position = elem.css(\"position\");\n if (position === \"absolute\" || position === \"relative\" || position === \"fixed\") {\n // IE returns 0 when zIndex is not specified\n // other browsers return a string\n // we ignore the case of nested elements with an explicit value of 0\n //
\n let value = parseInt(elem.css(\"zIndex\"), 10);\n if (!isNaN(value) && value !== 0) {\n return value;\n }\n }\n elem = elem.parent();\n }\n\n return 0;\n }\n\n /**\n * Calculate the inheritted background colour.\n *\n * @method calculateInherittedBackgroundColor\n * @param {jQuery} elem The element to calculate colour for\n * @return {String} Calculated background colour\n */\n calculateInherittedBackgroundColor(elem) {\n // Use a fake node to compare each element against.\n let fakeNode = $('
').hide();\n $('body').append(fakeNode);\n let fakeElemColor = fakeNode.css('backgroundColor');\n fakeNode.remove();\n\n elem = $(elem);\n while (elem.length && elem[0] !== document) {\n let color = elem.css('backgroundColor');\n if (color !== fakeElemColor) {\n return color;\n }\n elem = elem.parent();\n }\n\n return null;\n }\n\n /**\n * Calculate the inheritted position.\n *\n * @method calculatePosition\n * @param {jQuery} elem The element to calculate position for\n * @return {String} Calculated position\n */\n calculatePosition(elem) {\n elem = $(elem);\n while (elem.length && elem[0] !== document) {\n let position = elem.css('position');\n if (position !== 'static') {\n return position;\n }\n elem = elem.parent();\n }\n\n return null;\n }\n\n /**\n * Perform accessibility changes for step shown.\n *\n * This will add aria-hidden=\"true\" to all siblings and parent siblings.\n *\n * @method accessibilityShow\n */\n accessibilityShow() {\n let stateHolder = 'data-has-hidden';\n let attrName = 'aria-hidden';\n let hideFunction = function(child) {\n let flexitourRole = child.data('flexitour');\n if (flexitourRole) {\n switch (flexitourRole) {\n case 'container':\n case 'target':\n return;\n }\n }\n\n let hidden = child.attr(attrName);\n if (!hidden) {\n child.attr(stateHolder, true);\n child.attr(attrName, true);\n }\n };\n\n this.currentStepNode.siblings().each(function(index, node) {\n hideFunction($(node));\n });\n this.currentStepNode.parentsUntil('body').siblings().each(function(index, node) {\n hideFunction($(node));\n });\n }\n\n /**\n * Perform accessibility changes for step hidden.\n *\n * This will remove any newly added aria-hidden=\"true\".\n *\n * @method accessibilityHide\n */\n accessibilityHide() {\n let stateHolder = 'data-has-hidden';\n let attrName = 'aria-hidden';\n let showFunction = function(child) {\n let hidden = child.attr(stateHolder);\n if (typeof hidden !== 'undefined') {\n child.removeAttr(stateHolder);\n child.removeAttr(attrName);\n }\n };\n\n $('[' + stateHolder + ']').each(function(index, node) {\n showFunction($(node));\n });\n }\n}\n"],"file":"tour.min.js"} \ No newline at end of file diff --git a/availability/condition/completion/yui/build/moodle-availability_completion-form/moodle-availability_completion-form-min.js b/availability/condition/completion/yui/build/moodle-availability_completion-form/moodle-availability_completion-form-min.js index 67acacbf734..668c9c5c983 100644 --- a/availability/condition/completion/yui/build/moodle-availability_completion-form/moodle-availability_completion-form-min.js +++ b/availability/condition/completion/yui/build/moodle-availability_completion-form/moodle-availability_completion-form-min.js @@ -1 +1 @@ -YUI.add("moodle-availability_completion-form",function(o,e){M.availability_completion=M.availability_completion||{},M.availability_completion.form=o.Object(M.core_availability.plugin),M.availability_completion.form.initInner=function(e){this.cms=e},M.availability_completion.form.getNode=function(e){var i,l,t,a=' '+M.util.get_string("title","availability_completion")+' ",t=o.Node.create(''+a+""),e.cm!==undefined&&t.one("select[name=cm] > option[value="+e.cm+"]")&&t.one("select[name=cm]").set("value",""+e.cm),e.e!==undefined&&t.one("select[name=e]").set("value",""+e.e),M.availability_completion.form.addedEvents||(M.availability_completion.form.addedEvents=!0,o.one(".availability-field").delegate("change",function(){M.core_availability.form.update()},".availability_completion select")),t},M.availability_completion.form.fillValue=function(e,i){e.cm=parseInt(i.one("select[name=cm]").get("value"),10),e.e=parseInt(i.one("select[name=e]").get("value"),10)},M.availability_completion.form.fillErrors=function(i,e){var l,t=parseInt(e.one("select[name=cm]").get("value"),10);0===t&&i.push("availability_completion:error_selectcmid"),2!==(l=parseInt(e.one("select[name=e]").get("value"),10))&&3!==l||this.cms.forEach(function(e){e.id===t&&null===e.completiongradeitemnumber&&i.push("availability_completion:error_selectcmidpassfail")})}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]}); \ No newline at end of file +YUI.add("moodle-availability_completion-form",function(o,e){M.availability_completion=M.availability_completion||{},M.availability_completion.form=o.Object(M.core_availability.plugin),M.availability_completion.form.initInner=function(e){this.cms=e},M.availability_completion.form.getNode=function(e){for(var i,l,t=' '+M.util.get_string("title","availability_completion")+' ",l=o.Node.create(''+t+""),e.cm!==undefined&&l.one("select[name=cm] > option[value="+e.cm+"]")&&l.one("select[name=cm]").set("value",""+e.cm),e.e!==undefined&&l.one("select[name=e]").set("value",""+e.e),M.availability_completion.form.addedEvents||(M.availability_completion.form.addedEvents=!0,o.one(".availability-field").delegate("change",function(){M.core_availability.form.update()},".availability_completion select")),l},M.availability_completion.form.fillValue=function(e,i){e.cm=parseInt(i.one("select[name=cm]").get("value"),10),e.e=parseInt(i.one("select[name=e]").get("value"),10)},M.availability_completion.form.fillErrors=function(i,e){var l=parseInt(e.one("select[name=cm]").get("value"),10);0===l&&i.push("availability_completion:error_selectcmid"),2!==(e=parseInt(e.one("select[name=e]").get("value"),10))&&3!==e||this.cms.forEach(function(e){e.id===l&&null===e.completiongradeitemnumber&&i.push("availability_completion:error_selectcmidpassfail")})}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]}); \ No newline at end of file diff --git a/availability/condition/date/yui/build/moodle-availability_date-form/moodle-availability_date-form-min.js b/availability/condition/date/yui/build/moodle-availability_date-form/moodle-availability_date-form-min.js index 42a4d651cab..f2fa1b3e1df 100644 --- a/availability/condition/date/yui/build/moodle-availability_date-form/moodle-availability_date-form-min.js +++ b/availability/condition/date/yui/build/moodle-availability_date-form/moodle-availability_date-form-min.js @@ -1 +1 @@ -YUI.add("moodle-availability_date-form",function(s,e){M.availability_date=M.availability_date||{},M.availability_date.form=s.Object(M.core_availability.plugin),M.availability_date.form.initInner=function(e,a){this.html=e,this.defaultTime=a},M.availability_date.form.getNode=function(e){var a,t,i,l,n=''+M.util.get_string("direction_before","availability_date")+' "+this.html,o=s.Node.create(""+n+"");return e.t!==undefined?(o.setData("time",e.t),o.all("select:not([name=direction])").each(function(e){e.set("disabled",!0)}),a=M.cfg.wwwroot+"/availability/condition/date/ajax.php?action=fromtime&time="+e.t,s.io(a,{on:{success:function(e,a){var t,i,l=s.JSON.parse(a.responseText);for(t in l)(i=o.one("select[name=x\\["+t+"\\]]")).set("value",""+l[t]),i.set("disabled",!1)},failure:function(){window.alert(M.util.get_string("ajaxerror","availability_date"))}}})):o.setData("time",this.defaultTime),e.d!==undefined&&o.one("select[name=direction]").set("value",e.d),M.availability_date.form.addedEvents||(M.availability_date.form.addedEvents=!0,(t=s.one(".availability-field")).delegate("change",function(){M.core_availability.form.update()},".availability_date select[name=direction]"),t.delegate("change",function(){M.availability_date.form.updateTime(this.ancestor("span.availability_date"))},".availability_date select:not([name=direction])")),o.one("a[href=#]")&&(M.form.dateselector.init_single_date_selector(o),i=o.one("select[name=x\\[year\\]]"),l=i.set,i.set=function(e,a){l.call(i,e,a),"selectedIndex"===e&&setTimeout(function(){M.availability_date.form.updateTime(o)},0)}),o},M.availability_date.form.updateTime=function(t){var e=M.cfg.wwwroot+"/availability/condition/date/ajax.php?action=totime&year="+t.one("select[name=x\\[year\\]]").get("value")+"&month="+t.one("select[name=x\\[month\\]]").get("value")+"&day="+t.one("select[name=x\\[day\\]]").get("value")+"&hour="+t.one("select[name=x\\[hour\\]]").get("value")+"&minute="+t.one("select[name=x\\[minute\\]]").get("value");s.io(e,{on:{success:function(e,a){t.setData("time",a.responseText),M.core_availability.form.update()},failure:function(){window.alert(M.util.get_string("ajaxerror","availability_date"))}}})},M.availability_date.form.fillValue=function(e,a){e.d=a.one("select[name=direction]").get("value"),e.t=parseInt(a.getData("time"),10)}},"@VERSION@",{requires:["base","node","event","io","moodle-core_availability-form"]}); \ No newline at end of file +YUI.add("moodle-availability_date-form",function(o,e){M.availability_date=M.availability_date||{},M.availability_date.form=o.Object(M.core_availability.plugin),M.availability_date.form.initInner=function(e,a){this.html=e,this.defaultTime=a},M.availability_date.form.getNode=function(e){var t,i,a=''+M.util.get_string("direction_before","availability_date")+' "+this.html,n=o.Node.create(""+a+"");return e.t!==undefined?(n.setData("time",e.t),n.all("select:not([name=direction])").each(function(e){e.set("disabled",!0)}),a=M.cfg.wwwroot+"/availability/condition/date/ajax.php?action=fromtime&time="+e.t,o.io(a,{on:{success:function(e,a){var t,i,l=o.JSON.parse(a.responseText);for(t in l)(i=n.one("select[name=x\\["+t+"\\]]")).set("value",""+l[t]),i.set("disabled",!1)},failure:function(){window.alert(M.util.get_string("ajaxerror","availability_date"))}}})):n.setData("time",this.defaultTime),e.d!==undefined&&n.one("select[name=direction]").set("value",e.d),M.availability_date.form.addedEvents||(M.availability_date.form.addedEvents=!0,(a=o.one(".availability-field")).delegate("change",function(){M.core_availability.form.update()},".availability_date select[name=direction]"),a.delegate("change",function(){M.availability_date.form.updateTime(this.ancestor("span.availability_date"))},".availability_date select:not([name=direction])")),n.one("a[href=#]")&&(M.form.dateselector.init_single_date_selector(n),t=n.one("select[name=x\\[year\\]]"),i=t.set,t.set=function(e,a){i.call(t,e,a),"selectedIndex"===e&&setTimeout(function(){M.availability_date.form.updateTime(n)},0)}),n},M.availability_date.form.updateTime=function(t){var e=M.cfg.wwwroot+"/availability/condition/date/ajax.php?action=totime&year="+t.one("select[name=x\\[year\\]]").get("value")+"&month="+t.one("select[name=x\\[month\\]]").get("value")+"&day="+t.one("select[name=x\\[day\\]]").get("value")+"&hour="+t.one("select[name=x\\[hour\\]]").get("value")+"&minute="+t.one("select[name=x\\[minute\\]]").get("value");o.io(e,{on:{success:function(e,a){t.setData("time",a.responseText),M.core_availability.form.update()},failure:function(){window.alert(M.util.get_string("ajaxerror","availability_date"))}}})},M.availability_date.form.fillValue=function(e,a){e.d=a.one("select[name=direction]").get("value"),e.t=parseInt(a.getData("time"),10)}},"@VERSION@",{requires:["base","node","event","io","moodle-core_availability-form"]}); \ No newline at end of file diff --git a/availability/condition/grade/yui/build/moodle-availability_grade-form/moodle-availability_grade-form-min.js b/availability/condition/grade/yui/build/moodle-availability_grade-form/moodle-availability_grade-form-min.js index 9f523aa6feb..c31899fb442 100644 --- a/availability/condition/grade/yui/build/moodle-availability_grade-form/moodle-availability_grade-form-min.js +++ b/availability/condition/grade/yui/build/moodle-availability_grade-form/moodle-availability_grade-form-min.js @@ -1 +1 @@ -YUI.add("moodle-availability_grade-form",function(o,a){M.availability_grade=M.availability_grade||{},M.availability_grade.form=o.Object(M.core_availability.plugin),M.availability_grade.form.grades=null,M.availability_grade.form.initInner=function(a){this.grades=a,this.nodesSoFar=0},M.availability_grade.form.getNode=function(a){var e,i,l,t,n,r;for(this.nodesSoFar++,e='
%
%',t=o.Node.create('
'+e+"
"),a.id!==undefined&&t.one("select[name=id] > option[value="+a.id+"]")&&t.one("select[name=id]").set("value",""+a.id),a.min!==undefined&&(t.one("input[name=min]").set("checked",!0),t.one("input[name=minval]").set("value",a.min)),a.max!==undefined&&(t.one("input[name=max]").set("checked",!0),t.one("input[name=maxval]").set("value",a.max)),n=function(a,e){var i=a.ancestor("label").next("label").one("input"),l=a.get("checked");return i.set("disabled",!l),e&&l&&i.focus(),l},t.all("input[type=checkbox]").each(n),M.availability_grade.form.addedEvents||(M.availability_grade.form.addedEvents=!0,(r=o.one(".availability-field")).delegate("change",function(){M.core_availability.form.update()},".availability_grade select[name=id]"),r.delegate("click",function(){n(this,!0),M.core_availability.form.update()},".availability_grade input[type=checkbox]"),r.delegate("valuechange",function(){M.core_availability.form.update()},".availability_grade input[type=text]")),t},M.availability_grade.form.fillValue=function(a,e){a.id=parseInt(e.one("select[name=id]").get("value"),10),e.one("input[name=min]").get("checked")&&(a.min=this.getValue("minval",e)),e.one("input[name=max]").get("checked")&&(a.max=this.getValue("maxval",e))},M.availability_grade.form.getValue=function(a,e){var i,l=e.one("input[name="+a+"]").get("value");return!/^[0-9]+([.,][0-9]+)?$/.test(l)||(i=parseFloat(l.replace(",",".")))<0||100
%
%',t=r.Node.create('
'+e+"
"),a.id!==undefined&&t.one("select[name=id] > option[value="+a.id+"]")&&t.one("select[name=id]").set("value",""+a.id),a.min!==undefined&&(t.one("input[name=min]").set("checked",!0),t.one("input[name=minval]").set("value",a.min)),a.max!==undefined&&(t.one("input[name=max]").set("checked",!0),t.one("input[name=maxval]").set("value",a.max)),n=function(a,e){var i=a.ancestor("label").next("label").one("input"),a=a.get("checked");return i.set("disabled",!a),e&&a&&i.focus(),a},t.all("input[type=checkbox]").each(n),M.availability_grade.form.addedEvents||(M.availability_grade.form.addedEvents=!0,(a=r.one(".availability-field")).delegate("change",function(){M.core_availability.form.update()},".availability_grade select[name=id]"),a.delegate("click",function(){n(this,!0),M.core_availability.form.update()},".availability_grade input[type=checkbox]"),a.delegate("valuechange",function(){M.core_availability.form.update()},".availability_grade input[type=text]")),t},M.availability_grade.form.fillValue=function(a,e){a.id=parseInt(e.one("select[name=id]").get("value"),10),e.one("input[name=min]").get("checked")&&(a.min=this.getValue("minval",e)),e.one("input[name=max]").get("checked")&&(a.max=this.getValue("maxval",e))},M.availability_grade.form.getValue=function(a,e){a=e.one("input[name="+a+"]").get("value");return!/^[0-9]+([.,][0-9]+)?$/.test(a)||(e=parseFloat(a.replace(",",".")))<0||100 ",l=t.Node.create(''+o+""),i.creating===undefined&&(i.id!==undefined&&l.one("select[name=id] > option[value="+i.id+"]")?l.one("select[name=id]").set("value",""+i.id):i.id===undefined&&l.one("select[name=id]").set("value","any")),M.availability_group.form.addedEvents||(M.availability_group.form.addedEvents=!0,t.one(".availability-field").delegate("change",function(){M.core_availability.form.update()},".availability_group select")),l},M.availability_group.form.fillValue=function(i,a){var e=a.one("select[name=id]").get("value");"choose"===e?i.id="choose":"any"!==e&&(i.id=parseInt(e,10))},M.availability_group.form.fillErrors=function(i,a){var e={};this.fillValue(e,a),e.id&&"choose"===e.id&&i.push("availability_group:error_selectgroup")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]}); \ No newline at end of file +YUI.add("moodle-availability_group-form",function(t,i){M.availability_group=M.availability_group||{},M.availability_group.form=t.Object(M.core_availability.plugin),M.availability_group.form.groups=null,M.availability_group.form.initInner=function(i){this.groups=i},M.availability_group.form.getNode=function(i){for(var a,e,l='")+""),i.creating===undefined&&(i.id!==undefined&&e.one("select[name=id] > option[value="+i.id+"]")?e.one("select[name=id]").set("value",""+i.id):i.id===undefined&&e.one("select[name=id]").set("value","any")),M.availability_group.form.addedEvents||(M.availability_group.form.addedEvents=!0,t.one(".availability-field").delegate("change",function(){M.core_availability.form.update()},".availability_group select")),e},M.availability_group.form.fillValue=function(i,a){a=a.one("select[name=id]").get("value");"choose"===a?i.id="choose":"any"!==a&&(i.id=parseInt(a,10))},M.availability_group.form.fillErrors=function(i,a){var e={};this.fillValue(e,a),e.id&&"choose"===e.id&&i.push("availability_group:error_selectgroup")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]}); \ No newline at end of file diff --git a/availability/condition/grouping/yui/build/moodle-availability_grouping-form/moodle-availability_grouping-form-min.js b/availability/condition/grouping/yui/build/moodle-availability_grouping-form/moodle-availability_grouping-form-min.js index 4430bd6dc8d..796e1ca7352 100644 --- a/availability/condition/grouping/yui/build/moodle-availability_grouping-form/moodle-availability_grouping-form-min.js +++ b/availability/condition/grouping/yui/build/moodle-availability_grouping-form/moodle-availability_grouping-form-min.js @@ -1 +1 @@ -YUI.add("moodle-availability_grouping-form",function(n,i){M.availability_grouping=M.availability_grouping||{},M.availability_grouping.form=n.Object(M.core_availability.plugin),M.availability_grouping.form.groupings=null,M.availability_grouping.form.initInner=function(i){this.groupings=i},M.availability_grouping.form.getNode=function(i){var a,e,l,o='",l=n.Node.create(''+o+""),i.id!==undefined&&l.one("select[name=id] > option[value="+i.id+"]")&&l.one("select[name=id]").set("value",""+i.id),M.availability_grouping.form.addedEvents||(M.availability_grouping.form.addedEvents=!0,n.one(".availability-field").delegate("change",function(){M.core_availability.form.update()},".availability_grouping select")),l},M.availability_grouping.form.fillValue=function(i,a){var e=a.one("select[name=id]").get("value");i.id="choose"===e?"choose":parseInt(e,10)},M.availability_grouping.form.fillErrors=function(i,a){var e={};this.fillValue(e,a),"choose"===e.id&&i.push("availability_grouping:error_selectgrouping")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]}); \ No newline at end of file +YUI.add("moodle-availability_grouping-form",function(n,i){M.availability_grouping=M.availability_grouping||{},M.availability_grouping.form=n.Object(M.core_availability.plugin),M.availability_grouping.form.groupings=null,M.availability_grouping.form.initInner=function(i){this.groupings=i},M.availability_grouping.form.getNode=function(i){for(var a,e,l='")+""),i.id!==undefined&&e.one("select[name=id] > option[value="+i.id+"]")&&e.one("select[name=id]").set("value",""+i.id),M.availability_grouping.form.addedEvents||(M.availability_grouping.form.addedEvents=!0,n.one(".availability-field").delegate("change",function(){M.core_availability.form.update()},".availability_grouping select")),e},M.availability_grouping.form.fillValue=function(i,a){a=a.one("select[name=id]").get("value");i.id="choose"===a?"choose":parseInt(a,10)},M.availability_grouping.form.fillErrors=function(i,a){var e={};this.fillValue(e,a),"choose"===e.id&&i.push("availability_grouping:error_selectgrouping")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]}); \ No newline at end of file diff --git a/availability/condition/profile/yui/build/moodle-availability_profile-form/moodle-availability_profile-form-min.js b/availability/condition/profile/yui/build/moodle-availability_profile-form/moodle-availability_profile-form-min.js index 945137ab227..158a6d4c128 100644 --- a/availability/condition/profile/yui/build/moodle-availability_profile-form/moodle-availability_profile-form-min.js +++ b/availability/condition/profile/yui/build/moodle-availability_profile-form/moodle-availability_profile-form-min.js @@ -1 +1 @@ -YUI.add("moodle-availability_profile-form",function(f,e){M.availability_profile=M.availability_profile||{},M.availability_profile.form=f.Object(M.core_availability.plugin),M.availability_profile.form.profiles=null,M.availability_profile.form.initInner=function(e,i){this.standardFields=e,this.customFields=i},M.availability_profile.form.getNode=function(e){var i,l,a,t,o,s,n=' ',t=f.Node.create(''+n+""),e.sf!==undefined&&t.one("select[name=field] > option[value=sf_"+e.sf+"]")?t.one("select[name=field]").set("value","sf_"+e.sf):e.cf!==undefined&&t.one("select[name=field] > option[value=cf_"+e.cf+"]")&&t.one("select[name=field]").set("value","cf_"+e.cf),e.op!==undefined&&t.one("select[name=op] > option[value="+e.op+"]")&&(t.one("select[name=op]").set("value",e.op),"isempty"!==e.op&&"isnotempty"!==e.op||t.one("input[name=value]").set("disabled",!0)),e.v!==undefined&&t.one("input").set("value",e.v),M.availability_profile.form.addedEvents||(M.availability_profile.form.addedEvents=!0,o=function(e){var i=e.ancestor("span.availability_profile"),l=i.one("select[name=op]"),a="isempty"===l.get("value")||"isnotempty"===l.get("value");i.one("input[name=value]").set("disabled",a),M.core_availability.form.update()},(s=f.one(".availability-field")).delegate("change",function(){o(this)},".availability_profile select"),s.delegate("change",function(){o(this)},".availability_profile input[name=value]")),t},M.availability_profile.form.fillValue=function(e,i){var l,a=i.one("select[name=field]").get("value");"sf_"===a.substr(0,3)?e.sf=a.substr(3):"cf_"===a.substr(0,3)&&(e.cf=a.substr(3)),e.op=i.one("select[name=op]").get("value"),(l=i.one("input[name=value]")).get("disabled")||(e.v=l.get("value"))},M.availability_profile.form.fillErrors=function(e,i){var l={};this.fillValue(l,i),l.sf===undefined&&l.cf===undefined&&e.push("availability_profile:error_selectfield"),l.v!==undefined&&/^\s*$/.test(l.v)&&e.push("availability_profile:error_setvalue")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]}); \ No newline at end of file +YUI.add("moodle-availability_profile-form",function(n,e){M.availability_profile=M.availability_profile||{},M.availability_profile.form=n.Object(M.core_availability.plugin),M.availability_profile.form.profiles=null,M.availability_profile.form.initInner=function(e,i){this.standardFields=e,this.customFields=i},M.availability_profile.form.getNode=function(e){for(var i,l,a,t,o=' ',a=n.Node.create(''+o+""),e.sf!==undefined&&a.one("select[name=field] > option[value=sf_"+e.sf+"]")?a.one("select[name=field]").set("value","sf_"+e.sf):e.cf!==undefined&&a.one("select[name=field] > option[value=cf_"+e.cf+"]")&&a.one("select[name=field]").set("value","cf_"+e.cf),e.op!==undefined&&a.one("select[name=op] > option[value="+e.op+"]")&&(a.one("select[name=op]").set("value",e.op),"isempty"!==e.op&&"isnotempty"!==e.op||a.one("input[name=value]").set("disabled",!0)),e.v!==undefined&&a.one("input").set("value",e.v),M.availability_profile.form.addedEvents||(M.availability_profile.form.addedEvents=!0,t=function(e){var e=e.ancestor("span.availability_profile"),i=e.one("select[name=op]"),i="isempty"===i.get("value")||"isnotempty"===i.get("value");e.one("input[name=value]").set("disabled",i),M.core_availability.form.update()},(e=n.one(".availability-field")).delegate("change",function(){t(this)},".availability_profile select"),e.delegate("change",function(){t(this)},".availability_profile input[name=value]")),a},M.availability_profile.form.fillValue=function(e,i){var l=i.one("select[name=field]").get("value");"sf_"===l.substr(0,3)?e.sf=l.substr(3):"cf_"===l.substr(0,3)&&(e.cf=l.substr(3)),e.op=i.one("select[name=op]").get("value"),(l=i.one("input[name=value]")).get("disabled")||(e.v=l.get("value"))},M.availability_profile.form.fillErrors=function(e,i){var l={};this.fillValue(l,i),l.sf===undefined&&l.cf===undefined&&e.push("availability_profile:error_selectfield"),l.v!==undefined&&/^\s*$/.test(l.v)&&e.push("availability_profile:error_setvalue")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]}); \ No newline at end of file diff --git a/availability/yui/build/moodle-core_availability-form/moodle-core_availability-form-min.js b/availability/yui/build/moodle-core_availability-form/moodle-core_availability-form-min.js index fc4f8d51d4a..e8f2ae55109 100644 --- a/availability/yui/build/moodle-core_availability-form/moodle-core_availability-form-min.js +++ b/availability/yui/build/moodle-core_availability-form/moodle-core_availability-form-min.js @@ -1,3 +1,3 @@ -YUI.add("moodle-core_availability-form",function(c,i){M.core_availability=M.core_availability||{},M.core_availability.form={plugins:{},field:null,mainDiv:null,rootList:null,idCounter:0,restrictByGroup:null,init:function(i){var t,e,a,l,n,o,s;for(t in i)e=i[t],(a=M[e[0]].form).init.apply(a,e);if(this.field=c.one("#id_availabilityconditionsjson"),this.field.setAttribute("aria-hidden","true"),this.mainDiv=c.Node.create(''),this.field.insert(this.mainDiv,"after"),n=null,""!==(l=this.field.get("value")))try{n=c.JSON.parse(l)}catch(r){this.field.set("value","")}this.rootList=new M.core_availability.List(n,!0),this.mainDiv.appendChild(this.rootList.node),this.update(),this.rootList.renumber(),this.mainDiv.setAttribute("aria-live","polite"),this.field.ancestor("form").on("submit",function(){this.mainDiv.all("input,textarea,select").set("disabled",!0)},this),this.restrictByGroup=c.one("#restrictbygroup"),this.restrictByGroup&&(this.restrictByGroup.on("click",this.addRestrictByGroup,this),o=c.one("#id_groupmode"),s=c.one("#id_groupingid"),o&&o.on("change",this.updateRestrictByGroup,this),s&&s.on("change",this.updateRestrictByGroup,this),this.updateRestrictByGroup())},update:function(){var i=this.rootList.getValue(),t=[];this.rootList.fillErrors(t),0!==t.length&&(i.errors=t),this.field.set("value",c.JSON.stringify(i)),this.updateRestrictByGroup()},updateRestrictByGroup:function(){var i,t,e,a;this.restrictByGroup&&("&"!==this.rootList.getValue().op||(this.rootList.hasItemOfType("group")||this.rootList.hasItemOfType("grouping"))?this.restrictByGroup.set("disabled",!0):(i=c.one("#id_groupmode"),t=c.one("#id_groupingid"),e=1===Number(this.restrictByGroup.getData("groupavailability")),a=1===Number(this.restrictByGroup.getData("groupingavailability")),i&&0!==Number(i.get("value"))&&e||t&&0!==Number(t.get("value"))&&a?this.restrictByGroup.set("disabled",!1):this.restrictByGroup.set("disabled",!0)))},addRestrictByGroup:function(i){var t,e,a,l,n;i.preventDefault(),t=c.one("#id_groupmode"),e=c.one("#id_groupingid"),a=1===Number(this.restrictByGroup.getData("groupavailability")),l=1===Number(this.restrictByGroup.getData("groupingavailability")),e&&0!==Number(e.get("value"))&&l?n=new M.core_availability.Item({type:"grouping",id:Number(e.get("value"))},!0):t&&a&&(n=new M.core_availability.Item({type:"group"},!0)),null!==n&&(this.rootList.addChild(n),this.update(),this.rootList.renumber(),this.rootList.updateHtml())}},M.core_availability.plugin={allowAdd:!1,init:function(i,t,e){var a=i.replace(/^availability_/,"");this.allowAdd=t,(M.core_availability.form.plugins[a]=this).initInner.apply(this,e)},initInner:function(){},getNode:function(){throw"getNode not implemented"},fillValue:function(){throw"fillValue not implemented"},fillErrors:function(){},focusAfterAdd:function(i){i.one("input:not([disabled]),select:not([disabled])").focus()}},M.core_availability.List=function(i,t,e){var a,l,n,o,s,r,d;if(this.children=[],t!==undefined&&(this.root=t),this.node=c.Node.create('

'+M.util.get_string("listheader_sign_before","availability")+' '+M.util.get_string("listheader_single","availability")+''+M.util.get_string("listheader_multi_before","availability")+' "+M.util.get_string("listheader_multi_after","availability")+'
'+M.util.get_string("none","moodle")+'
'),t||this.node.addClass("availability-childlist d-sm-flex align-items-center"),this.inner=this.node.one("> .availability-inner"),a=!0,t?(i&&i.show!==undefined&&(a=i.show),this.eyeIcon=new M.core_availability.EyeIcon(!1,a),this.node.one(".availability-header").get("firstChild").insert(this.eyeIcon.span,"before")):e&&(i&&i.showc!==undefined&&(a=i.showc),this.eyeIcon=new M.core_availability.EyeIcon(!1,a),this.inner.insert(this.eyeIcon.span,"before")),t||(l=new M.core_availability.DeleteIcon(this),(n=this.node.one(".availability-none")).appendChild(document.createTextNode(" ")),n.appendChild(l.span),n.appendChild(c.Node.create(''+M.util.get_string("invalid","availability")+""))),(o=c.Node.create('")).on("click",function(){this.clickAdd()},this),this.node.one("div.availability-button").appendChild(o),i){switch(i.op){case"&":case"|":this.node.one(".availability-neg").set("value","");break;case"!&":case"!|":this.node.one(".availability-neg").set("value","!")}switch(i.op){case"&":case"!&":this.node.one(".availability-op").set("value","&");break;case"|":case"!|":this.node.one(".availability-op").set("value","|")}for(s=0;s
')),this.children.push(i),this.inner.one(".availability-children").appendChild(i.node)},M.core_availability.List.prototype.focusAfterAdd=function(){this.inner.one("button").focus()},M.core_availability.List.prototype.isIndividualShowIcons=function(){var i,t;if(!this.root)throw"Can only call this on root list";return i="!"===this.node.one(".availability-neg").get("value"),t="|"===this.node.one(".availability-op").get("value"),!i&&!t||i&&t},M.core_availability.List.prototype.renumber=function(i){var t,e,a,l={count:this.children.length};for(t=i===undefined?l.number="":(l.number=i+":",i+"."),e=M.util.get_string("setheading","availability",l),this.node.one("> h3").set("innerHTML",e),a=0;a .availability-children").removeAttribute("aria-hidden"),this.inner.one("> .availability-none").setAttribute("aria-hidden","true"),this.inner.one("> .availability-header").removeAttribute("aria-hidden"),1 .availability-children").setAttribute("aria-hidden","true"),this.inner.one("> .availability-none").removeAttribute("aria-hidden"),this.inner.one("> .availability-header").setAttribute("aria-hidden","true")),this.root){for(i=this.isIndividualShowIcons(),t=0;t .availability-children > .availability-connector span.label").each(function(i){i.set("innerHTML",a)})},M.core_availability.List.prototype.deleteDescendant=function(i){var t,e,a;for(t=0;t .availability-children").removeChild(a),M.core_availability.form.update(),this.updateHtml(),this.inner.one("> .availability-button").one("button").focus(),!0;if(e instanceof M.core_availability.List&&e.deleteDescendant(i))return!0}return!1},M.core_availability.List.prototype.clickAdd=function(){var i,t,e,a,l,n,o=c.Node.create('
    "),s=o.one("button"),r={dialog:null},d=o.one("ul");for(l in M.core_availability.form.plugins)M.core_availability.form.plugins[l].allowAdd&&(i=c.Node.create('
  • '),t="availability_addrestriction_"+l,(e=c.Node.create('
    ")).on("click",this.getAddHandler(l,r),this),i.appendChild(e),a=c.Node.create('
    "),i.appendChild(a),d.appendChild(i));i=c.Node.create('
  • '),t="availability_addrestriction_list_",(e=c.Node.create('
    ")).on("click",this.getAddHandler(null,r),this),i.appendChild(e),a=c.Node.create('
    "),i.appendChild(a),d.appendChild(i),n={headerContent:M.util.get_string("addrestriction","availability"),bodyContent:o,additionalBaseClass:"availability-dialogue",draggable:!0,modal:!0,closeButton:!1,width:"450px"},r.dialog=new M.core.dialogue(n),r.dialog.show(),s.on("click",function(){r.dialog.destroy(),this.inner.one("> .availability-button").one("button").focus()},this)},M.core_availability.List.prototype.getAddHandler=function(t,e){return function(){var i;i=t?new M.core_availability.Item({type:t,creating:!0},this.root):new M.core_availability.List({c:[],showc:!0},!1,this.root),this.addChild(i),M.core_availability.form.update(),M.core_availability.form.rootList.renumber(),this.updateHtml(),e.dialog.destroy(),i.focusAfterAdd()}},M.core_availability.List.prototype.getValue=function(){var i,t={};for(t.op=this.node.one(".availability-neg").get("value")+this.node.one(".availability-op").get("value"),t.c=[],i=0;i'+M.util.get_string("missingplugin","availability")+"
    ")):(this.plugin=M.core_availability.form.plugins[i.type],this.pluginNode=this.plugin.getNode(i),this.pluginNode.addClass("availability_"+i.type)),this.node=c.Node.create('

    '),t&&(e=!0,i.showc!==undefined&&(e=i.showc),this.eyeIcon=new M.core_availability.EyeIcon(!0,e),this.node.appendChild(this.eyeIcon.span)),this.pluginNode.addClass("availability-plugincontrols"),this.node.appendChild(this.pluginNode),a=new M.core_availability.DeleteIcon(this),this.node.appendChild(a.span),this.node.appendChild(document.createTextNode(" ")),this.node.appendChild(c.Node.create(''))},M.core_availability.Item.prototype.getValue=function(){var i={type:this.pluginType};return this.plugin&&this.plugin.fillValue(i,this.pluginNode),i},M.core_availability.Item.prototype.fillErrors=function(i){var t,e=i.length;this.plugin?this.plugin.fillErrors(i,this.pluginNode):i.push("core_availability:item_unknowntype"),t=this.node.one("> .badge-warning"),i.length===e||t.get("firstChild")?i.length===e&&t.get("firstChild")&&t.get("firstChild").remove():t.appendChild(document.createTextNode(M.util.get_string("invalid","availability")))},M.core_availability.Item.prototype.renumber=function(i){var t,e={number:i};this.plugin?e.type=M.util.get_string("title","availability_"+this.pluginType):e.type="["+this.pluginType+"]",e.number=i+":",t=M.util.get_string("itemheading","availability",e),this.node.one("> h3").set("innerHTML",t)},M.core_availability.Item.prototype.focusAfterAdd=function(){this.plugin.focusAfterAdd(this.pluginNode)},M.core_availability.Item.prototype.pluginType=null,M.core_availability.Item.prototype.plugin=null,M.core_availability.Item.prototype.eyeIcon=null,M.core_availability.Item.prototype.node=null,M.core_availability.Item.prototype.pluginNode=null,M.core_availability.EyeIcon=function(i,t){var e,a,l,n,o;this.individual=i,this.span=c.Node.create(''),e=c.Node.create(""),this.span.appendChild(e),a=i?"_individual":"_all",l=function(){var i=M.util.get_string("hidden"+a,"availability");e.set("src",M.util.image_url("i/show","core")),e.set("alt",i),this.span.set("title",i+" • "+M.util.get_string("show_verb","availability"))},n=function(){var i=M.util.get_string("shown"+a,"availability");e.set("src",M.util.image_url("i/hide","core")),e.set("alt",i),this.span.set("title",i+" • "+M.util.get_string("hide_verb","availability"))},t?n.call(this):l.call(this),o=function(i){i.preventDefault(),this.isHidden()?n.call(this):l.call(this),M.core_availability.form.update()},this.span.on("click",o,this),this.span.on("key",o,"up:32",this),this.span.on("key",function(i){i.preventDefault()},"down:32",this)},M.core_availability.EyeIcon.prototype.individual=!1,M.core_availability.EyeIcon.prototype.span=null,M.core_availability.EyeIcon.prototype.isHidden=function(){var i=this.individual?"_individual":"_all",t=M.util.get_string("hidden"+i,"availability");return this.span.one("img").get("alt")===t},M.core_availability.DeleteIcon=function(t){var i,e;this.span=c.Node.create(''),i=c.Node.create(''+M.util.get_string('),this.span.appendChild(i),e=function(i){i.preventDefault(),M.core_availability.form.rootList.deleteDescendant(t),M.core_availability.form.rootList.renumber()},this.span.on("click",e,this),this.span.on("key",e,"up:32",this),this.span.on("key",function(i){i.preventDefault()},"down:32",this)},M.core_availability.DeleteIcon.prototype.span=null},"@VERSION@",{requires:["base","node","event","event-delegate","panel","moodle-core-notification-dialogue","json"]}); \ No newline at end of file +YUI.add("moodle-core_availability-form",function(d,i){M.core_availability=M.core_availability||{},M.core_availability.form={plugins:{},field:null,mainDiv:null,rootList:null,idCounter:0,restrictByGroup:null,init:function(i){var t,e,a,l,n;for(t in i)e=i[t],(a=M[e[0]].form).init.apply(a,e);if(this.field=d.one("#id_availabilityconditionsjson"),this.field.setAttribute("aria-hidden","true"),this.mainDiv=d.Node.create(''),this.field.insert(this.mainDiv,"after"),n=null,""!==(l=this.field.get("value")))try{n=d.JSON.parse(l)}catch(o){this.field.set("value","")}this.rootList=new M.core_availability.List(n,!0),this.mainDiv.appendChild(this.rootList.node),this.update(),this.rootList.renumber(),this.mainDiv.setAttribute("aria-live","polite"),this.field.ancestor("form").on("submit",function(){this.mainDiv.all("input,textarea,select").set("disabled",!0)},this),this.restrictByGroup=d.one("#restrictbygroup"),this.restrictByGroup&&(this.restrictByGroup.on("click",this.addRestrictByGroup,this),l=d.one("#id_groupmode"),n=d.one("#id_groupingid"),l&&l.on("change",this.updateRestrictByGroup,this),n&&n.on("change",this.updateRestrictByGroup,this),this.updateRestrictByGroup())},update:function(){var i=this.rootList.getValue(),t=[];this.rootList.fillErrors(t),0!==t.length&&(i.errors=t),this.field.set("value",d.JSON.stringify(i)),this.updateRestrictByGroup()},updateRestrictByGroup:function(){var i,t,e,a;this.restrictByGroup&&("&"!==this.rootList.getValue().op||(this.rootList.hasItemOfType("group")||this.rootList.hasItemOfType("grouping"))?this.restrictByGroup.set("disabled",!0):(i=d.one("#id_groupmode"),t=d.one("#id_groupingid"),e=1===Number(this.restrictByGroup.getData("groupavailability")),a=1===Number(this.restrictByGroup.getData("groupingavailability")),i&&0!==Number(i.get("value"))&&e||t&&0!==Number(t.get("value"))&&a?this.restrictByGroup.set("disabled",!1):this.restrictByGroup.set("disabled",!0)))},addRestrictByGroup:function(i){var t,e,a,l;i.preventDefault(),i=d.one("#id_groupmode"),t=d.one("#id_groupingid"),e=1===Number(this.restrictByGroup.getData("groupavailability")),a=1===Number(this.restrictByGroup.getData("groupingavailability")),t&&0!==Number(t.get("value"))&&a?l=new M.core_availability.Item({type:"grouping",id:Number(t.get("value"))},!0):i&&e&&(l=new M.core_availability.Item({type:"group"},!0)),null!==l&&(this.rootList.addChild(l),this.update(),this.rootList.renumber(),this.rootList.updateHtml())}},M.core_availability.plugin={allowAdd:!1,init:function(i,t,e){i=i.replace(/^availability_/,"");this.allowAdd=t,(M.core_availability.form.plugins[i]=this).initInner.apply(this,e)},initInner:function(){},getNode:function(){throw"getNode not implemented"},fillValue:function(){throw"fillValue not implemented"},fillErrors:function(){},focusAfterAdd:function(i){i.one("input:not([disabled]),select:not([disabled])").focus()}},M.core_availability.List=function(i,t,e){var a,l,n;if(this.children=[],t!==undefined&&(this.root=t),this.node=d.Node.create('

    '+M.util.get_string("listheader_sign_before","availability")+' '+M.util.get_string("listheader_single","availability")+''+M.util.get_string("listheader_multi_before","availability")+' "+M.util.get_string("listheader_multi_after","availability")+'
    '+M.util.get_string("none","moodle")+'
    '),t||this.node.addClass("availability-childlist d-sm-flex align-items-center"),this.inner=this.node.one("> .availability-inner"),a=!0,t?(i&&i.show!==undefined&&(a=i.show),this.eyeIcon=new M.core_availability.EyeIcon(!1,a),this.node.one(".availability-header").get("firstChild").insert(this.eyeIcon.span,"before")):e&&(i&&i.showc!==undefined&&(a=i.showc),this.eyeIcon=new M.core_availability.EyeIcon(!1,a),this.inner.insert(this.eyeIcon.span,"before")),t||(e=new M.core_availability.DeleteIcon(this),(a=this.node.one(".availability-none")).appendChild(document.createTextNode(" ")),a.appendChild(e.span),a.appendChild(d.Node.create(''+M.util.get_string("invalid","availability")+""))),(t=d.Node.create('")).on("click",function(){this.clickAdd()},this),this.node.one("div.availability-button").appendChild(t),i){switch(i.op){case"&":case"|":this.node.one(".availability-neg").set("value","");break;case"!&":case"!|":this.node.one(".availability-neg").set("value","!")}switch(i.op){case"&":case"!&":this.node.one(".availability-op").set("value","&");break;case"|":case"!|":this.node.one(".availability-op").set("value","|")}for(l=0;l')),this.children.push(i),this.inner.one(".availability-children").appendChild(i.node)},M.core_availability.List.prototype.focusAfterAdd=function(){this.inner.one("button").focus()},M.core_availability.List.prototype.isIndividualShowIcons=function(){var i,t;if(!this.root)throw"Can only call this on root list";return i="!"===this.node.one(".availability-neg").get("value"),t="|"===this.node.one(".availability-op").get("value"),!i&&!t||i&&t},M.core_availability.List.prototype.renumber=function(i){var t,e={count:this.children.length},a=i===undefined?e.number="":(e.number=i+":",i+"."),i=M.util.get_string("setheading","availability",e);for(this.node.one("> h3").set("innerHTML",i),t=0;t .availability-children").removeAttribute("aria-hidden"),this.inner.one("> .availability-none").setAttribute("aria-hidden","true"),this.inner.one("> .availability-header").removeAttribute("aria-hidden"),1 .availability-children").setAttribute("aria-hidden","true"),this.inner.one("> .availability-none").removeAttribute("aria-hidden"),this.inner.one("> .availability-header").setAttribute("aria-hidden","true")),this.root){for(i=this.isIndividualShowIcons(),t=0;t .availability-children > .availability-connector span.label").each(function(i){i.set("innerHTML",a)})},M.core_availability.List.prototype.deleteDescendant=function(i){for(var t,e,a=0;a .availability-children").removeChild(e),M.core_availability.form.update(),this.updateHtml(),this.inner.one("> .availability-button").one("button").focus(),!0;if(t instanceof M.core_availability.List&&t.deleteDescendant(i))return!0}return!1},M.core_availability.List.prototype.clickAdd=function(){var i,t,e,a,l,n=d.Node.create('
      "),o=n.one("button"),s={dialog:null},r=n.one("ul");for(l in M.core_availability.form.plugins)M.core_availability.form.plugins[l].allowAdd&&(i=d.Node.create('
    • '),(e=d.Node.create('
      ")).on("click",this.getAddHandler(l,s),this),i.appendChild(e),a=d.Node.create('
      "),i.appendChild(a),r.appendChild(i));i=d.Node.create('
    • '),(e=d.Node.create('
      ")).on("click",this.getAddHandler(null,s),this),i.appendChild(e),a=d.Node.create('
      "),i.appendChild(a),r.appendChild(i),n={headerContent:M.util.get_string("addrestriction","availability"),bodyContent:n,additionalBaseClass:"availability-dialogue",draggable:!0,modal:!0,closeButton:!1,width:"450px"},s.dialog=new M.core.dialogue(n),s.dialog.show(),o.on("click",function(){s.dialog.destroy(),this.inner.one("> .availability-button").one("button").focus()},this)},M.core_availability.List.prototype.getAddHandler=function(t,e){return function(){var i=t?new M.core_availability.Item({type:t,creating:!0},this.root):new M.core_availability.List({c:[],showc:!0},!1,this.root);this.addChild(i),M.core_availability.form.update(),M.core_availability.form.rootList.renumber(),this.updateHtml(),e.dialog.destroy(),i.focusAfterAdd()}},M.core_availability.List.prototype.getValue=function(){var i,t={};for(t.op=this.node.one(".availability-neg").get("value")+this.node.one(".availability-op").get("value"),t.c=[],i=0;i'+M.util.get_string("missingplugin","availability")+"")):(this.plugin=M.core_availability.form.plugins[i.type],this.pluginNode=this.plugin.getNode(i),this.pluginNode.addClass("availability_"+i.type)),this.node=d.Node.create('

      '),t&&(t=!0,i.showc!==undefined&&(t=i.showc),this.eyeIcon=new M.core_availability.EyeIcon(!0,t),this.node.appendChild(this.eyeIcon.span)),this.pluginNode.addClass("availability-plugincontrols"),this.node.appendChild(this.pluginNode),i=new M.core_availability.DeleteIcon(this),this.node.appendChild(i.span),this.node.appendChild(document.createTextNode(" ")),this.node.appendChild(d.Node.create(''))},M.core_availability.Item.prototype.getValue=function(){var i={type:this.pluginType};return this.plugin&&this.plugin.fillValue(i,this.pluginNode),i},M.core_availability.Item.prototype.fillErrors=function(i){var t,e=i.length;this.plugin?this.plugin.fillErrors(i,this.pluginNode):i.push("core_availability:item_unknowntype"),t=this.node.one("> .badge-warning"),i.length===e||t.get("firstChild")?i.length===e&&t.get("firstChild")&&t.get("firstChild").remove():t.appendChild(document.createTextNode(M.util.get_string("invalid","availability")))},M.core_availability.Item.prototype.renumber=function(i){var t={number:i};this.plugin?t.type=M.util.get_string("title","availability_"+this.pluginType):t.type="["+this.pluginType+"]",t.number=i+":",i=M.util.get_string("itemheading","availability",t),this.node.one("> h3").set("innerHTML",i)},M.core_availability.Item.prototype.focusAfterAdd=function(){this.plugin.focusAfterAdd(this.pluginNode)},M.core_availability.Item.prototype.pluginType=null,M.core_availability.Item.prototype.plugin=null,M.core_availability.Item.prototype.eyeIcon=null,M.core_availability.Item.prototype.node=null,M.core_availability.Item.prototype.pluginNode=null,M.core_availability.EyeIcon=function(i,t){var e,a,l,n;this.individual=i,this.span=d.Node.create('
      '),e=d.Node.create(""),this.span.appendChild(e),a=i?"_individual":"_all",l=function(){var i=M.util.get_string("hidden"+a,"availability");e.set("src",M.util.image_url("i/show","core")),e.set("alt",i),this.span.set("title",i+" • "+M.util.get_string("show_verb","availability"))},n=function(){var i=M.util.get_string("shown"+a,"availability");e.set("src",M.util.image_url("i/hide","core")),e.set("alt",i),this.span.set("title",i+" • "+M.util.get_string("hide_verb","availability"))},(t?n:l).call(this),this.span.on("click",i=function(i){i.preventDefault(),(this.isHidden()?n:l).call(this),M.core_availability.form.update()},this),this.span.on("key",i,"up:32",this),this.span.on("key",function(i){i.preventDefault()},"down:32",this)},M.core_availability.EyeIcon.prototype.individual=!1,M.core_availability.EyeIcon.prototype.span=null,M.core_availability.EyeIcon.prototype.isHidden=function(){var i=this.individual?"_individual":"_all",i=M.util.get_string("hidden"+i,"availability");return this.span.one("img").get("alt")===i},M.core_availability.DeleteIcon=function(t){var i;this.span=d.Node.create(''),i=d.Node.create(''+M.util.get_string('),this.span.appendChild(i),this.span.on("click",i=function(i){i.preventDefault(),M.core_availability.form.rootList.deleteDescendant(t),M.core_availability.form.rootList.renumber()},this),this.span.on("key",i,"up:32",this),this.span.on("key",function(i){i.preventDefault()},"down:32",this)},M.core_availability.DeleteIcon.prototype.span=null},"@VERSION@",{requires:["base","node","event","event-delegate","panel","moodle-core-notification-dialogue","json"]}); \ No newline at end of file diff --git a/backup/util/ui/amd/build/async_backup.min.js b/backup/util/ui/amd/build/async_backup.min.js index 1511c10a96d..ffba1a925e1 100644 --- a/backup/util/ui/amd/build/async_backup.min.js +++ b/backup/util/ui/amd/build/async_backup.min.js @@ -1,2 +1,2 @@ -define ("core_backup/async_backup",["jquery","core/ajax","core/str","core/notification","core/templates"],function(a,b,c,d,e){var q=900,r=1e3,s={},t=15e3,u=15e3,v=1.5,w,x,y,z,A,B,C,D=2e3;function f(a,b,c){var d=Math.round(c)+"%",e=document.querySelectorAll("[data-"+b+"id="+CSS.escape(a)+"]")[0],f=c.toFixed(2)+"%";e.setAttribute("aria-valuenow",d);e.style.width=d;e.innerHTML=f}function g(a,b,c){clearInterval(a);return setInterval(b,c)}function h(c){var f=a("#"+c+"_bar").parent().parent(),g=f.parent(),h=f.siblings(),i=h[1],j=a(i).text(),k=h[0],l=a(k).text();b.call([{methodname:"core_backup_get_async_backup_links_backup",args:{filename:l,contextid:x}}])[0].done(function(a){var b={filename:l,time:j,size:a.filesize,fileurl:a.fileurl,restoreurl:a.restoreurl};e.render("core/async_backup_progress_row",b).then(function(a,b){e.replaceNodeContents(g,a,b)}).fail(function(){d.exception(new Error("Failed to load table row"))})})}function i(c){var f=a("#"+c+"_bar").parent().parent(),g=f.parent(),h=f.siblings(),i=h[0],j=h[1],k=a(j).text();b.call([{methodname:"core_backup_get_async_backup_links_restore",args:{backupid:c,contextid:x}}])[0].done(function(b){var c=a(i).text(),f={resourcename:c,restoreurl:b.restoreurl,time:k};e.render("core/async_restore_progress_row",f).then(function(a,b){e.replaceNodeContents(g,a,b)}).fail(function(){d.exception(new Error("Failed to load table row"))})})}function j(a){var f=document.querySelectorAll("[data-restoreid="+CSS.escape(a)+"]")[0],g=f.closest("tr").children[1],h=g.innerHTML,i=document.createElement("a"),j=f.closest("td"),k=j.previousElementSibling;c.get_string("complete").then(function(a){k.innerHTML=a}).catch(function(){d.exception(new Error("Failed to load string: complete"))});e.render("core/async_copy_complete_cell",{}).then(function(a,b){e.replaceNodeContents(j,a,b)}).fail(function(){d.exception(new Error("Failed to load table cell"))});b.call([{methodname:"core_backup_get_async_backup_links_restore",args:{backupid:a,contextid:0}}])[0].done(function(a){i.setAttribute("href",a.restoreurl);i.innerHTML=h;g.innerHTML=null;g.appendChild(i)}).fail(function(){d.exception(new Error("Failed to update table row"))})}function k(e){var g=100*e.progress,h="backup",i=document.querySelectorAll("[data-"+h+"id="+CSS.escape(w)+"]")[0],j=a("#"+w+"_status"),k=a("#"+w+"_detail"),l=a("#"+w+"_button"),m;if(e.status==800){i.classList.add("bg-success");f(w,h,g);var n="async"+z+"processing";c.get_string(n,"backup").then(function(a){j.text(a)}).catch(function(){d.exception(new Error("Failed to load string: backup "+n))})}else if(e.status==q){i.classList.add("bg-danger");i.classList.remove("bg-success");f(w,h,100);var o="async"+z+"error",p="async"+z+"errordetail";m=[{key:o,component:"backup"},{key:p,component:"backup"}];c.get_strings(m).then(function(a){j.text(a[0]);k.text(a[1])}).catch(function(){d.exception(new Error("Failed to load string"))});a(".backup_progress").children("span").removeClass("backup_stage_current");a(".backup_progress").children("span").last().addClass("backup_stage_current");clearInterval(A)}else if(e.status==r){i.classList.add("bg-success");f(w,h,100);var s="async"+z+"complete";c.get_string(s,"backup").then(function(a){j.text(a)}).catch(function(){d.exception(new Error("Failed to load string: backup "+s))});if("restore"==z){b.call([{methodname:"core_backup_get_async_backup_links_restore",args:{backupid:w,contextid:x}}])[0].done(function(a){var b="async"+z+"completedetail",e="async"+z+"completebutton",f=[{key:b,component:"backup",param:a.restoreurl},{key:e,component:"backup"}];c.get_strings(f).then(function(b){k.html(b[0]);l.text(b[1]);l.attr("href",a.restoreurl)}).catch(function(){d.exception(new Error("Failed to load string"))})})}else{var t="async"+z+"completedetail",u="async"+z+"completebutton";m=[{key:t,component:"backup",param:y},{key:u,component:"backup"}];c.get_strings(m).then(function(a){k.html(a[0]);l.text(a[1]);l.attr("href",y)}).catch(function(){d.exception(new Error("Failed to load string"))})}a(".backup_progress").children("span").removeClass("backup_stage_current");a(".backup_progress").children("span").last().addClass("backup_stage_current");clearInterval(A)}}function l(a){a.forEach(function(a){var b=100*a.progress,c=a.backupid,d=a.operation,e=document.querySelectorAll("[data-"+d+"id="+CSS.escape(c)+"]")[0];if(a.status==800){e.classList.add("bg-success");f(c,d,b)}else if(a.status==q){e.classList.add("bg-danger");e.classList.add("complete");e.classList.remove("bg-success");f(c,d,100)}else if(a.status==r){e.classList.add("bg-success");e.classList.add("complete");f(c,d,100);if("backup"==d){h(c)}else{i(c)}}})}function m(a){a.forEach(function(a){var b=100*a.progress,e=a.backupid,g=a.operation,h=document.querySelectorAll("[data-"+g+"id="+CSS.escape(e)+"]")[0];if("restore"==g){var i=h.closest("tr").children[3];c.get_string("restore").then(function(a){i.innerHTML=a}).catch(function(){d.exception(new Error("Failed to load string: restore"))})}if(a.status==800){h.classList.add("bg-success");f(e,g,b)}else if(a.status==q){h.classList.add("bg-danger");h.classList.add("complete");h.classList.remove("bg-success");f(e,g,100)}else if(a.status==r&&"restore"==g){h.classList.add("bg-success");h.classList.add("complete");f(e,g,100);j(e)}})}function n(){b.call([{methodname:"core_backup_get_async_backup_progress",args:{backupids:[w],contextid:x}}],!0,!0,!1,D)[0].done(function(a){k(a[0]);u=t;A=g(A,n,t)}).fail(function(){u=u*v;A=g(A,n,u)})}function o(){var c=[],d=a(".progress").find(".progress-bar").not(".complete");d.each(function(){c.push(this.id.substring(0,32))});if(0"},p=g.one("fieldset#id_coursesettings .fcontainer.clearfix .grouped_settings.section_level");if(p&&p.one('input[type="checkbox"]')){for(l in s=p.ancestor("form").getAttribute("id"),t=!1,g.all('input[type="checkbox"]').each(function(e){var n=e.get("name");"_userdata"===n.substring(n.length-9)?t="_userdata":"_userinfo"===n.substring(n.length-9)&&(t="_userinfo")}),n=r("include_setting section_level","included",M.util.get_string("select","moodle"),' ('+M.util.get_string("showtypes","backup")+")"),t&&(n+=r("normal_setting","userdata",M.util.get_string("select","moodle"))),i=g.Node.create('
      '+n+"
      "),p.insert(i,"before"),c=function(e,n){g.one("#backup-all-mod_"+n).on("click",function(e){d(e,!0,"_included",n)}),g.one("#backup-none-mod_"+n).on("click",function(e){d(e,!1,"_included",n)}),t&&(g.one("#backup-all-userdata-mod_"+n).on("click",function(e){d(e,!0,t,n)}),g.one("#backup-none-userdata-mod_"+n).on("click",function(e){d(e,!1,t,n)}))},(o=g.Node.create('
      ";var l=t.childNodes[0],s=t.childNodes[1];t._reset=function(){l.scrollLeft=o;l.scrollTop=o;s.scrollLeft=o;s.scrollTop=o};var d=function(){t._reset();e()};p(l,"scroll",d.bind(l,"expand"));p(s,"scroll",d.bind(s,"shrink"));return t}function v(e,t){var i=e[o]||(e[o]={}),d=i.renderProxy=function(a){if(a.animationName===l){t()}};a.each(s,function(t){p(e,t,d)});e.classList.add(n)}function S(e){var t=e[o]||{},i=t.renderProxy;if(i){a.each(s,function(t){f(e,t,i)});delete t.renderProxy}e.classList.remove(n)}function w(e,t,a){var i=e[o]||(e[o]={}),n=i.resizer=_(k(function(){if(i.resizer){return t(y("resize",a))}}));v(e,function(){if(i.resizer){var t=e.parentNode;if(t&&t!==n.parentNode){t.insertBefore(n,t.firstChild)}n._reset()}})}function D(e){var t=e[o]||{},a=t.resizer;delete t.resizer;S(e);if(a&&a.parentNode){a.parentNode.removeChild(a)}}function C(e,t){var a=e._style||document.createElement("style");if(!e._style){e._style=a;t="/* Chart.js */\n"+t;a.setAttribute("type","text/css");document.getElementsByTagName("head")[0].appendChild(a)}a.appendChild(document.createTextNode(t))}t.exports={_enabled:"undefined"!=typeof window&&"undefined"!=typeof document,initialize:function initialize(){C(this,"@-webkit-keyframes "+l+"{"+"from{opacity:0.99}to{opacity:1}"+"}@keyframes "+l+"{"+"from{opacity:0.99}to{opacity:1}"+"}."+n+"{-webkit-animation:"+l+" 0.001s;animation:"+l+" 0.001s;}")},acquireContext:function acquireContext(e,t){if("string"==typeof e){e=document.getElementById(e)}else if(e.length){e=e[0]}if(e&&e.canvas){e=e.canvas}var a=e&&e.getContext&&e.getContext("2d");if(a&&a.canvas===e){h(e,t);return a}return null},releaseContext:function releaseContext(e){var t=e.canvas;if(!t[o]){return}var i=t[o].initial;["height","width"].forEach(function(e){var o=i[e];if(a.isNullOrUndef(o)){t.removeAttribute(e)}else{t.setAttribute(e,o)}});a.each(i.style||{},function(e,a){t.style[a]=e});t.width=t.width;delete t[o]},addEventListener:function addEventListener(e,t,a){var i=e.canvas;if("resize"===t){w(i,a,e);return}var n=a[o]||(a[o]={}),l=n.proxies||(n.proxies={}),s=l[e.id+"_"+t]=function(t){a(x(t,e))};p(i,t,s)},removeEventListener:function removeEventListener(e,t,a){var i=e.canvas;if("resize"===t){D(i,a);return}var n=a[o]||{},l=n.proxies||{},s=l[e.id+"_"+t];if(!s){return}f(i,t,s)}};a.addEvent=p;a.removeEvent=f},{45:45}],48:[function(e,t){"use strict";var a=e(45),o=e(46),i=e(47),n=i._enabled?i:o;t.exports=a.extend({initialize:function initialize(){},acquireContext:function acquireContext(){},releaseContext:function releaseContext(){},addEventListener:function addEventListener(){},removeEventListener:function removeEventListener(){}},n)},{45:45,46:46,47:47}],49:[function(e,t){"use strict";var a=e(25),o=e(40),n=e(45);a._set("global",{plugins:{filler:{propagate:!0}}});t.exports=function(){var e={dataset:function dataset(e){var t=e.fill,a=e.chart,o=a.getDatasetMeta(t),i=o&&a.isDatasetVisible(t),n=i&&o.dataset._children||[],l=n.length||0;return!l?null:function(e,t){return tn||n>=a){return!1}return n}switch(i){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return i;default:return!1;}}function l(e){var t=e.el._model||{},a=e.el._scale||{},o=e.fill,i=null,n;if(isFinite(o)){return null}if("start"===o){i=t.scaleBottom===void 0?a.bottom:t.scaleBottom}else if("end"===o){i=t.scaleTop===void 0?a.top:t.scaleTop}else if(t.scaleZero!==void 0){i=t.scaleZero}else if(a.getBasePosition){i=a.getBasePosition()}else if(a.getBasePixel){i=a.getBasePixel()}if(i!==void 0&&null!==i){if(i.x!==void 0&&i.y!==void 0){return i}if("number"==typeof i&&isFinite(i)){n=a.isHorizontal();return{x:n?i:null,y:n?null:i}}}return null}function s(e,t,a){var o=e[t],i=o.fill,n=[t],l;if(!a){return i}while(!1!==i&&-1===n.indexOf(i)){if(!isFinite(i)){return i}l=e[i];if(!l){return!1}if(l.visible){return i}n.push(i);i=l.fill}return!1}function d(t){var a=t.fill,o="dataset";if(!1===a){return null}if(!isFinite(a)){o="boundary"}return e[o](t)}function c(e){return e&&!e.skip}function h(e,t,a,o,l){var s;if(!o||!l){return}e.moveTo(t[0].x,t[0].y);for(s=1;s"],a=0;a");if(e.data.datasets[a].label){t.push(e.data.datasets[a].label)}t.push("")}t.push("");return t.join("")}});t.exports=function(e){var t=e.layoutService,i=n.noop;function l(e,t){return e.usePointStyle?t*Math.SQRT2:e.boxWidth}e.Legend=o.extend({initialize:function initialize(e){n.extend(this,e);this.legendHitBoxes=[];this.doughnutMode=!1},beforeUpdate:i,update:function update(e,t,a){var o=this;o.beforeUpdate();o.maxWidth=e;o.maxHeight=t;o.margins=a;o.beforeSetDimensions();o.setDimensions();o.afterSetDimensions();o.beforeBuildLabels();o.buildLabels();o.afterBuildLabels();o.beforeFit();o.fit();o.afterFit();o.afterUpdate();return o.minSize},afterUpdate:i,beforeSetDimensions:i,setDimensions:function setDimensions(){var e=this;if(e.isHorizontal()){e.width=e.maxWidth;e.left=0;e.right=e.width}else{e.height=e.maxHeight;e.top=0;e.bottom=e.height}e.paddingLeft=0;e.paddingTop=0;e.paddingRight=0;e.paddingBottom=0;e.minSize={width:0,height:0}},afterSetDimensions:i,beforeBuildLabels:i,buildLabels:function buildLabels(){var e=this,t=e.options.labels||{},a=n.callback(t.generateLabels,[e.chart],e)||[];if(t.filter){a=a.filter(function(a){return t.filter(a,e.chart.data)})}if(e.options.reverse){a.reverse()}e.legendItems=a},afterBuildLabels:i,beforeFit:i,fit:function fit(){var e=this,t=e.options,o=t.labels,i=t.display,s=e.ctx,d=a.global,c=n.valueOrDefault,h=c(o.fontSize,d.defaultFontSize),u=c(o.fontStyle,d.defaultFontStyle),m=c(o.fontFamily,d.defaultFontFamily),p=n.fontString(h,u,m),f=e.legendHitBoxes=[],y=e.minSize,x=e.isHorizontal();if(x){y.width=e.maxWidth;y.height=i?10:0}else{y.width=i?10:0;y.height=e.maxHeight}if(i){s.font=p;if(x){var k=e.lineWidths=[0],_=e.legendItems.length?h+o.padding:0;s.textAlign="left";s.textBaseline="top";n.each(e.legendItems,function(t,a){var i=l(o,h),n=i+h/2+s.measureText(t.text).width;if(k[k.length-1]+n+o.padding>=e.width){_+=h+o.padding;k[k.length]=e.left}f[a]={left:0,top:0,width:n,height:h};k[k.length-1]+=n+o.padding});y.height+=_}else{var v=o.padding,S=e.columnWidths=[],w=o.padding,D=0,C=0,P=h+v;n.each(e.legendItems,function(e,t){var a=l(o,h),i=a+h/2+s.measureText(e.text).width;if(C+P>y.height){w+=D+o.padding;S.push(D);D=0;C=0}D=Math.max(D,i);C+=P;f[t]={left:0,top:0,width:i,height:h}});w+=D;S.push(D);y.width+=w}}e.width=y.width;e.height=y.height},afterFit:i,isHorizontal:function isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position},draw:function draw(){var e=this,t=e.options,o=t.labels,i=a.global,s=i.elements.line,d=e.width,c=e.lineWidths;if(t.display){var h=e.ctx,u=n.valueOrDefault,m=u(o.fontColor,i.defaultFontColor),p=u(o.fontSize,i.defaultFontSize),f=u(o.fontStyle,i.defaultFontStyle),y=u(o.fontFamily,i.defaultFontFamily),x=n.fontString(p,f,y),k;h.textAlign="left";h.textBaseline="middle";h.lineWidth=.5;h.strokeStyle=m;h.fillStyle=m;h.font=x;var _=l(o,p),v=e.legendHitBoxes,S=function(e,a,o){if(isNaN(_)||0>=_){return}h.save();h.fillStyle=u(o.fillStyle,i.defaultColor);h.lineCap=u(o.lineCap,s.borderCapStyle);h.lineDashOffset=u(o.lineDashOffset,s.borderDashOffset);h.lineJoin=u(o.lineJoin,s.borderJoinStyle);h.lineWidth=u(o.lineWidth,s.borderWidth);h.strokeStyle=u(o.strokeStyle,i.defaultColor);var l=0===u(o.lineWidth,s.borderWidth);if(h.setLineDash){h.setLineDash(u(o.lineDash,s.borderDash))}if(t.labels&&t.labels.usePointStyle){var d=p*Math.SQRT2/2,c=d/Math.SQRT2;n.canvas.drawPoint(h,o.pointStyle,d,e+c,a+c)}else{if(!l){h.strokeRect(e,a,_,p)}h.fillRect(e,a,_,p)}h.restore()},w=function(e,t,a,o){var i=p/2,n=_+i+e,l=t+i;h.fillText(a.text,n,l);if(a.hidden){h.beginPath();h.lineWidth=2;h.moveTo(n,l);h.lineTo(n+o,l);h.stroke()}},D=e.isHorizontal();if(D){k={x:e.left+(d-c[0])/2,y:e.top+o.padding,line:0}}else{k={x:e.left+o.padding,y:e.top+o.padding,line:0}}var C=p+o.padding;n.each(e.legendItems,function(t,a){var i=h.measureText(t.text).width,n=_+p/2+i,l=k.x,s=k.y;if(D){if(l+n>=d){s=k.y+=C;k.line++;l=k.x=e.left+(d-c[k.line])/2}}else if(s+C>e.bottom){l=k.x=l+e.columnWidths[k.line]+o.padding;s=k.y=e.top+o.padding;k.line++}S(l,s,t);v[a].left=l;v[a].top=s;w(l,s,t,i);if(D){k.x+=n+o.padding}else{k.y+=C}})}},handleEvent:function handleEvent(t){var e=this,a=e.options,o="mouseup"===t.type?"click":t.type,n=!1;if("mousemove"===o){if(!a.onHover){return}}else if("click"===o){if(!a.onClick){return}}else{return}var l=t.x,s=t.y;if(l>=e.left&&l<=e.right&&s>=e.top&&s<=e.bottom){for(var d=e.legendHitBoxes,c=0,h;c=h.left&&l<=h.left+h.width&&s>=h.top&&s<=h.top+h.height){if("click"===o){a.onClick.call(e,t.native,e.legendItems[c]);n=!0;break}else if("mousemove"===o){a.onHover.call(e,t.native,e.legendItems[c]);n=!0;break}}}}return n}});function s(a,o){var i=new e.Legend({ctx:a.ctx,options:o,chart:a});t.configure(a,i,o);t.addBox(a,i);a.legend=i}return{id:"legend",beforeInit:function beforeInit(e){var t=e.options.legend;if(t){s(e,t)}},beforeUpdate:function beforeUpdate(e){var o=e.options.legend,i=e.legend;if(o){n.mergeIf(o,a.global.legend);if(i){t.configure(e,i,o);i.options=o}else{s(e,o)}}else if(i){t.removeBox(e,i);delete e.legend}},afterEvent:function afterEvent(t,a){var e=t.legend;if(e){e.handleEvent(a)}}}}},{25:25,26:26,45:45}],51:[function(e,t){"use strict";var a=e(25),o=e(26),n=e(45);a._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,lineHeight:1.2,padding:10,position:"top",text:"",weight:2e3}});t.exports=function(e){var t=e.layoutService,i=n.noop;e.Title=o.extend({initialize:function initialize(e){var t=this;n.extend(t,e);t.legendHitBoxes=[]},beforeUpdate:i,update:function update(e,t,a){var o=this;o.beforeUpdate();o.maxWidth=e;o.maxHeight=t;o.margins=a;o.beforeSetDimensions();o.setDimensions();o.afterSetDimensions();o.beforeBuildLabels();o.buildLabels();o.afterBuildLabels();o.beforeFit();o.fit();o.afterFit();o.afterUpdate();return o.minSize},afterUpdate:i,beforeSetDimensions:i,setDimensions:function setDimensions(){var e=this;if(e.isHorizontal()){e.width=e.maxWidth;e.left=0;e.right=e.width}else{e.height=e.maxHeight;e.top=0;e.bottom=e.height}e.paddingLeft=0;e.paddingTop=0;e.paddingRight=0;e.paddingBottom=0;e.minSize={width:0,height:0}},afterSetDimensions:i,beforeBuildLabels:i,buildLabels:i,afterBuildLabels:i,beforeFit:i,fit:function fit(){var e=this,t=n.valueOrDefault,o=e.options,i=o.display,l=t(o.fontSize,a.global.defaultFontSize),s=e.minSize,d=n.isArray(o.text)?o.text.length:1,c=n.options.toLineHeight(o.lineHeight,l),h=i?d*c+2*o.padding:0;if(e.isHorizontal()){s.width=e.maxWidth;s.height=h}else{s.width=h;s.height=e.maxHeight}e.width=s.width;e.height=s.height},afterFit:i,isHorizontal:function isHorizontal(){var e=this.options.position;return"top"===e||"bottom"===e},draw:function draw(){var e=this,t=e.ctx,o=n.valueOrDefault,l=e.options,s=a.global;if(l.display){var d=o(l.fontSize,s.defaultFontSize),c=o(l.fontStyle,s.defaultFontStyle),h=o(l.fontFamily,s.defaultFontFamily),u=n.fontString(d,c,h),m=n.options.toLineHeight(l.lineHeight,d),p=m/2+l.padding,f=0,x=e.top,k=e.left,_=e.bottom,v=e.right,S,w,D;t.fillStyle=o(l.fontColor,s.defaultFontColor);t.font=u;if(e.isHorizontal()){w=k+(v-k)/2;D=x+p;S=v-k}else{w="left"===l.position?k+p:v-p;D=x+(_-x)/2;S=_-x;f=Math.PI*("left"===l.position?-.5:.5)}t.save();t.translate(w,D);t.rotate(f);t.textAlign="center";t.textBaseline="middle";var C=l.text;if(n.isArray(C)){for(var P=0,T=0;T=e){o=0}else{o=Math.round(e/l)}return o+t.minIndex},getBasePixel:function getBasePixel(){return this.bottom}});e.scaleService.registerScaleType("category",t,{position:"bottom"})}},{}],53:[function(e,t){"use strict";var a=e(25),o=e(45),i=e(34);t.exports=function(e){var t={position:"left",ticks:{callback:i.formatters.linear}},n=e.LinearScaleBase.extend({determineDataLimits:function determineDataLimits(){var e=this,t=e.options,a=e.chart,i=a.data,n=i.datasets,l=e.isHorizontal();function s(t){return l?t.xAxisID===e.id:t.yAxisID===e.id}e.min=null;e.max=null;var d=t.stacked;if(d===void 0){o.each(n,function(e,t){if(d){return}var o=a.getDatasetMeta(t);if(a.isDatasetVisible(t)&&s(o)&&o.stack!==void 0){d=!0}})}if(t.stacked||d){var c={};o.each(n,function(i,n){var l=a.getDatasetMeta(n),d=[l.type,t.stacked===void 0&&l.stack===void 0?n:"",l.stack].join(".");if(c[d]===void 0){c[d]={positiveValues:[],negativeValues:[]}}var h=c[d].positiveValues,u=c[d].negativeValues;if(a.isDatasetVisible(n)&&s(l)){o.each(i.data,function(a,o){var i=+e.getRightValue(a);if(isNaN(i)||l.data[o].hidden){return}h[o]=h[o]||0;u[o]=u[o]||0;if(t.relativePoints){h[o]=100}else if(0>i){u[o]+=i}else{h[o]+=i}})}});o.each(c,function(t){var a=t.positiveValues.concat(t.negativeValues),i=o.min(a),n=o.max(a);e.min=null===e.min?i:Math.min(e.min,i);e.max=null===e.max?n:Math.max(e.max,n)})}else{o.each(n,function(t,i){var n=a.getDatasetMeta(i);if(a.isDatasetVisible(i)&&s(n)){o.each(t.data,function(t,a){var o=+e.getRightValue(t);if(isNaN(o)||n.data[a].hidden){return}if(null===e.min){e.min=o}else if(oe.max){e.max=o}})}})}e.min=isFinite(e.min)&&!isNaN(e.min)?e.min:0;e.max=isFinite(e.max)&&!isNaN(e.max)?e.max:1;this.handleTickRangeOptions()},getTickLimit:function getTickLimit(){var e,t=this,i=t.options.ticks;if(t.isHorizontal()){e=Math.min(i.maxTicksLimit?i.maxTicksLimit:11,Math.ceil(t.width/50))}else{var n=o.valueOrDefault(i.fontSize,a.global.defaultFontSize);e=Math.min(i.maxTicksLimit?i.maxTicksLimit:11,Math.ceil(t.height/(2*n)))}return e},handleDirectionalChanges:function handleDirectionalChanges(){if(!this.isHorizontal()){this.ticks.reverse()}},getLabelForIndex:function getLabelForIndex(e,t){return+this.getRightValue(this.chart.data.datasets[t].data[e])},getPixelForValue:function getPixelForValue(e){var t=this,a=t.start,o=+t.getRightValue(e),i,n=t.end-a;if(t.isHorizontal()){i=t.left+t.width/n*(o-a);return Math.round(i)}i=t.bottom-t.height/n*(o-a);return Math.round(i)},getValueForPixel:function getValueForPixel(e){var t=this,a=t.isHorizontal(),o=a?t.width:t.height,i=(a?e-t.left:t.bottom-e)/o;return t.start+(t.end-t.start)*i},getPixelForTick:function getPixelForTick(e){return this.getPixelForValue(this.ticksAsNumbers[e])}});e.scaleService.registerScaleType("linear",n,t)}},{25:25,34:34,45:45}],54:[function(e,t){"use strict";var a=e(45),o=e(34);t.exports=function(e){var t=a.noop;e.LinearScaleBase=e.Scale.extend({getRightValue:function getRightValue(t){if("string"==typeof t){return+t}return e.Scale.prototype.getRightValue.call(this,t)},handleTickRangeOptions:function handleTickRangeOptions(){var e=this,t=e.options,o=t.ticks;if(o.beginAtZero){var i=a.sign(e.min),n=a.sign(e.max);if(0>i&&0>n){e.max=0}else if(0=e.max){if(l){e.max=e.min+1}else{e.min=e.max-1}}}if(e.min===e.max){e.max++;if(!o.beginAtZero){e.min--}}},getTickLimit:t,handleDirectionalChanges:t,buildTicks:function buildTicks(){var e=this,t=e.options,i=t.ticks,n=e.getTickLimit();n=Math.max(2,n);var l={maxTicks:n,min:i.min,max:i.max,stepSize:a.valueOrDefault(i.fixedStepSize,i.stepSize)},s=e.ticks=o.generators.linear(l,e);e.handleDirectionalChanges();e.max=a.max(s);e.min=a.min(s);if(i.reverse){s.reverse();e.start=e.max;e.end=e.min}else{e.start=e.min;e.end=e.max}},convertTicksToLabels:function convertTicksToLabels(){var t=this;t.ticksAsNumbers=t.ticks.slice();t.zeroLineIndex=t.ticks.indexOf(0);e.Scale.prototype.convertTicksToLabels.call(t)}})}},{34:34,45:45}],55:[function(e,t){"use strict";var a=e(45),o=e(34);t.exports=function(e){var t={position:"left",ticks:{callback:o.formatters.logarithmic}},i=e.Scale.extend({determineDataLimits:function determineDataLimits(){var e=this,t=e.options,o=t.ticks,i=e.chart,n=i.data,l=n.datasets,s=a.valueOrDefault,d=e.isHorizontal();function c(t){return d?t.xAxisID===e.id:t.yAxisID===e.id}e.min=null;e.max=null;e.minNotZero=null;var h=t.stacked;if(h===void 0){a.each(l,function(e,t){if(h){return}var a=i.getDatasetMeta(t);if(i.isDatasetVisible(t)&&c(a)&&a.stack!==void 0){h=!0}})}if(t.stacked||h){var u={};a.each(l,function(o,n){var l=i.getDatasetMeta(n),s=[l.type,t.stacked===void 0&&l.stack===void 0?n:"",l.stack].join(".");if(i.isDatasetVisible(n)&&c(l)){if(u[s]===void 0){u[s]=[]}a.each(o.data,function(a,o){var i=u[s],n=+e.getRightValue(a);if(isNaN(n)||l.data[o].hidden){return}i[o]=i[o]||0;if(t.relativePoints){i[o]=100}else{i[o]+=n}})}});a.each(u,function(t){var o=a.min(t),i=a.max(t);e.min=null===e.min?o:Math.min(e.min,o);e.max=null===e.max?i:Math.max(e.max,i)})}else{a.each(l,function(t,o){var n=i.getDatasetMeta(o);if(i.isDatasetVisible(o)&&c(n)){a.each(t.data,function(t,a){var o=+e.getRightValue(t);if(isNaN(o)||n.data[a].hidden){return}if(null===e.min){e.min=o}else if(oe.max){e.max=o}if(0!=o&&(null===e.minNotZero||oi){return{start:t-a-5,end:t}}return{start:t,end:t+a+5}}function h(e){var t=s(e),a=Math.min(e.height/2,e.width/2),n={r:e.width,l:0,t:e.height,b:0},h={},u,m,p;e.ctx.font=t.font;e._pointLabelSizes=[];var f=l(e);for(u=0;un.r){n.r=k.end;h.r=y}if(_.startn.b){n.b=_.end;h.b=y}}e.setReductions(a,n,h)}function u(e){var t=Math.min(e.height/2,e.width/2);e.drawingArea=Math.round(t);e.setCenterPoint(0,0,0,0)}function m(e){if(0===e||180===e){return"center"}else if(180>e){return"left"}return"right"}function p(e,t,a,n){if(o.isArray(t)){for(var l=a.y,s=0;se){a.y-=t.h}}function y(e){var a=e.ctx,n=o.valueOrDefault,d=e.options,c=d.angleLines,h=d.pointLabels;a.lineWidth=c.lineWidth;a.strokeStyle=c.color;var u=e.getDistanceFromCenterForValue(d.ticks.reverse?e.min:e.max),y=s(e);a.textBaseline="top";for(var x=l(e)-1;0<=x;x--){if(c.display){var k=e.getPointPosition(x,u);a.beginPath();a.moveTo(e.xCenter,e.yCenter);a.lineTo(k.x,k.y);a.stroke();a.closePath()}if(h.display){var _=e.getPointPosition(x,u+5),v=n(h.fontColor,t.defaultFontColor);a.font=y.font;a.fillStyle=v;var S=e.getIndexAngle(x),w=o.toDegrees(S);a.textAlign=m(w);f(w,e._pointLabelSizes[x],_);p(a,e.pointLabels[x]||"",_,y.size)}}}function x(e,t,a,n){var s=e.ctx;s.strokeStyle=o.valueAtIndexOrDefault(t.color,n-1);s.lineWidth=o.valueAtIndexOrDefault(t.lineWidth,n-1);if(e.options.gridLines.circular){s.beginPath();s.arc(e.xCenter,e.yCenter,a,0,2*Math.PI);s.closePath();s.stroke()}else{var d=l(e);if(0===d){return}s.beginPath();var c=e.getPointPosition(0,a);s.moveTo(c.x,c.y);for(var h=1;ht&&0>a?a:0t&&h>1;l=e[n-1]||null;s=e[n];if(!l){return{lo:null,hi:s}}else if(s[t]a){i=n-1}else{return{lo:l,hi:s}}}return{lo:s,hi:null}}function f(e,t,a,o){var i=p(e,t,a),n=!i.lo?e[0]:!i.hi?e[e.length-2]:i.lo,l=!i.lo?e[1]:!i.hi?e[e.length-1]:i.hi,s=l[t]-n[t],d=s?(a-n[t])/s:0,c=(l[o]-n[o])*d;return n[o]+c}function y(e,t){var o=t.parser,i=t.parser||t.format;if("function"==typeof o){return o(e)}if("string"==typeof e&&"string"==typeof i){return a(e,i)}if(!(e instanceof a)){e=a(e)}if(e.isValid()){return e}if("function"==typeof i){return i(e)}return e}function x(e,t){if(n.isNullOrUndef(e)){return null}var a=t.options.time,o=y(t.getRightValue(e),a);if(!o.isValid()){return null}if(a.round){o.startOf(a.round)}return o.valueOf()}function k(e,t,a,o){var n=t-e,l=d[a],s=l.size,c=l.steps,h,u,m;if(!c){return Math.ceil(n/((o||1)*s))}for(h=0,u=c.length;h=t&&y<=a){u.push(y)}}e.min=t;e.max=a;e._unit=d;e._majorUnit=c;e._minorFormat=l[d];e._majorFormat=l[c];e._table=m(e._timestamps.data,t,a,o.distribution);e._offsets=w(e._table,u,t,a,o);return D(u,c)},getLabelForIndex:function getLabelForIndex(e,t){var a=this,o=a.chart.data,i=a.options.time,l=o.labels&&e lum2) {\n return (lum1 + 0.05) / (lum2 + 0.05);\n }\n return (lum2 + 0.05) / (lum1 + 0.05);\n },\n\n level: function (color2) {\n var contrastRatio = this.contrast(color2);\n if (contrastRatio >= 7.1) {\n return 'AAA';\n }\n\n return (contrastRatio >= 4.5) ? 'AA' : '';\n },\n\n dark: function () {\n // YIQ equation from http://24ways.org/2010/calculating-color-contrast\n var rgb = this.values.rgb;\n var yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000;\n return yiq < 128;\n },\n\n light: function () {\n return !this.dark();\n },\n\n negate: function () {\n var rgb = [];\n for (var i = 0; i < 3; i++) {\n rgb[i] = 255 - this.values.rgb[i];\n }\n this.setValues('rgb', rgb);\n return this;\n },\n\n lighten: function (ratio) {\n var hsl = this.values.hsl;\n hsl[2] += hsl[2] * ratio;\n this.setValues('hsl', hsl);\n return this;\n },\n\n darken: function (ratio) {\n var hsl = this.values.hsl;\n hsl[2] -= hsl[2] * ratio;\n this.setValues('hsl', hsl);\n return this;\n },\n\n saturate: function (ratio) {\n var hsl = this.values.hsl;\n hsl[1] += hsl[1] * ratio;\n this.setValues('hsl', hsl);\n return this;\n },\n\n desaturate: function (ratio) {\n var hsl = this.values.hsl;\n hsl[1] -= hsl[1] * ratio;\n this.setValues('hsl', hsl);\n return this;\n },\n\n whiten: function (ratio) {\n var hwb = this.values.hwb;\n hwb[1] += hwb[1] * ratio;\n this.setValues('hwb', hwb);\n return this;\n },\n\n blacken: function (ratio) {\n var hwb = this.values.hwb;\n hwb[2] += hwb[2] * ratio;\n this.setValues('hwb', hwb);\n return this;\n },\n\n greyscale: function () {\n var rgb = this.values.rgb;\n // http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale\n var val = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;\n this.setValues('rgb', [val, val, val]);\n return this;\n },\n\n clearer: function (ratio) {\n var alpha = this.values.alpha;\n this.setValues('alpha', alpha - (alpha * ratio));\n return this;\n },\n\n opaquer: function (ratio) {\n var alpha = this.values.alpha;\n this.setValues('alpha', alpha + (alpha * ratio));\n return this;\n },\n\n rotate: function (degrees) {\n var hsl = this.values.hsl;\n var hue = (hsl[0] + degrees) % 360;\n hsl[0] = hue < 0 ? 360 + hue : hue;\n this.setValues('hsl', hsl);\n return this;\n },\n\n /**\n * Ported from sass implementation in C\n * https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209\n */\n mix: function (mixinColor, weight) {\n var color1 = this;\n var color2 = mixinColor;\n var p = weight === undefined ? 0.5 : weight;\n\n var w = 2 * p - 1;\n var a = color1.alpha() - color2.alpha();\n\n var w1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n var w2 = 1 - w1;\n\n return this\n .rgb(\n w1 * color1.red() + w2 * color2.red(),\n w1 * color1.green() + w2 * color2.green(),\n w1 * color1.blue() + w2 * color2.blue()\n )\n .alpha(color1.alpha() * p + color2.alpha() * (1 - p));\n },\n\n toJSON: function () {\n return this.rgb();\n },\n\n clone: function () {\n // NOTE(SB): using node-clone creates a dependency to Buffer when using browserify,\n // making the final build way to big to embed in Chart.js. So let's do it manually,\n // assuming that values to clone are 1 dimension arrays containing only numbers,\n // except 'alpha' which is a number.\n var result = new Color();\n var source = this.values;\n var target = result.values;\n var value, type;\n\n for (var prop in source) {\n if (source.hasOwnProperty(prop)) {\n value = source[prop];\n type = ({}).toString.call(value);\n if (type === '[object Array]') {\n target[prop] = value.slice(0);\n } else if (type === '[object Number]') {\n target[prop] = value;\n } else {\n console.error('unexpected color value:', value);\n }\n }\n }\n\n return result;\n }\n };\n\n Color.prototype.spaces = {\n rgb: ['red', 'green', 'blue'],\n hsl: ['hue', 'saturation', 'lightness'],\n hsv: ['hue', 'saturation', 'value'],\n hwb: ['hue', 'whiteness', 'blackness'],\n cmyk: ['cyan', 'magenta', 'yellow', 'black']\n };\n\n Color.prototype.maxes = {\n rgb: [255, 255, 255],\n hsl: [360, 100, 100],\n hsv: [360, 100, 100],\n hwb: [360, 100, 100],\n cmyk: [100, 100, 100, 100]\n };\n\n Color.prototype.getValues = function (space) {\n var values = this.values;\n var vals = {};\n\n for (var i = 0; i < space.length; i++) {\n vals[space.charAt(i)] = values[space][i];\n }\n\n if (values.alpha !== 1) {\n vals.a = values.alpha;\n }\n\n // {r: 255, g: 255, b: 255, a: 0.4}\n return vals;\n };\n\n Color.prototype.setValues = function (space, vals) {\n var values = this.values;\n var spaces = this.spaces;\n var maxes = this.maxes;\n var alpha = 1;\n var i;\n\n this.valid = true;\n\n if (space === 'alpha') {\n alpha = vals;\n } else if (vals.length) {\n // [10, 10, 10]\n values[space] = vals.slice(0, space.length);\n alpha = vals[space.length];\n } else if (vals[space.charAt(0)] !== undefined) {\n // {r: 10, g: 10, b: 10}\n for (i = 0; i < space.length; i++) {\n values[space][i] = vals[space.charAt(i)];\n }\n\n alpha = vals.a;\n } else if (vals[spaces[space][0]] !== undefined) {\n // {red: 10, green: 10, blue: 10}\n var chans = spaces[space];\n\n for (i = 0; i < space.length; i++) {\n values[space][i] = vals[chans[i]];\n }\n\n alpha = vals.alpha;\n }\n\n values.alpha = Math.max(0, Math.min(1, (alpha === undefined ? values.alpha : alpha)));\n\n if (space === 'alpha') {\n return false;\n }\n\n var capped;\n\n // cap values of the space prior converting all values\n for (i = 0; i < space.length; i++) {\n capped = Math.max(0, Math.min(maxes[space][i], values[space][i]));\n values[space][i] = Math.round(capped);\n }\n\n // convert to all the other color spaces\n for (var sname in spaces) {\n if (sname !== space) {\n values[sname] = convert[space][sname](values[space]);\n }\n }\n\n return true;\n };\n\n Color.prototype.setSpace = function (space, args) {\n var vals = args[0];\n\n if (vals === undefined) {\n // color.rgb()\n return this.getValues(space);\n }\n\n // color.rgb(10, 10, 10)\n if (typeof vals === 'number') {\n vals = Array.prototype.slice.call(args);\n }\n\n this.setValues(space, vals);\n return this;\n };\n\n Color.prototype.setChannel = function (space, index, val) {\n var svalues = this.values[space];\n if (val === undefined) {\n // color.red()\n return svalues[index];\n } else if (val === svalues[index]) {\n // color.red(color.red())\n return this;\n }\n\n // color.red(100)\n svalues[index] = val;\n this.setValues(space, svalues);\n\n return this;\n };\n\n if (typeof window !== 'undefined') {\n window.Color = Color;\n }\n\n module.exports = Color;\n\n},{\"1\":1,\"4\":4}],3:[function(require,module,exports){\n\t/* MIT license */\n\n module.exports = {\n rgb2hsl: rgb2hsl,\n rgb2hsv: rgb2hsv,\n rgb2hwb: rgb2hwb,\n rgb2cmyk: rgb2cmyk,\n rgb2keyword: rgb2keyword,\n rgb2xyz: rgb2xyz,\n rgb2lab: rgb2lab,\n rgb2lch: rgb2lch,\n\n hsl2rgb: hsl2rgb,\n hsl2hsv: hsl2hsv,\n hsl2hwb: hsl2hwb,\n hsl2cmyk: hsl2cmyk,\n hsl2keyword: hsl2keyword,\n\n hsv2rgb: hsv2rgb,\n hsv2hsl: hsv2hsl,\n hsv2hwb: hsv2hwb,\n hsv2cmyk: hsv2cmyk,\n hsv2keyword: hsv2keyword,\n\n hwb2rgb: hwb2rgb,\n hwb2hsl: hwb2hsl,\n hwb2hsv: hwb2hsv,\n hwb2cmyk: hwb2cmyk,\n hwb2keyword: hwb2keyword,\n\n cmyk2rgb: cmyk2rgb,\n cmyk2hsl: cmyk2hsl,\n cmyk2hsv: cmyk2hsv,\n cmyk2hwb: cmyk2hwb,\n cmyk2keyword: cmyk2keyword,\n\n keyword2rgb: keyword2rgb,\n keyword2hsl: keyword2hsl,\n keyword2hsv: keyword2hsv,\n keyword2hwb: keyword2hwb,\n keyword2cmyk: keyword2cmyk,\n keyword2lab: keyword2lab,\n keyword2xyz: keyword2xyz,\n\n xyz2rgb: xyz2rgb,\n xyz2lab: xyz2lab,\n xyz2lch: xyz2lch,\n\n lab2xyz: lab2xyz,\n lab2rgb: lab2rgb,\n lab2lch: lab2lch,\n\n lch2lab: lch2lab,\n lch2xyz: lch2xyz,\n lch2rgb: lch2rgb\n }\n\n\n function rgb2hsl(rgb) {\n var r = rgb[0]/255,\n g = rgb[1]/255,\n b = rgb[2]/255,\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n delta = max - min,\n h, s, l;\n\n if (max == min)\n h = 0;\n else if (r == max)\n h = (g - b) / delta;\n else if (g == max)\n h = 2 + (b - r) / delta;\n else if (b == max)\n h = 4 + (r - g)/ delta;\n\n h = Math.min(h * 60, 360);\n\n if (h < 0)\n h += 360;\n\n l = (min + max) / 2;\n\n if (max == min)\n s = 0;\n else if (l <= 0.5)\n s = delta / (max + min);\n else\n s = delta / (2 - max - min);\n\n return [h, s * 100, l * 100];\n }\n\n function rgb2hsv(rgb) {\n var r = rgb[0],\n g = rgb[1],\n b = rgb[2],\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n delta = max - min,\n h, s, v;\n\n if (max == 0)\n s = 0;\n else\n s = (delta/max * 1000)/10;\n\n if (max == min)\n h = 0;\n else if (r == max)\n h = (g - b) / delta;\n else if (g == max)\n h = 2 + (b - r) / delta;\n else if (b == max)\n h = 4 + (r - g) / delta;\n\n h = Math.min(h * 60, 360);\n\n if (h < 0)\n h += 360;\n\n v = ((max / 255) * 1000) / 10;\n\n return [h, s, v];\n }\n\n function rgb2hwb(rgb) {\n var r = rgb[0],\n g = rgb[1],\n b = rgb[2],\n h = rgb2hsl(rgb)[0],\n w = 1/255 * Math.min(r, Math.min(g, b)),\n b = 1 - 1/255 * Math.max(r, Math.max(g, b));\n\n return [h, w * 100, b * 100];\n }\n\n function rgb2cmyk(rgb) {\n var r = rgb[0] / 255,\n g = rgb[1] / 255,\n b = rgb[2] / 255,\n c, m, y, k;\n\n k = Math.min(1 - r, 1 - g, 1 - b);\n c = (1 - r - k) / (1 - k) || 0;\n m = (1 - g - k) / (1 - k) || 0;\n y = (1 - b - k) / (1 - k) || 0;\n return [c * 100, m * 100, y * 100, k * 100];\n }\n\n function rgb2keyword(rgb) {\n return reverseKeywords[JSON.stringify(rgb)];\n }\n\n function rgb2xyz(rgb) {\n var r = rgb[0] / 255,\n g = rgb[1] / 255,\n b = rgb[2] / 255;\n\n // assume sRGB\n r = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92);\n g = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92);\n b = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92);\n\n var x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);\n var y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);\n var z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);\n\n return [x * 100, y *100, z * 100];\n }\n\n function rgb2lab(rgb) {\n var xyz = rgb2xyz(rgb),\n x = xyz[0],\n y = xyz[1],\n z = xyz[2],\n l, a, b;\n\n x /= 95.047;\n y /= 100;\n z /= 108.883;\n\n x = x > 0.008856 ? Math.pow(x, 1/3) : (7.787 * x) + (16 / 116);\n y = y > 0.008856 ? Math.pow(y, 1/3) : (7.787 * y) + (16 / 116);\n z = z > 0.008856 ? Math.pow(z, 1/3) : (7.787 * z) + (16 / 116);\n\n l = (116 * y) - 16;\n a = 500 * (x - y);\n b = 200 * (y - z);\n\n return [l, a, b];\n }\n\n function rgb2lch(args) {\n return lab2lch(rgb2lab(args));\n }\n\n function hsl2rgb(hsl) {\n var h = hsl[0] / 360,\n s = hsl[1] / 100,\n l = hsl[2] / 100,\n t1, t2, t3, rgb, val;\n\n if (s == 0) {\n val = l * 255;\n return [val, val, val];\n }\n\n if (l < 0.5)\n t2 = l * (1 + s);\n else\n t2 = l + s - l * s;\n t1 = 2 * l - t2;\n\n rgb = [0, 0, 0];\n for (var i = 0; i < 3; i++) {\n t3 = h + 1 / 3 * - (i - 1);\n t3 < 0 && t3++;\n t3 > 1 && t3--;\n\n if (6 * t3 < 1)\n val = t1 + (t2 - t1) * 6 * t3;\n else if (2 * t3 < 1)\n val = t2;\n else if (3 * t3 < 2)\n val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;\n else\n val = t1;\n\n rgb[i] = val * 255;\n }\n\n return rgb;\n }\n\n function hsl2hsv(hsl) {\n var h = hsl[0],\n s = hsl[1] / 100,\n l = hsl[2] / 100,\n sv, v;\n\n if(l === 0) {\n // no need to do calc on black\n // also avoids divide by 0 error\n return [0, 0, 0];\n }\n\n l *= 2;\n s *= (l <= 1) ? l : 2 - l;\n v = (l + s) / 2;\n sv = (2 * s) / (l + s);\n return [h, sv * 100, v * 100];\n }\n\n function hsl2hwb(args) {\n return rgb2hwb(hsl2rgb(args));\n }\n\n function hsl2cmyk(args) {\n return rgb2cmyk(hsl2rgb(args));\n }\n\n function hsl2keyword(args) {\n return rgb2keyword(hsl2rgb(args));\n }\n\n\n function hsv2rgb(hsv) {\n var h = hsv[0] / 60,\n s = hsv[1] / 100,\n v = hsv[2] / 100,\n hi = Math.floor(h) % 6;\n\n var f = h - Math.floor(h),\n p = 255 * v * (1 - s),\n q = 255 * v * (1 - (s * f)),\n t = 255 * v * (1 - (s * (1 - f))),\n v = 255 * v;\n\n switch(hi) {\n case 0:\n return [v, t, p];\n case 1:\n return [q, v, p];\n case 2:\n return [p, v, t];\n case 3:\n return [p, q, v];\n case 4:\n return [t, p, v];\n case 5:\n return [v, p, q];\n }\n }\n\n function hsv2hsl(hsv) {\n var h = hsv[0],\n s = hsv[1] / 100,\n v = hsv[2] / 100,\n sl, l;\n\n l = (2 - s) * v;\n sl = s * v;\n sl /= (l <= 1) ? l : 2 - l;\n sl = sl || 0;\n l /= 2;\n return [h, sl * 100, l * 100];\n }\n\n function hsv2hwb(args) {\n return rgb2hwb(hsv2rgb(args))\n }\n\n function hsv2cmyk(args) {\n return rgb2cmyk(hsv2rgb(args));\n }\n\n function hsv2keyword(args) {\n return rgb2keyword(hsv2rgb(args));\n }\n\n// http://dev.w3.org/csswg/css-color/#hwb-to-rgb\n function hwb2rgb(hwb) {\n var h = hwb[0] / 360,\n wh = hwb[1] / 100,\n bl = hwb[2] / 100,\n ratio = wh + bl,\n i, v, f, n;\n\n // wh + bl cant be > 1\n if (ratio > 1) {\n wh /= ratio;\n bl /= ratio;\n }\n\n i = Math.floor(6 * h);\n v = 1 - bl;\n f = 6 * h - i;\n if ((i & 0x01) != 0) {\n f = 1 - f;\n }\n n = wh + f * (v - wh); // linear interpolation\n\n switch (i) {\n default:\n case 6:\n case 0: r = v; g = n; b = wh; break;\n case 1: r = n; g = v; b = wh; break;\n case 2: r = wh; g = v; b = n; break;\n case 3: r = wh; g = n; b = v; break;\n case 4: r = n; g = wh; b = v; break;\n case 5: r = v; g = wh; b = n; break;\n }\n\n return [r * 255, g * 255, b * 255];\n }\n\n function hwb2hsl(args) {\n return rgb2hsl(hwb2rgb(args));\n }\n\n function hwb2hsv(args) {\n return rgb2hsv(hwb2rgb(args));\n }\n\n function hwb2cmyk(args) {\n return rgb2cmyk(hwb2rgb(args));\n }\n\n function hwb2keyword(args) {\n return rgb2keyword(hwb2rgb(args));\n }\n\n function cmyk2rgb(cmyk) {\n var c = cmyk[0] / 100,\n m = cmyk[1] / 100,\n y = cmyk[2] / 100,\n k = cmyk[3] / 100,\n r, g, b;\n\n r = 1 - Math.min(1, c * (1 - k) + k);\n g = 1 - Math.min(1, m * (1 - k) + k);\n b = 1 - Math.min(1, y * (1 - k) + k);\n return [r * 255, g * 255, b * 255];\n }\n\n function cmyk2hsl(args) {\n return rgb2hsl(cmyk2rgb(args));\n }\n\n function cmyk2hsv(args) {\n return rgb2hsv(cmyk2rgb(args));\n }\n\n function cmyk2hwb(args) {\n return rgb2hwb(cmyk2rgb(args));\n }\n\n function cmyk2keyword(args) {\n return rgb2keyword(cmyk2rgb(args));\n }\n\n\n function xyz2rgb(xyz) {\n var x = xyz[0] / 100,\n y = xyz[1] / 100,\n z = xyz[2] / 100,\n r, g, b;\n\n r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);\n g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);\n b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);\n\n // assume sRGB\n r = r > 0.0031308 ? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055)\n : r = (r * 12.92);\n\n g = g > 0.0031308 ? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055)\n : g = (g * 12.92);\n\n b = b > 0.0031308 ? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055)\n : b = (b * 12.92);\n\n r = Math.min(Math.max(0, r), 1);\n g = Math.min(Math.max(0, g), 1);\n b = Math.min(Math.max(0, b), 1);\n\n return [r * 255, g * 255, b * 255];\n }\n\n function xyz2lab(xyz) {\n var x = xyz[0],\n y = xyz[1],\n z = xyz[2],\n l, a, b;\n\n x /= 95.047;\n y /= 100;\n z /= 108.883;\n\n x = x > 0.008856 ? Math.pow(x, 1/3) : (7.787 * x) + (16 / 116);\n y = y > 0.008856 ? Math.pow(y, 1/3) : (7.787 * y) + (16 / 116);\n z = z > 0.008856 ? Math.pow(z, 1/3) : (7.787 * z) + (16 / 116);\n\n l = (116 * y) - 16;\n a = 500 * (x - y);\n b = 200 * (y - z);\n\n return [l, a, b];\n }\n\n function xyz2lch(args) {\n return lab2lch(xyz2lab(args));\n }\n\n function lab2xyz(lab) {\n var l = lab[0],\n a = lab[1],\n b = lab[2],\n x, y, z, y2;\n\n if (l <= 8) {\n y = (l * 100) / 903.3;\n y2 = (7.787 * (y / 100)) + (16 / 116);\n } else {\n y = 100 * Math.pow((l + 16) / 116, 3);\n y2 = Math.pow(y / 100, 1/3);\n }\n\n x = x / 95.047 <= 0.008856 ? x = (95.047 * ((a / 500) + y2 - (16 / 116))) / 7.787 : 95.047 * Math.pow((a / 500) + y2, 3);\n\n z = z / 108.883 <= 0.008859 ? z = (108.883 * (y2 - (b / 200) - (16 / 116))) / 7.787 : 108.883 * Math.pow(y2 - (b / 200), 3);\n\n return [x, y, z];\n }\n\n function lab2lch(lab) {\n var l = lab[0],\n a = lab[1],\n b = lab[2],\n hr, h, c;\n\n hr = Math.atan2(b, a);\n h = hr * 360 / 2 / Math.PI;\n if (h < 0) {\n h += 360;\n }\n c = Math.sqrt(a * a + b * b);\n return [l, c, h];\n }\n\n function lab2rgb(args) {\n return xyz2rgb(lab2xyz(args));\n }\n\n function lch2lab(lch) {\n var l = lch[0],\n c = lch[1],\n h = lch[2],\n a, b, hr;\n\n hr = h / 360 * 2 * Math.PI;\n a = c * Math.cos(hr);\n b = c * Math.sin(hr);\n return [l, a, b];\n }\n\n function lch2xyz(args) {\n return lab2xyz(lch2lab(args));\n }\n\n function lch2rgb(args) {\n return lab2rgb(lch2lab(args));\n }\n\n function keyword2rgb(keyword) {\n return cssKeywords[keyword];\n }\n\n function keyword2hsl(args) {\n return rgb2hsl(keyword2rgb(args));\n }\n\n function keyword2hsv(args) {\n return rgb2hsv(keyword2rgb(args));\n }\n\n function keyword2hwb(args) {\n return rgb2hwb(keyword2rgb(args));\n }\n\n function keyword2cmyk(args) {\n return rgb2cmyk(keyword2rgb(args));\n }\n\n function keyword2lab(args) {\n return rgb2lab(keyword2rgb(args));\n }\n\n function keyword2xyz(args) {\n return rgb2xyz(keyword2rgb(args));\n }\n\n var cssKeywords = {\n aliceblue: [240,248,255],\n antiquewhite: [250,235,215],\n aqua: [0,255,255],\n aquamarine: [127,255,212],\n azure: [240,255,255],\n beige: [245,245,220],\n bisque: [255,228,196],\n black: [0,0,0],\n blanchedalmond: [255,235,205],\n blue: [0,0,255],\n blueviolet: [138,43,226],\n brown: [165,42,42],\n burlywood: [222,184,135],\n cadetblue: [95,158,160],\n chartreuse: [127,255,0],\n chocolate: [210,105,30],\n coral: [255,127,80],\n cornflowerblue: [100,149,237],\n cornsilk: [255,248,220],\n crimson: [220,20,60],\n cyan: [0,255,255],\n darkblue: [0,0,139],\n darkcyan: [0,139,139],\n darkgoldenrod: [184,134,11],\n darkgray: [169,169,169],\n darkgreen: [0,100,0],\n darkgrey: [169,169,169],\n darkkhaki: [189,183,107],\n darkmagenta: [139,0,139],\n darkolivegreen: [85,107,47],\n darkorange: [255,140,0],\n darkorchid: [153,50,204],\n darkred: [139,0,0],\n darksalmon: [233,150,122],\n darkseagreen: [143,188,143],\n darkslateblue: [72,61,139],\n darkslategray: [47,79,79],\n darkslategrey: [47,79,79],\n darkturquoise: [0,206,209],\n darkviolet: [148,0,211],\n deeppink: [255,20,147],\n deepskyblue: [0,191,255],\n dimgray: [105,105,105],\n dimgrey: [105,105,105],\n dodgerblue: [30,144,255],\n firebrick: [178,34,34],\n floralwhite: [255,250,240],\n forestgreen: [34,139,34],\n fuchsia: [255,0,255],\n gainsboro: [220,220,220],\n ghostwhite: [248,248,255],\n gold: [255,215,0],\n goldenrod: [218,165,32],\n gray: [128,128,128],\n green: [0,128,0],\n greenyellow: [173,255,47],\n grey: [128,128,128],\n honeydew: [240,255,240],\n hotpink: [255,105,180],\n indianred: [205,92,92],\n indigo: [75,0,130],\n ivory: [255,255,240],\n khaki: [240,230,140],\n lavender: [230,230,250],\n lavenderblush: [255,240,245],\n lawngreen: [124,252,0],\n lemonchiffon: [255,250,205],\n lightblue: [173,216,230],\n lightcoral: [240,128,128],\n lightcyan: [224,255,255],\n lightgoldenrodyellow: [250,250,210],\n lightgray: [211,211,211],\n lightgreen: [144,238,144],\n lightgrey: [211,211,211],\n lightpink: [255,182,193],\n lightsalmon: [255,160,122],\n lightseagreen: [32,178,170],\n lightskyblue: [135,206,250],\n lightslategray: [119,136,153],\n lightslategrey: [119,136,153],\n lightsteelblue: [176,196,222],\n lightyellow: [255,255,224],\n lime: [0,255,0],\n limegreen: [50,205,50],\n linen: [250,240,230],\n magenta: [255,0,255],\n maroon: [128,0,0],\n mediumaquamarine: [102,205,170],\n mediumblue: [0,0,205],\n mediumorchid: [186,85,211],\n mediumpurple: [147,112,219],\n mediumseagreen: [60,179,113],\n mediumslateblue: [123,104,238],\n mediumspringgreen: [0,250,154],\n mediumturquoise: [72,209,204],\n mediumvioletred: [199,21,133],\n midnightblue: [25,25,112],\n mintcream: [245,255,250],\n mistyrose: [255,228,225],\n moccasin: [255,228,181],\n navajowhite: [255,222,173],\n navy: [0,0,128],\n oldlace: [253,245,230],\n olive: [128,128,0],\n olivedrab: [107,142,35],\n orange: [255,165,0],\n orangered: [255,69,0],\n orchid: [218,112,214],\n palegoldenrod: [238,232,170],\n palegreen: [152,251,152],\n paleturquoise: [175,238,238],\n palevioletred: [219,112,147],\n papayawhip: [255,239,213],\n peachpuff: [255,218,185],\n peru: [205,133,63],\n pink: [255,192,203],\n plum: [221,160,221],\n powderblue: [176,224,230],\n purple: [128,0,128],\n rebeccapurple: [102, 51, 153],\n red: [255,0,0],\n rosybrown: [188,143,143],\n royalblue: [65,105,225],\n saddlebrown: [139,69,19],\n salmon: [250,128,114],\n sandybrown: [244,164,96],\n seagreen: [46,139,87],\n seashell: [255,245,238],\n sienna: [160,82,45],\n silver: [192,192,192],\n skyblue: [135,206,235],\n slateblue: [106,90,205],\n slategray: [112,128,144],\n slategrey: [112,128,144],\n snow: [255,250,250],\n springgreen: [0,255,127],\n steelblue: [70,130,180],\n tan: [210,180,140],\n teal: [0,128,128],\n thistle: [216,191,216],\n tomato: [255,99,71],\n turquoise: [64,224,208],\n violet: [238,130,238],\n wheat: [245,222,179],\n white: [255,255,255],\n whitesmoke: [245,245,245],\n yellow: [255,255,0],\n yellowgreen: [154,205,50]\n };\n\n var reverseKeywords = {};\n for (var key in cssKeywords) {\n reverseKeywords[JSON.stringify(cssKeywords[key])] = key;\n }\n\n},{}],4:[function(require,module,exports){\n var conversions = require(3);\n\n var convert = function() {\n return new Converter();\n }\n\n for (var func in conversions) {\n // export Raw versions\n convert[func + \"Raw\"] = (function(func) {\n // accept array or plain args\n return function(arg) {\n if (typeof arg == \"number\")\n arg = Array.prototype.slice.call(arguments);\n return conversions[func](arg);\n }\n })(func);\n\n var pair = /(\\w+)2(\\w+)/.exec(func),\n from = pair[1],\n to = pair[2];\n\n // export rgb2hsl and [\"rgb\"][\"hsl\"]\n convert[from] = convert[from] || {};\n\n convert[from][to] = convert[func] = (function(func) {\n return function(arg) {\n if (typeof arg == \"number\")\n arg = Array.prototype.slice.call(arguments);\n\n var val = conversions[func](arg);\n if (typeof val == \"string\" || val === undefined)\n return val; // keyword\n\n for (var i = 0; i < val.length; i++)\n val[i] = Math.round(val[i]);\n return val;\n }\n })(func);\n }\n\n\n\t/* Converter does lazy conversion and caching */\n var Converter = function() {\n this.convs = {};\n };\n\n\t/* Either get the values for a space or\n\t set the values for a space, depending on args */\n Converter.prototype.routeSpace = function(space, args) {\n var values = args[0];\n if (values === undefined) {\n // color.rgb()\n return this.getValues(space);\n }\n // color.rgb(10, 10, 10)\n if (typeof values == \"number\") {\n values = Array.prototype.slice.call(args);\n }\n\n return this.setValues(space, values);\n };\n\n\t/* Set the values for a space, invalidating cache */\n Converter.prototype.setValues = function(space, values) {\n this.space = space;\n this.convs = {};\n this.convs[space] = values;\n return this;\n };\n\n\t/* Get the values for a space. If there's already\n\t a conversion for the space, fetch it, otherwise\n\t compute it */\n Converter.prototype.getValues = function(space) {\n var vals = this.convs[space];\n if (!vals) {\n var fspace = this.space,\n from = this.convs[fspace];\n vals = convert[fspace][space](from);\n\n this.convs[space] = vals;\n }\n return vals;\n };\n\n [\"rgb\", \"hsl\", \"hsv\", \"cmyk\", \"keyword\"].forEach(function(space) {\n Converter.prototype[space] = function(vals) {\n return this.routeSpace(space, arguments);\n }\n });\n\n module.exports = convert;\n},{\"3\":3}],5:[function(require,module,exports){\n 'use strict'\n\n module.exports = {\n \"aliceblue\": [240, 248, 255],\n \"antiquewhite\": [250, 235, 215],\n \"aqua\": [0, 255, 255],\n \"aquamarine\": [127, 255, 212],\n \"azure\": [240, 255, 255],\n \"beige\": [245, 245, 220],\n \"bisque\": [255, 228, 196],\n \"black\": [0, 0, 0],\n \"blanchedalmond\": [255, 235, 205],\n \"blue\": [0, 0, 255],\n \"blueviolet\": [138, 43, 226],\n \"brown\": [165, 42, 42],\n \"burlywood\": [222, 184, 135],\n \"cadetblue\": [95, 158, 160],\n \"chartreuse\": [127, 255, 0],\n \"chocolate\": [210, 105, 30],\n \"coral\": [255, 127, 80],\n \"cornflowerblue\": [100, 149, 237],\n \"cornsilk\": [255, 248, 220],\n \"crimson\": [220, 20, 60],\n \"cyan\": [0, 255, 255],\n \"darkblue\": [0, 0, 139],\n \"darkcyan\": [0, 139, 139],\n \"darkgoldenrod\": [184, 134, 11],\n \"darkgray\": [169, 169, 169],\n \"darkgreen\": [0, 100, 0],\n \"darkgrey\": [169, 169, 169],\n \"darkkhaki\": [189, 183, 107],\n \"darkmagenta\": [139, 0, 139],\n \"darkolivegreen\": [85, 107, 47],\n \"darkorange\": [255, 140, 0],\n \"darkorchid\": [153, 50, 204],\n \"darkred\": [139, 0, 0],\n \"darksalmon\": [233, 150, 122],\n \"darkseagreen\": [143, 188, 143],\n \"darkslateblue\": [72, 61, 139],\n \"darkslategray\": [47, 79, 79],\n \"darkslategrey\": [47, 79, 79],\n \"darkturquoise\": [0, 206, 209],\n \"darkviolet\": [148, 0, 211],\n \"deeppink\": [255, 20, 147],\n \"deepskyblue\": [0, 191, 255],\n \"dimgray\": [105, 105, 105],\n \"dimgrey\": [105, 105, 105],\n \"dodgerblue\": [30, 144, 255],\n \"firebrick\": [178, 34, 34],\n \"floralwhite\": [255, 250, 240],\n \"forestgreen\": [34, 139, 34],\n \"fuchsia\": [255, 0, 255],\n \"gainsboro\": [220, 220, 220],\n \"ghostwhite\": [248, 248, 255],\n \"gold\": [255, 215, 0],\n \"goldenrod\": [218, 165, 32],\n \"gray\": [128, 128, 128],\n \"green\": [0, 128, 0],\n \"greenyellow\": [173, 255, 47],\n \"grey\": [128, 128, 128],\n \"honeydew\": [240, 255, 240],\n \"hotpink\": [255, 105, 180],\n \"indianred\": [205, 92, 92],\n \"indigo\": [75, 0, 130],\n \"ivory\": [255, 255, 240],\n \"khaki\": [240, 230, 140],\n \"lavender\": [230, 230, 250],\n \"lavenderblush\": [255, 240, 245],\n \"lawngreen\": [124, 252, 0],\n \"lemonchiffon\": [255, 250, 205],\n \"lightblue\": [173, 216, 230],\n \"lightcoral\": [240, 128, 128],\n \"lightcyan\": [224, 255, 255],\n \"lightgoldenrodyellow\": [250, 250, 210],\n \"lightgray\": [211, 211, 211],\n \"lightgreen\": [144, 238, 144],\n \"lightgrey\": [211, 211, 211],\n \"lightpink\": [255, 182, 193],\n \"lightsalmon\": [255, 160, 122],\n \"lightseagreen\": [32, 178, 170],\n \"lightskyblue\": [135, 206, 250],\n \"lightslategray\": [119, 136, 153],\n \"lightslategrey\": [119, 136, 153],\n \"lightsteelblue\": [176, 196, 222],\n \"lightyellow\": [255, 255, 224],\n \"lime\": [0, 255, 0],\n \"limegreen\": [50, 205, 50],\n \"linen\": [250, 240, 230],\n \"magenta\": [255, 0, 255],\n \"maroon\": [128, 0, 0],\n \"mediumaquamarine\": [102, 205, 170],\n \"mediumblue\": [0, 0, 205],\n \"mediumorchid\": [186, 85, 211],\n \"mediumpurple\": [147, 112, 219],\n \"mediumseagreen\": [60, 179, 113],\n \"mediumslateblue\": [123, 104, 238],\n \"mediumspringgreen\": [0, 250, 154],\n \"mediumturquoise\": [72, 209, 204],\n \"mediumvioletred\": [199, 21, 133],\n \"midnightblue\": [25, 25, 112],\n \"mintcream\": [245, 255, 250],\n \"mistyrose\": [255, 228, 225],\n \"moccasin\": [255, 228, 181],\n \"navajowhite\": [255, 222, 173],\n \"navy\": [0, 0, 128],\n \"oldlace\": [253, 245, 230],\n \"olive\": [128, 128, 0],\n \"olivedrab\": [107, 142, 35],\n \"orange\": [255, 165, 0],\n \"orangered\": [255, 69, 0],\n \"orchid\": [218, 112, 214],\n \"palegoldenrod\": [238, 232, 170],\n \"palegreen\": [152, 251, 152],\n \"paleturquoise\": [175, 238, 238],\n \"palevioletred\": [219, 112, 147],\n \"papayawhip\": [255, 239, 213],\n \"peachpuff\": [255, 218, 185],\n \"peru\": [205, 133, 63],\n \"pink\": [255, 192, 203],\n \"plum\": [221, 160, 221],\n \"powderblue\": [176, 224, 230],\n \"purple\": [128, 0, 128],\n \"rebeccapurple\": [102, 51, 153],\n \"red\": [255, 0, 0],\n \"rosybrown\": [188, 143, 143],\n \"royalblue\": [65, 105, 225],\n \"saddlebrown\": [139, 69, 19],\n \"salmon\": [250, 128, 114],\n \"sandybrown\": [244, 164, 96],\n \"seagreen\": [46, 139, 87],\n \"seashell\": [255, 245, 238],\n \"sienna\": [160, 82, 45],\n \"silver\": [192, 192, 192],\n \"skyblue\": [135, 206, 235],\n \"slateblue\": [106, 90, 205],\n \"slategray\": [112, 128, 144],\n \"slategrey\": [112, 128, 144],\n \"snow\": [255, 250, 250],\n \"springgreen\": [0, 255, 127],\n \"steelblue\": [70, 130, 180],\n \"tan\": [210, 180, 140],\n \"teal\": [0, 128, 128],\n \"thistle\": [216, 191, 216],\n \"tomato\": [255, 99, 71],\n \"turquoise\": [64, 224, 208],\n \"violet\": [238, 130, 238],\n \"wheat\": [245, 222, 179],\n \"white\": [255, 255, 255],\n \"whitesmoke\": [245, 245, 245],\n \"yellow\": [255, 255, 0],\n \"yellowgreen\": [154, 205, 50]\n };\n\n},{}],6:[function(require,module,exports){\n//! moment.js\n//! version : 2.18.1\n//! authors : Tim Wood, Iskren Chernev, Moment.js contributors\n//! license : MIT\n//! momentjs.com\n\n ;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n global.moment = factory()\n }(this, (function () { 'use strict';\n\n var hookCallback;\n\n function hooks () {\n return hookCallback.apply(null, arguments);\n }\n\n// This is done to register the method called with moment()\n// without creating circular dependencies.\n function setHookCallback (callback) {\n hookCallback = callback;\n }\n\n function isArray(input) {\n return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';\n }\n\n function isObject(input) {\n // IE8 will treat undefined and null as object if it wasn't for\n // input != null\n return input != null && Object.prototype.toString.call(input) === '[object Object]';\n }\n\n function isObjectEmpty(obj) {\n var k;\n for (k in obj) {\n // even if its not own property I'd still call it non-empty\n return false;\n }\n return true;\n }\n\n function isUndefined(input) {\n return input === void 0;\n }\n\n function isNumber(input) {\n return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]';\n }\n\n function isDate(input) {\n return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';\n }\n\n function map(arr, fn) {\n var res = [], i;\n for (i = 0; i < arr.length; ++i) {\n res.push(fn(arr[i], i));\n }\n return res;\n }\n\n function hasOwnProp(a, b) {\n return Object.prototype.hasOwnProperty.call(a, b);\n }\n\n function extend(a, b) {\n for (var i in b) {\n if (hasOwnProp(b, i)) {\n a[i] = b[i];\n }\n }\n\n if (hasOwnProp(b, 'toString')) {\n a.toString = b.toString;\n }\n\n if (hasOwnProp(b, 'valueOf')) {\n a.valueOf = b.valueOf;\n }\n\n return a;\n }\n\n function createUTC (input, format, locale, strict) {\n return createLocalOrUTC(input, format, locale, strict, true).utc();\n }\n\n function defaultParsingFlags() {\n // We need to deep clone this object.\n return {\n empty : false,\n unusedTokens : [],\n unusedInput : [],\n overflow : -2,\n charsLeftOver : 0,\n nullInput : false,\n invalidMonth : null,\n invalidFormat : false,\n userInvalidated : false,\n iso : false,\n parsedDateParts : [],\n meridiem : null,\n rfc2822 : false,\n weekdayMismatch : false\n };\n }\n\n function getParsingFlags(m) {\n if (m._pf == null) {\n m._pf = defaultParsingFlags();\n }\n return m._pf;\n }\n\n var some;\n if (Array.prototype.some) {\n some = Array.prototype.some;\n } else {\n some = function (fun) {\n var t = Object(this);\n var len = t.length >>> 0;\n\n for (var i = 0; i < len; i++) {\n if (i in t && fun.call(this, t[i], i, t)) {\n return true;\n }\n }\n\n return false;\n };\n }\n\n var some$1 = some;\n\n function isValid(m) {\n if (m._isValid == null) {\n var flags = getParsingFlags(m);\n var parsedParts = some$1.call(flags.parsedDateParts, function (i) {\n return i != null;\n });\n var isNowValid = !isNaN(m._d.getTime()) &&\n flags.overflow < 0 &&\n !flags.empty &&\n !flags.invalidMonth &&\n !flags.invalidWeekday &&\n !flags.nullInput &&\n !flags.invalidFormat &&\n !flags.userInvalidated &&\n (!flags.meridiem || (flags.meridiem && parsedParts));\n\n if (m._strict) {\n isNowValid = isNowValid &&\n flags.charsLeftOver === 0 &&\n flags.unusedTokens.length === 0 &&\n flags.bigHour === undefined;\n }\n\n if (Object.isFrozen == null || !Object.isFrozen(m)) {\n m._isValid = isNowValid;\n }\n else {\n return isNowValid;\n }\n }\n return m._isValid;\n }\n\n function createInvalid (flags) {\n var m = createUTC(NaN);\n if (flags != null) {\n extend(getParsingFlags(m), flags);\n }\n else {\n getParsingFlags(m).userInvalidated = true;\n }\n\n return m;\n }\n\n// Plugins that add properties should also add the key here (null value),\n// so we can properly clone ourselves.\n var momentProperties = hooks.momentProperties = [];\n\n function copyConfig(to, from) {\n var i, prop, val;\n\n if (!isUndefined(from._isAMomentObject)) {\n to._isAMomentObject = from._isAMomentObject;\n }\n if (!isUndefined(from._i)) {\n to._i = from._i;\n }\n if (!isUndefined(from._f)) {\n to._f = from._f;\n }\n if (!isUndefined(from._l)) {\n to._l = from._l;\n }\n if (!isUndefined(from._strict)) {\n to._strict = from._strict;\n }\n if (!isUndefined(from._tzm)) {\n to._tzm = from._tzm;\n }\n if (!isUndefined(from._isUTC)) {\n to._isUTC = from._isUTC;\n }\n if (!isUndefined(from._offset)) {\n to._offset = from._offset;\n }\n if (!isUndefined(from._pf)) {\n to._pf = getParsingFlags(from);\n }\n if (!isUndefined(from._locale)) {\n to._locale = from._locale;\n }\n\n if (momentProperties.length > 0) {\n for (i = 0; i < momentProperties.length; i++) {\n prop = momentProperties[i];\n val = from[prop];\n if (!isUndefined(val)) {\n to[prop] = val;\n }\n }\n }\n\n return to;\n }\n\n var updateInProgress = false;\n\n// Moment prototype object\n function Moment(config) {\n copyConfig(this, config);\n this._d = new Date(config._d != null ? config._d.getTime() : NaN);\n if (!this.isValid()) {\n this._d = new Date(NaN);\n }\n // Prevent infinite loop in case updateOffset creates new moment\n // objects.\n if (updateInProgress === false) {\n updateInProgress = true;\n hooks.updateOffset(this);\n updateInProgress = false;\n }\n }\n\n function isMoment (obj) {\n return obj instanceof Moment || (obj != null && obj._isAMomentObject != null);\n }\n\n function absFloor (number) {\n if (number < 0) {\n // -0 -> 0\n return Math.ceil(number) || 0;\n } else {\n return Math.floor(number);\n }\n }\n\n function toInt(argumentForCoercion) {\n var coercedNumber = +argumentForCoercion,\n value = 0;\n\n if (coercedNumber !== 0 && isFinite(coercedNumber)) {\n value = absFloor(coercedNumber);\n }\n\n return value;\n }\n\n// compare two arrays, return the number of differences\n function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }\n\n function warn(msg) {\n if (hooks.suppressDeprecationWarnings === false &&\n (typeof console !== 'undefined') && console.warn) {\n console.warn('Deprecation warning: ' + msg);\n }\n }\n\n function deprecate(msg, fn) {\n var firstTime = true;\n\n return extend(function () {\n if (hooks.deprecationHandler != null) {\n hooks.deprecationHandler(null, msg);\n }\n if (firstTime) {\n var args = [];\n var arg;\n for (var i = 0; i < arguments.length; i++) {\n arg = '';\n if (typeof arguments[i] === 'object') {\n arg += '\\n[' + i + '] ';\n for (var key in arguments[0]) {\n arg += key + ': ' + arguments[0][key] + ', ';\n }\n arg = arg.slice(0, -2); // Remove trailing comma and space\n } else {\n arg = arguments[i];\n }\n args.push(arg);\n }\n warn(msg + '\\nArguments: ' + Array.prototype.slice.call(args).join('') + '\\n' + (new Error()).stack);\n firstTime = false;\n }\n return fn.apply(this, arguments);\n }, fn);\n }\n\n var deprecations = {};\n\n function deprecateSimple(name, msg) {\n if (hooks.deprecationHandler != null) {\n hooks.deprecationHandler(name, msg);\n }\n if (!deprecations[name]) {\n warn(msg);\n deprecations[name] = true;\n }\n }\n\n hooks.suppressDeprecationWarnings = false;\n hooks.deprecationHandler = null;\n\n function isFunction(input) {\n return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';\n }\n\n function set (config) {\n var prop, i;\n for (i in config) {\n prop = config[i];\n if (isFunction(prop)) {\n this[i] = prop;\n } else {\n this['_' + i] = prop;\n }\n }\n this._config = config;\n // Lenient ordinal parsing accepts just a number in addition to\n // number + (possibly) stuff coming from _dayOfMonthOrdinalParse.\n // TODO: Remove \"ordinalParse\" fallback in next major release.\n this._dayOfMonthOrdinalParseLenient = new RegExp(\n (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +\n '|' + (/\\d{1,2}/).source);\n }\n\n function mergeConfigs(parentConfig, childConfig) {\n var res = extend({}, parentConfig), prop;\n for (prop in childConfig) {\n if (hasOwnProp(childConfig, prop)) {\n if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {\n res[prop] = {};\n extend(res[prop], parentConfig[prop]);\n extend(res[prop], childConfig[prop]);\n } else if (childConfig[prop] != null) {\n res[prop] = childConfig[prop];\n } else {\n delete res[prop];\n }\n }\n }\n for (prop in parentConfig) {\n if (hasOwnProp(parentConfig, prop) &&\n !hasOwnProp(childConfig, prop) &&\n isObject(parentConfig[prop])) {\n // make sure changes to properties don't modify parent config\n res[prop] = extend({}, res[prop]);\n }\n }\n return res;\n }\n\n function Locale(config) {\n if (config != null) {\n this.set(config);\n }\n }\n\n var keys;\n\n if (Object.keys) {\n keys = Object.keys;\n } else {\n keys = function (obj) {\n var i, res = [];\n for (i in obj) {\n if (hasOwnProp(obj, i)) {\n res.push(i);\n }\n }\n return res;\n };\n }\n\n var keys$1 = keys;\n\n var defaultCalendar = {\n sameDay : '[Today at] LT',\n nextDay : '[Tomorrow at] LT',\n nextWeek : 'dddd [at] LT',\n lastDay : '[Yesterday at] LT',\n lastWeek : '[Last] dddd [at] LT',\n sameElse : 'L'\n };\n\n function calendar (key, mom, now) {\n var output = this._calendar[key] || this._calendar['sameElse'];\n return isFunction(output) ? output.call(mom, now) : output;\n }\n\n var defaultLongDateFormat = {\n LTS : 'h:mm:ss A',\n LT : 'h:mm A',\n L : 'MM/DD/YYYY',\n LL : 'MMMM D, YYYY',\n LLL : 'MMMM D, YYYY h:mm A',\n LLLL : 'dddd, MMMM D, YYYY h:mm A'\n };\n\n function longDateFormat (key) {\n var format = this._longDateFormat[key],\n formatUpper = this._longDateFormat[key.toUpperCase()];\n\n if (format || !formatUpper) {\n return format;\n }\n\n this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {\n return val.slice(1);\n });\n\n return this._longDateFormat[key];\n }\n\n var defaultInvalidDate = 'Invalid date';\n\n function invalidDate () {\n return this._invalidDate;\n }\n\n var defaultOrdinal = '%d';\n var defaultDayOfMonthOrdinalParse = /\\d{1,2}/;\n\n function ordinal (number) {\n return this._ordinal.replace('%d', number);\n }\n\n var defaultRelativeTime = {\n future : 'in %s',\n past : '%s ago',\n s : 'a few seconds',\n ss : '%d seconds',\n m : 'a minute',\n mm : '%d minutes',\n h : 'an hour',\n hh : '%d hours',\n d : 'a day',\n dd : '%d days',\n M : 'a month',\n MM : '%d months',\n y : 'a year',\n yy : '%d years'\n };\n\n function relativeTime (number, withoutSuffix, string, isFuture) {\n var output = this._relativeTime[string];\n return (isFunction(output)) ?\n output(number, withoutSuffix, string, isFuture) :\n output.replace(/%d/i, number);\n }\n\n function pastFuture (diff, output) {\n var format = this._relativeTime[diff > 0 ? 'future' : 'past'];\n return isFunction(format) ? format(output) : format.replace(/%s/i, output);\n }\n\n var aliases = {};\n\n function addUnitAlias (unit, shorthand) {\n var lowerCase = unit.toLowerCase();\n aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;\n }\n\n function normalizeUnits(units) {\n return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;\n }\n\n function normalizeObjectUnits(inputObject) {\n var normalizedInput = {},\n normalizedProp,\n prop;\n\n for (prop in inputObject) {\n if (hasOwnProp(inputObject, prop)) {\n normalizedProp = normalizeUnits(prop);\n if (normalizedProp) {\n normalizedInput[normalizedProp] = inputObject[prop];\n }\n }\n }\n\n return normalizedInput;\n }\n\n var priorities = {};\n\n function addUnitPriority(unit, priority) {\n priorities[unit] = priority;\n }\n\n function getPrioritizedUnits(unitsObj) {\n var units = [];\n for (var u in unitsObj) {\n units.push({unit: u, priority: priorities[u]});\n }\n units.sort(function (a, b) {\n return a.priority - b.priority;\n });\n return units;\n }\n\n function makeGetSet (unit, keepTime) {\n return function (value) {\n if (value != null) {\n set$1(this, unit, value);\n hooks.updateOffset(this, keepTime);\n return this;\n } else {\n return get(this, unit);\n }\n };\n }\n\n function get (mom, unit) {\n return mom.isValid() ?\n mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;\n }\n\n function set$1 (mom, unit, value) {\n if (mom.isValid()) {\n mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);\n }\n }\n\n// MOMENTS\n\n function stringGet (units) {\n units = normalizeUnits(units);\n if (isFunction(this[units])) {\n return this[units]();\n }\n return this;\n }\n\n\n function stringSet (units, value) {\n if (typeof units === 'object') {\n units = normalizeObjectUnits(units);\n var prioritized = getPrioritizedUnits(units);\n for (var i = 0; i < prioritized.length; i++) {\n this[prioritized[i].unit](units[prioritized[i].unit]);\n }\n } else {\n units = normalizeUnits(units);\n if (isFunction(this[units])) {\n return this[units](value);\n }\n }\n return this;\n }\n\n function zeroFill(number, targetLength, forceSign) {\n var absNumber = '' + Math.abs(number),\n zerosToFill = targetLength - absNumber.length,\n sign = number >= 0;\n return (sign ? (forceSign ? '+' : '') : '-') +\n Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;\n }\n\n var formattingTokens = /(\\[[^\\[]*\\])|(\\\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;\n\n var localFormattingTokens = /(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g;\n\n var formatFunctions = {};\n\n var formatTokenFunctions = {};\n\n// token: 'M'\n// padded: ['MM', 2]\n// ordinal: 'Mo'\n// callback: function () { this.month() + 1 }\n function addFormatToken (token, padded, ordinal, callback) {\n var func = callback;\n if (typeof callback === 'string') {\n func = function () {\n return this[callback]();\n };\n }\n if (token) {\n formatTokenFunctions[token] = func;\n }\n if (padded) {\n formatTokenFunctions[padded[0]] = function () {\n return zeroFill(func.apply(this, arguments), padded[1], padded[2]);\n };\n }\n if (ordinal) {\n formatTokenFunctions[ordinal] = function () {\n return this.localeData().ordinal(func.apply(this, arguments), token);\n };\n }\n }\n\n function removeFormattingTokens(input) {\n if (input.match(/\\[[\\s\\S]/)) {\n return input.replace(/^\\[|\\]$/g, '');\n }\n return input.replace(/\\\\/g, '');\n }\n\n function makeFormatFunction(format) {\n var array = format.match(formattingTokens), i, length;\n\n for (i = 0, length = array.length; i < length; i++) {\n if (formatTokenFunctions[array[i]]) {\n array[i] = formatTokenFunctions[array[i]];\n } else {\n array[i] = removeFormattingTokens(array[i]);\n }\n }\n\n return function (mom) {\n var output = '', i;\n for (i = 0; i < length; i++) {\n output += isFunction(array[i]) ? array[i].call(mom, format) : array[i];\n }\n return output;\n };\n }\n\n// format date using native date object\n function formatMoment(m, format) {\n if (!m.isValid()) {\n return m.localeData().invalidDate();\n }\n\n format = expandFormat(format, m.localeData());\n formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);\n\n return formatFunctions[format](m);\n }\n\n function expandFormat(format, locale) {\n var i = 5;\n\n function replaceLongDateFormatTokens(input) {\n return locale.longDateFormat(input) || input;\n }\n\n localFormattingTokens.lastIndex = 0;\n while (i >= 0 && localFormattingTokens.test(format)) {\n format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);\n localFormattingTokens.lastIndex = 0;\n i -= 1;\n }\n\n return format;\n }\n\n var match1 = /\\d/; // 0 - 9\n var match2 = /\\d\\d/; // 00 - 99\n var match3 = /\\d{3}/; // 000 - 999\n var match4 = /\\d{4}/; // 0000 - 9999\n var match6 = /[+-]?\\d{6}/; // -999999 - 999999\n var match1to2 = /\\d\\d?/; // 0 - 99\n var match3to4 = /\\d\\d\\d\\d?/; // 999 - 9999\n var match5to6 = /\\d\\d\\d\\d\\d\\d?/; // 99999 - 999999\n var match1to3 = /\\d{1,3}/; // 0 - 999\n var match1to4 = /\\d{1,4}/; // 0 - 9999\n var match1to6 = /[+-]?\\d{1,6}/; // -999999 - 999999\n\n var matchUnsigned = /\\d+/; // 0 - inf\n var matchSigned = /[+-]?\\d+/; // -inf - inf\n\n var matchOffset = /Z|[+-]\\d\\d:?\\d\\d/gi; // +00:00 -00:00 +0000 -0000 or Z\n var matchShortOffset = /Z|[+-]\\d\\d(?::?\\d\\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z\n\n var matchTimestamp = /[+-]?\\d+(\\.\\d{1,3})?/; // 123456789 123456789.123\n\n// any word (or two) characters or numbers including two/three word month in arabic.\n// includes scottish gaelic two word and hyphenated months\n var matchWord = /[0-9]*['a-z\\u00A0-\\u05FF\\u0700-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]+|[\\u0600-\\u06FF\\/]+(\\s*?[\\u0600-\\u06FF]+){1,2}/i;\n\n\n var regexes = {};\n\n function addRegexToken (token, regex, strictRegex) {\n regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {\n return (isStrict && strictRegex) ? strictRegex : regex;\n };\n }\n\n function getParseRegexForToken (token, config) {\n if (!hasOwnProp(regexes, token)) {\n return new RegExp(unescapeFormat(token));\n }\n\n return regexes[token](config._strict, config._locale);\n }\n\n// Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript\n function unescapeFormat(s) {\n return regexEscape(s.replace('\\\\', '').replace(/\\\\(\\[)|\\\\(\\])|\\[([^\\]\\[]*)\\]|\\\\(.)/g, function (matched, p1, p2, p3, p4) {\n return p1 || p2 || p3 || p4;\n }));\n }\n\n function regexEscape(s) {\n return s.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n }\n\n var tokens = {};\n\n function addParseToken (token, callback) {\n var i, func = callback;\n if (typeof token === 'string') {\n token = [token];\n }\n if (isNumber(callback)) {\n func = function (input, array) {\n array[callback] = toInt(input);\n };\n }\n for (i = 0; i < token.length; i++) {\n tokens[token[i]] = func;\n }\n }\n\n function addWeekParseToken (token, callback) {\n addParseToken(token, function (input, array, config, token) {\n config._w = config._w || {};\n callback(input, config._w, config, token);\n });\n }\n\n function addTimeToArrayFromToken(token, input, config) {\n if (input != null && hasOwnProp(tokens, token)) {\n tokens[token](input, config._a, config, token);\n }\n }\n\n var YEAR = 0;\n var MONTH = 1;\n var DATE = 2;\n var HOUR = 3;\n var MINUTE = 4;\n var SECOND = 5;\n var MILLISECOND = 6;\n var WEEK = 7;\n var WEEKDAY = 8;\n\n var indexOf;\n\n if (Array.prototype.indexOf) {\n indexOf = Array.prototype.indexOf;\n } else {\n indexOf = function (o) {\n // I know\n var i;\n for (i = 0; i < this.length; ++i) {\n if (this[i] === o) {\n return i;\n }\n }\n return -1;\n };\n }\n\n var indexOf$1 = indexOf;\n\n function daysInMonth(year, month) {\n return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();\n }\n\n// FORMATTING\n\n addFormatToken('M', ['MM', 2], 'Mo', function () {\n return this.month() + 1;\n });\n\n addFormatToken('MMM', 0, 0, function (format) {\n return this.localeData().monthsShort(this, format);\n });\n\n addFormatToken('MMMM', 0, 0, function (format) {\n return this.localeData().months(this, format);\n });\n\n// ALIASES\n\n addUnitAlias('month', 'M');\n\n// PRIORITY\n\n addUnitPriority('month', 8);\n\n// PARSING\n\n addRegexToken('M', match1to2);\n addRegexToken('MM', match1to2, match2);\n addRegexToken('MMM', function (isStrict, locale) {\n return locale.monthsShortRegex(isStrict);\n });\n addRegexToken('MMMM', function (isStrict, locale) {\n return locale.monthsRegex(isStrict);\n });\n\n addParseToken(['M', 'MM'], function (input, array) {\n array[MONTH] = toInt(input) - 1;\n });\n\n addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {\n var month = config._locale.monthsParse(input, token, config._strict);\n // if we didn't find a month name, mark the date as invalid.\n if (month != null) {\n array[MONTH] = month;\n } else {\n getParsingFlags(config).invalidMonth = input;\n }\n });\n\n// LOCALES\n\n var MONTHS_IN_FORMAT = /D[oD]?(\\[[^\\[\\]]*\\]|\\s)+MMMM?/;\n var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');\n function localeMonths (m, format) {\n if (!m) {\n return isArray(this._months) ? this._months :\n this._months['standalone'];\n }\n return isArray(this._months) ? this._months[m.month()] :\n this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()];\n }\n\n var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');\n function localeMonthsShort (m, format) {\n if (!m) {\n return isArray(this._monthsShort) ? this._monthsShort :\n this._monthsShort['standalone'];\n }\n return isArray(this._monthsShort) ? this._monthsShort[m.month()] :\n this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];\n }\n\n function handleStrictParse(monthName, format, strict) {\n var i, ii, mom, llc = monthName.toLocaleLowerCase();\n if (!this._monthsParse) {\n // this is not used\n this._monthsParse = [];\n this._longMonthsParse = [];\n this._shortMonthsParse = [];\n for (i = 0; i < 12; ++i) {\n mom = createUTC([2000, i]);\n this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();\n this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();\n }\n }\n\n if (strict) {\n if (format === 'MMM') {\n ii = indexOf$1.call(this._shortMonthsParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf$1.call(this._longMonthsParse, llc);\n return ii !== -1 ? ii : null;\n }\n } else {\n if (format === 'MMM') {\n ii = indexOf$1.call(this._shortMonthsParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf$1.call(this._longMonthsParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf$1.call(this._longMonthsParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf$1.call(this._shortMonthsParse, llc);\n return ii !== -1 ? ii : null;\n }\n }\n }\n\n function localeMonthsParse (monthName, format, strict) {\n var i, mom, regex;\n\n if (this._monthsParseExact) {\n return handleStrictParse.call(this, monthName, format, strict);\n }\n\n if (!this._monthsParse) {\n this._monthsParse = [];\n this._longMonthsParse = [];\n this._shortMonthsParse = [];\n }\n\n // TODO: add sorting\n // Sorting makes sure if one month (or abbr) is a prefix of another\n // see sorting in computeMonthsParse\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, i]);\n if (strict && !this._longMonthsParse[i]) {\n this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');\n this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');\n }\n if (!strict && !this._monthsParse[i]) {\n regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');\n this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');\n }\n // test the regex\n if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {\n return i;\n } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {\n return i;\n } else if (!strict && this._monthsParse[i].test(monthName)) {\n return i;\n }\n }\n }\n\n// MOMENTS\n\n function setMonth (mom, value) {\n var dayOfMonth;\n\n if (!mom.isValid()) {\n // No op\n return mom;\n }\n\n if (typeof value === 'string') {\n if (/^\\d+$/.test(value)) {\n value = toInt(value);\n } else {\n value = mom.localeData().monthsParse(value);\n // TODO: Another silent failure?\n if (!isNumber(value)) {\n return mom;\n }\n }\n }\n\n dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));\n mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);\n return mom;\n }\n\n function getSetMonth (value) {\n if (value != null) {\n setMonth(this, value);\n hooks.updateOffset(this, true);\n return this;\n } else {\n return get(this, 'Month');\n }\n }\n\n function getDaysInMonth () {\n return daysInMonth(this.year(), this.month());\n }\n\n var defaultMonthsShortRegex = matchWord;\n function monthsShortRegex (isStrict) {\n if (this._monthsParseExact) {\n if (!hasOwnProp(this, '_monthsRegex')) {\n computeMonthsParse.call(this);\n }\n if (isStrict) {\n return this._monthsShortStrictRegex;\n } else {\n return this._monthsShortRegex;\n }\n } else {\n if (!hasOwnProp(this, '_monthsShortRegex')) {\n this._monthsShortRegex = defaultMonthsShortRegex;\n }\n return this._monthsShortStrictRegex && isStrict ?\n this._monthsShortStrictRegex : this._monthsShortRegex;\n }\n }\n\n var defaultMonthsRegex = matchWord;\n function monthsRegex (isStrict) {\n if (this._monthsParseExact) {\n if (!hasOwnProp(this, '_monthsRegex')) {\n computeMonthsParse.call(this);\n }\n if (isStrict) {\n return this._monthsStrictRegex;\n } else {\n return this._monthsRegex;\n }\n } else {\n if (!hasOwnProp(this, '_monthsRegex')) {\n this._monthsRegex = defaultMonthsRegex;\n }\n return this._monthsStrictRegex && isStrict ?\n this._monthsStrictRegex : this._monthsRegex;\n }\n }\n\n function computeMonthsParse () {\n function cmpLenRev(a, b) {\n return b.length - a.length;\n }\n\n var shortPieces = [], longPieces = [], mixedPieces = [],\n i, mom;\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, i]);\n shortPieces.push(this.monthsShort(mom, ''));\n longPieces.push(this.months(mom, ''));\n mixedPieces.push(this.months(mom, ''));\n mixedPieces.push(this.monthsShort(mom, ''));\n }\n // Sorting makes sure if one month (or abbr) is a prefix of another it\n // will match the longer piece.\n shortPieces.sort(cmpLenRev);\n longPieces.sort(cmpLenRev);\n mixedPieces.sort(cmpLenRev);\n for (i = 0; i < 12; i++) {\n shortPieces[i] = regexEscape(shortPieces[i]);\n longPieces[i] = regexEscape(longPieces[i]);\n }\n for (i = 0; i < 24; i++) {\n mixedPieces[i] = regexEscape(mixedPieces[i]);\n }\n\n this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._monthsShortRegex = this._monthsRegex;\n this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');\n this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');\n }\n\n// FORMATTING\n\n addFormatToken('Y', 0, 0, function () {\n var y = this.year();\n return y <= 9999 ? '' + y : '+' + y;\n });\n\n addFormatToken(0, ['YY', 2], 0, function () {\n return this.year() % 100;\n });\n\n addFormatToken(0, ['YYYY', 4], 0, 'year');\n addFormatToken(0, ['YYYYY', 5], 0, 'year');\n addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');\n\n// ALIASES\n\n addUnitAlias('year', 'y');\n\n// PRIORITIES\n\n addUnitPriority('year', 1);\n\n// PARSING\n\n addRegexToken('Y', matchSigned);\n addRegexToken('YY', match1to2, match2);\n addRegexToken('YYYY', match1to4, match4);\n addRegexToken('YYYYY', match1to6, match6);\n addRegexToken('YYYYYY', match1to6, match6);\n\n addParseToken(['YYYYY', 'YYYYYY'], YEAR);\n addParseToken('YYYY', function (input, array) {\n array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);\n });\n addParseToken('YY', function (input, array) {\n array[YEAR] = hooks.parseTwoDigitYear(input);\n });\n addParseToken('Y', function (input, array) {\n array[YEAR] = parseInt(input, 10);\n });\n\n// HELPERS\n\n function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n }\n\n function isLeapYear(year) {\n return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n }\n\n// HOOKS\n\n hooks.parseTwoDigitYear = function (input) {\n return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);\n };\n\n// MOMENTS\n\n var getSetYear = makeGetSet('FullYear', true);\n\n function getIsLeapYear () {\n return isLeapYear(this.year());\n }\n\n function createDate (y, m, d, h, M, s, ms) {\n // can't just apply() to create a date:\n // https://stackoverflow.com/q/181348\n var date = new Date(y, m, d, h, M, s, ms);\n\n // the date constructor remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0 && isFinite(date.getFullYear())) {\n date.setFullYear(y);\n }\n return date;\n }\n\n function createUTCDate (y) {\n var date = new Date(Date.UTC.apply(null, arguments));\n\n // the Date.UTC function remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) {\n date.setUTCFullYear(y);\n }\n return date;\n }\n\n// start-of-first-week - start-of-year\n function firstWeekOffset(year, dow, doy) {\n var // first-week day -- which january is always in the first week (4 for iso, 1 for other)\n fwd = 7 + dow - doy,\n // first-week day local weekday -- which local weekday is fwd\n fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;\n\n return -fwdlw + fwd - 1;\n }\n\n// https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday\n function dayOfYearFromWeeks(year, week, weekday, dow, doy) {\n var localWeekday = (7 + weekday - dow) % 7,\n weekOffset = firstWeekOffset(year, dow, doy),\n dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,\n resYear, resDayOfYear;\n\n if (dayOfYear <= 0) {\n resYear = year - 1;\n resDayOfYear = daysInYear(resYear) + dayOfYear;\n } else if (dayOfYear > daysInYear(year)) {\n resYear = year + 1;\n resDayOfYear = dayOfYear - daysInYear(year);\n } else {\n resYear = year;\n resDayOfYear = dayOfYear;\n }\n\n return {\n year: resYear,\n dayOfYear: resDayOfYear\n };\n }\n\n function weekOfYear(mom, dow, doy) {\n var weekOffset = firstWeekOffset(mom.year(), dow, doy),\n week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,\n resWeek, resYear;\n\n if (week < 1) {\n resYear = mom.year() - 1;\n resWeek = week + weeksInYear(resYear, dow, doy);\n } else if (week > weeksInYear(mom.year(), dow, doy)) {\n resWeek = week - weeksInYear(mom.year(), dow, doy);\n resYear = mom.year() + 1;\n } else {\n resYear = mom.year();\n resWeek = week;\n }\n\n return {\n week: resWeek,\n year: resYear\n };\n }\n\n function weeksInYear(year, dow, doy) {\n var weekOffset = firstWeekOffset(year, dow, doy),\n weekOffsetNext = firstWeekOffset(year + 1, dow, doy);\n return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;\n }\n\n// FORMATTING\n\n addFormatToken('w', ['ww', 2], 'wo', 'week');\n addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');\n\n// ALIASES\n\n addUnitAlias('week', 'w');\n addUnitAlias('isoWeek', 'W');\n\n// PRIORITIES\n\n addUnitPriority('week', 5);\n addUnitPriority('isoWeek', 5);\n\n// PARSING\n\n addRegexToken('w', match1to2);\n addRegexToken('ww', match1to2, match2);\n addRegexToken('W', match1to2);\n addRegexToken('WW', match1to2, match2);\n\n addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {\n week[token.substr(0, 1)] = toInt(input);\n });\n\n// HELPERS\n\n// LOCALES\n\n function localeWeek (mom) {\n return weekOfYear(mom, this._week.dow, this._week.doy).week;\n }\n\n var defaultLocaleWeek = {\n dow : 0, // Sunday is the first day of the week.\n doy : 6 // The week that contains Jan 1st is the first week of the year.\n };\n\n function localeFirstDayOfWeek () {\n return this._week.dow;\n }\n\n function localeFirstDayOfYear () {\n return this._week.doy;\n }\n\n// MOMENTS\n\n function getSetWeek (input) {\n var week = this.localeData().week(this);\n return input == null ? week : this.add((input - week) * 7, 'd');\n }\n\n function getSetISOWeek (input) {\n var week = weekOfYear(this, 1, 4).week;\n return input == null ? week : this.add((input - week) * 7, 'd');\n }\n\n// FORMATTING\n\n addFormatToken('d', 0, 'do', 'day');\n\n addFormatToken('dd', 0, 0, function (format) {\n return this.localeData().weekdaysMin(this, format);\n });\n\n addFormatToken('ddd', 0, 0, function (format) {\n return this.localeData().weekdaysShort(this, format);\n });\n\n addFormatToken('dddd', 0, 0, function (format) {\n return this.localeData().weekdays(this, format);\n });\n\n addFormatToken('e', 0, 0, 'weekday');\n addFormatToken('E', 0, 0, 'isoWeekday');\n\n// ALIASES\n\n addUnitAlias('day', 'd');\n addUnitAlias('weekday', 'e');\n addUnitAlias('isoWeekday', 'E');\n\n// PRIORITY\n addUnitPriority('day', 11);\n addUnitPriority('weekday', 11);\n addUnitPriority('isoWeekday', 11);\n\n// PARSING\n\n addRegexToken('d', match1to2);\n addRegexToken('e', match1to2);\n addRegexToken('E', match1to2);\n addRegexToken('dd', function (isStrict, locale) {\n return locale.weekdaysMinRegex(isStrict);\n });\n addRegexToken('ddd', function (isStrict, locale) {\n return locale.weekdaysShortRegex(isStrict);\n });\n addRegexToken('dddd', function (isStrict, locale) {\n return locale.weekdaysRegex(isStrict);\n });\n\n addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {\n var weekday = config._locale.weekdaysParse(input, token, config._strict);\n // if we didn't get a weekday name, mark the date as invalid\n if (weekday != null) {\n week.d = weekday;\n } else {\n getParsingFlags(config).invalidWeekday = input;\n }\n });\n\n addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {\n week[token] = toInt(input);\n });\n\n// HELPERS\n\n function parseWeekday(input, locale) {\n if (typeof input !== 'string') {\n return input;\n }\n\n if (!isNaN(input)) {\n return parseInt(input, 10);\n }\n\n input = locale.weekdaysParse(input);\n if (typeof input === 'number') {\n return input;\n }\n\n return null;\n }\n\n function parseIsoWeekday(input, locale) {\n if (typeof input === 'string') {\n return locale.weekdaysParse(input) % 7 || 7;\n }\n return isNaN(input) ? null : input;\n }\n\n// LOCALES\n\n var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');\n function localeWeekdays (m, format) {\n if (!m) {\n return isArray(this._weekdays) ? this._weekdays :\n this._weekdays['standalone'];\n }\n return isArray(this._weekdays) ? this._weekdays[m.day()] :\n this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()];\n }\n\n var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');\n function localeWeekdaysShort (m) {\n return (m) ? this._weekdaysShort[m.day()] : this._weekdaysShort;\n }\n\n var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');\n function localeWeekdaysMin (m) {\n return (m) ? this._weekdaysMin[m.day()] : this._weekdaysMin;\n }\n\n function handleStrictParse$1(weekdayName, format, strict) {\n var i, ii, mom, llc = weekdayName.toLocaleLowerCase();\n if (!this._weekdaysParse) {\n this._weekdaysParse = [];\n this._shortWeekdaysParse = [];\n this._minWeekdaysParse = [];\n\n for (i = 0; i < 7; ++i) {\n mom = createUTC([2000, 1]).day(i);\n this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();\n this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();\n this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();\n }\n }\n\n if (strict) {\n if (format === 'dddd') {\n ii = indexOf$1.call(this._weekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else if (format === 'ddd') {\n ii = indexOf$1.call(this._shortWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf$1.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n }\n } else {\n if (format === 'dddd') {\n ii = indexOf$1.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf$1.call(this._shortWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf$1.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else if (format === 'ddd') {\n ii = indexOf$1.call(this._shortWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf$1.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf$1.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf$1.call(this._minWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf$1.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf$1.call(this._shortWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n }\n }\n }\n\n function localeWeekdaysParse (weekdayName, format, strict) {\n var i, mom, regex;\n\n if (this._weekdaysParseExact) {\n return handleStrictParse$1.call(this, weekdayName, format, strict);\n }\n\n if (!this._weekdaysParse) {\n this._weekdaysParse = [];\n this._minWeekdaysParse = [];\n this._shortWeekdaysParse = [];\n this._fullWeekdaysParse = [];\n }\n\n for (i = 0; i < 7; i++) {\n // make the regex if we don't have it already\n\n mom = createUTC([2000, 1]).day(i);\n if (strict && !this._fullWeekdaysParse[i]) {\n this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\\.?') + '$', 'i');\n this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$', 'i');\n this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$', 'i');\n }\n if (!this._weekdaysParse[i]) {\n regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');\n this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');\n }\n // test the regex\n if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {\n return i;\n } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {\n return i;\n } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {\n return i;\n } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {\n return i;\n }\n }\n }\n\n// MOMENTS\n\n function getSetDayOfWeek (input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();\n if (input != null) {\n input = parseWeekday(input, this.localeData());\n return this.add(input - day, 'd');\n } else {\n return day;\n }\n }\n\n function getSetLocaleDayOfWeek (input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;\n return input == null ? weekday : this.add(input - weekday, 'd');\n }\n\n function getSetISODayOfWeek (input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n\n // behaves the same as moment#day except\n // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)\n // as a setter, sunday should belong to the previous week.\n\n if (input != null) {\n var weekday = parseIsoWeekday(input, this.localeData());\n return this.day(this.day() % 7 ? weekday : weekday - 7);\n } else {\n return this.day() || 7;\n }\n }\n\n var defaultWeekdaysRegex = matchWord;\n function weekdaysRegex (isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysStrictRegex;\n } else {\n return this._weekdaysRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n this._weekdaysRegex = defaultWeekdaysRegex;\n }\n return this._weekdaysStrictRegex && isStrict ?\n this._weekdaysStrictRegex : this._weekdaysRegex;\n }\n }\n\n var defaultWeekdaysShortRegex = matchWord;\n function weekdaysShortRegex (isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysShortStrictRegex;\n } else {\n return this._weekdaysShortRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysShortRegex')) {\n this._weekdaysShortRegex = defaultWeekdaysShortRegex;\n }\n return this._weekdaysShortStrictRegex && isStrict ?\n this._weekdaysShortStrictRegex : this._weekdaysShortRegex;\n }\n }\n\n var defaultWeekdaysMinRegex = matchWord;\n function weekdaysMinRegex (isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysMinStrictRegex;\n } else {\n return this._weekdaysMinRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysMinRegex')) {\n this._weekdaysMinRegex = defaultWeekdaysMinRegex;\n }\n return this._weekdaysMinStrictRegex && isStrict ?\n this._weekdaysMinStrictRegex : this._weekdaysMinRegex;\n }\n }\n\n\n function computeWeekdaysParse () {\n function cmpLenRev(a, b) {\n return b.length - a.length;\n }\n\n var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [],\n i, mom, minp, shortp, longp;\n for (i = 0; i < 7; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, 1]).day(i);\n minp = this.weekdaysMin(mom, '');\n shortp = this.weekdaysShort(mom, '');\n longp = this.weekdays(mom, '');\n minPieces.push(minp);\n shortPieces.push(shortp);\n longPieces.push(longp);\n mixedPieces.push(minp);\n mixedPieces.push(shortp);\n mixedPieces.push(longp);\n }\n // Sorting makes sure if one weekday (or abbr) is a prefix of another it\n // will match the longer piece.\n minPieces.sort(cmpLenRev);\n shortPieces.sort(cmpLenRev);\n longPieces.sort(cmpLenRev);\n mixedPieces.sort(cmpLenRev);\n for (i = 0; i < 7; i++) {\n shortPieces[i] = regexEscape(shortPieces[i]);\n longPieces[i] = regexEscape(longPieces[i]);\n mixedPieces[i] = regexEscape(mixedPieces[i]);\n }\n\n this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._weekdaysShortRegex = this._weekdaysRegex;\n this._weekdaysMinRegex = this._weekdaysRegex;\n\n this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');\n this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');\n this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i');\n }\n\n// FORMATTING\n\n function hFormat() {\n return this.hours() % 12 || 12;\n }\n\n function kFormat() {\n return this.hours() || 24;\n }\n\n addFormatToken('H', ['HH', 2], 0, 'hour');\n addFormatToken('h', ['hh', 2], 0, hFormat);\n addFormatToken('k', ['kk', 2], 0, kFormat);\n\n addFormatToken('hmm', 0, 0, function () {\n return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);\n });\n\n addFormatToken('hmmss', 0, 0, function () {\n return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) +\n zeroFill(this.seconds(), 2);\n });\n\n addFormatToken('Hmm', 0, 0, function () {\n return '' + this.hours() + zeroFill(this.minutes(), 2);\n });\n\n addFormatToken('Hmmss', 0, 0, function () {\n return '' + this.hours() + zeroFill(this.minutes(), 2) +\n zeroFill(this.seconds(), 2);\n });\n\n function meridiem (token, lowercase) {\n addFormatToken(token, 0, 0, function () {\n return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);\n });\n }\n\n meridiem('a', true);\n meridiem('A', false);\n\n// ALIASES\n\n addUnitAlias('hour', 'h');\n\n// PRIORITY\n addUnitPriority('hour', 13);\n\n// PARSING\n\n function matchMeridiem (isStrict, locale) {\n return locale._meridiemParse;\n }\n\n addRegexToken('a', matchMeridiem);\n addRegexToken('A', matchMeridiem);\n addRegexToken('H', match1to2);\n addRegexToken('h', match1to2);\n addRegexToken('k', match1to2);\n addRegexToken('HH', match1to2, match2);\n addRegexToken('hh', match1to2, match2);\n addRegexToken('kk', match1to2, match2);\n\n addRegexToken('hmm', match3to4);\n addRegexToken('hmmss', match5to6);\n addRegexToken('Hmm', match3to4);\n addRegexToken('Hmmss', match5to6);\n\n addParseToken(['H', 'HH'], HOUR);\n addParseToken(['k', 'kk'], function (input, array, config) {\n var kInput = toInt(input);\n array[HOUR] = kInput === 24 ? 0 : kInput;\n });\n addParseToken(['a', 'A'], function (input, array, config) {\n config._isPm = config._locale.isPM(input);\n config._meridiem = input;\n });\n addParseToken(['h', 'hh'], function (input, array, config) {\n array[HOUR] = toInt(input);\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('hmm', function (input, array, config) {\n var pos = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos));\n array[MINUTE] = toInt(input.substr(pos));\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('hmmss', function (input, array, config) {\n var pos1 = input.length - 4;\n var pos2 = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos1));\n array[MINUTE] = toInt(input.substr(pos1, 2));\n array[SECOND] = toInt(input.substr(pos2));\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('Hmm', function (input, array, config) {\n var pos = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos));\n array[MINUTE] = toInt(input.substr(pos));\n });\n addParseToken('Hmmss', function (input, array, config) {\n var pos1 = input.length - 4;\n var pos2 = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos1));\n array[MINUTE] = toInt(input.substr(pos1, 2));\n array[SECOND] = toInt(input.substr(pos2));\n });\n\n// LOCALES\n\n function localeIsPM (input) {\n // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays\n // Using charAt should be more compatible.\n return ((input + '').toLowerCase().charAt(0) === 'p');\n }\n\n var defaultLocaleMeridiemParse = /[ap]\\.?m?\\.?/i;\n function localeMeridiem (hours, minutes, isLower) {\n if (hours > 11) {\n return isLower ? 'pm' : 'PM';\n } else {\n return isLower ? 'am' : 'AM';\n }\n }\n\n\n// MOMENTS\n\n// Setting the hour should keep the time, because the user explicitly\n// specified which hour he wants. So trying to maintain the same hour (in\n// a new timezone) makes sense. Adding/subtracting hours does not follow\n// this rule.\n var getSetHour = makeGetSet('Hours', true);\n\n// months\n// week\n// weekdays\n// meridiem\n var baseConfig = {\n calendar: defaultCalendar,\n longDateFormat: defaultLongDateFormat,\n invalidDate: defaultInvalidDate,\n ordinal: defaultOrdinal,\n dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,\n relativeTime: defaultRelativeTime,\n\n months: defaultLocaleMonths,\n monthsShort: defaultLocaleMonthsShort,\n\n week: defaultLocaleWeek,\n\n weekdays: defaultLocaleWeekdays,\n weekdaysMin: defaultLocaleWeekdaysMin,\n weekdaysShort: defaultLocaleWeekdaysShort,\n\n meridiemParse: defaultLocaleMeridiemParse\n };\n\n// internal storage for locale config files\n var locales = {};\n var localeFamilies = {};\n var globalLocale;\n\n function normalizeLocale(key) {\n return key ? key.toLowerCase().replace('_', '-') : key;\n }\n\n// pick the locale from the array\n// try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n// substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n }\n\n function loadLocale(name) {\n var oldLocale = null;\n // TODO: Find a better way to register and load all the locales in Node\n if (!locales[name] && (typeof module !== 'undefined') &&\n module && module.exports) {\n try {\n oldLocale = globalLocale._abbr;\n require('./locale/' + name);\n // because defineLocale currently also sets the global locale, we\n // want to undo that for lazy loaded locales\n getSetGlobalLocale(oldLocale);\n } catch (e) { }\n }\n return locales[name];\n }\n\n// This function will load locale and then set the global locale. If\n// no arguments are passed in, it will simply return the current global\n// locale key.\n function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }\n\n function defineLocale (name, config) {\n if (config !== null) {\n var parentConfig = baseConfig;\n config.abbr = name;\n if (locales[name] != null) {\n deprecateSimple('defineLocaleOverride',\n 'use moment.updateLocale(localeName, config) to change ' +\n 'an existing locale. moment.defineLocale(localeName, ' +\n 'config) should only be used for creating a new locale ' +\n 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.');\n parentConfig = locales[name]._config;\n } else if (config.parentLocale != null) {\n if (locales[config.parentLocale] != null) {\n parentConfig = locales[config.parentLocale]._config;\n } else {\n if (!localeFamilies[config.parentLocale]) {\n localeFamilies[config.parentLocale] = [];\n }\n localeFamilies[config.parentLocale].push({\n name: name,\n config: config\n });\n return null;\n }\n }\n locales[name] = new Locale(mergeConfigs(parentConfig, config));\n\n if (localeFamilies[name]) {\n localeFamilies[name].forEach(function (x) {\n defineLocale(x.name, x.config);\n });\n }\n\n // backwards compat for now: also set the locale\n // make sure we set the locale AFTER all child locales have been\n // created, so we won't end up with the child locale set.\n getSetGlobalLocale(name);\n\n\n return locales[name];\n } else {\n // useful for testing\n delete locales[name];\n return null;\n }\n }\n\n function updateLocale(name, config) {\n if (config != null) {\n var locale, parentConfig = baseConfig;\n // MERGE\n if (locales[name] != null) {\n parentConfig = locales[name]._config;\n }\n config = mergeConfigs(parentConfig, config);\n locale = new Locale(config);\n locale.parentLocale = locales[name];\n locales[name] = locale;\n\n // backwards compat for now: also set the locale\n getSetGlobalLocale(name);\n } else {\n // pass null for config to unupdate, useful for tests\n if (locales[name] != null) {\n if (locales[name].parentLocale != null) {\n locales[name] = locales[name].parentLocale;\n } else if (locales[name] != null) {\n delete locales[name];\n }\n }\n }\n return locales[name];\n }\n\n// returns locale data\n function getLocale (key) {\n var locale;\n\n if (key && key._locale && key._locale._abbr) {\n key = key._locale._abbr;\n }\n\n if (!key) {\n return globalLocale;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n locale = loadLocale(key);\n if (locale) {\n return locale;\n }\n key = [key];\n }\n\n return chooseLocale(key);\n }\n\n function listLocales() {\n return keys$1(locales);\n }\n\n function checkOverflow (m) {\n var overflow;\n var a = m._a;\n\n if (a && getParsingFlags(m).overflow === -2) {\n overflow =\n a[MONTH] < 0 || a[MONTH] > 11 ? MONTH :\n a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE :\n a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :\n a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE :\n a[SECOND] < 0 || a[SECOND] > 59 ? SECOND :\n a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :\n -1;\n\n if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {\n overflow = DATE;\n }\n if (getParsingFlags(m)._overflowWeeks && overflow === -1) {\n overflow = WEEK;\n }\n if (getParsingFlags(m)._overflowWeekday && overflow === -1) {\n overflow = WEEKDAY;\n }\n\n getParsingFlags(m).overflow = overflow;\n }\n\n return m;\n }\n\n// iso 8601 regex\n// 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)\n var extendedIsoRegex = /^\\s*((?:[+-]\\d{6}|\\d{4})-(?:\\d\\d-\\d\\d|W\\d\\d-\\d|W\\d\\d|\\d\\d\\d|\\d\\d))(?:(T| )(\\d\\d(?::\\d\\d(?::\\d\\d(?:[.,]\\d+)?)?)?)([\\+\\-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/;\n var basicIsoRegex = /^\\s*((?:[+-]\\d{6}|\\d{4})(?:\\d\\d\\d\\d|W\\d\\d\\d|W\\d\\d|\\d\\d\\d|\\d\\d))(?:(T| )(\\d\\d(?:\\d\\d(?:\\d\\d(?:[.,]\\d+)?)?)?)([\\+\\-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/;\n\n var tzRegex = /Z|[+-]\\d\\d(?::?\\d\\d)?/;\n\n var isoDates = [\n ['YYYYYY-MM-DD', /[+-]\\d{6}-\\d\\d-\\d\\d/],\n ['YYYY-MM-DD', /\\d{4}-\\d\\d-\\d\\d/],\n ['GGGG-[W]WW-E', /\\d{4}-W\\d\\d-\\d/],\n ['GGGG-[W]WW', /\\d{4}-W\\d\\d/, false],\n ['YYYY-DDD', /\\d{4}-\\d{3}/],\n ['YYYY-MM', /\\d{4}-\\d\\d/, false],\n ['YYYYYYMMDD', /[+-]\\d{10}/],\n ['YYYYMMDD', /\\d{8}/],\n // YYYYMM is NOT allowed by the standard\n ['GGGG[W]WWE', /\\d{4}W\\d{3}/],\n ['GGGG[W]WW', /\\d{4}W\\d{2}/, false],\n ['YYYYDDD', /\\d{7}/]\n ];\n\n// iso time formats and regexes\n var isoTimes = [\n ['HH:mm:ss.SSSS', /\\d\\d:\\d\\d:\\d\\d\\.\\d+/],\n ['HH:mm:ss,SSSS', /\\d\\d:\\d\\d:\\d\\d,\\d+/],\n ['HH:mm:ss', /\\d\\d:\\d\\d:\\d\\d/],\n ['HH:mm', /\\d\\d:\\d\\d/],\n ['HHmmss.SSSS', /\\d\\d\\d\\d\\d\\d\\.\\d+/],\n ['HHmmss,SSSS', /\\d\\d\\d\\d\\d\\d,\\d+/],\n ['HHmmss', /\\d\\d\\d\\d\\d\\d/],\n ['HHmm', /\\d\\d\\d\\d/],\n ['HH', /\\d\\d/]\n ];\n\n var aspNetJsonRegex = /^\\/?Date\\((\\-?\\d+)/i;\n\n// date from iso format\n function configFromISO(config) {\n var i, l,\n string = config._i,\n match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),\n allowTime, dateFormat, timeFormat, tzFormat;\n\n if (match) {\n getParsingFlags(config).iso = true;\n\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(match[1])) {\n dateFormat = isoDates[i][0];\n allowTime = isoDates[i][2] !== false;\n break;\n }\n }\n if (dateFormat == null) {\n config._isValid = false;\n return;\n }\n if (match[3]) {\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(match[3])) {\n // match[2] should be 'T' or space\n timeFormat = (match[2] || ' ') + isoTimes[i][0];\n break;\n }\n }\n if (timeFormat == null) {\n config._isValid = false;\n return;\n }\n }\n if (!allowTime && timeFormat != null) {\n config._isValid = false;\n return;\n }\n if (match[4]) {\n if (tzRegex.exec(match[4])) {\n tzFormat = 'Z';\n } else {\n config._isValid = false;\n return;\n }\n }\n config._f = dateFormat + (timeFormat || '') + (tzFormat || '');\n configFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }\n\n// RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3\n var basicRfcRegex = /^((?:Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\\s)?(\\d?\\d\\s(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(?:\\d\\d)?\\d\\d\\s)(\\d\\d:\\d\\d)(\\:\\d\\d)?(\\s(?:UT|GMT|[ECMP][SD]T|[A-IK-Za-ik-z]|[+-]\\d{4}))$/;\n\n// date and time from ref 2822 format\n function configFromRFC2822(config) {\n var string, match, dayFormat,\n dateFormat, timeFormat, tzFormat;\n var timezones = {\n ' GMT': ' +0000',\n ' EDT': ' -0400',\n ' EST': ' -0500',\n ' CDT': ' -0500',\n ' CST': ' -0600',\n ' MDT': ' -0600',\n ' MST': ' -0700',\n ' PDT': ' -0700',\n ' PST': ' -0800'\n };\n var military = 'YXWVUTSRQPONZABCDEFGHIKLM';\n var timezone, timezoneIndex;\n\n string = config._i\n .replace(/\\([^\\)]*\\)|[\\n\\t]/g, ' ') // Remove comments and folding whitespace\n .replace(/(\\s\\s+)/g, ' ') // Replace multiple-spaces with a single space\n .replace(/^\\s|\\s$/g, ''); // Remove leading and trailing spaces\n match = basicRfcRegex.exec(string);\n\n if (match) {\n dayFormat = match[1] ? 'ddd' + ((match[1].length === 5) ? ', ' : ' ') : '';\n dateFormat = 'D MMM ' + ((match[2].length > 10) ? 'YYYY ' : 'YY ');\n timeFormat = 'HH:mm' + (match[4] ? ':ss' : '');\n\n // TODO: Replace the vanilla JS Date object with an indepentent day-of-week check.\n if (match[1]) { // day of week given\n var momentDate = new Date(match[2]);\n var momentDay = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'][momentDate.getDay()];\n\n if (match[1].substr(0,3) !== momentDay) {\n getParsingFlags(config).weekdayMismatch = true;\n config._isValid = false;\n return;\n }\n }\n\n switch (match[5].length) {\n case 2: // military\n if (timezoneIndex === 0) {\n timezone = ' +0000';\n } else {\n timezoneIndex = military.indexOf(match[5][1].toUpperCase()) - 12;\n timezone = ((timezoneIndex < 0) ? ' -' : ' +') +\n (('' + timezoneIndex).replace(/^-?/, '0')).match(/..$/)[0] + '00';\n }\n break;\n case 4: // Zone\n timezone = timezones[match[5]];\n break;\n default: // UT or +/-9999\n timezone = timezones[' GMT'];\n }\n match[5] = timezone;\n config._i = match.splice(1).join('');\n tzFormat = ' ZZ';\n config._f = dayFormat + dateFormat + timeFormat + tzFormat;\n configFromStringAndFormat(config);\n getParsingFlags(config).rfc2822 = true;\n } else {\n config._isValid = false;\n }\n }\n\n// date from iso format or fallback\n function configFromString(config) {\n var matched = aspNetJsonRegex.exec(config._i);\n\n if (matched !== null) {\n config._d = new Date(+matched[1]);\n return;\n }\n\n configFromISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n } else {\n return;\n }\n\n configFromRFC2822(config);\n if (config._isValid === false) {\n delete config._isValid;\n } else {\n return;\n }\n\n // Final attempt, use Input Fallback\n hooks.createFromInputFallback(config);\n }\n\n hooks.createFromInputFallback = deprecate(\n 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +\n 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +\n 'discouraged and will be removed in an upcoming major release. Please refer to ' +\n 'http://momentjs.com/guides/#/warnings/js-date/ for more info.',\n function (config) {\n config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));\n }\n );\n\n// Pick the first defined of two or three arguments.\n function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }\n\n function currentDateArray(config) {\n // hooks is actually the exported moment object\n var nowValue = new Date(hooks.now());\n if (config._useUTC) {\n return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];\n }\n return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];\n }\n\n// convert an array to a date.\n// the array should mirror the parameters below\n// note: all values past the year are optional and will default to the lowest possible value.\n// [year, month, day , hour, minute, second, millisecond]\n function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }\n\n function dayOfYearFromWeekInfo(config) {\n var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;\n\n w = config._w;\n if (w.GG != null || w.W != null || w.E != null) {\n dow = 1;\n doy = 4;\n\n // TODO: We need to take the current isoWeekYear, but that depends on\n // how we interpret now (local, utc, fixed offset). So create\n // a now version of current config (take local/utc/offset flags, and\n // create now).\n weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year);\n week = defaults(w.W, 1);\n weekday = defaults(w.E, 1);\n if (weekday < 1 || weekday > 7) {\n weekdayOverflow = true;\n }\n } else {\n dow = config._locale._week.dow;\n doy = config._locale._week.doy;\n\n var curWeek = weekOfYear(createLocal(), dow, doy);\n\n weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);\n\n // Default to current week.\n week = defaults(w.w, curWeek.week);\n\n if (w.d != null) {\n // weekday -- low day numbers are considered next week\n weekday = w.d;\n if (weekday < 0 || weekday > 6) {\n weekdayOverflow = true;\n }\n } else if (w.e != null) {\n // local weekday -- counting starts from begining of week\n weekday = w.e + dow;\n if (w.e < 0 || w.e > 6) {\n weekdayOverflow = true;\n }\n } else {\n // default to begining of week\n weekday = dow;\n }\n }\n if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {\n getParsingFlags(config)._overflowWeeks = true;\n } else if (weekdayOverflow != null) {\n getParsingFlags(config)._overflowWeekday = true;\n } else {\n temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);\n config._a[YEAR] = temp.year;\n config._dayOfYear = temp.dayOfYear;\n }\n }\n\n// constant that refers to the ISO standard\n hooks.ISO_8601 = function () {};\n\n// constant that refers to the RFC 2822 form\n hooks.RFC_2822 = function () {};\n\n// date from string and format string\n function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n }\n\n\n function meridiemFixWrap (locale, hour, meridiem) {\n var isPm;\n\n if (meridiem == null) {\n // nothing to do\n return hour;\n }\n if (locale.meridiemHour != null) {\n return locale.meridiemHour(hour, meridiem);\n } else if (locale.isPM != null) {\n // Fallback\n isPm = locale.isPM(meridiem);\n if (isPm && hour < 12) {\n hour += 12;\n }\n if (!isPm && hour === 12) {\n hour = 0;\n }\n return hour;\n } else {\n // this is not supposed to happen\n return hour;\n }\n }\n\n// date from string and array of format strings\n function configFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n getParsingFlags(config).invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._f = config._f[i];\n configFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += getParsingFlags(tempConfig).charsLeftOver;\n\n //or tokens\n currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;\n\n getParsingFlags(tempConfig).score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }\n\n function configFromObject(config) {\n if (config._d) {\n return;\n }\n\n var i = normalizeObjectUnits(config._i);\n config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) {\n return obj && parseInt(obj, 10);\n });\n\n configFromArray(config);\n }\n\n function createFromConfig (config) {\n var res = new Moment(checkOverflow(prepareConfig(config)));\n if (res._nextDay) {\n // Adding is smart enough around DST\n res.add(1, 'd');\n res._nextDay = undefined;\n }\n\n return res;\n }\n\n function prepareConfig (config) {\n var input = config._i,\n format = config._f;\n\n config._locale = config._locale || getLocale(config._l);\n\n if (input === null || (format === undefined && input === '')) {\n return createInvalid({nullInput: true});\n }\n\n if (typeof input === 'string') {\n config._i = input = config._locale.preparse(input);\n }\n\n if (isMoment(input)) {\n return new Moment(checkOverflow(input));\n } else if (isDate(input)) {\n config._d = input;\n } else if (isArray(format)) {\n configFromStringAndArray(config);\n } else if (format) {\n configFromStringAndFormat(config);\n } else {\n configFromInput(config);\n }\n\n if (!isValid(config)) {\n config._d = null;\n }\n\n return config;\n }\n\n function configFromInput(config) {\n var input = config._i;\n if (isUndefined(input)) {\n config._d = new Date(hooks.now());\n } else if (isDate(input)) {\n config._d = new Date(input.valueOf());\n } else if (typeof input === 'string') {\n configFromString(config);\n } else if (isArray(input)) {\n config._a = map(input.slice(0), function (obj) {\n return parseInt(obj, 10);\n });\n configFromArray(config);\n } else if (isObject(input)) {\n configFromObject(config);\n } else if (isNumber(input)) {\n // from milliseconds\n config._d = new Date(input);\n } else {\n hooks.createFromInputFallback(config);\n }\n }\n\n function createLocalOrUTC (input, format, locale, strict, isUTC) {\n var c = {};\n\n if (locale === true || locale === false) {\n strict = locale;\n locale = undefined;\n }\n\n if ((isObject(input) && isObjectEmpty(input)) ||\n (isArray(input) && input.length === 0)) {\n input = undefined;\n }\n // object construction must be done this way.\n // https://github.com/moment/moment/issues/1423\n c._isAMomentObject = true;\n c._useUTC = c._isUTC = isUTC;\n c._l = locale;\n c._i = input;\n c._f = format;\n c._strict = strict;\n\n return createFromConfig(c);\n }\n\n function createLocal (input, format, locale, strict) {\n return createLocalOrUTC(input, format, locale, strict, false);\n }\n\n var prototypeMin = deprecate(\n 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',\n function () {\n var other = createLocal.apply(null, arguments);\n if (this.isValid() && other.isValid()) {\n return other < this ? this : other;\n } else {\n return createInvalid();\n }\n }\n );\n\n var prototypeMax = deprecate(\n 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',\n function () {\n var other = createLocal.apply(null, arguments);\n if (this.isValid() && other.isValid()) {\n return other > this ? this : other;\n } else {\n return createInvalid();\n }\n }\n );\n\n// Pick a moment m from moments so that m[fn](other) is true for all\n// other. This relies on the function fn to be transitive.\n//\n// moments should either be an array of moment objects or an array, whose\n// first element is an array of moment objects.\n function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }\n\n// TODO: Use [].sort instead?\n function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n }\n\n function max () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isAfter', args);\n }\n\n var now = function () {\n return Date.now ? Date.now() : +(new Date());\n };\n\n var ordering = ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond'];\n\n function isDurationValid(m) {\n for (var key in m) {\n if (!(ordering.indexOf(key) !== -1 && (m[key] == null || !isNaN(m[key])))) {\n return false;\n }\n }\n\n var unitHasDecimal = false;\n for (var i = 0; i < ordering.length; ++i) {\n if (m[ordering[i]]) {\n if (unitHasDecimal) {\n return false; // only allow non-integers for smallest unit\n }\n if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {\n unitHasDecimal = true;\n }\n }\n }\n\n return true;\n }\n\n function isValid$1() {\n return this._isValid;\n }\n\n function createInvalid$1() {\n return createDuration(NaN);\n }\n\n function Duration (duration) {\n var normalizedInput = normalizeObjectUnits(duration),\n years = normalizedInput.year || 0,\n quarters = normalizedInput.quarter || 0,\n months = normalizedInput.month || 0,\n weeks = normalizedInput.week || 0,\n days = normalizedInput.day || 0,\n hours = normalizedInput.hour || 0,\n minutes = normalizedInput.minute || 0,\n seconds = normalizedInput.second || 0,\n milliseconds = normalizedInput.millisecond || 0;\n\n this._isValid = isDurationValid(normalizedInput);\n\n // representation for dateAddRemove\n this._milliseconds = +milliseconds +\n seconds * 1e3 + // 1000\n minutes * 6e4 + // 1000 * 60\n hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978\n // Because of dateAddRemove treats 24 hours as different from a\n // day when working around DST, we need to store them separately\n this._days = +days +\n weeks * 7;\n // It is impossible translate months into days without knowing\n // which months you are are talking about, so we have to store\n // it separately.\n this._months = +months +\n quarters * 3 +\n years * 12;\n\n this._data = {};\n\n this._locale = getLocale();\n\n this._bubble();\n }\n\n function isDuration (obj) {\n return obj instanceof Duration;\n }\n\n function absRound (number) {\n if (number < 0) {\n return Math.round(-1 * number) * -1;\n } else {\n return Math.round(number);\n }\n }\n\n// FORMATTING\n\n function offset (token, separator) {\n addFormatToken(token, 0, 0, function () {\n var offset = this.utcOffset();\n var sign = '+';\n if (offset < 0) {\n offset = -offset;\n sign = '-';\n }\n return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);\n });\n }\n\n offset('Z', ':');\n offset('ZZ', '');\n\n// PARSING\n\n addRegexToken('Z', matchShortOffset);\n addRegexToken('ZZ', matchShortOffset);\n addParseToken(['Z', 'ZZ'], function (input, array, config) {\n config._useUTC = true;\n config._tzm = offsetFromString(matchShortOffset, input);\n });\n\n// HELPERS\n\n// timezone chunker\n// '+10:00' > ['10', '00']\n// '-1530' > ['-15', '30']\n var chunkOffset = /([\\+\\-]|\\d\\d)/gi;\n\n function offsetFromString(matcher, string) {\n var matches = (string || '').match(matcher);\n\n if (matches === null) {\n return null;\n }\n\n var chunk = matches[matches.length - 1] || [];\n var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];\n var minutes = +(parts[1] * 60) + toInt(parts[2]);\n\n return minutes === 0 ?\n 0 :\n parts[0] === '+' ? minutes : -minutes;\n }\n\n// Return a moment from input, that is local/utc/zone equivalent to model.\n function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(res._d.valueOf() + diff);\n hooks.updateOffset(res, false);\n return res;\n } else {\n return createLocal(input).local();\n }\n }\n\n function getDateOffset (m) {\n // On Firefox.24 Date#getTimezoneOffset returns a floating point.\n // https://github.com/moment/moment/pull/1871\n return -Math.round(m._d.getTimezoneOffset() / 15) * 15;\n }\n\n// HOOKS\n\n// This function will be called whenever a moment is mutated.\n// It is intended to keep the offset in sync with the timezone.\n hooks.updateOffset = function () {};\n\n// MOMENTS\n\n// keepLocalTime = true means only change the timezone, without\n// affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->\n// 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset\n// +0200, so we adjust the time as needed, to be valid.\n//\n// Keeping the time actually adds/subtracts (one hour)\n// from the actual represented time. That is why we call updateOffset\n// a second time. In case it wants us to change the offset again\n// _changeInProgress == true case, then we have to adjust, because\n// there is no such time in the given timezone.\n function getSetOffset (input, keepLocalTime, keepMinutes) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16 && !keepMinutes) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }\n\n function getSetZone (input, keepLocalTime) {\n if (input != null) {\n if (typeof input !== 'string') {\n input = -input;\n }\n\n this.utcOffset(input, keepLocalTime);\n\n return this;\n } else {\n return -this.utcOffset();\n }\n }\n\n function setOffsetToUTC (keepLocalTime) {\n return this.utcOffset(0, keepLocalTime);\n }\n\n function setOffsetToLocal (keepLocalTime) {\n if (this._isUTC) {\n this.utcOffset(0, keepLocalTime);\n this._isUTC = false;\n\n if (keepLocalTime) {\n this.subtract(getDateOffset(this), 'm');\n }\n }\n return this;\n }\n\n function setOffsetToParsedOffset () {\n if (this._tzm != null) {\n this.utcOffset(this._tzm, false, true);\n } else if (typeof this._i === 'string') {\n var tZone = offsetFromString(matchOffset, this._i);\n if (tZone != null) {\n this.utcOffset(tZone);\n }\n else {\n this.utcOffset(0, true);\n }\n }\n return this;\n }\n\n function hasAlignedHourOffset (input) {\n if (!this.isValid()) {\n return false;\n }\n input = input ? createLocal(input).utcOffset() : 0;\n\n return (this.utcOffset() - input) % 60 === 0;\n }\n\n function isDaylightSavingTime () {\n return (\n this.utcOffset() > this.clone().month(0).utcOffset() ||\n this.utcOffset() > this.clone().month(5).utcOffset()\n );\n }\n\n function isDaylightSavingTimeShifted () {\n if (!isUndefined(this._isDSTShifted)) {\n return this._isDSTShifted;\n }\n\n var c = {};\n\n copyConfig(c, this);\n c = prepareConfig(c);\n\n if (c._a) {\n var other = c._isUTC ? createUTC(c._a) : createLocal(c._a);\n this._isDSTShifted = this.isValid() &&\n compareArrays(c._a, other.toArray()) > 0;\n } else {\n this._isDSTShifted = false;\n }\n\n return this._isDSTShifted;\n }\n\n function isLocal () {\n return this.isValid() ? !this._isUTC : false;\n }\n\n function isUtcOffset () {\n return this.isValid() ? this._isUTC : false;\n }\n\n function isUtc () {\n return this.isValid() ? this._isUTC && this._offset === 0 : false;\n }\n\n// ASP.NET json date format regex\n var aspNetRegex = /^(\\-)?(?:(\\d*)[. ])?(\\d+)\\:(\\d+)(?:\\:(\\d+)(\\.\\d*)?)?$/;\n\n// from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html\n// somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere\n// and further modified to allow for strings containing both week and day\n var isoRegex = /^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;\n\n function createDuration (input, key) {\n var duration = input,\n // matching against regexp is expensive, do it on demand\n match = null,\n sign,\n ret,\n diffRes;\n\n if (isDuration(input)) {\n duration = {\n ms : input._milliseconds,\n d : input._days,\n M : input._months\n };\n } else if (isNumber(input)) {\n duration = {};\n if (key) {\n duration[key] = input;\n } else {\n duration.milliseconds = input;\n }\n } else if (!!(match = aspNetRegex.exec(input))) {\n sign = (match[1] === '-') ? -1 : 1;\n duration = {\n y : 0,\n d : toInt(match[DATE]) * sign,\n h : toInt(match[HOUR]) * sign,\n m : toInt(match[MINUTE]) * sign,\n s : toInt(match[SECOND]) * sign,\n ms : toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match\n };\n } else if (!!(match = isoRegex.exec(input))) {\n sign = (match[1] === '-') ? -1 : 1;\n duration = {\n y : parseIso(match[2], sign),\n M : parseIso(match[3], sign),\n w : parseIso(match[4], sign),\n d : parseIso(match[5], sign),\n h : parseIso(match[6], sign),\n m : parseIso(match[7], sign),\n s : parseIso(match[8], sign)\n };\n } else if (duration == null) {// checks for null or undefined\n duration = {};\n } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {\n diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to));\n\n duration = {};\n duration.ms = diffRes.milliseconds;\n duration.M = diffRes.months;\n }\n\n ret = new Duration(duration);\n\n if (isDuration(input) && hasOwnProp(input, '_locale')) {\n ret._locale = input._locale;\n }\n\n return ret;\n }\n\n createDuration.fn = Duration.prototype;\n createDuration.invalid = createInvalid$1;\n\n function parseIso (inp, sign) {\n // We'd normally use ~~inp for this, but unfortunately it also\n // converts floats to ints.\n // inp may be undefined, so careful calling replace on it.\n var res = inp && parseFloat(inp.replace(',', '.'));\n // apply sign while we're at it\n return (isNaN(res) ? 0 : res) * sign;\n }\n\n function positiveMomentsDifference(base, other) {\n var res = {milliseconds: 0, months: 0};\n\n res.months = other.month() - base.month() +\n (other.year() - base.year()) * 12;\n if (base.clone().add(res.months, 'M').isAfter(other)) {\n --res.months;\n }\n\n res.milliseconds = +other - +(base.clone().add(res.months, 'M'));\n\n return res;\n }\n\n function momentsDifference(base, other) {\n var res;\n if (!(base.isValid() && other.isValid())) {\n return {milliseconds: 0, months: 0};\n }\n\n other = cloneWithOffset(other, base);\n if (base.isBefore(other)) {\n res = positiveMomentsDifference(base, other);\n } else {\n res = positiveMomentsDifference(other, base);\n res.milliseconds = -res.milliseconds;\n res.months = -res.months;\n }\n\n return res;\n }\n\n// TODO: remove 'name' arg after deprecation is removed\n function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n tmp = val; val = period; period = tmp;\n }\n\n val = typeof val === 'string' ? +val : val;\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }\n\n function addSubtract (mom, duration, isAdding, updateOffset) {\n var milliseconds = duration._milliseconds,\n days = absRound(duration._days),\n months = absRound(duration._months);\n\n if (!mom.isValid()) {\n // No op\n return;\n }\n\n updateOffset = updateOffset == null ? true : updateOffset;\n\n if (milliseconds) {\n mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);\n }\n if (days) {\n set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);\n }\n if (months) {\n setMonth(mom, get(mom, 'Month') + months * isAdding);\n }\n if (updateOffset) {\n hooks.updateOffset(mom, days || months);\n }\n }\n\n var add = createAdder(1, 'add');\n var subtract = createAdder(-1, 'subtract');\n\n function getCalendarFormat(myMoment, now) {\n var diff = myMoment.diff(now, 'days', true);\n return diff < -6 ? 'sameElse' :\n diff < -1 ? 'lastWeek' :\n diff < 0 ? 'lastDay' :\n diff < 1 ? 'sameDay' :\n diff < 2 ? 'nextDay' :\n diff < 7 ? 'nextWeek' : 'sameElse';\n }\n\n function calendar$1 (time, formats) {\n // We want to compare the start of today, vs this.\n // Getting start-of-today depends on whether we're local/utc/offset or not.\n var now = time || createLocal(),\n sod = cloneWithOffset(now, this).startOf('day'),\n format = hooks.calendarFormat(this, sod) || 'sameElse';\n\n var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);\n\n return this.format(output || this.localeData().calendar(format, this, createLocal(now)));\n }\n\n function clone () {\n return new Moment(this);\n }\n\n function isAfter (input, units) {\n var localInput = isMoment(input) ? input : createLocal(input);\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');\n if (units === 'millisecond') {\n return this.valueOf() > localInput.valueOf();\n } else {\n return localInput.valueOf() < this.clone().startOf(units).valueOf();\n }\n }\n\n function isBefore (input, units) {\n var localInput = isMoment(input) ? input : createLocal(input);\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');\n if (units === 'millisecond') {\n return this.valueOf() < localInput.valueOf();\n } else {\n return this.clone().endOf(units).valueOf() < localInput.valueOf();\n }\n }\n\n function isBetween (from, to, units, inclusivity) {\n inclusivity = inclusivity || '()';\n return (inclusivity[0] === '(' ? this.isAfter(from, units) : !this.isBefore(from, units)) &&\n (inclusivity[1] === ')' ? this.isBefore(to, units) : !this.isAfter(to, units));\n }\n\n function isSame (input, units) {\n var localInput = isMoment(input) ? input : createLocal(input),\n inputMs;\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(units || 'millisecond');\n if (units === 'millisecond') {\n return this.valueOf() === localInput.valueOf();\n } else {\n inputMs = localInput.valueOf();\n return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();\n }\n }\n\n function isSameOrAfter (input, units) {\n return this.isSame(input, units) || this.isAfter(input,units);\n }\n\n function isSameOrBefore (input, units) {\n return this.isSame(input, units) || this.isBefore(input,units);\n }\n\n function diff (input, units, asFloat) {\n var that,\n zoneDelta,\n delta, output;\n\n if (!this.isValid()) {\n return NaN;\n }\n\n that = cloneWithOffset(input, this);\n\n if (!that.isValid()) {\n return NaN;\n }\n\n zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;\n\n units = normalizeUnits(units);\n\n if (units === 'year' || units === 'month' || units === 'quarter') {\n output = monthDiff(this, that);\n if (units === 'quarter') {\n output = output / 3;\n } else if (units === 'year') {\n output = output / 12;\n }\n } else {\n delta = this - that;\n output = units === 'second' ? delta / 1e3 : // 1000\n units === 'minute' ? delta / 6e4 : // 1000 * 60\n units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60\n units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst\n units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst\n delta;\n }\n return asFloat ? output : absFloor(output);\n }\n\n function monthDiff (a, b) {\n // difference in months\n var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),\n // b is in (anchor - 1 month, anchor + 1 month)\n anchor = a.clone().add(wholeMonthDiff, 'months'),\n anchor2, adjust;\n\n if (b - anchor < 0) {\n anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');\n // linear across the month\n adjust = (b - anchor) / (anchor - anchor2);\n } else {\n anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');\n // linear across the month\n adjust = (b - anchor) / (anchor2 - anchor);\n }\n\n //check for negative zero, return zero if negative zero\n return -(wholeMonthDiff + adjust) || 0;\n }\n\n hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';\n hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';\n\n function toString () {\n return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');\n }\n\n function toISOString() {\n if (!this.isValid()) {\n return null;\n }\n var m = this.clone().utc();\n if (m.year() < 0 || m.year() > 9999) {\n return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');\n }\n if (isFunction(Date.prototype.toISOString)) {\n // native implementation is ~50x faster, use it when we can\n return this.toDate().toISOString();\n }\n return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');\n }\n\n /**\n * Return a human readable representation of a moment that can\n * also be evaluated to get a new moment which is the same\n *\n * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects\n */\n function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n }\n\n function format (inputString) {\n if (!inputString) {\n inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;\n }\n var output = formatMoment(this, inputString);\n return this.localeData().postformat(output);\n }\n\n function from (time, withoutSuffix) {\n if (this.isValid() &&\n ((isMoment(time) && time.isValid()) ||\n createLocal(time).isValid())) {\n return createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);\n } else {\n return this.localeData().invalidDate();\n }\n }\n\n function fromNow (withoutSuffix) {\n return this.from(createLocal(), withoutSuffix);\n }\n\n function to (time, withoutSuffix) {\n if (this.isValid() &&\n ((isMoment(time) && time.isValid()) ||\n createLocal(time).isValid())) {\n return createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix);\n } else {\n return this.localeData().invalidDate();\n }\n }\n\n function toNow (withoutSuffix) {\n return this.to(createLocal(), withoutSuffix);\n }\n\n// If passed a locale key, it will set the locale for this\n// instance. Otherwise, it will return the locale configuration\n// variables for this instance.\n function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n }\n\n var lang = deprecate(\n 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',\n function (key) {\n if (key === undefined) {\n return this.localeData();\n } else {\n return this.locale(key);\n }\n }\n );\n\n function localeData () {\n return this._locale;\n }\n\n function startOf (units) {\n units = normalizeUnits(units);\n // the following switch intentionally omits break keywords\n // to utilize falling through the cases.\n switch (units) {\n case 'year':\n this.month(0);\n\t\t\t\t/* falls through */\n case 'quarter':\n case 'month':\n this.date(1);\n\t\t\t\t/* falls through */\n case 'week':\n case 'isoWeek':\n case 'day':\n case 'date':\n this.hours(0);\n\t\t\t\t/* falls through */\n case 'hour':\n this.minutes(0);\n\t\t\t\t/* falls through */\n case 'minute':\n this.seconds(0);\n\t\t\t\t/* falls through */\n case 'second':\n this.milliseconds(0);\n }\n\n // weeks are a special case\n if (units === 'week') {\n this.weekday(0);\n }\n if (units === 'isoWeek') {\n this.isoWeekday(1);\n }\n\n // quarters are also special\n if (units === 'quarter') {\n this.month(Math.floor(this.month() / 3) * 3);\n }\n\n return this;\n }\n\n function endOf (units) {\n units = normalizeUnits(units);\n if (units === undefined || units === 'millisecond') {\n return this;\n }\n\n // 'date' is an alias for 'day', so it should be considered as such.\n if (units === 'date') {\n units = 'day';\n }\n\n return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms');\n }\n\n function valueOf () {\n return this._d.valueOf() - ((this._offset || 0) * 60000);\n }\n\n function unix () {\n return Math.floor(this.valueOf() / 1000);\n }\n\n function toDate () {\n return new Date(this.valueOf());\n }\n\n function toArray () {\n var m = this;\n return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];\n }\n\n function toObject () {\n var m = this;\n return {\n years: m.year(),\n months: m.month(),\n date: m.date(),\n hours: m.hours(),\n minutes: m.minutes(),\n seconds: m.seconds(),\n milliseconds: m.milliseconds()\n };\n }\n\n function toJSON () {\n // new Date(NaN).toJSON() === null\n return this.isValid() ? this.toISOString() : null;\n }\n\n function isValid$2 () {\n return isValid(this);\n }\n\n function parsingFlags () {\n return extend({}, getParsingFlags(this));\n }\n\n function invalidAt () {\n return getParsingFlags(this).overflow;\n }\n\n function creationData() {\n return {\n input: this._i,\n format: this._f,\n locale: this._locale,\n isUTC: this._isUTC,\n strict: this._strict\n };\n }\n\n// FORMATTING\n\n addFormatToken(0, ['gg', 2], 0, function () {\n return this.weekYear() % 100;\n });\n\n addFormatToken(0, ['GG', 2], 0, function () {\n return this.isoWeekYear() % 100;\n });\n\n function addWeekYearFormatToken (token, getter) {\n addFormatToken(0, [token, token.length], 0, getter);\n }\n\n addWeekYearFormatToken('gggg', 'weekYear');\n addWeekYearFormatToken('ggggg', 'weekYear');\n addWeekYearFormatToken('GGGG', 'isoWeekYear');\n addWeekYearFormatToken('GGGGG', 'isoWeekYear');\n\n// ALIASES\n\n addUnitAlias('weekYear', 'gg');\n addUnitAlias('isoWeekYear', 'GG');\n\n// PRIORITY\n\n addUnitPriority('weekYear', 1);\n addUnitPriority('isoWeekYear', 1);\n\n\n// PARSING\n\n addRegexToken('G', matchSigned);\n addRegexToken('g', matchSigned);\n addRegexToken('GG', match1to2, match2);\n addRegexToken('gg', match1to2, match2);\n addRegexToken('GGGG', match1to4, match4);\n addRegexToken('gggg', match1to4, match4);\n addRegexToken('GGGGG', match1to6, match6);\n addRegexToken('ggggg', match1to6, match6);\n\n addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {\n week[token.substr(0, 2)] = toInt(input);\n });\n\n addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {\n week[token] = hooks.parseTwoDigitYear(input);\n });\n\n// MOMENTS\n\n function getSetWeekYear (input) {\n return getSetWeekYearHelper.call(this,\n input,\n this.week(),\n this.weekday(),\n this.localeData()._week.dow,\n this.localeData()._week.doy);\n }\n\n function getSetISOWeekYear (input) {\n return getSetWeekYearHelper.call(this,\n input, this.isoWeek(), this.isoWeekday(), 1, 4);\n }\n\n function getISOWeeksInYear () {\n return weeksInYear(this.year(), 1, 4);\n }\n\n function getWeeksInYear () {\n var weekInfo = this.localeData()._week;\n return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);\n }\n\n function getSetWeekYearHelper(input, week, weekday, dow, doy) {\n var weeksTarget;\n if (input == null) {\n return weekOfYear(this, dow, doy).year;\n } else {\n weeksTarget = weeksInYear(input, dow, doy);\n if (week > weeksTarget) {\n week = weeksTarget;\n }\n return setWeekAll.call(this, input, week, weekday, dow, doy);\n }\n }\n\n function setWeekAll(weekYear, week, weekday, dow, doy) {\n var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),\n date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);\n\n this.year(date.getUTCFullYear());\n this.month(date.getUTCMonth());\n this.date(date.getUTCDate());\n return this;\n }\n\n// FORMATTING\n\n addFormatToken('Q', 0, 'Qo', 'quarter');\n\n// ALIASES\n\n addUnitAlias('quarter', 'Q');\n\n// PRIORITY\n\n addUnitPriority('quarter', 7);\n\n// PARSING\n\n addRegexToken('Q', match1);\n addParseToken('Q', function (input, array) {\n array[MONTH] = (toInt(input) - 1) * 3;\n });\n\n// MOMENTS\n\n function getSetQuarter (input) {\n return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);\n }\n\n// FORMATTING\n\n addFormatToken('D', ['DD', 2], 'Do', 'date');\n\n// ALIASES\n\n addUnitAlias('date', 'D');\n\n// PRIOROITY\n addUnitPriority('date', 9);\n\n// PARSING\n\n addRegexToken('D', match1to2);\n addRegexToken('DD', match1to2, match2);\n addRegexToken('Do', function (isStrict, locale) {\n // TODO: Remove \"ordinalParse\" fallback in next major release.\n return isStrict ?\n (locale._dayOfMonthOrdinalParse || locale._ordinalParse) :\n locale._dayOfMonthOrdinalParseLenient;\n });\n\n addParseToken(['D', 'DD'], DATE);\n addParseToken('Do', function (input, array) {\n array[DATE] = toInt(input.match(match1to2)[0], 10);\n });\n\n// MOMENTS\n\n var getSetDayOfMonth = makeGetSet('Date', true);\n\n// FORMATTING\n\n addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');\n\n// ALIASES\n\n addUnitAlias('dayOfYear', 'DDD');\n\n// PRIORITY\n addUnitPriority('dayOfYear', 4);\n\n// PARSING\n\n addRegexToken('DDD', match1to3);\n addRegexToken('DDDD', match3);\n addParseToken(['DDD', 'DDDD'], function (input, array, config) {\n config._dayOfYear = toInt(input);\n });\n\n// HELPERS\n\n// MOMENTS\n\n function getSetDayOfYear (input) {\n var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;\n return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');\n }\n\n// FORMATTING\n\n addFormatToken('m', ['mm', 2], 0, 'minute');\n\n// ALIASES\n\n addUnitAlias('minute', 'm');\n\n// PRIORITY\n\n addUnitPriority('minute', 14);\n\n// PARSING\n\n addRegexToken('m', match1to2);\n addRegexToken('mm', match1to2, match2);\n addParseToken(['m', 'mm'], MINUTE);\n\n// MOMENTS\n\n var getSetMinute = makeGetSet('Minutes', false);\n\n// FORMATTING\n\n addFormatToken('s', ['ss', 2], 0, 'second');\n\n// ALIASES\n\n addUnitAlias('second', 's');\n\n// PRIORITY\n\n addUnitPriority('second', 15);\n\n// PARSING\n\n addRegexToken('s', match1to2);\n addRegexToken('ss', match1to2, match2);\n addParseToken(['s', 'ss'], SECOND);\n\n// MOMENTS\n\n var getSetSecond = makeGetSet('Seconds', false);\n\n// FORMATTING\n\n addFormatToken('S', 0, 0, function () {\n return ~~(this.millisecond() / 100);\n });\n\n addFormatToken(0, ['SS', 2], 0, function () {\n return ~~(this.millisecond() / 10);\n });\n\n addFormatToken(0, ['SSS', 3], 0, 'millisecond');\n addFormatToken(0, ['SSSS', 4], 0, function () {\n return this.millisecond() * 10;\n });\n addFormatToken(0, ['SSSSS', 5], 0, function () {\n return this.millisecond() * 100;\n });\n addFormatToken(0, ['SSSSSS', 6], 0, function () {\n return this.millisecond() * 1000;\n });\n addFormatToken(0, ['SSSSSSS', 7], 0, function () {\n return this.millisecond() * 10000;\n });\n addFormatToken(0, ['SSSSSSSS', 8], 0, function () {\n return this.millisecond() * 100000;\n });\n addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {\n return this.millisecond() * 1000000;\n });\n\n\n// ALIASES\n\n addUnitAlias('millisecond', 'ms');\n\n// PRIORITY\n\n addUnitPriority('millisecond', 16);\n\n// PARSING\n\n addRegexToken('S', match1to3, match1);\n addRegexToken('SS', match1to3, match2);\n addRegexToken('SSS', match1to3, match3);\n\n var token;\n for (token = 'SSSS'; token.length <= 9; token += 'S') {\n addRegexToken(token, matchUnsigned);\n }\n\n function parseMs(input, array) {\n array[MILLISECOND] = toInt(('0.' + input) * 1000);\n }\n\n for (token = 'S'; token.length <= 9; token += 'S') {\n addParseToken(token, parseMs);\n }\n// MOMENTS\n\n var getSetMillisecond = makeGetSet('Milliseconds', false);\n\n// FORMATTING\n\n addFormatToken('z', 0, 0, 'zoneAbbr');\n addFormatToken('zz', 0, 0, 'zoneName');\n\n// MOMENTS\n\n function getZoneAbbr () {\n return this._isUTC ? 'UTC' : '';\n }\n\n function getZoneName () {\n return this._isUTC ? 'Coordinated Universal Time' : '';\n }\n\n var proto = Moment.prototype;\n\n proto.add = add;\n proto.calendar = calendar$1;\n proto.clone = clone;\n proto.diff = diff;\n proto.endOf = endOf;\n proto.format = format;\n proto.from = from;\n proto.fromNow = fromNow;\n proto.to = to;\n proto.toNow = toNow;\n proto.get = stringGet;\n proto.invalidAt = invalidAt;\n proto.isAfter = isAfter;\n proto.isBefore = isBefore;\n proto.isBetween = isBetween;\n proto.isSame = isSame;\n proto.isSameOrAfter = isSameOrAfter;\n proto.isSameOrBefore = isSameOrBefore;\n proto.isValid = isValid$2;\n proto.lang = lang;\n proto.locale = locale;\n proto.localeData = localeData;\n proto.max = prototypeMax;\n proto.min = prototypeMin;\n proto.parsingFlags = parsingFlags;\n proto.set = stringSet;\n proto.startOf = startOf;\n proto.subtract = subtract;\n proto.toArray = toArray;\n proto.toObject = toObject;\n proto.toDate = toDate;\n proto.toISOString = toISOString;\n proto.inspect = inspect;\n proto.toJSON = toJSON;\n proto.toString = toString;\n proto.unix = unix;\n proto.valueOf = valueOf;\n proto.creationData = creationData;\n\n// Year\n proto.year = getSetYear;\n proto.isLeapYear = getIsLeapYear;\n\n// Week Year\n proto.weekYear = getSetWeekYear;\n proto.isoWeekYear = getSetISOWeekYear;\n\n// Quarter\n proto.quarter = proto.quarters = getSetQuarter;\n\n// Month\n proto.month = getSetMonth;\n proto.daysInMonth = getDaysInMonth;\n\n// Week\n proto.week = proto.weeks = getSetWeek;\n proto.isoWeek = proto.isoWeeks = getSetISOWeek;\n proto.weeksInYear = getWeeksInYear;\n proto.isoWeeksInYear = getISOWeeksInYear;\n\n// Day\n proto.date = getSetDayOfMonth;\n proto.day = proto.days = getSetDayOfWeek;\n proto.weekday = getSetLocaleDayOfWeek;\n proto.isoWeekday = getSetISODayOfWeek;\n proto.dayOfYear = getSetDayOfYear;\n\n// Hour\n proto.hour = proto.hours = getSetHour;\n\n// Minute\n proto.minute = proto.minutes = getSetMinute;\n\n// Second\n proto.second = proto.seconds = getSetSecond;\n\n// Millisecond\n proto.millisecond = proto.milliseconds = getSetMillisecond;\n\n// Offset\n proto.utcOffset = getSetOffset;\n proto.utc = setOffsetToUTC;\n proto.local = setOffsetToLocal;\n proto.parseZone = setOffsetToParsedOffset;\n proto.hasAlignedHourOffset = hasAlignedHourOffset;\n proto.isDST = isDaylightSavingTime;\n proto.isLocal = isLocal;\n proto.isUtcOffset = isUtcOffset;\n proto.isUtc = isUtc;\n proto.isUTC = isUtc;\n\n// Timezone\n proto.zoneAbbr = getZoneAbbr;\n proto.zoneName = getZoneName;\n\n// Deprecations\n proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);\n proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);\n proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);\n proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone);\n proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted);\n\n function createUnix (input) {\n return createLocal(input * 1000);\n }\n\n function createInZone () {\n return createLocal.apply(null, arguments).parseZone();\n }\n\n function preParsePostFormat (string) {\n return string;\n }\n\n var proto$1 = Locale.prototype;\n\n proto$1.calendar = calendar;\n proto$1.longDateFormat = longDateFormat;\n proto$1.invalidDate = invalidDate;\n proto$1.ordinal = ordinal;\n proto$1.preparse = preParsePostFormat;\n proto$1.postformat = preParsePostFormat;\n proto$1.relativeTime = relativeTime;\n proto$1.pastFuture = pastFuture;\n proto$1.set = set;\n\n// Month\n proto$1.months = localeMonths;\n proto$1.monthsShort = localeMonthsShort;\n proto$1.monthsParse = localeMonthsParse;\n proto$1.monthsRegex = monthsRegex;\n proto$1.monthsShortRegex = monthsShortRegex;\n\n// Week\n proto$1.week = localeWeek;\n proto$1.firstDayOfYear = localeFirstDayOfYear;\n proto$1.firstDayOfWeek = localeFirstDayOfWeek;\n\n// Day of Week\n proto$1.weekdays = localeWeekdays;\n proto$1.weekdaysMin = localeWeekdaysMin;\n proto$1.weekdaysShort = localeWeekdaysShort;\n proto$1.weekdaysParse = localeWeekdaysParse;\n\n proto$1.weekdaysRegex = weekdaysRegex;\n proto$1.weekdaysShortRegex = weekdaysShortRegex;\n proto$1.weekdaysMinRegex = weekdaysMinRegex;\n\n// Hours\n proto$1.isPM = localeIsPM;\n proto$1.meridiem = localeMeridiem;\n\n function get$1 (format, index, field, setter) {\n var locale = getLocale();\n var utc = createUTC().set(setter, index);\n return locale[field](utc, format);\n }\n\n function listMonthsImpl (format, index, field) {\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n\n if (index != null) {\n return get$1(format, index, field, 'month');\n }\n\n var i;\n var out = [];\n for (i = 0; i < 12; i++) {\n out[i] = get$1(format, i, field, 'month');\n }\n return out;\n }\n\n// ()\n// (5)\n// (fmt, 5)\n// (fmt)\n// (true)\n// (true, 5)\n// (true, fmt, 5)\n// (true, fmt)\n function listWeekdaysImpl (localeSorted, format, index, field) {\n if (typeof localeSorted === 'boolean') {\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n } else {\n format = localeSorted;\n index = format;\n localeSorted = false;\n\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n }\n\n var locale = getLocale(),\n shift = localeSorted ? locale._week.dow : 0;\n\n if (index != null) {\n return get$1(format, (index + shift) % 7, field, 'day');\n }\n\n var i;\n var out = [];\n for (i = 0; i < 7; i++) {\n out[i] = get$1(format, (i + shift) % 7, field, 'day');\n }\n return out;\n }\n\n function listMonths (format, index) {\n return listMonthsImpl(format, index, 'months');\n }\n\n function listMonthsShort (format, index) {\n return listMonthsImpl(format, index, 'monthsShort');\n }\n\n function listWeekdays (localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdays');\n }\n\n function listWeekdaysShort (localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');\n }\n\n function listWeekdaysMin (localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');\n }\n\n getSetGlobalLocale('en', {\n dayOfMonthOrdinalParse: /\\d{1,2}(th|st|nd|rd)/,\n ordinal : function (number) {\n var b = number % 10,\n output = (toInt(number % 100 / 10) === 1) ? 'th' :\n (b === 1) ? 'st' :\n (b === 2) ? 'nd' :\n (b === 3) ? 'rd' : 'th';\n return number + output;\n }\n });\n\n// Side effect imports\n hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale);\n hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale);\n\n var mathAbs = Math.abs;\n\n function abs () {\n var data = this._data;\n\n this._milliseconds = mathAbs(this._milliseconds);\n this._days = mathAbs(this._days);\n this._months = mathAbs(this._months);\n\n data.milliseconds = mathAbs(data.milliseconds);\n data.seconds = mathAbs(data.seconds);\n data.minutes = mathAbs(data.minutes);\n data.hours = mathAbs(data.hours);\n data.months = mathAbs(data.months);\n data.years = mathAbs(data.years);\n\n return this;\n }\n\n function addSubtract$1 (duration, input, value, direction) {\n var other = createDuration(input, value);\n\n duration._milliseconds += direction * other._milliseconds;\n duration._days += direction * other._days;\n duration._months += direction * other._months;\n\n return duration._bubble();\n }\n\n// supports only 2.0-style add(1, 's') or add(duration)\n function add$1 (input, value) {\n return addSubtract$1(this, input, value, 1);\n }\n\n// supports only 2.0-style subtract(1, 's') or subtract(duration)\n function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }\n\n function absCeil (number) {\n if (number < 0) {\n return Math.floor(number);\n } else {\n return Math.ceil(number);\n }\n }\n\n function bubble () {\n var milliseconds = this._milliseconds;\n var days = this._days;\n var months = this._months;\n var data = this._data;\n var seconds, minutes, hours, years, monthsFromDays;\n\n // if we have a mix of positive and negative values, bubble down first\n // check: https://github.com/moment/moment/issues/2166\n if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||\n (milliseconds <= 0 && days <= 0 && months <= 0))) {\n milliseconds += absCeil(monthsToDays(months) + days) * 864e5;\n days = 0;\n months = 0;\n }\n\n // The following code bubbles up values, see the tests for\n // examples of what that means.\n data.milliseconds = milliseconds % 1000;\n\n seconds = absFloor(milliseconds / 1000);\n data.seconds = seconds % 60;\n\n minutes = absFloor(seconds / 60);\n data.minutes = minutes % 60;\n\n hours = absFloor(minutes / 60);\n data.hours = hours % 24;\n\n days += absFloor(hours / 24);\n\n // convert days to months\n monthsFromDays = absFloor(daysToMonths(days));\n months += monthsFromDays;\n days -= absCeil(monthsToDays(monthsFromDays));\n\n // 12 months -> 1 year\n years = absFloor(months / 12);\n months %= 12;\n\n data.days = days;\n data.months = months;\n data.years = years;\n\n return this;\n }\n\n function daysToMonths (days) {\n // 400 years have 146097 days (taking into account leap year rules)\n // 400 years have 12 months === 4800\n return days * 4800 / 146097;\n }\n\n function monthsToDays (months) {\n // the reverse of daysToMonths\n return months * 146097 / 4800;\n }\n\n function as (units) {\n if (!this.isValid()) {\n return NaN;\n }\n var days;\n var months;\n var milliseconds = this._milliseconds;\n\n units = normalizeUnits(units);\n\n if (units === 'month' || units === 'year') {\n days = this._days + milliseconds / 864e5;\n months = this._months + daysToMonths(days);\n return units === 'month' ? months : months / 12;\n } else {\n // handle milliseconds separately because of floating point math errors (issue #1867)\n days = this._days + Math.round(monthsToDays(this._months));\n switch (units) {\n case 'week' : return days / 7 + milliseconds / 6048e5;\n case 'day' : return days + milliseconds / 864e5;\n case 'hour' : return days * 24 + milliseconds / 36e5;\n case 'minute' : return days * 1440 + milliseconds / 6e4;\n case 'second' : return days * 86400 + milliseconds / 1000;\n // Math.floor prevents floating point math errors here\n case 'millisecond': return Math.floor(days * 864e5) + milliseconds;\n default: throw new Error('Unknown unit ' + units);\n }\n }\n }\n\n// TODO: Use this.as('ms')?\n function valueOf$1 () {\n if (!this.isValid()) {\n return NaN;\n }\n return (\n this._milliseconds +\n this._days * 864e5 +\n (this._months % 12) * 2592e6 +\n toInt(this._months / 12) * 31536e6\n );\n }\n\n function makeAs (alias) {\n return function () {\n return this.as(alias);\n };\n }\n\n var asMilliseconds = makeAs('ms');\n var asSeconds = makeAs('s');\n var asMinutes = makeAs('m');\n var asHours = makeAs('h');\n var asDays = makeAs('d');\n var asWeeks = makeAs('w');\n var asMonths = makeAs('M');\n var asYears = makeAs('y');\n\n function get$2 (units) {\n units = normalizeUnits(units);\n return this.isValid() ? this[units + 's']() : NaN;\n }\n\n function makeGetter(name) {\n return function () {\n return this.isValid() ? this._data[name] : NaN;\n };\n }\n\n var milliseconds = makeGetter('milliseconds');\n var seconds = makeGetter('seconds');\n var minutes = makeGetter('minutes');\n var hours = makeGetter('hours');\n var days = makeGetter('days');\n var months = makeGetter('months');\n var years = makeGetter('years');\n\n function weeks () {\n return absFloor(this.days() / 7);\n }\n\n var round = Math.round;\n var thresholds = {\n ss: 44, // a few seconds to seconds\n s : 45, // seconds to minute\n m : 45, // minutes to hour\n h : 22, // hours to day\n d : 26, // days to month\n M : 11 // months to year\n };\n\n// helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize\n function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {\n return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);\n }\n\n function relativeTime$1 (posNegDuration, withoutSuffix, locale) {\n var duration = createDuration(posNegDuration).abs();\n var seconds = round(duration.as('s'));\n var minutes = round(duration.as('m'));\n var hours = round(duration.as('h'));\n var days = round(duration.as('d'));\n var months = round(duration.as('M'));\n var years = round(duration.as('y'));\n\n var a = seconds <= thresholds.ss && ['s', seconds] ||\n seconds < thresholds.s && ['ss', seconds] ||\n minutes <= 1 && ['m'] ||\n minutes < thresholds.m && ['mm', minutes] ||\n hours <= 1 && ['h'] ||\n hours < thresholds.h && ['hh', hours] ||\n days <= 1 && ['d'] ||\n days < thresholds.d && ['dd', days] ||\n months <= 1 && ['M'] ||\n months < thresholds.M && ['MM', months] ||\n years <= 1 && ['y'] || ['yy', years];\n\n a[2] = withoutSuffix;\n a[3] = +posNegDuration > 0;\n a[4] = locale;\n return substituteTimeAgo.apply(null, a);\n }\n\n// This function allows you to set the rounding function for relative time strings\n function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }\n\n// This function allows you to set a threshold for relative time strings\n function getSetRelativeTimeThreshold (threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n if (limit === undefined) {\n return thresholds[threshold];\n }\n thresholds[threshold] = limit;\n if (threshold === 's') {\n thresholds.ss = limit - 1;\n }\n return true;\n }\n\n function humanize (withSuffix) {\n if (!this.isValid()) {\n return this.localeData().invalidDate();\n }\n\n var locale = this.localeData();\n var output = relativeTime$1(this, !withSuffix, locale);\n\n if (withSuffix) {\n output = locale.pastFuture(+this, output);\n }\n\n return locale.postformat(output);\n }\n\n var abs$1 = Math.abs;\n\n function toISOString$1() {\n // for ISO strings we do not use the normal bubbling rules:\n // * milliseconds bubble up until they become hours\n // * days do not bubble at all\n // * months bubble up until they become years\n // This is because there is no context-free conversion between hours and days\n // (think of clock changes)\n // and also not between days and months (28-31 days per month)\n if (!this.isValid()) {\n return this.localeData().invalidDate();\n }\n\n var seconds = abs$1(this._milliseconds) / 1000;\n var days = abs$1(this._days);\n var months = abs$1(this._months);\n var minutes, hours, years;\n\n // 3600 seconds -> 60 minutes -> 1 hour\n minutes = absFloor(seconds / 60);\n hours = absFloor(minutes / 60);\n seconds %= 60;\n minutes %= 60;\n\n // 12 months -> 1 year\n years = absFloor(months / 12);\n months %= 12;\n\n\n // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js\n var Y = years;\n var M = months;\n var D = days;\n var h = hours;\n var m = minutes;\n var s = seconds;\n var total = this.asSeconds();\n\n if (!total) {\n // this is the same as C#'s (Noda) and python (isodate)...\n // but not other JS (goog.date)\n return 'P0D';\n }\n\n return (total < 0 ? '-' : '') +\n 'P' +\n (Y ? Y + 'Y' : '') +\n (M ? M + 'M' : '') +\n (D ? D + 'D' : '') +\n ((h || m || s) ? 'T' : '') +\n (h ? h + 'H' : '') +\n (m ? m + 'M' : '') +\n (s ? s + 'S' : '');\n }\n\n var proto$2 = Duration.prototype;\n\n proto$2.isValid = isValid$1;\n proto$2.abs = abs;\n proto$2.add = add$1;\n proto$2.subtract = subtract$1;\n proto$2.as = as;\n proto$2.asMilliseconds = asMilliseconds;\n proto$2.asSeconds = asSeconds;\n proto$2.asMinutes = asMinutes;\n proto$2.asHours = asHours;\n proto$2.asDays = asDays;\n proto$2.asWeeks = asWeeks;\n proto$2.asMonths = asMonths;\n proto$2.asYears = asYears;\n proto$2.valueOf = valueOf$1;\n proto$2._bubble = bubble;\n proto$2.get = get$2;\n proto$2.milliseconds = milliseconds;\n proto$2.seconds = seconds;\n proto$2.minutes = minutes;\n proto$2.hours = hours;\n proto$2.days = days;\n proto$2.weeks = weeks;\n proto$2.months = months;\n proto$2.years = years;\n proto$2.humanize = humanize;\n proto$2.toISOString = toISOString$1;\n proto$2.toString = toISOString$1;\n proto$2.toJSON = toISOString$1;\n proto$2.locale = locale;\n proto$2.localeData = localeData;\n\n// Deprecations\n proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1);\n proto$2.lang = lang;\n\n// Side effect imports\n\n// FORMATTING\n\n addFormatToken('X', 0, 0, 'unix');\n addFormatToken('x', 0, 0, 'valueOf');\n\n// PARSING\n\n addRegexToken('x', matchSigned);\n addRegexToken('X', matchTimestamp);\n addParseToken('X', function (input, array, config) {\n config._d = new Date(parseFloat(input, 10) * 1000);\n });\n addParseToken('x', function (input, array, config) {\n config._d = new Date(toInt(input));\n });\n\n// Side effect imports\n\n\n hooks.version = '2.18.1';\n\n setHookCallback(createLocal);\n\n hooks.fn = proto;\n hooks.min = min;\n hooks.max = max;\n hooks.now = now;\n hooks.utc = createUTC;\n hooks.unix = createUnix;\n hooks.months = listMonths;\n hooks.isDate = isDate;\n hooks.locale = getSetGlobalLocale;\n hooks.invalid = createInvalid;\n hooks.duration = createDuration;\n hooks.isMoment = isMoment;\n hooks.weekdays = listWeekdays;\n hooks.parseZone = createInZone;\n hooks.localeData = getLocale;\n hooks.isDuration = isDuration;\n hooks.monthsShort = listMonthsShort;\n hooks.weekdaysMin = listWeekdaysMin;\n hooks.defineLocale = defineLocale;\n hooks.updateLocale = updateLocale;\n hooks.locales = listLocales;\n hooks.weekdaysShort = listWeekdaysShort;\n hooks.normalizeUnits = normalizeUnits;\n hooks.relativeTimeRounding = getSetRelativeTimeRounding;\n hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;\n hooks.calendarFormat = getCalendarFormat;\n hooks.prototype = proto;\n\n return hooks;\n\n })));\n\n},{}],7:[function(require,module,exports){\n /**\n * @namespace Chart\n */\n var Chart = require(29)();\n\n Chart.helpers = require(45);\n\n// @todo dispatch these helpers into appropriated helpers/helpers.* file and write unit tests!\n require(27)(Chart);\n\n Chart.defaults = require(25);\n Chart.Element = require(26);\n Chart.elements = require(40);\n Chart.Interaction = require(28);\n Chart.platform = require(48);\n\n require(31)(Chart);\n require(22)(Chart);\n require(23)(Chart);\n require(24)(Chart);\n require(30)(Chart);\n require(33)(Chart);\n require(32)(Chart);\n require(35)(Chart);\n\n require(54)(Chart);\n require(52)(Chart);\n require(53)(Chart);\n require(55)(Chart);\n require(56)(Chart);\n require(57)(Chart);\n\n// Controllers must be loaded after elements\n// See Chart.core.datasetController.dataElementType\n require(15)(Chart);\n require(16)(Chart);\n require(17)(Chart);\n require(18)(Chart);\n require(19)(Chart);\n require(20)(Chart);\n require(21)(Chart);\n\n require(8)(Chart);\n require(9)(Chart);\n require(10)(Chart);\n require(11)(Chart);\n require(12)(Chart);\n require(13)(Chart);\n require(14)(Chart);\n\n// Loading built-it plugins\n var plugins = [];\n\n plugins.push(\n require(49)(Chart),\n require(50)(Chart),\n require(51)(Chart)\n );\n\n Chart.plugins.register(plugins);\n\n Chart.platform.initialize();\n\n module.exports = Chart;\n if (typeof window !== 'undefined') {\n window.Chart = Chart;\n }\n\n// DEPRECATIONS\n\n /**\n * Provided for backward compatibility, use Chart.helpers.canvas instead.\n * @namespace Chart.canvasHelpers\n * @deprecated since version 2.6.0\n * @todo remove at version 3\n * @private\n */\n Chart.canvasHelpers = Chart.helpers.canvas;\n\n},{\"10\":10,\"11\":11,\"12\":12,\"13\":13,\"14\":14,\"15\":15,\"16\":16,\"17\":17,\"18\":18,\"19\":19,\"20\":20,\"21\":21,\"22\":22,\"23\":23,\"24\":24,\"25\":25,\"26\":26,\"27\":27,\"28\":28,\"29\":29,\"30\":30,\"31\":31,\"32\":32,\"33\":33,\"35\":35,\"40\":40,\"45\":45,\"48\":48,\"49\":49,\"50\":50,\"51\":51,\"52\":52,\"53\":53,\"54\":54,\"55\":55,\"56\":56,\"57\":57,\"8\":8,\"9\":9}],8:[function(require,module,exports){\n 'use strict';\n\n module.exports = function(Chart) {\n\n Chart.Bar = function(context, config) {\n config.type = 'bar';\n\n return new Chart(context, config);\n };\n\n };\n\n},{}],9:[function(require,module,exports){\n 'use strict';\n\n module.exports = function(Chart) {\n\n Chart.Bubble = function(context, config) {\n config.type = 'bubble';\n return new Chart(context, config);\n };\n\n };\n\n},{}],10:[function(require,module,exports){\n 'use strict';\n\n module.exports = function(Chart) {\n\n Chart.Doughnut = function(context, config) {\n config.type = 'doughnut';\n\n return new Chart(context, config);\n };\n\n };\n\n},{}],11:[function(require,module,exports){\n 'use strict';\n\n module.exports = function(Chart) {\n\n Chart.Line = function(context, config) {\n config.type = 'line';\n\n return new Chart(context, config);\n };\n\n };\n\n},{}],12:[function(require,module,exports){\n 'use strict';\n\n module.exports = function(Chart) {\n\n Chart.PolarArea = function(context, config) {\n config.type = 'polarArea';\n\n return new Chart(context, config);\n };\n\n };\n\n},{}],13:[function(require,module,exports){\n 'use strict';\n\n module.exports = function(Chart) {\n\n Chart.Radar = function(context, config) {\n config.type = 'radar';\n\n return new Chart(context, config);\n };\n\n };\n\n},{}],14:[function(require,module,exports){\n 'use strict';\n\n module.exports = function(Chart) {\n Chart.Scatter = function(context, config) {\n config.type = 'scatter';\n return new Chart(context, config);\n };\n };\n\n},{}],15:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var elements = require(40);\n var helpers = require(45);\n\n defaults._set('bar', {\n hover: {\n mode: 'label'\n },\n\n scales: {\n xAxes: [{\n type: 'category',\n\n // Specific to Bar Controller\n categoryPercentage: 0.8,\n barPercentage: 0.9,\n\n // offset settings\n offset: true,\n\n // grid line settings\n gridLines: {\n offsetGridLines: true\n }\n }],\n\n yAxes: [{\n type: 'linear'\n }]\n }\n });\n\n defaults._set('horizontalBar', {\n hover: {\n mode: 'index',\n axis: 'y'\n },\n\n scales: {\n xAxes: [{\n type: 'linear',\n position: 'bottom'\n }],\n\n yAxes: [{\n position: 'left',\n type: 'category',\n\n // Specific to Horizontal Bar Controller\n categoryPercentage: 0.8,\n barPercentage: 0.9,\n\n // offset settings\n offset: true,\n\n // grid line settings\n gridLines: {\n offsetGridLines: true\n }\n }]\n },\n\n elements: {\n rectangle: {\n borderSkipped: 'left'\n }\n },\n\n tooltips: {\n callbacks: {\n title: function(item, data) {\n // Pick first xLabel for now\n var title = '';\n\n if (item.length > 0) {\n if (item[0].yLabel) {\n title = item[0].yLabel;\n } else if (data.labels.length > 0 && item[0].index < data.labels.length) {\n title = data.labels[item[0].index];\n }\n }\n\n return title;\n },\n\n label: function(item, data) {\n var datasetLabel = data.datasets[item.datasetIndex].label || '';\n return datasetLabel + ': ' + item.xLabel;\n }\n },\n mode: 'index',\n axis: 'y'\n }\n });\n\n module.exports = function(Chart) {\n\n Chart.controllers.bar = Chart.DatasetController.extend({\n\n dataElementType: elements.Rectangle,\n\n initialize: function() {\n var me = this;\n var meta;\n\n Chart.DatasetController.prototype.initialize.apply(me, arguments);\n\n meta = me.getMeta();\n meta.stack = me.getDataset().stack;\n meta.bar = true;\n },\n\n update: function(reset) {\n var me = this;\n var rects = me.getMeta().data;\n var i, ilen;\n\n me._ruler = me.getRuler();\n\n for (i = 0, ilen = rects.length; i < ilen; ++i) {\n me.updateElement(rects[i], i, reset);\n }\n },\n\n updateElement: function(rectangle, index, reset) {\n var me = this;\n var chart = me.chart;\n var meta = me.getMeta();\n var dataset = me.getDataset();\n var custom = rectangle.custom || {};\n var rectangleOptions = chart.options.elements.rectangle;\n\n rectangle._xScale = me.getScaleForId(meta.xAxisID);\n rectangle._yScale = me.getScaleForId(meta.yAxisID);\n rectangle._datasetIndex = me.index;\n rectangle._index = index;\n\n rectangle._model = {\n datasetLabel: dataset.label,\n label: chart.data.labels[index],\n borderSkipped: custom.borderSkipped ? custom.borderSkipped : rectangleOptions.borderSkipped,\n backgroundColor: custom.backgroundColor ? custom.backgroundColor : helpers.valueAtIndexOrDefault(dataset.backgroundColor, index, rectangleOptions.backgroundColor),\n borderColor: custom.borderColor ? custom.borderColor : helpers.valueAtIndexOrDefault(dataset.borderColor, index, rectangleOptions.borderColor),\n borderWidth: custom.borderWidth ? custom.borderWidth : helpers.valueAtIndexOrDefault(dataset.borderWidth, index, rectangleOptions.borderWidth)\n };\n\n me.updateElementGeometry(rectangle, index, reset);\n\n rectangle.pivot();\n },\n\n /**\n * @private\n */\n updateElementGeometry: function(rectangle, index, reset) {\n var me = this;\n var model = rectangle._model;\n var vscale = me.getValueScale();\n var base = vscale.getBasePixel();\n var horizontal = vscale.isHorizontal();\n var ruler = me._ruler || me.getRuler();\n var vpixels = me.calculateBarValuePixels(me.index, index);\n var ipixels = me.calculateBarIndexPixels(me.index, index, ruler);\n\n model.horizontal = horizontal;\n model.base = reset ? base : vpixels.base;\n model.x = horizontal ? reset ? base : vpixels.head : ipixels.center;\n model.y = horizontal ? ipixels.center : reset ? base : vpixels.head;\n model.height = horizontal ? ipixels.size : undefined;\n model.width = horizontal ? undefined : ipixels.size;\n },\n\n /**\n * @private\n */\n getValueScaleId: function() {\n return this.getMeta().yAxisID;\n },\n\n /**\n * @private\n */\n getIndexScaleId: function() {\n return this.getMeta().xAxisID;\n },\n\n /**\n * @private\n */\n getValueScale: function() {\n return this.getScaleForId(this.getValueScaleId());\n },\n\n /**\n * @private\n */\n getIndexScale: function() {\n return this.getScaleForId(this.getIndexScaleId());\n },\n\n /**\n * Returns the effective number of stacks based on groups and bar visibility.\n * @private\n */\n getStackCount: function(last) {\n var me = this;\n var chart = me.chart;\n var scale = me.getIndexScale();\n var stacked = scale.options.stacked;\n var ilen = last === undefined ? chart.data.datasets.length : last + 1;\n var stacks = [];\n var i, meta;\n\n for (i = 0; i < ilen; ++i) {\n meta = chart.getDatasetMeta(i);\n if (meta.bar && chart.isDatasetVisible(i) &&\n (stacked === false ||\n (stacked === true && stacks.indexOf(meta.stack) === -1) ||\n (stacked === undefined && (meta.stack === undefined || stacks.indexOf(meta.stack) === -1)))) {\n stacks.push(meta.stack);\n }\n }\n\n return stacks.length;\n },\n\n /**\n * Returns the stack index for the given dataset based on groups and bar visibility.\n * @private\n */\n getStackIndex: function(datasetIndex) {\n return this.getStackCount(datasetIndex) - 1;\n },\n\n /**\n * @private\n */\n getRuler: function() {\n var me = this;\n var scale = me.getIndexScale();\n var stackCount = me.getStackCount();\n var datasetIndex = me.index;\n var pixels = [];\n var isHorizontal = scale.isHorizontal();\n var start = isHorizontal ? scale.left : scale.top;\n var end = start + (isHorizontal ? scale.width : scale.height);\n var i, ilen;\n\n for (i = 0, ilen = me.getMeta().data.length; i < ilen; ++i) {\n pixels.push(scale.getPixelForValue(null, i, datasetIndex));\n }\n\n return {\n pixels: pixels,\n start: start,\n end: end,\n stackCount: stackCount,\n scale: scale\n };\n },\n\n /**\n * Note: pixel values are not clamped to the scale area.\n * @private\n */\n calculateBarValuePixels: function(datasetIndex, index) {\n var me = this;\n var chart = me.chart;\n var meta = me.getMeta();\n var scale = me.getValueScale();\n var datasets = chart.data.datasets;\n var value = scale.getRightValue(datasets[datasetIndex].data[index]);\n var stacked = scale.options.stacked;\n var stack = meta.stack;\n var start = 0;\n var i, imeta, ivalue, base, head, size;\n\n if (stacked || (stacked === undefined && stack !== undefined)) {\n for (i = 0; i < datasetIndex; ++i) {\n imeta = chart.getDatasetMeta(i);\n\n if (imeta.bar &&\n imeta.stack === stack &&\n imeta.controller.getValueScaleId() === scale.id &&\n chart.isDatasetVisible(i)) {\n\n ivalue = scale.getRightValue(datasets[i].data[index]);\n if ((value < 0 && ivalue < 0) || (value >= 0 && ivalue > 0)) {\n start += ivalue;\n }\n }\n }\n }\n\n base = scale.getPixelForValue(start);\n head = scale.getPixelForValue(start + value);\n size = (head - base) / 2;\n\n return {\n size: size,\n base: base,\n head: head,\n center: head + size / 2\n };\n },\n\n /**\n * @private\n */\n calculateBarIndexPixels: function(datasetIndex, index, ruler) {\n var me = this;\n var options = ruler.scale.options;\n var stackIndex = me.getStackIndex(datasetIndex);\n var pixels = ruler.pixels;\n var base = pixels[index];\n var length = pixels.length;\n var start = ruler.start;\n var end = ruler.end;\n var leftSampleSize, rightSampleSize, leftCategorySize, rightCategorySize, fullBarSize, size;\n\n if (length === 1) {\n leftSampleSize = base > start ? base - start : end - base;\n rightSampleSize = base < end ? end - base : base - start;\n } else {\n if (index > 0) {\n leftSampleSize = (base - pixels[index - 1]) / 2;\n if (index === length - 1) {\n rightSampleSize = leftSampleSize;\n }\n }\n if (index < length - 1) {\n rightSampleSize = (pixels[index + 1] - base) / 2;\n if (index === 0) {\n leftSampleSize = rightSampleSize;\n }\n }\n }\n\n leftCategorySize = leftSampleSize * options.categoryPercentage;\n rightCategorySize = rightSampleSize * options.categoryPercentage;\n fullBarSize = (leftCategorySize + rightCategorySize) / ruler.stackCount;\n size = fullBarSize * options.barPercentage;\n\n size = Math.min(\n helpers.valueOrDefault(options.barThickness, size),\n helpers.valueOrDefault(options.maxBarThickness, Infinity));\n\n base -= leftCategorySize;\n base += fullBarSize * stackIndex;\n base += (fullBarSize - size) / 2;\n\n return {\n size: size,\n base: base,\n head: base + size,\n center: base + size / 2\n };\n },\n\n draw: function() {\n var me = this;\n var chart = me.chart;\n var scale = me.getValueScale();\n var rects = me.getMeta().data;\n var dataset = me.getDataset();\n var ilen = rects.length;\n var i = 0;\n\n helpers.canvas.clipArea(chart.ctx, chart.chartArea);\n\n for (; i < ilen; ++i) {\n if (!isNaN(scale.getRightValue(dataset.data[i]))) {\n rects[i].draw();\n }\n }\n\n helpers.canvas.unclipArea(chart.ctx);\n },\n\n setHoverStyle: function(rectangle) {\n var dataset = this.chart.data.datasets[rectangle._datasetIndex];\n var index = rectangle._index;\n var custom = rectangle.custom || {};\n var model = rectangle._model;\n\n model.backgroundColor = custom.hoverBackgroundColor ? custom.hoverBackgroundColor : helpers.valueAtIndexOrDefault(dataset.hoverBackgroundColor, index, helpers.getHoverColor(model.backgroundColor));\n model.borderColor = custom.hoverBorderColor ? custom.hoverBorderColor : helpers.valueAtIndexOrDefault(dataset.hoverBorderColor, index, helpers.getHoverColor(model.borderColor));\n model.borderWidth = custom.hoverBorderWidth ? custom.hoverBorderWidth : helpers.valueAtIndexOrDefault(dataset.hoverBorderWidth, index, model.borderWidth);\n },\n\n removeHoverStyle: function(rectangle) {\n var dataset = this.chart.data.datasets[rectangle._datasetIndex];\n var index = rectangle._index;\n var custom = rectangle.custom || {};\n var model = rectangle._model;\n var rectangleElementOptions = this.chart.options.elements.rectangle;\n\n model.backgroundColor = custom.backgroundColor ? custom.backgroundColor : helpers.valueAtIndexOrDefault(dataset.backgroundColor, index, rectangleElementOptions.backgroundColor);\n model.borderColor = custom.borderColor ? custom.borderColor : helpers.valueAtIndexOrDefault(dataset.borderColor, index, rectangleElementOptions.borderColor);\n model.borderWidth = custom.borderWidth ? custom.borderWidth : helpers.valueAtIndexOrDefault(dataset.borderWidth, index, rectangleElementOptions.borderWidth);\n }\n });\n\n Chart.controllers.horizontalBar = Chart.controllers.bar.extend({\n /**\n * @private\n */\n getValueScaleId: function() {\n return this.getMeta().xAxisID;\n },\n\n /**\n * @private\n */\n getIndexScaleId: function() {\n return this.getMeta().yAxisID;\n }\n });\n };\n\n},{\"25\":25,\"40\":40,\"45\":45}],16:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var elements = require(40);\n var helpers = require(45);\n\n defaults._set('bubble', {\n hover: {\n mode: 'single'\n },\n\n scales: {\n xAxes: [{\n type: 'linear', // bubble should probably use a linear scale by default\n position: 'bottom',\n id: 'x-axis-0' // need an ID so datasets can reference the scale\n }],\n yAxes: [{\n type: 'linear',\n position: 'left',\n id: 'y-axis-0'\n }]\n },\n\n tooltips: {\n callbacks: {\n title: function() {\n // Title doesn't make sense for scatter since we format the data as a point\n return '';\n },\n label: function(item, data) {\n var datasetLabel = data.datasets[item.datasetIndex].label || '';\n var dataPoint = data.datasets[item.datasetIndex].data[item.index];\n return datasetLabel + ': (' + item.xLabel + ', ' + item.yLabel + ', ' + dataPoint.r + ')';\n }\n }\n }\n });\n\n\n module.exports = function(Chart) {\n\n Chart.controllers.bubble = Chart.DatasetController.extend({\n /**\n * @protected\n */\n dataElementType: elements.Point,\n\n /**\n * @protected\n */\n update: function(reset) {\n var me = this;\n var meta = me.getMeta();\n var points = meta.data;\n\n // Update Points\n helpers.each(points, function(point, index) {\n me.updateElement(point, index, reset);\n });\n },\n\n /**\n * @protected\n */\n updateElement: function(point, index, reset) {\n var me = this;\n var meta = me.getMeta();\n var custom = point.custom || {};\n var xScale = me.getScaleForId(meta.xAxisID);\n var yScale = me.getScaleForId(meta.yAxisID);\n var options = me._resolveElementOptions(point, index);\n var data = me.getDataset().data[index];\n var dsIndex = me.index;\n\n var x = reset ? xScale.getPixelForDecimal(0.5) : xScale.getPixelForValue(typeof data === 'object' ? data : NaN, index, dsIndex);\n var y = reset ? yScale.getBasePixel() : yScale.getPixelForValue(data, index, dsIndex);\n\n point._xScale = xScale;\n point._yScale = yScale;\n point._options = options;\n point._datasetIndex = dsIndex;\n point._index = index;\n point._model = {\n backgroundColor: options.backgroundColor,\n borderColor: options.borderColor,\n borderWidth: options.borderWidth,\n hitRadius: options.hitRadius,\n pointStyle: options.pointStyle,\n radius: reset ? 0 : options.radius,\n skip: custom.skip || isNaN(x) || isNaN(y),\n x: x,\n y: y,\n };\n\n point.pivot();\n },\n\n /**\n * @protected\n */\n setHoverStyle: function(point) {\n var model = point._model;\n var options = point._options;\n\n model.backgroundColor = helpers.valueOrDefault(options.hoverBackgroundColor, helpers.getHoverColor(options.backgroundColor));\n model.borderColor = helpers.valueOrDefault(options.hoverBorderColor, helpers.getHoverColor(options.borderColor));\n model.borderWidth = helpers.valueOrDefault(options.hoverBorderWidth, options.borderWidth);\n model.radius = options.radius + options.hoverRadius;\n },\n\n /**\n * @protected\n */\n removeHoverStyle: function(point) {\n var model = point._model;\n var options = point._options;\n\n model.backgroundColor = options.backgroundColor;\n model.borderColor = options.borderColor;\n model.borderWidth = options.borderWidth;\n model.radius = options.radius;\n },\n\n /**\n * @private\n */\n _resolveElementOptions: function(point, index) {\n var me = this;\n var chart = me.chart;\n var datasets = chart.data.datasets;\n var dataset = datasets[me.index];\n var custom = point.custom || {};\n var options = chart.options.elements.point;\n var resolve = helpers.options.resolve;\n var data = dataset.data[index];\n var values = {};\n var i, ilen, key;\n\n // Scriptable options\n var context = {\n chart: chart,\n dataIndex: index,\n dataset: dataset,\n datasetIndex: me.index\n };\n\n var keys = [\n 'backgroundColor',\n 'borderColor',\n 'borderWidth',\n 'hoverBackgroundColor',\n 'hoverBorderColor',\n 'hoverBorderWidth',\n 'hoverRadius',\n 'hitRadius',\n 'pointStyle'\n ];\n\n for (i = 0, ilen = keys.length; i < ilen; ++i) {\n key = keys[i];\n values[key] = resolve([\n custom[key],\n dataset[key],\n options[key]\n ], context, index);\n }\n\n // Custom radius resolution\n values.radius = resolve([\n custom.radius,\n data ? data.r : undefined,\n dataset.radius,\n options.radius\n ], context, index);\n\n return values;\n }\n });\n };\n\n},{\"25\":25,\"40\":40,\"45\":45}],17:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var elements = require(40);\n var helpers = require(45);\n\n defaults._set('doughnut', {\n animation: {\n // Boolean - Whether we animate the rotation of the Doughnut\n animateRotate: true,\n // Boolean - Whether we animate scaling the Doughnut from the centre\n animateScale: false\n },\n hover: {\n mode: 'single'\n },\n legendCallback: function(chart) {\n var text = [];\n text.push('
        ');\n\n var data = chart.data;\n var datasets = data.datasets;\n var labels = data.labels;\n\n if (datasets.length) {\n for (var i = 0; i < datasets[0].data.length; ++i) {\n text.push('
      • ');\n if (labels[i]) {\n text.push(labels[i]);\n }\n text.push('
      • ');\n }\n }\n\n text.push('
      ');\n return text.join('');\n },\n legend: {\n labels: {\n generateLabels: function(chart) {\n var data = chart.data;\n if (data.labels.length && data.datasets.length) {\n return data.labels.map(function(label, i) {\n var meta = chart.getDatasetMeta(0);\n var ds = data.datasets[0];\n var arc = meta.data[i];\n var custom = arc && arc.custom || {};\n var valueAtIndexOrDefault = helpers.valueAtIndexOrDefault;\n var arcOpts = chart.options.elements.arc;\n var fill = custom.backgroundColor ? custom.backgroundColor : valueAtIndexOrDefault(ds.backgroundColor, i, arcOpts.backgroundColor);\n var stroke = custom.borderColor ? custom.borderColor : valueAtIndexOrDefault(ds.borderColor, i, arcOpts.borderColor);\n var bw = custom.borderWidth ? custom.borderWidth : valueAtIndexOrDefault(ds.borderWidth, i, arcOpts.borderWidth);\n\n return {\n text: label,\n fillStyle: fill,\n strokeStyle: stroke,\n lineWidth: bw,\n hidden: isNaN(ds.data[i]) || meta.data[i].hidden,\n\n // Extra data used for toggling the correct item\n index: i\n };\n });\n }\n return [];\n }\n },\n\n onClick: function(e, legendItem) {\n var index = legendItem.index;\n var chart = this.chart;\n var i, ilen, meta;\n\n for (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) {\n meta = chart.getDatasetMeta(i);\n // toggle visibility of index if exists\n if (meta.data[index]) {\n meta.data[index].hidden = !meta.data[index].hidden;\n }\n }\n\n chart.update();\n }\n },\n\n // The percentage of the chart that we cut out of the middle.\n cutoutPercentage: 50,\n\n // The rotation of the chart, where the first data arc begins.\n rotation: Math.PI * -0.5,\n\n // The total circumference of the chart.\n circumference: Math.PI * 2.0,\n\n // Need to override these to give a nice default\n tooltips: {\n callbacks: {\n title: function() {\n return '';\n },\n label: function(tooltipItem, data) {\n var dataLabel = data.labels[tooltipItem.index];\n var value = ': ' + data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index];\n\n if (helpers.isArray(dataLabel)) {\n // show value on first line of multiline label\n // need to clone because we are changing the value\n dataLabel = dataLabel.slice();\n dataLabel[0] += value;\n } else {\n dataLabel += value;\n }\n\n return dataLabel;\n }\n }\n }\n });\n\n defaults._set('pie', helpers.clone(defaults.doughnut));\n defaults._set('pie', {\n cutoutPercentage: 0\n });\n\n module.exports = function(Chart) {\n\n Chart.controllers.doughnut = Chart.controllers.pie = Chart.DatasetController.extend({\n\n dataElementType: elements.Arc,\n\n linkScales: helpers.noop,\n\n // Get index of the dataset in relation to the visible datasets. This allows determining the inner and outer radius correctly\n getRingIndex: function(datasetIndex) {\n var ringIndex = 0;\n\n for (var j = 0; j < datasetIndex; ++j) {\n if (this.chart.isDatasetVisible(j)) {\n ++ringIndex;\n }\n }\n\n return ringIndex;\n },\n\n update: function(reset) {\n var me = this;\n var chart = me.chart;\n var chartArea = chart.chartArea;\n var opts = chart.options;\n var arcOpts = opts.elements.arc;\n var availableWidth = chartArea.right - chartArea.left - arcOpts.borderWidth;\n var availableHeight = chartArea.bottom - chartArea.top - arcOpts.borderWidth;\n var minSize = Math.min(availableWidth, availableHeight);\n var offset = {x: 0, y: 0};\n var meta = me.getMeta();\n var cutoutPercentage = opts.cutoutPercentage;\n var circumference = opts.circumference;\n\n // If the chart's circumference isn't a full circle, calculate minSize as a ratio of the width/height of the arc\n if (circumference < Math.PI * 2.0) {\n var startAngle = opts.rotation % (Math.PI * 2.0);\n startAngle += Math.PI * 2.0 * (startAngle >= Math.PI ? -1 : startAngle < -Math.PI ? 1 : 0);\n var endAngle = startAngle + circumference;\n var start = {x: Math.cos(startAngle), y: Math.sin(startAngle)};\n var end = {x: Math.cos(endAngle), y: Math.sin(endAngle)};\n var contains0 = (startAngle <= 0 && endAngle >= 0) || (startAngle <= Math.PI * 2.0 && Math.PI * 2.0 <= endAngle);\n var contains90 = (startAngle <= Math.PI * 0.5 && Math.PI * 0.5 <= endAngle) || (startAngle <= Math.PI * 2.5 && Math.PI * 2.5 <= endAngle);\n var contains180 = (startAngle <= -Math.PI && -Math.PI <= endAngle) || (startAngle <= Math.PI && Math.PI <= endAngle);\n var contains270 = (startAngle <= -Math.PI * 0.5 && -Math.PI * 0.5 <= endAngle) || (startAngle <= Math.PI * 1.5 && Math.PI * 1.5 <= endAngle);\n var cutout = cutoutPercentage / 100.0;\n var min = {x: contains180 ? -1 : Math.min(start.x * (start.x < 0 ? 1 : cutout), end.x * (end.x < 0 ? 1 : cutout)), y: contains270 ? -1 : Math.min(start.y * (start.y < 0 ? 1 : cutout), end.y * (end.y < 0 ? 1 : cutout))};\n var max = {x: contains0 ? 1 : Math.max(start.x * (start.x > 0 ? 1 : cutout), end.x * (end.x > 0 ? 1 : cutout)), y: contains90 ? 1 : Math.max(start.y * (start.y > 0 ? 1 : cutout), end.y * (end.y > 0 ? 1 : cutout))};\n var size = {width: (max.x - min.x) * 0.5, height: (max.y - min.y) * 0.5};\n minSize = Math.min(availableWidth / size.width, availableHeight / size.height);\n offset = {x: (max.x + min.x) * -0.5, y: (max.y + min.y) * -0.5};\n }\n\n chart.borderWidth = me.getMaxBorderWidth(meta.data);\n chart.outerRadius = Math.max((minSize - chart.borderWidth) / 2, 0);\n chart.innerRadius = Math.max(cutoutPercentage ? (chart.outerRadius / 100) * (cutoutPercentage) : 0, 0);\n chart.radiusLength = (chart.outerRadius - chart.innerRadius) / chart.getVisibleDatasetCount();\n chart.offsetX = offset.x * chart.outerRadius;\n chart.offsetY = offset.y * chart.outerRadius;\n\n meta.total = me.calculateTotal();\n\n me.outerRadius = chart.outerRadius - (chart.radiusLength * me.getRingIndex(me.index));\n me.innerRadius = Math.max(me.outerRadius - chart.radiusLength, 0);\n\n helpers.each(meta.data, function(arc, index) {\n me.updateElement(arc, index, reset);\n });\n },\n\n updateElement: function(arc, index, reset) {\n var me = this;\n var chart = me.chart;\n var chartArea = chart.chartArea;\n var opts = chart.options;\n var animationOpts = opts.animation;\n var centerX = (chartArea.left + chartArea.right) / 2;\n var centerY = (chartArea.top + chartArea.bottom) / 2;\n var startAngle = opts.rotation; // non reset case handled later\n var endAngle = opts.rotation; // non reset case handled later\n var dataset = me.getDataset();\n var circumference = reset && animationOpts.animateRotate ? 0 : arc.hidden ? 0 : me.calculateCircumference(dataset.data[index]) * (opts.circumference / (2.0 * Math.PI));\n var innerRadius = reset && animationOpts.animateScale ? 0 : me.innerRadius;\n var outerRadius = reset && animationOpts.animateScale ? 0 : me.outerRadius;\n var valueAtIndexOrDefault = helpers.valueAtIndexOrDefault;\n\n helpers.extend(arc, {\n // Utility\n _datasetIndex: me.index,\n _index: index,\n\n // Desired view properties\n _model: {\n x: centerX + chart.offsetX,\n y: centerY + chart.offsetY,\n startAngle: startAngle,\n endAngle: endAngle,\n circumference: circumference,\n outerRadius: outerRadius,\n innerRadius: innerRadius,\n label: valueAtIndexOrDefault(dataset.label, index, chart.data.labels[index])\n }\n });\n\n var model = arc._model;\n // Resets the visual styles\n this.removeHoverStyle(arc);\n\n // Set correct angles if not resetting\n if (!reset || !animationOpts.animateRotate) {\n if (index === 0) {\n model.startAngle = opts.rotation;\n } else {\n model.startAngle = me.getMeta().data[index - 1]._model.endAngle;\n }\n\n model.endAngle = model.startAngle + model.circumference;\n }\n\n arc.pivot();\n },\n\n removeHoverStyle: function(arc) {\n Chart.DatasetController.prototype.removeHoverStyle.call(this, arc, this.chart.options.elements.arc);\n },\n\n calculateTotal: function() {\n var dataset = this.getDataset();\n var meta = this.getMeta();\n var total = 0;\n var value;\n\n helpers.each(meta.data, function(element, index) {\n value = dataset.data[index];\n if (!isNaN(value) && !element.hidden) {\n total += Math.abs(value);\n }\n });\n\n\t\t\t\t/* if (total === 0) {\n\t\t\t\t total = NaN;\n\t\t\t\t }*/\n\n return total;\n },\n\n calculateCircumference: function(value) {\n var total = this.getMeta().total;\n if (total > 0 && !isNaN(value)) {\n return (Math.PI * 2.0) * (value / total);\n }\n return 0;\n },\n\n // gets the max border or hover width to properly scale pie charts\n getMaxBorderWidth: function(arcs) {\n var max = 0;\n var index = this.index;\n var length = arcs.length;\n var borderWidth;\n var hoverWidth;\n\n for (var i = 0; i < length; i++) {\n borderWidth = arcs[i]._model ? arcs[i]._model.borderWidth : 0;\n hoverWidth = arcs[i]._chart ? arcs[i]._chart.config.data.datasets[index].hoverBorderWidth : 0;\n\n max = borderWidth > max ? borderWidth : max;\n max = hoverWidth > max ? hoverWidth : max;\n }\n return max;\n }\n });\n };\n\n},{\"25\":25,\"40\":40,\"45\":45}],18:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var elements = require(40);\n var helpers = require(45);\n\n defaults._set('line', {\n showLines: true,\n spanGaps: false,\n\n hover: {\n mode: 'label'\n },\n\n scales: {\n xAxes: [{\n type: 'category',\n id: 'x-axis-0'\n }],\n yAxes: [{\n type: 'linear',\n id: 'y-axis-0'\n }]\n }\n });\n\n module.exports = function(Chart) {\n\n function lineEnabled(dataset, options) {\n return helpers.valueOrDefault(dataset.showLine, options.showLines);\n }\n\n Chart.controllers.line = Chart.DatasetController.extend({\n\n datasetElementType: elements.Line,\n\n dataElementType: elements.Point,\n\n update: function(reset) {\n var me = this;\n var meta = me.getMeta();\n var line = meta.dataset;\n var points = meta.data || [];\n var options = me.chart.options;\n var lineElementOptions = options.elements.line;\n var scale = me.getScaleForId(meta.yAxisID);\n var i, ilen, custom;\n var dataset = me.getDataset();\n var showLine = lineEnabled(dataset, options);\n\n // Update Line\n if (showLine) {\n custom = line.custom || {};\n\n // Compatibility: If the properties are defined with only the old name, use those values\n if ((dataset.tension !== undefined) && (dataset.lineTension === undefined)) {\n dataset.lineTension = dataset.tension;\n }\n\n // Utility\n line._scale = scale;\n line._datasetIndex = me.index;\n // Data\n line._children = points;\n // Model\n line._model = {\n // Appearance\n // The default behavior of lines is to break at null values, according\n // to https://github.com/chartjs/Chart.js/issues/2435#issuecomment-216718158\n // This option gives lines the ability to span gaps\n spanGaps: dataset.spanGaps ? dataset.spanGaps : options.spanGaps,\n tension: custom.tension ? custom.tension : helpers.valueOrDefault(dataset.lineTension, lineElementOptions.tension),\n backgroundColor: custom.backgroundColor ? custom.backgroundColor : (dataset.backgroundColor || lineElementOptions.backgroundColor),\n borderWidth: custom.borderWidth ? custom.borderWidth : (dataset.borderWidth || lineElementOptions.borderWidth),\n borderColor: custom.borderColor ? custom.borderColor : (dataset.borderColor || lineElementOptions.borderColor),\n borderCapStyle: custom.borderCapStyle ? custom.borderCapStyle : (dataset.borderCapStyle || lineElementOptions.borderCapStyle),\n borderDash: custom.borderDash ? custom.borderDash : (dataset.borderDash || lineElementOptions.borderDash),\n borderDashOffset: custom.borderDashOffset ? custom.borderDashOffset : (dataset.borderDashOffset || lineElementOptions.borderDashOffset),\n borderJoinStyle: custom.borderJoinStyle ? custom.borderJoinStyle : (dataset.borderJoinStyle || lineElementOptions.borderJoinStyle),\n fill: custom.fill ? custom.fill : (dataset.fill !== undefined ? dataset.fill : lineElementOptions.fill),\n steppedLine: custom.steppedLine ? custom.steppedLine : helpers.valueOrDefault(dataset.steppedLine, lineElementOptions.stepped),\n cubicInterpolationMode: custom.cubicInterpolationMode ? custom.cubicInterpolationMode : helpers.valueOrDefault(dataset.cubicInterpolationMode, lineElementOptions.cubicInterpolationMode),\n };\n\n line.pivot();\n }\n\n // Update Points\n for (i = 0, ilen = points.length; i < ilen; ++i) {\n me.updateElement(points[i], i, reset);\n }\n\n if (showLine && line._model.tension !== 0) {\n me.updateBezierControlPoints();\n }\n\n // Now pivot the point for animation\n for (i = 0, ilen = points.length; i < ilen; ++i) {\n points[i].pivot();\n }\n },\n\n getPointBackgroundColor: function(point, index) {\n var backgroundColor = this.chart.options.elements.point.backgroundColor;\n var dataset = this.getDataset();\n var custom = point.custom || {};\n\n if (custom.backgroundColor) {\n backgroundColor = custom.backgroundColor;\n } else if (dataset.pointBackgroundColor) {\n backgroundColor = helpers.valueAtIndexOrDefault(dataset.pointBackgroundColor, index, backgroundColor);\n } else if (dataset.backgroundColor) {\n backgroundColor = dataset.backgroundColor;\n }\n\n return backgroundColor;\n },\n\n getPointBorderColor: function(point, index) {\n var borderColor = this.chart.options.elements.point.borderColor;\n var dataset = this.getDataset();\n var custom = point.custom || {};\n\n if (custom.borderColor) {\n borderColor = custom.borderColor;\n } else if (dataset.pointBorderColor) {\n borderColor = helpers.valueAtIndexOrDefault(dataset.pointBorderColor, index, borderColor);\n } else if (dataset.borderColor) {\n borderColor = dataset.borderColor;\n }\n\n return borderColor;\n },\n\n getPointBorderWidth: function(point, index) {\n var borderWidth = this.chart.options.elements.point.borderWidth;\n var dataset = this.getDataset();\n var custom = point.custom || {};\n\n if (!isNaN(custom.borderWidth)) {\n borderWidth = custom.borderWidth;\n } else if (!isNaN(dataset.pointBorderWidth) || helpers.isArray(dataset.pointBorderWidth)) {\n borderWidth = helpers.valueAtIndexOrDefault(dataset.pointBorderWidth, index, borderWidth);\n } else if (!isNaN(dataset.borderWidth)) {\n borderWidth = dataset.borderWidth;\n }\n\n return borderWidth;\n },\n\n updateElement: function(point, index, reset) {\n var me = this;\n var meta = me.getMeta();\n var custom = point.custom || {};\n var dataset = me.getDataset();\n var datasetIndex = me.index;\n var value = dataset.data[index];\n var yScale = me.getScaleForId(meta.yAxisID);\n var xScale = me.getScaleForId(meta.xAxisID);\n var pointOptions = me.chart.options.elements.point;\n var x, y;\n\n // Compatibility: If the properties are defined with only the old name, use those values\n if ((dataset.radius !== undefined) && (dataset.pointRadius === undefined)) {\n dataset.pointRadius = dataset.radius;\n }\n if ((dataset.hitRadius !== undefined) && (dataset.pointHitRadius === undefined)) {\n dataset.pointHitRadius = dataset.hitRadius;\n }\n\n x = xScale.getPixelForValue(typeof value === 'object' ? value : NaN, index, datasetIndex);\n y = reset ? yScale.getBasePixel() : me.calculatePointY(value, index, datasetIndex);\n\n // Utility\n point._xScale = xScale;\n point._yScale = yScale;\n point._datasetIndex = datasetIndex;\n point._index = index;\n\n // Desired view properties\n point._model = {\n x: x,\n y: y,\n skip: custom.skip || isNaN(x) || isNaN(y),\n // Appearance\n radius: custom.radius || helpers.valueAtIndexOrDefault(dataset.pointRadius, index, pointOptions.radius),\n pointStyle: custom.pointStyle || helpers.valueAtIndexOrDefault(dataset.pointStyle, index, pointOptions.pointStyle),\n backgroundColor: me.getPointBackgroundColor(point, index),\n borderColor: me.getPointBorderColor(point, index),\n borderWidth: me.getPointBorderWidth(point, index),\n tension: meta.dataset._model ? meta.dataset._model.tension : 0,\n steppedLine: meta.dataset._model ? meta.dataset._model.steppedLine : false,\n // Tooltip\n hitRadius: custom.hitRadius || helpers.valueAtIndexOrDefault(dataset.pointHitRadius, index, pointOptions.hitRadius)\n };\n },\n\n calculatePointY: function(value, index, datasetIndex) {\n var me = this;\n var chart = me.chart;\n var meta = me.getMeta();\n var yScale = me.getScaleForId(meta.yAxisID);\n var sumPos = 0;\n var sumNeg = 0;\n var i, ds, dsMeta;\n\n if (yScale.options.stacked) {\n for (i = 0; i < datasetIndex; i++) {\n ds = chart.data.datasets[i];\n dsMeta = chart.getDatasetMeta(i);\n if (dsMeta.type === 'line' && dsMeta.yAxisID === yScale.id && chart.isDatasetVisible(i)) {\n var stackedRightValue = Number(yScale.getRightValue(ds.data[index]));\n if (stackedRightValue < 0) {\n sumNeg += stackedRightValue || 0;\n } else {\n sumPos += stackedRightValue || 0;\n }\n }\n }\n\n var rightValue = Number(yScale.getRightValue(value));\n if (rightValue < 0) {\n return yScale.getPixelForValue(sumNeg + rightValue);\n }\n return yScale.getPixelForValue(sumPos + rightValue);\n }\n\n return yScale.getPixelForValue(value);\n },\n\n updateBezierControlPoints: function() {\n var me = this;\n var meta = me.getMeta();\n var area = me.chart.chartArea;\n var points = (meta.data || []);\n var i, ilen, point, model, controlPoints;\n\n // Only consider points that are drawn in case the spanGaps option is used\n if (meta.dataset._model.spanGaps) {\n points = points.filter(function(pt) {\n return !pt._model.skip;\n });\n }\n\n function capControlPoint(pt, min, max) {\n return Math.max(Math.min(pt, max), min);\n }\n\n if (meta.dataset._model.cubicInterpolationMode === 'monotone') {\n helpers.splineCurveMonotone(points);\n } else {\n for (i = 0, ilen = points.length; i < ilen; ++i) {\n point = points[i];\n model = point._model;\n controlPoints = helpers.splineCurve(\n helpers.previousItem(points, i)._model,\n model,\n helpers.nextItem(points, i)._model,\n meta.dataset._model.tension\n );\n model.controlPointPreviousX = controlPoints.previous.x;\n model.controlPointPreviousY = controlPoints.previous.y;\n model.controlPointNextX = controlPoints.next.x;\n model.controlPointNextY = controlPoints.next.y;\n }\n }\n\n if (me.chart.options.elements.line.capBezierPoints) {\n for (i = 0, ilen = points.length; i < ilen; ++i) {\n model = points[i]._model;\n model.controlPointPreviousX = capControlPoint(model.controlPointPreviousX, area.left, area.right);\n model.controlPointPreviousY = capControlPoint(model.controlPointPreviousY, area.top, area.bottom);\n model.controlPointNextX = capControlPoint(model.controlPointNextX, area.left, area.right);\n model.controlPointNextY = capControlPoint(model.controlPointNextY, area.top, area.bottom);\n }\n }\n },\n\n draw: function() {\n var me = this;\n var chart = me.chart;\n var meta = me.getMeta();\n var points = meta.data || [];\n var area = chart.chartArea;\n var ilen = points.length;\n var i = 0;\n\n helpers.canvas.clipArea(chart.ctx, area);\n\n if (lineEnabled(me.getDataset(), chart.options)) {\n meta.dataset.draw();\n }\n\n helpers.canvas.unclipArea(chart.ctx);\n\n // Draw the points\n for (; i < ilen; ++i) {\n points[i].draw(area);\n }\n },\n\n setHoverStyle: function(point) {\n // Point\n var dataset = this.chart.data.datasets[point._datasetIndex];\n var index = point._index;\n var custom = point.custom || {};\n var model = point._model;\n\n model.radius = custom.hoverRadius || helpers.valueAtIndexOrDefault(dataset.pointHoverRadius, index, this.chart.options.elements.point.hoverRadius);\n model.backgroundColor = custom.hoverBackgroundColor || helpers.valueAtIndexOrDefault(dataset.pointHoverBackgroundColor, index, helpers.getHoverColor(model.backgroundColor));\n model.borderColor = custom.hoverBorderColor || helpers.valueAtIndexOrDefault(dataset.pointHoverBorderColor, index, helpers.getHoverColor(model.borderColor));\n model.borderWidth = custom.hoverBorderWidth || helpers.valueAtIndexOrDefault(dataset.pointHoverBorderWidth, index, model.borderWidth);\n },\n\n removeHoverStyle: function(point) {\n var me = this;\n var dataset = me.chart.data.datasets[point._datasetIndex];\n var index = point._index;\n var custom = point.custom || {};\n var model = point._model;\n\n // Compatibility: If the properties are defined with only the old name, use those values\n if ((dataset.radius !== undefined) && (dataset.pointRadius === undefined)) {\n dataset.pointRadius = dataset.radius;\n }\n\n model.radius = custom.radius || helpers.valueAtIndexOrDefault(dataset.pointRadius, index, me.chart.options.elements.point.radius);\n model.backgroundColor = me.getPointBackgroundColor(point, index);\n model.borderColor = me.getPointBorderColor(point, index);\n model.borderWidth = me.getPointBorderWidth(point, index);\n }\n });\n };\n\n},{\"25\":25,\"40\":40,\"45\":45}],19:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var elements = require(40);\n var helpers = require(45);\n\n defaults._set('polarArea', {\n scale: {\n type: 'radialLinear',\n angleLines: {\n display: false\n },\n gridLines: {\n circular: true\n },\n pointLabels: {\n display: false\n },\n ticks: {\n beginAtZero: true\n }\n },\n\n // Boolean - Whether to animate the rotation of the chart\n animation: {\n animateRotate: true,\n animateScale: true\n },\n\n startAngle: -0.5 * Math.PI,\n legendCallback: function(chart) {\n var text = [];\n text.push('
        ');\n\n var data = chart.data;\n var datasets = data.datasets;\n var labels = data.labels;\n\n if (datasets.length) {\n for (var i = 0; i < datasets[0].data.length; ++i) {\n text.push('
      • ');\n if (labels[i]) {\n text.push(labels[i]);\n }\n text.push('
      • ');\n }\n }\n\n text.push('
      ');\n return text.join('');\n },\n legend: {\n labels: {\n generateLabels: function(chart) {\n var data = chart.data;\n if (data.labels.length && data.datasets.length) {\n return data.labels.map(function(label, i) {\n var meta = chart.getDatasetMeta(0);\n var ds = data.datasets[0];\n var arc = meta.data[i];\n var custom = arc.custom || {};\n var valueAtIndexOrDefault = helpers.valueAtIndexOrDefault;\n var arcOpts = chart.options.elements.arc;\n var fill = custom.backgroundColor ? custom.backgroundColor : valueAtIndexOrDefault(ds.backgroundColor, i, arcOpts.backgroundColor);\n var stroke = custom.borderColor ? custom.borderColor : valueAtIndexOrDefault(ds.borderColor, i, arcOpts.borderColor);\n var bw = custom.borderWidth ? custom.borderWidth : valueAtIndexOrDefault(ds.borderWidth, i, arcOpts.borderWidth);\n\n return {\n text: label,\n fillStyle: fill,\n strokeStyle: stroke,\n lineWidth: bw,\n hidden: isNaN(ds.data[i]) || meta.data[i].hidden,\n\n // Extra data used for toggling the correct item\n index: i\n };\n });\n }\n return [];\n }\n },\n\n onClick: function(e, legendItem) {\n var index = legendItem.index;\n var chart = this.chart;\n var i, ilen, meta;\n\n for (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) {\n meta = chart.getDatasetMeta(i);\n meta.data[index].hidden = !meta.data[index].hidden;\n }\n\n chart.update();\n }\n },\n\n // Need to override these to give a nice default\n tooltips: {\n callbacks: {\n title: function() {\n return '';\n },\n label: function(item, data) {\n return data.labels[item.index] + ': ' + item.yLabel;\n }\n }\n }\n });\n\n module.exports = function(Chart) {\n\n Chart.controllers.polarArea = Chart.DatasetController.extend({\n\n dataElementType: elements.Arc,\n\n linkScales: helpers.noop,\n\n update: function(reset) {\n var me = this;\n var chart = me.chart;\n var chartArea = chart.chartArea;\n var meta = me.getMeta();\n var opts = chart.options;\n var arcOpts = opts.elements.arc;\n var minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);\n chart.outerRadius = Math.max((minSize - arcOpts.borderWidth / 2) / 2, 0);\n chart.innerRadius = Math.max(opts.cutoutPercentage ? (chart.outerRadius / 100) * (opts.cutoutPercentage) : 1, 0);\n chart.radiusLength = (chart.outerRadius - chart.innerRadius) / chart.getVisibleDatasetCount();\n\n me.outerRadius = chart.outerRadius - (chart.radiusLength * me.index);\n me.innerRadius = me.outerRadius - chart.radiusLength;\n\n meta.count = me.countVisibleElements();\n\n helpers.each(meta.data, function(arc, index) {\n me.updateElement(arc, index, reset);\n });\n },\n\n updateElement: function(arc, index, reset) {\n var me = this;\n var chart = me.chart;\n var dataset = me.getDataset();\n var opts = chart.options;\n var animationOpts = opts.animation;\n var scale = chart.scale;\n var labels = chart.data.labels;\n\n var circumference = me.calculateCircumference(dataset.data[index]);\n var centerX = scale.xCenter;\n var centerY = scale.yCenter;\n\n // If there is NaN data before us, we need to calculate the starting angle correctly.\n // We could be way more efficient here, but its unlikely that the polar area chart will have a lot of data\n var visibleCount = 0;\n var meta = me.getMeta();\n for (var i = 0; i < index; ++i) {\n if (!isNaN(dataset.data[i]) && !meta.data[i].hidden) {\n ++visibleCount;\n }\n }\n\n // var negHalfPI = -0.5 * Math.PI;\n var datasetStartAngle = opts.startAngle;\n var distance = arc.hidden ? 0 : scale.getDistanceFromCenterForValue(dataset.data[index]);\n var startAngle = datasetStartAngle + (circumference * visibleCount);\n var endAngle = startAngle + (arc.hidden ? 0 : circumference);\n\n var resetRadius = animationOpts.animateScale ? 0 : scale.getDistanceFromCenterForValue(dataset.data[index]);\n\n helpers.extend(arc, {\n // Utility\n _datasetIndex: me.index,\n _index: index,\n _scale: scale,\n\n // Desired view properties\n _model: {\n x: centerX,\n y: centerY,\n innerRadius: 0,\n outerRadius: reset ? resetRadius : distance,\n startAngle: reset && animationOpts.animateRotate ? datasetStartAngle : startAngle,\n endAngle: reset && animationOpts.animateRotate ? datasetStartAngle : endAngle,\n label: helpers.valueAtIndexOrDefault(labels, index, labels[index])\n }\n });\n\n // Apply border and fill style\n me.removeHoverStyle(arc);\n\n arc.pivot();\n },\n\n removeHoverStyle: function(arc) {\n Chart.DatasetController.prototype.removeHoverStyle.call(this, arc, this.chart.options.elements.arc);\n },\n\n countVisibleElements: function() {\n var dataset = this.getDataset();\n var meta = this.getMeta();\n var count = 0;\n\n helpers.each(meta.data, function(element, index) {\n if (!isNaN(dataset.data[index]) && !element.hidden) {\n count++;\n }\n });\n\n return count;\n },\n\n calculateCircumference: function(value) {\n var count = this.getMeta().count;\n if (count > 0 && !isNaN(value)) {\n return (2 * Math.PI) / count;\n }\n return 0;\n }\n });\n };\n\n},{\"25\":25,\"40\":40,\"45\":45}],20:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var elements = require(40);\n var helpers = require(45);\n\n defaults._set('radar', {\n scale: {\n type: 'radialLinear'\n },\n elements: {\n line: {\n tension: 0 // no bezier in radar\n }\n }\n });\n\n module.exports = function(Chart) {\n\n Chart.controllers.radar = Chart.DatasetController.extend({\n\n datasetElementType: elements.Line,\n\n dataElementType: elements.Point,\n\n linkScales: helpers.noop,\n\n update: function(reset) {\n var me = this;\n var meta = me.getMeta();\n var line = meta.dataset;\n var points = meta.data;\n var custom = line.custom || {};\n var dataset = me.getDataset();\n var lineElementOptions = me.chart.options.elements.line;\n var scale = me.chart.scale;\n\n // Compatibility: If the properties are defined with only the old name, use those values\n if ((dataset.tension !== undefined) && (dataset.lineTension === undefined)) {\n dataset.lineTension = dataset.tension;\n }\n\n helpers.extend(meta.dataset, {\n // Utility\n _datasetIndex: me.index,\n _scale: scale,\n // Data\n _children: points,\n _loop: true,\n // Model\n _model: {\n // Appearance\n tension: custom.tension ? custom.tension : helpers.valueOrDefault(dataset.lineTension, lineElementOptions.tension),\n backgroundColor: custom.backgroundColor ? custom.backgroundColor : (dataset.backgroundColor || lineElementOptions.backgroundColor),\n borderWidth: custom.borderWidth ? custom.borderWidth : (dataset.borderWidth || lineElementOptions.borderWidth),\n borderColor: custom.borderColor ? custom.borderColor : (dataset.borderColor || lineElementOptions.borderColor),\n fill: custom.fill ? custom.fill : (dataset.fill !== undefined ? dataset.fill : lineElementOptions.fill),\n borderCapStyle: custom.borderCapStyle ? custom.borderCapStyle : (dataset.borderCapStyle || lineElementOptions.borderCapStyle),\n borderDash: custom.borderDash ? custom.borderDash : (dataset.borderDash || lineElementOptions.borderDash),\n borderDashOffset: custom.borderDashOffset ? custom.borderDashOffset : (dataset.borderDashOffset || lineElementOptions.borderDashOffset),\n borderJoinStyle: custom.borderJoinStyle ? custom.borderJoinStyle : (dataset.borderJoinStyle || lineElementOptions.borderJoinStyle),\n }\n });\n\n meta.dataset.pivot();\n\n // Update Points\n helpers.each(points, function(point, index) {\n me.updateElement(point, index, reset);\n }, me);\n\n // Update bezier control points\n me.updateBezierControlPoints();\n },\n updateElement: function(point, index, reset) {\n var me = this;\n var custom = point.custom || {};\n var dataset = me.getDataset();\n var scale = me.chart.scale;\n var pointElementOptions = me.chart.options.elements.point;\n var pointPosition = scale.getPointPositionForValue(index, dataset.data[index]);\n\n // Compatibility: If the properties are defined with only the old name, use those values\n if ((dataset.radius !== undefined) && (dataset.pointRadius === undefined)) {\n dataset.pointRadius = dataset.radius;\n }\n if ((dataset.hitRadius !== undefined) && (dataset.pointHitRadius === undefined)) {\n dataset.pointHitRadius = dataset.hitRadius;\n }\n\n helpers.extend(point, {\n // Utility\n _datasetIndex: me.index,\n _index: index,\n _scale: scale,\n\n // Desired view properties\n _model: {\n x: reset ? scale.xCenter : pointPosition.x, // value not used in dataset scale, but we want a consistent API between scales\n y: reset ? scale.yCenter : pointPosition.y,\n\n // Appearance\n tension: custom.tension ? custom.tension : helpers.valueOrDefault(dataset.lineTension, me.chart.options.elements.line.tension),\n radius: custom.radius ? custom.radius : helpers.valueAtIndexOrDefault(dataset.pointRadius, index, pointElementOptions.radius),\n backgroundColor: custom.backgroundColor ? custom.backgroundColor : helpers.valueAtIndexOrDefault(dataset.pointBackgroundColor, index, pointElementOptions.backgroundColor),\n borderColor: custom.borderColor ? custom.borderColor : helpers.valueAtIndexOrDefault(dataset.pointBorderColor, index, pointElementOptions.borderColor),\n borderWidth: custom.borderWidth ? custom.borderWidth : helpers.valueAtIndexOrDefault(dataset.pointBorderWidth, index, pointElementOptions.borderWidth),\n pointStyle: custom.pointStyle ? custom.pointStyle : helpers.valueAtIndexOrDefault(dataset.pointStyle, index, pointElementOptions.pointStyle),\n\n // Tooltip\n hitRadius: custom.hitRadius ? custom.hitRadius : helpers.valueAtIndexOrDefault(dataset.pointHitRadius, index, pointElementOptions.hitRadius)\n }\n });\n\n point._model.skip = custom.skip ? custom.skip : (isNaN(point._model.x) || isNaN(point._model.y));\n },\n updateBezierControlPoints: function() {\n var chartArea = this.chart.chartArea;\n var meta = this.getMeta();\n\n helpers.each(meta.data, function(point, index) {\n var model = point._model;\n var controlPoints = helpers.splineCurve(\n helpers.previousItem(meta.data, index, true)._model,\n model,\n helpers.nextItem(meta.data, index, true)._model,\n model.tension\n );\n\n // Prevent the bezier going outside of the bounds of the graph\n model.controlPointPreviousX = Math.max(Math.min(controlPoints.previous.x, chartArea.right), chartArea.left);\n model.controlPointPreviousY = Math.max(Math.min(controlPoints.previous.y, chartArea.bottom), chartArea.top);\n\n model.controlPointNextX = Math.max(Math.min(controlPoints.next.x, chartArea.right), chartArea.left);\n model.controlPointNextY = Math.max(Math.min(controlPoints.next.y, chartArea.bottom), chartArea.top);\n\n // Now pivot the point for animation\n point.pivot();\n });\n },\n\n setHoverStyle: function(point) {\n // Point\n var dataset = this.chart.data.datasets[point._datasetIndex];\n var custom = point.custom || {};\n var index = point._index;\n var model = point._model;\n\n model.radius = custom.hoverRadius ? custom.hoverRadius : helpers.valueAtIndexOrDefault(dataset.pointHoverRadius, index, this.chart.options.elements.point.hoverRadius);\n model.backgroundColor = custom.hoverBackgroundColor ? custom.hoverBackgroundColor : helpers.valueAtIndexOrDefault(dataset.pointHoverBackgroundColor, index, helpers.getHoverColor(model.backgroundColor));\n model.borderColor = custom.hoverBorderColor ? custom.hoverBorderColor : helpers.valueAtIndexOrDefault(dataset.pointHoverBorderColor, index, helpers.getHoverColor(model.borderColor));\n model.borderWidth = custom.hoverBorderWidth ? custom.hoverBorderWidth : helpers.valueAtIndexOrDefault(dataset.pointHoverBorderWidth, index, model.borderWidth);\n },\n\n removeHoverStyle: function(point) {\n var dataset = this.chart.data.datasets[point._datasetIndex];\n var custom = point.custom || {};\n var index = point._index;\n var model = point._model;\n var pointElementOptions = this.chart.options.elements.point;\n\n model.radius = custom.radius ? custom.radius : helpers.valueAtIndexOrDefault(dataset.pointRadius, index, pointElementOptions.radius);\n model.backgroundColor = custom.backgroundColor ? custom.backgroundColor : helpers.valueAtIndexOrDefault(dataset.pointBackgroundColor, index, pointElementOptions.backgroundColor);\n model.borderColor = custom.borderColor ? custom.borderColor : helpers.valueAtIndexOrDefault(dataset.pointBorderColor, index, pointElementOptions.borderColor);\n model.borderWidth = custom.borderWidth ? custom.borderWidth : helpers.valueAtIndexOrDefault(dataset.pointBorderWidth, index, pointElementOptions.borderWidth);\n }\n });\n };\n\n},{\"25\":25,\"40\":40,\"45\":45}],21:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n\n defaults._set('scatter', {\n hover: {\n mode: 'single'\n },\n\n scales: {\n xAxes: [{\n id: 'x-axis-1', // need an ID so datasets can reference the scale\n type: 'linear', // scatter should not use a category axis\n position: 'bottom'\n }],\n yAxes: [{\n id: 'y-axis-1',\n type: 'linear',\n position: 'left'\n }]\n },\n\n showLines: false,\n\n tooltips: {\n callbacks: {\n title: function() {\n return ''; // doesn't make sense for scatter since data are formatted as a point\n },\n label: function(item) {\n return '(' + item.xLabel + ', ' + item.yLabel + ')';\n }\n }\n }\n });\n\n module.exports = function(Chart) {\n\n // Scatter charts use line controllers\n Chart.controllers.scatter = Chart.controllers.line;\n\n };\n\n},{\"25\":25}],22:[function(require,module,exports){\n\t/* global window: false */\n 'use strict';\n\n var defaults = require(25);\n var Element = require(26);\n var helpers = require(45);\n\n defaults._set('global', {\n animation: {\n duration: 1000,\n easing: 'easeOutQuart',\n onProgress: helpers.noop,\n onComplete: helpers.noop\n }\n });\n\n module.exports = function(Chart) {\n\n Chart.Animation = Element.extend({\n chart: null, // the animation associated chart instance\n currentStep: 0, // the current animation step\n numSteps: 60, // default number of steps\n easing: '', // the easing to use for this animation\n render: null, // render function used by the animation service\n\n onAnimationProgress: null, // user specified callback to fire on each step of the animation\n onAnimationComplete: null, // user specified callback to fire when the animation finishes\n });\n\n Chart.animationService = {\n frameDuration: 17,\n animations: [],\n dropFrames: 0,\n request: null,\n\n /**\n * @param {Chart} chart - The chart to animate.\n * @param {Chart.Animation} animation - The animation that we will animate.\n * @param {Number} duration - The animation duration in ms.\n * @param {Boolean} lazy - if true, the chart is not marked as animating to enable more responsive interactions\n */\n addAnimation: function(chart, animation, duration, lazy) {\n var animations = this.animations;\n var i, ilen;\n\n animation.chart = chart;\n\n if (!lazy) {\n chart.animating = true;\n }\n\n for (i = 0, ilen = animations.length; i < ilen; ++i) {\n if (animations[i].chart === chart) {\n animations[i] = animation;\n return;\n }\n }\n\n animations.push(animation);\n\n // If there are no animations queued, manually kickstart a digest, for lack of a better word\n if (animations.length === 1) {\n this.requestAnimationFrame();\n }\n },\n\n cancelAnimation: function(chart) {\n var index = helpers.findIndex(this.animations, function(animation) {\n return animation.chart === chart;\n });\n\n if (index !== -1) {\n this.animations.splice(index, 1);\n chart.animating = false;\n }\n },\n\n requestAnimationFrame: function() {\n var me = this;\n if (me.request === null) {\n // Skip animation frame requests until the active one is executed.\n // This can happen when processing mouse events, e.g. 'mousemove'\n // and 'mouseout' events will trigger multiple renders.\n me.request = helpers.requestAnimFrame.call(window, function() {\n me.request = null;\n me.startDigest();\n });\n }\n },\n\n /**\n * @private\n */\n startDigest: function() {\n var me = this;\n var startTime = Date.now();\n var framesToDrop = 0;\n\n if (me.dropFrames > 1) {\n framesToDrop = Math.floor(me.dropFrames);\n me.dropFrames = me.dropFrames % 1;\n }\n\n me.advance(1 + framesToDrop);\n\n var endTime = Date.now();\n\n me.dropFrames += (endTime - startTime) / me.frameDuration;\n\n // Do we have more stuff to animate?\n if (me.animations.length > 0) {\n me.requestAnimationFrame();\n }\n },\n\n /**\n * @private\n */\n advance: function(count) {\n var animations = this.animations;\n var animation, chart;\n var i = 0;\n\n while (i < animations.length) {\n animation = animations[i];\n chart = animation.chart;\n\n animation.currentStep = (animation.currentStep || 0) + count;\n animation.currentStep = Math.min(animation.currentStep, animation.numSteps);\n\n helpers.callback(animation.render, [chart, animation], chart);\n helpers.callback(animation.onAnimationProgress, [animation], chart);\n\n if (animation.currentStep >= animation.numSteps) {\n helpers.callback(animation.onAnimationComplete, [animation], chart);\n chart.animating = false;\n animations.splice(i, 1);\n } else {\n ++i;\n }\n }\n }\n };\n\n /**\n * Provided for backward compatibility, use Chart.Animation instead\n * @prop Chart.Animation#animationObject\n * @deprecated since version 2.6.0\n * @todo remove at version 3\n */\n Object.defineProperty(Chart.Animation.prototype, 'animationObject', {\n get: function() {\n return this;\n }\n });\n\n /**\n * Provided for backward compatibility, use Chart.Animation#chart instead\n * @prop Chart.Animation#chartInstance\n * @deprecated since version 2.6.0\n * @todo remove at version 3\n */\n Object.defineProperty(Chart.Animation.prototype, 'chartInstance', {\n get: function() {\n return this.chart;\n },\n set: function(value) {\n this.chart = value;\n }\n });\n\n };\n\n},{\"25\":25,\"26\":26,\"45\":45}],23:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var helpers = require(45);\n var Interaction = require(28);\n var platform = require(48);\n\n module.exports = function(Chart) {\n var plugins = Chart.plugins;\n\n // Create a dictionary of chart types, to allow for extension of existing types\n Chart.types = {};\n\n // Store a reference to each instance - allowing us to globally resize chart instances on window resize.\n // Destroy method on the chart will remove the instance of the chart from this reference.\n Chart.instances = {};\n\n // Controllers available for dataset visualization eg. bar, line, slice, etc.\n Chart.controllers = {};\n\n /**\n * Initializes the given config with global and chart default values.\n */\n function initConfig(config) {\n config = config || {};\n\n // Do NOT use configMerge() for the data object because this method merges arrays\n // and so would change references to labels and datasets, preventing data updates.\n var data = config.data = config.data || {};\n data.datasets = data.datasets || [];\n data.labels = data.labels || [];\n\n config.options = helpers.configMerge(\n defaults.global,\n defaults[config.type],\n config.options || {});\n\n return config;\n }\n\n /**\n * Updates the config of the chart\n * @param chart {Chart} chart to update the options for\n */\n function updateConfig(chart) {\n var newOptions = chart.options;\n\n // Update Scale(s) with options\n if (newOptions.scale) {\n chart.scale.options = newOptions.scale;\n } else if (newOptions.scales) {\n newOptions.scales.xAxes.concat(newOptions.scales.yAxes).forEach(function(scaleOptions) {\n chart.scales[scaleOptions.id].options = scaleOptions;\n });\n }\n\n // Tooltip\n chart.tooltip._options = newOptions.tooltips;\n }\n\n function positionIsHorizontal(position) {\n return position === 'top' || position === 'bottom';\n }\n\n helpers.extend(Chart.prototype, /** @lends Chart */ {\n /**\n * @private\n */\n construct: function(item, config) {\n var me = this;\n\n config = initConfig(config);\n\n var context = platform.acquireContext(item, config);\n var canvas = context && context.canvas;\n var height = canvas && canvas.height;\n var width = canvas && canvas.width;\n\n me.id = helpers.uid();\n me.ctx = context;\n me.canvas = canvas;\n me.config = config;\n me.width = width;\n me.height = height;\n me.aspectRatio = height ? width / height : null;\n me.options = config.options;\n me._bufferedRender = false;\n\n /**\n * Provided for backward compatibility, Chart and Chart.Controller have been merged,\n * the \"instance\" still need to be defined since it might be called from plugins.\n * @prop Chart#chart\n * @deprecated since version 2.6.0\n * @todo remove at version 3\n * @private\n */\n me.chart = me;\n me.controller = me; // chart.chart.controller #inception\n\n // Add the chart instance to the global namespace\n Chart.instances[me.id] = me;\n\n // Define alias to the config data: `chart.data === chart.config.data`\n Object.defineProperty(me, 'data', {\n get: function() {\n return me.config.data;\n },\n set: function(value) {\n me.config.data = value;\n }\n });\n\n if (!context || !canvas) {\n // The given item is not a compatible context2d element, let's return before finalizing\n // the chart initialization but after setting basic chart / controller properties that\n // can help to figure out that the chart is not valid (e.g chart.canvas !== null);\n // https://github.com/chartjs/Chart.js/issues/2807\n console.error(\"Failed to create chart: can't acquire context from the given item\");\n return;\n }\n\n me.initialize();\n me.update();\n },\n\n /**\n * @private\n */\n initialize: function() {\n var me = this;\n\n // Before init plugin notification\n plugins.notify(me, 'beforeInit');\n\n helpers.retinaScale(me, me.options.devicePixelRatio);\n\n me.bindEvents();\n\n if (me.options.responsive) {\n // Initial resize before chart draws (must be silent to preserve initial animations).\n me.resize(true);\n }\n\n // Make sure scales have IDs and are built before we build any controllers.\n me.ensureScalesHaveIDs();\n me.buildScales();\n me.initToolTip();\n\n // After init plugin notification\n plugins.notify(me, 'afterInit');\n\n return me;\n },\n\n clear: function() {\n helpers.canvas.clear(this);\n return this;\n },\n\n stop: function() {\n // Stops any current animation loop occurring\n Chart.animationService.cancelAnimation(this);\n return this;\n },\n\n resize: function(silent) {\n var me = this;\n var options = me.options;\n var canvas = me.canvas;\n var aspectRatio = (options.maintainAspectRatio && me.aspectRatio) || null;\n\n // the canvas render width and height will be casted to integers so make sure that\n // the canvas display style uses the same integer values to avoid blurring effect.\n\n // Set to 0 instead of canvas.size because the size defaults to 300x150 if the element is collased\n var newWidth = Math.max(0, Math.floor(helpers.getMaximumWidth(canvas)));\n var newHeight = Math.max(0, Math.floor(aspectRatio ? newWidth / aspectRatio : helpers.getMaximumHeight(canvas)));\n\n if (me.width === newWidth && me.height === newHeight) {\n return;\n }\n\n canvas.width = me.width = newWidth;\n canvas.height = me.height = newHeight;\n canvas.style.width = newWidth + 'px';\n canvas.style.height = newHeight + 'px';\n\n helpers.retinaScale(me, options.devicePixelRatio);\n\n if (!silent) {\n // Notify any plugins about the resize\n var newSize = {width: newWidth, height: newHeight};\n plugins.notify(me, 'resize', [newSize]);\n\n // Notify of resize\n if (me.options.onResize) {\n me.options.onResize(me, newSize);\n }\n\n me.stop();\n me.update(me.options.responsiveAnimationDuration);\n }\n },\n\n ensureScalesHaveIDs: function() {\n var options = this.options;\n var scalesOptions = options.scales || {};\n var scaleOptions = options.scale;\n\n helpers.each(scalesOptions.xAxes, function(xAxisOptions, index) {\n xAxisOptions.id = xAxisOptions.id || ('x-axis-' + index);\n });\n\n helpers.each(scalesOptions.yAxes, function(yAxisOptions, index) {\n yAxisOptions.id = yAxisOptions.id || ('y-axis-' + index);\n });\n\n if (scaleOptions) {\n scaleOptions.id = scaleOptions.id || 'scale';\n }\n },\n\n /**\n * Builds a map of scale ID to scale object for future lookup.\n */\n buildScales: function() {\n var me = this;\n var options = me.options;\n var scales = me.scales = {};\n var items = [];\n\n if (options.scales) {\n items = items.concat(\n (options.scales.xAxes || []).map(function(xAxisOptions) {\n return {options: xAxisOptions, dtype: 'category', dposition: 'bottom'};\n }),\n (options.scales.yAxes || []).map(function(yAxisOptions) {\n return {options: yAxisOptions, dtype: 'linear', dposition: 'left'};\n })\n );\n }\n\n if (options.scale) {\n items.push({\n options: options.scale,\n dtype: 'radialLinear',\n isDefault: true,\n dposition: 'chartArea'\n });\n }\n\n helpers.each(items, function(item) {\n var scaleOptions = item.options;\n var scaleType = helpers.valueOrDefault(scaleOptions.type, item.dtype);\n var scaleClass = Chart.scaleService.getScaleConstructor(scaleType);\n if (!scaleClass) {\n return;\n }\n\n if (positionIsHorizontal(scaleOptions.position) !== positionIsHorizontal(item.dposition)) {\n scaleOptions.position = item.dposition;\n }\n\n var scale = new scaleClass({\n id: scaleOptions.id,\n options: scaleOptions,\n ctx: me.ctx,\n chart: me\n });\n\n scales[scale.id] = scale;\n scale.mergeTicksOptions();\n\n // TODO(SB): I think we should be able to remove this custom case (options.scale)\n // and consider it as a regular scale part of the \"scales\"\" map only! This would\n // make the logic easier and remove some useless? custom code.\n if (item.isDefault) {\n me.scale = scale;\n }\n });\n\n Chart.scaleService.addScalesToLayout(this);\n },\n\n buildOrUpdateControllers: function() {\n var me = this;\n var types = [];\n var newControllers = [];\n\n helpers.each(me.data.datasets, function(dataset, datasetIndex) {\n var meta = me.getDatasetMeta(datasetIndex);\n var type = dataset.type || me.config.type;\n\n if (meta.type && meta.type !== type) {\n me.destroyDatasetMeta(datasetIndex);\n meta = me.getDatasetMeta(datasetIndex);\n }\n meta.type = type;\n\n types.push(meta.type);\n\n if (meta.controller) {\n meta.controller.updateIndex(datasetIndex);\n } else {\n var ControllerClass = Chart.controllers[meta.type];\n if (ControllerClass === undefined) {\n throw new Error('\"' + meta.type + '\" is not a chart type.');\n }\n\n meta.controller = new ControllerClass(me, datasetIndex);\n newControllers.push(meta.controller);\n }\n }, me);\n\n return newControllers;\n },\n\n /**\n * Reset the elements of all datasets\n * @private\n */\n resetElements: function() {\n var me = this;\n helpers.each(me.data.datasets, function(dataset, datasetIndex) {\n me.getDatasetMeta(datasetIndex).controller.reset();\n }, me);\n },\n\n /**\n * Resets the chart back to it's state before the initial animation\n */\n reset: function() {\n this.resetElements();\n this.tooltip.initialize();\n },\n\n update: function(config) {\n var me = this;\n\n if (!config || typeof config !== 'object') {\n // backwards compatibility\n config = {\n duration: config,\n lazy: arguments[1]\n };\n }\n\n updateConfig(me);\n\n if (plugins.notify(me, 'beforeUpdate') === false) {\n return;\n }\n\n // In case the entire data object changed\n me.tooltip._data = me.data;\n\n // Make sure dataset controllers are updated and new controllers are reset\n var newControllers = me.buildOrUpdateControllers();\n\n // Make sure all dataset controllers have correct meta data counts\n helpers.each(me.data.datasets, function(dataset, datasetIndex) {\n me.getDatasetMeta(datasetIndex).controller.buildOrUpdateElements();\n }, me);\n\n me.updateLayout();\n\n // Can only reset the new controllers after the scales have been updated\n helpers.each(newControllers, function(controller) {\n controller.reset();\n });\n\n me.updateDatasets();\n\n // Do this before render so that any plugins that need final scale updates can use it\n plugins.notify(me, 'afterUpdate');\n\n if (me._bufferedRender) {\n me._bufferedRequest = {\n duration: config.duration,\n easing: config.easing,\n lazy: config.lazy\n };\n } else {\n me.render(config);\n }\n },\n\n /**\n * Updates the chart layout unless a plugin returns `false` to the `beforeLayout`\n * hook, in which case, plugins will not be called on `afterLayout`.\n * @private\n */\n updateLayout: function() {\n var me = this;\n\n if (plugins.notify(me, 'beforeLayout') === false) {\n return;\n }\n\n Chart.layoutService.update(this, this.width, this.height);\n\n /**\n * Provided for backward compatibility, use `afterLayout` instead.\n * @method IPlugin#afterScaleUpdate\n * @deprecated since version 2.5.0\n * @todo remove at version 3\n * @private\n */\n plugins.notify(me, 'afterScaleUpdate');\n plugins.notify(me, 'afterLayout');\n },\n\n /**\n * Updates all datasets unless a plugin returns `false` to the `beforeDatasetsUpdate`\n * hook, in which case, plugins will not be called on `afterDatasetsUpdate`.\n * @private\n */\n updateDatasets: function() {\n var me = this;\n\n if (plugins.notify(me, 'beforeDatasetsUpdate') === false) {\n return;\n }\n\n for (var i = 0, ilen = me.data.datasets.length; i < ilen; ++i) {\n me.updateDataset(i);\n }\n\n plugins.notify(me, 'afterDatasetsUpdate');\n },\n\n /**\n * Updates dataset at index unless a plugin returns `false` to the `beforeDatasetUpdate`\n * hook, in which case, plugins will not be called on `afterDatasetUpdate`.\n * @private\n */\n updateDataset: function(index) {\n var me = this;\n var meta = me.getDatasetMeta(index);\n var args = {\n meta: meta,\n index: index\n };\n\n if (plugins.notify(me, 'beforeDatasetUpdate', [args]) === false) {\n return;\n }\n\n meta.controller.update();\n\n plugins.notify(me, 'afterDatasetUpdate', [args]);\n },\n\n render: function(config) {\n var me = this;\n\n if (!config || typeof config !== 'object') {\n // backwards compatibility\n config = {\n duration: config,\n lazy: arguments[1]\n };\n }\n\n var duration = config.duration;\n var lazy = config.lazy;\n\n if (plugins.notify(me, 'beforeRender') === false) {\n return;\n }\n\n var animationOptions = me.options.animation;\n var onComplete = function(animation) {\n plugins.notify(me, 'afterRender');\n helpers.callback(animationOptions && animationOptions.onComplete, [animation], me);\n };\n\n if (animationOptions && ((typeof duration !== 'undefined' && duration !== 0) || (typeof duration === 'undefined' && animationOptions.duration !== 0))) {\n var animation = new Chart.Animation({\n numSteps: (duration || animationOptions.duration) / 16.66, // 60 fps\n easing: config.easing || animationOptions.easing,\n\n render: function(chart, animationObject) {\n var easingFunction = helpers.easing.effects[animationObject.easing];\n var currentStep = animationObject.currentStep;\n var stepDecimal = currentStep / animationObject.numSteps;\n\n chart.draw(easingFunction(stepDecimal), stepDecimal, currentStep);\n },\n\n onAnimationProgress: animationOptions.onProgress,\n onAnimationComplete: onComplete\n });\n\n Chart.animationService.addAnimation(me, animation, duration, lazy);\n } else {\n me.draw();\n\n // See https://github.com/chartjs/Chart.js/issues/3781\n onComplete(new Chart.Animation({numSteps: 0, chart: me}));\n }\n\n return me;\n },\n\n draw: function(easingValue) {\n var me = this;\n\n me.clear();\n\n if (helpers.isNullOrUndef(easingValue)) {\n easingValue = 1;\n }\n\n me.transition(easingValue);\n\n if (plugins.notify(me, 'beforeDraw', [easingValue]) === false) {\n return;\n }\n\n // Draw all the scales\n helpers.each(me.boxes, function(box) {\n box.draw(me.chartArea);\n }, me);\n\n if (me.scale) {\n me.scale.draw();\n }\n\n me.drawDatasets(easingValue);\n\n // Finally draw the tooltip\n me.tooltip.draw();\n\n plugins.notify(me, 'afterDraw', [easingValue]);\n },\n\n /**\n * @private\n */\n transition: function(easingValue) {\n var me = this;\n\n for (var i = 0, ilen = (me.data.datasets || []).length; i < ilen; ++i) {\n if (me.isDatasetVisible(i)) {\n me.getDatasetMeta(i).controller.transition(easingValue);\n }\n }\n\n me.tooltip.transition(easingValue);\n },\n\n /**\n * Draws all datasets unless a plugin returns `false` to the `beforeDatasetsDraw`\n * hook, in which case, plugins will not be called on `afterDatasetsDraw`.\n * @private\n */\n drawDatasets: function(easingValue) {\n var me = this;\n\n if (plugins.notify(me, 'beforeDatasetsDraw', [easingValue]) === false) {\n return;\n }\n\n // Draw datasets reversed to support proper line stacking\n for (var i = (me.data.datasets || []).length - 1; i >= 0; --i) {\n if (me.isDatasetVisible(i)) {\n me.drawDataset(i, easingValue);\n }\n }\n\n plugins.notify(me, 'afterDatasetsDraw', [easingValue]);\n },\n\n /**\n * Draws dataset at index unless a plugin returns `false` to the `beforeDatasetDraw`\n * hook, in which case, plugins will not be called on `afterDatasetDraw`.\n * @private\n */\n drawDataset: function(index, easingValue) {\n var me = this;\n var meta = me.getDatasetMeta(index);\n var args = {\n meta: meta,\n index: index,\n easingValue: easingValue\n };\n\n if (plugins.notify(me, 'beforeDatasetDraw', [args]) === false) {\n return;\n }\n\n meta.controller.draw(easingValue);\n\n plugins.notify(me, 'afterDatasetDraw', [args]);\n },\n\n // Get the single element that was clicked on\n // @return : An object containing the dataset index and element index of the matching element. Also contains the rectangle that was draw\n getElementAtEvent: function(e) {\n return Interaction.modes.single(this, e);\n },\n\n getElementsAtEvent: function(e) {\n return Interaction.modes.label(this, e, {intersect: true});\n },\n\n getElementsAtXAxis: function(e) {\n return Interaction.modes['x-axis'](this, e, {intersect: true});\n },\n\n getElementsAtEventForMode: function(e, mode, options) {\n var method = Interaction.modes[mode];\n if (typeof method === 'function') {\n return method(this, e, options);\n }\n\n return [];\n },\n\n getDatasetAtEvent: function(e) {\n return Interaction.modes.dataset(this, e, {intersect: true});\n },\n\n getDatasetMeta: function(datasetIndex) {\n var me = this;\n var dataset = me.data.datasets[datasetIndex];\n if (!dataset._meta) {\n dataset._meta = {};\n }\n\n var meta = dataset._meta[me.id];\n if (!meta) {\n meta = dataset._meta[me.id] = {\n type: null,\n data: [],\n dataset: null,\n controller: null,\n hidden: null,\t\t\t// See isDatasetVisible() comment\n xAxisID: null,\n yAxisID: null\n };\n }\n\n return meta;\n },\n\n getVisibleDatasetCount: function() {\n var count = 0;\n for (var i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n if (this.isDatasetVisible(i)) {\n count++;\n }\n }\n return count;\n },\n\n isDatasetVisible: function(datasetIndex) {\n var meta = this.getDatasetMeta(datasetIndex);\n\n // meta.hidden is a per chart dataset hidden flag override with 3 states: if true or false,\n // the dataset.hidden value is ignored, else if null, the dataset hidden state is returned.\n return typeof meta.hidden === 'boolean' ? !meta.hidden : !this.data.datasets[datasetIndex].hidden;\n },\n\n generateLegend: function() {\n return this.options.legendCallback(this);\n },\n\n /**\n * @private\n */\n destroyDatasetMeta: function(datasetIndex) {\n var id = this.id;\n var dataset = this.data.datasets[datasetIndex];\n var meta = dataset._meta && dataset._meta[id];\n\n if (meta) {\n meta.controller.destroy();\n delete dataset._meta[id];\n }\n },\n\n destroy: function() {\n var me = this;\n var canvas = me.canvas;\n var i, ilen;\n\n me.stop();\n\n // dataset controllers need to cleanup associated data\n for (i = 0, ilen = me.data.datasets.length; i < ilen; ++i) {\n me.destroyDatasetMeta(i);\n }\n\n if (canvas) {\n me.unbindEvents();\n helpers.canvas.clear(me);\n platform.releaseContext(me.ctx);\n me.canvas = null;\n me.ctx = null;\n }\n\n plugins.notify(me, 'destroy');\n\n delete Chart.instances[me.id];\n },\n\n toBase64Image: function() {\n return this.canvas.toDataURL.apply(this.canvas, arguments);\n },\n\n initToolTip: function() {\n var me = this;\n me.tooltip = new Chart.Tooltip({\n _chart: me,\n _chartInstance: me, // deprecated, backward compatibility\n _data: me.data,\n _options: me.options.tooltips\n }, me);\n },\n\n /**\n * @private\n */\n bindEvents: function() {\n var me = this;\n var listeners = me._listeners = {};\n var listener = function() {\n me.eventHandler.apply(me, arguments);\n };\n\n helpers.each(me.options.events, function(type) {\n platform.addEventListener(me, type, listener);\n listeners[type] = listener;\n });\n\n // Elements used to detect size change should not be injected for non responsive charts.\n // See https://github.com/chartjs/Chart.js/issues/2210\n if (me.options.responsive) {\n listener = function() {\n me.resize();\n };\n\n platform.addEventListener(me, 'resize', listener);\n listeners.resize = listener;\n }\n },\n\n /**\n * @private\n */\n unbindEvents: function() {\n var me = this;\n var listeners = me._listeners;\n if (!listeners) {\n return;\n }\n\n delete me._listeners;\n helpers.each(listeners, function(listener, type) {\n platform.removeEventListener(me, type, listener);\n });\n },\n\n updateHoverStyle: function(elements, mode, enabled) {\n var method = enabled ? 'setHoverStyle' : 'removeHoverStyle';\n var element, i, ilen;\n\n for (i = 0, ilen = elements.length; i < ilen; ++i) {\n element = elements[i];\n if (element) {\n this.getDatasetMeta(element._datasetIndex).controller[method](element);\n }\n }\n },\n\n /**\n * @private\n */\n eventHandler: function(e) {\n var me = this;\n var tooltip = me.tooltip;\n\n if (plugins.notify(me, 'beforeEvent', [e]) === false) {\n return;\n }\n\n // Buffer any update calls so that renders do not occur\n me._bufferedRender = true;\n me._bufferedRequest = null;\n\n var changed = me.handleEvent(e);\n changed |= tooltip && tooltip.handleEvent(e);\n\n plugins.notify(me, 'afterEvent', [e]);\n\n var bufferedRequest = me._bufferedRequest;\n if (bufferedRequest) {\n // If we have an update that was triggered, we need to do a normal render\n me.render(bufferedRequest);\n } else if (changed && !me.animating) {\n // If entering, leaving, or changing elements, animate the change via pivot\n me.stop();\n\n // We only need to render at this point. Updating will cause scales to be\n // recomputed generating flicker & using more memory than necessary.\n me.render(me.options.hover.animationDuration, true);\n }\n\n me._bufferedRender = false;\n me._bufferedRequest = null;\n\n return me;\n },\n\n /**\n * Handle an event\n * @private\n * @param {IEvent} event the event to handle\n * @return {Boolean} true if the chart needs to re-render\n */\n handleEvent: function(e) {\n var me = this;\n var options = me.options || {};\n var hoverOptions = options.hover;\n var changed = false;\n\n me.lastActive = me.lastActive || [];\n\n // Find Active Elements for hover and tooltips\n if (e.type === 'mouseout') {\n me.active = [];\n } else {\n me.active = me.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions);\n }\n\n // Invoke onHover hook\n // Need to call with native event here to not break backwards compatibility\n helpers.callback(options.onHover || options.hover.onHover, [e.native, me.active], me);\n\n if (e.type === 'mouseup' || e.type === 'click') {\n if (options.onClick) {\n // Use e.native here for backwards compatibility\n options.onClick.call(me, e.native, me.active);\n }\n }\n\n // Remove styling for last active (even if it may still be active)\n if (me.lastActive.length) {\n me.updateHoverStyle(me.lastActive, hoverOptions.mode, false);\n }\n\n // Built in hover styling\n if (me.active.length && hoverOptions.mode) {\n me.updateHoverStyle(me.active, hoverOptions.mode, true);\n }\n\n changed = !helpers.arrayEquals(me.active, me.lastActive);\n\n // Remember Last Actives\n me.lastActive = me.active;\n\n return changed;\n }\n });\n\n /**\n * Provided for backward compatibility, use Chart instead.\n * @class Chart.Controller\n * @deprecated since version 2.6.0\n * @todo remove at version 3\n * @private\n */\n Chart.Controller = Chart;\n };\n\n},{\"25\":25,\"28\":28,\"45\":45,\"48\":48}],24:[function(require,module,exports){\n 'use strict';\n\n var helpers = require(45);\n\n module.exports = function(Chart) {\n\n var arrayEvents = ['push', 'pop', 'shift', 'splice', 'unshift'];\n\n /**\n * Hooks the array methods that add or remove values ('push', pop', 'shift', 'splice',\n * 'unshift') and notify the listener AFTER the array has been altered. Listeners are\n * called on the 'onData*' callbacks (e.g. onDataPush, etc.) with same arguments.\n */\n function listenArrayEvents(array, listener) {\n if (array._chartjs) {\n array._chartjs.listeners.push(listener);\n return;\n }\n\n Object.defineProperty(array, '_chartjs', {\n configurable: true,\n enumerable: false,\n value: {\n listeners: [listener]\n }\n });\n\n arrayEvents.forEach(function(key) {\n var method = 'onData' + key.charAt(0).toUpperCase() + key.slice(1);\n var base = array[key];\n\n Object.defineProperty(array, key, {\n configurable: true,\n enumerable: false,\n value: function() {\n var args = Array.prototype.slice.call(arguments);\n var res = base.apply(this, args);\n\n helpers.each(array._chartjs.listeners, function(object) {\n if (typeof object[method] === 'function') {\n object[method].apply(object, args);\n }\n });\n\n return res;\n }\n });\n });\n }\n\n /**\n * Removes the given array event listener and cleanup extra attached properties (such as\n * the _chartjs stub and overridden methods) if array doesn't have any more listeners.\n */\n function unlistenArrayEvents(array, listener) {\n var stub = array._chartjs;\n if (!stub) {\n return;\n }\n\n var listeners = stub.listeners;\n var index = listeners.indexOf(listener);\n if (index !== -1) {\n listeners.splice(index, 1);\n }\n\n if (listeners.length > 0) {\n return;\n }\n\n arrayEvents.forEach(function(key) {\n delete array[key];\n });\n\n delete array._chartjs;\n }\n\n // Base class for all dataset controllers (line, bar, etc)\n Chart.DatasetController = function(chart, datasetIndex) {\n this.initialize(chart, datasetIndex);\n };\n\n helpers.extend(Chart.DatasetController.prototype, {\n\n /**\n * Element type used to generate a meta dataset (e.g. Chart.element.Line).\n * @type {Chart.core.element}\n */\n datasetElementType: null,\n\n /**\n * Element type used to generate a meta data (e.g. Chart.element.Point).\n * @type {Chart.core.element}\n */\n dataElementType: null,\n\n initialize: function(chart, datasetIndex) {\n var me = this;\n me.chart = chart;\n me.index = datasetIndex;\n me.linkScales();\n me.addElements();\n },\n\n updateIndex: function(datasetIndex) {\n this.index = datasetIndex;\n },\n\n linkScales: function() {\n var me = this;\n var meta = me.getMeta();\n var dataset = me.getDataset();\n\n if (meta.xAxisID === null) {\n meta.xAxisID = dataset.xAxisID || me.chart.options.scales.xAxes[0].id;\n }\n if (meta.yAxisID === null) {\n meta.yAxisID = dataset.yAxisID || me.chart.options.scales.yAxes[0].id;\n }\n },\n\n getDataset: function() {\n return this.chart.data.datasets[this.index];\n },\n\n getMeta: function() {\n return this.chart.getDatasetMeta(this.index);\n },\n\n getScaleForId: function(scaleID) {\n return this.chart.scales[scaleID];\n },\n\n reset: function() {\n this.update(true);\n },\n\n /**\n * @private\n */\n destroy: function() {\n if (this._data) {\n unlistenArrayEvents(this._data, this);\n }\n },\n\n createMetaDataset: function() {\n var me = this;\n var type = me.datasetElementType;\n return type && new type({\n _chart: me.chart,\n _datasetIndex: me.index\n });\n },\n\n createMetaData: function(index) {\n var me = this;\n var type = me.dataElementType;\n return type && new type({\n _chart: me.chart,\n _datasetIndex: me.index,\n _index: index\n });\n },\n\n addElements: function() {\n var me = this;\n var meta = me.getMeta();\n var data = me.getDataset().data || [];\n var metaData = meta.data;\n var i, ilen;\n\n for (i = 0, ilen = data.length; i < ilen; ++i) {\n metaData[i] = metaData[i] || me.createMetaData(i);\n }\n\n meta.dataset = meta.dataset || me.createMetaDataset();\n },\n\n addElementAndReset: function(index) {\n var element = this.createMetaData(index);\n this.getMeta().data.splice(index, 0, element);\n this.updateElement(element, index, true);\n },\n\n buildOrUpdateElements: function() {\n var me = this;\n var dataset = me.getDataset();\n var data = dataset.data || (dataset.data = []);\n\n // In order to correctly handle data addition/deletion animation (an thus simulate\n // real-time charts), we need to monitor these data modifications and synchronize\n // the internal meta data accordingly.\n if (me._data !== data) {\n if (me._data) {\n // This case happens when the user replaced the data array instance.\n unlistenArrayEvents(me._data, me);\n }\n\n listenArrayEvents(data, me);\n me._data = data;\n }\n\n // Re-sync meta data in case the user replaced the data array or if we missed\n // any updates and so make sure that we handle number of datapoints changing.\n me.resyncElements();\n },\n\n update: helpers.noop,\n\n transition: function(easingValue) {\n var meta = this.getMeta();\n var elements = meta.data || [];\n var ilen = elements.length;\n var i = 0;\n\n for (; i < ilen; ++i) {\n elements[i].transition(easingValue);\n }\n\n if (meta.dataset) {\n meta.dataset.transition(easingValue);\n }\n },\n\n draw: function() {\n var meta = this.getMeta();\n var elements = meta.data || [];\n var ilen = elements.length;\n var i = 0;\n\n if (meta.dataset) {\n meta.dataset.draw();\n }\n\n for (; i < ilen; ++i) {\n elements[i].draw();\n }\n },\n\n removeHoverStyle: function(element, elementOpts) {\n var dataset = this.chart.data.datasets[element._datasetIndex];\n var index = element._index;\n var custom = element.custom || {};\n var valueOrDefault = helpers.valueAtIndexOrDefault;\n var model = element._model;\n\n model.backgroundColor = custom.backgroundColor ? custom.backgroundColor : valueOrDefault(dataset.backgroundColor, index, elementOpts.backgroundColor);\n model.borderColor = custom.borderColor ? custom.borderColor : valueOrDefault(dataset.borderColor, index, elementOpts.borderColor);\n model.borderWidth = custom.borderWidth ? custom.borderWidth : valueOrDefault(dataset.borderWidth, index, elementOpts.borderWidth);\n },\n\n setHoverStyle: function(element) {\n var dataset = this.chart.data.datasets[element._datasetIndex];\n var index = element._index;\n var custom = element.custom || {};\n var valueOrDefault = helpers.valueAtIndexOrDefault;\n var getHoverColor = helpers.getHoverColor;\n var model = element._model;\n\n model.backgroundColor = custom.hoverBackgroundColor ? custom.hoverBackgroundColor : valueOrDefault(dataset.hoverBackgroundColor, index, getHoverColor(model.backgroundColor));\n model.borderColor = custom.hoverBorderColor ? custom.hoverBorderColor : valueOrDefault(dataset.hoverBorderColor, index, getHoverColor(model.borderColor));\n model.borderWidth = custom.hoverBorderWidth ? custom.hoverBorderWidth : valueOrDefault(dataset.hoverBorderWidth, index, model.borderWidth);\n },\n\n /**\n * @private\n */\n resyncElements: function() {\n var me = this;\n var meta = me.getMeta();\n var data = me.getDataset().data;\n var numMeta = meta.data.length;\n var numData = data.length;\n\n if (numData < numMeta) {\n meta.data.splice(numData, numMeta - numData);\n } else if (numData > numMeta) {\n me.insertElements(numMeta, numData - numMeta);\n }\n },\n\n /**\n * @private\n */\n insertElements: function(start, count) {\n for (var i = 0; i < count; ++i) {\n this.addElementAndReset(start + i);\n }\n },\n\n /**\n * @private\n */\n onDataPush: function() {\n this.insertElements(this.getDataset().data.length - 1, arguments.length);\n },\n\n /**\n * @private\n */\n onDataPop: function() {\n this.getMeta().data.pop();\n },\n\n /**\n * @private\n */\n onDataShift: function() {\n this.getMeta().data.shift();\n },\n\n /**\n * @private\n */\n onDataSplice: function(start, count) {\n this.getMeta().data.splice(start, count);\n this.insertElements(start, arguments.length - 2);\n },\n\n /**\n * @private\n */\n onDataUnshift: function() {\n this.insertElements(0, arguments.length);\n }\n });\n\n Chart.DatasetController.extend = helpers.inherits;\n };\n\n},{\"45\":45}],25:[function(require,module,exports){\n 'use strict';\n\n var helpers = require(45);\n\n module.exports = {\n /**\n * @private\n */\n _set: function(scope, values) {\n return helpers.merge(this[scope] || (this[scope] = {}), values);\n }\n };\n\n},{\"45\":45}],26:[function(require,module,exports){\n 'use strict';\n\n var color = require(2);\n var helpers = require(45);\n\n function interpolate(start, view, model, ease) {\n var keys = Object.keys(model);\n var i, ilen, key, actual, origin, target, type, c0, c1;\n\n for (i = 0, ilen = keys.length; i < ilen; ++i) {\n key = keys[i];\n\n target = model[key];\n\n // if a value is added to the model after pivot() has been called, the view\n // doesn't contain it, so let's initialize the view to the target value.\n if (!view.hasOwnProperty(key)) {\n view[key] = target;\n }\n\n actual = view[key];\n\n if (actual === target || key[0] === '_') {\n continue;\n }\n\n if (!start.hasOwnProperty(key)) {\n start[key] = actual;\n }\n\n origin = start[key];\n\n type = typeof target;\n\n if (type === typeof origin) {\n if (type === 'string') {\n c0 = color(origin);\n if (c0.valid) {\n c1 = color(target);\n if (c1.valid) {\n view[key] = c1.mix(c0, ease).rgbString();\n continue;\n }\n }\n } else if (type === 'number' && isFinite(origin) && isFinite(target)) {\n view[key] = origin + (target - origin) * ease;\n continue;\n }\n }\n\n view[key] = target;\n }\n }\n\n var Element = function(configuration) {\n helpers.extend(this, configuration);\n this.initialize.apply(this, arguments);\n };\n\n helpers.extend(Element.prototype, {\n\n initialize: function() {\n this.hidden = false;\n },\n\n pivot: function() {\n var me = this;\n if (!me._view) {\n me._view = helpers.clone(me._model);\n }\n me._start = {};\n return me;\n },\n\n transition: function(ease) {\n var me = this;\n var model = me._model;\n var start = me._start;\n var view = me._view;\n\n // No animation -> No Transition\n if (!model || ease === 1) {\n me._view = model;\n me._start = null;\n return me;\n }\n\n if (!view) {\n view = me._view = {};\n }\n\n if (!start) {\n start = me._start = {};\n }\n\n interpolate(start, view, model, ease);\n\n return me;\n },\n\n tooltipPosition: function() {\n return {\n x: this._model.x,\n y: this._model.y\n };\n },\n\n hasValue: function() {\n return helpers.isNumber(this._model.x) && helpers.isNumber(this._model.y);\n }\n });\n\n Element.extend = helpers.inherits;\n\n module.exports = Element;\n\n},{\"2\":2,\"45\":45}],27:[function(require,module,exports){\n\t/* global window: false */\n\t/* global document: false */\n 'use strict';\n\n var color = require(2);\n var defaults = require(25);\n var helpers = require(45);\n\n module.exports = function(Chart) {\n\n // -- Basic js utility methods\n\n helpers.extend = function(base) {\n var setFn = function(value, key) {\n base[key] = value;\n };\n for (var i = 1, ilen = arguments.length; i < ilen; i++) {\n helpers.each(arguments[i], setFn);\n }\n return base;\n };\n\n helpers.configMerge = function(/* objects ... */) {\n return helpers.merge(helpers.clone(arguments[0]), [].slice.call(arguments, 1), {\n merger: function(key, target, source, options) {\n var tval = target[key] || {};\n var sval = source[key];\n\n if (key === 'scales') {\n // scale config merging is complex. Add our own function here for that\n target[key] = helpers.scaleMerge(tval, sval);\n } else if (key === 'scale') {\n // used in polar area & radar charts since there is only one scale\n target[key] = helpers.merge(tval, [Chart.scaleService.getScaleDefaults(sval.type), sval]);\n } else {\n helpers._merger(key, target, source, options);\n }\n }\n });\n };\n\n helpers.scaleMerge = function(/* objects ... */) {\n return helpers.merge(helpers.clone(arguments[0]), [].slice.call(arguments, 1), {\n merger: function(key, target, source, options) {\n if (key === 'xAxes' || key === 'yAxes') {\n var slen = source[key].length;\n var i, type, scale;\n\n if (!target[key]) {\n target[key] = [];\n }\n\n for (i = 0; i < slen; ++i) {\n scale = source[key][i];\n type = helpers.valueOrDefault(scale.type, key === 'xAxes' ? 'category' : 'linear');\n\n if (i >= target[key].length) {\n target[key].push({});\n }\n\n if (!target[key][i].type || (scale.type && scale.type !== target[key][i].type)) {\n // new/untyped scale or type changed: let's apply the new defaults\n // then merge source scale to correctly overwrite the defaults.\n helpers.merge(target[key][i], [Chart.scaleService.getScaleDefaults(type), scale]);\n } else {\n // scales type are the same\n helpers.merge(target[key][i], scale);\n }\n }\n } else {\n helpers._merger(key, target, source, options);\n }\n }\n });\n };\n\n helpers.where = function(collection, filterCallback) {\n if (helpers.isArray(collection) && Array.prototype.filter) {\n return collection.filter(filterCallback);\n }\n var filtered = [];\n\n helpers.each(collection, function(item) {\n if (filterCallback(item)) {\n filtered.push(item);\n }\n });\n\n return filtered;\n };\n helpers.findIndex = Array.prototype.findIndex ?\n function(array, callback, scope) {\n return array.findIndex(callback, scope);\n } :\n function(array, callback, scope) {\n scope = scope === undefined ? array : scope;\n for (var i = 0, ilen = array.length; i < ilen; ++i) {\n if (callback.call(scope, array[i], i, array)) {\n return i;\n }\n }\n return -1;\n };\n helpers.findNextWhere = function(arrayToSearch, filterCallback, startIndex) {\n // Default to start of the array\n if (helpers.isNullOrUndef(startIndex)) {\n startIndex = -1;\n }\n for (var i = startIndex + 1; i < arrayToSearch.length; i++) {\n var currentItem = arrayToSearch[i];\n if (filterCallback(currentItem)) {\n return currentItem;\n }\n }\n };\n helpers.findPreviousWhere = function(arrayToSearch, filterCallback, startIndex) {\n // Default to end of the array\n if (helpers.isNullOrUndef(startIndex)) {\n startIndex = arrayToSearch.length;\n }\n for (var i = startIndex - 1; i >= 0; i--) {\n var currentItem = arrayToSearch[i];\n if (filterCallback(currentItem)) {\n return currentItem;\n }\n }\n };\n helpers.inherits = function(extensions) {\n // Basic javascript inheritance based on the model created in Backbone.js\n var me = this;\n var ChartElement = (extensions && extensions.hasOwnProperty('constructor')) ? extensions.constructor : function() {\n return me.apply(this, arguments);\n };\n\n var Surrogate = function() {\n this.constructor = ChartElement;\n };\n Surrogate.prototype = me.prototype;\n ChartElement.prototype = new Surrogate();\n\n ChartElement.extend = helpers.inherits;\n\n if (extensions) {\n helpers.extend(ChartElement.prototype, extensions);\n }\n\n ChartElement.__super__ = me.prototype;\n\n return ChartElement;\n };\n // -- Math methods\n helpers.isNumber = function(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n };\n helpers.almostEquals = function(x, y, epsilon) {\n return Math.abs(x - y) < epsilon;\n };\n helpers.almostWhole = function(x, epsilon) {\n var rounded = Math.round(x);\n return (((rounded - epsilon) < x) && ((rounded + epsilon) > x));\n };\n helpers.max = function(array) {\n return array.reduce(function(max, value) {\n if (!isNaN(value)) {\n return Math.max(max, value);\n }\n return max;\n }, Number.NEGATIVE_INFINITY);\n };\n helpers.min = function(array) {\n return array.reduce(function(min, value) {\n if (!isNaN(value)) {\n return Math.min(min, value);\n }\n return min;\n }, Number.POSITIVE_INFINITY);\n };\n helpers.sign = Math.sign ?\n function(x) {\n return Math.sign(x);\n } :\n function(x) {\n x = +x; // convert to a number\n if (x === 0 || isNaN(x)) {\n return x;\n }\n return x > 0 ? 1 : -1;\n };\n helpers.log10 = Math.log10 ?\n function(x) {\n return Math.log10(x);\n } :\n function(x) {\n return Math.log(x) / Math.LN10;\n };\n helpers.toRadians = function(degrees) {\n return degrees * (Math.PI / 180);\n };\n helpers.toDegrees = function(radians) {\n return radians * (180 / Math.PI);\n };\n // Gets the angle from vertical upright to the point about a centre.\n helpers.getAngleFromPoint = function(centrePoint, anglePoint) {\n var distanceFromXCenter = anglePoint.x - centrePoint.x;\n var distanceFromYCenter = anglePoint.y - centrePoint.y;\n var radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);\n\n var angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);\n\n if (angle < (-0.5 * Math.PI)) {\n angle += 2.0 * Math.PI; // make sure the returned angle is in the range of (-PI/2, 3PI/2]\n }\n\n return {\n angle: angle,\n distance: radialDistanceFromCenter\n };\n };\n helpers.distanceBetweenPoints = function(pt1, pt2) {\n return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));\n };\n helpers.aliasPixel = function(pixelWidth) {\n return (pixelWidth % 2 === 0) ? 0 : 0.5;\n };\n helpers.splineCurve = function(firstPoint, middlePoint, afterPoint, t) {\n // Props to Rob Spencer at scaled innovation for his post on splining between points\n // http://scaledinnovation.com/analytics/splines/aboutSplines.html\n\n // This function must also respect \"skipped\" points\n\n var previous = firstPoint.skip ? middlePoint : firstPoint;\n var current = middlePoint;\n var next = afterPoint.skip ? middlePoint : afterPoint;\n\n var d01 = Math.sqrt(Math.pow(current.x - previous.x, 2) + Math.pow(current.y - previous.y, 2));\n var d12 = Math.sqrt(Math.pow(next.x - current.x, 2) + Math.pow(next.y - current.y, 2));\n\n var s01 = d01 / (d01 + d12);\n var s12 = d12 / (d01 + d12);\n\n // If all points are the same, s01 & s02 will be inf\n s01 = isNaN(s01) ? 0 : s01;\n s12 = isNaN(s12) ? 0 : s12;\n\n var fa = t * s01; // scaling factor for triangle Ta\n var fb = t * s12;\n\n return {\n previous: {\n x: current.x - fa * (next.x - previous.x),\n y: current.y - fa * (next.y - previous.y)\n },\n next: {\n x: current.x + fb * (next.x - previous.x),\n y: current.y + fb * (next.y - previous.y)\n }\n };\n };\n helpers.EPSILON = Number.EPSILON || 1e-14;\n helpers.splineCurveMonotone = function(points) {\n // This function calculates Bézier control points in a similar way than |splineCurve|,\n // but preserves monotonicity of the provided data and ensures no local extremums are added\n // between the dataset discrete points due to the interpolation.\n // See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation\n\n var pointsWithTangents = (points || []).map(function(point) {\n return {\n model: point._model,\n deltaK: 0,\n mK: 0\n };\n });\n\n // Calculate slopes (deltaK) and initialize tangents (mK)\n var pointsLen = pointsWithTangents.length;\n var i, pointBefore, pointCurrent, pointAfter;\n for (i = 0; i < pointsLen; ++i) {\n pointCurrent = pointsWithTangents[i];\n if (pointCurrent.model.skip) {\n continue;\n }\n\n pointBefore = i > 0 ? pointsWithTangents[i - 1] : null;\n pointAfter = i < pointsLen - 1 ? pointsWithTangents[i + 1] : null;\n if (pointAfter && !pointAfter.model.skip) {\n var slopeDeltaX = (pointAfter.model.x - pointCurrent.model.x);\n\n // In the case of two points that appear at the same x pixel, slopeDeltaX is 0\n pointCurrent.deltaK = slopeDeltaX !== 0 ? (pointAfter.model.y - pointCurrent.model.y) / slopeDeltaX : 0;\n }\n\n if (!pointBefore || pointBefore.model.skip) {\n pointCurrent.mK = pointCurrent.deltaK;\n } else if (!pointAfter || pointAfter.model.skip) {\n pointCurrent.mK = pointBefore.deltaK;\n } else if (this.sign(pointBefore.deltaK) !== this.sign(pointCurrent.deltaK)) {\n pointCurrent.mK = 0;\n } else {\n pointCurrent.mK = (pointBefore.deltaK + pointCurrent.deltaK) / 2;\n }\n }\n\n // Adjust tangents to ensure monotonic properties\n var alphaK, betaK, tauK, squaredMagnitude;\n for (i = 0; i < pointsLen - 1; ++i) {\n pointCurrent = pointsWithTangents[i];\n pointAfter = pointsWithTangents[i + 1];\n if (pointCurrent.model.skip || pointAfter.model.skip) {\n continue;\n }\n\n if (helpers.almostEquals(pointCurrent.deltaK, 0, this.EPSILON)) {\n pointCurrent.mK = pointAfter.mK = 0;\n continue;\n }\n\n alphaK = pointCurrent.mK / pointCurrent.deltaK;\n betaK = pointAfter.mK / pointCurrent.deltaK;\n squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);\n if (squaredMagnitude <= 9) {\n continue;\n }\n\n tauK = 3 / Math.sqrt(squaredMagnitude);\n pointCurrent.mK = alphaK * tauK * pointCurrent.deltaK;\n pointAfter.mK = betaK * tauK * pointCurrent.deltaK;\n }\n\n // Compute control points\n var deltaX;\n for (i = 0; i < pointsLen; ++i) {\n pointCurrent = pointsWithTangents[i];\n if (pointCurrent.model.skip) {\n continue;\n }\n\n pointBefore = i > 0 ? pointsWithTangents[i - 1] : null;\n pointAfter = i < pointsLen - 1 ? pointsWithTangents[i + 1] : null;\n if (pointBefore && !pointBefore.model.skip) {\n deltaX = (pointCurrent.model.x - pointBefore.model.x) / 3;\n pointCurrent.model.controlPointPreviousX = pointCurrent.model.x - deltaX;\n pointCurrent.model.controlPointPreviousY = pointCurrent.model.y - deltaX * pointCurrent.mK;\n }\n if (pointAfter && !pointAfter.model.skip) {\n deltaX = (pointAfter.model.x - pointCurrent.model.x) / 3;\n pointCurrent.model.controlPointNextX = pointCurrent.model.x + deltaX;\n pointCurrent.model.controlPointNextY = pointCurrent.model.y + deltaX * pointCurrent.mK;\n }\n }\n };\n helpers.nextItem = function(collection, index, loop) {\n if (loop) {\n return index >= collection.length - 1 ? collection[0] : collection[index + 1];\n }\n return index >= collection.length - 1 ? collection[collection.length - 1] : collection[index + 1];\n };\n helpers.previousItem = function(collection, index, loop) {\n if (loop) {\n return index <= 0 ? collection[collection.length - 1] : collection[index - 1];\n }\n return index <= 0 ? collection[0] : collection[index - 1];\n };\n // Implementation of the nice number algorithm used in determining where axis labels will go\n helpers.niceNum = function(range, round) {\n var exponent = Math.floor(helpers.log10(range));\n var fraction = range / Math.pow(10, exponent);\n var niceFraction;\n\n if (round) {\n if (fraction < 1.5) {\n niceFraction = 1;\n } else if (fraction < 3) {\n niceFraction = 2;\n } else if (fraction < 7) {\n niceFraction = 5;\n } else {\n niceFraction = 10;\n }\n } else if (fraction <= 1.0) {\n niceFraction = 1;\n } else if (fraction <= 2) {\n niceFraction = 2;\n } else if (fraction <= 5) {\n niceFraction = 5;\n } else {\n niceFraction = 10;\n }\n\n return niceFraction * Math.pow(10, exponent);\n };\n // Request animation polyfill - http://www.paulirish.com/2011/requestanimationframe-for-smart-animating/\n helpers.requestAnimFrame = (function() {\n if (typeof window === 'undefined') {\n return function(callback) {\n callback();\n };\n }\n return window.requestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.oRequestAnimationFrame ||\n window.msRequestAnimationFrame ||\n function(callback) {\n return window.setTimeout(callback, 1000 / 60);\n };\n }());\n // -- DOM methods\n helpers.getRelativePosition = function(evt, chart) {\n var mouseX, mouseY;\n var e = evt.originalEvent || evt;\n var canvas = evt.currentTarget || evt.srcElement;\n var boundingRect = canvas.getBoundingClientRect();\n\n var touches = e.touches;\n if (touches && touches.length > 0) {\n mouseX = touches[0].clientX;\n mouseY = touches[0].clientY;\n\n } else {\n mouseX = e.clientX;\n mouseY = e.clientY;\n }\n\n // Scale mouse coordinates into canvas coordinates\n // by following the pattern laid out by 'jerryj' in the comments of\n // http://www.html5canvastutorials.com/advanced/html5-canvas-mouse-coordinates/\n var paddingLeft = parseFloat(helpers.getStyle(canvas, 'padding-left'));\n var paddingTop = parseFloat(helpers.getStyle(canvas, 'padding-top'));\n var paddingRight = parseFloat(helpers.getStyle(canvas, 'padding-right'));\n var paddingBottom = parseFloat(helpers.getStyle(canvas, 'padding-bottom'));\n var width = boundingRect.right - boundingRect.left - paddingLeft - paddingRight;\n var height = boundingRect.bottom - boundingRect.top - paddingTop - paddingBottom;\n\n // We divide by the current device pixel ratio, because the canvas is scaled up by that amount in each direction. However\n // the backend model is in unscaled coordinates. Since we are going to deal with our model coordinates, we go back here\n mouseX = Math.round((mouseX - boundingRect.left - paddingLeft) / (width) * canvas.width / chart.currentDevicePixelRatio);\n mouseY = Math.round((mouseY - boundingRect.top - paddingTop) / (height) * canvas.height / chart.currentDevicePixelRatio);\n\n return {\n x: mouseX,\n y: mouseY\n };\n\n };\n\n // Private helper function to convert max-width/max-height values that may be percentages into a number\n function parseMaxStyle(styleValue, node, parentProperty) {\n var valueInPixels;\n if (typeof styleValue === 'string') {\n valueInPixels = parseInt(styleValue, 10);\n\n if (styleValue.indexOf('%') !== -1) {\n // percentage * size in dimension\n valueInPixels = valueInPixels / 100 * node.parentNode[parentProperty];\n }\n } else {\n valueInPixels = styleValue;\n }\n\n return valueInPixels;\n }\n\n /**\n * Returns if the given value contains an effective constraint.\n * @private\n */\n function isConstrainedValue(value) {\n return value !== undefined && value !== null && value !== 'none';\n }\n\n // Private helper to get a constraint dimension\n // @param domNode : the node to check the constraint on\n // @param maxStyle : the style that defines the maximum for the direction we are using (maxWidth / maxHeight)\n // @param percentageProperty : property of parent to use when calculating width as a percentage\n // @see http://www.nathanaeljones.com/blog/2013/reading-max-width-cross-browser\n function getConstraintDimension(domNode, maxStyle, percentageProperty) {\n var view = document.defaultView;\n var parentNode = domNode.parentNode;\n var constrainedNode = view.getComputedStyle(domNode)[maxStyle];\n var constrainedContainer = view.getComputedStyle(parentNode)[maxStyle];\n var hasCNode = isConstrainedValue(constrainedNode);\n var hasCContainer = isConstrainedValue(constrainedContainer);\n var infinity = Number.POSITIVE_INFINITY;\n\n if (hasCNode || hasCContainer) {\n return Math.min(\n hasCNode ? parseMaxStyle(constrainedNode, domNode, percentageProperty) : infinity,\n hasCContainer ? parseMaxStyle(constrainedContainer, parentNode, percentageProperty) : infinity);\n }\n\n return 'none';\n }\n // returns Number or undefined if no constraint\n helpers.getConstraintWidth = function(domNode) {\n return getConstraintDimension(domNode, 'max-width', 'clientWidth');\n };\n // returns Number or undefined if no constraint\n helpers.getConstraintHeight = function(domNode) {\n return getConstraintDimension(domNode, 'max-height', 'clientHeight');\n };\n helpers.getMaximumWidth = function(domNode) {\n var container = domNode.parentNode;\n if (!container) {\n return domNode.clientWidth;\n }\n\n var paddingLeft = parseInt(helpers.getStyle(container, 'padding-left'), 10);\n var paddingRight = parseInt(helpers.getStyle(container, 'padding-right'), 10);\n var w = container.clientWidth - paddingLeft - paddingRight;\n var cw = helpers.getConstraintWidth(domNode);\n return isNaN(cw) ? w : Math.min(w, cw);\n };\n helpers.getMaximumHeight = function(domNode) {\n var container = domNode.parentNode;\n if (!container) {\n return domNode.clientHeight;\n }\n\n var paddingTop = parseInt(helpers.getStyle(container, 'padding-top'), 10);\n var paddingBottom = parseInt(helpers.getStyle(container, 'padding-bottom'), 10);\n var h = container.clientHeight - paddingTop - paddingBottom;\n var ch = helpers.getConstraintHeight(domNode);\n return isNaN(ch) ? h : Math.min(h, ch);\n };\n helpers.getStyle = function(el, property) {\n return el.currentStyle ?\n el.currentStyle[property] :\n document.defaultView.getComputedStyle(el, null).getPropertyValue(property);\n };\n helpers.retinaScale = function(chart, forceRatio) {\n var pixelRatio = chart.currentDevicePixelRatio = forceRatio || window.devicePixelRatio || 1;\n if (pixelRatio === 1) {\n return;\n }\n\n var canvas = chart.canvas;\n var height = chart.height;\n var width = chart.width;\n\n canvas.height = height * pixelRatio;\n canvas.width = width * pixelRatio;\n chart.ctx.scale(pixelRatio, pixelRatio);\n\n // If no style has been set on the canvas, the render size is used as display size,\n // making the chart visually bigger, so let's enforce it to the \"correct\" values.\n // See https://github.com/chartjs/Chart.js/issues/3575\n canvas.style.height = height + 'px';\n canvas.style.width = width + 'px';\n };\n // -- Canvas methods\n helpers.fontString = function(pixelSize, fontStyle, fontFamily) {\n return fontStyle + ' ' + pixelSize + 'px ' + fontFamily;\n };\n helpers.longestText = function(ctx, font, arrayOfThings, cache) {\n cache = cache || {};\n var data = cache.data = cache.data || {};\n var gc = cache.garbageCollect = cache.garbageCollect || [];\n\n if (cache.font !== font) {\n data = cache.data = {};\n gc = cache.garbageCollect = [];\n cache.font = font;\n }\n\n ctx.font = font;\n var longest = 0;\n helpers.each(arrayOfThings, function(thing) {\n // Undefined strings and arrays should not be measured\n if (thing !== undefined && thing !== null && helpers.isArray(thing) !== true) {\n longest = helpers.measureText(ctx, data, gc, longest, thing);\n } else if (helpers.isArray(thing)) {\n // if it is an array lets measure each element\n // to do maybe simplify this function a bit so we can do this more recursively?\n helpers.each(thing, function(nestedThing) {\n // Undefined strings and arrays should not be measured\n if (nestedThing !== undefined && nestedThing !== null && !helpers.isArray(nestedThing)) {\n longest = helpers.measureText(ctx, data, gc, longest, nestedThing);\n }\n });\n }\n });\n\n var gcLen = gc.length / 2;\n if (gcLen > arrayOfThings.length) {\n for (var i = 0; i < gcLen; i++) {\n delete data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n return longest;\n };\n helpers.measureText = function(ctx, data, gc, longest, string) {\n var textWidth = data[string];\n if (!textWidth) {\n textWidth = data[string] = ctx.measureText(string).width;\n gc.push(string);\n }\n if (textWidth > longest) {\n longest = textWidth;\n }\n return longest;\n };\n helpers.numberOfLabelLines = function(arrayOfThings) {\n var numberOfLines = 1;\n helpers.each(arrayOfThings, function(thing) {\n if (helpers.isArray(thing)) {\n if (thing.length > numberOfLines) {\n numberOfLines = thing.length;\n }\n }\n });\n return numberOfLines;\n };\n\n helpers.color = !color ?\n function(value) {\n console.error('Color.js not found!');\n return value;\n } :\n function(value) {\n\t\t\t\t/* global CanvasGradient */\n if (value instanceof CanvasGradient) {\n value = defaults.global.defaultColor;\n }\n\n return color(value);\n };\n\n helpers.getHoverColor = function(colorValue) {\n\t\t\t/* global CanvasPattern */\n return (colorValue instanceof CanvasPattern) ?\n colorValue :\n helpers.color(colorValue).saturate(0.5).darken(0.1).rgbString();\n };\n };\n\n},{\"2\":2,\"25\":25,\"45\":45}],28:[function(require,module,exports){\n 'use strict';\n\n var helpers = require(45);\n\n /**\n * Helper function to get relative position for an event\n * @param {Event|IEvent} event - The event to get the position for\n * @param {Chart} chart - The chart\n * @returns {Point} the event position\n */\n function getRelativePosition(e, chart) {\n if (e.native) {\n return {\n x: e.x,\n y: e.y\n };\n }\n\n return helpers.getRelativePosition(e, chart);\n }\n\n /**\n * Helper function to traverse all of the visible elements in the chart\n * @param chart {chart} the chart\n * @param handler {Function} the callback to execute for each visible item\n */\n function parseVisibleItems(chart, handler) {\n var datasets = chart.data.datasets;\n var meta, i, j, ilen, jlen;\n\n for (i = 0, ilen = datasets.length; i < ilen; ++i) {\n if (!chart.isDatasetVisible(i)) {\n continue;\n }\n\n meta = chart.getDatasetMeta(i);\n for (j = 0, jlen = meta.data.length; j < jlen; ++j) {\n var element = meta.data[j];\n if (!element._view.skip) {\n handler(element);\n }\n }\n }\n }\n\n /**\n * Helper function to get the items that intersect the event position\n * @param items {ChartElement[]} elements to filter\n * @param position {Point} the point to be nearest to\n * @return {ChartElement[]} the nearest items\n */\n function getIntersectItems(chart, position) {\n var elements = [];\n\n parseVisibleItems(chart, function(element) {\n if (element.inRange(position.x, position.y)) {\n elements.push(element);\n }\n });\n\n return elements;\n }\n\n /**\n * Helper function to get the items nearest to the event position considering all visible items in teh chart\n * @param chart {Chart} the chart to look at elements from\n * @param position {Point} the point to be nearest to\n * @param intersect {Boolean} if true, only consider items that intersect the position\n * @param distanceMetric {Function} function to provide the distance between points\n * @return {ChartElement[]} the nearest items\n */\n function getNearestItems(chart, position, intersect, distanceMetric) {\n var minDistance = Number.POSITIVE_INFINITY;\n var nearestItems = [];\n\n parseVisibleItems(chart, function(element) {\n if (intersect && !element.inRange(position.x, position.y)) {\n return;\n }\n\n var center = element.getCenterPoint();\n var distance = distanceMetric(position, center);\n\n if (distance < minDistance) {\n nearestItems = [element];\n minDistance = distance;\n } else if (distance === minDistance) {\n // Can have multiple items at the same distance in which case we sort by size\n nearestItems.push(element);\n }\n });\n\n return nearestItems;\n }\n\n /**\n * Get a distance metric function for two points based on the\n * axis mode setting\n * @param {String} axis the axis mode. x|y|xy\n */\n function getDistanceMetricForAxis(axis) {\n var useX = axis.indexOf('x') !== -1;\n var useY = axis.indexOf('y') !== -1;\n\n return function(pt1, pt2) {\n var deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;\n var deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;\n return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));\n };\n }\n\n function indexMode(chart, e, options) {\n var position = getRelativePosition(e, chart);\n // Default axis for index mode is 'x' to match old behaviour\n options.axis = options.axis || 'x';\n var distanceMetric = getDistanceMetricForAxis(options.axis);\n var items = options.intersect ? getIntersectItems(chart, position) : getNearestItems(chart, position, false, distanceMetric);\n var elements = [];\n\n if (!items.length) {\n return [];\n }\n\n chart.data.datasets.forEach(function(dataset, datasetIndex) {\n if (chart.isDatasetVisible(datasetIndex)) {\n var meta = chart.getDatasetMeta(datasetIndex);\n var element = meta.data[items[0]._index];\n\n // don't count items that are skipped (null data)\n if (element && !element._view.skip) {\n elements.push(element);\n }\n }\n });\n\n return elements;\n }\n\n /**\n * @interface IInteractionOptions\n */\n /**\n * If true, only consider items that intersect the point\n * @name IInterfaceOptions#boolean\n * @type Boolean\n */\n\n /**\n * Contains interaction related functions\n * @namespace Chart.Interaction\n */\n module.exports = {\n // Helper function for different modes\n modes: {\n single: function(chart, e) {\n var position = getRelativePosition(e, chart);\n var elements = [];\n\n parseVisibleItems(chart, function(element) {\n if (element.inRange(position.x, position.y)) {\n elements.push(element);\n return elements;\n }\n });\n\n return elements.slice(0, 1);\n },\n\n /**\n * @function Chart.Interaction.modes.label\n * @deprecated since version 2.4.0\n * @todo remove at version 3\n * @private\n */\n label: indexMode,\n\n /**\n * Returns items at the same index. If the options.intersect parameter is true, we only return items if we intersect something\n * If the options.intersect mode is false, we find the nearest item and return the items at the same index as that item\n * @function Chart.Interaction.modes.index\n * @since v2.4.0\n * @param chart {chart} the chart we are returning items from\n * @param e {Event} the event we are find things at\n * @param options {IInteractionOptions} options to use during interaction\n * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\n */\n index: indexMode,\n\n /**\n * Returns items in the same dataset. If the options.intersect parameter is true, we only return items if we intersect something\n * If the options.intersect is false, we find the nearest item and return the items in that dataset\n * @function Chart.Interaction.modes.dataset\n * @param chart {chart} the chart we are returning items from\n * @param e {Event} the event we are find things at\n * @param options {IInteractionOptions} options to use during interaction\n * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\n */\n dataset: function(chart, e, options) {\n var position = getRelativePosition(e, chart);\n options.axis = options.axis || 'xy';\n var distanceMetric = getDistanceMetricForAxis(options.axis);\n var items = options.intersect ? getIntersectItems(chart, position) : getNearestItems(chart, position, false, distanceMetric);\n\n if (items.length > 0) {\n items = chart.getDatasetMeta(items[0]._datasetIndex).data;\n }\n\n return items;\n },\n\n /**\n * @function Chart.Interaction.modes.x-axis\n * @deprecated since version 2.4.0. Use index mode and intersect == true\n * @todo remove at version 3\n * @private\n */\n 'x-axis': function(chart, e) {\n return indexMode(chart, e, {intersect: true});\n },\n\n /**\n * Point mode returns all elements that hit test based on the event position\n * of the event\n * @function Chart.Interaction.modes.intersect\n * @param chart {chart} the chart we are returning items from\n * @param e {Event} the event we are find things at\n * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\n */\n point: function(chart, e) {\n var position = getRelativePosition(e, chart);\n return getIntersectItems(chart, position);\n },\n\n /**\n * nearest mode returns the element closest to the point\n * @function Chart.Interaction.modes.intersect\n * @param chart {chart} the chart we are returning items from\n * @param e {Event} the event we are find things at\n * @param options {IInteractionOptions} options to use\n * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\n */\n nearest: function(chart, e, options) {\n var position = getRelativePosition(e, chart);\n options.axis = options.axis || 'xy';\n var distanceMetric = getDistanceMetricForAxis(options.axis);\n var nearestItems = getNearestItems(chart, position, options.intersect, distanceMetric);\n\n // We have multiple items at the same distance from the event. Now sort by smallest\n if (nearestItems.length > 1) {\n nearestItems.sort(function(a, b) {\n var sizeA = a.getArea();\n var sizeB = b.getArea();\n var ret = sizeA - sizeB;\n\n if (ret === 0) {\n // if equal sort by dataset index\n ret = a._datasetIndex - b._datasetIndex;\n }\n\n return ret;\n });\n }\n\n // Return only 1 item\n return nearestItems.slice(0, 1);\n },\n\n /**\n * x mode returns the elements that hit-test at the current x coordinate\n * @function Chart.Interaction.modes.x\n * @param chart {chart} the chart we are returning items from\n * @param e {Event} the event we are find things at\n * @param options {IInteractionOptions} options to use\n * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\n */\n x: function(chart, e, options) {\n var position = getRelativePosition(e, chart);\n var items = [];\n var intersectsItem = false;\n\n parseVisibleItems(chart, function(element) {\n if (element.inXRange(position.x)) {\n items.push(element);\n }\n\n if (element.inRange(position.x, position.y)) {\n intersectsItem = true;\n }\n });\n\n // If we want to trigger on an intersect and we don't have any items\n // that intersect the position, return nothing\n if (options.intersect && !intersectsItem) {\n items = [];\n }\n return items;\n },\n\n /**\n * y mode returns the elements that hit-test at the current y coordinate\n * @function Chart.Interaction.modes.y\n * @param chart {chart} the chart we are returning items from\n * @param e {Event} the event we are find things at\n * @param options {IInteractionOptions} options to use\n * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\n */\n y: function(chart, e, options) {\n var position = getRelativePosition(e, chart);\n var items = [];\n var intersectsItem = false;\n\n parseVisibleItems(chart, function(element) {\n if (element.inYRange(position.y)) {\n items.push(element);\n }\n\n if (element.inRange(position.x, position.y)) {\n intersectsItem = true;\n }\n });\n\n // If we want to trigger on an intersect and we don't have any items\n // that intersect the position, return nothing\n if (options.intersect && !intersectsItem) {\n items = [];\n }\n return items;\n }\n }\n };\n\n},{\"45\":45}],29:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n\n defaults._set('global', {\n responsive: true,\n responsiveAnimationDuration: 0,\n maintainAspectRatio: true,\n events: ['mousemove', 'mouseout', 'click', 'touchstart', 'touchmove'],\n hover: {\n onHover: null,\n mode: 'nearest',\n intersect: true,\n animationDuration: 400\n },\n onClick: null,\n defaultColor: 'rgba(0,0,0,0.1)',\n defaultFontColor: '#666',\n defaultFontFamily: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\n defaultFontSize: 12,\n defaultFontStyle: 'normal',\n showLines: true,\n\n // Element defaults defined in element extensions\n elements: {},\n\n // Layout options such as padding\n layout: {\n padding: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n }\n }\n });\n\n module.exports = function() {\n\n // Occupy the global variable of Chart, and create a simple base class\n var Chart = function(item, config) {\n this.construct(item, config);\n return this;\n };\n\n Chart.Chart = Chart;\n\n return Chart;\n };\n\n},{\"25\":25}],30:[function(require,module,exports){\n 'use strict';\n\n var helpers = require(45);\n\n module.exports = function(Chart) {\n\n function filterByPosition(array, position) {\n return helpers.where(array, function(v) {\n return v.position === position;\n });\n }\n\n function sortByWeight(array, reverse) {\n array.forEach(function(v, i) {\n v._tmpIndex_ = i;\n return v;\n });\n array.sort(function(a, b) {\n var v0 = reverse ? b : a;\n var v1 = reverse ? a : b;\n return v0.weight === v1.weight ?\n v0._tmpIndex_ - v1._tmpIndex_ :\n v0.weight - v1.weight;\n });\n array.forEach(function(v) {\n delete v._tmpIndex_;\n });\n }\n\n /**\n * @interface ILayoutItem\n * @prop {String} position - The position of the item in the chart layout. Possible values are\n * 'left', 'top', 'right', 'bottom', and 'chartArea'\n * @prop {Number} weight - The weight used to sort the item. Higher weights are further away from the chart area\n * @prop {Boolean} fullWidth - if true, and the item is horizontal, then push vertical boxes down\n * @prop {Function} isHorizontal - returns true if the layout item is horizontal (ie. top or bottom)\n * @prop {Function} update - Takes two parameters: width and height. Returns size of item\n * @prop {Function} getPadding - Returns an object with padding on the edges\n * @prop {Number} width - Width of item. Must be valid after update()\n * @prop {Number} height - Height of item. Must be valid after update()\n * @prop {Number} left - Left edge of the item. Set by layout system and cannot be used in update\n * @prop {Number} top - Top edge of the item. Set by layout system and cannot be used in update\n * @prop {Number} right - Right edge of the item. Set by layout system and cannot be used in update\n * @prop {Number} bottom - Bottom edge of the item. Set by layout system and cannot be used in update\n */\n\n // The layout service is very self explanatory. It's responsible for the layout within a chart.\n // Scales, Legends and Plugins all rely on the layout service and can easily register to be placed anywhere they need\n // It is this service's responsibility of carrying out that layout.\n Chart.layoutService = {\n defaults: {},\n\n /**\n * Register a box to a chart.\n * A box is simply a reference to an object that requires layout. eg. Scales, Legend, Title.\n * @param {Chart} chart - the chart to use\n * @param {ILayoutItem} item - the item to add to be layed out\n */\n addBox: function(chart, item) {\n if (!chart.boxes) {\n chart.boxes = [];\n }\n\n // initialize item with default values\n item.fullWidth = item.fullWidth || false;\n item.position = item.position || 'top';\n item.weight = item.weight || 0;\n\n chart.boxes.push(item);\n },\n\n /**\n * Remove a layoutItem from a chart\n * @param {Chart} chart - the chart to remove the box from\n * @param {Object} layoutItem - the item to remove from the layout\n */\n removeBox: function(chart, layoutItem) {\n var index = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;\n if (index !== -1) {\n chart.boxes.splice(index, 1);\n }\n },\n\n /**\n * Sets (or updates) options on the given `item`.\n * @param {Chart} chart - the chart in which the item lives (or will be added to)\n * @param {Object} item - the item to configure with the given options\n * @param {Object} options - the new item options.\n */\n configure: function(chart, item, options) {\n var props = ['fullWidth', 'position', 'weight'];\n var ilen = props.length;\n var i = 0;\n var prop;\n\n for (; i < ilen; ++i) {\n prop = props[i];\n if (options.hasOwnProperty(prop)) {\n item[prop] = options[prop];\n }\n }\n },\n\n /**\n * Fits boxes of the given chart into the given size by having each box measure itself\n * then running a fitting algorithm\n * @param {Chart} chart - the chart\n * @param {Number} width - the width to fit into\n * @param {Number} height - the height to fit into\n */\n update: function(chart, width, height) {\n if (!chart) {\n return;\n }\n\n var layoutOptions = chart.options.layout || {};\n var padding = helpers.options.toPadding(layoutOptions.padding);\n var leftPadding = padding.left;\n var rightPadding = padding.right;\n var topPadding = padding.top;\n var bottomPadding = padding.bottom;\n\n var leftBoxes = filterByPosition(chart.boxes, 'left');\n var rightBoxes = filterByPosition(chart.boxes, 'right');\n var topBoxes = filterByPosition(chart.boxes, 'top');\n var bottomBoxes = filterByPosition(chart.boxes, 'bottom');\n var chartAreaBoxes = filterByPosition(chart.boxes, 'chartArea');\n\n // Sort boxes by weight. A higher weight is further away from the chart area\n sortByWeight(leftBoxes, true);\n sortByWeight(rightBoxes, false);\n sortByWeight(topBoxes, true);\n sortByWeight(bottomBoxes, false);\n\n // Essentially we now have any number of boxes on each of the 4 sides.\n // Our canvas looks like the following.\n // The areas L1 and L2 are the left axes. R1 is the right axis, T1 is the top axis and\n // B1 is the bottom axis\n // There are also 4 quadrant-like locations (left to right instead of clockwise) reserved for chart overlays\n // These locations are single-box locations only, when trying to register a chartArea location that is already taken,\n // an error will be thrown.\n //\n // |----------------------------------------------------|\n // | T1 (Full Width) |\n // |----------------------------------------------------|\n // | | | T2 | |\n // | |----|-------------------------------------|----|\n // | | | C1 | | C2 | |\n // | | |----| |----| |\n // | | | | |\n // | L1 | L2 | ChartArea (C0) | R1 |\n // | | | | |\n // | | |----| |----| |\n // | | | C3 | | C4 | |\n // | |----|-------------------------------------|----|\n // | | | B1 | |\n // |----------------------------------------------------|\n // | B2 (Full Width) |\n // |----------------------------------------------------|\n //\n // What we do to find the best sizing, we do the following\n // 1. Determine the minimum size of the chart area.\n // 2. Split the remaining width equally between each vertical axis\n // 3. Split the remaining height equally between each horizontal axis\n // 4. Give each layout the maximum size it can be. The layout will return it's minimum size\n // 5. Adjust the sizes of each axis based on it's minimum reported size.\n // 6. Refit each axis\n // 7. Position each axis in the final location\n // 8. Tell the chart the final location of the chart area\n // 9. Tell any axes that overlay the chart area the positions of the chart area\n\n // Step 1\n var chartWidth = width - leftPadding - rightPadding;\n var chartHeight = height - topPadding - bottomPadding;\n var chartAreaWidth = chartWidth / 2; // min 50%\n var chartAreaHeight = chartHeight / 2; // min 50%\n\n // Step 2\n var verticalBoxWidth = (width - chartAreaWidth) / (leftBoxes.length + rightBoxes.length);\n\n // Step 3\n var horizontalBoxHeight = (height - chartAreaHeight) / (topBoxes.length + bottomBoxes.length);\n\n // Step 4\n var maxChartAreaWidth = chartWidth;\n var maxChartAreaHeight = chartHeight;\n var minBoxSizes = [];\n\n function getMinimumBoxSize(box) {\n var minSize;\n var isHorizontal = box.isHorizontal();\n\n if (isHorizontal) {\n minSize = box.update(box.fullWidth ? chartWidth : maxChartAreaWidth, horizontalBoxHeight);\n maxChartAreaHeight -= minSize.height;\n } else {\n minSize = box.update(verticalBoxWidth, chartAreaHeight);\n maxChartAreaWidth -= minSize.width;\n }\n\n minBoxSizes.push({\n horizontal: isHorizontal,\n minSize: minSize,\n box: box,\n });\n }\n\n helpers.each(leftBoxes.concat(rightBoxes, topBoxes, bottomBoxes), getMinimumBoxSize);\n\n // If a horizontal box has padding, we move the left boxes over to avoid ugly charts (see issue #2478)\n var maxHorizontalLeftPadding = 0;\n var maxHorizontalRightPadding = 0;\n var maxVerticalTopPadding = 0;\n var maxVerticalBottomPadding = 0;\n\n helpers.each(topBoxes.concat(bottomBoxes), function(horizontalBox) {\n if (horizontalBox.getPadding) {\n var boxPadding = horizontalBox.getPadding();\n maxHorizontalLeftPadding = Math.max(maxHorizontalLeftPadding, boxPadding.left);\n maxHorizontalRightPadding = Math.max(maxHorizontalRightPadding, boxPadding.right);\n }\n });\n\n helpers.each(leftBoxes.concat(rightBoxes), function(verticalBox) {\n if (verticalBox.getPadding) {\n var boxPadding = verticalBox.getPadding();\n maxVerticalTopPadding = Math.max(maxVerticalTopPadding, boxPadding.top);\n maxVerticalBottomPadding = Math.max(maxVerticalBottomPadding, boxPadding.bottom);\n }\n });\n\n // At this point, maxChartAreaHeight and maxChartAreaWidth are the size the chart area could\n // be if the axes are drawn at their minimum sizes.\n // Steps 5 & 6\n var totalLeftBoxesWidth = leftPadding;\n var totalRightBoxesWidth = rightPadding;\n var totalTopBoxesHeight = topPadding;\n var totalBottomBoxesHeight = bottomPadding;\n\n // Function to fit a box\n function fitBox(box) {\n var minBoxSize = helpers.findNextWhere(minBoxSizes, function(minBox) {\n return minBox.box === box;\n });\n\n if (minBoxSize) {\n if (box.isHorizontal()) {\n var scaleMargin = {\n left: Math.max(totalLeftBoxesWidth, maxHorizontalLeftPadding),\n right: Math.max(totalRightBoxesWidth, maxHorizontalRightPadding),\n top: 0,\n bottom: 0\n };\n\n // Don't use min size here because of label rotation. When the labels are rotated, their rotation highly depends\n // on the margin. Sometimes they need to increase in size slightly\n box.update(box.fullWidth ? chartWidth : maxChartAreaWidth, chartHeight / 2, scaleMargin);\n } else {\n box.update(minBoxSize.minSize.width, maxChartAreaHeight);\n }\n }\n }\n\n // Update, and calculate the left and right margins for the horizontal boxes\n helpers.each(leftBoxes.concat(rightBoxes), fitBox);\n\n helpers.each(leftBoxes, function(box) {\n totalLeftBoxesWidth += box.width;\n });\n\n helpers.each(rightBoxes, function(box) {\n totalRightBoxesWidth += box.width;\n });\n\n // Set the Left and Right margins for the horizontal boxes\n helpers.each(topBoxes.concat(bottomBoxes), fitBox);\n\n // Figure out how much margin is on the top and bottom of the vertical boxes\n helpers.each(topBoxes, function(box) {\n totalTopBoxesHeight += box.height;\n });\n\n helpers.each(bottomBoxes, function(box) {\n totalBottomBoxesHeight += box.height;\n });\n\n function finalFitVerticalBox(box) {\n var minBoxSize = helpers.findNextWhere(minBoxSizes, function(minSize) {\n return minSize.box === box;\n });\n\n var scaleMargin = {\n left: 0,\n right: 0,\n top: totalTopBoxesHeight,\n bottom: totalBottomBoxesHeight\n };\n\n if (minBoxSize) {\n box.update(minBoxSize.minSize.width, maxChartAreaHeight, scaleMargin);\n }\n }\n\n // Let the left layout know the final margin\n helpers.each(leftBoxes.concat(rightBoxes), finalFitVerticalBox);\n\n // Recalculate because the size of each layout might have changed slightly due to the margins (label rotation for instance)\n totalLeftBoxesWidth = leftPadding;\n totalRightBoxesWidth = rightPadding;\n totalTopBoxesHeight = topPadding;\n totalBottomBoxesHeight = bottomPadding;\n\n helpers.each(leftBoxes, function(box) {\n totalLeftBoxesWidth += box.width;\n });\n\n helpers.each(rightBoxes, function(box) {\n totalRightBoxesWidth += box.width;\n });\n\n helpers.each(topBoxes, function(box) {\n totalTopBoxesHeight += box.height;\n });\n helpers.each(bottomBoxes, function(box) {\n totalBottomBoxesHeight += box.height;\n });\n\n // We may be adding some padding to account for rotated x axis labels\n var leftPaddingAddition = Math.max(maxHorizontalLeftPadding - totalLeftBoxesWidth, 0);\n totalLeftBoxesWidth += leftPaddingAddition;\n totalRightBoxesWidth += Math.max(maxHorizontalRightPadding - totalRightBoxesWidth, 0);\n\n var topPaddingAddition = Math.max(maxVerticalTopPadding - totalTopBoxesHeight, 0);\n totalTopBoxesHeight += topPaddingAddition;\n totalBottomBoxesHeight += Math.max(maxVerticalBottomPadding - totalBottomBoxesHeight, 0);\n\n // Figure out if our chart area changed. This would occur if the dataset layout label rotation\n // changed due to the application of the margins in step 6. Since we can only get bigger, this is safe to do\n // without calling `fit` again\n var newMaxChartAreaHeight = height - totalTopBoxesHeight - totalBottomBoxesHeight;\n var newMaxChartAreaWidth = width - totalLeftBoxesWidth - totalRightBoxesWidth;\n\n if (newMaxChartAreaWidth !== maxChartAreaWidth || newMaxChartAreaHeight !== maxChartAreaHeight) {\n helpers.each(leftBoxes, function(box) {\n box.height = newMaxChartAreaHeight;\n });\n\n helpers.each(rightBoxes, function(box) {\n box.height = newMaxChartAreaHeight;\n });\n\n helpers.each(topBoxes, function(box) {\n if (!box.fullWidth) {\n box.width = newMaxChartAreaWidth;\n }\n });\n\n helpers.each(bottomBoxes, function(box) {\n if (!box.fullWidth) {\n box.width = newMaxChartAreaWidth;\n }\n });\n\n maxChartAreaHeight = newMaxChartAreaHeight;\n maxChartAreaWidth = newMaxChartAreaWidth;\n }\n\n // Step 7 - Position the boxes\n var left = leftPadding + leftPaddingAddition;\n var top = topPadding + topPaddingAddition;\n\n function placeBox(box) {\n if (box.isHorizontal()) {\n box.left = box.fullWidth ? leftPadding : totalLeftBoxesWidth;\n box.right = box.fullWidth ? width - rightPadding : totalLeftBoxesWidth + maxChartAreaWidth;\n box.top = top;\n box.bottom = top + box.height;\n\n // Move to next point\n top = box.bottom;\n\n } else {\n\n box.left = left;\n box.right = left + box.width;\n box.top = totalTopBoxesHeight;\n box.bottom = totalTopBoxesHeight + maxChartAreaHeight;\n\n // Move to next point\n left = box.right;\n }\n }\n\n helpers.each(leftBoxes.concat(topBoxes), placeBox);\n\n // Account for chart width and height\n left += maxChartAreaWidth;\n top += maxChartAreaHeight;\n\n helpers.each(rightBoxes, placeBox);\n helpers.each(bottomBoxes, placeBox);\n\n // Step 8\n chart.chartArea = {\n left: totalLeftBoxesWidth,\n top: totalTopBoxesHeight,\n right: totalLeftBoxesWidth + maxChartAreaWidth,\n bottom: totalTopBoxesHeight + maxChartAreaHeight\n };\n\n // Step 9\n helpers.each(chartAreaBoxes, function(box) {\n box.left = chart.chartArea.left;\n box.top = chart.chartArea.top;\n box.right = chart.chartArea.right;\n box.bottom = chart.chartArea.bottom;\n\n box.update(maxChartAreaWidth, maxChartAreaHeight);\n });\n }\n };\n };\n\n},{\"45\":45}],31:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var Element = require(26);\n var helpers = require(45);\n\n defaults._set('global', {\n plugins: {}\n });\n\n module.exports = function(Chart) {\n\n /**\n * The plugin service singleton\n * @namespace Chart.plugins\n * @since 2.1.0\n */\n Chart.plugins = {\n /**\n * Globally registered plugins.\n * @private\n */\n _plugins: [],\n\n /**\n * This identifier is used to invalidate the descriptors cache attached to each chart\n * when a global plugin is registered or unregistered. In this case, the cache ID is\n * incremented and descriptors are regenerated during following API calls.\n * @private\n */\n _cacheId: 0,\n\n /**\n * Registers the given plugin(s) if not already registered.\n * @param {Array|Object} plugins plugin instance(s).\n */\n register: function(plugins) {\n var p = this._plugins;\n ([]).concat(plugins).forEach(function(plugin) {\n if (p.indexOf(plugin) === -1) {\n p.push(plugin);\n }\n });\n\n this._cacheId++;\n },\n\n /**\n * Unregisters the given plugin(s) only if registered.\n * @param {Array|Object} plugins plugin instance(s).\n */\n unregister: function(plugins) {\n var p = this._plugins;\n ([]).concat(plugins).forEach(function(plugin) {\n var idx = p.indexOf(plugin);\n if (idx !== -1) {\n p.splice(idx, 1);\n }\n });\n\n this._cacheId++;\n },\n\n /**\n * Remove all registered plugins.\n * @since 2.1.5\n */\n clear: function() {\n this._plugins = [];\n this._cacheId++;\n },\n\n /**\n * Returns the number of registered plugins?\n * @returns {Number}\n * @since 2.1.5\n */\n count: function() {\n return this._plugins.length;\n },\n\n /**\n * Returns all registered plugin instances.\n * @returns {Array} array of plugin objects.\n * @since 2.1.5\n */\n getAll: function() {\n return this._plugins;\n },\n\n /**\n * Calls enabled plugins for `chart` on the specified hook and with the given args.\n * This method immediately returns as soon as a plugin explicitly returns false. The\n * returned value can be used, for instance, to interrupt the current action.\n * @param {Object} chart - The chart instance for which plugins should be called.\n * @param {String} hook - The name of the plugin method to call (e.g. 'beforeUpdate').\n * @param {Array} [args] - Extra arguments to apply to the hook call.\n * @returns {Boolean} false if any of the plugins return false, else returns true.\n */\n notify: function(chart, hook, args) {\n var descriptors = this.descriptors(chart);\n var ilen = descriptors.length;\n var i, descriptor, plugin, params, method;\n\n for (i = 0; i < ilen; ++i) {\n descriptor = descriptors[i];\n plugin = descriptor.plugin;\n method = plugin[hook];\n if (typeof method === 'function') {\n params = [chart].concat(args || []);\n params.push(descriptor.options);\n if (method.apply(plugin, params) === false) {\n return false;\n }\n }\n }\n\n return true;\n },\n\n /**\n * Returns descriptors of enabled plugins for the given chart.\n * @returns {Array} [{ plugin, options }]\n * @private\n */\n descriptors: function(chart) {\n var cache = chart._plugins || (chart._plugins = {});\n if (cache.id === this._cacheId) {\n return cache.descriptors;\n }\n\n var plugins = [];\n var descriptors = [];\n var config = (chart && chart.config) || {};\n var options = (config.options && config.options.plugins) || {};\n\n this._plugins.concat(config.plugins || []).forEach(function(plugin) {\n var idx = plugins.indexOf(plugin);\n if (idx !== -1) {\n return;\n }\n\n var id = plugin.id;\n var opts = options[id];\n if (opts === false) {\n return;\n }\n\n if (opts === true) {\n opts = helpers.clone(defaults.global.plugins[id]);\n }\n\n plugins.push(plugin);\n descriptors.push({\n plugin: plugin,\n options: opts || {}\n });\n });\n\n cache.descriptors = descriptors;\n cache.id = this._cacheId;\n return descriptors;\n }\n };\n\n /**\n * Plugin extension hooks.\n * @interface IPlugin\n * @since 2.1.0\n */\n /**\n * @method IPlugin#beforeInit\n * @desc Called before initializing `chart`.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Object} options - The plugin options.\n */\n /**\n * @method IPlugin#afterInit\n * @desc Called after `chart` has been initialized and before the first update.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Object} options - The plugin options.\n */\n /**\n * @method IPlugin#beforeUpdate\n * @desc Called before updating `chart`. If any plugin returns `false`, the update\n * is cancelled (and thus subsequent render(s)) until another `update` is triggered.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Object} options - The plugin options.\n * @returns {Boolean} `false` to cancel the chart update.\n */\n /**\n * @method IPlugin#afterUpdate\n * @desc Called after `chart` has been updated and before rendering. Note that this\n * hook will not be called if the chart update has been previously cancelled.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Object} options - The plugin options.\n */\n /**\n * @method IPlugin#beforeDatasetsUpdate\n * @desc Called before updating the `chart` datasets. If any plugin returns `false`,\n * the datasets update is cancelled until another `update` is triggered.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Object} options - The plugin options.\n * @returns {Boolean} false to cancel the datasets update.\n * @since version 2.1.5\n */\n /**\n * @method IPlugin#afterDatasetsUpdate\n * @desc Called after the `chart` datasets have been updated. Note that this hook\n * will not be called if the datasets update has been previously cancelled.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Object} options - The plugin options.\n * @since version 2.1.5\n */\n /**\n * @method IPlugin#beforeDatasetUpdate\n * @desc Called before updating the `chart` dataset at the given `args.index`. If any plugin\n * returns `false`, the datasets update is cancelled until another `update` is triggered.\n * @param {Chart} chart - The chart instance.\n * @param {Object} args - The call arguments.\n * @param {Number} args.index - The dataset index.\n * @param {Object} args.meta - The dataset metadata.\n * @param {Object} options - The plugin options.\n * @returns {Boolean} `false` to cancel the chart datasets drawing.\n */\n /**\n * @method IPlugin#afterDatasetUpdate\n * @desc Called after the `chart` datasets at the given `args.index` has been updated. Note\n * that this hook will not be called if the datasets update has been previously cancelled.\n * @param {Chart} chart - The chart instance.\n * @param {Object} args - The call arguments.\n * @param {Number} args.index - The dataset index.\n * @param {Object} args.meta - The dataset metadata.\n * @param {Object} options - The plugin options.\n */\n /**\n * @method IPlugin#beforeLayout\n * @desc Called before laying out `chart`. If any plugin returns `false`,\n * the layout update is cancelled until another `update` is triggered.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Object} options - The plugin options.\n * @returns {Boolean} `false` to cancel the chart layout.\n */\n /**\n * @method IPlugin#afterLayout\n * @desc Called after the `chart` has been layed out. Note that this hook will not\n * be called if the layout update has been previously cancelled.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Object} options - The plugin options.\n */\n /**\n * @method IPlugin#beforeRender\n * @desc Called before rendering `chart`. If any plugin returns `false`,\n * the rendering is cancelled until another `render` is triggered.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Object} options - The plugin options.\n * @returns {Boolean} `false` to cancel the chart rendering.\n */\n /**\n * @method IPlugin#afterRender\n * @desc Called after the `chart` has been fully rendered (and animation completed). Note\n * that this hook will not be called if the rendering has been previously cancelled.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Object} options - The plugin options.\n */\n /**\n * @method IPlugin#beforeDraw\n * @desc Called before drawing `chart` at every animation frame specified by the given\n * easing value. If any plugin returns `false`, the frame drawing is cancelled until\n * another `render` is triggered.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Number} easingValue - The current animation value, between 0.0 and 1.0.\n * @param {Object} options - The plugin options.\n * @returns {Boolean} `false` to cancel the chart drawing.\n */\n /**\n * @method IPlugin#afterDraw\n * @desc Called after the `chart` has been drawn for the specific easing value. Note\n * that this hook will not be called if the drawing has been previously cancelled.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Number} easingValue - The current animation value, between 0.0 and 1.0.\n * @param {Object} options - The plugin options.\n */\n /**\n * @method IPlugin#beforeDatasetsDraw\n * @desc Called before drawing the `chart` datasets. If any plugin returns `false`,\n * the datasets drawing is cancelled until another `render` is triggered.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Number} easingValue - The current animation value, between 0.0 and 1.0.\n * @param {Object} options - The plugin options.\n * @returns {Boolean} `false` to cancel the chart datasets drawing.\n */\n /**\n * @method IPlugin#afterDatasetsDraw\n * @desc Called after the `chart` datasets have been drawn. Note that this hook\n * will not be called if the datasets drawing has been previously cancelled.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Number} easingValue - The current animation value, between 0.0 and 1.0.\n * @param {Object} options - The plugin options.\n */\n /**\n * @method IPlugin#beforeDatasetDraw\n * @desc Called before drawing the `chart` dataset at the given `args.index` (datasets\n * are drawn in the reverse order). If any plugin returns `false`, the datasets drawing\n * is cancelled until another `render` is triggered.\n * @param {Chart} chart - The chart instance.\n * @param {Object} args - The call arguments.\n * @param {Number} args.index - The dataset index.\n * @param {Object} args.meta - The dataset metadata.\n * @param {Number} args.easingValue - The current animation value, between 0.0 and 1.0.\n * @param {Object} options - The plugin options.\n * @returns {Boolean} `false` to cancel the chart datasets drawing.\n */\n /**\n * @method IPlugin#afterDatasetDraw\n * @desc Called after the `chart` datasets at the given `args.index` have been drawn\n * (datasets are drawn in the reverse order). Note that this hook will not be called\n * if the datasets drawing has been previously cancelled.\n * @param {Chart} chart - The chart instance.\n * @param {Object} args - The call arguments.\n * @param {Number} args.index - The dataset index.\n * @param {Object} args.meta - The dataset metadata.\n * @param {Number} args.easingValue - The current animation value, between 0.0 and 1.0.\n * @param {Object} options - The plugin options.\n */\n /**\n * @method IPlugin#beforeEvent\n * @desc Called before processing the specified `event`. If any plugin returns `false`,\n * the event will be discarded.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {IEvent} event - The event object.\n * @param {Object} options - The plugin options.\n */\n /**\n * @method IPlugin#afterEvent\n * @desc Called after the `event` has been consumed. Note that this hook\n * will not be called if the `event` has been previously discarded.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {IEvent} event - The event object.\n * @param {Object} options - The plugin options.\n */\n /**\n * @method IPlugin#resize\n * @desc Called after the chart as been resized.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Number} size - The new canvas display size (eq. canvas.style width & height).\n * @param {Object} options - The plugin options.\n */\n /**\n * @method IPlugin#destroy\n * @desc Called after the chart as been destroyed.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Object} options - The plugin options.\n */\n\n /**\n * Provided for backward compatibility, use Chart.plugins instead\n * @namespace Chart.pluginService\n * @deprecated since version 2.1.5\n * @todo remove at version 3\n * @private\n */\n Chart.pluginService = Chart.plugins;\n\n /**\n * Provided for backward compatibility, inheriting from Chart.PlugingBase has no\n * effect, instead simply create/register plugins via plain JavaScript objects.\n * @interface Chart.PluginBase\n * @deprecated since version 2.5.0\n * @todo remove at version 3\n * @private\n */\n Chart.PluginBase = Element.extend({});\n };\n\n},{\"25\":25,\"26\":26,\"45\":45}],32:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var Element = require(26);\n var helpers = require(45);\n var Ticks = require(34);\n\n defaults._set('scale', {\n display: true,\n position: 'left',\n offset: false,\n\n // grid line settings\n gridLines: {\n display: true,\n color: 'rgba(0, 0, 0, 0.1)',\n lineWidth: 1,\n drawBorder: true,\n drawOnChartArea: true,\n drawTicks: true,\n tickMarkLength: 10,\n zeroLineWidth: 1,\n zeroLineColor: 'rgba(0,0,0,0.25)',\n zeroLineBorderDash: [],\n zeroLineBorderDashOffset: 0.0,\n offsetGridLines: false,\n borderDash: [],\n borderDashOffset: 0.0\n },\n\n // scale label\n scaleLabel: {\n // display property\n display: false,\n\n // actual label\n labelString: '',\n\n // line height\n lineHeight: 1.2,\n\n // top/bottom padding\n padding: {\n top: 4,\n bottom: 4\n }\n },\n\n // label settings\n ticks: {\n beginAtZero: false,\n minRotation: 0,\n maxRotation: 50,\n mirror: false,\n padding: 0,\n reverse: false,\n display: true,\n autoSkip: true,\n autoSkipPadding: 0,\n labelOffset: 0,\n // We pass through arrays to be rendered as multiline labels, we convert Others to strings here.\n callback: Ticks.formatters.values,\n minor: {},\n major: {}\n }\n });\n\n function labelsFromTicks(ticks) {\n var labels = [];\n var i, ilen;\n\n for (i = 0, ilen = ticks.length; i < ilen; ++i) {\n labels.push(ticks[i].label);\n }\n\n return labels;\n }\n\n function getLineValue(scale, index, offsetGridLines) {\n var lineValue = scale.getPixelForTick(index);\n\n if (offsetGridLines) {\n if (index === 0) {\n lineValue -= (scale.getPixelForTick(1) - lineValue) / 2;\n } else {\n lineValue -= (lineValue - scale.getPixelForTick(index - 1)) / 2;\n }\n }\n return lineValue;\n }\n\n module.exports = function(Chart) {\n\n function computeTextSize(context, tick, font) {\n return helpers.isArray(tick) ?\n helpers.longestText(context, font, tick) :\n context.measureText(tick).width;\n }\n\n function parseFontOptions(options) {\n var valueOrDefault = helpers.valueOrDefault;\n var globalDefaults = defaults.global;\n var size = valueOrDefault(options.fontSize, globalDefaults.defaultFontSize);\n var style = valueOrDefault(options.fontStyle, globalDefaults.defaultFontStyle);\n var family = valueOrDefault(options.fontFamily, globalDefaults.defaultFontFamily);\n\n return {\n size: size,\n style: style,\n family: family,\n font: helpers.fontString(size, style, family)\n };\n }\n\n function parseLineHeight(options) {\n return helpers.options.toLineHeight(\n helpers.valueOrDefault(options.lineHeight, 1.2),\n helpers.valueOrDefault(options.fontSize, defaults.global.defaultFontSize));\n }\n\n Chart.Scale = Element.extend({\n /**\n * Get the padding needed for the scale\n * @method getPadding\n * @private\n * @returns {Padding} the necessary padding\n */\n getPadding: function() {\n var me = this;\n return {\n left: me.paddingLeft || 0,\n top: me.paddingTop || 0,\n right: me.paddingRight || 0,\n bottom: me.paddingBottom || 0\n };\n },\n\n /**\n * Returns the scale tick objects ({label, major})\n * @since 2.7\n */\n getTicks: function() {\n return this._ticks;\n },\n\n // These methods are ordered by lifecyle. Utilities then follow.\n // Any function defined here is inherited by all scale types.\n // Any function can be extended by the scale type\n\n mergeTicksOptions: function() {\n var ticks = this.options.ticks;\n if (ticks.minor === false) {\n ticks.minor = {\n display: false\n };\n }\n if (ticks.major === false) {\n ticks.major = {\n display: false\n };\n }\n for (var key in ticks) {\n if (key !== 'major' && key !== 'minor') {\n if (typeof ticks.minor[key] === 'undefined') {\n ticks.minor[key] = ticks[key];\n }\n if (typeof ticks.major[key] === 'undefined') {\n ticks.major[key] = ticks[key];\n }\n }\n }\n },\n beforeUpdate: function() {\n helpers.callback(this.options.beforeUpdate, [this]);\n },\n update: function(maxWidth, maxHeight, margins) {\n var me = this;\n var i, ilen, labels, label, ticks, tick;\n\n // Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)\n me.beforeUpdate();\n\n // Absorb the master measurements\n me.maxWidth = maxWidth;\n me.maxHeight = maxHeight;\n me.margins = helpers.extend({\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n }, margins);\n me.longestTextCache = me.longestTextCache || {};\n\n // Dimensions\n me.beforeSetDimensions();\n me.setDimensions();\n me.afterSetDimensions();\n\n // Data min/max\n me.beforeDataLimits();\n me.determineDataLimits();\n me.afterDataLimits();\n\n // Ticks - `this.ticks` is now DEPRECATED!\n // Internal ticks are now stored as objects in the PRIVATE `this._ticks` member\n // and must not be accessed directly from outside this class. `this.ticks` being\n // around for long time and not marked as private, we can't change its structure\n // without unexpected breaking changes. If you need to access the scale ticks,\n // use scale.getTicks() instead.\n\n me.beforeBuildTicks();\n\n // New implementations should return an array of objects but for BACKWARD COMPAT,\n // we still support no return (`this.ticks` internally set by calling this method).\n ticks = me.buildTicks() || [];\n\n me.afterBuildTicks();\n\n me.beforeTickToLabelConversion();\n\n // New implementations should return the formatted tick labels but for BACKWARD\n // COMPAT, we still support no return (`this.ticks` internally changed by calling\n // this method and supposed to contain only string values).\n labels = me.convertTicksToLabels(ticks) || me.ticks;\n\n me.afterTickToLabelConversion();\n\n me.ticks = labels; // BACKWARD COMPATIBILITY\n\n // IMPORTANT: from this point, we consider that `this.ticks` will NEVER change!\n\n // BACKWARD COMPAT: synchronize `_ticks` with labels (so potentially `this.ticks`)\n for (i = 0, ilen = labels.length; i < ilen; ++i) {\n label = labels[i];\n tick = ticks[i];\n if (!tick) {\n ticks.push(tick = {\n label: label,\n major: false\n });\n } else {\n tick.label = label;\n }\n }\n\n me._ticks = ticks;\n\n // Tick Rotation\n me.beforeCalculateTickRotation();\n me.calculateTickRotation();\n me.afterCalculateTickRotation();\n // Fit\n me.beforeFit();\n me.fit();\n me.afterFit();\n //\n me.afterUpdate();\n\n return me.minSize;\n\n },\n afterUpdate: function() {\n helpers.callback(this.options.afterUpdate, [this]);\n },\n\n //\n\n beforeSetDimensions: function() {\n helpers.callback(this.options.beforeSetDimensions, [this]);\n },\n setDimensions: function() {\n var me = this;\n // Set the unconstrained dimension before label rotation\n if (me.isHorizontal()) {\n // Reset position before calculating rotation\n me.width = me.maxWidth;\n me.left = 0;\n me.right = me.width;\n } else {\n me.height = me.maxHeight;\n\n // Reset position before calculating rotation\n me.top = 0;\n me.bottom = me.height;\n }\n\n // Reset padding\n me.paddingLeft = 0;\n me.paddingTop = 0;\n me.paddingRight = 0;\n me.paddingBottom = 0;\n },\n afterSetDimensions: function() {\n helpers.callback(this.options.afterSetDimensions, [this]);\n },\n\n // Data limits\n beforeDataLimits: function() {\n helpers.callback(this.options.beforeDataLimits, [this]);\n },\n determineDataLimits: helpers.noop,\n afterDataLimits: function() {\n helpers.callback(this.options.afterDataLimits, [this]);\n },\n\n //\n beforeBuildTicks: function() {\n helpers.callback(this.options.beforeBuildTicks, [this]);\n },\n buildTicks: helpers.noop,\n afterBuildTicks: function() {\n helpers.callback(this.options.afterBuildTicks, [this]);\n },\n\n beforeTickToLabelConversion: function() {\n helpers.callback(this.options.beforeTickToLabelConversion, [this]);\n },\n convertTicksToLabels: function() {\n var me = this;\n // Convert ticks to strings\n var tickOpts = me.options.ticks;\n me.ticks = me.ticks.map(tickOpts.userCallback || tickOpts.callback, this);\n },\n afterTickToLabelConversion: function() {\n helpers.callback(this.options.afterTickToLabelConversion, [this]);\n },\n\n //\n\n beforeCalculateTickRotation: function() {\n helpers.callback(this.options.beforeCalculateTickRotation, [this]);\n },\n calculateTickRotation: function() {\n var me = this;\n var context = me.ctx;\n var tickOpts = me.options.ticks;\n var labels = labelsFromTicks(me._ticks);\n\n // Get the width of each grid by calculating the difference\n // between x offsets between 0 and 1.\n var tickFont = parseFontOptions(tickOpts);\n context.font = tickFont.font;\n\n var labelRotation = tickOpts.minRotation || 0;\n\n if (labels.length && me.options.display && me.isHorizontal()) {\n var originalLabelWidth = helpers.longestText(context, tickFont.font, labels, me.longestTextCache);\n var labelWidth = originalLabelWidth;\n var cosRotation, sinRotation;\n\n // Allow 3 pixels x2 padding either side for label readability\n var tickWidth = me.getPixelForTick(1) - me.getPixelForTick(0) - 6;\n\n // Max label rotation can be set or default to 90 - also act as a loop counter\n while (labelWidth > tickWidth && labelRotation < tickOpts.maxRotation) {\n var angleRadians = helpers.toRadians(labelRotation);\n cosRotation = Math.cos(angleRadians);\n sinRotation = Math.sin(angleRadians);\n\n if (sinRotation * originalLabelWidth > me.maxHeight) {\n // go back one step\n labelRotation--;\n break;\n }\n\n labelRotation++;\n labelWidth = cosRotation * originalLabelWidth;\n }\n }\n\n me.labelRotation = labelRotation;\n },\n afterCalculateTickRotation: function() {\n helpers.callback(this.options.afterCalculateTickRotation, [this]);\n },\n\n //\n\n beforeFit: function() {\n helpers.callback(this.options.beforeFit, [this]);\n },\n fit: function() {\n var me = this;\n // Reset\n var minSize = me.minSize = {\n width: 0,\n height: 0\n };\n\n var labels = labelsFromTicks(me._ticks);\n\n var opts = me.options;\n var tickOpts = opts.ticks;\n var scaleLabelOpts = opts.scaleLabel;\n var gridLineOpts = opts.gridLines;\n var display = opts.display;\n var isHorizontal = me.isHorizontal();\n\n var tickFont = parseFontOptions(tickOpts);\n var tickMarkLength = opts.gridLines.tickMarkLength;\n\n // Width\n if (isHorizontal) {\n // subtract the margins to line up with the chartArea if we are a full width scale\n minSize.width = me.isFullWidth() ? me.maxWidth - me.margins.left - me.margins.right : me.maxWidth;\n } else {\n minSize.width = display && gridLineOpts.drawTicks ? tickMarkLength : 0;\n }\n\n // height\n if (isHorizontal) {\n minSize.height = display && gridLineOpts.drawTicks ? tickMarkLength : 0;\n } else {\n minSize.height = me.maxHeight; // fill all the height\n }\n\n // Are we showing a title for the scale?\n if (scaleLabelOpts.display && display) {\n var scaleLabelLineHeight = parseLineHeight(scaleLabelOpts);\n var scaleLabelPadding = helpers.options.toPadding(scaleLabelOpts.padding);\n var deltaHeight = scaleLabelLineHeight + scaleLabelPadding.height;\n\n if (isHorizontal) {\n minSize.height += deltaHeight;\n } else {\n minSize.width += deltaHeight;\n }\n }\n\n // Don't bother fitting the ticks if we are not showing them\n if (tickOpts.display && display) {\n var largestTextWidth = helpers.longestText(me.ctx, tickFont.font, labels, me.longestTextCache);\n var tallestLabelHeightInLines = helpers.numberOfLabelLines(labels);\n var lineSpace = tickFont.size * 0.5;\n var tickPadding = me.options.ticks.padding;\n\n if (isHorizontal) {\n // A horizontal axis is more constrained by the height.\n me.longestLabelWidth = largestTextWidth;\n\n var angleRadians = helpers.toRadians(me.labelRotation);\n var cosRotation = Math.cos(angleRadians);\n var sinRotation = Math.sin(angleRadians);\n\n // TODO - improve this calculation\n var labelHeight = (sinRotation * largestTextWidth)\n + (tickFont.size * tallestLabelHeightInLines)\n + (lineSpace * (tallestLabelHeightInLines - 1))\n + lineSpace; // padding\n\n minSize.height = Math.min(me.maxHeight, minSize.height + labelHeight + tickPadding);\n\n me.ctx.font = tickFont.font;\n var firstLabelWidth = computeTextSize(me.ctx, labels[0], tickFont.font);\n var lastLabelWidth = computeTextSize(me.ctx, labels[labels.length - 1], tickFont.font);\n\n // Ensure that our ticks are always inside the canvas. When rotated, ticks are right aligned\n // which means that the right padding is dominated by the font height\n if (me.labelRotation !== 0) {\n me.paddingLeft = opts.position === 'bottom' ? (cosRotation * firstLabelWidth) + 3 : (cosRotation * lineSpace) + 3; // add 3 px to move away from canvas edges\n me.paddingRight = opts.position === 'bottom' ? (cosRotation * lineSpace) + 3 : (cosRotation * lastLabelWidth) + 3;\n } else {\n me.paddingLeft = firstLabelWidth / 2 + 3; // add 3 px to move away from canvas edges\n me.paddingRight = lastLabelWidth / 2 + 3;\n }\n } else {\n // A vertical axis is more constrained by the width. Labels are the\n // dominant factor here, so get that length first and account for padding\n if (tickOpts.mirror) {\n largestTextWidth = 0;\n } else {\n // use lineSpace for consistency with horizontal axis\n // tickPadding is not implemented for horizontal\n largestTextWidth += tickPadding + lineSpace;\n }\n\n minSize.width = Math.min(me.maxWidth, minSize.width + largestTextWidth);\n\n me.paddingTop = tickFont.size / 2;\n me.paddingBottom = tickFont.size / 2;\n }\n }\n\n me.handleMargins();\n\n me.width = minSize.width;\n me.height = minSize.height;\n },\n\n /**\n * Handle margins and padding interactions\n * @private\n */\n handleMargins: function() {\n var me = this;\n if (me.margins) {\n me.paddingLeft = Math.max(me.paddingLeft - me.margins.left, 0);\n me.paddingTop = Math.max(me.paddingTop - me.margins.top, 0);\n me.paddingRight = Math.max(me.paddingRight - me.margins.right, 0);\n me.paddingBottom = Math.max(me.paddingBottom - me.margins.bottom, 0);\n }\n },\n\n afterFit: function() {\n helpers.callback(this.options.afterFit, [this]);\n },\n\n // Shared Methods\n isHorizontal: function() {\n return this.options.position === 'top' || this.options.position === 'bottom';\n },\n isFullWidth: function() {\n return (this.options.fullWidth);\n },\n\n // Get the correct value. NaN bad inputs, If the value type is object get the x or y based on whether we are horizontal or not\n getRightValue: function(rawValue) {\n // Null and undefined values first\n if (helpers.isNullOrUndef(rawValue)) {\n return NaN;\n }\n // isNaN(object) returns true, so make sure NaN is checking for a number; Discard Infinite values\n if (typeof rawValue === 'number' && !isFinite(rawValue)) {\n return NaN;\n }\n // If it is in fact an object, dive in one more level\n if (rawValue) {\n if (this.isHorizontal()) {\n if (rawValue.x !== undefined) {\n return this.getRightValue(rawValue.x);\n }\n } else if (rawValue.y !== undefined) {\n return this.getRightValue(rawValue.y);\n }\n }\n\n // Value is good, return it\n return rawValue;\n },\n\n // Used to get the value to display in the tooltip for the data at the given index\n // function getLabelForIndex(index, datasetIndex)\n getLabelForIndex: helpers.noop,\n\n // Used to get data value locations. Value can either be an index or a numerical value\n getPixelForValue: helpers.noop,\n\n // Used to get the data value from a given pixel. This is the inverse of getPixelForValue\n getValueForPixel: helpers.noop,\n\n // Used for tick location, should\n getPixelForTick: function(index) {\n var me = this;\n var offset = me.options.offset;\n if (me.isHorizontal()) {\n var innerWidth = me.width - (me.paddingLeft + me.paddingRight);\n var tickWidth = innerWidth / Math.max((me._ticks.length - (offset ? 0 : 1)), 1);\n var pixel = (tickWidth * index) + me.paddingLeft;\n\n if (offset) {\n pixel += tickWidth / 2;\n }\n\n var finalVal = me.left + Math.round(pixel);\n finalVal += me.isFullWidth() ? me.margins.left : 0;\n return finalVal;\n }\n var innerHeight = me.height - (me.paddingTop + me.paddingBottom);\n return me.top + (index * (innerHeight / (me._ticks.length - 1)));\n },\n\n // Utility for getting the pixel location of a percentage of scale\n getPixelForDecimal: function(decimal) {\n var me = this;\n if (me.isHorizontal()) {\n var innerWidth = me.width - (me.paddingLeft + me.paddingRight);\n var valueOffset = (innerWidth * decimal) + me.paddingLeft;\n\n var finalVal = me.left + Math.round(valueOffset);\n finalVal += me.isFullWidth() ? me.margins.left : 0;\n return finalVal;\n }\n return me.top + (decimal * me.height);\n },\n\n getBasePixel: function() {\n return this.getPixelForValue(this.getBaseValue());\n },\n\n getBaseValue: function() {\n var me = this;\n var min = me.min;\n var max = me.max;\n\n return me.beginAtZero ? 0 :\n min < 0 && max < 0 ? max :\n min > 0 && max > 0 ? min :\n 0;\n },\n\n /**\n * Returns a subset of ticks to be plotted to avoid overlapping labels.\n * @private\n */\n _autoSkip: function(ticks) {\n var skipRatio;\n var me = this;\n var isHorizontal = me.isHorizontal();\n var optionTicks = me.options.ticks.minor;\n var tickCount = ticks.length;\n var labelRotationRadians = helpers.toRadians(me.labelRotation);\n var cosRotation = Math.cos(labelRotationRadians);\n var longestRotatedLabel = me.longestLabelWidth * cosRotation;\n var result = [];\n var i, tick, shouldSkip;\n\n // figure out the maximum number of gridlines to show\n var maxTicks;\n if (optionTicks.maxTicksLimit) {\n maxTicks = optionTicks.maxTicksLimit;\n }\n\n if (isHorizontal) {\n skipRatio = false;\n\n if ((longestRotatedLabel + optionTicks.autoSkipPadding) * tickCount > (me.width - (me.paddingLeft + me.paddingRight))) {\n skipRatio = 1 + Math.floor(((longestRotatedLabel + optionTicks.autoSkipPadding) * tickCount) / (me.width - (me.paddingLeft + me.paddingRight)));\n }\n\n // if they defined a max number of optionTicks,\n // increase skipRatio until that number is met\n if (maxTicks && tickCount > maxTicks) {\n skipRatio = Math.max(skipRatio, Math.floor(tickCount / maxTicks));\n }\n }\n\n for (i = 0; i < tickCount; i++) {\n tick = ticks[i];\n\n // Since we always show the last tick,we need may need to hide the last shown one before\n shouldSkip = (skipRatio > 1 && i % skipRatio > 0) || (i % skipRatio === 0 && i + skipRatio >= tickCount);\n if (shouldSkip && i !== tickCount - 1 || helpers.isNullOrUndef(tick.label)) {\n // leave tick in place but make sure it's not displayed (#4635)\n delete tick.label;\n }\n result.push(tick);\n }\n return result;\n },\n\n // Actually draw the scale on the canvas\n // @param {rectangle} chartArea : the area of the chart to draw full grid lines on\n draw: function(chartArea) {\n var me = this;\n var options = me.options;\n if (!options.display) {\n return;\n }\n\n var context = me.ctx;\n var globalDefaults = defaults.global;\n var optionTicks = options.ticks.minor;\n var optionMajorTicks = options.ticks.major || optionTicks;\n var gridLines = options.gridLines;\n var scaleLabel = options.scaleLabel;\n\n var isRotated = me.labelRotation !== 0;\n var isHorizontal = me.isHorizontal();\n\n var ticks = optionTicks.autoSkip ? me._autoSkip(me.getTicks()) : me.getTicks();\n var tickFontColor = helpers.valueOrDefault(optionTicks.fontColor, globalDefaults.defaultFontColor);\n var tickFont = parseFontOptions(optionTicks);\n var majorTickFontColor = helpers.valueOrDefault(optionMajorTicks.fontColor, globalDefaults.defaultFontColor);\n var majorTickFont = parseFontOptions(optionMajorTicks);\n\n var tl = gridLines.drawTicks ? gridLines.tickMarkLength : 0;\n\n var scaleLabelFontColor = helpers.valueOrDefault(scaleLabel.fontColor, globalDefaults.defaultFontColor);\n var scaleLabelFont = parseFontOptions(scaleLabel);\n var scaleLabelPadding = helpers.options.toPadding(scaleLabel.padding);\n var labelRotationRadians = helpers.toRadians(me.labelRotation);\n\n var itemsToDraw = [];\n\n var xTickStart = options.position === 'right' ? me.left : me.right - tl;\n var xTickEnd = options.position === 'right' ? me.left + tl : me.right;\n var yTickStart = options.position === 'bottom' ? me.top : me.bottom - tl;\n var yTickEnd = options.position === 'bottom' ? me.top + tl : me.bottom;\n\n helpers.each(ticks, function(tick, index) {\n // autoskipper skipped this tick (#4635)\n if (tick.label === undefined) {\n return;\n }\n\n var label = tick.label;\n var lineWidth, lineColor, borderDash, borderDashOffset;\n if (index === me.zeroLineIndex && options.offset === gridLines.offsetGridLines) {\n // Draw the first index specially\n lineWidth = gridLines.zeroLineWidth;\n lineColor = gridLines.zeroLineColor;\n borderDash = gridLines.zeroLineBorderDash;\n borderDashOffset = gridLines.zeroLineBorderDashOffset;\n } else {\n lineWidth = helpers.valueAtIndexOrDefault(gridLines.lineWidth, index);\n lineColor = helpers.valueAtIndexOrDefault(gridLines.color, index);\n borderDash = helpers.valueOrDefault(gridLines.borderDash, globalDefaults.borderDash);\n borderDashOffset = helpers.valueOrDefault(gridLines.borderDashOffset, globalDefaults.borderDashOffset);\n }\n\n // Common properties\n var tx1, ty1, tx2, ty2, x1, y1, x2, y2, labelX, labelY;\n var textAlign = 'middle';\n var textBaseline = 'middle';\n var tickPadding = optionTicks.padding;\n\n if (isHorizontal) {\n var labelYOffset = tl + tickPadding;\n\n if (options.position === 'bottom') {\n // bottom\n textBaseline = !isRotated ? 'top' : 'middle';\n textAlign = !isRotated ? 'center' : 'right';\n labelY = me.top + labelYOffset;\n } else {\n // top\n textBaseline = !isRotated ? 'bottom' : 'middle';\n textAlign = !isRotated ? 'center' : 'left';\n labelY = me.bottom - labelYOffset;\n }\n\n var xLineValue = getLineValue(me, index, gridLines.offsetGridLines && ticks.length > 1);\n if (xLineValue < me.left) {\n lineColor = 'rgba(0,0,0,0)';\n }\n xLineValue += helpers.aliasPixel(lineWidth);\n\n labelX = me.getPixelForTick(index) + optionTicks.labelOffset; // x values for optionTicks (need to consider offsetLabel option)\n\n tx1 = tx2 = x1 = x2 = xLineValue;\n ty1 = yTickStart;\n ty2 = yTickEnd;\n y1 = chartArea.top;\n y2 = chartArea.bottom;\n } else {\n var isLeft = options.position === 'left';\n var labelXOffset;\n\n if (optionTicks.mirror) {\n textAlign = isLeft ? 'left' : 'right';\n labelXOffset = tickPadding;\n } else {\n textAlign = isLeft ? 'right' : 'left';\n labelXOffset = tl + tickPadding;\n }\n\n labelX = isLeft ? me.right - labelXOffset : me.left + labelXOffset;\n\n var yLineValue = getLineValue(me, index, gridLines.offsetGridLines && ticks.length > 1);\n if (yLineValue < me.top) {\n lineColor = 'rgba(0,0,0,0)';\n }\n yLineValue += helpers.aliasPixel(lineWidth);\n\n labelY = me.getPixelForTick(index) + optionTicks.labelOffset;\n\n tx1 = xTickStart;\n tx2 = xTickEnd;\n x1 = chartArea.left;\n x2 = chartArea.right;\n ty1 = ty2 = y1 = y2 = yLineValue;\n }\n\n itemsToDraw.push({\n tx1: tx1,\n ty1: ty1,\n tx2: tx2,\n ty2: ty2,\n x1: x1,\n y1: y1,\n x2: x2,\n y2: y2,\n labelX: labelX,\n labelY: labelY,\n glWidth: lineWidth,\n glColor: lineColor,\n glBorderDash: borderDash,\n glBorderDashOffset: borderDashOffset,\n rotation: -1 * labelRotationRadians,\n label: label,\n major: tick.major,\n textBaseline: textBaseline,\n textAlign: textAlign\n });\n });\n\n // Draw all of the tick labels, tick marks, and grid lines at the correct places\n helpers.each(itemsToDraw, function(itemToDraw) {\n if (gridLines.display) {\n context.save();\n context.lineWidth = itemToDraw.glWidth;\n context.strokeStyle = itemToDraw.glColor;\n if (context.setLineDash) {\n context.setLineDash(itemToDraw.glBorderDash);\n context.lineDashOffset = itemToDraw.glBorderDashOffset;\n }\n\n context.beginPath();\n\n if (gridLines.drawTicks) {\n context.moveTo(itemToDraw.tx1, itemToDraw.ty1);\n context.lineTo(itemToDraw.tx2, itemToDraw.ty2);\n }\n\n if (gridLines.drawOnChartArea) {\n context.moveTo(itemToDraw.x1, itemToDraw.y1);\n context.lineTo(itemToDraw.x2, itemToDraw.y2);\n }\n\n context.stroke();\n context.restore();\n }\n\n if (optionTicks.display) {\n // Make sure we draw text in the correct color and font\n context.save();\n context.translate(itemToDraw.labelX, itemToDraw.labelY);\n context.rotate(itemToDraw.rotation);\n context.font = itemToDraw.major ? majorTickFont.font : tickFont.font;\n context.fillStyle = itemToDraw.major ? majorTickFontColor : tickFontColor;\n context.textBaseline = itemToDraw.textBaseline;\n context.textAlign = itemToDraw.textAlign;\n\n var label = itemToDraw.label;\n if (helpers.isArray(label)) {\n for (var i = 0, y = 0; i < label.length; ++i) {\n // We just make sure the multiline element is a string here..\n context.fillText('' + label[i], 0, y);\n // apply same lineSpacing as calculated @ L#320\n y += (tickFont.size * 1.5);\n }\n } else {\n context.fillText(label, 0, 0);\n }\n context.restore();\n }\n });\n\n if (scaleLabel.display) {\n // Draw the scale label\n var scaleLabelX;\n var scaleLabelY;\n var rotation = 0;\n var halfLineHeight = parseLineHeight(scaleLabel) / 2;\n\n if (isHorizontal) {\n scaleLabelX = me.left + ((me.right - me.left) / 2); // midpoint of the width\n scaleLabelY = options.position === 'bottom'\n ? me.bottom - halfLineHeight - scaleLabelPadding.bottom\n : me.top + halfLineHeight + scaleLabelPadding.top;\n } else {\n var isLeft = options.position === 'left';\n scaleLabelX = isLeft\n ? me.left + halfLineHeight + scaleLabelPadding.top\n : me.right - halfLineHeight - scaleLabelPadding.top;\n scaleLabelY = me.top + ((me.bottom - me.top) / 2);\n rotation = isLeft ? -0.5 * Math.PI : 0.5 * Math.PI;\n }\n\n context.save();\n context.translate(scaleLabelX, scaleLabelY);\n context.rotate(rotation);\n context.textAlign = 'center';\n context.textBaseline = 'middle';\n context.fillStyle = scaleLabelFontColor; // render in correct colour\n context.font = scaleLabelFont.font;\n context.fillText(scaleLabel.labelString, 0, 0);\n context.restore();\n }\n\n if (gridLines.drawBorder) {\n // Draw the line at the edge of the axis\n context.lineWidth = helpers.valueAtIndexOrDefault(gridLines.lineWidth, 0);\n context.strokeStyle = helpers.valueAtIndexOrDefault(gridLines.color, 0);\n var x1 = me.left;\n var x2 = me.right;\n var y1 = me.top;\n var y2 = me.bottom;\n\n var aliasPixel = helpers.aliasPixel(context.lineWidth);\n if (isHorizontal) {\n y1 = y2 = options.position === 'top' ? me.bottom : me.top;\n y1 += aliasPixel;\n y2 += aliasPixel;\n } else {\n x1 = x2 = options.position === 'left' ? me.right : me.left;\n x1 += aliasPixel;\n x2 += aliasPixel;\n }\n\n context.beginPath();\n context.moveTo(x1, y1);\n context.lineTo(x2, y2);\n context.stroke();\n }\n }\n });\n };\n\n},{\"25\":25,\"26\":26,\"34\":34,\"45\":45}],33:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var helpers = require(45);\n\n module.exports = function(Chart) {\n\n Chart.scaleService = {\n // Scale registration object. Extensions can register new scale types (such as log or DB scales) and then\n // use the new chart options to grab the correct scale\n constructors: {},\n // Use a registration function so that we can move to an ES6 map when we no longer need to support\n // old browsers\n\n // Scale config defaults\n defaults: {},\n registerScaleType: function(type, scaleConstructor, scaleDefaults) {\n this.constructors[type] = scaleConstructor;\n this.defaults[type] = helpers.clone(scaleDefaults);\n },\n getScaleConstructor: function(type) {\n return this.constructors.hasOwnProperty(type) ? this.constructors[type] : undefined;\n },\n getScaleDefaults: function(type) {\n // Return the scale defaults merged with the global settings so that we always use the latest ones\n return this.defaults.hasOwnProperty(type) ? helpers.merge({}, [defaults.scale, this.defaults[type]]) : {};\n },\n updateScaleDefaults: function(type, additions) {\n var me = this;\n if (me.defaults.hasOwnProperty(type)) {\n me.defaults[type] = helpers.extend(me.defaults[type], additions);\n }\n },\n addScalesToLayout: function(chart) {\n // Adds each scale to the chart.boxes array to be sized accordingly\n helpers.each(chart.scales, function(scale) {\n // Set ILayoutItem parameters for backwards compatibility\n scale.fullWidth = scale.options.fullWidth;\n scale.position = scale.options.position;\n scale.weight = scale.options.weight;\n Chart.layoutService.addBox(chart, scale);\n });\n }\n };\n };\n\n},{\"25\":25,\"45\":45}],34:[function(require,module,exports){\n 'use strict';\n\n var helpers = require(45);\n\n /**\n * Namespace to hold static tick generation functions\n * @namespace Chart.Ticks\n */\n module.exports = {\n /**\n * Namespace to hold generators for different types of ticks\n * @namespace Chart.Ticks.generators\n */\n generators: {\n /**\n * Interface for the options provided to the numeric tick generator\n * @interface INumericTickGenerationOptions\n */\n /**\n * The maximum number of ticks to display\n * @name INumericTickGenerationOptions#maxTicks\n * @type Number\n */\n /**\n * The distance between each tick.\n * @name INumericTickGenerationOptions#stepSize\n * @type Number\n * @optional\n */\n /**\n * Forced minimum for the ticks. If not specified, the minimum of the data range is used to calculate the tick minimum\n * @name INumericTickGenerationOptions#min\n * @type Number\n * @optional\n */\n /**\n * The maximum value of the ticks. If not specified, the maximum of the data range is used to calculate the tick maximum\n * @name INumericTickGenerationOptions#max\n * @type Number\n * @optional\n */\n\n /**\n * Generate a set of linear ticks\n * @method Chart.Ticks.generators.linear\n * @param generationOptions {INumericTickGenerationOptions} the options used to generate the ticks\n * @param dataRange {IRange} the range of the data\n * @returns {Array} array of tick values\n */\n linear: function(generationOptions, dataRange) {\n var ticks = [];\n // To get a \"nice\" value for the tick spacing, we will use the appropriately named\n // \"nice number\" algorithm. See http://stackoverflow.com/questions/8506881/nice-label-algorithm-for-charts-with-minimum-ticks\n // for details.\n\n var spacing;\n if (generationOptions.stepSize && generationOptions.stepSize > 0) {\n spacing = generationOptions.stepSize;\n } else {\n var niceRange = helpers.niceNum(dataRange.max - dataRange.min, false);\n spacing = helpers.niceNum(niceRange / (generationOptions.maxTicks - 1), true);\n }\n var niceMin = Math.floor(dataRange.min / spacing) * spacing;\n var niceMax = Math.ceil(dataRange.max / spacing) * spacing;\n\n // If min, max and stepSize is set and they make an evenly spaced scale use it.\n if (generationOptions.min && generationOptions.max && generationOptions.stepSize) {\n // If very close to our whole number, use it.\n if (helpers.almostWhole((generationOptions.max - generationOptions.min) / generationOptions.stepSize, spacing / 1000)) {\n niceMin = generationOptions.min;\n niceMax = generationOptions.max;\n }\n }\n\n var numSpaces = (niceMax - niceMin) / spacing;\n // If very close to our rounded value, use it.\n if (helpers.almostEquals(numSpaces, Math.round(numSpaces), spacing / 1000)) {\n numSpaces = Math.round(numSpaces);\n } else {\n numSpaces = Math.ceil(numSpaces);\n }\n\n // Put the values into the ticks array\n ticks.push(generationOptions.min !== undefined ? generationOptions.min : niceMin);\n for (var j = 1; j < numSpaces; ++j) {\n ticks.push(niceMin + (j * spacing));\n }\n ticks.push(generationOptions.max !== undefined ? generationOptions.max : niceMax);\n\n return ticks;\n },\n\n /**\n * Generate a set of logarithmic ticks\n * @method Chart.Ticks.generators.logarithmic\n * @param generationOptions {INumericTickGenerationOptions} the options used to generate the ticks\n * @param dataRange {IRange} the range of the data\n * @returns {Array} array of tick values\n */\n logarithmic: function(generationOptions, dataRange) {\n var ticks = [];\n var valueOrDefault = helpers.valueOrDefault;\n\n // Figure out what the max number of ticks we can support it is based on the size of\n // the axis area. For now, we say that the minimum tick spacing in pixels must be 50\n // We also limit the maximum number of ticks to 11 which gives a nice 10 squares on\n // the graph\n var tickVal = valueOrDefault(generationOptions.min, Math.pow(10, Math.floor(helpers.log10(dataRange.min))));\n\n var endExp = Math.floor(helpers.log10(dataRange.max));\n var endSignificand = Math.ceil(dataRange.max / Math.pow(10, endExp));\n var exp, significand;\n\n if (tickVal === 0) {\n exp = Math.floor(helpers.log10(dataRange.minNotZero));\n significand = Math.floor(dataRange.minNotZero / Math.pow(10, exp));\n\n ticks.push(tickVal);\n tickVal = significand * Math.pow(10, exp);\n } else {\n exp = Math.floor(helpers.log10(tickVal));\n significand = Math.floor(tickVal / Math.pow(10, exp));\n }\n\n do {\n ticks.push(tickVal);\n\n ++significand;\n if (significand === 10) {\n significand = 1;\n ++exp;\n }\n\n tickVal = significand * Math.pow(10, exp);\n } while (exp < endExp || (exp === endExp && significand < endSignificand));\n\n var lastTick = valueOrDefault(generationOptions.max, tickVal);\n ticks.push(lastTick);\n\n return ticks;\n }\n },\n\n /**\n * Namespace to hold formatters for different types of ticks\n * @namespace Chart.Ticks.formatters\n */\n formatters: {\n /**\n * Formatter for value labels\n * @method Chart.Ticks.formatters.values\n * @param value the value to display\n * @return {String|Array} the label to display\n */\n values: function(value) {\n return helpers.isArray(value) ? value : '' + value;\n },\n\n /**\n * Formatter for linear numeric ticks\n * @method Chart.Ticks.formatters.linear\n * @param tickValue {Number} the value to be formatted\n * @param index {Number} the position of the tickValue parameter in the ticks array\n * @param ticks {Array} the list of ticks being converted\n * @return {String} string representation of the tickValue parameter\n */\n linear: function(tickValue, index, ticks) {\n // If we have lots of ticks, don't use the ones\n var delta = ticks.length > 3 ? ticks[2] - ticks[1] : ticks[1] - ticks[0];\n\n // If we have a number like 2.5 as the delta, figure out how many decimal places we need\n if (Math.abs(delta) > 1) {\n if (tickValue !== Math.floor(tickValue)) {\n // not an integer\n delta = tickValue - Math.floor(tickValue);\n }\n }\n\n var logDelta = helpers.log10(Math.abs(delta));\n var tickString = '';\n\n if (tickValue !== 0) {\n var numDecimal = -1 * Math.floor(logDelta);\n numDecimal = Math.max(Math.min(numDecimal, 20), 0); // toFixed has a max of 20 decimal places\n tickString = tickValue.toFixed(numDecimal);\n } else {\n tickString = '0'; // never show decimal places for 0\n }\n\n return tickString;\n },\n\n logarithmic: function(tickValue, index, ticks) {\n var remain = tickValue / (Math.pow(10, Math.floor(helpers.log10(tickValue))));\n\n if (tickValue === 0) {\n return '0';\n } else if (remain === 1 || remain === 2 || remain === 5 || index === 0 || index === ticks.length - 1) {\n return tickValue.toExponential();\n }\n return '';\n }\n }\n };\n\n},{\"45\":45}],35:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var Element = require(26);\n var helpers = require(45);\n\n defaults._set('global', {\n tooltips: {\n enabled: true,\n custom: null,\n mode: 'nearest',\n position: 'average',\n intersect: true,\n backgroundColor: 'rgba(0,0,0,0.8)',\n titleFontStyle: 'bold',\n titleSpacing: 2,\n titleMarginBottom: 6,\n titleFontColor: '#fff',\n titleAlign: 'left',\n bodySpacing: 2,\n bodyFontColor: '#fff',\n bodyAlign: 'left',\n footerFontStyle: 'bold',\n footerSpacing: 2,\n footerMarginTop: 6,\n footerFontColor: '#fff',\n footerAlign: 'left',\n yPadding: 6,\n xPadding: 6,\n caretPadding: 2,\n caretSize: 5,\n cornerRadius: 6,\n multiKeyBackground: '#fff',\n displayColors: true,\n borderColor: 'rgba(0,0,0,0)',\n borderWidth: 0,\n callbacks: {\n // Args are: (tooltipItems, data)\n beforeTitle: helpers.noop,\n title: function(tooltipItems, data) {\n // Pick first xLabel for now\n var title = '';\n var labels = data.labels;\n var labelCount = labels ? labels.length : 0;\n\n if (tooltipItems.length > 0) {\n var item = tooltipItems[0];\n\n if (item.xLabel) {\n title = item.xLabel;\n } else if (labelCount > 0 && item.index < labelCount) {\n title = labels[item.index];\n }\n }\n\n return title;\n },\n afterTitle: helpers.noop,\n\n // Args are: (tooltipItems, data)\n beforeBody: helpers.noop,\n\n // Args are: (tooltipItem, data)\n beforeLabel: helpers.noop,\n label: function(tooltipItem, data) {\n var label = data.datasets[tooltipItem.datasetIndex].label || '';\n\n if (label) {\n label += ': ';\n }\n label += tooltipItem.yLabel;\n return label;\n },\n labelColor: function(tooltipItem, chart) {\n var meta = chart.getDatasetMeta(tooltipItem.datasetIndex);\n var activeElement = meta.data[tooltipItem.index];\n var view = activeElement._view;\n return {\n borderColor: view.borderColor,\n backgroundColor: view.backgroundColor\n };\n },\n labelTextColor: function() {\n return this._options.bodyFontColor;\n },\n afterLabel: helpers.noop,\n\n // Args are: (tooltipItems, data)\n afterBody: helpers.noop,\n\n // Args are: (tooltipItems, data)\n beforeFooter: helpers.noop,\n footer: helpers.noop,\n afterFooter: helpers.noop\n }\n }\n });\n\n module.exports = function(Chart) {\n\n /**\n * Helper method to merge the opacity into a color\n */\n function mergeOpacity(colorString, opacity) {\n var color = helpers.color(colorString);\n return color.alpha(opacity * color.alpha()).rgbaString();\n }\n\n // Helper to push or concat based on if the 2nd parameter is an array or not\n function pushOrConcat(base, toPush) {\n if (toPush) {\n if (helpers.isArray(toPush)) {\n // base = base.concat(toPush);\n Array.prototype.push.apply(base, toPush);\n } else {\n base.push(toPush);\n }\n }\n\n return base;\n }\n\n // Private helper to create a tooltip item model\n // @param element : the chart element (point, arc, bar) to create the tooltip item for\n // @return : new tooltip item\n function createTooltipItem(element) {\n var xScale = element._xScale;\n var yScale = element._yScale || element._scale; // handle radar || polarArea charts\n var index = element._index;\n var datasetIndex = element._datasetIndex;\n\n return {\n xLabel: xScale ? xScale.getLabelForIndex(index, datasetIndex) : '',\n yLabel: yScale ? yScale.getLabelForIndex(index, datasetIndex) : '',\n index: index,\n datasetIndex: datasetIndex,\n x: element._model.x,\n y: element._model.y\n };\n }\n\n /**\n * Helper to get the reset model for the tooltip\n * @param tooltipOpts {Object} the tooltip options\n */\n function getBaseModel(tooltipOpts) {\n var globalDefaults = defaults.global;\n var valueOrDefault = helpers.valueOrDefault;\n\n return {\n // Positioning\n xPadding: tooltipOpts.xPadding,\n yPadding: tooltipOpts.yPadding,\n xAlign: tooltipOpts.xAlign,\n yAlign: tooltipOpts.yAlign,\n\n // Body\n bodyFontColor: tooltipOpts.bodyFontColor,\n _bodyFontFamily: valueOrDefault(tooltipOpts.bodyFontFamily, globalDefaults.defaultFontFamily),\n _bodyFontStyle: valueOrDefault(tooltipOpts.bodyFontStyle, globalDefaults.defaultFontStyle),\n _bodyAlign: tooltipOpts.bodyAlign,\n bodyFontSize: valueOrDefault(tooltipOpts.bodyFontSize, globalDefaults.defaultFontSize),\n bodySpacing: tooltipOpts.bodySpacing,\n\n // Title\n titleFontColor: tooltipOpts.titleFontColor,\n _titleFontFamily: valueOrDefault(tooltipOpts.titleFontFamily, globalDefaults.defaultFontFamily),\n _titleFontStyle: valueOrDefault(tooltipOpts.titleFontStyle, globalDefaults.defaultFontStyle),\n titleFontSize: valueOrDefault(tooltipOpts.titleFontSize, globalDefaults.defaultFontSize),\n _titleAlign: tooltipOpts.titleAlign,\n titleSpacing: tooltipOpts.titleSpacing,\n titleMarginBottom: tooltipOpts.titleMarginBottom,\n\n // Footer\n footerFontColor: tooltipOpts.footerFontColor,\n _footerFontFamily: valueOrDefault(tooltipOpts.footerFontFamily, globalDefaults.defaultFontFamily),\n _footerFontStyle: valueOrDefault(tooltipOpts.footerFontStyle, globalDefaults.defaultFontStyle),\n footerFontSize: valueOrDefault(tooltipOpts.footerFontSize, globalDefaults.defaultFontSize),\n _footerAlign: tooltipOpts.footerAlign,\n footerSpacing: tooltipOpts.footerSpacing,\n footerMarginTop: tooltipOpts.footerMarginTop,\n\n // Appearance\n caretSize: tooltipOpts.caretSize,\n cornerRadius: tooltipOpts.cornerRadius,\n backgroundColor: tooltipOpts.backgroundColor,\n opacity: 0,\n legendColorBackground: tooltipOpts.multiKeyBackground,\n displayColors: tooltipOpts.displayColors,\n borderColor: tooltipOpts.borderColor,\n borderWidth: tooltipOpts.borderWidth\n };\n }\n\n /**\n * Get the size of the tooltip\n */\n function getTooltipSize(tooltip, model) {\n var ctx = tooltip._chart.ctx;\n\n var height = model.yPadding * 2; // Tooltip Padding\n var width = 0;\n\n // Count of all lines in the body\n var body = model.body;\n var combinedBodyLength = body.reduce(function(count, bodyItem) {\n return count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length;\n }, 0);\n combinedBodyLength += model.beforeBody.length + model.afterBody.length;\n\n var titleLineCount = model.title.length;\n var footerLineCount = model.footer.length;\n var titleFontSize = model.titleFontSize;\n var bodyFontSize = model.bodyFontSize;\n var footerFontSize = model.footerFontSize;\n\n height += titleLineCount * titleFontSize; // Title Lines\n height += titleLineCount ? (titleLineCount - 1) * model.titleSpacing : 0; // Title Line Spacing\n height += titleLineCount ? model.titleMarginBottom : 0; // Title's bottom Margin\n height += combinedBodyLength * bodyFontSize; // Body Lines\n height += combinedBodyLength ? (combinedBodyLength - 1) * model.bodySpacing : 0; // Body Line Spacing\n height += footerLineCount ? model.footerMarginTop : 0; // Footer Margin\n height += footerLineCount * (footerFontSize); // Footer Lines\n height += footerLineCount ? (footerLineCount - 1) * model.footerSpacing : 0; // Footer Line Spacing\n\n // Title width\n var widthPadding = 0;\n var maxLineWidth = function(line) {\n width = Math.max(width, ctx.measureText(line).width + widthPadding);\n };\n\n ctx.font = helpers.fontString(titleFontSize, model._titleFontStyle, model._titleFontFamily);\n helpers.each(model.title, maxLineWidth);\n\n // Body width\n ctx.font = helpers.fontString(bodyFontSize, model._bodyFontStyle, model._bodyFontFamily);\n helpers.each(model.beforeBody.concat(model.afterBody), maxLineWidth);\n\n // Body lines may include some extra width due to the color box\n widthPadding = model.displayColors ? (bodyFontSize + 2) : 0;\n helpers.each(body, function(bodyItem) {\n helpers.each(bodyItem.before, maxLineWidth);\n helpers.each(bodyItem.lines, maxLineWidth);\n helpers.each(bodyItem.after, maxLineWidth);\n });\n\n // Reset back to 0\n widthPadding = 0;\n\n // Footer width\n ctx.font = helpers.fontString(footerFontSize, model._footerFontStyle, model._footerFontFamily);\n helpers.each(model.footer, maxLineWidth);\n\n // Add padding\n width += 2 * model.xPadding;\n\n return {\n width: width,\n height: height\n };\n }\n\n /**\n * Helper to get the alignment of a tooltip given the size\n */\n function determineAlignment(tooltip, size) {\n var model = tooltip._model;\n var chart = tooltip._chart;\n var chartArea = tooltip._chart.chartArea;\n var xAlign = 'center';\n var yAlign = 'center';\n\n if (model.y < size.height) {\n yAlign = 'top';\n } else if (model.y > (chart.height - size.height)) {\n yAlign = 'bottom';\n }\n\n var lf, rf; // functions to determine left, right alignment\n var olf, orf; // functions to determine if left/right alignment causes tooltip to go outside chart\n var yf; // function to get the y alignment if the tooltip goes outside of the left or right edges\n var midX = (chartArea.left + chartArea.right) / 2;\n var midY = (chartArea.top + chartArea.bottom) / 2;\n\n if (yAlign === 'center') {\n lf = function(x) {\n return x <= midX;\n };\n rf = function(x) {\n return x > midX;\n };\n } else {\n lf = function(x) {\n return x <= (size.width / 2);\n };\n rf = function(x) {\n return x >= (chart.width - (size.width / 2));\n };\n }\n\n olf = function(x) {\n return x + size.width > chart.width;\n };\n orf = function(x) {\n return x - size.width < 0;\n };\n yf = function(y) {\n return y <= midY ? 'top' : 'bottom';\n };\n\n if (lf(model.x)) {\n xAlign = 'left';\n\n // Is tooltip too wide and goes over the right side of the chart.?\n if (olf(model.x)) {\n xAlign = 'center';\n yAlign = yf(model.y);\n }\n } else if (rf(model.x)) {\n xAlign = 'right';\n\n // Is tooltip too wide and goes outside left edge of canvas?\n if (orf(model.x)) {\n xAlign = 'center';\n yAlign = yf(model.y);\n }\n }\n\n var opts = tooltip._options;\n return {\n xAlign: opts.xAlign ? opts.xAlign : xAlign,\n yAlign: opts.yAlign ? opts.yAlign : yAlign\n };\n }\n\n /**\n * @Helper to get the location a tooltip needs to be placed at given the initial position (via the vm) and the size and alignment\n */\n function getBackgroundPoint(vm, size, alignment) {\n // Background Position\n var x = vm.x;\n var y = vm.y;\n\n var caretSize = vm.caretSize;\n var caretPadding = vm.caretPadding;\n var cornerRadius = vm.cornerRadius;\n var xAlign = alignment.xAlign;\n var yAlign = alignment.yAlign;\n var paddingAndSize = caretSize + caretPadding;\n var radiusAndPadding = cornerRadius + caretPadding;\n\n if (xAlign === 'right') {\n x -= size.width;\n } else if (xAlign === 'center') {\n x -= (size.width / 2);\n }\n\n if (yAlign === 'top') {\n y += paddingAndSize;\n } else if (yAlign === 'bottom') {\n y -= size.height + paddingAndSize;\n } else {\n y -= (size.height / 2);\n }\n\n if (yAlign === 'center') {\n if (xAlign === 'left') {\n x += paddingAndSize;\n } else if (xAlign === 'right') {\n x -= paddingAndSize;\n }\n } else if (xAlign === 'left') {\n x -= radiusAndPadding;\n } else if (xAlign === 'right') {\n x += radiusAndPadding;\n }\n\n return {\n x: x,\n y: y\n };\n }\n\n Chart.Tooltip = Element.extend({\n initialize: function() {\n this._model = getBaseModel(this._options);\n },\n\n // Get the title\n // Args are: (tooltipItem, data)\n getTitle: function() {\n var me = this;\n var opts = me._options;\n var callbacks = opts.callbacks;\n\n var beforeTitle = callbacks.beforeTitle.apply(me, arguments);\n var title = callbacks.title.apply(me, arguments);\n var afterTitle = callbacks.afterTitle.apply(me, arguments);\n\n var lines = [];\n lines = pushOrConcat(lines, beforeTitle);\n lines = pushOrConcat(lines, title);\n lines = pushOrConcat(lines, afterTitle);\n\n return lines;\n },\n\n // Args are: (tooltipItem, data)\n getBeforeBody: function() {\n var lines = this._options.callbacks.beforeBody.apply(this, arguments);\n return helpers.isArray(lines) ? lines : lines !== undefined ? [lines] : [];\n },\n\n // Args are: (tooltipItem, data)\n getBody: function(tooltipItems, data) {\n var me = this;\n var callbacks = me._options.callbacks;\n var bodyItems = [];\n\n helpers.each(tooltipItems, function(tooltipItem) {\n var bodyItem = {\n before: [],\n lines: [],\n after: []\n };\n pushOrConcat(bodyItem.before, callbacks.beforeLabel.call(me, tooltipItem, data));\n pushOrConcat(bodyItem.lines, callbacks.label.call(me, tooltipItem, data));\n pushOrConcat(bodyItem.after, callbacks.afterLabel.call(me, tooltipItem, data));\n\n bodyItems.push(bodyItem);\n });\n\n return bodyItems;\n },\n\n // Args are: (tooltipItem, data)\n getAfterBody: function() {\n var lines = this._options.callbacks.afterBody.apply(this, arguments);\n return helpers.isArray(lines) ? lines : lines !== undefined ? [lines] : [];\n },\n\n // Get the footer and beforeFooter and afterFooter lines\n // Args are: (tooltipItem, data)\n getFooter: function() {\n var me = this;\n var callbacks = me._options.callbacks;\n\n var beforeFooter = callbacks.beforeFooter.apply(me, arguments);\n var footer = callbacks.footer.apply(me, arguments);\n var afterFooter = callbacks.afterFooter.apply(me, arguments);\n\n var lines = [];\n lines = pushOrConcat(lines, beforeFooter);\n lines = pushOrConcat(lines, footer);\n lines = pushOrConcat(lines, afterFooter);\n\n return lines;\n },\n\n update: function(changed) {\n var me = this;\n var opts = me._options;\n\n // Need to regenerate the model because its faster than using extend and it is necessary due to the optimization in Chart.Element.transition\n // that does _view = _model if ease === 1. This causes the 2nd tooltip update to set properties in both the view and model at the same time\n // which breaks any animations.\n var existingModel = me._model;\n var model = me._model = getBaseModel(opts);\n var active = me._active;\n\n var data = me._data;\n\n // In the case where active.length === 0 we need to keep these at existing values for good animations\n var alignment = {\n xAlign: existingModel.xAlign,\n yAlign: existingModel.yAlign\n };\n var backgroundPoint = {\n x: existingModel.x,\n y: existingModel.y\n };\n var tooltipSize = {\n width: existingModel.width,\n height: existingModel.height\n };\n var tooltipPosition = {\n x: existingModel.caretX,\n y: existingModel.caretY\n };\n\n var i, len;\n\n if (active.length) {\n model.opacity = 1;\n\n var labelColors = [];\n var labelTextColors = [];\n tooltipPosition = Chart.Tooltip.positioners[opts.position](active, me._eventPosition);\n\n var tooltipItems = [];\n for (i = 0, len = active.length; i < len; ++i) {\n tooltipItems.push(createTooltipItem(active[i]));\n }\n\n // If the user provided a filter function, use it to modify the tooltip items\n if (opts.filter) {\n tooltipItems = tooltipItems.filter(function(a) {\n return opts.filter(a, data);\n });\n }\n\n // If the user provided a sorting function, use it to modify the tooltip items\n if (opts.itemSort) {\n tooltipItems = tooltipItems.sort(function(a, b) {\n return opts.itemSort(a, b, data);\n });\n }\n\n // Determine colors for boxes\n helpers.each(tooltipItems, function(tooltipItem) {\n labelColors.push(opts.callbacks.labelColor.call(me, tooltipItem, me._chart));\n labelTextColors.push(opts.callbacks.labelTextColor.call(me, tooltipItem, me._chart));\n });\n\n\n // Build the Text Lines\n model.title = me.getTitle(tooltipItems, data);\n model.beforeBody = me.getBeforeBody(tooltipItems, data);\n model.body = me.getBody(tooltipItems, data);\n model.afterBody = me.getAfterBody(tooltipItems, data);\n model.footer = me.getFooter(tooltipItems, data);\n\n // Initial positioning and colors\n model.x = Math.round(tooltipPosition.x);\n model.y = Math.round(tooltipPosition.y);\n model.caretPadding = opts.caretPadding;\n model.labelColors = labelColors;\n model.labelTextColors = labelTextColors;\n\n // data points\n model.dataPoints = tooltipItems;\n\n // We need to determine alignment of the tooltip\n tooltipSize = getTooltipSize(this, model);\n alignment = determineAlignment(this, tooltipSize);\n // Final Size and Position\n backgroundPoint = getBackgroundPoint(model, tooltipSize, alignment);\n } else {\n model.opacity = 0;\n }\n\n model.xAlign = alignment.xAlign;\n model.yAlign = alignment.yAlign;\n model.x = backgroundPoint.x;\n model.y = backgroundPoint.y;\n model.width = tooltipSize.width;\n model.height = tooltipSize.height;\n\n // Point where the caret on the tooltip points to\n model.caretX = tooltipPosition.x;\n model.caretY = tooltipPosition.y;\n\n me._model = model;\n\n if (changed && opts.custom) {\n opts.custom.call(me, model);\n }\n\n return me;\n },\n drawCaret: function(tooltipPoint, size) {\n var ctx = this._chart.ctx;\n var vm = this._view;\n var caretPosition = this.getCaretPosition(tooltipPoint, size, vm);\n\n ctx.lineTo(caretPosition.x1, caretPosition.y1);\n ctx.lineTo(caretPosition.x2, caretPosition.y2);\n ctx.lineTo(caretPosition.x3, caretPosition.y3);\n },\n getCaretPosition: function(tooltipPoint, size, vm) {\n var x1, x2, x3, y1, y2, y3;\n var caretSize = vm.caretSize;\n var cornerRadius = vm.cornerRadius;\n var xAlign = vm.xAlign;\n var yAlign = vm.yAlign;\n var ptX = tooltipPoint.x;\n var ptY = tooltipPoint.y;\n var width = size.width;\n var height = size.height;\n\n if (yAlign === 'center') {\n y2 = ptY + (height / 2);\n\n if (xAlign === 'left') {\n x1 = ptX;\n x2 = x1 - caretSize;\n x3 = x1;\n\n y1 = y2 + caretSize;\n y3 = y2 - caretSize;\n } else {\n x1 = ptX + width;\n x2 = x1 + caretSize;\n x3 = x1;\n\n y1 = y2 - caretSize;\n y3 = y2 + caretSize;\n }\n } else {\n if (xAlign === 'left') {\n x2 = ptX + cornerRadius + (caretSize);\n x1 = x2 - caretSize;\n x3 = x2 + caretSize;\n } else if (xAlign === 'right') {\n x2 = ptX + width - cornerRadius - caretSize;\n x1 = x2 - caretSize;\n x3 = x2 + caretSize;\n } else {\n x2 = ptX + (width / 2);\n x1 = x2 - caretSize;\n x3 = x2 + caretSize;\n }\n if (yAlign === 'top') {\n y1 = ptY;\n y2 = y1 - caretSize;\n y3 = y1;\n } else {\n y1 = ptY + height;\n y2 = y1 + caretSize;\n y3 = y1;\n // invert drawing order\n var tmp = x3;\n x3 = x1;\n x1 = tmp;\n }\n }\n return {x1: x1, x2: x2, x3: x3, y1: y1, y2: y2, y3: y3};\n },\n drawTitle: function(pt, vm, ctx, opacity) {\n var title = vm.title;\n\n if (title.length) {\n ctx.textAlign = vm._titleAlign;\n ctx.textBaseline = 'top';\n\n var titleFontSize = vm.titleFontSize;\n var titleSpacing = vm.titleSpacing;\n\n ctx.fillStyle = mergeOpacity(vm.titleFontColor, opacity);\n ctx.font = helpers.fontString(titleFontSize, vm._titleFontStyle, vm._titleFontFamily);\n\n var i, len;\n for (i = 0, len = title.length; i < len; ++i) {\n ctx.fillText(title[i], pt.x, pt.y);\n pt.y += titleFontSize + titleSpacing; // Line Height and spacing\n\n if (i + 1 === title.length) {\n pt.y += vm.titleMarginBottom - titleSpacing; // If Last, add margin, remove spacing\n }\n }\n }\n },\n drawBody: function(pt, vm, ctx, opacity) {\n var bodyFontSize = vm.bodyFontSize;\n var bodySpacing = vm.bodySpacing;\n var body = vm.body;\n\n ctx.textAlign = vm._bodyAlign;\n ctx.textBaseline = 'top';\n ctx.font = helpers.fontString(bodyFontSize, vm._bodyFontStyle, vm._bodyFontFamily);\n\n // Before Body\n var xLinePadding = 0;\n var fillLineOfText = function(line) {\n ctx.fillText(line, pt.x + xLinePadding, pt.y);\n pt.y += bodyFontSize + bodySpacing;\n };\n\n // Before body lines\n helpers.each(vm.beforeBody, fillLineOfText);\n\n var drawColorBoxes = vm.displayColors;\n xLinePadding = drawColorBoxes ? (bodyFontSize + 2) : 0;\n\n // Draw body lines now\n helpers.each(body, function(bodyItem, i) {\n helpers.each(bodyItem.before, fillLineOfText);\n\n helpers.each(bodyItem.lines, function(line) {\n // Draw Legend-like boxes if needed\n if (drawColorBoxes) {\n // Fill a white rect so that colours merge nicely if the opacity is < 1\n ctx.fillStyle = mergeOpacity(vm.legendColorBackground, opacity);\n ctx.fillRect(pt.x, pt.y, bodyFontSize, bodyFontSize);\n\n // Border\n ctx.lineWidth = 1;\n ctx.strokeStyle = mergeOpacity(vm.labelColors[i].borderColor, opacity);\n ctx.strokeRect(pt.x, pt.y, bodyFontSize, bodyFontSize);\n\n // Inner square\n ctx.fillStyle = mergeOpacity(vm.labelColors[i].backgroundColor, opacity);\n ctx.fillRect(pt.x + 1, pt.y + 1, bodyFontSize - 2, bodyFontSize - 2);\n var textColor = mergeOpacity(vm.labelTextColors[i], opacity);\n ctx.fillStyle = textColor;\n }\n\n fillLineOfText(line);\n });\n\n helpers.each(bodyItem.after, fillLineOfText);\n });\n\n // Reset back to 0 for after body\n xLinePadding = 0;\n\n // After body lines\n helpers.each(vm.afterBody, fillLineOfText);\n pt.y -= bodySpacing; // Remove last body spacing\n },\n drawFooter: function(pt, vm, ctx, opacity) {\n var footer = vm.footer;\n\n if (footer.length) {\n pt.y += vm.footerMarginTop;\n\n ctx.textAlign = vm._footerAlign;\n ctx.textBaseline = 'top';\n\n ctx.fillStyle = mergeOpacity(vm.footerFontColor, opacity);\n ctx.font = helpers.fontString(vm.footerFontSize, vm._footerFontStyle, vm._footerFontFamily);\n\n helpers.each(footer, function(line) {\n ctx.fillText(line, pt.x, pt.y);\n pt.y += vm.footerFontSize + vm.footerSpacing;\n });\n }\n },\n drawBackground: function(pt, vm, ctx, tooltipSize, opacity) {\n ctx.fillStyle = mergeOpacity(vm.backgroundColor, opacity);\n ctx.strokeStyle = mergeOpacity(vm.borderColor, opacity);\n ctx.lineWidth = vm.borderWidth;\n var xAlign = vm.xAlign;\n var yAlign = vm.yAlign;\n var x = pt.x;\n var y = pt.y;\n var width = tooltipSize.width;\n var height = tooltipSize.height;\n var radius = vm.cornerRadius;\n\n ctx.beginPath();\n ctx.moveTo(x + radius, y);\n if (yAlign === 'top') {\n this.drawCaret(pt, tooltipSize);\n }\n ctx.lineTo(x + width - radius, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + radius);\n if (yAlign === 'center' && xAlign === 'right') {\n this.drawCaret(pt, tooltipSize);\n }\n ctx.lineTo(x + width, y + height - radius);\n ctx.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);\n if (yAlign === 'bottom') {\n this.drawCaret(pt, tooltipSize);\n }\n ctx.lineTo(x + radius, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - radius);\n if (yAlign === 'center' && xAlign === 'left') {\n this.drawCaret(pt, tooltipSize);\n }\n ctx.lineTo(x, y + radius);\n ctx.quadraticCurveTo(x, y, x + radius, y);\n ctx.closePath();\n\n ctx.fill();\n\n if (vm.borderWidth > 0) {\n ctx.stroke();\n }\n },\n draw: function() {\n var ctx = this._chart.ctx;\n var vm = this._view;\n\n if (vm.opacity === 0) {\n return;\n }\n\n var tooltipSize = {\n width: vm.width,\n height: vm.height\n };\n var pt = {\n x: vm.x,\n y: vm.y\n };\n\n // IE11/Edge does not like very small opacities, so snap to 0\n var opacity = Math.abs(vm.opacity < 1e-3) ? 0 : vm.opacity;\n\n // Truthy/falsey value for empty tooltip\n var hasTooltipContent = vm.title.length || vm.beforeBody.length || vm.body.length || vm.afterBody.length || vm.footer.length;\n\n if (this._options.enabled && hasTooltipContent) {\n // Draw Background\n this.drawBackground(pt, vm, ctx, tooltipSize, opacity);\n\n // Draw Title, Body, and Footer\n pt.x += vm.xPadding;\n pt.y += vm.yPadding;\n\n // Titles\n this.drawTitle(pt, vm, ctx, opacity);\n\n // Body\n this.drawBody(pt, vm, ctx, opacity);\n\n // Footer\n this.drawFooter(pt, vm, ctx, opacity);\n }\n },\n\n /**\n * Handle an event\n * @private\n * @param {IEvent} event - The event to handle\n * @returns {Boolean} true if the tooltip changed\n */\n handleEvent: function(e) {\n var me = this;\n var options = me._options;\n var changed = false;\n\n me._lastActive = me._lastActive || [];\n\n // Find Active Elements for tooltips\n if (e.type === 'mouseout') {\n me._active = [];\n } else {\n me._active = me._chart.getElementsAtEventForMode(e, options.mode, options);\n }\n\n // Remember Last Actives\n changed = !helpers.arrayEquals(me._active, me._lastActive);\n\n // If tooltip didn't change, do not handle the target event\n if (!changed) {\n return false;\n }\n\n me._lastActive = me._active;\n\n if (options.enabled || options.custom) {\n me._eventPosition = {\n x: e.x,\n y: e.y\n };\n\n var model = me._model;\n me.update(true);\n me.pivot();\n\n // See if our tooltip position changed\n changed |= (model.x !== me._model.x) || (model.y !== me._model.y);\n }\n\n return changed;\n }\n });\n\n /**\n * @namespace Chart.Tooltip.positioners\n */\n Chart.Tooltip.positioners = {\n /**\n * Average mode places the tooltip at the average position of the elements shown\n * @function Chart.Tooltip.positioners.average\n * @param elements {ChartElement[]} the elements being displayed in the tooltip\n * @returns {Point} tooltip position\n */\n average: function(elements) {\n if (!elements.length) {\n return false;\n }\n\n var i, len;\n var x = 0;\n var y = 0;\n var count = 0;\n\n for (i = 0, len = elements.length; i < len; ++i) {\n var el = elements[i];\n if (el && el.hasValue()) {\n var pos = el.tooltipPosition();\n x += pos.x;\n y += pos.y;\n ++count;\n }\n }\n\n return {\n x: Math.round(x / count),\n y: Math.round(y / count)\n };\n },\n\n /**\n * Gets the tooltip position nearest of the item nearest to the event position\n * @function Chart.Tooltip.positioners.nearest\n * @param elements {Chart.Element[]} the tooltip elements\n * @param eventPosition {Point} the position of the event in canvas coordinates\n * @returns {Point} the tooltip position\n */\n nearest: function(elements, eventPosition) {\n var x = eventPosition.x;\n var y = eventPosition.y;\n var minDistance = Number.POSITIVE_INFINITY;\n var i, len, nearestElement;\n\n for (i = 0, len = elements.length; i < len; ++i) {\n var el = elements[i];\n if (el && el.hasValue()) {\n var center = el.getCenterPoint();\n var d = helpers.distanceBetweenPoints(eventPosition, center);\n\n if (d < minDistance) {\n minDistance = d;\n nearestElement = el;\n }\n }\n }\n\n if (nearestElement) {\n var tp = nearestElement.tooltipPosition();\n x = tp.x;\n y = tp.y;\n }\n\n return {\n x: x,\n y: y\n };\n }\n };\n };\n\n},{\"25\":25,\"26\":26,\"45\":45}],36:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var Element = require(26);\n var helpers = require(45);\n\n defaults._set('global', {\n elements: {\n arc: {\n backgroundColor: defaults.global.defaultColor,\n borderColor: '#fff',\n borderWidth: 2\n }\n }\n });\n\n module.exports = Element.extend({\n inLabelRange: function(mouseX) {\n var vm = this._view;\n\n if (vm) {\n return (Math.pow(mouseX - vm.x, 2) < Math.pow(vm.radius + vm.hoverRadius, 2));\n }\n return false;\n },\n\n inRange: function(chartX, chartY) {\n var vm = this._view;\n\n if (vm) {\n var pointRelativePosition = helpers.getAngleFromPoint(vm, {x: chartX, y: chartY});\n var\tangle = pointRelativePosition.angle;\n var distance = pointRelativePosition.distance;\n\n // Sanitise angle range\n var startAngle = vm.startAngle;\n var endAngle = vm.endAngle;\n while (endAngle < startAngle) {\n endAngle += 2.0 * Math.PI;\n }\n while (angle > endAngle) {\n angle -= 2.0 * Math.PI;\n }\n while (angle < startAngle) {\n angle += 2.0 * Math.PI;\n }\n\n // Check if within the range of the open/close angle\n var betweenAngles = (angle >= startAngle && angle <= endAngle);\n var withinRadius = (distance >= vm.innerRadius && distance <= vm.outerRadius);\n\n return (betweenAngles && withinRadius);\n }\n return false;\n },\n\n getCenterPoint: function() {\n var vm = this._view;\n var halfAngle = (vm.startAngle + vm.endAngle) / 2;\n var halfRadius = (vm.innerRadius + vm.outerRadius) / 2;\n return {\n x: vm.x + Math.cos(halfAngle) * halfRadius,\n y: vm.y + Math.sin(halfAngle) * halfRadius\n };\n },\n\n getArea: function() {\n var vm = this._view;\n return Math.PI * ((vm.endAngle - vm.startAngle) / (2 * Math.PI)) * (Math.pow(vm.outerRadius, 2) - Math.pow(vm.innerRadius, 2));\n },\n\n tooltipPosition: function() {\n var vm = this._view;\n var centreAngle = vm.startAngle + ((vm.endAngle - vm.startAngle) / 2);\n var rangeFromCentre = (vm.outerRadius - vm.innerRadius) / 2 + vm.innerRadius;\n\n return {\n x: vm.x + (Math.cos(centreAngle) * rangeFromCentre),\n y: vm.y + (Math.sin(centreAngle) * rangeFromCentre)\n };\n },\n\n draw: function() {\n var ctx = this._chart.ctx;\n var vm = this._view;\n var sA = vm.startAngle;\n var eA = vm.endAngle;\n\n ctx.beginPath();\n\n ctx.arc(vm.x, vm.y, vm.outerRadius, sA, eA);\n ctx.arc(vm.x, vm.y, vm.innerRadius, eA, sA, true);\n\n ctx.closePath();\n ctx.strokeStyle = vm.borderColor;\n ctx.lineWidth = vm.borderWidth;\n\n ctx.fillStyle = vm.backgroundColor;\n\n ctx.fill();\n ctx.lineJoin = 'bevel';\n\n if (vm.borderWidth) {\n ctx.stroke();\n }\n }\n });\n\n},{\"25\":25,\"26\":26,\"45\":45}],37:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var Element = require(26);\n var helpers = require(45);\n\n var globalDefaults = defaults.global;\n\n defaults._set('global', {\n elements: {\n line: {\n tension: 0.4,\n backgroundColor: globalDefaults.defaultColor,\n borderWidth: 3,\n borderColor: globalDefaults.defaultColor,\n borderCapStyle: 'butt',\n borderDash: [],\n borderDashOffset: 0.0,\n borderJoinStyle: 'miter',\n capBezierPoints: true,\n fill: true, // do we fill in the area between the line and its base axis\n }\n }\n });\n\n module.exports = Element.extend({\n draw: function() {\n var me = this;\n var vm = me._view;\n var ctx = me._chart.ctx;\n var spanGaps = vm.spanGaps;\n var points = me._children.slice(); // clone array\n var globalOptionLineElements = globalDefaults.elements.line;\n var lastDrawnIndex = -1;\n var index, current, previous, currentVM;\n\n // If we are looping, adding the first point again\n if (me._loop && points.length) {\n points.push(points[0]);\n }\n\n ctx.save();\n\n // Stroke Line Options\n ctx.lineCap = vm.borderCapStyle || globalOptionLineElements.borderCapStyle;\n\n // IE 9 and 10 do not support line dash\n if (ctx.setLineDash) {\n ctx.setLineDash(vm.borderDash || globalOptionLineElements.borderDash);\n }\n\n ctx.lineDashOffset = vm.borderDashOffset || globalOptionLineElements.borderDashOffset;\n ctx.lineJoin = vm.borderJoinStyle || globalOptionLineElements.borderJoinStyle;\n ctx.lineWidth = vm.borderWidth || globalOptionLineElements.borderWidth;\n ctx.strokeStyle = vm.borderColor || globalDefaults.defaultColor;\n\n // Stroke Line\n ctx.beginPath();\n lastDrawnIndex = -1;\n\n for (index = 0; index < points.length; ++index) {\n current = points[index];\n previous = helpers.previousItem(points, index);\n currentVM = current._view;\n\n // First point moves to it's starting position no matter what\n if (index === 0) {\n if (!currentVM.skip) {\n ctx.moveTo(currentVM.x, currentVM.y);\n lastDrawnIndex = index;\n }\n } else {\n previous = lastDrawnIndex === -1 ? previous : points[lastDrawnIndex];\n\n if (!currentVM.skip) {\n if ((lastDrawnIndex !== (index - 1) && !spanGaps) || lastDrawnIndex === -1) {\n // There was a gap and this is the first point after the gap\n ctx.moveTo(currentVM.x, currentVM.y);\n } else {\n // Line to next point\n helpers.canvas.lineTo(ctx, previous._view, current._view);\n }\n lastDrawnIndex = index;\n }\n }\n }\n\n ctx.stroke();\n ctx.restore();\n }\n });\n\n},{\"25\":25,\"26\":26,\"45\":45}],38:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var Element = require(26);\n var helpers = require(45);\n\n var defaultColor = defaults.global.defaultColor;\n\n defaults._set('global', {\n elements: {\n point: {\n radius: 3,\n pointStyle: 'circle',\n backgroundColor: defaultColor,\n borderColor: defaultColor,\n borderWidth: 1,\n // Hover\n hitRadius: 1,\n hoverRadius: 4,\n hoverBorderWidth: 1\n }\n }\n });\n\n function xRange(mouseX) {\n var vm = this._view;\n return vm ? (Math.pow(mouseX - vm.x, 2) < Math.pow(vm.radius + vm.hitRadius, 2)) : false;\n }\n\n function yRange(mouseY) {\n var vm = this._view;\n return vm ? (Math.pow(mouseY - vm.y, 2) < Math.pow(vm.radius + vm.hitRadius, 2)) : false;\n }\n\n module.exports = Element.extend({\n inRange: function(mouseX, mouseY) {\n var vm = this._view;\n return vm ? ((Math.pow(mouseX - vm.x, 2) + Math.pow(mouseY - vm.y, 2)) < Math.pow(vm.hitRadius + vm.radius, 2)) : false;\n },\n\n inLabelRange: xRange,\n inXRange: xRange,\n inYRange: yRange,\n\n getCenterPoint: function() {\n var vm = this._view;\n return {\n x: vm.x,\n y: vm.y\n };\n },\n\n getArea: function() {\n return Math.PI * Math.pow(this._view.radius, 2);\n },\n\n tooltipPosition: function() {\n var vm = this._view;\n return {\n x: vm.x,\n y: vm.y,\n padding: vm.radius + vm.borderWidth\n };\n },\n\n draw: function(chartArea) {\n var vm = this._view;\n var model = this._model;\n var ctx = this._chart.ctx;\n var pointStyle = vm.pointStyle;\n var radius = vm.radius;\n var x = vm.x;\n var y = vm.y;\n var color = helpers.color;\n var errMargin = 1.01; // 1.01 is margin for Accumulated error. (Especially Edge, IE.)\n var ratio = 0;\n\n if (vm.skip) {\n return;\n }\n\n ctx.strokeStyle = vm.borderColor || defaultColor;\n ctx.lineWidth = helpers.valueOrDefault(vm.borderWidth, defaults.global.elements.point.borderWidth);\n ctx.fillStyle = vm.backgroundColor || defaultColor;\n\n // Cliping for Points.\n // going out from inner charArea?\n if ((chartArea !== undefined) && ((model.x < chartArea.left) || (chartArea.right * errMargin < model.x) || (model.y < chartArea.top) || (chartArea.bottom * errMargin < model.y))) {\n // Point fade out\n if (model.x < chartArea.left) {\n ratio = (x - model.x) / (chartArea.left - model.x);\n } else if (chartArea.right * errMargin < model.x) {\n ratio = (model.x - x) / (model.x - chartArea.right);\n } else if (model.y < chartArea.top) {\n ratio = (y - model.y) / (chartArea.top - model.y);\n } else if (chartArea.bottom * errMargin < model.y) {\n ratio = (model.y - y) / (model.y - chartArea.bottom);\n }\n ratio = Math.round(ratio * 100) / 100;\n ctx.strokeStyle = color(ctx.strokeStyle).alpha(ratio).rgbString();\n ctx.fillStyle = color(ctx.fillStyle).alpha(ratio).rgbString();\n }\n\n helpers.canvas.drawPoint(ctx, pointStyle, radius, x, y);\n }\n });\n\n},{\"25\":25,\"26\":26,\"45\":45}],39:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var Element = require(26);\n\n defaults._set('global', {\n elements: {\n rectangle: {\n backgroundColor: defaults.global.defaultColor,\n borderColor: defaults.global.defaultColor,\n borderSkipped: 'bottom',\n borderWidth: 0\n }\n }\n });\n\n function isVertical(bar) {\n return bar._view.width !== undefined;\n }\n\n /**\n * Helper function to get the bounds of the bar regardless of the orientation\n * @param bar {Chart.Element.Rectangle} the bar\n * @return {Bounds} bounds of the bar\n * @private\n */\n function getBarBounds(bar) {\n var vm = bar._view;\n var x1, x2, y1, y2;\n\n if (isVertical(bar)) {\n // vertical\n var halfWidth = vm.width / 2;\n x1 = vm.x - halfWidth;\n x2 = vm.x + halfWidth;\n y1 = Math.min(vm.y, vm.base);\n y2 = Math.max(vm.y, vm.base);\n } else {\n // horizontal bar\n var halfHeight = vm.height / 2;\n x1 = Math.min(vm.x, vm.base);\n x2 = Math.max(vm.x, vm.base);\n y1 = vm.y - halfHeight;\n y2 = vm.y + halfHeight;\n }\n\n return {\n left: x1,\n top: y1,\n right: x2,\n bottom: y2\n };\n }\n\n module.exports = Element.extend({\n draw: function() {\n var ctx = this._chart.ctx;\n var vm = this._view;\n var left, right, top, bottom, signX, signY, borderSkipped;\n var borderWidth = vm.borderWidth;\n\n if (!vm.horizontal) {\n // bar\n left = vm.x - vm.width / 2;\n right = vm.x + vm.width / 2;\n top = vm.y;\n bottom = vm.base;\n signX = 1;\n signY = bottom > top ? 1 : -1;\n borderSkipped = vm.borderSkipped || 'bottom';\n } else {\n // horizontal bar\n left = vm.base;\n right = vm.x;\n top = vm.y - vm.height / 2;\n bottom = vm.y + vm.height / 2;\n signX = right > left ? 1 : -1;\n signY = 1;\n borderSkipped = vm.borderSkipped || 'left';\n }\n\n // Canvas doesn't allow us to stroke inside the width so we can\n // adjust the sizes to fit if we're setting a stroke on the line\n if (borderWidth) {\n // borderWidth shold be less than bar width and bar height.\n var barSize = Math.min(Math.abs(left - right), Math.abs(top - bottom));\n borderWidth = borderWidth > barSize ? barSize : borderWidth;\n var halfStroke = borderWidth / 2;\n // Adjust borderWidth when bar top position is near vm.base(zero).\n var borderLeft = left + (borderSkipped !== 'left' ? halfStroke * signX : 0);\n var borderRight = right + (borderSkipped !== 'right' ? -halfStroke * signX : 0);\n var borderTop = top + (borderSkipped !== 'top' ? halfStroke * signY : 0);\n var borderBottom = bottom + (borderSkipped !== 'bottom' ? -halfStroke * signY : 0);\n // not become a vertical line?\n if (borderLeft !== borderRight) {\n top = borderTop;\n bottom = borderBottom;\n }\n // not become a horizontal line?\n if (borderTop !== borderBottom) {\n left = borderLeft;\n right = borderRight;\n }\n }\n\n ctx.beginPath();\n ctx.fillStyle = vm.backgroundColor;\n ctx.strokeStyle = vm.borderColor;\n ctx.lineWidth = borderWidth;\n\n // Corner points, from bottom-left to bottom-right clockwise\n // | 1 2 |\n // | 0 3 |\n var corners = [\n [left, bottom],\n [left, top],\n [right, top],\n [right, bottom]\n ];\n\n // Find first (starting) corner with fallback to 'bottom'\n var borders = ['bottom', 'left', 'top', 'right'];\n var startCorner = borders.indexOf(borderSkipped, 0);\n if (startCorner === -1) {\n startCorner = 0;\n }\n\n function cornerAt(index) {\n return corners[(startCorner + index) % 4];\n }\n\n // Draw rectangle from 'startCorner'\n var corner = cornerAt(0);\n ctx.moveTo(corner[0], corner[1]);\n\n for (var i = 1; i < 4; i++) {\n corner = cornerAt(i);\n ctx.lineTo(corner[0], corner[1]);\n }\n\n ctx.fill();\n if (borderWidth) {\n ctx.stroke();\n }\n },\n\n height: function() {\n var vm = this._view;\n return vm.base - vm.y;\n },\n\n inRange: function(mouseX, mouseY) {\n var inRange = false;\n\n if (this._view) {\n var bounds = getBarBounds(this);\n inRange = mouseX >= bounds.left && mouseX <= bounds.right && mouseY >= bounds.top && mouseY <= bounds.bottom;\n }\n\n return inRange;\n },\n\n inLabelRange: function(mouseX, mouseY) {\n var me = this;\n if (!me._view) {\n return false;\n }\n\n var inRange = false;\n var bounds = getBarBounds(me);\n\n if (isVertical(me)) {\n inRange = mouseX >= bounds.left && mouseX <= bounds.right;\n } else {\n inRange = mouseY >= bounds.top && mouseY <= bounds.bottom;\n }\n\n return inRange;\n },\n\n inXRange: function(mouseX) {\n var bounds = getBarBounds(this);\n return mouseX >= bounds.left && mouseX <= bounds.right;\n },\n\n inYRange: function(mouseY) {\n var bounds = getBarBounds(this);\n return mouseY >= bounds.top && mouseY <= bounds.bottom;\n },\n\n getCenterPoint: function() {\n var vm = this._view;\n var x, y;\n if (isVertical(this)) {\n x = vm.x;\n y = (vm.y + vm.base) / 2;\n } else {\n x = (vm.x + vm.base) / 2;\n y = vm.y;\n }\n\n return {x: x, y: y};\n },\n\n getArea: function() {\n var vm = this._view;\n return vm.width * Math.abs(vm.y - vm.base);\n },\n\n tooltipPosition: function() {\n var vm = this._view;\n return {\n x: vm.x,\n y: vm.y\n };\n }\n });\n\n},{\"25\":25,\"26\":26}],40:[function(require,module,exports){\n 'use strict';\n\n module.exports = {};\n module.exports.Arc = require(36);\n module.exports.Line = require(37);\n module.exports.Point = require(38);\n module.exports.Rectangle = require(39);\n\n},{\"36\":36,\"37\":37,\"38\":38,\"39\":39}],41:[function(require,module,exports){\n 'use strict';\n\n var helpers = require(42);\n\n /**\n * @namespace Chart.helpers.canvas\n */\n var exports = module.exports = {\n /**\n * Clears the entire canvas associated to the given `chart`.\n * @param {Chart} chart - The chart for which to clear the canvas.\n */\n clear: function(chart) {\n chart.ctx.clearRect(0, 0, chart.width, chart.height);\n },\n\n /**\n * Creates a \"path\" for a rectangle with rounded corners at position (x, y) with a\n * given size (width, height) and the same `radius` for all corners.\n * @param {CanvasRenderingContext2D} ctx - The canvas 2D Context.\n * @param {Number} x - The x axis of the coordinate for the rectangle starting point.\n * @param {Number} y - The y axis of the coordinate for the rectangle starting point.\n * @param {Number} width - The rectangle's width.\n * @param {Number} height - The rectangle's height.\n * @param {Number} radius - The rounded amount (in pixels) for the four corners.\n * @todo handle `radius` as top-left, top-right, bottom-right, bottom-left array/object?\n */\n roundedRect: function(ctx, x, y, width, height, radius) {\n if (radius) {\n var rx = Math.min(radius, width / 2);\n var ry = Math.min(radius, height / 2);\n\n ctx.moveTo(x + rx, y);\n ctx.lineTo(x + width - rx, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + ry);\n ctx.lineTo(x + width, y + height - ry);\n ctx.quadraticCurveTo(x + width, y + height, x + width - rx, y + height);\n ctx.lineTo(x + rx, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - ry);\n ctx.lineTo(x, y + ry);\n ctx.quadraticCurveTo(x, y, x + rx, y);\n } else {\n ctx.rect(x, y, width, height);\n }\n },\n\n drawPoint: function(ctx, style, radius, x, y) {\n var type, edgeLength, xOffset, yOffset, height, size;\n\n if (typeof style === 'object') {\n type = style.toString();\n if (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') {\n ctx.drawImage(style, x - style.width / 2, y - style.height / 2, style.width, style.height);\n return;\n }\n }\n\n if (isNaN(radius) || radius <= 0) {\n return;\n }\n\n switch (style) {\n // Default includes circle\n default:\n ctx.beginPath();\n ctx.arc(x, y, radius, 0, Math.PI * 2);\n ctx.closePath();\n ctx.fill();\n break;\n case 'triangle':\n ctx.beginPath();\n edgeLength = 3 * radius / Math.sqrt(3);\n height = edgeLength * Math.sqrt(3) / 2;\n ctx.moveTo(x - edgeLength / 2, y + height / 3);\n ctx.lineTo(x + edgeLength / 2, y + height / 3);\n ctx.lineTo(x, y - 2 * height / 3);\n ctx.closePath();\n ctx.fill();\n break;\n case 'rect':\n size = 1 / Math.SQRT2 * radius;\n ctx.beginPath();\n ctx.fillRect(x - size, y - size, 2 * size, 2 * size);\n ctx.strokeRect(x - size, y - size, 2 * size, 2 * size);\n break;\n case 'rectRounded':\n var offset = radius / Math.SQRT2;\n var leftX = x - offset;\n var topY = y - offset;\n var sideSize = Math.SQRT2 * radius;\n ctx.beginPath();\n this.roundedRect(ctx, leftX, topY, sideSize, sideSize, radius / 2);\n ctx.closePath();\n ctx.fill();\n break;\n case 'rectRot':\n size = 1 / Math.SQRT2 * radius;\n ctx.beginPath();\n ctx.moveTo(x - size, y);\n ctx.lineTo(x, y + size);\n ctx.lineTo(x + size, y);\n ctx.lineTo(x, y - size);\n ctx.closePath();\n ctx.fill();\n break;\n case 'cross':\n ctx.beginPath();\n ctx.moveTo(x, y + radius);\n ctx.lineTo(x, y - radius);\n ctx.moveTo(x - radius, y);\n ctx.lineTo(x + radius, y);\n ctx.closePath();\n break;\n case 'crossRot':\n ctx.beginPath();\n xOffset = Math.cos(Math.PI / 4) * radius;\n yOffset = Math.sin(Math.PI / 4) * radius;\n ctx.moveTo(x - xOffset, y - yOffset);\n ctx.lineTo(x + xOffset, y + yOffset);\n ctx.moveTo(x - xOffset, y + yOffset);\n ctx.lineTo(x + xOffset, y - yOffset);\n ctx.closePath();\n break;\n case 'star':\n ctx.beginPath();\n ctx.moveTo(x, y + radius);\n ctx.lineTo(x, y - radius);\n ctx.moveTo(x - radius, y);\n ctx.lineTo(x + radius, y);\n xOffset = Math.cos(Math.PI / 4) * radius;\n yOffset = Math.sin(Math.PI / 4) * radius;\n ctx.moveTo(x - xOffset, y - yOffset);\n ctx.lineTo(x + xOffset, y + yOffset);\n ctx.moveTo(x - xOffset, y + yOffset);\n ctx.lineTo(x + xOffset, y - yOffset);\n ctx.closePath();\n break;\n case 'line':\n ctx.beginPath();\n ctx.moveTo(x - radius, y);\n ctx.lineTo(x + radius, y);\n ctx.closePath();\n break;\n case 'dash':\n ctx.beginPath();\n ctx.moveTo(x, y);\n ctx.lineTo(x + radius, y);\n ctx.closePath();\n break;\n }\n\n ctx.stroke();\n },\n\n clipArea: function(ctx, area) {\n ctx.save();\n ctx.beginPath();\n ctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);\n ctx.clip();\n },\n\n unclipArea: function(ctx) {\n ctx.restore();\n },\n\n lineTo: function(ctx, previous, target, flip) {\n if (target.steppedLine) {\n if ((target.steppedLine === 'after' && !flip) || (target.steppedLine !== 'after' && flip)) {\n ctx.lineTo(previous.x, target.y);\n } else {\n ctx.lineTo(target.x, previous.y);\n }\n ctx.lineTo(target.x, target.y);\n return;\n }\n\n if (!target.tension) {\n ctx.lineTo(target.x, target.y);\n return;\n }\n\n ctx.bezierCurveTo(\n flip ? previous.controlPointPreviousX : previous.controlPointNextX,\n flip ? previous.controlPointPreviousY : previous.controlPointNextY,\n flip ? target.controlPointNextX : target.controlPointPreviousX,\n flip ? target.controlPointNextY : target.controlPointPreviousY,\n target.x,\n target.y);\n }\n };\n\n// DEPRECATIONS\n\n /**\n * Provided for backward compatibility, use Chart.helpers.canvas.clear instead.\n * @namespace Chart.helpers.clear\n * @deprecated since version 2.7.0\n * @todo remove at version 3\n * @private\n */\n helpers.clear = exports.clear;\n\n /**\n * Provided for backward compatibility, use Chart.helpers.canvas.roundedRect instead.\n * @namespace Chart.helpers.drawRoundedRectangle\n * @deprecated since version 2.7.0\n * @todo remove at version 3\n * @private\n */\n helpers.drawRoundedRectangle = function(ctx) {\n ctx.beginPath();\n exports.roundedRect.apply(exports, arguments);\n ctx.closePath();\n };\n\n},{\"42\":42}],42:[function(require,module,exports){\n 'use strict';\n\n /**\n * @namespace Chart.helpers\n */\n var helpers = {\n /**\n * An empty function that can be used, for example, for optional callback.\n */\n noop: function() {},\n\n /**\n * Returns a unique id, sequentially generated from a global variable.\n * @returns {Number}\n * @function\n */\n uid: (function() {\n var id = 0;\n return function() {\n return id++;\n };\n }()),\n\n /**\n * Returns true if `value` is neither null nor undefined, else returns false.\n * @param {*} value - The value to test.\n * @returns {Boolean}\n * @since 2.7.0\n */\n isNullOrUndef: function(value) {\n return value === null || typeof value === 'undefined';\n },\n\n /**\n * Returns true if `value` is an array, else returns false.\n * @param {*} value - The value to test.\n * @returns {Boolean}\n * @function\n */\n isArray: Array.isArray ? Array.isArray : function(value) {\n return Object.prototype.toString.call(value) === '[object Array]';\n },\n\n /**\n * Returns true if `value` is an object (excluding null), else returns false.\n * @param {*} value - The value to test.\n * @returns {Boolean}\n * @since 2.7.0\n */\n isObject: function(value) {\n return value !== null && Object.prototype.toString.call(value) === '[object Object]';\n },\n\n /**\n * Returns `value` if defined, else returns `defaultValue`.\n * @param {*} value - The value to return if defined.\n * @param {*} defaultValue - The value to return if `value` is undefined.\n * @returns {*}\n */\n valueOrDefault: function(value, defaultValue) {\n return typeof value === 'undefined' ? defaultValue : value;\n },\n\n /**\n * Returns value at the given `index` in array if defined, else returns `defaultValue`.\n * @param {Array} value - The array to lookup for value at `index`.\n * @param {Number} index - The index in `value` to lookup for value.\n * @param {*} defaultValue - The value to return if `value[index]` is undefined.\n * @returns {*}\n */\n valueAtIndexOrDefault: function(value, index, defaultValue) {\n return helpers.valueOrDefault(helpers.isArray(value) ? value[index] : value, defaultValue);\n },\n\n /**\n * Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the\n * value returned by `fn`. If `fn` is not a function, this method returns undefined.\n * @param {Function} fn - The function to call.\n * @param {Array|undefined|null} args - The arguments with which `fn` should be called.\n * @param {Object} [thisArg] - The value of `this` provided for the call to `fn`.\n * @returns {*}\n */\n callback: function(fn, args, thisArg) {\n if (fn && typeof fn.call === 'function') {\n return fn.apply(thisArg, args);\n }\n },\n\n /**\n * Note(SB) for performance sake, this method should only be used when loopable type\n * is unknown or in none intensive code (not called often and small loopable). Else\n * it's preferable to use a regular for() loop and save extra function calls.\n * @param {Object|Array} loopable - The object or array to be iterated.\n * @param {Function} fn - The function to call for each item.\n * @param {Object} [thisArg] - The value of `this` provided for the call to `fn`.\n * @param {Boolean} [reverse] - If true, iterates backward on the loopable.\n */\n each: function(loopable, fn, thisArg, reverse) {\n var i, len, keys;\n if (helpers.isArray(loopable)) {\n len = loopable.length;\n if (reverse) {\n for (i = len - 1; i >= 0; i--) {\n fn.call(thisArg, loopable[i], i);\n }\n } else {\n for (i = 0; i < len; i++) {\n fn.call(thisArg, loopable[i], i);\n }\n }\n } else if (helpers.isObject(loopable)) {\n keys = Object.keys(loopable);\n len = keys.length;\n for (i = 0; i < len; i++) {\n fn.call(thisArg, loopable[keys[i]], keys[i]);\n }\n }\n },\n\n /**\n * Returns true if the `a0` and `a1` arrays have the same content, else returns false.\n * @see http://stackoverflow.com/a/14853974\n * @param {Array} a0 - The array to compare\n * @param {Array} a1 - The array to compare\n * @returns {Boolean}\n */\n arrayEquals: function(a0, a1) {\n var i, ilen, v0, v1;\n\n if (!a0 || !a1 || a0.length !== a1.length) {\n return false;\n }\n\n for (i = 0, ilen = a0.length; i < ilen; ++i) {\n v0 = a0[i];\n v1 = a1[i];\n\n if (v0 instanceof Array && v1 instanceof Array) {\n if (!helpers.arrayEquals(v0, v1)) {\n return false;\n }\n } else if (v0 !== v1) {\n // NOTE: two different object instances will never be equal: {x:20} != {x:20}\n return false;\n }\n }\n\n return true;\n },\n\n /**\n * Returns a deep copy of `source` without keeping references on objects and arrays.\n * @param {*} source - The value to clone.\n * @returns {*}\n */\n clone: function(source) {\n if (helpers.isArray(source)) {\n return source.map(helpers.clone);\n }\n\n if (helpers.isObject(source)) {\n var target = {};\n var keys = Object.keys(source);\n var klen = keys.length;\n var k = 0;\n\n for (; k < klen; ++k) {\n target[keys[k]] = helpers.clone(source[keys[k]]);\n }\n\n return target;\n }\n\n return source;\n },\n\n /**\n * The default merger when Chart.helpers.merge is called without merger option.\n * Note(SB): this method is also used by configMerge and scaleMerge as fallback.\n * @private\n */\n _merger: function(key, target, source, options) {\n var tval = target[key];\n var sval = source[key];\n\n if (helpers.isObject(tval) && helpers.isObject(sval)) {\n helpers.merge(tval, sval, options);\n } else {\n target[key] = helpers.clone(sval);\n }\n },\n\n /**\n * Merges source[key] in target[key] only if target[key] is undefined.\n * @private\n */\n _mergerIf: function(key, target, source) {\n var tval = target[key];\n var sval = source[key];\n\n if (helpers.isObject(tval) && helpers.isObject(sval)) {\n helpers.mergeIf(tval, sval);\n } else if (!target.hasOwnProperty(key)) {\n target[key] = helpers.clone(sval);\n }\n },\n\n /**\n * Recursively deep copies `source` properties into `target` with the given `options`.\n * IMPORTANT: `target` is not cloned and will be updated with `source` properties.\n * @param {Object} target - The target object in which all sources are merged into.\n * @param {Object|Array(Object)} source - Object(s) to merge into `target`.\n * @param {Object} [options] - Merging options:\n * @param {Function} [options.merger] - The merge method (key, target, source, options)\n * @returns {Object} The `target` object.\n */\n merge: function(target, source, options) {\n var sources = helpers.isArray(source) ? source : [source];\n var ilen = sources.length;\n var merge, i, keys, klen, k;\n\n if (!helpers.isObject(target)) {\n return target;\n }\n\n options = options || {};\n merge = options.merger || helpers._merger;\n\n for (i = 0; i < ilen; ++i) {\n source = sources[i];\n if (!helpers.isObject(source)) {\n continue;\n }\n\n keys = Object.keys(source);\n for (k = 0, klen = keys.length; k < klen; ++k) {\n merge(keys[k], target, source, options);\n }\n }\n\n return target;\n },\n\n /**\n * Recursively deep copies `source` properties into `target` *only* if not defined in target.\n * IMPORTANT: `target` is not cloned and will be updated with `source` properties.\n * @param {Object} target - The target object in which all sources are merged into.\n * @param {Object|Array(Object)} source - Object(s) to merge into `target`.\n * @returns {Object} The `target` object.\n */\n mergeIf: function(target, source) {\n return helpers.merge(target, source, {merger: helpers._mergerIf});\n }\n };\n\n module.exports = helpers;\n\n// DEPRECATIONS\n\n /**\n * Provided for backward compatibility, use Chart.helpers.callback instead.\n * @function Chart.helpers.callCallback\n * @deprecated since version 2.6.0\n * @todo remove at version 3\n * @private\n */\n helpers.callCallback = helpers.callback;\n\n /**\n * Provided for backward compatibility, use Array.prototype.indexOf instead.\n * Array.prototype.indexOf compatibility: Chrome, Opera, Safari, FF1.5+, IE9+\n * @function Chart.helpers.indexOf\n * @deprecated since version 2.7.0\n * @todo remove at version 3\n * @private\n */\n helpers.indexOf = function(array, item, fromIndex) {\n return Array.prototype.indexOf.call(array, item, fromIndex);\n };\n\n /**\n * Provided for backward compatibility, use Chart.helpers.valueOrDefault instead.\n * @function Chart.helpers.getValueOrDefault\n * @deprecated since version 2.7.0\n * @todo remove at version 3\n * @private\n */\n helpers.getValueOrDefault = helpers.valueOrDefault;\n\n /**\n * Provided for backward compatibility, use Chart.helpers.valueAtIndexOrDefault instead.\n * @function Chart.helpers.getValueAtIndexOrDefault\n * @deprecated since version 2.7.0\n * @todo remove at version 3\n * @private\n */\n helpers.getValueAtIndexOrDefault = helpers.valueAtIndexOrDefault;\n\n},{}],43:[function(require,module,exports){\n 'use strict';\n\n var helpers = require(42);\n\n /**\n * Easing functions adapted from Robert Penner's easing equations.\n * @namespace Chart.helpers.easingEffects\n * @see http://www.robertpenner.com/easing/\n */\n var effects = {\n linear: function(t) {\n return t;\n },\n\n easeInQuad: function(t) {\n return t * t;\n },\n\n easeOutQuad: function(t) {\n return -t * (t - 2);\n },\n\n easeInOutQuad: function(t) {\n if ((t /= 0.5) < 1) {\n return 0.5 * t * t;\n }\n return -0.5 * ((--t) * (t - 2) - 1);\n },\n\n easeInCubic: function(t) {\n return t * t * t;\n },\n\n easeOutCubic: function(t) {\n return (t = t - 1) * t * t + 1;\n },\n\n easeInOutCubic: function(t) {\n if ((t /= 0.5) < 1) {\n return 0.5 * t * t * t;\n }\n return 0.5 * ((t -= 2) * t * t + 2);\n },\n\n easeInQuart: function(t) {\n return t * t * t * t;\n },\n\n easeOutQuart: function(t) {\n return -((t = t - 1) * t * t * t - 1);\n },\n\n easeInOutQuart: function(t) {\n if ((t /= 0.5) < 1) {\n return 0.5 * t * t * t * t;\n }\n return -0.5 * ((t -= 2) * t * t * t - 2);\n },\n\n easeInQuint: function(t) {\n return t * t * t * t * t;\n },\n\n easeOutQuint: function(t) {\n return (t = t - 1) * t * t * t * t + 1;\n },\n\n easeInOutQuint: function(t) {\n if ((t /= 0.5) < 1) {\n return 0.5 * t * t * t * t * t;\n }\n return 0.5 * ((t -= 2) * t * t * t * t + 2);\n },\n\n easeInSine: function(t) {\n return -Math.cos(t * (Math.PI / 2)) + 1;\n },\n\n easeOutSine: function(t) {\n return Math.sin(t * (Math.PI / 2));\n },\n\n easeInOutSine: function(t) {\n return -0.5 * (Math.cos(Math.PI * t) - 1);\n },\n\n easeInExpo: function(t) {\n return (t === 0) ? 0 : Math.pow(2, 10 * (t - 1));\n },\n\n easeOutExpo: function(t) {\n return (t === 1) ? 1 : -Math.pow(2, -10 * t) + 1;\n },\n\n easeInOutExpo: function(t) {\n if (t === 0) {\n return 0;\n }\n if (t === 1) {\n return 1;\n }\n if ((t /= 0.5) < 1) {\n return 0.5 * Math.pow(2, 10 * (t - 1));\n }\n return 0.5 * (-Math.pow(2, -10 * --t) + 2);\n },\n\n easeInCirc: function(t) {\n if (t >= 1) {\n return t;\n }\n return -(Math.sqrt(1 - t * t) - 1);\n },\n\n easeOutCirc: function(t) {\n return Math.sqrt(1 - (t = t - 1) * t);\n },\n\n easeInOutCirc: function(t) {\n if ((t /= 0.5) < 1) {\n return -0.5 * (Math.sqrt(1 - t * t) - 1);\n }\n return 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1);\n },\n\n easeInElastic: function(t) {\n var s = 1.70158;\n var p = 0;\n var a = 1;\n if (t === 0) {\n return 0;\n }\n if (t === 1) {\n return 1;\n }\n if (!p) {\n p = 0.3;\n }\n if (a < 1) {\n a = 1;\n s = p / 4;\n } else {\n s = p / (2 * Math.PI) * Math.asin(1 / a);\n }\n return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * (2 * Math.PI) / p));\n },\n\n easeOutElastic: function(t) {\n var s = 1.70158;\n var p = 0;\n var a = 1;\n if (t === 0) {\n return 0;\n }\n if (t === 1) {\n return 1;\n }\n if (!p) {\n p = 0.3;\n }\n if (a < 1) {\n a = 1;\n s = p / 4;\n } else {\n s = p / (2 * Math.PI) * Math.asin(1 / a);\n }\n return a * Math.pow(2, -10 * t) * Math.sin((t - s) * (2 * Math.PI) / p) + 1;\n },\n\n easeInOutElastic: function(t) {\n var s = 1.70158;\n var p = 0;\n var a = 1;\n if (t === 0) {\n return 0;\n }\n if ((t /= 0.5) === 2) {\n return 1;\n }\n if (!p) {\n p = 0.45;\n }\n if (a < 1) {\n a = 1;\n s = p / 4;\n } else {\n s = p / (2 * Math.PI) * Math.asin(1 / a);\n }\n if (t < 1) {\n return -0.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * (2 * Math.PI) / p));\n }\n return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t - s) * (2 * Math.PI) / p) * 0.5 + 1;\n },\n easeInBack: function(t) {\n var s = 1.70158;\n return t * t * ((s + 1) * t - s);\n },\n\n easeOutBack: function(t) {\n var s = 1.70158;\n return (t = t - 1) * t * ((s + 1) * t + s) + 1;\n },\n\n easeInOutBack: function(t) {\n var s = 1.70158;\n if ((t /= 0.5) < 1) {\n return 0.5 * (t * t * (((s *= (1.525)) + 1) * t - s));\n }\n return 0.5 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2);\n },\n\n easeInBounce: function(t) {\n return 1 - effects.easeOutBounce(1 - t);\n },\n\n easeOutBounce: function(t) {\n if (t < (1 / 2.75)) {\n return 7.5625 * t * t;\n }\n if (t < (2 / 2.75)) {\n return 7.5625 * (t -= (1.5 / 2.75)) * t + 0.75;\n }\n if (t < (2.5 / 2.75)) {\n return 7.5625 * (t -= (2.25 / 2.75)) * t + 0.9375;\n }\n return 7.5625 * (t -= (2.625 / 2.75)) * t + 0.984375;\n },\n\n easeInOutBounce: function(t) {\n if (t < 0.5) {\n return effects.easeInBounce(t * 2) * 0.5;\n }\n return effects.easeOutBounce(t * 2 - 1) * 0.5 + 0.5;\n }\n };\n\n module.exports = {\n effects: effects\n };\n\n// DEPRECATIONS\n\n /**\n * Provided for backward compatibility, use Chart.helpers.easing.effects instead.\n * @function Chart.helpers.easingEffects\n * @deprecated since version 2.7.0\n * @todo remove at version 3\n * @private\n */\n helpers.easingEffects = effects;\n\n},{\"42\":42}],44:[function(require,module,exports){\n 'use strict';\n\n var helpers = require(42);\n\n /**\n * @alias Chart.helpers.options\n * @namespace\n */\n module.exports = {\n /**\n * Converts the given line height `value` in pixels for a specific font `size`.\n * @param {Number|String} value - The lineHeight to parse (eg. 1.6, '14px', '75%', '1.6em').\n * @param {Number} size - The font size (in pixels) used to resolve relative `value`.\n * @returns {Number} The effective line height in pixels (size * 1.2 if value is invalid).\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height\n * @since 2.7.0\n */\n toLineHeight: function(value, size) {\n var matches = ('' + value).match(/^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/);\n if (!matches || matches[1] === 'normal') {\n return size * 1.2;\n }\n\n value = +matches[2];\n\n switch (matches[3]) {\n case 'px':\n return value;\n case '%':\n value /= 100;\n break;\n default:\n break;\n }\n\n return size * value;\n },\n\n /**\n * Converts the given value into a padding object with pre-computed width/height.\n * @param {Number|Object} value - If a number, set the value to all TRBL component,\n * else, if and object, use defined properties and sets undefined ones to 0.\n * @returns {Object} The padding values (top, right, bottom, left, width, height)\n * @since 2.7.0\n */\n toPadding: function(value) {\n var t, r, b, l;\n\n if (helpers.isObject(value)) {\n t = +value.top || 0;\n r = +value.right || 0;\n b = +value.bottom || 0;\n l = +value.left || 0;\n } else {\n t = r = b = l = +value || 0;\n }\n\n return {\n top: t,\n right: r,\n bottom: b,\n left: l,\n height: t + b,\n width: l + r\n };\n },\n\n /**\n * Evaluates the given `inputs` sequentially and returns the first defined value.\n * @param {Array[]} inputs - An array of values, falling back to the last value.\n * @param {Object} [context] - If defined and the current value is a function, the value\n * is called with `context` as first argument and the result becomes the new input.\n * @param {Number} [index] - If defined and the current value is an array, the value\n * at `index` become the new input.\n * @since 2.7.0\n */\n resolve: function(inputs, context, index) {\n var i, ilen, value;\n\n for (i = 0, ilen = inputs.length; i < ilen; ++i) {\n value = inputs[i];\n if (value === undefined) {\n continue;\n }\n if (context !== undefined && typeof value === 'function') {\n value = value(context);\n }\n if (index !== undefined && helpers.isArray(value)) {\n value = value[index];\n }\n if (value !== undefined) {\n return value;\n }\n }\n }\n };\n\n},{\"42\":42}],45:[function(require,module,exports){\n 'use strict';\n\n module.exports = require(42);\n module.exports.easing = require(43);\n module.exports.canvas = require(41);\n module.exports.options = require(44);\n\n},{\"41\":41,\"42\":42,\"43\":43,\"44\":44}],46:[function(require,module,exports){\n /**\n * Platform fallback implementation (minimal).\n * @see https://github.com/chartjs/Chart.js/pull/4591#issuecomment-319575939\n */\n\n module.exports = {\n acquireContext: function(item) {\n if (item && item.canvas) {\n // Support for any object associated to a canvas (including a context2d)\n item = item.canvas;\n }\n\n return item && item.getContext('2d') || null;\n }\n };\n\n},{}],47:[function(require,module,exports){\n /**\n * Chart.Platform implementation for targeting a web browser\n */\n\n 'use strict';\n\n var helpers = require(45);\n\n var EXPANDO_KEY = '$chartjs';\n var CSS_PREFIX = 'chartjs-';\n var CSS_RENDER_MONITOR = CSS_PREFIX + 'render-monitor';\n var CSS_RENDER_ANIMATION = CSS_PREFIX + 'render-animation';\n var ANIMATION_START_EVENTS = ['animationstart', 'webkitAnimationStart'];\n\n /**\n * DOM event types -> Chart.js event types.\n * Note: only events with different types are mapped.\n * @see https://developer.mozilla.org/en-US/docs/Web/Events\n */\n var EVENT_TYPES = {\n touchstart: 'mousedown',\n touchmove: 'mousemove',\n touchend: 'mouseup',\n pointerenter: 'mouseenter',\n pointerdown: 'mousedown',\n pointermove: 'mousemove',\n pointerup: 'mouseup',\n pointerleave: 'mouseout',\n pointerout: 'mouseout'\n };\n\n /**\n * The \"used\" size is the final value of a dimension property after all calculations have\n * been performed. This method uses the computed style of `element` but returns undefined\n * if the computed style is not expressed in pixels. That can happen in some cases where\n * `element` has a size relative to its parent and this last one is not yet displayed,\n * for example because of `display: none` on a parent node.\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value\n * @returns {Number} Size in pixels or undefined if unknown.\n */\n function readUsedSize(element, property) {\n var value = helpers.getStyle(element, property);\n var matches = value && value.match(/^(\\d+)(\\.\\d+)?px$/);\n return matches ? Number(matches[1]) : undefined;\n }\n\n /**\n * Initializes the canvas style and render size without modifying the canvas display size,\n * since responsiveness is handled by the controller.resize() method. The config is used\n * to determine the aspect ratio to apply in case no explicit height has been specified.\n */\n function initCanvas(canvas, config) {\n var style = canvas.style;\n\n // NOTE(SB) canvas.getAttribute('width') !== canvas.width: in the first case it\n // returns null or '' if no explicit value has been set to the canvas attribute.\n var renderHeight = canvas.getAttribute('height');\n var renderWidth = canvas.getAttribute('width');\n\n // Chart.js modifies some canvas values that we want to restore on destroy\n canvas[EXPANDO_KEY] = {\n initial: {\n height: renderHeight,\n width: renderWidth,\n style: {\n display: style.display,\n height: style.height,\n width: style.width\n }\n }\n };\n\n // Force canvas to display as block to avoid extra space caused by inline\n // elements, which would interfere with the responsive resize process.\n // https://github.com/chartjs/Chart.js/issues/2538\n style.display = style.display || 'block';\n\n if (renderWidth === null || renderWidth === '') {\n var displayWidth = readUsedSize(canvas, 'width');\n if (displayWidth !== undefined) {\n canvas.width = displayWidth;\n }\n }\n\n if (renderHeight === null || renderHeight === '') {\n if (canvas.style.height === '') {\n // If no explicit render height and style height, let's apply the aspect ratio,\n // which one can be specified by the user but also by charts as default option\n // (i.e. options.aspectRatio). If not specified, use canvas aspect ratio of 2.\n canvas.height = canvas.width / (config.options.aspectRatio || 2);\n } else {\n var displayHeight = readUsedSize(canvas, 'height');\n if (displayWidth !== undefined) {\n canvas.height = displayHeight;\n }\n }\n }\n\n return canvas;\n }\n\n /**\n * Detects support for options object argument in addEventListener.\n * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support\n * @private\n */\n var supportsEventListenerOptions = (function() {\n var supports = false;\n try {\n var options = Object.defineProperty({}, 'passive', {\n get: function() {\n supports = true;\n }\n });\n window.addEventListener('e', null, options);\n } catch (e) {\n // continue regardless of error\n }\n return supports;\n }());\n\n// Default passive to true as expected by Chrome for 'touchstart' and 'touchend' events.\n// https://github.com/chartjs/Chart.js/issues/4287\n var eventListenerOptions = supportsEventListenerOptions ? {passive: true} : false;\n\n function addEventListener(node, type, listener) {\n node.addEventListener(type, listener, eventListenerOptions);\n }\n\n function removeEventListener(node, type, listener) {\n node.removeEventListener(type, listener, eventListenerOptions);\n }\n\n function createEvent(type, chart, x, y, nativeEvent) {\n return {\n type: type,\n chart: chart,\n native: nativeEvent || null,\n x: x !== undefined ? x : null,\n y: y !== undefined ? y : null,\n };\n }\n\n function fromNativeEvent(event, chart) {\n var type = EVENT_TYPES[event.type] || event.type;\n var pos = helpers.getRelativePosition(event, chart);\n return createEvent(type, chart, pos.x, pos.y, event);\n }\n\n function throttled(fn, thisArg) {\n var ticking = false;\n var args = [];\n\n return function() {\n args = Array.prototype.slice.call(arguments);\n thisArg = thisArg || this;\n\n if (!ticking) {\n ticking = true;\n helpers.requestAnimFrame.call(window, function() {\n ticking = false;\n fn.apply(thisArg, args);\n });\n }\n };\n }\n\n// Implementation based on https://github.com/marcj/css-element-queries\n function createResizer(handler) {\n var resizer = document.createElement('div');\n var cls = CSS_PREFIX + 'size-monitor';\n var maxSize = 1000000;\n var style =\n 'position:absolute;' +\n 'left:0;' +\n 'top:0;' +\n 'right:0;' +\n 'bottom:0;' +\n 'overflow:hidden;' +\n 'pointer-events:none;' +\n 'visibility:hidden;' +\n 'z-index:-1;';\n\n resizer.style.cssText = style;\n resizer.className = cls;\n resizer.innerHTML =\n '
      ' +\n '
      ' +\n '
      ' +\n '
      ' +\n '
      ' +\n '
      ' +\n '
      ' +\n '
      ';\n\n var expand = resizer.childNodes[0];\n var shrink = resizer.childNodes[1];\n\n resizer._reset = function() {\n expand.scrollLeft = maxSize;\n expand.scrollTop = maxSize;\n shrink.scrollLeft = maxSize;\n shrink.scrollTop = maxSize;\n };\n var onScroll = function() {\n resizer._reset();\n handler();\n };\n\n addEventListener(expand, 'scroll', onScroll.bind(expand, 'expand'));\n addEventListener(shrink, 'scroll', onScroll.bind(shrink, 'shrink'));\n\n return resizer;\n }\n\n// https://davidwalsh.name/detect-node-insertion\n function watchForRender(node, handler) {\n var expando = node[EXPANDO_KEY] || (node[EXPANDO_KEY] = {});\n var proxy = expando.renderProxy = function(e) {\n if (e.animationName === CSS_RENDER_ANIMATION) {\n handler();\n }\n };\n\n helpers.each(ANIMATION_START_EVENTS, function(type) {\n addEventListener(node, type, proxy);\n });\n\n node.classList.add(CSS_RENDER_MONITOR);\n }\n\n function unwatchForRender(node) {\n var expando = node[EXPANDO_KEY] || {};\n var proxy = expando.renderProxy;\n\n if (proxy) {\n helpers.each(ANIMATION_START_EVENTS, function(type) {\n removeEventListener(node, type, proxy);\n });\n\n delete expando.renderProxy;\n }\n\n node.classList.remove(CSS_RENDER_MONITOR);\n }\n\n function addResizeListener(node, listener, chart) {\n var expando = node[EXPANDO_KEY] || (node[EXPANDO_KEY] = {});\n\n // Let's keep track of this added resizer and thus avoid DOM query when removing it.\n var resizer = expando.resizer = createResizer(throttled(function() {\n if (expando.resizer) {\n return listener(createEvent('resize', chart));\n }\n }));\n\n // The resizer needs to be attached to the node parent, so we first need to be\n // sure that `node` is attached to the DOM before injecting the resizer element.\n watchForRender(node, function() {\n if (expando.resizer) {\n var container = node.parentNode;\n if (container && container !== resizer.parentNode) {\n container.insertBefore(resizer, container.firstChild);\n }\n\n // The container size might have changed, let's reset the resizer state.\n resizer._reset();\n }\n });\n }\n\n function removeResizeListener(node) {\n var expando = node[EXPANDO_KEY] || {};\n var resizer = expando.resizer;\n\n delete expando.resizer;\n unwatchForRender(node);\n\n if (resizer && resizer.parentNode) {\n resizer.parentNode.removeChild(resizer);\n }\n }\n\n function injectCSS(platform, css) {\n // http://stackoverflow.com/q/3922139\n var style = platform._style || document.createElement('style');\n if (!platform._style) {\n platform._style = style;\n css = '/* Chart.js */\\n' + css;\n style.setAttribute('type', 'text/css');\n document.getElementsByTagName('head')[0].appendChild(style);\n }\n\n style.appendChild(document.createTextNode(css));\n }\n\n module.exports = {\n /**\n * This property holds whether this platform is enabled for the current environment.\n * Currently used by platform.js to select the proper implementation.\n * @private\n */\n _enabled: typeof window !== 'undefined' && typeof document !== 'undefined',\n\n initialize: function() {\n var keyframes = 'from{opacity:0.99}to{opacity:1}';\n\n injectCSS(this,\n // DOM rendering detection\n // https://davidwalsh.name/detect-node-insertion\n '@-webkit-keyframes ' + CSS_RENDER_ANIMATION + '{' + keyframes + '}' +\n '@keyframes ' + CSS_RENDER_ANIMATION + '{' + keyframes + '}' +\n '.' + CSS_RENDER_MONITOR + '{' +\n '-webkit-animation:' + CSS_RENDER_ANIMATION + ' 0.001s;' +\n 'animation:' + CSS_RENDER_ANIMATION + ' 0.001s;' +\n '}'\n );\n },\n\n acquireContext: function(item, config) {\n if (typeof item === 'string') {\n item = document.getElementById(item);\n } else if (item.length) {\n // Support for array based queries (such as jQuery)\n item = item[0];\n }\n\n if (item && item.canvas) {\n // Support for any object associated to a canvas (including a context2d)\n item = item.canvas;\n }\n\n // To prevent canvas fingerprinting, some add-ons undefine the getContext\n // method, for example: https://github.com/kkapsner/CanvasBlocker\n // https://github.com/chartjs/Chart.js/issues/2807\n var context = item && item.getContext && item.getContext('2d');\n\n // `instanceof HTMLCanvasElement/CanvasRenderingContext2D` fails when the item is\n // inside an iframe or when running in a protected environment. We could guess the\n // types from their toString() value but let's keep things flexible and assume it's\n // a sufficient condition if the item has a context2D which has item as `canvas`.\n // https://github.com/chartjs/Chart.js/issues/3887\n // https://github.com/chartjs/Chart.js/issues/4102\n // https://github.com/chartjs/Chart.js/issues/4152\n if (context && context.canvas === item) {\n initCanvas(item, config);\n return context;\n }\n\n return null;\n },\n\n releaseContext: function(context) {\n var canvas = context.canvas;\n if (!canvas[EXPANDO_KEY]) {\n return;\n }\n\n var initial = canvas[EXPANDO_KEY].initial;\n ['height', 'width'].forEach(function(prop) {\n var value = initial[prop];\n if (helpers.isNullOrUndef(value)) {\n canvas.removeAttribute(prop);\n } else {\n canvas.setAttribute(prop, value);\n }\n });\n\n helpers.each(initial.style || {}, function(value, key) {\n canvas.style[key] = value;\n });\n\n // The canvas render size might have been changed (and thus the state stack discarded),\n // we can't use save() and restore() to restore the initial state. So make sure that at\n // least the canvas context is reset to the default state by setting the canvas width.\n // https://www.w3.org/TR/2011/WD-html5-20110525/the-canvas-element.html\n canvas.width = canvas.width;\n\n delete canvas[EXPANDO_KEY];\n },\n\n addEventListener: function(chart, type, listener) {\n var canvas = chart.canvas;\n if (type === 'resize') {\n // Note: the resize event is not supported on all browsers.\n addResizeListener(canvas, listener, chart);\n return;\n }\n\n var expando = listener[EXPANDO_KEY] || (listener[EXPANDO_KEY] = {});\n var proxies = expando.proxies || (expando.proxies = {});\n var proxy = proxies[chart.id + '_' + type] = function(event) {\n listener(fromNativeEvent(event, chart));\n };\n\n addEventListener(canvas, type, proxy);\n },\n\n removeEventListener: function(chart, type, listener) {\n var canvas = chart.canvas;\n if (type === 'resize') {\n // Note: the resize event is not supported on all browsers.\n removeResizeListener(canvas, listener);\n return;\n }\n\n var expando = listener[EXPANDO_KEY] || {};\n var proxies = expando.proxies || {};\n var proxy = proxies[chart.id + '_' + type];\n if (!proxy) {\n return;\n }\n\n removeEventListener(canvas, type, proxy);\n }\n };\n\n// DEPRECATIONS\n\n /**\n * Provided for backward compatibility, use EventTarget.addEventListener instead.\n * EventTarget.addEventListener compatibility: Chrome, Opera 7, Safari, FF1.5+, IE9+\n * @see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener\n * @function Chart.helpers.addEvent\n * @deprecated since version 2.7.0\n * @todo remove at version 3\n * @private\n */\n helpers.addEvent = addEventListener;\n\n /**\n * Provided for backward compatibility, use EventTarget.removeEventListener instead.\n * EventTarget.removeEventListener compatibility: Chrome, Opera 7, Safari, FF1.5+, IE9+\n * @see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener\n * @function Chart.helpers.removeEvent\n * @deprecated since version 2.7.0\n * @todo remove at version 3\n * @private\n */\n helpers.removeEvent = removeEventListener;\n\n},{\"45\":45}],48:[function(require,module,exports){\n 'use strict';\n\n var helpers = require(45);\n var basic = require(46);\n var dom = require(47);\n\n// @TODO Make possible to select another platform at build time.\n var implementation = dom._enabled ? dom : basic;\n\n /**\n * @namespace Chart.platform\n * @see https://chartjs.gitbooks.io/proposals/content/Platform.html\n * @since 2.4.0\n */\n module.exports = helpers.extend({\n /**\n * @since 2.7.0\n */\n initialize: function() {},\n\n /**\n * Called at chart construction time, returns a context2d instance implementing\n * the [W3C Canvas 2D Context API standard]{@link https://www.w3.org/TR/2dcontext/}.\n * @param {*} item - The native item from which to acquire context (platform specific)\n * @param {Object} options - The chart options\n * @returns {CanvasRenderingContext2D} context2d instance\n */\n acquireContext: function() {},\n\n /**\n * Called at chart destruction time, releases any resources associated to the context\n * previously returned by the acquireContext() method.\n * @param {CanvasRenderingContext2D} context - The context2d instance\n * @returns {Boolean} true if the method succeeded, else false\n */\n releaseContext: function() {},\n\n /**\n * Registers the specified listener on the given chart.\n * @param {Chart} chart - Chart from which to listen for event\n * @param {String} type - The ({@link IEvent}) type to listen for\n * @param {Function} listener - Receives a notification (an object that implements\n * the {@link IEvent} interface) when an event of the specified type occurs.\n */\n addEventListener: function() {},\n\n /**\n * Removes the specified listener previously registered with addEventListener.\n * @param {Chart} chart -Chart from which to remove the listener\n * @param {String} type - The ({@link IEvent}) type to remove\n * @param {Function} listener - The listener function to remove from the event target.\n */\n removeEventListener: function() {}\n\n }, implementation);\n\n /**\n * @interface IPlatform\n * Allows abstracting platform dependencies away from the chart\n * @borrows Chart.platform.acquireContext as acquireContext\n * @borrows Chart.platform.releaseContext as releaseContext\n * @borrows Chart.platform.addEventListener as addEventListener\n * @borrows Chart.platform.removeEventListener as removeEventListener\n */\n\n /**\n * @interface IEvent\n * @prop {String} type - The event type name, possible values are:\n * 'contextmenu', 'mouseenter', 'mousedown', 'mousemove', 'mouseup', 'mouseout',\n * 'click', 'dblclick', 'keydown', 'keypress', 'keyup' and 'resize'\n * @prop {*} native - The original native event (null for emulated events, e.g. 'resize')\n * @prop {Number} x - The mouse x position, relative to the canvas (null for incompatible events)\n * @prop {Number} y - The mouse y position, relative to the canvas (null for incompatible events)\n */\n\n},{\"45\":45,\"46\":46,\"47\":47}],49:[function(require,module,exports){\n /**\n * Plugin based on discussion from the following Chart.js issues:\n * @see https://github.com/chartjs/Chart.js/issues/2380#issuecomment-279961569\n * @see https://github.com/chartjs/Chart.js/issues/2440#issuecomment-256461897\n */\n\n 'use strict';\n\n var defaults = require(25);\n var elements = require(40);\n var helpers = require(45);\n\n defaults._set('global', {\n plugins: {\n filler: {\n propagate: true\n }\n }\n });\n\n module.exports = function() {\n\n var mappers = {\n dataset: function(source) {\n var index = source.fill;\n var chart = source.chart;\n var meta = chart.getDatasetMeta(index);\n var visible = meta && chart.isDatasetVisible(index);\n var points = (visible && meta.dataset._children) || [];\n var length = points.length || 0;\n\n return !length ? null : function(point, i) {\n return (i < length && points[i]._view) || null;\n };\n },\n\n boundary: function(source) {\n var boundary = source.boundary;\n var x = boundary ? boundary.x : null;\n var y = boundary ? boundary.y : null;\n\n return function(point) {\n return {\n x: x === null ? point.x : x,\n y: y === null ? point.y : y,\n };\n };\n }\n };\n\n // @todo if (fill[0] === '#')\n function decodeFill(el, index, count) {\n var model = el._model || {};\n var fill = model.fill;\n var target;\n\n if (fill === undefined) {\n fill = !!model.backgroundColor;\n }\n\n if (fill === false || fill === null) {\n return false;\n }\n\n if (fill === true) {\n return 'origin';\n }\n\n target = parseFloat(fill, 10);\n if (isFinite(target) && Math.floor(target) === target) {\n if (fill[0] === '-' || fill[0] === '+') {\n target = index + target;\n }\n\n if (target === index || target < 0 || target >= count) {\n return false;\n }\n\n return target;\n }\n\n switch (fill) {\n // compatibility\n case 'bottom':\n return 'start';\n case 'top':\n return 'end';\n case 'zero':\n return 'origin';\n // supported boundaries\n case 'origin':\n case 'start':\n case 'end':\n return fill;\n // invalid fill values\n default:\n return false;\n }\n }\n\n function computeBoundary(source) {\n var model = source.el._model || {};\n var scale = source.el._scale || {};\n var fill = source.fill;\n var target = null;\n var horizontal;\n\n if (isFinite(fill)) {\n return null;\n }\n\n // Backward compatibility: until v3, we still need to support boundary values set on\n // the model (scaleTop, scaleBottom and scaleZero) because some external plugins and\n // controllers might still use it (e.g. the Smith chart).\n\n if (fill === 'start') {\n target = model.scaleBottom === undefined ? scale.bottom : model.scaleBottom;\n } else if (fill === 'end') {\n target = model.scaleTop === undefined ? scale.top : model.scaleTop;\n } else if (model.scaleZero !== undefined) {\n target = model.scaleZero;\n } else if (scale.getBasePosition) {\n target = scale.getBasePosition();\n } else if (scale.getBasePixel) {\n target = scale.getBasePixel();\n }\n\n if (target !== undefined && target !== null) {\n if (target.x !== undefined && target.y !== undefined) {\n return target;\n }\n\n if (typeof target === 'number' && isFinite(target)) {\n horizontal = scale.isHorizontal();\n return {\n x: horizontal ? target : null,\n y: horizontal ? null : target\n };\n }\n }\n\n return null;\n }\n\n function resolveTarget(sources, index, propagate) {\n var source = sources[index];\n var fill = source.fill;\n var visited = [index];\n var target;\n\n if (!propagate) {\n return fill;\n }\n\n while (fill !== false && visited.indexOf(fill) === -1) {\n if (!isFinite(fill)) {\n return fill;\n }\n\n target = sources[fill];\n if (!target) {\n return false;\n }\n\n if (target.visible) {\n return fill;\n }\n\n visited.push(fill);\n fill = target.fill;\n }\n\n return false;\n }\n\n function createMapper(source) {\n var fill = source.fill;\n var type = 'dataset';\n\n if (fill === false) {\n return null;\n }\n\n if (!isFinite(fill)) {\n type = 'boundary';\n }\n\n return mappers[type](source);\n }\n\n function isDrawable(point) {\n return point && !point.skip;\n }\n\n function drawArea(ctx, curve0, curve1, len0, len1) {\n var i;\n\n if (!len0 || !len1) {\n return;\n }\n\n // building first area curve (normal)\n ctx.moveTo(curve0[0].x, curve0[0].y);\n for (i = 1; i < len0; ++i) {\n helpers.canvas.lineTo(ctx, curve0[i - 1], curve0[i]);\n }\n\n // joining the two area curves\n ctx.lineTo(curve1[len1 - 1].x, curve1[len1 - 1].y);\n\n // building opposite area curve (reverse)\n for (i = len1 - 1; i > 0; --i) {\n helpers.canvas.lineTo(ctx, curve1[i], curve1[i - 1], true);\n }\n }\n\n function doFill(ctx, points, mapper, view, color, loop) {\n var count = points.length;\n var span = view.spanGaps;\n var curve0 = [];\n var curve1 = [];\n var len0 = 0;\n var len1 = 0;\n var i, ilen, index, p0, p1, d0, d1;\n\n ctx.beginPath();\n\n for (i = 0, ilen = (count + !!loop); i < ilen; ++i) {\n index = i % count;\n p0 = points[index]._view;\n p1 = mapper(p0, index, view);\n d0 = isDrawable(p0);\n d1 = isDrawable(p1);\n\n if (d0 && d1) {\n len0 = curve0.push(p0);\n len1 = curve1.push(p1);\n } else if (len0 && len1) {\n if (!span) {\n drawArea(ctx, curve0, curve1, len0, len1);\n len0 = len1 = 0;\n curve0 = [];\n curve1 = [];\n } else {\n if (d0) {\n curve0.push(p0);\n }\n if (d1) {\n curve1.push(p1);\n }\n }\n }\n }\n\n drawArea(ctx, curve0, curve1, len0, len1);\n\n ctx.closePath();\n ctx.fillStyle = color;\n ctx.fill();\n }\n\n return {\n id: 'filler',\n\n afterDatasetsUpdate: function(chart, options) {\n var count = (chart.data.datasets || []).length;\n var propagate = options.propagate;\n var sources = [];\n var meta, i, el, source;\n\n for (i = 0; i < count; ++i) {\n meta = chart.getDatasetMeta(i);\n el = meta.dataset;\n source = null;\n\n if (el && el._model && el instanceof elements.Line) {\n source = {\n visible: chart.isDatasetVisible(i),\n fill: decodeFill(el, i, count),\n chart: chart,\n el: el\n };\n }\n\n meta.$filler = source;\n sources.push(source);\n }\n\n for (i = 0; i < count; ++i) {\n source = sources[i];\n if (!source) {\n continue;\n }\n\n source.fill = resolveTarget(sources, i, propagate);\n source.boundary = computeBoundary(source);\n source.mapper = createMapper(source);\n }\n },\n\n beforeDatasetDraw: function(chart, args) {\n var meta = args.meta.$filler;\n if (!meta) {\n return;\n }\n\n var ctx = chart.ctx;\n var el = meta.el;\n var view = el._view;\n var points = el._children || [];\n var mapper = meta.mapper;\n var color = view.backgroundColor || defaults.global.defaultColor;\n\n if (mapper && color && points.length) {\n helpers.canvas.clipArea(ctx, chart.chartArea);\n doFill(ctx, points, mapper, view, color, el._loop);\n helpers.canvas.unclipArea(ctx);\n }\n }\n };\n };\n\n},{\"25\":25,\"40\":40,\"45\":45}],50:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var Element = require(26);\n var helpers = require(45);\n\n defaults._set('global', {\n legend: {\n display: true,\n position: 'top',\n fullWidth: true,\n reverse: false,\n weight: 1000,\n\n // a callback that will handle\n onClick: function(e, legendItem) {\n var index = legendItem.datasetIndex;\n var ci = this.chart;\n var meta = ci.getDatasetMeta(index);\n\n // See controller.isDatasetVisible comment\n meta.hidden = meta.hidden === null ? !ci.data.datasets[index].hidden : null;\n\n // We hid a dataset ... rerender the chart\n ci.update();\n },\n\n onHover: null,\n\n labels: {\n boxWidth: 40,\n padding: 10,\n // Generates labels shown in the legend\n // Valid properties to return:\n // text : text to display\n // fillStyle : fill of coloured box\n // strokeStyle: stroke of coloured box\n // hidden : if this legend item refers to a hidden item\n // lineCap : cap style for line\n // lineDash\n // lineDashOffset :\n // lineJoin :\n // lineWidth :\n generateLabels: function(chart) {\n var data = chart.data;\n return helpers.isArray(data.datasets) ? data.datasets.map(function(dataset, i) {\n return {\n text: dataset.label,\n fillStyle: (!helpers.isArray(dataset.backgroundColor) ? dataset.backgroundColor : dataset.backgroundColor[0]),\n hidden: !chart.isDatasetVisible(i),\n lineCap: dataset.borderCapStyle,\n lineDash: dataset.borderDash,\n lineDashOffset: dataset.borderDashOffset,\n lineJoin: dataset.borderJoinStyle,\n lineWidth: dataset.borderWidth,\n strokeStyle: dataset.borderColor,\n pointStyle: dataset.pointStyle,\n\n // Below is extra data used for toggling the datasets\n datasetIndex: i\n };\n }, this) : [];\n }\n }\n },\n\n legendCallback: function(chart) {\n var text = [];\n text.push('
        ');\n for (var i = 0; i < chart.data.datasets.length; i++) {\n text.push('
      • ');\n if (chart.data.datasets[i].label) {\n text.push(chart.data.datasets[i].label);\n }\n text.push('
      • ');\n }\n text.push('
      ');\n return text.join('');\n }\n });\n\n module.exports = function(Chart) {\n\n var layout = Chart.layoutService;\n var noop = helpers.noop;\n\n /**\n * Helper function to get the box width based on the usePointStyle option\n * @param labelopts {Object} the label options on the legend\n * @param fontSize {Number} the label font size\n * @return {Number} width of the color box area\n */\n function getBoxWidth(labelOpts, fontSize) {\n return labelOpts.usePointStyle ?\n fontSize * Math.SQRT2 :\n labelOpts.boxWidth;\n }\n\n Chart.Legend = Element.extend({\n\n initialize: function(config) {\n helpers.extend(this, config);\n\n // Contains hit boxes for each dataset (in dataset order)\n this.legendHitBoxes = [];\n\n // Are we in doughnut mode which has a different data type\n this.doughnutMode = false;\n },\n\n // These methods are ordered by lifecycle. Utilities then follow.\n // Any function defined here is inherited by all legend types.\n // Any function can be extended by the legend type\n\n beforeUpdate: noop,\n update: function(maxWidth, maxHeight, margins) {\n var me = this;\n\n // Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)\n me.beforeUpdate();\n\n // Absorb the master measurements\n me.maxWidth = maxWidth;\n me.maxHeight = maxHeight;\n me.margins = margins;\n\n // Dimensions\n me.beforeSetDimensions();\n me.setDimensions();\n me.afterSetDimensions();\n // Labels\n me.beforeBuildLabels();\n me.buildLabels();\n me.afterBuildLabels();\n\n // Fit\n me.beforeFit();\n me.fit();\n me.afterFit();\n //\n me.afterUpdate();\n\n return me.minSize;\n },\n afterUpdate: noop,\n\n //\n\n beforeSetDimensions: noop,\n setDimensions: function() {\n var me = this;\n // Set the unconstrained dimension before label rotation\n if (me.isHorizontal()) {\n // Reset position before calculating rotation\n me.width = me.maxWidth;\n me.left = 0;\n me.right = me.width;\n } else {\n me.height = me.maxHeight;\n\n // Reset position before calculating rotation\n me.top = 0;\n me.bottom = me.height;\n }\n\n // Reset padding\n me.paddingLeft = 0;\n me.paddingTop = 0;\n me.paddingRight = 0;\n me.paddingBottom = 0;\n\n // Reset minSize\n me.minSize = {\n width: 0,\n height: 0\n };\n },\n afterSetDimensions: noop,\n\n //\n\n beforeBuildLabels: noop,\n buildLabels: function() {\n var me = this;\n var labelOpts = me.options.labels || {};\n var legendItems = helpers.callback(labelOpts.generateLabels, [me.chart], me) || [];\n\n if (labelOpts.filter) {\n legendItems = legendItems.filter(function(item) {\n return labelOpts.filter(item, me.chart.data);\n });\n }\n\n if (me.options.reverse) {\n legendItems.reverse();\n }\n\n me.legendItems = legendItems;\n },\n afterBuildLabels: noop,\n\n //\n\n beforeFit: noop,\n fit: function() {\n var me = this;\n var opts = me.options;\n var labelOpts = opts.labels;\n var display = opts.display;\n\n var ctx = me.ctx;\n\n var globalDefault = defaults.global;\n var valueOrDefault = helpers.valueOrDefault;\n var fontSize = valueOrDefault(labelOpts.fontSize, globalDefault.defaultFontSize);\n var fontStyle = valueOrDefault(labelOpts.fontStyle, globalDefault.defaultFontStyle);\n var fontFamily = valueOrDefault(labelOpts.fontFamily, globalDefault.defaultFontFamily);\n var labelFont = helpers.fontString(fontSize, fontStyle, fontFamily);\n\n // Reset hit boxes\n var hitboxes = me.legendHitBoxes = [];\n\n var minSize = me.minSize;\n var isHorizontal = me.isHorizontal();\n\n if (isHorizontal) {\n minSize.width = me.maxWidth; // fill all the width\n minSize.height = display ? 10 : 0;\n } else {\n minSize.width = display ? 10 : 0;\n minSize.height = me.maxHeight; // fill all the height\n }\n\n // Increase sizes here\n if (display) {\n ctx.font = labelFont;\n\n if (isHorizontal) {\n // Labels\n\n // Width of each line of legend boxes. Labels wrap onto multiple lines when there are too many to fit on one\n var lineWidths = me.lineWidths = [0];\n var totalHeight = me.legendItems.length ? fontSize + (labelOpts.padding) : 0;\n\n ctx.textAlign = 'left';\n ctx.textBaseline = 'top';\n\n helpers.each(me.legendItems, function(legendItem, i) {\n var boxWidth = getBoxWidth(labelOpts, fontSize);\n var width = boxWidth + (fontSize / 2) + ctx.measureText(legendItem.text).width;\n\n if (lineWidths[lineWidths.length - 1] + width + labelOpts.padding >= me.width) {\n totalHeight += fontSize + (labelOpts.padding);\n lineWidths[lineWidths.length] = me.left;\n }\n\n // Store the hitbox width and height here. Final position will be updated in `draw`\n hitboxes[i] = {\n left: 0,\n top: 0,\n width: width,\n height: fontSize\n };\n\n lineWidths[lineWidths.length - 1] += width + labelOpts.padding;\n });\n\n minSize.height += totalHeight;\n\n } else {\n var vPadding = labelOpts.padding;\n var columnWidths = me.columnWidths = [];\n var totalWidth = labelOpts.padding;\n var currentColWidth = 0;\n var currentColHeight = 0;\n var itemHeight = fontSize + vPadding;\n\n helpers.each(me.legendItems, function(legendItem, i) {\n var boxWidth = getBoxWidth(labelOpts, fontSize);\n var itemWidth = boxWidth + (fontSize / 2) + ctx.measureText(legendItem.text).width;\n\n // If too tall, go to new column\n if (currentColHeight + itemHeight > minSize.height) {\n totalWidth += currentColWidth + labelOpts.padding;\n columnWidths.push(currentColWidth); // previous column width\n\n currentColWidth = 0;\n currentColHeight = 0;\n }\n\n // Get max width\n currentColWidth = Math.max(currentColWidth, itemWidth);\n currentColHeight += itemHeight;\n\n // Store the hitbox width and height here. Final position will be updated in `draw`\n hitboxes[i] = {\n left: 0,\n top: 0,\n width: itemWidth,\n height: fontSize\n };\n });\n\n totalWidth += currentColWidth;\n columnWidths.push(currentColWidth);\n minSize.width += totalWidth;\n }\n }\n\n me.width = minSize.width;\n me.height = minSize.height;\n },\n afterFit: noop,\n\n // Shared Methods\n isHorizontal: function() {\n return this.options.position === 'top' || this.options.position === 'bottom';\n },\n\n // Actually draw the legend on the canvas\n draw: function() {\n var me = this;\n var opts = me.options;\n var labelOpts = opts.labels;\n var globalDefault = defaults.global;\n var lineDefault = globalDefault.elements.line;\n var legendWidth = me.width;\n var lineWidths = me.lineWidths;\n\n if (opts.display) {\n var ctx = me.ctx;\n var valueOrDefault = helpers.valueOrDefault;\n var fontColor = valueOrDefault(labelOpts.fontColor, globalDefault.defaultFontColor);\n var fontSize = valueOrDefault(labelOpts.fontSize, globalDefault.defaultFontSize);\n var fontStyle = valueOrDefault(labelOpts.fontStyle, globalDefault.defaultFontStyle);\n var fontFamily = valueOrDefault(labelOpts.fontFamily, globalDefault.defaultFontFamily);\n var labelFont = helpers.fontString(fontSize, fontStyle, fontFamily);\n var cursor;\n\n // Canvas setup\n ctx.textAlign = 'left';\n ctx.textBaseline = 'middle';\n ctx.lineWidth = 0.5;\n ctx.strokeStyle = fontColor; // for strikethrough effect\n ctx.fillStyle = fontColor; // render in correct colour\n ctx.font = labelFont;\n\n var boxWidth = getBoxWidth(labelOpts, fontSize);\n var hitboxes = me.legendHitBoxes;\n\n // current position\n var drawLegendBox = function(x, y, legendItem) {\n if (isNaN(boxWidth) || boxWidth <= 0) {\n return;\n }\n\n // Set the ctx for the box\n ctx.save();\n\n ctx.fillStyle = valueOrDefault(legendItem.fillStyle, globalDefault.defaultColor);\n ctx.lineCap = valueOrDefault(legendItem.lineCap, lineDefault.borderCapStyle);\n ctx.lineDashOffset = valueOrDefault(legendItem.lineDashOffset, lineDefault.borderDashOffset);\n ctx.lineJoin = valueOrDefault(legendItem.lineJoin, lineDefault.borderJoinStyle);\n ctx.lineWidth = valueOrDefault(legendItem.lineWidth, lineDefault.borderWidth);\n ctx.strokeStyle = valueOrDefault(legendItem.strokeStyle, globalDefault.defaultColor);\n var isLineWidthZero = (valueOrDefault(legendItem.lineWidth, lineDefault.borderWidth) === 0);\n\n if (ctx.setLineDash) {\n // IE 9 and 10 do not support line dash\n ctx.setLineDash(valueOrDefault(legendItem.lineDash, lineDefault.borderDash));\n }\n\n if (opts.labels && opts.labels.usePointStyle) {\n // Recalculate x and y for drawPoint() because its expecting\n // x and y to be center of figure (instead of top left)\n var radius = fontSize * Math.SQRT2 / 2;\n var offSet = radius / Math.SQRT2;\n var centerX = x + offSet;\n var centerY = y + offSet;\n\n // Draw pointStyle as legend symbol\n helpers.canvas.drawPoint(ctx, legendItem.pointStyle, radius, centerX, centerY);\n } else {\n // Draw box as legend symbol\n if (!isLineWidthZero) {\n ctx.strokeRect(x, y, boxWidth, fontSize);\n }\n ctx.fillRect(x, y, boxWidth, fontSize);\n }\n\n ctx.restore();\n };\n var fillText = function(x, y, legendItem, textWidth) {\n var halfFontSize = fontSize / 2;\n var xLeft = boxWidth + halfFontSize + x;\n var yMiddle = y + halfFontSize;\n\n ctx.fillText(legendItem.text, xLeft, yMiddle);\n\n if (legendItem.hidden) {\n // Strikethrough the text if hidden\n ctx.beginPath();\n ctx.lineWidth = 2;\n ctx.moveTo(xLeft, yMiddle);\n ctx.lineTo(xLeft + textWidth, yMiddle);\n ctx.stroke();\n }\n };\n\n // Horizontal\n var isHorizontal = me.isHorizontal();\n if (isHorizontal) {\n cursor = {\n x: me.left + ((legendWidth - lineWidths[0]) / 2),\n y: me.top + labelOpts.padding,\n line: 0\n };\n } else {\n cursor = {\n x: me.left + labelOpts.padding,\n y: me.top + labelOpts.padding,\n line: 0\n };\n }\n\n var itemHeight = fontSize + labelOpts.padding;\n helpers.each(me.legendItems, function(legendItem, i) {\n var textWidth = ctx.measureText(legendItem.text).width;\n var width = boxWidth + (fontSize / 2) + textWidth;\n var x = cursor.x;\n var y = cursor.y;\n\n if (isHorizontal) {\n if (x + width >= legendWidth) {\n y = cursor.y += itemHeight;\n cursor.line++;\n x = cursor.x = me.left + ((legendWidth - lineWidths[cursor.line]) / 2);\n }\n } else if (y + itemHeight > me.bottom) {\n x = cursor.x = x + me.columnWidths[cursor.line] + labelOpts.padding;\n y = cursor.y = me.top + labelOpts.padding;\n cursor.line++;\n }\n\n drawLegendBox(x, y, legendItem);\n\n hitboxes[i].left = x;\n hitboxes[i].top = y;\n\n // Fill the actual label\n fillText(x, y, legendItem, textWidth);\n\n if (isHorizontal) {\n cursor.x += width + (labelOpts.padding);\n } else {\n cursor.y += itemHeight;\n }\n\n });\n }\n },\n\n /**\n * Handle an event\n * @private\n * @param {IEvent} event - The event to handle\n * @return {Boolean} true if a change occured\n */\n handleEvent: function(e) {\n var me = this;\n var opts = me.options;\n var type = e.type === 'mouseup' ? 'click' : e.type;\n var changed = false;\n\n if (type === 'mousemove') {\n if (!opts.onHover) {\n return;\n }\n } else if (type === 'click') {\n if (!opts.onClick) {\n return;\n }\n } else {\n return;\n }\n\n // Chart event already has relative position in it\n var x = e.x;\n var y = e.y;\n\n if (x >= me.left && x <= me.right && y >= me.top && y <= me.bottom) {\n // See if we are touching one of the dataset boxes\n var lh = me.legendHitBoxes;\n for (var i = 0; i < lh.length; ++i) {\n var hitBox = lh[i];\n\n if (x >= hitBox.left && x <= hitBox.left + hitBox.width && y >= hitBox.top && y <= hitBox.top + hitBox.height) {\n // Touching an element\n if (type === 'click') {\n // use e.native for backwards compatibility\n opts.onClick.call(me, e.native, me.legendItems[i]);\n changed = true;\n break;\n } else if (type === 'mousemove') {\n // use e.native for backwards compatibility\n opts.onHover.call(me, e.native, me.legendItems[i]);\n changed = true;\n break;\n }\n }\n }\n }\n\n return changed;\n }\n });\n\n function createNewLegendAndAttach(chart, legendOpts) {\n var legend = new Chart.Legend({\n ctx: chart.ctx,\n options: legendOpts,\n chart: chart\n });\n\n layout.configure(chart, legend, legendOpts);\n layout.addBox(chart, legend);\n chart.legend = legend;\n }\n\n return {\n id: 'legend',\n\n beforeInit: function(chart) {\n var legendOpts = chart.options.legend;\n\n if (legendOpts) {\n createNewLegendAndAttach(chart, legendOpts);\n }\n },\n\n beforeUpdate: function(chart) {\n var legendOpts = chart.options.legend;\n var legend = chart.legend;\n\n if (legendOpts) {\n helpers.mergeIf(legendOpts, defaults.global.legend);\n\n if (legend) {\n layout.configure(chart, legend, legendOpts);\n legend.options = legendOpts;\n } else {\n createNewLegendAndAttach(chart, legendOpts);\n }\n } else if (legend) {\n layout.removeBox(chart, legend);\n delete chart.legend;\n }\n },\n\n afterEvent: function(chart, e) {\n var legend = chart.legend;\n if (legend) {\n legend.handleEvent(e);\n }\n }\n };\n };\n\n},{\"25\":25,\"26\":26,\"45\":45}],51:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var Element = require(26);\n var helpers = require(45);\n\n defaults._set('global', {\n title: {\n display: false,\n fontStyle: 'bold',\n fullWidth: true,\n lineHeight: 1.2,\n padding: 10,\n position: 'top',\n text: '',\n weight: 2000 // by default greater than legend (1000) to be above\n }\n });\n\n module.exports = function(Chart) {\n\n var layout = Chart.layoutService;\n var noop = helpers.noop;\n\n Chart.Title = Element.extend({\n initialize: function(config) {\n var me = this;\n helpers.extend(me, config);\n\n // Contains hit boxes for each dataset (in dataset order)\n me.legendHitBoxes = [];\n },\n\n // These methods are ordered by lifecycle. Utilities then follow.\n\n beforeUpdate: noop,\n update: function(maxWidth, maxHeight, margins) {\n var me = this;\n\n // Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)\n me.beforeUpdate();\n\n // Absorb the master measurements\n me.maxWidth = maxWidth;\n me.maxHeight = maxHeight;\n me.margins = margins;\n\n // Dimensions\n me.beforeSetDimensions();\n me.setDimensions();\n me.afterSetDimensions();\n // Labels\n me.beforeBuildLabels();\n me.buildLabels();\n me.afterBuildLabels();\n\n // Fit\n me.beforeFit();\n me.fit();\n me.afterFit();\n //\n me.afterUpdate();\n\n return me.minSize;\n\n },\n afterUpdate: noop,\n\n //\n\n beforeSetDimensions: noop,\n setDimensions: function() {\n var me = this;\n // Set the unconstrained dimension before label rotation\n if (me.isHorizontal()) {\n // Reset position before calculating rotation\n me.width = me.maxWidth;\n me.left = 0;\n me.right = me.width;\n } else {\n me.height = me.maxHeight;\n\n // Reset position before calculating rotation\n me.top = 0;\n me.bottom = me.height;\n }\n\n // Reset padding\n me.paddingLeft = 0;\n me.paddingTop = 0;\n me.paddingRight = 0;\n me.paddingBottom = 0;\n\n // Reset minSize\n me.minSize = {\n width: 0,\n height: 0\n };\n },\n afterSetDimensions: noop,\n\n //\n\n beforeBuildLabels: noop,\n buildLabels: noop,\n afterBuildLabels: noop,\n\n //\n\n beforeFit: noop,\n fit: function() {\n var me = this;\n var valueOrDefault = helpers.valueOrDefault;\n var opts = me.options;\n var display = opts.display;\n var fontSize = valueOrDefault(opts.fontSize, defaults.global.defaultFontSize);\n var minSize = me.minSize;\n var lineCount = helpers.isArray(opts.text) ? opts.text.length : 1;\n var lineHeight = helpers.options.toLineHeight(opts.lineHeight, fontSize);\n var textSize = display ? (lineCount * lineHeight) + (opts.padding * 2) : 0;\n\n if (me.isHorizontal()) {\n minSize.width = me.maxWidth; // fill all the width\n minSize.height = textSize;\n } else {\n minSize.width = textSize;\n minSize.height = me.maxHeight; // fill all the height\n }\n\n me.width = minSize.width;\n me.height = minSize.height;\n\n },\n afterFit: noop,\n\n // Shared Methods\n isHorizontal: function() {\n var pos = this.options.position;\n return pos === 'top' || pos === 'bottom';\n },\n\n // Actually draw the title block on the canvas\n draw: function() {\n var me = this;\n var ctx = me.ctx;\n var valueOrDefault = helpers.valueOrDefault;\n var opts = me.options;\n var globalDefaults = defaults.global;\n\n if (opts.display) {\n var fontSize = valueOrDefault(opts.fontSize, globalDefaults.defaultFontSize);\n var fontStyle = valueOrDefault(opts.fontStyle, globalDefaults.defaultFontStyle);\n var fontFamily = valueOrDefault(opts.fontFamily, globalDefaults.defaultFontFamily);\n var titleFont = helpers.fontString(fontSize, fontStyle, fontFamily);\n var lineHeight = helpers.options.toLineHeight(opts.lineHeight, fontSize);\n var offset = lineHeight / 2 + opts.padding;\n var rotation = 0;\n var top = me.top;\n var left = me.left;\n var bottom = me.bottom;\n var right = me.right;\n var maxWidth, titleX, titleY;\n\n ctx.fillStyle = valueOrDefault(opts.fontColor, globalDefaults.defaultFontColor); // render in correct colour\n ctx.font = titleFont;\n\n // Horizontal\n if (me.isHorizontal()) {\n titleX = left + ((right - left) / 2); // midpoint of the width\n titleY = top + offset;\n maxWidth = right - left;\n } else {\n titleX = opts.position === 'left' ? left + offset : right - offset;\n titleY = top + ((bottom - top) / 2);\n maxWidth = bottom - top;\n rotation = Math.PI * (opts.position === 'left' ? -0.5 : 0.5);\n }\n\n ctx.save();\n ctx.translate(titleX, titleY);\n ctx.rotate(rotation);\n ctx.textAlign = 'center';\n ctx.textBaseline = 'middle';\n\n var text = opts.text;\n if (helpers.isArray(text)) {\n var y = 0;\n for (var i = 0; i < text.length; ++i) {\n ctx.fillText(text[i], 0, y, maxWidth);\n y += lineHeight;\n }\n } else {\n ctx.fillText(text, 0, 0, maxWidth);\n }\n\n ctx.restore();\n }\n }\n });\n\n function createNewTitleBlockAndAttach(chart, titleOpts) {\n var title = new Chart.Title({\n ctx: chart.ctx,\n options: titleOpts,\n chart: chart\n });\n\n layout.configure(chart, title, titleOpts);\n layout.addBox(chart, title);\n chart.titleBlock = title;\n }\n\n return {\n id: 'title',\n\n beforeInit: function(chart) {\n var titleOpts = chart.options.title;\n\n if (titleOpts) {\n createNewTitleBlockAndAttach(chart, titleOpts);\n }\n },\n\n beforeUpdate: function(chart) {\n var titleOpts = chart.options.title;\n var titleBlock = chart.titleBlock;\n\n if (titleOpts) {\n helpers.mergeIf(titleOpts, defaults.global.title);\n\n if (titleBlock) {\n layout.configure(chart, titleBlock, titleOpts);\n titleBlock.options = titleOpts;\n } else {\n createNewTitleBlockAndAttach(chart, titleOpts);\n }\n } else if (titleBlock) {\n Chart.layoutService.removeBox(chart, titleBlock);\n delete chart.titleBlock;\n }\n }\n };\n };\n\n},{\"25\":25,\"26\":26,\"45\":45}],52:[function(require,module,exports){\n 'use strict';\n\n module.exports = function(Chart) {\n\n // Default config for a category scale\n var defaultConfig = {\n position: 'bottom'\n };\n\n var DatasetScale = Chart.Scale.extend({\n /**\n * Internal function to get the correct labels. If data.xLabels or data.yLabels are defined, use those\n * else fall back to data.labels\n * @private\n */\n getLabels: function() {\n var data = this.chart.data;\n return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels;\n },\n\n determineDataLimits: function() {\n var me = this;\n var labels = me.getLabels();\n me.minIndex = 0;\n me.maxIndex = labels.length - 1;\n var findIndex;\n\n if (me.options.ticks.min !== undefined) {\n // user specified min value\n findIndex = labels.indexOf(me.options.ticks.min);\n me.minIndex = findIndex !== -1 ? findIndex : me.minIndex;\n }\n\n if (me.options.ticks.max !== undefined) {\n // user specified max value\n findIndex = labels.indexOf(me.options.ticks.max);\n me.maxIndex = findIndex !== -1 ? findIndex : me.maxIndex;\n }\n\n me.min = labels[me.minIndex];\n me.max = labels[me.maxIndex];\n },\n\n buildTicks: function() {\n var me = this;\n var labels = me.getLabels();\n // If we are viewing some subset of labels, slice the original array\n me.ticks = (me.minIndex === 0 && me.maxIndex === labels.length - 1) ? labels : labels.slice(me.minIndex, me.maxIndex + 1);\n },\n\n getLabelForIndex: function(index, datasetIndex) {\n var me = this;\n var data = me.chart.data;\n var isHorizontal = me.isHorizontal();\n\n if (data.yLabels && !isHorizontal) {\n return me.getRightValue(data.datasets[datasetIndex].data[index]);\n }\n return me.ticks[index - me.minIndex];\n },\n\n // Used to get data value locations. Value can either be an index or a numerical value\n getPixelForValue: function(value, index) {\n var me = this;\n var offset = me.options.offset;\n // 1 is added because we need the length but we have the indexes\n var offsetAmt = Math.max((me.maxIndex + 1 - me.minIndex - (offset ? 0 : 1)), 1);\n\n // If value is a data object, then index is the index in the data array,\n // not the index of the scale. We need to change that.\n var valueCategory;\n if (value !== undefined && value !== null) {\n valueCategory = me.isHorizontal() ? value.x : value.y;\n }\n if (valueCategory !== undefined || (value !== undefined && isNaN(index))) {\n var labels = me.getLabels();\n value = valueCategory || value;\n var idx = labels.indexOf(value);\n index = idx !== -1 ? idx : index;\n }\n\n if (me.isHorizontal()) {\n var valueWidth = me.width / offsetAmt;\n var widthOffset = (valueWidth * (index - me.minIndex));\n\n if (offset) {\n widthOffset += (valueWidth / 2);\n }\n\n return me.left + Math.round(widthOffset);\n }\n var valueHeight = me.height / offsetAmt;\n var heightOffset = (valueHeight * (index - me.minIndex));\n\n if (offset) {\n heightOffset += (valueHeight / 2);\n }\n\n return me.top + Math.round(heightOffset);\n },\n getPixelForTick: function(index) {\n return this.getPixelForValue(this.ticks[index], index + this.minIndex, null);\n },\n getValueForPixel: function(pixel) {\n var me = this;\n var offset = me.options.offset;\n var value;\n var offsetAmt = Math.max((me._ticks.length - (offset ? 0 : 1)), 1);\n var horz = me.isHorizontal();\n var valueDimension = (horz ? me.width : me.height) / offsetAmt;\n\n pixel -= horz ? me.left : me.top;\n\n if (offset) {\n pixel -= (valueDimension / 2);\n }\n\n if (pixel <= 0) {\n value = 0;\n } else {\n value = Math.round(pixel / valueDimension);\n }\n\n return value + me.minIndex;\n },\n getBasePixel: function() {\n return this.bottom;\n }\n });\n\n Chart.scaleService.registerScaleType('category', DatasetScale, defaultConfig);\n\n };\n\n},{}],53:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var helpers = require(45);\n var Ticks = require(34);\n\n module.exports = function(Chart) {\n\n var defaultConfig = {\n position: 'left',\n ticks: {\n callback: Ticks.formatters.linear\n }\n };\n\n var LinearScale = Chart.LinearScaleBase.extend({\n\n determineDataLimits: function() {\n var me = this;\n var opts = me.options;\n var chart = me.chart;\n var data = chart.data;\n var datasets = data.datasets;\n var isHorizontal = me.isHorizontal();\n var DEFAULT_MIN = 0;\n var DEFAULT_MAX = 1;\n\n function IDMatches(meta) {\n return isHorizontal ? meta.xAxisID === me.id : meta.yAxisID === me.id;\n }\n\n // First Calculate the range\n me.min = null;\n me.max = null;\n\n var hasStacks = opts.stacked;\n if (hasStacks === undefined) {\n helpers.each(datasets, function(dataset, datasetIndex) {\n if (hasStacks) {\n return;\n }\n\n var meta = chart.getDatasetMeta(datasetIndex);\n if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta) &&\n meta.stack !== undefined) {\n hasStacks = true;\n }\n });\n }\n\n if (opts.stacked || hasStacks) {\n var valuesPerStack = {};\n\n helpers.each(datasets, function(dataset, datasetIndex) {\n var meta = chart.getDatasetMeta(datasetIndex);\n var key = [\n meta.type,\n // we have a separate stack for stack=undefined datasets when the opts.stacked is undefined\n ((opts.stacked === undefined && meta.stack === undefined) ? datasetIndex : ''),\n meta.stack\n ].join('.');\n\n if (valuesPerStack[key] === undefined) {\n valuesPerStack[key] = {\n positiveValues: [],\n negativeValues: []\n };\n }\n\n // Store these per type\n var positiveValues = valuesPerStack[key].positiveValues;\n var negativeValues = valuesPerStack[key].negativeValues;\n\n if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {\n helpers.each(dataset.data, function(rawValue, index) {\n var value = +me.getRightValue(rawValue);\n if (isNaN(value) || meta.data[index].hidden) {\n return;\n }\n\n positiveValues[index] = positiveValues[index] || 0;\n negativeValues[index] = negativeValues[index] || 0;\n\n if (opts.relativePoints) {\n positiveValues[index] = 100;\n } else if (value < 0) {\n negativeValues[index] += value;\n } else {\n positiveValues[index] += value;\n }\n });\n }\n });\n\n helpers.each(valuesPerStack, function(valuesForType) {\n var values = valuesForType.positiveValues.concat(valuesForType.negativeValues);\n var minVal = helpers.min(values);\n var maxVal = helpers.max(values);\n me.min = me.min === null ? minVal : Math.min(me.min, minVal);\n me.max = me.max === null ? maxVal : Math.max(me.max, maxVal);\n });\n\n } else {\n helpers.each(datasets, function(dataset, datasetIndex) {\n var meta = chart.getDatasetMeta(datasetIndex);\n if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {\n helpers.each(dataset.data, function(rawValue, index) {\n var value = +me.getRightValue(rawValue);\n if (isNaN(value) || meta.data[index].hidden) {\n return;\n }\n\n if (me.min === null) {\n me.min = value;\n } else if (value < me.min) {\n me.min = value;\n }\n\n if (me.max === null) {\n me.max = value;\n } else if (value > me.max) {\n me.max = value;\n }\n });\n }\n });\n }\n\n me.min = isFinite(me.min) && !isNaN(me.min) ? me.min : DEFAULT_MIN;\n me.max = isFinite(me.max) && !isNaN(me.max) ? me.max : DEFAULT_MAX;\n\n // Common base implementation to handle ticks.min, ticks.max, ticks.beginAtZero\n this.handleTickRangeOptions();\n },\n getTickLimit: function() {\n var maxTicks;\n var me = this;\n var tickOpts = me.options.ticks;\n\n if (me.isHorizontal()) {\n maxTicks = Math.min(tickOpts.maxTicksLimit ? tickOpts.maxTicksLimit : 11, Math.ceil(me.width / 50));\n } else {\n // The factor of 2 used to scale the font size has been experimentally determined.\n var tickFontSize = helpers.valueOrDefault(tickOpts.fontSize, defaults.global.defaultFontSize);\n maxTicks = Math.min(tickOpts.maxTicksLimit ? tickOpts.maxTicksLimit : 11, Math.ceil(me.height / (2 * tickFontSize)));\n }\n\n return maxTicks;\n },\n // Called after the ticks are built. We need\n handleDirectionalChanges: function() {\n if (!this.isHorizontal()) {\n // We are in a vertical orientation. The top value is the highest. So reverse the array\n this.ticks.reverse();\n }\n },\n getLabelForIndex: function(index, datasetIndex) {\n return +this.getRightValue(this.chart.data.datasets[datasetIndex].data[index]);\n },\n // Utils\n getPixelForValue: function(value) {\n // This must be called after fit has been run so that\n // this.left, this.top, this.right, and this.bottom have been defined\n var me = this;\n var start = me.start;\n\n var rightValue = +me.getRightValue(value);\n var pixel;\n var range = me.end - start;\n\n if (me.isHorizontal()) {\n pixel = me.left + (me.width / range * (rightValue - start));\n return Math.round(pixel);\n }\n\n pixel = me.bottom - (me.height / range * (rightValue - start));\n return Math.round(pixel);\n },\n getValueForPixel: function(pixel) {\n var me = this;\n var isHorizontal = me.isHorizontal();\n var innerDimension = isHorizontal ? me.width : me.height;\n var offset = (isHorizontal ? pixel - me.left : me.bottom - pixel) / innerDimension;\n return me.start + ((me.end - me.start) * offset);\n },\n getPixelForTick: function(index) {\n return this.getPixelForValue(this.ticksAsNumbers[index]);\n }\n });\n Chart.scaleService.registerScaleType('linear', LinearScale, defaultConfig);\n\n };\n\n},{\"25\":25,\"34\":34,\"45\":45}],54:[function(require,module,exports){\n 'use strict';\n\n var helpers = require(45);\n var Ticks = require(34);\n\n module.exports = function(Chart) {\n\n var noop = helpers.noop;\n\n Chart.LinearScaleBase = Chart.Scale.extend({\n getRightValue: function(value) {\n if (typeof value === 'string') {\n return +value;\n }\n return Chart.Scale.prototype.getRightValue.call(this, value);\n },\n\n handleTickRangeOptions: function() {\n var me = this;\n var opts = me.options;\n var tickOpts = opts.ticks;\n\n // If we are forcing it to begin at 0, but 0 will already be rendered on the chart,\n // do nothing since that would make the chart weird. If the user really wants a weird chart\n // axis, they can manually override it\n if (tickOpts.beginAtZero) {\n var minSign = helpers.sign(me.min);\n var maxSign = helpers.sign(me.max);\n\n if (minSign < 0 && maxSign < 0) {\n // move the top up to 0\n me.max = 0;\n } else if (minSign > 0 && maxSign > 0) {\n // move the bottom down to 0\n me.min = 0;\n }\n }\n\n var setMin = tickOpts.min !== undefined || tickOpts.suggestedMin !== undefined;\n var setMax = tickOpts.max !== undefined || tickOpts.suggestedMax !== undefined;\n\n if (tickOpts.min !== undefined) {\n me.min = tickOpts.min;\n } else if (tickOpts.suggestedMin !== undefined) {\n if (me.min === null) {\n me.min = tickOpts.suggestedMin;\n } else {\n me.min = Math.min(me.min, tickOpts.suggestedMin);\n }\n }\n\n if (tickOpts.max !== undefined) {\n me.max = tickOpts.max;\n } else if (tickOpts.suggestedMax !== undefined) {\n if (me.max === null) {\n me.max = tickOpts.suggestedMax;\n } else {\n me.max = Math.max(me.max, tickOpts.suggestedMax);\n }\n }\n\n if (setMin !== setMax) {\n // We set the min or the max but not both.\n // So ensure that our range is good\n // Inverted or 0 length range can happen when\n // ticks.min is set, and no datasets are visible\n if (me.min >= me.max) {\n if (setMin) {\n me.max = me.min + 1;\n } else {\n me.min = me.max - 1;\n }\n }\n }\n\n if (me.min === me.max) {\n me.max++;\n\n if (!tickOpts.beginAtZero) {\n me.min--;\n }\n }\n },\n getTickLimit: noop,\n handleDirectionalChanges: noop,\n\n buildTicks: function() {\n var me = this;\n var opts = me.options;\n var tickOpts = opts.ticks;\n\n // Figure out what the max number of ticks we can support it is based on the size of\n // the axis area. For now, we say that the minimum tick spacing in pixels must be 50\n // We also limit the maximum number of ticks to 11 which gives a nice 10 squares on\n // the graph. Make sure we always have at least 2 ticks\n var maxTicks = me.getTickLimit();\n maxTicks = Math.max(2, maxTicks);\n\n var numericGeneratorOptions = {\n maxTicks: maxTicks,\n min: tickOpts.min,\n max: tickOpts.max,\n stepSize: helpers.valueOrDefault(tickOpts.fixedStepSize, tickOpts.stepSize)\n };\n var ticks = me.ticks = Ticks.generators.linear(numericGeneratorOptions, me);\n\n me.handleDirectionalChanges();\n\n // At this point, we need to update our max and min given the tick values since we have expanded the\n // range of the scale\n me.max = helpers.max(ticks);\n me.min = helpers.min(ticks);\n\n if (tickOpts.reverse) {\n ticks.reverse();\n\n me.start = me.max;\n me.end = me.min;\n } else {\n me.start = me.min;\n me.end = me.max;\n }\n },\n convertTicksToLabels: function() {\n var me = this;\n me.ticksAsNumbers = me.ticks.slice();\n me.zeroLineIndex = me.ticks.indexOf(0);\n\n Chart.Scale.prototype.convertTicksToLabels.call(me);\n }\n });\n };\n\n},{\"34\":34,\"45\":45}],55:[function(require,module,exports){\n 'use strict';\n\n var helpers = require(45);\n var Ticks = require(34);\n\n module.exports = function(Chart) {\n\n var defaultConfig = {\n position: 'left',\n\n // label settings\n ticks: {\n callback: Ticks.formatters.logarithmic\n }\n };\n\n var LogarithmicScale = Chart.Scale.extend({\n determineDataLimits: function() {\n var me = this;\n var opts = me.options;\n var tickOpts = opts.ticks;\n var chart = me.chart;\n var data = chart.data;\n var datasets = data.datasets;\n var valueOrDefault = helpers.valueOrDefault;\n var isHorizontal = me.isHorizontal();\n function IDMatches(meta) {\n return isHorizontal ? meta.xAxisID === me.id : meta.yAxisID === me.id;\n }\n\n // Calculate Range\n me.min = null;\n me.max = null;\n me.minNotZero = null;\n\n var hasStacks = opts.stacked;\n if (hasStacks === undefined) {\n helpers.each(datasets, function(dataset, datasetIndex) {\n if (hasStacks) {\n return;\n }\n\n var meta = chart.getDatasetMeta(datasetIndex);\n if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta) &&\n meta.stack !== undefined) {\n hasStacks = true;\n }\n });\n }\n\n if (opts.stacked || hasStacks) {\n var valuesPerStack = {};\n\n helpers.each(datasets, function(dataset, datasetIndex) {\n var meta = chart.getDatasetMeta(datasetIndex);\n var key = [\n meta.type,\n // we have a separate stack for stack=undefined datasets when the opts.stacked is undefined\n ((opts.stacked === undefined && meta.stack === undefined) ? datasetIndex : ''),\n meta.stack\n ].join('.');\n\n if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {\n if (valuesPerStack[key] === undefined) {\n valuesPerStack[key] = [];\n }\n\n helpers.each(dataset.data, function(rawValue, index) {\n var values = valuesPerStack[key];\n var value = +me.getRightValue(rawValue);\n if (isNaN(value) || meta.data[index].hidden) {\n return;\n }\n\n values[index] = values[index] || 0;\n\n if (opts.relativePoints) {\n values[index] = 100;\n } else {\n // Don't need to split positive and negative since the log scale can't handle a 0 crossing\n values[index] += value;\n }\n });\n }\n });\n\n helpers.each(valuesPerStack, function(valuesForType) {\n var minVal = helpers.min(valuesForType);\n var maxVal = helpers.max(valuesForType);\n me.min = me.min === null ? minVal : Math.min(me.min, minVal);\n me.max = me.max === null ? maxVal : Math.max(me.max, maxVal);\n });\n\n } else {\n helpers.each(datasets, function(dataset, datasetIndex) {\n var meta = chart.getDatasetMeta(datasetIndex);\n if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {\n helpers.each(dataset.data, function(rawValue, index) {\n var value = +me.getRightValue(rawValue);\n if (isNaN(value) || meta.data[index].hidden) {\n return;\n }\n\n if (me.min === null) {\n me.min = value;\n } else if (value < me.min) {\n me.min = value;\n }\n\n if (me.max === null) {\n me.max = value;\n } else if (value > me.max) {\n me.max = value;\n }\n\n if (value !== 0 && (me.minNotZero === null || value < me.minNotZero)) {\n me.minNotZero = value;\n }\n });\n }\n });\n }\n\n me.min = valueOrDefault(tickOpts.min, me.min);\n me.max = valueOrDefault(tickOpts.max, me.max);\n\n if (me.min === me.max) {\n if (me.min !== 0 && me.min !== null) {\n me.min = Math.pow(10, Math.floor(helpers.log10(me.min)) - 1);\n me.max = Math.pow(10, Math.floor(helpers.log10(me.max)) + 1);\n } else {\n me.min = 1;\n me.max = 10;\n }\n }\n },\n buildTicks: function() {\n var me = this;\n var opts = me.options;\n var tickOpts = opts.ticks;\n\n var generationOptions = {\n min: tickOpts.min,\n max: tickOpts.max\n };\n var ticks = me.ticks = Ticks.generators.logarithmic(generationOptions, me);\n\n if (!me.isHorizontal()) {\n // We are in a vertical orientation. The top value is the highest. So reverse the array\n ticks.reverse();\n }\n\n // At this point, we need to update our max and min given the tick values since we have expanded the\n // range of the scale\n me.max = helpers.max(ticks);\n me.min = helpers.min(ticks);\n\n if (tickOpts.reverse) {\n ticks.reverse();\n\n me.start = me.max;\n me.end = me.min;\n } else {\n me.start = me.min;\n me.end = me.max;\n }\n },\n convertTicksToLabels: function() {\n this.tickValues = this.ticks.slice();\n\n Chart.Scale.prototype.convertTicksToLabels.call(this);\n },\n // Get the correct tooltip label\n getLabelForIndex: function(index, datasetIndex) {\n return +this.getRightValue(this.chart.data.datasets[datasetIndex].data[index]);\n },\n getPixelForTick: function(index) {\n return this.getPixelForValue(this.tickValues[index]);\n },\n getPixelForValue: function(value) {\n var me = this;\n var start = me.start;\n var newVal = +me.getRightValue(value);\n var opts = me.options;\n var tickOpts = opts.ticks;\n var innerDimension, pixel, range;\n\n if (me.isHorizontal()) {\n range = helpers.log10(me.end) - helpers.log10(start); // todo: if start === 0\n if (newVal === 0) {\n pixel = me.left;\n } else {\n innerDimension = me.width;\n pixel = me.left + (innerDimension / range * (helpers.log10(newVal) - helpers.log10(start)));\n }\n } else {\n // Bottom - top since pixels increase downward on a screen\n innerDimension = me.height;\n if (start === 0 && !tickOpts.reverse) {\n range = helpers.log10(me.end) - helpers.log10(me.minNotZero);\n if (newVal === start) {\n pixel = me.bottom;\n } else if (newVal === me.minNotZero) {\n pixel = me.bottom - innerDimension * 0.02;\n } else {\n pixel = me.bottom - innerDimension * 0.02 - (innerDimension * 0.98 / range * (helpers.log10(newVal) - helpers.log10(me.minNotZero)));\n }\n } else if (me.end === 0 && tickOpts.reverse) {\n range = helpers.log10(me.start) - helpers.log10(me.minNotZero);\n if (newVal === me.end) {\n pixel = me.top;\n } else if (newVal === me.minNotZero) {\n pixel = me.top + innerDimension * 0.02;\n } else {\n pixel = me.top + innerDimension * 0.02 + (innerDimension * 0.98 / range * (helpers.log10(newVal) - helpers.log10(me.minNotZero)));\n }\n } else if (newVal === 0) {\n pixel = tickOpts.reverse ? me.top : me.bottom;\n } else {\n range = helpers.log10(me.end) - helpers.log10(start);\n innerDimension = me.height;\n pixel = me.bottom - (innerDimension / range * (helpers.log10(newVal) - helpers.log10(start)));\n }\n }\n return pixel;\n },\n getValueForPixel: function(pixel) {\n var me = this;\n var range = helpers.log10(me.end) - helpers.log10(me.start);\n var value, innerDimension;\n\n if (me.isHorizontal()) {\n innerDimension = me.width;\n value = me.start * Math.pow(10, (pixel - me.left) * range / innerDimension);\n } else { // todo: if start === 0\n innerDimension = me.height;\n value = Math.pow(10, (me.bottom - pixel) * range / innerDimension) / me.start;\n }\n return value;\n }\n });\n Chart.scaleService.registerScaleType('logarithmic', LogarithmicScale, defaultConfig);\n\n };\n\n},{\"34\":34,\"45\":45}],56:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var helpers = require(45);\n var Ticks = require(34);\n\n module.exports = function(Chart) {\n\n var globalDefaults = defaults.global;\n\n var defaultConfig = {\n display: true,\n\n // Boolean - Whether to animate scaling the chart from the centre\n animate: true,\n position: 'chartArea',\n\n angleLines: {\n display: true,\n color: 'rgba(0, 0, 0, 0.1)',\n lineWidth: 1\n },\n\n gridLines: {\n circular: false\n },\n\n // label settings\n ticks: {\n // Boolean - Show a backdrop to the scale label\n showLabelBackdrop: true,\n\n // String - The colour of the label backdrop\n backdropColor: 'rgba(255,255,255,0.75)',\n\n // Number - The backdrop padding above & below the label in pixels\n backdropPaddingY: 2,\n\n // Number - The backdrop padding to the side of the label in pixels\n backdropPaddingX: 2,\n\n callback: Ticks.formatters.linear\n },\n\n pointLabels: {\n // Boolean - if true, show point labels\n display: true,\n\n // Number - Point label font size in pixels\n fontSize: 10,\n\n // Function - Used to convert point labels\n callback: function(label) {\n return label;\n }\n }\n };\n\n function getValueCount(scale) {\n var opts = scale.options;\n return opts.angleLines.display || opts.pointLabels.display ? scale.chart.data.labels.length : 0;\n }\n\n function getPointLabelFontOptions(scale) {\n var pointLabelOptions = scale.options.pointLabels;\n var fontSize = helpers.valueOrDefault(pointLabelOptions.fontSize, globalDefaults.defaultFontSize);\n var fontStyle = helpers.valueOrDefault(pointLabelOptions.fontStyle, globalDefaults.defaultFontStyle);\n var fontFamily = helpers.valueOrDefault(pointLabelOptions.fontFamily, globalDefaults.defaultFontFamily);\n var font = helpers.fontString(fontSize, fontStyle, fontFamily);\n\n return {\n size: fontSize,\n style: fontStyle,\n family: fontFamily,\n font: font\n };\n }\n\n function measureLabelSize(ctx, fontSize, label) {\n if (helpers.isArray(label)) {\n return {\n w: helpers.longestText(ctx, ctx.font, label),\n h: (label.length * fontSize) + ((label.length - 1) * 1.5 * fontSize)\n };\n }\n\n return {\n w: ctx.measureText(label).width,\n h: fontSize\n };\n }\n\n function determineLimits(angle, pos, size, min, max) {\n if (angle === min || angle === max) {\n return {\n start: pos - (size / 2),\n end: pos + (size / 2)\n };\n } else if (angle < min || angle > max) {\n return {\n start: pos - size - 5,\n end: pos\n };\n }\n\n return {\n start: pos,\n end: pos + size + 5\n };\n }\n\n /**\n * Helper function to fit a radial linear scale with point labels\n */\n function fitWithPointLabels(scale) {\n\t\t\t/*\n\t\t\t * Right, this is really confusing and there is a lot of maths going on here\n\t\t\t * The gist of the problem is here: https://gist.github.com/nnnick/696cc9c55f4b0beb8fe9\n\t\t\t *\n\t\t\t * Reaction: https://dl.dropboxusercontent.com/u/34601363/toomuchscience.gif\n\t\t\t *\n\t\t\t * Solution:\n\t\t\t *\n\t\t\t * We assume the radius of the polygon is half the size of the canvas at first\n\t\t\t * at each index we check if the text overlaps.\n\t\t\t *\n\t\t\t * Where it does, we store that angle and that index.\n\t\t\t *\n\t\t\t * After finding the largest index and angle we calculate how much we need to remove\n\t\t\t * from the shape radius to move the point inwards by that x.\n\t\t\t *\n\t\t\t * We average the left and right distances to get the maximum shape radius that can fit in the box\n\t\t\t * along with labels.\n\t\t\t *\n\t\t\t * Once we have that, we can find the centre point for the chart, by taking the x text protrusion\n\t\t\t * on each side, removing that from the size, halving it and adding the left x protrusion width.\n\t\t\t *\n\t\t\t * This will mean we have a shape fitted to the canvas, as large as it can be with the labels\n\t\t\t * and position it in the most space efficient manner\n\t\t\t *\n\t\t\t * https://dl.dropboxusercontent.com/u/34601363/yeahscience.gif\n\t\t\t */\n\n var plFont = getPointLabelFontOptions(scale);\n\n // Get maximum radius of the polygon. Either half the height (minus the text width) or half the width.\n // Use this to calculate the offset + change. - Make sure L/R protrusion is at least 0 to stop issues with centre points\n var largestPossibleRadius = Math.min(scale.height / 2, scale.width / 2);\n var furthestLimits = {\n r: scale.width,\n l: 0,\n t: scale.height,\n b: 0\n };\n var furthestAngles = {};\n var i, textSize, pointPosition;\n\n scale.ctx.font = plFont.font;\n scale._pointLabelSizes = [];\n\n var valueCount = getValueCount(scale);\n for (i = 0; i < valueCount; i++) {\n pointPosition = scale.getPointPosition(i, largestPossibleRadius);\n textSize = measureLabelSize(scale.ctx, plFont.size, scale.pointLabels[i] || '');\n scale._pointLabelSizes[i] = textSize;\n\n // Add quarter circle to make degree 0 mean top of circle\n var angleRadians = scale.getIndexAngle(i);\n var angle = helpers.toDegrees(angleRadians) % 360;\n var hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180);\n var vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270);\n\n if (hLimits.start < furthestLimits.l) {\n furthestLimits.l = hLimits.start;\n furthestAngles.l = angleRadians;\n }\n\n if (hLimits.end > furthestLimits.r) {\n furthestLimits.r = hLimits.end;\n furthestAngles.r = angleRadians;\n }\n\n if (vLimits.start < furthestLimits.t) {\n furthestLimits.t = vLimits.start;\n furthestAngles.t = angleRadians;\n }\n\n if (vLimits.end > furthestLimits.b) {\n furthestLimits.b = vLimits.end;\n furthestAngles.b = angleRadians;\n }\n }\n\n scale.setReductions(largestPossibleRadius, furthestLimits, furthestAngles);\n }\n\n /**\n * Helper function to fit a radial linear scale with no point labels\n */\n function fit(scale) {\n var largestPossibleRadius = Math.min(scale.height / 2, scale.width / 2);\n scale.drawingArea = Math.round(largestPossibleRadius);\n scale.setCenterPoint(0, 0, 0, 0);\n }\n\n function getTextAlignForAngle(angle) {\n if (angle === 0 || angle === 180) {\n return 'center';\n } else if (angle < 180) {\n return 'left';\n }\n\n return 'right';\n }\n\n function fillText(ctx, text, position, fontSize) {\n if (helpers.isArray(text)) {\n var y = position.y;\n var spacing = 1.5 * fontSize;\n\n for (var i = 0; i < text.length; ++i) {\n ctx.fillText(text[i], position.x, y);\n y += spacing;\n }\n } else {\n ctx.fillText(text, position.x, position.y);\n }\n }\n\n function adjustPointPositionForLabelHeight(angle, textSize, position) {\n if (angle === 90 || angle === 270) {\n position.y -= (textSize.h / 2);\n } else if (angle > 270 || angle < 90) {\n position.y -= textSize.h;\n }\n }\n\n function drawPointLabels(scale) {\n var ctx = scale.ctx;\n var valueOrDefault = helpers.valueOrDefault;\n var opts = scale.options;\n var angleLineOpts = opts.angleLines;\n var pointLabelOpts = opts.pointLabels;\n\n ctx.lineWidth = angleLineOpts.lineWidth;\n ctx.strokeStyle = angleLineOpts.color;\n\n var outerDistance = scale.getDistanceFromCenterForValue(opts.ticks.reverse ? scale.min : scale.max);\n\n // Point Label Font\n var plFont = getPointLabelFontOptions(scale);\n\n ctx.textBaseline = 'top';\n\n for (var i = getValueCount(scale) - 1; i >= 0; i--) {\n if (angleLineOpts.display) {\n var outerPosition = scale.getPointPosition(i, outerDistance);\n ctx.beginPath();\n ctx.moveTo(scale.xCenter, scale.yCenter);\n ctx.lineTo(outerPosition.x, outerPosition.y);\n ctx.stroke();\n ctx.closePath();\n }\n\n if (pointLabelOpts.display) {\n // Extra 3px out for some label spacing\n var pointLabelPosition = scale.getPointPosition(i, outerDistance + 5);\n\n // Keep this in loop since we may support array properties here\n var pointLabelFontColor = valueOrDefault(pointLabelOpts.fontColor, globalDefaults.defaultFontColor);\n ctx.font = plFont.font;\n ctx.fillStyle = pointLabelFontColor;\n\n var angleRadians = scale.getIndexAngle(i);\n var angle = helpers.toDegrees(angleRadians);\n ctx.textAlign = getTextAlignForAngle(angle);\n adjustPointPositionForLabelHeight(angle, scale._pointLabelSizes[i], pointLabelPosition);\n fillText(ctx, scale.pointLabels[i] || '', pointLabelPosition, plFont.size);\n }\n }\n }\n\n function drawRadiusLine(scale, gridLineOpts, radius, index) {\n var ctx = scale.ctx;\n ctx.strokeStyle = helpers.valueAtIndexOrDefault(gridLineOpts.color, index - 1);\n ctx.lineWidth = helpers.valueAtIndexOrDefault(gridLineOpts.lineWidth, index - 1);\n\n if (scale.options.gridLines.circular) {\n // Draw circular arcs between the points\n ctx.beginPath();\n ctx.arc(scale.xCenter, scale.yCenter, radius, 0, Math.PI * 2);\n ctx.closePath();\n ctx.stroke();\n } else {\n // Draw straight lines connecting each index\n var valueCount = getValueCount(scale);\n\n if (valueCount === 0) {\n return;\n }\n\n ctx.beginPath();\n var pointPosition = scale.getPointPosition(0, radius);\n ctx.moveTo(pointPosition.x, pointPosition.y);\n\n for (var i = 1; i < valueCount; i++) {\n pointPosition = scale.getPointPosition(i, radius);\n ctx.lineTo(pointPosition.x, pointPosition.y);\n }\n\n ctx.closePath();\n ctx.stroke();\n }\n }\n\n function numberOrZero(param) {\n return helpers.isNumber(param) ? param : 0;\n }\n\n var LinearRadialScale = Chart.LinearScaleBase.extend({\n setDimensions: function() {\n var me = this;\n var opts = me.options;\n var tickOpts = opts.ticks;\n // Set the unconstrained dimension before label rotation\n me.width = me.maxWidth;\n me.height = me.maxHeight;\n me.xCenter = Math.round(me.width / 2);\n me.yCenter = Math.round(me.height / 2);\n\n var minSize = helpers.min([me.height, me.width]);\n var tickFontSize = helpers.valueOrDefault(tickOpts.fontSize, globalDefaults.defaultFontSize);\n me.drawingArea = opts.display ? (minSize / 2) - (tickFontSize / 2 + tickOpts.backdropPaddingY) : (minSize / 2);\n },\n determineDataLimits: function() {\n var me = this;\n var chart = me.chart;\n var min = Number.POSITIVE_INFINITY;\n var max = Number.NEGATIVE_INFINITY;\n\n helpers.each(chart.data.datasets, function(dataset, datasetIndex) {\n if (chart.isDatasetVisible(datasetIndex)) {\n var meta = chart.getDatasetMeta(datasetIndex);\n\n helpers.each(dataset.data, function(rawValue, index) {\n var value = +me.getRightValue(rawValue);\n if (isNaN(value) || meta.data[index].hidden) {\n return;\n }\n\n min = Math.min(value, min);\n max = Math.max(value, max);\n });\n }\n });\n\n me.min = (min === Number.POSITIVE_INFINITY ? 0 : min);\n me.max = (max === Number.NEGATIVE_INFINITY ? 0 : max);\n\n // Common base implementation to handle ticks.min, ticks.max, ticks.beginAtZero\n me.handleTickRangeOptions();\n },\n getTickLimit: function() {\n var tickOpts = this.options.ticks;\n var tickFontSize = helpers.valueOrDefault(tickOpts.fontSize, globalDefaults.defaultFontSize);\n return Math.min(tickOpts.maxTicksLimit ? tickOpts.maxTicksLimit : 11, Math.ceil(this.drawingArea / (1.5 * tickFontSize)));\n },\n convertTicksToLabels: function() {\n var me = this;\n\n Chart.LinearScaleBase.prototype.convertTicksToLabels.call(me);\n\n // Point labels\n me.pointLabels = me.chart.data.labels.map(me.options.pointLabels.callback, me);\n },\n getLabelForIndex: function(index, datasetIndex) {\n return +this.getRightValue(this.chart.data.datasets[datasetIndex].data[index]);\n },\n fit: function() {\n if (this.options.pointLabels.display) {\n fitWithPointLabels(this);\n } else {\n fit(this);\n }\n },\n /**\n * Set radius reductions and determine new radius and center point\n * @private\n */\n setReductions: function(largestPossibleRadius, furthestLimits, furthestAngles) {\n var me = this;\n var radiusReductionLeft = furthestLimits.l / Math.sin(furthestAngles.l);\n var radiusReductionRight = Math.max(furthestLimits.r - me.width, 0) / Math.sin(furthestAngles.r);\n var radiusReductionTop = -furthestLimits.t / Math.cos(furthestAngles.t);\n var radiusReductionBottom = -Math.max(furthestLimits.b - me.height, 0) / Math.cos(furthestAngles.b);\n\n radiusReductionLeft = numberOrZero(radiusReductionLeft);\n radiusReductionRight = numberOrZero(radiusReductionRight);\n radiusReductionTop = numberOrZero(radiusReductionTop);\n radiusReductionBottom = numberOrZero(radiusReductionBottom);\n\n me.drawingArea = Math.min(\n Math.round(largestPossibleRadius - (radiusReductionLeft + radiusReductionRight) / 2),\n Math.round(largestPossibleRadius - (radiusReductionTop + radiusReductionBottom) / 2));\n me.setCenterPoint(radiusReductionLeft, radiusReductionRight, radiusReductionTop, radiusReductionBottom);\n },\n setCenterPoint: function(leftMovement, rightMovement, topMovement, bottomMovement) {\n var me = this;\n var maxRight = me.width - rightMovement - me.drawingArea;\n var maxLeft = leftMovement + me.drawingArea;\n var maxTop = topMovement + me.drawingArea;\n var maxBottom = me.height - bottomMovement - me.drawingArea;\n\n me.xCenter = Math.round(((maxLeft + maxRight) / 2) + me.left);\n me.yCenter = Math.round(((maxTop + maxBottom) / 2) + me.top);\n },\n\n getIndexAngle: function(index) {\n var angleMultiplier = (Math.PI * 2) / getValueCount(this);\n var startAngle = this.chart.options && this.chart.options.startAngle ?\n this.chart.options.startAngle :\n 0;\n\n var startAngleRadians = startAngle * Math.PI * 2 / 360;\n\n // Start from the top instead of right, so remove a quarter of the circle\n return index * angleMultiplier + startAngleRadians;\n },\n getDistanceFromCenterForValue: function(value) {\n var me = this;\n\n if (value === null) {\n return 0; // null always in center\n }\n\n // Take into account half font size + the yPadding of the top value\n var scalingFactor = me.drawingArea / (me.max - me.min);\n if (me.options.ticks.reverse) {\n return (me.max - value) * scalingFactor;\n }\n return (value - me.min) * scalingFactor;\n },\n getPointPosition: function(index, distanceFromCenter) {\n var me = this;\n var thisAngle = me.getIndexAngle(index) - (Math.PI / 2);\n return {\n x: Math.round(Math.cos(thisAngle) * distanceFromCenter) + me.xCenter,\n y: Math.round(Math.sin(thisAngle) * distanceFromCenter) + me.yCenter\n };\n },\n getPointPositionForValue: function(index, value) {\n return this.getPointPosition(index, this.getDistanceFromCenterForValue(value));\n },\n\n getBasePosition: function() {\n var me = this;\n var min = me.min;\n var max = me.max;\n\n return me.getPointPositionForValue(0,\n me.beginAtZero ? 0 :\n min < 0 && max < 0 ? max :\n min > 0 && max > 0 ? min :\n 0);\n },\n\n draw: function() {\n var me = this;\n var opts = me.options;\n var gridLineOpts = opts.gridLines;\n var tickOpts = opts.ticks;\n var valueOrDefault = helpers.valueOrDefault;\n\n if (opts.display) {\n var ctx = me.ctx;\n var startAngle = this.getIndexAngle(0);\n\n // Tick Font\n var tickFontSize = valueOrDefault(tickOpts.fontSize, globalDefaults.defaultFontSize);\n var tickFontStyle = valueOrDefault(tickOpts.fontStyle, globalDefaults.defaultFontStyle);\n var tickFontFamily = valueOrDefault(tickOpts.fontFamily, globalDefaults.defaultFontFamily);\n var tickLabelFont = helpers.fontString(tickFontSize, tickFontStyle, tickFontFamily);\n\n helpers.each(me.ticks, function(label, index) {\n // Don't draw a centre value (if it is minimum)\n if (index > 0 || tickOpts.reverse) {\n var yCenterOffset = me.getDistanceFromCenterForValue(me.ticksAsNumbers[index]);\n\n // Draw circular lines around the scale\n if (gridLineOpts.display && index !== 0) {\n drawRadiusLine(me, gridLineOpts, yCenterOffset, index);\n }\n\n if (tickOpts.display) {\n var tickFontColor = valueOrDefault(tickOpts.fontColor, globalDefaults.defaultFontColor);\n ctx.font = tickLabelFont;\n\n ctx.save();\n ctx.translate(me.xCenter, me.yCenter);\n ctx.rotate(startAngle);\n\n if (tickOpts.showLabelBackdrop) {\n var labelWidth = ctx.measureText(label).width;\n ctx.fillStyle = tickOpts.backdropColor;\n ctx.fillRect(\n -labelWidth / 2 - tickOpts.backdropPaddingX,\n -yCenterOffset - tickFontSize / 2 - tickOpts.backdropPaddingY,\n labelWidth + tickOpts.backdropPaddingX * 2,\n tickFontSize + tickOpts.backdropPaddingY * 2\n );\n }\n\n ctx.textAlign = 'center';\n ctx.textBaseline = 'middle';\n ctx.fillStyle = tickFontColor;\n ctx.fillText(label, 0, -yCenterOffset);\n ctx.restore();\n }\n }\n });\n\n if (opts.angleLines.display || opts.pointLabels.display) {\n drawPointLabels(me);\n }\n }\n }\n });\n Chart.scaleService.registerScaleType('radialLinear', LinearRadialScale, defaultConfig);\n\n };\n\n},{\"25\":25,\"34\":34,\"45\":45}],57:[function(require,module,exports){\n\t/* global window: false */\n 'use strict';\n\n var moment = require(6);\n moment = typeof moment === 'function' ? moment : window.moment;\n\n var defaults = require(25);\n var helpers = require(45);\n\n// Integer constants are from the ES6 spec.\n var MIN_INTEGER = Number.MIN_SAFE_INTEGER || -9007199254740991;\n var MAX_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;\n\n var INTERVALS = {\n millisecond: {\n major: true,\n size: 1,\n steps: [1, 2, 5, 10, 20, 50, 100, 250, 500]\n },\n second: {\n major: true,\n size: 1000,\n steps: [1, 2, 5, 10, 30]\n },\n minute: {\n major: true,\n size: 60000,\n steps: [1, 2, 5, 10, 30]\n },\n hour: {\n major: true,\n size: 3600000,\n steps: [1, 2, 3, 6, 12]\n },\n day: {\n major: true,\n size: 86400000,\n steps: [1, 2, 5]\n },\n week: {\n major: false,\n size: 604800000,\n steps: [1, 2, 3, 4]\n },\n month: {\n major: true,\n size: 2.628e9,\n steps: [1, 2, 3]\n },\n quarter: {\n major: false,\n size: 7.884e9,\n steps: [1, 2, 3, 4]\n },\n year: {\n major: true,\n size: 3.154e10\n }\n };\n\n var UNITS = Object.keys(INTERVALS);\n\n function sorter(a, b) {\n return a - b;\n }\n\n function arrayUnique(items) {\n var hash = {};\n var out = [];\n var i, ilen, item;\n\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n item = items[i];\n if (!hash[item]) {\n hash[item] = true;\n out.push(item);\n }\n }\n\n return out;\n }\n\n /**\n * Returns an array of {time, pos} objects used to interpolate a specific `time` or position\n * (`pos`) on the scale, by searching entries before and after the requested value. `pos` is\n * a decimal between 0 and 1: 0 being the start of the scale (left or top) and 1 the other\n * extremity (left + width or top + height). Note that it would be more optimized to directly\n * store pre-computed pixels, but the scale dimensions are not guaranteed at the time we need\n * to create the lookup table. The table ALWAYS contains at least two items: min and max.\n *\n * @param {Number[]} timestamps - timestamps sorted from lowest to highest.\n * @param {String} distribution - If 'linear', timestamps will be spread linearly along the min\n * and max range, so basically, the table will contains only two items: {min, 0} and {max, 1}.\n * If 'series', timestamps will be positioned at the same distance from each other. In this\n * case, only timestamps that break the time linearity are registered, meaning that in the\n * best case, all timestamps are linear, the table contains only min and max.\n */\n function buildLookupTable(timestamps, min, max, distribution) {\n if (distribution === 'linear' || !timestamps.length) {\n return [\n {time: min, pos: 0},\n {time: max, pos: 1}\n ];\n }\n\n var table = [];\n var items = [min];\n var i, ilen, prev, curr, next;\n\n for (i = 0, ilen = timestamps.length; i < ilen; ++i) {\n curr = timestamps[i];\n if (curr > min && curr < max) {\n items.push(curr);\n }\n }\n\n items.push(max);\n\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n next = items[i + 1];\n prev = items[i - 1];\n curr = items[i];\n\n // only add points that breaks the scale linearity\n if (prev === undefined || next === undefined || Math.round((next + prev) / 2) !== curr) {\n table.push({time: curr, pos: i / (ilen - 1)});\n }\n }\n\n return table;\n }\n\n// @see adapted from http://www.anujgakhar.com/2014/03/01/binary-search-in-javascript/\n function lookup(table, key, value) {\n var lo = 0;\n var hi = table.length - 1;\n var mid, i0, i1;\n\n while (lo >= 0 && lo <= hi) {\n mid = (lo + hi) >> 1;\n i0 = table[mid - 1] || null;\n i1 = table[mid];\n\n if (!i0) {\n // given value is outside table (before first item)\n return {lo: null, hi: i1};\n } else if (i1[key] < value) {\n lo = mid + 1;\n } else if (i0[key] > value) {\n hi = mid - 1;\n } else {\n return {lo: i0, hi: i1};\n }\n }\n\n // given value is outside table (after last item)\n return {lo: i1, hi: null};\n }\n\n /**\n * Linearly interpolates the given source `value` using the table items `skey` values and\n * returns the associated `tkey` value. For example, interpolate(table, 'time', 42, 'pos')\n * returns the position for a timestamp equal to 42. If value is out of bounds, values at\n * index [0, 1] or [n - 1, n] are used for the interpolation.\n */\n function interpolate(table, skey, sval, tkey) {\n var range = lookup(table, skey, sval);\n\n // Note: the lookup table ALWAYS contains at least 2 items (min and max)\n var prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n var next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n var span = next[skey] - prev[skey];\n var ratio = span ? (sval - prev[skey]) / span : 0;\n var offset = (next[tkey] - prev[tkey]) * ratio;\n\n return prev[tkey] + offset;\n }\n\n /**\n * Convert the given value to a moment object using the given time options.\n * @see http://momentjs.com/docs/#/parsing/\n */\n function momentify(value, options) {\n var parser = options.parser;\n var format = options.parser || options.format;\n\n if (typeof parser === 'function') {\n return parser(value);\n }\n\n if (typeof value === 'string' && typeof format === 'string') {\n return moment(value, format);\n }\n\n if (!(value instanceof moment)) {\n value = moment(value);\n }\n\n if (value.isValid()) {\n return value;\n }\n\n // Labels are in an incompatible moment format and no `parser` has been provided.\n // The user might still use the deprecated `format` option to convert his inputs.\n if (typeof format === 'function') {\n return format(value);\n }\n\n return value;\n }\n\n function parse(input, scale) {\n if (helpers.isNullOrUndef(input)) {\n return null;\n }\n\n var options = scale.options.time;\n var value = momentify(scale.getRightValue(input), options);\n if (!value.isValid()) {\n return null;\n }\n\n if (options.round) {\n value.startOf(options.round);\n }\n\n return value.valueOf();\n }\n\n /**\n * Returns the number of unit to skip to be able to display up to `capacity` number of ticks\n * in `unit` for the given `min` / `max` range and respecting the interval steps constraints.\n */\n function determineStepSize(min, max, unit, capacity) {\n var range = max - min;\n var interval = INTERVALS[unit];\n var milliseconds = interval.size;\n var steps = interval.steps;\n var i, ilen, factor;\n\n if (!steps) {\n return Math.ceil(range / ((capacity || 1) * milliseconds));\n }\n\n for (i = 0, ilen = steps.length; i < ilen; ++i) {\n factor = steps[i];\n if (Math.ceil(range / (milliseconds * factor)) <= capacity) {\n break;\n }\n }\n\n return factor;\n }\n\n function determineUnit(minUnit, min, max, capacity) {\n var ilen = UNITS.length;\n var i, interval, factor;\n\n for (i = UNITS.indexOf(minUnit); i < ilen - 1; ++i) {\n interval = INTERVALS[UNITS[i]];\n factor = interval.steps ? interval.steps[interval.steps.length - 1] : MAX_INTEGER;\n\n if (Math.ceil((max - min) / (factor * interval.size)) <= capacity) {\n return UNITS[i];\n }\n }\n\n return UNITS[ilen - 1];\n }\n\n function determineMajorUnit(unit) {\n for (var i = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i < ilen; ++i) {\n if (INTERVALS[UNITS[i]].major) {\n return UNITS[i];\n }\n }\n }\n\n /**\n * Generates a maximum of `capacity` timestamps between min and max, rounded to the\n * `minor` unit, aligned on the `major` unit and using the given scale time `options`.\n * Important: this method can return ticks outside the min and max range, it's the\n * responsibility of the calling code to clamp values if needed.\n */\n function generate(min, max, minor, major, capacity, options) {\n var timeOpts = options.time;\n var stepSize = helpers.valueOrDefault(timeOpts.stepSize, timeOpts.unitStepSize);\n var weekday = minor === 'week' ? timeOpts.isoWeekday : false;\n var majorTicksEnabled = options.ticks.major.enabled;\n var interval = INTERVALS[minor];\n var first = moment(min);\n var last = moment(max);\n var ticks = [];\n var time;\n\n if (!stepSize) {\n stepSize = determineStepSize(min, max, minor, capacity);\n }\n\n // For 'week' unit, handle the first day of week option\n if (weekday) {\n first = first.isoWeekday(weekday);\n last = last.isoWeekday(weekday);\n }\n\n // Align first/last ticks on unit\n first = first.startOf(weekday ? 'day' : minor);\n last = last.startOf(weekday ? 'day' : minor);\n\n // Make sure that the last tick include max\n if (last < max) {\n last.add(1, minor);\n }\n\n time = moment(first);\n\n if (majorTicksEnabled && major && !weekday && !timeOpts.round) {\n // Align the first tick on the previous `minor` unit aligned on the `major` unit:\n // we first aligned time on the previous `major` unit then add the number of full\n // stepSize there is between first and the previous major time.\n time.startOf(major);\n time.add(~~((first - time) / (interval.size * stepSize)) * stepSize, minor);\n }\n\n for (; time < last; time.add(stepSize, minor)) {\n ticks.push(+time);\n }\n\n ticks.push(+time);\n\n return ticks;\n }\n\n /**\n * Returns the right and left offsets from edges in the form of {left, right}.\n * Offsets are added when the `offset` option is true.\n */\n function computeOffsets(table, ticks, min, max, options) {\n var left = 0;\n var right = 0;\n var upper, lower;\n\n if (options.offset && ticks.length) {\n if (!options.time.min) {\n upper = ticks.length > 1 ? ticks[1] : max;\n lower = ticks[0];\n left = (\n interpolate(table, 'time', upper, 'pos') -\n interpolate(table, 'time', lower, 'pos')\n ) / 2;\n }\n if (!options.time.max) {\n upper = ticks[ticks.length - 1];\n lower = ticks.length > 1 ? ticks[ticks.length - 2] : min;\n right = (\n interpolate(table, 'time', upper, 'pos') -\n interpolate(table, 'time', lower, 'pos')\n ) / 2;\n }\n }\n\n return {left: left, right: right};\n }\n\n function ticksFromTimestamps(values, majorUnit) {\n var ticks = [];\n var i, ilen, value, major;\n\n for (i = 0, ilen = values.length; i < ilen; ++i) {\n value = values[i];\n major = majorUnit ? value === +moment(value).startOf(majorUnit) : false;\n\n ticks.push({\n value: value,\n major: major\n });\n }\n\n return ticks;\n }\n\n module.exports = function(Chart) {\n\n var defaultConfig = {\n position: 'bottom',\n\n /**\n * Data distribution along the scale:\n * - 'linear': data are spread according to their time (distances can vary),\n * - 'series': data are spread at the same distance from each other.\n * @see https://github.com/chartjs/Chart.js/pull/4507\n * @since 2.7.0\n */\n distribution: 'linear',\n\n /**\n * Scale boundary strategy (bypassed by min/max time options)\n * - `data`: make sure data are fully visible, ticks outside are removed\n * - `ticks`: make sure ticks are fully visible, data outside are truncated\n * @see https://github.com/chartjs/Chart.js/pull/4556\n * @since 2.7.0\n */\n bounds: 'data',\n\n time: {\n parser: false, // false == a pattern string from http://momentjs.com/docs/#/parsing/string-format/ or a custom callback that converts its argument to a moment\n format: false, // DEPRECATED false == date objects, moment object, callback or a pattern string from http://momentjs.com/docs/#/parsing/string-format/\n unit: false, // false == automatic or override with week, month, year, etc.\n round: false, // none, or override with week, month, year, etc.\n displayFormat: false, // DEPRECATED\n isoWeekday: false, // override week start day - see http://momentjs.com/docs/#/get-set/iso-weekday/\n minUnit: 'millisecond',\n\n // defaults to unit's corresponding unitFormat below or override using pattern string from http://momentjs.com/docs/#/displaying/format/\n displayFormats: {\n millisecond: 'h:mm:ss.SSS a', // 11:20:01.123 AM,\n second: 'h:mm:ss a', // 11:20:01 AM\n minute: 'h:mm a', // 11:20 AM\n hour: 'hA', // 5PM\n day: 'MMM D', // Sep 4\n week: 'll', // Week 46, or maybe \"[W]WW - YYYY\" ?\n month: 'MMM YYYY', // Sept 2015\n quarter: '[Q]Q - YYYY', // Q3\n year: 'YYYY' // 2015\n },\n },\n ticks: {\n autoSkip: false,\n\n /**\n * Ticks generation input values:\n * - 'auto': generates \"optimal\" ticks based on scale size and time options.\n * - 'data': generates ticks from data (including labels from data {t|x|y} objects).\n * - 'labels': generates ticks from user given `data.labels` values ONLY.\n * @see https://github.com/chartjs/Chart.js/pull/4507\n * @since 2.7.0\n */\n source: 'auto',\n\n major: {\n enabled: false\n }\n }\n };\n\n var TimeScale = Chart.Scale.extend({\n initialize: function() {\n if (!moment) {\n throw new Error('Chart.js - Moment.js could not be found! You must include it before Chart.js to use the time scale. Download at https://momentjs.com');\n }\n\n this.mergeTicksOptions();\n\n Chart.Scale.prototype.initialize.call(this);\n },\n\n update: function() {\n var me = this;\n var options = me.options;\n\n // DEPRECATIONS: output a message only one time per update\n if (options.time && options.time.format) {\n console.warn('options.time.format is deprecated and replaced by options.time.parser.');\n }\n\n return Chart.Scale.prototype.update.apply(me, arguments);\n },\n\n /**\n * Allows data to be referenced via 't' attribute\n */\n getRightValue: function(rawValue) {\n if (rawValue && rawValue.t !== undefined) {\n rawValue = rawValue.t;\n }\n return Chart.Scale.prototype.getRightValue.call(this, rawValue);\n },\n\n determineDataLimits: function() {\n var me = this;\n var chart = me.chart;\n var timeOpts = me.options.time;\n var min = parse(timeOpts.min, me) || MAX_INTEGER;\n var max = parse(timeOpts.max, me) || MIN_INTEGER;\n var timestamps = [];\n var datasets = [];\n var labels = [];\n var i, j, ilen, jlen, data, timestamp;\n\n // Convert labels to timestamps\n for (i = 0, ilen = chart.data.labels.length; i < ilen; ++i) {\n labels.push(parse(chart.data.labels[i], me));\n }\n\n // Convert data to timestamps\n for (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) {\n if (chart.isDatasetVisible(i)) {\n data = chart.data.datasets[i].data;\n\n // Let's consider that all data have the same format.\n if (helpers.isObject(data[0])) {\n datasets[i] = [];\n\n for (j = 0, jlen = data.length; j < jlen; ++j) {\n timestamp = parse(data[j], me);\n timestamps.push(timestamp);\n datasets[i][j] = timestamp;\n }\n } else {\n timestamps.push.apply(timestamps, labels);\n datasets[i] = labels.slice(0);\n }\n } else {\n datasets[i] = [];\n }\n }\n\n if (labels.length) {\n // Sort labels **after** data have been converted\n labels = arrayUnique(labels).sort(sorter);\n min = Math.min(min, labels[0]);\n max = Math.max(max, labels[labels.length - 1]);\n }\n\n if (timestamps.length) {\n timestamps = arrayUnique(timestamps).sort(sorter);\n min = Math.min(min, timestamps[0]);\n max = Math.max(max, timestamps[timestamps.length - 1]);\n }\n\n // In case there is no valid min/max, let's use today limits\n min = min === MAX_INTEGER ? +moment().startOf('day') : min;\n max = max === MIN_INTEGER ? +moment().endOf('day') + 1 : max;\n\n // Make sure that max is strictly higher than min (required by the lookup table)\n me.min = Math.min(min, max);\n me.max = Math.max(min + 1, max);\n\n // PRIVATE\n me._horizontal = me.isHorizontal();\n me._table = [];\n me._timestamps = {\n data: timestamps,\n datasets: datasets,\n labels: labels\n };\n },\n\n buildTicks: function() {\n var me = this;\n var min = me.min;\n var max = me.max;\n var options = me.options;\n var timeOpts = options.time;\n var formats = timeOpts.displayFormats;\n var capacity = me.getLabelCapacity(min);\n var unit = timeOpts.unit || determineUnit(timeOpts.minUnit, min, max, capacity);\n var majorUnit = determineMajorUnit(unit);\n var timestamps = [];\n var ticks = [];\n var i, ilen, timestamp;\n\n switch (options.ticks.source) {\n case 'data':\n timestamps = me._timestamps.data;\n break;\n case 'labels':\n timestamps = me._timestamps.labels;\n break;\n case 'auto':\n default:\n timestamps = generate(min, max, unit, majorUnit, capacity, options);\n }\n\n if (options.bounds === 'ticks' && timestamps.length) {\n min = timestamps[0];\n max = timestamps[timestamps.length - 1];\n }\n\n // Enforce limits with user min/max options\n min = parse(timeOpts.min, me) || min;\n max = parse(timeOpts.max, me) || max;\n\n // Remove ticks outside the min/max range\n for (i = 0, ilen = timestamps.length; i < ilen; ++i) {\n timestamp = timestamps[i];\n if (timestamp >= min && timestamp <= max) {\n ticks.push(timestamp);\n }\n }\n\n me.min = min;\n me.max = max;\n\n // PRIVATE\n me._unit = unit;\n me._majorUnit = majorUnit;\n me._minorFormat = formats[unit];\n me._majorFormat = formats[majorUnit];\n me._table = buildLookupTable(me._timestamps.data, min, max, options.distribution);\n me._offsets = computeOffsets(me._table, ticks, min, max, options);\n\n return ticksFromTimestamps(ticks, majorUnit);\n },\n\n getLabelForIndex: function(index, datasetIndex) {\n var me = this;\n var data = me.chart.data;\n var timeOpts = me.options.time;\n var label = data.labels && index < data.labels.length ? data.labels[index] : '';\n var value = data.datasets[datasetIndex].data[index];\n\n if (helpers.isObject(value)) {\n label = me.getRightValue(value);\n }\n if (timeOpts.tooltipFormat) {\n label = momentify(label, timeOpts).format(timeOpts.tooltipFormat);\n }\n\n return label;\n },\n\n /**\n * Function to format an individual tick mark\n * @private\n */\n tickFormatFunction: function(tick, index, ticks) {\n var me = this;\n var options = me.options;\n var time = tick.valueOf();\n var majorUnit = me._majorUnit;\n var majorFormat = me._majorFormat;\n var majorTime = tick.clone().startOf(me._majorUnit).valueOf();\n var majorTickOpts = options.ticks.major;\n var major = majorTickOpts.enabled && majorUnit && majorFormat && time === majorTime;\n var label = tick.format(major ? majorFormat : me._minorFormat);\n var tickOpts = major ? majorTickOpts : options.ticks.minor;\n var formatter = helpers.valueOrDefault(tickOpts.callback, tickOpts.userCallback);\n\n return formatter ? formatter(label, index, ticks) : label;\n },\n\n convertTicksToLabels: function(ticks) {\n var labels = [];\n var i, ilen;\n\n for (i = 0, ilen = ticks.length; i < ilen; ++i) {\n labels.push(this.tickFormatFunction(moment(ticks[i].value), i, ticks));\n }\n\n return labels;\n },\n\n /**\n * @private\n */\n getPixelForOffset: function(time) {\n var me = this;\n var size = me._horizontal ? me.width : me.height;\n var start = me._horizontal ? me.left : me.top;\n var pos = interpolate(me._table, 'time', time, 'pos');\n\n return start + size * (me._offsets.left + pos) / (me._offsets.left + 1 + me._offsets.right);\n },\n\n getPixelForValue: function(value, index, datasetIndex) {\n var me = this;\n var time = null;\n\n if (index !== undefined && datasetIndex !== undefined) {\n time = me._timestamps.datasets[datasetIndex][index];\n }\n\n if (time === null) {\n time = parse(value, me);\n }\n\n if (time !== null) {\n return me.getPixelForOffset(time);\n }\n },\n\n getPixelForTick: function(index) {\n var ticks = this.getTicks();\n return index >= 0 && index < ticks.length ?\n this.getPixelForOffset(ticks[index].value) :\n null;\n },\n\n getValueForPixel: function(pixel) {\n var me = this;\n var size = me._horizontal ? me.width : me.height;\n var start = me._horizontal ? me.left : me.top;\n var pos = (size ? (pixel - start) / size : 0) * (me._offsets.left + 1 + me._offsets.left) - me._offsets.right;\n var time = interpolate(me._table, 'pos', pos, 'time');\n\n return moment(time);\n },\n\n /**\n * Crude approximation of what the label width might be\n * @private\n */\n getLabelWidth: function(label) {\n var me = this;\n var ticksOpts = me.options.ticks;\n var tickLabelWidth = me.ctx.measureText(label).width;\n var angle = helpers.toRadians(ticksOpts.maxRotation);\n var cosRotation = Math.cos(angle);\n var sinRotation = Math.sin(angle);\n var tickFontSize = helpers.valueOrDefault(ticksOpts.fontSize, defaults.global.defaultFontSize);\n\n return (tickLabelWidth * cosRotation) + (tickFontSize * sinRotation);\n },\n\n /**\n * @private\n */\n getLabelCapacity: function(exampleTime) {\n var me = this;\n\n me._minorFormat = me.options.time.displayFormats.millisecond;\t// Pick the longest format for guestimation\n\n var exampleLabel = me.tickFormatFunction(moment(exampleTime), 0, []);\n var tickLabelWidth = me.getLabelWidth(exampleLabel);\n var innerWidth = me.isHorizontal() ? me.width : me.height;\n\n return Math.floor(innerWidth / tickLabelWidth);\n }\n });\n\n Chart.scaleService.registerScaleType('time', TimeScale, defaultConfig);\n };\n\n},{\"25\":25,\"45\":45,\"6\":6}]},{},[7])(7)\n});"],"file":"chartjs-lazy.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/chartjs-lazy.js"],"names":["f","exports","module","define","amd","g","window","global","self","Chart","e","t","n","r","s","o","u","a","require","i","Error","code","l","call","length","colorNames","getRgba","getHsla","getRgb","string","rgba","slice","getHsl","hsla","getHwb","getAlpha","vals","hexString","rgb","hexDouble","rgbString","alpha","rgbaString","percentString","percentaString","Math","round","b","hslString","hslaString","hwbString","hwb","keyword","reverseNames","match","parseInt","parseFloat","scale","h","isNaN","w","num","min","max","str","toString","toUpperCase","name","convert","Color","obj","valid","values","hsl","hsv","cmyk","setValues","red","lightness","v","value","whiteness","c","cyan","prototype","isValid","setSpace","arguments","rgbArray","hslArray","hsvArray","hwbArray","concat","cmykArray","rgbaArray","hslaArray","val","setChannel","green","blue","hue","saturation","saturationv","blackness","magenta","yellow","black","rgbNumber","luminosity","lum","chan","pow","contrast","color2","lum1","lum2","level","contrastRatio","dark","yiq","light","negate","lighten","ratio","darken","saturate","desaturate","whiten","blacken","greyscale","clearer","opaquer","rotate","degrees","mix","mixinColor","weight","color1","p","w1","w2","toJSON","clone","result","source","target","type","prop","hasOwnProperty","console","error","spaces","maxes","getValues","space","charAt","chans","capped","sname","args","Array","index","svalues","rgb2hsl","rgb2hsv","rgb2hwb","rgb2cmyk","rgb2keyword","rgb2xyz","rgb2lab","rgb2lch","lab2lch","hsl2rgb","hsl2hsv","sv","hsl2hwb","hsl2cmyk","hsl2keyword","hsv2rgb","hsv2hsl","sl","hsv2hwb","hsv2cmyk","hsv2keyword","hwb2rgb","hwb2hsl","hwb2hsv","hwb2cmyk","hwb2keyword","cmyk2rgb","cmyk2hsl","cmyk2hsv","cmyk2hwb","cmyk2keyword","keyword2rgb","keyword2hsl","keyword2hsv","keyword2hwb","keyword2cmyk","keyword2lab","keyword2xyz","xyz2rgb","xyz2lab","xyz2lch","lab2xyz","lab2rgb","lch2lab","lch2xyz","lch2rgb","delta","m","y","k","reverseKeywords","JSON","stringify","x","z","xyz","t1","t2","t3","hi","floor","q","wh","bl","lab","y2","hr","atan2","PI","sqrt","lch","cos","sin","cssKeywords","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","blanchedalmond","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellowgreen","key","conversions","Converter","func","arg","pair","exec","from","to","convs","routeSpace","fspace","forEach","factory","moment","hookCallback","hooks","apply","isArray","input","Object","isObject","isObjectEmpty","isUndefined","isNumber","isDate","Date","map","arr","fn","res","push","hasOwnProp","extend","valueOf","createUTC","format","locale","strict","createLocalOrUTC","utc","defaultParsingFlags","empty","unusedTokens","unusedInput","overflow","charsLeftOver","nullInput","invalidMonth","invalidFormat","userInvalidated","iso","parsedDateParts","meridiem","rfc2822","weekdayMismatch","getParsingFlags","_pf","some","fun","len","some$1","_isValid","flags","parsedParts","isNowValid","_d","getTime","invalidWeekday","_strict","bigHour","isFrozen","createInvalid","NaN","momentProperties","copyConfig","_isAMomentObject","_i","_f","_l","_tzm","_isUTC","_offset","_locale","updateInProgress","Moment","config","updateOffset","isMoment","absFloor","number","ceil","toInt","argumentForCoercion","coercedNumber","isFinite","compareArrays","array1","array2","dontConvert","lengthDiff","abs","diffs","warn","msg","suppressDeprecationWarnings","deprecate","firstTime","deprecationHandler","join","stack","deprecations","deprecateSimple","isFunction","Function","mergeConfigs","parentConfig","childConfig","Locale","set","keys","keys$1","aliases","addUnitAlias","unit","shorthand","lowerCase","toLowerCase","normalizeUnits","units","normalizeObjectUnits","inputObject","normalizedInput","normalizedProp","priorities","addUnitPriority","priority","getPrioritizedUnits","unitsObj","sort","makeGetSet","keepTime","set$1","get","mom","stringSet","prioritized","zeroFill","targetLength","forceSign","absNumber","zerosToFill","substr","formattingTokens","localFormattingTokens","formatFunctions","formatTokenFunctions","addFormatToken","token","padded","ordinal","callback","localeData","removeFormattingTokens","replace","makeFormatFunction","array","output","formatMoment","invalidDate","expandFormat","replaceLongDateFormatTokens","longDateFormat","lastIndex","test","match1","match2","match3","match4","match6","match1to2","match3to4","match5to6","match1to3","match1to4","match1to6","matchSigned","matchShortOffset","matchWord","regexes","addRegexToken","regex","strictRegex","isStrict","getParseRegexForToken","RegExp","unescapeFormat","regexEscape","matched","p1","p2","p3","p4","tokens","addParseToken","addWeekParseToken","_w","addTimeToArrayFromToken","_a","MONTH","DATE","HOUR","MINUTE","SECOND","MILLISECOND","indexOf","indexOf$1","daysInMonth","year","month","UTC","getUTCDate","monthsShort","months","monthsShortRegex","monthsRegex","monthsParse","MONTHS_IN_FORMAT","handleStrictParse","monthName","ii","llc","toLocaleLowerCase","_monthsParse","_longMonthsParse","_shortMonthsParse","setMonth","dayOfMonth","date","getSetMonth","computeMonthsParse","cmpLenRev","shortPieces","longPieces","mixedPieces","_monthsRegex","_monthsShortRegex","_monthsStrictRegex","_monthsShortStrictRegex","parseTwoDigitYear","daysInYear","isLeapYear","getSetYear","createDate","d","M","ms","getFullYear","setFullYear","createUTCDate","getUTCFullYear","setUTCFullYear","firstWeekOffset","dow","doy","fwd","fwdlw","getUTCDay","dayOfYearFromWeeks","week","weekday","weekOffset","dayOfYear","resYear","resDayOfYear","weekOfYear","resWeek","weeksInYear","weekOffsetNext","weekdaysMin","weekdaysShort","weekdays","weekdaysMinRegex","weekdaysShortRegex","weekdaysRegex","weekdaysParse","parseWeekday","parseIsoWeekday","handleStrictParse$1","weekdayName","_weekdaysParse","_shortWeekdaysParse","_minWeekdaysParse","day","computeWeekdaysParse","minPieces","minp","shortp","longp","_weekdaysRegex","_weekdaysShortRegex","_weekdaysMinRegex","_weekdaysStrictRegex","_weekdaysShortStrictRegex","_weekdaysMinStrictRegex","hFormat","hours","minutes","seconds","lowercase","matchMeridiem","_meridiemParse","kInput","_isPm","isPM","_meridiem","pos","pos1","pos2","getSetHour","baseConfig","calendar","sameDay","nextDay","nextWeek","lastDay","lastWeek","sameElse","LTS","LT","L","LL","LLL","LLLL","dayOfMonthOrdinalParse","relativeTime","future","past","ss","mm","hh","dd","MM","yy","meridiemParse","locales","localeFamilies","globalLocale","normalizeLocale","chooseLocale","names","j","next","split","loadLocale","oldLocale","_abbr","getSetGlobalLocale","data","getLocale","defineLocale","abbr","_config","parentLocale","checkOverflow","_overflowDayOfYear","_overflowWeeks","_overflowWeekday","isoDates","isoTimes","configFromISO","allowTime","dateFormat","timeFormat","tzFormat","configFromStringAndFormat","configFromRFC2822","dayFormat","timezones","timezone","timezoneIndex","momentDate","momentDay","getDay","splice","configFromString","createFromInputFallback","_useUTC","defaults","currentDateArray","nowValue","now","getUTCMonth","getMonth","getDate","configFromArray","currentDate","yearToUse","dayOfYearFromWeekInfo","_dayOfYear","_nextDay","setUTCMinutes","getUTCMinutes","weekYear","temp","weekdayOverflow","GG","W","E","createLocal","_week","curWeek","gg","ISO_8601","RFC_2822","parsedInput","skipped","stringLength","totalParsedInputLength","meridiemFixWrap","hour","isPm","meridiemHour","configFromStringAndArray","tempConfig","bestMoment","scoreToBeat","currentScore","score","configFromObject","minute","second","millisecond","createFromConfig","prepareConfig","add","preparse","configFromInput","isUTC","prototypeMin","other","prototypeMax","pickBy","moments","ordering","isDurationValid","unitHasDecimal","Duration","duration","years","quarters","quarter","weeks","days","milliseconds","_milliseconds","_days","_months","_data","_bubble","isDuration","absRound","offset","separator","utcOffset","sign","offsetFromString","matcher","matches","chunk","parts","cloneWithOffset","model","diff","setTime","local","getDateOffset","getTimezoneOffset","isUtc","createDuration","ret","diffRes","parseIso","momentsDifference","invalid","inp","positiveMomentsDifference","base","isAfter","isBefore","createAdder","direction","period","dur","tmp","addSubtract","isAdding","subtract","monthDiff","wholeMonthDiff","anchor","anchor2","adjust","defaultFormat","defaultFormatUtc","newLocaleData","lang","isoWeekYear","addWeekYearFormatToken","getter","getSetWeekYearHelper","weeksTarget","setWeekAll","dayOfYearData","_dayOfMonthOrdinalParse","_ordinalParse","_dayOfMonthOrdinalParseLenient","getSetDayOfMonth","getSetMinute","getSetSecond","parseMs","getSetMillisecond","proto","time","formats","sod","startOf","calendarFormat","asFloat","that","zoneDelta","endOf","inputString","postformat","withoutSuffix","humanize","fromNow","toNow","invalidAt","localInput","isBetween","inclusivity","isSame","inputMs","isSameOrAfter","isSameOrBefore","parsingFlags","isoWeekday","toArray","toObject","toDate","toISOString","inspect","zone","isLocal","prefix","suffix","unix","creationData","isoWeek","isoWeeks","weekInfo","isoWeeksInYear","keepLocalTime","keepMinutes","localAdjust","_changeInProgress","parseZone","tZone","hasAlignedHourOffset","isDST","isUtcOffset","zoneAbbr","zoneName","dates","isDSTShifted","_isDSTShifted","preParsePostFormat","proto$1","_calendar","_longDateFormat","formatUpper","_invalidDate","_ordinal","isFuture","_relativeTime","pastFuture","isFormat","_monthsShort","_monthsParseExact","firstDayOfYear","firstDayOfWeek","_weekdays","_weekdaysMin","_weekdaysShort","_weekdaysParseExact","_fullWeekdaysParse","isLower","get$1","field","setter","listMonthsImpl","out","listWeekdaysImpl","localeSorted","shift","langData","mathAbs","addSubtract$1","absCeil","daysToMonths","monthsToDays","makeAs","alias","as","asMilliseconds","asSeconds","asMinutes","asHours","asDays","asWeeks","asMonths","asYears","makeGetter","thresholds","substituteTimeAgo","relativeTime$1","posNegDuration","getSetRelativeTimeRounding","roundingFunction","abs$1","toISOString$1","Y","D","total","proto$2","monthsFromDays","withSuffix","toIsoString","version","updateLocale","relativeTimeRounding","relativeTimeThreshold","threshold","limit","myMoment","helpers","Element","elements","Interaction","platform","plugins","register","initialize","canvasHelpers","canvas","Bar","context","Bubble","Doughnut","Line","PolarArea","Radar","Scatter","_set","hover","mode","scales","xAxes","categoryPercentage","barPercentage","gridLines","offsetGridLines","yAxes","axis","position","rectangle","borderSkipped","tooltips","callbacks","title","item","yLabel","labels","label","datasetLabel","datasets","datasetIndex","xLabel","controllers","bar","DatasetController","dataElementType","Rectangle","me","meta","getMeta","getDataset","update","reset","rects","ilen","_ruler","getRuler","updateElement","chart","dataset","custom","rectangleOptions","options","_xScale","getScaleForId","xAxisID","_yScale","yAxisID","_datasetIndex","_index","_model","backgroundColor","valueAtIndexOrDefault","borderColor","borderWidth","updateElementGeometry","pivot","vscale","getValueScale","getBasePixel","horizontal","isHorizontal","ruler","vpixels","calculateBarValuePixels","ipixels","calculateBarIndexPixels","head","center","height","size","width","getValueScaleId","getIndexScaleId","getIndexScale","getStackCount","last","stacked","stacks","getDatasetMeta","isDatasetVisible","getStackIndex","stackCount","pixels","start","left","top","end","getPixelForValue","getRightValue","imeta","ivalue","controller","id","stackIndex","leftSampleSize","rightSampleSize","leftCategorySize","rightCategorySize","fullBarSize","valueOrDefault","barThickness","maxBarThickness","draw","clipArea","ctx","chartArea","unclipArea","setHoverStyle","hoverBackgroundColor","getHoverColor","hoverBorderColor","hoverBorderWidth","removeHoverStyle","rectangleElementOptions","horizontalBar","dataPoint","bubble","Point","points","each","point","xScale","yScale","_resolveElementOptions","dsIndex","getPixelForDecimal","_options","hitRadius","pointStyle","radius","skip","hoverRadius","resolve","dataIndex","animation","animateRotate","animateScale","legendCallback","text","legend","generateLabels","ds","arc","arcOpts","fill","stroke","bw","fillStyle","strokeStyle","lineWidth","hidden","onClick","legendItem","cutoutPercentage","rotation","circumference","tooltipItem","dataLabel","doughnut","pie","Arc","linkScales","noop","getRingIndex","ringIndex","opts","availableWidth","right","availableHeight","bottom","minSize","startAngle","endAngle","contains0","contains90","contains180","contains270","cutout","getMaxBorderWidth","outerRadius","innerRadius","radiusLength","getVisibleDatasetCount","offsetX","offsetY","calculateTotal","animationOpts","centerX","centerY","calculateCircumference","element","arcs","hoverWidth","_chart","showLines","spanGaps","lineEnabled","showLine","line","datasetElementType","lineElementOptions","tension","lineTension","_scale","_children","borderCapStyle","borderDash","borderDashOffset","borderJoinStyle","steppedLine","stepped","cubicInterpolationMode","updateBezierControlPoints","getPointBackgroundColor","pointBackgroundColor","getPointBorderColor","pointBorderColor","getPointBorderWidth","pointBorderWidth","pointOptions","pointRadius","pointHitRadius","calculatePointY","sumPos","sumNeg","dsMeta","stackedRightValue","rightValue","area","controlPoints","filter","pt","capControlPoint","splineCurveMonotone","splineCurve","previousItem","nextItem","controlPointPreviousX","previous","controlPointPreviousY","controlPointNextX","controlPointNextY","capBezierPoints","pointHoverRadius","pointHoverBackgroundColor","pointHoverBorderColor","pointHoverBorderWidth","angleLines","display","circular","pointLabels","ticks","beginAtZero","polarArea","count","countVisibleElements","xCenter","yCenter","visibleCount","datasetStartAngle","distance","getDistanceFromCenterForValue","resetRadius","radar","_loop","pointElementOptions","pointPosition","getPointPositionForValue","scatter","easing","onProgress","onComplete","Animation","currentStep","numSteps","render","onAnimationProgress","onAnimationComplete","animationService","frameDuration","animations","dropFrames","request","addAnimation","lazy","animating","requestAnimationFrame","cancelAnimation","findIndex","requestAnimFrame","startDigest","startTime","framesToDrop","advance","endTime","defineProperty","types","instances","initConfig","configMerge","updateConfig","newOptions","scaleOptions","tooltip","positionIsHorizontal","construct","acquireContext","uid","aspectRatio","_bufferedRender","notify","retinaScale","devicePixelRatio","bindEvents","responsive","resize","ensureScalesHaveIDs","buildScales","initToolTip","clear","stop","silent","maintainAspectRatio","newWidth","getMaximumWidth","newHeight","getMaximumHeight","style","newSize","onResize","responsiveAnimationDuration","scalesOptions","xAxisOptions","yAxisOptions","items","dtype","dposition","isDefault","scaleType","scaleClass","scaleService","getScaleConstructor","mergeTicksOptions","addScalesToLayout","buildOrUpdateControllers","newControllers","destroyDatasetMeta","updateIndex","ControllerClass","resetElements","buildOrUpdateElements","updateLayout","updateDatasets","_bufferedRequest","layoutService","updateDataset","animationOptions","animationObject","easingFunction","effects","stepDecimal","easingValue","isNullOrUndef","transition","boxes","box","drawDatasets","drawDataset","getElementAtEvent","modes","single","getElementsAtEvent","intersect","getElementsAtXAxis","getElementsAtEventForMode","method","getDatasetAtEvent","_meta","generateLegend","destroy","unbindEvents","releaseContext","toBase64Image","toDataURL","Tooltip","_chartInstance","listeners","_listeners","listener","eventHandler","events","addEventListener","removeEventListener","updateHoverStyle","enabled","changed","handleEvent","bufferedRequest","animationDuration","hoverOptions","lastActive","active","onHover","native","arrayEquals","Controller","arrayEvents","listenArrayEvents","_chartjs","configurable","enumerable","object","unlistenArrayEvents","stub","addElements","scaleID","createMetaDataset","createMetaData","metaData","addElementAndReset","resyncElements","elementOpts","numMeta","numData","insertElements","onDataPush","onDataPop","pop","onDataShift","onDataSplice","onDataUnshift","inherits","scope","merge","color","interpolate","view","ease","actual","origin","c0","c1","configuration","_view","_start","tooltipPosition","hasValue","setFn","merger","tval","sval","scaleMerge","getScaleDefaults","_merger","slen","where","collection","filterCallback","filtered","findNextWhere","arrayToSearch","startIndex","currentItem","findPreviousWhere","extensions","ChartElement","constructor","Surrogate","__super__","almostEquals","epsilon","almostWhole","rounded","reduce","Number","NEGATIVE_INFINITY","POSITIVE_INFINITY","log10","log","LN10","toRadians","toDegrees","radians","getAngleFromPoint","centrePoint","anglePoint","distanceFromXCenter","distanceFromYCenter","radialDistanceFromCenter","angle","distanceBetweenPoints","pt1","pt2","aliasPixel","pixelWidth","firstPoint","middlePoint","afterPoint","current","d01","d12","s01","s12","fa","fb","EPSILON","pointsWithTangents","deltaK","mK","pointsLen","pointBefore","pointCurrent","pointAfter","slopeDeltaX","alphaK","betaK","tauK","squaredMagnitude","deltaX","loop","niceNum","range","exponent","fraction","niceFraction","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame","msRequestAnimationFrame","setTimeout","getRelativePosition","evt","mouseX","mouseY","originalEvent","currentTarget","srcElement","boundingRect","getBoundingClientRect","touches","clientX","clientY","paddingLeft","getStyle","paddingTop","paddingRight","paddingBottom","currentDevicePixelRatio","parseMaxStyle","styleValue","node","parentProperty","valueInPixels","parentNode","isConstrainedValue","getConstraintDimension","domNode","maxStyle","percentageProperty","document","defaultView","constrainedNode","getComputedStyle","constrainedContainer","hasCNode","hasCContainer","infinity","getConstraintWidth","getConstraintHeight","container","clientWidth","cw","clientHeight","ch","el","property","currentStyle","getPropertyValue","forceRatio","pixelRatio","fontString","pixelSize","fontStyle","fontFamily","longestText","font","arrayOfThings","cache","gc","garbageCollect","longest","thing","measureText","nestedThing","gcLen","textWidth","numberOfLabelLines","numberOfLines","CanvasGradient","defaultColor","colorValue","CanvasPattern","parseVisibleItems","handler","jlen","getIntersectItems","inRange","getNearestItems","distanceMetric","minDistance","nearestItems","getCenterPoint","getDistanceMetricForAxis","useX","useY","deltaY","indexMode","nearest","sizeA","getArea","sizeB","intersectsItem","inXRange","inYRange","defaultFontColor","defaultFontFamily","defaultFontSize","defaultFontStyle","layout","padding","filterByPosition","sortByWeight","reverse","_tmpIndex_","v0","v1","addBox","fullWidth","removeBox","layoutItem","configure","props","layoutOptions","toPadding","leftPadding","rightPadding","topPadding","bottomPadding","leftBoxes","rightBoxes","topBoxes","bottomBoxes","chartAreaBoxes","chartWidth","chartHeight","chartAreaHeight","verticalBoxWidth","horizontalBoxHeight","maxChartAreaWidth","maxChartAreaHeight","minBoxSizes","getMinimumBoxSize","maxHorizontalLeftPadding","maxHorizontalRightPadding","maxVerticalTopPadding","maxVerticalBottomPadding","horizontalBox","getPadding","boxPadding","verticalBox","totalLeftBoxesWidth","totalRightBoxesWidth","totalTopBoxesHeight","totalBottomBoxesHeight","fitBox","minBoxSize","minBox","scaleMargin","finalFitVerticalBox","leftPaddingAddition","topPaddingAddition","newMaxChartAreaHeight","newMaxChartAreaWidth","placeBox","_plugins","_cacheId","plugin","unregister","idx","getAll","hook","descriptors","descriptor","params","pluginService","PluginBase","Ticks","drawBorder","drawOnChartArea","drawTicks","tickMarkLength","zeroLineWidth","zeroLineColor","zeroLineBorderDash","zeroLineBorderDashOffset","scaleLabel","labelString","lineHeight","minRotation","maxRotation","mirror","autoSkip","autoSkipPadding","labelOffset","formatters","minor","major","labelsFromTicks","getLineValue","lineValue","getPixelForTick","computeTextSize","tick","parseFontOptions","globalDefaults","fontSize","family","parseLineHeight","toLineHeight","Scale","getTicks","_ticks","beforeUpdate","maxWidth","maxHeight","margins","longestTextCache","beforeSetDimensions","setDimensions","afterSetDimensions","beforeDataLimits","determineDataLimits","afterDataLimits","beforeBuildTicks","buildTicks","afterBuildTicks","beforeTickToLabelConversion","convertTicksToLabels","afterTickToLabelConversion","beforeCalculateTickRotation","calculateTickRotation","afterCalculateTickRotation","beforeFit","fit","afterFit","afterUpdate","tickOpts","userCallback","tickFont","labelRotation","originalLabelWidth","labelWidth","cosRotation","sinRotation","tickWidth","angleRadians","scaleLabelOpts","gridLineOpts","isFullWidth","scaleLabelLineHeight","scaleLabelPadding","deltaHeight","largestTextWidth","tallestLabelHeightInLines","lineSpace","tickPadding","longestLabelWidth","labelHeight","firstLabelWidth","lastLabelWidth","handleMargins","rawValue","getLabelForIndex","getValueForPixel","innerWidth","pixel","finalVal","innerHeight","decimal","valueOffset","getBaseValue","_autoSkip","skipRatio","optionTicks","tickCount","labelRotationRadians","longestRotatedLabel","shouldSkip","maxTicks","maxTicksLimit","optionMajorTicks","isRotated","tickFontColor","fontColor","majorTickFontColor","majorTickFont","tl","scaleLabelFontColor","scaleLabelFont","itemsToDraw","xTickStart","xTickEnd","yTickStart","yTickEnd","lineColor","zeroLineIndex","tx1","ty1","tx2","ty2","x1","y1","x2","labelX","labelY","textAlign","textBaseline","labelYOffset","xLineValue","isLeft","labelXOffset","yLineValue","glWidth","glColor","glBorderDash","glBorderDashOffset","itemToDraw","save","setLineDash","lineDashOffset","beginPath","moveTo","lineTo","restore","translate","fillText","scaleLabelX","scaleLabelY","halfLineHeight","constructors","registerScaleType","scaleConstructor","scaleDefaults","updateScaleDefaults","additions","generators","linear","generationOptions","dataRange","spacing","stepSize","niceRange","niceMin","niceMax","numSpaces","logarithmic","tickVal","endExp","endSignificand","exp","significand","minNotZero","lastTick","tickValue","logDelta","tickString","numDecimal","toFixed","remain","toExponential","titleFontStyle","titleSpacing","titleMarginBottom","titleFontColor","titleAlign","bodySpacing","bodyFontColor","bodyAlign","footerFontStyle","footerSpacing","footerMarginTop","footerFontColor","footerAlign","yPadding","xPadding","caretPadding","caretSize","cornerRadius","multiKeyBackground","displayColors","beforeTitle","tooltipItems","labelCount","afterTitle","beforeBody","beforeLabel","labelColor","activeElement","labelTextColor","afterLabel","afterBody","beforeFooter","footer","afterFooter","mergeOpacity","colorString","opacity","pushOrConcat","toPush","createTooltipItem","getBaseModel","tooltipOpts","xAlign","yAlign","_bodyFontFamily","bodyFontFamily","_bodyFontStyle","bodyFontStyle","_bodyAlign","bodyFontSize","_titleFontFamily","titleFontFamily","_titleFontStyle","titleFontSize","_titleAlign","_footerFontFamily","footerFontFamily","_footerFontStyle","footerFontSize","_footerAlign","legendColorBackground","getTooltipSize","body","combinedBodyLength","bodyItem","before","lines","after","titleLineCount","footerLineCount","widthPadding","maxLineWidth","determineAlignment","lf","rf","olf","orf","yf","midX","midY","getBackgroundPoint","vm","alignment","paddingAndSize","radiusAndPadding","getTitle","getBeforeBody","getBody","bodyItems","getAfterBody","getFooter","existingModel","_active","backgroundPoint","tooltipSize","caretX","caretY","labelColors","labelTextColors","positioners","_eventPosition","itemSort","dataPoints","drawCaret","tooltipPoint","caretPosition","getCaretPosition","x3","y3","ptX","ptY","drawTitle","drawBody","xLinePadding","fillLineOfText","drawColorBoxes","fillRect","strokeRect","textColor","drawFooter","drawBackground","quadraticCurveTo","closePath","hasTooltipContent","_lastActive","average","eventPosition","nearestElement","tp","inLabelRange","chartX","chartY","pointRelativePosition","betweenAngles","withinRadius","halfAngle","halfRadius","centreAngle","rangeFromCentre","sA","eA","lineJoin","globalOptionLineElements","lastDrawnIndex","currentVM","lineCap","xRange","errMargin","drawPoint","isVertical","getBarBounds","halfWidth","halfHeight","signX","signY","barSize","halfStroke","borderLeft","borderRight","borderTop","borderBottom","corners","startCorner","cornerAt","corner","bounds","clearRect","roundedRect","rx","ry","rect","edgeLength","xOffset","yOffset","drawImage","SQRT2","sideSize","clip","flip","bezierCurveTo","drawRoundedRectangle","defaultValue","thisArg","loopable","a0","a1","klen","_mergerIf","mergeIf","sources","callCallback","fromIndex","getValueOrDefault","getValueAtIndexOrDefault","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","easeInSine","easeOutSine","easeInOutSine","easeInExpo","easeOutExpo","easeInOutExpo","easeInCirc","easeOutCirc","easeInOutCirc","easeInElastic","asin","easeOutElastic","easeInOutElastic","easeInBack","easeOutBack","easeInOutBack","easeInBounce","easeOutBounce","easeInOutBounce","easingEffects","inputs","getContext","EXPANDO_KEY","CSS_PREFIX","CSS_RENDER_MONITOR","CSS_RENDER_ANIMATION","ANIMATION_START_EVENTS","EVENT_TYPES","touchstart","touchmove","touchend","pointerenter","pointerdown","pointermove","pointerup","pointerleave","pointerout","readUsedSize","initCanvas","renderHeight","getAttribute","renderWidth","initial","displayWidth","displayHeight","supportsEventListenerOptions","supports","eventListenerOptions","passive","createEvent","nativeEvent","fromNativeEvent","event","throttled","ticking","createResizer","resizer","createElement","cls","maxSize","cssText","className","innerHTML","expand","childNodes","shrink","_reset","scrollLeft","scrollTop","onScroll","bind","watchForRender","expando","proxy","renderProxy","animationName","classList","unwatchForRender","remove","addResizeListener","insertBefore","firstChild","removeResizeListener","removeChild","injectCSS","css","_style","setAttribute","getElementsByTagName","appendChild","createTextNode","_enabled","getElementById","removeAttribute","proxies","addEvent","removeEvent","basic","dom","implementation","filler","propagate","mappers","visible","boundary","decodeFill","computeBoundary","scaleBottom","scaleTop","scaleZero","getBasePosition","resolveTarget","visited","createMapper","isDrawable","drawArea","curve0","curve1","len0","len1","doFill","mapper","span","p0","d0","d1","afterDatasetsUpdate","$filler","beforeDatasetDraw","ci","boxWidth","lineDash","getBoxWidth","labelOpts","usePointStyle","Legend","legendHitBoxes","doughnutMode","beforeBuildLabels","buildLabels","afterBuildLabels","legendItems","globalDefault","labelFont","hitboxes","lineWidths","totalHeight","vPadding","columnWidths","totalWidth","currentColWidth","currentColHeight","itemHeight","itemWidth","lineDefault","legendWidth","cursor","drawLegendBox","isLineWidthZero","offSet","halfFontSize","xLeft","yMiddle","lh","hitBox","createNewLegendAndAttach","legendOpts","beforeInit","afterEvent","Title","lineCount","textSize","titleFont","titleX","titleY","createNewTitleBlockAndAttach","titleOpts","titleBlock","DatasetScale","getLabels","xLabels","yLabels","minIndex","maxIndex","offsetAmt","valueCategory","valueWidth","widthOffset","valueHeight","heightOffset","horz","valueDimension","defaultConfig","LinearScale","LinearScaleBase","IDMatches","hasStacks","valuesPerStack","positiveValues","negativeValues","relativePoints","valuesForType","minVal","maxVal","handleTickRangeOptions","getTickLimit","tickFontSize","handleDirectionalChanges","innerDimension","ticksAsNumbers","minSign","maxSign","setMin","suggestedMin","setMax","suggestedMax","numericGeneratorOptions","fixedStepSize","LogarithmicScale","tickValues","newVal","animate","showLabelBackdrop","backdropColor","backdropPaddingY","backdropPaddingX","getValueCount","getPointLabelFontOptions","pointLabelOptions","measureLabelSize","determineLimits","fitWithPointLabels","plFont","largestPossibleRadius","furthestLimits","furthestAngles","_pointLabelSizes","valueCount","getPointPosition","getIndexAngle","hLimits","vLimits","setReductions","drawingArea","setCenterPoint","getTextAlignForAngle","adjustPointPositionForLabelHeight","drawPointLabels","angleLineOpts","pointLabelOpts","outerDistance","outerPosition","pointLabelPosition","pointLabelFontColor","drawRadiusLine","numberOrZero","param","LinearRadialScale","radiusReductionLeft","radiusReductionRight","radiusReductionTop","radiusReductionBottom","leftMovement","rightMovement","topMovement","bottomMovement","maxRight","maxLeft","maxTop","maxBottom","angleMultiplier","startAngleRadians","scalingFactor","distanceFromCenter","thisAngle","tickFontStyle","tickFontFamily","tickLabelFont","yCenterOffset","MIN_INTEGER","MIN_SAFE_INTEGER","MAX_INTEGER","MAX_SAFE_INTEGER","INTERVALS","steps","UNITS","sorter","arrayUnique","hash","buildLookupTable","timestamps","distribution","table","prev","curr","lookup","lo","mid","i0","i1","skey","tkey","momentify","parser","parse","determineStepSize","capacity","interval","factor","determineUnit","minUnit","determineMajorUnit","generate","timeOpts","unitStepSize","majorTicksEnabled","first","computeOffsets","upper","lower","ticksFromTimestamps","majorUnit","TimeScale","timestamp","_horizontal","_table","_timestamps","displayFormats","getLabelCapacity","_unit","_majorUnit","_minorFormat","_majorFormat","_offsets","tooltipFormat","tickFormatFunction","majorFormat","majorTime","majorTickOpts","formatter","getPixelForOffset","getLabelWidth","ticksOpts","tickLabelWidth","exampleTime","exampleLabel","displayFormat"],"mappings":"kRAoBA,CAAC,SAASA,CAAT,CAAW,CAAC,GAAoB,QAAjB,uBAAOC,CAAAA,OAAP,qBAAOA,OAAP,IAA2C,WAAhB,QAAOC,CAAAA,MAArC,CAA0D,CAACA,MAAM,CAACD,OAAP,CAAeD,CAAC,EAAG,CAA9E,IAAmF,IAAmB,UAAhB,QAAOG,CAAAA,MAAP,EAA4BA,MAAM,CAACC,GAAtC,CAA0C,CAACD,OAAM,qBAAC,EAAD,CAAIH,CAAJ,CAAO,CAAxD,IAA4D,CAAC,GAAIK,CAAAA,CAAJ,CAAM,GAAmB,WAAhB,QAAOC,CAAAA,MAAV,CAA+B,CAACD,CAAC,CAACC,MAAO,CAAzC,IAA8C,IAAmB,WAAhB,QAAOC,CAAAA,MAAV,CAA+B,CAACF,CAAC,CAACE,MAAO,CAAzC,IAA8C,IAAiB,WAAd,QAAOC,CAAAA,IAAV,CAA6B,CAACH,CAAC,CAACG,IAAK,CAArC,IAAyC,CAACH,CAAC,CAAC,IAAK,CAAAA,CAAC,CAACI,KAAF,CAAUT,CAAC,EAAG,CAAC,CAA/T,EAAiU,UAAU,CAAC,GAAIG,CAAAA,CAAJ,CAA0B,MAAQ,SAASO,CAAAA,CAAT,C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AQ,GADL,CAWH7kD,MAAM,CAAE,MAXL,CAaHklD,KAAK,CAAE,CACHlU,OAAO,GADJ,CAbJ,CA3CS,CA4VpB,CACH,CAEJ,CAhuB+B,CAguB9B,CAAC,GAAK,EAAN,CAAS,GAAK,EAAd,CAAiB,EAAI,CAArB,CAhuB8B,CAn1iBwwB,CAA3b,CAmjkBjV,EAnjkBiV,CAmjkB9U,CAAC,CAAD,CAnjkB8U,EAmjkBzU,CAnjkByU,CAojkB5W,CApjkBD","sourcesContent":["/*!\n * Chart.js\n * http://chartjs.org/\n * Version: 2.2.2\n *\n * Copyright 2016 Nick Downie\n * Released under the MIT license\n * https://github.com/chartjs/Chart.js/blob/master/LICENSE.md\n */\n\n/**\n * Description of import into Moodle:\n *\n * - Download Chart.bundle.js from https://github.com/chartjs/Chart.js/releases.\n * - Copy Chart.bundle.js content to lib/amd/src/chartjs-lazy.js.\n * - Convert line endings to LF-Unix format.\n * - Keep these instructions to the file.\n * - Visit lib/tests/other/chartjstestpage.php to see if the library still works after the update.\n */\n\n(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.Chart = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o lum2) {\n return (lum1 + 0.05) / (lum2 + 0.05);\n }\n return (lum2 + 0.05) / (lum1 + 0.05);\n },\n\n level: function (color2) {\n var contrastRatio = this.contrast(color2);\n if (contrastRatio >= 7.1) {\n return 'AAA';\n }\n\n return (contrastRatio >= 4.5) ? 'AA' : '';\n },\n\n dark: function () {\n // YIQ equation from http://24ways.org/2010/calculating-color-contrast\n var rgb = this.values.rgb;\n var yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000;\n return yiq < 128;\n },\n\n light: function () {\n return !this.dark();\n },\n\n negate: function () {\n var rgb = [];\n for (var i = 0; i < 3; i++) {\n rgb[i] = 255 - this.values.rgb[i];\n }\n this.setValues('rgb', rgb);\n return this;\n },\n\n lighten: function (ratio) {\n var hsl = this.values.hsl;\n hsl[2] += hsl[2] * ratio;\n this.setValues('hsl', hsl);\n return this;\n },\n\n darken: function (ratio) {\n var hsl = this.values.hsl;\n hsl[2] -= hsl[2] * ratio;\n this.setValues('hsl', hsl);\n return this;\n },\n\n saturate: function (ratio) {\n var hsl = this.values.hsl;\n hsl[1] += hsl[1] * ratio;\n this.setValues('hsl', hsl);\n return this;\n },\n\n desaturate: function (ratio) {\n var hsl = this.values.hsl;\n hsl[1] -= hsl[1] * ratio;\n this.setValues('hsl', hsl);\n return this;\n },\n\n whiten: function (ratio) {\n var hwb = this.values.hwb;\n hwb[1] += hwb[1] * ratio;\n this.setValues('hwb', hwb);\n return this;\n },\n\n blacken: function (ratio) {\n var hwb = this.values.hwb;\n hwb[2] += hwb[2] * ratio;\n this.setValues('hwb', hwb);\n return this;\n },\n\n greyscale: function () {\n var rgb = this.values.rgb;\n // http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale\n var val = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;\n this.setValues('rgb', [val, val, val]);\n return this;\n },\n\n clearer: function (ratio) {\n var alpha = this.values.alpha;\n this.setValues('alpha', alpha - (alpha * ratio));\n return this;\n },\n\n opaquer: function (ratio) {\n var alpha = this.values.alpha;\n this.setValues('alpha', alpha + (alpha * ratio));\n return this;\n },\n\n rotate: function (degrees) {\n var hsl = this.values.hsl;\n var hue = (hsl[0] + degrees) % 360;\n hsl[0] = hue < 0 ? 360 + hue : hue;\n this.setValues('hsl', hsl);\n return this;\n },\n\n /**\n * Ported from sass implementation in C\n * https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209\n */\n mix: function (mixinColor, weight) {\n var color1 = this;\n var color2 = mixinColor;\n var p = weight === undefined ? 0.5 : weight;\n\n var w = 2 * p - 1;\n var a = color1.alpha() - color2.alpha();\n\n var w1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n var w2 = 1 - w1;\n\n return this\n .rgb(\n w1 * color1.red() + w2 * color2.red(),\n w1 * color1.green() + w2 * color2.green(),\n w1 * color1.blue() + w2 * color2.blue()\n )\n .alpha(color1.alpha() * p + color2.alpha() * (1 - p));\n },\n\n toJSON: function () {\n return this.rgb();\n },\n\n clone: function () {\n // NOTE(SB): using node-clone creates a dependency to Buffer when using browserify,\n // making the final build way to big to embed in Chart.js. So let's do it manually,\n // assuming that values to clone are 1 dimension arrays containing only numbers,\n // except 'alpha' which is a number.\n var result = new Color();\n var source = this.values;\n var target = result.values;\n var value, type;\n\n for (var prop in source) {\n if (source.hasOwnProperty(prop)) {\n value = source[prop];\n type = ({}).toString.call(value);\n if (type === '[object Array]') {\n target[prop] = value.slice(0);\n } else if (type === '[object Number]') {\n target[prop] = value;\n } else {\n console.error('unexpected color value:', value);\n }\n }\n }\n\n return result;\n }\n };\n\n Color.prototype.spaces = {\n rgb: ['red', 'green', 'blue'],\n hsl: ['hue', 'saturation', 'lightness'],\n hsv: ['hue', 'saturation', 'value'],\n hwb: ['hue', 'whiteness', 'blackness'],\n cmyk: ['cyan', 'magenta', 'yellow', 'black']\n };\n\n Color.prototype.maxes = {\n rgb: [255, 255, 255],\n hsl: [360, 100, 100],\n hsv: [360, 100, 100],\n hwb: [360, 100, 100],\n cmyk: [100, 100, 100, 100]\n };\n\n Color.prototype.getValues = function (space) {\n var values = this.values;\n var vals = {};\n\n for (var i = 0; i < space.length; i++) {\n vals[space.charAt(i)] = values[space][i];\n }\n\n if (values.alpha !== 1) {\n vals.a = values.alpha;\n }\n\n // {r: 255, g: 255, b: 255, a: 0.4}\n return vals;\n };\n\n Color.prototype.setValues = function (space, vals) {\n var values = this.values;\n var spaces = this.spaces;\n var maxes = this.maxes;\n var alpha = 1;\n var i;\n\n this.valid = true;\n\n if (space === 'alpha') {\n alpha = vals;\n } else if (vals.length) {\n // [10, 10, 10]\n values[space] = vals.slice(0, space.length);\n alpha = vals[space.length];\n } else if (vals[space.charAt(0)] !== undefined) {\n // {r: 10, g: 10, b: 10}\n for (i = 0; i < space.length; i++) {\n values[space][i] = vals[space.charAt(i)];\n }\n\n alpha = vals.a;\n } else if (vals[spaces[space][0]] !== undefined) {\n // {red: 10, green: 10, blue: 10}\n var chans = spaces[space];\n\n for (i = 0; i < space.length; i++) {\n values[space][i] = vals[chans[i]];\n }\n\n alpha = vals.alpha;\n }\n\n values.alpha = Math.max(0, Math.min(1, (alpha === undefined ? values.alpha : alpha)));\n\n if (space === 'alpha') {\n return false;\n }\n\n var capped;\n\n // cap values of the space prior converting all values\n for (i = 0; i < space.length; i++) {\n capped = Math.max(0, Math.min(maxes[space][i], values[space][i]));\n values[space][i] = Math.round(capped);\n }\n\n // convert to all the other color spaces\n for (var sname in spaces) {\n if (sname !== space) {\n values[sname] = convert[space][sname](values[space]);\n }\n }\n\n return true;\n };\n\n Color.prototype.setSpace = function (space, args) {\n var vals = args[0];\n\n if (vals === undefined) {\n // color.rgb()\n return this.getValues(space);\n }\n\n // color.rgb(10, 10, 10)\n if (typeof vals === 'number') {\n vals = Array.prototype.slice.call(args);\n }\n\n this.setValues(space, vals);\n return this;\n };\n\n Color.prototype.setChannel = function (space, index, val) {\n var svalues = this.values[space];\n if (val === undefined) {\n // color.red()\n return svalues[index];\n } else if (val === svalues[index]) {\n // color.red(color.red())\n return this;\n }\n\n // color.red(100)\n svalues[index] = val;\n this.setValues(space, svalues);\n\n return this;\n };\n\n if (typeof window !== 'undefined') {\n window.Color = Color;\n }\n\n module.exports = Color;\n\n},{\"1\":1,\"4\":4}],3:[function(require,module,exports){\n\t/* MIT license */\n\n module.exports = {\n rgb2hsl: rgb2hsl,\n rgb2hsv: rgb2hsv,\n rgb2hwb: rgb2hwb,\n rgb2cmyk: rgb2cmyk,\n rgb2keyword: rgb2keyword,\n rgb2xyz: rgb2xyz,\n rgb2lab: rgb2lab,\n rgb2lch: rgb2lch,\n\n hsl2rgb: hsl2rgb,\n hsl2hsv: hsl2hsv,\n hsl2hwb: hsl2hwb,\n hsl2cmyk: hsl2cmyk,\n hsl2keyword: hsl2keyword,\n\n hsv2rgb: hsv2rgb,\n hsv2hsl: hsv2hsl,\n hsv2hwb: hsv2hwb,\n hsv2cmyk: hsv2cmyk,\n hsv2keyword: hsv2keyword,\n\n hwb2rgb: hwb2rgb,\n hwb2hsl: hwb2hsl,\n hwb2hsv: hwb2hsv,\n hwb2cmyk: hwb2cmyk,\n hwb2keyword: hwb2keyword,\n\n cmyk2rgb: cmyk2rgb,\n cmyk2hsl: cmyk2hsl,\n cmyk2hsv: cmyk2hsv,\n cmyk2hwb: cmyk2hwb,\n cmyk2keyword: cmyk2keyword,\n\n keyword2rgb: keyword2rgb,\n keyword2hsl: keyword2hsl,\n keyword2hsv: keyword2hsv,\n keyword2hwb: keyword2hwb,\n keyword2cmyk: keyword2cmyk,\n keyword2lab: keyword2lab,\n keyword2xyz: keyword2xyz,\n\n xyz2rgb: xyz2rgb,\n xyz2lab: xyz2lab,\n xyz2lch: xyz2lch,\n\n lab2xyz: lab2xyz,\n lab2rgb: lab2rgb,\n lab2lch: lab2lch,\n\n lch2lab: lch2lab,\n lch2xyz: lch2xyz,\n lch2rgb: lch2rgb\n }\n\n\n function rgb2hsl(rgb) {\n var r = rgb[0]/255,\n g = rgb[1]/255,\n b = rgb[2]/255,\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n delta = max - min,\n h, s, l;\n\n if (max == min)\n h = 0;\n else if (r == max)\n h = (g - b) / delta;\n else if (g == max)\n h = 2 + (b - r) / delta;\n else if (b == max)\n h = 4 + (r - g)/ delta;\n\n h = Math.min(h * 60, 360);\n\n if (h < 0)\n h += 360;\n\n l = (min + max) / 2;\n\n if (max == min)\n s = 0;\n else if (l <= 0.5)\n s = delta / (max + min);\n else\n s = delta / (2 - max - min);\n\n return [h, s * 100, l * 100];\n }\n\n function rgb2hsv(rgb) {\n var r = rgb[0],\n g = rgb[1],\n b = rgb[2],\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n delta = max - min,\n h, s, v;\n\n if (max == 0)\n s = 0;\n else\n s = (delta/max * 1000)/10;\n\n if (max == min)\n h = 0;\n else if (r == max)\n h = (g - b) / delta;\n else if (g == max)\n h = 2 + (b - r) / delta;\n else if (b == max)\n h = 4 + (r - g) / delta;\n\n h = Math.min(h * 60, 360);\n\n if (h < 0)\n h += 360;\n\n v = ((max / 255) * 1000) / 10;\n\n return [h, s, v];\n }\n\n function rgb2hwb(rgb) {\n var r = rgb[0],\n g = rgb[1],\n b = rgb[2],\n h = rgb2hsl(rgb)[0],\n w = 1/255 * Math.min(r, Math.min(g, b)),\n b = 1 - 1/255 * Math.max(r, Math.max(g, b));\n\n return [h, w * 100, b * 100];\n }\n\n function rgb2cmyk(rgb) {\n var r = rgb[0] / 255,\n g = rgb[1] / 255,\n b = rgb[2] / 255,\n c, m, y, k;\n\n k = Math.min(1 - r, 1 - g, 1 - b);\n c = (1 - r - k) / (1 - k) || 0;\n m = (1 - g - k) / (1 - k) || 0;\n y = (1 - b - k) / (1 - k) || 0;\n return [c * 100, m * 100, y * 100, k * 100];\n }\n\n function rgb2keyword(rgb) {\n return reverseKeywords[JSON.stringify(rgb)];\n }\n\n function rgb2xyz(rgb) {\n var r = rgb[0] / 255,\n g = rgb[1] / 255,\n b = rgb[2] / 255;\n\n // assume sRGB\n r = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92);\n g = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92);\n b = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92);\n\n var x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);\n var y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);\n var z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);\n\n return [x * 100, y *100, z * 100];\n }\n\n function rgb2lab(rgb) {\n var xyz = rgb2xyz(rgb),\n x = xyz[0],\n y = xyz[1],\n z = xyz[2],\n l, a, b;\n\n x /= 95.047;\n y /= 100;\n z /= 108.883;\n\n x = x > 0.008856 ? Math.pow(x, 1/3) : (7.787 * x) + (16 / 116);\n y = y > 0.008856 ? Math.pow(y, 1/3) : (7.787 * y) + (16 / 116);\n z = z > 0.008856 ? Math.pow(z, 1/3) : (7.787 * z) + (16 / 116);\n\n l = (116 * y) - 16;\n a = 500 * (x - y);\n b = 200 * (y - z);\n\n return [l, a, b];\n }\n\n function rgb2lch(args) {\n return lab2lch(rgb2lab(args));\n }\n\n function hsl2rgb(hsl) {\n var h = hsl[0] / 360,\n s = hsl[1] / 100,\n l = hsl[2] / 100,\n t1, t2, t3, rgb, val;\n\n if (s == 0) {\n val = l * 255;\n return [val, val, val];\n }\n\n if (l < 0.5)\n t2 = l * (1 + s);\n else\n t2 = l + s - l * s;\n t1 = 2 * l - t2;\n\n rgb = [0, 0, 0];\n for (var i = 0; i < 3; i++) {\n t3 = h + 1 / 3 * - (i - 1);\n t3 < 0 && t3++;\n t3 > 1 && t3--;\n\n if (6 * t3 < 1)\n val = t1 + (t2 - t1) * 6 * t3;\n else if (2 * t3 < 1)\n val = t2;\n else if (3 * t3 < 2)\n val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;\n else\n val = t1;\n\n rgb[i] = val * 255;\n }\n\n return rgb;\n }\n\n function hsl2hsv(hsl) {\n var h = hsl[0],\n s = hsl[1] / 100,\n l = hsl[2] / 100,\n sv, v;\n\n if(l === 0) {\n // no need to do calc on black\n // also avoids divide by 0 error\n return [0, 0, 0];\n }\n\n l *= 2;\n s *= (l <= 1) ? l : 2 - l;\n v = (l + s) / 2;\n sv = (2 * s) / (l + s);\n return [h, sv * 100, v * 100];\n }\n\n function hsl2hwb(args) {\n return rgb2hwb(hsl2rgb(args));\n }\n\n function hsl2cmyk(args) {\n return rgb2cmyk(hsl2rgb(args));\n }\n\n function hsl2keyword(args) {\n return rgb2keyword(hsl2rgb(args));\n }\n\n\n function hsv2rgb(hsv) {\n var h = hsv[0] / 60,\n s = hsv[1] / 100,\n v = hsv[2] / 100,\n hi = Math.floor(h) % 6;\n\n var f = h - Math.floor(h),\n p = 255 * v * (1 - s),\n q = 255 * v * (1 - (s * f)),\n t = 255 * v * (1 - (s * (1 - f))),\n v = 255 * v;\n\n switch(hi) {\n case 0:\n return [v, t, p];\n case 1:\n return [q, v, p];\n case 2:\n return [p, v, t];\n case 3:\n return [p, q, v];\n case 4:\n return [t, p, v];\n case 5:\n return [v, p, q];\n }\n }\n\n function hsv2hsl(hsv) {\n var h = hsv[0],\n s = hsv[1] / 100,\n v = hsv[2] / 100,\n sl, l;\n\n l = (2 - s) * v;\n sl = s * v;\n sl /= (l <= 1) ? l : 2 - l;\n sl = sl || 0;\n l /= 2;\n return [h, sl * 100, l * 100];\n }\n\n function hsv2hwb(args) {\n return rgb2hwb(hsv2rgb(args))\n }\n\n function hsv2cmyk(args) {\n return rgb2cmyk(hsv2rgb(args));\n }\n\n function hsv2keyword(args) {\n return rgb2keyword(hsv2rgb(args));\n }\n\n// http://dev.w3.org/csswg/css-color/#hwb-to-rgb\n function hwb2rgb(hwb) {\n var h = hwb[0] / 360,\n wh = hwb[1] / 100,\n bl = hwb[2] / 100,\n ratio = wh + bl,\n i, v, f, n;\n\n // wh + bl cant be > 1\n if (ratio > 1) {\n wh /= ratio;\n bl /= ratio;\n }\n\n i = Math.floor(6 * h);\n v = 1 - bl;\n f = 6 * h - i;\n if ((i & 0x01) != 0) {\n f = 1 - f;\n }\n n = wh + f * (v - wh); // linear interpolation\n\n switch (i) {\n default:\n case 6:\n case 0: r = v; g = n; b = wh; break;\n case 1: r = n; g = v; b = wh; break;\n case 2: r = wh; g = v; b = n; break;\n case 3: r = wh; g = n; b = v; break;\n case 4: r = n; g = wh; b = v; break;\n case 5: r = v; g = wh; b = n; break;\n }\n\n return [r * 255, g * 255, b * 255];\n }\n\n function hwb2hsl(args) {\n return rgb2hsl(hwb2rgb(args));\n }\n\n function hwb2hsv(args) {\n return rgb2hsv(hwb2rgb(args));\n }\n\n function hwb2cmyk(args) {\n return rgb2cmyk(hwb2rgb(args));\n }\n\n function hwb2keyword(args) {\n return rgb2keyword(hwb2rgb(args));\n }\n\n function cmyk2rgb(cmyk) {\n var c = cmyk[0] / 100,\n m = cmyk[1] / 100,\n y = cmyk[2] / 100,\n k = cmyk[3] / 100,\n r, g, b;\n\n r = 1 - Math.min(1, c * (1 - k) + k);\n g = 1 - Math.min(1, m * (1 - k) + k);\n b = 1 - Math.min(1, y * (1 - k) + k);\n return [r * 255, g * 255, b * 255];\n }\n\n function cmyk2hsl(args) {\n return rgb2hsl(cmyk2rgb(args));\n }\n\n function cmyk2hsv(args) {\n return rgb2hsv(cmyk2rgb(args));\n }\n\n function cmyk2hwb(args) {\n return rgb2hwb(cmyk2rgb(args));\n }\n\n function cmyk2keyword(args) {\n return rgb2keyword(cmyk2rgb(args));\n }\n\n\n function xyz2rgb(xyz) {\n var x = xyz[0] / 100,\n y = xyz[1] / 100,\n z = xyz[2] / 100,\n r, g, b;\n\n r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);\n g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);\n b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);\n\n // assume sRGB\n r = r > 0.0031308 ? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055)\n : r = (r * 12.92);\n\n g = g > 0.0031308 ? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055)\n : g = (g * 12.92);\n\n b = b > 0.0031308 ? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055)\n : b = (b * 12.92);\n\n r = Math.min(Math.max(0, r), 1);\n g = Math.min(Math.max(0, g), 1);\n b = Math.min(Math.max(0, b), 1);\n\n return [r * 255, g * 255, b * 255];\n }\n\n function xyz2lab(xyz) {\n var x = xyz[0],\n y = xyz[1],\n z = xyz[2],\n l, a, b;\n\n x /= 95.047;\n y /= 100;\n z /= 108.883;\n\n x = x > 0.008856 ? Math.pow(x, 1/3) : (7.787 * x) + (16 / 116);\n y = y > 0.008856 ? Math.pow(y, 1/3) : (7.787 * y) + (16 / 116);\n z = z > 0.008856 ? Math.pow(z, 1/3) : (7.787 * z) + (16 / 116);\n\n l = (116 * y) - 16;\n a = 500 * (x - y);\n b = 200 * (y - z);\n\n return [l, a, b];\n }\n\n function xyz2lch(args) {\n return lab2lch(xyz2lab(args));\n }\n\n function lab2xyz(lab) {\n var l = lab[0],\n a = lab[1],\n b = lab[2],\n x, y, z, y2;\n\n if (l <= 8) {\n y = (l * 100) / 903.3;\n y2 = (7.787 * (y / 100)) + (16 / 116);\n } else {\n y = 100 * Math.pow((l + 16) / 116, 3);\n y2 = Math.pow(y / 100, 1/3);\n }\n\n x = x / 95.047 <= 0.008856 ? x = (95.047 * ((a / 500) + y2 - (16 / 116))) / 7.787 : 95.047 * Math.pow((a / 500) + y2, 3);\n\n z = z / 108.883 <= 0.008859 ? z = (108.883 * (y2 - (b / 200) - (16 / 116))) / 7.787 : 108.883 * Math.pow(y2 - (b / 200), 3);\n\n return [x, y, z];\n }\n\n function lab2lch(lab) {\n var l = lab[0],\n a = lab[1],\n b = lab[2],\n hr, h, c;\n\n hr = Math.atan2(b, a);\n h = hr * 360 / 2 / Math.PI;\n if (h < 0) {\n h += 360;\n }\n c = Math.sqrt(a * a + b * b);\n return [l, c, h];\n }\n\n function lab2rgb(args) {\n return xyz2rgb(lab2xyz(args));\n }\n\n function lch2lab(lch) {\n var l = lch[0],\n c = lch[1],\n h = lch[2],\n a, b, hr;\n\n hr = h / 360 * 2 * Math.PI;\n a = c * Math.cos(hr);\n b = c * Math.sin(hr);\n return [l, a, b];\n }\n\n function lch2xyz(args) {\n return lab2xyz(lch2lab(args));\n }\n\n function lch2rgb(args) {\n return lab2rgb(lch2lab(args));\n }\n\n function keyword2rgb(keyword) {\n return cssKeywords[keyword];\n }\n\n function keyword2hsl(args) {\n return rgb2hsl(keyword2rgb(args));\n }\n\n function keyword2hsv(args) {\n return rgb2hsv(keyword2rgb(args));\n }\n\n function keyword2hwb(args) {\n return rgb2hwb(keyword2rgb(args));\n }\n\n function keyword2cmyk(args) {\n return rgb2cmyk(keyword2rgb(args));\n }\n\n function keyword2lab(args) {\n return rgb2lab(keyword2rgb(args));\n }\n\n function keyword2xyz(args) {\n return rgb2xyz(keyword2rgb(args));\n }\n\n var cssKeywords = {\n aliceblue: [240,248,255],\n antiquewhite: [250,235,215],\n aqua: [0,255,255],\n aquamarine: [127,255,212],\n azure: [240,255,255],\n beige: [245,245,220],\n bisque: [255,228,196],\n black: [0,0,0],\n blanchedalmond: [255,235,205],\n blue: [0,0,255],\n blueviolet: [138,43,226],\n brown: [165,42,42],\n burlywood: [222,184,135],\n cadetblue: [95,158,160],\n chartreuse: [127,255,0],\n chocolate: [210,105,30],\n coral: [255,127,80],\n cornflowerblue: [100,149,237],\n cornsilk: [255,248,220],\n crimson: [220,20,60],\n cyan: [0,255,255],\n darkblue: [0,0,139],\n darkcyan: [0,139,139],\n darkgoldenrod: [184,134,11],\n darkgray: [169,169,169],\n darkgreen: [0,100,0],\n darkgrey: [169,169,169],\n darkkhaki: [189,183,107],\n darkmagenta: [139,0,139],\n darkolivegreen: [85,107,47],\n darkorange: [255,140,0],\n darkorchid: [153,50,204],\n darkred: [139,0,0],\n darksalmon: [233,150,122],\n darkseagreen: [143,188,143],\n darkslateblue: [72,61,139],\n darkslategray: [47,79,79],\n darkslategrey: [47,79,79],\n darkturquoise: [0,206,209],\n darkviolet: [148,0,211],\n deeppink: [255,20,147],\n deepskyblue: [0,191,255],\n dimgray: [105,105,105],\n dimgrey: [105,105,105],\n dodgerblue: [30,144,255],\n firebrick: [178,34,34],\n floralwhite: [255,250,240],\n forestgreen: [34,139,34],\n fuchsia: [255,0,255],\n gainsboro: [220,220,220],\n ghostwhite: [248,248,255],\n gold: [255,215,0],\n goldenrod: [218,165,32],\n gray: [128,128,128],\n green: [0,128,0],\n greenyellow: [173,255,47],\n grey: [128,128,128],\n honeydew: [240,255,240],\n hotpink: [255,105,180],\n indianred: [205,92,92],\n indigo: [75,0,130],\n ivory: [255,255,240],\n khaki: [240,230,140],\n lavender: [230,230,250],\n lavenderblush: [255,240,245],\n lawngreen: [124,252,0],\n lemonchiffon: [255,250,205],\n lightblue: [173,216,230],\n lightcoral: [240,128,128],\n lightcyan: [224,255,255],\n lightgoldenrodyellow: [250,250,210],\n lightgray: [211,211,211],\n lightgreen: [144,238,144],\n lightgrey: [211,211,211],\n lightpink: [255,182,193],\n lightsalmon: [255,160,122],\n lightseagreen: [32,178,170],\n lightskyblue: [135,206,250],\n lightslategray: [119,136,153],\n lightslategrey: [119,136,153],\n lightsteelblue: [176,196,222],\n lightyellow: [255,255,224],\n lime: [0,255,0],\n limegreen: [50,205,50],\n linen: [250,240,230],\n magenta: [255,0,255],\n maroon: [128,0,0],\n mediumaquamarine: [102,205,170],\n mediumblue: [0,0,205],\n mediumorchid: [186,85,211],\n mediumpurple: [147,112,219],\n mediumseagreen: [60,179,113],\n mediumslateblue: [123,104,238],\n mediumspringgreen: [0,250,154],\n mediumturquoise: [72,209,204],\n mediumvioletred: [199,21,133],\n midnightblue: [25,25,112],\n mintcream: [245,255,250],\n mistyrose: [255,228,225],\n moccasin: [255,228,181],\n navajowhite: [255,222,173],\n navy: [0,0,128],\n oldlace: [253,245,230],\n olive: [128,128,0],\n olivedrab: [107,142,35],\n orange: [255,165,0],\n orangered: [255,69,0],\n orchid: [218,112,214],\n palegoldenrod: [238,232,170],\n palegreen: [152,251,152],\n paleturquoise: [175,238,238],\n palevioletred: [219,112,147],\n papayawhip: [255,239,213],\n peachpuff: [255,218,185],\n peru: [205,133,63],\n pink: [255,192,203],\n plum: [221,160,221],\n powderblue: [176,224,230],\n purple: [128,0,128],\n rebeccapurple: [102, 51, 153],\n red: [255,0,0],\n rosybrown: [188,143,143],\n royalblue: [65,105,225],\n saddlebrown: [139,69,19],\n salmon: [250,128,114],\n sandybrown: [244,164,96],\n seagreen: [46,139,87],\n seashell: [255,245,238],\n sienna: [160,82,45],\n silver: [192,192,192],\n skyblue: [135,206,235],\n slateblue: [106,90,205],\n slategray: [112,128,144],\n slategrey: [112,128,144],\n snow: [255,250,250],\n springgreen: [0,255,127],\n steelblue: [70,130,180],\n tan: [210,180,140],\n teal: [0,128,128],\n thistle: [216,191,216],\n tomato: [255,99,71],\n turquoise: [64,224,208],\n violet: [238,130,238],\n wheat: [245,222,179],\n white: [255,255,255],\n whitesmoke: [245,245,245],\n yellow: [255,255,0],\n yellowgreen: [154,205,50]\n };\n\n var reverseKeywords = {};\n for (var key in cssKeywords) {\n reverseKeywords[JSON.stringify(cssKeywords[key])] = key;\n }\n\n},{}],4:[function(require,module,exports){\n var conversions = require(3);\n\n var convert = function() {\n return new Converter();\n }\n\n for (var func in conversions) {\n // export Raw versions\n convert[func + \"Raw\"] = (function(func) {\n // accept array or plain args\n return function(arg) {\n if (typeof arg == \"number\")\n arg = Array.prototype.slice.call(arguments);\n return conversions[func](arg);\n }\n })(func);\n\n var pair = /(\\w+)2(\\w+)/.exec(func),\n from = pair[1],\n to = pair[2];\n\n // export rgb2hsl and [\"rgb\"][\"hsl\"]\n convert[from] = convert[from] || {};\n\n convert[from][to] = convert[func] = (function(func) {\n return function(arg) {\n if (typeof arg == \"number\")\n arg = Array.prototype.slice.call(arguments);\n\n var val = conversions[func](arg);\n if (typeof val == \"string\" || val === undefined)\n return val; // keyword\n\n for (var i = 0; i < val.length; i++)\n val[i] = Math.round(val[i]);\n return val;\n }\n })(func);\n }\n\n\n\t/* Converter does lazy conversion and caching */\n var Converter = function() {\n this.convs = {};\n };\n\n\t/* Either get the values for a space or\n\t set the values for a space, depending on args */\n Converter.prototype.routeSpace = function(space, args) {\n var values = args[0];\n if (values === undefined) {\n // color.rgb()\n return this.getValues(space);\n }\n // color.rgb(10, 10, 10)\n if (typeof values == \"number\") {\n values = Array.prototype.slice.call(args);\n }\n\n return this.setValues(space, values);\n };\n\n\t/* Set the values for a space, invalidating cache */\n Converter.prototype.setValues = function(space, values) {\n this.space = space;\n this.convs = {};\n this.convs[space] = values;\n return this;\n };\n\n\t/* Get the values for a space. If there's already\n\t a conversion for the space, fetch it, otherwise\n\t compute it */\n Converter.prototype.getValues = function(space) {\n var vals = this.convs[space];\n if (!vals) {\n var fspace = this.space,\n from = this.convs[fspace];\n vals = convert[fspace][space](from);\n\n this.convs[space] = vals;\n }\n return vals;\n };\n\n [\"rgb\", \"hsl\", \"hsv\", \"cmyk\", \"keyword\"].forEach(function(space) {\n Converter.prototype[space] = function(vals) {\n return this.routeSpace(space, arguments);\n }\n });\n\n module.exports = convert;\n},{\"3\":3}],5:[function(require,module,exports){\n 'use strict'\n\n module.exports = {\n \"aliceblue\": [240, 248, 255],\n \"antiquewhite\": [250, 235, 215],\n \"aqua\": [0, 255, 255],\n \"aquamarine\": [127, 255, 212],\n \"azure\": [240, 255, 255],\n \"beige\": [245, 245, 220],\n \"bisque\": [255, 228, 196],\n \"black\": [0, 0, 0],\n \"blanchedalmond\": [255, 235, 205],\n \"blue\": [0, 0, 255],\n \"blueviolet\": [138, 43, 226],\n \"brown\": [165, 42, 42],\n \"burlywood\": [222, 184, 135],\n \"cadetblue\": [95, 158, 160],\n \"chartreuse\": [127, 255, 0],\n \"chocolate\": [210, 105, 30],\n \"coral\": [255, 127, 80],\n \"cornflowerblue\": [100, 149, 237],\n \"cornsilk\": [255, 248, 220],\n \"crimson\": [220, 20, 60],\n \"cyan\": [0, 255, 255],\n \"darkblue\": [0, 0, 139],\n \"darkcyan\": [0, 139, 139],\n \"darkgoldenrod\": [184, 134, 11],\n \"darkgray\": [169, 169, 169],\n \"darkgreen\": [0, 100, 0],\n \"darkgrey\": [169, 169, 169],\n \"darkkhaki\": [189, 183, 107],\n \"darkmagenta\": [139, 0, 139],\n \"darkolivegreen\": [85, 107, 47],\n \"darkorange\": [255, 140, 0],\n \"darkorchid\": [153, 50, 204],\n \"darkred\": [139, 0, 0],\n \"darksalmon\": [233, 150, 122],\n \"darkseagreen\": [143, 188, 143],\n \"darkslateblue\": [72, 61, 139],\n \"darkslategray\": [47, 79, 79],\n \"darkslategrey\": [47, 79, 79],\n \"darkturquoise\": [0, 206, 209],\n \"darkviolet\": [148, 0, 211],\n \"deeppink\": [255, 20, 147],\n \"deepskyblue\": [0, 191, 255],\n \"dimgray\": [105, 105, 105],\n \"dimgrey\": [105, 105, 105],\n \"dodgerblue\": [30, 144, 255],\n \"firebrick\": [178, 34, 34],\n \"floralwhite\": [255, 250, 240],\n \"forestgreen\": [34, 139, 34],\n \"fuchsia\": [255, 0, 255],\n \"gainsboro\": [220, 220, 220],\n \"ghostwhite\": [248, 248, 255],\n \"gold\": [255, 215, 0],\n \"goldenrod\": [218, 165, 32],\n \"gray\": [128, 128, 128],\n \"green\": [0, 128, 0],\n \"greenyellow\": [173, 255, 47],\n \"grey\": [128, 128, 128],\n \"honeydew\": [240, 255, 240],\n \"hotpink\": [255, 105, 180],\n \"indianred\": [205, 92, 92],\n \"indigo\": [75, 0, 130],\n \"ivory\": [255, 255, 240],\n \"khaki\": [240, 230, 140],\n \"lavender\": [230, 230, 250],\n \"lavenderblush\": [255, 240, 245],\n \"lawngreen\": [124, 252, 0],\n \"lemonchiffon\": [255, 250, 205],\n \"lightblue\": [173, 216, 230],\n \"lightcoral\": [240, 128, 128],\n \"lightcyan\": [224, 255, 255],\n \"lightgoldenrodyellow\": [250, 250, 210],\n \"lightgray\": [211, 211, 211],\n \"lightgreen\": [144, 238, 144],\n \"lightgrey\": [211, 211, 211],\n \"lightpink\": [255, 182, 193],\n \"lightsalmon\": [255, 160, 122],\n \"lightseagreen\": [32, 178, 170],\n \"lightskyblue\": [135, 206, 250],\n \"lightslategray\": [119, 136, 153],\n \"lightslategrey\": [119, 136, 153],\n \"lightsteelblue\": [176, 196, 222],\n \"lightyellow\": [255, 255, 224],\n \"lime\": [0, 255, 0],\n \"limegreen\": [50, 205, 50],\n \"linen\": [250, 240, 230],\n \"magenta\": [255, 0, 255],\n \"maroon\": [128, 0, 0],\n \"mediumaquamarine\": [102, 205, 170],\n \"mediumblue\": [0, 0, 205],\n \"mediumorchid\": [186, 85, 211],\n \"mediumpurple\": [147, 112, 219],\n \"mediumseagreen\": [60, 179, 113],\n \"mediumslateblue\": [123, 104, 238],\n \"mediumspringgreen\": [0, 250, 154],\n \"mediumturquoise\": [72, 209, 204],\n \"mediumvioletred\": [199, 21, 133],\n \"midnightblue\": [25, 25, 112],\n \"mintcream\": [245, 255, 250],\n \"mistyrose\": [255, 228, 225],\n \"moccasin\": [255, 228, 181],\n \"navajowhite\": [255, 222, 173],\n \"navy\": [0, 0, 128],\n \"oldlace\": [253, 245, 230],\n \"olive\": [128, 128, 0],\n \"olivedrab\": [107, 142, 35],\n \"orange\": [255, 165, 0],\n \"orangered\": [255, 69, 0],\n \"orchid\": [218, 112, 214],\n \"palegoldenrod\": [238, 232, 170],\n \"palegreen\": [152, 251, 152],\n \"paleturquoise\": [175, 238, 238],\n \"palevioletred\": [219, 112, 147],\n \"papayawhip\": [255, 239, 213],\n \"peachpuff\": [255, 218, 185],\n \"peru\": [205, 133, 63],\n \"pink\": [255, 192, 203],\n \"plum\": [221, 160, 221],\n \"powderblue\": [176, 224, 230],\n \"purple\": [128, 0, 128],\n \"rebeccapurple\": [102, 51, 153],\n \"red\": [255, 0, 0],\n \"rosybrown\": [188, 143, 143],\n \"royalblue\": [65, 105, 225],\n \"saddlebrown\": [139, 69, 19],\n \"salmon\": [250, 128, 114],\n \"sandybrown\": [244, 164, 96],\n \"seagreen\": [46, 139, 87],\n \"seashell\": [255, 245, 238],\n \"sienna\": [160, 82, 45],\n \"silver\": [192, 192, 192],\n \"skyblue\": [135, 206, 235],\n \"slateblue\": [106, 90, 205],\n \"slategray\": [112, 128, 144],\n \"slategrey\": [112, 128, 144],\n \"snow\": [255, 250, 250],\n \"springgreen\": [0, 255, 127],\n \"steelblue\": [70, 130, 180],\n \"tan\": [210, 180, 140],\n \"teal\": [0, 128, 128],\n \"thistle\": [216, 191, 216],\n \"tomato\": [255, 99, 71],\n \"turquoise\": [64, 224, 208],\n \"violet\": [238, 130, 238],\n \"wheat\": [245, 222, 179],\n \"white\": [255, 255, 255],\n \"whitesmoke\": [245, 245, 245],\n \"yellow\": [255, 255, 0],\n \"yellowgreen\": [154, 205, 50]\n };\n\n},{}],6:[function(require,module,exports){\n//! moment.js\n//! version : 2.18.1\n//! authors : Tim Wood, Iskren Chernev, Moment.js contributors\n//! license : MIT\n//! momentjs.com\n\n ;(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n global.moment = factory()\n }(this, (function () { 'use strict';\n\n var hookCallback;\n\n function hooks () {\n return hookCallback.apply(null, arguments);\n }\n\n// This is done to register the method called with moment()\n// without creating circular dependencies.\n function setHookCallback (callback) {\n hookCallback = callback;\n }\n\n function isArray(input) {\n return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]';\n }\n\n function isObject(input) {\n // IE8 will treat undefined and null as object if it wasn't for\n // input != null\n return input != null && Object.prototype.toString.call(input) === '[object Object]';\n }\n\n function isObjectEmpty(obj) {\n var k;\n for (k in obj) {\n // even if its not own property I'd still call it non-empty\n return false;\n }\n return true;\n }\n\n function isUndefined(input) {\n return input === void 0;\n }\n\n function isNumber(input) {\n return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]';\n }\n\n function isDate(input) {\n return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';\n }\n\n function map(arr, fn) {\n var res = [], i;\n for (i = 0; i < arr.length; ++i) {\n res.push(fn(arr[i], i));\n }\n return res;\n }\n\n function hasOwnProp(a, b) {\n return Object.prototype.hasOwnProperty.call(a, b);\n }\n\n function extend(a, b) {\n for (var i in b) {\n if (hasOwnProp(b, i)) {\n a[i] = b[i];\n }\n }\n\n if (hasOwnProp(b, 'toString')) {\n a.toString = b.toString;\n }\n\n if (hasOwnProp(b, 'valueOf')) {\n a.valueOf = b.valueOf;\n }\n\n return a;\n }\n\n function createUTC (input, format, locale, strict) {\n return createLocalOrUTC(input, format, locale, strict, true).utc();\n }\n\n function defaultParsingFlags() {\n // We need to deep clone this object.\n return {\n empty : false,\n unusedTokens : [],\n unusedInput : [],\n overflow : -2,\n charsLeftOver : 0,\n nullInput : false,\n invalidMonth : null,\n invalidFormat : false,\n userInvalidated : false,\n iso : false,\n parsedDateParts : [],\n meridiem : null,\n rfc2822 : false,\n weekdayMismatch : false\n };\n }\n\n function getParsingFlags(m) {\n if (m._pf == null) {\n m._pf = defaultParsingFlags();\n }\n return m._pf;\n }\n\n var some;\n if (Array.prototype.some) {\n some = Array.prototype.some;\n } else {\n some = function (fun) {\n var t = Object(this);\n var len = t.length >>> 0;\n\n for (var i = 0; i < len; i++) {\n if (i in t && fun.call(this, t[i], i, t)) {\n return true;\n }\n }\n\n return false;\n };\n }\n\n var some$1 = some;\n\n function isValid(m) {\n if (m._isValid == null) {\n var flags = getParsingFlags(m);\n var parsedParts = some$1.call(flags.parsedDateParts, function (i) {\n return i != null;\n });\n var isNowValid = !isNaN(m._d.getTime()) &&\n flags.overflow < 0 &&\n !flags.empty &&\n !flags.invalidMonth &&\n !flags.invalidWeekday &&\n !flags.nullInput &&\n !flags.invalidFormat &&\n !flags.userInvalidated &&\n (!flags.meridiem || (flags.meridiem && parsedParts));\n\n if (m._strict) {\n isNowValid = isNowValid &&\n flags.charsLeftOver === 0 &&\n flags.unusedTokens.length === 0 &&\n flags.bigHour === undefined;\n }\n\n if (Object.isFrozen == null || !Object.isFrozen(m)) {\n m._isValid = isNowValid;\n }\n else {\n return isNowValid;\n }\n }\n return m._isValid;\n }\n\n function createInvalid (flags) {\n var m = createUTC(NaN);\n if (flags != null) {\n extend(getParsingFlags(m), flags);\n }\n else {\n getParsingFlags(m).userInvalidated = true;\n }\n\n return m;\n }\n\n// Plugins that add properties should also add the key here (null value),\n// so we can properly clone ourselves.\n var momentProperties = hooks.momentProperties = [];\n\n function copyConfig(to, from) {\n var i, prop, val;\n\n if (!isUndefined(from._isAMomentObject)) {\n to._isAMomentObject = from._isAMomentObject;\n }\n if (!isUndefined(from._i)) {\n to._i = from._i;\n }\n if (!isUndefined(from._f)) {\n to._f = from._f;\n }\n if (!isUndefined(from._l)) {\n to._l = from._l;\n }\n if (!isUndefined(from._strict)) {\n to._strict = from._strict;\n }\n if (!isUndefined(from._tzm)) {\n to._tzm = from._tzm;\n }\n if (!isUndefined(from._isUTC)) {\n to._isUTC = from._isUTC;\n }\n if (!isUndefined(from._offset)) {\n to._offset = from._offset;\n }\n if (!isUndefined(from._pf)) {\n to._pf = getParsingFlags(from);\n }\n if (!isUndefined(from._locale)) {\n to._locale = from._locale;\n }\n\n if (momentProperties.length > 0) {\n for (i = 0; i < momentProperties.length; i++) {\n prop = momentProperties[i];\n val = from[prop];\n if (!isUndefined(val)) {\n to[prop] = val;\n }\n }\n }\n\n return to;\n }\n\n var updateInProgress = false;\n\n// Moment prototype object\n function Moment(config) {\n copyConfig(this, config);\n this._d = new Date(config._d != null ? config._d.getTime() : NaN);\n if (!this.isValid()) {\n this._d = new Date(NaN);\n }\n // Prevent infinite loop in case updateOffset creates new moment\n // objects.\n if (updateInProgress === false) {\n updateInProgress = true;\n hooks.updateOffset(this);\n updateInProgress = false;\n }\n }\n\n function isMoment (obj) {\n return obj instanceof Moment || (obj != null && obj._isAMomentObject != null);\n }\n\n function absFloor (number) {\n if (number < 0) {\n // -0 -> 0\n return Math.ceil(number) || 0;\n } else {\n return Math.floor(number);\n }\n }\n\n function toInt(argumentForCoercion) {\n var coercedNumber = +argumentForCoercion,\n value = 0;\n\n if (coercedNumber !== 0 && isFinite(coercedNumber)) {\n value = absFloor(coercedNumber);\n }\n\n return value;\n }\n\n// compare two arrays, return the number of differences\n function compareArrays(array1, array2, dontConvert) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if ((dontConvert && array1[i] !== array2[i]) ||\n (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }\n\n function warn(msg) {\n if (hooks.suppressDeprecationWarnings === false &&\n (typeof console !== 'undefined') && console.warn) {\n console.warn('Deprecation warning: ' + msg);\n }\n }\n\n function deprecate(msg, fn) {\n var firstTime = true;\n\n return extend(function () {\n if (hooks.deprecationHandler != null) {\n hooks.deprecationHandler(null, msg);\n }\n if (firstTime) {\n var args = [];\n var arg;\n for (var i = 0; i < arguments.length; i++) {\n arg = '';\n if (typeof arguments[i] === 'object') {\n arg += '\\n[' + i + '] ';\n for (var key in arguments[0]) {\n arg += key + ': ' + arguments[0][key] + ', ';\n }\n arg = arg.slice(0, -2); // Remove trailing comma and space\n } else {\n arg = arguments[i];\n }\n args.push(arg);\n }\n warn(msg + '\\nArguments: ' + Array.prototype.slice.call(args).join('') + '\\n' + (new Error()).stack);\n firstTime = false;\n }\n return fn.apply(this, arguments);\n }, fn);\n }\n\n var deprecations = {};\n\n function deprecateSimple(name, msg) {\n if (hooks.deprecationHandler != null) {\n hooks.deprecationHandler(name, msg);\n }\n if (!deprecations[name]) {\n warn(msg);\n deprecations[name] = true;\n }\n }\n\n hooks.suppressDeprecationWarnings = false;\n hooks.deprecationHandler = null;\n\n function isFunction(input) {\n return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';\n }\n\n function set (config) {\n var prop, i;\n for (i in config) {\n prop = config[i];\n if (isFunction(prop)) {\n this[i] = prop;\n } else {\n this['_' + i] = prop;\n }\n }\n this._config = config;\n // Lenient ordinal parsing accepts just a number in addition to\n // number + (possibly) stuff coming from _dayOfMonthOrdinalParse.\n // TODO: Remove \"ordinalParse\" fallback in next major release.\n this._dayOfMonthOrdinalParseLenient = new RegExp(\n (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +\n '|' + (/\\d{1,2}/).source);\n }\n\n function mergeConfigs(parentConfig, childConfig) {\n var res = extend({}, parentConfig), prop;\n for (prop in childConfig) {\n if (hasOwnProp(childConfig, prop)) {\n if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {\n res[prop] = {};\n extend(res[prop], parentConfig[prop]);\n extend(res[prop], childConfig[prop]);\n } else if (childConfig[prop] != null) {\n res[prop] = childConfig[prop];\n } else {\n delete res[prop];\n }\n }\n }\n for (prop in parentConfig) {\n if (hasOwnProp(parentConfig, prop) &&\n !hasOwnProp(childConfig, prop) &&\n isObject(parentConfig[prop])) {\n // make sure changes to properties don't modify parent config\n res[prop] = extend({}, res[prop]);\n }\n }\n return res;\n }\n\n function Locale(config) {\n if (config != null) {\n this.set(config);\n }\n }\n\n var keys;\n\n if (Object.keys) {\n keys = Object.keys;\n } else {\n keys = function (obj) {\n var i, res = [];\n for (i in obj) {\n if (hasOwnProp(obj, i)) {\n res.push(i);\n }\n }\n return res;\n };\n }\n\n var keys$1 = keys;\n\n var defaultCalendar = {\n sameDay : '[Today at] LT',\n nextDay : '[Tomorrow at] LT',\n nextWeek : 'dddd [at] LT',\n lastDay : '[Yesterday at] LT',\n lastWeek : '[Last] dddd [at] LT',\n sameElse : 'L'\n };\n\n function calendar (key, mom, now) {\n var output = this._calendar[key] || this._calendar['sameElse'];\n return isFunction(output) ? output.call(mom, now) : output;\n }\n\n var defaultLongDateFormat = {\n LTS : 'h:mm:ss A',\n LT : 'h:mm A',\n L : 'MM/DD/YYYY',\n LL : 'MMMM D, YYYY',\n LLL : 'MMMM D, YYYY h:mm A',\n LLLL : 'dddd, MMMM D, YYYY h:mm A'\n };\n\n function longDateFormat (key) {\n var format = this._longDateFormat[key],\n formatUpper = this._longDateFormat[key.toUpperCase()];\n\n if (format || !formatUpper) {\n return format;\n }\n\n this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {\n return val.slice(1);\n });\n\n return this._longDateFormat[key];\n }\n\n var defaultInvalidDate = 'Invalid date';\n\n function invalidDate () {\n return this._invalidDate;\n }\n\n var defaultOrdinal = '%d';\n var defaultDayOfMonthOrdinalParse = /\\d{1,2}/;\n\n function ordinal (number) {\n return this._ordinal.replace('%d', number);\n }\n\n var defaultRelativeTime = {\n future : 'in %s',\n past : '%s ago',\n s : 'a few seconds',\n ss : '%d seconds',\n m : 'a minute',\n mm : '%d minutes',\n h : 'an hour',\n hh : '%d hours',\n d : 'a day',\n dd : '%d days',\n M : 'a month',\n MM : '%d months',\n y : 'a year',\n yy : '%d years'\n };\n\n function relativeTime (number, withoutSuffix, string, isFuture) {\n var output = this._relativeTime[string];\n return (isFunction(output)) ?\n output(number, withoutSuffix, string, isFuture) :\n output.replace(/%d/i, number);\n }\n\n function pastFuture (diff, output) {\n var format = this._relativeTime[diff > 0 ? 'future' : 'past'];\n return isFunction(format) ? format(output) : format.replace(/%s/i, output);\n }\n\n var aliases = {};\n\n function addUnitAlias (unit, shorthand) {\n var lowerCase = unit.toLowerCase();\n aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;\n }\n\n function normalizeUnits(units) {\n return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;\n }\n\n function normalizeObjectUnits(inputObject) {\n var normalizedInput = {},\n normalizedProp,\n prop;\n\n for (prop in inputObject) {\n if (hasOwnProp(inputObject, prop)) {\n normalizedProp = normalizeUnits(prop);\n if (normalizedProp) {\n normalizedInput[normalizedProp] = inputObject[prop];\n }\n }\n }\n\n return normalizedInput;\n }\n\n var priorities = {};\n\n function addUnitPriority(unit, priority) {\n priorities[unit] = priority;\n }\n\n function getPrioritizedUnits(unitsObj) {\n var units = [];\n for (var u in unitsObj) {\n units.push({unit: u, priority: priorities[u]});\n }\n units.sort(function (a, b) {\n return a.priority - b.priority;\n });\n return units;\n }\n\n function makeGetSet (unit, keepTime) {\n return function (value) {\n if (value != null) {\n set$1(this, unit, value);\n hooks.updateOffset(this, keepTime);\n return this;\n } else {\n return get(this, unit);\n }\n };\n }\n\n function get (mom, unit) {\n return mom.isValid() ?\n mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;\n }\n\n function set$1 (mom, unit, value) {\n if (mom.isValid()) {\n mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);\n }\n }\n\n// MOMENTS\n\n function stringGet (units) {\n units = normalizeUnits(units);\n if (isFunction(this[units])) {\n return this[units]();\n }\n return this;\n }\n\n\n function stringSet (units, value) {\n if (typeof units === 'object') {\n units = normalizeObjectUnits(units);\n var prioritized = getPrioritizedUnits(units);\n for (var i = 0; i < prioritized.length; i++) {\n this[prioritized[i].unit](units[prioritized[i].unit]);\n }\n } else {\n units = normalizeUnits(units);\n if (isFunction(this[units])) {\n return this[units](value);\n }\n }\n return this;\n }\n\n function zeroFill(number, targetLength, forceSign) {\n var absNumber = '' + Math.abs(number),\n zerosToFill = targetLength - absNumber.length,\n sign = number >= 0;\n return (sign ? (forceSign ? '+' : '') : '-') +\n Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;\n }\n\n var formattingTokens = /(\\[[^\\[]*\\])|(\\\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;\n\n var localFormattingTokens = /(\\[[^\\[]*\\])|(\\\\)?(LTS|LT|LL?L?L?|l{1,4})/g;\n\n var formatFunctions = {};\n\n var formatTokenFunctions = {};\n\n// token: 'M'\n// padded: ['MM', 2]\n// ordinal: 'Mo'\n// callback: function () { this.month() + 1 }\n function addFormatToken (token, padded, ordinal, callback) {\n var func = callback;\n if (typeof callback === 'string') {\n func = function () {\n return this[callback]();\n };\n }\n if (token) {\n formatTokenFunctions[token] = func;\n }\n if (padded) {\n formatTokenFunctions[padded[0]] = function () {\n return zeroFill(func.apply(this, arguments), padded[1], padded[2]);\n };\n }\n if (ordinal) {\n formatTokenFunctions[ordinal] = function () {\n return this.localeData().ordinal(func.apply(this, arguments), token);\n };\n }\n }\n\n function removeFormattingTokens(input) {\n if (input.match(/\\[[\\s\\S]/)) {\n return input.replace(/^\\[|\\]$/g, '');\n }\n return input.replace(/\\\\/g, '');\n }\n\n function makeFormatFunction(format) {\n var array = format.match(formattingTokens), i, length;\n\n for (i = 0, length = array.length; i < length; i++) {\n if (formatTokenFunctions[array[i]]) {\n array[i] = formatTokenFunctions[array[i]];\n } else {\n array[i] = removeFormattingTokens(array[i]);\n }\n }\n\n return function (mom) {\n var output = '', i;\n for (i = 0; i < length; i++) {\n output += isFunction(array[i]) ? array[i].call(mom, format) : array[i];\n }\n return output;\n };\n }\n\n// format date using native date object\n function formatMoment(m, format) {\n if (!m.isValid()) {\n return m.localeData().invalidDate();\n }\n\n format = expandFormat(format, m.localeData());\n formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);\n\n return formatFunctions[format](m);\n }\n\n function expandFormat(format, locale) {\n var i = 5;\n\n function replaceLongDateFormatTokens(input) {\n return locale.longDateFormat(input) || input;\n }\n\n localFormattingTokens.lastIndex = 0;\n while (i >= 0 && localFormattingTokens.test(format)) {\n format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);\n localFormattingTokens.lastIndex = 0;\n i -= 1;\n }\n\n return format;\n }\n\n var match1 = /\\d/; // 0 - 9\n var match2 = /\\d\\d/; // 00 - 99\n var match3 = /\\d{3}/; // 000 - 999\n var match4 = /\\d{4}/; // 0000 - 9999\n var match6 = /[+-]?\\d{6}/; // -999999 - 999999\n var match1to2 = /\\d\\d?/; // 0 - 99\n var match3to4 = /\\d\\d\\d\\d?/; // 999 - 9999\n var match5to6 = /\\d\\d\\d\\d\\d\\d?/; // 99999 - 999999\n var match1to3 = /\\d{1,3}/; // 0 - 999\n var match1to4 = /\\d{1,4}/; // 0 - 9999\n var match1to6 = /[+-]?\\d{1,6}/; // -999999 - 999999\n\n var matchUnsigned = /\\d+/; // 0 - inf\n var matchSigned = /[+-]?\\d+/; // -inf - inf\n\n var matchOffset = /Z|[+-]\\d\\d:?\\d\\d/gi; // +00:00 -00:00 +0000 -0000 or Z\n var matchShortOffset = /Z|[+-]\\d\\d(?::?\\d\\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z\n\n var matchTimestamp = /[+-]?\\d+(\\.\\d{1,3})?/; // 123456789 123456789.123\n\n// any word (or two) characters or numbers including two/three word month in arabic.\n// includes scottish gaelic two word and hyphenated months\n var matchWord = /[0-9]*['a-z\\u00A0-\\u05FF\\u0700-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]+|[\\u0600-\\u06FF\\/]+(\\s*?[\\u0600-\\u06FF]+){1,2}/i;\n\n\n var regexes = {};\n\n function addRegexToken (token, regex, strictRegex) {\n regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {\n return (isStrict && strictRegex) ? strictRegex : regex;\n };\n }\n\n function getParseRegexForToken (token, config) {\n if (!hasOwnProp(regexes, token)) {\n return new RegExp(unescapeFormat(token));\n }\n\n return regexes[token](config._strict, config._locale);\n }\n\n// Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript\n function unescapeFormat(s) {\n return regexEscape(s.replace('\\\\', '').replace(/\\\\(\\[)|\\\\(\\])|\\[([^\\]\\[]*)\\]|\\\\(.)/g, function (matched, p1, p2, p3, p4) {\n return p1 || p2 || p3 || p4;\n }));\n }\n\n function regexEscape(s) {\n return s.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n }\n\n var tokens = {};\n\n function addParseToken (token, callback) {\n var i, func = callback;\n if (typeof token === 'string') {\n token = [token];\n }\n if (isNumber(callback)) {\n func = function (input, array) {\n array[callback] = toInt(input);\n };\n }\n for (i = 0; i < token.length; i++) {\n tokens[token[i]] = func;\n }\n }\n\n function addWeekParseToken (token, callback) {\n addParseToken(token, function (input, array, config, token) {\n config._w = config._w || {};\n callback(input, config._w, config, token);\n });\n }\n\n function addTimeToArrayFromToken(token, input, config) {\n if (input != null && hasOwnProp(tokens, token)) {\n tokens[token](input, config._a, config, token);\n }\n }\n\n var YEAR = 0;\n var MONTH = 1;\n var DATE = 2;\n var HOUR = 3;\n var MINUTE = 4;\n var SECOND = 5;\n var MILLISECOND = 6;\n var WEEK = 7;\n var WEEKDAY = 8;\n\n var indexOf;\n\n if (Array.prototype.indexOf) {\n indexOf = Array.prototype.indexOf;\n } else {\n indexOf = function (o) {\n // I know\n var i;\n for (i = 0; i < this.length; ++i) {\n if (this[i] === o) {\n return i;\n }\n }\n return -1;\n };\n }\n\n var indexOf$1 = indexOf;\n\n function daysInMonth(year, month) {\n return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();\n }\n\n// FORMATTING\n\n addFormatToken('M', ['MM', 2], 'Mo', function () {\n return this.month() + 1;\n });\n\n addFormatToken('MMM', 0, 0, function (format) {\n return this.localeData().monthsShort(this, format);\n });\n\n addFormatToken('MMMM', 0, 0, function (format) {\n return this.localeData().months(this, format);\n });\n\n// ALIASES\n\n addUnitAlias('month', 'M');\n\n// PRIORITY\n\n addUnitPriority('month', 8);\n\n// PARSING\n\n addRegexToken('M', match1to2);\n addRegexToken('MM', match1to2, match2);\n addRegexToken('MMM', function (isStrict, locale) {\n return locale.monthsShortRegex(isStrict);\n });\n addRegexToken('MMMM', function (isStrict, locale) {\n return locale.monthsRegex(isStrict);\n });\n\n addParseToken(['M', 'MM'], function (input, array) {\n array[MONTH] = toInt(input) - 1;\n });\n\n addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {\n var month = config._locale.monthsParse(input, token, config._strict);\n // if we didn't find a month name, mark the date as invalid.\n if (month != null) {\n array[MONTH] = month;\n } else {\n getParsingFlags(config).invalidMonth = input;\n }\n });\n\n// LOCALES\n\n var MONTHS_IN_FORMAT = /D[oD]?(\\[[^\\[\\]]*\\]|\\s)+MMMM?/;\n var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');\n function localeMonths (m, format) {\n if (!m) {\n return isArray(this._months) ? this._months :\n this._months['standalone'];\n }\n return isArray(this._months) ? this._months[m.month()] :\n this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()];\n }\n\n var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');\n function localeMonthsShort (m, format) {\n if (!m) {\n return isArray(this._monthsShort) ? this._monthsShort :\n this._monthsShort['standalone'];\n }\n return isArray(this._monthsShort) ? this._monthsShort[m.month()] :\n this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];\n }\n\n function handleStrictParse(monthName, format, strict) {\n var i, ii, mom, llc = monthName.toLocaleLowerCase();\n if (!this._monthsParse) {\n // this is not used\n this._monthsParse = [];\n this._longMonthsParse = [];\n this._shortMonthsParse = [];\n for (i = 0; i < 12; ++i) {\n mom = createUTC([2000, i]);\n this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();\n this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();\n }\n }\n\n if (strict) {\n if (format === 'MMM') {\n ii = indexOf$1.call(this._shortMonthsParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf$1.call(this._longMonthsParse, llc);\n return ii !== -1 ? ii : null;\n }\n } else {\n if (format === 'MMM') {\n ii = indexOf$1.call(this._shortMonthsParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf$1.call(this._longMonthsParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf$1.call(this._longMonthsParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf$1.call(this._shortMonthsParse, llc);\n return ii !== -1 ? ii : null;\n }\n }\n }\n\n function localeMonthsParse (monthName, format, strict) {\n var i, mom, regex;\n\n if (this._monthsParseExact) {\n return handleStrictParse.call(this, monthName, format, strict);\n }\n\n if (!this._monthsParse) {\n this._monthsParse = [];\n this._longMonthsParse = [];\n this._shortMonthsParse = [];\n }\n\n // TODO: add sorting\n // Sorting makes sure if one month (or abbr) is a prefix of another\n // see sorting in computeMonthsParse\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, i]);\n if (strict && !this._longMonthsParse[i]) {\n this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');\n this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');\n }\n if (!strict && !this._monthsParse[i]) {\n regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');\n this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');\n }\n // test the regex\n if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {\n return i;\n } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {\n return i;\n } else if (!strict && this._monthsParse[i].test(monthName)) {\n return i;\n }\n }\n }\n\n// MOMENTS\n\n function setMonth (mom, value) {\n var dayOfMonth;\n\n if (!mom.isValid()) {\n // No op\n return mom;\n }\n\n if (typeof value === 'string') {\n if (/^\\d+$/.test(value)) {\n value = toInt(value);\n } else {\n value = mom.localeData().monthsParse(value);\n // TODO: Another silent failure?\n if (!isNumber(value)) {\n return mom;\n }\n }\n }\n\n dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));\n mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);\n return mom;\n }\n\n function getSetMonth (value) {\n if (value != null) {\n setMonth(this, value);\n hooks.updateOffset(this, true);\n return this;\n } else {\n return get(this, 'Month');\n }\n }\n\n function getDaysInMonth () {\n return daysInMonth(this.year(), this.month());\n }\n\n var defaultMonthsShortRegex = matchWord;\n function monthsShortRegex (isStrict) {\n if (this._monthsParseExact) {\n if (!hasOwnProp(this, '_monthsRegex')) {\n computeMonthsParse.call(this);\n }\n if (isStrict) {\n return this._monthsShortStrictRegex;\n } else {\n return this._monthsShortRegex;\n }\n } else {\n if (!hasOwnProp(this, '_monthsShortRegex')) {\n this._monthsShortRegex = defaultMonthsShortRegex;\n }\n return this._monthsShortStrictRegex && isStrict ?\n this._monthsShortStrictRegex : this._monthsShortRegex;\n }\n }\n\n var defaultMonthsRegex = matchWord;\n function monthsRegex (isStrict) {\n if (this._monthsParseExact) {\n if (!hasOwnProp(this, '_monthsRegex')) {\n computeMonthsParse.call(this);\n }\n if (isStrict) {\n return this._monthsStrictRegex;\n } else {\n return this._monthsRegex;\n }\n } else {\n if (!hasOwnProp(this, '_monthsRegex')) {\n this._monthsRegex = defaultMonthsRegex;\n }\n return this._monthsStrictRegex && isStrict ?\n this._monthsStrictRegex : this._monthsRegex;\n }\n }\n\n function computeMonthsParse () {\n function cmpLenRev(a, b) {\n return b.length - a.length;\n }\n\n var shortPieces = [], longPieces = [], mixedPieces = [],\n i, mom;\n for (i = 0; i < 12; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, i]);\n shortPieces.push(this.monthsShort(mom, ''));\n longPieces.push(this.months(mom, ''));\n mixedPieces.push(this.months(mom, ''));\n mixedPieces.push(this.monthsShort(mom, ''));\n }\n // Sorting makes sure if one month (or abbr) is a prefix of another it\n // will match the longer piece.\n shortPieces.sort(cmpLenRev);\n longPieces.sort(cmpLenRev);\n mixedPieces.sort(cmpLenRev);\n for (i = 0; i < 12; i++) {\n shortPieces[i] = regexEscape(shortPieces[i]);\n longPieces[i] = regexEscape(longPieces[i]);\n }\n for (i = 0; i < 24; i++) {\n mixedPieces[i] = regexEscape(mixedPieces[i]);\n }\n\n this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._monthsShortRegex = this._monthsRegex;\n this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');\n this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');\n }\n\n// FORMATTING\n\n addFormatToken('Y', 0, 0, function () {\n var y = this.year();\n return y <= 9999 ? '' + y : '+' + y;\n });\n\n addFormatToken(0, ['YY', 2], 0, function () {\n return this.year() % 100;\n });\n\n addFormatToken(0, ['YYYY', 4], 0, 'year');\n addFormatToken(0, ['YYYYY', 5], 0, 'year');\n addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');\n\n// ALIASES\n\n addUnitAlias('year', 'y');\n\n// PRIORITIES\n\n addUnitPriority('year', 1);\n\n// PARSING\n\n addRegexToken('Y', matchSigned);\n addRegexToken('YY', match1to2, match2);\n addRegexToken('YYYY', match1to4, match4);\n addRegexToken('YYYYY', match1to6, match6);\n addRegexToken('YYYYYY', match1to6, match6);\n\n addParseToken(['YYYYY', 'YYYYYY'], YEAR);\n addParseToken('YYYY', function (input, array) {\n array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);\n });\n addParseToken('YY', function (input, array) {\n array[YEAR] = hooks.parseTwoDigitYear(input);\n });\n addParseToken('Y', function (input, array) {\n array[YEAR] = parseInt(input, 10);\n });\n\n// HELPERS\n\n function daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n }\n\n function isLeapYear(year) {\n return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n }\n\n// HOOKS\n\n hooks.parseTwoDigitYear = function (input) {\n return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);\n };\n\n// MOMENTS\n\n var getSetYear = makeGetSet('FullYear', true);\n\n function getIsLeapYear () {\n return isLeapYear(this.year());\n }\n\n function createDate (y, m, d, h, M, s, ms) {\n // can't just apply() to create a date:\n // https://stackoverflow.com/q/181348\n var date = new Date(y, m, d, h, M, s, ms);\n\n // the date constructor remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0 && isFinite(date.getFullYear())) {\n date.setFullYear(y);\n }\n return date;\n }\n\n function createUTCDate (y) {\n var date = new Date(Date.UTC.apply(null, arguments));\n\n // the Date.UTC function remaps years 0-99 to 1900-1999\n if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) {\n date.setUTCFullYear(y);\n }\n return date;\n }\n\n// start-of-first-week - start-of-year\n function firstWeekOffset(year, dow, doy) {\n var // first-week day -- which january is always in the first week (4 for iso, 1 for other)\n fwd = 7 + dow - doy,\n // first-week day local weekday -- which local weekday is fwd\n fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;\n\n return -fwdlw + fwd - 1;\n }\n\n// https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday\n function dayOfYearFromWeeks(year, week, weekday, dow, doy) {\n var localWeekday = (7 + weekday - dow) % 7,\n weekOffset = firstWeekOffset(year, dow, doy),\n dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,\n resYear, resDayOfYear;\n\n if (dayOfYear <= 0) {\n resYear = year - 1;\n resDayOfYear = daysInYear(resYear) + dayOfYear;\n } else if (dayOfYear > daysInYear(year)) {\n resYear = year + 1;\n resDayOfYear = dayOfYear - daysInYear(year);\n } else {\n resYear = year;\n resDayOfYear = dayOfYear;\n }\n\n return {\n year: resYear,\n dayOfYear: resDayOfYear\n };\n }\n\n function weekOfYear(mom, dow, doy) {\n var weekOffset = firstWeekOffset(mom.year(), dow, doy),\n week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,\n resWeek, resYear;\n\n if (week < 1) {\n resYear = mom.year() - 1;\n resWeek = week + weeksInYear(resYear, dow, doy);\n } else if (week > weeksInYear(mom.year(), dow, doy)) {\n resWeek = week - weeksInYear(mom.year(), dow, doy);\n resYear = mom.year() + 1;\n } else {\n resYear = mom.year();\n resWeek = week;\n }\n\n return {\n week: resWeek,\n year: resYear\n };\n }\n\n function weeksInYear(year, dow, doy) {\n var weekOffset = firstWeekOffset(year, dow, doy),\n weekOffsetNext = firstWeekOffset(year + 1, dow, doy);\n return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;\n }\n\n// FORMATTING\n\n addFormatToken('w', ['ww', 2], 'wo', 'week');\n addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');\n\n// ALIASES\n\n addUnitAlias('week', 'w');\n addUnitAlias('isoWeek', 'W');\n\n// PRIORITIES\n\n addUnitPriority('week', 5);\n addUnitPriority('isoWeek', 5);\n\n// PARSING\n\n addRegexToken('w', match1to2);\n addRegexToken('ww', match1to2, match2);\n addRegexToken('W', match1to2);\n addRegexToken('WW', match1to2, match2);\n\n addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {\n week[token.substr(0, 1)] = toInt(input);\n });\n\n// HELPERS\n\n// LOCALES\n\n function localeWeek (mom) {\n return weekOfYear(mom, this._week.dow, this._week.doy).week;\n }\n\n var defaultLocaleWeek = {\n dow : 0, // Sunday is the first day of the week.\n doy : 6 // The week that contains Jan 1st is the first week of the year.\n };\n\n function localeFirstDayOfWeek () {\n return this._week.dow;\n }\n\n function localeFirstDayOfYear () {\n return this._week.doy;\n }\n\n// MOMENTS\n\n function getSetWeek (input) {\n var week = this.localeData().week(this);\n return input == null ? week : this.add((input - week) * 7, 'd');\n }\n\n function getSetISOWeek (input) {\n var week = weekOfYear(this, 1, 4).week;\n return input == null ? week : this.add((input - week) * 7, 'd');\n }\n\n// FORMATTING\n\n addFormatToken('d', 0, 'do', 'day');\n\n addFormatToken('dd', 0, 0, function (format) {\n return this.localeData().weekdaysMin(this, format);\n });\n\n addFormatToken('ddd', 0, 0, function (format) {\n return this.localeData().weekdaysShort(this, format);\n });\n\n addFormatToken('dddd', 0, 0, function (format) {\n return this.localeData().weekdays(this, format);\n });\n\n addFormatToken('e', 0, 0, 'weekday');\n addFormatToken('E', 0, 0, 'isoWeekday');\n\n// ALIASES\n\n addUnitAlias('day', 'd');\n addUnitAlias('weekday', 'e');\n addUnitAlias('isoWeekday', 'E');\n\n// PRIORITY\n addUnitPriority('day', 11);\n addUnitPriority('weekday', 11);\n addUnitPriority('isoWeekday', 11);\n\n// PARSING\n\n addRegexToken('d', match1to2);\n addRegexToken('e', match1to2);\n addRegexToken('E', match1to2);\n addRegexToken('dd', function (isStrict, locale) {\n return locale.weekdaysMinRegex(isStrict);\n });\n addRegexToken('ddd', function (isStrict, locale) {\n return locale.weekdaysShortRegex(isStrict);\n });\n addRegexToken('dddd', function (isStrict, locale) {\n return locale.weekdaysRegex(isStrict);\n });\n\n addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {\n var weekday = config._locale.weekdaysParse(input, token, config._strict);\n // if we didn't get a weekday name, mark the date as invalid\n if (weekday != null) {\n week.d = weekday;\n } else {\n getParsingFlags(config).invalidWeekday = input;\n }\n });\n\n addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {\n week[token] = toInt(input);\n });\n\n// HELPERS\n\n function parseWeekday(input, locale) {\n if (typeof input !== 'string') {\n return input;\n }\n\n if (!isNaN(input)) {\n return parseInt(input, 10);\n }\n\n input = locale.weekdaysParse(input);\n if (typeof input === 'number') {\n return input;\n }\n\n return null;\n }\n\n function parseIsoWeekday(input, locale) {\n if (typeof input === 'string') {\n return locale.weekdaysParse(input) % 7 || 7;\n }\n return isNaN(input) ? null : input;\n }\n\n// LOCALES\n\n var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');\n function localeWeekdays (m, format) {\n if (!m) {\n return isArray(this._weekdays) ? this._weekdays :\n this._weekdays['standalone'];\n }\n return isArray(this._weekdays) ? this._weekdays[m.day()] :\n this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()];\n }\n\n var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');\n function localeWeekdaysShort (m) {\n return (m) ? this._weekdaysShort[m.day()] : this._weekdaysShort;\n }\n\n var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');\n function localeWeekdaysMin (m) {\n return (m) ? this._weekdaysMin[m.day()] : this._weekdaysMin;\n }\n\n function handleStrictParse$1(weekdayName, format, strict) {\n var i, ii, mom, llc = weekdayName.toLocaleLowerCase();\n if (!this._weekdaysParse) {\n this._weekdaysParse = [];\n this._shortWeekdaysParse = [];\n this._minWeekdaysParse = [];\n\n for (i = 0; i < 7; ++i) {\n mom = createUTC([2000, 1]).day(i);\n this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase();\n this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase();\n this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();\n }\n }\n\n if (strict) {\n if (format === 'dddd') {\n ii = indexOf$1.call(this._weekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else if (format === 'ddd') {\n ii = indexOf$1.call(this._shortWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf$1.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n }\n } else {\n if (format === 'dddd') {\n ii = indexOf$1.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf$1.call(this._shortWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf$1.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else if (format === 'ddd') {\n ii = indexOf$1.call(this._shortWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf$1.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf$1.call(this._minWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n } else {\n ii = indexOf$1.call(this._minWeekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf$1.call(this._weekdaysParse, llc);\n if (ii !== -1) {\n return ii;\n }\n ii = indexOf$1.call(this._shortWeekdaysParse, llc);\n return ii !== -1 ? ii : null;\n }\n }\n }\n\n function localeWeekdaysParse (weekdayName, format, strict) {\n var i, mom, regex;\n\n if (this._weekdaysParseExact) {\n return handleStrictParse$1.call(this, weekdayName, format, strict);\n }\n\n if (!this._weekdaysParse) {\n this._weekdaysParse = [];\n this._minWeekdaysParse = [];\n this._shortWeekdaysParse = [];\n this._fullWeekdaysParse = [];\n }\n\n for (i = 0; i < 7; i++) {\n // make the regex if we don't have it already\n\n mom = createUTC([2000, 1]).day(i);\n if (strict && !this._fullWeekdaysParse[i]) {\n this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\\.?') + '$', 'i');\n this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$', 'i');\n this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$', 'i');\n }\n if (!this._weekdaysParse[i]) {\n regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');\n this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');\n }\n // test the regex\n if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {\n return i;\n } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {\n return i;\n } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {\n return i;\n } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {\n return i;\n }\n }\n }\n\n// MOMENTS\n\n function getSetDayOfWeek (input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();\n if (input != null) {\n input = parseWeekday(input, this.localeData());\n return this.add(input - day, 'd');\n } else {\n return day;\n }\n }\n\n function getSetLocaleDayOfWeek (input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;\n return input == null ? weekday : this.add(input - weekday, 'd');\n }\n\n function getSetISODayOfWeek (input) {\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n\n // behaves the same as moment#day except\n // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)\n // as a setter, sunday should belong to the previous week.\n\n if (input != null) {\n var weekday = parseIsoWeekday(input, this.localeData());\n return this.day(this.day() % 7 ? weekday : weekday - 7);\n } else {\n return this.day() || 7;\n }\n }\n\n var defaultWeekdaysRegex = matchWord;\n function weekdaysRegex (isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysStrictRegex;\n } else {\n return this._weekdaysRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n this._weekdaysRegex = defaultWeekdaysRegex;\n }\n return this._weekdaysStrictRegex && isStrict ?\n this._weekdaysStrictRegex : this._weekdaysRegex;\n }\n }\n\n var defaultWeekdaysShortRegex = matchWord;\n function weekdaysShortRegex (isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysShortStrictRegex;\n } else {\n return this._weekdaysShortRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysShortRegex')) {\n this._weekdaysShortRegex = defaultWeekdaysShortRegex;\n }\n return this._weekdaysShortStrictRegex && isStrict ?\n this._weekdaysShortStrictRegex : this._weekdaysShortRegex;\n }\n }\n\n var defaultWeekdaysMinRegex = matchWord;\n function weekdaysMinRegex (isStrict) {\n if (this._weekdaysParseExact) {\n if (!hasOwnProp(this, '_weekdaysRegex')) {\n computeWeekdaysParse.call(this);\n }\n if (isStrict) {\n return this._weekdaysMinStrictRegex;\n } else {\n return this._weekdaysMinRegex;\n }\n } else {\n if (!hasOwnProp(this, '_weekdaysMinRegex')) {\n this._weekdaysMinRegex = defaultWeekdaysMinRegex;\n }\n return this._weekdaysMinStrictRegex && isStrict ?\n this._weekdaysMinStrictRegex : this._weekdaysMinRegex;\n }\n }\n\n\n function computeWeekdaysParse () {\n function cmpLenRev(a, b) {\n return b.length - a.length;\n }\n\n var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [],\n i, mom, minp, shortp, longp;\n for (i = 0; i < 7; i++) {\n // make the regex if we don't have it already\n mom = createUTC([2000, 1]).day(i);\n minp = this.weekdaysMin(mom, '');\n shortp = this.weekdaysShort(mom, '');\n longp = this.weekdays(mom, '');\n minPieces.push(minp);\n shortPieces.push(shortp);\n longPieces.push(longp);\n mixedPieces.push(minp);\n mixedPieces.push(shortp);\n mixedPieces.push(longp);\n }\n // Sorting makes sure if one weekday (or abbr) is a prefix of another it\n // will match the longer piece.\n minPieces.sort(cmpLenRev);\n shortPieces.sort(cmpLenRev);\n longPieces.sort(cmpLenRev);\n mixedPieces.sort(cmpLenRev);\n for (i = 0; i < 7; i++) {\n shortPieces[i] = regexEscape(shortPieces[i]);\n longPieces[i] = regexEscape(longPieces[i]);\n mixedPieces[i] = regexEscape(mixedPieces[i]);\n }\n\n this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');\n this._weekdaysShortRegex = this._weekdaysRegex;\n this._weekdaysMinRegex = this._weekdaysRegex;\n\n this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i');\n this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i');\n this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i');\n }\n\n// FORMATTING\n\n function hFormat() {\n return this.hours() % 12 || 12;\n }\n\n function kFormat() {\n return this.hours() || 24;\n }\n\n addFormatToken('H', ['HH', 2], 0, 'hour');\n addFormatToken('h', ['hh', 2], 0, hFormat);\n addFormatToken('k', ['kk', 2], 0, kFormat);\n\n addFormatToken('hmm', 0, 0, function () {\n return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);\n });\n\n addFormatToken('hmmss', 0, 0, function () {\n return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) +\n zeroFill(this.seconds(), 2);\n });\n\n addFormatToken('Hmm', 0, 0, function () {\n return '' + this.hours() + zeroFill(this.minutes(), 2);\n });\n\n addFormatToken('Hmmss', 0, 0, function () {\n return '' + this.hours() + zeroFill(this.minutes(), 2) +\n zeroFill(this.seconds(), 2);\n });\n\n function meridiem (token, lowercase) {\n addFormatToken(token, 0, 0, function () {\n return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);\n });\n }\n\n meridiem('a', true);\n meridiem('A', false);\n\n// ALIASES\n\n addUnitAlias('hour', 'h');\n\n// PRIORITY\n addUnitPriority('hour', 13);\n\n// PARSING\n\n function matchMeridiem (isStrict, locale) {\n return locale._meridiemParse;\n }\n\n addRegexToken('a', matchMeridiem);\n addRegexToken('A', matchMeridiem);\n addRegexToken('H', match1to2);\n addRegexToken('h', match1to2);\n addRegexToken('k', match1to2);\n addRegexToken('HH', match1to2, match2);\n addRegexToken('hh', match1to2, match2);\n addRegexToken('kk', match1to2, match2);\n\n addRegexToken('hmm', match3to4);\n addRegexToken('hmmss', match5to6);\n addRegexToken('Hmm', match3to4);\n addRegexToken('Hmmss', match5to6);\n\n addParseToken(['H', 'HH'], HOUR);\n addParseToken(['k', 'kk'], function (input, array, config) {\n var kInput = toInt(input);\n array[HOUR] = kInput === 24 ? 0 : kInput;\n });\n addParseToken(['a', 'A'], function (input, array, config) {\n config._isPm = config._locale.isPM(input);\n config._meridiem = input;\n });\n addParseToken(['h', 'hh'], function (input, array, config) {\n array[HOUR] = toInt(input);\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('hmm', function (input, array, config) {\n var pos = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos));\n array[MINUTE] = toInt(input.substr(pos));\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('hmmss', function (input, array, config) {\n var pos1 = input.length - 4;\n var pos2 = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos1));\n array[MINUTE] = toInt(input.substr(pos1, 2));\n array[SECOND] = toInt(input.substr(pos2));\n getParsingFlags(config).bigHour = true;\n });\n addParseToken('Hmm', function (input, array, config) {\n var pos = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos));\n array[MINUTE] = toInt(input.substr(pos));\n });\n addParseToken('Hmmss', function (input, array, config) {\n var pos1 = input.length - 4;\n var pos2 = input.length - 2;\n array[HOUR] = toInt(input.substr(0, pos1));\n array[MINUTE] = toInt(input.substr(pos1, 2));\n array[SECOND] = toInt(input.substr(pos2));\n });\n\n// LOCALES\n\n function localeIsPM (input) {\n // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays\n // Using charAt should be more compatible.\n return ((input + '').toLowerCase().charAt(0) === 'p');\n }\n\n var defaultLocaleMeridiemParse = /[ap]\\.?m?\\.?/i;\n function localeMeridiem (hours, minutes, isLower) {\n if (hours > 11) {\n return isLower ? 'pm' : 'PM';\n } else {\n return isLower ? 'am' : 'AM';\n }\n }\n\n\n// MOMENTS\n\n// Setting the hour should keep the time, because the user explicitly\n// specified which hour he wants. So trying to maintain the same hour (in\n// a new timezone) makes sense. Adding/subtracting hours does not follow\n// this rule.\n var getSetHour = makeGetSet('Hours', true);\n\n// months\n// week\n// weekdays\n// meridiem\n var baseConfig = {\n calendar: defaultCalendar,\n longDateFormat: defaultLongDateFormat,\n invalidDate: defaultInvalidDate,\n ordinal: defaultOrdinal,\n dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,\n relativeTime: defaultRelativeTime,\n\n months: defaultLocaleMonths,\n monthsShort: defaultLocaleMonthsShort,\n\n week: defaultLocaleWeek,\n\n weekdays: defaultLocaleWeekdays,\n weekdaysMin: defaultLocaleWeekdaysMin,\n weekdaysShort: defaultLocaleWeekdaysShort,\n\n meridiemParse: defaultLocaleMeridiemParse\n };\n\n// internal storage for locale config files\n var locales = {};\n var localeFamilies = {};\n var globalLocale;\n\n function normalizeLocale(key) {\n return key ? key.toLowerCase().replace('_', '-') : key;\n }\n\n// pick the locale from the array\n// try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each\n// substring from most specific to least, but move to the next array item if it's a more specific variant than the current root\n function chooseLocale(names) {\n var i = 0, j, next, locale, split;\n\n while (i < names.length) {\n split = normalizeLocale(names[i]).split('-');\n j = split.length;\n next = normalizeLocale(names[i + 1]);\n next = next ? next.split('-') : null;\n while (j > 0) {\n locale = loadLocale(split.slice(0, j).join('-'));\n if (locale) {\n return locale;\n }\n if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {\n //the next array item is better than a shallower substring of this one\n break;\n }\n j--;\n }\n i++;\n }\n return null;\n }\n\n function loadLocale(name) {\n var oldLocale = null;\n // TODO: Find a better way to register and load all the locales in Node\n if (!locales[name] && (typeof module !== 'undefined') &&\n module && module.exports) {\n try {\n oldLocale = globalLocale._abbr;\n require('./locale/' + name);\n // because defineLocale currently also sets the global locale, we\n // want to undo that for lazy loaded locales\n getSetGlobalLocale(oldLocale);\n } catch (e) { }\n }\n return locales[name];\n }\n\n// This function will load locale and then set the global locale. If\n// no arguments are passed in, it will simply return the current global\n// locale key.\n function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }\n\n function defineLocale (name, config) {\n if (config !== null) {\n var parentConfig = baseConfig;\n config.abbr = name;\n if (locales[name] != null) {\n deprecateSimple('defineLocaleOverride',\n 'use moment.updateLocale(localeName, config) to change ' +\n 'an existing locale. moment.defineLocale(localeName, ' +\n 'config) should only be used for creating a new locale ' +\n 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.');\n parentConfig = locales[name]._config;\n } else if (config.parentLocale != null) {\n if (locales[config.parentLocale] != null) {\n parentConfig = locales[config.parentLocale]._config;\n } else {\n if (!localeFamilies[config.parentLocale]) {\n localeFamilies[config.parentLocale] = [];\n }\n localeFamilies[config.parentLocale].push({\n name: name,\n config: config\n });\n return null;\n }\n }\n locales[name] = new Locale(mergeConfigs(parentConfig, config));\n\n if (localeFamilies[name]) {\n localeFamilies[name].forEach(function (x) {\n defineLocale(x.name, x.config);\n });\n }\n\n // backwards compat for now: also set the locale\n // make sure we set the locale AFTER all child locales have been\n // created, so we won't end up with the child locale set.\n getSetGlobalLocale(name);\n\n\n return locales[name];\n } else {\n // useful for testing\n delete locales[name];\n return null;\n }\n }\n\n function updateLocale(name, config) {\n if (config != null) {\n var locale, parentConfig = baseConfig;\n // MERGE\n if (locales[name] != null) {\n parentConfig = locales[name]._config;\n }\n config = mergeConfigs(parentConfig, config);\n locale = new Locale(config);\n locale.parentLocale = locales[name];\n locales[name] = locale;\n\n // backwards compat for now: also set the locale\n getSetGlobalLocale(name);\n } else {\n // pass null for config to unupdate, useful for tests\n if (locales[name] != null) {\n if (locales[name].parentLocale != null) {\n locales[name] = locales[name].parentLocale;\n } else if (locales[name] != null) {\n delete locales[name];\n }\n }\n }\n return locales[name];\n }\n\n// returns locale data\n function getLocale (key) {\n var locale;\n\n if (key && key._locale && key._locale._abbr) {\n key = key._locale._abbr;\n }\n\n if (!key) {\n return globalLocale;\n }\n\n if (!isArray(key)) {\n //short-circuit everything else\n locale = loadLocale(key);\n if (locale) {\n return locale;\n }\n key = [key];\n }\n\n return chooseLocale(key);\n }\n\n function listLocales() {\n return keys$1(locales);\n }\n\n function checkOverflow (m) {\n var overflow;\n var a = m._a;\n\n if (a && getParsingFlags(m).overflow === -2) {\n overflow =\n a[MONTH] < 0 || a[MONTH] > 11 ? MONTH :\n a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE :\n a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :\n a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE :\n a[SECOND] < 0 || a[SECOND] > 59 ? SECOND :\n a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :\n -1;\n\n if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {\n overflow = DATE;\n }\n if (getParsingFlags(m)._overflowWeeks && overflow === -1) {\n overflow = WEEK;\n }\n if (getParsingFlags(m)._overflowWeekday && overflow === -1) {\n overflow = WEEKDAY;\n }\n\n getParsingFlags(m).overflow = overflow;\n }\n\n return m;\n }\n\n// iso 8601 regex\n// 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)\n var extendedIsoRegex = /^\\s*((?:[+-]\\d{6}|\\d{4})-(?:\\d\\d-\\d\\d|W\\d\\d-\\d|W\\d\\d|\\d\\d\\d|\\d\\d))(?:(T| )(\\d\\d(?::\\d\\d(?::\\d\\d(?:[.,]\\d+)?)?)?)([\\+\\-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/;\n var basicIsoRegex = /^\\s*((?:[+-]\\d{6}|\\d{4})(?:\\d\\d\\d\\d|W\\d\\d\\d|W\\d\\d|\\d\\d\\d|\\d\\d))(?:(T| )(\\d\\d(?:\\d\\d(?:\\d\\d(?:[.,]\\d+)?)?)?)([\\+\\-]\\d\\d(?::?\\d\\d)?|\\s*Z)?)?$/;\n\n var tzRegex = /Z|[+-]\\d\\d(?::?\\d\\d)?/;\n\n var isoDates = [\n ['YYYYYY-MM-DD', /[+-]\\d{6}-\\d\\d-\\d\\d/],\n ['YYYY-MM-DD', /\\d{4}-\\d\\d-\\d\\d/],\n ['GGGG-[W]WW-E', /\\d{4}-W\\d\\d-\\d/],\n ['GGGG-[W]WW', /\\d{4}-W\\d\\d/, false],\n ['YYYY-DDD', /\\d{4}-\\d{3}/],\n ['YYYY-MM', /\\d{4}-\\d\\d/, false],\n ['YYYYYYMMDD', /[+-]\\d{10}/],\n ['YYYYMMDD', /\\d{8}/],\n // YYYYMM is NOT allowed by the standard\n ['GGGG[W]WWE', /\\d{4}W\\d{3}/],\n ['GGGG[W]WW', /\\d{4}W\\d{2}/, false],\n ['YYYYDDD', /\\d{7}/]\n ];\n\n// iso time formats and regexes\n var isoTimes = [\n ['HH:mm:ss.SSSS', /\\d\\d:\\d\\d:\\d\\d\\.\\d+/],\n ['HH:mm:ss,SSSS', /\\d\\d:\\d\\d:\\d\\d,\\d+/],\n ['HH:mm:ss', /\\d\\d:\\d\\d:\\d\\d/],\n ['HH:mm', /\\d\\d:\\d\\d/],\n ['HHmmss.SSSS', /\\d\\d\\d\\d\\d\\d\\.\\d+/],\n ['HHmmss,SSSS', /\\d\\d\\d\\d\\d\\d,\\d+/],\n ['HHmmss', /\\d\\d\\d\\d\\d\\d/],\n ['HHmm', /\\d\\d\\d\\d/],\n ['HH', /\\d\\d/]\n ];\n\n var aspNetJsonRegex = /^\\/?Date\\((\\-?\\d+)/i;\n\n// date from iso format\n function configFromISO(config) {\n var i, l,\n string = config._i,\n match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),\n allowTime, dateFormat, timeFormat, tzFormat;\n\n if (match) {\n getParsingFlags(config).iso = true;\n\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(match[1])) {\n dateFormat = isoDates[i][0];\n allowTime = isoDates[i][2] !== false;\n break;\n }\n }\n if (dateFormat == null) {\n config._isValid = false;\n return;\n }\n if (match[3]) {\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(match[3])) {\n // match[2] should be 'T' or space\n timeFormat = (match[2] || ' ') + isoTimes[i][0];\n break;\n }\n }\n if (timeFormat == null) {\n config._isValid = false;\n return;\n }\n }\n if (!allowTime && timeFormat != null) {\n config._isValid = false;\n return;\n }\n if (match[4]) {\n if (tzRegex.exec(match[4])) {\n tzFormat = 'Z';\n } else {\n config._isValid = false;\n return;\n }\n }\n config._f = dateFormat + (timeFormat || '') + (tzFormat || '');\n configFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }\n\n// RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3\n var basicRfcRegex = /^((?:Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\\s)?(\\d?\\d\\s(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(?:\\d\\d)?\\d\\d\\s)(\\d\\d:\\d\\d)(\\:\\d\\d)?(\\s(?:UT|GMT|[ECMP][SD]T|[A-IK-Za-ik-z]|[+-]\\d{4}))$/;\n\n// date and time from ref 2822 format\n function configFromRFC2822(config) {\n var string, match, dayFormat,\n dateFormat, timeFormat, tzFormat;\n var timezones = {\n ' GMT': ' +0000',\n ' EDT': ' -0400',\n ' EST': ' -0500',\n ' CDT': ' -0500',\n ' CST': ' -0600',\n ' MDT': ' -0600',\n ' MST': ' -0700',\n ' PDT': ' -0700',\n ' PST': ' -0800'\n };\n var military = 'YXWVUTSRQPONZABCDEFGHIKLM';\n var timezone, timezoneIndex;\n\n string = config._i\n .replace(/\\([^\\)]*\\)|[\\n\\t]/g, ' ') // Remove comments and folding whitespace\n .replace(/(\\s\\s+)/g, ' ') // Replace multiple-spaces with a single space\n .replace(/^\\s|\\s$/g, ''); // Remove leading and trailing spaces\n match = basicRfcRegex.exec(string);\n\n if (match) {\n dayFormat = match[1] ? 'ddd' + ((match[1].length === 5) ? ', ' : ' ') : '';\n dateFormat = 'D MMM ' + ((match[2].length > 10) ? 'YYYY ' : 'YY ');\n timeFormat = 'HH:mm' + (match[4] ? ':ss' : '');\n\n // TODO: Replace the vanilla JS Date object with an indepentent day-of-week check.\n if (match[1]) { // day of week given\n var momentDate = new Date(match[2]);\n var momentDay = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'][momentDate.getDay()];\n\n if (match[1].substr(0,3) !== momentDay) {\n getParsingFlags(config).weekdayMismatch = true;\n config._isValid = false;\n return;\n }\n }\n\n switch (match[5].length) {\n case 2: // military\n if (timezoneIndex === 0) {\n timezone = ' +0000';\n } else {\n timezoneIndex = military.indexOf(match[5][1].toUpperCase()) - 12;\n timezone = ((timezoneIndex < 0) ? ' -' : ' +') +\n (('' + timezoneIndex).replace(/^-?/, '0')).match(/..$/)[0] + '00';\n }\n break;\n case 4: // Zone\n timezone = timezones[match[5]];\n break;\n default: // UT or +/-9999\n timezone = timezones[' GMT'];\n }\n match[5] = timezone;\n config._i = match.splice(1).join('');\n tzFormat = ' ZZ';\n config._f = dayFormat + dateFormat + timeFormat + tzFormat;\n configFromStringAndFormat(config);\n getParsingFlags(config).rfc2822 = true;\n } else {\n config._isValid = false;\n }\n }\n\n// date from iso format or fallback\n function configFromString(config) {\n var matched = aspNetJsonRegex.exec(config._i);\n\n if (matched !== null) {\n config._d = new Date(+matched[1]);\n return;\n }\n\n configFromISO(config);\n if (config._isValid === false) {\n delete config._isValid;\n } else {\n return;\n }\n\n configFromRFC2822(config);\n if (config._isValid === false) {\n delete config._isValid;\n } else {\n return;\n }\n\n // Final attempt, use Input Fallback\n hooks.createFromInputFallback(config);\n }\n\n hooks.createFromInputFallback = deprecate(\n 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +\n 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +\n 'discouraged and will be removed in an upcoming major release. Please refer to ' +\n 'http://momentjs.com/guides/#/warnings/js-date/ for more info.',\n function (config) {\n config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));\n }\n );\n\n// Pick the first defined of two or three arguments.\n function defaults(a, b, c) {\n if (a != null) {\n return a;\n }\n if (b != null) {\n return b;\n }\n return c;\n }\n\n function currentDateArray(config) {\n // hooks is actually the exported moment object\n var nowValue = new Date(hooks.now());\n if (config._useUTC) {\n return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];\n }\n return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];\n }\n\n// convert an array to a date.\n// the array should mirror the parameters below\n// note: all values past the year are optional and will default to the lowest possible value.\n// [year, month, day , hour, minute, second, millisecond]\n function configFromArray (config) {\n var i, date, input = [], currentDate, yearToUse;\n\n if (config._d) {\n return;\n }\n\n currentDate = currentDateArray(config);\n\n //compute day of the year from weeks and weekdays\n if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {\n dayOfYearFromWeekInfo(config);\n }\n\n //if the day of the year is set, figure out what it is\n if (config._dayOfYear != null) {\n yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);\n\n if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {\n getParsingFlags(config)._overflowDayOfYear = true;\n }\n\n date = createUTCDate(yearToUse, 0, config._dayOfYear);\n config._a[MONTH] = date.getUTCMonth();\n config._a[DATE] = date.getUTCDate();\n }\n\n // Default to current date.\n // * if no year, month, day of month are given, default to today\n // * if day of month is given, default month and year\n // * if month is given, default only year\n // * if year is given, don't default anything\n for (i = 0; i < 3 && config._a[i] == null; ++i) {\n config._a[i] = input[i] = currentDate[i];\n }\n\n // Zero out whatever was not defaulted, including time\n for (; i < 7; i++) {\n config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];\n }\n\n // Check for 24:00:00.000\n if (config._a[HOUR] === 24 &&\n config._a[MINUTE] === 0 &&\n config._a[SECOND] === 0 &&\n config._a[MILLISECOND] === 0) {\n config._nextDay = true;\n config._a[HOUR] = 0;\n }\n\n config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);\n // Apply timezone offset from input. The actual utcOffset can be changed\n // with parseZone.\n if (config._tzm != null) {\n config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);\n }\n\n if (config._nextDay) {\n config._a[HOUR] = 24;\n }\n }\n\n function dayOfYearFromWeekInfo(config) {\n var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;\n\n w = config._w;\n if (w.GG != null || w.W != null || w.E != null) {\n dow = 1;\n doy = 4;\n\n // TODO: We need to take the current isoWeekYear, but that depends on\n // how we interpret now (local, utc, fixed offset). So create\n // a now version of current config (take local/utc/offset flags, and\n // create now).\n weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year);\n week = defaults(w.W, 1);\n weekday = defaults(w.E, 1);\n if (weekday < 1 || weekday > 7) {\n weekdayOverflow = true;\n }\n } else {\n dow = config._locale._week.dow;\n doy = config._locale._week.doy;\n\n var curWeek = weekOfYear(createLocal(), dow, doy);\n\n weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);\n\n // Default to current week.\n week = defaults(w.w, curWeek.week);\n\n if (w.d != null) {\n // weekday -- low day numbers are considered next week\n weekday = w.d;\n if (weekday < 0 || weekday > 6) {\n weekdayOverflow = true;\n }\n } else if (w.e != null) {\n // local weekday -- counting starts from begining of week\n weekday = w.e + dow;\n if (w.e < 0 || w.e > 6) {\n weekdayOverflow = true;\n }\n } else {\n // default to begining of week\n weekday = dow;\n }\n }\n if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {\n getParsingFlags(config)._overflowWeeks = true;\n } else if (weekdayOverflow != null) {\n getParsingFlags(config)._overflowWeekday = true;\n } else {\n temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);\n config._a[YEAR] = temp.year;\n config._dayOfYear = temp.dayOfYear;\n }\n }\n\n// constant that refers to the ISO standard\n hooks.ISO_8601 = function () {};\n\n// constant that refers to the RFC 2822 form\n hooks.RFC_2822 = function () {};\n\n// date from string and format string\n function configFromStringAndFormat(config) {\n // TODO: Move this to another part of the creation flow to prevent circular deps\n if (config._f === hooks.ISO_8601) {\n configFromISO(config);\n return;\n }\n if (config._f === hooks.RFC_2822) {\n configFromRFC2822(config);\n return;\n }\n config._a = [];\n getParsingFlags(config).empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n // console.log('token', token, 'parsedInput', parsedInput,\n // 'regex', getParseRegexForToken(token, config));\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n getParsingFlags(config).unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n getParsingFlags(config).empty = false;\n }\n else {\n getParsingFlags(config).unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n getParsingFlags(config).unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n getParsingFlags(config).unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._a[HOUR] <= 12 &&\n getParsingFlags(config).bigHour === true &&\n config._a[HOUR] > 0) {\n getParsingFlags(config).bigHour = undefined;\n }\n\n getParsingFlags(config).parsedDateParts = config._a.slice(0);\n getParsingFlags(config).meridiem = config._meridiem;\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);\n\n configFromArray(config);\n checkOverflow(config);\n }\n\n\n function meridiemFixWrap (locale, hour, meridiem) {\n var isPm;\n\n if (meridiem == null) {\n // nothing to do\n return hour;\n }\n if (locale.meridiemHour != null) {\n return locale.meridiemHour(hour, meridiem);\n } else if (locale.isPM != null) {\n // Fallback\n isPm = locale.isPM(meridiem);\n if (isPm && hour < 12) {\n hour += 12;\n }\n if (!isPm && hour === 12) {\n hour = 0;\n }\n return hour;\n } else {\n // this is not supposed to happen\n return hour;\n }\n }\n\n// date from string and array of format strings\n function configFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n getParsingFlags(config).invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._f = config._f[i];\n configFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += getParsingFlags(tempConfig).charsLeftOver;\n\n //or tokens\n currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;\n\n getParsingFlags(tempConfig).score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }\n\n function configFromObject(config) {\n if (config._d) {\n return;\n }\n\n var i = normalizeObjectUnits(config._i);\n config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) {\n return obj && parseInt(obj, 10);\n });\n\n configFromArray(config);\n }\n\n function createFromConfig (config) {\n var res = new Moment(checkOverflow(prepareConfig(config)));\n if (res._nextDay) {\n // Adding is smart enough around DST\n res.add(1, 'd');\n res._nextDay = undefined;\n }\n\n return res;\n }\n\n function prepareConfig (config) {\n var input = config._i,\n format = config._f;\n\n config._locale = config._locale || getLocale(config._l);\n\n if (input === null || (format === undefined && input === '')) {\n return createInvalid({nullInput: true});\n }\n\n if (typeof input === 'string') {\n config._i = input = config._locale.preparse(input);\n }\n\n if (isMoment(input)) {\n return new Moment(checkOverflow(input));\n } else if (isDate(input)) {\n config._d = input;\n } else if (isArray(format)) {\n configFromStringAndArray(config);\n } else if (format) {\n configFromStringAndFormat(config);\n } else {\n configFromInput(config);\n }\n\n if (!isValid(config)) {\n config._d = null;\n }\n\n return config;\n }\n\n function configFromInput(config) {\n var input = config._i;\n if (isUndefined(input)) {\n config._d = new Date(hooks.now());\n } else if (isDate(input)) {\n config._d = new Date(input.valueOf());\n } else if (typeof input === 'string') {\n configFromString(config);\n } else if (isArray(input)) {\n config._a = map(input.slice(0), function (obj) {\n return parseInt(obj, 10);\n });\n configFromArray(config);\n } else if (isObject(input)) {\n configFromObject(config);\n } else if (isNumber(input)) {\n // from milliseconds\n config._d = new Date(input);\n } else {\n hooks.createFromInputFallback(config);\n }\n }\n\n function createLocalOrUTC (input, format, locale, strict, isUTC) {\n var c = {};\n\n if (locale === true || locale === false) {\n strict = locale;\n locale = undefined;\n }\n\n if ((isObject(input) && isObjectEmpty(input)) ||\n (isArray(input) && input.length === 0)) {\n input = undefined;\n }\n // object construction must be done this way.\n // https://github.com/moment/moment/issues/1423\n c._isAMomentObject = true;\n c._useUTC = c._isUTC = isUTC;\n c._l = locale;\n c._i = input;\n c._f = format;\n c._strict = strict;\n\n return createFromConfig(c);\n }\n\n function createLocal (input, format, locale, strict) {\n return createLocalOrUTC(input, format, locale, strict, false);\n }\n\n var prototypeMin = deprecate(\n 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',\n function () {\n var other = createLocal.apply(null, arguments);\n if (this.isValid() && other.isValid()) {\n return other < this ? this : other;\n } else {\n return createInvalid();\n }\n }\n );\n\n var prototypeMax = deprecate(\n 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',\n function () {\n var other = createLocal.apply(null, arguments);\n if (this.isValid() && other.isValid()) {\n return other > this ? this : other;\n } else {\n return createInvalid();\n }\n }\n );\n\n// Pick a moment m from moments so that m[fn](other) is true for all\n// other. This relies on the function fn to be transitive.\n//\n// moments should either be an array of moment objects or an array, whose\n// first element is an array of moment objects.\n function pickBy(fn, moments) {\n var res, i;\n if (moments.length === 1 && isArray(moments[0])) {\n moments = moments[0];\n }\n if (!moments.length) {\n return createLocal();\n }\n res = moments[0];\n for (i = 1; i < moments.length; ++i) {\n if (!moments[i].isValid() || moments[i][fn](res)) {\n res = moments[i];\n }\n }\n return res;\n }\n\n// TODO: Use [].sort instead?\n function min () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isBefore', args);\n }\n\n function max () {\n var args = [].slice.call(arguments, 0);\n\n return pickBy('isAfter', args);\n }\n\n var now = function () {\n return Date.now ? Date.now() : +(new Date());\n };\n\n var ordering = ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond'];\n\n function isDurationValid(m) {\n for (var key in m) {\n if (!(ordering.indexOf(key) !== -1 && (m[key] == null || !isNaN(m[key])))) {\n return false;\n }\n }\n\n var unitHasDecimal = false;\n for (var i = 0; i < ordering.length; ++i) {\n if (m[ordering[i]]) {\n if (unitHasDecimal) {\n return false; // only allow non-integers for smallest unit\n }\n if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {\n unitHasDecimal = true;\n }\n }\n }\n\n return true;\n }\n\n function isValid$1() {\n return this._isValid;\n }\n\n function createInvalid$1() {\n return createDuration(NaN);\n }\n\n function Duration (duration) {\n var normalizedInput = normalizeObjectUnits(duration),\n years = normalizedInput.year || 0,\n quarters = normalizedInput.quarter || 0,\n months = normalizedInput.month || 0,\n weeks = normalizedInput.week || 0,\n days = normalizedInput.day || 0,\n hours = normalizedInput.hour || 0,\n minutes = normalizedInput.minute || 0,\n seconds = normalizedInput.second || 0,\n milliseconds = normalizedInput.millisecond || 0;\n\n this._isValid = isDurationValid(normalizedInput);\n\n // representation for dateAddRemove\n this._milliseconds = +milliseconds +\n seconds * 1e3 + // 1000\n minutes * 6e4 + // 1000 * 60\n hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978\n // Because of dateAddRemove treats 24 hours as different from a\n // day when working around DST, we need to store them separately\n this._days = +days +\n weeks * 7;\n // It is impossible translate months into days without knowing\n // which months you are are talking about, so we have to store\n // it separately.\n this._months = +months +\n quarters * 3 +\n years * 12;\n\n this._data = {};\n\n this._locale = getLocale();\n\n this._bubble();\n }\n\n function isDuration (obj) {\n return obj instanceof Duration;\n }\n\n function absRound (number) {\n if (number < 0) {\n return Math.round(-1 * number) * -1;\n } else {\n return Math.round(number);\n }\n }\n\n// FORMATTING\n\n function offset (token, separator) {\n addFormatToken(token, 0, 0, function () {\n var offset = this.utcOffset();\n var sign = '+';\n if (offset < 0) {\n offset = -offset;\n sign = '-';\n }\n return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);\n });\n }\n\n offset('Z', ':');\n offset('ZZ', '');\n\n// PARSING\n\n addRegexToken('Z', matchShortOffset);\n addRegexToken('ZZ', matchShortOffset);\n addParseToken(['Z', 'ZZ'], function (input, array, config) {\n config._useUTC = true;\n config._tzm = offsetFromString(matchShortOffset, input);\n });\n\n// HELPERS\n\n// timezone chunker\n// '+10:00' > ['10', '00']\n// '-1530' > ['-15', '30']\n var chunkOffset = /([\\+\\-]|\\d\\d)/gi;\n\n function offsetFromString(matcher, string) {\n var matches = (string || '').match(matcher);\n\n if (matches === null) {\n return null;\n }\n\n var chunk = matches[matches.length - 1] || [];\n var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];\n var minutes = +(parts[1] * 60) + toInt(parts[2]);\n\n return minutes === 0 ?\n 0 :\n parts[0] === '+' ? minutes : -minutes;\n }\n\n// Return a moment from input, that is local/utc/zone equivalent to model.\n function cloneWithOffset(input, model) {\n var res, diff;\n if (model._isUTC) {\n res = model.clone();\n diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf();\n // Use low-level api, because this fn is low-level api.\n res._d.setTime(res._d.valueOf() + diff);\n hooks.updateOffset(res, false);\n return res;\n } else {\n return createLocal(input).local();\n }\n }\n\n function getDateOffset (m) {\n // On Firefox.24 Date#getTimezoneOffset returns a floating point.\n // https://github.com/moment/moment/pull/1871\n return -Math.round(m._d.getTimezoneOffset() / 15) * 15;\n }\n\n// HOOKS\n\n// This function will be called whenever a moment is mutated.\n// It is intended to keep the offset in sync with the timezone.\n hooks.updateOffset = function () {};\n\n// MOMENTS\n\n// keepLocalTime = true means only change the timezone, without\n// affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->\n// 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset\n// +0200, so we adjust the time as needed, to be valid.\n//\n// Keeping the time actually adds/subtracts (one hour)\n// from the actual represented time. That is why we call updateOffset\n// a second time. In case it wants us to change the offset again\n// _changeInProgress == true case, then we have to adjust, because\n// there is no such time in the given timezone.\n function getSetOffset (input, keepLocalTime, keepMinutes) {\n var offset = this._offset || 0,\n localAdjust;\n if (!this.isValid()) {\n return input != null ? this : NaN;\n }\n if (input != null) {\n if (typeof input === 'string') {\n input = offsetFromString(matchShortOffset, input);\n if (input === null) {\n return this;\n }\n } else if (Math.abs(input) < 16 && !keepMinutes) {\n input = input * 60;\n }\n if (!this._isUTC && keepLocalTime) {\n localAdjust = getDateOffset(this);\n }\n this._offset = input;\n this._isUTC = true;\n if (localAdjust != null) {\n this.add(localAdjust, 'm');\n }\n if (offset !== input) {\n if (!keepLocalTime || this._changeInProgress) {\n addSubtract(this, createDuration(input - offset, 'm'), 1, false);\n } else if (!this._changeInProgress) {\n this._changeInProgress = true;\n hooks.updateOffset(this, true);\n this._changeInProgress = null;\n }\n }\n return this;\n } else {\n return this._isUTC ? offset : getDateOffset(this);\n }\n }\n\n function getSetZone (input, keepLocalTime) {\n if (input != null) {\n if (typeof input !== 'string') {\n input = -input;\n }\n\n this.utcOffset(input, keepLocalTime);\n\n return this;\n } else {\n return -this.utcOffset();\n }\n }\n\n function setOffsetToUTC (keepLocalTime) {\n return this.utcOffset(0, keepLocalTime);\n }\n\n function setOffsetToLocal (keepLocalTime) {\n if (this._isUTC) {\n this.utcOffset(0, keepLocalTime);\n this._isUTC = false;\n\n if (keepLocalTime) {\n this.subtract(getDateOffset(this), 'm');\n }\n }\n return this;\n }\n\n function setOffsetToParsedOffset () {\n if (this._tzm != null) {\n this.utcOffset(this._tzm, false, true);\n } else if (typeof this._i === 'string') {\n var tZone = offsetFromString(matchOffset, this._i);\n if (tZone != null) {\n this.utcOffset(tZone);\n }\n else {\n this.utcOffset(0, true);\n }\n }\n return this;\n }\n\n function hasAlignedHourOffset (input) {\n if (!this.isValid()) {\n return false;\n }\n input = input ? createLocal(input).utcOffset() : 0;\n\n return (this.utcOffset() - input) % 60 === 0;\n }\n\n function isDaylightSavingTime () {\n return (\n this.utcOffset() > this.clone().month(0).utcOffset() ||\n this.utcOffset() > this.clone().month(5).utcOffset()\n );\n }\n\n function isDaylightSavingTimeShifted () {\n if (!isUndefined(this._isDSTShifted)) {\n return this._isDSTShifted;\n }\n\n var c = {};\n\n copyConfig(c, this);\n c = prepareConfig(c);\n\n if (c._a) {\n var other = c._isUTC ? createUTC(c._a) : createLocal(c._a);\n this._isDSTShifted = this.isValid() &&\n compareArrays(c._a, other.toArray()) > 0;\n } else {\n this._isDSTShifted = false;\n }\n\n return this._isDSTShifted;\n }\n\n function isLocal () {\n return this.isValid() ? !this._isUTC : false;\n }\n\n function isUtcOffset () {\n return this.isValid() ? this._isUTC : false;\n }\n\n function isUtc () {\n return this.isValid() ? this._isUTC && this._offset === 0 : false;\n }\n\n// ASP.NET json date format regex\n var aspNetRegex = /^(\\-)?(?:(\\d*)[. ])?(\\d+)\\:(\\d+)(?:\\:(\\d+)(\\.\\d*)?)?$/;\n\n// from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html\n// somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere\n// and further modified to allow for strings containing both week and day\n var isoRegex = /^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;\n\n function createDuration (input, key) {\n var duration = input,\n // matching against regexp is expensive, do it on demand\n match = null,\n sign,\n ret,\n diffRes;\n\n if (isDuration(input)) {\n duration = {\n ms : input._milliseconds,\n d : input._days,\n M : input._months\n };\n } else if (isNumber(input)) {\n duration = {};\n if (key) {\n duration[key] = input;\n } else {\n duration.milliseconds = input;\n }\n } else if (!!(match = aspNetRegex.exec(input))) {\n sign = (match[1] === '-') ? -1 : 1;\n duration = {\n y : 0,\n d : toInt(match[DATE]) * sign,\n h : toInt(match[HOUR]) * sign,\n m : toInt(match[MINUTE]) * sign,\n s : toInt(match[SECOND]) * sign,\n ms : toInt(absRound(match[MILLISECOND] * 1000)) * sign // the millisecond decimal point is included in the match\n };\n } else if (!!(match = isoRegex.exec(input))) {\n sign = (match[1] === '-') ? -1 : 1;\n duration = {\n y : parseIso(match[2], sign),\n M : parseIso(match[3], sign),\n w : parseIso(match[4], sign),\n d : parseIso(match[5], sign),\n h : parseIso(match[6], sign),\n m : parseIso(match[7], sign),\n s : parseIso(match[8], sign)\n };\n } else if (duration == null) {// checks for null or undefined\n duration = {};\n } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {\n diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to));\n\n duration = {};\n duration.ms = diffRes.milliseconds;\n duration.M = diffRes.months;\n }\n\n ret = new Duration(duration);\n\n if (isDuration(input) && hasOwnProp(input, '_locale')) {\n ret._locale = input._locale;\n }\n\n return ret;\n }\n\n createDuration.fn = Duration.prototype;\n createDuration.invalid = createInvalid$1;\n\n function parseIso (inp, sign) {\n // We'd normally use ~~inp for this, but unfortunately it also\n // converts floats to ints.\n // inp may be undefined, so careful calling replace on it.\n var res = inp && parseFloat(inp.replace(',', '.'));\n // apply sign while we're at it\n return (isNaN(res) ? 0 : res) * sign;\n }\n\n function positiveMomentsDifference(base, other) {\n var res = {milliseconds: 0, months: 0};\n\n res.months = other.month() - base.month() +\n (other.year() - base.year()) * 12;\n if (base.clone().add(res.months, 'M').isAfter(other)) {\n --res.months;\n }\n\n res.milliseconds = +other - +(base.clone().add(res.months, 'M'));\n\n return res;\n }\n\n function momentsDifference(base, other) {\n var res;\n if (!(base.isValid() && other.isValid())) {\n return {milliseconds: 0, months: 0};\n }\n\n other = cloneWithOffset(other, base);\n if (base.isBefore(other)) {\n res = positiveMomentsDifference(base, other);\n } else {\n res = positiveMomentsDifference(other, base);\n res.milliseconds = -res.milliseconds;\n res.months = -res.months;\n }\n\n return res;\n }\n\n// TODO: remove 'name' arg after deprecation is removed\n function createAdder(direction, name) {\n return function (val, period) {\n var dur, tmp;\n //invert the arguments, but complain about it\n if (period !== null && !isNaN(+period)) {\n deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' +\n 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.');\n tmp = val; val = period; period = tmp;\n }\n\n val = typeof val === 'string' ? +val : val;\n dur = createDuration(val, period);\n addSubtract(this, dur, direction);\n return this;\n };\n }\n\n function addSubtract (mom, duration, isAdding, updateOffset) {\n var milliseconds = duration._milliseconds,\n days = absRound(duration._days),\n months = absRound(duration._months);\n\n if (!mom.isValid()) {\n // No op\n return;\n }\n\n updateOffset = updateOffset == null ? true : updateOffset;\n\n if (milliseconds) {\n mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);\n }\n if (days) {\n set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);\n }\n if (months) {\n setMonth(mom, get(mom, 'Month') + months * isAdding);\n }\n if (updateOffset) {\n hooks.updateOffset(mom, days || months);\n }\n }\n\n var add = createAdder(1, 'add');\n var subtract = createAdder(-1, 'subtract');\n\n function getCalendarFormat(myMoment, now) {\n var diff = myMoment.diff(now, 'days', true);\n return diff < -6 ? 'sameElse' :\n diff < -1 ? 'lastWeek' :\n diff < 0 ? 'lastDay' :\n diff < 1 ? 'sameDay' :\n diff < 2 ? 'nextDay' :\n diff < 7 ? 'nextWeek' : 'sameElse';\n }\n\n function calendar$1 (time, formats) {\n // We want to compare the start of today, vs this.\n // Getting start-of-today depends on whether we're local/utc/offset or not.\n var now = time || createLocal(),\n sod = cloneWithOffset(now, this).startOf('day'),\n format = hooks.calendarFormat(this, sod) || 'sameElse';\n\n var output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]);\n\n return this.format(output || this.localeData().calendar(format, this, createLocal(now)));\n }\n\n function clone () {\n return new Moment(this);\n }\n\n function isAfter (input, units) {\n var localInput = isMoment(input) ? input : createLocal(input);\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');\n if (units === 'millisecond') {\n return this.valueOf() > localInput.valueOf();\n } else {\n return localInput.valueOf() < this.clone().startOf(units).valueOf();\n }\n }\n\n function isBefore (input, units) {\n var localInput = isMoment(input) ? input : createLocal(input);\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');\n if (units === 'millisecond') {\n return this.valueOf() < localInput.valueOf();\n } else {\n return this.clone().endOf(units).valueOf() < localInput.valueOf();\n }\n }\n\n function isBetween (from, to, units, inclusivity) {\n inclusivity = inclusivity || '()';\n return (inclusivity[0] === '(' ? this.isAfter(from, units) : !this.isBefore(from, units)) &&\n (inclusivity[1] === ')' ? this.isBefore(to, units) : !this.isAfter(to, units));\n }\n\n function isSame (input, units) {\n var localInput = isMoment(input) ? input : createLocal(input),\n inputMs;\n if (!(this.isValid() && localInput.isValid())) {\n return false;\n }\n units = normalizeUnits(units || 'millisecond');\n if (units === 'millisecond') {\n return this.valueOf() === localInput.valueOf();\n } else {\n inputMs = localInput.valueOf();\n return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf();\n }\n }\n\n function isSameOrAfter (input, units) {\n return this.isSame(input, units) || this.isAfter(input,units);\n }\n\n function isSameOrBefore (input, units) {\n return this.isSame(input, units) || this.isBefore(input,units);\n }\n\n function diff (input, units, asFloat) {\n var that,\n zoneDelta,\n delta, output;\n\n if (!this.isValid()) {\n return NaN;\n }\n\n that = cloneWithOffset(input, this);\n\n if (!that.isValid()) {\n return NaN;\n }\n\n zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;\n\n units = normalizeUnits(units);\n\n if (units === 'year' || units === 'month' || units === 'quarter') {\n output = monthDiff(this, that);\n if (units === 'quarter') {\n output = output / 3;\n } else if (units === 'year') {\n output = output / 12;\n }\n } else {\n delta = this - that;\n output = units === 'second' ? delta / 1e3 : // 1000\n units === 'minute' ? delta / 6e4 : // 1000 * 60\n units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60\n units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst\n units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst\n delta;\n }\n return asFloat ? output : absFloor(output);\n }\n\n function monthDiff (a, b) {\n // difference in months\n var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),\n // b is in (anchor - 1 month, anchor + 1 month)\n anchor = a.clone().add(wholeMonthDiff, 'months'),\n anchor2, adjust;\n\n if (b - anchor < 0) {\n anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');\n // linear across the month\n adjust = (b - anchor) / (anchor - anchor2);\n } else {\n anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');\n // linear across the month\n adjust = (b - anchor) / (anchor2 - anchor);\n }\n\n //check for negative zero, return zero if negative zero\n return -(wholeMonthDiff + adjust) || 0;\n }\n\n hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';\n hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';\n\n function toString () {\n return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');\n }\n\n function toISOString() {\n if (!this.isValid()) {\n return null;\n }\n var m = this.clone().utc();\n if (m.year() < 0 || m.year() > 9999) {\n return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');\n }\n if (isFunction(Date.prototype.toISOString)) {\n // native implementation is ~50x faster, use it when we can\n return this.toDate().toISOString();\n }\n return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');\n }\n\n /**\n * Return a human readable representation of a moment that can\n * also be evaluated to get a new moment which is the same\n *\n * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects\n */\n function inspect () {\n if (!this.isValid()) {\n return 'moment.invalid(/* ' + this._i + ' */)';\n }\n var func = 'moment';\n var zone = '';\n if (!this.isLocal()) {\n func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';\n zone = 'Z';\n }\n var prefix = '[' + func + '(\"]';\n var year = (0 <= this.year() && this.year() <= 9999) ? 'YYYY' : 'YYYYYY';\n var datetime = '-MM-DD[T]HH:mm:ss.SSS';\n var suffix = zone + '[\")]';\n\n return this.format(prefix + year + datetime + suffix);\n }\n\n function format (inputString) {\n if (!inputString) {\n inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat;\n }\n var output = formatMoment(this, inputString);\n return this.localeData().postformat(output);\n }\n\n function from (time, withoutSuffix) {\n if (this.isValid() &&\n ((isMoment(time) && time.isValid()) ||\n createLocal(time).isValid())) {\n return createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);\n } else {\n return this.localeData().invalidDate();\n }\n }\n\n function fromNow (withoutSuffix) {\n return this.from(createLocal(), withoutSuffix);\n }\n\n function to (time, withoutSuffix) {\n if (this.isValid() &&\n ((isMoment(time) && time.isValid()) ||\n createLocal(time).isValid())) {\n return createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix);\n } else {\n return this.localeData().invalidDate();\n }\n }\n\n function toNow (withoutSuffix) {\n return this.to(createLocal(), withoutSuffix);\n }\n\n// If passed a locale key, it will set the locale for this\n// instance. Otherwise, it will return the locale configuration\n// variables for this instance.\n function locale (key) {\n var newLocaleData;\n\n if (key === undefined) {\n return this._locale._abbr;\n } else {\n newLocaleData = getLocale(key);\n if (newLocaleData != null) {\n this._locale = newLocaleData;\n }\n return this;\n }\n }\n\n var lang = deprecate(\n 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',\n function (key) {\n if (key === undefined) {\n return this.localeData();\n } else {\n return this.locale(key);\n }\n }\n );\n\n function localeData () {\n return this._locale;\n }\n\n function startOf (units) {\n units = normalizeUnits(units);\n // the following switch intentionally omits break keywords\n // to utilize falling through the cases.\n switch (units) {\n case 'year':\n this.month(0);\n\t\t\t\t/* falls through */\n case 'quarter':\n case 'month':\n this.date(1);\n\t\t\t\t/* falls through */\n case 'week':\n case 'isoWeek':\n case 'day':\n case 'date':\n this.hours(0);\n\t\t\t\t/* falls through */\n case 'hour':\n this.minutes(0);\n\t\t\t\t/* falls through */\n case 'minute':\n this.seconds(0);\n\t\t\t\t/* falls through */\n case 'second':\n this.milliseconds(0);\n }\n\n // weeks are a special case\n if (units === 'week') {\n this.weekday(0);\n }\n if (units === 'isoWeek') {\n this.isoWeekday(1);\n }\n\n // quarters are also special\n if (units === 'quarter') {\n this.month(Math.floor(this.month() / 3) * 3);\n }\n\n return this;\n }\n\n function endOf (units) {\n units = normalizeUnits(units);\n if (units === undefined || units === 'millisecond') {\n return this;\n }\n\n // 'date' is an alias for 'day', so it should be considered as such.\n if (units === 'date') {\n units = 'day';\n }\n\n return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms');\n }\n\n function valueOf () {\n return this._d.valueOf() - ((this._offset || 0) * 60000);\n }\n\n function unix () {\n return Math.floor(this.valueOf() / 1000);\n }\n\n function toDate () {\n return new Date(this.valueOf());\n }\n\n function toArray () {\n var m = this;\n return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];\n }\n\n function toObject () {\n var m = this;\n return {\n years: m.year(),\n months: m.month(),\n date: m.date(),\n hours: m.hours(),\n minutes: m.minutes(),\n seconds: m.seconds(),\n milliseconds: m.milliseconds()\n };\n }\n\n function toJSON () {\n // new Date(NaN).toJSON() === null\n return this.isValid() ? this.toISOString() : null;\n }\n\n function isValid$2 () {\n return isValid(this);\n }\n\n function parsingFlags () {\n return extend({}, getParsingFlags(this));\n }\n\n function invalidAt () {\n return getParsingFlags(this).overflow;\n }\n\n function creationData() {\n return {\n input: this._i,\n format: this._f,\n locale: this._locale,\n isUTC: this._isUTC,\n strict: this._strict\n };\n }\n\n// FORMATTING\n\n addFormatToken(0, ['gg', 2], 0, function () {\n return this.weekYear() % 100;\n });\n\n addFormatToken(0, ['GG', 2], 0, function () {\n return this.isoWeekYear() % 100;\n });\n\n function addWeekYearFormatToken (token, getter) {\n addFormatToken(0, [token, token.length], 0, getter);\n }\n\n addWeekYearFormatToken('gggg', 'weekYear');\n addWeekYearFormatToken('ggggg', 'weekYear');\n addWeekYearFormatToken('GGGG', 'isoWeekYear');\n addWeekYearFormatToken('GGGGG', 'isoWeekYear');\n\n// ALIASES\n\n addUnitAlias('weekYear', 'gg');\n addUnitAlias('isoWeekYear', 'GG');\n\n// PRIORITY\n\n addUnitPriority('weekYear', 1);\n addUnitPriority('isoWeekYear', 1);\n\n\n// PARSING\n\n addRegexToken('G', matchSigned);\n addRegexToken('g', matchSigned);\n addRegexToken('GG', match1to2, match2);\n addRegexToken('gg', match1to2, match2);\n addRegexToken('GGGG', match1to4, match4);\n addRegexToken('gggg', match1to4, match4);\n addRegexToken('GGGGG', match1to6, match6);\n addRegexToken('ggggg', match1to6, match6);\n\n addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {\n week[token.substr(0, 2)] = toInt(input);\n });\n\n addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {\n week[token] = hooks.parseTwoDigitYear(input);\n });\n\n// MOMENTS\n\n function getSetWeekYear (input) {\n return getSetWeekYearHelper.call(this,\n input,\n this.week(),\n this.weekday(),\n this.localeData()._week.dow,\n this.localeData()._week.doy);\n }\n\n function getSetISOWeekYear (input) {\n return getSetWeekYearHelper.call(this,\n input, this.isoWeek(), this.isoWeekday(), 1, 4);\n }\n\n function getISOWeeksInYear () {\n return weeksInYear(this.year(), 1, 4);\n }\n\n function getWeeksInYear () {\n var weekInfo = this.localeData()._week;\n return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);\n }\n\n function getSetWeekYearHelper(input, week, weekday, dow, doy) {\n var weeksTarget;\n if (input == null) {\n return weekOfYear(this, dow, doy).year;\n } else {\n weeksTarget = weeksInYear(input, dow, doy);\n if (week > weeksTarget) {\n week = weeksTarget;\n }\n return setWeekAll.call(this, input, week, weekday, dow, doy);\n }\n }\n\n function setWeekAll(weekYear, week, weekday, dow, doy) {\n var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),\n date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);\n\n this.year(date.getUTCFullYear());\n this.month(date.getUTCMonth());\n this.date(date.getUTCDate());\n return this;\n }\n\n// FORMATTING\n\n addFormatToken('Q', 0, 'Qo', 'quarter');\n\n// ALIASES\n\n addUnitAlias('quarter', 'Q');\n\n// PRIORITY\n\n addUnitPriority('quarter', 7);\n\n// PARSING\n\n addRegexToken('Q', match1);\n addParseToken('Q', function (input, array) {\n array[MONTH] = (toInt(input) - 1) * 3;\n });\n\n// MOMENTS\n\n function getSetQuarter (input) {\n return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);\n }\n\n// FORMATTING\n\n addFormatToken('D', ['DD', 2], 'Do', 'date');\n\n// ALIASES\n\n addUnitAlias('date', 'D');\n\n// PRIOROITY\n addUnitPriority('date', 9);\n\n// PARSING\n\n addRegexToken('D', match1to2);\n addRegexToken('DD', match1to2, match2);\n addRegexToken('Do', function (isStrict, locale) {\n // TODO: Remove \"ordinalParse\" fallback in next major release.\n return isStrict ?\n (locale._dayOfMonthOrdinalParse || locale._ordinalParse) :\n locale._dayOfMonthOrdinalParseLenient;\n });\n\n addParseToken(['D', 'DD'], DATE);\n addParseToken('Do', function (input, array) {\n array[DATE] = toInt(input.match(match1to2)[0], 10);\n });\n\n// MOMENTS\n\n var getSetDayOfMonth = makeGetSet('Date', true);\n\n// FORMATTING\n\n addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');\n\n// ALIASES\n\n addUnitAlias('dayOfYear', 'DDD');\n\n// PRIORITY\n addUnitPriority('dayOfYear', 4);\n\n// PARSING\n\n addRegexToken('DDD', match1to3);\n addRegexToken('DDDD', match3);\n addParseToken(['DDD', 'DDDD'], function (input, array, config) {\n config._dayOfYear = toInt(input);\n });\n\n// HELPERS\n\n// MOMENTS\n\n function getSetDayOfYear (input) {\n var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;\n return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');\n }\n\n// FORMATTING\n\n addFormatToken('m', ['mm', 2], 0, 'minute');\n\n// ALIASES\n\n addUnitAlias('minute', 'm');\n\n// PRIORITY\n\n addUnitPriority('minute', 14);\n\n// PARSING\n\n addRegexToken('m', match1to2);\n addRegexToken('mm', match1to2, match2);\n addParseToken(['m', 'mm'], MINUTE);\n\n// MOMENTS\n\n var getSetMinute = makeGetSet('Minutes', false);\n\n// FORMATTING\n\n addFormatToken('s', ['ss', 2], 0, 'second');\n\n// ALIASES\n\n addUnitAlias('second', 's');\n\n// PRIORITY\n\n addUnitPriority('second', 15);\n\n// PARSING\n\n addRegexToken('s', match1to2);\n addRegexToken('ss', match1to2, match2);\n addParseToken(['s', 'ss'], SECOND);\n\n// MOMENTS\n\n var getSetSecond = makeGetSet('Seconds', false);\n\n// FORMATTING\n\n addFormatToken('S', 0, 0, function () {\n return ~~(this.millisecond() / 100);\n });\n\n addFormatToken(0, ['SS', 2], 0, function () {\n return ~~(this.millisecond() / 10);\n });\n\n addFormatToken(0, ['SSS', 3], 0, 'millisecond');\n addFormatToken(0, ['SSSS', 4], 0, function () {\n return this.millisecond() * 10;\n });\n addFormatToken(0, ['SSSSS', 5], 0, function () {\n return this.millisecond() * 100;\n });\n addFormatToken(0, ['SSSSSS', 6], 0, function () {\n return this.millisecond() * 1000;\n });\n addFormatToken(0, ['SSSSSSS', 7], 0, function () {\n return this.millisecond() * 10000;\n });\n addFormatToken(0, ['SSSSSSSS', 8], 0, function () {\n return this.millisecond() * 100000;\n });\n addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {\n return this.millisecond() * 1000000;\n });\n\n\n// ALIASES\n\n addUnitAlias('millisecond', 'ms');\n\n// PRIORITY\n\n addUnitPriority('millisecond', 16);\n\n// PARSING\n\n addRegexToken('S', match1to3, match1);\n addRegexToken('SS', match1to3, match2);\n addRegexToken('SSS', match1to3, match3);\n\n var token;\n for (token = 'SSSS'; token.length <= 9; token += 'S') {\n addRegexToken(token, matchUnsigned);\n }\n\n function parseMs(input, array) {\n array[MILLISECOND] = toInt(('0.' + input) * 1000);\n }\n\n for (token = 'S'; token.length <= 9; token += 'S') {\n addParseToken(token, parseMs);\n }\n// MOMENTS\n\n var getSetMillisecond = makeGetSet('Milliseconds', false);\n\n// FORMATTING\n\n addFormatToken('z', 0, 0, 'zoneAbbr');\n addFormatToken('zz', 0, 0, 'zoneName');\n\n// MOMENTS\n\n function getZoneAbbr () {\n return this._isUTC ? 'UTC' : '';\n }\n\n function getZoneName () {\n return this._isUTC ? 'Coordinated Universal Time' : '';\n }\n\n var proto = Moment.prototype;\n\n proto.add = add;\n proto.calendar = calendar$1;\n proto.clone = clone;\n proto.diff = diff;\n proto.endOf = endOf;\n proto.format = format;\n proto.from = from;\n proto.fromNow = fromNow;\n proto.to = to;\n proto.toNow = toNow;\n proto.get = stringGet;\n proto.invalidAt = invalidAt;\n proto.isAfter = isAfter;\n proto.isBefore = isBefore;\n proto.isBetween = isBetween;\n proto.isSame = isSame;\n proto.isSameOrAfter = isSameOrAfter;\n proto.isSameOrBefore = isSameOrBefore;\n proto.isValid = isValid$2;\n proto.lang = lang;\n proto.locale = locale;\n proto.localeData = localeData;\n proto.max = prototypeMax;\n proto.min = prototypeMin;\n proto.parsingFlags = parsingFlags;\n proto.set = stringSet;\n proto.startOf = startOf;\n proto.subtract = subtract;\n proto.toArray = toArray;\n proto.toObject = toObject;\n proto.toDate = toDate;\n proto.toISOString = toISOString;\n proto.inspect = inspect;\n proto.toJSON = toJSON;\n proto.toString = toString;\n proto.unix = unix;\n proto.valueOf = valueOf;\n proto.creationData = creationData;\n\n// Year\n proto.year = getSetYear;\n proto.isLeapYear = getIsLeapYear;\n\n// Week Year\n proto.weekYear = getSetWeekYear;\n proto.isoWeekYear = getSetISOWeekYear;\n\n// Quarter\n proto.quarter = proto.quarters = getSetQuarter;\n\n// Month\n proto.month = getSetMonth;\n proto.daysInMonth = getDaysInMonth;\n\n// Week\n proto.week = proto.weeks = getSetWeek;\n proto.isoWeek = proto.isoWeeks = getSetISOWeek;\n proto.weeksInYear = getWeeksInYear;\n proto.isoWeeksInYear = getISOWeeksInYear;\n\n// Day\n proto.date = getSetDayOfMonth;\n proto.day = proto.days = getSetDayOfWeek;\n proto.weekday = getSetLocaleDayOfWeek;\n proto.isoWeekday = getSetISODayOfWeek;\n proto.dayOfYear = getSetDayOfYear;\n\n// Hour\n proto.hour = proto.hours = getSetHour;\n\n// Minute\n proto.minute = proto.minutes = getSetMinute;\n\n// Second\n proto.second = proto.seconds = getSetSecond;\n\n// Millisecond\n proto.millisecond = proto.milliseconds = getSetMillisecond;\n\n// Offset\n proto.utcOffset = getSetOffset;\n proto.utc = setOffsetToUTC;\n proto.local = setOffsetToLocal;\n proto.parseZone = setOffsetToParsedOffset;\n proto.hasAlignedHourOffset = hasAlignedHourOffset;\n proto.isDST = isDaylightSavingTime;\n proto.isLocal = isLocal;\n proto.isUtcOffset = isUtcOffset;\n proto.isUtc = isUtc;\n proto.isUTC = isUtc;\n\n// Timezone\n proto.zoneAbbr = getZoneAbbr;\n proto.zoneName = getZoneName;\n\n// Deprecations\n proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);\n proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);\n proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);\n proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone);\n proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted);\n\n function createUnix (input) {\n return createLocal(input * 1000);\n }\n\n function createInZone () {\n return createLocal.apply(null, arguments).parseZone();\n }\n\n function preParsePostFormat (string) {\n return string;\n }\n\n var proto$1 = Locale.prototype;\n\n proto$1.calendar = calendar;\n proto$1.longDateFormat = longDateFormat;\n proto$1.invalidDate = invalidDate;\n proto$1.ordinal = ordinal;\n proto$1.preparse = preParsePostFormat;\n proto$1.postformat = preParsePostFormat;\n proto$1.relativeTime = relativeTime;\n proto$1.pastFuture = pastFuture;\n proto$1.set = set;\n\n// Month\n proto$1.months = localeMonths;\n proto$1.monthsShort = localeMonthsShort;\n proto$1.monthsParse = localeMonthsParse;\n proto$1.monthsRegex = monthsRegex;\n proto$1.monthsShortRegex = monthsShortRegex;\n\n// Week\n proto$1.week = localeWeek;\n proto$1.firstDayOfYear = localeFirstDayOfYear;\n proto$1.firstDayOfWeek = localeFirstDayOfWeek;\n\n// Day of Week\n proto$1.weekdays = localeWeekdays;\n proto$1.weekdaysMin = localeWeekdaysMin;\n proto$1.weekdaysShort = localeWeekdaysShort;\n proto$1.weekdaysParse = localeWeekdaysParse;\n\n proto$1.weekdaysRegex = weekdaysRegex;\n proto$1.weekdaysShortRegex = weekdaysShortRegex;\n proto$1.weekdaysMinRegex = weekdaysMinRegex;\n\n// Hours\n proto$1.isPM = localeIsPM;\n proto$1.meridiem = localeMeridiem;\n\n function get$1 (format, index, field, setter) {\n var locale = getLocale();\n var utc = createUTC().set(setter, index);\n return locale[field](utc, format);\n }\n\n function listMonthsImpl (format, index, field) {\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n\n if (index != null) {\n return get$1(format, index, field, 'month');\n }\n\n var i;\n var out = [];\n for (i = 0; i < 12; i++) {\n out[i] = get$1(format, i, field, 'month');\n }\n return out;\n }\n\n// ()\n// (5)\n// (fmt, 5)\n// (fmt)\n// (true)\n// (true, 5)\n// (true, fmt, 5)\n// (true, fmt)\n function listWeekdaysImpl (localeSorted, format, index, field) {\n if (typeof localeSorted === 'boolean') {\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n } else {\n format = localeSorted;\n index = format;\n localeSorted = false;\n\n if (isNumber(format)) {\n index = format;\n format = undefined;\n }\n\n format = format || '';\n }\n\n var locale = getLocale(),\n shift = localeSorted ? locale._week.dow : 0;\n\n if (index != null) {\n return get$1(format, (index + shift) % 7, field, 'day');\n }\n\n var i;\n var out = [];\n for (i = 0; i < 7; i++) {\n out[i] = get$1(format, (i + shift) % 7, field, 'day');\n }\n return out;\n }\n\n function listMonths (format, index) {\n return listMonthsImpl(format, index, 'months');\n }\n\n function listMonthsShort (format, index) {\n return listMonthsImpl(format, index, 'monthsShort');\n }\n\n function listWeekdays (localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdays');\n }\n\n function listWeekdaysShort (localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');\n }\n\n function listWeekdaysMin (localeSorted, format, index) {\n return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');\n }\n\n getSetGlobalLocale('en', {\n dayOfMonthOrdinalParse: /\\d{1,2}(th|st|nd|rd)/,\n ordinal : function (number) {\n var b = number % 10,\n output = (toInt(number % 100 / 10) === 1) ? 'th' :\n (b === 1) ? 'st' :\n (b === 2) ? 'nd' :\n (b === 3) ? 'rd' : 'th';\n return number + output;\n }\n });\n\n// Side effect imports\n hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale);\n hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale);\n\n var mathAbs = Math.abs;\n\n function abs () {\n var data = this._data;\n\n this._milliseconds = mathAbs(this._milliseconds);\n this._days = mathAbs(this._days);\n this._months = mathAbs(this._months);\n\n data.milliseconds = mathAbs(data.milliseconds);\n data.seconds = mathAbs(data.seconds);\n data.minutes = mathAbs(data.minutes);\n data.hours = mathAbs(data.hours);\n data.months = mathAbs(data.months);\n data.years = mathAbs(data.years);\n\n return this;\n }\n\n function addSubtract$1 (duration, input, value, direction) {\n var other = createDuration(input, value);\n\n duration._milliseconds += direction * other._milliseconds;\n duration._days += direction * other._days;\n duration._months += direction * other._months;\n\n return duration._bubble();\n }\n\n// supports only 2.0-style add(1, 's') or add(duration)\n function add$1 (input, value) {\n return addSubtract$1(this, input, value, 1);\n }\n\n// supports only 2.0-style subtract(1, 's') or subtract(duration)\n function subtract$1 (input, value) {\n return addSubtract$1(this, input, value, -1);\n }\n\n function absCeil (number) {\n if (number < 0) {\n return Math.floor(number);\n } else {\n return Math.ceil(number);\n }\n }\n\n function bubble () {\n var milliseconds = this._milliseconds;\n var days = this._days;\n var months = this._months;\n var data = this._data;\n var seconds, minutes, hours, years, monthsFromDays;\n\n // if we have a mix of positive and negative values, bubble down first\n // check: https://github.com/moment/moment/issues/2166\n if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||\n (milliseconds <= 0 && days <= 0 && months <= 0))) {\n milliseconds += absCeil(monthsToDays(months) + days) * 864e5;\n days = 0;\n months = 0;\n }\n\n // The following code bubbles up values, see the tests for\n // examples of what that means.\n data.milliseconds = milliseconds % 1000;\n\n seconds = absFloor(milliseconds / 1000);\n data.seconds = seconds % 60;\n\n minutes = absFloor(seconds / 60);\n data.minutes = minutes % 60;\n\n hours = absFloor(minutes / 60);\n data.hours = hours % 24;\n\n days += absFloor(hours / 24);\n\n // convert days to months\n monthsFromDays = absFloor(daysToMonths(days));\n months += monthsFromDays;\n days -= absCeil(monthsToDays(monthsFromDays));\n\n // 12 months -> 1 year\n years = absFloor(months / 12);\n months %= 12;\n\n data.days = days;\n data.months = months;\n data.years = years;\n\n return this;\n }\n\n function daysToMonths (days) {\n // 400 years have 146097 days (taking into account leap year rules)\n // 400 years have 12 months === 4800\n return days * 4800 / 146097;\n }\n\n function monthsToDays (months) {\n // the reverse of daysToMonths\n return months * 146097 / 4800;\n }\n\n function as (units) {\n if (!this.isValid()) {\n return NaN;\n }\n var days;\n var months;\n var milliseconds = this._milliseconds;\n\n units = normalizeUnits(units);\n\n if (units === 'month' || units === 'year') {\n days = this._days + milliseconds / 864e5;\n months = this._months + daysToMonths(days);\n return units === 'month' ? months : months / 12;\n } else {\n // handle milliseconds separately because of floating point math errors (issue #1867)\n days = this._days + Math.round(monthsToDays(this._months));\n switch (units) {\n case 'week' : return days / 7 + milliseconds / 6048e5;\n case 'day' : return days + milliseconds / 864e5;\n case 'hour' : return days * 24 + milliseconds / 36e5;\n case 'minute' : return days * 1440 + milliseconds / 6e4;\n case 'second' : return days * 86400 + milliseconds / 1000;\n // Math.floor prevents floating point math errors here\n case 'millisecond': return Math.floor(days * 864e5) + milliseconds;\n default: throw new Error('Unknown unit ' + units);\n }\n }\n }\n\n// TODO: Use this.as('ms')?\n function valueOf$1 () {\n if (!this.isValid()) {\n return NaN;\n }\n return (\n this._milliseconds +\n this._days * 864e5 +\n (this._months % 12) * 2592e6 +\n toInt(this._months / 12) * 31536e6\n );\n }\n\n function makeAs (alias) {\n return function () {\n return this.as(alias);\n };\n }\n\n var asMilliseconds = makeAs('ms');\n var asSeconds = makeAs('s');\n var asMinutes = makeAs('m');\n var asHours = makeAs('h');\n var asDays = makeAs('d');\n var asWeeks = makeAs('w');\n var asMonths = makeAs('M');\n var asYears = makeAs('y');\n\n function get$2 (units) {\n units = normalizeUnits(units);\n return this.isValid() ? this[units + 's']() : NaN;\n }\n\n function makeGetter(name) {\n return function () {\n return this.isValid() ? this._data[name] : NaN;\n };\n }\n\n var milliseconds = makeGetter('milliseconds');\n var seconds = makeGetter('seconds');\n var minutes = makeGetter('minutes');\n var hours = makeGetter('hours');\n var days = makeGetter('days');\n var months = makeGetter('months');\n var years = makeGetter('years');\n\n function weeks () {\n return absFloor(this.days() / 7);\n }\n\n var round = Math.round;\n var thresholds = {\n ss: 44, // a few seconds to seconds\n s : 45, // seconds to minute\n m : 45, // minutes to hour\n h : 22, // hours to day\n d : 26, // days to month\n M : 11 // months to year\n };\n\n// helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize\n function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {\n return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);\n }\n\n function relativeTime$1 (posNegDuration, withoutSuffix, locale) {\n var duration = createDuration(posNegDuration).abs();\n var seconds = round(duration.as('s'));\n var minutes = round(duration.as('m'));\n var hours = round(duration.as('h'));\n var days = round(duration.as('d'));\n var months = round(duration.as('M'));\n var years = round(duration.as('y'));\n\n var a = seconds <= thresholds.ss && ['s', seconds] ||\n seconds < thresholds.s && ['ss', seconds] ||\n minutes <= 1 && ['m'] ||\n minutes < thresholds.m && ['mm', minutes] ||\n hours <= 1 && ['h'] ||\n hours < thresholds.h && ['hh', hours] ||\n days <= 1 && ['d'] ||\n days < thresholds.d && ['dd', days] ||\n months <= 1 && ['M'] ||\n months < thresholds.M && ['MM', months] ||\n years <= 1 && ['y'] || ['yy', years];\n\n a[2] = withoutSuffix;\n a[3] = +posNegDuration > 0;\n a[4] = locale;\n return substituteTimeAgo.apply(null, a);\n }\n\n// This function allows you to set the rounding function for relative time strings\n function getSetRelativeTimeRounding (roundingFunction) {\n if (roundingFunction === undefined) {\n return round;\n }\n if (typeof(roundingFunction) === 'function') {\n round = roundingFunction;\n return true;\n }\n return false;\n }\n\n// This function allows you to set a threshold for relative time strings\n function getSetRelativeTimeThreshold (threshold, limit) {\n if (thresholds[threshold] === undefined) {\n return false;\n }\n if (limit === undefined) {\n return thresholds[threshold];\n }\n thresholds[threshold] = limit;\n if (threshold === 's') {\n thresholds.ss = limit - 1;\n }\n return true;\n }\n\n function humanize (withSuffix) {\n if (!this.isValid()) {\n return this.localeData().invalidDate();\n }\n\n var locale = this.localeData();\n var output = relativeTime$1(this, !withSuffix, locale);\n\n if (withSuffix) {\n output = locale.pastFuture(+this, output);\n }\n\n return locale.postformat(output);\n }\n\n var abs$1 = Math.abs;\n\n function toISOString$1() {\n // for ISO strings we do not use the normal bubbling rules:\n // * milliseconds bubble up until they become hours\n // * days do not bubble at all\n // * months bubble up until they become years\n // This is because there is no context-free conversion between hours and days\n // (think of clock changes)\n // and also not between days and months (28-31 days per month)\n if (!this.isValid()) {\n return this.localeData().invalidDate();\n }\n\n var seconds = abs$1(this._milliseconds) / 1000;\n var days = abs$1(this._days);\n var months = abs$1(this._months);\n var minutes, hours, years;\n\n // 3600 seconds -> 60 minutes -> 1 hour\n minutes = absFloor(seconds / 60);\n hours = absFloor(minutes / 60);\n seconds %= 60;\n minutes %= 60;\n\n // 12 months -> 1 year\n years = absFloor(months / 12);\n months %= 12;\n\n\n // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js\n var Y = years;\n var M = months;\n var D = days;\n var h = hours;\n var m = minutes;\n var s = seconds;\n var total = this.asSeconds();\n\n if (!total) {\n // this is the same as C#'s (Noda) and python (isodate)...\n // but not other JS (goog.date)\n return 'P0D';\n }\n\n return (total < 0 ? '-' : '') +\n 'P' +\n (Y ? Y + 'Y' : '') +\n (M ? M + 'M' : '') +\n (D ? D + 'D' : '') +\n ((h || m || s) ? 'T' : '') +\n (h ? h + 'H' : '') +\n (m ? m + 'M' : '') +\n (s ? s + 'S' : '');\n }\n\n var proto$2 = Duration.prototype;\n\n proto$2.isValid = isValid$1;\n proto$2.abs = abs;\n proto$2.add = add$1;\n proto$2.subtract = subtract$1;\n proto$2.as = as;\n proto$2.asMilliseconds = asMilliseconds;\n proto$2.asSeconds = asSeconds;\n proto$2.asMinutes = asMinutes;\n proto$2.asHours = asHours;\n proto$2.asDays = asDays;\n proto$2.asWeeks = asWeeks;\n proto$2.asMonths = asMonths;\n proto$2.asYears = asYears;\n proto$2.valueOf = valueOf$1;\n proto$2._bubble = bubble;\n proto$2.get = get$2;\n proto$2.milliseconds = milliseconds;\n proto$2.seconds = seconds;\n proto$2.minutes = minutes;\n proto$2.hours = hours;\n proto$2.days = days;\n proto$2.weeks = weeks;\n proto$2.months = months;\n proto$2.years = years;\n proto$2.humanize = humanize;\n proto$2.toISOString = toISOString$1;\n proto$2.toString = toISOString$1;\n proto$2.toJSON = toISOString$1;\n proto$2.locale = locale;\n proto$2.localeData = localeData;\n\n// Deprecations\n proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1);\n proto$2.lang = lang;\n\n// Side effect imports\n\n// FORMATTING\n\n addFormatToken('X', 0, 0, 'unix');\n addFormatToken('x', 0, 0, 'valueOf');\n\n// PARSING\n\n addRegexToken('x', matchSigned);\n addRegexToken('X', matchTimestamp);\n addParseToken('X', function (input, array, config) {\n config._d = new Date(parseFloat(input, 10) * 1000);\n });\n addParseToken('x', function (input, array, config) {\n config._d = new Date(toInt(input));\n });\n\n// Side effect imports\n\n\n hooks.version = '2.18.1';\n\n setHookCallback(createLocal);\n\n hooks.fn = proto;\n hooks.min = min;\n hooks.max = max;\n hooks.now = now;\n hooks.utc = createUTC;\n hooks.unix = createUnix;\n hooks.months = listMonths;\n hooks.isDate = isDate;\n hooks.locale = getSetGlobalLocale;\n hooks.invalid = createInvalid;\n hooks.duration = createDuration;\n hooks.isMoment = isMoment;\n hooks.weekdays = listWeekdays;\n hooks.parseZone = createInZone;\n hooks.localeData = getLocale;\n hooks.isDuration = isDuration;\n hooks.monthsShort = listMonthsShort;\n hooks.weekdaysMin = listWeekdaysMin;\n hooks.defineLocale = defineLocale;\n hooks.updateLocale = updateLocale;\n hooks.locales = listLocales;\n hooks.weekdaysShort = listWeekdaysShort;\n hooks.normalizeUnits = normalizeUnits;\n hooks.relativeTimeRounding = getSetRelativeTimeRounding;\n hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;\n hooks.calendarFormat = getCalendarFormat;\n hooks.prototype = proto;\n\n return hooks;\n\n })));\n\n},{}],7:[function(require,module,exports){\n /**\n * @namespace Chart\n */\n var Chart = require(29)();\n\n Chart.helpers = require(45);\n\n// @todo dispatch these helpers into appropriated helpers/helpers.* file and write unit tests!\n require(27)(Chart);\n\n Chart.defaults = require(25);\n Chart.Element = require(26);\n Chart.elements = require(40);\n Chart.Interaction = require(28);\n Chart.platform = require(48);\n\n require(31)(Chart);\n require(22)(Chart);\n require(23)(Chart);\n require(24)(Chart);\n require(30)(Chart);\n require(33)(Chart);\n require(32)(Chart);\n require(35)(Chart);\n\n require(54)(Chart);\n require(52)(Chart);\n require(53)(Chart);\n require(55)(Chart);\n require(56)(Chart);\n require(57)(Chart);\n\n// Controllers must be loaded after elements\n// See Chart.core.datasetController.dataElementType\n require(15)(Chart);\n require(16)(Chart);\n require(17)(Chart);\n require(18)(Chart);\n require(19)(Chart);\n require(20)(Chart);\n require(21)(Chart);\n\n require(8)(Chart);\n require(9)(Chart);\n require(10)(Chart);\n require(11)(Chart);\n require(12)(Chart);\n require(13)(Chart);\n require(14)(Chart);\n\n// Loading built-it plugins\n var plugins = [];\n\n plugins.push(\n require(49)(Chart),\n require(50)(Chart),\n require(51)(Chart)\n );\n\n Chart.plugins.register(plugins);\n\n Chart.platform.initialize();\n\n module.exports = Chart;\n if (typeof window !== 'undefined') {\n window.Chart = Chart;\n }\n\n// DEPRECATIONS\n\n /**\n * Provided for backward compatibility, use Chart.helpers.canvas instead.\n * @namespace Chart.canvasHelpers\n * @deprecated since version 2.6.0\n * @todo remove at version 3\n * @private\n */\n Chart.canvasHelpers = Chart.helpers.canvas;\n\n},{\"10\":10,\"11\":11,\"12\":12,\"13\":13,\"14\":14,\"15\":15,\"16\":16,\"17\":17,\"18\":18,\"19\":19,\"20\":20,\"21\":21,\"22\":22,\"23\":23,\"24\":24,\"25\":25,\"26\":26,\"27\":27,\"28\":28,\"29\":29,\"30\":30,\"31\":31,\"32\":32,\"33\":33,\"35\":35,\"40\":40,\"45\":45,\"48\":48,\"49\":49,\"50\":50,\"51\":51,\"52\":52,\"53\":53,\"54\":54,\"55\":55,\"56\":56,\"57\":57,\"8\":8,\"9\":9}],8:[function(require,module,exports){\n 'use strict';\n\n module.exports = function(Chart) {\n\n Chart.Bar = function(context, config) {\n config.type = 'bar';\n\n return new Chart(context, config);\n };\n\n };\n\n},{}],9:[function(require,module,exports){\n 'use strict';\n\n module.exports = function(Chart) {\n\n Chart.Bubble = function(context, config) {\n config.type = 'bubble';\n return new Chart(context, config);\n };\n\n };\n\n},{}],10:[function(require,module,exports){\n 'use strict';\n\n module.exports = function(Chart) {\n\n Chart.Doughnut = function(context, config) {\n config.type = 'doughnut';\n\n return new Chart(context, config);\n };\n\n };\n\n},{}],11:[function(require,module,exports){\n 'use strict';\n\n module.exports = function(Chart) {\n\n Chart.Line = function(context, config) {\n config.type = 'line';\n\n return new Chart(context, config);\n };\n\n };\n\n},{}],12:[function(require,module,exports){\n 'use strict';\n\n module.exports = function(Chart) {\n\n Chart.PolarArea = function(context, config) {\n config.type = 'polarArea';\n\n return new Chart(context, config);\n };\n\n };\n\n},{}],13:[function(require,module,exports){\n 'use strict';\n\n module.exports = function(Chart) {\n\n Chart.Radar = function(context, config) {\n config.type = 'radar';\n\n return new Chart(context, config);\n };\n\n };\n\n},{}],14:[function(require,module,exports){\n 'use strict';\n\n module.exports = function(Chart) {\n Chart.Scatter = function(context, config) {\n config.type = 'scatter';\n return new Chart(context, config);\n };\n };\n\n},{}],15:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var elements = require(40);\n var helpers = require(45);\n\n defaults._set('bar', {\n hover: {\n mode: 'label'\n },\n\n scales: {\n xAxes: [{\n type: 'category',\n\n // Specific to Bar Controller\n categoryPercentage: 0.8,\n barPercentage: 0.9,\n\n // offset settings\n offset: true,\n\n // grid line settings\n gridLines: {\n offsetGridLines: true\n }\n }],\n\n yAxes: [{\n type: 'linear'\n }]\n }\n });\n\n defaults._set('horizontalBar', {\n hover: {\n mode: 'index',\n axis: 'y'\n },\n\n scales: {\n xAxes: [{\n type: 'linear',\n position: 'bottom'\n }],\n\n yAxes: [{\n position: 'left',\n type: 'category',\n\n // Specific to Horizontal Bar Controller\n categoryPercentage: 0.8,\n barPercentage: 0.9,\n\n // offset settings\n offset: true,\n\n // grid line settings\n gridLines: {\n offsetGridLines: true\n }\n }]\n },\n\n elements: {\n rectangle: {\n borderSkipped: 'left'\n }\n },\n\n tooltips: {\n callbacks: {\n title: function(item, data) {\n // Pick first xLabel for now\n var title = '';\n\n if (item.length > 0) {\n if (item[0].yLabel) {\n title = item[0].yLabel;\n } else if (data.labels.length > 0 && item[0].index < data.labels.length) {\n title = data.labels[item[0].index];\n }\n }\n\n return title;\n },\n\n label: function(item, data) {\n var datasetLabel = data.datasets[item.datasetIndex].label || '';\n return datasetLabel + ': ' + item.xLabel;\n }\n },\n mode: 'index',\n axis: 'y'\n }\n });\n\n module.exports = function(Chart) {\n\n Chart.controllers.bar = Chart.DatasetController.extend({\n\n dataElementType: elements.Rectangle,\n\n initialize: function() {\n var me = this;\n var meta;\n\n Chart.DatasetController.prototype.initialize.apply(me, arguments);\n\n meta = me.getMeta();\n meta.stack = me.getDataset().stack;\n meta.bar = true;\n },\n\n update: function(reset) {\n var me = this;\n var rects = me.getMeta().data;\n var i, ilen;\n\n me._ruler = me.getRuler();\n\n for (i = 0, ilen = rects.length; i < ilen; ++i) {\n me.updateElement(rects[i], i, reset);\n }\n },\n\n updateElement: function(rectangle, index, reset) {\n var me = this;\n var chart = me.chart;\n var meta = me.getMeta();\n var dataset = me.getDataset();\n var custom = rectangle.custom || {};\n var rectangleOptions = chart.options.elements.rectangle;\n\n rectangle._xScale = me.getScaleForId(meta.xAxisID);\n rectangle._yScale = me.getScaleForId(meta.yAxisID);\n rectangle._datasetIndex = me.index;\n rectangle._index = index;\n\n rectangle._model = {\n datasetLabel: dataset.label,\n label: chart.data.labels[index],\n borderSkipped: custom.borderSkipped ? custom.borderSkipped : rectangleOptions.borderSkipped,\n backgroundColor: custom.backgroundColor ? custom.backgroundColor : helpers.valueAtIndexOrDefault(dataset.backgroundColor, index, rectangleOptions.backgroundColor),\n borderColor: custom.borderColor ? custom.borderColor : helpers.valueAtIndexOrDefault(dataset.borderColor, index, rectangleOptions.borderColor),\n borderWidth: custom.borderWidth ? custom.borderWidth : helpers.valueAtIndexOrDefault(dataset.borderWidth, index, rectangleOptions.borderWidth)\n };\n\n me.updateElementGeometry(rectangle, index, reset);\n\n rectangle.pivot();\n },\n\n /**\n * @private\n */\n updateElementGeometry: function(rectangle, index, reset) {\n var me = this;\n var model = rectangle._model;\n var vscale = me.getValueScale();\n var base = vscale.getBasePixel();\n var horizontal = vscale.isHorizontal();\n var ruler = me._ruler || me.getRuler();\n var vpixels = me.calculateBarValuePixels(me.index, index);\n var ipixels = me.calculateBarIndexPixels(me.index, index, ruler);\n\n model.horizontal = horizontal;\n model.base = reset ? base : vpixels.base;\n model.x = horizontal ? reset ? base : vpixels.head : ipixels.center;\n model.y = horizontal ? ipixels.center : reset ? base : vpixels.head;\n model.height = horizontal ? ipixels.size : undefined;\n model.width = horizontal ? undefined : ipixels.size;\n },\n\n /**\n * @private\n */\n getValueScaleId: function() {\n return this.getMeta().yAxisID;\n },\n\n /**\n * @private\n */\n getIndexScaleId: function() {\n return this.getMeta().xAxisID;\n },\n\n /**\n * @private\n */\n getValueScale: function() {\n return this.getScaleForId(this.getValueScaleId());\n },\n\n /**\n * @private\n */\n getIndexScale: function() {\n return this.getScaleForId(this.getIndexScaleId());\n },\n\n /**\n * Returns the effective number of stacks based on groups and bar visibility.\n * @private\n */\n getStackCount: function(last) {\n var me = this;\n var chart = me.chart;\n var scale = me.getIndexScale();\n var stacked = scale.options.stacked;\n var ilen = last === undefined ? chart.data.datasets.length : last + 1;\n var stacks = [];\n var i, meta;\n\n for (i = 0; i < ilen; ++i) {\n meta = chart.getDatasetMeta(i);\n if (meta.bar && chart.isDatasetVisible(i) &&\n (stacked === false ||\n (stacked === true && stacks.indexOf(meta.stack) === -1) ||\n (stacked === undefined && (meta.stack === undefined || stacks.indexOf(meta.stack) === -1)))) {\n stacks.push(meta.stack);\n }\n }\n\n return stacks.length;\n },\n\n /**\n * Returns the stack index for the given dataset based on groups and bar visibility.\n * @private\n */\n getStackIndex: function(datasetIndex) {\n return this.getStackCount(datasetIndex) - 1;\n },\n\n /**\n * @private\n */\n getRuler: function() {\n var me = this;\n var scale = me.getIndexScale();\n var stackCount = me.getStackCount();\n var datasetIndex = me.index;\n var pixels = [];\n var isHorizontal = scale.isHorizontal();\n var start = isHorizontal ? scale.left : scale.top;\n var end = start + (isHorizontal ? scale.width : scale.height);\n var i, ilen;\n\n for (i = 0, ilen = me.getMeta().data.length; i < ilen; ++i) {\n pixels.push(scale.getPixelForValue(null, i, datasetIndex));\n }\n\n return {\n pixels: pixels,\n start: start,\n end: end,\n stackCount: stackCount,\n scale: scale\n };\n },\n\n /**\n * Note: pixel values are not clamped to the scale area.\n * @private\n */\n calculateBarValuePixels: function(datasetIndex, index) {\n var me = this;\n var chart = me.chart;\n var meta = me.getMeta();\n var scale = me.getValueScale();\n var datasets = chart.data.datasets;\n var value = scale.getRightValue(datasets[datasetIndex].data[index]);\n var stacked = scale.options.stacked;\n var stack = meta.stack;\n var start = 0;\n var i, imeta, ivalue, base, head, size;\n\n if (stacked || (stacked === undefined && stack !== undefined)) {\n for (i = 0; i < datasetIndex; ++i) {\n imeta = chart.getDatasetMeta(i);\n\n if (imeta.bar &&\n imeta.stack === stack &&\n imeta.controller.getValueScaleId() === scale.id &&\n chart.isDatasetVisible(i)) {\n\n ivalue = scale.getRightValue(datasets[i].data[index]);\n if ((value < 0 && ivalue < 0) || (value >= 0 && ivalue > 0)) {\n start += ivalue;\n }\n }\n }\n }\n\n base = scale.getPixelForValue(start);\n head = scale.getPixelForValue(start + value);\n size = (head - base) / 2;\n\n return {\n size: size,\n base: base,\n head: head,\n center: head + size / 2\n };\n },\n\n /**\n * @private\n */\n calculateBarIndexPixels: function(datasetIndex, index, ruler) {\n var me = this;\n var options = ruler.scale.options;\n var stackIndex = me.getStackIndex(datasetIndex);\n var pixels = ruler.pixels;\n var base = pixels[index];\n var length = pixels.length;\n var start = ruler.start;\n var end = ruler.end;\n var leftSampleSize, rightSampleSize, leftCategorySize, rightCategorySize, fullBarSize, size;\n\n if (length === 1) {\n leftSampleSize = base > start ? base - start : end - base;\n rightSampleSize = base < end ? end - base : base - start;\n } else {\n if (index > 0) {\n leftSampleSize = (base - pixels[index - 1]) / 2;\n if (index === length - 1) {\n rightSampleSize = leftSampleSize;\n }\n }\n if (index < length - 1) {\n rightSampleSize = (pixels[index + 1] - base) / 2;\n if (index === 0) {\n leftSampleSize = rightSampleSize;\n }\n }\n }\n\n leftCategorySize = leftSampleSize * options.categoryPercentage;\n rightCategorySize = rightSampleSize * options.categoryPercentage;\n fullBarSize = (leftCategorySize + rightCategorySize) / ruler.stackCount;\n size = fullBarSize * options.barPercentage;\n\n size = Math.min(\n helpers.valueOrDefault(options.barThickness, size),\n helpers.valueOrDefault(options.maxBarThickness, Infinity));\n\n base -= leftCategorySize;\n base += fullBarSize * stackIndex;\n base += (fullBarSize - size) / 2;\n\n return {\n size: size,\n base: base,\n head: base + size,\n center: base + size / 2\n };\n },\n\n draw: function() {\n var me = this;\n var chart = me.chart;\n var scale = me.getValueScale();\n var rects = me.getMeta().data;\n var dataset = me.getDataset();\n var ilen = rects.length;\n var i = 0;\n\n helpers.canvas.clipArea(chart.ctx, chart.chartArea);\n\n for (; i < ilen; ++i) {\n if (!isNaN(scale.getRightValue(dataset.data[i]))) {\n rects[i].draw();\n }\n }\n\n helpers.canvas.unclipArea(chart.ctx);\n },\n\n setHoverStyle: function(rectangle) {\n var dataset = this.chart.data.datasets[rectangle._datasetIndex];\n var index = rectangle._index;\n var custom = rectangle.custom || {};\n var model = rectangle._model;\n\n model.backgroundColor = custom.hoverBackgroundColor ? custom.hoverBackgroundColor : helpers.valueAtIndexOrDefault(dataset.hoverBackgroundColor, index, helpers.getHoverColor(model.backgroundColor));\n model.borderColor = custom.hoverBorderColor ? custom.hoverBorderColor : helpers.valueAtIndexOrDefault(dataset.hoverBorderColor, index, helpers.getHoverColor(model.borderColor));\n model.borderWidth = custom.hoverBorderWidth ? custom.hoverBorderWidth : helpers.valueAtIndexOrDefault(dataset.hoverBorderWidth, index, model.borderWidth);\n },\n\n removeHoverStyle: function(rectangle) {\n var dataset = this.chart.data.datasets[rectangle._datasetIndex];\n var index = rectangle._index;\n var custom = rectangle.custom || {};\n var model = rectangle._model;\n var rectangleElementOptions = this.chart.options.elements.rectangle;\n\n model.backgroundColor = custom.backgroundColor ? custom.backgroundColor : helpers.valueAtIndexOrDefault(dataset.backgroundColor, index, rectangleElementOptions.backgroundColor);\n model.borderColor = custom.borderColor ? custom.borderColor : helpers.valueAtIndexOrDefault(dataset.borderColor, index, rectangleElementOptions.borderColor);\n model.borderWidth = custom.borderWidth ? custom.borderWidth : helpers.valueAtIndexOrDefault(dataset.borderWidth, index, rectangleElementOptions.borderWidth);\n }\n });\n\n Chart.controllers.horizontalBar = Chart.controllers.bar.extend({\n /**\n * @private\n */\n getValueScaleId: function() {\n return this.getMeta().xAxisID;\n },\n\n /**\n * @private\n */\n getIndexScaleId: function() {\n return this.getMeta().yAxisID;\n }\n });\n };\n\n},{\"25\":25,\"40\":40,\"45\":45}],16:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var elements = require(40);\n var helpers = require(45);\n\n defaults._set('bubble', {\n hover: {\n mode: 'single'\n },\n\n scales: {\n xAxes: [{\n type: 'linear', // bubble should probably use a linear scale by default\n position: 'bottom',\n id: 'x-axis-0' // need an ID so datasets can reference the scale\n }],\n yAxes: [{\n type: 'linear',\n position: 'left',\n id: 'y-axis-0'\n }]\n },\n\n tooltips: {\n callbacks: {\n title: function() {\n // Title doesn't make sense for scatter since we format the data as a point\n return '';\n },\n label: function(item, data) {\n var datasetLabel = data.datasets[item.datasetIndex].label || '';\n var dataPoint = data.datasets[item.datasetIndex].data[item.index];\n return datasetLabel + ': (' + item.xLabel + ', ' + item.yLabel + ', ' + dataPoint.r + ')';\n }\n }\n }\n });\n\n\n module.exports = function(Chart) {\n\n Chart.controllers.bubble = Chart.DatasetController.extend({\n /**\n * @protected\n */\n dataElementType: elements.Point,\n\n /**\n * @protected\n */\n update: function(reset) {\n var me = this;\n var meta = me.getMeta();\n var points = meta.data;\n\n // Update Points\n helpers.each(points, function(point, index) {\n me.updateElement(point, index, reset);\n });\n },\n\n /**\n * @protected\n */\n updateElement: function(point, index, reset) {\n var me = this;\n var meta = me.getMeta();\n var custom = point.custom || {};\n var xScale = me.getScaleForId(meta.xAxisID);\n var yScale = me.getScaleForId(meta.yAxisID);\n var options = me._resolveElementOptions(point, index);\n var data = me.getDataset().data[index];\n var dsIndex = me.index;\n\n var x = reset ? xScale.getPixelForDecimal(0.5) : xScale.getPixelForValue(typeof data === 'object' ? data : NaN, index, dsIndex);\n var y = reset ? yScale.getBasePixel() : yScale.getPixelForValue(data, index, dsIndex);\n\n point._xScale = xScale;\n point._yScale = yScale;\n point._options = options;\n point._datasetIndex = dsIndex;\n point._index = index;\n point._model = {\n backgroundColor: options.backgroundColor,\n borderColor: options.borderColor,\n borderWidth: options.borderWidth,\n hitRadius: options.hitRadius,\n pointStyle: options.pointStyle,\n radius: reset ? 0 : options.radius,\n skip: custom.skip || isNaN(x) || isNaN(y),\n x: x,\n y: y,\n };\n\n point.pivot();\n },\n\n /**\n * @protected\n */\n setHoverStyle: function(point) {\n var model = point._model;\n var options = point._options;\n\n model.backgroundColor = helpers.valueOrDefault(options.hoverBackgroundColor, helpers.getHoverColor(options.backgroundColor));\n model.borderColor = helpers.valueOrDefault(options.hoverBorderColor, helpers.getHoverColor(options.borderColor));\n model.borderWidth = helpers.valueOrDefault(options.hoverBorderWidth, options.borderWidth);\n model.radius = options.radius + options.hoverRadius;\n },\n\n /**\n * @protected\n */\n removeHoverStyle: function(point) {\n var model = point._model;\n var options = point._options;\n\n model.backgroundColor = options.backgroundColor;\n model.borderColor = options.borderColor;\n model.borderWidth = options.borderWidth;\n model.radius = options.radius;\n },\n\n /**\n * @private\n */\n _resolveElementOptions: function(point, index) {\n var me = this;\n var chart = me.chart;\n var datasets = chart.data.datasets;\n var dataset = datasets[me.index];\n var custom = point.custom || {};\n var options = chart.options.elements.point;\n var resolve = helpers.options.resolve;\n var data = dataset.data[index];\n var values = {};\n var i, ilen, key;\n\n // Scriptable options\n var context = {\n chart: chart,\n dataIndex: index,\n dataset: dataset,\n datasetIndex: me.index\n };\n\n var keys = [\n 'backgroundColor',\n 'borderColor',\n 'borderWidth',\n 'hoverBackgroundColor',\n 'hoverBorderColor',\n 'hoverBorderWidth',\n 'hoverRadius',\n 'hitRadius',\n 'pointStyle'\n ];\n\n for (i = 0, ilen = keys.length; i < ilen; ++i) {\n key = keys[i];\n values[key] = resolve([\n custom[key],\n dataset[key],\n options[key]\n ], context, index);\n }\n\n // Custom radius resolution\n values.radius = resolve([\n custom.radius,\n data ? data.r : undefined,\n dataset.radius,\n options.radius\n ], context, index);\n\n return values;\n }\n });\n };\n\n},{\"25\":25,\"40\":40,\"45\":45}],17:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var elements = require(40);\n var helpers = require(45);\n\n defaults._set('doughnut', {\n animation: {\n // Boolean - Whether we animate the rotation of the Doughnut\n animateRotate: true,\n // Boolean - Whether we animate scaling the Doughnut from the centre\n animateScale: false\n },\n hover: {\n mode: 'single'\n },\n legendCallback: function(chart) {\n var text = [];\n text.push('
        ');\n\n var data = chart.data;\n var datasets = data.datasets;\n var labels = data.labels;\n\n if (datasets.length) {\n for (var i = 0; i < datasets[0].data.length; ++i) {\n text.push('
      • ');\n if (labels[i]) {\n text.push(labels[i]);\n }\n text.push('
      • ');\n }\n }\n\n text.push('
      ');\n return text.join('');\n },\n legend: {\n labels: {\n generateLabels: function(chart) {\n var data = chart.data;\n if (data.labels.length && data.datasets.length) {\n return data.labels.map(function(label, i) {\n var meta = chart.getDatasetMeta(0);\n var ds = data.datasets[0];\n var arc = meta.data[i];\n var custom = arc && arc.custom || {};\n var valueAtIndexOrDefault = helpers.valueAtIndexOrDefault;\n var arcOpts = chart.options.elements.arc;\n var fill = custom.backgroundColor ? custom.backgroundColor : valueAtIndexOrDefault(ds.backgroundColor, i, arcOpts.backgroundColor);\n var stroke = custom.borderColor ? custom.borderColor : valueAtIndexOrDefault(ds.borderColor, i, arcOpts.borderColor);\n var bw = custom.borderWidth ? custom.borderWidth : valueAtIndexOrDefault(ds.borderWidth, i, arcOpts.borderWidth);\n\n return {\n text: label,\n fillStyle: fill,\n strokeStyle: stroke,\n lineWidth: bw,\n hidden: isNaN(ds.data[i]) || meta.data[i].hidden,\n\n // Extra data used for toggling the correct item\n index: i\n };\n });\n }\n return [];\n }\n },\n\n onClick: function(e, legendItem) {\n var index = legendItem.index;\n var chart = this.chart;\n var i, ilen, meta;\n\n for (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) {\n meta = chart.getDatasetMeta(i);\n // toggle visibility of index if exists\n if (meta.data[index]) {\n meta.data[index].hidden = !meta.data[index].hidden;\n }\n }\n\n chart.update();\n }\n },\n\n // The percentage of the chart that we cut out of the middle.\n cutoutPercentage: 50,\n\n // The rotation of the chart, where the first data arc begins.\n rotation: Math.PI * -0.5,\n\n // The total circumference of the chart.\n circumference: Math.PI * 2.0,\n\n // Need to override these to give a nice default\n tooltips: {\n callbacks: {\n title: function() {\n return '';\n },\n label: function(tooltipItem, data) {\n var dataLabel = data.labels[tooltipItem.index];\n var value = ': ' + data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index];\n\n if (helpers.isArray(dataLabel)) {\n // show value on first line of multiline label\n // need to clone because we are changing the value\n dataLabel = dataLabel.slice();\n dataLabel[0] += value;\n } else {\n dataLabel += value;\n }\n\n return dataLabel;\n }\n }\n }\n });\n\n defaults._set('pie', helpers.clone(defaults.doughnut));\n defaults._set('pie', {\n cutoutPercentage: 0\n });\n\n module.exports = function(Chart) {\n\n Chart.controllers.doughnut = Chart.controllers.pie = Chart.DatasetController.extend({\n\n dataElementType: elements.Arc,\n\n linkScales: helpers.noop,\n\n // Get index of the dataset in relation to the visible datasets. This allows determining the inner and outer radius correctly\n getRingIndex: function(datasetIndex) {\n var ringIndex = 0;\n\n for (var j = 0; j < datasetIndex; ++j) {\n if (this.chart.isDatasetVisible(j)) {\n ++ringIndex;\n }\n }\n\n return ringIndex;\n },\n\n update: function(reset) {\n var me = this;\n var chart = me.chart;\n var chartArea = chart.chartArea;\n var opts = chart.options;\n var arcOpts = opts.elements.arc;\n var availableWidth = chartArea.right - chartArea.left - arcOpts.borderWidth;\n var availableHeight = chartArea.bottom - chartArea.top - arcOpts.borderWidth;\n var minSize = Math.min(availableWidth, availableHeight);\n var offset = {x: 0, y: 0};\n var meta = me.getMeta();\n var cutoutPercentage = opts.cutoutPercentage;\n var circumference = opts.circumference;\n\n // If the chart's circumference isn't a full circle, calculate minSize as a ratio of the width/height of the arc\n if (circumference < Math.PI * 2.0) {\n var startAngle = opts.rotation % (Math.PI * 2.0);\n startAngle += Math.PI * 2.0 * (startAngle >= Math.PI ? -1 : startAngle < -Math.PI ? 1 : 0);\n var endAngle = startAngle + circumference;\n var start = {x: Math.cos(startAngle), y: Math.sin(startAngle)};\n var end = {x: Math.cos(endAngle), y: Math.sin(endAngle)};\n var contains0 = (startAngle <= 0 && endAngle >= 0) || (startAngle <= Math.PI * 2.0 && Math.PI * 2.0 <= endAngle);\n var contains90 = (startAngle <= Math.PI * 0.5 && Math.PI * 0.5 <= endAngle) || (startAngle <= Math.PI * 2.5 && Math.PI * 2.5 <= endAngle);\n var contains180 = (startAngle <= -Math.PI && -Math.PI <= endAngle) || (startAngle <= Math.PI && Math.PI <= endAngle);\n var contains270 = (startAngle <= -Math.PI * 0.5 && -Math.PI * 0.5 <= endAngle) || (startAngle <= Math.PI * 1.5 && Math.PI * 1.5 <= endAngle);\n var cutout = cutoutPercentage / 100.0;\n var min = {x: contains180 ? -1 : Math.min(start.x * (start.x < 0 ? 1 : cutout), end.x * (end.x < 0 ? 1 : cutout)), y: contains270 ? -1 : Math.min(start.y * (start.y < 0 ? 1 : cutout), end.y * (end.y < 0 ? 1 : cutout))};\n var max = {x: contains0 ? 1 : Math.max(start.x * (start.x > 0 ? 1 : cutout), end.x * (end.x > 0 ? 1 : cutout)), y: contains90 ? 1 : Math.max(start.y * (start.y > 0 ? 1 : cutout), end.y * (end.y > 0 ? 1 : cutout))};\n var size = {width: (max.x - min.x) * 0.5, height: (max.y - min.y) * 0.5};\n minSize = Math.min(availableWidth / size.width, availableHeight / size.height);\n offset = {x: (max.x + min.x) * -0.5, y: (max.y + min.y) * -0.5};\n }\n\n chart.borderWidth = me.getMaxBorderWidth(meta.data);\n chart.outerRadius = Math.max((minSize - chart.borderWidth) / 2, 0);\n chart.innerRadius = Math.max(cutoutPercentage ? (chart.outerRadius / 100) * (cutoutPercentage) : 0, 0);\n chart.radiusLength = (chart.outerRadius - chart.innerRadius) / chart.getVisibleDatasetCount();\n chart.offsetX = offset.x * chart.outerRadius;\n chart.offsetY = offset.y * chart.outerRadius;\n\n meta.total = me.calculateTotal();\n\n me.outerRadius = chart.outerRadius - (chart.radiusLength * me.getRingIndex(me.index));\n me.innerRadius = Math.max(me.outerRadius - chart.radiusLength, 0);\n\n helpers.each(meta.data, function(arc, index) {\n me.updateElement(arc, index, reset);\n });\n },\n\n updateElement: function(arc, index, reset) {\n var me = this;\n var chart = me.chart;\n var chartArea = chart.chartArea;\n var opts = chart.options;\n var animationOpts = opts.animation;\n var centerX = (chartArea.left + chartArea.right) / 2;\n var centerY = (chartArea.top + chartArea.bottom) / 2;\n var startAngle = opts.rotation; // non reset case handled later\n var endAngle = opts.rotation; // non reset case handled later\n var dataset = me.getDataset();\n var circumference = reset && animationOpts.animateRotate ? 0 : arc.hidden ? 0 : me.calculateCircumference(dataset.data[index]) * (opts.circumference / (2.0 * Math.PI));\n var innerRadius = reset && animationOpts.animateScale ? 0 : me.innerRadius;\n var outerRadius = reset && animationOpts.animateScale ? 0 : me.outerRadius;\n var valueAtIndexOrDefault = helpers.valueAtIndexOrDefault;\n\n helpers.extend(arc, {\n // Utility\n _datasetIndex: me.index,\n _index: index,\n\n // Desired view properties\n _model: {\n x: centerX + chart.offsetX,\n y: centerY + chart.offsetY,\n startAngle: startAngle,\n endAngle: endAngle,\n circumference: circumference,\n outerRadius: outerRadius,\n innerRadius: innerRadius,\n label: valueAtIndexOrDefault(dataset.label, index, chart.data.labels[index])\n }\n });\n\n var model = arc._model;\n // Resets the visual styles\n this.removeHoverStyle(arc);\n\n // Set correct angles if not resetting\n if (!reset || !animationOpts.animateRotate) {\n if (index === 0) {\n model.startAngle = opts.rotation;\n } else {\n model.startAngle = me.getMeta().data[index - 1]._model.endAngle;\n }\n\n model.endAngle = model.startAngle + model.circumference;\n }\n\n arc.pivot();\n },\n\n removeHoverStyle: function(arc) {\n Chart.DatasetController.prototype.removeHoverStyle.call(this, arc, this.chart.options.elements.arc);\n },\n\n calculateTotal: function() {\n var dataset = this.getDataset();\n var meta = this.getMeta();\n var total = 0;\n var value;\n\n helpers.each(meta.data, function(element, index) {\n value = dataset.data[index];\n if (!isNaN(value) && !element.hidden) {\n total += Math.abs(value);\n }\n });\n\n\t\t\t\t/* if (total === 0) {\n\t\t\t\t total = NaN;\n\t\t\t\t }*/\n\n return total;\n },\n\n calculateCircumference: function(value) {\n var total = this.getMeta().total;\n if (total > 0 && !isNaN(value)) {\n return (Math.PI * 2.0) * (value / total);\n }\n return 0;\n },\n\n // gets the max border or hover width to properly scale pie charts\n getMaxBorderWidth: function(arcs) {\n var max = 0;\n var index = this.index;\n var length = arcs.length;\n var borderWidth;\n var hoverWidth;\n\n for (var i = 0; i < length; i++) {\n borderWidth = arcs[i]._model ? arcs[i]._model.borderWidth : 0;\n hoverWidth = arcs[i]._chart ? arcs[i]._chart.config.data.datasets[index].hoverBorderWidth : 0;\n\n max = borderWidth > max ? borderWidth : max;\n max = hoverWidth > max ? hoverWidth : max;\n }\n return max;\n }\n });\n };\n\n},{\"25\":25,\"40\":40,\"45\":45}],18:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var elements = require(40);\n var helpers = require(45);\n\n defaults._set('line', {\n showLines: true,\n spanGaps: false,\n\n hover: {\n mode: 'label'\n },\n\n scales: {\n xAxes: [{\n type: 'category',\n id: 'x-axis-0'\n }],\n yAxes: [{\n type: 'linear',\n id: 'y-axis-0'\n }]\n }\n });\n\n module.exports = function(Chart) {\n\n function lineEnabled(dataset, options) {\n return helpers.valueOrDefault(dataset.showLine, options.showLines);\n }\n\n Chart.controllers.line = Chart.DatasetController.extend({\n\n datasetElementType: elements.Line,\n\n dataElementType: elements.Point,\n\n update: function(reset) {\n var me = this;\n var meta = me.getMeta();\n var line = meta.dataset;\n var points = meta.data || [];\n var options = me.chart.options;\n var lineElementOptions = options.elements.line;\n var scale = me.getScaleForId(meta.yAxisID);\n var i, ilen, custom;\n var dataset = me.getDataset();\n var showLine = lineEnabled(dataset, options);\n\n // Update Line\n if (showLine) {\n custom = line.custom || {};\n\n // Compatibility: If the properties are defined with only the old name, use those values\n if ((dataset.tension !== undefined) && (dataset.lineTension === undefined)) {\n dataset.lineTension = dataset.tension;\n }\n\n // Utility\n line._scale = scale;\n line._datasetIndex = me.index;\n // Data\n line._children = points;\n // Model\n line._model = {\n // Appearance\n // The default behavior of lines is to break at null values, according\n // to https://github.com/chartjs/Chart.js/issues/2435#issuecomment-216718158\n // This option gives lines the ability to span gaps\n spanGaps: dataset.spanGaps ? dataset.spanGaps : options.spanGaps,\n tension: custom.tension ? custom.tension : helpers.valueOrDefault(dataset.lineTension, lineElementOptions.tension),\n backgroundColor: custom.backgroundColor ? custom.backgroundColor : (dataset.backgroundColor || lineElementOptions.backgroundColor),\n borderWidth: custom.borderWidth ? custom.borderWidth : (dataset.borderWidth || lineElementOptions.borderWidth),\n borderColor: custom.borderColor ? custom.borderColor : (dataset.borderColor || lineElementOptions.borderColor),\n borderCapStyle: custom.borderCapStyle ? custom.borderCapStyle : (dataset.borderCapStyle || lineElementOptions.borderCapStyle),\n borderDash: custom.borderDash ? custom.borderDash : (dataset.borderDash || lineElementOptions.borderDash),\n borderDashOffset: custom.borderDashOffset ? custom.borderDashOffset : (dataset.borderDashOffset || lineElementOptions.borderDashOffset),\n borderJoinStyle: custom.borderJoinStyle ? custom.borderJoinStyle : (dataset.borderJoinStyle || lineElementOptions.borderJoinStyle),\n fill: custom.fill ? custom.fill : (dataset.fill !== undefined ? dataset.fill : lineElementOptions.fill),\n steppedLine: custom.steppedLine ? custom.steppedLine : helpers.valueOrDefault(dataset.steppedLine, lineElementOptions.stepped),\n cubicInterpolationMode: custom.cubicInterpolationMode ? custom.cubicInterpolationMode : helpers.valueOrDefault(dataset.cubicInterpolationMode, lineElementOptions.cubicInterpolationMode),\n };\n\n line.pivot();\n }\n\n // Update Points\n for (i = 0, ilen = points.length; i < ilen; ++i) {\n me.updateElement(points[i], i, reset);\n }\n\n if (showLine && line._model.tension !== 0) {\n me.updateBezierControlPoints();\n }\n\n // Now pivot the point for animation\n for (i = 0, ilen = points.length; i < ilen; ++i) {\n points[i].pivot();\n }\n },\n\n getPointBackgroundColor: function(point, index) {\n var backgroundColor = this.chart.options.elements.point.backgroundColor;\n var dataset = this.getDataset();\n var custom = point.custom || {};\n\n if (custom.backgroundColor) {\n backgroundColor = custom.backgroundColor;\n } else if (dataset.pointBackgroundColor) {\n backgroundColor = helpers.valueAtIndexOrDefault(dataset.pointBackgroundColor, index, backgroundColor);\n } else if (dataset.backgroundColor) {\n backgroundColor = dataset.backgroundColor;\n }\n\n return backgroundColor;\n },\n\n getPointBorderColor: function(point, index) {\n var borderColor = this.chart.options.elements.point.borderColor;\n var dataset = this.getDataset();\n var custom = point.custom || {};\n\n if (custom.borderColor) {\n borderColor = custom.borderColor;\n } else if (dataset.pointBorderColor) {\n borderColor = helpers.valueAtIndexOrDefault(dataset.pointBorderColor, index, borderColor);\n } else if (dataset.borderColor) {\n borderColor = dataset.borderColor;\n }\n\n return borderColor;\n },\n\n getPointBorderWidth: function(point, index) {\n var borderWidth = this.chart.options.elements.point.borderWidth;\n var dataset = this.getDataset();\n var custom = point.custom || {};\n\n if (!isNaN(custom.borderWidth)) {\n borderWidth = custom.borderWidth;\n } else if (!isNaN(dataset.pointBorderWidth) || helpers.isArray(dataset.pointBorderWidth)) {\n borderWidth = helpers.valueAtIndexOrDefault(dataset.pointBorderWidth, index, borderWidth);\n } else if (!isNaN(dataset.borderWidth)) {\n borderWidth = dataset.borderWidth;\n }\n\n return borderWidth;\n },\n\n updateElement: function(point, index, reset) {\n var me = this;\n var meta = me.getMeta();\n var custom = point.custom || {};\n var dataset = me.getDataset();\n var datasetIndex = me.index;\n var value = dataset.data[index];\n var yScale = me.getScaleForId(meta.yAxisID);\n var xScale = me.getScaleForId(meta.xAxisID);\n var pointOptions = me.chart.options.elements.point;\n var x, y;\n\n // Compatibility: If the properties are defined with only the old name, use those values\n if ((dataset.radius !== undefined) && (dataset.pointRadius === undefined)) {\n dataset.pointRadius = dataset.radius;\n }\n if ((dataset.hitRadius !== undefined) && (dataset.pointHitRadius === undefined)) {\n dataset.pointHitRadius = dataset.hitRadius;\n }\n\n x = xScale.getPixelForValue(typeof value === 'object' ? value : NaN, index, datasetIndex);\n y = reset ? yScale.getBasePixel() : me.calculatePointY(value, index, datasetIndex);\n\n // Utility\n point._xScale = xScale;\n point._yScale = yScale;\n point._datasetIndex = datasetIndex;\n point._index = index;\n\n // Desired view properties\n point._model = {\n x: x,\n y: y,\n skip: custom.skip || isNaN(x) || isNaN(y),\n // Appearance\n radius: custom.radius || helpers.valueAtIndexOrDefault(dataset.pointRadius, index, pointOptions.radius),\n pointStyle: custom.pointStyle || helpers.valueAtIndexOrDefault(dataset.pointStyle, index, pointOptions.pointStyle),\n backgroundColor: me.getPointBackgroundColor(point, index),\n borderColor: me.getPointBorderColor(point, index),\n borderWidth: me.getPointBorderWidth(point, index),\n tension: meta.dataset._model ? meta.dataset._model.tension : 0,\n steppedLine: meta.dataset._model ? meta.dataset._model.steppedLine : false,\n // Tooltip\n hitRadius: custom.hitRadius || helpers.valueAtIndexOrDefault(dataset.pointHitRadius, index, pointOptions.hitRadius)\n };\n },\n\n calculatePointY: function(value, index, datasetIndex) {\n var me = this;\n var chart = me.chart;\n var meta = me.getMeta();\n var yScale = me.getScaleForId(meta.yAxisID);\n var sumPos = 0;\n var sumNeg = 0;\n var i, ds, dsMeta;\n\n if (yScale.options.stacked) {\n for (i = 0; i < datasetIndex; i++) {\n ds = chart.data.datasets[i];\n dsMeta = chart.getDatasetMeta(i);\n if (dsMeta.type === 'line' && dsMeta.yAxisID === yScale.id && chart.isDatasetVisible(i)) {\n var stackedRightValue = Number(yScale.getRightValue(ds.data[index]));\n if (stackedRightValue < 0) {\n sumNeg += stackedRightValue || 0;\n } else {\n sumPos += stackedRightValue || 0;\n }\n }\n }\n\n var rightValue = Number(yScale.getRightValue(value));\n if (rightValue < 0) {\n return yScale.getPixelForValue(sumNeg + rightValue);\n }\n return yScale.getPixelForValue(sumPos + rightValue);\n }\n\n return yScale.getPixelForValue(value);\n },\n\n updateBezierControlPoints: function() {\n var me = this;\n var meta = me.getMeta();\n var area = me.chart.chartArea;\n var points = (meta.data || []);\n var i, ilen, point, model, controlPoints;\n\n // Only consider points that are drawn in case the spanGaps option is used\n if (meta.dataset._model.spanGaps) {\n points = points.filter(function(pt) {\n return !pt._model.skip;\n });\n }\n\n function capControlPoint(pt, min, max) {\n return Math.max(Math.min(pt, max), min);\n }\n\n if (meta.dataset._model.cubicInterpolationMode === 'monotone') {\n helpers.splineCurveMonotone(points);\n } else {\n for (i = 0, ilen = points.length; i < ilen; ++i) {\n point = points[i];\n model = point._model;\n controlPoints = helpers.splineCurve(\n helpers.previousItem(points, i)._model,\n model,\n helpers.nextItem(points, i)._model,\n meta.dataset._model.tension\n );\n model.controlPointPreviousX = controlPoints.previous.x;\n model.controlPointPreviousY = controlPoints.previous.y;\n model.controlPointNextX = controlPoints.next.x;\n model.controlPointNextY = controlPoints.next.y;\n }\n }\n\n if (me.chart.options.elements.line.capBezierPoints) {\n for (i = 0, ilen = points.length; i < ilen; ++i) {\n model = points[i]._model;\n model.controlPointPreviousX = capControlPoint(model.controlPointPreviousX, area.left, area.right);\n model.controlPointPreviousY = capControlPoint(model.controlPointPreviousY, area.top, area.bottom);\n model.controlPointNextX = capControlPoint(model.controlPointNextX, area.left, area.right);\n model.controlPointNextY = capControlPoint(model.controlPointNextY, area.top, area.bottom);\n }\n }\n },\n\n draw: function() {\n var me = this;\n var chart = me.chart;\n var meta = me.getMeta();\n var points = meta.data || [];\n var area = chart.chartArea;\n var ilen = points.length;\n var i = 0;\n\n helpers.canvas.clipArea(chart.ctx, area);\n\n if (lineEnabled(me.getDataset(), chart.options)) {\n meta.dataset.draw();\n }\n\n helpers.canvas.unclipArea(chart.ctx);\n\n // Draw the points\n for (; i < ilen; ++i) {\n points[i].draw(area);\n }\n },\n\n setHoverStyle: function(point) {\n // Point\n var dataset = this.chart.data.datasets[point._datasetIndex];\n var index = point._index;\n var custom = point.custom || {};\n var model = point._model;\n\n model.radius = custom.hoverRadius || helpers.valueAtIndexOrDefault(dataset.pointHoverRadius, index, this.chart.options.elements.point.hoverRadius);\n model.backgroundColor = custom.hoverBackgroundColor || helpers.valueAtIndexOrDefault(dataset.pointHoverBackgroundColor, index, helpers.getHoverColor(model.backgroundColor));\n model.borderColor = custom.hoverBorderColor || helpers.valueAtIndexOrDefault(dataset.pointHoverBorderColor, index, helpers.getHoverColor(model.borderColor));\n model.borderWidth = custom.hoverBorderWidth || helpers.valueAtIndexOrDefault(dataset.pointHoverBorderWidth, index, model.borderWidth);\n },\n\n removeHoverStyle: function(point) {\n var me = this;\n var dataset = me.chart.data.datasets[point._datasetIndex];\n var index = point._index;\n var custom = point.custom || {};\n var model = point._model;\n\n // Compatibility: If the properties are defined with only the old name, use those values\n if ((dataset.radius !== undefined) && (dataset.pointRadius === undefined)) {\n dataset.pointRadius = dataset.radius;\n }\n\n model.radius = custom.radius || helpers.valueAtIndexOrDefault(dataset.pointRadius, index, me.chart.options.elements.point.radius);\n model.backgroundColor = me.getPointBackgroundColor(point, index);\n model.borderColor = me.getPointBorderColor(point, index);\n model.borderWidth = me.getPointBorderWidth(point, index);\n }\n });\n };\n\n},{\"25\":25,\"40\":40,\"45\":45}],19:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var elements = require(40);\n var helpers = require(45);\n\n defaults._set('polarArea', {\n scale: {\n type: 'radialLinear',\n angleLines: {\n display: false\n },\n gridLines: {\n circular: true\n },\n pointLabels: {\n display: false\n },\n ticks: {\n beginAtZero: true\n }\n },\n\n // Boolean - Whether to animate the rotation of the chart\n animation: {\n animateRotate: true,\n animateScale: true\n },\n\n startAngle: -0.5 * Math.PI,\n legendCallback: function(chart) {\n var text = [];\n text.push('
        ');\n\n var data = chart.data;\n var datasets = data.datasets;\n var labels = data.labels;\n\n if (datasets.length) {\n for (var i = 0; i < datasets[0].data.length; ++i) {\n text.push('
      • ');\n if (labels[i]) {\n text.push(labels[i]);\n }\n text.push('
      • ');\n }\n }\n\n text.push('
      ');\n return text.join('');\n },\n legend: {\n labels: {\n generateLabels: function(chart) {\n var data = chart.data;\n if (data.labels.length && data.datasets.length) {\n return data.labels.map(function(label, i) {\n var meta = chart.getDatasetMeta(0);\n var ds = data.datasets[0];\n var arc = meta.data[i];\n var custom = arc.custom || {};\n var valueAtIndexOrDefault = helpers.valueAtIndexOrDefault;\n var arcOpts = chart.options.elements.arc;\n var fill = custom.backgroundColor ? custom.backgroundColor : valueAtIndexOrDefault(ds.backgroundColor, i, arcOpts.backgroundColor);\n var stroke = custom.borderColor ? custom.borderColor : valueAtIndexOrDefault(ds.borderColor, i, arcOpts.borderColor);\n var bw = custom.borderWidth ? custom.borderWidth : valueAtIndexOrDefault(ds.borderWidth, i, arcOpts.borderWidth);\n\n return {\n text: label,\n fillStyle: fill,\n strokeStyle: stroke,\n lineWidth: bw,\n hidden: isNaN(ds.data[i]) || meta.data[i].hidden,\n\n // Extra data used for toggling the correct item\n index: i\n };\n });\n }\n return [];\n }\n },\n\n onClick: function(e, legendItem) {\n var index = legendItem.index;\n var chart = this.chart;\n var i, ilen, meta;\n\n for (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) {\n meta = chart.getDatasetMeta(i);\n meta.data[index].hidden = !meta.data[index].hidden;\n }\n\n chart.update();\n }\n },\n\n // Need to override these to give a nice default\n tooltips: {\n callbacks: {\n title: function() {\n return '';\n },\n label: function(item, data) {\n return data.labels[item.index] + ': ' + item.yLabel;\n }\n }\n }\n });\n\n module.exports = function(Chart) {\n\n Chart.controllers.polarArea = Chart.DatasetController.extend({\n\n dataElementType: elements.Arc,\n\n linkScales: helpers.noop,\n\n update: function(reset) {\n var me = this;\n var chart = me.chart;\n var chartArea = chart.chartArea;\n var meta = me.getMeta();\n var opts = chart.options;\n var arcOpts = opts.elements.arc;\n var minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);\n chart.outerRadius = Math.max((minSize - arcOpts.borderWidth / 2) / 2, 0);\n chart.innerRadius = Math.max(opts.cutoutPercentage ? (chart.outerRadius / 100) * (opts.cutoutPercentage) : 1, 0);\n chart.radiusLength = (chart.outerRadius - chart.innerRadius) / chart.getVisibleDatasetCount();\n\n me.outerRadius = chart.outerRadius - (chart.radiusLength * me.index);\n me.innerRadius = me.outerRadius - chart.radiusLength;\n\n meta.count = me.countVisibleElements();\n\n helpers.each(meta.data, function(arc, index) {\n me.updateElement(arc, index, reset);\n });\n },\n\n updateElement: function(arc, index, reset) {\n var me = this;\n var chart = me.chart;\n var dataset = me.getDataset();\n var opts = chart.options;\n var animationOpts = opts.animation;\n var scale = chart.scale;\n var labels = chart.data.labels;\n\n var circumference = me.calculateCircumference(dataset.data[index]);\n var centerX = scale.xCenter;\n var centerY = scale.yCenter;\n\n // If there is NaN data before us, we need to calculate the starting angle correctly.\n // We could be way more efficient here, but its unlikely that the polar area chart will have a lot of data\n var visibleCount = 0;\n var meta = me.getMeta();\n for (var i = 0; i < index; ++i) {\n if (!isNaN(dataset.data[i]) && !meta.data[i].hidden) {\n ++visibleCount;\n }\n }\n\n // var negHalfPI = -0.5 * Math.PI;\n var datasetStartAngle = opts.startAngle;\n var distance = arc.hidden ? 0 : scale.getDistanceFromCenterForValue(dataset.data[index]);\n var startAngle = datasetStartAngle + (circumference * visibleCount);\n var endAngle = startAngle + (arc.hidden ? 0 : circumference);\n\n var resetRadius = animationOpts.animateScale ? 0 : scale.getDistanceFromCenterForValue(dataset.data[index]);\n\n helpers.extend(arc, {\n // Utility\n _datasetIndex: me.index,\n _index: index,\n _scale: scale,\n\n // Desired view properties\n _model: {\n x: centerX,\n y: centerY,\n innerRadius: 0,\n outerRadius: reset ? resetRadius : distance,\n startAngle: reset && animationOpts.animateRotate ? datasetStartAngle : startAngle,\n endAngle: reset && animationOpts.animateRotate ? datasetStartAngle : endAngle,\n label: helpers.valueAtIndexOrDefault(labels, index, labels[index])\n }\n });\n\n // Apply border and fill style\n me.removeHoverStyle(arc);\n\n arc.pivot();\n },\n\n removeHoverStyle: function(arc) {\n Chart.DatasetController.prototype.removeHoverStyle.call(this, arc, this.chart.options.elements.arc);\n },\n\n countVisibleElements: function() {\n var dataset = this.getDataset();\n var meta = this.getMeta();\n var count = 0;\n\n helpers.each(meta.data, function(element, index) {\n if (!isNaN(dataset.data[index]) && !element.hidden) {\n count++;\n }\n });\n\n return count;\n },\n\n calculateCircumference: function(value) {\n var count = this.getMeta().count;\n if (count > 0 && !isNaN(value)) {\n return (2 * Math.PI) / count;\n }\n return 0;\n }\n });\n };\n\n},{\"25\":25,\"40\":40,\"45\":45}],20:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var elements = require(40);\n var helpers = require(45);\n\n defaults._set('radar', {\n scale: {\n type: 'radialLinear'\n },\n elements: {\n line: {\n tension: 0 // no bezier in radar\n }\n }\n });\n\n module.exports = function(Chart) {\n\n Chart.controllers.radar = Chart.DatasetController.extend({\n\n datasetElementType: elements.Line,\n\n dataElementType: elements.Point,\n\n linkScales: helpers.noop,\n\n update: function(reset) {\n var me = this;\n var meta = me.getMeta();\n var line = meta.dataset;\n var points = meta.data;\n var custom = line.custom || {};\n var dataset = me.getDataset();\n var lineElementOptions = me.chart.options.elements.line;\n var scale = me.chart.scale;\n\n // Compatibility: If the properties are defined with only the old name, use those values\n if ((dataset.tension !== undefined) && (dataset.lineTension === undefined)) {\n dataset.lineTension = dataset.tension;\n }\n\n helpers.extend(meta.dataset, {\n // Utility\n _datasetIndex: me.index,\n _scale: scale,\n // Data\n _children: points,\n _loop: true,\n // Model\n _model: {\n // Appearance\n tension: custom.tension ? custom.tension : helpers.valueOrDefault(dataset.lineTension, lineElementOptions.tension),\n backgroundColor: custom.backgroundColor ? custom.backgroundColor : (dataset.backgroundColor || lineElementOptions.backgroundColor),\n borderWidth: custom.borderWidth ? custom.borderWidth : (dataset.borderWidth || lineElementOptions.borderWidth),\n borderColor: custom.borderColor ? custom.borderColor : (dataset.borderColor || lineElementOptions.borderColor),\n fill: custom.fill ? custom.fill : (dataset.fill !== undefined ? dataset.fill : lineElementOptions.fill),\n borderCapStyle: custom.borderCapStyle ? custom.borderCapStyle : (dataset.borderCapStyle || lineElementOptions.borderCapStyle),\n borderDash: custom.borderDash ? custom.borderDash : (dataset.borderDash || lineElementOptions.borderDash),\n borderDashOffset: custom.borderDashOffset ? custom.borderDashOffset : (dataset.borderDashOffset || lineElementOptions.borderDashOffset),\n borderJoinStyle: custom.borderJoinStyle ? custom.borderJoinStyle : (dataset.borderJoinStyle || lineElementOptions.borderJoinStyle),\n }\n });\n\n meta.dataset.pivot();\n\n // Update Points\n helpers.each(points, function(point, index) {\n me.updateElement(point, index, reset);\n }, me);\n\n // Update bezier control points\n me.updateBezierControlPoints();\n },\n updateElement: function(point, index, reset) {\n var me = this;\n var custom = point.custom || {};\n var dataset = me.getDataset();\n var scale = me.chart.scale;\n var pointElementOptions = me.chart.options.elements.point;\n var pointPosition = scale.getPointPositionForValue(index, dataset.data[index]);\n\n // Compatibility: If the properties are defined with only the old name, use those values\n if ((dataset.radius !== undefined) && (dataset.pointRadius === undefined)) {\n dataset.pointRadius = dataset.radius;\n }\n if ((dataset.hitRadius !== undefined) && (dataset.pointHitRadius === undefined)) {\n dataset.pointHitRadius = dataset.hitRadius;\n }\n\n helpers.extend(point, {\n // Utility\n _datasetIndex: me.index,\n _index: index,\n _scale: scale,\n\n // Desired view properties\n _model: {\n x: reset ? scale.xCenter : pointPosition.x, // value not used in dataset scale, but we want a consistent API between scales\n y: reset ? scale.yCenter : pointPosition.y,\n\n // Appearance\n tension: custom.tension ? custom.tension : helpers.valueOrDefault(dataset.lineTension, me.chart.options.elements.line.tension),\n radius: custom.radius ? custom.radius : helpers.valueAtIndexOrDefault(dataset.pointRadius, index, pointElementOptions.radius),\n backgroundColor: custom.backgroundColor ? custom.backgroundColor : helpers.valueAtIndexOrDefault(dataset.pointBackgroundColor, index, pointElementOptions.backgroundColor),\n borderColor: custom.borderColor ? custom.borderColor : helpers.valueAtIndexOrDefault(dataset.pointBorderColor, index, pointElementOptions.borderColor),\n borderWidth: custom.borderWidth ? custom.borderWidth : helpers.valueAtIndexOrDefault(dataset.pointBorderWidth, index, pointElementOptions.borderWidth),\n pointStyle: custom.pointStyle ? custom.pointStyle : helpers.valueAtIndexOrDefault(dataset.pointStyle, index, pointElementOptions.pointStyle),\n\n // Tooltip\n hitRadius: custom.hitRadius ? custom.hitRadius : helpers.valueAtIndexOrDefault(dataset.pointHitRadius, index, pointElementOptions.hitRadius)\n }\n });\n\n point._model.skip = custom.skip ? custom.skip : (isNaN(point._model.x) || isNaN(point._model.y));\n },\n updateBezierControlPoints: function() {\n var chartArea = this.chart.chartArea;\n var meta = this.getMeta();\n\n helpers.each(meta.data, function(point, index) {\n var model = point._model;\n var controlPoints = helpers.splineCurve(\n helpers.previousItem(meta.data, index, true)._model,\n model,\n helpers.nextItem(meta.data, index, true)._model,\n model.tension\n );\n\n // Prevent the bezier going outside of the bounds of the graph\n model.controlPointPreviousX = Math.max(Math.min(controlPoints.previous.x, chartArea.right), chartArea.left);\n model.controlPointPreviousY = Math.max(Math.min(controlPoints.previous.y, chartArea.bottom), chartArea.top);\n\n model.controlPointNextX = Math.max(Math.min(controlPoints.next.x, chartArea.right), chartArea.left);\n model.controlPointNextY = Math.max(Math.min(controlPoints.next.y, chartArea.bottom), chartArea.top);\n\n // Now pivot the point for animation\n point.pivot();\n });\n },\n\n setHoverStyle: function(point) {\n // Point\n var dataset = this.chart.data.datasets[point._datasetIndex];\n var custom = point.custom || {};\n var index = point._index;\n var model = point._model;\n\n model.radius = custom.hoverRadius ? custom.hoverRadius : helpers.valueAtIndexOrDefault(dataset.pointHoverRadius, index, this.chart.options.elements.point.hoverRadius);\n model.backgroundColor = custom.hoverBackgroundColor ? custom.hoverBackgroundColor : helpers.valueAtIndexOrDefault(dataset.pointHoverBackgroundColor, index, helpers.getHoverColor(model.backgroundColor));\n model.borderColor = custom.hoverBorderColor ? custom.hoverBorderColor : helpers.valueAtIndexOrDefault(dataset.pointHoverBorderColor, index, helpers.getHoverColor(model.borderColor));\n model.borderWidth = custom.hoverBorderWidth ? custom.hoverBorderWidth : helpers.valueAtIndexOrDefault(dataset.pointHoverBorderWidth, index, model.borderWidth);\n },\n\n removeHoverStyle: function(point) {\n var dataset = this.chart.data.datasets[point._datasetIndex];\n var custom = point.custom || {};\n var index = point._index;\n var model = point._model;\n var pointElementOptions = this.chart.options.elements.point;\n\n model.radius = custom.radius ? custom.radius : helpers.valueAtIndexOrDefault(dataset.pointRadius, index, pointElementOptions.radius);\n model.backgroundColor = custom.backgroundColor ? custom.backgroundColor : helpers.valueAtIndexOrDefault(dataset.pointBackgroundColor, index, pointElementOptions.backgroundColor);\n model.borderColor = custom.borderColor ? custom.borderColor : helpers.valueAtIndexOrDefault(dataset.pointBorderColor, index, pointElementOptions.borderColor);\n model.borderWidth = custom.borderWidth ? custom.borderWidth : helpers.valueAtIndexOrDefault(dataset.pointBorderWidth, index, pointElementOptions.borderWidth);\n }\n });\n };\n\n},{\"25\":25,\"40\":40,\"45\":45}],21:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n\n defaults._set('scatter', {\n hover: {\n mode: 'single'\n },\n\n scales: {\n xAxes: [{\n id: 'x-axis-1', // need an ID so datasets can reference the scale\n type: 'linear', // scatter should not use a category axis\n position: 'bottom'\n }],\n yAxes: [{\n id: 'y-axis-1',\n type: 'linear',\n position: 'left'\n }]\n },\n\n showLines: false,\n\n tooltips: {\n callbacks: {\n title: function() {\n return ''; // doesn't make sense for scatter since data are formatted as a point\n },\n label: function(item) {\n return '(' + item.xLabel + ', ' + item.yLabel + ')';\n }\n }\n }\n });\n\n module.exports = function(Chart) {\n\n // Scatter charts use line controllers\n Chart.controllers.scatter = Chart.controllers.line;\n\n };\n\n},{\"25\":25}],22:[function(require,module,exports){\n\t/* global window: false */\n 'use strict';\n\n var defaults = require(25);\n var Element = require(26);\n var helpers = require(45);\n\n defaults._set('global', {\n animation: {\n duration: 1000,\n easing: 'easeOutQuart',\n onProgress: helpers.noop,\n onComplete: helpers.noop\n }\n });\n\n module.exports = function(Chart) {\n\n Chart.Animation = Element.extend({\n chart: null, // the animation associated chart instance\n currentStep: 0, // the current animation step\n numSteps: 60, // default number of steps\n easing: '', // the easing to use for this animation\n render: null, // render function used by the animation service\n\n onAnimationProgress: null, // user specified callback to fire on each step of the animation\n onAnimationComplete: null, // user specified callback to fire when the animation finishes\n });\n\n Chart.animationService = {\n frameDuration: 17,\n animations: [],\n dropFrames: 0,\n request: null,\n\n /**\n * @param {Chart} chart - The chart to animate.\n * @param {Chart.Animation} animation - The animation that we will animate.\n * @param {Number} duration - The animation duration in ms.\n * @param {Boolean} lazy - if true, the chart is not marked as animating to enable more responsive interactions\n */\n addAnimation: function(chart, animation, duration, lazy) {\n var animations = this.animations;\n var i, ilen;\n\n animation.chart = chart;\n\n if (!lazy) {\n chart.animating = true;\n }\n\n for (i = 0, ilen = animations.length; i < ilen; ++i) {\n if (animations[i].chart === chart) {\n animations[i] = animation;\n return;\n }\n }\n\n animations.push(animation);\n\n // If there are no animations queued, manually kickstart a digest, for lack of a better word\n if (animations.length === 1) {\n this.requestAnimationFrame();\n }\n },\n\n cancelAnimation: function(chart) {\n var index = helpers.findIndex(this.animations, function(animation) {\n return animation.chart === chart;\n });\n\n if (index !== -1) {\n this.animations.splice(index, 1);\n chart.animating = false;\n }\n },\n\n requestAnimationFrame: function() {\n var me = this;\n if (me.request === null) {\n // Skip animation frame requests until the active one is executed.\n // This can happen when processing mouse events, e.g. 'mousemove'\n // and 'mouseout' events will trigger multiple renders.\n me.request = helpers.requestAnimFrame.call(window, function() {\n me.request = null;\n me.startDigest();\n });\n }\n },\n\n /**\n * @private\n */\n startDigest: function() {\n var me = this;\n var startTime = Date.now();\n var framesToDrop = 0;\n\n if (me.dropFrames > 1) {\n framesToDrop = Math.floor(me.dropFrames);\n me.dropFrames = me.dropFrames % 1;\n }\n\n me.advance(1 + framesToDrop);\n\n var endTime = Date.now();\n\n me.dropFrames += (endTime - startTime) / me.frameDuration;\n\n // Do we have more stuff to animate?\n if (me.animations.length > 0) {\n me.requestAnimationFrame();\n }\n },\n\n /**\n * @private\n */\n advance: function(count) {\n var animations = this.animations;\n var animation, chart;\n var i = 0;\n\n while (i < animations.length) {\n animation = animations[i];\n chart = animation.chart;\n\n animation.currentStep = (animation.currentStep || 0) + count;\n animation.currentStep = Math.min(animation.currentStep, animation.numSteps);\n\n helpers.callback(animation.render, [chart, animation], chart);\n helpers.callback(animation.onAnimationProgress, [animation], chart);\n\n if (animation.currentStep >= animation.numSteps) {\n helpers.callback(animation.onAnimationComplete, [animation], chart);\n chart.animating = false;\n animations.splice(i, 1);\n } else {\n ++i;\n }\n }\n }\n };\n\n /**\n * Provided for backward compatibility, use Chart.Animation instead\n * @prop Chart.Animation#animationObject\n * @deprecated since version 2.6.0\n * @todo remove at version 3\n */\n Object.defineProperty(Chart.Animation.prototype, 'animationObject', {\n get: function() {\n return this;\n }\n });\n\n /**\n * Provided for backward compatibility, use Chart.Animation#chart instead\n * @prop Chart.Animation#chartInstance\n * @deprecated since version 2.6.0\n * @todo remove at version 3\n */\n Object.defineProperty(Chart.Animation.prototype, 'chartInstance', {\n get: function() {\n return this.chart;\n },\n set: function(value) {\n this.chart = value;\n }\n });\n\n };\n\n},{\"25\":25,\"26\":26,\"45\":45}],23:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var helpers = require(45);\n var Interaction = require(28);\n var platform = require(48);\n\n module.exports = function(Chart) {\n var plugins = Chart.plugins;\n\n // Create a dictionary of chart types, to allow for extension of existing types\n Chart.types = {};\n\n // Store a reference to each instance - allowing us to globally resize chart instances on window resize.\n // Destroy method on the chart will remove the instance of the chart from this reference.\n Chart.instances = {};\n\n // Controllers available for dataset visualization eg. bar, line, slice, etc.\n Chart.controllers = {};\n\n /**\n * Initializes the given config with global and chart default values.\n */\n function initConfig(config) {\n config = config || {};\n\n // Do NOT use configMerge() for the data object because this method merges arrays\n // and so would change references to labels and datasets, preventing data updates.\n var data = config.data = config.data || {};\n data.datasets = data.datasets || [];\n data.labels = data.labels || [];\n\n config.options = helpers.configMerge(\n defaults.global,\n defaults[config.type],\n config.options || {});\n\n return config;\n }\n\n /**\n * Updates the config of the chart\n * @param chart {Chart} chart to update the options for\n */\n function updateConfig(chart) {\n var newOptions = chart.options;\n\n // Update Scale(s) with options\n if (newOptions.scale) {\n chart.scale.options = newOptions.scale;\n } else if (newOptions.scales) {\n newOptions.scales.xAxes.concat(newOptions.scales.yAxes).forEach(function(scaleOptions) {\n chart.scales[scaleOptions.id].options = scaleOptions;\n });\n }\n\n // Tooltip\n chart.tooltip._options = newOptions.tooltips;\n }\n\n function positionIsHorizontal(position) {\n return position === 'top' || position === 'bottom';\n }\n\n helpers.extend(Chart.prototype, /** @lends Chart */ {\n /**\n * @private\n */\n construct: function(item, config) {\n var me = this;\n\n config = initConfig(config);\n\n var context = platform.acquireContext(item, config);\n var canvas = context && context.canvas;\n var height = canvas && canvas.height;\n var width = canvas && canvas.width;\n\n me.id = helpers.uid();\n me.ctx = context;\n me.canvas = canvas;\n me.config = config;\n me.width = width;\n me.height = height;\n me.aspectRatio = height ? width / height : null;\n me.options = config.options;\n me._bufferedRender = false;\n\n /**\n * Provided for backward compatibility, Chart and Chart.Controller have been merged,\n * the \"instance\" still need to be defined since it might be called from plugins.\n * @prop Chart#chart\n * @deprecated since version 2.6.0\n * @todo remove at version 3\n * @private\n */\n me.chart = me;\n me.controller = me; // chart.chart.controller #inception\n\n // Add the chart instance to the global namespace\n Chart.instances[me.id] = me;\n\n // Define alias to the config data: `chart.data === chart.config.data`\n Object.defineProperty(me, 'data', {\n get: function() {\n return me.config.data;\n },\n set: function(value) {\n me.config.data = value;\n }\n });\n\n if (!context || !canvas) {\n // The given item is not a compatible context2d element, let's return before finalizing\n // the chart initialization but after setting basic chart / controller properties that\n // can help to figure out that the chart is not valid (e.g chart.canvas !== null);\n // https://github.com/chartjs/Chart.js/issues/2807\n console.error(\"Failed to create chart: can't acquire context from the given item\");\n return;\n }\n\n me.initialize();\n me.update();\n },\n\n /**\n * @private\n */\n initialize: function() {\n var me = this;\n\n // Before init plugin notification\n plugins.notify(me, 'beforeInit');\n\n helpers.retinaScale(me, me.options.devicePixelRatio);\n\n me.bindEvents();\n\n if (me.options.responsive) {\n // Initial resize before chart draws (must be silent to preserve initial animations).\n me.resize(true);\n }\n\n // Make sure scales have IDs and are built before we build any controllers.\n me.ensureScalesHaveIDs();\n me.buildScales();\n me.initToolTip();\n\n // After init plugin notification\n plugins.notify(me, 'afterInit');\n\n return me;\n },\n\n clear: function() {\n helpers.canvas.clear(this);\n return this;\n },\n\n stop: function() {\n // Stops any current animation loop occurring\n Chart.animationService.cancelAnimation(this);\n return this;\n },\n\n resize: function(silent) {\n var me = this;\n var options = me.options;\n var canvas = me.canvas;\n var aspectRatio = (options.maintainAspectRatio && me.aspectRatio) || null;\n\n // the canvas render width and height will be casted to integers so make sure that\n // the canvas display style uses the same integer values to avoid blurring effect.\n\n // Set to 0 instead of canvas.size because the size defaults to 300x150 if the element is collased\n var newWidth = Math.max(0, Math.floor(helpers.getMaximumWidth(canvas)));\n var newHeight = Math.max(0, Math.floor(aspectRatio ? newWidth / aspectRatio : helpers.getMaximumHeight(canvas)));\n\n if (me.width === newWidth && me.height === newHeight) {\n return;\n }\n\n canvas.width = me.width = newWidth;\n canvas.height = me.height = newHeight;\n canvas.style.width = newWidth + 'px';\n canvas.style.height = newHeight + 'px';\n\n helpers.retinaScale(me, options.devicePixelRatio);\n\n if (!silent) {\n // Notify any plugins about the resize\n var newSize = {width: newWidth, height: newHeight};\n plugins.notify(me, 'resize', [newSize]);\n\n // Notify of resize\n if (me.options.onResize) {\n me.options.onResize(me, newSize);\n }\n\n me.stop();\n me.update(me.options.responsiveAnimationDuration);\n }\n },\n\n ensureScalesHaveIDs: function() {\n var options = this.options;\n var scalesOptions = options.scales || {};\n var scaleOptions = options.scale;\n\n helpers.each(scalesOptions.xAxes, function(xAxisOptions, index) {\n xAxisOptions.id = xAxisOptions.id || ('x-axis-' + index);\n });\n\n helpers.each(scalesOptions.yAxes, function(yAxisOptions, index) {\n yAxisOptions.id = yAxisOptions.id || ('y-axis-' + index);\n });\n\n if (scaleOptions) {\n scaleOptions.id = scaleOptions.id || 'scale';\n }\n },\n\n /**\n * Builds a map of scale ID to scale object for future lookup.\n */\n buildScales: function() {\n var me = this;\n var options = me.options;\n var scales = me.scales = {};\n var items = [];\n\n if (options.scales) {\n items = items.concat(\n (options.scales.xAxes || []).map(function(xAxisOptions) {\n return {options: xAxisOptions, dtype: 'category', dposition: 'bottom'};\n }),\n (options.scales.yAxes || []).map(function(yAxisOptions) {\n return {options: yAxisOptions, dtype: 'linear', dposition: 'left'};\n })\n );\n }\n\n if (options.scale) {\n items.push({\n options: options.scale,\n dtype: 'radialLinear',\n isDefault: true,\n dposition: 'chartArea'\n });\n }\n\n helpers.each(items, function(item) {\n var scaleOptions = item.options;\n var scaleType = helpers.valueOrDefault(scaleOptions.type, item.dtype);\n var scaleClass = Chart.scaleService.getScaleConstructor(scaleType);\n if (!scaleClass) {\n return;\n }\n\n if (positionIsHorizontal(scaleOptions.position) !== positionIsHorizontal(item.dposition)) {\n scaleOptions.position = item.dposition;\n }\n\n var scale = new scaleClass({\n id: scaleOptions.id,\n options: scaleOptions,\n ctx: me.ctx,\n chart: me\n });\n\n scales[scale.id] = scale;\n scale.mergeTicksOptions();\n\n // TODO(SB): I think we should be able to remove this custom case (options.scale)\n // and consider it as a regular scale part of the \"scales\"\" map only! This would\n // make the logic easier and remove some useless? custom code.\n if (item.isDefault) {\n me.scale = scale;\n }\n });\n\n Chart.scaleService.addScalesToLayout(this);\n },\n\n buildOrUpdateControllers: function() {\n var me = this;\n var types = [];\n var newControllers = [];\n\n helpers.each(me.data.datasets, function(dataset, datasetIndex) {\n var meta = me.getDatasetMeta(datasetIndex);\n var type = dataset.type || me.config.type;\n\n if (meta.type && meta.type !== type) {\n me.destroyDatasetMeta(datasetIndex);\n meta = me.getDatasetMeta(datasetIndex);\n }\n meta.type = type;\n\n types.push(meta.type);\n\n if (meta.controller) {\n meta.controller.updateIndex(datasetIndex);\n } else {\n var ControllerClass = Chart.controllers[meta.type];\n if (ControllerClass === undefined) {\n throw new Error('\"' + meta.type + '\" is not a chart type.');\n }\n\n meta.controller = new ControllerClass(me, datasetIndex);\n newControllers.push(meta.controller);\n }\n }, me);\n\n return newControllers;\n },\n\n /**\n * Reset the elements of all datasets\n * @private\n */\n resetElements: function() {\n var me = this;\n helpers.each(me.data.datasets, function(dataset, datasetIndex) {\n me.getDatasetMeta(datasetIndex).controller.reset();\n }, me);\n },\n\n /**\n * Resets the chart back to it's state before the initial animation\n */\n reset: function() {\n this.resetElements();\n this.tooltip.initialize();\n },\n\n update: function(config) {\n var me = this;\n\n if (!config || typeof config !== 'object') {\n // backwards compatibility\n config = {\n duration: config,\n lazy: arguments[1]\n };\n }\n\n updateConfig(me);\n\n if (plugins.notify(me, 'beforeUpdate') === false) {\n return;\n }\n\n // In case the entire data object changed\n me.tooltip._data = me.data;\n\n // Make sure dataset controllers are updated and new controllers are reset\n var newControllers = me.buildOrUpdateControllers();\n\n // Make sure all dataset controllers have correct meta data counts\n helpers.each(me.data.datasets, function(dataset, datasetIndex) {\n me.getDatasetMeta(datasetIndex).controller.buildOrUpdateElements();\n }, me);\n\n me.updateLayout();\n\n // Can only reset the new controllers after the scales have been updated\n helpers.each(newControllers, function(controller) {\n controller.reset();\n });\n\n me.updateDatasets();\n\n // Do this before render so that any plugins that need final scale updates can use it\n plugins.notify(me, 'afterUpdate');\n\n if (me._bufferedRender) {\n me._bufferedRequest = {\n duration: config.duration,\n easing: config.easing,\n lazy: config.lazy\n };\n } else {\n me.render(config);\n }\n },\n\n /**\n * Updates the chart layout unless a plugin returns `false` to the `beforeLayout`\n * hook, in which case, plugins will not be called on `afterLayout`.\n * @private\n */\n updateLayout: function() {\n var me = this;\n\n if (plugins.notify(me, 'beforeLayout') === false) {\n return;\n }\n\n Chart.layoutService.update(this, this.width, this.height);\n\n /**\n * Provided for backward compatibility, use `afterLayout` instead.\n * @method IPlugin#afterScaleUpdate\n * @deprecated since version 2.5.0\n * @todo remove at version 3\n * @private\n */\n plugins.notify(me, 'afterScaleUpdate');\n plugins.notify(me, 'afterLayout');\n },\n\n /**\n * Updates all datasets unless a plugin returns `false` to the `beforeDatasetsUpdate`\n * hook, in which case, plugins will not be called on `afterDatasetsUpdate`.\n * @private\n */\n updateDatasets: function() {\n var me = this;\n\n if (plugins.notify(me, 'beforeDatasetsUpdate') === false) {\n return;\n }\n\n for (var i = 0, ilen = me.data.datasets.length; i < ilen; ++i) {\n me.updateDataset(i);\n }\n\n plugins.notify(me, 'afterDatasetsUpdate');\n },\n\n /**\n * Updates dataset at index unless a plugin returns `false` to the `beforeDatasetUpdate`\n * hook, in which case, plugins will not be called on `afterDatasetUpdate`.\n * @private\n */\n updateDataset: function(index) {\n var me = this;\n var meta = me.getDatasetMeta(index);\n var args = {\n meta: meta,\n index: index\n };\n\n if (plugins.notify(me, 'beforeDatasetUpdate', [args]) === false) {\n return;\n }\n\n meta.controller.update();\n\n plugins.notify(me, 'afterDatasetUpdate', [args]);\n },\n\n render: function(config) {\n var me = this;\n\n if (!config || typeof config !== 'object') {\n // backwards compatibility\n config = {\n duration: config,\n lazy: arguments[1]\n };\n }\n\n var duration = config.duration;\n var lazy = config.lazy;\n\n if (plugins.notify(me, 'beforeRender') === false) {\n return;\n }\n\n var animationOptions = me.options.animation;\n var onComplete = function(animation) {\n plugins.notify(me, 'afterRender');\n helpers.callback(animationOptions && animationOptions.onComplete, [animation], me);\n };\n\n if (animationOptions && ((typeof duration !== 'undefined' && duration !== 0) || (typeof duration === 'undefined' && animationOptions.duration !== 0))) {\n var animation = new Chart.Animation({\n numSteps: (duration || animationOptions.duration) / 16.66, // 60 fps\n easing: config.easing || animationOptions.easing,\n\n render: function(chart, animationObject) {\n var easingFunction = helpers.easing.effects[animationObject.easing];\n var currentStep = animationObject.currentStep;\n var stepDecimal = currentStep / animationObject.numSteps;\n\n chart.draw(easingFunction(stepDecimal), stepDecimal, currentStep);\n },\n\n onAnimationProgress: animationOptions.onProgress,\n onAnimationComplete: onComplete\n });\n\n Chart.animationService.addAnimation(me, animation, duration, lazy);\n } else {\n me.draw();\n\n // See https://github.com/chartjs/Chart.js/issues/3781\n onComplete(new Chart.Animation({numSteps: 0, chart: me}));\n }\n\n return me;\n },\n\n draw: function(easingValue) {\n var me = this;\n\n me.clear();\n\n if (helpers.isNullOrUndef(easingValue)) {\n easingValue = 1;\n }\n\n me.transition(easingValue);\n\n if (plugins.notify(me, 'beforeDraw', [easingValue]) === false) {\n return;\n }\n\n // Draw all the scales\n helpers.each(me.boxes, function(box) {\n box.draw(me.chartArea);\n }, me);\n\n if (me.scale) {\n me.scale.draw();\n }\n\n me.drawDatasets(easingValue);\n\n // Finally draw the tooltip\n me.tooltip.draw();\n\n plugins.notify(me, 'afterDraw', [easingValue]);\n },\n\n /**\n * @private\n */\n transition: function(easingValue) {\n var me = this;\n\n for (var i = 0, ilen = (me.data.datasets || []).length; i < ilen; ++i) {\n if (me.isDatasetVisible(i)) {\n me.getDatasetMeta(i).controller.transition(easingValue);\n }\n }\n\n me.tooltip.transition(easingValue);\n },\n\n /**\n * Draws all datasets unless a plugin returns `false` to the `beforeDatasetsDraw`\n * hook, in which case, plugins will not be called on `afterDatasetsDraw`.\n * @private\n */\n drawDatasets: function(easingValue) {\n var me = this;\n\n if (plugins.notify(me, 'beforeDatasetsDraw', [easingValue]) === false) {\n return;\n }\n\n // Draw datasets reversed to support proper line stacking\n for (var i = (me.data.datasets || []).length - 1; i >= 0; --i) {\n if (me.isDatasetVisible(i)) {\n me.drawDataset(i, easingValue);\n }\n }\n\n plugins.notify(me, 'afterDatasetsDraw', [easingValue]);\n },\n\n /**\n * Draws dataset at index unless a plugin returns `false` to the `beforeDatasetDraw`\n * hook, in which case, plugins will not be called on `afterDatasetDraw`.\n * @private\n */\n drawDataset: function(index, easingValue) {\n var me = this;\n var meta = me.getDatasetMeta(index);\n var args = {\n meta: meta,\n index: index,\n easingValue: easingValue\n };\n\n if (plugins.notify(me, 'beforeDatasetDraw', [args]) === false) {\n return;\n }\n\n meta.controller.draw(easingValue);\n\n plugins.notify(me, 'afterDatasetDraw', [args]);\n },\n\n // Get the single element that was clicked on\n // @return : An object containing the dataset index and element index of the matching element. Also contains the rectangle that was draw\n getElementAtEvent: function(e) {\n return Interaction.modes.single(this, e);\n },\n\n getElementsAtEvent: function(e) {\n return Interaction.modes.label(this, e, {intersect: true});\n },\n\n getElementsAtXAxis: function(e) {\n return Interaction.modes['x-axis'](this, e, {intersect: true});\n },\n\n getElementsAtEventForMode: function(e, mode, options) {\n var method = Interaction.modes[mode];\n if (typeof method === 'function') {\n return method(this, e, options);\n }\n\n return [];\n },\n\n getDatasetAtEvent: function(e) {\n return Interaction.modes.dataset(this, e, {intersect: true});\n },\n\n getDatasetMeta: function(datasetIndex) {\n var me = this;\n var dataset = me.data.datasets[datasetIndex];\n if (!dataset._meta) {\n dataset._meta = {};\n }\n\n var meta = dataset._meta[me.id];\n if (!meta) {\n meta = dataset._meta[me.id] = {\n type: null,\n data: [],\n dataset: null,\n controller: null,\n hidden: null,\t\t\t// See isDatasetVisible() comment\n xAxisID: null,\n yAxisID: null\n };\n }\n\n return meta;\n },\n\n getVisibleDatasetCount: function() {\n var count = 0;\n for (var i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n if (this.isDatasetVisible(i)) {\n count++;\n }\n }\n return count;\n },\n\n isDatasetVisible: function(datasetIndex) {\n var meta = this.getDatasetMeta(datasetIndex);\n\n // meta.hidden is a per chart dataset hidden flag override with 3 states: if true or false,\n // the dataset.hidden value is ignored, else if null, the dataset hidden state is returned.\n return typeof meta.hidden === 'boolean' ? !meta.hidden : !this.data.datasets[datasetIndex].hidden;\n },\n\n generateLegend: function() {\n return this.options.legendCallback(this);\n },\n\n /**\n * @private\n */\n destroyDatasetMeta: function(datasetIndex) {\n var id = this.id;\n var dataset = this.data.datasets[datasetIndex];\n var meta = dataset._meta && dataset._meta[id];\n\n if (meta) {\n meta.controller.destroy();\n delete dataset._meta[id];\n }\n },\n\n destroy: function() {\n var me = this;\n var canvas = me.canvas;\n var i, ilen;\n\n me.stop();\n\n // dataset controllers need to cleanup associated data\n for (i = 0, ilen = me.data.datasets.length; i < ilen; ++i) {\n me.destroyDatasetMeta(i);\n }\n\n if (canvas) {\n me.unbindEvents();\n helpers.canvas.clear(me);\n platform.releaseContext(me.ctx);\n me.canvas = null;\n me.ctx = null;\n }\n\n plugins.notify(me, 'destroy');\n\n delete Chart.instances[me.id];\n },\n\n toBase64Image: function() {\n return this.canvas.toDataURL.apply(this.canvas, arguments);\n },\n\n initToolTip: function() {\n var me = this;\n me.tooltip = new Chart.Tooltip({\n _chart: me,\n _chartInstance: me, // deprecated, backward compatibility\n _data: me.data,\n _options: me.options.tooltips\n }, me);\n },\n\n /**\n * @private\n */\n bindEvents: function() {\n var me = this;\n var listeners = me._listeners = {};\n var listener = function() {\n me.eventHandler.apply(me, arguments);\n };\n\n helpers.each(me.options.events, function(type) {\n platform.addEventListener(me, type, listener);\n listeners[type] = listener;\n });\n\n // Elements used to detect size change should not be injected for non responsive charts.\n // See https://github.com/chartjs/Chart.js/issues/2210\n if (me.options.responsive) {\n listener = function() {\n me.resize();\n };\n\n platform.addEventListener(me, 'resize', listener);\n listeners.resize = listener;\n }\n },\n\n /**\n * @private\n */\n unbindEvents: function() {\n var me = this;\n var listeners = me._listeners;\n if (!listeners) {\n return;\n }\n\n delete me._listeners;\n helpers.each(listeners, function(listener, type) {\n platform.removeEventListener(me, type, listener);\n });\n },\n\n updateHoverStyle: function(elements, mode, enabled) {\n var method = enabled ? 'setHoverStyle' : 'removeHoverStyle';\n var element, i, ilen;\n\n for (i = 0, ilen = elements.length; i < ilen; ++i) {\n element = elements[i];\n if (element) {\n this.getDatasetMeta(element._datasetIndex).controller[method](element);\n }\n }\n },\n\n /**\n * @private\n */\n eventHandler: function(e) {\n var me = this;\n var tooltip = me.tooltip;\n\n if (plugins.notify(me, 'beforeEvent', [e]) === false) {\n return;\n }\n\n // Buffer any update calls so that renders do not occur\n me._bufferedRender = true;\n me._bufferedRequest = null;\n\n var changed = me.handleEvent(e);\n changed |= tooltip && tooltip.handleEvent(e);\n\n plugins.notify(me, 'afterEvent', [e]);\n\n var bufferedRequest = me._bufferedRequest;\n if (bufferedRequest) {\n // If we have an update that was triggered, we need to do a normal render\n me.render(bufferedRequest);\n } else if (changed && !me.animating) {\n // If entering, leaving, or changing elements, animate the change via pivot\n me.stop();\n\n // We only need to render at this point. Updating will cause scales to be\n // recomputed generating flicker & using more memory than necessary.\n me.render(me.options.hover.animationDuration, true);\n }\n\n me._bufferedRender = false;\n me._bufferedRequest = null;\n\n return me;\n },\n\n /**\n * Handle an event\n * @private\n * @param {IEvent} event the event to handle\n * @return {Boolean} true if the chart needs to re-render\n */\n handleEvent: function(e) {\n var me = this;\n var options = me.options || {};\n var hoverOptions = options.hover;\n var changed = false;\n\n me.lastActive = me.lastActive || [];\n\n // Find Active Elements for hover and tooltips\n if (e.type === 'mouseout') {\n me.active = [];\n } else {\n me.active = me.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions);\n }\n\n // Invoke onHover hook\n // Need to call with native event here to not break backwards compatibility\n helpers.callback(options.onHover || options.hover.onHover, [e.native, me.active], me);\n\n if (e.type === 'mouseup' || e.type === 'click') {\n if (options.onClick) {\n // Use e.native here for backwards compatibility\n options.onClick.call(me, e.native, me.active);\n }\n }\n\n // Remove styling for last active (even if it may still be active)\n if (me.lastActive.length) {\n me.updateHoverStyle(me.lastActive, hoverOptions.mode, false);\n }\n\n // Built in hover styling\n if (me.active.length && hoverOptions.mode) {\n me.updateHoverStyle(me.active, hoverOptions.mode, true);\n }\n\n changed = !helpers.arrayEquals(me.active, me.lastActive);\n\n // Remember Last Actives\n me.lastActive = me.active;\n\n return changed;\n }\n });\n\n /**\n * Provided for backward compatibility, use Chart instead.\n * @class Chart.Controller\n * @deprecated since version 2.6.0\n * @todo remove at version 3\n * @private\n */\n Chart.Controller = Chart;\n };\n\n},{\"25\":25,\"28\":28,\"45\":45,\"48\":48}],24:[function(require,module,exports){\n 'use strict';\n\n var helpers = require(45);\n\n module.exports = function(Chart) {\n\n var arrayEvents = ['push', 'pop', 'shift', 'splice', 'unshift'];\n\n /**\n * Hooks the array methods that add or remove values ('push', pop', 'shift', 'splice',\n * 'unshift') and notify the listener AFTER the array has been altered. Listeners are\n * called on the 'onData*' callbacks (e.g. onDataPush, etc.) with same arguments.\n */\n function listenArrayEvents(array, listener) {\n if (array._chartjs) {\n array._chartjs.listeners.push(listener);\n return;\n }\n\n Object.defineProperty(array, '_chartjs', {\n configurable: true,\n enumerable: false,\n value: {\n listeners: [listener]\n }\n });\n\n arrayEvents.forEach(function(key) {\n var method = 'onData' + key.charAt(0).toUpperCase() + key.slice(1);\n var base = array[key];\n\n Object.defineProperty(array, key, {\n configurable: true,\n enumerable: false,\n value: function() {\n var args = Array.prototype.slice.call(arguments);\n var res = base.apply(this, args);\n\n helpers.each(array._chartjs.listeners, function(object) {\n if (typeof object[method] === 'function') {\n object[method].apply(object, args);\n }\n });\n\n return res;\n }\n });\n });\n }\n\n /**\n * Removes the given array event listener and cleanup extra attached properties (such as\n * the _chartjs stub and overridden methods) if array doesn't have any more listeners.\n */\n function unlistenArrayEvents(array, listener) {\n var stub = array._chartjs;\n if (!stub) {\n return;\n }\n\n var listeners = stub.listeners;\n var index = listeners.indexOf(listener);\n if (index !== -1) {\n listeners.splice(index, 1);\n }\n\n if (listeners.length > 0) {\n return;\n }\n\n arrayEvents.forEach(function(key) {\n delete array[key];\n });\n\n delete array._chartjs;\n }\n\n // Base class for all dataset controllers (line, bar, etc)\n Chart.DatasetController = function(chart, datasetIndex) {\n this.initialize(chart, datasetIndex);\n };\n\n helpers.extend(Chart.DatasetController.prototype, {\n\n /**\n * Element type used to generate a meta dataset (e.g. Chart.element.Line).\n * @type {Chart.core.element}\n */\n datasetElementType: null,\n\n /**\n * Element type used to generate a meta data (e.g. Chart.element.Point).\n * @type {Chart.core.element}\n */\n dataElementType: null,\n\n initialize: function(chart, datasetIndex) {\n var me = this;\n me.chart = chart;\n me.index = datasetIndex;\n me.linkScales();\n me.addElements();\n },\n\n updateIndex: function(datasetIndex) {\n this.index = datasetIndex;\n },\n\n linkScales: function() {\n var me = this;\n var meta = me.getMeta();\n var dataset = me.getDataset();\n\n if (meta.xAxisID === null) {\n meta.xAxisID = dataset.xAxisID || me.chart.options.scales.xAxes[0].id;\n }\n if (meta.yAxisID === null) {\n meta.yAxisID = dataset.yAxisID || me.chart.options.scales.yAxes[0].id;\n }\n },\n\n getDataset: function() {\n return this.chart.data.datasets[this.index];\n },\n\n getMeta: function() {\n return this.chart.getDatasetMeta(this.index);\n },\n\n getScaleForId: function(scaleID) {\n return this.chart.scales[scaleID];\n },\n\n reset: function() {\n this.update(true);\n },\n\n /**\n * @private\n */\n destroy: function() {\n if (this._data) {\n unlistenArrayEvents(this._data, this);\n }\n },\n\n createMetaDataset: function() {\n var me = this;\n var type = me.datasetElementType;\n return type && new type({\n _chart: me.chart,\n _datasetIndex: me.index\n });\n },\n\n createMetaData: function(index) {\n var me = this;\n var type = me.dataElementType;\n return type && new type({\n _chart: me.chart,\n _datasetIndex: me.index,\n _index: index\n });\n },\n\n addElements: function() {\n var me = this;\n var meta = me.getMeta();\n var data = me.getDataset().data || [];\n var metaData = meta.data;\n var i, ilen;\n\n for (i = 0, ilen = data.length; i < ilen; ++i) {\n metaData[i] = metaData[i] || me.createMetaData(i);\n }\n\n meta.dataset = meta.dataset || me.createMetaDataset();\n },\n\n addElementAndReset: function(index) {\n var element = this.createMetaData(index);\n this.getMeta().data.splice(index, 0, element);\n this.updateElement(element, index, true);\n },\n\n buildOrUpdateElements: function() {\n var me = this;\n var dataset = me.getDataset();\n var data = dataset.data || (dataset.data = []);\n\n // In order to correctly handle data addition/deletion animation (an thus simulate\n // real-time charts), we need to monitor these data modifications and synchronize\n // the internal meta data accordingly.\n if (me._data !== data) {\n if (me._data) {\n // This case happens when the user replaced the data array instance.\n unlistenArrayEvents(me._data, me);\n }\n\n listenArrayEvents(data, me);\n me._data = data;\n }\n\n // Re-sync meta data in case the user replaced the data array or if we missed\n // any updates and so make sure that we handle number of datapoints changing.\n me.resyncElements();\n },\n\n update: helpers.noop,\n\n transition: function(easingValue) {\n var meta = this.getMeta();\n var elements = meta.data || [];\n var ilen = elements.length;\n var i = 0;\n\n for (; i < ilen; ++i) {\n elements[i].transition(easingValue);\n }\n\n if (meta.dataset) {\n meta.dataset.transition(easingValue);\n }\n },\n\n draw: function() {\n var meta = this.getMeta();\n var elements = meta.data || [];\n var ilen = elements.length;\n var i = 0;\n\n if (meta.dataset) {\n meta.dataset.draw();\n }\n\n for (; i < ilen; ++i) {\n elements[i].draw();\n }\n },\n\n removeHoverStyle: function(element, elementOpts) {\n var dataset = this.chart.data.datasets[element._datasetIndex];\n var index = element._index;\n var custom = element.custom || {};\n var valueOrDefault = helpers.valueAtIndexOrDefault;\n var model = element._model;\n\n model.backgroundColor = custom.backgroundColor ? custom.backgroundColor : valueOrDefault(dataset.backgroundColor, index, elementOpts.backgroundColor);\n model.borderColor = custom.borderColor ? custom.borderColor : valueOrDefault(dataset.borderColor, index, elementOpts.borderColor);\n model.borderWidth = custom.borderWidth ? custom.borderWidth : valueOrDefault(dataset.borderWidth, index, elementOpts.borderWidth);\n },\n\n setHoverStyle: function(element) {\n var dataset = this.chart.data.datasets[element._datasetIndex];\n var index = element._index;\n var custom = element.custom || {};\n var valueOrDefault = helpers.valueAtIndexOrDefault;\n var getHoverColor = helpers.getHoverColor;\n var model = element._model;\n\n model.backgroundColor = custom.hoverBackgroundColor ? custom.hoverBackgroundColor : valueOrDefault(dataset.hoverBackgroundColor, index, getHoverColor(model.backgroundColor));\n model.borderColor = custom.hoverBorderColor ? custom.hoverBorderColor : valueOrDefault(dataset.hoverBorderColor, index, getHoverColor(model.borderColor));\n model.borderWidth = custom.hoverBorderWidth ? custom.hoverBorderWidth : valueOrDefault(dataset.hoverBorderWidth, index, model.borderWidth);\n },\n\n /**\n * @private\n */\n resyncElements: function() {\n var me = this;\n var meta = me.getMeta();\n var data = me.getDataset().data;\n var numMeta = meta.data.length;\n var numData = data.length;\n\n if (numData < numMeta) {\n meta.data.splice(numData, numMeta - numData);\n } else if (numData > numMeta) {\n me.insertElements(numMeta, numData - numMeta);\n }\n },\n\n /**\n * @private\n */\n insertElements: function(start, count) {\n for (var i = 0; i < count; ++i) {\n this.addElementAndReset(start + i);\n }\n },\n\n /**\n * @private\n */\n onDataPush: function() {\n this.insertElements(this.getDataset().data.length - 1, arguments.length);\n },\n\n /**\n * @private\n */\n onDataPop: function() {\n this.getMeta().data.pop();\n },\n\n /**\n * @private\n */\n onDataShift: function() {\n this.getMeta().data.shift();\n },\n\n /**\n * @private\n */\n onDataSplice: function(start, count) {\n this.getMeta().data.splice(start, count);\n this.insertElements(start, arguments.length - 2);\n },\n\n /**\n * @private\n */\n onDataUnshift: function() {\n this.insertElements(0, arguments.length);\n }\n });\n\n Chart.DatasetController.extend = helpers.inherits;\n };\n\n},{\"45\":45}],25:[function(require,module,exports){\n 'use strict';\n\n var helpers = require(45);\n\n module.exports = {\n /**\n * @private\n */\n _set: function(scope, values) {\n return helpers.merge(this[scope] || (this[scope] = {}), values);\n }\n };\n\n},{\"45\":45}],26:[function(require,module,exports){\n 'use strict';\n\n var color = require(2);\n var helpers = require(45);\n\n function interpolate(start, view, model, ease) {\n var keys = Object.keys(model);\n var i, ilen, key, actual, origin, target, type, c0, c1;\n\n for (i = 0, ilen = keys.length; i < ilen; ++i) {\n key = keys[i];\n\n target = model[key];\n\n // if a value is added to the model after pivot() has been called, the view\n // doesn't contain it, so let's initialize the view to the target value.\n if (!view.hasOwnProperty(key)) {\n view[key] = target;\n }\n\n actual = view[key];\n\n if (actual === target || key[0] === '_') {\n continue;\n }\n\n if (!start.hasOwnProperty(key)) {\n start[key] = actual;\n }\n\n origin = start[key];\n\n type = typeof target;\n\n if (type === typeof origin) {\n if (type === 'string') {\n c0 = color(origin);\n if (c0.valid) {\n c1 = color(target);\n if (c1.valid) {\n view[key] = c1.mix(c0, ease).rgbString();\n continue;\n }\n }\n } else if (type === 'number' && isFinite(origin) && isFinite(target)) {\n view[key] = origin + (target - origin) * ease;\n continue;\n }\n }\n\n view[key] = target;\n }\n }\n\n var Element = function(configuration) {\n helpers.extend(this, configuration);\n this.initialize.apply(this, arguments);\n };\n\n helpers.extend(Element.prototype, {\n\n initialize: function() {\n this.hidden = false;\n },\n\n pivot: function() {\n var me = this;\n if (!me._view) {\n me._view = helpers.clone(me._model);\n }\n me._start = {};\n return me;\n },\n\n transition: function(ease) {\n var me = this;\n var model = me._model;\n var start = me._start;\n var view = me._view;\n\n // No animation -> No Transition\n if (!model || ease === 1) {\n me._view = model;\n me._start = null;\n return me;\n }\n\n if (!view) {\n view = me._view = {};\n }\n\n if (!start) {\n start = me._start = {};\n }\n\n interpolate(start, view, model, ease);\n\n return me;\n },\n\n tooltipPosition: function() {\n return {\n x: this._model.x,\n y: this._model.y\n };\n },\n\n hasValue: function() {\n return helpers.isNumber(this._model.x) && helpers.isNumber(this._model.y);\n }\n });\n\n Element.extend = helpers.inherits;\n\n module.exports = Element;\n\n},{\"2\":2,\"45\":45}],27:[function(require,module,exports){\n\t/* global window: false */\n\t/* global document: false */\n 'use strict';\n\n var color = require(2);\n var defaults = require(25);\n var helpers = require(45);\n\n module.exports = function(Chart) {\n\n // -- Basic js utility methods\n\n helpers.extend = function(base) {\n var setFn = function(value, key) {\n base[key] = value;\n };\n for (var i = 1, ilen = arguments.length; i < ilen; i++) {\n helpers.each(arguments[i], setFn);\n }\n return base;\n };\n\n helpers.configMerge = function(/* objects ... */) {\n return helpers.merge(helpers.clone(arguments[0]), [].slice.call(arguments, 1), {\n merger: function(key, target, source, options) {\n var tval = target[key] || {};\n var sval = source[key];\n\n if (key === 'scales') {\n // scale config merging is complex. Add our own function here for that\n target[key] = helpers.scaleMerge(tval, sval);\n } else if (key === 'scale') {\n // used in polar area & radar charts since there is only one scale\n target[key] = helpers.merge(tval, [Chart.scaleService.getScaleDefaults(sval.type), sval]);\n } else {\n helpers._merger(key, target, source, options);\n }\n }\n });\n };\n\n helpers.scaleMerge = function(/* objects ... */) {\n return helpers.merge(helpers.clone(arguments[0]), [].slice.call(arguments, 1), {\n merger: function(key, target, source, options) {\n if (key === 'xAxes' || key === 'yAxes') {\n var slen = source[key].length;\n var i, type, scale;\n\n if (!target[key]) {\n target[key] = [];\n }\n\n for (i = 0; i < slen; ++i) {\n scale = source[key][i];\n type = helpers.valueOrDefault(scale.type, key === 'xAxes' ? 'category' : 'linear');\n\n if (i >= target[key].length) {\n target[key].push({});\n }\n\n if (!target[key][i].type || (scale.type && scale.type !== target[key][i].type)) {\n // new/untyped scale or type changed: let's apply the new defaults\n // then merge source scale to correctly overwrite the defaults.\n helpers.merge(target[key][i], [Chart.scaleService.getScaleDefaults(type), scale]);\n } else {\n // scales type are the same\n helpers.merge(target[key][i], scale);\n }\n }\n } else {\n helpers._merger(key, target, source, options);\n }\n }\n });\n };\n\n helpers.where = function(collection, filterCallback) {\n if (helpers.isArray(collection) && Array.prototype.filter) {\n return collection.filter(filterCallback);\n }\n var filtered = [];\n\n helpers.each(collection, function(item) {\n if (filterCallback(item)) {\n filtered.push(item);\n }\n });\n\n return filtered;\n };\n helpers.findIndex = Array.prototype.findIndex ?\n function(array, callback, scope) {\n return array.findIndex(callback, scope);\n } :\n function(array, callback, scope) {\n scope = scope === undefined ? array : scope;\n for (var i = 0, ilen = array.length; i < ilen; ++i) {\n if (callback.call(scope, array[i], i, array)) {\n return i;\n }\n }\n return -1;\n };\n helpers.findNextWhere = function(arrayToSearch, filterCallback, startIndex) {\n // Default to start of the array\n if (helpers.isNullOrUndef(startIndex)) {\n startIndex = -1;\n }\n for (var i = startIndex + 1; i < arrayToSearch.length; i++) {\n var currentItem = arrayToSearch[i];\n if (filterCallback(currentItem)) {\n return currentItem;\n }\n }\n };\n helpers.findPreviousWhere = function(arrayToSearch, filterCallback, startIndex) {\n // Default to end of the array\n if (helpers.isNullOrUndef(startIndex)) {\n startIndex = arrayToSearch.length;\n }\n for (var i = startIndex - 1; i >= 0; i--) {\n var currentItem = arrayToSearch[i];\n if (filterCallback(currentItem)) {\n return currentItem;\n }\n }\n };\n helpers.inherits = function(extensions) {\n // Basic javascript inheritance based on the model created in Backbone.js\n var me = this;\n var ChartElement = (extensions && extensions.hasOwnProperty('constructor')) ? extensions.constructor : function() {\n return me.apply(this, arguments);\n };\n\n var Surrogate = function() {\n this.constructor = ChartElement;\n };\n Surrogate.prototype = me.prototype;\n ChartElement.prototype = new Surrogate();\n\n ChartElement.extend = helpers.inherits;\n\n if (extensions) {\n helpers.extend(ChartElement.prototype, extensions);\n }\n\n ChartElement.__super__ = me.prototype;\n\n return ChartElement;\n };\n // -- Math methods\n helpers.isNumber = function(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n };\n helpers.almostEquals = function(x, y, epsilon) {\n return Math.abs(x - y) < epsilon;\n };\n helpers.almostWhole = function(x, epsilon) {\n var rounded = Math.round(x);\n return (((rounded - epsilon) < x) && ((rounded + epsilon) > x));\n };\n helpers.max = function(array) {\n return array.reduce(function(max, value) {\n if (!isNaN(value)) {\n return Math.max(max, value);\n }\n return max;\n }, Number.NEGATIVE_INFINITY);\n };\n helpers.min = function(array) {\n return array.reduce(function(min, value) {\n if (!isNaN(value)) {\n return Math.min(min, value);\n }\n return min;\n }, Number.POSITIVE_INFINITY);\n };\n helpers.sign = Math.sign ?\n function(x) {\n return Math.sign(x);\n } :\n function(x) {\n x = +x; // convert to a number\n if (x === 0 || isNaN(x)) {\n return x;\n }\n return x > 0 ? 1 : -1;\n };\n helpers.log10 = Math.log10 ?\n function(x) {\n return Math.log10(x);\n } :\n function(x) {\n return Math.log(x) / Math.LN10;\n };\n helpers.toRadians = function(degrees) {\n return degrees * (Math.PI / 180);\n };\n helpers.toDegrees = function(radians) {\n return radians * (180 / Math.PI);\n };\n // Gets the angle from vertical upright to the point about a centre.\n helpers.getAngleFromPoint = function(centrePoint, anglePoint) {\n var distanceFromXCenter = anglePoint.x - centrePoint.x;\n var distanceFromYCenter = anglePoint.y - centrePoint.y;\n var radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);\n\n var angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);\n\n if (angle < (-0.5 * Math.PI)) {\n angle += 2.0 * Math.PI; // make sure the returned angle is in the range of (-PI/2, 3PI/2]\n }\n\n return {\n angle: angle,\n distance: radialDistanceFromCenter\n };\n };\n helpers.distanceBetweenPoints = function(pt1, pt2) {\n return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));\n };\n helpers.aliasPixel = function(pixelWidth) {\n return (pixelWidth % 2 === 0) ? 0 : 0.5;\n };\n helpers.splineCurve = function(firstPoint, middlePoint, afterPoint, t) {\n // Props to Rob Spencer at scaled innovation for his post on splining between points\n // http://scaledinnovation.com/analytics/splines/aboutSplines.html\n\n // This function must also respect \"skipped\" points\n\n var previous = firstPoint.skip ? middlePoint : firstPoint;\n var current = middlePoint;\n var next = afterPoint.skip ? middlePoint : afterPoint;\n\n var d01 = Math.sqrt(Math.pow(current.x - previous.x, 2) + Math.pow(current.y - previous.y, 2));\n var d12 = Math.sqrt(Math.pow(next.x - current.x, 2) + Math.pow(next.y - current.y, 2));\n\n var s01 = d01 / (d01 + d12);\n var s12 = d12 / (d01 + d12);\n\n // If all points are the same, s01 & s02 will be inf\n s01 = isNaN(s01) ? 0 : s01;\n s12 = isNaN(s12) ? 0 : s12;\n\n var fa = t * s01; // scaling factor for triangle Ta\n var fb = t * s12;\n\n return {\n previous: {\n x: current.x - fa * (next.x - previous.x),\n y: current.y - fa * (next.y - previous.y)\n },\n next: {\n x: current.x + fb * (next.x - previous.x),\n y: current.y + fb * (next.y - previous.y)\n }\n };\n };\n helpers.EPSILON = Number.EPSILON || 1e-14;\n helpers.splineCurveMonotone = function(points) {\n // This function calculates Bézier control points in a similar way than |splineCurve|,\n // but preserves monotonicity of the provided data and ensures no local extremums are added\n // between the dataset discrete points due to the interpolation.\n // See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation\n\n var pointsWithTangents = (points || []).map(function(point) {\n return {\n model: point._model,\n deltaK: 0,\n mK: 0\n };\n });\n\n // Calculate slopes (deltaK) and initialize tangents (mK)\n var pointsLen = pointsWithTangents.length;\n var i, pointBefore, pointCurrent, pointAfter;\n for (i = 0; i < pointsLen; ++i) {\n pointCurrent = pointsWithTangents[i];\n if (pointCurrent.model.skip) {\n continue;\n }\n\n pointBefore = i > 0 ? pointsWithTangents[i - 1] : null;\n pointAfter = i < pointsLen - 1 ? pointsWithTangents[i + 1] : null;\n if (pointAfter && !pointAfter.model.skip) {\n var slopeDeltaX = (pointAfter.model.x - pointCurrent.model.x);\n\n // In the case of two points that appear at the same x pixel, slopeDeltaX is 0\n pointCurrent.deltaK = slopeDeltaX !== 0 ? (pointAfter.model.y - pointCurrent.model.y) / slopeDeltaX : 0;\n }\n\n if (!pointBefore || pointBefore.model.skip) {\n pointCurrent.mK = pointCurrent.deltaK;\n } else if (!pointAfter || pointAfter.model.skip) {\n pointCurrent.mK = pointBefore.deltaK;\n } else if (this.sign(pointBefore.deltaK) !== this.sign(pointCurrent.deltaK)) {\n pointCurrent.mK = 0;\n } else {\n pointCurrent.mK = (pointBefore.deltaK + pointCurrent.deltaK) / 2;\n }\n }\n\n // Adjust tangents to ensure monotonic properties\n var alphaK, betaK, tauK, squaredMagnitude;\n for (i = 0; i < pointsLen - 1; ++i) {\n pointCurrent = pointsWithTangents[i];\n pointAfter = pointsWithTangents[i + 1];\n if (pointCurrent.model.skip || pointAfter.model.skip) {\n continue;\n }\n\n if (helpers.almostEquals(pointCurrent.deltaK, 0, this.EPSILON)) {\n pointCurrent.mK = pointAfter.mK = 0;\n continue;\n }\n\n alphaK = pointCurrent.mK / pointCurrent.deltaK;\n betaK = pointAfter.mK / pointCurrent.deltaK;\n squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);\n if (squaredMagnitude <= 9) {\n continue;\n }\n\n tauK = 3 / Math.sqrt(squaredMagnitude);\n pointCurrent.mK = alphaK * tauK * pointCurrent.deltaK;\n pointAfter.mK = betaK * tauK * pointCurrent.deltaK;\n }\n\n // Compute control points\n var deltaX;\n for (i = 0; i < pointsLen; ++i) {\n pointCurrent = pointsWithTangents[i];\n if (pointCurrent.model.skip) {\n continue;\n }\n\n pointBefore = i > 0 ? pointsWithTangents[i - 1] : null;\n pointAfter = i < pointsLen - 1 ? pointsWithTangents[i + 1] : null;\n if (pointBefore && !pointBefore.model.skip) {\n deltaX = (pointCurrent.model.x - pointBefore.model.x) / 3;\n pointCurrent.model.controlPointPreviousX = pointCurrent.model.x - deltaX;\n pointCurrent.model.controlPointPreviousY = pointCurrent.model.y - deltaX * pointCurrent.mK;\n }\n if (pointAfter && !pointAfter.model.skip) {\n deltaX = (pointAfter.model.x - pointCurrent.model.x) / 3;\n pointCurrent.model.controlPointNextX = pointCurrent.model.x + deltaX;\n pointCurrent.model.controlPointNextY = pointCurrent.model.y + deltaX * pointCurrent.mK;\n }\n }\n };\n helpers.nextItem = function(collection, index, loop) {\n if (loop) {\n return index >= collection.length - 1 ? collection[0] : collection[index + 1];\n }\n return index >= collection.length - 1 ? collection[collection.length - 1] : collection[index + 1];\n };\n helpers.previousItem = function(collection, index, loop) {\n if (loop) {\n return index <= 0 ? collection[collection.length - 1] : collection[index - 1];\n }\n return index <= 0 ? collection[0] : collection[index - 1];\n };\n // Implementation of the nice number algorithm used in determining where axis labels will go\n helpers.niceNum = function(range, round) {\n var exponent = Math.floor(helpers.log10(range));\n var fraction = range / Math.pow(10, exponent);\n var niceFraction;\n\n if (round) {\n if (fraction < 1.5) {\n niceFraction = 1;\n } else if (fraction < 3) {\n niceFraction = 2;\n } else if (fraction < 7) {\n niceFraction = 5;\n } else {\n niceFraction = 10;\n }\n } else if (fraction <= 1.0) {\n niceFraction = 1;\n } else if (fraction <= 2) {\n niceFraction = 2;\n } else if (fraction <= 5) {\n niceFraction = 5;\n } else {\n niceFraction = 10;\n }\n\n return niceFraction * Math.pow(10, exponent);\n };\n // Request animation polyfill - http://www.paulirish.com/2011/requestanimationframe-for-smart-animating/\n helpers.requestAnimFrame = (function() {\n if (typeof window === 'undefined') {\n return function(callback) {\n callback();\n };\n }\n return window.requestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.oRequestAnimationFrame ||\n window.msRequestAnimationFrame ||\n function(callback) {\n return window.setTimeout(callback, 1000 / 60);\n };\n }());\n // -- DOM methods\n helpers.getRelativePosition = function(evt, chart) {\n var mouseX, mouseY;\n var e = evt.originalEvent || evt;\n var canvas = evt.currentTarget || evt.srcElement;\n var boundingRect = canvas.getBoundingClientRect();\n\n var touches = e.touches;\n if (touches && touches.length > 0) {\n mouseX = touches[0].clientX;\n mouseY = touches[0].clientY;\n\n } else {\n mouseX = e.clientX;\n mouseY = e.clientY;\n }\n\n // Scale mouse coordinates into canvas coordinates\n // by following the pattern laid out by 'jerryj' in the comments of\n // http://www.html5canvastutorials.com/advanced/html5-canvas-mouse-coordinates/\n var paddingLeft = parseFloat(helpers.getStyle(canvas, 'padding-left'));\n var paddingTop = parseFloat(helpers.getStyle(canvas, 'padding-top'));\n var paddingRight = parseFloat(helpers.getStyle(canvas, 'padding-right'));\n var paddingBottom = parseFloat(helpers.getStyle(canvas, 'padding-bottom'));\n var width = boundingRect.right - boundingRect.left - paddingLeft - paddingRight;\n var height = boundingRect.bottom - boundingRect.top - paddingTop - paddingBottom;\n\n // We divide by the current device pixel ratio, because the canvas is scaled up by that amount in each direction. However\n // the backend model is in unscaled coordinates. Since we are going to deal with our model coordinates, we go back here\n mouseX = Math.round((mouseX - boundingRect.left - paddingLeft) / (width) * canvas.width / chart.currentDevicePixelRatio);\n mouseY = Math.round((mouseY - boundingRect.top - paddingTop) / (height) * canvas.height / chart.currentDevicePixelRatio);\n\n return {\n x: mouseX,\n y: mouseY\n };\n\n };\n\n // Private helper function to convert max-width/max-height values that may be percentages into a number\n function parseMaxStyle(styleValue, node, parentProperty) {\n var valueInPixels;\n if (typeof styleValue === 'string') {\n valueInPixels = parseInt(styleValue, 10);\n\n if (styleValue.indexOf('%') !== -1) {\n // percentage * size in dimension\n valueInPixels = valueInPixels / 100 * node.parentNode[parentProperty];\n }\n } else {\n valueInPixels = styleValue;\n }\n\n return valueInPixels;\n }\n\n /**\n * Returns if the given value contains an effective constraint.\n * @private\n */\n function isConstrainedValue(value) {\n return value !== undefined && value !== null && value !== 'none';\n }\n\n // Private helper to get a constraint dimension\n // @param domNode : the node to check the constraint on\n // @param maxStyle : the style that defines the maximum for the direction we are using (maxWidth / maxHeight)\n // @param percentageProperty : property of parent to use when calculating width as a percentage\n // @see http://www.nathanaeljones.com/blog/2013/reading-max-width-cross-browser\n function getConstraintDimension(domNode, maxStyle, percentageProperty) {\n var view = document.defaultView;\n var parentNode = domNode.parentNode;\n var constrainedNode = view.getComputedStyle(domNode)[maxStyle];\n var constrainedContainer = view.getComputedStyle(parentNode)[maxStyle];\n var hasCNode = isConstrainedValue(constrainedNode);\n var hasCContainer = isConstrainedValue(constrainedContainer);\n var infinity = Number.POSITIVE_INFINITY;\n\n if (hasCNode || hasCContainer) {\n return Math.min(\n hasCNode ? parseMaxStyle(constrainedNode, domNode, percentageProperty) : infinity,\n hasCContainer ? parseMaxStyle(constrainedContainer, parentNode, percentageProperty) : infinity);\n }\n\n return 'none';\n }\n // returns Number or undefined if no constraint\n helpers.getConstraintWidth = function(domNode) {\n return getConstraintDimension(domNode, 'max-width', 'clientWidth');\n };\n // returns Number or undefined if no constraint\n helpers.getConstraintHeight = function(domNode) {\n return getConstraintDimension(domNode, 'max-height', 'clientHeight');\n };\n helpers.getMaximumWidth = function(domNode) {\n var container = domNode.parentNode;\n if (!container) {\n return domNode.clientWidth;\n }\n\n var paddingLeft = parseInt(helpers.getStyle(container, 'padding-left'), 10);\n var paddingRight = parseInt(helpers.getStyle(container, 'padding-right'), 10);\n var w = container.clientWidth - paddingLeft - paddingRight;\n var cw = helpers.getConstraintWidth(domNode);\n return isNaN(cw) ? w : Math.min(w, cw);\n };\n helpers.getMaximumHeight = function(domNode) {\n var container = domNode.parentNode;\n if (!container) {\n return domNode.clientHeight;\n }\n\n var paddingTop = parseInt(helpers.getStyle(container, 'padding-top'), 10);\n var paddingBottom = parseInt(helpers.getStyle(container, 'padding-bottom'), 10);\n var h = container.clientHeight - paddingTop - paddingBottom;\n var ch = helpers.getConstraintHeight(domNode);\n return isNaN(ch) ? h : Math.min(h, ch);\n };\n helpers.getStyle = function(el, property) {\n return el.currentStyle ?\n el.currentStyle[property] :\n document.defaultView.getComputedStyle(el, null).getPropertyValue(property);\n };\n helpers.retinaScale = function(chart, forceRatio) {\n var pixelRatio = chart.currentDevicePixelRatio = forceRatio || window.devicePixelRatio || 1;\n if (pixelRatio === 1) {\n return;\n }\n\n var canvas = chart.canvas;\n var height = chart.height;\n var width = chart.width;\n\n canvas.height = height * pixelRatio;\n canvas.width = width * pixelRatio;\n chart.ctx.scale(pixelRatio, pixelRatio);\n\n // If no style has been set on the canvas, the render size is used as display size,\n // making the chart visually bigger, so let's enforce it to the \"correct\" values.\n // See https://github.com/chartjs/Chart.js/issues/3575\n canvas.style.height = height + 'px';\n canvas.style.width = width + 'px';\n };\n // -- Canvas methods\n helpers.fontString = function(pixelSize, fontStyle, fontFamily) {\n return fontStyle + ' ' + pixelSize + 'px ' + fontFamily;\n };\n helpers.longestText = function(ctx, font, arrayOfThings, cache) {\n cache = cache || {};\n var data = cache.data = cache.data || {};\n var gc = cache.garbageCollect = cache.garbageCollect || [];\n\n if (cache.font !== font) {\n data = cache.data = {};\n gc = cache.garbageCollect = [];\n cache.font = font;\n }\n\n ctx.font = font;\n var longest = 0;\n helpers.each(arrayOfThings, function(thing) {\n // Undefined strings and arrays should not be measured\n if (thing !== undefined && thing !== null && helpers.isArray(thing) !== true) {\n longest = helpers.measureText(ctx, data, gc, longest, thing);\n } else if (helpers.isArray(thing)) {\n // if it is an array lets measure each element\n // to do maybe simplify this function a bit so we can do this more recursively?\n helpers.each(thing, function(nestedThing) {\n // Undefined strings and arrays should not be measured\n if (nestedThing !== undefined && nestedThing !== null && !helpers.isArray(nestedThing)) {\n longest = helpers.measureText(ctx, data, gc, longest, nestedThing);\n }\n });\n }\n });\n\n var gcLen = gc.length / 2;\n if (gcLen > arrayOfThings.length) {\n for (var i = 0; i < gcLen; i++) {\n delete data[gc[i]];\n }\n gc.splice(0, gcLen);\n }\n return longest;\n };\n helpers.measureText = function(ctx, data, gc, longest, string) {\n var textWidth = data[string];\n if (!textWidth) {\n textWidth = data[string] = ctx.measureText(string).width;\n gc.push(string);\n }\n if (textWidth > longest) {\n longest = textWidth;\n }\n return longest;\n };\n helpers.numberOfLabelLines = function(arrayOfThings) {\n var numberOfLines = 1;\n helpers.each(arrayOfThings, function(thing) {\n if (helpers.isArray(thing)) {\n if (thing.length > numberOfLines) {\n numberOfLines = thing.length;\n }\n }\n });\n return numberOfLines;\n };\n\n helpers.color = !color ?\n function(value) {\n console.error('Color.js not found!');\n return value;\n } :\n function(value) {\n\t\t\t\t/* global CanvasGradient */\n if (value instanceof CanvasGradient) {\n value = defaults.global.defaultColor;\n }\n\n return color(value);\n };\n\n helpers.getHoverColor = function(colorValue) {\n\t\t\t/* global CanvasPattern */\n return (colorValue instanceof CanvasPattern) ?\n colorValue :\n helpers.color(colorValue).saturate(0.5).darken(0.1).rgbString();\n };\n };\n\n},{\"2\":2,\"25\":25,\"45\":45}],28:[function(require,module,exports){\n 'use strict';\n\n var helpers = require(45);\n\n /**\n * Helper function to get relative position for an event\n * @param {Event|IEvent} event - The event to get the position for\n * @param {Chart} chart - The chart\n * @returns {Point} the event position\n */\n function getRelativePosition(e, chart) {\n if (e.native) {\n return {\n x: e.x,\n y: e.y\n };\n }\n\n return helpers.getRelativePosition(e, chart);\n }\n\n /**\n * Helper function to traverse all of the visible elements in the chart\n * @param chart {chart} the chart\n * @param handler {Function} the callback to execute for each visible item\n */\n function parseVisibleItems(chart, handler) {\n var datasets = chart.data.datasets;\n var meta, i, j, ilen, jlen;\n\n for (i = 0, ilen = datasets.length; i < ilen; ++i) {\n if (!chart.isDatasetVisible(i)) {\n continue;\n }\n\n meta = chart.getDatasetMeta(i);\n for (j = 0, jlen = meta.data.length; j < jlen; ++j) {\n var element = meta.data[j];\n if (!element._view.skip) {\n handler(element);\n }\n }\n }\n }\n\n /**\n * Helper function to get the items that intersect the event position\n * @param items {ChartElement[]} elements to filter\n * @param position {Point} the point to be nearest to\n * @return {ChartElement[]} the nearest items\n */\n function getIntersectItems(chart, position) {\n var elements = [];\n\n parseVisibleItems(chart, function(element) {\n if (element.inRange(position.x, position.y)) {\n elements.push(element);\n }\n });\n\n return elements;\n }\n\n /**\n * Helper function to get the items nearest to the event position considering all visible items in teh chart\n * @param chart {Chart} the chart to look at elements from\n * @param position {Point} the point to be nearest to\n * @param intersect {Boolean} if true, only consider items that intersect the position\n * @param distanceMetric {Function} function to provide the distance between points\n * @return {ChartElement[]} the nearest items\n */\n function getNearestItems(chart, position, intersect, distanceMetric) {\n var minDistance = Number.POSITIVE_INFINITY;\n var nearestItems = [];\n\n parseVisibleItems(chart, function(element) {\n if (intersect && !element.inRange(position.x, position.y)) {\n return;\n }\n\n var center = element.getCenterPoint();\n var distance = distanceMetric(position, center);\n\n if (distance < minDistance) {\n nearestItems = [element];\n minDistance = distance;\n } else if (distance === minDistance) {\n // Can have multiple items at the same distance in which case we sort by size\n nearestItems.push(element);\n }\n });\n\n return nearestItems;\n }\n\n /**\n * Get a distance metric function for two points based on the\n * axis mode setting\n * @param {String} axis the axis mode. x|y|xy\n */\n function getDistanceMetricForAxis(axis) {\n var useX = axis.indexOf('x') !== -1;\n var useY = axis.indexOf('y') !== -1;\n\n return function(pt1, pt2) {\n var deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;\n var deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;\n return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));\n };\n }\n\n function indexMode(chart, e, options) {\n var position = getRelativePosition(e, chart);\n // Default axis for index mode is 'x' to match old behaviour\n options.axis = options.axis || 'x';\n var distanceMetric = getDistanceMetricForAxis(options.axis);\n var items = options.intersect ? getIntersectItems(chart, position) : getNearestItems(chart, position, false, distanceMetric);\n var elements = [];\n\n if (!items.length) {\n return [];\n }\n\n chart.data.datasets.forEach(function(dataset, datasetIndex) {\n if (chart.isDatasetVisible(datasetIndex)) {\n var meta = chart.getDatasetMeta(datasetIndex);\n var element = meta.data[items[0]._index];\n\n // don't count items that are skipped (null data)\n if (element && !element._view.skip) {\n elements.push(element);\n }\n }\n });\n\n return elements;\n }\n\n /**\n * @interface IInteractionOptions\n */\n /**\n * If true, only consider items that intersect the point\n * @name IInterfaceOptions#boolean\n * @type Boolean\n */\n\n /**\n * Contains interaction related functions\n * @namespace Chart.Interaction\n */\n module.exports = {\n // Helper function for different modes\n modes: {\n single: function(chart, e) {\n var position = getRelativePosition(e, chart);\n var elements = [];\n\n parseVisibleItems(chart, function(element) {\n if (element.inRange(position.x, position.y)) {\n elements.push(element);\n return elements;\n }\n });\n\n return elements.slice(0, 1);\n },\n\n /**\n * @function Chart.Interaction.modes.label\n * @deprecated since version 2.4.0\n * @todo remove at version 3\n * @private\n */\n label: indexMode,\n\n /**\n * Returns items at the same index. If the options.intersect parameter is true, we only return items if we intersect something\n * If the options.intersect mode is false, we find the nearest item and return the items at the same index as that item\n * @function Chart.Interaction.modes.index\n * @since v2.4.0\n * @param chart {chart} the chart we are returning items from\n * @param e {Event} the event we are find things at\n * @param options {IInteractionOptions} options to use during interaction\n * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\n */\n index: indexMode,\n\n /**\n * Returns items in the same dataset. If the options.intersect parameter is true, we only return items if we intersect something\n * If the options.intersect is false, we find the nearest item and return the items in that dataset\n * @function Chart.Interaction.modes.dataset\n * @param chart {chart} the chart we are returning items from\n * @param e {Event} the event we are find things at\n * @param options {IInteractionOptions} options to use during interaction\n * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\n */\n dataset: function(chart, e, options) {\n var position = getRelativePosition(e, chart);\n options.axis = options.axis || 'xy';\n var distanceMetric = getDistanceMetricForAxis(options.axis);\n var items = options.intersect ? getIntersectItems(chart, position) : getNearestItems(chart, position, false, distanceMetric);\n\n if (items.length > 0) {\n items = chart.getDatasetMeta(items[0]._datasetIndex).data;\n }\n\n return items;\n },\n\n /**\n * @function Chart.Interaction.modes.x-axis\n * @deprecated since version 2.4.0. Use index mode and intersect == true\n * @todo remove at version 3\n * @private\n */\n 'x-axis': function(chart, e) {\n return indexMode(chart, e, {intersect: true});\n },\n\n /**\n * Point mode returns all elements that hit test based on the event position\n * of the event\n * @function Chart.Interaction.modes.intersect\n * @param chart {chart} the chart we are returning items from\n * @param e {Event} the event we are find things at\n * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\n */\n point: function(chart, e) {\n var position = getRelativePosition(e, chart);\n return getIntersectItems(chart, position);\n },\n\n /**\n * nearest mode returns the element closest to the point\n * @function Chart.Interaction.modes.intersect\n * @param chart {chart} the chart we are returning items from\n * @param e {Event} the event we are find things at\n * @param options {IInteractionOptions} options to use\n * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\n */\n nearest: function(chart, e, options) {\n var position = getRelativePosition(e, chart);\n options.axis = options.axis || 'xy';\n var distanceMetric = getDistanceMetricForAxis(options.axis);\n var nearestItems = getNearestItems(chart, position, options.intersect, distanceMetric);\n\n // We have multiple items at the same distance from the event. Now sort by smallest\n if (nearestItems.length > 1) {\n nearestItems.sort(function(a, b) {\n var sizeA = a.getArea();\n var sizeB = b.getArea();\n var ret = sizeA - sizeB;\n\n if (ret === 0) {\n // if equal sort by dataset index\n ret = a._datasetIndex - b._datasetIndex;\n }\n\n return ret;\n });\n }\n\n // Return only 1 item\n return nearestItems.slice(0, 1);\n },\n\n /**\n * x mode returns the elements that hit-test at the current x coordinate\n * @function Chart.Interaction.modes.x\n * @param chart {chart} the chart we are returning items from\n * @param e {Event} the event we are find things at\n * @param options {IInteractionOptions} options to use\n * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\n */\n x: function(chart, e, options) {\n var position = getRelativePosition(e, chart);\n var items = [];\n var intersectsItem = false;\n\n parseVisibleItems(chart, function(element) {\n if (element.inXRange(position.x)) {\n items.push(element);\n }\n\n if (element.inRange(position.x, position.y)) {\n intersectsItem = true;\n }\n });\n\n // If we want to trigger on an intersect and we don't have any items\n // that intersect the position, return nothing\n if (options.intersect && !intersectsItem) {\n items = [];\n }\n return items;\n },\n\n /**\n * y mode returns the elements that hit-test at the current y coordinate\n * @function Chart.Interaction.modes.y\n * @param chart {chart} the chart we are returning items from\n * @param e {Event} the event we are find things at\n * @param options {IInteractionOptions} options to use\n * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned\n */\n y: function(chart, e, options) {\n var position = getRelativePosition(e, chart);\n var items = [];\n var intersectsItem = false;\n\n parseVisibleItems(chart, function(element) {\n if (element.inYRange(position.y)) {\n items.push(element);\n }\n\n if (element.inRange(position.x, position.y)) {\n intersectsItem = true;\n }\n });\n\n // If we want to trigger on an intersect and we don't have any items\n // that intersect the position, return nothing\n if (options.intersect && !intersectsItem) {\n items = [];\n }\n return items;\n }\n }\n };\n\n},{\"45\":45}],29:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n\n defaults._set('global', {\n responsive: true,\n responsiveAnimationDuration: 0,\n maintainAspectRatio: true,\n events: ['mousemove', 'mouseout', 'click', 'touchstart', 'touchmove'],\n hover: {\n onHover: null,\n mode: 'nearest',\n intersect: true,\n animationDuration: 400\n },\n onClick: null,\n defaultColor: 'rgba(0,0,0,0.1)',\n defaultFontColor: '#666',\n defaultFontFamily: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\n defaultFontSize: 12,\n defaultFontStyle: 'normal',\n showLines: true,\n\n // Element defaults defined in element extensions\n elements: {},\n\n // Layout options such as padding\n layout: {\n padding: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n }\n }\n });\n\n module.exports = function() {\n\n // Occupy the global variable of Chart, and create a simple base class\n var Chart = function(item, config) {\n this.construct(item, config);\n return this;\n };\n\n Chart.Chart = Chart;\n\n return Chart;\n };\n\n},{\"25\":25}],30:[function(require,module,exports){\n 'use strict';\n\n var helpers = require(45);\n\n module.exports = function(Chart) {\n\n function filterByPosition(array, position) {\n return helpers.where(array, function(v) {\n return v.position === position;\n });\n }\n\n function sortByWeight(array, reverse) {\n array.forEach(function(v, i) {\n v._tmpIndex_ = i;\n return v;\n });\n array.sort(function(a, b) {\n var v0 = reverse ? b : a;\n var v1 = reverse ? a : b;\n return v0.weight === v1.weight ?\n v0._tmpIndex_ - v1._tmpIndex_ :\n v0.weight - v1.weight;\n });\n array.forEach(function(v) {\n delete v._tmpIndex_;\n });\n }\n\n /**\n * @interface ILayoutItem\n * @prop {String} position - The position of the item in the chart layout. Possible values are\n * 'left', 'top', 'right', 'bottom', and 'chartArea'\n * @prop {Number} weight - The weight used to sort the item. Higher weights are further away from the chart area\n * @prop {Boolean} fullWidth - if true, and the item is horizontal, then push vertical boxes down\n * @prop {Function} isHorizontal - returns true if the layout item is horizontal (ie. top or bottom)\n * @prop {Function} update - Takes two parameters: width and height. Returns size of item\n * @prop {Function} getPadding - Returns an object with padding on the edges\n * @prop {Number} width - Width of item. Must be valid after update()\n * @prop {Number} height - Height of item. Must be valid after update()\n * @prop {Number} left - Left edge of the item. Set by layout system and cannot be used in update\n * @prop {Number} top - Top edge of the item. Set by layout system and cannot be used in update\n * @prop {Number} right - Right edge of the item. Set by layout system and cannot be used in update\n * @prop {Number} bottom - Bottom edge of the item. Set by layout system and cannot be used in update\n */\n\n // The layout service is very self explanatory. It's responsible for the layout within a chart.\n // Scales, Legends and Plugins all rely on the layout service and can easily register to be placed anywhere they need\n // It is this service's responsibility of carrying out that layout.\n Chart.layoutService = {\n defaults: {},\n\n /**\n * Register a box to a chart.\n * A box is simply a reference to an object that requires layout. eg. Scales, Legend, Title.\n * @param {Chart} chart - the chart to use\n * @param {ILayoutItem} item - the item to add to be layed out\n */\n addBox: function(chart, item) {\n if (!chart.boxes) {\n chart.boxes = [];\n }\n\n // initialize item with default values\n item.fullWidth = item.fullWidth || false;\n item.position = item.position || 'top';\n item.weight = item.weight || 0;\n\n chart.boxes.push(item);\n },\n\n /**\n * Remove a layoutItem from a chart\n * @param {Chart} chart - the chart to remove the box from\n * @param {Object} layoutItem - the item to remove from the layout\n */\n removeBox: function(chart, layoutItem) {\n var index = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;\n if (index !== -1) {\n chart.boxes.splice(index, 1);\n }\n },\n\n /**\n * Sets (or updates) options on the given `item`.\n * @param {Chart} chart - the chart in which the item lives (or will be added to)\n * @param {Object} item - the item to configure with the given options\n * @param {Object} options - the new item options.\n */\n configure: function(chart, item, options) {\n var props = ['fullWidth', 'position', 'weight'];\n var ilen = props.length;\n var i = 0;\n var prop;\n\n for (; i < ilen; ++i) {\n prop = props[i];\n if (options.hasOwnProperty(prop)) {\n item[prop] = options[prop];\n }\n }\n },\n\n /**\n * Fits boxes of the given chart into the given size by having each box measure itself\n * then running a fitting algorithm\n * @param {Chart} chart - the chart\n * @param {Number} width - the width to fit into\n * @param {Number} height - the height to fit into\n */\n update: function(chart, width, height) {\n if (!chart) {\n return;\n }\n\n var layoutOptions = chart.options.layout || {};\n var padding = helpers.options.toPadding(layoutOptions.padding);\n var leftPadding = padding.left;\n var rightPadding = padding.right;\n var topPadding = padding.top;\n var bottomPadding = padding.bottom;\n\n var leftBoxes = filterByPosition(chart.boxes, 'left');\n var rightBoxes = filterByPosition(chart.boxes, 'right');\n var topBoxes = filterByPosition(chart.boxes, 'top');\n var bottomBoxes = filterByPosition(chart.boxes, 'bottom');\n var chartAreaBoxes = filterByPosition(chart.boxes, 'chartArea');\n\n // Sort boxes by weight. A higher weight is further away from the chart area\n sortByWeight(leftBoxes, true);\n sortByWeight(rightBoxes, false);\n sortByWeight(topBoxes, true);\n sortByWeight(bottomBoxes, false);\n\n // Essentially we now have any number of boxes on each of the 4 sides.\n // Our canvas looks like the following.\n // The areas L1 and L2 are the left axes. R1 is the right axis, T1 is the top axis and\n // B1 is the bottom axis\n // There are also 4 quadrant-like locations (left to right instead of clockwise) reserved for chart overlays\n // These locations are single-box locations only, when trying to register a chartArea location that is already taken,\n // an error will be thrown.\n //\n // |----------------------------------------------------|\n // | T1 (Full Width) |\n // |----------------------------------------------------|\n // | | | T2 | |\n // | |----|-------------------------------------|----|\n // | | | C1 | | C2 | |\n // | | |----| |----| |\n // | | | | |\n // | L1 | L2 | ChartArea (C0) | R1 |\n // | | | | |\n // | | |----| |----| |\n // | | | C3 | | C4 | |\n // | |----|-------------------------------------|----|\n // | | | B1 | |\n // |----------------------------------------------------|\n // | B2 (Full Width) |\n // |----------------------------------------------------|\n //\n // What we do to find the best sizing, we do the following\n // 1. Determine the minimum size of the chart area.\n // 2. Split the remaining width equally between each vertical axis\n // 3. Split the remaining height equally between each horizontal axis\n // 4. Give each layout the maximum size it can be. The layout will return it's minimum size\n // 5. Adjust the sizes of each axis based on it's minimum reported size.\n // 6. Refit each axis\n // 7. Position each axis in the final location\n // 8. Tell the chart the final location of the chart area\n // 9. Tell any axes that overlay the chart area the positions of the chart area\n\n // Step 1\n var chartWidth = width - leftPadding - rightPadding;\n var chartHeight = height - topPadding - bottomPadding;\n var chartAreaWidth = chartWidth / 2; // min 50%\n var chartAreaHeight = chartHeight / 2; // min 50%\n\n // Step 2\n var verticalBoxWidth = (width - chartAreaWidth) / (leftBoxes.length + rightBoxes.length);\n\n // Step 3\n var horizontalBoxHeight = (height - chartAreaHeight) / (topBoxes.length + bottomBoxes.length);\n\n // Step 4\n var maxChartAreaWidth = chartWidth;\n var maxChartAreaHeight = chartHeight;\n var minBoxSizes = [];\n\n function getMinimumBoxSize(box) {\n var minSize;\n var isHorizontal = box.isHorizontal();\n\n if (isHorizontal) {\n minSize = box.update(box.fullWidth ? chartWidth : maxChartAreaWidth, horizontalBoxHeight);\n maxChartAreaHeight -= minSize.height;\n } else {\n minSize = box.update(verticalBoxWidth, chartAreaHeight);\n maxChartAreaWidth -= minSize.width;\n }\n\n minBoxSizes.push({\n horizontal: isHorizontal,\n minSize: minSize,\n box: box,\n });\n }\n\n helpers.each(leftBoxes.concat(rightBoxes, topBoxes, bottomBoxes), getMinimumBoxSize);\n\n // If a horizontal box has padding, we move the left boxes over to avoid ugly charts (see issue #2478)\n var maxHorizontalLeftPadding = 0;\n var maxHorizontalRightPadding = 0;\n var maxVerticalTopPadding = 0;\n var maxVerticalBottomPadding = 0;\n\n helpers.each(topBoxes.concat(bottomBoxes), function(horizontalBox) {\n if (horizontalBox.getPadding) {\n var boxPadding = horizontalBox.getPadding();\n maxHorizontalLeftPadding = Math.max(maxHorizontalLeftPadding, boxPadding.left);\n maxHorizontalRightPadding = Math.max(maxHorizontalRightPadding, boxPadding.right);\n }\n });\n\n helpers.each(leftBoxes.concat(rightBoxes), function(verticalBox) {\n if (verticalBox.getPadding) {\n var boxPadding = verticalBox.getPadding();\n maxVerticalTopPadding = Math.max(maxVerticalTopPadding, boxPadding.top);\n maxVerticalBottomPadding = Math.max(maxVerticalBottomPadding, boxPadding.bottom);\n }\n });\n\n // At this point, maxChartAreaHeight and maxChartAreaWidth are the size the chart area could\n // be if the axes are drawn at their minimum sizes.\n // Steps 5 & 6\n var totalLeftBoxesWidth = leftPadding;\n var totalRightBoxesWidth = rightPadding;\n var totalTopBoxesHeight = topPadding;\n var totalBottomBoxesHeight = bottomPadding;\n\n // Function to fit a box\n function fitBox(box) {\n var minBoxSize = helpers.findNextWhere(minBoxSizes, function(minBox) {\n return minBox.box === box;\n });\n\n if (minBoxSize) {\n if (box.isHorizontal()) {\n var scaleMargin = {\n left: Math.max(totalLeftBoxesWidth, maxHorizontalLeftPadding),\n right: Math.max(totalRightBoxesWidth, maxHorizontalRightPadding),\n top: 0,\n bottom: 0\n };\n\n // Don't use min size here because of label rotation. When the labels are rotated, their rotation highly depends\n // on the margin. Sometimes they need to increase in size slightly\n box.update(box.fullWidth ? chartWidth : maxChartAreaWidth, chartHeight / 2, scaleMargin);\n } else {\n box.update(minBoxSize.minSize.width, maxChartAreaHeight);\n }\n }\n }\n\n // Update, and calculate the left and right margins for the horizontal boxes\n helpers.each(leftBoxes.concat(rightBoxes), fitBox);\n\n helpers.each(leftBoxes, function(box) {\n totalLeftBoxesWidth += box.width;\n });\n\n helpers.each(rightBoxes, function(box) {\n totalRightBoxesWidth += box.width;\n });\n\n // Set the Left and Right margins for the horizontal boxes\n helpers.each(topBoxes.concat(bottomBoxes), fitBox);\n\n // Figure out how much margin is on the top and bottom of the vertical boxes\n helpers.each(topBoxes, function(box) {\n totalTopBoxesHeight += box.height;\n });\n\n helpers.each(bottomBoxes, function(box) {\n totalBottomBoxesHeight += box.height;\n });\n\n function finalFitVerticalBox(box) {\n var minBoxSize = helpers.findNextWhere(minBoxSizes, function(minSize) {\n return minSize.box === box;\n });\n\n var scaleMargin = {\n left: 0,\n right: 0,\n top: totalTopBoxesHeight,\n bottom: totalBottomBoxesHeight\n };\n\n if (minBoxSize) {\n box.update(minBoxSize.minSize.width, maxChartAreaHeight, scaleMargin);\n }\n }\n\n // Let the left layout know the final margin\n helpers.each(leftBoxes.concat(rightBoxes), finalFitVerticalBox);\n\n // Recalculate because the size of each layout might have changed slightly due to the margins (label rotation for instance)\n totalLeftBoxesWidth = leftPadding;\n totalRightBoxesWidth = rightPadding;\n totalTopBoxesHeight = topPadding;\n totalBottomBoxesHeight = bottomPadding;\n\n helpers.each(leftBoxes, function(box) {\n totalLeftBoxesWidth += box.width;\n });\n\n helpers.each(rightBoxes, function(box) {\n totalRightBoxesWidth += box.width;\n });\n\n helpers.each(topBoxes, function(box) {\n totalTopBoxesHeight += box.height;\n });\n helpers.each(bottomBoxes, function(box) {\n totalBottomBoxesHeight += box.height;\n });\n\n // We may be adding some padding to account for rotated x axis labels\n var leftPaddingAddition = Math.max(maxHorizontalLeftPadding - totalLeftBoxesWidth, 0);\n totalLeftBoxesWidth += leftPaddingAddition;\n totalRightBoxesWidth += Math.max(maxHorizontalRightPadding - totalRightBoxesWidth, 0);\n\n var topPaddingAddition = Math.max(maxVerticalTopPadding - totalTopBoxesHeight, 0);\n totalTopBoxesHeight += topPaddingAddition;\n totalBottomBoxesHeight += Math.max(maxVerticalBottomPadding - totalBottomBoxesHeight, 0);\n\n // Figure out if our chart area changed. This would occur if the dataset layout label rotation\n // changed due to the application of the margins in step 6. Since we can only get bigger, this is safe to do\n // without calling `fit` again\n var newMaxChartAreaHeight = height - totalTopBoxesHeight - totalBottomBoxesHeight;\n var newMaxChartAreaWidth = width - totalLeftBoxesWidth - totalRightBoxesWidth;\n\n if (newMaxChartAreaWidth !== maxChartAreaWidth || newMaxChartAreaHeight !== maxChartAreaHeight) {\n helpers.each(leftBoxes, function(box) {\n box.height = newMaxChartAreaHeight;\n });\n\n helpers.each(rightBoxes, function(box) {\n box.height = newMaxChartAreaHeight;\n });\n\n helpers.each(topBoxes, function(box) {\n if (!box.fullWidth) {\n box.width = newMaxChartAreaWidth;\n }\n });\n\n helpers.each(bottomBoxes, function(box) {\n if (!box.fullWidth) {\n box.width = newMaxChartAreaWidth;\n }\n });\n\n maxChartAreaHeight = newMaxChartAreaHeight;\n maxChartAreaWidth = newMaxChartAreaWidth;\n }\n\n // Step 7 - Position the boxes\n var left = leftPadding + leftPaddingAddition;\n var top = topPadding + topPaddingAddition;\n\n function placeBox(box) {\n if (box.isHorizontal()) {\n box.left = box.fullWidth ? leftPadding : totalLeftBoxesWidth;\n box.right = box.fullWidth ? width - rightPadding : totalLeftBoxesWidth + maxChartAreaWidth;\n box.top = top;\n box.bottom = top + box.height;\n\n // Move to next point\n top = box.bottom;\n\n } else {\n\n box.left = left;\n box.right = left + box.width;\n box.top = totalTopBoxesHeight;\n box.bottom = totalTopBoxesHeight + maxChartAreaHeight;\n\n // Move to next point\n left = box.right;\n }\n }\n\n helpers.each(leftBoxes.concat(topBoxes), placeBox);\n\n // Account for chart width and height\n left += maxChartAreaWidth;\n top += maxChartAreaHeight;\n\n helpers.each(rightBoxes, placeBox);\n helpers.each(bottomBoxes, placeBox);\n\n // Step 8\n chart.chartArea = {\n left: totalLeftBoxesWidth,\n top: totalTopBoxesHeight,\n right: totalLeftBoxesWidth + maxChartAreaWidth,\n bottom: totalTopBoxesHeight + maxChartAreaHeight\n };\n\n // Step 9\n helpers.each(chartAreaBoxes, function(box) {\n box.left = chart.chartArea.left;\n box.top = chart.chartArea.top;\n box.right = chart.chartArea.right;\n box.bottom = chart.chartArea.bottom;\n\n box.update(maxChartAreaWidth, maxChartAreaHeight);\n });\n }\n };\n };\n\n},{\"45\":45}],31:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var Element = require(26);\n var helpers = require(45);\n\n defaults._set('global', {\n plugins: {}\n });\n\n module.exports = function(Chart) {\n\n /**\n * The plugin service singleton\n * @namespace Chart.plugins\n * @since 2.1.0\n */\n Chart.plugins = {\n /**\n * Globally registered plugins.\n * @private\n */\n _plugins: [],\n\n /**\n * This identifier is used to invalidate the descriptors cache attached to each chart\n * when a global plugin is registered or unregistered. In this case, the cache ID is\n * incremented and descriptors are regenerated during following API calls.\n * @private\n */\n _cacheId: 0,\n\n /**\n * Registers the given plugin(s) if not already registered.\n * @param {Array|Object} plugins plugin instance(s).\n */\n register: function(plugins) {\n var p = this._plugins;\n ([]).concat(plugins).forEach(function(plugin) {\n if (p.indexOf(plugin) === -1) {\n p.push(plugin);\n }\n });\n\n this._cacheId++;\n },\n\n /**\n * Unregisters the given plugin(s) only if registered.\n * @param {Array|Object} plugins plugin instance(s).\n */\n unregister: function(plugins) {\n var p = this._plugins;\n ([]).concat(plugins).forEach(function(plugin) {\n var idx = p.indexOf(plugin);\n if (idx !== -1) {\n p.splice(idx, 1);\n }\n });\n\n this._cacheId++;\n },\n\n /**\n * Remove all registered plugins.\n * @since 2.1.5\n */\n clear: function() {\n this._plugins = [];\n this._cacheId++;\n },\n\n /**\n * Returns the number of registered plugins?\n * @returns {Number}\n * @since 2.1.5\n */\n count: function() {\n return this._plugins.length;\n },\n\n /**\n * Returns all registered plugin instances.\n * @returns {Array} array of plugin objects.\n * @since 2.1.5\n */\n getAll: function() {\n return this._plugins;\n },\n\n /**\n * Calls enabled plugins for `chart` on the specified hook and with the given args.\n * This method immediately returns as soon as a plugin explicitly returns false. The\n * returned value can be used, for instance, to interrupt the current action.\n * @param {Object} chart - The chart instance for which plugins should be called.\n * @param {String} hook - The name of the plugin method to call (e.g. 'beforeUpdate').\n * @param {Array} [args] - Extra arguments to apply to the hook call.\n * @returns {Boolean} false if any of the plugins return false, else returns true.\n */\n notify: function(chart, hook, args) {\n var descriptors = this.descriptors(chart);\n var ilen = descriptors.length;\n var i, descriptor, plugin, params, method;\n\n for (i = 0; i < ilen; ++i) {\n descriptor = descriptors[i];\n plugin = descriptor.plugin;\n method = plugin[hook];\n if (typeof method === 'function') {\n params = [chart].concat(args || []);\n params.push(descriptor.options);\n if (method.apply(plugin, params) === false) {\n return false;\n }\n }\n }\n\n return true;\n },\n\n /**\n * Returns descriptors of enabled plugins for the given chart.\n * @returns {Array} [{ plugin, options }]\n * @private\n */\n descriptors: function(chart) {\n var cache = chart._plugins || (chart._plugins = {});\n if (cache.id === this._cacheId) {\n return cache.descriptors;\n }\n\n var plugins = [];\n var descriptors = [];\n var config = (chart && chart.config) || {};\n var options = (config.options && config.options.plugins) || {};\n\n this._plugins.concat(config.plugins || []).forEach(function(plugin) {\n var idx = plugins.indexOf(plugin);\n if (idx !== -1) {\n return;\n }\n\n var id = plugin.id;\n var opts = options[id];\n if (opts === false) {\n return;\n }\n\n if (opts === true) {\n opts = helpers.clone(defaults.global.plugins[id]);\n }\n\n plugins.push(plugin);\n descriptors.push({\n plugin: plugin,\n options: opts || {}\n });\n });\n\n cache.descriptors = descriptors;\n cache.id = this._cacheId;\n return descriptors;\n }\n };\n\n /**\n * Plugin extension hooks.\n * @interface IPlugin\n * @since 2.1.0\n */\n /**\n * @method IPlugin#beforeInit\n * @desc Called before initializing `chart`.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Object} options - The plugin options.\n */\n /**\n * @method IPlugin#afterInit\n * @desc Called after `chart` has been initialized and before the first update.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Object} options - The plugin options.\n */\n /**\n * @method IPlugin#beforeUpdate\n * @desc Called before updating `chart`. If any plugin returns `false`, the update\n * is cancelled (and thus subsequent render(s)) until another `update` is triggered.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Object} options - The plugin options.\n * @returns {Boolean} `false` to cancel the chart update.\n */\n /**\n * @method IPlugin#afterUpdate\n * @desc Called after `chart` has been updated and before rendering. Note that this\n * hook will not be called if the chart update has been previously cancelled.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Object} options - The plugin options.\n */\n /**\n * @method IPlugin#beforeDatasetsUpdate\n * @desc Called before updating the `chart` datasets. If any plugin returns `false`,\n * the datasets update is cancelled until another `update` is triggered.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Object} options - The plugin options.\n * @returns {Boolean} false to cancel the datasets update.\n * @since version 2.1.5\n */\n /**\n * @method IPlugin#afterDatasetsUpdate\n * @desc Called after the `chart` datasets have been updated. Note that this hook\n * will not be called if the datasets update has been previously cancelled.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Object} options - The plugin options.\n * @since version 2.1.5\n */\n /**\n * @method IPlugin#beforeDatasetUpdate\n * @desc Called before updating the `chart` dataset at the given `args.index`. If any plugin\n * returns `false`, the datasets update is cancelled until another `update` is triggered.\n * @param {Chart} chart - The chart instance.\n * @param {Object} args - The call arguments.\n * @param {Number} args.index - The dataset index.\n * @param {Object} args.meta - The dataset metadata.\n * @param {Object} options - The plugin options.\n * @returns {Boolean} `false` to cancel the chart datasets drawing.\n */\n /**\n * @method IPlugin#afterDatasetUpdate\n * @desc Called after the `chart` datasets at the given `args.index` has been updated. Note\n * that this hook will not be called if the datasets update has been previously cancelled.\n * @param {Chart} chart - The chart instance.\n * @param {Object} args - The call arguments.\n * @param {Number} args.index - The dataset index.\n * @param {Object} args.meta - The dataset metadata.\n * @param {Object} options - The plugin options.\n */\n /**\n * @method IPlugin#beforeLayout\n * @desc Called before laying out `chart`. If any plugin returns `false`,\n * the layout update is cancelled until another `update` is triggered.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Object} options - The plugin options.\n * @returns {Boolean} `false` to cancel the chart layout.\n */\n /**\n * @method IPlugin#afterLayout\n * @desc Called after the `chart` has been layed out. Note that this hook will not\n * be called if the layout update has been previously cancelled.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Object} options - The plugin options.\n */\n /**\n * @method IPlugin#beforeRender\n * @desc Called before rendering `chart`. If any plugin returns `false`,\n * the rendering is cancelled until another `render` is triggered.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Object} options - The plugin options.\n * @returns {Boolean} `false` to cancel the chart rendering.\n */\n /**\n * @method IPlugin#afterRender\n * @desc Called after the `chart` has been fully rendered (and animation completed). Note\n * that this hook will not be called if the rendering has been previously cancelled.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Object} options - The plugin options.\n */\n /**\n * @method IPlugin#beforeDraw\n * @desc Called before drawing `chart` at every animation frame specified by the given\n * easing value. If any plugin returns `false`, the frame drawing is cancelled until\n * another `render` is triggered.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Number} easingValue - The current animation value, between 0.0 and 1.0.\n * @param {Object} options - The plugin options.\n * @returns {Boolean} `false` to cancel the chart drawing.\n */\n /**\n * @method IPlugin#afterDraw\n * @desc Called after the `chart` has been drawn for the specific easing value. Note\n * that this hook will not be called if the drawing has been previously cancelled.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Number} easingValue - The current animation value, between 0.0 and 1.0.\n * @param {Object} options - The plugin options.\n */\n /**\n * @method IPlugin#beforeDatasetsDraw\n * @desc Called before drawing the `chart` datasets. If any plugin returns `false`,\n * the datasets drawing is cancelled until another `render` is triggered.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Number} easingValue - The current animation value, between 0.0 and 1.0.\n * @param {Object} options - The plugin options.\n * @returns {Boolean} `false` to cancel the chart datasets drawing.\n */\n /**\n * @method IPlugin#afterDatasetsDraw\n * @desc Called after the `chart` datasets have been drawn. Note that this hook\n * will not be called if the datasets drawing has been previously cancelled.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Number} easingValue - The current animation value, between 0.0 and 1.0.\n * @param {Object} options - The plugin options.\n */\n /**\n * @method IPlugin#beforeDatasetDraw\n * @desc Called before drawing the `chart` dataset at the given `args.index` (datasets\n * are drawn in the reverse order). If any plugin returns `false`, the datasets drawing\n * is cancelled until another `render` is triggered.\n * @param {Chart} chart - The chart instance.\n * @param {Object} args - The call arguments.\n * @param {Number} args.index - The dataset index.\n * @param {Object} args.meta - The dataset metadata.\n * @param {Number} args.easingValue - The current animation value, between 0.0 and 1.0.\n * @param {Object} options - The plugin options.\n * @returns {Boolean} `false` to cancel the chart datasets drawing.\n */\n /**\n * @method IPlugin#afterDatasetDraw\n * @desc Called after the `chart` datasets at the given `args.index` have been drawn\n * (datasets are drawn in the reverse order). Note that this hook will not be called\n * if the datasets drawing has been previously cancelled.\n * @param {Chart} chart - The chart instance.\n * @param {Object} args - The call arguments.\n * @param {Number} args.index - The dataset index.\n * @param {Object} args.meta - The dataset metadata.\n * @param {Number} args.easingValue - The current animation value, between 0.0 and 1.0.\n * @param {Object} options - The plugin options.\n */\n /**\n * @method IPlugin#beforeEvent\n * @desc Called before processing the specified `event`. If any plugin returns `false`,\n * the event will be discarded.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {IEvent} event - The event object.\n * @param {Object} options - The plugin options.\n */\n /**\n * @method IPlugin#afterEvent\n * @desc Called after the `event` has been consumed. Note that this hook\n * will not be called if the `event` has been previously discarded.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {IEvent} event - The event object.\n * @param {Object} options - The plugin options.\n */\n /**\n * @method IPlugin#resize\n * @desc Called after the chart as been resized.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Number} size - The new canvas display size (eq. canvas.style width & height).\n * @param {Object} options - The plugin options.\n */\n /**\n * @method IPlugin#destroy\n * @desc Called after the chart as been destroyed.\n * @param {Chart.Controller} chart - The chart instance.\n * @param {Object} options - The plugin options.\n */\n\n /**\n * Provided for backward compatibility, use Chart.plugins instead\n * @namespace Chart.pluginService\n * @deprecated since version 2.1.5\n * @todo remove at version 3\n * @private\n */\n Chart.pluginService = Chart.plugins;\n\n /**\n * Provided for backward compatibility, inheriting from Chart.PlugingBase has no\n * effect, instead simply create/register plugins via plain JavaScript objects.\n * @interface Chart.PluginBase\n * @deprecated since version 2.5.0\n * @todo remove at version 3\n * @private\n */\n Chart.PluginBase = Element.extend({});\n };\n\n},{\"25\":25,\"26\":26,\"45\":45}],32:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var Element = require(26);\n var helpers = require(45);\n var Ticks = require(34);\n\n defaults._set('scale', {\n display: true,\n position: 'left',\n offset: false,\n\n // grid line settings\n gridLines: {\n display: true,\n color: 'rgba(0, 0, 0, 0.1)',\n lineWidth: 1,\n drawBorder: true,\n drawOnChartArea: true,\n drawTicks: true,\n tickMarkLength: 10,\n zeroLineWidth: 1,\n zeroLineColor: 'rgba(0,0,0,0.25)',\n zeroLineBorderDash: [],\n zeroLineBorderDashOffset: 0.0,\n offsetGridLines: false,\n borderDash: [],\n borderDashOffset: 0.0\n },\n\n // scale label\n scaleLabel: {\n // display property\n display: false,\n\n // actual label\n labelString: '',\n\n // line height\n lineHeight: 1.2,\n\n // top/bottom padding\n padding: {\n top: 4,\n bottom: 4\n }\n },\n\n // label settings\n ticks: {\n beginAtZero: false,\n minRotation: 0,\n maxRotation: 50,\n mirror: false,\n padding: 0,\n reverse: false,\n display: true,\n autoSkip: true,\n autoSkipPadding: 0,\n labelOffset: 0,\n // We pass through arrays to be rendered as multiline labels, we convert Others to strings here.\n callback: Ticks.formatters.values,\n minor: {},\n major: {}\n }\n });\n\n function labelsFromTicks(ticks) {\n var labels = [];\n var i, ilen;\n\n for (i = 0, ilen = ticks.length; i < ilen; ++i) {\n labels.push(ticks[i].label);\n }\n\n return labels;\n }\n\n function getLineValue(scale, index, offsetGridLines) {\n var lineValue = scale.getPixelForTick(index);\n\n if (offsetGridLines) {\n if (index === 0) {\n lineValue -= (scale.getPixelForTick(1) - lineValue) / 2;\n } else {\n lineValue -= (lineValue - scale.getPixelForTick(index - 1)) / 2;\n }\n }\n return lineValue;\n }\n\n module.exports = function(Chart) {\n\n function computeTextSize(context, tick, font) {\n return helpers.isArray(tick) ?\n helpers.longestText(context, font, tick) :\n context.measureText(tick).width;\n }\n\n function parseFontOptions(options) {\n var valueOrDefault = helpers.valueOrDefault;\n var globalDefaults = defaults.global;\n var size = valueOrDefault(options.fontSize, globalDefaults.defaultFontSize);\n var style = valueOrDefault(options.fontStyle, globalDefaults.defaultFontStyle);\n var family = valueOrDefault(options.fontFamily, globalDefaults.defaultFontFamily);\n\n return {\n size: size,\n style: style,\n family: family,\n font: helpers.fontString(size, style, family)\n };\n }\n\n function parseLineHeight(options) {\n return helpers.options.toLineHeight(\n helpers.valueOrDefault(options.lineHeight, 1.2),\n helpers.valueOrDefault(options.fontSize, defaults.global.defaultFontSize));\n }\n\n Chart.Scale = Element.extend({\n /**\n * Get the padding needed for the scale\n * @method getPadding\n * @private\n * @returns {Padding} the necessary padding\n */\n getPadding: function() {\n var me = this;\n return {\n left: me.paddingLeft || 0,\n top: me.paddingTop || 0,\n right: me.paddingRight || 0,\n bottom: me.paddingBottom || 0\n };\n },\n\n /**\n * Returns the scale tick objects ({label, major})\n * @since 2.7\n */\n getTicks: function() {\n return this._ticks;\n },\n\n // These methods are ordered by lifecyle. Utilities then follow.\n // Any function defined here is inherited by all scale types.\n // Any function can be extended by the scale type\n\n mergeTicksOptions: function() {\n var ticks = this.options.ticks;\n if (ticks.minor === false) {\n ticks.minor = {\n display: false\n };\n }\n if (ticks.major === false) {\n ticks.major = {\n display: false\n };\n }\n for (var key in ticks) {\n if (key !== 'major' && key !== 'minor') {\n if (typeof ticks.minor[key] === 'undefined') {\n ticks.minor[key] = ticks[key];\n }\n if (typeof ticks.major[key] === 'undefined') {\n ticks.major[key] = ticks[key];\n }\n }\n }\n },\n beforeUpdate: function() {\n helpers.callback(this.options.beforeUpdate, [this]);\n },\n update: function(maxWidth, maxHeight, margins) {\n var me = this;\n var i, ilen, labels, label, ticks, tick;\n\n // Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)\n me.beforeUpdate();\n\n // Absorb the master measurements\n me.maxWidth = maxWidth;\n me.maxHeight = maxHeight;\n me.margins = helpers.extend({\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n }, margins);\n me.longestTextCache = me.longestTextCache || {};\n\n // Dimensions\n me.beforeSetDimensions();\n me.setDimensions();\n me.afterSetDimensions();\n\n // Data min/max\n me.beforeDataLimits();\n me.determineDataLimits();\n me.afterDataLimits();\n\n // Ticks - `this.ticks` is now DEPRECATED!\n // Internal ticks are now stored as objects in the PRIVATE `this._ticks` member\n // and must not be accessed directly from outside this class. `this.ticks` being\n // around for long time and not marked as private, we can't change its structure\n // without unexpected breaking changes. If you need to access the scale ticks,\n // use scale.getTicks() instead.\n\n me.beforeBuildTicks();\n\n // New implementations should return an array of objects but for BACKWARD COMPAT,\n // we still support no return (`this.ticks` internally set by calling this method).\n ticks = me.buildTicks() || [];\n\n me.afterBuildTicks();\n\n me.beforeTickToLabelConversion();\n\n // New implementations should return the formatted tick labels but for BACKWARD\n // COMPAT, we still support no return (`this.ticks` internally changed by calling\n // this method and supposed to contain only string values).\n labels = me.convertTicksToLabels(ticks) || me.ticks;\n\n me.afterTickToLabelConversion();\n\n me.ticks = labels; // BACKWARD COMPATIBILITY\n\n // IMPORTANT: from this point, we consider that `this.ticks` will NEVER change!\n\n // BACKWARD COMPAT: synchronize `_ticks` with labels (so potentially `this.ticks`)\n for (i = 0, ilen = labels.length; i < ilen; ++i) {\n label = labels[i];\n tick = ticks[i];\n if (!tick) {\n ticks.push(tick = {\n label: label,\n major: false\n });\n } else {\n tick.label = label;\n }\n }\n\n me._ticks = ticks;\n\n // Tick Rotation\n me.beforeCalculateTickRotation();\n me.calculateTickRotation();\n me.afterCalculateTickRotation();\n // Fit\n me.beforeFit();\n me.fit();\n me.afterFit();\n //\n me.afterUpdate();\n\n return me.minSize;\n\n },\n afterUpdate: function() {\n helpers.callback(this.options.afterUpdate, [this]);\n },\n\n //\n\n beforeSetDimensions: function() {\n helpers.callback(this.options.beforeSetDimensions, [this]);\n },\n setDimensions: function() {\n var me = this;\n // Set the unconstrained dimension before label rotation\n if (me.isHorizontal()) {\n // Reset position before calculating rotation\n me.width = me.maxWidth;\n me.left = 0;\n me.right = me.width;\n } else {\n me.height = me.maxHeight;\n\n // Reset position before calculating rotation\n me.top = 0;\n me.bottom = me.height;\n }\n\n // Reset padding\n me.paddingLeft = 0;\n me.paddingTop = 0;\n me.paddingRight = 0;\n me.paddingBottom = 0;\n },\n afterSetDimensions: function() {\n helpers.callback(this.options.afterSetDimensions, [this]);\n },\n\n // Data limits\n beforeDataLimits: function() {\n helpers.callback(this.options.beforeDataLimits, [this]);\n },\n determineDataLimits: helpers.noop,\n afterDataLimits: function() {\n helpers.callback(this.options.afterDataLimits, [this]);\n },\n\n //\n beforeBuildTicks: function() {\n helpers.callback(this.options.beforeBuildTicks, [this]);\n },\n buildTicks: helpers.noop,\n afterBuildTicks: function() {\n helpers.callback(this.options.afterBuildTicks, [this]);\n },\n\n beforeTickToLabelConversion: function() {\n helpers.callback(this.options.beforeTickToLabelConversion, [this]);\n },\n convertTicksToLabels: function() {\n var me = this;\n // Convert ticks to strings\n var tickOpts = me.options.ticks;\n me.ticks = me.ticks.map(tickOpts.userCallback || tickOpts.callback, this);\n },\n afterTickToLabelConversion: function() {\n helpers.callback(this.options.afterTickToLabelConversion, [this]);\n },\n\n //\n\n beforeCalculateTickRotation: function() {\n helpers.callback(this.options.beforeCalculateTickRotation, [this]);\n },\n calculateTickRotation: function() {\n var me = this;\n var context = me.ctx;\n var tickOpts = me.options.ticks;\n var labels = labelsFromTicks(me._ticks);\n\n // Get the width of each grid by calculating the difference\n // between x offsets between 0 and 1.\n var tickFont = parseFontOptions(tickOpts);\n context.font = tickFont.font;\n\n var labelRotation = tickOpts.minRotation || 0;\n\n if (labels.length && me.options.display && me.isHorizontal()) {\n var originalLabelWidth = helpers.longestText(context, tickFont.font, labels, me.longestTextCache);\n var labelWidth = originalLabelWidth;\n var cosRotation, sinRotation;\n\n // Allow 3 pixels x2 padding either side for label readability\n var tickWidth = me.getPixelForTick(1) - me.getPixelForTick(0) - 6;\n\n // Max label rotation can be set or default to 90 - also act as a loop counter\n while (labelWidth > tickWidth && labelRotation < tickOpts.maxRotation) {\n var angleRadians = helpers.toRadians(labelRotation);\n cosRotation = Math.cos(angleRadians);\n sinRotation = Math.sin(angleRadians);\n\n if (sinRotation * originalLabelWidth > me.maxHeight) {\n // go back one step\n labelRotation--;\n break;\n }\n\n labelRotation++;\n labelWidth = cosRotation * originalLabelWidth;\n }\n }\n\n me.labelRotation = labelRotation;\n },\n afterCalculateTickRotation: function() {\n helpers.callback(this.options.afterCalculateTickRotation, [this]);\n },\n\n //\n\n beforeFit: function() {\n helpers.callback(this.options.beforeFit, [this]);\n },\n fit: function() {\n var me = this;\n // Reset\n var minSize = me.minSize = {\n width: 0,\n height: 0\n };\n\n var labels = labelsFromTicks(me._ticks);\n\n var opts = me.options;\n var tickOpts = opts.ticks;\n var scaleLabelOpts = opts.scaleLabel;\n var gridLineOpts = opts.gridLines;\n var display = opts.display;\n var isHorizontal = me.isHorizontal();\n\n var tickFont = parseFontOptions(tickOpts);\n var tickMarkLength = opts.gridLines.tickMarkLength;\n\n // Width\n if (isHorizontal) {\n // subtract the margins to line up with the chartArea if we are a full width scale\n minSize.width = me.isFullWidth() ? me.maxWidth - me.margins.left - me.margins.right : me.maxWidth;\n } else {\n minSize.width = display && gridLineOpts.drawTicks ? tickMarkLength : 0;\n }\n\n // height\n if (isHorizontal) {\n minSize.height = display && gridLineOpts.drawTicks ? tickMarkLength : 0;\n } else {\n minSize.height = me.maxHeight; // fill all the height\n }\n\n // Are we showing a title for the scale?\n if (scaleLabelOpts.display && display) {\n var scaleLabelLineHeight = parseLineHeight(scaleLabelOpts);\n var scaleLabelPadding = helpers.options.toPadding(scaleLabelOpts.padding);\n var deltaHeight = scaleLabelLineHeight + scaleLabelPadding.height;\n\n if (isHorizontal) {\n minSize.height += deltaHeight;\n } else {\n minSize.width += deltaHeight;\n }\n }\n\n // Don't bother fitting the ticks if we are not showing them\n if (tickOpts.display && display) {\n var largestTextWidth = helpers.longestText(me.ctx, tickFont.font, labels, me.longestTextCache);\n var tallestLabelHeightInLines = helpers.numberOfLabelLines(labels);\n var lineSpace = tickFont.size * 0.5;\n var tickPadding = me.options.ticks.padding;\n\n if (isHorizontal) {\n // A horizontal axis is more constrained by the height.\n me.longestLabelWidth = largestTextWidth;\n\n var angleRadians = helpers.toRadians(me.labelRotation);\n var cosRotation = Math.cos(angleRadians);\n var sinRotation = Math.sin(angleRadians);\n\n // TODO - improve this calculation\n var labelHeight = (sinRotation * largestTextWidth)\n + (tickFont.size * tallestLabelHeightInLines)\n + (lineSpace * (tallestLabelHeightInLines - 1))\n + lineSpace; // padding\n\n minSize.height = Math.min(me.maxHeight, minSize.height + labelHeight + tickPadding);\n\n me.ctx.font = tickFont.font;\n var firstLabelWidth = computeTextSize(me.ctx, labels[0], tickFont.font);\n var lastLabelWidth = computeTextSize(me.ctx, labels[labels.length - 1], tickFont.font);\n\n // Ensure that our ticks are always inside the canvas. When rotated, ticks are right aligned\n // which means that the right padding is dominated by the font height\n if (me.labelRotation !== 0) {\n me.paddingLeft = opts.position === 'bottom' ? (cosRotation * firstLabelWidth) + 3 : (cosRotation * lineSpace) + 3; // add 3 px to move away from canvas edges\n me.paddingRight = opts.position === 'bottom' ? (cosRotation * lineSpace) + 3 : (cosRotation * lastLabelWidth) + 3;\n } else {\n me.paddingLeft = firstLabelWidth / 2 + 3; // add 3 px to move away from canvas edges\n me.paddingRight = lastLabelWidth / 2 + 3;\n }\n } else {\n // A vertical axis is more constrained by the width. Labels are the\n // dominant factor here, so get that length first and account for padding\n if (tickOpts.mirror) {\n largestTextWidth = 0;\n } else {\n // use lineSpace for consistency with horizontal axis\n // tickPadding is not implemented for horizontal\n largestTextWidth += tickPadding + lineSpace;\n }\n\n minSize.width = Math.min(me.maxWidth, minSize.width + largestTextWidth);\n\n me.paddingTop = tickFont.size / 2;\n me.paddingBottom = tickFont.size / 2;\n }\n }\n\n me.handleMargins();\n\n me.width = minSize.width;\n me.height = minSize.height;\n },\n\n /**\n * Handle margins and padding interactions\n * @private\n */\n handleMargins: function() {\n var me = this;\n if (me.margins) {\n me.paddingLeft = Math.max(me.paddingLeft - me.margins.left, 0);\n me.paddingTop = Math.max(me.paddingTop - me.margins.top, 0);\n me.paddingRight = Math.max(me.paddingRight - me.margins.right, 0);\n me.paddingBottom = Math.max(me.paddingBottom - me.margins.bottom, 0);\n }\n },\n\n afterFit: function() {\n helpers.callback(this.options.afterFit, [this]);\n },\n\n // Shared Methods\n isHorizontal: function() {\n return this.options.position === 'top' || this.options.position === 'bottom';\n },\n isFullWidth: function() {\n return (this.options.fullWidth);\n },\n\n // Get the correct value. NaN bad inputs, If the value type is object get the x or y based on whether we are horizontal or not\n getRightValue: function(rawValue) {\n // Null and undefined values first\n if (helpers.isNullOrUndef(rawValue)) {\n return NaN;\n }\n // isNaN(object) returns true, so make sure NaN is checking for a number; Discard Infinite values\n if (typeof rawValue === 'number' && !isFinite(rawValue)) {\n return NaN;\n }\n // If it is in fact an object, dive in one more level\n if (rawValue) {\n if (this.isHorizontal()) {\n if (rawValue.x !== undefined) {\n return this.getRightValue(rawValue.x);\n }\n } else if (rawValue.y !== undefined) {\n return this.getRightValue(rawValue.y);\n }\n }\n\n // Value is good, return it\n return rawValue;\n },\n\n // Used to get the value to display in the tooltip for the data at the given index\n // function getLabelForIndex(index, datasetIndex)\n getLabelForIndex: helpers.noop,\n\n // Used to get data value locations. Value can either be an index or a numerical value\n getPixelForValue: helpers.noop,\n\n // Used to get the data value from a given pixel. This is the inverse of getPixelForValue\n getValueForPixel: helpers.noop,\n\n // Used for tick location, should\n getPixelForTick: function(index) {\n var me = this;\n var offset = me.options.offset;\n if (me.isHorizontal()) {\n var innerWidth = me.width - (me.paddingLeft + me.paddingRight);\n var tickWidth = innerWidth / Math.max((me._ticks.length - (offset ? 0 : 1)), 1);\n var pixel = (tickWidth * index) + me.paddingLeft;\n\n if (offset) {\n pixel += tickWidth / 2;\n }\n\n var finalVal = me.left + Math.round(pixel);\n finalVal += me.isFullWidth() ? me.margins.left : 0;\n return finalVal;\n }\n var innerHeight = me.height - (me.paddingTop + me.paddingBottom);\n return me.top + (index * (innerHeight / (me._ticks.length - 1)));\n },\n\n // Utility for getting the pixel location of a percentage of scale\n getPixelForDecimal: function(decimal) {\n var me = this;\n if (me.isHorizontal()) {\n var innerWidth = me.width - (me.paddingLeft + me.paddingRight);\n var valueOffset = (innerWidth * decimal) + me.paddingLeft;\n\n var finalVal = me.left + Math.round(valueOffset);\n finalVal += me.isFullWidth() ? me.margins.left : 0;\n return finalVal;\n }\n return me.top + (decimal * me.height);\n },\n\n getBasePixel: function() {\n return this.getPixelForValue(this.getBaseValue());\n },\n\n getBaseValue: function() {\n var me = this;\n var min = me.min;\n var max = me.max;\n\n return me.beginAtZero ? 0 :\n min < 0 && max < 0 ? max :\n min > 0 && max > 0 ? min :\n 0;\n },\n\n /**\n * Returns a subset of ticks to be plotted to avoid overlapping labels.\n * @private\n */\n _autoSkip: function(ticks) {\n var skipRatio;\n var me = this;\n var isHorizontal = me.isHorizontal();\n var optionTicks = me.options.ticks.minor;\n var tickCount = ticks.length;\n var labelRotationRadians = helpers.toRadians(me.labelRotation);\n var cosRotation = Math.cos(labelRotationRadians);\n var longestRotatedLabel = me.longestLabelWidth * cosRotation;\n var result = [];\n var i, tick, shouldSkip;\n\n // figure out the maximum number of gridlines to show\n var maxTicks;\n if (optionTicks.maxTicksLimit) {\n maxTicks = optionTicks.maxTicksLimit;\n }\n\n if (isHorizontal) {\n skipRatio = false;\n\n if ((longestRotatedLabel + optionTicks.autoSkipPadding) * tickCount > (me.width - (me.paddingLeft + me.paddingRight))) {\n skipRatio = 1 + Math.floor(((longestRotatedLabel + optionTicks.autoSkipPadding) * tickCount) / (me.width - (me.paddingLeft + me.paddingRight)));\n }\n\n // if they defined a max number of optionTicks,\n // increase skipRatio until that number is met\n if (maxTicks && tickCount > maxTicks) {\n skipRatio = Math.max(skipRatio, Math.floor(tickCount / maxTicks));\n }\n }\n\n for (i = 0; i < tickCount; i++) {\n tick = ticks[i];\n\n // Since we always show the last tick,we need may need to hide the last shown one before\n shouldSkip = (skipRatio > 1 && i % skipRatio > 0) || (i % skipRatio === 0 && i + skipRatio >= tickCount);\n if (shouldSkip && i !== tickCount - 1 || helpers.isNullOrUndef(tick.label)) {\n // leave tick in place but make sure it's not displayed (#4635)\n delete tick.label;\n }\n result.push(tick);\n }\n return result;\n },\n\n // Actually draw the scale on the canvas\n // @param {rectangle} chartArea : the area of the chart to draw full grid lines on\n draw: function(chartArea) {\n var me = this;\n var options = me.options;\n if (!options.display) {\n return;\n }\n\n var context = me.ctx;\n var globalDefaults = defaults.global;\n var optionTicks = options.ticks.minor;\n var optionMajorTicks = options.ticks.major || optionTicks;\n var gridLines = options.gridLines;\n var scaleLabel = options.scaleLabel;\n\n var isRotated = me.labelRotation !== 0;\n var isHorizontal = me.isHorizontal();\n\n var ticks = optionTicks.autoSkip ? me._autoSkip(me.getTicks()) : me.getTicks();\n var tickFontColor = helpers.valueOrDefault(optionTicks.fontColor, globalDefaults.defaultFontColor);\n var tickFont = parseFontOptions(optionTicks);\n var majorTickFontColor = helpers.valueOrDefault(optionMajorTicks.fontColor, globalDefaults.defaultFontColor);\n var majorTickFont = parseFontOptions(optionMajorTicks);\n\n var tl = gridLines.drawTicks ? gridLines.tickMarkLength : 0;\n\n var scaleLabelFontColor = helpers.valueOrDefault(scaleLabel.fontColor, globalDefaults.defaultFontColor);\n var scaleLabelFont = parseFontOptions(scaleLabel);\n var scaleLabelPadding = helpers.options.toPadding(scaleLabel.padding);\n var labelRotationRadians = helpers.toRadians(me.labelRotation);\n\n var itemsToDraw = [];\n\n var xTickStart = options.position === 'right' ? me.left : me.right - tl;\n var xTickEnd = options.position === 'right' ? me.left + tl : me.right;\n var yTickStart = options.position === 'bottom' ? me.top : me.bottom - tl;\n var yTickEnd = options.position === 'bottom' ? me.top + tl : me.bottom;\n\n helpers.each(ticks, function(tick, index) {\n // autoskipper skipped this tick (#4635)\n if (tick.label === undefined) {\n return;\n }\n\n var label = tick.label;\n var lineWidth, lineColor, borderDash, borderDashOffset;\n if (index === me.zeroLineIndex && options.offset === gridLines.offsetGridLines) {\n // Draw the first index specially\n lineWidth = gridLines.zeroLineWidth;\n lineColor = gridLines.zeroLineColor;\n borderDash = gridLines.zeroLineBorderDash;\n borderDashOffset = gridLines.zeroLineBorderDashOffset;\n } else {\n lineWidth = helpers.valueAtIndexOrDefault(gridLines.lineWidth, index);\n lineColor = helpers.valueAtIndexOrDefault(gridLines.color, index);\n borderDash = helpers.valueOrDefault(gridLines.borderDash, globalDefaults.borderDash);\n borderDashOffset = helpers.valueOrDefault(gridLines.borderDashOffset, globalDefaults.borderDashOffset);\n }\n\n // Common properties\n var tx1, ty1, tx2, ty2, x1, y1, x2, y2, labelX, labelY;\n var textAlign = 'middle';\n var textBaseline = 'middle';\n var tickPadding = optionTicks.padding;\n\n if (isHorizontal) {\n var labelYOffset = tl + tickPadding;\n\n if (options.position === 'bottom') {\n // bottom\n textBaseline = !isRotated ? 'top' : 'middle';\n textAlign = !isRotated ? 'center' : 'right';\n labelY = me.top + labelYOffset;\n } else {\n // top\n textBaseline = !isRotated ? 'bottom' : 'middle';\n textAlign = !isRotated ? 'center' : 'left';\n labelY = me.bottom - labelYOffset;\n }\n\n var xLineValue = getLineValue(me, index, gridLines.offsetGridLines && ticks.length > 1);\n if (xLineValue < me.left) {\n lineColor = 'rgba(0,0,0,0)';\n }\n xLineValue += helpers.aliasPixel(lineWidth);\n\n labelX = me.getPixelForTick(index) + optionTicks.labelOffset; // x values for optionTicks (need to consider offsetLabel option)\n\n tx1 = tx2 = x1 = x2 = xLineValue;\n ty1 = yTickStart;\n ty2 = yTickEnd;\n y1 = chartArea.top;\n y2 = chartArea.bottom;\n } else {\n var isLeft = options.position === 'left';\n var labelXOffset;\n\n if (optionTicks.mirror) {\n textAlign = isLeft ? 'left' : 'right';\n labelXOffset = tickPadding;\n } else {\n textAlign = isLeft ? 'right' : 'left';\n labelXOffset = tl + tickPadding;\n }\n\n labelX = isLeft ? me.right - labelXOffset : me.left + labelXOffset;\n\n var yLineValue = getLineValue(me, index, gridLines.offsetGridLines && ticks.length > 1);\n if (yLineValue < me.top) {\n lineColor = 'rgba(0,0,0,0)';\n }\n yLineValue += helpers.aliasPixel(lineWidth);\n\n labelY = me.getPixelForTick(index) + optionTicks.labelOffset;\n\n tx1 = xTickStart;\n tx2 = xTickEnd;\n x1 = chartArea.left;\n x2 = chartArea.right;\n ty1 = ty2 = y1 = y2 = yLineValue;\n }\n\n itemsToDraw.push({\n tx1: tx1,\n ty1: ty1,\n tx2: tx2,\n ty2: ty2,\n x1: x1,\n y1: y1,\n x2: x2,\n y2: y2,\n labelX: labelX,\n labelY: labelY,\n glWidth: lineWidth,\n glColor: lineColor,\n glBorderDash: borderDash,\n glBorderDashOffset: borderDashOffset,\n rotation: -1 * labelRotationRadians,\n label: label,\n major: tick.major,\n textBaseline: textBaseline,\n textAlign: textAlign\n });\n });\n\n // Draw all of the tick labels, tick marks, and grid lines at the correct places\n helpers.each(itemsToDraw, function(itemToDraw) {\n if (gridLines.display) {\n context.save();\n context.lineWidth = itemToDraw.glWidth;\n context.strokeStyle = itemToDraw.glColor;\n if (context.setLineDash) {\n context.setLineDash(itemToDraw.glBorderDash);\n context.lineDashOffset = itemToDraw.glBorderDashOffset;\n }\n\n context.beginPath();\n\n if (gridLines.drawTicks) {\n context.moveTo(itemToDraw.tx1, itemToDraw.ty1);\n context.lineTo(itemToDraw.tx2, itemToDraw.ty2);\n }\n\n if (gridLines.drawOnChartArea) {\n context.moveTo(itemToDraw.x1, itemToDraw.y1);\n context.lineTo(itemToDraw.x2, itemToDraw.y2);\n }\n\n context.stroke();\n context.restore();\n }\n\n if (optionTicks.display) {\n // Make sure we draw text in the correct color and font\n context.save();\n context.translate(itemToDraw.labelX, itemToDraw.labelY);\n context.rotate(itemToDraw.rotation);\n context.font = itemToDraw.major ? majorTickFont.font : tickFont.font;\n context.fillStyle = itemToDraw.major ? majorTickFontColor : tickFontColor;\n context.textBaseline = itemToDraw.textBaseline;\n context.textAlign = itemToDraw.textAlign;\n\n var label = itemToDraw.label;\n if (helpers.isArray(label)) {\n for (var i = 0, y = 0; i < label.length; ++i) {\n // We just make sure the multiline element is a string here..\n context.fillText('' + label[i], 0, y);\n // apply same lineSpacing as calculated @ L#320\n y += (tickFont.size * 1.5);\n }\n } else {\n context.fillText(label, 0, 0);\n }\n context.restore();\n }\n });\n\n if (scaleLabel.display) {\n // Draw the scale label\n var scaleLabelX;\n var scaleLabelY;\n var rotation = 0;\n var halfLineHeight = parseLineHeight(scaleLabel) / 2;\n\n if (isHorizontal) {\n scaleLabelX = me.left + ((me.right - me.left) / 2); // midpoint of the width\n scaleLabelY = options.position === 'bottom'\n ? me.bottom - halfLineHeight - scaleLabelPadding.bottom\n : me.top + halfLineHeight + scaleLabelPadding.top;\n } else {\n var isLeft = options.position === 'left';\n scaleLabelX = isLeft\n ? me.left + halfLineHeight + scaleLabelPadding.top\n : me.right - halfLineHeight - scaleLabelPadding.top;\n scaleLabelY = me.top + ((me.bottom - me.top) / 2);\n rotation = isLeft ? -0.5 * Math.PI : 0.5 * Math.PI;\n }\n\n context.save();\n context.translate(scaleLabelX, scaleLabelY);\n context.rotate(rotation);\n context.textAlign = 'center';\n context.textBaseline = 'middle';\n context.fillStyle = scaleLabelFontColor; // render in correct colour\n context.font = scaleLabelFont.font;\n context.fillText(scaleLabel.labelString, 0, 0);\n context.restore();\n }\n\n if (gridLines.drawBorder) {\n // Draw the line at the edge of the axis\n context.lineWidth = helpers.valueAtIndexOrDefault(gridLines.lineWidth, 0);\n context.strokeStyle = helpers.valueAtIndexOrDefault(gridLines.color, 0);\n var x1 = me.left;\n var x2 = me.right;\n var y1 = me.top;\n var y2 = me.bottom;\n\n var aliasPixel = helpers.aliasPixel(context.lineWidth);\n if (isHorizontal) {\n y1 = y2 = options.position === 'top' ? me.bottom : me.top;\n y1 += aliasPixel;\n y2 += aliasPixel;\n } else {\n x1 = x2 = options.position === 'left' ? me.right : me.left;\n x1 += aliasPixel;\n x2 += aliasPixel;\n }\n\n context.beginPath();\n context.moveTo(x1, y1);\n context.lineTo(x2, y2);\n context.stroke();\n }\n }\n });\n };\n\n},{\"25\":25,\"26\":26,\"34\":34,\"45\":45}],33:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var helpers = require(45);\n\n module.exports = function(Chart) {\n\n Chart.scaleService = {\n // Scale registration object. Extensions can register new scale types (such as log or DB scales) and then\n // use the new chart options to grab the correct scale\n constructors: {},\n // Use a registration function so that we can move to an ES6 map when we no longer need to support\n // old browsers\n\n // Scale config defaults\n defaults: {},\n registerScaleType: function(type, scaleConstructor, scaleDefaults) {\n this.constructors[type] = scaleConstructor;\n this.defaults[type] = helpers.clone(scaleDefaults);\n },\n getScaleConstructor: function(type) {\n return this.constructors.hasOwnProperty(type) ? this.constructors[type] : undefined;\n },\n getScaleDefaults: function(type) {\n // Return the scale defaults merged with the global settings so that we always use the latest ones\n return this.defaults.hasOwnProperty(type) ? helpers.merge({}, [defaults.scale, this.defaults[type]]) : {};\n },\n updateScaleDefaults: function(type, additions) {\n var me = this;\n if (me.defaults.hasOwnProperty(type)) {\n me.defaults[type] = helpers.extend(me.defaults[type], additions);\n }\n },\n addScalesToLayout: function(chart) {\n // Adds each scale to the chart.boxes array to be sized accordingly\n helpers.each(chart.scales, function(scale) {\n // Set ILayoutItem parameters for backwards compatibility\n scale.fullWidth = scale.options.fullWidth;\n scale.position = scale.options.position;\n scale.weight = scale.options.weight;\n Chart.layoutService.addBox(chart, scale);\n });\n }\n };\n };\n\n},{\"25\":25,\"45\":45}],34:[function(require,module,exports){\n 'use strict';\n\n var helpers = require(45);\n\n /**\n * Namespace to hold static tick generation functions\n * @namespace Chart.Ticks\n */\n module.exports = {\n /**\n * Namespace to hold generators for different types of ticks\n * @namespace Chart.Ticks.generators\n */\n generators: {\n /**\n * Interface for the options provided to the numeric tick generator\n * @interface INumericTickGenerationOptions\n */\n /**\n * The maximum number of ticks to display\n * @name INumericTickGenerationOptions#maxTicks\n * @type Number\n */\n /**\n * The distance between each tick.\n * @name INumericTickGenerationOptions#stepSize\n * @type Number\n * @optional\n */\n /**\n * Forced minimum for the ticks. If not specified, the minimum of the data range is used to calculate the tick minimum\n * @name INumericTickGenerationOptions#min\n * @type Number\n * @optional\n */\n /**\n * The maximum value of the ticks. If not specified, the maximum of the data range is used to calculate the tick maximum\n * @name INumericTickGenerationOptions#max\n * @type Number\n * @optional\n */\n\n /**\n * Generate a set of linear ticks\n * @method Chart.Ticks.generators.linear\n * @param generationOptions {INumericTickGenerationOptions} the options used to generate the ticks\n * @param dataRange {IRange} the range of the data\n * @returns {Array} array of tick values\n */\n linear: function(generationOptions, dataRange) {\n var ticks = [];\n // To get a \"nice\" value for the tick spacing, we will use the appropriately named\n // \"nice number\" algorithm. See http://stackoverflow.com/questions/8506881/nice-label-algorithm-for-charts-with-minimum-ticks\n // for details.\n\n var spacing;\n if (generationOptions.stepSize && generationOptions.stepSize > 0) {\n spacing = generationOptions.stepSize;\n } else {\n var niceRange = helpers.niceNum(dataRange.max - dataRange.min, false);\n spacing = helpers.niceNum(niceRange / (generationOptions.maxTicks - 1), true);\n }\n var niceMin = Math.floor(dataRange.min / spacing) * spacing;\n var niceMax = Math.ceil(dataRange.max / spacing) * spacing;\n\n // If min, max and stepSize is set and they make an evenly spaced scale use it.\n if (generationOptions.min && generationOptions.max && generationOptions.stepSize) {\n // If very close to our whole number, use it.\n if (helpers.almostWhole((generationOptions.max - generationOptions.min) / generationOptions.stepSize, spacing / 1000)) {\n niceMin = generationOptions.min;\n niceMax = generationOptions.max;\n }\n }\n\n var numSpaces = (niceMax - niceMin) / spacing;\n // If very close to our rounded value, use it.\n if (helpers.almostEquals(numSpaces, Math.round(numSpaces), spacing / 1000)) {\n numSpaces = Math.round(numSpaces);\n } else {\n numSpaces = Math.ceil(numSpaces);\n }\n\n // Put the values into the ticks array\n ticks.push(generationOptions.min !== undefined ? generationOptions.min : niceMin);\n for (var j = 1; j < numSpaces; ++j) {\n ticks.push(niceMin + (j * spacing));\n }\n ticks.push(generationOptions.max !== undefined ? generationOptions.max : niceMax);\n\n return ticks;\n },\n\n /**\n * Generate a set of logarithmic ticks\n * @method Chart.Ticks.generators.logarithmic\n * @param generationOptions {INumericTickGenerationOptions} the options used to generate the ticks\n * @param dataRange {IRange} the range of the data\n * @returns {Array} array of tick values\n */\n logarithmic: function(generationOptions, dataRange) {\n var ticks = [];\n var valueOrDefault = helpers.valueOrDefault;\n\n // Figure out what the max number of ticks we can support it is based on the size of\n // the axis area. For now, we say that the minimum tick spacing in pixels must be 50\n // We also limit the maximum number of ticks to 11 which gives a nice 10 squares on\n // the graph\n var tickVal = valueOrDefault(generationOptions.min, Math.pow(10, Math.floor(helpers.log10(dataRange.min))));\n\n var endExp = Math.floor(helpers.log10(dataRange.max));\n var endSignificand = Math.ceil(dataRange.max / Math.pow(10, endExp));\n var exp, significand;\n\n if (tickVal === 0) {\n exp = Math.floor(helpers.log10(dataRange.minNotZero));\n significand = Math.floor(dataRange.minNotZero / Math.pow(10, exp));\n\n ticks.push(tickVal);\n tickVal = significand * Math.pow(10, exp);\n } else {\n exp = Math.floor(helpers.log10(tickVal));\n significand = Math.floor(tickVal / Math.pow(10, exp));\n }\n\n do {\n ticks.push(tickVal);\n\n ++significand;\n if (significand === 10) {\n significand = 1;\n ++exp;\n }\n\n tickVal = significand * Math.pow(10, exp);\n } while (exp < endExp || (exp === endExp && significand < endSignificand));\n\n var lastTick = valueOrDefault(generationOptions.max, tickVal);\n ticks.push(lastTick);\n\n return ticks;\n }\n },\n\n /**\n * Namespace to hold formatters for different types of ticks\n * @namespace Chart.Ticks.formatters\n */\n formatters: {\n /**\n * Formatter for value labels\n * @method Chart.Ticks.formatters.values\n * @param value the value to display\n * @return {String|Array} the label to display\n */\n values: function(value) {\n return helpers.isArray(value) ? value : '' + value;\n },\n\n /**\n * Formatter for linear numeric ticks\n * @method Chart.Ticks.formatters.linear\n * @param tickValue {Number} the value to be formatted\n * @param index {Number} the position of the tickValue parameter in the ticks array\n * @param ticks {Array} the list of ticks being converted\n * @return {String} string representation of the tickValue parameter\n */\n linear: function(tickValue, index, ticks) {\n // If we have lots of ticks, don't use the ones\n var delta = ticks.length > 3 ? ticks[2] - ticks[1] : ticks[1] - ticks[0];\n\n // If we have a number like 2.5 as the delta, figure out how many decimal places we need\n if (Math.abs(delta) > 1) {\n if (tickValue !== Math.floor(tickValue)) {\n // not an integer\n delta = tickValue - Math.floor(tickValue);\n }\n }\n\n var logDelta = helpers.log10(Math.abs(delta));\n var tickString = '';\n\n if (tickValue !== 0) {\n var numDecimal = -1 * Math.floor(logDelta);\n numDecimal = Math.max(Math.min(numDecimal, 20), 0); // toFixed has a max of 20 decimal places\n tickString = tickValue.toFixed(numDecimal);\n } else {\n tickString = '0'; // never show decimal places for 0\n }\n\n return tickString;\n },\n\n logarithmic: function(tickValue, index, ticks) {\n var remain = tickValue / (Math.pow(10, Math.floor(helpers.log10(tickValue))));\n\n if (tickValue === 0) {\n return '0';\n } else if (remain === 1 || remain === 2 || remain === 5 || index === 0 || index === ticks.length - 1) {\n return tickValue.toExponential();\n }\n return '';\n }\n }\n };\n\n},{\"45\":45}],35:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var Element = require(26);\n var helpers = require(45);\n\n defaults._set('global', {\n tooltips: {\n enabled: true,\n custom: null,\n mode: 'nearest',\n position: 'average',\n intersect: true,\n backgroundColor: 'rgba(0,0,0,0.8)',\n titleFontStyle: 'bold',\n titleSpacing: 2,\n titleMarginBottom: 6,\n titleFontColor: '#fff',\n titleAlign: 'left',\n bodySpacing: 2,\n bodyFontColor: '#fff',\n bodyAlign: 'left',\n footerFontStyle: 'bold',\n footerSpacing: 2,\n footerMarginTop: 6,\n footerFontColor: '#fff',\n footerAlign: 'left',\n yPadding: 6,\n xPadding: 6,\n caretPadding: 2,\n caretSize: 5,\n cornerRadius: 6,\n multiKeyBackground: '#fff',\n displayColors: true,\n borderColor: 'rgba(0,0,0,0)',\n borderWidth: 0,\n callbacks: {\n // Args are: (tooltipItems, data)\n beforeTitle: helpers.noop,\n title: function(tooltipItems, data) {\n // Pick first xLabel for now\n var title = '';\n var labels = data.labels;\n var labelCount = labels ? labels.length : 0;\n\n if (tooltipItems.length > 0) {\n var item = tooltipItems[0];\n\n if (item.xLabel) {\n title = item.xLabel;\n } else if (labelCount > 0 && item.index < labelCount) {\n title = labels[item.index];\n }\n }\n\n return title;\n },\n afterTitle: helpers.noop,\n\n // Args are: (tooltipItems, data)\n beforeBody: helpers.noop,\n\n // Args are: (tooltipItem, data)\n beforeLabel: helpers.noop,\n label: function(tooltipItem, data) {\n var label = data.datasets[tooltipItem.datasetIndex].label || '';\n\n if (label) {\n label += ': ';\n }\n label += tooltipItem.yLabel;\n return label;\n },\n labelColor: function(tooltipItem, chart) {\n var meta = chart.getDatasetMeta(tooltipItem.datasetIndex);\n var activeElement = meta.data[tooltipItem.index];\n var view = activeElement._view;\n return {\n borderColor: view.borderColor,\n backgroundColor: view.backgroundColor\n };\n },\n labelTextColor: function() {\n return this._options.bodyFontColor;\n },\n afterLabel: helpers.noop,\n\n // Args are: (tooltipItems, data)\n afterBody: helpers.noop,\n\n // Args are: (tooltipItems, data)\n beforeFooter: helpers.noop,\n footer: helpers.noop,\n afterFooter: helpers.noop\n }\n }\n });\n\n module.exports = function(Chart) {\n\n /**\n * Helper method to merge the opacity into a color\n */\n function mergeOpacity(colorString, opacity) {\n var color = helpers.color(colorString);\n return color.alpha(opacity * color.alpha()).rgbaString();\n }\n\n // Helper to push or concat based on if the 2nd parameter is an array or not\n function pushOrConcat(base, toPush) {\n if (toPush) {\n if (helpers.isArray(toPush)) {\n // base = base.concat(toPush);\n Array.prototype.push.apply(base, toPush);\n } else {\n base.push(toPush);\n }\n }\n\n return base;\n }\n\n // Private helper to create a tooltip item model\n // @param element : the chart element (point, arc, bar) to create the tooltip item for\n // @return : new tooltip item\n function createTooltipItem(element) {\n var xScale = element._xScale;\n var yScale = element._yScale || element._scale; // handle radar || polarArea charts\n var index = element._index;\n var datasetIndex = element._datasetIndex;\n\n return {\n xLabel: xScale ? xScale.getLabelForIndex(index, datasetIndex) : '',\n yLabel: yScale ? yScale.getLabelForIndex(index, datasetIndex) : '',\n index: index,\n datasetIndex: datasetIndex,\n x: element._model.x,\n y: element._model.y\n };\n }\n\n /**\n * Helper to get the reset model for the tooltip\n * @param tooltipOpts {Object} the tooltip options\n */\n function getBaseModel(tooltipOpts) {\n var globalDefaults = defaults.global;\n var valueOrDefault = helpers.valueOrDefault;\n\n return {\n // Positioning\n xPadding: tooltipOpts.xPadding,\n yPadding: tooltipOpts.yPadding,\n xAlign: tooltipOpts.xAlign,\n yAlign: tooltipOpts.yAlign,\n\n // Body\n bodyFontColor: tooltipOpts.bodyFontColor,\n _bodyFontFamily: valueOrDefault(tooltipOpts.bodyFontFamily, globalDefaults.defaultFontFamily),\n _bodyFontStyle: valueOrDefault(tooltipOpts.bodyFontStyle, globalDefaults.defaultFontStyle),\n _bodyAlign: tooltipOpts.bodyAlign,\n bodyFontSize: valueOrDefault(tooltipOpts.bodyFontSize, globalDefaults.defaultFontSize),\n bodySpacing: tooltipOpts.bodySpacing,\n\n // Title\n titleFontColor: tooltipOpts.titleFontColor,\n _titleFontFamily: valueOrDefault(tooltipOpts.titleFontFamily, globalDefaults.defaultFontFamily),\n _titleFontStyle: valueOrDefault(tooltipOpts.titleFontStyle, globalDefaults.defaultFontStyle),\n titleFontSize: valueOrDefault(tooltipOpts.titleFontSize, globalDefaults.defaultFontSize),\n _titleAlign: tooltipOpts.titleAlign,\n titleSpacing: tooltipOpts.titleSpacing,\n titleMarginBottom: tooltipOpts.titleMarginBottom,\n\n // Footer\n footerFontColor: tooltipOpts.footerFontColor,\n _footerFontFamily: valueOrDefault(tooltipOpts.footerFontFamily, globalDefaults.defaultFontFamily),\n _footerFontStyle: valueOrDefault(tooltipOpts.footerFontStyle, globalDefaults.defaultFontStyle),\n footerFontSize: valueOrDefault(tooltipOpts.footerFontSize, globalDefaults.defaultFontSize),\n _footerAlign: tooltipOpts.footerAlign,\n footerSpacing: tooltipOpts.footerSpacing,\n footerMarginTop: tooltipOpts.footerMarginTop,\n\n // Appearance\n caretSize: tooltipOpts.caretSize,\n cornerRadius: tooltipOpts.cornerRadius,\n backgroundColor: tooltipOpts.backgroundColor,\n opacity: 0,\n legendColorBackground: tooltipOpts.multiKeyBackground,\n displayColors: tooltipOpts.displayColors,\n borderColor: tooltipOpts.borderColor,\n borderWidth: tooltipOpts.borderWidth\n };\n }\n\n /**\n * Get the size of the tooltip\n */\n function getTooltipSize(tooltip, model) {\n var ctx = tooltip._chart.ctx;\n\n var height = model.yPadding * 2; // Tooltip Padding\n var width = 0;\n\n // Count of all lines in the body\n var body = model.body;\n var combinedBodyLength = body.reduce(function(count, bodyItem) {\n return count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length;\n }, 0);\n combinedBodyLength += model.beforeBody.length + model.afterBody.length;\n\n var titleLineCount = model.title.length;\n var footerLineCount = model.footer.length;\n var titleFontSize = model.titleFontSize;\n var bodyFontSize = model.bodyFontSize;\n var footerFontSize = model.footerFontSize;\n\n height += titleLineCount * titleFontSize; // Title Lines\n height += titleLineCount ? (titleLineCount - 1) * model.titleSpacing : 0; // Title Line Spacing\n height += titleLineCount ? model.titleMarginBottom : 0; // Title's bottom Margin\n height += combinedBodyLength * bodyFontSize; // Body Lines\n height += combinedBodyLength ? (combinedBodyLength - 1) * model.bodySpacing : 0; // Body Line Spacing\n height += footerLineCount ? model.footerMarginTop : 0; // Footer Margin\n height += footerLineCount * (footerFontSize); // Footer Lines\n height += footerLineCount ? (footerLineCount - 1) * model.footerSpacing : 0; // Footer Line Spacing\n\n // Title width\n var widthPadding = 0;\n var maxLineWidth = function(line) {\n width = Math.max(width, ctx.measureText(line).width + widthPadding);\n };\n\n ctx.font = helpers.fontString(titleFontSize, model._titleFontStyle, model._titleFontFamily);\n helpers.each(model.title, maxLineWidth);\n\n // Body width\n ctx.font = helpers.fontString(bodyFontSize, model._bodyFontStyle, model._bodyFontFamily);\n helpers.each(model.beforeBody.concat(model.afterBody), maxLineWidth);\n\n // Body lines may include some extra width due to the color box\n widthPadding = model.displayColors ? (bodyFontSize + 2) : 0;\n helpers.each(body, function(bodyItem) {\n helpers.each(bodyItem.before, maxLineWidth);\n helpers.each(bodyItem.lines, maxLineWidth);\n helpers.each(bodyItem.after, maxLineWidth);\n });\n\n // Reset back to 0\n widthPadding = 0;\n\n // Footer width\n ctx.font = helpers.fontString(footerFontSize, model._footerFontStyle, model._footerFontFamily);\n helpers.each(model.footer, maxLineWidth);\n\n // Add padding\n width += 2 * model.xPadding;\n\n return {\n width: width,\n height: height\n };\n }\n\n /**\n * Helper to get the alignment of a tooltip given the size\n */\n function determineAlignment(tooltip, size) {\n var model = tooltip._model;\n var chart = tooltip._chart;\n var chartArea = tooltip._chart.chartArea;\n var xAlign = 'center';\n var yAlign = 'center';\n\n if (model.y < size.height) {\n yAlign = 'top';\n } else if (model.y > (chart.height - size.height)) {\n yAlign = 'bottom';\n }\n\n var lf, rf; // functions to determine left, right alignment\n var olf, orf; // functions to determine if left/right alignment causes tooltip to go outside chart\n var yf; // function to get the y alignment if the tooltip goes outside of the left or right edges\n var midX = (chartArea.left + chartArea.right) / 2;\n var midY = (chartArea.top + chartArea.bottom) / 2;\n\n if (yAlign === 'center') {\n lf = function(x) {\n return x <= midX;\n };\n rf = function(x) {\n return x > midX;\n };\n } else {\n lf = function(x) {\n return x <= (size.width / 2);\n };\n rf = function(x) {\n return x >= (chart.width - (size.width / 2));\n };\n }\n\n olf = function(x) {\n return x + size.width > chart.width;\n };\n orf = function(x) {\n return x - size.width < 0;\n };\n yf = function(y) {\n return y <= midY ? 'top' : 'bottom';\n };\n\n if (lf(model.x)) {\n xAlign = 'left';\n\n // Is tooltip too wide and goes over the right side of the chart.?\n if (olf(model.x)) {\n xAlign = 'center';\n yAlign = yf(model.y);\n }\n } else if (rf(model.x)) {\n xAlign = 'right';\n\n // Is tooltip too wide and goes outside left edge of canvas?\n if (orf(model.x)) {\n xAlign = 'center';\n yAlign = yf(model.y);\n }\n }\n\n var opts = tooltip._options;\n return {\n xAlign: opts.xAlign ? opts.xAlign : xAlign,\n yAlign: opts.yAlign ? opts.yAlign : yAlign\n };\n }\n\n /**\n * @Helper to get the location a tooltip needs to be placed at given the initial position (via the vm) and the size and alignment\n */\n function getBackgroundPoint(vm, size, alignment) {\n // Background Position\n var x = vm.x;\n var y = vm.y;\n\n var caretSize = vm.caretSize;\n var caretPadding = vm.caretPadding;\n var cornerRadius = vm.cornerRadius;\n var xAlign = alignment.xAlign;\n var yAlign = alignment.yAlign;\n var paddingAndSize = caretSize + caretPadding;\n var radiusAndPadding = cornerRadius + caretPadding;\n\n if (xAlign === 'right') {\n x -= size.width;\n } else if (xAlign === 'center') {\n x -= (size.width / 2);\n }\n\n if (yAlign === 'top') {\n y += paddingAndSize;\n } else if (yAlign === 'bottom') {\n y -= size.height + paddingAndSize;\n } else {\n y -= (size.height / 2);\n }\n\n if (yAlign === 'center') {\n if (xAlign === 'left') {\n x += paddingAndSize;\n } else if (xAlign === 'right') {\n x -= paddingAndSize;\n }\n } else if (xAlign === 'left') {\n x -= radiusAndPadding;\n } else if (xAlign === 'right') {\n x += radiusAndPadding;\n }\n\n return {\n x: x,\n y: y\n };\n }\n\n Chart.Tooltip = Element.extend({\n initialize: function() {\n this._model = getBaseModel(this._options);\n },\n\n // Get the title\n // Args are: (tooltipItem, data)\n getTitle: function() {\n var me = this;\n var opts = me._options;\n var callbacks = opts.callbacks;\n\n var beforeTitle = callbacks.beforeTitle.apply(me, arguments);\n var title = callbacks.title.apply(me, arguments);\n var afterTitle = callbacks.afterTitle.apply(me, arguments);\n\n var lines = [];\n lines = pushOrConcat(lines, beforeTitle);\n lines = pushOrConcat(lines, title);\n lines = pushOrConcat(lines, afterTitle);\n\n return lines;\n },\n\n // Args are: (tooltipItem, data)\n getBeforeBody: function() {\n var lines = this._options.callbacks.beforeBody.apply(this, arguments);\n return helpers.isArray(lines) ? lines : lines !== undefined ? [lines] : [];\n },\n\n // Args are: (tooltipItem, data)\n getBody: function(tooltipItems, data) {\n var me = this;\n var callbacks = me._options.callbacks;\n var bodyItems = [];\n\n helpers.each(tooltipItems, function(tooltipItem) {\n var bodyItem = {\n before: [],\n lines: [],\n after: []\n };\n pushOrConcat(bodyItem.before, callbacks.beforeLabel.call(me, tooltipItem, data));\n pushOrConcat(bodyItem.lines, callbacks.label.call(me, tooltipItem, data));\n pushOrConcat(bodyItem.after, callbacks.afterLabel.call(me, tooltipItem, data));\n\n bodyItems.push(bodyItem);\n });\n\n return bodyItems;\n },\n\n // Args are: (tooltipItem, data)\n getAfterBody: function() {\n var lines = this._options.callbacks.afterBody.apply(this, arguments);\n return helpers.isArray(lines) ? lines : lines !== undefined ? [lines] : [];\n },\n\n // Get the footer and beforeFooter and afterFooter lines\n // Args are: (tooltipItem, data)\n getFooter: function() {\n var me = this;\n var callbacks = me._options.callbacks;\n\n var beforeFooter = callbacks.beforeFooter.apply(me, arguments);\n var footer = callbacks.footer.apply(me, arguments);\n var afterFooter = callbacks.afterFooter.apply(me, arguments);\n\n var lines = [];\n lines = pushOrConcat(lines, beforeFooter);\n lines = pushOrConcat(lines, footer);\n lines = pushOrConcat(lines, afterFooter);\n\n return lines;\n },\n\n update: function(changed) {\n var me = this;\n var opts = me._options;\n\n // Need to regenerate the model because its faster than using extend and it is necessary due to the optimization in Chart.Element.transition\n // that does _view = _model if ease === 1. This causes the 2nd tooltip update to set properties in both the view and model at the same time\n // which breaks any animations.\n var existingModel = me._model;\n var model = me._model = getBaseModel(opts);\n var active = me._active;\n\n var data = me._data;\n\n // In the case where active.length === 0 we need to keep these at existing values for good animations\n var alignment = {\n xAlign: existingModel.xAlign,\n yAlign: existingModel.yAlign\n };\n var backgroundPoint = {\n x: existingModel.x,\n y: existingModel.y\n };\n var tooltipSize = {\n width: existingModel.width,\n height: existingModel.height\n };\n var tooltipPosition = {\n x: existingModel.caretX,\n y: existingModel.caretY\n };\n\n var i, len;\n\n if (active.length) {\n model.opacity = 1;\n\n var labelColors = [];\n var labelTextColors = [];\n tooltipPosition = Chart.Tooltip.positioners[opts.position](active, me._eventPosition);\n\n var tooltipItems = [];\n for (i = 0, len = active.length; i < len; ++i) {\n tooltipItems.push(createTooltipItem(active[i]));\n }\n\n // If the user provided a filter function, use it to modify the tooltip items\n if (opts.filter) {\n tooltipItems = tooltipItems.filter(function(a) {\n return opts.filter(a, data);\n });\n }\n\n // If the user provided a sorting function, use it to modify the tooltip items\n if (opts.itemSort) {\n tooltipItems = tooltipItems.sort(function(a, b) {\n return opts.itemSort(a, b, data);\n });\n }\n\n // Determine colors for boxes\n helpers.each(tooltipItems, function(tooltipItem) {\n labelColors.push(opts.callbacks.labelColor.call(me, tooltipItem, me._chart));\n labelTextColors.push(opts.callbacks.labelTextColor.call(me, tooltipItem, me._chart));\n });\n\n\n // Build the Text Lines\n model.title = me.getTitle(tooltipItems, data);\n model.beforeBody = me.getBeforeBody(tooltipItems, data);\n model.body = me.getBody(tooltipItems, data);\n model.afterBody = me.getAfterBody(tooltipItems, data);\n model.footer = me.getFooter(tooltipItems, data);\n\n // Initial positioning and colors\n model.x = Math.round(tooltipPosition.x);\n model.y = Math.round(tooltipPosition.y);\n model.caretPadding = opts.caretPadding;\n model.labelColors = labelColors;\n model.labelTextColors = labelTextColors;\n\n // data points\n model.dataPoints = tooltipItems;\n\n // We need to determine alignment of the tooltip\n tooltipSize = getTooltipSize(this, model);\n alignment = determineAlignment(this, tooltipSize);\n // Final Size and Position\n backgroundPoint = getBackgroundPoint(model, tooltipSize, alignment);\n } else {\n model.opacity = 0;\n }\n\n model.xAlign = alignment.xAlign;\n model.yAlign = alignment.yAlign;\n model.x = backgroundPoint.x;\n model.y = backgroundPoint.y;\n model.width = tooltipSize.width;\n model.height = tooltipSize.height;\n\n // Point where the caret on the tooltip points to\n model.caretX = tooltipPosition.x;\n model.caretY = tooltipPosition.y;\n\n me._model = model;\n\n if (changed && opts.custom) {\n opts.custom.call(me, model);\n }\n\n return me;\n },\n drawCaret: function(tooltipPoint, size) {\n var ctx = this._chart.ctx;\n var vm = this._view;\n var caretPosition = this.getCaretPosition(tooltipPoint, size, vm);\n\n ctx.lineTo(caretPosition.x1, caretPosition.y1);\n ctx.lineTo(caretPosition.x2, caretPosition.y2);\n ctx.lineTo(caretPosition.x3, caretPosition.y3);\n },\n getCaretPosition: function(tooltipPoint, size, vm) {\n var x1, x2, x3, y1, y2, y3;\n var caretSize = vm.caretSize;\n var cornerRadius = vm.cornerRadius;\n var xAlign = vm.xAlign;\n var yAlign = vm.yAlign;\n var ptX = tooltipPoint.x;\n var ptY = tooltipPoint.y;\n var width = size.width;\n var height = size.height;\n\n if (yAlign === 'center') {\n y2 = ptY + (height / 2);\n\n if (xAlign === 'left') {\n x1 = ptX;\n x2 = x1 - caretSize;\n x3 = x1;\n\n y1 = y2 + caretSize;\n y3 = y2 - caretSize;\n } else {\n x1 = ptX + width;\n x2 = x1 + caretSize;\n x3 = x1;\n\n y1 = y2 - caretSize;\n y3 = y2 + caretSize;\n }\n } else {\n if (xAlign === 'left') {\n x2 = ptX + cornerRadius + (caretSize);\n x1 = x2 - caretSize;\n x3 = x2 + caretSize;\n } else if (xAlign === 'right') {\n x2 = ptX + width - cornerRadius - caretSize;\n x1 = x2 - caretSize;\n x3 = x2 + caretSize;\n } else {\n x2 = ptX + (width / 2);\n x1 = x2 - caretSize;\n x3 = x2 + caretSize;\n }\n if (yAlign === 'top') {\n y1 = ptY;\n y2 = y1 - caretSize;\n y3 = y1;\n } else {\n y1 = ptY + height;\n y2 = y1 + caretSize;\n y3 = y1;\n // invert drawing order\n var tmp = x3;\n x3 = x1;\n x1 = tmp;\n }\n }\n return {x1: x1, x2: x2, x3: x3, y1: y1, y2: y2, y3: y3};\n },\n drawTitle: function(pt, vm, ctx, opacity) {\n var title = vm.title;\n\n if (title.length) {\n ctx.textAlign = vm._titleAlign;\n ctx.textBaseline = 'top';\n\n var titleFontSize = vm.titleFontSize;\n var titleSpacing = vm.titleSpacing;\n\n ctx.fillStyle = mergeOpacity(vm.titleFontColor, opacity);\n ctx.font = helpers.fontString(titleFontSize, vm._titleFontStyle, vm._titleFontFamily);\n\n var i, len;\n for (i = 0, len = title.length; i < len; ++i) {\n ctx.fillText(title[i], pt.x, pt.y);\n pt.y += titleFontSize + titleSpacing; // Line Height and spacing\n\n if (i + 1 === title.length) {\n pt.y += vm.titleMarginBottom - titleSpacing; // If Last, add margin, remove spacing\n }\n }\n }\n },\n drawBody: function(pt, vm, ctx, opacity) {\n var bodyFontSize = vm.bodyFontSize;\n var bodySpacing = vm.bodySpacing;\n var body = vm.body;\n\n ctx.textAlign = vm._bodyAlign;\n ctx.textBaseline = 'top';\n ctx.font = helpers.fontString(bodyFontSize, vm._bodyFontStyle, vm._bodyFontFamily);\n\n // Before Body\n var xLinePadding = 0;\n var fillLineOfText = function(line) {\n ctx.fillText(line, pt.x + xLinePadding, pt.y);\n pt.y += bodyFontSize + bodySpacing;\n };\n\n // Before body lines\n helpers.each(vm.beforeBody, fillLineOfText);\n\n var drawColorBoxes = vm.displayColors;\n xLinePadding = drawColorBoxes ? (bodyFontSize + 2) : 0;\n\n // Draw body lines now\n helpers.each(body, function(bodyItem, i) {\n helpers.each(bodyItem.before, fillLineOfText);\n\n helpers.each(bodyItem.lines, function(line) {\n // Draw Legend-like boxes if needed\n if (drawColorBoxes) {\n // Fill a white rect so that colours merge nicely if the opacity is < 1\n ctx.fillStyle = mergeOpacity(vm.legendColorBackground, opacity);\n ctx.fillRect(pt.x, pt.y, bodyFontSize, bodyFontSize);\n\n // Border\n ctx.lineWidth = 1;\n ctx.strokeStyle = mergeOpacity(vm.labelColors[i].borderColor, opacity);\n ctx.strokeRect(pt.x, pt.y, bodyFontSize, bodyFontSize);\n\n // Inner square\n ctx.fillStyle = mergeOpacity(vm.labelColors[i].backgroundColor, opacity);\n ctx.fillRect(pt.x + 1, pt.y + 1, bodyFontSize - 2, bodyFontSize - 2);\n var textColor = mergeOpacity(vm.labelTextColors[i], opacity);\n ctx.fillStyle = textColor;\n }\n\n fillLineOfText(line);\n });\n\n helpers.each(bodyItem.after, fillLineOfText);\n });\n\n // Reset back to 0 for after body\n xLinePadding = 0;\n\n // After body lines\n helpers.each(vm.afterBody, fillLineOfText);\n pt.y -= bodySpacing; // Remove last body spacing\n },\n drawFooter: function(pt, vm, ctx, opacity) {\n var footer = vm.footer;\n\n if (footer.length) {\n pt.y += vm.footerMarginTop;\n\n ctx.textAlign = vm._footerAlign;\n ctx.textBaseline = 'top';\n\n ctx.fillStyle = mergeOpacity(vm.footerFontColor, opacity);\n ctx.font = helpers.fontString(vm.footerFontSize, vm._footerFontStyle, vm._footerFontFamily);\n\n helpers.each(footer, function(line) {\n ctx.fillText(line, pt.x, pt.y);\n pt.y += vm.footerFontSize + vm.footerSpacing;\n });\n }\n },\n drawBackground: function(pt, vm, ctx, tooltipSize, opacity) {\n ctx.fillStyle = mergeOpacity(vm.backgroundColor, opacity);\n ctx.strokeStyle = mergeOpacity(vm.borderColor, opacity);\n ctx.lineWidth = vm.borderWidth;\n var xAlign = vm.xAlign;\n var yAlign = vm.yAlign;\n var x = pt.x;\n var y = pt.y;\n var width = tooltipSize.width;\n var height = tooltipSize.height;\n var radius = vm.cornerRadius;\n\n ctx.beginPath();\n ctx.moveTo(x + radius, y);\n if (yAlign === 'top') {\n this.drawCaret(pt, tooltipSize);\n }\n ctx.lineTo(x + width - radius, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + radius);\n if (yAlign === 'center' && xAlign === 'right') {\n this.drawCaret(pt, tooltipSize);\n }\n ctx.lineTo(x + width, y + height - radius);\n ctx.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);\n if (yAlign === 'bottom') {\n this.drawCaret(pt, tooltipSize);\n }\n ctx.lineTo(x + radius, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - radius);\n if (yAlign === 'center' && xAlign === 'left') {\n this.drawCaret(pt, tooltipSize);\n }\n ctx.lineTo(x, y + radius);\n ctx.quadraticCurveTo(x, y, x + radius, y);\n ctx.closePath();\n\n ctx.fill();\n\n if (vm.borderWidth > 0) {\n ctx.stroke();\n }\n },\n draw: function() {\n var ctx = this._chart.ctx;\n var vm = this._view;\n\n if (vm.opacity === 0) {\n return;\n }\n\n var tooltipSize = {\n width: vm.width,\n height: vm.height\n };\n var pt = {\n x: vm.x,\n y: vm.y\n };\n\n // IE11/Edge does not like very small opacities, so snap to 0\n var opacity = Math.abs(vm.opacity < 1e-3) ? 0 : vm.opacity;\n\n // Truthy/falsey value for empty tooltip\n var hasTooltipContent = vm.title.length || vm.beforeBody.length || vm.body.length || vm.afterBody.length || vm.footer.length;\n\n if (this._options.enabled && hasTooltipContent) {\n // Draw Background\n this.drawBackground(pt, vm, ctx, tooltipSize, opacity);\n\n // Draw Title, Body, and Footer\n pt.x += vm.xPadding;\n pt.y += vm.yPadding;\n\n // Titles\n this.drawTitle(pt, vm, ctx, opacity);\n\n // Body\n this.drawBody(pt, vm, ctx, opacity);\n\n // Footer\n this.drawFooter(pt, vm, ctx, opacity);\n }\n },\n\n /**\n * Handle an event\n * @private\n * @param {IEvent} event - The event to handle\n * @returns {Boolean} true if the tooltip changed\n */\n handleEvent: function(e) {\n var me = this;\n var options = me._options;\n var changed = false;\n\n me._lastActive = me._lastActive || [];\n\n // Find Active Elements for tooltips\n if (e.type === 'mouseout') {\n me._active = [];\n } else {\n me._active = me._chart.getElementsAtEventForMode(e, options.mode, options);\n }\n\n // Remember Last Actives\n changed = !helpers.arrayEquals(me._active, me._lastActive);\n\n // If tooltip didn't change, do not handle the target event\n if (!changed) {\n return false;\n }\n\n me._lastActive = me._active;\n\n if (options.enabled || options.custom) {\n me._eventPosition = {\n x: e.x,\n y: e.y\n };\n\n var model = me._model;\n me.update(true);\n me.pivot();\n\n // See if our tooltip position changed\n changed |= (model.x !== me._model.x) || (model.y !== me._model.y);\n }\n\n return changed;\n }\n });\n\n /**\n * @namespace Chart.Tooltip.positioners\n */\n Chart.Tooltip.positioners = {\n /**\n * Average mode places the tooltip at the average position of the elements shown\n * @function Chart.Tooltip.positioners.average\n * @param elements {ChartElement[]} the elements being displayed in the tooltip\n * @returns {Point} tooltip position\n */\n average: function(elements) {\n if (!elements.length) {\n return false;\n }\n\n var i, len;\n var x = 0;\n var y = 0;\n var count = 0;\n\n for (i = 0, len = elements.length; i < len; ++i) {\n var el = elements[i];\n if (el && el.hasValue()) {\n var pos = el.tooltipPosition();\n x += pos.x;\n y += pos.y;\n ++count;\n }\n }\n\n return {\n x: Math.round(x / count),\n y: Math.round(y / count)\n };\n },\n\n /**\n * Gets the tooltip position nearest of the item nearest to the event position\n * @function Chart.Tooltip.positioners.nearest\n * @param elements {Chart.Element[]} the tooltip elements\n * @param eventPosition {Point} the position of the event in canvas coordinates\n * @returns {Point} the tooltip position\n */\n nearest: function(elements, eventPosition) {\n var x = eventPosition.x;\n var y = eventPosition.y;\n var minDistance = Number.POSITIVE_INFINITY;\n var i, len, nearestElement;\n\n for (i = 0, len = elements.length; i < len; ++i) {\n var el = elements[i];\n if (el && el.hasValue()) {\n var center = el.getCenterPoint();\n var d = helpers.distanceBetweenPoints(eventPosition, center);\n\n if (d < minDistance) {\n minDistance = d;\n nearestElement = el;\n }\n }\n }\n\n if (nearestElement) {\n var tp = nearestElement.tooltipPosition();\n x = tp.x;\n y = tp.y;\n }\n\n return {\n x: x,\n y: y\n };\n }\n };\n };\n\n},{\"25\":25,\"26\":26,\"45\":45}],36:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var Element = require(26);\n var helpers = require(45);\n\n defaults._set('global', {\n elements: {\n arc: {\n backgroundColor: defaults.global.defaultColor,\n borderColor: '#fff',\n borderWidth: 2\n }\n }\n });\n\n module.exports = Element.extend({\n inLabelRange: function(mouseX) {\n var vm = this._view;\n\n if (vm) {\n return (Math.pow(mouseX - vm.x, 2) < Math.pow(vm.radius + vm.hoverRadius, 2));\n }\n return false;\n },\n\n inRange: function(chartX, chartY) {\n var vm = this._view;\n\n if (vm) {\n var pointRelativePosition = helpers.getAngleFromPoint(vm, {x: chartX, y: chartY});\n var\tangle = pointRelativePosition.angle;\n var distance = pointRelativePosition.distance;\n\n // Sanitise angle range\n var startAngle = vm.startAngle;\n var endAngle = vm.endAngle;\n while (endAngle < startAngle) {\n endAngle += 2.0 * Math.PI;\n }\n while (angle > endAngle) {\n angle -= 2.0 * Math.PI;\n }\n while (angle < startAngle) {\n angle += 2.0 * Math.PI;\n }\n\n // Check if within the range of the open/close angle\n var betweenAngles = (angle >= startAngle && angle <= endAngle);\n var withinRadius = (distance >= vm.innerRadius && distance <= vm.outerRadius);\n\n return (betweenAngles && withinRadius);\n }\n return false;\n },\n\n getCenterPoint: function() {\n var vm = this._view;\n var halfAngle = (vm.startAngle + vm.endAngle) / 2;\n var halfRadius = (vm.innerRadius + vm.outerRadius) / 2;\n return {\n x: vm.x + Math.cos(halfAngle) * halfRadius,\n y: vm.y + Math.sin(halfAngle) * halfRadius\n };\n },\n\n getArea: function() {\n var vm = this._view;\n return Math.PI * ((vm.endAngle - vm.startAngle) / (2 * Math.PI)) * (Math.pow(vm.outerRadius, 2) - Math.pow(vm.innerRadius, 2));\n },\n\n tooltipPosition: function() {\n var vm = this._view;\n var centreAngle = vm.startAngle + ((vm.endAngle - vm.startAngle) / 2);\n var rangeFromCentre = (vm.outerRadius - vm.innerRadius) / 2 + vm.innerRadius;\n\n return {\n x: vm.x + (Math.cos(centreAngle) * rangeFromCentre),\n y: vm.y + (Math.sin(centreAngle) * rangeFromCentre)\n };\n },\n\n draw: function() {\n var ctx = this._chart.ctx;\n var vm = this._view;\n var sA = vm.startAngle;\n var eA = vm.endAngle;\n\n ctx.beginPath();\n\n ctx.arc(vm.x, vm.y, vm.outerRadius, sA, eA);\n ctx.arc(vm.x, vm.y, vm.innerRadius, eA, sA, true);\n\n ctx.closePath();\n ctx.strokeStyle = vm.borderColor;\n ctx.lineWidth = vm.borderWidth;\n\n ctx.fillStyle = vm.backgroundColor;\n\n ctx.fill();\n ctx.lineJoin = 'bevel';\n\n if (vm.borderWidth) {\n ctx.stroke();\n }\n }\n });\n\n},{\"25\":25,\"26\":26,\"45\":45}],37:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var Element = require(26);\n var helpers = require(45);\n\n var globalDefaults = defaults.global;\n\n defaults._set('global', {\n elements: {\n line: {\n tension: 0.4,\n backgroundColor: globalDefaults.defaultColor,\n borderWidth: 3,\n borderColor: globalDefaults.defaultColor,\n borderCapStyle: 'butt',\n borderDash: [],\n borderDashOffset: 0.0,\n borderJoinStyle: 'miter',\n capBezierPoints: true,\n fill: true, // do we fill in the area between the line and its base axis\n }\n }\n });\n\n module.exports = Element.extend({\n draw: function() {\n var me = this;\n var vm = me._view;\n var ctx = me._chart.ctx;\n var spanGaps = vm.spanGaps;\n var points = me._children.slice(); // clone array\n var globalOptionLineElements = globalDefaults.elements.line;\n var lastDrawnIndex = -1;\n var index, current, previous, currentVM;\n\n // If we are looping, adding the first point again\n if (me._loop && points.length) {\n points.push(points[0]);\n }\n\n ctx.save();\n\n // Stroke Line Options\n ctx.lineCap = vm.borderCapStyle || globalOptionLineElements.borderCapStyle;\n\n // IE 9 and 10 do not support line dash\n if (ctx.setLineDash) {\n ctx.setLineDash(vm.borderDash || globalOptionLineElements.borderDash);\n }\n\n ctx.lineDashOffset = vm.borderDashOffset || globalOptionLineElements.borderDashOffset;\n ctx.lineJoin = vm.borderJoinStyle || globalOptionLineElements.borderJoinStyle;\n ctx.lineWidth = vm.borderWidth || globalOptionLineElements.borderWidth;\n ctx.strokeStyle = vm.borderColor || globalDefaults.defaultColor;\n\n // Stroke Line\n ctx.beginPath();\n lastDrawnIndex = -1;\n\n for (index = 0; index < points.length; ++index) {\n current = points[index];\n previous = helpers.previousItem(points, index);\n currentVM = current._view;\n\n // First point moves to it's starting position no matter what\n if (index === 0) {\n if (!currentVM.skip) {\n ctx.moveTo(currentVM.x, currentVM.y);\n lastDrawnIndex = index;\n }\n } else {\n previous = lastDrawnIndex === -1 ? previous : points[lastDrawnIndex];\n\n if (!currentVM.skip) {\n if ((lastDrawnIndex !== (index - 1) && !spanGaps) || lastDrawnIndex === -1) {\n // There was a gap and this is the first point after the gap\n ctx.moveTo(currentVM.x, currentVM.y);\n } else {\n // Line to next point\n helpers.canvas.lineTo(ctx, previous._view, current._view);\n }\n lastDrawnIndex = index;\n }\n }\n }\n\n ctx.stroke();\n ctx.restore();\n }\n });\n\n},{\"25\":25,\"26\":26,\"45\":45}],38:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var Element = require(26);\n var helpers = require(45);\n\n var defaultColor = defaults.global.defaultColor;\n\n defaults._set('global', {\n elements: {\n point: {\n radius: 3,\n pointStyle: 'circle',\n backgroundColor: defaultColor,\n borderColor: defaultColor,\n borderWidth: 1,\n // Hover\n hitRadius: 1,\n hoverRadius: 4,\n hoverBorderWidth: 1\n }\n }\n });\n\n function xRange(mouseX) {\n var vm = this._view;\n return vm ? (Math.pow(mouseX - vm.x, 2) < Math.pow(vm.radius + vm.hitRadius, 2)) : false;\n }\n\n function yRange(mouseY) {\n var vm = this._view;\n return vm ? (Math.pow(mouseY - vm.y, 2) < Math.pow(vm.radius + vm.hitRadius, 2)) : false;\n }\n\n module.exports = Element.extend({\n inRange: function(mouseX, mouseY) {\n var vm = this._view;\n return vm ? ((Math.pow(mouseX - vm.x, 2) + Math.pow(mouseY - vm.y, 2)) < Math.pow(vm.hitRadius + vm.radius, 2)) : false;\n },\n\n inLabelRange: xRange,\n inXRange: xRange,\n inYRange: yRange,\n\n getCenterPoint: function() {\n var vm = this._view;\n return {\n x: vm.x,\n y: vm.y\n };\n },\n\n getArea: function() {\n return Math.PI * Math.pow(this._view.radius, 2);\n },\n\n tooltipPosition: function() {\n var vm = this._view;\n return {\n x: vm.x,\n y: vm.y,\n padding: vm.radius + vm.borderWidth\n };\n },\n\n draw: function(chartArea) {\n var vm = this._view;\n var model = this._model;\n var ctx = this._chart.ctx;\n var pointStyle = vm.pointStyle;\n var radius = vm.radius;\n var x = vm.x;\n var y = vm.y;\n var color = helpers.color;\n var errMargin = 1.01; // 1.01 is margin for Accumulated error. (Especially Edge, IE.)\n var ratio = 0;\n\n if (vm.skip) {\n return;\n }\n\n ctx.strokeStyle = vm.borderColor || defaultColor;\n ctx.lineWidth = helpers.valueOrDefault(vm.borderWidth, defaults.global.elements.point.borderWidth);\n ctx.fillStyle = vm.backgroundColor || defaultColor;\n\n // Cliping for Points.\n // going out from inner charArea?\n if ((chartArea !== undefined) && ((model.x < chartArea.left) || (chartArea.right * errMargin < model.x) || (model.y < chartArea.top) || (chartArea.bottom * errMargin < model.y))) {\n // Point fade out\n if (model.x < chartArea.left) {\n ratio = (x - model.x) / (chartArea.left - model.x);\n } else if (chartArea.right * errMargin < model.x) {\n ratio = (model.x - x) / (model.x - chartArea.right);\n } else if (model.y < chartArea.top) {\n ratio = (y - model.y) / (chartArea.top - model.y);\n } else if (chartArea.bottom * errMargin < model.y) {\n ratio = (model.y - y) / (model.y - chartArea.bottom);\n }\n ratio = Math.round(ratio * 100) / 100;\n ctx.strokeStyle = color(ctx.strokeStyle).alpha(ratio).rgbString();\n ctx.fillStyle = color(ctx.fillStyle).alpha(ratio).rgbString();\n }\n\n helpers.canvas.drawPoint(ctx, pointStyle, radius, x, y);\n }\n });\n\n},{\"25\":25,\"26\":26,\"45\":45}],39:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var Element = require(26);\n\n defaults._set('global', {\n elements: {\n rectangle: {\n backgroundColor: defaults.global.defaultColor,\n borderColor: defaults.global.defaultColor,\n borderSkipped: 'bottom',\n borderWidth: 0\n }\n }\n });\n\n function isVertical(bar) {\n return bar._view.width !== undefined;\n }\n\n /**\n * Helper function to get the bounds of the bar regardless of the orientation\n * @param bar {Chart.Element.Rectangle} the bar\n * @return {Bounds} bounds of the bar\n * @private\n */\n function getBarBounds(bar) {\n var vm = bar._view;\n var x1, x2, y1, y2;\n\n if (isVertical(bar)) {\n // vertical\n var halfWidth = vm.width / 2;\n x1 = vm.x - halfWidth;\n x2 = vm.x + halfWidth;\n y1 = Math.min(vm.y, vm.base);\n y2 = Math.max(vm.y, vm.base);\n } else {\n // horizontal bar\n var halfHeight = vm.height / 2;\n x1 = Math.min(vm.x, vm.base);\n x2 = Math.max(vm.x, vm.base);\n y1 = vm.y - halfHeight;\n y2 = vm.y + halfHeight;\n }\n\n return {\n left: x1,\n top: y1,\n right: x2,\n bottom: y2\n };\n }\n\n module.exports = Element.extend({\n draw: function() {\n var ctx = this._chart.ctx;\n var vm = this._view;\n var left, right, top, bottom, signX, signY, borderSkipped;\n var borderWidth = vm.borderWidth;\n\n if (!vm.horizontal) {\n // bar\n left = vm.x - vm.width / 2;\n right = vm.x + vm.width / 2;\n top = vm.y;\n bottom = vm.base;\n signX = 1;\n signY = bottom > top ? 1 : -1;\n borderSkipped = vm.borderSkipped || 'bottom';\n } else {\n // horizontal bar\n left = vm.base;\n right = vm.x;\n top = vm.y - vm.height / 2;\n bottom = vm.y + vm.height / 2;\n signX = right > left ? 1 : -1;\n signY = 1;\n borderSkipped = vm.borderSkipped || 'left';\n }\n\n // Canvas doesn't allow us to stroke inside the width so we can\n // adjust the sizes to fit if we're setting a stroke on the line\n if (borderWidth) {\n // borderWidth shold be less than bar width and bar height.\n var barSize = Math.min(Math.abs(left - right), Math.abs(top - bottom));\n borderWidth = borderWidth > barSize ? barSize : borderWidth;\n var halfStroke = borderWidth / 2;\n // Adjust borderWidth when bar top position is near vm.base(zero).\n var borderLeft = left + (borderSkipped !== 'left' ? halfStroke * signX : 0);\n var borderRight = right + (borderSkipped !== 'right' ? -halfStroke * signX : 0);\n var borderTop = top + (borderSkipped !== 'top' ? halfStroke * signY : 0);\n var borderBottom = bottom + (borderSkipped !== 'bottom' ? -halfStroke * signY : 0);\n // not become a vertical line?\n if (borderLeft !== borderRight) {\n top = borderTop;\n bottom = borderBottom;\n }\n // not become a horizontal line?\n if (borderTop !== borderBottom) {\n left = borderLeft;\n right = borderRight;\n }\n }\n\n ctx.beginPath();\n ctx.fillStyle = vm.backgroundColor;\n ctx.strokeStyle = vm.borderColor;\n ctx.lineWidth = borderWidth;\n\n // Corner points, from bottom-left to bottom-right clockwise\n // | 1 2 |\n // | 0 3 |\n var corners = [\n [left, bottom],\n [left, top],\n [right, top],\n [right, bottom]\n ];\n\n // Find first (starting) corner with fallback to 'bottom'\n var borders = ['bottom', 'left', 'top', 'right'];\n var startCorner = borders.indexOf(borderSkipped, 0);\n if (startCorner === -1) {\n startCorner = 0;\n }\n\n function cornerAt(index) {\n return corners[(startCorner + index) % 4];\n }\n\n // Draw rectangle from 'startCorner'\n var corner = cornerAt(0);\n ctx.moveTo(corner[0], corner[1]);\n\n for (var i = 1; i < 4; i++) {\n corner = cornerAt(i);\n ctx.lineTo(corner[0], corner[1]);\n }\n\n ctx.fill();\n if (borderWidth) {\n ctx.stroke();\n }\n },\n\n height: function() {\n var vm = this._view;\n return vm.base - vm.y;\n },\n\n inRange: function(mouseX, mouseY) {\n var inRange = false;\n\n if (this._view) {\n var bounds = getBarBounds(this);\n inRange = mouseX >= bounds.left && mouseX <= bounds.right && mouseY >= bounds.top && mouseY <= bounds.bottom;\n }\n\n return inRange;\n },\n\n inLabelRange: function(mouseX, mouseY) {\n var me = this;\n if (!me._view) {\n return false;\n }\n\n var inRange = false;\n var bounds = getBarBounds(me);\n\n if (isVertical(me)) {\n inRange = mouseX >= bounds.left && mouseX <= bounds.right;\n } else {\n inRange = mouseY >= bounds.top && mouseY <= bounds.bottom;\n }\n\n return inRange;\n },\n\n inXRange: function(mouseX) {\n var bounds = getBarBounds(this);\n return mouseX >= bounds.left && mouseX <= bounds.right;\n },\n\n inYRange: function(mouseY) {\n var bounds = getBarBounds(this);\n return mouseY >= bounds.top && mouseY <= bounds.bottom;\n },\n\n getCenterPoint: function() {\n var vm = this._view;\n var x, y;\n if (isVertical(this)) {\n x = vm.x;\n y = (vm.y + vm.base) / 2;\n } else {\n x = (vm.x + vm.base) / 2;\n y = vm.y;\n }\n\n return {x: x, y: y};\n },\n\n getArea: function() {\n var vm = this._view;\n return vm.width * Math.abs(vm.y - vm.base);\n },\n\n tooltipPosition: function() {\n var vm = this._view;\n return {\n x: vm.x,\n y: vm.y\n };\n }\n });\n\n},{\"25\":25,\"26\":26}],40:[function(require,module,exports){\n 'use strict';\n\n module.exports = {};\n module.exports.Arc = require(36);\n module.exports.Line = require(37);\n module.exports.Point = require(38);\n module.exports.Rectangle = require(39);\n\n},{\"36\":36,\"37\":37,\"38\":38,\"39\":39}],41:[function(require,module,exports){\n 'use strict';\n\n var helpers = require(42);\n\n /**\n * @namespace Chart.helpers.canvas\n */\n var exports = module.exports = {\n /**\n * Clears the entire canvas associated to the given `chart`.\n * @param {Chart} chart - The chart for which to clear the canvas.\n */\n clear: function(chart) {\n chart.ctx.clearRect(0, 0, chart.width, chart.height);\n },\n\n /**\n * Creates a \"path\" for a rectangle with rounded corners at position (x, y) with a\n * given size (width, height) and the same `radius` for all corners.\n * @param {CanvasRenderingContext2D} ctx - The canvas 2D Context.\n * @param {Number} x - The x axis of the coordinate for the rectangle starting point.\n * @param {Number} y - The y axis of the coordinate for the rectangle starting point.\n * @param {Number} width - The rectangle's width.\n * @param {Number} height - The rectangle's height.\n * @param {Number} radius - The rounded amount (in pixels) for the four corners.\n * @todo handle `radius` as top-left, top-right, bottom-right, bottom-left array/object?\n */\n roundedRect: function(ctx, x, y, width, height, radius) {\n if (radius) {\n var rx = Math.min(radius, width / 2);\n var ry = Math.min(radius, height / 2);\n\n ctx.moveTo(x + rx, y);\n ctx.lineTo(x + width - rx, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + ry);\n ctx.lineTo(x + width, y + height - ry);\n ctx.quadraticCurveTo(x + width, y + height, x + width - rx, y + height);\n ctx.lineTo(x + rx, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - ry);\n ctx.lineTo(x, y + ry);\n ctx.quadraticCurveTo(x, y, x + rx, y);\n } else {\n ctx.rect(x, y, width, height);\n }\n },\n\n drawPoint: function(ctx, style, radius, x, y) {\n var type, edgeLength, xOffset, yOffset, height, size;\n\n if (typeof style === 'object') {\n type = style.toString();\n if (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') {\n ctx.drawImage(style, x - style.width / 2, y - style.height / 2, style.width, style.height);\n return;\n }\n }\n\n if (isNaN(radius) || radius <= 0) {\n return;\n }\n\n switch (style) {\n // Default includes circle\n default:\n ctx.beginPath();\n ctx.arc(x, y, radius, 0, Math.PI * 2);\n ctx.closePath();\n ctx.fill();\n break;\n case 'triangle':\n ctx.beginPath();\n edgeLength = 3 * radius / Math.sqrt(3);\n height = edgeLength * Math.sqrt(3) / 2;\n ctx.moveTo(x - edgeLength / 2, y + height / 3);\n ctx.lineTo(x + edgeLength / 2, y + height / 3);\n ctx.lineTo(x, y - 2 * height / 3);\n ctx.closePath();\n ctx.fill();\n break;\n case 'rect':\n size = 1 / Math.SQRT2 * radius;\n ctx.beginPath();\n ctx.fillRect(x - size, y - size, 2 * size, 2 * size);\n ctx.strokeRect(x - size, y - size, 2 * size, 2 * size);\n break;\n case 'rectRounded':\n var offset = radius / Math.SQRT2;\n var leftX = x - offset;\n var topY = y - offset;\n var sideSize = Math.SQRT2 * radius;\n ctx.beginPath();\n this.roundedRect(ctx, leftX, topY, sideSize, sideSize, radius / 2);\n ctx.closePath();\n ctx.fill();\n break;\n case 'rectRot':\n size = 1 / Math.SQRT2 * radius;\n ctx.beginPath();\n ctx.moveTo(x - size, y);\n ctx.lineTo(x, y + size);\n ctx.lineTo(x + size, y);\n ctx.lineTo(x, y - size);\n ctx.closePath();\n ctx.fill();\n break;\n case 'cross':\n ctx.beginPath();\n ctx.moveTo(x, y + radius);\n ctx.lineTo(x, y - radius);\n ctx.moveTo(x - radius, y);\n ctx.lineTo(x + radius, y);\n ctx.closePath();\n break;\n case 'crossRot':\n ctx.beginPath();\n xOffset = Math.cos(Math.PI / 4) * radius;\n yOffset = Math.sin(Math.PI / 4) * radius;\n ctx.moveTo(x - xOffset, y - yOffset);\n ctx.lineTo(x + xOffset, y + yOffset);\n ctx.moveTo(x - xOffset, y + yOffset);\n ctx.lineTo(x + xOffset, y - yOffset);\n ctx.closePath();\n break;\n case 'star':\n ctx.beginPath();\n ctx.moveTo(x, y + radius);\n ctx.lineTo(x, y - radius);\n ctx.moveTo(x - radius, y);\n ctx.lineTo(x + radius, y);\n xOffset = Math.cos(Math.PI / 4) * radius;\n yOffset = Math.sin(Math.PI / 4) * radius;\n ctx.moveTo(x - xOffset, y - yOffset);\n ctx.lineTo(x + xOffset, y + yOffset);\n ctx.moveTo(x - xOffset, y + yOffset);\n ctx.lineTo(x + xOffset, y - yOffset);\n ctx.closePath();\n break;\n case 'line':\n ctx.beginPath();\n ctx.moveTo(x - radius, y);\n ctx.lineTo(x + radius, y);\n ctx.closePath();\n break;\n case 'dash':\n ctx.beginPath();\n ctx.moveTo(x, y);\n ctx.lineTo(x + radius, y);\n ctx.closePath();\n break;\n }\n\n ctx.stroke();\n },\n\n clipArea: function(ctx, area) {\n ctx.save();\n ctx.beginPath();\n ctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);\n ctx.clip();\n },\n\n unclipArea: function(ctx) {\n ctx.restore();\n },\n\n lineTo: function(ctx, previous, target, flip) {\n if (target.steppedLine) {\n if ((target.steppedLine === 'after' && !flip) || (target.steppedLine !== 'after' && flip)) {\n ctx.lineTo(previous.x, target.y);\n } else {\n ctx.lineTo(target.x, previous.y);\n }\n ctx.lineTo(target.x, target.y);\n return;\n }\n\n if (!target.tension) {\n ctx.lineTo(target.x, target.y);\n return;\n }\n\n ctx.bezierCurveTo(\n flip ? previous.controlPointPreviousX : previous.controlPointNextX,\n flip ? previous.controlPointPreviousY : previous.controlPointNextY,\n flip ? target.controlPointNextX : target.controlPointPreviousX,\n flip ? target.controlPointNextY : target.controlPointPreviousY,\n target.x,\n target.y);\n }\n };\n\n// DEPRECATIONS\n\n /**\n * Provided for backward compatibility, use Chart.helpers.canvas.clear instead.\n * @namespace Chart.helpers.clear\n * @deprecated since version 2.7.0\n * @todo remove at version 3\n * @private\n */\n helpers.clear = exports.clear;\n\n /**\n * Provided for backward compatibility, use Chart.helpers.canvas.roundedRect instead.\n * @namespace Chart.helpers.drawRoundedRectangle\n * @deprecated since version 2.7.0\n * @todo remove at version 3\n * @private\n */\n helpers.drawRoundedRectangle = function(ctx) {\n ctx.beginPath();\n exports.roundedRect.apply(exports, arguments);\n ctx.closePath();\n };\n\n},{\"42\":42}],42:[function(require,module,exports){\n 'use strict';\n\n /**\n * @namespace Chart.helpers\n */\n var helpers = {\n /**\n * An empty function that can be used, for example, for optional callback.\n */\n noop: function() {},\n\n /**\n * Returns a unique id, sequentially generated from a global variable.\n * @returns {Number}\n * @function\n */\n uid: (function() {\n var id = 0;\n return function() {\n return id++;\n };\n }()),\n\n /**\n * Returns true if `value` is neither null nor undefined, else returns false.\n * @param {*} value - The value to test.\n * @returns {Boolean}\n * @since 2.7.0\n */\n isNullOrUndef: function(value) {\n return value === null || typeof value === 'undefined';\n },\n\n /**\n * Returns true if `value` is an array, else returns false.\n * @param {*} value - The value to test.\n * @returns {Boolean}\n * @function\n */\n isArray: Array.isArray ? Array.isArray : function(value) {\n return Object.prototype.toString.call(value) === '[object Array]';\n },\n\n /**\n * Returns true if `value` is an object (excluding null), else returns false.\n * @param {*} value - The value to test.\n * @returns {Boolean}\n * @since 2.7.0\n */\n isObject: function(value) {\n return value !== null && Object.prototype.toString.call(value) === '[object Object]';\n },\n\n /**\n * Returns `value` if defined, else returns `defaultValue`.\n * @param {*} value - The value to return if defined.\n * @param {*} defaultValue - The value to return if `value` is undefined.\n * @returns {*}\n */\n valueOrDefault: function(value, defaultValue) {\n return typeof value === 'undefined' ? defaultValue : value;\n },\n\n /**\n * Returns value at the given `index` in array if defined, else returns `defaultValue`.\n * @param {Array} value - The array to lookup for value at `index`.\n * @param {Number} index - The index in `value` to lookup for value.\n * @param {*} defaultValue - The value to return if `value[index]` is undefined.\n * @returns {*}\n */\n valueAtIndexOrDefault: function(value, index, defaultValue) {\n return helpers.valueOrDefault(helpers.isArray(value) ? value[index] : value, defaultValue);\n },\n\n /**\n * Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the\n * value returned by `fn`. If `fn` is not a function, this method returns undefined.\n * @param {Function} fn - The function to call.\n * @param {Array|undefined|null} args - The arguments with which `fn` should be called.\n * @param {Object} [thisArg] - The value of `this` provided for the call to `fn`.\n * @returns {*}\n */\n callback: function(fn, args, thisArg) {\n if (fn && typeof fn.call === 'function') {\n return fn.apply(thisArg, args);\n }\n },\n\n /**\n * Note(SB) for performance sake, this method should only be used when loopable type\n * is unknown or in none intensive code (not called often and small loopable). Else\n * it's preferable to use a regular for() loop and save extra function calls.\n * @param {Object|Array} loopable - The object or array to be iterated.\n * @param {Function} fn - The function to call for each item.\n * @param {Object} [thisArg] - The value of `this` provided for the call to `fn`.\n * @param {Boolean} [reverse] - If true, iterates backward on the loopable.\n */\n each: function(loopable, fn, thisArg, reverse) {\n var i, len, keys;\n if (helpers.isArray(loopable)) {\n len = loopable.length;\n if (reverse) {\n for (i = len - 1; i >= 0; i--) {\n fn.call(thisArg, loopable[i], i);\n }\n } else {\n for (i = 0; i < len; i++) {\n fn.call(thisArg, loopable[i], i);\n }\n }\n } else if (helpers.isObject(loopable)) {\n keys = Object.keys(loopable);\n len = keys.length;\n for (i = 0; i < len; i++) {\n fn.call(thisArg, loopable[keys[i]], keys[i]);\n }\n }\n },\n\n /**\n * Returns true if the `a0` and `a1` arrays have the same content, else returns false.\n * @see http://stackoverflow.com/a/14853974\n * @param {Array} a0 - The array to compare\n * @param {Array} a1 - The array to compare\n * @returns {Boolean}\n */\n arrayEquals: function(a0, a1) {\n var i, ilen, v0, v1;\n\n if (!a0 || !a1 || a0.length !== a1.length) {\n return false;\n }\n\n for (i = 0, ilen = a0.length; i < ilen; ++i) {\n v0 = a0[i];\n v1 = a1[i];\n\n if (v0 instanceof Array && v1 instanceof Array) {\n if (!helpers.arrayEquals(v0, v1)) {\n return false;\n }\n } else if (v0 !== v1) {\n // NOTE: two different object instances will never be equal: {x:20} != {x:20}\n return false;\n }\n }\n\n return true;\n },\n\n /**\n * Returns a deep copy of `source` without keeping references on objects and arrays.\n * @param {*} source - The value to clone.\n * @returns {*}\n */\n clone: function(source) {\n if (helpers.isArray(source)) {\n return source.map(helpers.clone);\n }\n\n if (helpers.isObject(source)) {\n var target = {};\n var keys = Object.keys(source);\n var klen = keys.length;\n var k = 0;\n\n for (; k < klen; ++k) {\n target[keys[k]] = helpers.clone(source[keys[k]]);\n }\n\n return target;\n }\n\n return source;\n },\n\n /**\n * The default merger when Chart.helpers.merge is called without merger option.\n * Note(SB): this method is also used by configMerge and scaleMerge as fallback.\n * @private\n */\n _merger: function(key, target, source, options) {\n var tval = target[key];\n var sval = source[key];\n\n if (helpers.isObject(tval) && helpers.isObject(sval)) {\n helpers.merge(tval, sval, options);\n } else {\n target[key] = helpers.clone(sval);\n }\n },\n\n /**\n * Merges source[key] in target[key] only if target[key] is undefined.\n * @private\n */\n _mergerIf: function(key, target, source) {\n var tval = target[key];\n var sval = source[key];\n\n if (helpers.isObject(tval) && helpers.isObject(sval)) {\n helpers.mergeIf(tval, sval);\n } else if (!target.hasOwnProperty(key)) {\n target[key] = helpers.clone(sval);\n }\n },\n\n /**\n * Recursively deep copies `source` properties into `target` with the given `options`.\n * IMPORTANT: `target` is not cloned and will be updated with `source` properties.\n * @param {Object} target - The target object in which all sources are merged into.\n * @param {Object|Array(Object)} source - Object(s) to merge into `target`.\n * @param {Object} [options] - Merging options:\n * @param {Function} [options.merger] - The merge method (key, target, source, options)\n * @returns {Object} The `target` object.\n */\n merge: function(target, source, options) {\n var sources = helpers.isArray(source) ? source : [source];\n var ilen = sources.length;\n var merge, i, keys, klen, k;\n\n if (!helpers.isObject(target)) {\n return target;\n }\n\n options = options || {};\n merge = options.merger || helpers._merger;\n\n for (i = 0; i < ilen; ++i) {\n source = sources[i];\n if (!helpers.isObject(source)) {\n continue;\n }\n\n keys = Object.keys(source);\n for (k = 0, klen = keys.length; k < klen; ++k) {\n merge(keys[k], target, source, options);\n }\n }\n\n return target;\n },\n\n /**\n * Recursively deep copies `source` properties into `target` *only* if not defined in target.\n * IMPORTANT: `target` is not cloned and will be updated with `source` properties.\n * @param {Object} target - The target object in which all sources are merged into.\n * @param {Object|Array(Object)} source - Object(s) to merge into `target`.\n * @returns {Object} The `target` object.\n */\n mergeIf: function(target, source) {\n return helpers.merge(target, source, {merger: helpers._mergerIf});\n }\n };\n\n module.exports = helpers;\n\n// DEPRECATIONS\n\n /**\n * Provided for backward compatibility, use Chart.helpers.callback instead.\n * @function Chart.helpers.callCallback\n * @deprecated since version 2.6.0\n * @todo remove at version 3\n * @private\n */\n helpers.callCallback = helpers.callback;\n\n /**\n * Provided for backward compatibility, use Array.prototype.indexOf instead.\n * Array.prototype.indexOf compatibility: Chrome, Opera, Safari, FF1.5+, IE9+\n * @function Chart.helpers.indexOf\n * @deprecated since version 2.7.0\n * @todo remove at version 3\n * @private\n */\n helpers.indexOf = function(array, item, fromIndex) {\n return Array.prototype.indexOf.call(array, item, fromIndex);\n };\n\n /**\n * Provided for backward compatibility, use Chart.helpers.valueOrDefault instead.\n * @function Chart.helpers.getValueOrDefault\n * @deprecated since version 2.7.0\n * @todo remove at version 3\n * @private\n */\n helpers.getValueOrDefault = helpers.valueOrDefault;\n\n /**\n * Provided for backward compatibility, use Chart.helpers.valueAtIndexOrDefault instead.\n * @function Chart.helpers.getValueAtIndexOrDefault\n * @deprecated since version 2.7.0\n * @todo remove at version 3\n * @private\n */\n helpers.getValueAtIndexOrDefault = helpers.valueAtIndexOrDefault;\n\n},{}],43:[function(require,module,exports){\n 'use strict';\n\n var helpers = require(42);\n\n /**\n * Easing functions adapted from Robert Penner's easing equations.\n * @namespace Chart.helpers.easingEffects\n * @see http://www.robertpenner.com/easing/\n */\n var effects = {\n linear: function(t) {\n return t;\n },\n\n easeInQuad: function(t) {\n return t * t;\n },\n\n easeOutQuad: function(t) {\n return -t * (t - 2);\n },\n\n easeInOutQuad: function(t) {\n if ((t /= 0.5) < 1) {\n return 0.5 * t * t;\n }\n return -0.5 * ((--t) * (t - 2) - 1);\n },\n\n easeInCubic: function(t) {\n return t * t * t;\n },\n\n easeOutCubic: function(t) {\n return (t = t - 1) * t * t + 1;\n },\n\n easeInOutCubic: function(t) {\n if ((t /= 0.5) < 1) {\n return 0.5 * t * t * t;\n }\n return 0.5 * ((t -= 2) * t * t + 2);\n },\n\n easeInQuart: function(t) {\n return t * t * t * t;\n },\n\n easeOutQuart: function(t) {\n return -((t = t - 1) * t * t * t - 1);\n },\n\n easeInOutQuart: function(t) {\n if ((t /= 0.5) < 1) {\n return 0.5 * t * t * t * t;\n }\n return -0.5 * ((t -= 2) * t * t * t - 2);\n },\n\n easeInQuint: function(t) {\n return t * t * t * t * t;\n },\n\n easeOutQuint: function(t) {\n return (t = t - 1) * t * t * t * t + 1;\n },\n\n easeInOutQuint: function(t) {\n if ((t /= 0.5) < 1) {\n return 0.5 * t * t * t * t * t;\n }\n return 0.5 * ((t -= 2) * t * t * t * t + 2);\n },\n\n easeInSine: function(t) {\n return -Math.cos(t * (Math.PI / 2)) + 1;\n },\n\n easeOutSine: function(t) {\n return Math.sin(t * (Math.PI / 2));\n },\n\n easeInOutSine: function(t) {\n return -0.5 * (Math.cos(Math.PI * t) - 1);\n },\n\n easeInExpo: function(t) {\n return (t === 0) ? 0 : Math.pow(2, 10 * (t - 1));\n },\n\n easeOutExpo: function(t) {\n return (t === 1) ? 1 : -Math.pow(2, -10 * t) + 1;\n },\n\n easeInOutExpo: function(t) {\n if (t === 0) {\n return 0;\n }\n if (t === 1) {\n return 1;\n }\n if ((t /= 0.5) < 1) {\n return 0.5 * Math.pow(2, 10 * (t - 1));\n }\n return 0.5 * (-Math.pow(2, -10 * --t) + 2);\n },\n\n easeInCirc: function(t) {\n if (t >= 1) {\n return t;\n }\n return -(Math.sqrt(1 - t * t) - 1);\n },\n\n easeOutCirc: function(t) {\n return Math.sqrt(1 - (t = t - 1) * t);\n },\n\n easeInOutCirc: function(t) {\n if ((t /= 0.5) < 1) {\n return -0.5 * (Math.sqrt(1 - t * t) - 1);\n }\n return 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1);\n },\n\n easeInElastic: function(t) {\n var s = 1.70158;\n var p = 0;\n var a = 1;\n if (t === 0) {\n return 0;\n }\n if (t === 1) {\n return 1;\n }\n if (!p) {\n p = 0.3;\n }\n if (a < 1) {\n a = 1;\n s = p / 4;\n } else {\n s = p / (2 * Math.PI) * Math.asin(1 / a);\n }\n return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * (2 * Math.PI) / p));\n },\n\n easeOutElastic: function(t) {\n var s = 1.70158;\n var p = 0;\n var a = 1;\n if (t === 0) {\n return 0;\n }\n if (t === 1) {\n return 1;\n }\n if (!p) {\n p = 0.3;\n }\n if (a < 1) {\n a = 1;\n s = p / 4;\n } else {\n s = p / (2 * Math.PI) * Math.asin(1 / a);\n }\n return a * Math.pow(2, -10 * t) * Math.sin((t - s) * (2 * Math.PI) / p) + 1;\n },\n\n easeInOutElastic: function(t) {\n var s = 1.70158;\n var p = 0;\n var a = 1;\n if (t === 0) {\n return 0;\n }\n if ((t /= 0.5) === 2) {\n return 1;\n }\n if (!p) {\n p = 0.45;\n }\n if (a < 1) {\n a = 1;\n s = p / 4;\n } else {\n s = p / (2 * Math.PI) * Math.asin(1 / a);\n }\n if (t < 1) {\n return -0.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * (2 * Math.PI) / p));\n }\n return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t - s) * (2 * Math.PI) / p) * 0.5 + 1;\n },\n easeInBack: function(t) {\n var s = 1.70158;\n return t * t * ((s + 1) * t - s);\n },\n\n easeOutBack: function(t) {\n var s = 1.70158;\n return (t = t - 1) * t * ((s + 1) * t + s) + 1;\n },\n\n easeInOutBack: function(t) {\n var s = 1.70158;\n if ((t /= 0.5) < 1) {\n return 0.5 * (t * t * (((s *= (1.525)) + 1) * t - s));\n }\n return 0.5 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2);\n },\n\n easeInBounce: function(t) {\n return 1 - effects.easeOutBounce(1 - t);\n },\n\n easeOutBounce: function(t) {\n if (t < (1 / 2.75)) {\n return 7.5625 * t * t;\n }\n if (t < (2 / 2.75)) {\n return 7.5625 * (t -= (1.5 / 2.75)) * t + 0.75;\n }\n if (t < (2.5 / 2.75)) {\n return 7.5625 * (t -= (2.25 / 2.75)) * t + 0.9375;\n }\n return 7.5625 * (t -= (2.625 / 2.75)) * t + 0.984375;\n },\n\n easeInOutBounce: function(t) {\n if (t < 0.5) {\n return effects.easeInBounce(t * 2) * 0.5;\n }\n return effects.easeOutBounce(t * 2 - 1) * 0.5 + 0.5;\n }\n };\n\n module.exports = {\n effects: effects\n };\n\n// DEPRECATIONS\n\n /**\n * Provided for backward compatibility, use Chart.helpers.easing.effects instead.\n * @function Chart.helpers.easingEffects\n * @deprecated since version 2.7.0\n * @todo remove at version 3\n * @private\n */\n helpers.easingEffects = effects;\n\n},{\"42\":42}],44:[function(require,module,exports){\n 'use strict';\n\n var helpers = require(42);\n\n /**\n * @alias Chart.helpers.options\n * @namespace\n */\n module.exports = {\n /**\n * Converts the given line height `value` in pixels for a specific font `size`.\n * @param {Number|String} value - The lineHeight to parse (eg. 1.6, '14px', '75%', '1.6em').\n * @param {Number} size - The font size (in pixels) used to resolve relative `value`.\n * @returns {Number} The effective line height in pixels (size * 1.2 if value is invalid).\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height\n * @since 2.7.0\n */\n toLineHeight: function(value, size) {\n var matches = ('' + value).match(/^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/);\n if (!matches || matches[1] === 'normal') {\n return size * 1.2;\n }\n\n value = +matches[2];\n\n switch (matches[3]) {\n case 'px':\n return value;\n case '%':\n value /= 100;\n break;\n default:\n break;\n }\n\n return size * value;\n },\n\n /**\n * Converts the given value into a padding object with pre-computed width/height.\n * @param {Number|Object} value - If a number, set the value to all TRBL component,\n * else, if and object, use defined properties and sets undefined ones to 0.\n * @returns {Object} The padding values (top, right, bottom, left, width, height)\n * @since 2.7.0\n */\n toPadding: function(value) {\n var t, r, b, l;\n\n if (helpers.isObject(value)) {\n t = +value.top || 0;\n r = +value.right || 0;\n b = +value.bottom || 0;\n l = +value.left || 0;\n } else {\n t = r = b = l = +value || 0;\n }\n\n return {\n top: t,\n right: r,\n bottom: b,\n left: l,\n height: t + b,\n width: l + r\n };\n },\n\n /**\n * Evaluates the given `inputs` sequentially and returns the first defined value.\n * @param {Array[]} inputs - An array of values, falling back to the last value.\n * @param {Object} [context] - If defined and the current value is a function, the value\n * is called with `context` as first argument and the result becomes the new input.\n * @param {Number} [index] - If defined and the current value is an array, the value\n * at `index` become the new input.\n * @since 2.7.0\n */\n resolve: function(inputs, context, index) {\n var i, ilen, value;\n\n for (i = 0, ilen = inputs.length; i < ilen; ++i) {\n value = inputs[i];\n if (value === undefined) {\n continue;\n }\n if (context !== undefined && typeof value === 'function') {\n value = value(context);\n }\n if (index !== undefined && helpers.isArray(value)) {\n value = value[index];\n }\n if (value !== undefined) {\n return value;\n }\n }\n }\n };\n\n},{\"42\":42}],45:[function(require,module,exports){\n 'use strict';\n\n module.exports = require(42);\n module.exports.easing = require(43);\n module.exports.canvas = require(41);\n module.exports.options = require(44);\n\n},{\"41\":41,\"42\":42,\"43\":43,\"44\":44}],46:[function(require,module,exports){\n /**\n * Platform fallback implementation (minimal).\n * @see https://github.com/chartjs/Chart.js/pull/4591#issuecomment-319575939\n */\n\n module.exports = {\n acquireContext: function(item) {\n if (item && item.canvas) {\n // Support for any object associated to a canvas (including a context2d)\n item = item.canvas;\n }\n\n return item && item.getContext('2d') || null;\n }\n };\n\n},{}],47:[function(require,module,exports){\n /**\n * Chart.Platform implementation for targeting a web browser\n */\n\n 'use strict';\n\n var helpers = require(45);\n\n var EXPANDO_KEY = '$chartjs';\n var CSS_PREFIX = 'chartjs-';\n var CSS_RENDER_MONITOR = CSS_PREFIX + 'render-monitor';\n var CSS_RENDER_ANIMATION = CSS_PREFIX + 'render-animation';\n var ANIMATION_START_EVENTS = ['animationstart', 'webkitAnimationStart'];\n\n /**\n * DOM event types -> Chart.js event types.\n * Note: only events with different types are mapped.\n * @see https://developer.mozilla.org/en-US/docs/Web/Events\n */\n var EVENT_TYPES = {\n touchstart: 'mousedown',\n touchmove: 'mousemove',\n touchend: 'mouseup',\n pointerenter: 'mouseenter',\n pointerdown: 'mousedown',\n pointermove: 'mousemove',\n pointerup: 'mouseup',\n pointerleave: 'mouseout',\n pointerout: 'mouseout'\n };\n\n /**\n * The \"used\" size is the final value of a dimension property after all calculations have\n * been performed. This method uses the computed style of `element` but returns undefined\n * if the computed style is not expressed in pixels. That can happen in some cases where\n * `element` has a size relative to its parent and this last one is not yet displayed,\n * for example because of `display: none` on a parent node.\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value\n * @returns {Number} Size in pixels or undefined if unknown.\n */\n function readUsedSize(element, property) {\n var value = helpers.getStyle(element, property);\n var matches = value && value.match(/^(\\d+)(\\.\\d+)?px$/);\n return matches ? Number(matches[1]) : undefined;\n }\n\n /**\n * Initializes the canvas style and render size without modifying the canvas display size,\n * since responsiveness is handled by the controller.resize() method. The config is used\n * to determine the aspect ratio to apply in case no explicit height has been specified.\n */\n function initCanvas(canvas, config) {\n var style = canvas.style;\n\n // NOTE(SB) canvas.getAttribute('width') !== canvas.width: in the first case it\n // returns null or '' if no explicit value has been set to the canvas attribute.\n var renderHeight = canvas.getAttribute('height');\n var renderWidth = canvas.getAttribute('width');\n\n // Chart.js modifies some canvas values that we want to restore on destroy\n canvas[EXPANDO_KEY] = {\n initial: {\n height: renderHeight,\n width: renderWidth,\n style: {\n display: style.display,\n height: style.height,\n width: style.width\n }\n }\n };\n\n // Force canvas to display as block to avoid extra space caused by inline\n // elements, which would interfere with the responsive resize process.\n // https://github.com/chartjs/Chart.js/issues/2538\n style.display = style.display || 'block';\n\n if (renderWidth === null || renderWidth === '') {\n var displayWidth = readUsedSize(canvas, 'width');\n if (displayWidth !== undefined) {\n canvas.width = displayWidth;\n }\n }\n\n if (renderHeight === null || renderHeight === '') {\n if (canvas.style.height === '') {\n // If no explicit render height and style height, let's apply the aspect ratio,\n // which one can be specified by the user but also by charts as default option\n // (i.e. options.aspectRatio). If not specified, use canvas aspect ratio of 2.\n canvas.height = canvas.width / (config.options.aspectRatio || 2);\n } else {\n var displayHeight = readUsedSize(canvas, 'height');\n if (displayWidth !== undefined) {\n canvas.height = displayHeight;\n }\n }\n }\n\n return canvas;\n }\n\n /**\n * Detects support for options object argument in addEventListener.\n * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support\n * @private\n */\n var supportsEventListenerOptions = (function() {\n var supports = false;\n try {\n var options = Object.defineProperty({}, 'passive', {\n get: function() {\n supports = true;\n }\n });\n window.addEventListener('e', null, options);\n } catch (e) {\n // continue regardless of error\n }\n return supports;\n }());\n\n// Default passive to true as expected by Chrome for 'touchstart' and 'touchend' events.\n// https://github.com/chartjs/Chart.js/issues/4287\n var eventListenerOptions = supportsEventListenerOptions ? {passive: true} : false;\n\n function addEventListener(node, type, listener) {\n node.addEventListener(type, listener, eventListenerOptions);\n }\n\n function removeEventListener(node, type, listener) {\n node.removeEventListener(type, listener, eventListenerOptions);\n }\n\n function createEvent(type, chart, x, y, nativeEvent) {\n return {\n type: type,\n chart: chart,\n native: nativeEvent || null,\n x: x !== undefined ? x : null,\n y: y !== undefined ? y : null,\n };\n }\n\n function fromNativeEvent(event, chart) {\n var type = EVENT_TYPES[event.type] || event.type;\n var pos = helpers.getRelativePosition(event, chart);\n return createEvent(type, chart, pos.x, pos.y, event);\n }\n\n function throttled(fn, thisArg) {\n var ticking = false;\n var args = [];\n\n return function() {\n args = Array.prototype.slice.call(arguments);\n thisArg = thisArg || this;\n\n if (!ticking) {\n ticking = true;\n helpers.requestAnimFrame.call(window, function() {\n ticking = false;\n fn.apply(thisArg, args);\n });\n }\n };\n }\n\n// Implementation based on https://github.com/marcj/css-element-queries\n function createResizer(handler) {\n var resizer = document.createElement('div');\n var cls = CSS_PREFIX + 'size-monitor';\n var maxSize = 1000000;\n var style =\n 'position:absolute;' +\n 'left:0;' +\n 'top:0;' +\n 'right:0;' +\n 'bottom:0;' +\n 'overflow:hidden;' +\n 'pointer-events:none;' +\n 'visibility:hidden;' +\n 'z-index:-1;';\n\n resizer.style.cssText = style;\n resizer.className = cls;\n resizer.innerHTML =\n '
      ' +\n '
      ' +\n '
      ' +\n '
      ' +\n '
      ' +\n '
      ' +\n '
      ' +\n '
      ';\n\n var expand = resizer.childNodes[0];\n var shrink = resizer.childNodes[1];\n\n resizer._reset = function() {\n expand.scrollLeft = maxSize;\n expand.scrollTop = maxSize;\n shrink.scrollLeft = maxSize;\n shrink.scrollTop = maxSize;\n };\n var onScroll = function() {\n resizer._reset();\n handler();\n };\n\n addEventListener(expand, 'scroll', onScroll.bind(expand, 'expand'));\n addEventListener(shrink, 'scroll', onScroll.bind(shrink, 'shrink'));\n\n return resizer;\n }\n\n// https://davidwalsh.name/detect-node-insertion\n function watchForRender(node, handler) {\n var expando = node[EXPANDO_KEY] || (node[EXPANDO_KEY] = {});\n var proxy = expando.renderProxy = function(e) {\n if (e.animationName === CSS_RENDER_ANIMATION) {\n handler();\n }\n };\n\n helpers.each(ANIMATION_START_EVENTS, function(type) {\n addEventListener(node, type, proxy);\n });\n\n node.classList.add(CSS_RENDER_MONITOR);\n }\n\n function unwatchForRender(node) {\n var expando = node[EXPANDO_KEY] || {};\n var proxy = expando.renderProxy;\n\n if (proxy) {\n helpers.each(ANIMATION_START_EVENTS, function(type) {\n removeEventListener(node, type, proxy);\n });\n\n delete expando.renderProxy;\n }\n\n node.classList.remove(CSS_RENDER_MONITOR);\n }\n\n function addResizeListener(node, listener, chart) {\n var expando = node[EXPANDO_KEY] || (node[EXPANDO_KEY] = {});\n\n // Let's keep track of this added resizer and thus avoid DOM query when removing it.\n var resizer = expando.resizer = createResizer(throttled(function() {\n if (expando.resizer) {\n return listener(createEvent('resize', chart));\n }\n }));\n\n // The resizer needs to be attached to the node parent, so we first need to be\n // sure that `node` is attached to the DOM before injecting the resizer element.\n watchForRender(node, function() {\n if (expando.resizer) {\n var container = node.parentNode;\n if (container && container !== resizer.parentNode) {\n container.insertBefore(resizer, container.firstChild);\n }\n\n // The container size might have changed, let's reset the resizer state.\n resizer._reset();\n }\n });\n }\n\n function removeResizeListener(node) {\n var expando = node[EXPANDO_KEY] || {};\n var resizer = expando.resizer;\n\n delete expando.resizer;\n unwatchForRender(node);\n\n if (resizer && resizer.parentNode) {\n resizer.parentNode.removeChild(resizer);\n }\n }\n\n function injectCSS(platform, css) {\n // http://stackoverflow.com/q/3922139\n var style = platform._style || document.createElement('style');\n if (!platform._style) {\n platform._style = style;\n css = '/* Chart.js */\\n' + css;\n style.setAttribute('type', 'text/css');\n document.getElementsByTagName('head')[0].appendChild(style);\n }\n\n style.appendChild(document.createTextNode(css));\n }\n\n module.exports = {\n /**\n * This property holds whether this platform is enabled for the current environment.\n * Currently used by platform.js to select the proper implementation.\n * @private\n */\n _enabled: typeof window !== 'undefined' && typeof document !== 'undefined',\n\n initialize: function() {\n var keyframes = 'from{opacity:0.99}to{opacity:1}';\n\n injectCSS(this,\n // DOM rendering detection\n // https://davidwalsh.name/detect-node-insertion\n '@-webkit-keyframes ' + CSS_RENDER_ANIMATION + '{' + keyframes + '}' +\n '@keyframes ' + CSS_RENDER_ANIMATION + '{' + keyframes + '}' +\n '.' + CSS_RENDER_MONITOR + '{' +\n '-webkit-animation:' + CSS_RENDER_ANIMATION + ' 0.001s;' +\n 'animation:' + CSS_RENDER_ANIMATION + ' 0.001s;' +\n '}'\n );\n },\n\n acquireContext: function(item, config) {\n if (typeof item === 'string') {\n item = document.getElementById(item);\n } else if (item.length) {\n // Support for array based queries (such as jQuery)\n item = item[0];\n }\n\n if (item && item.canvas) {\n // Support for any object associated to a canvas (including a context2d)\n item = item.canvas;\n }\n\n // To prevent canvas fingerprinting, some add-ons undefine the getContext\n // method, for example: https://github.com/kkapsner/CanvasBlocker\n // https://github.com/chartjs/Chart.js/issues/2807\n var context = item && item.getContext && item.getContext('2d');\n\n // `instanceof HTMLCanvasElement/CanvasRenderingContext2D` fails when the item is\n // inside an iframe or when running in a protected environment. We could guess the\n // types from their toString() value but let's keep things flexible and assume it's\n // a sufficient condition if the item has a context2D which has item as `canvas`.\n // https://github.com/chartjs/Chart.js/issues/3887\n // https://github.com/chartjs/Chart.js/issues/4102\n // https://github.com/chartjs/Chart.js/issues/4152\n if (context && context.canvas === item) {\n initCanvas(item, config);\n return context;\n }\n\n return null;\n },\n\n releaseContext: function(context) {\n var canvas = context.canvas;\n if (!canvas[EXPANDO_KEY]) {\n return;\n }\n\n var initial = canvas[EXPANDO_KEY].initial;\n ['height', 'width'].forEach(function(prop) {\n var value = initial[prop];\n if (helpers.isNullOrUndef(value)) {\n canvas.removeAttribute(prop);\n } else {\n canvas.setAttribute(prop, value);\n }\n });\n\n helpers.each(initial.style || {}, function(value, key) {\n canvas.style[key] = value;\n });\n\n // The canvas render size might have been changed (and thus the state stack discarded),\n // we can't use save() and restore() to restore the initial state. So make sure that at\n // least the canvas context is reset to the default state by setting the canvas width.\n // https://www.w3.org/TR/2011/WD-html5-20110525/the-canvas-element.html\n canvas.width = canvas.width;\n\n delete canvas[EXPANDO_KEY];\n },\n\n addEventListener: function(chart, type, listener) {\n var canvas = chart.canvas;\n if (type === 'resize') {\n // Note: the resize event is not supported on all browsers.\n addResizeListener(canvas, listener, chart);\n return;\n }\n\n var expando = listener[EXPANDO_KEY] || (listener[EXPANDO_KEY] = {});\n var proxies = expando.proxies || (expando.proxies = {});\n var proxy = proxies[chart.id + '_' + type] = function(event) {\n listener(fromNativeEvent(event, chart));\n };\n\n addEventListener(canvas, type, proxy);\n },\n\n removeEventListener: function(chart, type, listener) {\n var canvas = chart.canvas;\n if (type === 'resize') {\n // Note: the resize event is not supported on all browsers.\n removeResizeListener(canvas, listener);\n return;\n }\n\n var expando = listener[EXPANDO_KEY] || {};\n var proxies = expando.proxies || {};\n var proxy = proxies[chart.id + '_' + type];\n if (!proxy) {\n return;\n }\n\n removeEventListener(canvas, type, proxy);\n }\n };\n\n// DEPRECATIONS\n\n /**\n * Provided for backward compatibility, use EventTarget.addEventListener instead.\n * EventTarget.addEventListener compatibility: Chrome, Opera 7, Safari, FF1.5+, IE9+\n * @see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener\n * @function Chart.helpers.addEvent\n * @deprecated since version 2.7.0\n * @todo remove at version 3\n * @private\n */\n helpers.addEvent = addEventListener;\n\n /**\n * Provided for backward compatibility, use EventTarget.removeEventListener instead.\n * EventTarget.removeEventListener compatibility: Chrome, Opera 7, Safari, FF1.5+, IE9+\n * @see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener\n * @function Chart.helpers.removeEvent\n * @deprecated since version 2.7.0\n * @todo remove at version 3\n * @private\n */\n helpers.removeEvent = removeEventListener;\n\n},{\"45\":45}],48:[function(require,module,exports){\n 'use strict';\n\n var helpers = require(45);\n var basic = require(46);\n var dom = require(47);\n\n// @TODO Make possible to select another platform at build time.\n var implementation = dom._enabled ? dom : basic;\n\n /**\n * @namespace Chart.platform\n * @see https://chartjs.gitbooks.io/proposals/content/Platform.html\n * @since 2.4.0\n */\n module.exports = helpers.extend({\n /**\n * @since 2.7.0\n */\n initialize: function() {},\n\n /**\n * Called at chart construction time, returns a context2d instance implementing\n * the [W3C Canvas 2D Context API standard]{@link https://www.w3.org/TR/2dcontext/}.\n * @param {*} item - The native item from which to acquire context (platform specific)\n * @param {Object} options - The chart options\n * @returns {CanvasRenderingContext2D} context2d instance\n */\n acquireContext: function() {},\n\n /**\n * Called at chart destruction time, releases any resources associated to the context\n * previously returned by the acquireContext() method.\n * @param {CanvasRenderingContext2D} context - The context2d instance\n * @returns {Boolean} true if the method succeeded, else false\n */\n releaseContext: function() {},\n\n /**\n * Registers the specified listener on the given chart.\n * @param {Chart} chart - Chart from which to listen for event\n * @param {String} type - The ({@link IEvent}) type to listen for\n * @param {Function} listener - Receives a notification (an object that implements\n * the {@link IEvent} interface) when an event of the specified type occurs.\n */\n addEventListener: function() {},\n\n /**\n * Removes the specified listener previously registered with addEventListener.\n * @param {Chart} chart -Chart from which to remove the listener\n * @param {String} type - The ({@link IEvent}) type to remove\n * @param {Function} listener - The listener function to remove from the event target.\n */\n removeEventListener: function() {}\n\n }, implementation);\n\n /**\n * @interface IPlatform\n * Allows abstracting platform dependencies away from the chart\n * @borrows Chart.platform.acquireContext as acquireContext\n * @borrows Chart.platform.releaseContext as releaseContext\n * @borrows Chart.platform.addEventListener as addEventListener\n * @borrows Chart.platform.removeEventListener as removeEventListener\n */\n\n /**\n * @interface IEvent\n * @prop {String} type - The event type name, possible values are:\n * 'contextmenu', 'mouseenter', 'mousedown', 'mousemove', 'mouseup', 'mouseout',\n * 'click', 'dblclick', 'keydown', 'keypress', 'keyup' and 'resize'\n * @prop {*} native - The original native event (null for emulated events, e.g. 'resize')\n * @prop {Number} x - The mouse x position, relative to the canvas (null for incompatible events)\n * @prop {Number} y - The mouse y position, relative to the canvas (null for incompatible events)\n */\n\n},{\"45\":45,\"46\":46,\"47\":47}],49:[function(require,module,exports){\n /**\n * Plugin based on discussion from the following Chart.js issues:\n * @see https://github.com/chartjs/Chart.js/issues/2380#issuecomment-279961569\n * @see https://github.com/chartjs/Chart.js/issues/2440#issuecomment-256461897\n */\n\n 'use strict';\n\n var defaults = require(25);\n var elements = require(40);\n var helpers = require(45);\n\n defaults._set('global', {\n plugins: {\n filler: {\n propagate: true\n }\n }\n });\n\n module.exports = function() {\n\n var mappers = {\n dataset: function(source) {\n var index = source.fill;\n var chart = source.chart;\n var meta = chart.getDatasetMeta(index);\n var visible = meta && chart.isDatasetVisible(index);\n var points = (visible && meta.dataset._children) || [];\n var length = points.length || 0;\n\n return !length ? null : function(point, i) {\n return (i < length && points[i]._view) || null;\n };\n },\n\n boundary: function(source) {\n var boundary = source.boundary;\n var x = boundary ? boundary.x : null;\n var y = boundary ? boundary.y : null;\n\n return function(point) {\n return {\n x: x === null ? point.x : x,\n y: y === null ? point.y : y,\n };\n };\n }\n };\n\n // @todo if (fill[0] === '#')\n function decodeFill(el, index, count) {\n var model = el._model || {};\n var fill = model.fill;\n var target;\n\n if (fill === undefined) {\n fill = !!model.backgroundColor;\n }\n\n if (fill === false || fill === null) {\n return false;\n }\n\n if (fill === true) {\n return 'origin';\n }\n\n target = parseFloat(fill, 10);\n if (isFinite(target) && Math.floor(target) === target) {\n if (fill[0] === '-' || fill[0] === '+') {\n target = index + target;\n }\n\n if (target === index || target < 0 || target >= count) {\n return false;\n }\n\n return target;\n }\n\n switch (fill) {\n // compatibility\n case 'bottom':\n return 'start';\n case 'top':\n return 'end';\n case 'zero':\n return 'origin';\n // supported boundaries\n case 'origin':\n case 'start':\n case 'end':\n return fill;\n // invalid fill values\n default:\n return false;\n }\n }\n\n function computeBoundary(source) {\n var model = source.el._model || {};\n var scale = source.el._scale || {};\n var fill = source.fill;\n var target = null;\n var horizontal;\n\n if (isFinite(fill)) {\n return null;\n }\n\n // Backward compatibility: until v3, we still need to support boundary values set on\n // the model (scaleTop, scaleBottom and scaleZero) because some external plugins and\n // controllers might still use it (e.g. the Smith chart).\n\n if (fill === 'start') {\n target = model.scaleBottom === undefined ? scale.bottom : model.scaleBottom;\n } else if (fill === 'end') {\n target = model.scaleTop === undefined ? scale.top : model.scaleTop;\n } else if (model.scaleZero !== undefined) {\n target = model.scaleZero;\n } else if (scale.getBasePosition) {\n target = scale.getBasePosition();\n } else if (scale.getBasePixel) {\n target = scale.getBasePixel();\n }\n\n if (target !== undefined && target !== null) {\n if (target.x !== undefined && target.y !== undefined) {\n return target;\n }\n\n if (typeof target === 'number' && isFinite(target)) {\n horizontal = scale.isHorizontal();\n return {\n x: horizontal ? target : null,\n y: horizontal ? null : target\n };\n }\n }\n\n return null;\n }\n\n function resolveTarget(sources, index, propagate) {\n var source = sources[index];\n var fill = source.fill;\n var visited = [index];\n var target;\n\n if (!propagate) {\n return fill;\n }\n\n while (fill !== false && visited.indexOf(fill) === -1) {\n if (!isFinite(fill)) {\n return fill;\n }\n\n target = sources[fill];\n if (!target) {\n return false;\n }\n\n if (target.visible) {\n return fill;\n }\n\n visited.push(fill);\n fill = target.fill;\n }\n\n return false;\n }\n\n function createMapper(source) {\n var fill = source.fill;\n var type = 'dataset';\n\n if (fill === false) {\n return null;\n }\n\n if (!isFinite(fill)) {\n type = 'boundary';\n }\n\n return mappers[type](source);\n }\n\n function isDrawable(point) {\n return point && !point.skip;\n }\n\n function drawArea(ctx, curve0, curve1, len0, len1) {\n var i;\n\n if (!len0 || !len1) {\n return;\n }\n\n // building first area curve (normal)\n ctx.moveTo(curve0[0].x, curve0[0].y);\n for (i = 1; i < len0; ++i) {\n helpers.canvas.lineTo(ctx, curve0[i - 1], curve0[i]);\n }\n\n // joining the two area curves\n ctx.lineTo(curve1[len1 - 1].x, curve1[len1 - 1].y);\n\n // building opposite area curve (reverse)\n for (i = len1 - 1; i > 0; --i) {\n helpers.canvas.lineTo(ctx, curve1[i], curve1[i - 1], true);\n }\n }\n\n function doFill(ctx, points, mapper, view, color, loop) {\n var count = points.length;\n var span = view.spanGaps;\n var curve0 = [];\n var curve1 = [];\n var len0 = 0;\n var len1 = 0;\n var i, ilen, index, p0, p1, d0, d1;\n\n ctx.beginPath();\n\n for (i = 0, ilen = (count + !!loop); i < ilen; ++i) {\n index = i % count;\n p0 = points[index]._view;\n p1 = mapper(p0, index, view);\n d0 = isDrawable(p0);\n d1 = isDrawable(p1);\n\n if (d0 && d1) {\n len0 = curve0.push(p0);\n len1 = curve1.push(p1);\n } else if (len0 && len1) {\n if (!span) {\n drawArea(ctx, curve0, curve1, len0, len1);\n len0 = len1 = 0;\n curve0 = [];\n curve1 = [];\n } else {\n if (d0) {\n curve0.push(p0);\n }\n if (d1) {\n curve1.push(p1);\n }\n }\n }\n }\n\n drawArea(ctx, curve0, curve1, len0, len1);\n\n ctx.closePath();\n ctx.fillStyle = color;\n ctx.fill();\n }\n\n return {\n id: 'filler',\n\n afterDatasetsUpdate: function(chart, options) {\n var count = (chart.data.datasets || []).length;\n var propagate = options.propagate;\n var sources = [];\n var meta, i, el, source;\n\n for (i = 0; i < count; ++i) {\n meta = chart.getDatasetMeta(i);\n el = meta.dataset;\n source = null;\n\n if (el && el._model && el instanceof elements.Line) {\n source = {\n visible: chart.isDatasetVisible(i),\n fill: decodeFill(el, i, count),\n chart: chart,\n el: el\n };\n }\n\n meta.$filler = source;\n sources.push(source);\n }\n\n for (i = 0; i < count; ++i) {\n source = sources[i];\n if (!source) {\n continue;\n }\n\n source.fill = resolveTarget(sources, i, propagate);\n source.boundary = computeBoundary(source);\n source.mapper = createMapper(source);\n }\n },\n\n beforeDatasetDraw: function(chart, args) {\n var meta = args.meta.$filler;\n if (!meta) {\n return;\n }\n\n var ctx = chart.ctx;\n var el = meta.el;\n var view = el._view;\n var points = el._children || [];\n var mapper = meta.mapper;\n var color = view.backgroundColor || defaults.global.defaultColor;\n\n if (mapper && color && points.length) {\n helpers.canvas.clipArea(ctx, chart.chartArea);\n doFill(ctx, points, mapper, view, color, el._loop);\n helpers.canvas.unclipArea(ctx);\n }\n }\n };\n };\n\n},{\"25\":25,\"40\":40,\"45\":45}],50:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var Element = require(26);\n var helpers = require(45);\n\n defaults._set('global', {\n legend: {\n display: true,\n position: 'top',\n fullWidth: true,\n reverse: false,\n weight: 1000,\n\n // a callback that will handle\n onClick: function(e, legendItem) {\n var index = legendItem.datasetIndex;\n var ci = this.chart;\n var meta = ci.getDatasetMeta(index);\n\n // See controller.isDatasetVisible comment\n meta.hidden = meta.hidden === null ? !ci.data.datasets[index].hidden : null;\n\n // We hid a dataset ... rerender the chart\n ci.update();\n },\n\n onHover: null,\n\n labels: {\n boxWidth: 40,\n padding: 10,\n // Generates labels shown in the legend\n // Valid properties to return:\n // text : text to display\n // fillStyle : fill of coloured box\n // strokeStyle: stroke of coloured box\n // hidden : if this legend item refers to a hidden item\n // lineCap : cap style for line\n // lineDash\n // lineDashOffset :\n // lineJoin :\n // lineWidth :\n generateLabels: function(chart) {\n var data = chart.data;\n return helpers.isArray(data.datasets) ? data.datasets.map(function(dataset, i) {\n return {\n text: dataset.label,\n fillStyle: (!helpers.isArray(dataset.backgroundColor) ? dataset.backgroundColor : dataset.backgroundColor[0]),\n hidden: !chart.isDatasetVisible(i),\n lineCap: dataset.borderCapStyle,\n lineDash: dataset.borderDash,\n lineDashOffset: dataset.borderDashOffset,\n lineJoin: dataset.borderJoinStyle,\n lineWidth: dataset.borderWidth,\n strokeStyle: dataset.borderColor,\n pointStyle: dataset.pointStyle,\n\n // Below is extra data used for toggling the datasets\n datasetIndex: i\n };\n }, this) : [];\n }\n }\n },\n\n legendCallback: function(chart) {\n var text = [];\n text.push('
        ');\n for (var i = 0; i < chart.data.datasets.length; i++) {\n text.push('
      • ');\n if (chart.data.datasets[i].label) {\n text.push(chart.data.datasets[i].label);\n }\n text.push('
      • ');\n }\n text.push('
      ');\n return text.join('');\n }\n });\n\n module.exports = function(Chart) {\n\n var layout = Chart.layoutService;\n var noop = helpers.noop;\n\n /**\n * Helper function to get the box width based on the usePointStyle option\n * @param labelopts {Object} the label options on the legend\n * @param fontSize {Number} the label font size\n * @return {Number} width of the color box area\n */\n function getBoxWidth(labelOpts, fontSize) {\n return labelOpts.usePointStyle ?\n fontSize * Math.SQRT2 :\n labelOpts.boxWidth;\n }\n\n Chart.Legend = Element.extend({\n\n initialize: function(config) {\n helpers.extend(this, config);\n\n // Contains hit boxes for each dataset (in dataset order)\n this.legendHitBoxes = [];\n\n // Are we in doughnut mode which has a different data type\n this.doughnutMode = false;\n },\n\n // These methods are ordered by lifecycle. Utilities then follow.\n // Any function defined here is inherited by all legend types.\n // Any function can be extended by the legend type\n\n beforeUpdate: noop,\n update: function(maxWidth, maxHeight, margins) {\n var me = this;\n\n // Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)\n me.beforeUpdate();\n\n // Absorb the master measurements\n me.maxWidth = maxWidth;\n me.maxHeight = maxHeight;\n me.margins = margins;\n\n // Dimensions\n me.beforeSetDimensions();\n me.setDimensions();\n me.afterSetDimensions();\n // Labels\n me.beforeBuildLabels();\n me.buildLabels();\n me.afterBuildLabels();\n\n // Fit\n me.beforeFit();\n me.fit();\n me.afterFit();\n //\n me.afterUpdate();\n\n return me.minSize;\n },\n afterUpdate: noop,\n\n //\n\n beforeSetDimensions: noop,\n setDimensions: function() {\n var me = this;\n // Set the unconstrained dimension before label rotation\n if (me.isHorizontal()) {\n // Reset position before calculating rotation\n me.width = me.maxWidth;\n me.left = 0;\n me.right = me.width;\n } else {\n me.height = me.maxHeight;\n\n // Reset position before calculating rotation\n me.top = 0;\n me.bottom = me.height;\n }\n\n // Reset padding\n me.paddingLeft = 0;\n me.paddingTop = 0;\n me.paddingRight = 0;\n me.paddingBottom = 0;\n\n // Reset minSize\n me.minSize = {\n width: 0,\n height: 0\n };\n },\n afterSetDimensions: noop,\n\n //\n\n beforeBuildLabels: noop,\n buildLabels: function() {\n var me = this;\n var labelOpts = me.options.labels || {};\n var legendItems = helpers.callback(labelOpts.generateLabels, [me.chart], me) || [];\n\n if (labelOpts.filter) {\n legendItems = legendItems.filter(function(item) {\n return labelOpts.filter(item, me.chart.data);\n });\n }\n\n if (me.options.reverse) {\n legendItems.reverse();\n }\n\n me.legendItems = legendItems;\n },\n afterBuildLabels: noop,\n\n //\n\n beforeFit: noop,\n fit: function() {\n var me = this;\n var opts = me.options;\n var labelOpts = opts.labels;\n var display = opts.display;\n\n var ctx = me.ctx;\n\n var globalDefault = defaults.global;\n var valueOrDefault = helpers.valueOrDefault;\n var fontSize = valueOrDefault(labelOpts.fontSize, globalDefault.defaultFontSize);\n var fontStyle = valueOrDefault(labelOpts.fontStyle, globalDefault.defaultFontStyle);\n var fontFamily = valueOrDefault(labelOpts.fontFamily, globalDefault.defaultFontFamily);\n var labelFont = helpers.fontString(fontSize, fontStyle, fontFamily);\n\n // Reset hit boxes\n var hitboxes = me.legendHitBoxes = [];\n\n var minSize = me.minSize;\n var isHorizontal = me.isHorizontal();\n\n if (isHorizontal) {\n minSize.width = me.maxWidth; // fill all the width\n minSize.height = display ? 10 : 0;\n } else {\n minSize.width = display ? 10 : 0;\n minSize.height = me.maxHeight; // fill all the height\n }\n\n // Increase sizes here\n if (display) {\n ctx.font = labelFont;\n\n if (isHorizontal) {\n // Labels\n\n // Width of each line of legend boxes. Labels wrap onto multiple lines when there are too many to fit on one\n var lineWidths = me.lineWidths = [0];\n var totalHeight = me.legendItems.length ? fontSize + (labelOpts.padding) : 0;\n\n ctx.textAlign = 'left';\n ctx.textBaseline = 'top';\n\n helpers.each(me.legendItems, function(legendItem, i) {\n var boxWidth = getBoxWidth(labelOpts, fontSize);\n var width = boxWidth + (fontSize / 2) + ctx.measureText(legendItem.text).width;\n\n if (lineWidths[lineWidths.length - 1] + width + labelOpts.padding >= me.width) {\n totalHeight += fontSize + (labelOpts.padding);\n lineWidths[lineWidths.length] = me.left;\n }\n\n // Store the hitbox width and height here. Final position will be updated in `draw`\n hitboxes[i] = {\n left: 0,\n top: 0,\n width: width,\n height: fontSize\n };\n\n lineWidths[lineWidths.length - 1] += width + labelOpts.padding;\n });\n\n minSize.height += totalHeight;\n\n } else {\n var vPadding = labelOpts.padding;\n var columnWidths = me.columnWidths = [];\n var totalWidth = labelOpts.padding;\n var currentColWidth = 0;\n var currentColHeight = 0;\n var itemHeight = fontSize + vPadding;\n\n helpers.each(me.legendItems, function(legendItem, i) {\n var boxWidth = getBoxWidth(labelOpts, fontSize);\n var itemWidth = boxWidth + (fontSize / 2) + ctx.measureText(legendItem.text).width;\n\n // If too tall, go to new column\n if (currentColHeight + itemHeight > minSize.height) {\n totalWidth += currentColWidth + labelOpts.padding;\n columnWidths.push(currentColWidth); // previous column width\n\n currentColWidth = 0;\n currentColHeight = 0;\n }\n\n // Get max width\n currentColWidth = Math.max(currentColWidth, itemWidth);\n currentColHeight += itemHeight;\n\n // Store the hitbox width and height here. Final position will be updated in `draw`\n hitboxes[i] = {\n left: 0,\n top: 0,\n width: itemWidth,\n height: fontSize\n };\n });\n\n totalWidth += currentColWidth;\n columnWidths.push(currentColWidth);\n minSize.width += totalWidth;\n }\n }\n\n me.width = minSize.width;\n me.height = minSize.height;\n },\n afterFit: noop,\n\n // Shared Methods\n isHorizontal: function() {\n return this.options.position === 'top' || this.options.position === 'bottom';\n },\n\n // Actually draw the legend on the canvas\n draw: function() {\n var me = this;\n var opts = me.options;\n var labelOpts = opts.labels;\n var globalDefault = defaults.global;\n var lineDefault = globalDefault.elements.line;\n var legendWidth = me.width;\n var lineWidths = me.lineWidths;\n\n if (opts.display) {\n var ctx = me.ctx;\n var valueOrDefault = helpers.valueOrDefault;\n var fontColor = valueOrDefault(labelOpts.fontColor, globalDefault.defaultFontColor);\n var fontSize = valueOrDefault(labelOpts.fontSize, globalDefault.defaultFontSize);\n var fontStyle = valueOrDefault(labelOpts.fontStyle, globalDefault.defaultFontStyle);\n var fontFamily = valueOrDefault(labelOpts.fontFamily, globalDefault.defaultFontFamily);\n var labelFont = helpers.fontString(fontSize, fontStyle, fontFamily);\n var cursor;\n\n // Canvas setup\n ctx.textAlign = 'left';\n ctx.textBaseline = 'middle';\n ctx.lineWidth = 0.5;\n ctx.strokeStyle = fontColor; // for strikethrough effect\n ctx.fillStyle = fontColor; // render in correct colour\n ctx.font = labelFont;\n\n var boxWidth = getBoxWidth(labelOpts, fontSize);\n var hitboxes = me.legendHitBoxes;\n\n // current position\n var drawLegendBox = function(x, y, legendItem) {\n if (isNaN(boxWidth) || boxWidth <= 0) {\n return;\n }\n\n // Set the ctx for the box\n ctx.save();\n\n ctx.fillStyle = valueOrDefault(legendItem.fillStyle, globalDefault.defaultColor);\n ctx.lineCap = valueOrDefault(legendItem.lineCap, lineDefault.borderCapStyle);\n ctx.lineDashOffset = valueOrDefault(legendItem.lineDashOffset, lineDefault.borderDashOffset);\n ctx.lineJoin = valueOrDefault(legendItem.lineJoin, lineDefault.borderJoinStyle);\n ctx.lineWidth = valueOrDefault(legendItem.lineWidth, lineDefault.borderWidth);\n ctx.strokeStyle = valueOrDefault(legendItem.strokeStyle, globalDefault.defaultColor);\n var isLineWidthZero = (valueOrDefault(legendItem.lineWidth, lineDefault.borderWidth) === 0);\n\n if (ctx.setLineDash) {\n // IE 9 and 10 do not support line dash\n ctx.setLineDash(valueOrDefault(legendItem.lineDash, lineDefault.borderDash));\n }\n\n if (opts.labels && opts.labels.usePointStyle) {\n // Recalculate x and y for drawPoint() because its expecting\n // x and y to be center of figure (instead of top left)\n var radius = fontSize * Math.SQRT2 / 2;\n var offSet = radius / Math.SQRT2;\n var centerX = x + offSet;\n var centerY = y + offSet;\n\n // Draw pointStyle as legend symbol\n helpers.canvas.drawPoint(ctx, legendItem.pointStyle, radius, centerX, centerY);\n } else {\n // Draw box as legend symbol\n if (!isLineWidthZero) {\n ctx.strokeRect(x, y, boxWidth, fontSize);\n }\n ctx.fillRect(x, y, boxWidth, fontSize);\n }\n\n ctx.restore();\n };\n var fillText = function(x, y, legendItem, textWidth) {\n var halfFontSize = fontSize / 2;\n var xLeft = boxWidth + halfFontSize + x;\n var yMiddle = y + halfFontSize;\n\n ctx.fillText(legendItem.text, xLeft, yMiddle);\n\n if (legendItem.hidden) {\n // Strikethrough the text if hidden\n ctx.beginPath();\n ctx.lineWidth = 2;\n ctx.moveTo(xLeft, yMiddle);\n ctx.lineTo(xLeft + textWidth, yMiddle);\n ctx.stroke();\n }\n };\n\n // Horizontal\n var isHorizontal = me.isHorizontal();\n if (isHorizontal) {\n cursor = {\n x: me.left + ((legendWidth - lineWidths[0]) / 2),\n y: me.top + labelOpts.padding,\n line: 0\n };\n } else {\n cursor = {\n x: me.left + labelOpts.padding,\n y: me.top + labelOpts.padding,\n line: 0\n };\n }\n\n var itemHeight = fontSize + labelOpts.padding;\n helpers.each(me.legendItems, function(legendItem, i) {\n var textWidth = ctx.measureText(legendItem.text).width;\n var width = boxWidth + (fontSize / 2) + textWidth;\n var x = cursor.x;\n var y = cursor.y;\n\n if (isHorizontal) {\n if (x + width >= legendWidth) {\n y = cursor.y += itemHeight;\n cursor.line++;\n x = cursor.x = me.left + ((legendWidth - lineWidths[cursor.line]) / 2);\n }\n } else if (y + itemHeight > me.bottom) {\n x = cursor.x = x + me.columnWidths[cursor.line] + labelOpts.padding;\n y = cursor.y = me.top + labelOpts.padding;\n cursor.line++;\n }\n\n drawLegendBox(x, y, legendItem);\n\n hitboxes[i].left = x;\n hitboxes[i].top = y;\n\n // Fill the actual label\n fillText(x, y, legendItem, textWidth);\n\n if (isHorizontal) {\n cursor.x += width + (labelOpts.padding);\n } else {\n cursor.y += itemHeight;\n }\n\n });\n }\n },\n\n /**\n * Handle an event\n * @private\n * @param {IEvent} event - The event to handle\n * @return {Boolean} true if a change occured\n */\n handleEvent: function(e) {\n var me = this;\n var opts = me.options;\n var type = e.type === 'mouseup' ? 'click' : e.type;\n var changed = false;\n\n if (type === 'mousemove') {\n if (!opts.onHover) {\n return;\n }\n } else if (type === 'click') {\n if (!opts.onClick) {\n return;\n }\n } else {\n return;\n }\n\n // Chart event already has relative position in it\n var x = e.x;\n var y = e.y;\n\n if (x >= me.left && x <= me.right && y >= me.top && y <= me.bottom) {\n // See if we are touching one of the dataset boxes\n var lh = me.legendHitBoxes;\n for (var i = 0; i < lh.length; ++i) {\n var hitBox = lh[i];\n\n if (x >= hitBox.left && x <= hitBox.left + hitBox.width && y >= hitBox.top && y <= hitBox.top + hitBox.height) {\n // Touching an element\n if (type === 'click') {\n // use e.native for backwards compatibility\n opts.onClick.call(me, e.native, me.legendItems[i]);\n changed = true;\n break;\n } else if (type === 'mousemove') {\n // use e.native for backwards compatibility\n opts.onHover.call(me, e.native, me.legendItems[i]);\n changed = true;\n break;\n }\n }\n }\n }\n\n return changed;\n }\n });\n\n function createNewLegendAndAttach(chart, legendOpts) {\n var legend = new Chart.Legend({\n ctx: chart.ctx,\n options: legendOpts,\n chart: chart\n });\n\n layout.configure(chart, legend, legendOpts);\n layout.addBox(chart, legend);\n chart.legend = legend;\n }\n\n return {\n id: 'legend',\n\n beforeInit: function(chart) {\n var legendOpts = chart.options.legend;\n\n if (legendOpts) {\n createNewLegendAndAttach(chart, legendOpts);\n }\n },\n\n beforeUpdate: function(chart) {\n var legendOpts = chart.options.legend;\n var legend = chart.legend;\n\n if (legendOpts) {\n helpers.mergeIf(legendOpts, defaults.global.legend);\n\n if (legend) {\n layout.configure(chart, legend, legendOpts);\n legend.options = legendOpts;\n } else {\n createNewLegendAndAttach(chart, legendOpts);\n }\n } else if (legend) {\n layout.removeBox(chart, legend);\n delete chart.legend;\n }\n },\n\n afterEvent: function(chart, e) {\n var legend = chart.legend;\n if (legend) {\n legend.handleEvent(e);\n }\n }\n };\n };\n\n},{\"25\":25,\"26\":26,\"45\":45}],51:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var Element = require(26);\n var helpers = require(45);\n\n defaults._set('global', {\n title: {\n display: false,\n fontStyle: 'bold',\n fullWidth: true,\n lineHeight: 1.2,\n padding: 10,\n position: 'top',\n text: '',\n weight: 2000 // by default greater than legend (1000) to be above\n }\n });\n\n module.exports = function(Chart) {\n\n var layout = Chart.layoutService;\n var noop = helpers.noop;\n\n Chart.Title = Element.extend({\n initialize: function(config) {\n var me = this;\n helpers.extend(me, config);\n\n // Contains hit boxes for each dataset (in dataset order)\n me.legendHitBoxes = [];\n },\n\n // These methods are ordered by lifecycle. Utilities then follow.\n\n beforeUpdate: noop,\n update: function(maxWidth, maxHeight, margins) {\n var me = this;\n\n // Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)\n me.beforeUpdate();\n\n // Absorb the master measurements\n me.maxWidth = maxWidth;\n me.maxHeight = maxHeight;\n me.margins = margins;\n\n // Dimensions\n me.beforeSetDimensions();\n me.setDimensions();\n me.afterSetDimensions();\n // Labels\n me.beforeBuildLabels();\n me.buildLabels();\n me.afterBuildLabels();\n\n // Fit\n me.beforeFit();\n me.fit();\n me.afterFit();\n //\n me.afterUpdate();\n\n return me.minSize;\n\n },\n afterUpdate: noop,\n\n //\n\n beforeSetDimensions: noop,\n setDimensions: function() {\n var me = this;\n // Set the unconstrained dimension before label rotation\n if (me.isHorizontal()) {\n // Reset position before calculating rotation\n me.width = me.maxWidth;\n me.left = 0;\n me.right = me.width;\n } else {\n me.height = me.maxHeight;\n\n // Reset position before calculating rotation\n me.top = 0;\n me.bottom = me.height;\n }\n\n // Reset padding\n me.paddingLeft = 0;\n me.paddingTop = 0;\n me.paddingRight = 0;\n me.paddingBottom = 0;\n\n // Reset minSize\n me.minSize = {\n width: 0,\n height: 0\n };\n },\n afterSetDimensions: noop,\n\n //\n\n beforeBuildLabels: noop,\n buildLabels: noop,\n afterBuildLabels: noop,\n\n //\n\n beforeFit: noop,\n fit: function() {\n var me = this;\n var valueOrDefault = helpers.valueOrDefault;\n var opts = me.options;\n var display = opts.display;\n var fontSize = valueOrDefault(opts.fontSize, defaults.global.defaultFontSize);\n var minSize = me.minSize;\n var lineCount = helpers.isArray(opts.text) ? opts.text.length : 1;\n var lineHeight = helpers.options.toLineHeight(opts.lineHeight, fontSize);\n var textSize = display ? (lineCount * lineHeight) + (opts.padding * 2) : 0;\n\n if (me.isHorizontal()) {\n minSize.width = me.maxWidth; // fill all the width\n minSize.height = textSize;\n } else {\n minSize.width = textSize;\n minSize.height = me.maxHeight; // fill all the height\n }\n\n me.width = minSize.width;\n me.height = minSize.height;\n\n },\n afterFit: noop,\n\n // Shared Methods\n isHorizontal: function() {\n var pos = this.options.position;\n return pos === 'top' || pos === 'bottom';\n },\n\n // Actually draw the title block on the canvas\n draw: function() {\n var me = this;\n var ctx = me.ctx;\n var valueOrDefault = helpers.valueOrDefault;\n var opts = me.options;\n var globalDefaults = defaults.global;\n\n if (opts.display) {\n var fontSize = valueOrDefault(opts.fontSize, globalDefaults.defaultFontSize);\n var fontStyle = valueOrDefault(opts.fontStyle, globalDefaults.defaultFontStyle);\n var fontFamily = valueOrDefault(opts.fontFamily, globalDefaults.defaultFontFamily);\n var titleFont = helpers.fontString(fontSize, fontStyle, fontFamily);\n var lineHeight = helpers.options.toLineHeight(opts.lineHeight, fontSize);\n var offset = lineHeight / 2 + opts.padding;\n var rotation = 0;\n var top = me.top;\n var left = me.left;\n var bottom = me.bottom;\n var right = me.right;\n var maxWidth, titleX, titleY;\n\n ctx.fillStyle = valueOrDefault(opts.fontColor, globalDefaults.defaultFontColor); // render in correct colour\n ctx.font = titleFont;\n\n // Horizontal\n if (me.isHorizontal()) {\n titleX = left + ((right - left) / 2); // midpoint of the width\n titleY = top + offset;\n maxWidth = right - left;\n } else {\n titleX = opts.position === 'left' ? left + offset : right - offset;\n titleY = top + ((bottom - top) / 2);\n maxWidth = bottom - top;\n rotation = Math.PI * (opts.position === 'left' ? -0.5 : 0.5);\n }\n\n ctx.save();\n ctx.translate(titleX, titleY);\n ctx.rotate(rotation);\n ctx.textAlign = 'center';\n ctx.textBaseline = 'middle';\n\n var text = opts.text;\n if (helpers.isArray(text)) {\n var y = 0;\n for (var i = 0; i < text.length; ++i) {\n ctx.fillText(text[i], 0, y, maxWidth);\n y += lineHeight;\n }\n } else {\n ctx.fillText(text, 0, 0, maxWidth);\n }\n\n ctx.restore();\n }\n }\n });\n\n function createNewTitleBlockAndAttach(chart, titleOpts) {\n var title = new Chart.Title({\n ctx: chart.ctx,\n options: titleOpts,\n chart: chart\n });\n\n layout.configure(chart, title, titleOpts);\n layout.addBox(chart, title);\n chart.titleBlock = title;\n }\n\n return {\n id: 'title',\n\n beforeInit: function(chart) {\n var titleOpts = chart.options.title;\n\n if (titleOpts) {\n createNewTitleBlockAndAttach(chart, titleOpts);\n }\n },\n\n beforeUpdate: function(chart) {\n var titleOpts = chart.options.title;\n var titleBlock = chart.titleBlock;\n\n if (titleOpts) {\n helpers.mergeIf(titleOpts, defaults.global.title);\n\n if (titleBlock) {\n layout.configure(chart, titleBlock, titleOpts);\n titleBlock.options = titleOpts;\n } else {\n createNewTitleBlockAndAttach(chart, titleOpts);\n }\n } else if (titleBlock) {\n Chart.layoutService.removeBox(chart, titleBlock);\n delete chart.titleBlock;\n }\n }\n };\n };\n\n},{\"25\":25,\"26\":26,\"45\":45}],52:[function(require,module,exports){\n 'use strict';\n\n module.exports = function(Chart) {\n\n // Default config for a category scale\n var defaultConfig = {\n position: 'bottom'\n };\n\n var DatasetScale = Chart.Scale.extend({\n /**\n * Internal function to get the correct labels. If data.xLabels or data.yLabels are defined, use those\n * else fall back to data.labels\n * @private\n */\n getLabels: function() {\n var data = this.chart.data;\n return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels;\n },\n\n determineDataLimits: function() {\n var me = this;\n var labels = me.getLabels();\n me.minIndex = 0;\n me.maxIndex = labels.length - 1;\n var findIndex;\n\n if (me.options.ticks.min !== undefined) {\n // user specified min value\n findIndex = labels.indexOf(me.options.ticks.min);\n me.minIndex = findIndex !== -1 ? findIndex : me.minIndex;\n }\n\n if (me.options.ticks.max !== undefined) {\n // user specified max value\n findIndex = labels.indexOf(me.options.ticks.max);\n me.maxIndex = findIndex !== -1 ? findIndex : me.maxIndex;\n }\n\n me.min = labels[me.minIndex];\n me.max = labels[me.maxIndex];\n },\n\n buildTicks: function() {\n var me = this;\n var labels = me.getLabels();\n // If we are viewing some subset of labels, slice the original array\n me.ticks = (me.minIndex === 0 && me.maxIndex === labels.length - 1) ? labels : labels.slice(me.minIndex, me.maxIndex + 1);\n },\n\n getLabelForIndex: function(index, datasetIndex) {\n var me = this;\n var data = me.chart.data;\n var isHorizontal = me.isHorizontal();\n\n if (data.yLabels && !isHorizontal) {\n return me.getRightValue(data.datasets[datasetIndex].data[index]);\n }\n return me.ticks[index - me.minIndex];\n },\n\n // Used to get data value locations. Value can either be an index or a numerical value\n getPixelForValue: function(value, index) {\n var me = this;\n var offset = me.options.offset;\n // 1 is added because we need the length but we have the indexes\n var offsetAmt = Math.max((me.maxIndex + 1 - me.minIndex - (offset ? 0 : 1)), 1);\n\n // If value is a data object, then index is the index in the data array,\n // not the index of the scale. We need to change that.\n var valueCategory;\n if (value !== undefined && value !== null) {\n valueCategory = me.isHorizontal() ? value.x : value.y;\n }\n if (valueCategory !== undefined || (value !== undefined && isNaN(index))) {\n var labels = me.getLabels();\n value = valueCategory || value;\n var idx = labels.indexOf(value);\n index = idx !== -1 ? idx : index;\n }\n\n if (me.isHorizontal()) {\n var valueWidth = me.width / offsetAmt;\n var widthOffset = (valueWidth * (index - me.minIndex));\n\n if (offset) {\n widthOffset += (valueWidth / 2);\n }\n\n return me.left + Math.round(widthOffset);\n }\n var valueHeight = me.height / offsetAmt;\n var heightOffset = (valueHeight * (index - me.minIndex));\n\n if (offset) {\n heightOffset += (valueHeight / 2);\n }\n\n return me.top + Math.round(heightOffset);\n },\n getPixelForTick: function(index) {\n return this.getPixelForValue(this.ticks[index], index + this.minIndex, null);\n },\n getValueForPixel: function(pixel) {\n var me = this;\n var offset = me.options.offset;\n var value;\n var offsetAmt = Math.max((me._ticks.length - (offset ? 0 : 1)), 1);\n var horz = me.isHorizontal();\n var valueDimension = (horz ? me.width : me.height) / offsetAmt;\n\n pixel -= horz ? me.left : me.top;\n\n if (offset) {\n pixel -= (valueDimension / 2);\n }\n\n if (pixel <= 0) {\n value = 0;\n } else {\n value = Math.round(pixel / valueDimension);\n }\n\n return value + me.minIndex;\n },\n getBasePixel: function() {\n return this.bottom;\n }\n });\n\n Chart.scaleService.registerScaleType('category', DatasetScale, defaultConfig);\n\n };\n\n},{}],53:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var helpers = require(45);\n var Ticks = require(34);\n\n module.exports = function(Chart) {\n\n var defaultConfig = {\n position: 'left',\n ticks: {\n callback: Ticks.formatters.linear\n }\n };\n\n var LinearScale = Chart.LinearScaleBase.extend({\n\n determineDataLimits: function() {\n var me = this;\n var opts = me.options;\n var chart = me.chart;\n var data = chart.data;\n var datasets = data.datasets;\n var isHorizontal = me.isHorizontal();\n var DEFAULT_MIN = 0;\n var DEFAULT_MAX = 1;\n\n function IDMatches(meta) {\n return isHorizontal ? meta.xAxisID === me.id : meta.yAxisID === me.id;\n }\n\n // First Calculate the range\n me.min = null;\n me.max = null;\n\n var hasStacks = opts.stacked;\n if (hasStacks === undefined) {\n helpers.each(datasets, function(dataset, datasetIndex) {\n if (hasStacks) {\n return;\n }\n\n var meta = chart.getDatasetMeta(datasetIndex);\n if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta) &&\n meta.stack !== undefined) {\n hasStacks = true;\n }\n });\n }\n\n if (opts.stacked || hasStacks) {\n var valuesPerStack = {};\n\n helpers.each(datasets, function(dataset, datasetIndex) {\n var meta = chart.getDatasetMeta(datasetIndex);\n var key = [\n meta.type,\n // we have a separate stack for stack=undefined datasets when the opts.stacked is undefined\n ((opts.stacked === undefined && meta.stack === undefined) ? datasetIndex : ''),\n meta.stack\n ].join('.');\n\n if (valuesPerStack[key] === undefined) {\n valuesPerStack[key] = {\n positiveValues: [],\n negativeValues: []\n };\n }\n\n // Store these per type\n var positiveValues = valuesPerStack[key].positiveValues;\n var negativeValues = valuesPerStack[key].negativeValues;\n\n if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {\n helpers.each(dataset.data, function(rawValue, index) {\n var value = +me.getRightValue(rawValue);\n if (isNaN(value) || meta.data[index].hidden) {\n return;\n }\n\n positiveValues[index] = positiveValues[index] || 0;\n negativeValues[index] = negativeValues[index] || 0;\n\n if (opts.relativePoints) {\n positiveValues[index] = 100;\n } else if (value < 0) {\n negativeValues[index] += value;\n } else {\n positiveValues[index] += value;\n }\n });\n }\n });\n\n helpers.each(valuesPerStack, function(valuesForType) {\n var values = valuesForType.positiveValues.concat(valuesForType.negativeValues);\n var minVal = helpers.min(values);\n var maxVal = helpers.max(values);\n me.min = me.min === null ? minVal : Math.min(me.min, minVal);\n me.max = me.max === null ? maxVal : Math.max(me.max, maxVal);\n });\n\n } else {\n helpers.each(datasets, function(dataset, datasetIndex) {\n var meta = chart.getDatasetMeta(datasetIndex);\n if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {\n helpers.each(dataset.data, function(rawValue, index) {\n var value = +me.getRightValue(rawValue);\n if (isNaN(value) || meta.data[index].hidden) {\n return;\n }\n\n if (me.min === null) {\n me.min = value;\n } else if (value < me.min) {\n me.min = value;\n }\n\n if (me.max === null) {\n me.max = value;\n } else if (value > me.max) {\n me.max = value;\n }\n });\n }\n });\n }\n\n me.min = isFinite(me.min) && !isNaN(me.min) ? me.min : DEFAULT_MIN;\n me.max = isFinite(me.max) && !isNaN(me.max) ? me.max : DEFAULT_MAX;\n\n // Common base implementation to handle ticks.min, ticks.max, ticks.beginAtZero\n this.handleTickRangeOptions();\n },\n getTickLimit: function() {\n var maxTicks;\n var me = this;\n var tickOpts = me.options.ticks;\n\n if (me.isHorizontal()) {\n maxTicks = Math.min(tickOpts.maxTicksLimit ? tickOpts.maxTicksLimit : 11, Math.ceil(me.width / 50));\n } else {\n // The factor of 2 used to scale the font size has been experimentally determined.\n var tickFontSize = helpers.valueOrDefault(tickOpts.fontSize, defaults.global.defaultFontSize);\n maxTicks = Math.min(tickOpts.maxTicksLimit ? tickOpts.maxTicksLimit : 11, Math.ceil(me.height / (2 * tickFontSize)));\n }\n\n return maxTicks;\n },\n // Called after the ticks are built. We need\n handleDirectionalChanges: function() {\n if (!this.isHorizontal()) {\n // We are in a vertical orientation. The top value is the highest. So reverse the array\n this.ticks.reverse();\n }\n },\n getLabelForIndex: function(index, datasetIndex) {\n return +this.getRightValue(this.chart.data.datasets[datasetIndex].data[index]);\n },\n // Utils\n getPixelForValue: function(value) {\n // This must be called after fit has been run so that\n // this.left, this.top, this.right, and this.bottom have been defined\n var me = this;\n var start = me.start;\n\n var rightValue = +me.getRightValue(value);\n var pixel;\n var range = me.end - start;\n\n if (me.isHorizontal()) {\n pixel = me.left + (me.width / range * (rightValue - start));\n return Math.round(pixel);\n }\n\n pixel = me.bottom - (me.height / range * (rightValue - start));\n return Math.round(pixel);\n },\n getValueForPixel: function(pixel) {\n var me = this;\n var isHorizontal = me.isHorizontal();\n var innerDimension = isHorizontal ? me.width : me.height;\n var offset = (isHorizontal ? pixel - me.left : me.bottom - pixel) / innerDimension;\n return me.start + ((me.end - me.start) * offset);\n },\n getPixelForTick: function(index) {\n return this.getPixelForValue(this.ticksAsNumbers[index]);\n }\n });\n Chart.scaleService.registerScaleType('linear', LinearScale, defaultConfig);\n\n };\n\n},{\"25\":25,\"34\":34,\"45\":45}],54:[function(require,module,exports){\n 'use strict';\n\n var helpers = require(45);\n var Ticks = require(34);\n\n module.exports = function(Chart) {\n\n var noop = helpers.noop;\n\n Chart.LinearScaleBase = Chart.Scale.extend({\n getRightValue: function(value) {\n if (typeof value === 'string') {\n return +value;\n }\n return Chart.Scale.prototype.getRightValue.call(this, value);\n },\n\n handleTickRangeOptions: function() {\n var me = this;\n var opts = me.options;\n var tickOpts = opts.ticks;\n\n // If we are forcing it to begin at 0, but 0 will already be rendered on the chart,\n // do nothing since that would make the chart weird. If the user really wants a weird chart\n // axis, they can manually override it\n if (tickOpts.beginAtZero) {\n var minSign = helpers.sign(me.min);\n var maxSign = helpers.sign(me.max);\n\n if (minSign < 0 && maxSign < 0) {\n // move the top up to 0\n me.max = 0;\n } else if (minSign > 0 && maxSign > 0) {\n // move the bottom down to 0\n me.min = 0;\n }\n }\n\n var setMin = tickOpts.min !== undefined || tickOpts.suggestedMin !== undefined;\n var setMax = tickOpts.max !== undefined || tickOpts.suggestedMax !== undefined;\n\n if (tickOpts.min !== undefined) {\n me.min = tickOpts.min;\n } else if (tickOpts.suggestedMin !== undefined) {\n if (me.min === null) {\n me.min = tickOpts.suggestedMin;\n } else {\n me.min = Math.min(me.min, tickOpts.suggestedMin);\n }\n }\n\n if (tickOpts.max !== undefined) {\n me.max = tickOpts.max;\n } else if (tickOpts.suggestedMax !== undefined) {\n if (me.max === null) {\n me.max = tickOpts.suggestedMax;\n } else {\n me.max = Math.max(me.max, tickOpts.suggestedMax);\n }\n }\n\n if (setMin !== setMax) {\n // We set the min or the max but not both.\n // So ensure that our range is good\n // Inverted or 0 length range can happen when\n // ticks.min is set, and no datasets are visible\n if (me.min >= me.max) {\n if (setMin) {\n me.max = me.min + 1;\n } else {\n me.min = me.max - 1;\n }\n }\n }\n\n if (me.min === me.max) {\n me.max++;\n\n if (!tickOpts.beginAtZero) {\n me.min--;\n }\n }\n },\n getTickLimit: noop,\n handleDirectionalChanges: noop,\n\n buildTicks: function() {\n var me = this;\n var opts = me.options;\n var tickOpts = opts.ticks;\n\n // Figure out what the max number of ticks we can support it is based on the size of\n // the axis area. For now, we say that the minimum tick spacing in pixels must be 50\n // We also limit the maximum number of ticks to 11 which gives a nice 10 squares on\n // the graph. Make sure we always have at least 2 ticks\n var maxTicks = me.getTickLimit();\n maxTicks = Math.max(2, maxTicks);\n\n var numericGeneratorOptions = {\n maxTicks: maxTicks,\n min: tickOpts.min,\n max: tickOpts.max,\n stepSize: helpers.valueOrDefault(tickOpts.fixedStepSize, tickOpts.stepSize)\n };\n var ticks = me.ticks = Ticks.generators.linear(numericGeneratorOptions, me);\n\n me.handleDirectionalChanges();\n\n // At this point, we need to update our max and min given the tick values since we have expanded the\n // range of the scale\n me.max = helpers.max(ticks);\n me.min = helpers.min(ticks);\n\n if (tickOpts.reverse) {\n ticks.reverse();\n\n me.start = me.max;\n me.end = me.min;\n } else {\n me.start = me.min;\n me.end = me.max;\n }\n },\n convertTicksToLabels: function() {\n var me = this;\n me.ticksAsNumbers = me.ticks.slice();\n me.zeroLineIndex = me.ticks.indexOf(0);\n\n Chart.Scale.prototype.convertTicksToLabels.call(me);\n }\n });\n };\n\n},{\"34\":34,\"45\":45}],55:[function(require,module,exports){\n 'use strict';\n\n var helpers = require(45);\n var Ticks = require(34);\n\n module.exports = function(Chart) {\n\n var defaultConfig = {\n position: 'left',\n\n // label settings\n ticks: {\n callback: Ticks.formatters.logarithmic\n }\n };\n\n var LogarithmicScale = Chart.Scale.extend({\n determineDataLimits: function() {\n var me = this;\n var opts = me.options;\n var tickOpts = opts.ticks;\n var chart = me.chart;\n var data = chart.data;\n var datasets = data.datasets;\n var valueOrDefault = helpers.valueOrDefault;\n var isHorizontal = me.isHorizontal();\n function IDMatches(meta) {\n return isHorizontal ? meta.xAxisID === me.id : meta.yAxisID === me.id;\n }\n\n // Calculate Range\n me.min = null;\n me.max = null;\n me.minNotZero = null;\n\n var hasStacks = opts.stacked;\n if (hasStacks === undefined) {\n helpers.each(datasets, function(dataset, datasetIndex) {\n if (hasStacks) {\n return;\n }\n\n var meta = chart.getDatasetMeta(datasetIndex);\n if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta) &&\n meta.stack !== undefined) {\n hasStacks = true;\n }\n });\n }\n\n if (opts.stacked || hasStacks) {\n var valuesPerStack = {};\n\n helpers.each(datasets, function(dataset, datasetIndex) {\n var meta = chart.getDatasetMeta(datasetIndex);\n var key = [\n meta.type,\n // we have a separate stack for stack=undefined datasets when the opts.stacked is undefined\n ((opts.stacked === undefined && meta.stack === undefined) ? datasetIndex : ''),\n meta.stack\n ].join('.');\n\n if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {\n if (valuesPerStack[key] === undefined) {\n valuesPerStack[key] = [];\n }\n\n helpers.each(dataset.data, function(rawValue, index) {\n var values = valuesPerStack[key];\n var value = +me.getRightValue(rawValue);\n if (isNaN(value) || meta.data[index].hidden) {\n return;\n }\n\n values[index] = values[index] || 0;\n\n if (opts.relativePoints) {\n values[index] = 100;\n } else {\n // Don't need to split positive and negative since the log scale can't handle a 0 crossing\n values[index] += value;\n }\n });\n }\n });\n\n helpers.each(valuesPerStack, function(valuesForType) {\n var minVal = helpers.min(valuesForType);\n var maxVal = helpers.max(valuesForType);\n me.min = me.min === null ? minVal : Math.min(me.min, minVal);\n me.max = me.max === null ? maxVal : Math.max(me.max, maxVal);\n });\n\n } else {\n helpers.each(datasets, function(dataset, datasetIndex) {\n var meta = chart.getDatasetMeta(datasetIndex);\n if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {\n helpers.each(dataset.data, function(rawValue, index) {\n var value = +me.getRightValue(rawValue);\n if (isNaN(value) || meta.data[index].hidden) {\n return;\n }\n\n if (me.min === null) {\n me.min = value;\n } else if (value < me.min) {\n me.min = value;\n }\n\n if (me.max === null) {\n me.max = value;\n } else if (value > me.max) {\n me.max = value;\n }\n\n if (value !== 0 && (me.minNotZero === null || value < me.minNotZero)) {\n me.minNotZero = value;\n }\n });\n }\n });\n }\n\n me.min = valueOrDefault(tickOpts.min, me.min);\n me.max = valueOrDefault(tickOpts.max, me.max);\n\n if (me.min === me.max) {\n if (me.min !== 0 && me.min !== null) {\n me.min = Math.pow(10, Math.floor(helpers.log10(me.min)) - 1);\n me.max = Math.pow(10, Math.floor(helpers.log10(me.max)) + 1);\n } else {\n me.min = 1;\n me.max = 10;\n }\n }\n },\n buildTicks: function() {\n var me = this;\n var opts = me.options;\n var tickOpts = opts.ticks;\n\n var generationOptions = {\n min: tickOpts.min,\n max: tickOpts.max\n };\n var ticks = me.ticks = Ticks.generators.logarithmic(generationOptions, me);\n\n if (!me.isHorizontal()) {\n // We are in a vertical orientation. The top value is the highest. So reverse the array\n ticks.reverse();\n }\n\n // At this point, we need to update our max and min given the tick values since we have expanded the\n // range of the scale\n me.max = helpers.max(ticks);\n me.min = helpers.min(ticks);\n\n if (tickOpts.reverse) {\n ticks.reverse();\n\n me.start = me.max;\n me.end = me.min;\n } else {\n me.start = me.min;\n me.end = me.max;\n }\n },\n convertTicksToLabels: function() {\n this.tickValues = this.ticks.slice();\n\n Chart.Scale.prototype.convertTicksToLabels.call(this);\n },\n // Get the correct tooltip label\n getLabelForIndex: function(index, datasetIndex) {\n return +this.getRightValue(this.chart.data.datasets[datasetIndex].data[index]);\n },\n getPixelForTick: function(index) {\n return this.getPixelForValue(this.tickValues[index]);\n },\n getPixelForValue: function(value) {\n var me = this;\n var start = me.start;\n var newVal = +me.getRightValue(value);\n var opts = me.options;\n var tickOpts = opts.ticks;\n var innerDimension, pixel, range;\n\n if (me.isHorizontal()) {\n range = helpers.log10(me.end) - helpers.log10(start); // todo: if start === 0\n if (newVal === 0) {\n pixel = me.left;\n } else {\n innerDimension = me.width;\n pixel = me.left + (innerDimension / range * (helpers.log10(newVal) - helpers.log10(start)));\n }\n } else {\n // Bottom - top since pixels increase downward on a screen\n innerDimension = me.height;\n if (start === 0 && !tickOpts.reverse) {\n range = helpers.log10(me.end) - helpers.log10(me.minNotZero);\n if (newVal === start) {\n pixel = me.bottom;\n } else if (newVal === me.minNotZero) {\n pixel = me.bottom - innerDimension * 0.02;\n } else {\n pixel = me.bottom - innerDimension * 0.02 - (innerDimension * 0.98 / range * (helpers.log10(newVal) - helpers.log10(me.minNotZero)));\n }\n } else if (me.end === 0 && tickOpts.reverse) {\n range = helpers.log10(me.start) - helpers.log10(me.minNotZero);\n if (newVal === me.end) {\n pixel = me.top;\n } else if (newVal === me.minNotZero) {\n pixel = me.top + innerDimension * 0.02;\n } else {\n pixel = me.top + innerDimension * 0.02 + (innerDimension * 0.98 / range * (helpers.log10(newVal) - helpers.log10(me.minNotZero)));\n }\n } else if (newVal === 0) {\n pixel = tickOpts.reverse ? me.top : me.bottom;\n } else {\n range = helpers.log10(me.end) - helpers.log10(start);\n innerDimension = me.height;\n pixel = me.bottom - (innerDimension / range * (helpers.log10(newVal) - helpers.log10(start)));\n }\n }\n return pixel;\n },\n getValueForPixel: function(pixel) {\n var me = this;\n var range = helpers.log10(me.end) - helpers.log10(me.start);\n var value, innerDimension;\n\n if (me.isHorizontal()) {\n innerDimension = me.width;\n value = me.start * Math.pow(10, (pixel - me.left) * range / innerDimension);\n } else { // todo: if start === 0\n innerDimension = me.height;\n value = Math.pow(10, (me.bottom - pixel) * range / innerDimension) / me.start;\n }\n return value;\n }\n });\n Chart.scaleService.registerScaleType('logarithmic', LogarithmicScale, defaultConfig);\n\n };\n\n},{\"34\":34,\"45\":45}],56:[function(require,module,exports){\n 'use strict';\n\n var defaults = require(25);\n var helpers = require(45);\n var Ticks = require(34);\n\n module.exports = function(Chart) {\n\n var globalDefaults = defaults.global;\n\n var defaultConfig = {\n display: true,\n\n // Boolean - Whether to animate scaling the chart from the centre\n animate: true,\n position: 'chartArea',\n\n angleLines: {\n display: true,\n color: 'rgba(0, 0, 0, 0.1)',\n lineWidth: 1\n },\n\n gridLines: {\n circular: false\n },\n\n // label settings\n ticks: {\n // Boolean - Show a backdrop to the scale label\n showLabelBackdrop: true,\n\n // String - The colour of the label backdrop\n backdropColor: 'rgba(255,255,255,0.75)',\n\n // Number - The backdrop padding above & below the label in pixels\n backdropPaddingY: 2,\n\n // Number - The backdrop padding to the side of the label in pixels\n backdropPaddingX: 2,\n\n callback: Ticks.formatters.linear\n },\n\n pointLabels: {\n // Boolean - if true, show point labels\n display: true,\n\n // Number - Point label font size in pixels\n fontSize: 10,\n\n // Function - Used to convert point labels\n callback: function(label) {\n return label;\n }\n }\n };\n\n function getValueCount(scale) {\n var opts = scale.options;\n return opts.angleLines.display || opts.pointLabels.display ? scale.chart.data.labels.length : 0;\n }\n\n function getPointLabelFontOptions(scale) {\n var pointLabelOptions = scale.options.pointLabels;\n var fontSize = helpers.valueOrDefault(pointLabelOptions.fontSize, globalDefaults.defaultFontSize);\n var fontStyle = helpers.valueOrDefault(pointLabelOptions.fontStyle, globalDefaults.defaultFontStyle);\n var fontFamily = helpers.valueOrDefault(pointLabelOptions.fontFamily, globalDefaults.defaultFontFamily);\n var font = helpers.fontString(fontSize, fontStyle, fontFamily);\n\n return {\n size: fontSize,\n style: fontStyle,\n family: fontFamily,\n font: font\n };\n }\n\n function measureLabelSize(ctx, fontSize, label) {\n if (helpers.isArray(label)) {\n return {\n w: helpers.longestText(ctx, ctx.font, label),\n h: (label.length * fontSize) + ((label.length - 1) * 1.5 * fontSize)\n };\n }\n\n return {\n w: ctx.measureText(label).width,\n h: fontSize\n };\n }\n\n function determineLimits(angle, pos, size, min, max) {\n if (angle === min || angle === max) {\n return {\n start: pos - (size / 2),\n end: pos + (size / 2)\n };\n } else if (angle < min || angle > max) {\n return {\n start: pos - size - 5,\n end: pos\n };\n }\n\n return {\n start: pos,\n end: pos + size + 5\n };\n }\n\n /**\n * Helper function to fit a radial linear scale with point labels\n */\n function fitWithPointLabels(scale) {\n\t\t\t/*\n\t\t\t * Right, this is really confusing and there is a lot of maths going on here\n\t\t\t * The gist of the problem is here: https://gist.github.com/nnnick/696cc9c55f4b0beb8fe9\n\t\t\t *\n\t\t\t * Reaction: https://dl.dropboxusercontent.com/u/34601363/toomuchscience.gif\n\t\t\t *\n\t\t\t * Solution:\n\t\t\t *\n\t\t\t * We assume the radius of the polygon is half the size of the canvas at first\n\t\t\t * at each index we check if the text overlaps.\n\t\t\t *\n\t\t\t * Where it does, we store that angle and that index.\n\t\t\t *\n\t\t\t * After finding the largest index and angle we calculate how much we need to remove\n\t\t\t * from the shape radius to move the point inwards by that x.\n\t\t\t *\n\t\t\t * We average the left and right distances to get the maximum shape radius that can fit in the box\n\t\t\t * along with labels.\n\t\t\t *\n\t\t\t * Once we have that, we can find the centre point for the chart, by taking the x text protrusion\n\t\t\t * on each side, removing that from the size, halving it and adding the left x protrusion width.\n\t\t\t *\n\t\t\t * This will mean we have a shape fitted to the canvas, as large as it can be with the labels\n\t\t\t * and position it in the most space efficient manner\n\t\t\t *\n\t\t\t * https://dl.dropboxusercontent.com/u/34601363/yeahscience.gif\n\t\t\t */\n\n var plFont = getPointLabelFontOptions(scale);\n\n // Get maximum radius of the polygon. Either half the height (minus the text width) or half the width.\n // Use this to calculate the offset + change. - Make sure L/R protrusion is at least 0 to stop issues with centre points\n var largestPossibleRadius = Math.min(scale.height / 2, scale.width / 2);\n var furthestLimits = {\n r: scale.width,\n l: 0,\n t: scale.height,\n b: 0\n };\n var furthestAngles = {};\n var i, textSize, pointPosition;\n\n scale.ctx.font = plFont.font;\n scale._pointLabelSizes = [];\n\n var valueCount = getValueCount(scale);\n for (i = 0; i < valueCount; i++) {\n pointPosition = scale.getPointPosition(i, largestPossibleRadius);\n textSize = measureLabelSize(scale.ctx, plFont.size, scale.pointLabels[i] || '');\n scale._pointLabelSizes[i] = textSize;\n\n // Add quarter circle to make degree 0 mean top of circle\n var angleRadians = scale.getIndexAngle(i);\n var angle = helpers.toDegrees(angleRadians) % 360;\n var hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180);\n var vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270);\n\n if (hLimits.start < furthestLimits.l) {\n furthestLimits.l = hLimits.start;\n furthestAngles.l = angleRadians;\n }\n\n if (hLimits.end > furthestLimits.r) {\n furthestLimits.r = hLimits.end;\n furthestAngles.r = angleRadians;\n }\n\n if (vLimits.start < furthestLimits.t) {\n furthestLimits.t = vLimits.start;\n furthestAngles.t = angleRadians;\n }\n\n if (vLimits.end > furthestLimits.b) {\n furthestLimits.b = vLimits.end;\n furthestAngles.b = angleRadians;\n }\n }\n\n scale.setReductions(largestPossibleRadius, furthestLimits, furthestAngles);\n }\n\n /**\n * Helper function to fit a radial linear scale with no point labels\n */\n function fit(scale) {\n var largestPossibleRadius = Math.min(scale.height / 2, scale.width / 2);\n scale.drawingArea = Math.round(largestPossibleRadius);\n scale.setCenterPoint(0, 0, 0, 0);\n }\n\n function getTextAlignForAngle(angle) {\n if (angle === 0 || angle === 180) {\n return 'center';\n } else if (angle < 180) {\n return 'left';\n }\n\n return 'right';\n }\n\n function fillText(ctx, text, position, fontSize) {\n if (helpers.isArray(text)) {\n var y = position.y;\n var spacing = 1.5 * fontSize;\n\n for (var i = 0; i < text.length; ++i) {\n ctx.fillText(text[i], position.x, y);\n y += spacing;\n }\n } else {\n ctx.fillText(text, position.x, position.y);\n }\n }\n\n function adjustPointPositionForLabelHeight(angle, textSize, position) {\n if (angle === 90 || angle === 270) {\n position.y -= (textSize.h / 2);\n } else if (angle > 270 || angle < 90) {\n position.y -= textSize.h;\n }\n }\n\n function drawPointLabels(scale) {\n var ctx = scale.ctx;\n var valueOrDefault = helpers.valueOrDefault;\n var opts = scale.options;\n var angleLineOpts = opts.angleLines;\n var pointLabelOpts = opts.pointLabels;\n\n ctx.lineWidth = angleLineOpts.lineWidth;\n ctx.strokeStyle = angleLineOpts.color;\n\n var outerDistance = scale.getDistanceFromCenterForValue(opts.ticks.reverse ? scale.min : scale.max);\n\n // Point Label Font\n var plFont = getPointLabelFontOptions(scale);\n\n ctx.textBaseline = 'top';\n\n for (var i = getValueCount(scale) - 1; i >= 0; i--) {\n if (angleLineOpts.display) {\n var outerPosition = scale.getPointPosition(i, outerDistance);\n ctx.beginPath();\n ctx.moveTo(scale.xCenter, scale.yCenter);\n ctx.lineTo(outerPosition.x, outerPosition.y);\n ctx.stroke();\n ctx.closePath();\n }\n\n if (pointLabelOpts.display) {\n // Extra 3px out for some label spacing\n var pointLabelPosition = scale.getPointPosition(i, outerDistance + 5);\n\n // Keep this in loop since we may support array properties here\n var pointLabelFontColor = valueOrDefault(pointLabelOpts.fontColor, globalDefaults.defaultFontColor);\n ctx.font = plFont.font;\n ctx.fillStyle = pointLabelFontColor;\n\n var angleRadians = scale.getIndexAngle(i);\n var angle = helpers.toDegrees(angleRadians);\n ctx.textAlign = getTextAlignForAngle(angle);\n adjustPointPositionForLabelHeight(angle, scale._pointLabelSizes[i], pointLabelPosition);\n fillText(ctx, scale.pointLabels[i] || '', pointLabelPosition, plFont.size);\n }\n }\n }\n\n function drawRadiusLine(scale, gridLineOpts, radius, index) {\n var ctx = scale.ctx;\n ctx.strokeStyle = helpers.valueAtIndexOrDefault(gridLineOpts.color, index - 1);\n ctx.lineWidth = helpers.valueAtIndexOrDefault(gridLineOpts.lineWidth, index - 1);\n\n if (scale.options.gridLines.circular) {\n // Draw circular arcs between the points\n ctx.beginPath();\n ctx.arc(scale.xCenter, scale.yCenter, radius, 0, Math.PI * 2);\n ctx.closePath();\n ctx.stroke();\n } else {\n // Draw straight lines connecting each index\n var valueCount = getValueCount(scale);\n\n if (valueCount === 0) {\n return;\n }\n\n ctx.beginPath();\n var pointPosition = scale.getPointPosition(0, radius);\n ctx.moveTo(pointPosition.x, pointPosition.y);\n\n for (var i = 1; i < valueCount; i++) {\n pointPosition = scale.getPointPosition(i, radius);\n ctx.lineTo(pointPosition.x, pointPosition.y);\n }\n\n ctx.closePath();\n ctx.stroke();\n }\n }\n\n function numberOrZero(param) {\n return helpers.isNumber(param) ? param : 0;\n }\n\n var LinearRadialScale = Chart.LinearScaleBase.extend({\n setDimensions: function() {\n var me = this;\n var opts = me.options;\n var tickOpts = opts.ticks;\n // Set the unconstrained dimension before label rotation\n me.width = me.maxWidth;\n me.height = me.maxHeight;\n me.xCenter = Math.round(me.width / 2);\n me.yCenter = Math.round(me.height / 2);\n\n var minSize = helpers.min([me.height, me.width]);\n var tickFontSize = helpers.valueOrDefault(tickOpts.fontSize, globalDefaults.defaultFontSize);\n me.drawingArea = opts.display ? (minSize / 2) - (tickFontSize / 2 + tickOpts.backdropPaddingY) : (minSize / 2);\n },\n determineDataLimits: function() {\n var me = this;\n var chart = me.chart;\n var min = Number.POSITIVE_INFINITY;\n var max = Number.NEGATIVE_INFINITY;\n\n helpers.each(chart.data.datasets, function(dataset, datasetIndex) {\n if (chart.isDatasetVisible(datasetIndex)) {\n var meta = chart.getDatasetMeta(datasetIndex);\n\n helpers.each(dataset.data, function(rawValue, index) {\n var value = +me.getRightValue(rawValue);\n if (isNaN(value) || meta.data[index].hidden) {\n return;\n }\n\n min = Math.min(value, min);\n max = Math.max(value, max);\n });\n }\n });\n\n me.min = (min === Number.POSITIVE_INFINITY ? 0 : min);\n me.max = (max === Number.NEGATIVE_INFINITY ? 0 : max);\n\n // Common base implementation to handle ticks.min, ticks.max, ticks.beginAtZero\n me.handleTickRangeOptions();\n },\n getTickLimit: function() {\n var tickOpts = this.options.ticks;\n var tickFontSize = helpers.valueOrDefault(tickOpts.fontSize, globalDefaults.defaultFontSize);\n return Math.min(tickOpts.maxTicksLimit ? tickOpts.maxTicksLimit : 11, Math.ceil(this.drawingArea / (1.5 * tickFontSize)));\n },\n convertTicksToLabels: function() {\n var me = this;\n\n Chart.LinearScaleBase.prototype.convertTicksToLabels.call(me);\n\n // Point labels\n me.pointLabels = me.chart.data.labels.map(me.options.pointLabels.callback, me);\n },\n getLabelForIndex: function(index, datasetIndex) {\n return +this.getRightValue(this.chart.data.datasets[datasetIndex].data[index]);\n },\n fit: function() {\n if (this.options.pointLabels.display) {\n fitWithPointLabels(this);\n } else {\n fit(this);\n }\n },\n /**\n * Set radius reductions and determine new radius and center point\n * @private\n */\n setReductions: function(largestPossibleRadius, furthestLimits, furthestAngles) {\n var me = this;\n var radiusReductionLeft = furthestLimits.l / Math.sin(furthestAngles.l);\n var radiusReductionRight = Math.max(furthestLimits.r - me.width, 0) / Math.sin(furthestAngles.r);\n var radiusReductionTop = -furthestLimits.t / Math.cos(furthestAngles.t);\n var radiusReductionBottom = -Math.max(furthestLimits.b - me.height, 0) / Math.cos(furthestAngles.b);\n\n radiusReductionLeft = numberOrZero(radiusReductionLeft);\n radiusReductionRight = numberOrZero(radiusReductionRight);\n radiusReductionTop = numberOrZero(radiusReductionTop);\n radiusReductionBottom = numberOrZero(radiusReductionBottom);\n\n me.drawingArea = Math.min(\n Math.round(largestPossibleRadius - (radiusReductionLeft + radiusReductionRight) / 2),\n Math.round(largestPossibleRadius - (radiusReductionTop + radiusReductionBottom) / 2));\n me.setCenterPoint(radiusReductionLeft, radiusReductionRight, radiusReductionTop, radiusReductionBottom);\n },\n setCenterPoint: function(leftMovement, rightMovement, topMovement, bottomMovement) {\n var me = this;\n var maxRight = me.width - rightMovement - me.drawingArea;\n var maxLeft = leftMovement + me.drawingArea;\n var maxTop = topMovement + me.drawingArea;\n var maxBottom = me.height - bottomMovement - me.drawingArea;\n\n me.xCenter = Math.round(((maxLeft + maxRight) / 2) + me.left);\n me.yCenter = Math.round(((maxTop + maxBottom) / 2) + me.top);\n },\n\n getIndexAngle: function(index) {\n var angleMultiplier = (Math.PI * 2) / getValueCount(this);\n var startAngle = this.chart.options && this.chart.options.startAngle ?\n this.chart.options.startAngle :\n 0;\n\n var startAngleRadians = startAngle * Math.PI * 2 / 360;\n\n // Start from the top instead of right, so remove a quarter of the circle\n return index * angleMultiplier + startAngleRadians;\n },\n getDistanceFromCenterForValue: function(value) {\n var me = this;\n\n if (value === null) {\n return 0; // null always in center\n }\n\n // Take into account half font size + the yPadding of the top value\n var scalingFactor = me.drawingArea / (me.max - me.min);\n if (me.options.ticks.reverse) {\n return (me.max - value) * scalingFactor;\n }\n return (value - me.min) * scalingFactor;\n },\n getPointPosition: function(index, distanceFromCenter) {\n var me = this;\n var thisAngle = me.getIndexAngle(index) - (Math.PI / 2);\n return {\n x: Math.round(Math.cos(thisAngle) * distanceFromCenter) + me.xCenter,\n y: Math.round(Math.sin(thisAngle) * distanceFromCenter) + me.yCenter\n };\n },\n getPointPositionForValue: function(index, value) {\n return this.getPointPosition(index, this.getDistanceFromCenterForValue(value));\n },\n\n getBasePosition: function() {\n var me = this;\n var min = me.min;\n var max = me.max;\n\n return me.getPointPositionForValue(0,\n me.beginAtZero ? 0 :\n min < 0 && max < 0 ? max :\n min > 0 && max > 0 ? min :\n 0);\n },\n\n draw: function() {\n var me = this;\n var opts = me.options;\n var gridLineOpts = opts.gridLines;\n var tickOpts = opts.ticks;\n var valueOrDefault = helpers.valueOrDefault;\n\n if (opts.display) {\n var ctx = me.ctx;\n var startAngle = this.getIndexAngle(0);\n\n // Tick Font\n var tickFontSize = valueOrDefault(tickOpts.fontSize, globalDefaults.defaultFontSize);\n var tickFontStyle = valueOrDefault(tickOpts.fontStyle, globalDefaults.defaultFontStyle);\n var tickFontFamily = valueOrDefault(tickOpts.fontFamily, globalDefaults.defaultFontFamily);\n var tickLabelFont = helpers.fontString(tickFontSize, tickFontStyle, tickFontFamily);\n\n helpers.each(me.ticks, function(label, index) {\n // Don't draw a centre value (if it is minimum)\n if (index > 0 || tickOpts.reverse) {\n var yCenterOffset = me.getDistanceFromCenterForValue(me.ticksAsNumbers[index]);\n\n // Draw circular lines around the scale\n if (gridLineOpts.display && index !== 0) {\n drawRadiusLine(me, gridLineOpts, yCenterOffset, index);\n }\n\n if (tickOpts.display) {\n var tickFontColor = valueOrDefault(tickOpts.fontColor, globalDefaults.defaultFontColor);\n ctx.font = tickLabelFont;\n\n ctx.save();\n ctx.translate(me.xCenter, me.yCenter);\n ctx.rotate(startAngle);\n\n if (tickOpts.showLabelBackdrop) {\n var labelWidth = ctx.measureText(label).width;\n ctx.fillStyle = tickOpts.backdropColor;\n ctx.fillRect(\n -labelWidth / 2 - tickOpts.backdropPaddingX,\n -yCenterOffset - tickFontSize / 2 - tickOpts.backdropPaddingY,\n labelWidth + tickOpts.backdropPaddingX * 2,\n tickFontSize + tickOpts.backdropPaddingY * 2\n );\n }\n\n ctx.textAlign = 'center';\n ctx.textBaseline = 'middle';\n ctx.fillStyle = tickFontColor;\n ctx.fillText(label, 0, -yCenterOffset);\n ctx.restore();\n }\n }\n });\n\n if (opts.angleLines.display || opts.pointLabels.display) {\n drawPointLabels(me);\n }\n }\n }\n });\n Chart.scaleService.registerScaleType('radialLinear', LinearRadialScale, defaultConfig);\n\n };\n\n},{\"25\":25,\"34\":34,\"45\":45}],57:[function(require,module,exports){\n\t/* global window: false */\n 'use strict';\n\n var moment = require(6);\n moment = typeof moment === 'function' ? moment : window.moment;\n\n var defaults = require(25);\n var helpers = require(45);\n\n// Integer constants are from the ES6 spec.\n var MIN_INTEGER = Number.MIN_SAFE_INTEGER || -9007199254740991;\n var MAX_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;\n\n var INTERVALS = {\n millisecond: {\n major: true,\n size: 1,\n steps: [1, 2, 5, 10, 20, 50, 100, 250, 500]\n },\n second: {\n major: true,\n size: 1000,\n steps: [1, 2, 5, 10, 30]\n },\n minute: {\n major: true,\n size: 60000,\n steps: [1, 2, 5, 10, 30]\n },\n hour: {\n major: true,\n size: 3600000,\n steps: [1, 2, 3, 6, 12]\n },\n day: {\n major: true,\n size: 86400000,\n steps: [1, 2, 5]\n },\n week: {\n major: false,\n size: 604800000,\n steps: [1, 2, 3, 4]\n },\n month: {\n major: true,\n size: 2.628e9,\n steps: [1, 2, 3]\n },\n quarter: {\n major: false,\n size: 7.884e9,\n steps: [1, 2, 3, 4]\n },\n year: {\n major: true,\n size: 3.154e10\n }\n };\n\n var UNITS = Object.keys(INTERVALS);\n\n function sorter(a, b) {\n return a - b;\n }\n\n function arrayUnique(items) {\n var hash = {};\n var out = [];\n var i, ilen, item;\n\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n item = items[i];\n if (!hash[item]) {\n hash[item] = true;\n out.push(item);\n }\n }\n\n return out;\n }\n\n /**\n * Returns an array of {time, pos} objects used to interpolate a specific `time` or position\n * (`pos`) on the scale, by searching entries before and after the requested value. `pos` is\n * a decimal between 0 and 1: 0 being the start of the scale (left or top) and 1 the other\n * extremity (left + width or top + height). Note that it would be more optimized to directly\n * store pre-computed pixels, but the scale dimensions are not guaranteed at the time we need\n * to create the lookup table. The table ALWAYS contains at least two items: min and max.\n *\n * @param {Number[]} timestamps - timestamps sorted from lowest to highest.\n * @param {String} distribution - If 'linear', timestamps will be spread linearly along the min\n * and max range, so basically, the table will contains only two items: {min, 0} and {max, 1}.\n * If 'series', timestamps will be positioned at the same distance from each other. In this\n * case, only timestamps that break the time linearity are registered, meaning that in the\n * best case, all timestamps are linear, the table contains only min and max.\n */\n function buildLookupTable(timestamps, min, max, distribution) {\n if (distribution === 'linear' || !timestamps.length) {\n return [\n {time: min, pos: 0},\n {time: max, pos: 1}\n ];\n }\n\n var table = [];\n var items = [min];\n var i, ilen, prev, curr, next;\n\n for (i = 0, ilen = timestamps.length; i < ilen; ++i) {\n curr = timestamps[i];\n if (curr > min && curr < max) {\n items.push(curr);\n }\n }\n\n items.push(max);\n\n for (i = 0, ilen = items.length; i < ilen; ++i) {\n next = items[i + 1];\n prev = items[i - 1];\n curr = items[i];\n\n // only add points that breaks the scale linearity\n if (prev === undefined || next === undefined || Math.round((next + prev) / 2) !== curr) {\n table.push({time: curr, pos: i / (ilen - 1)});\n }\n }\n\n return table;\n }\n\n// @see adapted from http://www.anujgakhar.com/2014/03/01/binary-search-in-javascript/\n function lookup(table, key, value) {\n var lo = 0;\n var hi = table.length - 1;\n var mid, i0, i1;\n\n while (lo >= 0 && lo <= hi) {\n mid = (lo + hi) >> 1;\n i0 = table[mid - 1] || null;\n i1 = table[mid];\n\n if (!i0) {\n // given value is outside table (before first item)\n return {lo: null, hi: i1};\n } else if (i1[key] < value) {\n lo = mid + 1;\n } else if (i0[key] > value) {\n hi = mid - 1;\n } else {\n return {lo: i0, hi: i1};\n }\n }\n\n // given value is outside table (after last item)\n return {lo: i1, hi: null};\n }\n\n /**\n * Linearly interpolates the given source `value` using the table items `skey` values and\n * returns the associated `tkey` value. For example, interpolate(table, 'time', 42, 'pos')\n * returns the position for a timestamp equal to 42. If value is out of bounds, values at\n * index [0, 1] or [n - 1, n] are used for the interpolation.\n */\n function interpolate(table, skey, sval, tkey) {\n var range = lookup(table, skey, sval);\n\n // Note: the lookup table ALWAYS contains at least 2 items (min and max)\n var prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;\n var next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;\n\n var span = next[skey] - prev[skey];\n var ratio = span ? (sval - prev[skey]) / span : 0;\n var offset = (next[tkey] - prev[tkey]) * ratio;\n\n return prev[tkey] + offset;\n }\n\n /**\n * Convert the given value to a moment object using the given time options.\n * @see http://momentjs.com/docs/#/parsing/\n */\n function momentify(value, options) {\n var parser = options.parser;\n var format = options.parser || options.format;\n\n if (typeof parser === 'function') {\n return parser(value);\n }\n\n if (typeof value === 'string' && typeof format === 'string') {\n return moment(value, format);\n }\n\n if (!(value instanceof moment)) {\n value = moment(value);\n }\n\n if (value.isValid()) {\n return value;\n }\n\n // Labels are in an incompatible moment format and no `parser` has been provided.\n // The user might still use the deprecated `format` option to convert his inputs.\n if (typeof format === 'function') {\n return format(value);\n }\n\n return value;\n }\n\n function parse(input, scale) {\n if (helpers.isNullOrUndef(input)) {\n return null;\n }\n\n var options = scale.options.time;\n var value = momentify(scale.getRightValue(input), options);\n if (!value.isValid()) {\n return null;\n }\n\n if (options.round) {\n value.startOf(options.round);\n }\n\n return value.valueOf();\n }\n\n /**\n * Returns the number of unit to skip to be able to display up to `capacity` number of ticks\n * in `unit` for the given `min` / `max` range and respecting the interval steps constraints.\n */\n function determineStepSize(min, max, unit, capacity) {\n var range = max - min;\n var interval = INTERVALS[unit];\n var milliseconds = interval.size;\n var steps = interval.steps;\n var i, ilen, factor;\n\n if (!steps) {\n return Math.ceil(range / ((capacity || 1) * milliseconds));\n }\n\n for (i = 0, ilen = steps.length; i < ilen; ++i) {\n factor = steps[i];\n if (Math.ceil(range / (milliseconds * factor)) <= capacity) {\n break;\n }\n }\n\n return factor;\n }\n\n function determineUnit(minUnit, min, max, capacity) {\n var ilen = UNITS.length;\n var i, interval, factor;\n\n for (i = UNITS.indexOf(minUnit); i < ilen - 1; ++i) {\n interval = INTERVALS[UNITS[i]];\n factor = interval.steps ? interval.steps[interval.steps.length - 1] : MAX_INTEGER;\n\n if (Math.ceil((max - min) / (factor * interval.size)) <= capacity) {\n return UNITS[i];\n }\n }\n\n return UNITS[ilen - 1];\n }\n\n function determineMajorUnit(unit) {\n for (var i = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i < ilen; ++i) {\n if (INTERVALS[UNITS[i]].major) {\n return UNITS[i];\n }\n }\n }\n\n /**\n * Generates a maximum of `capacity` timestamps between min and max, rounded to the\n * `minor` unit, aligned on the `major` unit and using the given scale time `options`.\n * Important: this method can return ticks outside the min and max range, it's the\n * responsibility of the calling code to clamp values if needed.\n */\n function generate(min, max, minor, major, capacity, options) {\n var timeOpts = options.time;\n var stepSize = helpers.valueOrDefault(timeOpts.stepSize, timeOpts.unitStepSize);\n var weekday = minor === 'week' ? timeOpts.isoWeekday : false;\n var majorTicksEnabled = options.ticks.major.enabled;\n var interval = INTERVALS[minor];\n var first = moment(min);\n var last = moment(max);\n var ticks = [];\n var time;\n\n if (!stepSize) {\n stepSize = determineStepSize(min, max, minor, capacity);\n }\n\n // For 'week' unit, handle the first day of week option\n if (weekday) {\n first = first.isoWeekday(weekday);\n last = last.isoWeekday(weekday);\n }\n\n // Align first/last ticks on unit\n first = first.startOf(weekday ? 'day' : minor);\n last = last.startOf(weekday ? 'day' : minor);\n\n // Make sure that the last tick include max\n if (last < max) {\n last.add(1, minor);\n }\n\n time = moment(first);\n\n if (majorTicksEnabled && major && !weekday && !timeOpts.round) {\n // Align the first tick on the previous `minor` unit aligned on the `major` unit:\n // we first aligned time on the previous `major` unit then add the number of full\n // stepSize there is between first and the previous major time.\n time.startOf(major);\n time.add(~~((first - time) / (interval.size * stepSize)) * stepSize, minor);\n }\n\n for (; time < last; time.add(stepSize, minor)) {\n ticks.push(+time);\n }\n\n ticks.push(+time);\n\n return ticks;\n }\n\n /**\n * Returns the right and left offsets from edges in the form of {left, right}.\n * Offsets are added when the `offset` option is true.\n */\n function computeOffsets(table, ticks, min, max, options) {\n var left = 0;\n var right = 0;\n var upper, lower;\n\n if (options.offset && ticks.length) {\n if (!options.time.min) {\n upper = ticks.length > 1 ? ticks[1] : max;\n lower = ticks[0];\n left = (\n interpolate(table, 'time', upper, 'pos') -\n interpolate(table, 'time', lower, 'pos')\n ) / 2;\n }\n if (!options.time.max) {\n upper = ticks[ticks.length - 1];\n lower = ticks.length > 1 ? ticks[ticks.length - 2] : min;\n right = (\n interpolate(table, 'time', upper, 'pos') -\n interpolate(table, 'time', lower, 'pos')\n ) / 2;\n }\n }\n\n return {left: left, right: right};\n }\n\n function ticksFromTimestamps(values, majorUnit) {\n var ticks = [];\n var i, ilen, value, major;\n\n for (i = 0, ilen = values.length; i < ilen; ++i) {\n value = values[i];\n major = majorUnit ? value === +moment(value).startOf(majorUnit) : false;\n\n ticks.push({\n value: value,\n major: major\n });\n }\n\n return ticks;\n }\n\n module.exports = function(Chart) {\n\n var defaultConfig = {\n position: 'bottom',\n\n /**\n * Data distribution along the scale:\n * - 'linear': data are spread according to their time (distances can vary),\n * - 'series': data are spread at the same distance from each other.\n * @see https://github.com/chartjs/Chart.js/pull/4507\n * @since 2.7.0\n */\n distribution: 'linear',\n\n /**\n * Scale boundary strategy (bypassed by min/max time options)\n * - `data`: make sure data are fully visible, ticks outside are removed\n * - `ticks`: make sure ticks are fully visible, data outside are truncated\n * @see https://github.com/chartjs/Chart.js/pull/4556\n * @since 2.7.0\n */\n bounds: 'data',\n\n time: {\n parser: false, // false == a pattern string from http://momentjs.com/docs/#/parsing/string-format/ or a custom callback that converts its argument to a moment\n format: false, // DEPRECATED false == date objects, moment object, callback or a pattern string from http://momentjs.com/docs/#/parsing/string-format/\n unit: false, // false == automatic or override with week, month, year, etc.\n round: false, // none, or override with week, month, year, etc.\n displayFormat: false, // DEPRECATED\n isoWeekday: false, // override week start day - see http://momentjs.com/docs/#/get-set/iso-weekday/\n minUnit: 'millisecond',\n\n // defaults to unit's corresponding unitFormat below or override using pattern string from http://momentjs.com/docs/#/displaying/format/\n displayFormats: {\n millisecond: 'h:mm:ss.SSS a', // 11:20:01.123 AM,\n second: 'h:mm:ss a', // 11:20:01 AM\n minute: 'h:mm a', // 11:20 AM\n hour: 'hA', // 5PM\n day: 'MMM D', // Sep 4\n week: 'll', // Week 46, or maybe \"[W]WW - YYYY\" ?\n month: 'MMM YYYY', // Sept 2015\n quarter: '[Q]Q - YYYY', // Q3\n year: 'YYYY' // 2015\n },\n },\n ticks: {\n autoSkip: false,\n\n /**\n * Ticks generation input values:\n * - 'auto': generates \"optimal\" ticks based on scale size and time options.\n * - 'data': generates ticks from data (including labels from data {t|x|y} objects).\n * - 'labels': generates ticks from user given `data.labels` values ONLY.\n * @see https://github.com/chartjs/Chart.js/pull/4507\n * @since 2.7.0\n */\n source: 'auto',\n\n major: {\n enabled: false\n }\n }\n };\n\n var TimeScale = Chart.Scale.extend({\n initialize: function() {\n if (!moment) {\n throw new Error('Chart.js - Moment.js could not be found! You must include it before Chart.js to use the time scale. Download at https://momentjs.com');\n }\n\n this.mergeTicksOptions();\n\n Chart.Scale.prototype.initialize.call(this);\n },\n\n update: function() {\n var me = this;\n var options = me.options;\n\n // DEPRECATIONS: output a message only one time per update\n if (options.time && options.time.format) {\n console.warn('options.time.format is deprecated and replaced by options.time.parser.');\n }\n\n return Chart.Scale.prototype.update.apply(me, arguments);\n },\n\n /**\n * Allows data to be referenced via 't' attribute\n */\n getRightValue: function(rawValue) {\n if (rawValue && rawValue.t !== undefined) {\n rawValue = rawValue.t;\n }\n return Chart.Scale.prototype.getRightValue.call(this, rawValue);\n },\n\n determineDataLimits: function() {\n var me = this;\n var chart = me.chart;\n var timeOpts = me.options.time;\n var min = parse(timeOpts.min, me) || MAX_INTEGER;\n var max = parse(timeOpts.max, me) || MIN_INTEGER;\n var timestamps = [];\n var datasets = [];\n var labels = [];\n var i, j, ilen, jlen, data, timestamp;\n\n // Convert labels to timestamps\n for (i = 0, ilen = chart.data.labels.length; i < ilen; ++i) {\n labels.push(parse(chart.data.labels[i], me));\n }\n\n // Convert data to timestamps\n for (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) {\n if (chart.isDatasetVisible(i)) {\n data = chart.data.datasets[i].data;\n\n // Let's consider that all data have the same format.\n if (helpers.isObject(data[0])) {\n datasets[i] = [];\n\n for (j = 0, jlen = data.length; j < jlen; ++j) {\n timestamp = parse(data[j], me);\n timestamps.push(timestamp);\n datasets[i][j] = timestamp;\n }\n } else {\n timestamps.push.apply(timestamps, labels);\n datasets[i] = labels.slice(0);\n }\n } else {\n datasets[i] = [];\n }\n }\n\n if (labels.length) {\n // Sort labels **after** data have been converted\n labels = arrayUnique(labels).sort(sorter);\n min = Math.min(min, labels[0]);\n max = Math.max(max, labels[labels.length - 1]);\n }\n\n if (timestamps.length) {\n timestamps = arrayUnique(timestamps).sort(sorter);\n min = Math.min(min, timestamps[0]);\n max = Math.max(max, timestamps[timestamps.length - 1]);\n }\n\n // In case there is no valid min/max, let's use today limits\n min = min === MAX_INTEGER ? +moment().startOf('day') : min;\n max = max === MIN_INTEGER ? +moment().endOf('day') + 1 : max;\n\n // Make sure that max is strictly higher than min (required by the lookup table)\n me.min = Math.min(min, max);\n me.max = Math.max(min + 1, max);\n\n // PRIVATE\n me._horizontal = me.isHorizontal();\n me._table = [];\n me._timestamps = {\n data: timestamps,\n datasets: datasets,\n labels: labels\n };\n },\n\n buildTicks: function() {\n var me = this;\n var min = me.min;\n var max = me.max;\n var options = me.options;\n var timeOpts = options.time;\n var formats = timeOpts.displayFormats;\n var capacity = me.getLabelCapacity(min);\n var unit = timeOpts.unit || determineUnit(timeOpts.minUnit, min, max, capacity);\n var majorUnit = determineMajorUnit(unit);\n var timestamps = [];\n var ticks = [];\n var i, ilen, timestamp;\n\n switch (options.ticks.source) {\n case 'data':\n timestamps = me._timestamps.data;\n break;\n case 'labels':\n timestamps = me._timestamps.labels;\n break;\n case 'auto':\n default:\n timestamps = generate(min, max, unit, majorUnit, capacity, options);\n }\n\n if (options.bounds === 'ticks' && timestamps.length) {\n min = timestamps[0];\n max = timestamps[timestamps.length - 1];\n }\n\n // Enforce limits with user min/max options\n min = parse(timeOpts.min, me) || min;\n max = parse(timeOpts.max, me) || max;\n\n // Remove ticks outside the min/max range\n for (i = 0, ilen = timestamps.length; i < ilen; ++i) {\n timestamp = timestamps[i];\n if (timestamp >= min && timestamp <= max) {\n ticks.push(timestamp);\n }\n }\n\n me.min = min;\n me.max = max;\n\n // PRIVATE\n me._unit = unit;\n me._majorUnit = majorUnit;\n me._minorFormat = formats[unit];\n me._majorFormat = formats[majorUnit];\n me._table = buildLookupTable(me._timestamps.data, min, max, options.distribution);\n me._offsets = computeOffsets(me._table, ticks, min, max, options);\n\n return ticksFromTimestamps(ticks, majorUnit);\n },\n\n getLabelForIndex: function(index, datasetIndex) {\n var me = this;\n var data = me.chart.data;\n var timeOpts = me.options.time;\n var label = data.labels && index < data.labels.length ? data.labels[index] : '';\n var value = data.datasets[datasetIndex].data[index];\n\n if (helpers.isObject(value)) {\n label = me.getRightValue(value);\n }\n if (timeOpts.tooltipFormat) {\n label = momentify(label, timeOpts).format(timeOpts.tooltipFormat);\n }\n\n return label;\n },\n\n /**\n * Function to format an individual tick mark\n * @private\n */\n tickFormatFunction: function(tick, index, ticks) {\n var me = this;\n var options = me.options;\n var time = tick.valueOf();\n var majorUnit = me._majorUnit;\n var majorFormat = me._majorFormat;\n var majorTime = tick.clone().startOf(me._majorUnit).valueOf();\n var majorTickOpts = options.ticks.major;\n var major = majorTickOpts.enabled && majorUnit && majorFormat && time === majorTime;\n var label = tick.format(major ? majorFormat : me._minorFormat);\n var tickOpts = major ? majorTickOpts : options.ticks.minor;\n var formatter = helpers.valueOrDefault(tickOpts.callback, tickOpts.userCallback);\n\n return formatter ? formatter(label, index, ticks) : label;\n },\n\n convertTicksToLabels: function(ticks) {\n var labels = [];\n var i, ilen;\n\n for (i = 0, ilen = ticks.length; i < ilen; ++i) {\n labels.push(this.tickFormatFunction(moment(ticks[i].value), i, ticks));\n }\n\n return labels;\n },\n\n /**\n * @private\n */\n getPixelForOffset: function(time) {\n var me = this;\n var size = me._horizontal ? me.width : me.height;\n var start = me._horizontal ? me.left : me.top;\n var pos = interpolate(me._table, 'time', time, 'pos');\n\n return start + size * (me._offsets.left + pos) / (me._offsets.left + 1 + me._offsets.right);\n },\n\n getPixelForValue: function(value, index, datasetIndex) {\n var me = this;\n var time = null;\n\n if (index !== undefined && datasetIndex !== undefined) {\n time = me._timestamps.datasets[datasetIndex][index];\n }\n\n if (time === null) {\n time = parse(value, me);\n }\n\n if (time !== null) {\n return me.getPixelForOffset(time);\n }\n },\n\n getPixelForTick: function(index) {\n var ticks = this.getTicks();\n return index >= 0 && index < ticks.length ?\n this.getPixelForOffset(ticks[index].value) :\n null;\n },\n\n getValueForPixel: function(pixel) {\n var me = this;\n var size = me._horizontal ? me.width : me.height;\n var start = me._horizontal ? me.left : me.top;\n var pos = (size ? (pixel - start) / size : 0) * (me._offsets.left + 1 + me._offsets.left) - me._offsets.right;\n var time = interpolate(me._table, 'pos', pos, 'time');\n\n return moment(time);\n },\n\n /**\n * Crude approximation of what the label width might be\n * @private\n */\n getLabelWidth: function(label) {\n var me = this;\n var ticksOpts = me.options.ticks;\n var tickLabelWidth = me.ctx.measureText(label).width;\n var angle = helpers.toRadians(ticksOpts.maxRotation);\n var cosRotation = Math.cos(angle);\n var sinRotation = Math.sin(angle);\n var tickFontSize = helpers.valueOrDefault(ticksOpts.fontSize, defaults.global.defaultFontSize);\n\n return (tickLabelWidth * cosRotation) + (tickFontSize * sinRotation);\n },\n\n /**\n * @private\n */\n getLabelCapacity: function(exampleTime) {\n var me = this;\n\n me._minorFormat = me.options.time.displayFormats.millisecond;\t// Pick the longest format for guestimation\n\n var exampleLabel = me.tickFormatFunction(moment(exampleTime), 0, []);\n var tickLabelWidth = me.getLabelWidth(exampleLabel);\n var innerWidth = me.isHorizontal() ? me.width : me.height;\n\n return Math.floor(innerWidth / tickLabelWidth);\n }\n });\n\n Chart.scaleService.registerScaleType('time', TimeScale, defaultConfig);\n };\n\n},{\"25\":25,\"45\":45,\"6\":6}]},{},[7])(7)\n});"],"file":"chartjs-lazy.min.js"} \ No newline at end of file diff --git a/lib/amd/build/drawer.min.js b/lib/amd/build/drawer.min.js index 760a6742874..88a272fca69 100644 --- a/lib/amd/build/drawer.min.js +++ b/lib/amd/build/drawer.min.js @@ -1,2 +1,2 @@ -function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("core/drawer",["exports","jquery","core/pubsub","core/drawer_events"],function(a,b,c,d){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=g(b);c=f(c);d=g(d);function e(){if("function"!=typeof WeakMap)return null;var a=new WeakMap;e=function(){return a};return a}function f(a){if(a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var b=e();if(b&&b.has(a)){return b.get(a)}var c={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in a){if(Object.prototype.hasOwnProperty.call(a,f)){var g=d?Object.getOwnPropertyDescriptor(a,f):null;if(g&&(g.get||g.set)){Object.defineProperty(c,f,g)}else{c[f]=a[f]}}}c.default=a;if(b){b.set(a,c)}return c}function g(a){return a&&a.__esModule?a:{default:a}}var h=function(a){a.removeClass("hidden");a.attr("aria-expanded",!0);a.removeAttr("aria-hidden");a.focus();c.publish(d.default.DRAWER_SHOWN,a)},i=function(a){a.addClass("hidden");a.attr("aria-expanded",!1);a.attr("aria-hidden",!0);c.publish(d.default.DRAWER_HIDDEN,a)},j=function(a){var b=a.hasClass("hidden");return!b},k=function(a){if(j(a)){i(a)}else{h(a)}},l=function(a){a=(0,b.default)(a);return a.closest("[data-region=\"right-hand-drawer\"]")};a.default={hide:i,show:h,isVisible:j,toggle:k,registerToggles:function registerToggles(a,b){var c=null;b.attr("aria-expanded",j(a));b.on("click",function(d){d.preventDefault();var e=j(a);k(a);b.attr("aria-expanded",!e);if(!e){c=b.filter(function(a,b){return b==d.target||b.contains(d.target)})}else if(c){c.focus();c=null}})},getDrawerRoot:l};return a.default}); +function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}define ("core/drawer",["exports","jquery","core/pubsub","core/drawer_events"],function(a,b,c,d){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=g(b);c=f(c);d=g(d);function e(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(e=function(a){return a?c:b})(a)}function f(a,b){if(!b&&a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var c=e(b);if(c&&c.has(a)){return c.get(a)}var d={},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a){if("default"!=g&&Object.prototype.hasOwnProperty.call(a,g)){var h=f?Object.getOwnPropertyDescriptor(a,g):null;if(h&&(h.get||h.set)){Object.defineProperty(d,g,h)}else{d[g]=a[g]}}}d.default=a;if(c){c.set(a,d)}return d}function g(a){return a&&a.__esModule?a:{default:a}}var h=function(a){a.removeClass("hidden");a.attr("aria-expanded",!0);a.removeAttr("aria-hidden");a.focus();c.publish(d.default.DRAWER_SHOWN,a)},i=function(a){a.addClass("hidden");a.attr("aria-expanded",!1);a.attr("aria-hidden",!0);c.publish(d.default.DRAWER_HIDDEN,a)},j=function(a){var b=a.hasClass("hidden");return!b},k=function(a){if(j(a)){i(a)}else{h(a)}},l=function(a){a=(0,b.default)(a);return a.closest("[data-region=\"right-hand-drawer\"]")};a.default={hide:i,show:h,isVisible:j,toggle:k,registerToggles:function registerToggles(a,b){var c=null;b.attr("aria-expanded",j(a));b.on("click",function(d){d.preventDefault();var e=j(a);k(a);b.attr("aria-expanded",!e);if(!e){c=b.filter(function(a,b){return b==d.target||b.contains(d.target)})}else if(c){c.focus();c=null}})},getDrawerRoot:l};return a.default}); //# sourceMappingURL=drawer.min.js.map diff --git a/lib/amd/build/drawer.min.js.map b/lib/amd/build/drawer.min.js.map index 82cdd89ccc2..1cf7b2877ed 100644 --- a/lib/amd/build/drawer.min.js.map +++ b/lib/amd/build/drawer.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/drawer.js"],"names":["show","root","removeClass","attr","removeAttr","focus","PubSub","publish","DrawerEvents","DRAWER_SHOWN","hide","addClass","DRAWER_HIDDEN","isVisible","isHidden","hasClass","toggle","getDrawerRoot","contentRoot","closest","registerToggles","toggleElements","openTrigger","on","e","preventDefault","wasVisible","filter","index","element","target","contains"],"mappings":"kdAsBA,OACA,OACA,O,4lBAOMA,CAAAA,CAAI,CAAG,SAACC,CAAD,CAAU,CACnBA,CAAI,CAACC,WAAL,CAAiB,QAAjB,EACAD,CAAI,CAACE,IAAL,CAAU,eAAV,KACAF,CAAI,CAACG,UAAL,CAAgB,aAAhB,EACAH,CAAI,CAACI,KAAL,GAEAC,CAAM,CAACC,OAAP,CAAeC,UAAaC,YAA5B,CAA0CR,CAA1C,CACH,C,CAOKS,CAAI,CAAG,SAACT,CAAD,CAAU,CACnBA,CAAI,CAACU,QAAL,CAAc,QAAd,EACAV,CAAI,CAACE,IAAL,CAAU,eAAV,KACAF,CAAI,CAACE,IAAL,CAAU,aAAV,KACAG,CAAM,CAACC,OAAP,CAAeC,UAAaI,aAA5B,CAA2CX,CAA3C,CACH,C,CAQKY,CAAS,CAAG,SAACZ,CAAD,CAAU,CACxB,GAAIa,CAAAA,CAAQ,CAAGb,CAAI,CAACc,QAAL,CAAc,QAAd,CAAf,CACA,MAAO,CAACD,CACX,C,CAOKE,CAAM,CAAG,SAACf,CAAD,CAAU,CACrB,GAAIY,CAAS,CAACZ,CAAD,CAAb,CAAqB,CACjBS,CAAI,CAACT,CAAD,CACP,CAFD,IAEO,CACHD,CAAI,CAACC,CAAD,CACP,CACJ,C,CAsCKgB,CAAa,CAAG,SAACC,CAAD,CAAiB,CACnCA,CAAW,CAAG,cAAEA,CAAF,CAAd,CACA,MAAOA,CAAAA,CAAW,CAACC,OAAZ,CAAoB,qCAApB,CACV,C,WAEc,CACXT,IAAI,CAAEA,CADK,CAEXV,IAAI,CAAEA,CAFK,CAGXa,SAAS,CAAEA,CAHA,CAIXG,MAAM,CAAEA,CAJG,CAKXI,eAAe,CAxCK,QAAlBA,CAAAA,eAAkB,CAACnB,CAAD,CAAOoB,CAAP,CAA0B,CAC9C,GAAIC,CAAAA,CAAW,CAAG,IAAlB,CACAD,CAAc,CAAClB,IAAf,CAAoB,eAApB,CAAqCU,CAAS,CAACZ,CAAD,CAA9C,EAEAoB,CAAc,CAACE,EAAf,CAAkB,OAAlB,CAA2B,SAACC,CAAD,CAAO,CAC9BA,CAAC,CAACC,cAAF,GACA,GAAMC,CAAAA,CAAU,CAAGb,CAAS,CAACZ,CAAD,CAA5B,CACAe,CAAM,CAACf,CAAD,CAAN,CACAoB,CAAc,CAAClB,IAAf,CAAoB,eAApB,CAAqC,CAACuB,CAAtC,EAEA,GAAI,CAACA,CAAL,CAAiB,CAEbJ,CAAW,CAAGD,CAAc,CAACM,MAAf,CAAsB,SAACC,CAAD,CAAQC,CAAR,CAAoB,CACpD,MAAOA,CAAAA,CAAO,EAAIL,CAAC,CAACM,MAAb,EAAuBD,CAAO,CAACE,QAAR,CAAiBP,CAAC,CAACM,MAAnB,CACjC,CAFa,CAGjB,CALD,IAKO,IAAIR,CAAJ,CAAiB,CAGpBA,CAAW,CAACjB,KAAZ,GACAiB,CAAW,CAAG,IACjB,CACJ,CAjBD,CAkBH,CAac,CAMXL,aAAa,CAAEA,CANJ,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Controls the drawer.\n *\n * @module core/drawer\n * @copyright 2019 Jun Pataleta \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport $ from 'jquery';\nimport * as PubSub from 'core/pubsub';\nimport DrawerEvents from 'core/drawer_events';\n\n/**\n * Show the drawer.\n *\n * @param {Object} root The drawer container.\n */\nconst show = (root) => {\n root.removeClass('hidden');\n root.attr('aria-expanded', true);\n root.removeAttr('aria-hidden');\n root.focus();\n\n PubSub.publish(DrawerEvents.DRAWER_SHOWN, root);\n};\n\n/**\n * Hide the drawer.\n *\n * @param {Object} root The drawer container.\n */\nconst hide = (root) => {\n root.addClass('hidden');\n root.attr('aria-expanded', false);\n root.attr('aria-hidden', true);\n PubSub.publish(DrawerEvents.DRAWER_HIDDEN, root);\n};\n\n/**\n * Check if the drawer is visible.\n *\n * @param {Object} root The drawer container.\n * @return {boolean}\n */\nconst isVisible = (root) => {\n let isHidden = root.hasClass('hidden');\n return !isHidden;\n};\n\n/**\n * Toggle the drawer visibility.\n *\n * @param {Object} root The drawer container.\n */\nconst toggle = (root) => {\n if (isVisible(root)) {\n hide(root);\n } else {\n show(root);\n }\n};\n\n/**\n * Add event listeners to toggle the drawer.\n *\n * @param {Object} root The drawer container.\n * @param {Object} toggleElements The toggle elements.\n */\nconst registerToggles = (root, toggleElements) => {\n let openTrigger = null;\n toggleElements.attr('aria-expanded', isVisible(root));\n\n toggleElements.on('click', (e) => {\n e.preventDefault();\n const wasVisible = isVisible(root);\n toggle(root);\n toggleElements.attr('aria-expanded', !wasVisible);\n\n if (!wasVisible) {\n // Remember which trigger element opened the drawer.\n openTrigger = toggleElements.filter((index, element) => {\n return element == e.target || element.contains(e.target);\n });\n } else if (openTrigger) {\n // The drawer has gone from open to close so we need to set the focus back\n // to the element that openend it.\n openTrigger.focus();\n openTrigger = null;\n }\n });\n};\n\n/**\n * Find the root element of the drawer based on the using the drawer content root's ID.\n *\n * @param {Object} contentRoot The drawer content's root element.\n * @returns {*|jQuery}\n */\nconst getDrawerRoot = (contentRoot) => {\n contentRoot = $(contentRoot);\n return contentRoot.closest('[data-region=\"right-hand-drawer\"]');\n};\n\nexport default {\n hide: hide,\n show: show,\n isVisible: isVisible,\n toggle: toggle,\n registerToggles: registerToggles,\n getDrawerRoot: getDrawerRoot\n};\n"],"file":"drawer.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/drawer.js"],"names":["show","root","removeClass","attr","removeAttr","focus","PubSub","publish","DrawerEvents","DRAWER_SHOWN","hide","addClass","DRAWER_HIDDEN","isVisible","isHidden","hasClass","toggle","getDrawerRoot","contentRoot","closest","registerToggles","toggleElements","openTrigger","on","e","preventDefault","wasVisible","filter","index","element","target","contains"],"mappings":"icAsBA,OACA,OACA,O,uoBAOMA,CAAAA,CAAI,CAAG,SAACC,CAAD,CAAU,CACnBA,CAAI,CAACC,WAAL,CAAiB,QAAjB,EACAD,CAAI,CAACE,IAAL,CAAU,eAAV,KACAF,CAAI,CAACG,UAAL,CAAgB,aAAhB,EACAH,CAAI,CAACI,KAAL,GAEAC,CAAM,CAACC,OAAP,CAAeC,UAAaC,YAA5B,CAA0CR,CAA1C,CACH,C,CAOKS,CAAI,CAAG,SAACT,CAAD,CAAU,CACnBA,CAAI,CAACU,QAAL,CAAc,QAAd,EACAV,CAAI,CAACE,IAAL,CAAU,eAAV,KACAF,CAAI,CAACE,IAAL,CAAU,aAAV,KACAG,CAAM,CAACC,OAAP,CAAeC,UAAaI,aAA5B,CAA2CX,CAA3C,CACH,C,CAQKY,CAAS,CAAG,SAACZ,CAAD,CAAU,CACxB,GAAIa,CAAAA,CAAQ,CAAGb,CAAI,CAACc,QAAL,CAAc,QAAd,CAAf,CACA,MAAO,CAACD,CACX,C,CAOKE,CAAM,CAAG,SAACf,CAAD,CAAU,CACrB,GAAIY,CAAS,CAACZ,CAAD,CAAb,CAAqB,CACjBS,CAAI,CAACT,CAAD,CACP,CAFD,IAEO,CACHD,CAAI,CAACC,CAAD,CACP,CACJ,C,CAsCKgB,CAAa,CAAG,SAACC,CAAD,CAAiB,CACnCA,CAAW,CAAG,cAAEA,CAAF,CAAd,CACA,MAAOA,CAAAA,CAAW,CAACC,OAAZ,CAAoB,qCAApB,CACV,C,WAEc,CACXT,IAAI,CAAEA,CADK,CAEXV,IAAI,CAAEA,CAFK,CAGXa,SAAS,CAAEA,CAHA,CAIXG,MAAM,CAAEA,CAJG,CAKXI,eAAe,CAxCK,QAAlBA,CAAAA,eAAkB,CAACnB,CAAD,CAAOoB,CAAP,CAA0B,CAC9C,GAAIC,CAAAA,CAAW,CAAG,IAAlB,CACAD,CAAc,CAAClB,IAAf,CAAoB,eAApB,CAAqCU,CAAS,CAACZ,CAAD,CAA9C,EAEAoB,CAAc,CAACE,EAAf,CAAkB,OAAlB,CAA2B,SAACC,CAAD,CAAO,CAC9BA,CAAC,CAACC,cAAF,GACA,GAAMC,CAAAA,CAAU,CAAGb,CAAS,CAACZ,CAAD,CAA5B,CACAe,CAAM,CAACf,CAAD,CAAN,CACAoB,CAAc,CAAClB,IAAf,CAAoB,eAApB,CAAqC,CAACuB,CAAtC,EAEA,GAAI,CAACA,CAAL,CAAiB,CAEbJ,CAAW,CAAGD,CAAc,CAACM,MAAf,CAAsB,SAACC,CAAD,CAAQC,CAAR,CAAoB,CACpD,MAAOA,CAAAA,CAAO,EAAIL,CAAC,CAACM,MAAb,EAAuBD,CAAO,CAACE,QAAR,CAAiBP,CAAC,CAACM,MAAnB,CACjC,CAFa,CAGjB,CALD,IAKO,IAAIR,CAAJ,CAAiB,CAGpBA,CAAW,CAACjB,KAAZ,GACAiB,CAAW,CAAG,IACjB,CACJ,CAjBD,CAkBH,CAac,CAMXL,aAAa,CAAEA,CANJ,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Controls the drawer.\n *\n * @module core/drawer\n * @copyright 2019 Jun Pataleta \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport $ from 'jquery';\nimport * as PubSub from 'core/pubsub';\nimport DrawerEvents from 'core/drawer_events';\n\n/**\n * Show the drawer.\n *\n * @param {Object} root The drawer container.\n */\nconst show = (root) => {\n root.removeClass('hidden');\n root.attr('aria-expanded', true);\n root.removeAttr('aria-hidden');\n root.focus();\n\n PubSub.publish(DrawerEvents.DRAWER_SHOWN, root);\n};\n\n/**\n * Hide the drawer.\n *\n * @param {Object} root The drawer container.\n */\nconst hide = (root) => {\n root.addClass('hidden');\n root.attr('aria-expanded', false);\n root.attr('aria-hidden', true);\n PubSub.publish(DrawerEvents.DRAWER_HIDDEN, root);\n};\n\n/**\n * Check if the drawer is visible.\n *\n * @param {Object} root The drawer container.\n * @return {boolean}\n */\nconst isVisible = (root) => {\n let isHidden = root.hasClass('hidden');\n return !isHidden;\n};\n\n/**\n * Toggle the drawer visibility.\n *\n * @param {Object} root The drawer container.\n */\nconst toggle = (root) => {\n if (isVisible(root)) {\n hide(root);\n } else {\n show(root);\n }\n};\n\n/**\n * Add event listeners to toggle the drawer.\n *\n * @param {Object} root The drawer container.\n * @param {Object} toggleElements The toggle elements.\n */\nconst registerToggles = (root, toggleElements) => {\n let openTrigger = null;\n toggleElements.attr('aria-expanded', isVisible(root));\n\n toggleElements.on('click', (e) => {\n e.preventDefault();\n const wasVisible = isVisible(root);\n toggle(root);\n toggleElements.attr('aria-expanded', !wasVisible);\n\n if (!wasVisible) {\n // Remember which trigger element opened the drawer.\n openTrigger = toggleElements.filter((index, element) => {\n return element == e.target || element.contains(e.target);\n });\n } else if (openTrigger) {\n // The drawer has gone from open to close so we need to set the focus back\n // to the element that openend it.\n openTrigger.focus();\n openTrigger = null;\n }\n });\n};\n\n/**\n * Find the root element of the drawer based on the using the drawer content root's ID.\n *\n * @param {Object} contentRoot The drawer content's root element.\n * @returns {*|jQuery}\n */\nconst getDrawerRoot = (contentRoot) => {\n contentRoot = $(contentRoot);\n return contentRoot.closest('[data-region=\"right-hand-drawer\"]');\n};\n\nexport default {\n hide: hide,\n show: show,\n isVisible: isVisible,\n toggle: toggle,\n registerToggles: registerToggles,\n getDrawerRoot: getDrawerRoot\n};\n"],"file":"drawer.min.js"} \ No newline at end of file diff --git a/lib/amd/build/emoji/auto_complete.min.js b/lib/amd/build/emoji/auto_complete.min.js index 6fe3276eef5..e208b00f093 100644 --- a/lib/amd/build/emoji/auto_complete.min.js +++ b/lib/amd/build/emoji/auto_complete.min.js @@ -1,2 +1,2 @@ -function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("core/emoji/auto_complete",["exports","core/emoji/data","core/templates","core/utils","core/localstorage","core/key_codes"],function(a,b,c,d,e,f){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=i(b);e=g(e);f=g(f);function g(a){return a&&a.__esModule?a:{default:a}}function h(){if("function"!=typeof WeakMap)return null;var a=new WeakMap;h=function(){return a};return a}function i(a){if(a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var b=h();if(b&&b.has(a)){return b.get(a)}var c={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var e in a){if(Object.prototype.hasOwnProperty.call(a,e)){var f=d?Object.getOwnPropertyDescriptor(a,e):null;if(f&&(f.get||f.set)){Object.defineProperty(c,e,f)}else{c[e]=a[e]}}}c.default=a;if(b){b.set(a,c)}return c}function j(a,b,c,d,e,f,g){try{var h=a[f](g),i=h.value}catch(a){c(a);return}if(h.done){b(i)}else{Promise.resolve(i).then(d,e)}}function k(a){return function(){var b=this,c=arguments;return new Promise(function(d,e){var h=a.apply(b,c);function f(a){j(h,d,e,f,g,"next",a)}function g(a){j(h,d,e,f,g,"throw",a)}f(void 0)})}}function l(a){return p(a)||o(a)||n(a)||m()}function m(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function n(a,b){if(!a)return;if("string"==typeof a)return q(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);if("Object"===c&&a.constructor)c=a.constructor.name;if("Map"===c||"Set"===c)return Array.from(c);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return q(a,b)}function o(a){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(a))return Array.from(a)}function p(a){if(Array.isArray(a))return q(a)}function q(a,b){if(null==b||b>a.length)b=a.length;for(var c=0,d=Array(b);ca.length)b=a.length;for(var c=0,d=Array(b);c.\n\n/**\n * Emoji auto complete.\n *\n * @copyright 2019 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport * as EmojiData from 'core/emoji/data';\nimport {render as renderTemplate} from 'core/templates';\nimport {debounce} from 'core/utils';\nimport LocalStorage from 'core/localstorage';\nimport KeyCodes from 'core/key_codes';\n\nconst INPUT_DEBOUNCE_TIMER = 200;\nconst SUGGESTION_LIMIT = 50;\nconst MAX_RECENT_COUNT = 27;\nconst RECENT_EMOJIS_STORAGE_KEY = 'moodle-recent-emojis';\n\nconst SELECTORS = {\n EMOJI_BUTTON: '[data-region=\"emoji-button\"]',\n ACTIVE_EMOJI_BUTTON: '[data-region=\"emoji-button\"].active',\n};\n\n/**\n * Get the list of recent emojis data from local storage.\n *\n * @return {Array}\n */\nconst getRecentEmojis = () => {\n const storedData = LocalStorage.get(RECENT_EMOJIS_STORAGE_KEY);\n return storedData ? JSON.parse(storedData) : [];\n};\n\n/**\n * Add an emoji data to the set of recent emojis. The new set of recent emojis are\n * saved in local storage.\n *\n * @param {String} unified The char chodes for the emoji\n * @param {String} shortName The emoji short name\n */\nconst addRecentEmoji = (unified, shortName) => {\n const newEmoji = {\n unified,\n shortnames: [shortName]\n };\n const recentEmojis = getRecentEmojis();\n // Add the new emoji to the start of the list of recent emojis.\n let newRecentEmojis = [newEmoji, ...recentEmojis.filter(emoji => emoji.unified != newEmoji.unified)];\n // Limit the number of recent emojis.\n newRecentEmojis = newRecentEmojis.slice(0, MAX_RECENT_COUNT);\n\n LocalStorage.set(RECENT_EMOJIS_STORAGE_KEY, JSON.stringify(newRecentEmojis));\n};\n\n/**\n * Get the actual emoji string from the short name.\n *\n * @param {String} shortName Emoji short name\n * @return {String|null}\n */\nconst getEmojiTextFromShortName = (shortName) => {\n const unified = EmojiData.byShortName[shortName];\n\n if (unified) {\n const charCodes = unified.split('-').map(code => `0x${code}`);\n return String.fromCodePoint.apply(null, charCodes);\n } else {\n return null;\n }\n};\n\n/**\n * Render the auto complete list for the given short names.\n *\n * @param {Element} root The root container for the emoji auto complete\n * @param {Array} shortNames The list of short names for emoji suggestions to show\n */\nconst render = async (root, shortNames) => {\n const renderContext = {\n emojis: shortNames.map((shortName, index) => {\n return {\n active: index === 0,\n emojitext: getEmojiTextFromShortName(shortName),\n displayshortname: `:${shortName}:`,\n shortname: shortName,\n unified: EmojiData.byShortName[shortName]\n };\n })\n };\n const html = await renderTemplate('core/emoji/auto_complete', renderContext);\n root.innerHTML = html;\n};\n\n/**\n * Get the list of emoji short names that include the given search term. If\n * the search term is an empty string then the list of recently used emojis\n * will be returned.\n *\n * @param {String} searchTerm Text to match on\n * @param {Number} limit Maximum number of results to return\n * @return {Array}\n */\nconst searchEmojis = (searchTerm, limit) => {\n if (searchTerm === '') {\n return getRecentEmojis().map(data => data.shortnames[0]).slice(0, limit);\n } else {\n searchTerm = searchTerm.toLowerCase();\n return Object.keys(EmojiData.byShortName)\n .filter(shortName => shortName.includes(searchTerm))\n .slice(0, limit);\n }\n};\n\n/**\n * Get the current word at the given position (index) within the text.\n *\n * @param {String} text The text to process\n * @param {Number} position The position (index) within the text to match the word\n * @return {String}\n */\nconst getWordFromPosition = (text, position) => {\n const startMatches = text.slice(0, position).match(/(\\S*)$/);\n const endMatches = text.slice(position).match(/^(\\S*)/);\n let startText = '';\n let endText = '';\n\n if (startMatches) {\n startText = startMatches[startMatches.length - 1];\n }\n\n if (endMatches) {\n endText = endMatches[endMatches.length - 1];\n }\n\n return `${startText}${endText}`;\n};\n\n/**\n * Check if the given text is a full short name, i.e. has leading and trialing colon\n * characters.\n *\n * @param {String} text The text to process\n * @return {Bool}\n */\nconst isCompleteShortName = text => /^:[^:\\s]+:$/.test(text);\n\n/**\n * Check if the given text is a partial short name, i.e. has a leading colon but no\n * trailing colon.\n *\n * @param {String} text The text to process\n * @return {Bool}\n */\nconst isPartialShortName = text => /^:[^:\\s]*$/.test(text);\n\n/**\n * Remove the colon characters from the given text.\n *\n * @param {String} text The text to process\n * @return {String}\n */\nconst getShortNameFromText = text => text.replace(/:/g, '');\n\n/**\n * Get the currently active emoji button element in the list of suggestions.\n *\n * @param {Element} root The emoji auto complete container element\n * @return {Element|null}\n */\nconst getActiveEmojiSuggestion = (root) => {\n return root.querySelector(SELECTORS.ACTIVE_EMOJI_BUTTON);\n};\n\n/**\n * Make the previous sibling of the current active emoji active.\n *\n * @param {Element} root The emoji auto complete container element\n */\nconst selectPreviousEmojiSuggestion = (root) => {\n const activeEmojiSuggestion = getActiveEmojiSuggestion(root);\n const previousSuggestion = activeEmojiSuggestion.previousElementSibling;\n\n if (previousSuggestion) {\n activeEmojiSuggestion.classList.remove('active');\n previousSuggestion.classList.add('active');\n previousSuggestion.scrollIntoView({behaviour: 'smooth', inline: 'center'});\n }\n};\n\n/**\n * Make the next sibling to the current active emoji active.\n *\n * @param {Element} root The emoji auto complete container element\n */\nconst selectNextEmojiSuggestion = (root) => {\n const activeEmojiSuggestion = getActiveEmojiSuggestion(root);\n const nextSuggestion = activeEmojiSuggestion.nextElementSibling;\n\n if (nextSuggestion) {\n activeEmojiSuggestion.classList.remove('active');\n nextSuggestion.classList.add('active');\n nextSuggestion.scrollIntoView({behaviour: 'smooth', inline: 'center'});\n }\n};\n\n/**\n * Trigger the select callback for the given emoji button element.\n *\n * @param {Element} element The emoji button element\n * @param {Function} selectCallback The callback for when the user selects an emoji\n */\nconst selectEmojiElement = (element, selectCallback) => {\n const shortName = element.getAttribute('data-short-name');\n const unified = element.getAttribute('data-unified');\n addRecentEmoji(unified, shortName);\n selectCallback(element.innerHTML.trim());\n};\n\n/**\n * Initialise the emoji auto complete.\n *\n * @param {Element} root The root container element for the auto complete\n * @param {Element} textArea The text area element to monitor for auto complete\n * @param {Function} hasSuggestionCallback Callback for when there are auto-complete suggestions\n * @param {Function} selectCallback Callback for when the user selects an emoji\n */\nexport default (root, textArea, hasSuggestionCallback, selectCallback) => {\n let hasSuggestions = false;\n let previousSearchText = '';\n\n // Debounce the listener so that each keypress delays the execution of the handler. The\n // handler should only run 200 milliseconds after the last keypress.\n textArea.addEventListener('keyup', debounce(() => {\n // This is a \"keyup\" listener so that it only executes after the text area value\n // has been updated.\n const text = textArea.value;\n const cursorPos = textArea.selectionStart;\n const searchText = getWordFromPosition(text, cursorPos);\n\n if (searchText === previousSearchText) {\n // Nothing has changed so no need to take any action.\n return;\n } else {\n previousSearchText = searchText;\n }\n\n if (isCompleteShortName(searchText)) {\n // If the user has entered a full short name (with leading and trialing colons)\n // then see if we can find a match for it and auto complete it.\n const shortName = getShortNameFromText(searchText);\n const emojiText = getEmojiTextFromShortName(shortName);\n hasSuggestions = false;\n if (emojiText) {\n addRecentEmoji(EmojiData.byShortName[shortName], shortName);\n selectCallback(emojiText);\n }\n } else if (isPartialShortName(searchText)) {\n // If the user has entered a partial short name (leading colon but no trailing) then\n // search on the text to see if we can find some suggestions for them.\n const suggestions = searchEmojis(getShortNameFromText(searchText), SUGGESTION_LIMIT);\n\n if (suggestions.length) {\n render(root, suggestions);\n hasSuggestions = true;\n } else {\n hasSuggestions = false;\n }\n } else {\n hasSuggestions = false;\n }\n\n hasSuggestionCallback(hasSuggestions);\n }, INPUT_DEBOUNCE_TIMER));\n\n textArea.addEventListener('keydown', (e) => {\n if (hasSuggestions) {\n const isModifierPressed = (e.shiftKey || e.metaKey || e.altKey || e.ctrlKey);\n if (!isModifierPressed) {\n switch (e.which) {\n case KeyCodes.escape:\n // Escape key closes the auto complete.\n hasSuggestions = false;\n hasSuggestionCallback(false);\n break;\n case KeyCodes.arrowLeft:\n // Arrow keys navigate through the list of suggetions.\n selectPreviousEmojiSuggestion(root);\n e.preventDefault();\n break;\n case KeyCodes.arrowRight:\n // Arrow keys navigate through the list of suggetions.\n selectNextEmojiSuggestion(root);\n e.preventDefault();\n break;\n case KeyCodes.enter:\n // Enter key selects the current suggestion.\n selectEmojiElement(getActiveEmojiSuggestion(root), selectCallback);\n e.preventDefault();\n e.stopPropagation();\n break;\n }\n }\n }\n });\n\n root.addEventListener('click', (e) => {\n const target = e.target;\n if (target.matches(SELECTORS.EMOJI_BUTTON)) {\n selectEmojiElement(target, selectCallback);\n }\n });\n};"],"file":"auto_complete.min.js"} \ No newline at end of file +{"version":3,"sources":["../../src/emoji/auto_complete.js"],"names":["RECENT_EMOJIS_STORAGE_KEY","SELECTORS","EMOJI_BUTTON","ACTIVE_EMOJI_BUTTON","getRecentEmojis","storedData","LocalStorage","get","JSON","parse","addRecentEmoji","unified","shortName","newEmoji","shortnames","recentEmojis","newRecentEmojis","filter","emoji","slice","set","stringify","getEmojiTextFromShortName","EmojiData","byShortName","charCodes","split","map","code","String","fromCodePoint","apply","render","root","shortNames","renderContext","emojis","index","active","emojitext","displayshortname","shortname","html","innerHTML","searchEmojis","searchTerm","limit","data","toLowerCase","Object","keys","includes","getWordFromPosition","text","position","startMatches","match","endMatches","startText","endText","length","isCompleteShortName","test","isPartialShortName","getShortNameFromText","replace","getActiveEmojiSuggestion","querySelector","selectPreviousEmojiSuggestion","activeEmojiSuggestion","previousSuggestion","previousElementSibling","classList","remove","add","scrollIntoView","behaviour","inline","selectNextEmojiSuggestion","nextSuggestion","nextElementSibling","selectEmojiElement","element","selectCallback","getAttribute","trim","textArea","hasSuggestionCallback","hasSuggestions","previousSearchText","addEventListener","value","cursorPos","selectionStart","searchText","emojiText","suggestions","e","isModifierPressed","shiftKey","metaKey","altKey","ctrlKey","which","KeyCodes","escape","arrowLeft","preventDefault","arrowRight","enter","stopPropagation","target","matches"],"mappings":"2fAqBA,OAGA,OACA,O,0sDAKMA,CAAAA,CAAyB,CAAG,sB,CAE5BC,CAAS,CAAG,CACdC,YAAY,CAAE,gCADA,CAEdC,mBAAmB,CAAE,uCAFP,C,CAUZC,CAAe,CAAG,UAAM,CAC1B,GAAMC,CAAAA,CAAU,CAAGC,UAAaC,GAAb,CAAiBP,CAAjB,CAAnB,CACA,MAAOK,CAAAA,CAAU,CAAGG,IAAI,CAACC,KAAL,CAAWJ,CAAX,CAAH,CAA4B,EAChD,C,CASKK,CAAc,CAAG,SAACC,CAAD,CAAUC,CAAV,CAAwB,IACrCC,CAAAA,CAAQ,CAAG,CACbF,OAAO,CAAPA,CADa,CAEbG,UAAU,CAAE,CAACF,CAAD,CAFC,CAD0B,CAKrCG,CAAY,CAAGX,CAAe,EALO,CAOvCY,CAAe,EAAIH,CAAJ,WAAiBE,CAAY,CAACE,MAAb,CAAoB,SAAAC,CAAK,QAAIA,CAAAA,CAAK,CAACP,OAAN,EAAiBE,CAAQ,CAACF,OAA9B,CAAzB,CAAjB,EAPwB,CAS3CK,CAAe,CAAGA,CAAe,CAACG,KAAhB,CAAsB,CAAtB,CAlCG,EAkCH,CAAlB,CAEAb,UAAac,GAAb,CAAiBpB,CAAjB,CAA4CQ,IAAI,CAACa,SAAL,CAAeL,CAAf,CAA5C,CACH,C,CAQKM,CAAyB,CAAG,SAACV,CAAD,CAAe,CAC7C,GAAMD,CAAAA,CAAO,CAAGY,CAAS,CAACC,WAAV,CAAsBZ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ACJ,IAAKH,WAASI,UAAd,CAEI9B,CAAyB,CAAC7C,CAAD,CAAzB,CACAgE,CAAC,CAACU,cAAF,GACA,MACJ,IAAKH,WAASK,KAAd,CAEI5B,CAAkB,CAACf,CAAwB,CAACjC,CAAD,CAAzB,CAAiCkD,CAAjC,CAAlB,CACAc,CAAC,CAACU,cAAF,GACAV,CAAC,CAACa,eAAF,GACA,MArBR,CAuBH,CACJ,CACJ,CA7BD,EA+BA7E,CAAI,CAACyD,gBAAL,CAAsB,OAAtB,CAA+B,SAACO,CAAD,CAAO,CAClC,GAAMc,CAAAA,CAAM,CAAGd,CAAC,CAACc,MAAjB,CACA,GAAIA,CAAM,CAACC,OAAP,CAAe/G,CAAS,CAACC,YAAzB,CAAJ,CAA4C,CACxC+E,CAAkB,CAAC8B,CAAD,CAAS5B,CAAT,CACrB,CACJ,CALD,CAMH,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Emoji auto complete.\n *\n * @copyright 2019 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport * as EmojiData from 'core/emoji/data';\nimport {render as renderTemplate} from 'core/templates';\nimport {debounce} from 'core/utils';\nimport LocalStorage from 'core/localstorage';\nimport KeyCodes from 'core/key_codes';\n\nconst INPUT_DEBOUNCE_TIMER = 200;\nconst SUGGESTION_LIMIT = 50;\nconst MAX_RECENT_COUNT = 27;\nconst RECENT_EMOJIS_STORAGE_KEY = 'moodle-recent-emojis';\n\nconst SELECTORS = {\n EMOJI_BUTTON: '[data-region=\"emoji-button\"]',\n ACTIVE_EMOJI_BUTTON: '[data-region=\"emoji-button\"].active',\n};\n\n/**\n * Get the list of recent emojis data from local storage.\n *\n * @return {Array}\n */\nconst getRecentEmojis = () => {\n const storedData = LocalStorage.get(RECENT_EMOJIS_STORAGE_KEY);\n return storedData ? JSON.parse(storedData) : [];\n};\n\n/**\n * Add an emoji data to the set of recent emojis. The new set of recent emojis are\n * saved in local storage.\n *\n * @param {String} unified The char chodes for the emoji\n * @param {String} shortName The emoji short name\n */\nconst addRecentEmoji = (unified, shortName) => {\n const newEmoji = {\n unified,\n shortnames: [shortName]\n };\n const recentEmojis = getRecentEmojis();\n // Add the new emoji to the start of the list of recent emojis.\n let newRecentEmojis = [newEmoji, ...recentEmojis.filter(emoji => emoji.unified != newEmoji.unified)];\n // Limit the number of recent emojis.\n newRecentEmojis = newRecentEmojis.slice(0, MAX_RECENT_COUNT);\n\n LocalStorage.set(RECENT_EMOJIS_STORAGE_KEY, JSON.stringify(newRecentEmojis));\n};\n\n/**\n * Get the actual emoji string from the short name.\n *\n * @param {String} shortName Emoji short name\n * @return {String|null}\n */\nconst getEmojiTextFromShortName = (shortName) => {\n const unified = EmojiData.byShortName[shortName];\n\n if (unified) {\n const charCodes = unified.split('-').map(code => `0x${code}`);\n return String.fromCodePoint.apply(null, charCodes);\n } else {\n return null;\n }\n};\n\n/**\n * Render the auto complete list for the given short names.\n *\n * @param {Element} root The root container for the emoji auto complete\n * @param {Array} shortNames The list of short names for emoji suggestions to show\n */\nconst render = async (root, shortNames) => {\n const renderContext = {\n emojis: shortNames.map((shortName, index) => {\n return {\n active: index === 0,\n emojitext: getEmojiTextFromShortName(shortName),\n displayshortname: `:${shortName}:`,\n shortname: shortName,\n unified: EmojiData.byShortName[shortName]\n };\n })\n };\n const html = await renderTemplate('core/emoji/auto_complete', renderContext);\n root.innerHTML = html;\n};\n\n/**\n * Get the list of emoji short names that include the given search term. If\n * the search term is an empty string then the list of recently used emojis\n * will be returned.\n *\n * @param {String} searchTerm Text to match on\n * @param {Number} limit Maximum number of results to return\n * @return {Array}\n */\nconst searchEmojis = (searchTerm, limit) => {\n if (searchTerm === '') {\n return getRecentEmojis().map(data => data.shortnames[0]).slice(0, limit);\n } else {\n searchTerm = searchTerm.toLowerCase();\n return Object.keys(EmojiData.byShortName)\n .filter(shortName => shortName.includes(searchTerm))\n .slice(0, limit);\n }\n};\n\n/**\n * Get the current word at the given position (index) within the text.\n *\n * @param {String} text The text to process\n * @param {Number} position The position (index) within the text to match the word\n * @return {String}\n */\nconst getWordFromPosition = (text, position) => {\n const startMatches = text.slice(0, position).match(/(\\S*)$/);\n const endMatches = text.slice(position).match(/^(\\S*)/);\n let startText = '';\n let endText = '';\n\n if (startMatches) {\n startText = startMatches[startMatches.length - 1];\n }\n\n if (endMatches) {\n endText = endMatches[endMatches.length - 1];\n }\n\n return `${startText}${endText}`;\n};\n\n/**\n * Check if the given text is a full short name, i.e. has leading and trialing colon\n * characters.\n *\n * @param {String} text The text to process\n * @return {Bool}\n */\nconst isCompleteShortName = text => /^:[^:\\s]+:$/.test(text);\n\n/**\n * Check if the given text is a partial short name, i.e. has a leading colon but no\n * trailing colon.\n *\n * @param {String} text The text to process\n * @return {Bool}\n */\nconst isPartialShortName = text => /^:[^:\\s]*$/.test(text);\n\n/**\n * Remove the colon characters from the given text.\n *\n * @param {String} text The text to process\n * @return {String}\n */\nconst getShortNameFromText = text => text.replace(/:/g, '');\n\n/**\n * Get the currently active emoji button element in the list of suggestions.\n *\n * @param {Element} root The emoji auto complete container element\n * @return {Element|null}\n */\nconst getActiveEmojiSuggestion = (root) => {\n return root.querySelector(SELECTORS.ACTIVE_EMOJI_BUTTON);\n};\n\n/**\n * Make the previous sibling of the current active emoji active.\n *\n * @param {Element} root The emoji auto complete container element\n */\nconst selectPreviousEmojiSuggestion = (root) => {\n const activeEmojiSuggestion = getActiveEmojiSuggestion(root);\n const previousSuggestion = activeEmojiSuggestion.previousElementSibling;\n\n if (previousSuggestion) {\n activeEmojiSuggestion.classList.remove('active');\n previousSuggestion.classList.add('active');\n previousSuggestion.scrollIntoView({behaviour: 'smooth', inline: 'center'});\n }\n};\n\n/**\n * Make the next sibling to the current active emoji active.\n *\n * @param {Element} root The emoji auto complete container element\n */\nconst selectNextEmojiSuggestion = (root) => {\n const activeEmojiSuggestion = getActiveEmojiSuggestion(root);\n const nextSuggestion = activeEmojiSuggestion.nextElementSibling;\n\n if (nextSuggestion) {\n activeEmojiSuggestion.classList.remove('active');\n nextSuggestion.classList.add('active');\n nextSuggestion.scrollIntoView({behaviour: 'smooth', inline: 'center'});\n }\n};\n\n/**\n * Trigger the select callback for the given emoji button element.\n *\n * @param {Element} element The emoji button element\n * @param {Function} selectCallback The callback for when the user selects an emoji\n */\nconst selectEmojiElement = (element, selectCallback) => {\n const shortName = element.getAttribute('data-short-name');\n const unified = element.getAttribute('data-unified');\n addRecentEmoji(unified, shortName);\n selectCallback(element.innerHTML.trim());\n};\n\n/**\n * Initialise the emoji auto complete.\n *\n * @param {Element} root The root container element for the auto complete\n * @param {Element} textArea The text area element to monitor for auto complete\n * @param {Function} hasSuggestionCallback Callback for when there are auto-complete suggestions\n * @param {Function} selectCallback Callback for when the user selects an emoji\n */\nexport default (root, textArea, hasSuggestionCallback, selectCallback) => {\n let hasSuggestions = false;\n let previousSearchText = '';\n\n // Debounce the listener so that each keypress delays the execution of the handler. The\n // handler should only run 200 milliseconds after the last keypress.\n textArea.addEventListener('keyup', debounce(() => {\n // This is a \"keyup\" listener so that it only executes after the text area value\n // has been updated.\n const text = textArea.value;\n const cursorPos = textArea.selectionStart;\n const searchText = getWordFromPosition(text, cursorPos);\n\n if (searchText === previousSearchText) {\n // Nothing has changed so no need to take any action.\n return;\n } else {\n previousSearchText = searchText;\n }\n\n if (isCompleteShortName(searchText)) {\n // If the user has entered a full short name (with leading and trialing colons)\n // then see if we can find a match for it and auto complete it.\n const shortName = getShortNameFromText(searchText);\n const emojiText = getEmojiTextFromShortName(shortName);\n hasSuggestions = false;\n if (emojiText) {\n addRecentEmoji(EmojiData.byShortName[shortName], shortName);\n selectCallback(emojiText);\n }\n } else if (isPartialShortName(searchText)) {\n // If the user has entered a partial short name (leading colon but no trailing) then\n // search on the text to see if we can find some suggestions for them.\n const suggestions = searchEmojis(getShortNameFromText(searchText), SUGGESTION_LIMIT);\n\n if (suggestions.length) {\n render(root, suggestions);\n hasSuggestions = true;\n } else {\n hasSuggestions = false;\n }\n } else {\n hasSuggestions = false;\n }\n\n hasSuggestionCallback(hasSuggestions);\n }, INPUT_DEBOUNCE_TIMER));\n\n textArea.addEventListener('keydown', (e) => {\n if (hasSuggestions) {\n const isModifierPressed = (e.shiftKey || e.metaKey || e.altKey || e.ctrlKey);\n if (!isModifierPressed) {\n switch (e.which) {\n case KeyCodes.escape:\n // Escape key closes the auto complete.\n hasSuggestions = false;\n hasSuggestionCallback(false);\n break;\n case KeyCodes.arrowLeft:\n // Arrow keys navigate through the list of suggetions.\n selectPreviousEmojiSuggestion(root);\n e.preventDefault();\n break;\n case KeyCodes.arrowRight:\n // Arrow keys navigate through the list of suggetions.\n selectNextEmojiSuggestion(root);\n e.preventDefault();\n break;\n case KeyCodes.enter:\n // Enter key selects the current suggestion.\n selectEmojiElement(getActiveEmojiSuggestion(root), selectCallback);\n e.preventDefault();\n e.stopPropagation();\n break;\n }\n }\n }\n });\n\n root.addEventListener('click', (e) => {\n const target = e.target;\n if (target.matches(SELECTORS.EMOJI_BUTTON)) {\n selectEmojiElement(target, selectCallback);\n }\n });\n};"],"file":"auto_complete.min.js"} \ No newline at end of file diff --git a/lib/amd/build/emoji/picker.min.js b/lib/amd/build/emoji/picker.min.js index 3b0991457e5..7fa874d760b 100644 --- a/lib/amd/build/emoji/picker.min.js +++ b/lib/amd/build/emoji/picker.min.js @@ -1,2 +1,2 @@ -define ("core/emoji/picker",["exports","core/localstorage","core/emoji/data","core/utils","core/str","core/templates"],function(a,b,c,d,e,f){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);c=h(c);function g(){if("function"!=typeof WeakMap)return null;var a=new WeakMap;g=function(){return a};return a}function h(a){if(a&&a.__esModule){return a}if(null===a||"object"!==j(a)&&"function"!=typeof a){return{default:a}}var b=g();if(b&&b.has(a)){return b.get(a)}var c={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var e in a){if(Object.prototype.hasOwnProperty.call(a,e)){var f=d?Object.getOwnPropertyDescriptor(a,e):null;if(f&&(f.get||f.set)){Object.defineProperty(c,e,f)}else{c[e]=a[e]}}}c.default=a;if(b){b.set(a,c)}return c}function j(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){j=function(a){return typeof a}}else{j=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return j(a)}function k(a){return n(a)||m(a)||q(a)||l()}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function m(a){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(a))return Array.from(a)}function n(a){if(Array.isArray(a))return r(a)}function o(a,b){return t(a)||s(a,b)||q(a,b)||p()}function p(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function q(a,b){if(!a)return;if("string"==typeof a)return r(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);if("Object"===c&&a.constructor)c=a.constructor.name;if("Map"===c||"Set"===c)return Array.from(c);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return r(a,b)}function r(a,b){if(null==b||b>a.length)b=a.length;for(var c=0,d=Array(b);cb){b=0}for(var i in c){var j=c[i];d.push([j,i])}d.sort(function(c,d){var e=o(c,1),f=e[0],a=o(d,1),g=a[0];if(fg){return 1}else{return 0}});var e=d.reduce(function(a,c){var d=o(c,2),e=d[0],f=d[1];if(e<=b){a.categoryName=f;a.previousPosition=a.currentPosition;a.currentPosition=b}else if(null===a.nextPosition){a.nextPosition=e}return a},{categoryName:null,currentPosition:null,previousPosition:null,nextPosition:null}),f=e.categoryName,g=e.previousPosition,h=e.nextPosition;return[M(a,f),g,h]},P=function(){var a=b.default.get(A);return a?JSON.parse(a):[]},Q=function(a){b.default.set(A,JSON.stringify(a))},R=function(a,b,c){var d=a[0].data.name,e=a[0].data.displayName,f=P(),g=[c].concat(k(f.filter(function(a){return a.unified!=c.unified})));g=g.slice(0,3*C);var h=F(d,e,g);Q(g);return[G(h.concat(a.slice(b))),h.length]},S=function(a,b,c){var d=a>B?Math.floor(a/B):0,e=d>=z?d-z:d,f=c.slice(e,d+b+z);return f},T=function(){var a=v(regeneratorRuntime.mark(function a(b){var c;return regeneratorRuntime.wrap(function(a){while(1){switch(a.prev=a.next){case 0:c=null;if(!(b.type===D.HEADER)){a.next=7;break}a.next=4;return I(b.index,b.data.displayName);case 4:c=a.sent;a.next=10;break;case 7:a.next=9;return J(b.index,b.data);case 9:c=a.sent;case 10:c.style.position="absolute";c.style.left=0;c.style.right=0;c.style.top="".concat(b.index*B,"px");return a.abrupt("return",c);case 15:case"end":return a.stop();}}},a)}));return function(){return a.apply(this,arguments)}}(),U=function(c,a){if(c.index!==a.index){return!1}if(c.type!==a.type){return!1}if(j(c.data)!=j(a.data)){return!1}if(c.type===D.HEADER){return c.data.name===a.data.name}else{if(c.data.length!==a.data.length){return!1}for(var b=0;bd.index){g=h;break}}if(null!==g){var k=f[g],l=b.querySelector("[data-row=\"".concat(k.index,"\"]"));b.insertBefore(a,l);f.splice(g,0,f)}else{f.push(d);b.appendChild(a)}});h.forEach(function(a){for(var c=0,d;c=j||gk){requestAnimationFrame(function(){e(g,f);b=g})}}},ba=function(a,b,d){var f=b.querySelector(E.ROW_CONTAINER),g=W(f);b.appendChild(f);return v(regeneratorRuntime.mark(function f(){var h,i,j,k;return regeneratorRuntime.wrap(function(f){while(1){switch(f.prev=f.next){case 0:h=a.value.toLowerCase();if(!h){f.next=11;break}X(d,b);i=Object.keys(c.byShortName).reduce(function(a,b){if(b.includes(h)){a.push({shortnames:[b],unified:c.byShortName[b]})}return a},[]);f.next=6;return(0,e.get_string)("searchresults","core");case 6:j=f.sent;k=F(j,j,i,0);g(0,k,k.length);f.next=12;break;case 11:Y(d,b,a);case 12:case"end":return f.stop();}}},f)}))},ca=function(a,b,c,e,f,g,h,i){var j=a.querySelector(E.SEARCH_INPUT),k=a.querySelector(E.SEARCH_RESULTS_CONTAINER),l=a.querySelector(E.EMOJI_PREVIEW),m=a.querySelector(E.EMOJI_SHORT_NAME),n=_(i,b,k,j,f,c),p=aa(a,e,b,g,c),q=ba(j,k,b);a.addEventListener("focus",Z(l,m),!0);a.addEventListener("blur",$(l,m),!0);a.addEventListener("mouseenter",Z(l,m),!0);a.addEventListener("mouseleave",$(l,m),!0);a.addEventListener("click",function(a){var b=n(a,h,g),c=o(b,2);h=c[0];g=c[1]});b.addEventListener("scroll",(0,d.throttle)(function(){return p(g,h)},50));j.addEventListener("input",(0,d.debounce)(q,200))},da=function(a,b){var d=a.querySelector(E.EMOJIS_CONTAINER),e=d.querySelector(E.ROW_CONTAINER),f=P(),g=[{name:"Recent",emojis:f}].concat(k(c.byCategory)),h=[],i=0;g.forEach(function(b){var c=M(a,b.name),d=c.title,e=F(b.name,d,b.emojis,h.length);if("Recent"===b.name){i=e.length}h=h.concat(e)});h=G(h);var j=H(h),l=W(e);l(0,h);ca(a,d,l,0,b,j,h,i)};a.default=da;return a.default}); +define ("core/emoji/picker",["exports","core/localstorage","core/emoji/data","core/utils","core/str","core/templates"],function(a,b,c,d,e,f){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);c=h(c);function g(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(g=function(a){return a?c:b})(a)}function h(a,b){if(!b&&a&&a.__esModule){return a}if(null===a||"object"!==j(a)&&"function"!=typeof a){return{default:a}}var c=g(b);if(c&&c.has(a)){return c.get(a)}var d={},e=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in a){if("default"!=f&&Object.prototype.hasOwnProperty.call(a,f)){var h=e?Object.getOwnPropertyDescriptor(a,f):null;if(h&&(h.get||h.set)){Object.defineProperty(d,f,h)}else{d[f]=a[f]}}}d.default=a;if(c){c.set(a,d)}return d}function j(a){"@babel/helpers - typeof";return j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},j(a)}function k(a){return n(a)||m(a)||q(a)||l()}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function m(a){if("undefined"!=typeof Symbol&&null!=a[Symbol.iterator]||null!=a["@@iterator"])return Array.from(a)}function n(a){if(Array.isArray(a))return r(a)}function o(a,b){return t(a)||s(a,b)||q(a,b)||p()}function p(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function q(a,b){if(!a)return;if("string"==typeof a)return r(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);if("Object"===c&&a.constructor)c=a.constructor.name;if("Map"===c||"Set"===c)return Array.from(a);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return r(a,b)}function r(a,b){if(null==b||b>a.length)b=a.length;for(var c=0,d=Array(b);cb){b=0}for(var i in c){var j=c[i];d.push([j,i])}d.sort(function(c,d){var e=o(c,1),f=e[0],a=o(d,1),g=a[0];if(fg){return 1}else{return 0}});var e=d.reduce(function(a,c){var d=o(c,2),e=d[0],f=d[1];if(e<=b){a.categoryName=f;a.previousPosition=a.currentPosition;a.currentPosition=b}else if(null===a.nextPosition){a.nextPosition=e}return a},{categoryName:null,currentPosition:null,previousPosition:null,nextPosition:null}),f=e.categoryName,g=e.previousPosition,h=e.nextPosition;return[M(a,f),g,h]},P=function(){var a=b.default.get(A);return a?JSON.parse(a):[]},Q=function(a){b.default.set(A,JSON.stringify(a))},R=function(a,b,c){var d=a[0].data.name,e=a[0].data.displayName,f=P(),g=[c].concat(k(f.filter(function(a){return a.unified!=c.unified})));g=g.slice(0,3*C);var h=F(d,e,g);Q(g);return[G(h.concat(a.slice(b))),h.length]},S=function(a,b,c){var d=a>B?Math.floor(a/B):0,e=d>=z?d-z:d,f=c.slice(e,d+b+z);return f},T=function(){var a=v(regeneratorRuntime.mark(function b(a){var c;return regeneratorRuntime.wrap(function(b){while(1){switch(b.prev=b.next){case 0:c=null;if(!(a.type===D.HEADER)){b.next=7;break}b.next=4;return I(a.index,a.data.displayName);case 4:c=b.sent;b.next=10;break;case 7:b.next=9;return J(a.index,a.data);case 9:c=b.sent;case 10:c.style.position="absolute";c.style.left=0;c.style.right=0;c.style.top="".concat(a.index*B,"px");return b.abrupt("return",c);case 15:case"end":return b.stop();}}},b)}));return function(){return a.apply(this,arguments)}}(),U=function(c,a){if(c.index!==a.index){return!1}if(c.type!==a.type){return!1}if(j(c.data)!=j(a.data)){return!1}if(c.type===D.HEADER){return c.data.name===a.data.name}else{if(c.data.length!==a.data.length){return!1}for(var b=0;bd.index){g=h;break}}if(null!==g){var k=f[g],l=a.querySelector("[data-row=\"".concat(k.index,"\"]"));a.insertBefore(b,l);f.splice(g,0,f)}else{f.push(d);a.appendChild(b)}});h.forEach(function(b){for(var c=0,d;c=j||gk){requestAnimationFrame(function(){e(g,f);b=g})}}},ba=function(a,b,d){var f=b.querySelector(E.ROW_CONTAINER),g=W(f);b.appendChild(f);return v(regeneratorRuntime.mark(function f(){var h,i,j,k;return regeneratorRuntime.wrap(function(f){while(1){switch(f.prev=f.next){case 0:h=a.value.toLowerCase();if(!h){f.next=11;break}X(d,b);i=Object.keys(c.byShortName).reduce(function(a,b){if(b.includes(h)){a.push({shortnames:[b],unified:c.byShortName[b]})}return a},[]);f.next=6;return(0,e.get_string)("searchresults","core");case 6:j=f.sent;k=F(j,j,i,0);g(0,k,k.length);f.next=12;break;case 11:Y(d,b,a);case 12:case"end":return f.stop();}}},f)}))},ca=function(a,b,c,e,f,g,h,i){var j=a.querySelector(E.SEARCH_INPUT),k=a.querySelector(E.SEARCH_RESULTS_CONTAINER),l=a.querySelector(E.EMOJI_PREVIEW),m=a.querySelector(E.EMOJI_SHORT_NAME),n=_(i,b,k,j,f,c),p=aa(a,e,b,g,c),q=ba(j,k,b);a.addEventListener("focus",Z(l,m),!0);a.addEventListener("blur",$(l,m),!0);a.addEventListener("mouseenter",Z(l,m),!0);a.addEventListener("mouseleave",$(l,m),!0);a.addEventListener("click",function(a){var b=n(a,h,g),c=o(b,2);h=c[0];g=c[1]});b.addEventListener("scroll",(0,d.throttle)(function(){return p(g,h)},50));j.addEventListener("input",(0,d.debounce)(q,200))},da=function(a,b){var d=a.querySelector(E.EMOJIS_CONTAINER),e=d.querySelector(E.ROW_CONTAINER),f=P(),g=[{name:"Recent",emojis:f}].concat(k(c.byCategory)),h=[],i=0;g.forEach(function(b){var c=M(a,b.name),d=c.title,e=F(b.name,d,b.emojis,h.length);if("Recent"===b.name){i=e.length}h=h.concat(e)});h=G(h);var j=H(h),l=W(e);l(0,h);ca(a,d,l,0,b,j,h,i)};a.default=da;return a.default}); //# sourceMappingURL=picker.min.js.map diff --git a/lib/amd/build/emoji/picker.min.js.map b/lib/amd/build/emoji/picker.min.js.map index f476507fdf9..a0c9862f376 100644 --- a/lib/amd/build/emoji/picker.min.js.map +++ b/lib/amd/build/emoji/picker.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../src/emoji/picker.js"],"names":["ROW_RENDER_BUFFER_COUNT","RECENT_EMOJIS_STORAGE_KEY","ROW_HEIGHT_RAW","EMOJIS_PER_ROW","ROW_TYPE","EMOJI","HEADER","SELECTORS","CATEGORY_SELECTOR","EMOJIS_CONTAINER","EMOJI_PREVIEW","EMOJI_SHORT_NAME","ROW_CONTAINER","SEARCH_INPUT","SEARCH_RESULTS_CONTAINER","createRowDataForCategory","categoryName","categoryDisplayName","emojis","totalRowCount","rowData","push","index","length","type","data","name","displayName","i","rowEmojis","slice","addIndexesToRowData","map","getCategoryScrollPositionsFromRowData","reduce","carry","row","createHeaderRow","rowIndex","context","text","html","temp","document","createElement","innerHTML","firstChild","createEmojiRow","emojiData","charCodes","unified","split","code","emojiText","String","fromCodePoint","apply","shortnames","join","spacer","spacers","Array","fill","isEmojiElement","element","getAttribute","findCategorySelectorFromElement","parentElement","getCategorySelectorByCategoryName","root","querySelector","setCategorySelectorActive","allCategorySelectors","querySelectorAll","selector","classList","remove","add","getCategoryByScrollPosition","position","categoryScrollPositions","positions","categoryPosition","sort","a","b","candidate","previousPosition","currentPosition","nextPosition","getRecentEmojis","storedData","LocalStorage","get","JSON","parse","saveRecentEmoji","recentEmojis","set","stringify","addRecentEmoji","recentEmojiRowCount","newEmoji","newRecentEmojis","filter","emoji","newRecentEmojiRowData","concat","getRowsToRender","scrollPosition","visibleRowCount","minVisibleRow","Math","floor","start","rows","createRowElement","style","left","right","top","doRowsMatch","renderRows","rowContainer","currentRows","nextRows","toAdd","nextRow","some","currentRow","toKeep","toRemove","toRemoveElements","Promise","all","forEach","nextRowIndex","nextRowData","nextRowNode","insertBefore","splice","appendChild","removeChild","generateRenderRowsAtPositionFunction","rowCount","isRendering","renderNextRows","nextRowsToRender","rowLimit","height","showSearchResults","emojiContainer","searchResultsContainer","clearSearch","searchInput","value","getHandleMouseEnter","emojiPreview","emojiShortName","e","target","textContent","getHandleMouseLeave","getHandleClick","selectCallback","renderAtPosition","newRowData","newCategoryScrollPositions","replace","currentScrollTop","scrollTop","isRecentEmojiRowVisible","categorySelector","selectedCategory","getHandleScroll","currentVisibleRowScrollPosition","initialCategoryScrollPositions","currentCategoryElement","previousCategoryPosition","nextCategoryPosition","newScrollPosition","upperScrollBound","lowerScrollBound","updateActiveCategory","requestAnimationFrame","getHandleSearch","renderSearchResultsAtPosition","searchTerm","toLowerCase","matchingEmojis","Object","keys","EmojiData","byShortName","shortName","includes","searchResultsString","registerEventListeners","clickHandler","scrollHandler","searchHandler","addEventListener","allData","byCategory","category","title","categoryRowData"],"mappings":"4NAqBA,uDACA,O,qnGAMMA,CAAAA,CAAuB,CAAG,C,CAC1BC,CAAyB,CAAG,sB,CAC5BC,CAAc,CAAG,E,CACjBC,CAAc,CAAG,C,CAEjBC,CAAQ,CAAG,CACbC,KAAK,CAAE,CADM,CAEbC,MAAM,CAAE,CAFK,C,CAIXC,CAAS,CAAG,CACdC,iBAAiB,CAAE,iCADL,CAEdC,gBAAgB,CAAE,oCAFJ,CAGdC,aAAa,CAAE,iCAHD,CAIdC,gBAAgB,CAAE,oCAJJ,CAKdC,aAAa,CAAE,iCALD,CAMdC,YAAY,CAAE,gCANA,CAOdC,wBAAwB,CAAE,4CAPZ,C,CAmBZC,CAAwB,CAAG,SAACC,CAAD,CAAeC,CAAf,CAAoCC,CAApC,CAA4CC,CAA5C,CAA8D,CAC3F,GAAMC,CAAAA,CAAO,CAAG,EAAhB,CACAA,CAAO,CAACC,IAAR,CAAa,CACTC,KAAK,CAAEH,CAAa,CAAGC,CAAO,CAACG,MADtB,CAETC,IAAI,CAAEpB,CAAQ,CAACE,MAFN,CAGTmB,IAAI,CAAE,CACFC,IAAI,CAAEV,CADJ,CAEFW,WAAW,CAAEV,CAFX,CAHG,CAAb,EASA,IAAK,GAAIW,CAAAA,CAAC,CAAG,CAAR,CACKC,CADV,CAAgBD,CAAC,CAAGV,CAAM,CAACK,MAA3B,CAAmCK,CAAC,EAAIzB,CAAxC,CAAwD,CAC9C0B,CAD8C,CAClCX,CAAM,CAACY,KAAP,CAAaF,CAAb,CAAgBA,CAAC,CAAGzB,CAApB,CADkC,CAEpDiB,CAAO,CAACC,IAAR,CAAa,CACTC,KAAK,CAAEH,CAAa,CAAGC,CAAO,CAACG,MADtB,CAETC,IAAI,CAAEpB,CAAQ,CA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AgB,CAAC,CAAD,CAAIjJ,CAAJ,CAAhB,CAEAiL,EAAsB,CAClBhI,CADkB,CAElBkF,CAFkB,CAGlBc,CAHkB,CAIlB,CAJkB,CAKlBD,CALkB,CAMlBpF,CANkB,CAOlB5D,CAPkB,CAQlBiF,CARkB,CAUzB,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Emoji picker.\n *\n * @copyright 2019 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport LocalStorage from 'core/localstorage';\nimport * as EmojiData from 'core/emoji/data';\nimport {throttle, debounce} from 'core/utils';\nimport {get_string} from 'core/str';\nimport {render as renderTemplate} from 'core/templates';\n\nconst VISIBLE_ROW_COUNT = 10;\nconst ROW_RENDER_BUFFER_COUNT = 5;\nconst RECENT_EMOJIS_STORAGE_KEY = 'moodle-recent-emojis';\nconst ROW_HEIGHT_RAW = 40;\nconst EMOJIS_PER_ROW = 7;\nconst MAX_RECENT_COUNT = EMOJIS_PER_ROW * 3;\nconst ROW_TYPE = {\n EMOJI: 0,\n HEADER: 1\n};\nconst SELECTORS = {\n CATEGORY_SELECTOR: '[data-action=\"show-category\"]',\n EMOJIS_CONTAINER: '[data-region=\"emojis-container\"]',\n EMOJI_PREVIEW: '[data-region=\"emoji-preview\"]',\n EMOJI_SHORT_NAME: '[data-region=\"emoji-short-name\"]',\n ROW_CONTAINER: '[data-region=\"row-container\"]',\n SEARCH_INPUT: '[data-region=\"search-input\"]',\n SEARCH_RESULTS_CONTAINER: '[data-region=\"search-results-container\"]'\n};\n\n/**\n * Create the row data for a category.\n *\n * @param {String} categoryName The category name\n * @param {String} categoryDisplayName The category display name\n * @param {Array} emojis The emoji data\n * @param {Number} totalRowCount The total number of rows generated so far\n * @return {Array}\n */\nconst createRowDataForCategory = (categoryName, categoryDisplayName, emojis, totalRowCount) => {\n const rowData = [];\n rowData.push({\n index: totalRowCount + rowData.length,\n type: ROW_TYPE.HEADER,\n data: {\n name: categoryName,\n displayName: categoryDisplayName\n }\n });\n\n for (let i = 0; i < emojis.length; i += EMOJIS_PER_ROW) {\n const rowEmojis = emojis.slice(i, i + EMOJIS_PER_ROW);\n rowData.push({\n index: totalRowCount + rowData.length,\n type: ROW_TYPE.EMOJI,\n data: rowEmojis\n });\n }\n\n return rowData;\n};\n\n/**\n * Add each row's index to it's value in the row data.\n *\n * @param {Array} rowData List of emoji row data\n * @return {Array}\n */\nconst addIndexesToRowData = (rowData) => {\n return rowData.map((data, index) => {\n return {...data, index};\n });\n};\n\n/**\n * Calculate the scroll position for the beginning of each category from\n * the row data.\n *\n * @param {Array} rowData List of emoji row data\n * @return {Object}\n */\nconst getCategoryScrollPositionsFromRowData = (rowData) => {\n return rowData.reduce((carry, row, index) => {\n if (row.type === ROW_TYPE.HEADER) {\n carry[row.data.name] = index * ROW_HEIGHT_RAW;\n }\n return carry;\n }, {});\n};\n\n/**\n * Create a header row element for the category name.\n *\n * @param {Number} rowIndex Index of the row in the row data\n * @param {String} name The category display name\n * @return {Element}\n */\nconst createHeaderRow = async (rowIndex, name) => {\n const context = {\n index: rowIndex,\n text: name\n };\n const html = await renderTemplate('core/emoji/header_row', context);\n const temp = document.createElement('div');\n temp.innerHTML = html;\n return temp.firstChild;\n};\n\n/**\n * Create an emoji row element.\n *\n * @param {Number} rowIndex Index of the row in the row data\n * @param {Array} emojis The list of emoji data for the row\n * @return {Element}\n */\nconst createEmojiRow = async (rowIndex, emojis) => {\n const context = {\n index: rowIndex,\n emojis: emojis.map(emojiData => {\n const charCodes = emojiData.unified.split('-').map(code => `0x${code}`);\n const emojiText = String.fromCodePoint.apply(null, charCodes);\n return {\n shortnames: `:${emojiData.shortnames.join(': :')}:`,\n unified: emojiData.unified,\n text: emojiText,\n spacer: false\n };\n }),\n spacers: Array(EMOJIS_PER_ROW - emojis.length).fill(true)\n };\n const html = await renderTemplate('core/emoji/emoji_row', context);\n const temp = document.createElement('div');\n temp.innerHTML = html;\n return temp.firstChild;\n};\n\n/**\n * Check if the element is an emoji element.\n *\n * @param {Element} element Element to check\n * @return {Bool}\n */\nconst isEmojiElement = element => element.getAttribute('data-short-names') !== null;\n\n/**\n * Search from an element and up through it's ancestors to fine the category\n * selector element and return it.\n *\n * @param {Element} element Element to begin searching from\n * @return {Element|null}\n */\nconst findCategorySelectorFromElement = element => {\n if (!element) {\n return null;\n }\n\n if (element.getAttribute('data-action') === 'show-category') {\n return element;\n } else {\n return findCategorySelectorFromElement(element.parentElement);\n }\n};\n\nconst getCategorySelectorByCategoryName = (root, name) => {\n return root.querySelector(`[data-category=\"${name}\"]`);\n};\n\n/**\n * Sets the given category selector element as active.\n *\n * @param {Element} root The root picker element\n * @param {Element} element The category selector element to make active\n */\nconst setCategorySelectorActive = (root, element) => {\n const allCategorySelectors = root.querySelectorAll(SELECTORS.CATEGORY_SELECTOR);\n\n for (let i = 0; i < allCategorySelectors.length; i++) {\n const selector = allCategorySelectors[i];\n selector.classList.remove('selected');\n }\n\n element.classList.add('selected');\n};\n\n/**\n * Get the category selector element and the scroll positions for the previous and\n * next categories for the given scroll position.\n *\n * @param {Element} root The picker root element\n * @param {Number} position The position to get the category for\n * @param {Object} categoryScrollPositions Set of scroll positions for all categories\n * @return {Array}\n */\nconst getCategoryByScrollPosition = (root, position, categoryScrollPositions) => {\n let positions = [];\n\n if (position < 0) {\n position = 0;\n }\n\n // Get all of the category positions.\n for (const categoryName in categoryScrollPositions) {\n const categoryPosition = categoryScrollPositions[categoryName];\n positions.push([categoryPosition, categoryName]);\n }\n\n // Sort the positions in ascending order.\n positions.sort(([a], [b]) => {\n if (a < b) {\n return -1;\n } else if (a > b) {\n return 1;\n } else {\n return 0;\n }\n });\n\n // Get the current category name as well as the previous and next category\n // positions from the sorted list of positions.\n const {categoryName, previousPosition, nextPosition} = positions.reduce(\n (carry, candidate) => {\n const [categoryPosition, categoryName] = candidate;\n\n if (categoryPosition <= position) {\n carry.categoryName = categoryName;\n carry.previousPosition = carry.currentPosition;\n carry.currentPosition = position;\n } else if (carry.nextPosition === null) {\n carry.nextPosition = categoryPosition;\n }\n\n return carry;\n },\n {\n categoryName: null,\n currentPosition: null,\n previousPosition: null,\n nextPosition: null\n }\n );\n\n return [getCategorySelectorByCategoryName(root, categoryName), previousPosition, nextPosition];\n};\n\n/**\n * Get the list of recent emojis data from local storage.\n *\n * @return {Array}\n */\nconst getRecentEmojis = () => {\n const storedData = LocalStorage.get(RECENT_EMOJIS_STORAGE_KEY);\n return storedData ? JSON.parse(storedData) : [];\n};\n\n/**\n * Save the list of recent emojis in local storage.\n *\n * @param {Array} recentEmojis List of emoji data to save\n */\nconst saveRecentEmoji = (recentEmojis) => {\n LocalStorage.set(RECENT_EMOJIS_STORAGE_KEY, JSON.stringify(recentEmojis));\n};\n\n/**\n * Add an emoji data to the set of recent emojis. This function will update the row\n * data to ensure that the recent emoji rows are correct and all of the rows are\n * re-indexed.\n *\n * The new set of recent emojis are saved in local storage and the full set of updated\n * row data and new emoji row count are returned.\n *\n * @param {Array} rowData The emoji rows data\n * @param {Number} recentEmojiRowCount Count of the recent emoji rows\n * @param {Object} newEmoji The emoji data for the emoji to add to the recent emoji list\n * @return {Array}\n */\nconst addRecentEmoji = (rowData, recentEmojiRowCount, newEmoji) => {\n // The first set of rows is always the recent emojis.\n const categoryName = rowData[0].data.name;\n const categoryDisplayName = rowData[0].data.displayName;\n const recentEmojis = getRecentEmojis();\n // Add the new emoji to the start of the list of recent emojis.\n let newRecentEmojis = [newEmoji, ...recentEmojis.filter(emoji => emoji.unified != newEmoji.unified)];\n // Limit the number of recent emojis.\n newRecentEmojis = newRecentEmojis.slice(0, MAX_RECENT_COUNT);\n const newRecentEmojiRowData = createRowDataForCategory(categoryName, categoryDisplayName, newRecentEmojis);\n\n // Save the new list in local storage.\n saveRecentEmoji(newRecentEmojis);\n\n return [\n // Return the new rowData and re-index it to make sure it's all correct.\n addIndexesToRowData(newRecentEmojiRowData.concat(rowData.slice(recentEmojiRowCount))),\n newRecentEmojiRowData.length\n ];\n};\n\n/**\n * Calculate which rows should be visible based on the given scroll position. Adds a\n * buffer to amount to either side of the total number of requested rows so that\n * scrolling the emoji rows container is smooth.\n *\n * @param {Number} scrollPosition Scroll position within the emoji container\n * @param {Number} visibleRowCount How many rows should be visible\n * @param {Array} rowData The emoji rows data\n * @return {Array}\n */\nconst getRowsToRender = (scrollPosition, visibleRowCount, rowData) => {\n const minVisibleRow = scrollPosition > ROW_HEIGHT_RAW ? Math.floor(scrollPosition / ROW_HEIGHT_RAW) : 0;\n const start = minVisibleRow >= ROW_RENDER_BUFFER_COUNT ? minVisibleRow - ROW_RENDER_BUFFER_COUNT : minVisibleRow;\n const end = minVisibleRow + visibleRowCount + ROW_RENDER_BUFFER_COUNT;\n const rows = rowData.slice(start, end);\n return rows;\n};\n\n/**\n * Create a row element from the row data.\n *\n * @param {Object} rowData The emoji row data\n * @return {Element}\n */\nconst createRowElement = async (rowData) => {\n let row = null;\n if (rowData.type === ROW_TYPE.HEADER) {\n row = await createHeaderRow(rowData.index, rowData.data.displayName);\n } else {\n row = await createEmojiRow(rowData.index, rowData.data);\n }\n\n row.style.position = 'absolute';\n row.style.left = 0;\n row.style.right = 0;\n row.style.top = `${rowData.index * ROW_HEIGHT_RAW}px`;\n\n return row;\n};\n\n/**\n * Check if the given rows match.\n *\n * @param {Object} a The first row\n * @param {Object} b The second row\n * @return {Bool}\n */\nconst doRowsMatch = (a, b) => {\n if (a.index !== b.index) {\n return false;\n }\n\n if (a.type !== b.type) {\n return false;\n }\n\n if (typeof a.data != typeof b.data) {\n return false;\n }\n\n if (a.type === ROW_TYPE.HEADER) {\n return a.data.name === b.data.name;\n } else {\n if (a.data.length !== b.data.length) {\n return false;\n }\n\n for (let i = 0; i < a.data.length; i++) {\n if (a.data[i].unified != b.data[i].unified) {\n return false;\n }\n }\n }\n\n return true;\n};\n\n/**\n * Update the visible rows. Deletes any row elements that should no longer\n * be visible and creates the newly visible row elements. Any rows that haven't\n * changed visibility will be left untouched.\n *\n * @param {Element} rowContainer The container element for the emoji rows\n * @param {Array} currentRows List of row data that matches the currently visible rows\n * @param {Array} nextRows List of row data containing the new list of rows to be made visible\n */\nconst renderRows = async (rowContainer, currentRows, nextRows) => {\n // We need to add any rows that are in nextRows but not in currentRows.\n const toAdd = nextRows.filter(nextRow => !currentRows.some(currentRow => doRowsMatch(currentRow, nextRow)));\n // Remember which rows will still be visible so that we can insert our element in the correct place in the DOM.\n let toKeep = currentRows.filter(currentRow => nextRows.some(nextRow => doRowsMatch(currentRow, nextRow)));\n // We need to remove any rows that are in currentRows but not in nextRows.\n const toRemove = currentRows.filter(currentRow => !nextRows.some(nextRow => doRowsMatch(currentRow, nextRow)));\n const toRemoveElements = toRemove.map(rowData => rowContainer.querySelectorAll(`[data-row=\"${rowData.index}\"]`));\n\n // Render all of the templates first.\n const rows = await Promise.all(toAdd.map(rowData => createRowElement(rowData)));\n\n rows.forEach((row, index) => {\n const rowData = toAdd[index];\n let nextRowIndex = null;\n\n for (let i = 0; i < toKeep.length; i++) {\n const candidate = toKeep[i];\n if (candidate.index > rowData.index) {\n nextRowIndex = i;\n break;\n }\n }\n\n // Make sure the elements get added to the DOM in the correct order (ascending by row data index)\n // so that they appear naturally in the tab order.\n if (nextRowIndex !== null) {\n const nextRowData = toKeep[nextRowIndex];\n const nextRowNode = rowContainer.querySelector(`[data-row=\"${nextRowData.index}\"]`);\n\n rowContainer.insertBefore(row, nextRowNode);\n toKeep.splice(nextRowIndex, 0, toKeep);\n } else {\n toKeep.push(rowData);\n rowContainer.appendChild(row);\n }\n });\n\n toRemoveElements.forEach(rows => {\n for (let i = 0; i < rows.length; i++) {\n const row = rows[i];\n rowContainer.removeChild(row);\n }\n });\n};\n\n/**\n * Build a function to render the visible emoji rows for a given scroll\n * position.\n *\n * @param {Element} rowContainer The container element for the emoji rows\n * @return {Function}\n */\nconst generateRenderRowsAtPositionFunction = (rowContainer) => {\n let currentRows = [];\n let nextRows = [];\n let rowCount = 0;\n let isRendering = false;\n const renderNextRows = async () => {\n if (!nextRows.length) {\n return;\n }\n\n if (isRendering) {\n return;\n }\n\n isRendering = true;\n const nextRowsToRender = nextRows.slice();\n nextRows = [];\n\n await renderRows(rowContainer, currentRows, nextRowsToRender);\n currentRows = nextRowsToRender;\n isRendering = false;\n renderNextRows();\n };\n\n return (scrollPosition, rowData, rowLimit = VISIBLE_ROW_COUNT) => {\n nextRows = getRowsToRender(scrollPosition, rowLimit, rowData);\n renderNextRows();\n\n if (rowCount !== rowData.length) {\n // Adjust the height of the container to match the number of rows.\n rowContainer.style.height = `${rowData.length * ROW_HEIGHT_RAW}px`;\n }\n\n rowCount = rowData.length;\n };\n};\n\n/**\n * Show the search results container and hide the emoji container.\n *\n * @param {Element} emojiContainer The emojis container\n * @param {Element} searchResultsContainer The search results container\n */\nconst showSearchResults = (emojiContainer, searchResultsContainer) => {\n searchResultsContainer.classList.remove('hidden');\n emojiContainer.classList.add('hidden');\n};\n\n/**\n * Hide the search result container and show the emojis container.\n *\n * @param {Element} emojiContainer The emojis container\n * @param {Element} searchResultsContainer The search results container\n * @param {Element} searchInput The search input\n */\nconst clearSearch = (emojiContainer, searchResultsContainer, searchInput) => {\n searchResultsContainer.classList.add('hidden');\n emojiContainer.classList.remove('hidden');\n searchInput.value = '';\n};\n\n/**\n * Build function to handle mouse hovering an emoji. Shows the preview.\n *\n * @param {Element} emojiPreview The emoji preview element\n * @param {Element} emojiShortName The emoji short name element\n * @return {Function}\n */\nconst getHandleMouseEnter = (emojiPreview, emojiShortName) => {\n return (e) => {\n const target = e.target;\n if (isEmojiElement(target)) {\n emojiShortName.textContent = target.getAttribute('data-short-names');\n emojiPreview.textContent = target.textContent;\n }\n };\n};\n\n/**\n * Build function to handle mouse leaving an emoji. Removes the preview.\n *\n * @param {Element} emojiPreview The emoji preview element\n * @param {Element} emojiShortName The emoji short name element\n * @return {Function}\n */\nconst getHandleMouseLeave = (emojiPreview, emojiShortName) => {\n return (e) => {\n const target = e.target;\n if (isEmojiElement(target)) {\n emojiShortName.textContent = '';\n emojiPreview.textContent = '';\n }\n };\n};\n\n/**\n * Build the function to handle a user clicking something in the picker.\n *\n * The function currently handles clicking on the category selector or selecting\n * a specific emoji.\n *\n * @param {Number} recentEmojiRowCount Number of rows of recent emojis\n * @param {Element} emojiContainer Container element for the visible of emojis\n * @param {Element} searchResultsContainer Contaienr element for the search results\n * @param {Element} searchInput Search input element\n * @param {Function} selectCallback Callback function to execute when a user selects an emoji\n * @param {Function} renderAtPosition Render function to display current visible emojis\n * @return {Function}\n */\nconst getHandleClick = (\n recentEmojiRowCount,\n emojiContainer,\n searchResultsContainer,\n searchInput,\n selectCallback,\n renderAtPosition\n) => {\n return (e, rowData, categoryScrollPositions) => {\n const target = e.target;\n let newRowData = rowData;\n let newCategoryScrollPositions = categoryScrollPositions;\n\n // Hide the search results if they are visible.\n clearSearch(emojiContainer, searchResultsContainer, searchInput);\n\n if (isEmojiElement(target)) {\n // Emoji selected.\n const unified = target.getAttribute('data-unified');\n const shortnames = target.getAttribute('data-short-names').replace(/:/g, '').split(' ');\n // Build the emoji data from the selected element.\n const emojiData = {unified, shortnames};\n const currentScrollTop = emojiContainer.scrollTop;\n const isRecentEmojiRowVisible = emojiContainer.querySelector(`[data-row=\"${recentEmojiRowCount - 1}\"]`) !== null;\n // Save the selected emoji in the recent emojis list.\n [newRowData, recentEmojiRowCount] = addRecentEmoji(rowData, recentEmojiRowCount, emojiData);\n // Re-index the category scroll positions because the additional recent emoji may have\n // changed their positions.\n newCategoryScrollPositions = getCategoryScrollPositionsFromRowData(newRowData);\n\n if (isRecentEmojiRowVisible) {\n // If the list of recent emojis is currently visible then we need to re-render the emojis\n // to update the display and show the newly selected recent emoji.\n renderAtPosition(currentScrollTop, newRowData);\n }\n\n // Call the client's callback function with the selected emoji.\n selectCallback(target.textContent);\n // Return the newly calculated row data and scroll positions.\n return [newRowData, newCategoryScrollPositions];\n }\n\n const categorySelector = findCategorySelectorFromElement(target);\n if (categorySelector) {\n // Category selector.\n const selectedCategory = categorySelector.getAttribute('data-category');\n const position = categoryScrollPositions[selectedCategory];\n // Scroll the container to the selected category. This will trigger the\n // on scroll handler to re-render the visibile emojis.\n emojiContainer.scrollTop = position;\n }\n\n return [newRowData, newCategoryScrollPositions];\n };\n};\n\n/**\n * Build the function that handles scrolling of the emoji container to display the\n * correct emojis.\n *\n * We render the emoji rows as they are needed rather than all up front so that we\n * can avoid adding tends of thousands of elements to the DOM unnecessarily which\n * would bog down performance.\n *\n * @param {Element} root The picker root element\n * @param {Number} currentVisibleRowScrollPosition The current scroll position of the container\n * @param {Element} emojiContainer The emojis container element\n * @param {Object} initialCategoryScrollPositions Scroll positions for each category\n * @param {Function} renderAtPosition Function to render the appropriate emojis for a scroll position\n * @return {Function}\n */\nconst getHandleScroll = (\n root,\n currentVisibleRowScrollPosition,\n emojiContainer,\n initialCategoryScrollPositions,\n renderAtPosition\n) => {\n // Scope some local variables to track the scroll positions of the categories. We need to\n // recalculate these because adding recent emojis can change those positions by adding\n // additional rows.\n let [\n currentCategoryElement,\n previousCategoryPosition,\n nextCategoryPosition\n ] = getCategoryByScrollPosition(root, emojiContainer.scrollTop, initialCategoryScrollPositions);\n\n return (categoryScrollPositions, rowData) => {\n const newScrollPosition = emojiContainer.scrollTop;\n const upperScrollBound = currentVisibleRowScrollPosition + ROW_HEIGHT_RAW;\n const lowerScrollBound = currentVisibleRowScrollPosition - ROW_HEIGHT_RAW;\n // We only need to update the active category indicator if the user has scrolled into a\n // new category scroll position.\n const updateActiveCategory = (newScrollPosition >= nextCategoryPosition) ||\n (newScrollPosition < previousCategoryPosition);\n // We only need to render new emoji rows if the user has scrolled far enough that a new row\n // would be visible (i.e. they've scrolled up or down more than 40px - the height of a row).\n const updateRenderRows = (newScrollPosition < lowerScrollBound) || (newScrollPosition > upperScrollBound);\n\n if (updateActiveCategory) {\n // New category is visible so update the active category selector and re-index the\n // positions incase anything has changed.\n [\n currentCategoryElement,\n previousCategoryPosition,\n nextCategoryPosition\n ] = getCategoryByScrollPosition(root, newScrollPosition, categoryScrollPositions);\n setCategorySelectorActive(root, currentCategoryElement);\n }\n\n if (updateRenderRows) {\n // A new row should be visible so re-render the visible emojis at this new position.\n // We request an animation frame from the browser so that we're not blocking anything.\n // The animation only needs to occur as soon as the browser is ready not immediately.\n requestAnimationFrame(() => {\n renderAtPosition(newScrollPosition, rowData);\n // Remember the updated position.\n currentVisibleRowScrollPosition = newScrollPosition;\n });\n }\n };\n};\n\n/**\n * Build the function that handles search input from the user.\n *\n * @param {Element} searchInput The search input element\n * @param {Element} searchResultsContainer Container element to display the search results\n * @param {Element} emojiContainer Container element for the emoji rows\n * @return {Function}\n */\nconst getHandleSearch = (searchInput, searchResultsContainer, emojiContainer) => {\n const rowContainer = searchResultsContainer.querySelector(SELECTORS.ROW_CONTAINER);\n // Build a render function for the search results.\n const renderSearchResultsAtPosition = generateRenderRowsAtPositionFunction(rowContainer);\n searchResultsContainer.appendChild(rowContainer);\n\n return async () => {\n const searchTerm = searchInput.value.toLowerCase();\n\n if (searchTerm) {\n // Display the search results container and hide the emojis container.\n showSearchResults(emojiContainer, searchResultsContainer);\n\n // Find which emojis match the user's search input.\n const matchingEmojis = Object.keys(EmojiData.byShortName).reduce((carry, shortName) => {\n if (shortName.includes(searchTerm)) {\n carry.push({\n shortnames: [shortName],\n unified: EmojiData.byShortName[shortName]\n });\n }\n return carry;\n }, []);\n\n const searchResultsString = await get_string('searchresults', 'core');\n const rowData = createRowDataForCategory(searchResultsString, searchResultsString, matchingEmojis, 0);\n // Show the emoji rows for the search results.\n renderSearchResultsAtPosition(0, rowData, rowData.length);\n } else {\n // Hide the search container and show the emojis container.\n clearSearch(emojiContainer, searchResultsContainer, searchInput);\n }\n };\n};\n\n/**\n * Register the emoji picker event listeners.\n *\n * @param {Element} root The picker root element\n * @param {Element} emojiContainer Root element containing the list of visible emojis\n * @param {Function} renderAtPosition Function to render the visible emojis at a given scroll position\n * @param {Number} currentVisibleRowScrollPosition What is the current scroll position\n * @param {Function} selectCallback Function to execute when the user picks an emoji\n * @param {Object} categoryScrollPositions Scroll positions for where each of the emoji categories begin\n * @param {Array} rowData Data representing each of the display rows for hte emoji container\n * @param {Number} recentEmojiRowCount Number of rows of recent emojis\n */\nconst registerEventListeners = (\n root,\n emojiContainer,\n renderAtPosition,\n currentVisibleRowScrollPosition,\n selectCallback,\n categoryScrollPositions,\n rowData,\n recentEmojiRowCount\n) => {\n const searchInput = root.querySelector(SELECTORS.SEARCH_INPUT);\n const searchResultsContainer = root.querySelector(SELECTORS.SEARCH_RESULTS_CONTAINER);\n const emojiPreview = root.querySelector(SELECTORS.EMOJI_PREVIEW);\n const emojiShortName = root.querySelector(SELECTORS.EMOJI_SHORT_NAME);\n // Build the click handler function.\n const clickHandler = getHandleClick(\n recentEmojiRowCount,\n emojiContainer,\n searchResultsContainer,\n searchInput,\n selectCallback,\n renderAtPosition\n );\n // Build the scroll handler function.\n const scrollHandler = getHandleScroll(\n root,\n currentVisibleRowScrollPosition,\n emojiContainer,\n categoryScrollPositions,\n renderAtPosition\n );\n const searchHandler = getHandleSearch(searchInput, searchResultsContainer, emojiContainer);\n\n // Mouse enter/leave events to show the emoji preview on hover or focus.\n root.addEventListener('focus', getHandleMouseEnter(emojiPreview, emojiShortName), true);\n root.addEventListener('blur', getHandleMouseLeave(emojiPreview, emojiShortName), true);\n root.addEventListener('mouseenter', getHandleMouseEnter(emojiPreview, emojiShortName), true);\n root.addEventListener('mouseleave', getHandleMouseLeave(emojiPreview, emojiShortName), true);\n // User selects an emoji or clicks on one of the emoji category selectors.\n root.addEventListener('click', e => {\n // Update the row data and category scroll positions because they may have changes if the\n // user selects an emoji which updates the recent emojis list.\n [rowData, categoryScrollPositions] = clickHandler(e, rowData, categoryScrollPositions);\n });\n // Throttle the scroll event to only execute once every 50 milliseconds to prevent performance issues\n // in the browser when re-rendering the picker emojis. The scroll event fires a lot otherwise.\n emojiContainer.addEventListener('scroll', throttle(() => scrollHandler(categoryScrollPositions, rowData), 50));\n // Debounce the search input so that it only executes 200 milliseconds after the user has finished typing.\n searchInput.addEventListener('input', debounce(searchHandler, 200));\n};\n\n/**\n * Initialise the emoji picker.\n *\n * @param {Element} root The root element for the picker\n * @param {Function} selectCallback Callback for when the user selects an emoji\n */\nexport default (root, selectCallback) => {\n const emojiContainer = root.querySelector(SELECTORS.EMOJIS_CONTAINER);\n const rowContainer = emojiContainer.querySelector(SELECTORS.ROW_CONTAINER);\n const recentEmojis = getRecentEmojis();\n // Add the recent emojis category to the list of standard categories.\n const allData = [{\n name: 'Recent',\n emojis: recentEmojis\n }, ...EmojiData.byCategory];\n let rowData = [];\n let recentEmojiRowCount = 0;\n\n /**\n * Split categories data into rows which represent how they will be displayed in the\n * picker. Each category will add a row containing the display name for the category\n * and a row for every 9 emojis in the category. The row data will be used to calculate\n * which emojis should be visible in the picker at any given time.\n *\n * E.g.\n * input = [\n * {name: 'example1', emojis: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]},\n * {name: 'example2', emojis: [13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]},\n * ]\n * output = [\n * {type: 'categoryName': data: 'Example 1'},\n * {type: 'emojiRow': data: [1, 2, 3, 4, 5, 6, 7, 8, 9]},\n * {type: 'emojiRow': data: [10, 11, 12]},\n * {type: 'categoryName': data: 'Example 2'},\n * {type: 'emojiRow': data: [13, 14, 15, 16, 17, 18, 19, 20, 21]},\n * {type: 'emojiRow': data: [22, 23]},\n * ]\n */\n allData.forEach(category => {\n const categorySelector = getCategorySelectorByCategoryName(root, category.name);\n // Get the display name from the category selector button so that we don't need to\n // send an ajax request for the string.\n const categoryDisplayName = categorySelector.title;\n const categoryRowData = createRowDataForCategory(category.name, categoryDisplayName, category.emojis, rowData.length);\n\n if (category.name === 'Recent') {\n // Remember how many recent emoji rows there are because it needs to be used to\n // re-index the row data later when we're adding more recent emojis.\n recentEmojiRowCount = categoryRowData.length;\n }\n\n rowData = rowData.concat(categoryRowData);\n });\n\n // Index the row data so that we can calculate which rows should be visible.\n rowData = addIndexesToRowData(rowData);\n // Calculate the scroll positions for each of the categories within the emoji container.\n // These are used to know where to jump to when the user selects a specific category.\n const categoryScrollPositions = getCategoryScrollPositionsFromRowData(rowData);\n const renderAtPosition = generateRenderRowsAtPositionFunction(rowContainer);\n // Display the initial set of emojis.\n renderAtPosition(0, rowData);\n\n registerEventListeners(\n root,\n emojiContainer,\n renderAtPosition,\n 0,\n selectCallback,\n categoryScrollPositions,\n rowData,\n recentEmojiRowCount\n );\n};"],"file":"picker.min.js"} \ No newline at end of file +{"version":3,"sources":["../../src/emoji/picker.js"],"names":["ROW_RENDER_BUFFER_COUNT","RECENT_EMOJIS_STORAGE_KEY","ROW_HEIGHT_RAW","EMOJIS_PER_ROW","ROW_TYPE","EMOJI","HEADER","SELECTORS","CATEGORY_SELECTOR","EMOJIS_CONTAINER","EMOJI_PREVIEW","EMOJI_SHORT_NAME","ROW_CONTAINER","SEARCH_INPUT","SEARCH_RESULTS_CONTAINER","createRowDataForCategory","categoryName","categoryDisplayName","emojis","totalRowCount","rowData","push","index","length","type","data","name","displayName","i","rowEmojis","slice","addIndexesToRowData","map","getCategoryScrollPositionsFromRowData","reduce","carry","row","createHeaderRow","rowIndex","context","text","html","temp","document","createElement","innerHTML","firstChild","createEmojiRow","emojiData","charCodes","unified","split","code","emojiText","String","fromCodePoint","apply","shortnames","join","spacer","spacers","Array","fill","isEmojiElement","element","getAttribute","findCategorySelectorFromElement","parentElement","getCategorySelectorByCategoryName","root","querySelector","setCategorySelectorActive","allCategorySelectors","querySelectorAll","selector","classList","remove","add","getCategoryByScrollPosition","position","categoryScrollPositions","positions","categoryPosition","sort","a","b","candidate","previousPosition","currentPosition","nextPosition","getRecentEmojis","storedData","LocalStorage","get","JSON","parse","saveRecentEmoji","recentEmojis","set","stringify","addRecentEmoji","recentEmojiRowCount","newEmoji","newRecentEmojis","filter","emoji","newRecentEmojiRowData","concat","getRowsToRender","scrollPosition","visibleRowCount","minVisibleRow","Math","floor","start","rows","createRowElement","style","left","right","top","doRowsMatch","renderRows","rowContainer","currentRows","nextRows","toAdd","nextRow","some","currentRow","toKeep","toRemove","toRemoveElements","Promise","all","forEach","nextRowIndex","nextRowData","nextRowNode","insertBefore","splice","appendChild","removeChild","generateRenderRowsAtPositionFunction","rowCount","isRendering","renderNextRows","nextRowsToRender","rowLimit","height","showSearchResults","emojiContainer","searchResultsContainer","clearSearch","searchInput","value","getHandleMouseEnter","emojiPreview","emojiShortName","e","target","textContent","getHandleMouseLeave","getHandleClick","selectCallback","renderAtPosition","newRowData","newCategoryScrollPositions","replace","currentScrollTop","scrollTop","isRecentEmojiRowVisible","categorySelector","selectedCategory","getHandleScroll","currentVisibleRowScrollPosition","initialCategoryScrollPositions","currentCategoryElement","previousCategoryPosition","nextCategoryPosition","newScrollPosition","upperScrollBound","lowerScrollBound","updateActiveCategory","requestAnimationFrame","getHandleSearch","renderSearchResultsAtPosition","searchTerm","toLowerCase","matchingEmojis","Object","keys","EmojiData","byShortName","shortName","includes","searchResultsString","registerEventListeners","clickHandler","scrollHandler","searchHandler","addEventListener","allData","byCategory","category","title","categoryRowData"],"mappings":"4NAqBA,uDACA,O,8pGAMMA,CAAAA,CAAuB,CAAG,C,CAC1BC,CAAyB,CAAG,sB,CAC5BC,CAAc,CAAG,E,CACjBC,CAAc,CAAG,C,CAEjBC,CAAQ,CAAG,CACbC,KAAK,CAAE,CADM,CAEbC,MAAM,CAAE,CAFK,C,CAIXC,CAAS,CAAG,CACdC,iBAAiB,CAAE,iCADL,CAEdC,gBAAgB,CA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AE,QADO,CAEbR,MAAM,CAAE+E,CAFK,CAAJ,WAGP+F,CAAS,CAACW,UAHH,EALwB,CASjCvL,CAAO,CAAG,EATuB,CAUjCiF,CAAmB,CAAG,CAVW,CAgCrCqG,CAAO,CAACnE,OAAR,CAAgB,SAAAqE,CAAQ,CAAI,IAClBhC,CAAAA,CAAgB,CAAGxG,CAAiC,CAACC,CAAD,CAAOuI,CAAQ,CAAClL,IAAhB,CADlC,CAIlBT,CAAmB,CAAG2J,CAAgB,CAACiC,KAJrB,CAKlBC,CAAe,CAAG/L,CAAwB,CAAC6L,CAAQ,CAAClL,IAAV,CAAgBT,CAAhB,CAAqC2L,CAAQ,CAAC1L,MAA9C,CAAsDE,CAAO,CAACG,MAA9D,CALxB,CAOxB,GAAsB,QAAlB,GAAAqL,CAAQ,CAAClL,IAAb,CAAgC,CAG5B2E,CAAmB,CAAGyG,CAAe,CAACvL,MACzC,CAEDH,CAAO,CAAGA,CAAO,CAACuF,MAAR,CAAemG,CAAf,CACb,CAdD,EAiBA1L,CAAO,CAAGW,CAAmB,CAACX,CAAD,CAA7B,CAjDqC,GAoD/B4D,CAAAA,CAAuB,CAAG/C,CAAqC,CAACb,CAAD,CApDhC,CAqD/BiJ,CAAgB,CAAGtB,CAAoC,CAACpB,CAAD,CArDxB,CAuDrC0C,CAAgB,CAAC,CAAD,CAAIjJ,CAAJ,CAAhB,CAEAiL,EAAsB,CAClBhI,CADkB,CAElBkF,CAFkB,CAGlBc,CAHkB,CAIlB,CAJkB,CAKlBD,CALkB,CAMlBpF,CANkB,CAOlB5D,CAPkB,CAQlBiF,CARkB,CAUzB,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Emoji picker.\n *\n * @copyright 2019 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport LocalStorage from 'core/localstorage';\nimport * as EmojiData from 'core/emoji/data';\nimport {throttle, debounce} from 'core/utils';\nimport {get_string} from 'core/str';\nimport {render as renderTemplate} from 'core/templates';\n\nconst VISIBLE_ROW_COUNT = 10;\nconst ROW_RENDER_BUFFER_COUNT = 5;\nconst RECENT_EMOJIS_STORAGE_KEY = 'moodle-recent-emojis';\nconst ROW_HEIGHT_RAW = 40;\nconst EMOJIS_PER_ROW = 7;\nconst MAX_RECENT_COUNT = EMOJIS_PER_ROW * 3;\nconst ROW_TYPE = {\n EMOJI: 0,\n HEADER: 1\n};\nconst SELECTORS = {\n CATEGORY_SELECTOR: '[data-action=\"show-category\"]',\n EMOJIS_CONTAINER: '[data-region=\"emojis-container\"]',\n EMOJI_PREVIEW: '[data-region=\"emoji-preview\"]',\n EMOJI_SHORT_NAME: '[data-region=\"emoji-short-name\"]',\n ROW_CONTAINER: '[data-region=\"row-container\"]',\n SEARCH_INPUT: '[data-region=\"search-input\"]',\n SEARCH_RESULTS_CONTAINER: '[data-region=\"search-results-container\"]'\n};\n\n/**\n * Create the row data for a category.\n *\n * @param {String} categoryName The category name\n * @param {String} categoryDisplayName The category display name\n * @param {Array} emojis The emoji data\n * @param {Number} totalRowCount The total number of rows generated so far\n * @return {Array}\n */\nconst createRowDataForCategory = (categoryName, categoryDisplayName, emojis, totalRowCount) => {\n const rowData = [];\n rowData.push({\n index: totalRowCount + rowData.length,\n type: ROW_TYPE.HEADER,\n data: {\n name: categoryName,\n displayName: categoryDisplayName\n }\n });\n\n for (let i = 0; i < emojis.length; i += EMOJIS_PER_ROW) {\n const rowEmojis = emojis.slice(i, i + EMOJIS_PER_ROW);\n rowData.push({\n index: totalRowCount + rowData.length,\n type: ROW_TYPE.EMOJI,\n data: rowEmojis\n });\n }\n\n return rowData;\n};\n\n/**\n * Add each row's index to it's value in the row data.\n *\n * @param {Array} rowData List of emoji row data\n * @return {Array}\n */\nconst addIndexesToRowData = (rowData) => {\n return rowData.map((data, index) => {\n return {...data, index};\n });\n};\n\n/**\n * Calculate the scroll position for the beginning of each category from\n * the row data.\n *\n * @param {Array} rowData List of emoji row data\n * @return {Object}\n */\nconst getCategoryScrollPositionsFromRowData = (rowData) => {\n return rowData.reduce((carry, row, index) => {\n if (row.type === ROW_TYPE.HEADER) {\n carry[row.data.name] = index * ROW_HEIGHT_RAW;\n }\n return carry;\n }, {});\n};\n\n/**\n * Create a header row element for the category name.\n *\n * @param {Number} rowIndex Index of the row in the row data\n * @param {String} name The category display name\n * @return {Element}\n */\nconst createHeaderRow = async (rowIndex, name) => {\n const context = {\n index: rowIndex,\n text: name\n };\n const html = await renderTemplate('core/emoji/header_row', context);\n const temp = document.createElement('div');\n temp.innerHTML = html;\n return temp.firstChild;\n};\n\n/**\n * Create an emoji row element.\n *\n * @param {Number} rowIndex Index of the row in the row data\n * @param {Array} emojis The list of emoji data for the row\n * @return {Element}\n */\nconst createEmojiRow = async (rowIndex, emojis) => {\n const context = {\n index: rowIndex,\n emojis: emojis.map(emojiData => {\n const charCodes = emojiData.unified.split('-').map(code => `0x${code}`);\n const emojiText = String.fromCodePoint.apply(null, charCodes);\n return {\n shortnames: `:${emojiData.shortnames.join(': :')}:`,\n unified: emojiData.unified,\n text: emojiText,\n spacer: false\n };\n }),\n spacers: Array(EMOJIS_PER_ROW - emojis.length).fill(true)\n };\n const html = await renderTemplate('core/emoji/emoji_row', context);\n const temp = document.createElement('div');\n temp.innerHTML = html;\n return temp.firstChild;\n};\n\n/**\n * Check if the element is an emoji element.\n *\n * @param {Element} element Element to check\n * @return {Bool}\n */\nconst isEmojiElement = element => element.getAttribute('data-short-names') !== null;\n\n/**\n * Search from an element and up through it's ancestors to fine the category\n * selector element and return it.\n *\n * @param {Element} element Element to begin searching from\n * @return {Element|null}\n */\nconst findCategorySelectorFromElement = element => {\n if (!element) {\n return null;\n }\n\n if (element.getAttribute('data-action') === 'show-category') {\n return element;\n } else {\n return findCategorySelectorFromElement(element.parentElement);\n }\n};\n\nconst getCategorySelectorByCategoryName = (root, name) => {\n return root.querySelector(`[data-category=\"${name}\"]`);\n};\n\n/**\n * Sets the given category selector element as active.\n *\n * @param {Element} root The root picker element\n * @param {Element} element The category selector element to make active\n */\nconst setCategorySelectorActive = (root, element) => {\n const allCategorySelectors = root.querySelectorAll(SELECTORS.CATEGORY_SELECTOR);\n\n for (let i = 0; i < allCategorySelectors.length; i++) {\n const selector = allCategorySelectors[i];\n selector.classList.remove('selected');\n }\n\n element.classList.add('selected');\n};\n\n/**\n * Get the category selector element and the scroll positions for the previous and\n * next categories for the given scroll position.\n *\n * @param {Element} root The picker root element\n * @param {Number} position The position to get the category for\n * @param {Object} categoryScrollPositions Set of scroll positions for all categories\n * @return {Array}\n */\nconst getCategoryByScrollPosition = (root, position, categoryScrollPositions) => {\n let positions = [];\n\n if (position < 0) {\n position = 0;\n }\n\n // Get all of the category positions.\n for (const categoryName in categoryScrollPositions) {\n const categoryPosition = categoryScrollPositions[categoryName];\n positions.push([categoryPosition, categoryName]);\n }\n\n // Sort the positions in ascending order.\n positions.sort(([a], [b]) => {\n if (a < b) {\n return -1;\n } else if (a > b) {\n return 1;\n } else {\n return 0;\n }\n });\n\n // Get the current category name as well as the previous and next category\n // positions from the sorted list of positions.\n const {categoryName, previousPosition, nextPosition} = positions.reduce(\n (carry, candidate) => {\n const [categoryPosition, categoryName] = candidate;\n\n if (categoryPosition <= position) {\n carry.categoryName = categoryName;\n carry.previousPosition = carry.currentPosition;\n carry.currentPosition = position;\n } else if (carry.nextPosition === null) {\n carry.nextPosition = categoryPosition;\n }\n\n return carry;\n },\n {\n categoryName: null,\n currentPosition: null,\n previousPosition: null,\n nextPosition: null\n }\n );\n\n return [getCategorySelectorByCategoryName(root, categoryName), previousPosition, nextPosition];\n};\n\n/**\n * Get the list of recent emojis data from local storage.\n *\n * @return {Array}\n */\nconst getRecentEmojis = () => {\n const storedData = LocalStorage.get(RECENT_EMOJIS_STORAGE_KEY);\n return storedData ? JSON.parse(storedData) : [];\n};\n\n/**\n * Save the list of recent emojis in local storage.\n *\n * @param {Array} recentEmojis List of emoji data to save\n */\nconst saveRecentEmoji = (recentEmojis) => {\n LocalStorage.set(RECENT_EMOJIS_STORAGE_KEY, JSON.stringify(recentEmojis));\n};\n\n/**\n * Add an emoji data to the set of recent emojis. This function will update the row\n * data to ensure that the recent emoji rows are correct and all of the rows are\n * re-indexed.\n *\n * The new set of recent emojis are saved in local storage and the full set of updated\n * row data and new emoji row count are returned.\n *\n * @param {Array} rowData The emoji rows data\n * @param {Number} recentEmojiRowCount Count of the recent emoji rows\n * @param {Object} newEmoji The emoji data for the emoji to add to the recent emoji list\n * @return {Array}\n */\nconst addRecentEmoji = (rowData, recentEmojiRowCount, newEmoji) => {\n // The first set of rows is always the recent emojis.\n const categoryName = rowData[0].data.name;\n const categoryDisplayName = rowData[0].data.displayName;\n const recentEmojis = getRecentEmojis();\n // Add the new emoji to the start of the list of recent emojis.\n let newRecentEmojis = [newEmoji, ...recentEmojis.filter(emoji => emoji.unified != newEmoji.unified)];\n // Limit the number of recent emojis.\n newRecentEmojis = newRecentEmojis.slice(0, MAX_RECENT_COUNT);\n const newRecentEmojiRowData = createRowDataForCategory(categoryName, categoryDisplayName, newRecentEmojis);\n\n // Save the new list in local storage.\n saveRecentEmoji(newRecentEmojis);\n\n return [\n // Return the new rowData and re-index it to make sure it's all correct.\n addIndexesToRowData(newRecentEmojiRowData.concat(rowData.slice(recentEmojiRowCount))),\n newRecentEmojiRowData.length\n ];\n};\n\n/**\n * Calculate which rows should be visible based on the given scroll position. Adds a\n * buffer to amount to either side of the total number of requested rows so that\n * scrolling the emoji rows container is smooth.\n *\n * @param {Number} scrollPosition Scroll position within the emoji container\n * @param {Number} visibleRowCount How many rows should be visible\n * @param {Array} rowData The emoji rows data\n * @return {Array}\n */\nconst getRowsToRender = (scrollPosition, visibleRowCount, rowData) => {\n const minVisibleRow = scrollPosition > ROW_HEIGHT_RAW ? Math.floor(scrollPosition / ROW_HEIGHT_RAW) : 0;\n const start = minVisibleRow >= ROW_RENDER_BUFFER_COUNT ? minVisibleRow - ROW_RENDER_BUFFER_COUNT : minVisibleRow;\n const end = minVisibleRow + visibleRowCount + ROW_RENDER_BUFFER_COUNT;\n const rows = rowData.slice(start, end);\n return rows;\n};\n\n/**\n * Create a row element from the row data.\n *\n * @param {Object} rowData The emoji row data\n * @return {Element}\n */\nconst createRowElement = async (rowData) => {\n let row = null;\n if (rowData.type === ROW_TYPE.HEADER) {\n row = await createHeaderRow(rowData.index, rowData.data.displayName);\n } else {\n row = await createEmojiRow(rowData.index, rowData.data);\n }\n\n row.style.position = 'absolute';\n row.style.left = 0;\n row.style.right = 0;\n row.style.top = `${rowData.index * ROW_HEIGHT_RAW}px`;\n\n return row;\n};\n\n/**\n * Check if the given rows match.\n *\n * @param {Object} a The first row\n * @param {Object} b The second row\n * @return {Bool}\n */\nconst doRowsMatch = (a, b) => {\n if (a.index !== b.index) {\n return false;\n }\n\n if (a.type !== b.type) {\n return false;\n }\n\n if (typeof a.data != typeof b.data) {\n return false;\n }\n\n if (a.type === ROW_TYPE.HEADER) {\n return a.data.name === b.data.name;\n } else {\n if (a.data.length !== b.data.length) {\n return false;\n }\n\n for (let i = 0; i < a.data.length; i++) {\n if (a.data[i].unified != b.data[i].unified) {\n return false;\n }\n }\n }\n\n return true;\n};\n\n/**\n * Update the visible rows. Deletes any row elements that should no longer\n * be visible and creates the newly visible row elements. Any rows that haven't\n * changed visibility will be left untouched.\n *\n * @param {Element} rowContainer The container element for the emoji rows\n * @param {Array} currentRows List of row data that matches the currently visible rows\n * @param {Array} nextRows List of row data containing the new list of rows to be made visible\n */\nconst renderRows = async (rowContainer, currentRows, nextRows) => {\n // We need to add any rows that are in nextRows but not in currentRows.\n const toAdd = nextRows.filter(nextRow => !currentRows.some(currentRow => doRowsMatch(currentRow, nextRow)));\n // Remember which rows will still be visible so that we can insert our element in the correct place in the DOM.\n let toKeep = currentRows.filter(currentRow => nextRows.some(nextRow => doRowsMatch(currentRow, nextRow)));\n // We need to remove any rows that are in currentRows but not in nextRows.\n const toRemove = currentRows.filter(currentRow => !nextRows.some(nextRow => doRowsMatch(currentRow, nextRow)));\n const toRemoveElements = toRemove.map(rowData => rowContainer.querySelectorAll(`[data-row=\"${rowData.index}\"]`));\n\n // Render all of the templates first.\n const rows = await Promise.all(toAdd.map(rowData => createRowElement(rowData)));\n\n rows.forEach((row, index) => {\n const rowData = toAdd[index];\n let nextRowIndex = null;\n\n for (let i = 0; i < toKeep.length; i++) {\n const candidate = toKeep[i];\n if (candidate.index > rowData.index) {\n nextRowIndex = i;\n break;\n }\n }\n\n // Make sure the elements get added to the DOM in the correct order (ascending by row data index)\n // so that they appear naturally in the tab order.\n if (nextRowIndex !== null) {\n const nextRowData = toKeep[nextRowIndex];\n const nextRowNode = rowContainer.querySelector(`[data-row=\"${nextRowData.index}\"]`);\n\n rowContainer.insertBefore(row, nextRowNode);\n toKeep.splice(nextRowIndex, 0, toKeep);\n } else {\n toKeep.push(rowData);\n rowContainer.appendChild(row);\n }\n });\n\n toRemoveElements.forEach(rows => {\n for (let i = 0; i < rows.length; i++) {\n const row = rows[i];\n rowContainer.removeChild(row);\n }\n });\n};\n\n/**\n * Build a function to render the visible emoji rows for a given scroll\n * position.\n *\n * @param {Element} rowContainer The container element for the emoji rows\n * @return {Function}\n */\nconst generateRenderRowsAtPositionFunction = (rowContainer) => {\n let currentRows = [];\n let nextRows = [];\n let rowCount = 0;\n let isRendering = false;\n const renderNextRows = async () => {\n if (!nextRows.length) {\n return;\n }\n\n if (isRendering) {\n return;\n }\n\n isRendering = true;\n const nextRowsToRender = nextRows.slice();\n nextRows = [];\n\n await renderRows(rowContainer, currentRows, nextRowsToRender);\n currentRows = nextRowsToRender;\n isRendering = false;\n renderNextRows();\n };\n\n return (scrollPosition, rowData, rowLimit = VISIBLE_ROW_COUNT) => {\n nextRows = getRowsToRender(scrollPosition, rowLimit, rowData);\n renderNextRows();\n\n if (rowCount !== rowData.length) {\n // Adjust the height of the container to match the number of rows.\n rowContainer.style.height = `${rowData.length * ROW_HEIGHT_RAW}px`;\n }\n\n rowCount = rowData.length;\n };\n};\n\n/**\n * Show the search results container and hide the emoji container.\n *\n * @param {Element} emojiContainer The emojis container\n * @param {Element} searchResultsContainer The search results container\n */\nconst showSearchResults = (emojiContainer, searchResultsContainer) => {\n searchResultsContainer.classList.remove('hidden');\n emojiContainer.classList.add('hidden');\n};\n\n/**\n * Hide the search result container and show the emojis container.\n *\n * @param {Element} emojiContainer The emojis container\n * @param {Element} searchResultsContainer The search results container\n * @param {Element} searchInput The search input\n */\nconst clearSearch = (emojiContainer, searchResultsContainer, searchInput) => {\n searchResultsContainer.classList.add('hidden');\n emojiContainer.classList.remove('hidden');\n searchInput.value = '';\n};\n\n/**\n * Build function to handle mouse hovering an emoji. Shows the preview.\n *\n * @param {Element} emojiPreview The emoji preview element\n * @param {Element} emojiShortName The emoji short name element\n * @return {Function}\n */\nconst getHandleMouseEnter = (emojiPreview, emojiShortName) => {\n return (e) => {\n const target = e.target;\n if (isEmojiElement(target)) {\n emojiShortName.textContent = target.getAttribute('data-short-names');\n emojiPreview.textContent = target.textContent;\n }\n };\n};\n\n/**\n * Build function to handle mouse leaving an emoji. Removes the preview.\n *\n * @param {Element} emojiPreview The emoji preview element\n * @param {Element} emojiShortName The emoji short name element\n * @return {Function}\n */\nconst getHandleMouseLeave = (emojiPreview, emojiShortName) => {\n return (e) => {\n const target = e.target;\n if (isEmojiElement(target)) {\n emojiShortName.textContent = '';\n emojiPreview.textContent = '';\n }\n };\n};\n\n/**\n * Build the function to handle a user clicking something in the picker.\n *\n * The function currently handles clicking on the category selector or selecting\n * a specific emoji.\n *\n * @param {Number} recentEmojiRowCount Number of rows of recent emojis\n * @param {Element} emojiContainer Container element for the visible of emojis\n * @param {Element} searchResultsContainer Contaienr element for the search results\n * @param {Element} searchInput Search input element\n * @param {Function} selectCallback Callback function to execute when a user selects an emoji\n * @param {Function} renderAtPosition Render function to display current visible emojis\n * @return {Function}\n */\nconst getHandleClick = (\n recentEmojiRowCount,\n emojiContainer,\n searchResultsContainer,\n searchInput,\n selectCallback,\n renderAtPosition\n) => {\n return (e, rowData, categoryScrollPositions) => {\n const target = e.target;\n let newRowData = rowData;\n let newCategoryScrollPositions = categoryScrollPositions;\n\n // Hide the search results if they are visible.\n clearSearch(emojiContainer, searchResultsContainer, searchInput);\n\n if (isEmojiElement(target)) {\n // Emoji selected.\n const unified = target.getAttribute('data-unified');\n const shortnames = target.getAttribute('data-short-names').replace(/:/g, '').split(' ');\n // Build the emoji data from the selected element.\n const emojiData = {unified, shortnames};\n const currentScrollTop = emojiContainer.scrollTop;\n const isRecentEmojiRowVisible = emojiContainer.querySelector(`[data-row=\"${recentEmojiRowCount - 1}\"]`) !== null;\n // Save the selected emoji in the recent emojis list.\n [newRowData, recentEmojiRowCount] = addRecentEmoji(rowData, recentEmojiRowCount, emojiData);\n // Re-index the category scroll positions because the additional recent emoji may have\n // changed their positions.\n newCategoryScrollPositions = getCategoryScrollPositionsFromRowData(newRowData);\n\n if (isRecentEmojiRowVisible) {\n // If the list of recent emojis is currently visible then we need to re-render the emojis\n // to update the display and show the newly selected recent emoji.\n renderAtPosition(currentScrollTop, newRowData);\n }\n\n // Call the client's callback function with the selected emoji.\n selectCallback(target.textContent);\n // Return the newly calculated row data and scroll positions.\n return [newRowData, newCategoryScrollPositions];\n }\n\n const categorySelector = findCategorySelectorFromElement(target);\n if (categorySelector) {\n // Category selector.\n const selectedCategory = categorySelector.getAttribute('data-category');\n const position = categoryScrollPositions[selectedCategory];\n // Scroll the container to the selected category. This will trigger the\n // on scroll handler to re-render the visibile emojis.\n emojiContainer.scrollTop = position;\n }\n\n return [newRowData, newCategoryScrollPositions];\n };\n};\n\n/**\n * Build the function that handles scrolling of the emoji container to display the\n * correct emojis.\n *\n * We render the emoji rows as they are needed rather than all up front so that we\n * can avoid adding tends of thousands of elements to the DOM unnecessarily which\n * would bog down performance.\n *\n * @param {Element} root The picker root element\n * @param {Number} currentVisibleRowScrollPosition The current scroll position of the container\n * @param {Element} emojiContainer The emojis container element\n * @param {Object} initialCategoryScrollPositions Scroll positions for each category\n * @param {Function} renderAtPosition Function to render the appropriate emojis for a scroll position\n * @return {Function}\n */\nconst getHandleScroll = (\n root,\n currentVisibleRowScrollPosition,\n emojiContainer,\n initialCategoryScrollPositions,\n renderAtPosition\n) => {\n // Scope some local variables to track the scroll positions of the categories. We need to\n // recalculate these because adding recent emojis can change those positions by adding\n // additional rows.\n let [\n currentCategoryElement,\n previousCategoryPosition,\n nextCategoryPosition\n ] = getCategoryByScrollPosition(root, emojiContainer.scrollTop, initialCategoryScrollPositions);\n\n return (categoryScrollPositions, rowData) => {\n const newScrollPosition = emojiContainer.scrollTop;\n const upperScrollBound = currentVisibleRowScrollPosition + ROW_HEIGHT_RAW;\n const lowerScrollBound = currentVisibleRowScrollPosition - ROW_HEIGHT_RAW;\n // We only need to update the active category indicator if the user has scrolled into a\n // new category scroll position.\n const updateActiveCategory = (newScrollPosition >= nextCategoryPosition) ||\n (newScrollPosition < previousCategoryPosition);\n // We only need to render new emoji rows if the user has scrolled far enough that a new row\n // would be visible (i.e. they've scrolled up or down more than 40px - the height of a row).\n const updateRenderRows = (newScrollPosition < lowerScrollBound) || (newScrollPosition > upperScrollBound);\n\n if (updateActiveCategory) {\n // New category is visible so update the active category selector and re-index the\n // positions incase anything has changed.\n [\n currentCategoryElement,\n previousCategoryPosition,\n nextCategoryPosition\n ] = getCategoryByScrollPosition(root, newScrollPosition, categoryScrollPositions);\n setCategorySelectorActive(root, currentCategoryElement);\n }\n\n if (updateRenderRows) {\n // A new row should be visible so re-render the visible emojis at this new position.\n // We request an animation frame from the browser so that we're not blocking anything.\n // The animation only needs to occur as soon as the browser is ready not immediately.\n requestAnimationFrame(() => {\n renderAtPosition(newScrollPosition, rowData);\n // Remember the updated position.\n currentVisibleRowScrollPosition = newScrollPosition;\n });\n }\n };\n};\n\n/**\n * Build the function that handles search input from the user.\n *\n * @param {Element} searchInput The search input element\n * @param {Element} searchResultsContainer Container element to display the search results\n * @param {Element} emojiContainer Container element for the emoji rows\n * @return {Function}\n */\nconst getHandleSearch = (searchInput, searchResultsContainer, emojiContainer) => {\n const rowContainer = searchResultsContainer.querySelector(SELECTORS.ROW_CONTAINER);\n // Build a render function for the search results.\n const renderSearchResultsAtPosition = generateRenderRowsAtPositionFunction(rowContainer);\n searchResultsContainer.appendChild(rowContainer);\n\n return async () => {\n const searchTerm = searchInput.value.toLowerCase();\n\n if (searchTerm) {\n // Display the search results container and hide the emojis container.\n showSearchResults(emojiContainer, searchResultsContainer);\n\n // Find which emojis match the user's search input.\n const matchingEmojis = Object.keys(EmojiData.byShortName).reduce((carry, shortName) => {\n if (shortName.includes(searchTerm)) {\n carry.push({\n shortnames: [shortName],\n unified: EmojiData.byShortName[shortName]\n });\n }\n return carry;\n }, []);\n\n const searchResultsString = await get_string('searchresults', 'core');\n const rowData = createRowDataForCategory(searchResultsString, searchResultsString, matchingEmojis, 0);\n // Show the emoji rows for the search results.\n renderSearchResultsAtPosition(0, rowData, rowData.length);\n } else {\n // Hide the search container and show the emojis container.\n clearSearch(emojiContainer, searchResultsContainer, searchInput);\n }\n };\n};\n\n/**\n * Register the emoji picker event listeners.\n *\n * @param {Element} root The picker root element\n * @param {Element} emojiContainer Root element containing the list of visible emojis\n * @param {Function} renderAtPosition Function to render the visible emojis at a given scroll position\n * @param {Number} currentVisibleRowScrollPosition What is the current scroll position\n * @param {Function} selectCallback Function to execute when the user picks an emoji\n * @param {Object} categoryScrollPositions Scroll positions for where each of the emoji categories begin\n * @param {Array} rowData Data representing each of the display rows for hte emoji container\n * @param {Number} recentEmojiRowCount Number of rows of recent emojis\n */\nconst registerEventListeners = (\n root,\n emojiContainer,\n renderAtPosition,\n currentVisibleRowScrollPosition,\n selectCallback,\n categoryScrollPositions,\n rowData,\n recentEmojiRowCount\n) => {\n const searchInput = root.querySelector(SELECTORS.SEARCH_INPUT);\n const searchResultsContainer = root.querySelector(SELECTORS.SEARCH_RESULTS_CONTAINER);\n const emojiPreview = root.querySelector(SELECTORS.EMOJI_PREVIEW);\n const emojiShortName = root.querySelector(SELECTORS.EMOJI_SHORT_NAME);\n // Build the click handler function.\n const clickHandler = getHandleClick(\n recentEmojiRowCount,\n emojiContainer,\n searchResultsContainer,\n searchInput,\n selectCallback,\n renderAtPosition\n );\n // Build the scroll handler function.\n const scrollHandler = getHandleScroll(\n root,\n currentVisibleRowScrollPosition,\n emojiContainer,\n categoryScrollPositions,\n renderAtPosition\n );\n const searchHandler = getHandleSearch(searchInput, searchResultsContainer, emojiContainer);\n\n // Mouse enter/leave events to show the emoji preview on hover or focus.\n root.addEventListener('focus', getHandleMouseEnter(emojiPreview, emojiShortName), true);\n root.addEventListener('blur', getHandleMouseLeave(emojiPreview, emojiShortName), true);\n root.addEventListener('mouseenter', getHandleMouseEnter(emojiPreview, emojiShortName), true);\n root.addEventListener('mouseleave', getHandleMouseLeave(emojiPreview, emojiShortName), true);\n // User selects an emoji or clicks on one of the emoji category selectors.\n root.addEventListener('click', e => {\n // Update the row data and category scroll positions because they may have changes if the\n // user selects an emoji which updates the recent emojis list.\n [rowData, categoryScrollPositions] = clickHandler(e, rowData, categoryScrollPositions);\n });\n // Throttle the scroll event to only execute once every 50 milliseconds to prevent performance issues\n // in the browser when re-rendering the picker emojis. The scroll event fires a lot otherwise.\n emojiContainer.addEventListener('scroll', throttle(() => scrollHandler(categoryScrollPositions, rowData), 50));\n // Debounce the search input so that it only executes 200 milliseconds after the user has finished typing.\n searchInput.addEventListener('input', debounce(searchHandler, 200));\n};\n\n/**\n * Initialise the emoji picker.\n *\n * @param {Element} root The root element for the picker\n * @param {Function} selectCallback Callback for when the user selects an emoji\n */\nexport default (root, selectCallback) => {\n const emojiContainer = root.querySelector(SELECTORS.EMOJIS_CONTAINER);\n const rowContainer = emojiContainer.querySelector(SELECTORS.ROW_CONTAINER);\n const recentEmojis = getRecentEmojis();\n // Add the recent emojis category to the list of standard categories.\n const allData = [{\n name: 'Recent',\n emojis: recentEmojis\n }, ...EmojiData.byCategory];\n let rowData = [];\n let recentEmojiRowCount = 0;\n\n /**\n * Split categories data into rows which represent how they will be displayed in the\n * picker. Each category will add a row containing the display name for the category\n * and a row for every 9 emojis in the category. The row data will be used to calculate\n * which emojis should be visible in the picker at any given time.\n *\n * E.g.\n * input = [\n * {name: 'example1', emojis: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]},\n * {name: 'example2', emojis: [13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]},\n * ]\n * output = [\n * {type: 'categoryName': data: 'Example 1'},\n * {type: 'emojiRow': data: [1, 2, 3, 4, 5, 6, 7, 8, 9]},\n * {type: 'emojiRow': data: [10, 11, 12]},\n * {type: 'categoryName': data: 'Example 2'},\n * {type: 'emojiRow': data: [13, 14, 15, 16, 17, 18, 19, 20, 21]},\n * {type: 'emojiRow': data: [22, 23]},\n * ]\n */\n allData.forEach(category => {\n const categorySelector = getCategorySelectorByCategoryName(root, category.name);\n // Get the display name from the category selector button so that we don't need to\n // send an ajax request for the string.\n const categoryDisplayName = categorySelector.title;\n const categoryRowData = createRowDataForCategory(category.name, categoryDisplayName, category.emojis, rowData.length);\n\n if (category.name === 'Recent') {\n // Remember how many recent emoji rows there are because it needs to be used to\n // re-index the row data later when we're adding more recent emojis.\n recentEmojiRowCount = categoryRowData.length;\n }\n\n rowData = rowData.concat(categoryRowData);\n });\n\n // Index the row data so that we can calculate which rows should be visible.\n rowData = addIndexesToRowData(rowData);\n // Calculate the scroll positions for each of the categories within the emoji container.\n // These are used to know where to jump to when the user selects a specific category.\n const categoryScrollPositions = getCategoryScrollPositionsFromRowData(rowData);\n const renderAtPosition = generateRenderRowsAtPositionFunction(rowContainer);\n // Display the initial set of emojis.\n renderAtPosition(0, rowData);\n\n registerEventListeners(\n root,\n emojiContainer,\n renderAtPosition,\n 0,\n selectCallback,\n categoryScrollPositions,\n rowData,\n recentEmojiRowCount\n );\n};"],"file":"picker.min.js"} \ No newline at end of file diff --git a/lib/amd/build/local/modal/alert.min.js b/lib/amd/build/local/modal/alert.min.js index f0224368a1d..3f72ea933af 100644 --- a/lib/amd/build/local/modal/alert.min.js +++ b/lib/amd/build/local/modal/alert.min.js @@ -1,2 +1,2 @@ -define ("core/local/modal/alert",["exports","core/modal"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);function c(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){c=function(a){return typeof a}}else{c=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return c(a)}function d(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function e(a,b){for(var c=0,d;carguments.length?a:c)}return e.value}}return f.apply(this,arguments)}function g(a,b){while(!Object.prototype.hasOwnProperty.call(a,b)){a=n(a);if(null===a)break}return a}function h(a,b){if("function"!=typeof b&&null!==b){throw new TypeError("Super expression must either be null or a function")}a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}});Object.defineProperty(a,"prototype",{writable:!1});if(b)i(a,b)}function i(a,b){i=Object.setPrototypeOf||function(a,b){a.__proto__=b;return a};return i(a,b)}function j(a){var b=m();return function(){var c=n(a),d;if(b){var e=n(this).constructor;d=Reflect.construct(c,arguments,e)}else{d=c.apply(this,arguments)}return k(this,d)}}function k(a,b){if(b&&("object"===_typeof(b)||"function"==typeof b)){return b}else if(void 0!==b){throw new TypeError("Derived constructors may only return object or undefined")}return l(a)}function l(a){if(void 0===a){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return a}function m(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return!0}catch(a){return!1}}function n(a){n=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)};return n(a)}var o=function(a){h(d,a);var b=j(d);function d(){c(this,d);return b.apply(this,arguments)}e(d,[{key:"registerEventListeners",value:function registerEventListeners(){f(n(d.prototype),"registerEventListeners",this).call(this);this.registerCloseOnCancel()}}]);return d}(b.default);a.default=o;return a.default}); //# sourceMappingURL=alert.min.js.map diff --git a/lib/amd/build/local/modal/alert.min.js.map b/lib/amd/build/local/modal/alert.min.js.map index e85e86bbe94..02335a63bb9 100644 --- a/lib/amd/build/local/modal/alert.min.js.map +++ b/lib/amd/build/local/modal/alert.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../../src/local/modal/alert.js"],"names":["registerCloseOnCancel","Modal"],"mappings":"uJAyBA,uD,+mEAM6B,CAErB,2DAGA,KAAKA,qBAAL,EACH,C,cAVwBC,S","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Alert modal.\n *\n * @module core/modal_alert\n * @class modal_alert\n * @package core\n * @copyright 2020 Andrew Nicols \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport Modal from 'core/modal';\n\nexport default class extends Modal {\n /**\n * Register all event listeners.\n */\n registerEventListeners() {\n // Call the parent registration.\n super.registerEventListeners();\n\n // Register to close on cancel.\n this.registerCloseOnCancel();\n }\n}\n"],"file":"alert.min.js"} \ No newline at end of file +{"version":3,"sources":["../../../src/local/modal/alert.js"],"names":["registerCloseOnCancel","Modal"],"mappings":"yaAyBA,uD,4jEAMI,iCAAyB,CAErB,2DAGA,KAAKA,qBAAL,EACH,C,cAVwBC,S","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Alert modal.\n *\n * @module core/modal_alert\n * @class modal_alert\n * @package core\n * @copyright 2020 Andrew Nicols \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport Modal from 'core/modal';\n\nexport default class extends Modal {\n /**\n * Register all event listeners.\n */\n registerEventListeners() {\n // Call the parent registration.\n super.registerEventListeners();\n\n // Register to close on cancel.\n this.registerCloseOnCancel();\n }\n}\n"],"file":"alert.min.js"} \ No newline at end of file diff --git a/lib/amd/build/loglevel.min.js b/lib/amd/build/loglevel.min.js index 6f1faf89e5a..c5b03139142 100644 --- a/lib/amd/build/loglevel.min.js +++ b/lib/amd/build/loglevel.min.js @@ -1,2 +1,2 @@ -function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}(function(a,b){"use strict";if("function"==typeof define&&define.amd){define ("core/loglevel",b)}else if("object"===("undefined"==typeof module?"undefined":_typeof(module))&&module.exports){module.exports=b()}else{a.log=b()}})(this,function(){"use strict";var h=function(){},i="undefined",j=("undefined"==typeof window?"undefined":_typeof(window))!==i&&/Trident\/|MSIE /.test(window.navigator.userAgent),k=["trace","debug","info","warn","error"];function a(a,b){var c=a[b];if("function"==typeof c.bind){return c.bind(a)}else{try{return Function.prototype.bind.call(c,a)}catch(b){return function(){return Function.prototype.apply.apply(c,[a,arguments])}}}}function b(){if(console.log){if(console.log.apply){console.log.apply(console,arguments)}else{Function.prototype.apply.apply(console.log,[console,arguments])}}if(console.trace)console.trace()}function c(c){if("debug"===c){c="log"}if(("undefined"==typeof console?"undefined":_typeof(console))===i){return!1}else if("trace"===c&&j){return b}else if(console[c]!==void 0){return a(console,c)}else if(console.log!==void 0){return a(console,"log")}else{return h}}function d(a,b){for(var c=0,d;c= 0 && level <= self.levels.SILENT) {\n currentLevel = level;\n if (persist !== false) { // defaults to true\n persistLevelIfPossible(level);\n }\n replaceLoggingMethods.call(self, level, name);\n if (typeof console === undefinedType && level < self.levels.SILENT) {\n return \"No console available for logging\";\n }\n } else {\n throw \"log.setLevel() called with invalid level: \" + level;\n }\n };\n\n self.setDefaultLevel = function (level) {\n if (!getPersistedLevel()) {\n self.setLevel(level, false);\n }\n };\n\n self.enableAll = function(persist) {\n self.setLevel(self.levels.TRACE, persist);\n };\n\n self.disableAll = function(persist) {\n self.setLevel(self.levels.SILENT, persist);\n };\n\n // Initialize with the right level\n var initialLevel = getPersistedLevel();\n if (initialLevel == null) {\n initialLevel = defaultLevel == null ? \"WARN\" : defaultLevel;\n }\n self.setLevel(initialLevel, false);\n }\n\n /*\n *\n * Top-level API\n *\n */\n\n var defaultLogger = new Logger();\n\n var _loggersByName = {};\n defaultLogger.getLogger = function getLogger(name) {\n if (typeof name !== \"string\" || name === \"\") {\n throw new TypeError(\"You must supply a name when creating a logger.\");\n }\n\n var logger = _loggersByName[name];\n if (!logger) {\n logger = _loggersByName[name] = new Logger(\n name, defaultLogger.getLevel(), defaultLogger.methodFactory);\n }\n return logger;\n };\n\n // Grab the current global log variable in case of overwrite\n var _log = (typeof window !== undefinedType) ? window.log : undefined;\n defaultLogger.noConflict = function() {\n if (typeof window !== undefinedType &&\n window.log === defaultLogger) {\n window.log = _log;\n }\n\n return defaultLogger;\n };\n\n defaultLogger.getLoggers = function getLoggers() {\n return _loggersByName;\n };\n\n return defaultLogger;\n}));\n"],"file":"loglevel.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/loglevel.js"],"names":["root","definition","define","amd","module","exports","log","noop","undefinedType","isIE","window","test","navigator","userAgent","logMethods","bindMethod","obj","methodName","method","bind","Function","prototype","call","e","apply","arguments","traceForIE","console","trace","realMethod","replaceLoggingMethods","level","loggerName","i","length","methodFactory","debug","enableLoggingWhenConsoleArrives","defaultMethodFactory","Logger","name","defaultLevel","factory","self","currentLevel","storageKey","persistLevelIfPossible","levelNum","levelName","toUpperCase","localStorage","ignore","document","cookie","encodeURIComponent","getPersistedLevel","storedLevel","location","indexOf","exec","slice","levels","getLevel","setLevel","persist","SILENT","setDefaultLevel","enableAll","TRACE","disableAll","initialLevel","defaultLogger","_loggersByName","getLogger","TypeError","logger","_log","noConflict","getLoggers"],"mappings":"kRA6BC,UAAUA,CAAV,CAAgBC,CAAhB,CAA4B,CACzB,aACA,GAAsB,UAAlB,QAAOC,CAAAA,MAAP,EAAgCA,MAAM,CAACC,GAA3C,CAAgD,CAC5CD,OAAM,iBAACD,CAAD,CACT,CAFD,IAEO,IAAsB,QAAlB,uBAAOG,CAAAA,MAAP,qBAAOA,MAAP,IAA8BA,MAAM,CAACC,OAAzC,CAAkD,CACrDD,MAAM,CAACC,OAAP,CAAiBJ,CAAU,EAC9B,CAFM,IAEA,CACHD,CAAI,CAACM,GAAL,CAAWL,CAAU,EACxB,CACJ,CATA,EASC,IATD,CASO,UAAY,CAChB,aADgB,GAIZM,CAAAA,CAAI,CAAG,UAAW,CAAE,CAJR,CAKZC,CAAa,CAAG,WALJ,CAMZC,CAAI,CAAI,oBAAOC,CAAAA,MAAP,qBAAO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GAAI,CAACmC,CAAL,CAAa,CACXA,CAAM,CAAGH,CAAc,CAAChC,CAAD,CAAd,CAAuB,GAAID,CAAAA,CAAJ,CAC9BC,CAD8B,CACxB+B,CAAa,CAACT,QAAd,EADwB,CACES,CAAa,CAACpC,aADhB,CAEjC,CACD,MAAOwC,CAAAA,CACV,CAXD,CAcA,GAAIC,CAAAA,CAAI,CAAI,oBAAOlE,CAAAA,MAAP,qBAAOA,MAAP,KAAkBF,CAAnB,CAAoCE,MAAM,CAACJ,GAA3C,OAAX,CACAiE,CAAa,CAACM,UAAd,CAA2B,UAAW,CAClC,GAAI,oBAAOnE,CAAAA,MAAP,qBAAOA,MAAP,KAAkBF,CAAlB,EACGE,MAAM,CAACJ,GAAP,GAAeiE,CADtB,CACqC,CACjC7D,MAAM,CAACJ,GAAP,CAAasE,CAChB,CAED,MAAOL,CAAAA,CACV,CAPD,CASAA,CAAa,CAACO,UAAd,CAA2B,UAAsB,CAC7C,MAAON,CAAAA,CACV,CAFD,CAIA,MAAOD,CAAAA,CACV,CArQA,CAAD","sourcesContent":["// Copyright (c) 2013 Tim Perry\n//\n// Permission is hereby granted, free of charge, to any person\n// obtaining a copy of this software and associated documentation\n// files (the \"Software\"), to deal in the Software without\n// restriction, including without limitation the rights to use,\n// copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n// OTHER DEALINGS IN THE SOFTWARE.\n\n// Description of import into Moodle:\n// Download from https://github.com/pimterry/loglevel/tree/master/dist\n// Copy loglevel.js into lib/amd/src/ in Moodle folder.\n// Add the license as a comment to the file and these instructions.\n\n/*! loglevel - v1.6.6 - https://github.com/pimterry/loglevel - (c) 2019 Tim Perry - licensed MIT */\n(function (root, definition) {\n \"use strict\";\n if (typeof define === 'function' && define.amd) {\n define(definition);\n } else if (typeof module === 'object' && module.exports) {\n module.exports = definition();\n } else {\n root.log = definition();\n }\n}(this, function () {\n \"use strict\";\n\n // Slightly dubious tricks to cut down minimized file size\n var noop = function() {};\n var undefinedType = \"undefined\";\n var isIE = (typeof window !== undefinedType) && (\n /Trident\\/|MSIE /.test(window.navigator.userAgent)\n );\n\n var logMethods = [\n \"trace\",\n \"debug\",\n \"info\",\n \"warn\",\n \"error\"\n ];\n\n // Cross-browser bind equivalent that works at least back to IE6\n function bindMethod(obj, methodName) {\n var method = obj[methodName];\n if (typeof method.bind === 'function') {\n return method.bind(obj);\n } else {\n try {\n return Function.prototype.bind.call(method, obj);\n } catch (e) {\n // Missing bind shim or IE8 + Modernizr, fallback to wrapping\n return function() {\n return Function.prototype.apply.apply(method, [obj, arguments]);\n };\n }\n }\n }\n\n // Trace() doesn't print the message in IE, so for that case we need to wrap it\n function traceForIE() {\n if (console.log) {\n if (console.log.apply) {\n console.log.apply(console, arguments);\n } else {\n // In old IE, native console methods themselves don't have apply().\n Function.prototype.apply.apply(console.log, [console, arguments]);\n }\n }\n if (console.trace) console.trace();\n }\n\n // Build the best logging method possible for this env\n // Wherever possible we want to bind, not wrap, to preserve stack traces\n function realMethod(methodName) {\n if (methodName === 'debug') {\n methodName = 'log';\n }\n\n if (typeof console === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (methodName === 'trace' && isIE) {\n return traceForIE;\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, 'log');\n } else {\n return noop;\n }\n }\n\n // These private functions always need `this` to be set properly\n\n function replaceLoggingMethods(level, loggerName) {\n /*jshint validthis:true */\n for (var i = 0; i < logMethods.length; i++) {\n var methodName = logMethods[i];\n this[methodName] = (i < level) ?\n noop :\n this.methodFactory(methodName, level, loggerName);\n }\n\n // Define log.log as an alias for log.debug\n this.log = this.debug;\n }\n\n // In old IE versions, the console isn't present until you first open it.\n // We build realMethod() replacements here that regenerate logging methods\n function enableLoggingWhenConsoleArrives(methodName, level, loggerName) {\n return function () {\n if (typeof console !== undefinedType) {\n replaceLoggingMethods.call(this, level, loggerName);\n this[methodName].apply(this, arguments);\n }\n };\n }\n\n // By default, we use closely bound real methods wherever possible, and\n // otherwise we wait for a console to appear, and then try again.\n function defaultMethodFactory(methodName, level, loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) ||\n enableLoggingWhenConsoleArrives.apply(this, arguments);\n }\n\n function Logger(name, defaultLevel, factory) {\n var self = this;\n var currentLevel;\n var storageKey = \"loglevel\";\n if (name) {\n storageKey += \":\" + name;\n }\n\n function persistLevelIfPossible(levelNum) {\n var levelName = (logMethods[levelNum] || 'silent').toUpperCase();\n\n if (typeof window === undefinedType) return;\n\n // Use localStorage if available\n try {\n window.localStorage[storageKey] = levelName;\n return;\n } catch (ignore) {}\n\n // Use session cookie as fallback\n try {\n window.document.cookie =\n encodeURIComponent(storageKey) + \"=\" + levelName + \";\";\n } catch (ignore) {}\n }\n\n function getPersistedLevel() {\n var storedLevel;\n\n if (typeof window === undefinedType) return;\n\n try {\n storedLevel = window.localStorage[storageKey];\n } catch (ignore) {}\n\n // Fallback to cookies if local storage gives us nothing\n if (typeof storedLevel === undefinedType) {\n try {\n var cookie = window.document.cookie;\n var location = cookie.indexOf(\n encodeURIComponent(storageKey) + \"=\");\n if (location !== -1) {\n storedLevel = /^([^;]+)/.exec(cookie.slice(location))[1];\n }\n } catch (ignore) {}\n }\n\n // If the stored level is not valid, treat it as if nothing was stored.\n if (self.levels[storedLevel] === undefined) {\n storedLevel = undefined;\n }\n\n return storedLevel;\n }\n\n /*\n *\n * Public logger API - see https://github.com/pimterry/loglevel for details\n *\n */\n\n self.name = name;\n\n self.levels = { \"TRACE\": 0, \"DEBUG\": 1, \"INFO\": 2, \"WARN\": 3,\n \"ERROR\": 4, \"SILENT\": 5};\n\n self.methodFactory = factory || defaultMethodFactory;\n\n self.getLevel = function () {\n return currentLevel;\n };\n\n self.setLevel = function (level, persist) {\n if (typeof level === \"string\" && self.levels[level.toUpperCase()] !== undefined) {\n level = self.levels[level.toUpperCase()];\n }\n if (typeof level === \"number\" && level >= 0 && level <= self.levels.SILENT) {\n currentLevel = level;\n if (persist !== false) { // defaults to true\n persistLevelIfPossible(level);\n }\n replaceLoggingMethods.call(self, level, name);\n if (typeof console === undefinedType && level < self.levels.SILENT) {\n return \"No console available for logging\";\n }\n } else {\n throw \"log.setLevel() called with invalid level: \" + level;\n }\n };\n\n self.setDefaultLevel = function (level) {\n if (!getPersistedLevel()) {\n self.setLevel(level, false);\n }\n };\n\n self.enableAll = function(persist) {\n self.setLevel(self.levels.TRACE, persist);\n };\n\n self.disableAll = function(persist) {\n self.setLevel(self.levels.SILENT, persist);\n };\n\n // Initialize with the right level\n var initialLevel = getPersistedLevel();\n if (initialLevel == null) {\n initialLevel = defaultLevel == null ? \"WARN\" : defaultLevel;\n }\n self.setLevel(initialLevel, false);\n }\n\n /*\n *\n * Top-level API\n *\n */\n\n var defaultLogger = new Logger();\n\n var _loggersByName = {};\n defaultLogger.getLogger = function getLogger(name) {\n if (typeof name !== \"string\" || name === \"\") {\n throw new TypeError(\"You must supply a name when creating a logger.\");\n }\n\n var logger = _loggersByName[name];\n if (!logger) {\n logger = _loggersByName[name] = new Logger(\n name, defaultLogger.getLevel(), defaultLogger.methodFactory);\n }\n return logger;\n };\n\n // Grab the current global log variable in case of overwrite\n var _log = (typeof window !== undefinedType) ? window.log : undefined;\n defaultLogger.noConflict = function() {\n if (typeof window !== undefinedType &&\n window.log === defaultLogger) {\n window.log = _log;\n }\n\n return defaultLogger;\n };\n\n defaultLogger.getLoggers = function getLoggers() {\n return _loggersByName;\n };\n\n return defaultLogger;\n}));\n"],"file":"loglevel.min.js"} \ No newline at end of file diff --git a/lib/amd/build/modal.min.js b/lib/amd/build/modal.min.js index 887f57cf289..1716e719cee 100644 --- a/lib/amd/build/modal.min.js +++ b/lib/amd/build/modal.min.js @@ -1,2 +1,2 @@ -function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("core/modal",["jquery","core/templates","core/notification","core/key_codes","core/custom_interaction_events","core/modal_backdrop","core/event","core/modal_events","core/local/aria/focuslock","core/pending","core/fullscreen"],function(a,b,c,d,e,f,g,h,i,j,k){var l={CONTAINER:"[data-region=\"modal-container\"]",MODAL:"[data-region=\"modal\"]",HEADER:"[data-region=\"header\"]",TITLE:"[data-region=\"title\"]",BODY:"[data-region=\"body\"]",FOOTER:"[data-region=\"footer\"]",HIDE:"[data-action=\"hide\"]",DIALOG:"[role=dialog]",FORM:"form",MENU_BAR:"[role=menubar]",HAS_Z_INDEX:".moodle-has-zindex",CAN_RECEIVE_FOCUS:"input:not([type=\"hidden\"]), a[href], button, textarea, select, [tabindex]"},m={LOADING:"core/loading",BACKDROP:"core/modal_backdrop"},n,o=0,p=function(b){this.root=a(b);this.modal=this.root.find(l.MODAL);this.header=this.modal.find(l.HEADER);this.headerPromise=a.Deferred();this.title=this.header.find(l.TITLE);this.titlePromise=a.Deferred();this.body=this.modal.find(l.BODY);this.bodyPromise=a.Deferred();this.footer=this.modal.find(l.FOOTER);this.footerPromise=a.Deferred();this.hiddenSiblings=[];this.isAttached=!1;this.bodyJS=null;this.footerJS=null;this.modalCount=o++;this.attachmentPoint=document.createElement("div");document.body.append(this.attachmentPoint);if(!this.root.is(l.CONTAINER)){c.exception({message:"Element is not a modal container"})}if(!this.modal.length){c.exception({message:"Container does not contain a modal"})}if(!this.header.length){c.exception({message:"Modal is missing a header region"})}if(!this.title.length){c.exception({message:"Modal header is missing a title region"})}if(!this.body.length){c.exception({message:"Modal is missing a body region"})}if(!this.footer.length){c.exception({message:"Modal is missing a footer region"})}this.registerEventListeners()};p.prototype.attachToDOM=function(){this.getAttachmentPoint().append(this.root);if(this.isAttached){return}i.trapFocus(this.root[0]);if(this.bodyJS){b.runTemplateJS(this.bodyJS);this.bodyJS=null}if(this.footerJS){b.runTemplateJS(this.footerJS);this.footerJS=null}this.isAttached=!0};p.prototype.countOtherVisibleModals=function(){var b=0;a("body").find(l.CONTAINER).each(function(c,d){d=a(d);if(!this.root.is(d)&&d.hasClass("show")){b++}}.bind(this));return b};p.prototype.getBackdrop=function(){if(!n){n=b.render(m.BACKDROP,{}).then(function(b){var c=a(b);return new f(c)}).fail(c.exception)}return n};p.prototype.getRoot=function(){return this.root};p.prototype.getModal=function(){return this.modal};p.prototype.getTitle=function(){return this.title};p.prototype.getBody=function(){return this.body};p.prototype.getFooter=function(){return this.footer};p.prototype.getTitlePromise=function(){return this.titlePromise};p.prototype.getBodyPromise=function(){return this.bodyPromise};p.prototype.getFooterPromise=function(){return this.footerPromise};p.prototype.getModalCount=function(){return this.modalCount};p.prototype.setTitle=function(b){var d=this.getTitle();this.titlePromise=a.Deferred();this.asyncSet(b,d.html.bind(d)).then(function(){this.titlePromise.resolve(d)}.bind(this)).catch(c.exception)};p.prototype.setBody=function(d){this.bodyPromise=a.Deferred();var e=this.getBody();if("string"==typeof d){e.html(d);g.notifyFilterContentUpdated(e);this.getRoot().trigger(h.bodyRendered,this);this.bodyPromise.resolve(e)}else{var f="amd-modal-js-pending-id-"+this.getModalCount();M.util.js_pending(f);var i=null;e.css("overflow","hidden");d=a.when(d);if("pending"==d.state()){var j=e.innerHeight();if(100>j){j=100}e.animate({height:j+"px"},150);e.html("");i=b.render(m.LOADING,{}).then(function(b){var c=a(b).hide();e.html(c);c.fadeIn(150);return a.when(c.promise(),d)}).then(function(a){return a.fadeOut(100).promise()}).then(function(){return d})}else{i=d}i.then(function(a,c){var d=null;if(this.isVisible()){e.css("opacity",0);var f=e.innerHeight();e.html(a);e.css("height","");var g=e.innerHeight();e.css("height",f+"px");d=e.animate({height:g+"px",opacity:1},{duration:150,queue:!1}).promise()}else{e.html(a)}if(c){if(this.isAttached){b.runTemplateJS(c)}else{this.bodyJS=c}}return d}.bind(this)).then(function(a){g.notifyFilterContentUpdated(e);this.getRoot().trigger(h.bodyRendered,this);return a}.bind(this)).then(function(){this.bodyPromise.resolve(e)}.bind(this)).fail(c.exception).always(function(){e.css("height","");e.css("overflow","");e.css("opacity","");M.util.js_complete(f)}).fail(c.exception)}};p.prototype.setFooter=function(d){this.showFooter();this.footerPromise=a.Deferred();var e=this.getFooter();if("string"==typeof d){e.html(d);this.footerPromise.resolve(e)}else{b.render(m.LOADING,{}).then(function(a){e.html(a);return d}).then(function(a,c){e.html(a);if(c){if(this.isAttached){b.runTemplateJS(c)}else{this.footerJS=c}}return e}.bind(this)).then(function(a){this.footerPromise.resolve(a)}.bind(this)).catch(c.exception)}};p.prototype.hasFooterContent=function(){return this.getFooter().children().length?!0:!1};p.prototype.hideFooter=function(){this.getFooter().addClass("hidden")};p.prototype.showFooter=function(){this.getFooter().removeClass("hidden")};p.prototype.setLarge=function(){if(this.isLarge()){return}this.getModal().addClass("modal-lg")};p.prototype.isLarge=function(){return this.getModal().hasClass("modal-lg")};p.prototype.setSmall=function(){if(this.isSmall()){return}this.getModal().removeClass("modal-lg")};p.prototype.isSmall=function(){return!this.getModal().hasClass("modal-lg")};p.prototype.calculateZIndex=function(){var b=a(l.DIALOG+", "+l.MENU_BAR+", "+l.HAS_Z_INDEX),c=parseInt(this.root.css("z-index"));b.each(function(b,d){d=a(d);var e=d.css("z-index")?parseInt(d.css("z-index")):0;if(e>c){c=e}});return c};p.prototype.isVisible=function(){return this.root.hasClass("show")};p.prototype.hasFocus=function(){var b=a(document.activeElement);return this.root.is(b)||this.root.has(b).length};p.prototype.hasTransitions=function(){return this.getRoot().hasClass("fade")};p.prototype.getAttachmentPoint=function(){return a(k.getElement()||this.attachmentPoint)};p.prototype.show=function(){if(this.isVisible()){return a.Deferred().resolve()}var b=new j("core/modal:show");if(this.hasFooterContent()){this.showFooter()}else{this.hideFooter()}this.attachToDOM();return this.getBackdrop().then(function(b){var c=this.calculateZIndex(),d=c+2;this.root.css("z-index",d);b.setZIndex(d-1);b.show();this.root.removeClass("hide").addClass("show");this.accessibilityShow();this.getModal().focus();a("body").addClass("modal-open");this.root.trigger(h.shown,this)}.bind(this)).then(b.resolve)};p.prototype.hideIfNotForm=function(){var a=this.modal.find(l.FORM);if(0==a.length){this.hide()}};p.prototype.hide=function(){this.getBackdrop().done(function(b){i.untrapFocus();if(!this.countOtherVisibleModals()){b.hide();a("body").removeClass("modal-open")}var c=parseInt(this.root.css("z-index"));this.root.css("z-index","");b.setZIndex(c-3);this.accessibilityHide();if(this.hasTransitions()){this.getRoot().one("transitionend webkitTransitionEnd oTransitionEnd",function(){this.getRoot().removeClass("show").addClass("hide")}.bind(this))}else{this.getRoot().removeClass("show").addClass("hide")}if(a(document.body).find(this.getRoot()).length){a(document.body).append(this.getRoot())}this.root.trigger(h.hidden,this)}.bind(this))};p.prototype.destroy=function(){this.hide();this.root.remove();this.root.trigger(h.destroyed,this);this.attachmentPoint.remove()};p.prototype.accessibilityShow=function(){a("body").children().each(function(b,c){if(!this.root.is(c)){c=a(c);var d=c.attr("aria-hidden");if("true"!==d){c.data("previous-aria-hidden",d);this.hiddenSiblings.push(c);c.attr("aria-hidden","true")}}}.bind(this));this.root.attr("aria-hidden","false")};p.prototype.accessibilityHide=function(){this.root.attr("aria-hidden","true");a.each(this.hiddenSiblings,function(b,c){c=a(c);var d=c.data("previous-aria-hidden");if("undefined"==typeof d){c.removeAttr("aria-hidden")}else{c.attr("aria-hidden",d)}});this.hiddenSiblings=[]};p.prototype.registerEventListeners=function(){this.getRoot().on("keydown",function(a){if(!this.isVisible()){return}if(a.keyCode==d.escape){if(this.removeOnClose){this.destroy()}else{this.hide()}}}.bind(this));this.getRoot().click(function(b){if(!a(b.target).closest(l.MODAL).length){if(a(b.target).closest(l.CONTAINER).length){this.hideIfNotForm()}}}.bind(this));e.define(this.getModal(),[e.events.activate]);this.getModal().on(e.events.activate,l.HIDE,function(a,b){this.hide();b.originalEvent.preventDefault()}.bind(this))};p.prototype.registerCloseOnCancel=function(){this.getModal().on(e.events.activate,this.getActionSelector("cancel"),function(b,c){var d=a.Event(h.cancel);this.getRoot().trigger(d,this);if(!d.isDefaultPrevented()){c.originalEvent.preventDefault();if(this.removeOnClose){this.destroy()}else{this.hide()}}}.bind(this))};p.prototype.registerCloseOnSave=function(){this.getModal().on(e.events.activate,this.getActionSelector("save"),function(b,c){var d=a.Event(h.save);this.getRoot().trigger(d,this);if(!d.isDefaultPrevented()){c.originalEvent.preventDefault();if(this.removeOnClose){this.destroy()}else{this.hide()}}}.bind(this))};p.prototype.asyncSet=function(b,d){var e=b;if("object"!==_typeof(b)||!b.hasOwnProperty("then")){e=a.Deferred();e.resolve(b)}e.then(function(a){d(a)}).fail(c.exception);return e};p.prototype.setButtonText=function(a,b){var c=this.getFooter().find(this.getActionSelector(a));if(!c){throw new Error("Unable to find the '"+a+"' button")}return this.asyncSet(b,c.text.bind(c))};p.prototype.getActionSelector=function(a){return"[data-action='"+a+"']"};p.prototype.setRemoveOnClose=function(a){this.removeOnClose=a};return p}); +function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}define ("core/modal",["jquery","core/templates","core/notification","core/key_codes","core/custom_interaction_events","core/modal_backdrop","core/event","core/modal_events","core/local/aria/focuslock","core/pending","core/fullscreen"],function(a,b,c,d,e,f,g,h,i,j,k){var l={CONTAINER:"[data-region=\"modal-container\"]",MODAL:"[data-region=\"modal\"]",HEADER:"[data-region=\"header\"]",TITLE:"[data-region=\"title\"]",BODY:"[data-region=\"body\"]",FOOTER:"[data-region=\"footer\"]",HIDE:"[data-action=\"hide\"]",DIALOG:"[role=dialog]",FORM:"form",MENU_BAR:"[role=menubar]",HAS_Z_INDEX:".moodle-has-zindex",CAN_RECEIVE_FOCUS:"input:not([type=\"hidden\"]), a[href], button, textarea, select, [tabindex]"},m={LOADING:"core/loading",BACKDROP:"core/modal_backdrop"},n,o=0,p=function(b){this.root=a(b);this.modal=this.root.find(l.MODAL);this.header=this.modal.find(l.HEADER);this.headerPromise=a.Deferred();this.title=this.header.find(l.TITLE);this.titlePromise=a.Deferred();this.body=this.modal.find(l.BODY);this.bodyPromise=a.Deferred();this.footer=this.modal.find(l.FOOTER);this.footerPromise=a.Deferred();this.hiddenSiblings=[];this.isAttached=!1;this.bodyJS=null;this.footerJS=null;this.modalCount=o++;this.attachmentPoint=document.createElement("div");document.body.append(this.attachmentPoint);if(!this.root.is(l.CONTAINER)){c.exception({message:"Element is not a modal container"})}if(!this.modal.length){c.exception({message:"Container does not contain a modal"})}if(!this.header.length){c.exception({message:"Modal is missing a header region"})}if(!this.title.length){c.exception({message:"Modal header is missing a title region"})}if(!this.body.length){c.exception({message:"Modal is missing a body region"})}if(!this.footer.length){c.exception({message:"Modal is missing a footer region"})}this.registerEventListeners()};p.prototype.attachToDOM=function(){this.getAttachmentPoint().append(this.root);if(this.isAttached){return}i.trapFocus(this.root[0]);if(this.bodyJS){b.runTemplateJS(this.bodyJS);this.bodyJS=null}if(this.footerJS){b.runTemplateJS(this.footerJS);this.footerJS=null}this.isAttached=!0};p.prototype.countOtherVisibleModals=function(){var b=0;a("body").find(l.CONTAINER).each(function(c,d){d=a(d);if(!this.root.is(d)&&d.hasClass("show")){b++}}.bind(this));return b};p.prototype.getBackdrop=function(){if(!n){n=b.render(m.BACKDROP,{}).then(function(b){var c=a(b);return new f(c)}).fail(c.exception)}return n};p.prototype.getRoot=function(){return this.root};p.prototype.getModal=function(){return this.modal};p.prototype.getTitle=function(){return this.title};p.prototype.getBody=function(){return this.body};p.prototype.getFooter=function(){return this.footer};p.prototype.getTitlePromise=function(){return this.titlePromise};p.prototype.getBodyPromise=function(){return this.bodyPromise};p.prototype.getFooterPromise=function(){return this.footerPromise};p.prototype.getModalCount=function(){return this.modalCount};p.prototype.setTitle=function(b){var d=this.getTitle();this.titlePromise=a.Deferred();this.asyncSet(b,d.html.bind(d)).then(function(){this.titlePromise.resolve(d)}.bind(this)).catch(c.exception)};p.prototype.setBody=function(d){this.bodyPromise=a.Deferred();var e=this.getBody();if("string"==typeof d){e.html(d);g.notifyFilterContentUpdated(e);this.getRoot().trigger(h.bodyRendered,this);this.bodyPromise.resolve(e)}else{var f="amd-modal-js-pending-id-"+this.getModalCount();M.util.js_pending(f);var i=null;e.css("overflow","hidden");d=a.when(d);if("pending"==d.state()){var j=e.innerHeight();if(100>j){j=100}e.animate({height:j+"px"},150);e.html("");i=b.render(m.LOADING,{}).then(function(b){var c=a(b).hide();e.html(c);c.fadeIn(150);return a.when(c.promise(),d)}).then(function(a){return a.fadeOut(100).promise()}).then(function(){return d})}else{i=d}i.then(function(a,c){var d=null;if(this.isVisible()){e.css("opacity",0);var f=e.innerHeight();e.html(a);e.css("height","");var g=e.innerHeight();e.css("height",f+"px");d=e.animate({height:g+"px",opacity:1},{duration:150,queue:!1}).promise()}else{e.html(a)}if(c){if(this.isAttached){b.runTemplateJS(c)}else{this.bodyJS=c}}return d}.bind(this)).then(function(a){g.notifyFilterContentUpdated(e);this.getRoot().trigger(h.bodyRendered,this);return a}.bind(this)).then(function(){this.bodyPromise.resolve(e)}.bind(this)).fail(c.exception).always(function(){e.css("height","");e.css("overflow","");e.css("opacity","");M.util.js_complete(f)}).fail(c.exception)}};p.prototype.setFooter=function(d){this.showFooter();this.footerPromise=a.Deferred();var e=this.getFooter();if("string"==typeof d){e.html(d);this.footerPromise.resolve(e)}else{b.render(m.LOADING,{}).then(function(a){e.html(a);return d}).then(function(a,c){e.html(a);if(c){if(this.isAttached){b.runTemplateJS(c)}else{this.footerJS=c}}return e}.bind(this)).then(function(a){this.footerPromise.resolve(a)}.bind(this)).catch(c.exception)}};p.prototype.hasFooterContent=function(){return this.getFooter().children().length?!0:!1};p.prototype.hideFooter=function(){this.getFooter().addClass("hidden")};p.prototype.showFooter=function(){this.getFooter().removeClass("hidden")};p.prototype.setLarge=function(){if(this.isLarge()){return}this.getModal().addClass("modal-lg")};p.prototype.isLarge=function(){return this.getModal().hasClass("modal-lg")};p.prototype.setSmall=function(){if(this.isSmall()){return}this.getModal().removeClass("modal-lg")};p.prototype.isSmall=function(){return!this.getModal().hasClass("modal-lg")};p.prototype.calculateZIndex=function(){var b=a(l.DIALOG+", "+l.MENU_BAR+", "+l.HAS_Z_INDEX),c=parseInt(this.root.css("z-index"));b.each(function(b,d){d=a(d);var e=d.css("z-index")?parseInt(d.css("z-index")):0;if(e>c){c=e}});return c};p.prototype.isVisible=function(){return this.root.hasClass("show")};p.prototype.hasFocus=function(){var b=a(document.activeElement);return this.root.is(b)||this.root.has(b).length};p.prototype.hasTransitions=function(){return this.getRoot().hasClass("fade")};p.prototype.getAttachmentPoint=function(){return a(k.getElement()||this.attachmentPoint)};p.prototype.show=function(){if(this.isVisible()){return a.Deferred().resolve()}var b=new j("core/modal:show");if(this.hasFooterContent()){this.showFooter()}else{this.hideFooter()}this.attachToDOM();return this.getBackdrop().then(function(b){var c=this.calculateZIndex(),d=c+2;this.root.css("z-index",d);b.setZIndex(d-1);b.show();this.root.removeClass("hide").addClass("show");this.accessibilityShow();this.getModal().focus();a("body").addClass("modal-open");this.root.trigger(h.shown,this)}.bind(this)).then(b.resolve)};p.prototype.hideIfNotForm=function(){var a=this.modal.find(l.FORM);if(0==a.length){this.hide()}};p.prototype.hide=function(){this.getBackdrop().done(function(b){i.untrapFocus();if(!this.countOtherVisibleModals()){b.hide();a("body").removeClass("modal-open")}var c=parseInt(this.root.css("z-index"));this.root.css("z-index","");b.setZIndex(c-3);this.accessibilityHide();if(this.hasTransitions()){this.getRoot().one("transitionend webkitTransitionEnd oTransitionEnd",function(){this.getRoot().removeClass("show").addClass("hide")}.bind(this))}else{this.getRoot().removeClass("show").addClass("hide")}if(a(document.body).find(this.getRoot()).length){a(document.body).append(this.getRoot())}this.root.trigger(h.hidden,this)}.bind(this))};p.prototype.destroy=function(){this.hide();this.root.remove();this.root.trigger(h.destroyed,this);this.attachmentPoint.remove()};p.prototype.accessibilityShow=function(){a("body").children().each(function(b,c){if(!this.root.is(c)){c=a(c);var d=c.attr("aria-hidden");if("true"!==d){c.data("previous-aria-hidden",d);this.hiddenSiblings.push(c);c.attr("aria-hidden","true")}}}.bind(this));this.root.attr("aria-hidden","false")};p.prototype.accessibilityHide=function(){this.root.attr("aria-hidden","true");a.each(this.hiddenSiblings,function(b,c){c=a(c);var d=c.data("previous-aria-hidden");if("undefined"==typeof d){c.removeAttr("aria-hidden")}else{c.attr("aria-hidden",d)}});this.hiddenSiblings=[]};p.prototype.registerEventListeners=function(){this.getRoot().on("keydown",function(a){if(!this.isVisible()){return}if(a.keyCode==d.escape){if(this.removeOnClose){this.destroy()}else{this.hide()}}}.bind(this));this.getRoot().click(function(b){if(!a(b.target).closest(l.MODAL).length){if(a(b.target).closest(l.CONTAINER).length){this.hideIfNotForm()}}}.bind(this));e.define(this.getModal(),[e.events.activate]);this.getModal().on(e.events.activate,l.HIDE,function(a,b){this.hide();b.originalEvent.preventDefault()}.bind(this))};p.prototype.registerCloseOnCancel=function(){this.getModal().on(e.events.activate,this.getActionSelector("cancel"),function(b,c){var d=a.Event(h.cancel);this.getRoot().trigger(d,this);if(!d.isDefaultPrevented()){c.originalEvent.preventDefault();if(this.removeOnClose){this.destroy()}else{this.hide()}}}.bind(this))};p.prototype.registerCloseOnSave=function(){this.getModal().on(e.events.activate,this.getActionSelector("save"),function(b,c){var d=a.Event(h.save);this.getRoot().trigger(d,this);if(!d.isDefaultPrevented()){c.originalEvent.preventDefault();if(this.removeOnClose){this.destroy()}else{this.hide()}}}.bind(this))};p.prototype.asyncSet=function(b,d){var e=b;if("object"!==_typeof(b)||!b.hasOwnProperty("then")){e=a.Deferred();e.resolve(b)}e.then(function(a){d(a)}).fail(c.exception);return e};p.prototype.setButtonText=function(a,b){var c=this.getFooter().find(this.getActionSelector(a));if(!c){throw new Error("Unable to find the '"+a+"' button")}return this.asyncSet(b,c.text.bind(c))};p.prototype.getActionSelector=function(a){return"[data-action='"+a+"']"};p.prototype.setRemoveOnClose=function(a){this.removeOnClose=a};return p}); //# sourceMappingURL=modal.min.js.map diff --git a/lib/amd/build/modal.min.js.map b/lib/amd/build/modal.min.js.map index fc188992b1f..822d321ac54 100644 --- a/lib/amd/build/modal.min.js.map +++ b/lib/amd/build/modal.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/modal.js"],"names":["define","$","Templates","Notification","KeyCodes","CustomEvents","ModalBackdrop","Event","ModalEvents","FocusLock","Pending","Fullscreen","SELECTORS","CONTAINER","MODAL","HEADER","TITLE","BODY","FOOTER","HIDE","DIALOG","FORM","MENU_BAR","HAS_Z_INDEX","CAN_RECEIVE_FOCUS","TEMPLATES","LOADING","BACKDROP","backdropPromise","modalCounter","Modal","root","modal","find","header","headerPromise","Deferred","title","titlePromise","body","bodyPromise","footer","footerPromise","hiddenSiblings","isAttached","bodyJS","footerJS","modalCount","attachmentPoint","document","createElement","append","is","exception","message","length","registerEventListeners","prototype","attachToDOM","getAttachmentPoint","trapFocus","runTemplateJS","countOtherVisibleModals","count","each","index","element","hasClass","bind","getBackdrop","render","then","html","fail","getRoot","getModal","getTitle","getBody","getFooter","getTitlePromise","getBodyPromise","getFooterPromise","getModalCount","setTitle","value","asyncSet","resolve","catch","setBody","notifyFilterContentUpdated","trigger","bodyRendered","jsPendingId","M","util","js_pending","contentPromise","css","when","state","height","innerHeight","animate","loadingIcon","hide","fadeIn","promise","fadeOut","js","result","isVisible","currentHeight","newHeight","opacity","duration","queue","always","js_complete","setFooter","showFooter","hasFooterContent","children","hideFooter","addClass","removeClass","setLarge","isLarge","setSmall","isSmall","calculateZIndex","items","zIndex","parseInt","item","itemZIndex","hasFocus","target","activeElement","has","hasTransitions","getElement","show","pendingPromise","backdrop","currentIndex","newIndex","setZIndex","accessibilityShow","focus","shown","hideIfNotForm","formElement","done","untrapFocus","accessibilityHide","one","hidden","destroy","remove","destroyed","child","attr","data","push","sibling","previousValue","removeAttr","on","e","keyCode","escape","removeOnClose","click","closest","events","activate","originalEvent","preventDefault","registerCloseOnCancel","getActionSelector","cancelEvent","cancel","isDefaultPrevented","registerCloseOnSave","saveEvent","save","setFunction","p","hasOwnProperty","content","setButtonText","action","button","Error","text","setRemoveOnClose"],"mappings":"mSAwBAA,OAAM,cAAC,CACH,QADG,CAEH,gBAFG,CAGH,mBAHG,CAIH,gBAJG,CAKH,gCALG,CAMH,qBANG,CAOH,YAPG,CAQH,mBARG,CASH,2BATG,CAUH,cAVG,CAWH,iBAXG,CAAD,CAYH,SACCC,CADD,CAECC,CAFD,CAGCC,CAHD,CAICC,CAJD,CAKCC,CALD,CAMCC,CAND,CAOCC,CAPD,CAQCC,CARD,CASCC,CATD,CAUCC,CAVD,CAWCC,CAXD,CAYD,IAEMC,CAAAA,CAAS,CAAG,CACZC,SAAS,CAAE,mCADC,CAEZC,KAAK,CAAE,yBAFK,CAGZC,MAAM,CAAE,0BAHI,CAIZC,KAAK,CAAE,yBAJK,CAKZC,IAAI,CAAE,wBALM,CAMZC,MAAM,CAAE,0BANI,CAOZC,IAAI,CAAE,wBAPM,CAQZC,MAAM,CAAE,eARI,CASZC,IAAI,CAAE,MATM,CAUZC,QAAQ,CAAE,gBAVE,CAWZC,WAAW,CAAE,oBAXD,CAYZC,iBAAiB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BAAL,CAAuBY,CAAvB,CAAtB,CAAf,CAEA,GAAI,CAACC,CAAL,CAAa,CACT,KAAM,IAAIC,CAAAA,KAAJ,CAAU,uBAAyBF,CAAzB,CAAkC,UAA5C,CACT,CAED,MAAO,MAAK1G,QAAL,CAAcD,CAAd,CAAqB4G,CAAM,CAACE,IAAP,CAAY9H,IAAZ,CAAiB4H,CAAjB,CAArB,CACV,CARD,CAgBAlK,CAAK,CAAC2B,SAAN,CAAgB0H,iBAAhB,CAAoC,SAASY,CAAT,CAAiB,CACjD,MAAO,iBAAmBA,CAAnB,CAA4B,IACtC,CAFD,CASAjK,CAAK,CAAC2B,SAAN,CAAgB0I,gBAAhB,CAAmC,SAASrC,CAAT,CAAiB,CAChD,KAAKa,aAAL,CAAqBb,CACxB,CAFD,CAIA,MAAOhI,CAAAA,CACV,CAp6BK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Contain the logic for modals.\n *\n * @module core/modal\n * @class modal\n * @package core\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine([\n 'jquery',\n 'core/templates',\n 'core/notification',\n 'core/key_codes',\n 'core/custom_interaction_events',\n 'core/modal_backdrop',\n 'core/event',\n 'core/modal_events',\n 'core/local/aria/focuslock',\n 'core/pending',\n 'core/fullscreen'\n], function(\n $,\n Templates,\n Notification,\n KeyCodes,\n CustomEvents,\n ModalBackdrop,\n Event,\n ModalEvents,\n FocusLock,\n Pending,\n Fullscreen\n) {\n\n var SELECTORS = {\n CONTAINER: '[data-region=\"modal-container\"]',\n MODAL: '[data-region=\"modal\"]',\n HEADER: '[data-region=\"header\"]',\n TITLE: '[data-region=\"title\"]',\n BODY: '[data-region=\"body\"]',\n FOOTER: '[data-region=\"footer\"]',\n HIDE: '[data-action=\"hide\"]',\n DIALOG: '[role=dialog]',\n FORM: 'form',\n MENU_BAR: '[role=menubar]',\n HAS_Z_INDEX: '.moodle-has-zindex',\n CAN_RECEIVE_FOCUS: 'input:not([type=\"hidden\"]), a[href], button, textarea, select, [tabindex]',\n };\n\n var TEMPLATES = {\n LOADING: 'core/loading',\n BACKDROP: 'core/modal_backdrop',\n };\n\n /**\n * Module singleton for the backdrop to be reused by all Modal instances.\n */\n var backdropPromise;\n\n /**\n * A counter that gets incremented for each modal created. This can be\n * used to generate unique values for the modals.\n */\n var modalCounter = 0;\n\n /**\n * Constructor for the Modal.\n *\n * @param {object} root The root jQuery element for the modal\n */\n var Modal = function(root) {\n this.root = $(root);\n this.modal = this.root.find(SELECTORS.MODAL);\n this.header = this.modal.find(SELECTORS.HEADER);\n this.headerPromise = $.Deferred();\n this.title = this.header.find(SELECTORS.TITLE);\n this.titlePromise = $.Deferred();\n this.body = this.modal.find(SELECTORS.BODY);\n this.bodyPromise = $.Deferred();\n this.footer = this.modal.find(SELECTORS.FOOTER);\n this.footerPromise = $.Deferred();\n this.hiddenSiblings = [];\n this.isAttached = false;\n this.bodyJS = null;\n this.footerJS = null;\n this.modalCount = modalCounter++;\n this.attachmentPoint = document.createElement('div');\n document.body.append(this.attachmentPoint);\n\n if (!this.root.is(SELECTORS.CONTAINER)) {\n Notification.exception({message: 'Element is not a modal container'});\n }\n\n if (!this.modal.length) {\n Notification.exception({message: 'Container does not contain a modal'});\n }\n\n if (!this.header.length) {\n Notification.exception({message: 'Modal is missing a header region'});\n }\n\n if (!this.title.length) {\n Notification.exception({message: 'Modal header is missing a title region'});\n }\n\n if (!this.body.length) {\n Notification.exception({message: 'Modal is missing a body region'});\n }\n\n if (!this.footer.length) {\n Notification.exception({message: 'Modal is missing a footer region'});\n }\n\n this.registerEventListeners();\n };\n\n /**\n * Attach the modal to the correct part of the page.\n *\n * If it hasn't already been added it runs any\n * javascript that has been cached until now.\n *\n * @method attachToDOM\n */\n Modal.prototype.attachToDOM = function() {\n this.getAttachmentPoint().append(this.root);\n\n if (this.isAttached) {\n return;\n }\n\n FocusLock.trapFocus(this.root[0]);\n\n // If we'd cached any JS then we can run it how that the modal is\n // attached to the DOM.\n if (this.bodyJS) {\n Templates.runTemplateJS(this.bodyJS);\n this.bodyJS = null;\n }\n\n if (this.footerJS) {\n Templates.runTemplateJS(this.footerJS);\n this.footerJS = null;\n }\n\n this.isAttached = true;\n };\n\n /**\n * Count the number of other visible modals (not including this one).\n *\n * @method countOtherVisibleModals\n * @return {int}\n */\n Modal.prototype.countOtherVisibleModals = function() {\n var count = 0;\n $('body').find(SELECTORS.CONTAINER).each(function(index, element) {\n element = $(element);\n\n // If we haven't found ourself and the element is visible.\n if (!this.root.is(element) && element.hasClass('show')) {\n count++;\n }\n }.bind(this));\n\n return count;\n };\n\n /**\n * Get the modal backdrop.\n *\n * @method getBackdrop\n * @return {object} jQuery promise\n */\n Modal.prototype.getBackdrop = function() {\n if (!backdropPromise) {\n backdropPromise = Templates.render(TEMPLATES.BACKDROP, {})\n .then(function(html) {\n var element = $(html);\n\n return new ModalBackdrop(element);\n })\n .fail(Notification.exception);\n }\n\n return backdropPromise;\n };\n\n /**\n * Get the root element of this modal.\n *\n * @method getRoot\n * @return {object} jQuery object\n */\n Modal.prototype.getRoot = function() {\n return this.root;\n };\n\n /**\n * Get the modal element of this modal.\n *\n * @method getModal\n * @return {object} jQuery object\n */\n Modal.prototype.getModal = function() {\n return this.modal;\n };\n\n /**\n * Get the modal title element.\n *\n * @method getTitle\n * @return {object} jQuery object\n */\n Modal.prototype.getTitle = function() {\n return this.title;\n };\n\n /**\n * Get the modal body element.\n *\n * @method getBody\n * @return {object} jQuery object\n */\n Modal.prototype.getBody = function() {\n return this.body;\n };\n\n /**\n * Get the modal footer element.\n *\n * @method getFooter\n * @return {object} jQuery object\n */\n Modal.prototype.getFooter = function() {\n return this.footer;\n };\n\n /**\n * Get a promise resolving to the title region.\n *\n * @method getTitlePromise\n * @return {Promise}\n */\n Modal.prototype.getTitlePromise = function() {\n return this.titlePromise;\n };\n\n /**\n * Get a promise resolving to the body region.\n *\n * @method getBodyPromise\n * @return {object} jQuery object\n */\n Modal.prototype.getBodyPromise = function() {\n return this.bodyPromise;\n };\n\n /**\n * Get a promise resolving to the footer region.\n *\n * @method getFooterPromise\n * @return {object} jQuery object\n */\n Modal.prototype.getFooterPromise = function() {\n return this.footerPromise;\n };\n\n /**\n * Get the unique modal count.\n *\n * @method getModalCount\n * @return {int}\n */\n Modal.prototype.getModalCount = function() {\n return this.modalCount;\n };\n\n /**\n * Set the modal title element.\n *\n * This method is overloaded to take either a string value for the title or a jQuery promise that is resolved with\n * HTML most commonly from a Str.get_string call.\n *\n * @method setTitle\n * @param {(string|object)} value The title string or jQuery promise which resolves to the title.\n */\n Modal.prototype.setTitle = function(value) {\n var title = this.getTitle();\n this.titlePromise = $.Deferred();\n\n this.asyncSet(value, title.html.bind(title))\n .then(function() {\n this.titlePromise.resolve(title);\n }.bind(this))\n .catch(Notification.exception);\n };\n\n /**\n * Set the modal body element.\n *\n * This method is overloaded to take either a string value for the body or a jQuery promise that is resolved with\n * HTML and Javascript most commonly from a Templates.render call.\n *\n * @method setBody\n * @param {(string|object)} value The body string or jQuery promise which resolves to the body.\n */\n Modal.prototype.setBody = function(value) {\n this.bodyPromise = $.Deferred();\n\n var body = this.getBody();\n\n if (typeof value === 'string') {\n // Just set the value if it's a string.\n body.html(value);\n Event.notifyFilterContentUpdated(body);\n this.getRoot().trigger(ModalEvents.bodyRendered, this);\n this.bodyPromise.resolve(body);\n } else {\n var jsPendingId = 'amd-modal-js-pending-id-' + this.getModalCount();\n M.util.js_pending(jsPendingId);\n // Otherwise we assume it's a promise to be resolved with\n // html and javascript.\n var contentPromise = null;\n body.css('overflow', 'hidden');\n\n // Ensure that the `value` is a jQuery Promise.\n value = $.when(value);\n\n if (value.state() == 'pending') {\n // We're still waiting for the body promise to resolve so\n // let's show a loading icon.\n var height = body.innerHeight();\n if (height < 100) {\n height = 100;\n }\n\n body.animate({height: height + 'px'}, 150);\n\n body.html('');\n contentPromise = Templates.render(TEMPLATES.LOADING, {})\n .then(function(html) {\n var loadingIcon = $(html).hide();\n body.html(loadingIcon);\n loadingIcon.fadeIn(150);\n\n // We only want the loading icon to fade out\n // when the content for the body has finished\n // loading.\n return $.when(loadingIcon.promise(), value);\n })\n .then(function(loadingIcon) {\n // Once the content has finished loading and\n // the loading icon has been shown then we can\n // fade the icon away to reveal the content.\n return loadingIcon.fadeOut(100).promise();\n })\n .then(function() {\n return value;\n });\n } else {\n // The content is already loaded so let's just display\n // it to the user. No need for a loading icon.\n contentPromise = value;\n }\n\n // Now we can actually display the content.\n contentPromise.then(function(html, js) {\n var result = null;\n\n if (this.isVisible()) {\n // If the modal is visible then we should display\n // the content gracefully for the user.\n body.css('opacity', 0);\n var currentHeight = body.innerHeight();\n body.html(html);\n // We need to clear any height values we've set here\n // in order to measure the height of the content being\n // added. This then allows us to animate the height\n // transition.\n body.css('height', '');\n var newHeight = body.innerHeight();\n body.css('height', currentHeight + 'px');\n result = body.animate(\n {height: newHeight + 'px', opacity: 1},\n {duration: 150, queue: false}\n ).promise();\n } else {\n // Since the modal isn't visible we can just immediately\n // set the content. No need to animate it.\n body.html(html);\n }\n\n if (js) {\n if (this.isAttached) {\n // If we're in the DOM then run the JS immediately.\n Templates.runTemplateJS(js);\n } else {\n // Otherwise cache it to be run when we're attached.\n this.bodyJS = js;\n }\n }\n\n return result;\n }.bind(this))\n .then(function(result) {\n Event.notifyFilterContentUpdated(body);\n this.getRoot().trigger(ModalEvents.bodyRendered, this);\n return result;\n }.bind(this))\n .then(function() {\n this.bodyPromise.resolve(body);\n return;\n }.bind(this))\n .fail(Notification.exception)\n .always(function() {\n // When we're done displaying all of the content we need\n // to clear the custom values we've set here.\n body.css('height', '');\n body.css('overflow', '');\n body.css('opacity', '');\n M.util.js_complete(jsPendingId);\n\n return;\n })\n .fail(Notification.exception);\n }\n };\n\n /**\n * Set the modal footer element. The footer element is made visible, if it\n * isn't already.\n *\n * This method is overloaded to take either a string\n * value for the body or a jQuery promise that is resolved with HTML and Javascript\n * most commonly from a Templates.render call.\n *\n * @method setFooter\n * @param {(string|object)} value The footer string or jQuery promise\n */\n Modal.prototype.setFooter = function(value) {\n // Make sure the footer is visible.\n this.showFooter();\n this.footerPromise = $.Deferred();\n\n var footer = this.getFooter();\n\n if (typeof value === 'string') {\n // Just set the value if it's a string.\n footer.html(value);\n this.footerPromise.resolve(footer);\n } else {\n // Otherwise we assume it's a promise to be resolved with\n // html and javascript.\n Templates.render(TEMPLATES.LOADING, {})\n .then(function(html) {\n footer.html(html);\n\n return value;\n })\n .then(function(html, js) {\n footer.html(html);\n\n if (js) {\n if (this.isAttached) {\n // If we're in the DOM then run the JS immediately.\n Templates.runTemplateJS(js);\n } else {\n // Otherwise cache it to be run when we're attached.\n this.footerJS = js;\n }\n }\n\n return footer;\n }.bind(this))\n .then(function(footer) {\n this.footerPromise.resolve(footer);\n return;\n }.bind(this))\n .catch(Notification.exception);\n }\n };\n\n /**\n * Check if the footer has any content in it.\n *\n * @method hasFooterContent\n * @return {bool}\n */\n Modal.prototype.hasFooterContent = function() {\n return this.getFooter().children().length ? true : false;\n };\n\n /**\n * Hide the footer element.\n *\n * @method hideFooter\n */\n Modal.prototype.hideFooter = function() {\n this.getFooter().addClass('hidden');\n };\n\n /**\n * Show the footer element.\n *\n * @method showFooter\n */\n Modal.prototype.showFooter = function() {\n this.getFooter().removeClass('hidden');\n };\n\n /**\n * Mark the modal as a large modal.\n *\n * @method setLarge\n */\n Modal.prototype.setLarge = function() {\n if (this.isLarge()) {\n return;\n }\n\n this.getModal().addClass('modal-lg');\n };\n\n /**\n * Check if the modal is a large modal.\n *\n * @method isLarge\n * @return {bool}\n */\n Modal.prototype.isLarge = function() {\n return this.getModal().hasClass('modal-lg');\n };\n\n /**\n * Mark the modal as a small modal.\n *\n * @method setSmall\n */\n Modal.prototype.setSmall = function() {\n if (this.isSmall()) {\n return;\n }\n\n this.getModal().removeClass('modal-lg');\n };\n\n /**\n * Check if the modal is a small modal.\n *\n * @method isSmall\n * @return {bool}\n */\n Modal.prototype.isSmall = function() {\n return !this.getModal().hasClass('modal-lg');\n };\n\n /**\n * Determine the highest z-index value currently on the page.\n *\n * @method calculateZIndex\n * @return {int}\n */\n Modal.prototype.calculateZIndex = function() {\n var items = $(SELECTORS.DIALOG + ', ' + SELECTORS.MENU_BAR + ', ' + SELECTORS.HAS_Z_INDEX);\n var zIndex = parseInt(this.root.css('z-index'));\n\n items.each(function(index, item) {\n item = $(item);\n // Note that webkit browsers won't return the z-index value from the CSS stylesheet\n // if the element doesn't have a position specified. Instead it'll return \"auto\".\n var itemZIndex = item.css('z-index') ? parseInt(item.css('z-index')) : 0;\n\n if (itemZIndex > zIndex) {\n zIndex = itemZIndex;\n }\n });\n\n return zIndex;\n };\n\n /**\n * Check if this modal is visible.\n *\n * @method isVisible\n * @return {bool}\n */\n Modal.prototype.isVisible = function() {\n return this.root.hasClass('show');\n };\n\n /**\n * Check if this modal has focus.\n *\n * @method hasFocus\n * @return {bool}\n */\n Modal.prototype.hasFocus = function() {\n var target = $(document.activeElement);\n return this.root.is(target) || this.root.has(target).length;\n };\n\n /**\n * Check if this modal has CSS transitions applied.\n *\n * @method hasTransitions\n * @return {bool}\n */\n Modal.prototype.hasTransitions = function() {\n return this.getRoot().hasClass('fade');\n };\n\n /**\n * Gets the jQuery wrapped node that the Modal should be attached to.\n *\n * @returns {jQuery}\n */\n Modal.prototype.getAttachmentPoint = function() {\n return $(Fullscreen.getElement() || this.attachmentPoint);\n };\n\n /**\n * Display this modal. The modal will be attached to the DOM if it hasn't\n * already been.\n *\n * @method show\n * @returns {Promise}\n */\n Modal.prototype.show = function() {\n if (this.isVisible()) {\n return $.Deferred().resolve();\n }\n\n var pendingPromise = new Pending('core/modal:show');\n\n if (this.hasFooterContent()) {\n this.showFooter();\n } else {\n this.hideFooter();\n }\n\n this.attachToDOM();\n\n return this.getBackdrop()\n .then(function(backdrop) {\n var currentIndex = this.calculateZIndex();\n var newIndex = currentIndex + 2;\n var newBackdropIndex = newIndex - 1;\n this.root.css('z-index', newIndex);\n backdrop.setZIndex(newBackdropIndex);\n backdrop.show();\n\n this.root.removeClass('hide').addClass('show');\n this.accessibilityShow();\n this.getModal().focus();\n $('body').addClass('modal-open');\n this.root.trigger(ModalEvents.shown, this);\n\n return;\n }.bind(this))\n .then(pendingPromise.resolve);\n };\n\n /**\n * Hide this modal if it does not contain a form.\n *\n * @method hideIfNotForm\n */\n Modal.prototype.hideIfNotForm = function() {\n var formElement = this.modal.find(SELECTORS.FORM);\n if (formElement.length == 0) {\n this.hide();\n }\n };\n\n /**\n * Hide this modal.\n *\n * @method hide\n */\n Modal.prototype.hide = function() {\n this.getBackdrop().done(function(backdrop) {\n FocusLock.untrapFocus();\n\n if (!this.countOtherVisibleModals()) {\n // Hide the backdrop if we're the last open modal.\n backdrop.hide();\n $('body').removeClass('modal-open');\n }\n\n var currentIndex = parseInt(this.root.css('z-index'));\n this.root.css('z-index', '');\n backdrop.setZIndex(currentIndex - 3);\n\n this.accessibilityHide();\n\n if (this.hasTransitions()) {\n // Wait for CSS transitions to complete before hiding the element.\n this.getRoot().one('transitionend webkitTransitionEnd oTransitionEnd', function() {\n this.getRoot().removeClass('show').addClass('hide');\n }.bind(this));\n } else {\n this.getRoot().removeClass('show').addClass('hide');\n }\n\n // Ensure the modal is moved onto the body node if it is still attached to the DOM.\n if ($(document.body).find(this.getRoot()).length) {\n $(document.body).append(this.getRoot());\n }\n\n this.root.trigger(ModalEvents.hidden, this);\n }.bind(this));\n };\n\n /**\n * Remove this modal from the DOM.\n *\n * @method destroy\n */\n Modal.prototype.destroy = function() {\n this.hide();\n this.root.remove();\n this.root.trigger(ModalEvents.destroyed, this);\n this.attachmentPoint.remove();\n };\n\n /**\n * Sets the appropriate aria attributes on this dialogue and the other\n * elements in the DOM to ensure that screen readers are able to navigate\n * the dialogue popup correctly.\n *\n * @method accessibilityShow\n */\n Modal.prototype.accessibilityShow = function() {\n // We need to get a list containing each sibling element and the shallowest\n // non-ancestral nodes in the DOM. We can shortcut this a little by leveraging\n // the fact that this dialogue is always appended to the document body therefore\n // it's siblings are the shallowest non-ancestral nodes. If that changes then\n // this code should also be updated.\n $('body').children().each(function(index, child) {\n // Skip the current modal.\n if (!this.root.is(child)) {\n child = $(child);\n var hidden = child.attr('aria-hidden');\n // If they are already hidden we can ignore them.\n if (hidden !== 'true') {\n // Save their current state.\n child.data('previous-aria-hidden', hidden);\n this.hiddenSiblings.push(child);\n\n // Hide this node from screen readers.\n child.attr('aria-hidden', 'true');\n }\n }\n }.bind(this));\n\n // Make us visible to screen readers.\n this.root.attr('aria-hidden', 'false');\n };\n\n /**\n * Restores the aria visibility on the DOM elements changed when displaying\n * the dialogue popup and makes the dialogue aria hidden to allow screen\n * readers to navigate the main page correctly when the dialogue is closed.\n *\n * @method accessibilityHide\n */\n Modal.prototype.accessibilityHide = function() {\n this.root.attr('aria-hidden', 'true');\n\n // Restore the sibling nodes back to their original values.\n $.each(this.hiddenSiblings, function(index, sibling) {\n sibling = $(sibling);\n var previousValue = sibling.data('previous-aria-hidden');\n // If the element didn't previously have an aria-hidden attribute\n // then we can just remove the one we set.\n if (typeof previousValue == 'undefined') {\n sibling.removeAttr('aria-hidden');\n } else {\n // Otherwise set it back to the old value (which will be false).\n sibling.attr('aria-hidden', previousValue);\n }\n });\n\n // Clear the cache. No longer need to store these.\n this.hiddenSiblings = [];\n };\n\n /**\n * Set up all of the event handling for the modal.\n *\n * @method registerEventListeners\n */\n Modal.prototype.registerEventListeners = function() {\n this.getRoot().on('keydown', function(e) {\n if (!this.isVisible()) {\n return;\n }\n\n if (e.keyCode == KeyCodes.escape) {\n if (this.removeOnClose) {\n this.destroy();\n } else {\n this.hide();\n }\n }\n }.bind(this));\n\n // Listen for clicks on the modal container.\n this.getRoot().click(function(e) {\n // If the click wasn't inside the modal element then we should\n // hide the modal.\n if (!$(e.target).closest(SELECTORS.MODAL).length) {\n // The check above fails to detect the click was inside the modal when the DOM tree is already changed.\n // So, we check if we can still find the container element or not. If not, then the DOM tree is changed.\n // It's best not to hide the modal in that case.\n if ($(e.target).closest(SELECTORS.CONTAINER).length) {\n this.hideIfNotForm();\n }\n }\n }.bind(this));\n\n CustomEvents.define(this.getModal(), [CustomEvents.events.activate]);\n this.getModal().on(CustomEvents.events.activate, SELECTORS.HIDE, function(e, data) {\n this.hide();\n data.originalEvent.preventDefault();\n }.bind(this));\n };\n\n /**\n * Register a listener to close the dialogue when the cancel button is pressed.\n *\n * @method registerCloseOnCancel\n */\n Modal.prototype.registerCloseOnCancel = function() {\n // Handle the clicking of the Cancel button.\n this.getModal().on(CustomEvents.events.activate, this.getActionSelector('cancel'), function(e, data) {\n var cancelEvent = $.Event(ModalEvents.cancel);\n this.getRoot().trigger(cancelEvent, this);\n\n if (!cancelEvent.isDefaultPrevented()) {\n data.originalEvent.preventDefault();\n\n if (this.removeOnClose) {\n this.destroy();\n } else {\n this.hide();\n }\n }\n }.bind(this));\n };\n\n /**\n * Register a listener to close the dialogue when the save button is pressed.\n *\n * @method registerCloseOnSave\n */\n Modal.prototype.registerCloseOnSave = function() {\n // Handle the clicking of the Cancel button.\n this.getModal().on(CustomEvents.events.activate, this.getActionSelector('save'), function(e, data) {\n var saveEvent = $.Event(ModalEvents.save);\n this.getRoot().trigger(saveEvent, this);\n\n if (!saveEvent.isDefaultPrevented()) {\n data.originalEvent.preventDefault();\n\n if (this.removeOnClose) {\n this.destroy();\n } else {\n this.hide();\n }\n }\n }.bind(this));\n };\n\n /**\n * Set or resolve and set the value using the function.\n *\n * @method asyncSet\n * @param {(string|object)} value The string or jQuery promise.\n * @param {function} setFunction The setter\n * @return {Promise}\n */\n Modal.prototype.asyncSet = function(value, setFunction) {\n var p = value;\n if (typeof value !== 'object' || !value.hasOwnProperty('then')) {\n p = $.Deferred();\n p.resolve(value);\n }\n\n p.then(function(content) {\n setFunction(content);\n\n return;\n })\n .fail(Notification.exception);\n\n return p;\n };\n\n /**\n * Set the title text of a button.\n *\n * This method is overloaded to take either a string value for the button title or a jQuery promise that is resolved with\n * text most commonly from a Str.get_string call.\n *\n * @param {DOMString} action The action of the button\n * @param {(String|object)} value The button text, or a promise which will resolve to it\n * @returns {Promise}\n */\n Modal.prototype.setButtonText = function(action, value) {\n const button = this.getFooter().find(this.getActionSelector(action));\n\n if (!button) {\n throw new Error(\"Unable to find the '\" + action + \"' button\");\n }\n\n return this.asyncSet(value, button.text.bind(button));\n };\n\n /**\n * Get the Selector for an action.\n *\n * @param {String} action\n * @returns {DOMString}\n */\n Modal.prototype.getActionSelector = function(action) {\n return \"[data-action='\" + action + \"']\";\n };\n\n /**\n * Set the flag to remove the modal from the DOM on close.\n *\n * @param {Boolean} remove\n */\n Modal.prototype.setRemoveOnClose = function(remove) {\n this.removeOnClose = remove;\n };\n\n return Modal;\n});\n"],"file":"modal.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/modal.js"],"names":["define","$","Templates","Notification","KeyCodes","CustomEvents","ModalBackdrop","Event","ModalEvents","FocusLock","Pending","Fullscreen","SELECTORS","CONTAINER","MODAL","HEADER","TITLE","BODY","FOOTER","HIDE","DIALOG","FORM","MENU_BAR","HAS_Z_INDEX","CAN_RECEIVE_FOCUS","TEMPLATES","LOADING","BACKDROP","backdropPromise","modalCounter","Modal","root","modal","find","header","headerPromise","Deferred","title","titlePromise","body","bodyPromise","footer","footerPromise","hiddenSiblings","isAttached","bodyJS","footerJS","modalCount","attachmentPoint","document","createElement","append","is","exception","message","length","registerEventListeners","prototype","attachToDOM","getAttachmentPoint","trapFocus","runTemplateJS","countOtherVisibleModals","count","each","index","element","hasClass","bind","getBackdrop","render","then","html","fail","getRoot","getModal","getTitle","getBody","getFooter","getTitlePromise","getBodyPromise","getFooterPromise","getModalCount","setTitle","value","asyncSet","resolve","catch","setBody","notifyFilterContentUpdated","trigger","bodyRendered","jsPendingId","M","util","js_pending","contentPromise","css","when","state","height","innerHeight","animate","loadingIcon","hide","fadeIn","promise","fadeOut","js","result","isVisible","currentHeight","newHeight","opacity","duration","queue","always","js_complete","setFooter","showFooter","hasFooterContent","children","hideFooter","addClass","removeClass","setLarge","isLarge","setSmall","isSmall","calculateZIndex","items","zIndex","parseInt","item","itemZIndex","hasFocus","target","activeElement","has","hasTransitions","getElement","show","pendingPromise","backdrop","currentIndex","newIndex","setZIndex","accessibilityShow","focus","shown","hideIfNotForm","formElement","done","untrapFocus","accessibilityHide","one","hidden","destroy","remove","destroyed","child","attr","data","push","sibling","previousValue","removeAttr","on","e","keyCode","escape","removeOnClose","click","closest","events","activate","originalEvent","preventDefault","registerCloseOnCancel","getActionSelector","cancelEvent","cancel","isDefaultPrevented","registerCloseOnSave","saveEvent","save","setFunction","p","hasOwnProperty","content","setButtonText","action","button","Error","text","setRemoveOnClose"],"mappings":"kRAwBAA,OAAM,cAAC,CACH,QADG,CAEH,gBAFG,CAGH,mBAHG,CAIH,gBAJG,CAKH,gCALG,CAMH,qBANG,CAOH,YAPG,CAQH,mBARG,CASH,2BATG,CAUH,cAVG,CAWH,iBAXG,CAAD,CAYH,SACCC,CADD,CAECC,CAFD,CAGCC,CAHD,CAICC,CAJD,CAKCC,CALD,CAMCC,CAND,CAOCC,CAPD,CAQCC,CARD,CASCC,CATD,CAUCC,CAVD,CAWCC,CAXD,CAYD,IAEMC,CAAAA,CAAS,CAAG,CACZC,SAAS,CAAE,mCADC,CAEZC,KAAK,CAAE,yBAFK,CAGZC,MAAM,CAAE,0BAHI,CAIZC,KAAK,CAAE,yBAJK,CAKZC,IAAI,CAAE,wBALM,CAMZC,MAAM,CAAE,0BANI,CAOZC,IAAI,CAAE,wBAPM,CAQZC,MAAM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iB3G,CAAjB,CAAwB,CACpD,GAAM4G,CAAAA,CAAM,CAAG,KAAKlH,SAAL,GAAiB7C,IAAjB,CAAsB,KAAKkJ,iBAAL,CAAuBY,CAAvB,CAAtB,CAAf,CAEA,GAAI,CAACC,CAAL,CAAa,CACT,KAAM,IAAIC,CAAAA,KAAJ,CAAU,uBAAyBF,CAAzB,CAAkC,UAA5C,CACT,CAED,MAAO,MAAK1G,QAAL,CAAcD,CAAd,CAAqB4G,CAAM,CAACE,IAAP,CAAY9H,IAAZ,CAAiB4H,CAAjB,CAArB,CACV,CARD,CAgBAlK,CAAK,CAAC2B,SAAN,CAAgB0H,iBAAhB,CAAoC,SAASY,CAAT,CAAiB,CACjD,MAAO,iBAAmBA,CAAnB,CAA4B,IACtC,CAFD,CASAjK,CAAK,CAAC2B,SAAN,CAAgB0I,gBAAhB,CAAmC,SAASrC,CAAT,CAAiB,CAChD,KAAKa,aAAL,CAAqBb,CACxB,CAFD,CAIA,MAAOhI,CAAAA,CACV,CAp6BK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Contain the logic for modals.\n *\n * @module core/modal\n * @class modal\n * @package core\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine([\n 'jquery',\n 'core/templates',\n 'core/notification',\n 'core/key_codes',\n 'core/custom_interaction_events',\n 'core/modal_backdrop',\n 'core/event',\n 'core/modal_events',\n 'core/local/aria/focuslock',\n 'core/pending',\n 'core/fullscreen'\n], function(\n $,\n Templates,\n Notification,\n KeyCodes,\n CustomEvents,\n ModalBackdrop,\n Event,\n ModalEvents,\n FocusLock,\n Pending,\n Fullscreen\n) {\n\n var SELECTORS = {\n CONTAINER: '[data-region=\"modal-container\"]',\n MODAL: '[data-region=\"modal\"]',\n HEADER: '[data-region=\"header\"]',\n TITLE: '[data-region=\"title\"]',\n BODY: '[data-region=\"body\"]',\n FOOTER: '[data-region=\"footer\"]',\n HIDE: '[data-action=\"hide\"]',\n DIALOG: '[role=dialog]',\n FORM: 'form',\n MENU_BAR: '[role=menubar]',\n HAS_Z_INDEX: '.moodle-has-zindex',\n CAN_RECEIVE_FOCUS: 'input:not([type=\"hidden\"]), a[href], button, textarea, select, [tabindex]',\n };\n\n var TEMPLATES = {\n LOADING: 'core/loading',\n BACKDROP: 'core/modal_backdrop',\n };\n\n /**\n * Module singleton for the backdrop to be reused by all Modal instances.\n */\n var backdropPromise;\n\n /**\n * A counter that gets incremented for each modal created. This can be\n * used to generate unique values for the modals.\n */\n var modalCounter = 0;\n\n /**\n * Constructor for the Modal.\n *\n * @param {object} root The root jQuery element for the modal\n */\n var Modal = function(root) {\n this.root = $(root);\n this.modal = this.root.find(SELECTORS.MODAL);\n this.header = this.modal.find(SELECTORS.HEADER);\n this.headerPromise = $.Deferred();\n this.title = this.header.find(SELECTORS.TITLE);\n this.titlePromise = $.Deferred();\n this.body = this.modal.find(SELECTORS.BODY);\n this.bodyPromise = $.Deferred();\n this.footer = this.modal.find(SELECTORS.FOOTER);\n this.footerPromise = $.Deferred();\n this.hiddenSiblings = [];\n this.isAttached = false;\n this.bodyJS = null;\n this.footerJS = null;\n this.modalCount = modalCounter++;\n this.attachmentPoint = document.createElement('div');\n document.body.append(this.attachmentPoint);\n\n if (!this.root.is(SELECTORS.CONTAINER)) {\n Notification.exception({message: 'Element is not a modal container'});\n }\n\n if (!this.modal.length) {\n Notification.exception({message: 'Container does not contain a modal'});\n }\n\n if (!this.header.length) {\n Notification.exception({message: 'Modal is missing a header region'});\n }\n\n if (!this.title.length) {\n Notification.exception({message: 'Modal header is missing a title region'});\n }\n\n if (!this.body.length) {\n Notification.exception({message: 'Modal is missing a body region'});\n }\n\n if (!this.footer.length) {\n Notification.exception({message: 'Modal is missing a footer region'});\n }\n\n this.registerEventListeners();\n };\n\n /**\n * Attach the modal to the correct part of the page.\n *\n * If it hasn't already been added it runs any\n * javascript that has been cached until now.\n *\n * @method attachToDOM\n */\n Modal.prototype.attachToDOM = function() {\n this.getAttachmentPoint().append(this.root);\n\n if (this.isAttached) {\n return;\n }\n\n FocusLock.trapFocus(this.root[0]);\n\n // If we'd cached any JS then we can run it how that the modal is\n // attached to the DOM.\n if (this.bodyJS) {\n Templates.runTemplateJS(this.bodyJS);\n this.bodyJS = null;\n }\n\n if (this.footerJS) {\n Templates.runTemplateJS(this.footerJS);\n this.footerJS = null;\n }\n\n this.isAttached = true;\n };\n\n /**\n * Count the number of other visible modals (not including this one).\n *\n * @method countOtherVisibleModals\n * @return {int}\n */\n Modal.prototype.countOtherVisibleModals = function() {\n var count = 0;\n $('body').find(SELECTORS.CONTAINER).each(function(index, element) {\n element = $(element);\n\n // If we haven't found ourself and the element is visible.\n if (!this.root.is(element) && element.hasClass('show')) {\n count++;\n }\n }.bind(this));\n\n return count;\n };\n\n /**\n * Get the modal backdrop.\n *\n * @method getBackdrop\n * @return {object} jQuery promise\n */\n Modal.prototype.getBackdrop = function() {\n if (!backdropPromise) {\n backdropPromise = Templates.render(TEMPLATES.BACKDROP, {})\n .then(function(html) {\n var element = $(html);\n\n return new ModalBackdrop(element);\n })\n .fail(Notification.exception);\n }\n\n return backdropPromise;\n };\n\n /**\n * Get the root element of this modal.\n *\n * @method getRoot\n * @return {object} jQuery object\n */\n Modal.prototype.getRoot = function() {\n return this.root;\n };\n\n /**\n * Get the modal element of this modal.\n *\n * @method getModal\n * @return {object} jQuery object\n */\n Modal.prototype.getModal = function() {\n return this.modal;\n };\n\n /**\n * Get the modal title element.\n *\n * @method getTitle\n * @return {object} jQuery object\n */\n Modal.prototype.getTitle = function() {\n return this.title;\n };\n\n /**\n * Get the modal body element.\n *\n * @method getBody\n * @return {object} jQuery object\n */\n Modal.prototype.getBody = function() {\n return this.body;\n };\n\n /**\n * Get the modal footer element.\n *\n * @method getFooter\n * @return {object} jQuery object\n */\n Modal.prototype.getFooter = function() {\n return this.footer;\n };\n\n /**\n * Get a promise resolving to the title region.\n *\n * @method getTitlePromise\n * @return {Promise}\n */\n Modal.prototype.getTitlePromise = function() {\n return this.titlePromise;\n };\n\n /**\n * Get a promise resolving to the body region.\n *\n * @method getBodyPromise\n * @return {object} jQuery object\n */\n Modal.prototype.getBodyPromise = function() {\n return this.bodyPromise;\n };\n\n /**\n * Get a promise resolving to the footer region.\n *\n * @method getFooterPromise\n * @return {object} jQuery object\n */\n Modal.prototype.getFooterPromise = function() {\n return this.footerPromise;\n };\n\n /**\n * Get the unique modal count.\n *\n * @method getModalCount\n * @return {int}\n */\n Modal.prototype.getModalCount = function() {\n return this.modalCount;\n };\n\n /**\n * Set the modal title element.\n *\n * This method is overloaded to take either a string value for the title or a jQuery promise that is resolved with\n * HTML most commonly from a Str.get_string call.\n *\n * @method setTitle\n * @param {(string|object)} value The title string or jQuery promise which resolves to the title.\n */\n Modal.prototype.setTitle = function(value) {\n var title = this.getTitle();\n this.titlePromise = $.Deferred();\n\n this.asyncSet(value, title.html.bind(title))\n .then(function() {\n this.titlePromise.resolve(title);\n }.bind(this))\n .catch(Notification.exception);\n };\n\n /**\n * Set the modal body element.\n *\n * This method is overloaded to take either a string value for the body or a jQuery promise that is resolved with\n * HTML and Javascript most commonly from a Templates.render call.\n *\n * @method setBody\n * @param {(string|object)} value The body string or jQuery promise which resolves to the body.\n */\n Modal.prototype.setBody = function(value) {\n this.bodyPromise = $.Deferred();\n\n var body = this.getBody();\n\n if (typeof value === 'string') {\n // Just set the value if it's a string.\n body.html(value);\n Event.notifyFilterContentUpdated(body);\n this.getRoot().trigger(ModalEvents.bodyRendered, this);\n this.bodyPromise.resolve(body);\n } else {\n var jsPendingId = 'amd-modal-js-pending-id-' + this.getModalCount();\n M.util.js_pending(jsPendingId);\n // Otherwise we assume it's a promise to be resolved with\n // html and javascript.\n var contentPromise = null;\n body.css('overflow', 'hidden');\n\n // Ensure that the `value` is a jQuery Promise.\n value = $.when(value);\n\n if (value.state() == 'pending') {\n // We're still waiting for the body promise to resolve so\n // let's show a loading icon.\n var height = body.innerHeight();\n if (height < 100) {\n height = 100;\n }\n\n body.animate({height: height + 'px'}, 150);\n\n body.html('');\n contentPromise = Templates.render(TEMPLATES.LOADING, {})\n .then(function(html) {\n var loadingIcon = $(html).hide();\n body.html(loadingIcon);\n loadingIcon.fadeIn(150);\n\n // We only want the loading icon to fade out\n // when the content for the body has finished\n // loading.\n return $.when(loadingIcon.promise(), value);\n })\n .then(function(loadingIcon) {\n // Once the content has finished loading and\n // the loading icon has been shown then we can\n // fade the icon away to reveal the content.\n return loadingIcon.fadeOut(100).promise();\n })\n .then(function() {\n return value;\n });\n } else {\n // The content is already loaded so let's just display\n // it to the user. No need for a loading icon.\n contentPromise = value;\n }\n\n // Now we can actually display the content.\n contentPromise.then(function(html, js) {\n var result = null;\n\n if (this.isVisible()) {\n // If the modal is visible then we should display\n // the content gracefully for the user.\n body.css('opacity', 0);\n var currentHeight = body.innerHeight();\n body.html(html);\n // We need to clear any height values we've set here\n // in order to measure the height of the content being\n // added. This then allows us to animate the height\n // transition.\n body.css('height', '');\n var newHeight = body.innerHeight();\n body.css('height', currentHeight + 'px');\n result = body.animate(\n {height: newHeight + 'px', opacity: 1},\n {duration: 150, queue: false}\n ).promise();\n } else {\n // Since the modal isn't visible we can just immediately\n // set the content. No need to animate it.\n body.html(html);\n }\n\n if (js) {\n if (this.isAttached) {\n // If we're in the DOM then run the JS immediately.\n Templates.runTemplateJS(js);\n } else {\n // Otherwise cache it to be run when we're attached.\n this.bodyJS = js;\n }\n }\n\n return result;\n }.bind(this))\n .then(function(result) {\n Event.notifyFilterContentUpdated(body);\n this.getRoot().trigger(ModalEvents.bodyRendered, this);\n return result;\n }.bind(this))\n .then(function() {\n this.bodyPromise.resolve(body);\n return;\n }.bind(this))\n .fail(Notification.exception)\n .always(function() {\n // When we're done displaying all of the content we need\n // to clear the custom values we've set here.\n body.css('height', '');\n body.css('overflow', '');\n body.css('opacity', '');\n M.util.js_complete(jsPendingId);\n\n return;\n })\n .fail(Notification.exception);\n }\n };\n\n /**\n * Set the modal footer element. The footer element is made visible, if it\n * isn't already.\n *\n * This method is overloaded to take either a string\n * value for the body or a jQuery promise that is resolved with HTML and Javascript\n * most commonly from a Templates.render call.\n *\n * @method setFooter\n * @param {(string|object)} value The footer string or jQuery promise\n */\n Modal.prototype.setFooter = function(value) {\n // Make sure the footer is visible.\n this.showFooter();\n this.footerPromise = $.Deferred();\n\n var footer = this.getFooter();\n\n if (typeof value === 'string') {\n // Just set the value if it's a string.\n footer.html(value);\n this.footerPromise.resolve(footer);\n } else {\n // Otherwise we assume it's a promise to be resolved with\n // html and javascript.\n Templates.render(TEMPLATES.LOADING, {})\n .then(function(html) {\n footer.html(html);\n\n return value;\n })\n .then(function(html, js) {\n footer.html(html);\n\n if (js) {\n if (this.isAttached) {\n // If we're in the DOM then run the JS immediately.\n Templates.runTemplateJS(js);\n } else {\n // Otherwise cache it to be run when we're attached.\n this.footerJS = js;\n }\n }\n\n return footer;\n }.bind(this))\n .then(function(footer) {\n this.footerPromise.resolve(footer);\n return;\n }.bind(this))\n .catch(Notification.exception);\n }\n };\n\n /**\n * Check if the footer has any content in it.\n *\n * @method hasFooterContent\n * @return {bool}\n */\n Modal.prototype.hasFooterContent = function() {\n return this.getFooter().children().length ? true : false;\n };\n\n /**\n * Hide the footer element.\n *\n * @method hideFooter\n */\n Modal.prototype.hideFooter = function() {\n this.getFooter().addClass('hidden');\n };\n\n /**\n * Show the footer element.\n *\n * @method showFooter\n */\n Modal.prototype.showFooter = function() {\n this.getFooter().removeClass('hidden');\n };\n\n /**\n * Mark the modal as a large modal.\n *\n * @method setLarge\n */\n Modal.prototype.setLarge = function() {\n if (this.isLarge()) {\n return;\n }\n\n this.getModal().addClass('modal-lg');\n };\n\n /**\n * Check if the modal is a large modal.\n *\n * @method isLarge\n * @return {bool}\n */\n Modal.prototype.isLarge = function() {\n return this.getModal().hasClass('modal-lg');\n };\n\n /**\n * Mark the modal as a small modal.\n *\n * @method setSmall\n */\n Modal.prototype.setSmall = function() {\n if (this.isSmall()) {\n return;\n }\n\n this.getModal().removeClass('modal-lg');\n };\n\n /**\n * Check if the modal is a small modal.\n *\n * @method isSmall\n * @return {bool}\n */\n Modal.prototype.isSmall = function() {\n return !this.getModal().hasClass('modal-lg');\n };\n\n /**\n * Determine the highest z-index value currently on the page.\n *\n * @method calculateZIndex\n * @return {int}\n */\n Modal.prototype.calculateZIndex = function() {\n var items = $(SELECTORS.DIALOG + ', ' + SELECTORS.MENU_BAR + ', ' + SELECTORS.HAS_Z_INDEX);\n var zIndex = parseInt(this.root.css('z-index'));\n\n items.each(function(index, item) {\n item = $(item);\n // Note that webkit browsers won't return the z-index value from the CSS stylesheet\n // if the element doesn't have a position specified. Instead it'll return \"auto\".\n var itemZIndex = item.css('z-index') ? parseInt(item.css('z-index')) : 0;\n\n if (itemZIndex > zIndex) {\n zIndex = itemZIndex;\n }\n });\n\n return zIndex;\n };\n\n /**\n * Check if this modal is visible.\n *\n * @method isVisible\n * @return {bool}\n */\n Modal.prototype.isVisible = function() {\n return this.root.hasClass('show');\n };\n\n /**\n * Check if this modal has focus.\n *\n * @method hasFocus\n * @return {bool}\n */\n Modal.prototype.hasFocus = function() {\n var target = $(document.activeElement);\n return this.root.is(target) || this.root.has(target).length;\n };\n\n /**\n * Check if this modal has CSS transitions applied.\n *\n * @method hasTransitions\n * @return {bool}\n */\n Modal.prototype.hasTransitions = function() {\n return this.getRoot().hasClass('fade');\n };\n\n /**\n * Gets the jQuery wrapped node that the Modal should be attached to.\n *\n * @returns {jQuery}\n */\n Modal.prototype.getAttachmentPoint = function() {\n return $(Fullscreen.getElement() || this.attachmentPoint);\n };\n\n /**\n * Display this modal. The modal will be attached to the DOM if it hasn't\n * already been.\n *\n * @method show\n * @returns {Promise}\n */\n Modal.prototype.show = function() {\n if (this.isVisible()) {\n return $.Deferred().resolve();\n }\n\n var pendingPromise = new Pending('core/modal:show');\n\n if (this.hasFooterContent()) {\n this.showFooter();\n } else {\n this.hideFooter();\n }\n\n this.attachToDOM();\n\n return this.getBackdrop()\n .then(function(backdrop) {\n var currentIndex = this.calculateZIndex();\n var newIndex = currentIndex + 2;\n var newBackdropIndex = newIndex - 1;\n this.root.css('z-index', newIndex);\n backdrop.setZIndex(newBackdropIndex);\n backdrop.show();\n\n this.root.removeClass('hide').addClass('show');\n this.accessibilityShow();\n this.getModal().focus();\n $('body').addClass('modal-open');\n this.root.trigger(ModalEvents.shown, this);\n\n return;\n }.bind(this))\n .then(pendingPromise.resolve);\n };\n\n /**\n * Hide this modal if it does not contain a form.\n *\n * @method hideIfNotForm\n */\n Modal.prototype.hideIfNotForm = function() {\n var formElement = this.modal.find(SELECTORS.FORM);\n if (formElement.length == 0) {\n this.hide();\n }\n };\n\n /**\n * Hide this modal.\n *\n * @method hide\n */\n Modal.prototype.hide = function() {\n this.getBackdrop().done(function(backdrop) {\n FocusLock.untrapFocus();\n\n if (!this.countOtherVisibleModals()) {\n // Hide the backdrop if we're the last open modal.\n backdrop.hide();\n $('body').removeClass('modal-open');\n }\n\n var currentIndex = parseInt(this.root.css('z-index'));\n this.root.css('z-index', '');\n backdrop.setZIndex(currentIndex - 3);\n\n this.accessibilityHide();\n\n if (this.hasTransitions()) {\n // Wait for CSS transitions to complete before hiding the element.\n this.getRoot().one('transitionend webkitTransitionEnd oTransitionEnd', function() {\n this.getRoot().removeClass('show').addClass('hide');\n }.bind(this));\n } else {\n this.getRoot().removeClass('show').addClass('hide');\n }\n\n // Ensure the modal is moved onto the body node if it is still attached to the DOM.\n if ($(document.body).find(this.getRoot()).length) {\n $(document.body).append(this.getRoot());\n }\n\n this.root.trigger(ModalEvents.hidden, this);\n }.bind(this));\n };\n\n /**\n * Remove this modal from the DOM.\n *\n * @method destroy\n */\n Modal.prototype.destroy = function() {\n this.hide();\n this.root.remove();\n this.root.trigger(ModalEvents.destroyed, this);\n this.attachmentPoint.remove();\n };\n\n /**\n * Sets the appropriate aria attributes on this dialogue and the other\n * elements in the DOM to ensure that screen readers are able to navigate\n * the dialogue popup correctly.\n *\n * @method accessibilityShow\n */\n Modal.prototype.accessibilityShow = function() {\n // We need to get a list containing each sibling element and the shallowest\n // non-ancestral nodes in the DOM. We can shortcut this a little by leveraging\n // the fact that this dialogue is always appended to the document body therefore\n // it's siblings are the shallowest non-ancestral nodes. If that changes then\n // this code should also be updated.\n $('body').children().each(function(index, child) {\n // Skip the current modal.\n if (!this.root.is(child)) {\n child = $(child);\n var hidden = child.attr('aria-hidden');\n // If they are already hidden we can ignore them.\n if (hidden !== 'true') {\n // Save their current state.\n child.data('previous-aria-hidden', hidden);\n this.hiddenSiblings.push(child);\n\n // Hide this node from screen readers.\n child.attr('aria-hidden', 'true');\n }\n }\n }.bind(this));\n\n // Make us visible to screen readers.\n this.root.attr('aria-hidden', 'false');\n };\n\n /**\n * Restores the aria visibility on the DOM elements changed when displaying\n * the dialogue popup and makes the dialogue aria hidden to allow screen\n * readers to navigate the main page correctly when the dialogue is closed.\n *\n * @method accessibilityHide\n */\n Modal.prototype.accessibilityHide = function() {\n this.root.attr('aria-hidden', 'true');\n\n // Restore the sibling nodes back to their original values.\n $.each(this.hiddenSiblings, function(index, sibling) {\n sibling = $(sibling);\n var previousValue = sibling.data('previous-aria-hidden');\n // If the element didn't previously have an aria-hidden attribute\n // then we can just remove the one we set.\n if (typeof previousValue == 'undefined') {\n sibling.removeAttr('aria-hidden');\n } else {\n // Otherwise set it back to the old value (which will be false).\n sibling.attr('aria-hidden', previousValue);\n }\n });\n\n // Clear the cache. No longer need to store these.\n this.hiddenSiblings = [];\n };\n\n /**\n * Set up all of the event handling for the modal.\n *\n * @method registerEventListeners\n */\n Modal.prototype.registerEventListeners = function() {\n this.getRoot().on('keydown', function(e) {\n if (!this.isVisible()) {\n return;\n }\n\n if (e.keyCode == KeyCodes.escape) {\n if (this.removeOnClose) {\n this.destroy();\n } else {\n this.hide();\n }\n }\n }.bind(this));\n\n // Listen for clicks on the modal container.\n this.getRoot().click(function(e) {\n // If the click wasn't inside the modal element then we should\n // hide the modal.\n if (!$(e.target).closest(SELECTORS.MODAL).length) {\n // The check above fails to detect the click was inside the modal when the DOM tree is already changed.\n // So, we check if we can still find the container element or not. If not, then the DOM tree is changed.\n // It's best not to hide the modal in that case.\n if ($(e.target).closest(SELECTORS.CONTAINER).length) {\n this.hideIfNotForm();\n }\n }\n }.bind(this));\n\n CustomEvents.define(this.getModal(), [CustomEvents.events.activate]);\n this.getModal().on(CustomEvents.events.activate, SELECTORS.HIDE, function(e, data) {\n this.hide();\n data.originalEvent.preventDefault();\n }.bind(this));\n };\n\n /**\n * Register a listener to close the dialogue when the cancel button is pressed.\n *\n * @method registerCloseOnCancel\n */\n Modal.prototype.registerCloseOnCancel = function() {\n // Handle the clicking of the Cancel button.\n this.getModal().on(CustomEvents.events.activate, this.getActionSelector('cancel'), function(e, data) {\n var cancelEvent = $.Event(ModalEvents.cancel);\n this.getRoot().trigger(cancelEvent, this);\n\n if (!cancelEvent.isDefaultPrevented()) {\n data.originalEvent.preventDefault();\n\n if (this.removeOnClose) {\n this.destroy();\n } else {\n this.hide();\n }\n }\n }.bind(this));\n };\n\n /**\n * Register a listener to close the dialogue when the save button is pressed.\n *\n * @method registerCloseOnSave\n */\n Modal.prototype.registerCloseOnSave = function() {\n // Handle the clicking of the Cancel button.\n this.getModal().on(CustomEvents.events.activate, this.getActionSelector('save'), function(e, data) {\n var saveEvent = $.Event(ModalEvents.save);\n this.getRoot().trigger(saveEvent, this);\n\n if (!saveEvent.isDefaultPrevented()) {\n data.originalEvent.preventDefault();\n\n if (this.removeOnClose) {\n this.destroy();\n } else {\n this.hide();\n }\n }\n }.bind(this));\n };\n\n /**\n * Set or resolve and set the value using the function.\n *\n * @method asyncSet\n * @param {(string|object)} value The string or jQuery promise.\n * @param {function} setFunction The setter\n * @return {Promise}\n */\n Modal.prototype.asyncSet = function(value, setFunction) {\n var p = value;\n if (typeof value !== 'object' || !value.hasOwnProperty('then')) {\n p = $.Deferred();\n p.resolve(value);\n }\n\n p.then(function(content) {\n setFunction(content);\n\n return;\n })\n .fail(Notification.exception);\n\n return p;\n };\n\n /**\n * Set the title text of a button.\n *\n * This method is overloaded to take either a string value for the button title or a jQuery promise that is resolved with\n * text most commonly from a Str.get_string call.\n *\n * @param {DOMString} action The action of the button\n * @param {(String|object)} value The button text, or a promise which will resolve to it\n * @returns {Promise}\n */\n Modal.prototype.setButtonText = function(action, value) {\n const button = this.getFooter().find(this.getActionSelector(action));\n\n if (!button) {\n throw new Error(\"Unable to find the '\" + action + \"' button\");\n }\n\n return this.asyncSet(value, button.text.bind(button));\n };\n\n /**\n * Get the Selector for an action.\n *\n * @param {String} action\n * @returns {DOMString}\n */\n Modal.prototype.getActionSelector = function(action) {\n return \"[data-action='\" + action + \"']\";\n };\n\n /**\n * Set the flag to remove the modal from the DOM on close.\n *\n * @param {Boolean} remove\n */\n Modal.prototype.setRemoveOnClose = function(remove) {\n this.removeOnClose = remove;\n };\n\n return Modal;\n});\n"],"file":"modal.min.js"} \ No newline at end of file diff --git a/lib/amd/build/modal_cancel.min.js b/lib/amd/build/modal_cancel.min.js index c064af598bf..9c710830a1f 100644 --- a/lib/amd/build/modal_cancel.min.js +++ b/lib/amd/build/modal_cancel.min.js @@ -1,2 +1,2 @@ -define ("core/modal_cancel",["exports","core/modal"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);function c(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){c=function(a){return typeof a}}else{c=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return c(a)}function d(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function e(a,b){for(var c=0,d;carguments.length?a:c)}return e.value}}return f.apply(this,arguments)}function g(a,b){while(!Object.prototype.hasOwnProperty.call(a,b)){a=n(a);if(null===a)break}return a}function h(a,b){if("function"!=typeof b&&null!==b){throw new TypeError("Super expression must either be null or a function")}a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}});Object.defineProperty(a,"prototype",{writable:!1});if(b)i(a,b)}function i(a,b){i=Object.setPrototypeOf||function(a,b){a.__proto__=b;return a};return i(a,b)}function j(a){var b=m();return function(){var c=n(a),d;if(b){var e=n(this).constructor;d=Reflect.construct(c,arguments,e)}else{d=c.apply(this,arguments)}return k(this,d)}}function k(a,b){if(b&&("object"===_typeof(b)||"function"==typeof b)){return b}else if(void 0!==b){throw new TypeError("Derived constructors may only return object or undefined")}return l(a)}function l(a){if(void 0===a){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return a}function m(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return!0}catch(a){return!1}}function n(a){n=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)};return n(a)}var o=function(a){h(d,a);var b=j(d);function d(a){var e;c(this,d);e=b.call(this,a);if(!e.getFooter().find(e.getActionSelector("cancel")).length){Notification.exception({message:"No cancel button found"})}return e}e(d,[{key:"registerEventListeners",value:function registerEventListeners(){f(n(d.prototype),"registerEventListeners",this).call(this);this.registerCloseOnCancel()}}]);return d}(b.default);a.default=o;return a.default}); //# sourceMappingURL=modal_cancel.min.js.map diff --git a/lib/amd/build/modal_cancel.min.js.map b/lib/amd/build/modal_cancel.min.js.map index 5af7d5e6183..d2bc14c2999 100644 --- a/lib/amd/build/modal_cancel.min.js.map +++ b/lib/amd/build/modal_cancel.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/modal_cancel.js"],"names":["root","getFooter","find","getActionSelector","length","Notification","exception","message","registerCloseOnCancel","Modal"],"mappings":"kJAwBA,uD,++DAGI,WAAYA,CAAZ,CAAkB,iBACd,cAAMA,CAAN,EAEA,GAAI,CAAC,EAAKC,SAAL,GAAiBC,IAAjB,CAAsB,EAAKC,iBAAL,CAAuB,QAAvB,CAAtB,EAAwDC,MAA7D,CAAqE,CACjEC,YAAY,CAACC,SAAb,CAAuB,CAACC,OAAO,CAAE,wBAAV,CAAvB,CACH,CALa,QAMjB,C,0EAKwB,CAErB,2DAGA,KAAKC,qBAAL,EACH,C,cAlBwBC,S","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Contain the logic for the cancel modal.\n *\n * @module core/modal_cancel\n * @class modal_cancel\n * @package core\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport Modal from 'core/modal';\n\nexport default class extends Modal {\n constructor(root) {\n super(root);\n\n if (!this.getFooter().find(this.getActionSelector('cancel')).length) {\n Notification.exception({message: 'No cancel button found'});\n }\n }\n\n /**\n * Register all event listeners.\n */\n registerEventListeners() {\n // Call the parent registration.\n super.registerEventListeners();\n\n // Register to close on cancel.\n this.registerCloseOnCancel();\n }\n}\n"],"file":"modal_cancel.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/modal_cancel.js"],"names":["root","getFooter","find","getActionSelector","length","Notification","exception","message","registerCloseOnCancel","Modal"],"mappings":"oaAwBA,uD,69DAGI,WAAYA,CAAZ,CAAkB,iBACd,cAAMA,CAAN,EAEA,GAAI,CAAC,EAAKC,SAAL,GAAiBC,IAAjB,CAAsB,EAAKC,iBAAL,CAAuB,QAAvB,CAAtB,EAAwDC,MAA7D,CAAqE,CACjEC,YAAY,CAACC,SAAb,CAAuB,CAACC,OAAO,CAAE,wBAAV,CAAvB,CACH,CALa,QAMjB,C,yCAKD,iCAAyB,CAErB,2DAGA,KAAKC,qBAAL,EACH,C,cAlBwBC,S","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Contain the logic for the cancel modal.\n *\n * @module core/modal_cancel\n * @class modal_cancel\n * @package core\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport Modal from 'core/modal';\n\nexport default class extends Modal {\n constructor(root) {\n super(root);\n\n if (!this.getFooter().find(this.getActionSelector('cancel')).length) {\n Notification.exception({message: 'No cancel button found'});\n }\n }\n\n /**\n * Register all event listeners.\n */\n registerEventListeners() {\n // Call the parent registration.\n super.registerEventListeners();\n\n // Register to close on cancel.\n this.registerCloseOnCancel();\n }\n}\n"],"file":"modal_cancel.min.js"} \ No newline at end of file diff --git a/lib/amd/build/modal_factory.min.js b/lib/amd/build/modal_factory.min.js index 00c5ea4a976..9148d7108c1 100644 --- a/lib/amd/build/modal_factory.min.js +++ b/lib/amd/build/modal_factory.min.js @@ -1,2 +1,2 @@ -function _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_unsupportedIterableToArray(a,b)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(a,b){if(!a)return;if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);if("Object"===c&&a.constructor)c=a.constructor.name;if("Map"===c||"Set"===c)return Array.from(c);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return _arrayLikeToArray(a,b)}function _arrayLikeToArray(a,b){if(null==b||b>a.length)b=a.length;for(var c=0,d=Array(b);ca.length)b=a.length;for(var c=0,d=Array(b);c.\n\n/**\n * Create a modal.\n *\n * @module core/modal_factory\n * @class modal_factory\n * @package core\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/modal_events', 'core/modal_registry', 'core/modal',\n 'core/modal_save_cancel', 'core/modal_cancel', 'core/local/modal/alert',\n 'core/templates', 'core/notification', 'core/custom_interaction_events',\n 'core/pending'],\n function($, ModalEvents, ModalRegistry, Modal, ModalSaveCancel,\n ModalCancel, ModalAlert, Templates, Notification, CustomEvents, Pending) {\n\n // The templates for each type of modal.\n var TEMPLATES = {\n DEFAULT: 'core/modal',\n SAVE_CANCEL: 'core/modal_save_cancel',\n CANCEL: 'core/modal_cancel',\n ALERT: 'core/local/modal/alert',\n };\n\n // The available types of modals.\n var TYPES = {\n DEFAULT: 'DEFAULT',\n SAVE_CANCEL: 'SAVE_CANCEL',\n CANCEL: 'CANCEL',\n ALERT: 'ALERT',\n };\n\n // Register the common set of modals.\n ModalRegistry.register(TYPES.DEFAULT, Modal, TEMPLATES.DEFAULT);\n ModalRegistry.register(TYPES.SAVE_CANCEL, ModalSaveCancel, TEMPLATES.SAVE_CANCEL);\n ModalRegistry.register(TYPES.CANCEL, ModalCancel, TEMPLATES.CANCEL);\n ModalRegistry.register(TYPES.ALERT, ModalAlert, TEMPLATES.ALERT);\n\n /**\n * Set up the events required to show the modal and return focus when the modal\n * is closed.\n *\n * @method setUpTrigger\n * @param {Promise} modalPromise The modal instance\n * @param {object} triggerElement The jQuery element to open the modal\n * @param {object} modalConfig The modal configuration given to the factory\n */\n var setUpTrigger = function(modalPromise, triggerElement, modalConfig) {\n // The element that actually shows the modal.\n var actualTriggerElement = null;\n // Check if the client has provided a callback function to be called\n // before the modal is displayed.\n var hasPreShowCallback = (typeof modalConfig.preShowCallback == 'function');\n // Function to handle the trigger element being activated.\n var triggeredCallback = function(e, data) {\n var pendingPromise = new Pending('core/modal_factory:setUpTrigger:triggeredCallback');\n actualTriggerElement = $(e.currentTarget);\n modalPromise.then(function(modal) {\n if (hasPreShowCallback) {\n // If the client provided a pre-show callback then execute\n // it now before showing the modal.\n modalConfig.preShowCallback(actualTriggerElement, modal);\n }\n\n modal.show();\n\n return modal;\n })\n .then(pendingPromise.resolve);\n data.originalEvent.preventDefault();\n };\n\n // The trigger element can either be a single element or it can be an\n // element + selector pair to create a delegated event handler to trigger\n // the modal.\n if (Array.isArray(triggerElement)) {\n var selector = triggerElement[1];\n triggerElement = triggerElement[0];\n\n CustomEvents.define(triggerElement, [CustomEvents.events.activate]);\n triggerElement.on(CustomEvents.events.activate, selector, triggeredCallback);\n } else {\n CustomEvents.define(triggerElement, [CustomEvents.events.activate]);\n triggerElement.on(CustomEvents.events.activate, triggeredCallback);\n }\n\n modalPromise.then(function(modal) {\n modal.getRoot().on(ModalEvents.hidden, function() {\n // Focus on the trigger element that actually launched the modal.\n if (actualTriggerElement !== null) {\n actualTriggerElement.focus();\n }\n });\n\n return modal;\n });\n };\n\n /**\n * Create the correct instance of a modal based on the givem type. Sets up\n * the trigger between the modal and the trigger element.\n *\n * @method createFromElement\n * @param {object} registryConf A config from the ModalRegistry\n * @param {object} modalElement The modal HTML jQuery object\n * @return {object} Modal instance\n */\n var createFromElement = function(registryConf, modalElement) {\n modalElement = $(modalElement);\n var module = registryConf.module;\n var modal = new module(modalElement);\n\n return modal;\n };\n\n /**\n * Create the correct modal instance for the given type, including loading\n * the correct template.\n *\n * @method createFromType\n * @param {object} registryConf A config from the ModalRegistry\n * @param {object} templateContext The context to render the template with\n * @return {promise} Resolved with a Modal instance\n */\n var createFromType = function(registryConf, templateContext) {\n var templateName = registryConf.template;\n\n var modalPromise = Templates.render(templateName, templateContext)\n .then(function(html) {\n var modalElement = $(html);\n return createFromElement(registryConf, modalElement);\n })\n .fail(Notification.exception);\n\n return modalPromise;\n };\n\n /**\n * Create a Modal instance.\n *\n * @method create\n * @param {object} modalConfig The configuration to create the modal instance\n * @param {object} triggerElement The trigger HTML jQuery object\n * @return {promise} Resolved with a Modal instance\n */\n var create = function(modalConfig, triggerElement) {\n var type = modalConfig.type || TYPES.DEFAULT;\n var isLarge = modalConfig.large ? true : false;\n var registryConf = null;\n var templateContext = {};\n\n registryConf = ModalRegistry.get(type);\n\n if (!registryConf) {\n Notification.exception({message: 'Unable to find modal of type: ' + type});\n }\n\n if (typeof modalConfig.templateContext != 'undefined') {\n templateContext = modalConfig.templateContext;\n }\n\n var modalPromise = createFromType(registryConf, templateContext)\n .then(function(modal) {\n if (typeof modalConfig.title != 'undefined') {\n modal.setTitle(modalConfig.title);\n }\n\n if (typeof modalConfig.body != 'undefined') {\n modal.setBody(modalConfig.body);\n }\n\n if (typeof modalConfig.footer != 'undefined') {\n modal.setFooter(modalConfig.footer);\n }\n\n if (modalConfig.buttons) {\n Object.entries(modalConfig.buttons).forEach(function([key, value]) {\n modal.setButtonText(key, value);\n });\n }\n\n if (isLarge) {\n modal.setLarge();\n }\n\n if (typeof modalConfig.removeOnClose !== 'undefined') {\n // If configured remove the modal when hiding it.\n modal.setRemoveOnClose(modalConfig.removeOnClose);\n }\n\n return modal;\n });\n\n if (typeof triggerElement != 'undefined') {\n setUpTrigger(modalPromise, triggerElement, modalConfig);\n }\n\n return modalPromise;\n };\n\n return {\n create: create,\n types: TYPES,\n };\n});\n"],"file":"modal_factory.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/modal_factory.js"],"names":["define","$","ModalEvents","ModalRegistry","Modal","ModalSaveCancel","ModalCancel","ModalAlert","Templates","Notification","CustomEvents","Pending","TEMPLATES","DEFAULT","SAVE_CANCEL","CANCEL","ALERT","TYPES","register","setUpTrigger","modalPromise","triggerElement","modalConfig","actualTriggerElement","hasPreShowCallback","preShowCallback","triggeredCallback","e","data","pendingPromise","currentTarget","then","modal","show","resolve","originalEvent","preventDefault","Array","isArray","selector","events","activate","on","getRoot","hidden","focus","createFromElement","registryConf","modalElement","module","createFromType","templateContext","templateName","template","render","html","fail","exception","create","type","isLarge","large","get","message","title","setTitle","body","setBody","footer","setFooter","buttons","Object","entries","forEach","key","value","setButtonText","setLarge","removeOnClose","setRemoveOnClose","types"],"mappings":"wrCAwBAA,OAAM,sBAAC,CAAC,QAAD,CAAW,mBAAX,CAAgC,qBAAhC,CAAuD,YAAvD,CACC,wBADD,CAC2B,mBAD3B,CACgD,wBADhD,CAEC,gBAFD,CAEmB,mBAFnB,CAEwC,gCAFxC,CAGC,cAHD,CAAD,CAIF,SAASC,CAAT,CAAYC,CAAZ,CAAyBC,CAAzB,CAAwCC,CAAxC,CAA+CC,CAA/C,CACIC,CADJ,CACiBC,CADjB,CAC6BC,CAD7B,CACwCC,CADxC,CACsDC,CADtD,CACoEC,CADpE,CAC6E,IAGzEC,CAAAA,CAAS,CAAG,CACZC,OAAO,CAAE,YADG,CAEZC,WAAW,CAAE,wBAFD,CAGZC,MAAM,CAAE,mBAHI,CAIZC,KAAK,CAAE,wBAJK,CAH6D,CAWzEC,CAAK,CAAG,CACRJ,OAAO,CAAE,SADD,CAERC,WAAW,CAAE,aAFL,CAGRC,MAAM,CAAE,QAHA,CAIRC,KAAK,CAAE,OAJC,CAXiE,CAmB7Eb,CAAa,CAACe,QAAd,CAAuBD,CAAK,CAACJ,OAA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WAAuB,2BAAbC,CAAa,MAARC,CAAQ,MAC/D3C,CAAK,CAAC4C,aAAN,CAAoBF,CAApB,CAAyBC,CAAzB,CACH,CAFD,CAGH,CAED,GAAIf,CAAJ,CAAa,CACT5B,CAAK,CAAC6C,QAAN,EACH,CAED,GAAyC,WAArC,QAAOvD,CAAAA,CAAW,CAACwD,aAAvB,CAAsD,CAElD9C,CAAK,CAAC+C,gBAAN,CAAuBzD,CAAW,CAACwD,aAAnC,CACH,CAED,MAAO9C,CAAAA,CACV,CA9Bc,CAAnB,CAgCA,GAA6B,WAAzB,QAAOX,CAAAA,CAAX,CAA0C,CACtCF,CAAY,CAACC,CAAD,CAAeC,CAAf,CAA+BC,CAA/B,CACf,CAED,MAAOF,CAAAA,CACV,CAEM,CAEH4D,KAAK,CAAE/D,CAFJ,CAIV,CAnMK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Create a modal.\n *\n * @module core/modal_factory\n * @class modal_factory\n * @package core\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/modal_events', 'core/modal_registry', 'core/modal',\n 'core/modal_save_cancel', 'core/modal_cancel', 'core/local/modal/alert',\n 'core/templates', 'core/notification', 'core/custom_interaction_events',\n 'core/pending'],\n function($, ModalEvents, ModalRegistry, Modal, ModalSaveCancel,\n ModalCancel, ModalAlert, Templates, Notification, CustomEvents, Pending) {\n\n // The templates for each type of modal.\n var TEMPLATES = {\n DEFAULT: 'core/modal',\n SAVE_CANCEL: 'core/modal_save_cancel',\n CANCEL: 'core/modal_cancel',\n ALERT: 'core/local/modal/alert',\n };\n\n // The available types of modals.\n var TYPES = {\n DEFAULT: 'DEFAULT',\n SAVE_CANCEL: 'SAVE_CANCEL',\n CANCEL: 'CANCEL',\n ALERT: 'ALERT',\n };\n\n // Register the common set of modals.\n ModalRegistry.register(TYPES.DEFAULT, Modal, TEMPLATES.DEFAULT);\n ModalRegistry.register(TYPES.SAVE_CANCEL, ModalSaveCancel, TEMPLATES.SAVE_CANCEL);\n ModalRegistry.register(TYPES.CANCEL, ModalCancel, TEMPLATES.CANCEL);\n ModalRegistry.register(TYPES.ALERT, ModalAlert, TEMPLATES.ALERT);\n\n /**\n * Set up the events required to show the modal and return focus when the modal\n * is closed.\n *\n * @method setUpTrigger\n * @param {Promise} modalPromise The modal instance\n * @param {object} triggerElement The jQuery element to open the modal\n * @param {object} modalConfig The modal configuration given to the factory\n */\n var setUpTrigger = function(modalPromise, triggerElement, modalConfig) {\n // The element that actually shows the modal.\n var actualTriggerElement = null;\n // Check if the client has provided a callback function to be called\n // before the modal is displayed.\n var hasPreShowCallback = (typeof modalConfig.preShowCallback == 'function');\n // Function to handle the trigger element being activated.\n var triggeredCallback = function(e, data) {\n var pendingPromise = new Pending('core/modal_factory:setUpTrigger:triggeredCallback');\n actualTriggerElement = $(e.currentTarget);\n modalPromise.then(function(modal) {\n if (hasPreShowCallback) {\n // If the client provided a pre-show callback then execute\n // it now before showing the modal.\n modalConfig.preShowCallback(actualTriggerElement, modal);\n }\n\n modal.show();\n\n return modal;\n })\n .then(pendingPromise.resolve);\n data.originalEvent.preventDefault();\n };\n\n // The trigger element can either be a single element or it can be an\n // element + selector pair to create a delegated event handler to trigger\n // the modal.\n if (Array.isArray(triggerElement)) {\n var selector = triggerElement[1];\n triggerElement = triggerElement[0];\n\n CustomEvents.define(triggerElement, [CustomEvents.events.activate]);\n triggerElement.on(CustomEvents.events.activate, selector, triggeredCallback);\n } else {\n CustomEvents.define(triggerElement, [CustomEvents.events.activate]);\n triggerElement.on(CustomEvents.events.activate, triggeredCallback);\n }\n\n modalPromise.then(function(modal) {\n modal.getRoot().on(ModalEvents.hidden, function() {\n // Focus on the trigger element that actually launched the modal.\n if (actualTriggerElement !== null) {\n actualTriggerElement.focus();\n }\n });\n\n return modal;\n });\n };\n\n /**\n * Create the correct instance of a modal based on the givem type. Sets up\n * the trigger between the modal and the trigger element.\n *\n * @method createFromElement\n * @param {object} registryConf A config from the ModalRegistry\n * @param {object} modalElement The modal HTML jQuery object\n * @return {object} Modal instance\n */\n var createFromElement = function(registryConf, modalElement) {\n modalElement = $(modalElement);\n var module = registryConf.module;\n var modal = new module(modalElement);\n\n return modal;\n };\n\n /**\n * Create the correct modal instance for the given type, including loading\n * the correct template.\n *\n * @method createFromType\n * @param {object} registryConf A config from the ModalRegistry\n * @param {object} templateContext The context to render the template with\n * @return {promise} Resolved with a Modal instance\n */\n var createFromType = function(registryConf, templateContext) {\n var templateName = registryConf.template;\n\n var modalPromise = Templates.render(templateName, templateContext)\n .then(function(html) {\n var modalElement = $(html);\n return createFromElement(registryConf, modalElement);\n })\n .fail(Notification.exception);\n\n return modalPromise;\n };\n\n /**\n * Create a Modal instance.\n *\n * @method create\n * @param {object} modalConfig The configuration to create the modal instance\n * @param {object} triggerElement The trigger HTML jQuery object\n * @return {promise} Resolved with a Modal instance\n */\n var create = function(modalConfig, triggerElement) {\n var type = modalConfig.type || TYPES.DEFAULT;\n var isLarge = modalConfig.large ? true : false;\n var registryConf = null;\n var templateContext = {};\n\n registryConf = ModalRegistry.get(type);\n\n if (!registryConf) {\n Notification.exception({message: 'Unable to find modal of type: ' + type});\n }\n\n if (typeof modalConfig.templateContext != 'undefined') {\n templateContext = modalConfig.templateContext;\n }\n\n var modalPromise = createFromType(registryConf, templateContext)\n .then(function(modal) {\n if (typeof modalConfig.title != 'undefined') {\n modal.setTitle(modalConfig.title);\n }\n\n if (typeof modalConfig.body != 'undefined') {\n modal.setBody(modalConfig.body);\n }\n\n if (typeof modalConfig.footer != 'undefined') {\n modal.setFooter(modalConfig.footer);\n }\n\n if (modalConfig.buttons) {\n Object.entries(modalConfig.buttons).forEach(function([key, value]) {\n modal.setButtonText(key, value);\n });\n }\n\n if (isLarge) {\n modal.setLarge();\n }\n\n if (typeof modalConfig.removeOnClose !== 'undefined') {\n // If configured remove the modal when hiding it.\n modal.setRemoveOnClose(modalConfig.removeOnClose);\n }\n\n return modal;\n });\n\n if (typeof triggerElement != 'undefined') {\n setUpTrigger(modalPromise, triggerElement, modalConfig);\n }\n\n return modalPromise;\n };\n\n return {\n create: create,\n types: TYPES,\n };\n});\n"],"file":"modal_factory.min.js"} \ No newline at end of file diff --git a/lib/amd/build/modal_save_cancel.min.js b/lib/amd/build/modal_save_cancel.min.js index 4ec033d7ae3..e1db4198975 100644 --- a/lib/amd/build/modal_save_cancel.min.js +++ b/lib/amd/build/modal_save_cancel.min.js @@ -1,2 +1,2 @@ -define ("core/modal_save_cancel",["exports","core/modal"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);function c(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){c=function(a){return typeof a}}else{c=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return c(a)}function d(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}function e(a,b){for(var c=0,d;carguments.length?a:c)}return e.value}}return f.apply(this,arguments)}function g(a,b){while(!Object.prototype.hasOwnProperty.call(a,b)){a=n(a);if(null===a)break}return a}function h(a,b){if("function"!=typeof b&&null!==b){throw new TypeError("Super expression must either be null or a function")}a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}});Object.defineProperty(a,"prototype",{writable:!1});if(b)i(a,b)}function i(a,b){i=Object.setPrototypeOf||function(a,b){a.__proto__=b;return a};return i(a,b)}function j(a){var b=m();return function(){var c=n(a),d;if(b){var e=n(this).constructor;d=Reflect.construct(c,arguments,e)}else{d=c.apply(this,arguments)}return k(this,d)}}function k(a,b){if(b&&("object"===_typeof(b)||"function"==typeof b)){return b}else if(void 0!==b){throw new TypeError("Derived constructors may only return object or undefined")}return l(a)}function l(a){if(void 0===a){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return a}function m(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return!0}catch(a){return!1}}function n(a){n=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)};return n(a)}var o=function(a){h(d,a);var b=j(d);function d(a){var e;c(this,d);e=b.call(this,a);if(!e.getFooter().find(e.getActionSelector("save")).length){Notification.exception({message:"No save button found"})}if(!e.getFooter().find(e.getActionSelector("cancel")).length){Notification.exception({message:"No cancel button found"})}return e}e(d,[{key:"registerEventListeners",value:function registerEventListeners(){f(n(d.prototype),"registerEventListeners",this).call(this);this.registerCloseOnSave();this.registerCloseOnCancel()}},{key:"setFooter",value:function setFooter(){Notification.exception({message:"Can not change the footer of a save cancel modal"})}},{key:"setSaveButtonText",value:function setSaveButtonText(a){return this.setButtonText("save",a)}}]);return d}(b.default);a.default=o;return a.default}); //# sourceMappingURL=modal_save_cancel.min.js.map diff --git a/lib/amd/build/modal_save_cancel.min.js.map b/lib/amd/build/modal_save_cancel.min.js.map index 252a2e892e7..3019ca3f0eb 100644 --- a/lib/amd/build/modal_save_cancel.min.js.map +++ b/lib/amd/build/modal_save_cancel.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/modal_save_cancel.js"],"names":["root","getFooter","find","getActionSelector","length","Notification","exception","message","registerCloseOnSave","registerCloseOnCancel","value","setButtonText","Modal"],"mappings":"uJAwBA,uD,++DAGI,WAAYA,CAAZ,CAAkB,iBACd,cAAMA,CAAN,EAEA,GAAI,CAAC,EAAKC,SAAL,GAAiBC,IAAjB,CAAsB,EAAKC,iBAAL,CAAuB,MAAvB,CAAtB,EAAsDC,MAA3D,CAAmE,CAC/DC,YAAY,CAACC,SAAb,CAAuB,CAACC,OAAO,CAAE,sBAAV,CAAvB,CACH,CAED,GAAI,CAAC,EAAKN,SAAL,GAAiBC,IAAjB,CAAsB,EAAKC,iBAAL,CAAuB,QAAvB,CAAtB,EAAwDC,MAA7D,CAAqE,CACjEC,YAAY,CAACC,SAAb,CAAuB,CAACC,OAAO,CAAE,wBAAV,CAAvB,CACH,CATa,QAUjB,C,0EAKwB,CAErB,2DAGA,KAAKC,mBAAL,GACA,KAAKC,qBAAL,EACH,C,6CAKW,CACRJ,YAAY,CAACC,SAAb,CAAuB,CAACC,OAAO,CAAE,kDAAV,CAAvB,CAEH,C,4DAQiBG,C,CAAO,CACrB,MAAO,MAAKC,aAAL,CAAmB,MAAnB,CAA2BD,CAA3B,CACV,C,cAzCwBE,S","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Contain the logic for the save/cancel modal.\n *\n * @module core/modal_save_cancel\n * @class modal_save_cancel\n * @package core\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport Modal from 'core/modal';\n\nexport default class extends Modal {\n constructor(root) {\n super(root);\n\n if (!this.getFooter().find(this.getActionSelector('save')).length) {\n Notification.exception({message: 'No save button found'});\n }\n\n if (!this.getFooter().find(this.getActionSelector('cancel')).length) {\n Notification.exception({message: 'No cancel button found'});\n }\n }\n\n /**\n * Register all event listeners.\n */\n registerEventListeners() {\n // Call the parent registration.\n super.registerEventListeners();\n\n // Register to close on save/cancel.\n this.registerCloseOnSave();\n this.registerCloseOnCancel();\n }\n\n /**\n * Override parent implementation to prevent changing the footer content.\n */\n setFooter() {\n Notification.exception({message: 'Can not change the footer of a save cancel modal'});\n return;\n }\n\n /**\n * Set the title of the save button.\n *\n * @param {String|Promise} value The button text, or a Promise which will resolve it\n * @returns{Promise}\n */\n setSaveButtonText(value) {\n return this.setButtonText('save', value);\n }\n}\n"],"file":"modal_save_cancel.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/modal_save_cancel.js"],"names":["root","getFooter","find","getActionSelector","length","Notification","exception","message","registerCloseOnSave","registerCloseOnCancel","value","setButtonText","Modal"],"mappings":"yaAwBA,uD,69DAGI,WAAYA,CAAZ,CAAkB,iBACd,cAAMA,CAAN,EAEA,GAAI,CAAC,EAAKC,SAAL,GAAiBC,IAAjB,CAAsB,EAAKC,iBAAL,CAAuB,MAAvB,CAAtB,EAAsDC,MAA3D,CAAmE,CAC/DC,YAAY,CAACC,SAAb,CAAuB,CAACC,OAAO,CAAE,sBAAV,CAAvB,CACH,CAED,GAAI,CAAC,EAAKN,SAAL,GAAiBC,IAAjB,CAAsB,EAAKC,iBAAL,CAAuB,QAAvB,CAAtB,EAAwDC,MAA7D,CAAqE,CACjEC,YAAY,CAACC,SAAb,CAAuB,CAACC,OAAO,CAAE,wBAAV,CAAvB,CACH,CATa,QAUjB,C,yCAKD,iCAAyB,CAErB,2DAGA,KAAKC,mBAAL,GACA,KAAKC,qBAAL,EACH,C,yBAKD,oBAAY,CACRJ,YAAY,CAACC,SAAb,CAAuB,CAACC,OAAO,CAAE,kDAAV,CAAvB,CAEH,C,iCAQD,2BAAkBG,CAAlB,CAAyB,CACrB,MAAO,MAAKC,aAAL,CAAmB,MAAnB,CAA2BD,CAA3B,CACV,C,cAzCwBE,S","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Contain the logic for the save/cancel modal.\n *\n * @module core/modal_save_cancel\n * @class modal_save_cancel\n * @package core\n * @copyright 2016 Ryan Wyllie \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport Modal from 'core/modal';\n\nexport default class extends Modal {\n constructor(root) {\n super(root);\n\n if (!this.getFooter().find(this.getActionSelector('save')).length) {\n Notification.exception({message: 'No save button found'});\n }\n\n if (!this.getFooter().find(this.getActionSelector('cancel')).length) {\n Notification.exception({message: 'No cancel button found'});\n }\n }\n\n /**\n * Register all event listeners.\n */\n registerEventListeners() {\n // Call the parent registration.\n super.registerEventListeners();\n\n // Register to close on save/cancel.\n this.registerCloseOnSave();\n this.registerCloseOnCancel();\n }\n\n /**\n * Override parent implementation to prevent changing the footer content.\n */\n setFooter() {\n Notification.exception({message: 'Can not change the footer of a save cancel modal'});\n return;\n }\n\n /**\n * Set the title of the save button.\n *\n * @param {String|Promise} value The button text, or a Promise which will resolve it\n * @returns{Promise}\n */\n setSaveButtonText(value) {\n return this.setButtonText('save', value);\n }\n}\n"],"file":"modal_save_cancel.min.js"} \ No newline at end of file diff --git a/lib/amd/build/mustache.min.js b/lib/amd/build/mustache.min.js index e08e3b7dbe9..8f3a222dd93 100644 --- a/lib/amd/build/mustache.min.js +++ b/lib/amd/build/mustache.min.js @@ -1,2 +1,2 @@ -function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}(function(a,b){if("object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&exports&&"string"!=typeof exports.nodeName){b(exports)}else if("function"==typeof define&&define.amd){define ("core/mustache",["exports"],b)}else{a.Mustache={};b(a.Mustache)}})(this,function(a){var o=Object.prototype.toString,p=Array.isArray||function(a){return"[object Array]"===o.call(a)};function b(a){return"function"==typeof a}function c(a){return p(a)?"array":_typeof(a)}function d(a){return a.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function e(a,b){return null!=a&&"object"===_typeof(a)&&b in a}function f(a,b){return null!=a&&"object"!==_typeof(a)&&a.hasOwnProperty&&a.hasOwnProperty(b)}var q=RegExp.prototype.test;function g(a,b){return q.call(a,b)}function h(a){return!g(/\S/,a)}var r={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};var s=/\s*=/;function i(b,c){if(!b)return[];var g=!1,m=[],n=[],o=[],q=!1,r=!1,t="",u=0;function e(){if(q&&!r){while(o.length){delete n[o.pop()]}}else{o=[]}q=!1;r=!1}var v,w,x;function f(a){if("string"==typeof a)a=a.split(/\s+/,2);if(!p(a)||2!==a.length)throw new Error("Invalid tags: "+a);v=new RegExp(d(a[0])+"\\s*");w=new RegExp("\\s*"+d(a[1]));x=new RegExp("\\s*"+d("}"+a[1]))}f(c||a.tags);var y=new l(b),z,A,B,C,D,E;while(!y.eos()){z=y.pos;B=y.scanUntil(v);if(B){for(var F=0,G=B.length;F|\{|&|=|!|\$|"==A){D=[A,B,z,y.pos,t,u,g]}else{D=[A,B,z,y.pos]}u++;n.push(D);if("#"===A||"^"===A||"$"===A||"<"===A){m.push(D)}else if("/"===A){E=m.pop();if(!E)throw new Error("Unopened section \""+B+"\" at "+z);if(E[1]!==B)throw new Error("Unclosed section \""+E[1]+"\" at "+z)}else if("name"===A||"{"===A||"&"===A){r=!0}else if("="===A){f(B)}}e();E=m.pop();if(E)throw new Error("Unclosed section \""+E[1]+"\" at "+y.pos);return k(j(n))}function j(a){for(var b=[],c,d,e=0,f=a.length;e"===h)j=this.renderPartial(g,b,c,e);else if("<"===h)j=this.renderBlock(g,b,c,d);else if("$"===h)j=this.renderBlockVariable(g,b,c,d);else if("&"===h)j=this.unescapedValue(g,b);else if("name"===h)j=this.escapedValue(g,b);else if("text"===h)j=this.rawValue(g);if(j!==void 0)f+=j}return f};n.prototype.renderSection=function(a,c,d,e){var g=this,h="",i=c.lookup(a[1]);function f(a){return g.render(a,c,d)}if(!i)return;if(p(i)){for(var k=0,l=i.length;k"'`=\/]/g,function(a){return r[a]})};a.Scanner=l;a.Context=m;a.Writer=n;return a}); +function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}(function(a,b){if("object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&exports&&"string"!=typeof exports.nodeName){b(exports)}else if("function"==typeof define&&define.amd){define ("core/mustache",["exports"],b)}else{a.Mustache={};b(a.Mustache)}})(this,function(a){var b=Object.prototype.toString,c=Array.isArray||function(a){return"[object Array]"===b.call(a)};function d(a){return"function"==typeof a}function e(a){return c(a)?"array":_typeof(a)}function f(a){return a.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function g(a,b){return null!=a&&"object"===_typeof(a)&&b in a}function h(a,b){return null!=a&&"object"!==_typeof(a)&&a.hasOwnProperty&&a.hasOwnProperty(b)}var i=RegExp.prototype.test;function j(a,b){return i.call(a,b)}function k(a){return!j(/\S/,a)}var l={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};var m=/\s*=/;function n(b,d){if(!b)return[];var e=!1,g=[],h=[],j=[],l=!1,n=!1,r="",s=0;function t(){if(l&&!n){while(j.length){delete h[j.pop()]}}else{j=[]}l=!1;n=!1}var u,v,w;function x(a){if("string"==typeof a)a=a.split(/\s+/,2);if(!c(a)||2!==a.length)throw new Error("Invalid tags: "+a);u=new RegExp(f(a[0])+"\\s*");v=new RegExp("\\s*"+f(a[1]));w=new RegExp("\\s*"+f("}"+a[1]))}x(d||a.tags);var y=new q(b),z,A,B,C,D,E;while(!y.eos()){z=y.pos;B=y.scanUntil(u);if(B){for(var F=0,G=B.length;F|\{|&|=|!|\$|"==A){D=[A,B,z,y.pos,r,s,e]}else{D=[A,B,z,y.pos]}s++;h.push(D);if("#"===A||"^"===A||"$"===A||"<"===A){g.push(D)}else if("/"===A){E=g.pop();if(!E)throw new Error("Unopened section \""+B+"\" at "+z);if(E[1]!==B)throw new Error("Unclosed section \""+E[1]+"\" at "+z)}else if("name"===A||"{"===A||"&"===A){n=!0}else if("="===A){x(B)}}t();E=g.pop();if(E)throw new Error("Unclosed section \""+E[1]+"\" at "+y.pos);return p(o(h))}function o(a){for(var b=[],c,d,e=0,f=a.length;e"===h)j=this.renderPartial(g,b,c,e);else if("<"===h)j=this.renderBlock(g,b,c,d);else if("$"===h)j=this.renderBlockVariable(g,b,c,d);else if("&"===h)j=this.unescapedValue(g,b);else if("name"===h)j=this.escapedValue(g,b);else if("text"===h)j=this.rawValue(g);if(j!==void 0)f+=j}return f};s.prototype.renderSection=function(a,b,e,f){var g=this,h="",i=b.lookup(a[1]);function k(a){return g.render(a,b,e)}if(!i)return;if(c(i)){for(var l=0,m=i.length;l"'`=\/]/g,function(a){return l[a]})};a.Scanner=q;a.Context=r;a.Writer=s;return a}); //# sourceMappingURL=mustache.min.js.map diff --git a/lib/amd/build/mustache.min.js.map b/lib/amd/build/mustache.min.js.map index 1e71760341b..bafa3d891af 100644 --- a/lib/amd/build/mustache.min.js.map +++ b/lib/amd/build/mustache.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/mustache.js"],"names":["global","factory","exports","nodeName","define","amd","Mustache","mustache","objectToString","Object","prototype","toString","isArray","Array","object","call","isFunction","typeStr","obj","escapeRegExp","string","replace","hasProperty","propName","primitiveHasOwnProperty","primitive","hasOwnProperty","regExpTest","RegExp","test","testRegExp","re","isWhitespace","entityMap","equalsRe","parseTemplate","template","tags","lineHasNonSpace","sections","tokens","spaces","hasTag","nonSpace","indentation","tagIndex","stripSpace","length","pop","openingTagRe","closingTagRe","closingCurlyRe","compileTags","tagsToCompile","split","Error","scanner","Scanner","start","type","value","chr","token","openSection","eos","pos","scanUntil","i","valueLength","charAt","push","scan","nestTokens","squashTokens","squashedTokens","lastToken","numTokens","nestedTokens","collector","section","tail","match","index","substring","search","Context","view","parentContext","blocks","cache","parent","setBlockVar","name","clearBlockVars","getBlockVar","lookup","context","intermediateValue","names","lookupHit","indexOf","Writer","clearCache","parse","cacheKey","join","render","partials","renderTokens","originalTemplate","buffer","symbol","renderSection","renderInverted","renderPartial","renderBlock","renderBlockVariable","unescapedValue","escapedValue","rawValue","self","subRender","j","slice","indentPartial","partial","filteredIndentation","partialByNl","indentedValue","result","exists","escape","version","defaultWriter","TypeError","to_html","send","s"],"mappings":"mSA0CC,UAAyBA,CAAzB,CAAiCC,CAAjC,CAA0C,CACzC,GAAuB,QAAnB,uBAAOC,CAAAA,OAAP,qBAAOA,OAAP,IAA+BA,OAA/B,EAAsE,QAA5B,QAAOA,CAAAA,OAAO,CAACC,QAA7D,CAAoF,CAClFF,CAAO,CAACC,OAAD,CACR,CAFD,IAEO,IAAsB,UAAlB,QAAOE,CAAAA,MAAP,EAAgCA,MAAM,CAACC,GAA3C,CAAgD,CACrDD,OAAM,iBAAC,CAAC,SAAD,CAAD,CAAcH,CAAd,CACP,CAFM,IAEA,CACLD,CAAM,CAACM,QAAP,CAAkB,EAAlB,CACAL,CAAO,CAACD,CAAM,CAACM,QAAR,CACR,CACF,CATA,EASC,IATD,CASO,SAA0BC,CAA1B,CAAoC,IAEtCC,CAAAA,CAAc,CAAGC,MAAM,CAACC,SAAP,CAAiBC,QAFI,CAGtCC,CA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,CAAC8E,OAAT,CAAmBA,CAAnB,CACA9E,CAAQ,CAAC8F,MAAT,CAAkBA,CAAlB,CAEA,MAAO9F,CAAAA,CACR,CA9wBA,CAAD","sourcesContent":["// The MIT License\n//\n// Copyright (c) 2009 Chris Wanstrath (Ruby)\n// Copyright (c) 2010-2014 Jan Lehnardt (JavaScript)\n// Copyright (c) 2010-2015 The mustache.js community\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n\n// Description of import into Moodle:\n// Checkout from https://github.com/moodle/custom-mustache.js Branch: LAMBDA_ARGS\n// Rebase onto latest release tag from https://github.com/janl/mustache.js\n// Copy mustache.js into lib/amd/src/ in Moodle folder.\n// Add the license as a comment to the file and these instructions.\n// Add jshint tags so this file is not linted.\n// Remove the \"global define:\" comment (hint for linter)\n// Make sure that you have not removed the custom code for '$' and '<'.\n\n/*!\n * mustache.js - Logic-less {{mustache}} templates with JavaScript\n * http://github.com/janl/mustache.js\n */\n\n/* jshint ignore:start */\n\n(function defineMustache (global, factory) {\n if (typeof exports === 'object' && exports && typeof exports.nodeName !== 'string') {\n factory(exports); // CommonJS\n } else if (typeof define === 'function' && define.amd) {\n define(['exports'], factory); // AMD\n } else {\n global.Mustache = {};\n factory(global.Mustache); // script, wsh, asp\n }\n}(this, function mustacheFactory (mustache) {\n\n var objectToString = Object.prototype.toString;\n var isArray = Array.isArray || function isArrayPolyfill (object) {\n return objectToString.call(object) === '[object Array]';\n };\n\n function isFunction (object) {\n return typeof object === 'function';\n }\n\n /**\n * More correct typeof string handling array\n * which normally returns typeof 'object'\n */\n function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }\n\n function escapeRegExp (string) {\n return string.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, '\\\\$&');\n }\n\n /**\n * Null safe way of checking whether or not an object,\n * including its prototype, has a given property\n */\n function hasProperty (obj, propName) {\n return obj != null && typeof obj === 'object' && (propName in obj);\n }\n\n /**\n * Safe way of detecting whether or not the given thing is a primitive and\n * whether it has the given property\n */\n function primitiveHasOwnProperty (primitive, propName) {\n return (\n primitive != null\n && typeof primitive !== 'object'\n && primitive.hasOwnProperty\n && primitive.hasOwnProperty(propName)\n );\n }\n\n // Workaround for https://issues.apache.org/jira/browse/COUCHDB-577\n // See https://github.com/janl/mustache.js/issues/189\n var regExpTest = RegExp.prototype.test;\n function testRegExp (re, string) {\n return regExpTest.call(re, string);\n }\n\n var nonSpaceRe = /\\S/;\n function isWhitespace (string) {\n return !testRegExp(nonSpaceRe, string);\n }\n\n var entityMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '/': '/',\n '`': '`',\n '=': '='\n };\n\n function escapeHtml (string) {\n return String(string).replace(/[&<>\"'`=\\/]/g, function fromEntityMap (s) {\n return entityMap[s];\n });\n }\n\n var whiteRe = /\\s*/;\n var spaceRe = /\\s+/;\n var equalsRe = /\\s*=/;\n var curlyRe = /\\s*\\}/;\n var tagRe = /#|\\^|\\/|>|\\{|&|=|!|\\$|\" ]). Of\n * course, the default is to use mustaches (i.e. mustache.tags).\n *\n * A token is an array with at least 4 elements. The first element is the\n * mustache symbol that was used inside the tag, e.g. \"#\" or \"&\". If the tag\n * did not contain a symbol (i.e. {{myValue}}) this element is \"name\". For\n * all text that appears outside a symbol this element is \"text\".\n *\n * The second element of a token is its \"value\". For mustache tags this is\n * whatever else was inside the tag besides the opening symbol. For text tokens\n * this is the text itself.\n *\n * The third and fourth elements of the token are the start and end indices,\n * respectively, of the token in the original template.\n *\n * Tokens that are the root node of a subtree contain two more elements: 1) an\n * array of tokens in the subtree and 2) the index in the original template at\n * which the closing tag for that section begins.\n *\n * Tokens for partials also contain two more elements: 1) a string value of\n * indendation prior to that tag and 2) the index of that tag on that line -\n * eg a value of 2 indicates the partial is the third tag on this line.\n */\n function parseTemplate (template, tags) {\n if (!template)\n return [];\n var lineHasNonSpace = false;\n var sections = []; // Stack to hold section tokens\n var tokens = []; // Buffer to hold the tokens\n var spaces = []; // Indices of whitespace tokens on the current line\n var hasTag = false; // Is there a {{tag}} on the current line?\n var nonSpace = false; // Is there a non-space char on the current line?\n var indentation = ''; // Tracks indentation for tags that use it\n var tagIndex = 0; // Stores a count of number of tags encountered on a line\n\n // Strips all whitespace tokens array for the current line\n // if there was a {{#tag}} on it and otherwise only space.\n function stripSpace () {\n if (hasTag && !nonSpace) {\n while (spaces.length)\n delete tokens[spaces.pop()];\n } else {\n spaces = [];\n }\n\n hasTag = false;\n nonSpace = false;\n }\n\n var openingTagRe, closingTagRe, closingCurlyRe;\n function compileTags (tagsToCompile) {\n if (typeof tagsToCompile === 'string')\n tagsToCompile = tagsToCompile.split(spaceRe, 2);\n\n if (!isArray(tagsToCompile) || tagsToCompile.length !== 2)\n throw new Error('Invalid tags: ' + tagsToCompile);\n\n openingTagRe = new RegExp(escapeRegExp(tagsToCompile[0]) + '\\\\s*');\n closingTagRe = new RegExp('\\\\s*' + escapeRegExp(tagsToCompile[1]));\n closingCurlyRe = new RegExp('\\\\s*' + escapeRegExp('}' + tagsToCompile[1]));\n }\n\n compileTags(tags || mustache.tags);\n\n var scanner = new Scanner(template);\n\n var start, type, value, chr, token, openSection;\n while (!scanner.eos()) {\n start = scanner.pos;\n\n // Match any text between tags.\n value = scanner.scanUntil(openingTagRe);\n\n if (value) {\n for (var i = 0, valueLength = value.length; i < valueLength; ++i) {\n chr = value.charAt(i);\n\n if (isWhitespace(chr)) {\n spaces.push(tokens.length);\n indentation += chr;\n } else {\n nonSpace = true;\n lineHasNonSpace = true;\n indentation += ' ';\n }\n\n tokens.push([ 'text', chr, start, start + 1 ]);\n start += 1;\n\n // Check for whitespace on the current line.\n if (chr === '\\n') {\n stripSpace();\n indentation = '';\n tagIndex = 0;\n lineHasNonSpace = false;\n }\n }\n }\n\n // Match the opening tag.\n if (!scanner.scan(openingTagRe))\n break;\n\n hasTag = true;\n\n // Get the tag type.\n type = scanner.scan(tagRe) || 'name';\n scanner.scan(whiteRe);\n\n // Get the tag value.\n if (type === '=') {\n value = scanner.scanUntil(equalsRe);\n scanner.scan(equalsRe);\n scanner.scanUntil(closingTagRe);\n } else if (type === '{') {\n value = scanner.scanUntil(closingCurlyRe);\n scanner.scan(curlyRe);\n scanner.scanUntil(closingTagRe);\n type = '&';\n } else {\n value = scanner.scanUntil(closingTagRe);\n }\n\n // Match the closing tag.\n if (!scanner.scan(closingTagRe))\n throw new Error('Unclosed tag at ' + scanner.pos);\n\n if (type == '>') {\n token = [ type, value, start, scanner.pos, indentation, tagIndex, lineHasNonSpace ];\n } else {\n token = [ type, value, start, scanner.pos ];\n }\n tagIndex++;\n tokens.push(token);\n\n if (type === '#' || type === '^' || type === '$' || type === '<') {\n sections.push(token);\n } else if (type === '/') {\n // Check section nesting.\n openSection = sections.pop();\n\n if (!openSection)\n throw new Error('Unopened section \"' + value + '\" at ' + start);\n\n if (openSection[1] !== value)\n throw new Error('Unclosed section \"' + openSection[1] + '\" at ' + start);\n } else if (type === 'name' || type === '{' || type === '&') {\n nonSpace = true;\n } else if (type === '=') {\n // Set the tags for the next time around.\n compileTags(value);\n }\n }\n\n stripSpace();\n\n // Make sure there are no open sections when we're done.\n openSection = sections.pop();\n\n if (openSection)\n throw new Error('Unclosed section \"' + openSection[1] + '\" at ' + scanner.pos);\n\n return nestTokens(squashTokens(tokens));\n }\n\n /**\n * Combines the values of consecutive text tokens in the given `tokens` array\n * to a single token.\n */\n function squashTokens (tokens) {\n var squashedTokens = [];\n\n var token, lastToken;\n for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {\n token = tokens[i];\n\n if (token) {\n if (token[0] === 'text' && lastToken && lastToken[0] === 'text') {\n lastToken[1] += token[1];\n lastToken[3] = token[3];\n } else {\n squashedTokens.push(token);\n lastToken = token;\n }\n }\n }\n\n return squashedTokens;\n }\n\n /**\n * Forms the given array of `tokens` into a nested tree structure where\n * tokens that represent a section have two additional items: 1) an array of\n * all tokens that appear in that section and 2) the index in the original\n * template that represents the end of that section.\n */\n function nestTokens (tokens) {\n var nestedTokens = [];\n var collector = nestedTokens;\n var sections = [];\n\n var token, section;\n for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {\n token = tokens[i];\n\n switch (token[0]) {\n case '$':\n case '<':\n case '#':\n case '^':\n collector.push(token);\n sections.push(token);\n collector = token[4] = [];\n break;\n case '/':\n section = sections.pop();\n section[5] = token[2];\n collector = sections.length > 0 ? sections[sections.length - 1][4] : nestedTokens;\n break;\n default:\n collector.push(token);\n }\n }\n\n return nestedTokens;\n }\n\n /**\n * A simple string scanner that is used by the template parser to find\n * tokens in template strings.\n */\n function Scanner (string) {\n this.string = string;\n this.tail = string;\n this.pos = 0;\n }\n\n /**\n * Returns `true` if the tail is empty (end of string).\n */\n Scanner.prototype.eos = function eos () {\n return this.tail === '';\n };\n\n /**\n * Tries to match the given regular expression at the current position.\n * Returns the matched text if it can match, the empty string otherwise.\n */\n Scanner.prototype.scan = function scan (re) {\n var match = this.tail.match(re);\n\n if (!match || match.index !== 0)\n return '';\n\n var string = match[0];\n\n this.tail = this.tail.substring(string.length);\n this.pos += string.length;\n\n return string;\n };\n\n /**\n * Skips all text until the given regular expression can be matched. Returns\n * the skipped string, which is the entire tail if no match can be made.\n */\n Scanner.prototype.scanUntil = function scanUntil (re) {\n var index = this.tail.search(re), match;\n\n switch (index) {\n case -1:\n match = this.tail;\n this.tail = '';\n break;\n case 0:\n match = '';\n break;\n default:\n match = this.tail.substring(0, index);\n this.tail = this.tail.substring(index);\n }\n\n this.pos += match.length;\n\n return match;\n };\n\n /**\n * Represents a rendering context by wrapping a view object and\n * maintaining a reference to the parent context.\n */\n function Context (view, parentContext) {\n this.view = view;\n this.blocks = {};\n this.cache = { '.': this.view };\n this.parent = parentContext;\n }\n\n /**\n * Creates a new context using the given view with this context\n * as the parent.\n */\n Context.prototype.push = function push (view) {\n return new Context(view, this);\n };\n\n /**\n * Set a value in the current block context.\n */\n Context.prototype.setBlockVar = function set (name, value) {\n var blocks = this.blocks;\n\n blocks[name] = value;\n\n return value;\n };\n\n /**\n * Clear all current block vars.\n */\n Context.prototype.clearBlockVars = function clearBlockVars () {\n this.blocks = {};\n };\n\n /**\n * Get a value only from the current block context.\n */\n Context.prototype.getBlockVar = function getBlockVar (name) {\n var blocks = this.blocks;\n\n var value;\n if (blocks.hasOwnProperty(name)) {\n value = blocks[name];\n } else {\n if (this.parent) {\n value = this.parent.getBlockVar(name);\n }\n }\n // Can return undefined.\n return value;\n };\n\n /**\n * Returns the value of the given name in this context, traversing\n * up the context hierarchy if the value is absent in this context's view.\n */\n Context.prototype.lookup = function lookup (name) {\n var cache = this.cache;\n\n var value;\n if (cache.hasOwnProperty(name)) {\n value = cache[name];\n } else {\n var context = this, intermediateValue, names, index, lookupHit = false;\n\n while (context) {\n if (name.indexOf('.') > 0) {\n intermediateValue = context.view;\n names = name.split('.');\n index = 0;\n\n /**\n * Using the dot notion path in `name`, we descend through the\n * nested objects.\n *\n * To be certain that the lookup has been successful, we have to\n * check if the last object in the path actually has the property\n * we are looking for. We store the result in `lookupHit`.\n *\n * This is specially necessary for when the value has been set to\n * `undefined` and we want to avoid looking up parent contexts.\n *\n * In the case where dot notation is used, we consider the lookup\n * to be successful even if the last \"object\" in the path is\n * not actually an object but a primitive (e.g., a string, or an\n * integer), because it is sometimes useful to access a property\n * of an autoboxed primitive, such as the length of a string.\n **/\n while (intermediateValue != null && index < names.length) {\n if (index === names.length - 1)\n lookupHit = (\n hasProperty(intermediateValue, names[index])\n || primitiveHasOwnProperty(intermediateValue, names[index])\n );\n\n intermediateValue = intermediateValue[names[index++]];\n }\n } else {\n intermediateValue = context.view[name];\n\n /**\n * Only checking against `hasProperty`, which always returns `false` if\n * `context.view` is not an object. Deliberately omitting the check\n * against `primitiveHasOwnProperty` if dot notation is not used.\n *\n * Consider this example:\n * ```\n * Mustache.render(\"The length of a football field is {{#length}}{{length}}{{/length}}.\", {length: \"100 yards\"})\n * ```\n *\n * If we were to check also against `primitiveHasOwnProperty`, as we do\n * in the dot notation case, then render call would return:\n *\n * \"The length of a football field is 9.\"\n *\n * rather than the expected:\n *\n * \"The length of a football field is 100 yards.\"\n **/\n lookupHit = hasProperty(context.view, name);\n }\n\n if (lookupHit) {\n value = intermediateValue;\n break;\n }\n\n context = context.parent;\n }\n\n cache[name] = value;\n }\n\n if (isFunction(value))\n value = value.call(this.view);\n\n return value;\n };\n\n /**\n * A Writer knows how to take a stream of tokens and render them to a\n * string, given a context. It also maintains a cache of templates to\n * avoid the need to parse the same template twice.\n */\n function Writer () {\n this.cache = {};\n }\n\n /**\n * Clears all cached templates in this writer.\n */\n Writer.prototype.clearCache = function clearCache () {\n this.cache = {};\n };\n\n /**\n * Parses and caches the given `template` according to the given `tags` or\n * `mustache.tags` if `tags` is omitted, and returns the array of tokens\n * that is generated from the parse.\n */\n Writer.prototype.parse = function parse (template, tags) {\n var cache = this.cache;\n var cacheKey = template + ':' + (tags || mustache.tags).join(':');\n var tokens = cache[cacheKey];\n\n if (tokens == null)\n tokens = cache[cacheKey] = parseTemplate(template, tags);\n\n return tokens;\n };\n\n /**\n * High-level method that is used to render the given `template` with\n * the given `view`.\n *\n * The optional `partials` argument may be an object that contains the\n * names and templates of partials that are used in the template. It may\n * also be a function that is used to load partial templates on the fly\n * that takes a single argument: the name of the partial.\n *\n * If the optional `tags` argument is given here it must be an array with two\n * string values: the opening and closing tags used in the template (e.g.\n * [ \"<%\", \"%>\" ]). The default is to mustache.tags.\n */\n Writer.prototype.render = function render (template, view, partials, tags) {\n var tokens = this.parse(template, tags);\n var context = (view instanceof Context) ? view : new Context(view);\n return this.renderTokens(tokens, context, partials, template, tags);\n };\n\n /**\n * Low-level method that renders the given array of `tokens` using\n * the given `context` and `partials`.\n *\n * Note: The `originalTemplate` is only ever used to extract the portion\n * of the original template that was contained in a higher-order section.\n * If the template doesn't use higher-order sections, this argument may\n * be omitted.\n */\n Writer.prototype.renderTokens = function renderTokens (tokens, context, partials, originalTemplate, tags) {\n var buffer = '';\n\n var token, symbol, value;\n for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {\n value = undefined;\n token = tokens[i];\n symbol = token[0];\n\n if (symbol === '#') value = this.renderSection(token, context, partials, originalTemplate);\n else if (symbol === '^') value = this.renderInverted(token, context, partials, originalTemplate);\n else if (symbol === '>') value = this.renderPartial(token, context, partials, tags);\n else if (symbol === '<') value = this.renderBlock(token, context, partials, originalTemplate);\n else if (symbol === '$') value = this.renderBlockVariable(token, context, partials, originalTemplate);\n else if (symbol === '&') value = this.unescapedValue(token, context);\n else if (symbol === 'name') value = this.escapedValue(token, context);\n else if (symbol === 'text') value = this.rawValue(token);\n\n if (value !== undefined)\n buffer += value;\n }\n\n return buffer;\n };\n\n Writer.prototype.renderSection = function renderSection (token, context, partials, originalTemplate) {\n var self = this;\n var buffer = '';\n var value = context.lookup(token[1]);\n\n // This function is used to render an arbitrary template\n // in the current context by higher-order sections.\n function subRender (template) {\n return self.render(template, context, partials);\n }\n\n if (!value) return;\n\n if (isArray(value)) {\n for (var j = 0, valueLength = value.length; j < valueLength; ++j) {\n buffer += this.renderTokens(token[4], context.push(value[j]), partials, originalTemplate);\n }\n } else if (typeof value === 'object' || typeof value === 'string' || typeof value === 'number') {\n buffer += this.renderTokens(token[4], context.push(value), partials, originalTemplate);\n } else if (isFunction(value)) {\n if (typeof originalTemplate !== 'string')\n throw new Error('Cannot use higher-order sections without the original template');\n\n // Extract the portion of the original template that the section contains.\n value = value.call(context.view, originalTemplate.slice(token[3], token[5]), subRender);\n\n if (value != null)\n buffer += value;\n } else {\n buffer += this.renderTokens(token[4], context, partials, originalTemplate);\n }\n return buffer;\n };\n\n Writer.prototype.renderInverted = function renderInverted (token, context, partials, originalTemplate) {\n var value = context.lookup(token[1]);\n\n // Use JavaScript's definition of falsy. Include empty arrays.\n // See https://github.com/janl/mustache.js/issues/186\n if (!value || (isArray(value) && value.length === 0))\n return this.renderTokens(token[4], context, partials, originalTemplate);\n };\n\n Writer.prototype.indentPartial = function indentPartial (partial, indentation, lineHasNonSpace) {\n var filteredIndentation = indentation.replace(/[^ \\t]/g, '');\n var partialByNl = partial.split('\\n');\n for (var i = 0; i < partialByNl.length; i++) {\n if (partialByNl[i].length && (i > 0 || !lineHasNonSpace)) {\n partialByNl[i] = filteredIndentation + partialByNl[i];\n }\n }\n return partialByNl.join('\\n');\n };\n\n Writer.prototype.renderPartial = function renderPartial (token, context, partials, tags) {\n if (!partials) return;\n\n var value = isFunction(partials) ? partials(token[1]) : partials[token[1]];\n if (value != null) {\n var lineHasNonSpace = token[6];\n var tagIndex = token[5];\n var indentation = token[4];\n var indentedValue = value;\n if (tagIndex == 0 && indentation) {\n indentedValue = this.indentPartial(value, indentation, lineHasNonSpace);\n }\n return this.renderTokens(this.parse(indentedValue, tags), context, partials, indentedValue);\n }\n };\n\n Writer.prototype.renderBlock = function renderBlock (token, context, partials, originalTemplate) {\n if (!partials) return;\n\n var value = isFunction(partials) ? partials(token[1]) : partials[token[1]];\n if (value != null)\n // Ignore any wrongly set block vars before we started.\n context.clearBlockVars();\n // We are only rendering to record the default block variables.\n this.renderTokens(token[4], context, partials, originalTemplate);\n // Now we render and return the result.\n var result = this.renderTokens(this.parse(value), context, partials, value);\n // Don't leak the block variables outside this include.\n context.clearBlockVars();\n return result;\n };\n\n Writer.prototype.renderBlockVariable = function renderBlockVariable (token, context, partials, originalTemplate) {\n var value = token[1];\n\n var exists = context.getBlockVar(value);\n if (!exists) {\n context.setBlockVar(value, originalTemplate.slice(token[3], token[5]));\n return this.renderTokens(token[4], context, partials, originalTemplate);\n } else {\n return this.renderTokens(this.parse(exists), context, partials, exists);\n }\n };\n\n Writer.prototype.unescapedValue = function unescapedValue (token, context) {\n var value = context.lookup(token[1]);\n if (value != null)\n return value;\n };\n\n Writer.prototype.escapedValue = function escapedValue (token, context) {\n var value = context.lookup(token[1]);\n if (value != null)\n return mustache.escape(value);\n };\n\n Writer.prototype.rawValue = function rawValue (token) {\n return token[1];\n };\n\n mustache.name = 'mustache.js';\n mustache.version = '3.1.0';\n mustache.tags = [ '{{', '}}' ];\n\n // All high-level mustache.* functions use this writer.\n var defaultWriter = new Writer();\n\n /**\n * Clears all cached templates in the default writer.\n */\n mustache.clearCache = function clearCache () {\n return defaultWriter.clearCache();\n };\n\n /**\n * Parses and caches the given template in the default writer and returns the\n * array of tokens it contains. Doing this ahead of time avoids the need to\n * parse templates on the fly as they are rendered.\n */\n mustache.parse = function parse (template, tags) {\n return defaultWriter.parse(template, tags);\n };\n\n /**\n * Renders the `template` with the given `view` and `partials` using the\n * default writer. If the optional `tags` argument is given here it must be an\n * array with two string values: the opening and closing tags used in the\n * template (e.g. [ \"<%\", \"%>\" ]). The default is to mustache.tags.\n */\n mustache.render = function render (template, view, partials, tags) {\n if (typeof template !== 'string') {\n throw new TypeError('Invalid template! Template should be a \"string\" ' +\n 'but \"' + typeStr(template) + '\" was given as the first ' +\n 'argument for mustache#render(template, view, partials)');\n }\n\n return defaultWriter.render(template, view, partials, tags);\n };\n\n // This is here for backwards compatibility with 0.4.x.,\n /*eslint-disable */ // eslint wants camel cased function name\n mustache.to_html = function to_html (template, view, partials, send) {\n /*eslint-enable*/\n\n var result = mustache.render(template, view, partials);\n\n if (isFunction(send)) {\n send(result);\n } else {\n return result;\n }\n };\n\n // Export the escaping function so that the user may override it.\n // See https://github.com/janl/mustache.js/issues/244\n mustache.escape = escapeHtml;\n\n // Export these mainly for testing, but also for advanced usage.\n mustache.Scanner = Scanner;\n mustache.Context = Context;\n mustache.Writer = Writer;\n\n return mustache;\n}));\n/* jshint ignore:end */\n"],"file":"mustache.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/mustache.js"],"names":["global","factory","exports","nodeName","define","amd","Mustache","mustache","objectToString","Object","prototype","toString","isArray","Array","object","call","isFunction","typeStr","obj","escapeRegExp","string","replace","hasProperty","propName","primitiveHasOwnProperty","primitive","hasOwnProperty","regExpTest","RegExp","test","testRegExp","re","isWhitespace","entityMap","equalsRe","parseTemplate","template","tags","lineHasNonSpace","sections","tokens","spaces","hasTag","nonSpace","indentation","tagIndex","stripSpace","length","pop","openingTagRe","closingTagRe","closingCurlyRe","compileTags","tagsToCompile","split","Error","scanner","Scanner","start","type","value","chr","token","openSection","eos","pos","scanUntil","i","valueLength","charAt","push","scan","nestTokens","squashTokens","squashedTokens","lastToken","numTokens","nestedTokens","collector","section","tail","match","index","substring","search","Context","view","parentContext","blocks","cache","parent","setBlockVar","name","clearBlockVars","getBlockVar","lookup","context","intermediateValue","names","lookupHit","indexOf","Writer","clearCache","parse","cacheKey","join","render","partials","renderTokens","originalTemplate","buffer","symbol","renderSection","renderInverted","renderPartial","renderBlock","renderBlockVariable","unescapedValue","escapedValue","rawValue","self","subRender","j","slice","indentPartial","partial","filteredIndentation","partialByNl","indentedValue","result","exists","escape","version","defaultWriter","TypeError","to_html","send","s"],"mappings":"kRA0CC,UAAyBA,CAAzB,CAAiCC,CAAjC,CAA0C,CACzC,GAAuB,QAAnB,uBAAOC,CAAAA,OAAP,qBAAOA,OAAP,IAA+BA,OAA/B,EAAs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BkD,CAA1B,CAAgCqB,CAAhC,CAAb,CAEA,GAAI3F,CAAU,CAACwH,CAAD,CAAd,CAAsB,CACpBA,CAAI,CAACP,CAAD,CACL,CAFD,IAEO,CACL,MAAOA,CAAAA,CACR,CACF,CAVD,CAcA1H,CAAQ,CAAC4H,MAAT,CA1rBA,SAAqB/G,CAArB,CAA6B,CAC3B,MAAO,CAAOA,CAAP,KAAeC,OAAf,CAAuB,cAAvB,CAAuC,SAAwBoH,CAAxB,CAA2B,CACvE,MAAOxG,CAAAA,CAAS,CAACwG,CAAD,CACjB,CAFM,CAGR,CAsrBD,CAGAlI,CAAQ,CAACkD,OAAT,CAAmBA,CAAnB,CACAlD,CAAQ,CAAC8E,OAAT,CAAmBA,CAAnB,CACA9E,CAAQ,CAAC8F,MAAT,CAAkBA,CAAlB,CAEA,MAAO9F,CAAAA,CACR,CA9wBA,CAAD","sourcesContent":["// The MIT License\n//\n// Copyright (c) 2009 Chris Wanstrath (Ruby)\n// Copyright (c) 2010-2014 Jan Lehnardt (JavaScript)\n// Copyright (c) 2010-2015 The mustache.js community\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n//\n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n\n// Description of import into Moodle:\n// Checkout from https://github.com/moodle/custom-mustache.js Branch: LAMBDA_ARGS\n// Rebase onto latest release tag from https://github.com/janl/mustache.js\n// Copy mustache.js into lib/amd/src/ in Moodle folder.\n// Add the license as a comment to the file and these instructions.\n// Add jshint tags so this file is not linted.\n// Remove the \"global define:\" comment (hint for linter)\n// Make sure that you have not removed the custom code for '$' and '<'.\n\n/*!\n * mustache.js - Logic-less {{mustache}} templates with JavaScript\n * http://github.com/janl/mustache.js\n */\n\n/* jshint ignore:start */\n\n(function defineMustache (global, factory) {\n if (typeof exports === 'object' && exports && typeof exports.nodeName !== 'string') {\n factory(exports); // CommonJS\n } else if (typeof define === 'function' && define.amd) {\n define(['exports'], factory); // AMD\n } else {\n global.Mustache = {};\n factory(global.Mustache); // script, wsh, asp\n }\n}(this, function mustacheFactory (mustache) {\n\n var objectToString = Object.prototype.toString;\n var isArray = Array.isArray || function isArrayPolyfill (object) {\n return objectToString.call(object) === '[object Array]';\n };\n\n function isFunction (object) {\n return typeof object === 'function';\n }\n\n /**\n * More correct typeof string handling array\n * which normally returns typeof 'object'\n */\n function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }\n\n function escapeRegExp (string) {\n return string.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, '\\\\$&');\n }\n\n /**\n * Null safe way of checking whether or not an object,\n * including its prototype, has a given property\n */\n function hasProperty (obj, propName) {\n return obj != null && typeof obj === 'object' && (propName in obj);\n }\n\n /**\n * Safe way of detecting whether or not the given thing is a primitive and\n * whether it has the given property\n */\n function primitiveHasOwnProperty (primitive, propName) {\n return (\n primitive != null\n && typeof primitive !== 'object'\n && primitive.hasOwnProperty\n && primitive.hasOwnProperty(propName)\n );\n }\n\n // Workaround for https://issues.apache.org/jira/browse/COUCHDB-577\n // See https://github.com/janl/mustache.js/issues/189\n var regExpTest = RegExp.prototype.test;\n function testRegExp (re, string) {\n return regExpTest.call(re, string);\n }\n\n var nonSpaceRe = /\\S/;\n function isWhitespace (string) {\n return !testRegExp(nonSpaceRe, string);\n }\n\n var entityMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '/': '/',\n '`': '`',\n '=': '='\n };\n\n function escapeHtml (string) {\n return String(string).replace(/[&<>\"'`=\\/]/g, function fromEntityMap (s) {\n return entityMap[s];\n });\n }\n\n var whiteRe = /\\s*/;\n var spaceRe = /\\s+/;\n var equalsRe = /\\s*=/;\n var curlyRe = /\\s*\\}/;\n var tagRe = /#|\\^|\\/|>|\\{|&|=|!|\\$|\" ]). Of\n * course, the default is to use mustaches (i.e. mustache.tags).\n *\n * A token is an array with at least 4 elements. The first element is the\n * mustache symbol that was used inside the tag, e.g. \"#\" or \"&\". If the tag\n * did not contain a symbol (i.e. {{myValue}}) this element is \"name\". For\n * all text that appears outside a symbol this element is \"text\".\n *\n * The second element of a token is its \"value\". For mustache tags this is\n * whatever else was inside the tag besides the opening symbol. For text tokens\n * this is the text itself.\n *\n * The third and fourth elements of the token are the start and end indices,\n * respectively, of the token in the original template.\n *\n * Tokens that are the root node of a subtree contain two more elements: 1) an\n * array of tokens in the subtree and 2) the index in the original template at\n * which the closing tag for that section begins.\n *\n * Tokens for partials also contain two more elements: 1) a string value of\n * indendation prior to that tag and 2) the index of that tag on that line -\n * eg a value of 2 indicates the partial is the third tag on this line.\n */\n function parseTemplate (template, tags) {\n if (!template)\n return [];\n var lineHasNonSpace = false;\n var sections = []; // Stack to hold section tokens\n var tokens = []; // Buffer to hold the tokens\n var spaces = []; // Indices of whitespace tokens on the current line\n var hasTag = false; // Is there a {{tag}} on the current line?\n var nonSpace = false; // Is there a non-space char on the current line?\n var indentation = ''; // Tracks indentation for tags that use it\n var tagIndex = 0; // Stores a count of number of tags encountered on a line\n\n // Strips all whitespace tokens array for the current line\n // if there was a {{#tag}} on it and otherwise only space.\n function stripSpace () {\n if (hasTag && !nonSpace) {\n while (spaces.length)\n delete tokens[spaces.pop()];\n } else {\n spaces = [];\n }\n\n hasTag = false;\n nonSpace = false;\n }\n\n var openingTagRe, closingTagRe, closingCurlyRe;\n function compileTags (tagsToCompile) {\n if (typeof tagsToCompile === 'string')\n tagsToCompile = tagsToCompile.split(spaceRe, 2);\n\n if (!isArray(tagsToCompile) || tagsToCompile.length !== 2)\n throw new Error('Invalid tags: ' + tagsToCompile);\n\n openingTagRe = new RegExp(escapeRegExp(tagsToCompile[0]) + '\\\\s*');\n closingTagRe = new RegExp('\\\\s*' + escapeRegExp(tagsToCompile[1]));\n closingCurlyRe = new RegExp('\\\\s*' + escapeRegExp('}' + tagsToCompile[1]));\n }\n\n compileTags(tags || mustache.tags);\n\n var scanner = new Scanner(template);\n\n var start, type, value, chr, token, openSection;\n while (!scanner.eos()) {\n start = scanner.pos;\n\n // Match any text between tags.\n value = scanner.scanUntil(openingTagRe);\n\n if (value) {\n for (var i = 0, valueLength = value.length; i < valueLength; ++i) {\n chr = value.charAt(i);\n\n if (isWhitespace(chr)) {\n spaces.push(tokens.length);\n indentation += chr;\n } else {\n nonSpace = true;\n lineHasNonSpace = true;\n indentation += ' ';\n }\n\n tokens.push([ 'text', chr, start, start + 1 ]);\n start += 1;\n\n // Check for whitespace on the current line.\n if (chr === '\\n') {\n stripSpace();\n indentation = '';\n tagIndex = 0;\n lineHasNonSpace = false;\n }\n }\n }\n\n // Match the opening tag.\n if (!scanner.scan(openingTagRe))\n break;\n\n hasTag = true;\n\n // Get the tag type.\n type = scanner.scan(tagRe) || 'name';\n scanner.scan(whiteRe);\n\n // Get the tag value.\n if (type === '=') {\n value = scanner.scanUntil(equalsRe);\n scanner.scan(equalsRe);\n scanner.scanUntil(closingTagRe);\n } else if (type === '{') {\n value = scanner.scanUntil(closingCurlyRe);\n scanner.scan(curlyRe);\n scanner.scanUntil(closingTagRe);\n type = '&';\n } else {\n value = scanner.scanUntil(closingTagRe);\n }\n\n // Match the closing tag.\n if (!scanner.scan(closingTagRe))\n throw new Error('Unclosed tag at ' + scanner.pos);\n\n if (type == '>') {\n token = [ type, value, start, scanner.pos, indentation, tagIndex, lineHasNonSpace ];\n } else {\n token = [ type, value, start, scanner.pos ];\n }\n tagIndex++;\n tokens.push(token);\n\n if (type === '#' || type === '^' || type === '$' || type === '<') {\n sections.push(token);\n } else if (type === '/') {\n // Check section nesting.\n openSection = sections.pop();\n\n if (!openSection)\n throw new Error('Unopened section \"' + value + '\" at ' + start);\n\n if (openSection[1] !== value)\n throw new Error('Unclosed section \"' + openSection[1] + '\" at ' + start);\n } else if (type === 'name' || type === '{' || type === '&') {\n nonSpace = true;\n } else if (type === '=') {\n // Set the tags for the next time around.\n compileTags(value);\n }\n }\n\n stripSpace();\n\n // Make sure there are no open sections when we're done.\n openSection = sections.pop();\n\n if (openSection)\n throw new Error('Unclosed section \"' + openSection[1] + '\" at ' + scanner.pos);\n\n return nestTokens(squashTokens(tokens));\n }\n\n /**\n * Combines the values of consecutive text tokens in the given `tokens` array\n * to a single token.\n */\n function squashTokens (tokens) {\n var squashedTokens = [];\n\n var token, lastToken;\n for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {\n token = tokens[i];\n\n if (token) {\n if (token[0] === 'text' && lastToken && lastToken[0] === 'text') {\n lastToken[1] += token[1];\n lastToken[3] = token[3];\n } else {\n squashedTokens.push(token);\n lastToken = token;\n }\n }\n }\n\n return squashedTokens;\n }\n\n /**\n * Forms the given array of `tokens` into a nested tree structure where\n * tokens that represent a section have two additional items: 1) an array of\n * all tokens that appear in that section and 2) the index in the original\n * template that represents the end of that section.\n */\n function nestTokens (tokens) {\n var nestedTokens = [];\n var collector = nestedTokens;\n var sections = [];\n\n var token, section;\n for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {\n token = tokens[i];\n\n switch (token[0]) {\n case '$':\n case '<':\n case '#':\n case '^':\n collector.push(token);\n sections.push(token);\n collector = token[4] = [];\n break;\n case '/':\n section = sections.pop();\n section[5] = token[2];\n collector = sections.length > 0 ? sections[sections.length - 1][4] : nestedTokens;\n break;\n default:\n collector.push(token);\n }\n }\n\n return nestedTokens;\n }\n\n /**\n * A simple string scanner that is used by the template parser to find\n * tokens in template strings.\n */\n function Scanner (string) {\n this.string = string;\n this.tail = string;\n this.pos = 0;\n }\n\n /**\n * Returns `true` if the tail is empty (end of string).\n */\n Scanner.prototype.eos = function eos () {\n return this.tail === '';\n };\n\n /**\n * Tries to match the given regular expression at the current position.\n * Returns the matched text if it can match, the empty string otherwise.\n */\n Scanner.prototype.scan = function scan (re) {\n var match = this.tail.match(re);\n\n if (!match || match.index !== 0)\n return '';\n\n var string = match[0];\n\n this.tail = this.tail.substring(string.length);\n this.pos += string.length;\n\n return string;\n };\n\n /**\n * Skips all text until the given regular expression can be matched. Returns\n * the skipped string, which is the entire tail if no match can be made.\n */\n Scanner.prototype.scanUntil = function scanUntil (re) {\n var index = this.tail.search(re), match;\n\n switch (index) {\n case -1:\n match = this.tail;\n this.tail = '';\n break;\n case 0:\n match = '';\n break;\n default:\n match = this.tail.substring(0, index);\n this.tail = this.tail.substring(index);\n }\n\n this.pos += match.length;\n\n return match;\n };\n\n /**\n * Represents a rendering context by wrapping a view object and\n * maintaining a reference to the parent context.\n */\n function Context (view, parentContext) {\n this.view = view;\n this.blocks = {};\n this.cache = { '.': this.view };\n this.parent = parentContext;\n }\n\n /**\n * Creates a new context using the given view with this context\n * as the parent.\n */\n Context.prototype.push = function push (view) {\n return new Context(view, this);\n };\n\n /**\n * Set a value in the current block context.\n */\n Context.prototype.setBlockVar = function set (name, value) {\n var blocks = this.blocks;\n\n blocks[name] = value;\n\n return value;\n };\n\n /**\n * Clear all current block vars.\n */\n Context.prototype.clearBlockVars = function clearBlockVars () {\n this.blocks = {};\n };\n\n /**\n * Get a value only from the current block context.\n */\n Context.prototype.getBlockVar = function getBlockVar (name) {\n var blocks = this.blocks;\n\n var value;\n if (blocks.hasOwnProperty(name)) {\n value = blocks[name];\n } else {\n if (this.parent) {\n value = this.parent.getBlockVar(name);\n }\n }\n // Can return undefined.\n return value;\n };\n\n /**\n * Returns the value of the given name in this context, traversing\n * up the context hierarchy if the value is absent in this context's view.\n */\n Context.prototype.lookup = function lookup (name) {\n var cache = this.cache;\n\n var value;\n if (cache.hasOwnProperty(name)) {\n value = cache[name];\n } else {\n var context = this, intermediateValue, names, index, lookupHit = false;\n\n while (context) {\n if (name.indexOf('.') > 0) {\n intermediateValue = context.view;\n names = name.split('.');\n index = 0;\n\n /**\n * Using the dot notion path in `name`, we descend through the\n * nested objects.\n *\n * To be certain that the lookup has been successful, we have to\n * check if the last object in the path actually has the property\n * we are looking for. We store the result in `lookupHit`.\n *\n * This is specially necessary for when the value has been set to\n * `undefined` and we want to avoid looking up parent contexts.\n *\n * In the case where dot notation is used, we consider the lookup\n * to be successful even if the last \"object\" in the path is\n * not actually an object but a primitive (e.g., a string, or an\n * integer), because it is sometimes useful to access a property\n * of an autoboxed primitive, such as the length of a string.\n **/\n while (intermediateValue != null && index < names.length) {\n if (index === names.length - 1)\n lookupHit = (\n hasProperty(intermediateValue, names[index])\n || primitiveHasOwnProperty(intermediateValue, names[index])\n );\n\n intermediateValue = intermediateValue[names[index++]];\n }\n } else {\n intermediateValue = context.view[name];\n\n /**\n * Only checking against `hasProperty`, which always returns `false` if\n * `context.view` is not an object. Deliberately omitting the check\n * against `primitiveHasOwnProperty` if dot notation is not used.\n *\n * Consider this example:\n * ```\n * Mustache.render(\"The length of a football field is {{#length}}{{length}}{{/length}}.\", {length: \"100 yards\"})\n * ```\n *\n * If we were to check also against `primitiveHasOwnProperty`, as we do\n * in the dot notation case, then render call would return:\n *\n * \"The length of a football field is 9.\"\n *\n * rather than the expected:\n *\n * \"The length of a football field is 100 yards.\"\n **/\n lookupHit = hasProperty(context.view, name);\n }\n\n if (lookupHit) {\n value = intermediateValue;\n break;\n }\n\n context = context.parent;\n }\n\n cache[name] = value;\n }\n\n if (isFunction(value))\n value = value.call(this.view);\n\n return value;\n };\n\n /**\n * A Writer knows how to take a stream of tokens and render them to a\n * string, given a context. It also maintains a cache of templates to\n * avoid the need to parse the same template twice.\n */\n function Writer () {\n this.cache = {};\n }\n\n /**\n * Clears all cached templates in this writer.\n */\n Writer.prototype.clearCache = function clearCache () {\n this.cache = {};\n };\n\n /**\n * Parses and caches the given `template` according to the given `tags` or\n * `mustache.tags` if `tags` is omitted, and returns the array of tokens\n * that is generated from the parse.\n */\n Writer.prototype.parse = function parse (template, tags) {\n var cache = this.cache;\n var cacheKey = template + ':' + (tags || mustache.tags).join(':');\n var tokens = cache[cacheKey];\n\n if (tokens == null)\n tokens = cache[cacheKey] = parseTemplate(template, tags);\n\n return tokens;\n };\n\n /**\n * High-level method that is used to render the given `template` with\n * the given `view`.\n *\n * The optional `partials` argument may be an object that contains the\n * names and templates of partials that are used in the template. It may\n * also be a function that is used to load partial templates on the fly\n * that takes a single argument: the name of the partial.\n *\n * If the optional `tags` argument is given here it must be an array with two\n * string values: the opening and closing tags used in the template (e.g.\n * [ \"<%\", \"%>\" ]). The default is to mustache.tags.\n */\n Writer.prototype.render = function render (template, view, partials, tags) {\n var tokens = this.parse(template, tags);\n var context = (view instanceof Context) ? view : new Context(view);\n return this.renderTokens(tokens, context, partials, template, tags);\n };\n\n /**\n * Low-level method that renders the given array of `tokens` using\n * the given `context` and `partials`.\n *\n * Note: The `originalTemplate` is only ever used to extract the portion\n * of the original template that was contained in a higher-order section.\n * If the template doesn't use higher-order sections, this argument may\n * be omitted.\n */\n Writer.prototype.renderTokens = function renderTokens (tokens, context, partials, originalTemplate, tags) {\n var buffer = '';\n\n var token, symbol, value;\n for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {\n value = undefined;\n token = tokens[i];\n symbol = token[0];\n\n if (symbol === '#') value = this.renderSection(token, context, partials, originalTemplate);\n else if (symbol === '^') value = this.renderInverted(token, context, partials, originalTemplate);\n else if (symbol === '>') value = this.renderPartial(token, context, partials, tags);\n else if (symbol === '<') value = this.renderBlock(token, context, partials, originalTemplate);\n else if (symbol === '$') value = this.renderBlockVariable(token, context, partials, originalTemplate);\n else if (symbol === '&') value = this.unescapedValue(token, context);\n else if (symbol === 'name') value = this.escapedValue(token, context);\n else if (symbol === 'text') value = this.rawValue(token);\n\n if (value !== undefined)\n buffer += value;\n }\n\n return buffer;\n };\n\n Writer.prototype.renderSection = function renderSection (token, context, partials, originalTemplate) {\n var self = this;\n var buffer = '';\n var value = context.lookup(token[1]);\n\n // This function is used to render an arbitrary template\n // in the current context by higher-order sections.\n function subRender (template) {\n return self.render(template, context, partials);\n }\n\n if (!value) return;\n\n if (isArray(value)) {\n for (var j = 0, valueLength = value.length; j < valueLength; ++j) {\n buffer += this.renderTokens(token[4], context.push(value[j]), partials, originalTemplate);\n }\n } else if (typeof value === 'object' || typeof value === 'string' || typeof value === 'number') {\n buffer += this.renderTokens(token[4], context.push(value), partials, originalTemplate);\n } else if (isFunction(value)) {\n if (typeof originalTemplate !== 'string')\n throw new Error('Cannot use higher-order sections without the original template');\n\n // Extract the portion of the original template that the section contains.\n value = value.call(context.view, originalTemplate.slice(token[3], token[5]), subRender);\n\n if (value != null)\n buffer += value;\n } else {\n buffer += this.renderTokens(token[4], context, partials, originalTemplate);\n }\n return buffer;\n };\n\n Writer.prototype.renderInverted = function renderInverted (token, context, partials, originalTemplate) {\n var value = context.lookup(token[1]);\n\n // Use JavaScript's definition of falsy. Include empty arrays.\n // See https://github.com/janl/mustache.js/issues/186\n if (!value || (isArray(value) && value.length === 0))\n return this.renderTokens(token[4], context, partials, originalTemplate);\n };\n\n Writer.prototype.indentPartial = function indentPartial (partial, indentation, lineHasNonSpace) {\n var filteredIndentation = indentation.replace(/[^ \\t]/g, '');\n var partialByNl = partial.split('\\n');\n for (var i = 0; i < partialByNl.length; i++) {\n if (partialByNl[i].length && (i > 0 || !lineHasNonSpace)) {\n partialByNl[i] = filteredIndentation + partialByNl[i];\n }\n }\n return partialByNl.join('\\n');\n };\n\n Writer.prototype.renderPartial = function renderPartial (token, context, partials, tags) {\n if (!partials) return;\n\n var value = isFunction(partials) ? partials(token[1]) : partials[token[1]];\n if (value != null) {\n var lineHasNonSpace = token[6];\n var tagIndex = token[5];\n var indentation = token[4];\n var indentedValue = value;\n if (tagIndex == 0 && indentation) {\n indentedValue = this.indentPartial(value, indentation, lineHasNonSpace);\n }\n return this.renderTokens(this.parse(indentedValue, tags), context, partials, indentedValue);\n }\n };\n\n Writer.prototype.renderBlock = function renderBlock (token, context, partials, originalTemplate) {\n if (!partials) return;\n\n var value = isFunction(partials) ? partials(token[1]) : partials[token[1]];\n if (value != null)\n // Ignore any wrongly set block vars before we started.\n context.clearBlockVars();\n // We are only rendering to record the default block variables.\n this.renderTokens(token[4], context, partials, originalTemplate);\n // Now we render and return the result.\n var result = this.renderTokens(this.parse(value), context, partials, value);\n // Don't leak the block variables outside this include.\n context.clearBlockVars();\n return result;\n };\n\n Writer.prototype.renderBlockVariable = function renderBlockVariable (token, context, partials, originalTemplate) {\n var value = token[1];\n\n var exists = context.getBlockVar(value);\n if (!exists) {\n context.setBlockVar(value, originalTemplate.slice(token[3], token[5]));\n return this.renderTokens(token[4], context, partials, originalTemplate);\n } else {\n return this.renderTokens(this.parse(exists), context, partials, exists);\n }\n };\n\n Writer.prototype.unescapedValue = function unescapedValue (token, context) {\n var value = context.lookup(token[1]);\n if (value != null)\n return value;\n };\n\n Writer.prototype.escapedValue = function escapedValue (token, context) {\n var value = context.lookup(token[1]);\n if (value != null)\n return mustache.escape(value);\n };\n\n Writer.prototype.rawValue = function rawValue (token) {\n return token[1];\n };\n\n mustache.name = 'mustache.js';\n mustache.version = '3.1.0';\n mustache.tags = [ '{{', '}}' ];\n\n // All high-level mustache.* functions use this writer.\n var defaultWriter = new Writer();\n\n /**\n * Clears all cached templates in the default writer.\n */\n mustache.clearCache = function clearCache () {\n return defaultWriter.clearCache();\n };\n\n /**\n * Parses and caches the given template in the default writer and returns the\n * array of tokens it contains. Doing this ahead of time avoids the need to\n * parse templates on the fly as they are rendered.\n */\n mustache.parse = function parse (template, tags) {\n return defaultWriter.parse(template, tags);\n };\n\n /**\n * Renders the `template` with the given `view` and `partials` using the\n * default writer. If the optional `tags` argument is given here it must be an\n * array with two string values: the opening and closing tags used in the\n * template (e.g. [ \"<%\", \"%>\" ]). The default is to mustache.tags.\n */\n mustache.render = function render (template, view, partials, tags) {\n if (typeof template !== 'string') {\n throw new TypeError('Invalid template! Template should be a \"string\" ' +\n 'but \"' + typeStr(template) + '\" was given as the first ' +\n 'argument for mustache#render(template, view, partials)');\n }\n\n return defaultWriter.render(template, view, partials, tags);\n };\n\n // This is here for backwards compatibility with 0.4.x.,\n /*eslint-disable */ // eslint wants camel cased function name\n mustache.to_html = function to_html (template, view, partials, send) {\n /*eslint-enable*/\n\n var result = mustache.render(template, view, partials);\n\n if (isFunction(send)) {\n send(result);\n } else {\n return result;\n }\n };\n\n // Export the escaping function so that the user may override it.\n // See https://github.com/janl/mustache.js/issues/244\n mustache.escape = escapeHtml;\n\n // Export these mainly for testing, but also for advanced usage.\n mustache.Scanner = Scanner;\n mustache.Context = Context;\n mustache.Writer = Writer;\n\n return mustache;\n}));\n/* jshint ignore:end */\n"],"file":"mustache.min.js"} \ No newline at end of file diff --git a/lib/amd/build/notification.min.js b/lib/amd/build/notification.min.js index 42cdec9154c..f4d85acf786 100644 --- a/lib/amd/build/notification.min.js +++ b/lib/amd/build/notification.min.js @@ -1,2 +1,2 @@ -define ("core/notification",["exports","core/pending","core/log"],function(a,b,c){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=a.init=a.exception=a.saveCancel=a.confirm=a.alert=a.addNotification=a.fetchNotifications=void 0;b=d(b);c=d(c);var q="undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:{};function d(a){return a&&a.__esModule?a:{default:a}}function e(a,b){return k(a)||j(a,b)||g(a,b)||f()}function f(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function g(a,b){if(!a)return;if("string"==typeof a)return h(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);if("Object"===c&&a.constructor)c=a.constructor.name;if("Map"===c||"Set"===c)return Array.from(c);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return h(a,b)}function h(a,b){if(null==b||b>a.length)b=a.length;for(var c=0,d=Array(b);ca.length)b=a.length;for(var c=0,d=Array(b);c.\n\nimport Pending from 'core/pending';\nimport Log from 'core/log';\n\nlet currentContextId = M.cfg.contextid;\n\nconst notificationTypes = {\n success: 'core/notification_success',\n info: 'core/notification_info',\n warning: 'core/notification_warning',\n error: 'core/notification_error',\n};\n\nconst notificationRegionId = 'user-notifications';\n\nconst Selectors = {\n notificationRegion: `#${notificationRegionId}`,\n fallbackRegionParents: [\n '#region-main',\n '[role=\"main\"]',\n 'body',\n ],\n};\n\nconst setupTargetRegion = () => {\n let targetRegion = getNotificationRegion();\n if (targetRegion) {\n return false;\n }\n\n const newRegion = document.createElement('span');\n newRegion.id = notificationRegionId;\n\n return Selectors.fallbackRegionParents.some(selector => {\n const targetRegion = document.querySelector(selector);\n\n if (targetRegion) {\n targetRegion.prepend(newRegion);\n return true;\n }\n\n return false;\n });\n};\n\n\n/**\n * Poll the server for any new notifications.\n *\n * @returns {Promise}\n */\nexport const fetchNotifications = async() => {\n const Ajax = await import('core/ajax');\n\n return Ajax.call([{\n methodname: 'core_fetch_notifications',\n args: {\n contextid: currentContextId\n }\n }])[0]\n .then(addNotifications);\n};\n\n/**\n * Add all of the supplied notifications.\n *\n * @param {Array} notifications The list of notificaitons\n * @returns {Promise}\n */\nconst addNotifications = notifications => {\n if (!notifications.length) {\n return Promise.resolve();\n }\n\n const pendingPromise = new Pending('core/notification:addNotifications');\n notifications.forEach(notification => renderNotification(notification.template, notification.variables));\n\n return pendingPromise.resolve();\n};\n\n/**\n * Add a notification to the page.\n *\n * Note: This does not cause the notification to be added to the session.\n *\n * @param {Object} notification The notification to add.\n * @param {string} notification.message The body of the notification\n * @param {string} notification.type The type of notification to add (error, warning, info, success).\n * @param {Boolean} notification.closebutton Whether to show the close button.\n * @param {Boolean} notification.announce Whether to announce to screen readers.\n * @returns {Promise}\n */\nexport const addNotification = notification => {\n const pendingPromise = new Pending('core/notification:addNotifications');\n\n let template = notificationTypes.error;\n\n notification = {\n closebutton: true,\n announce: true,\n type: 'error',\n ...notification,\n };\n\n if (notification.template) {\n template = notification.template;\n delete notification.template;\n } else if (notification.type) {\n if (typeof notificationTypes[notification.type] !== 'undefined') {\n template = notificationTypes[notification.type];\n }\n delete notification.type;\n }\n\n return renderNotification(template, notification)\n .then(pendingPromise.resolve);\n};\n\nconst renderNotification = async(template, variables) => {\n if (typeof variables.message === 'undefined' || !variables.message) {\n Log.debug('Notification received without content. Skipping.');\n return;\n }\n\n const pendingPromise = new Pending('core/notification:renderNotification');\n const Templates = await import('core/templates');\n\n Templates.renderForPromise(template, variables)\n .then(({html, js = ''}) => {\n Templates.prependNodeContents(getNotificationRegion(), html, js);\n\n return;\n })\n .then(pendingPromise.resolve)\n .catch(exception);\n};\n\nconst getNotificationRegion = () => document.querySelector(Selectors.notificationRegion);\n\n/**\n * Alert dialogue.\n *\n * @param {String|Promise} title\n * @param {String|Promise} message\n * @param {String|Promise} cancelText\n * @returns {Promise}\n */\nexport const alert = async(title, message, cancelText) => {\n var pendingPromise = new Pending('core/notification:alert');\n\n const ModalFactory = await import('core/modal_factory');\n\n return ModalFactory.create({\n type: ModalFactory.types.ALERT,\n body: message,\n title: title,\n buttons: {\n cancel: cancelText,\n },\n removeOnClose: true,\n })\n .then(function(modal) {\n modal.show();\n\n pendingPromise.resolve();\n return modal;\n });\n};\n\n/**\n * The confirm has now been replaced with a save and cancel dialogue.\n *\n * @param {String|Promise} title\n * @param {String|Promise} question\n * @param {String|Promise} saveLabel\n * @param {String|Promise} noLabel\n * @param {String|Promise} saveCallback\n * @param {String|Promise} cancelCallback\n * @returns {Promise}\n */\nexport const confirm = (title, question, saveLabel, noLabel, saveCallback, cancelCallback) =>\n saveCancel(title, question, saveLabel, saveCallback, cancelCallback);\n\n/**\n * The Save and Cancel dialogue helper.\n *\n * @param {String|Promise} title\n * @param {String|Promise} question\n * @param {String|Promise} saveLabel\n * @param {String|Promise} saveCallback\n * @param {String|Promise} cancelCallback\n * @returns {Promise}\n */\nexport const saveCancel = async(title, question, saveLabel, saveCallback, cancelCallback) => {\n const pendingPromise = new Pending('core/notification:confirm');\n\n const [\n ModalFactory,\n ModalEvents,\n ] = await Promise.all([\n import('core/modal_factory'),\n import('core/modal_events'),\n ]);\n\n return ModalFactory.create({\n type: ModalFactory.types.SAVE_CANCEL,\n title: title,\n body: question,\n buttons: {\n // Note: The noLabel is no longer supported.\n save: saveLabel,\n },\n removeOnClose: true,\n })\n .then(function(modal) {\n modal.show();\n\n modal.getRoot().on(ModalEvents.save, saveCallback);\n modal.getRoot().on(ModalEvents.cancel, cancelCallback);\n pendingPromise.resolve();\n\n return modal;\n });\n};\n\n/**\n * Wrap M.core.exception.\n *\n * @param {Error} ex\n */\nexport const exception = async ex => {\n const pendingPromise = new Pending('core/notification:displayException');\n\n // Fudge some parameters.\n if (!ex.stack) {\n ex.stack = '';\n }\n\n if (ex.debuginfo) {\n ex.stack += ex.debuginfo + '\\n';\n }\n\n if (!ex.backtrace && ex.stacktrace) {\n ex.backtrace = ex.stacktrace;\n }\n\n if (ex.backtrace) {\n ex.stack += ex.backtrace;\n const ln = ex.backtrace.match(/line ([^ ]*) of/);\n const fn = ex.backtrace.match(/ of ([^:]*): /);\n if (ln && ln[1]) {\n ex.lineNumber = ln[1];\n }\n if (fn && fn[1]) {\n ex.fileName = fn[1];\n if (ex.fileName.length > 30) {\n ex.fileName = '...' + ex.fileName.substr(ex.fileName.length - 27);\n }\n }\n }\n\n if (typeof ex.name === 'undefined' && ex.errorcode) {\n ex.name = ex.errorcode;\n }\n\n const Y = await import('core/yui');\n Y.use('moodle-core-notification-exception', function() {\n var modal = new M.core.exception(ex);\n\n modal.show();\n\n pendingPromise.resolve();\n });\n};\n\n/**\n * Initialise the page for the suppled context, and displaying the supplied notifications.\n *\n * @param {Number} contextId\n * @param {Array} notificationList\n * @param {Boolean} userLoggedIn\n */\nexport const init = (contextId, notificationList, userLoggedIn) => {\n currentContextId = contextId;\n\n // Setup the message target region if it isn't setup already\n setupTargetRegion();\n\n // Add provided notifications.\n addNotifications(notificationList);\n\n // If the user is not logged in then we can not fetch anything for them.\n if (userLoggedIn) {\n // Perform an initial poll for any new notifications.\n fetchNotifications();\n }\n};\n\n// To maintain backwards compatability we export default here.\nexport default {\n init,\n fetchNotifications,\n addNotification,\n alert,\n confirm,\n saveCancel,\n exception,\n};\n"],"file":"notification.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/notification.js"],"names":["currentContextId","M","cfg","contextid","notificationTypes","success","info","warning","error","notificationRegionId","Selectors","notificationRegion","fallbackRegionParents","setupTargetRegion","targetRegion","getNotificationRegion","newRegion","document","createElement","id","some","selector","querySelector","prepend","fetchNotifications","Ajax","call","methodname","args","then","addNotifications","notifications","length","Promise","resolve","pendingPromise","Pending","forEach","notification","renderNotification","template","variables","addNotification","closebutton","announce","type","message","Log","debug","Templates","renderForPromise","html","js","prependNodeContents","catch","exception","alert","title","cancelText","ModalFactory","create","types","ALERT","body","buttons","cancel","removeOnClose","modal","show","confirm","question","saveLabel","noLabel","saveCallback","cancelCallback","saveCancel","all","ModalEvents","SAVE_CANCEL","save","getRoot","on","ex","stack","debuginfo","backtrace","stacktrace","ln","match","fn","lineNumber","fileName","substr","name","errorcode","Y","use","core","init","contextId","notificationList","userLoggedIn"],"mappings":"0PAeA,OACA,O,6nEAEIA,CAAAA,CAAgB,CAAGC,CAAC,CAACC,GAAF,CAAMC,S,CAEvBC,CAAiB,CAAG,CACtBC,OAAO,CAAG,2BADY,CAEtBC,IAAI,CAAM,wBAFY,CAGtBC,OAAO,CAAG,2BAHY,CAItBC,KAAK,CAAK,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le - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\nimport Pending from 'core/pending';\nimport Log from 'core/log';\n\nlet currentContextId = M.cfg.contextid;\n\nconst notificationTypes = {\n success: 'core/notification_success',\n info: 'core/notification_info',\n warning: 'core/notification_warning',\n error: 'core/notification_error',\n};\n\nconst notificationRegionId = 'user-notifications';\n\nconst Selectors = {\n notificationRegion: `#${notificationRegionId}`,\n fallbackRegionParents: [\n '#region-main',\n '[role=\"main\"]',\n 'body',\n ],\n};\n\nconst setupTargetRegion = () => {\n let targetRegion = getNotificationRegion();\n if (targetRegion) {\n return false;\n }\n\n const newRegion = document.createElement('span');\n newRegion.id = notificationRegionId;\n\n return Selectors.fallbackRegionParents.some(selector => {\n const targetRegion = document.querySelector(selector);\n\n if (targetRegion) {\n targetRegion.prepend(newRegion);\n return true;\n }\n\n return false;\n });\n};\n\n\n/**\n * Poll the server for any new notifications.\n *\n * @returns {Promise}\n */\nexport const fetchNotifications = async() => {\n const Ajax = await import('core/ajax');\n\n return Ajax.call([{\n methodname: 'core_fetch_notifications',\n args: {\n contextid: currentContextId\n }\n }])[0]\n .then(addNotifications);\n};\n\n/**\n * Add all of the supplied notifications.\n *\n * @param {Array} notifications The list of notificaitons\n * @returns {Promise}\n */\nconst addNotifications = notifications => {\n if (!notifications.length) {\n return Promise.resolve();\n }\n\n const pendingPromise = new Pending('core/notification:addNotifications');\n notifications.forEach(notification => renderNotification(notification.template, notification.variables));\n\n return pendingPromise.resolve();\n};\n\n/**\n * Add a notification to the page.\n *\n * Note: This does not cause the notification to be added to the session.\n *\n * @param {Object} notification The notification to add.\n * @param {string} notification.message The body of the notification\n * @param {string} notification.type The type of notification to add (error, warning, info, success).\n * @param {Boolean} notification.closebutton Whether to show the close button.\n * @param {Boolean} notification.announce Whether to announce to screen readers.\n * @returns {Promise}\n */\nexport const addNotification = notification => {\n const pendingPromise = new Pending('core/notification:addNotifications');\n\n let template = notificationTypes.error;\n\n notification = {\n closebutton: true,\n announce: true,\n type: 'error',\n ...notification,\n };\n\n if (notification.template) {\n template = notification.template;\n delete notification.template;\n } else if (notification.type) {\n if (typeof notificationTypes[notification.type] !== 'undefined') {\n template = notificationTypes[notification.type];\n }\n delete notification.type;\n }\n\n return renderNotification(template, notification)\n .then(pendingPromise.resolve);\n};\n\nconst renderNotification = async(template, variables) => {\n if (typeof variables.message === 'undefined' || !variables.message) {\n Log.debug('Notification received without content. Skipping.');\n return;\n }\n\n const pendingPromise = new Pending('core/notification:renderNotification');\n const Templates = await import('core/templates');\n\n Templates.renderForPromise(template, variables)\n .then(({html, js = ''}) => {\n Templates.prependNodeContents(getNotificationRegion(), html, js);\n\n return;\n })\n .then(pendingPromise.resolve)\n .catch(exception);\n};\n\nconst getNotificationRegion = () => document.querySelector(Selectors.notificationRegion);\n\n/**\n * Alert dialogue.\n *\n * @param {String|Promise} title\n * @param {String|Promise} message\n * @param {String|Promise} cancelText\n * @returns {Promise}\n */\nexport const alert = async(title, message, cancelText) => {\n var pendingPromise = new Pending('core/notification:alert');\n\n const ModalFactory = await import('core/modal_factory');\n\n return ModalFactory.create({\n type: ModalFactory.types.ALERT,\n body: message,\n title: title,\n buttons: {\n cancel: cancelText,\n },\n removeOnClose: true,\n })\n .then(function(modal) {\n modal.show();\n\n pendingPromise.resolve();\n return modal;\n });\n};\n\n/**\n * The confirm has now been replaced with a save and cancel dialogue.\n *\n * @param {String|Promise} title\n * @param {String|Promise} question\n * @param {String|Promise} saveLabel\n * @param {String|Promise} noLabel\n * @param {String|Promise} saveCallback\n * @param {String|Promise} cancelCallback\n * @returns {Promise}\n */\nexport const confirm = (title, question, saveLabel, noLabel, saveCallback, cancelCallback) =>\n saveCancel(title, question, saveLabel, saveCallback, cancelCallback);\n\n/**\n * The Save and Cancel dialogue helper.\n *\n * @param {String|Promise} title\n * @param {String|Promise} question\n * @param {String|Promise} saveLabel\n * @param {String|Promise} saveCallback\n * @param {String|Promise} cancelCallback\n * @returns {Promise}\n */\nexport const saveCancel = async(title, question, saveLabel, saveCallback, cancelCallback) => {\n const pendingPromise = new Pending('core/notification:confirm');\n\n const [\n ModalFactory,\n ModalEvents,\n ] = await Promise.all([\n import('core/modal_factory'),\n import('core/modal_events'),\n ]);\n\n return ModalFactory.create({\n type: ModalFactory.types.SAVE_CANCEL,\n title: title,\n body: question,\n buttons: {\n // Note: The noLabel is no longer supported.\n save: saveLabel,\n },\n removeOnClose: true,\n })\n .then(function(modal) {\n modal.show();\n\n modal.getRoot().on(ModalEvents.save, saveCallback);\n modal.getRoot().on(ModalEvents.cancel, cancelCallback);\n pendingPromise.resolve();\n\n return modal;\n });\n};\n\n/**\n * Wrap M.core.exception.\n *\n * @param {Error} ex\n */\nexport const exception = async ex => {\n const pendingPromise = new Pending('core/notification:displayException');\n\n // Fudge some parameters.\n if (!ex.stack) {\n ex.stack = '';\n }\n\n if (ex.debuginfo) {\n ex.stack += ex.debuginfo + '\\n';\n }\n\n if (!ex.backtrace && ex.stacktrace) {\n ex.backtrace = ex.stacktrace;\n }\n\n if (ex.backtrace) {\n ex.stack += ex.backtrace;\n const ln = ex.backtrace.match(/line ([^ ]*) of/);\n const fn = ex.backtrace.match(/ of ([^:]*): /);\n if (ln && ln[1]) {\n ex.lineNumber = ln[1];\n }\n if (fn && fn[1]) {\n ex.fileName = fn[1];\n if (ex.fileName.length > 30) {\n ex.fileName = '...' + ex.fileName.substr(ex.fileName.length - 27);\n }\n }\n }\n\n if (typeof ex.name === 'undefined' && ex.errorcode) {\n ex.name = ex.errorcode;\n }\n\n const Y = await import('core/yui');\n Y.use('moodle-core-notification-exception', function() {\n var modal = new M.core.exception(ex);\n\n modal.show();\n\n pendingPromise.resolve();\n });\n};\n\n/**\n * Initialise the page for the suppled context, and displaying the supplied notifications.\n *\n * @param {Number} contextId\n * @param {Array} notificationList\n * @param {Boolean} userLoggedIn\n */\nexport const init = (contextId, notificationList, userLoggedIn) => {\n currentContextId = contextId;\n\n // Setup the message target region if it isn't setup already\n setupTargetRegion();\n\n // Add provided notifications.\n addNotifications(notificationList);\n\n // If the user is not logged in then we can not fetch anything for them.\n if (userLoggedIn) {\n // Perform an initial poll for any new notifications.\n fetchNotifications();\n }\n};\n\n// To maintain backwards compatability we export default here.\nexport default {\n init,\n fetchNotifications,\n addNotification,\n alert,\n confirm,\n saveCancel,\n exception,\n};\n"],"file":"notification.min.js"} \ No newline at end of file diff --git a/lib/amd/build/popper.min.js b/lib/amd/build/popper.min.js index 4372e1375ec..739ac49e990 100644 --- a/lib/amd/build/popper.min.js +++ b/lib/amd/build/popper.min.js @@ -1,2 +1,2 @@ -function _typeof(e){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(e){return typeof e}}else{_typeof=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e}}return _typeof(e)}(function(e,t){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define ("core/popper",t):e.Popper=t()})(this,function(){'use strict';for(var _="undefined"!=typeof window&&"undefined"!=typeof window.document,X=["Edge","Trident","Firefox"],J=0,Q=0;Q=o.clientWidth&&i>=o.clientHeight}),l=0i[e]&&!t.escapeWithReference){n=Math.min(p[o],i[e]-("right"===e?p.width:p.height))}return ne({},o,n)}};n.forEach(function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";p=re({},p,s[t](e))});e.offsets.popper=p;return e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,o=t.popper,i=t.reference,n=e.placement.split("-")[0],r=Math.floor,p=-1!==["top","bottom"].indexOf(n),s=p?"right":"bottom",d=p?"left":"top",a=p?"width":"height";if(o[s]r(i[s])){e.offsets.popper[d]=r(i[s])}return e}},arrow:{order:500,enabled:!0,fn:function(e,o){if(!j(e.instance.modifiers,"arrow","keepTogether")){return e}var i=o.element;if("string"==typeof i){i=e.instance.popper.querySelector(i);if(!i){return e}}else{if(!e.instance.popper.contains(i)){console.warn("WARNING: `arrow.element` must be child of its popper element!");return e}}var n=e.placement.split("-")[0],r=e.offsets,p=r.popper,s=r.reference,d=-1!==["left","right"].indexOf(n),a=d?"height":"width",l=d?"Top":"Left",f=l.toLowerCase(),m=d?"left":"top",c=d?"bottom":"right",u=O(i)[a];if(s[c]-up[c]){e.offsets.popper[f]+=s[f]+u-p[c]}var g=s[f]+s[a]/2-u/2,b=t(e.instance.popper,"margin"+l).replace("px",""),y=g-h(e.offsets.popper)[f]-b;y=Math.max(Math.min(p[a]-u,y),0);e.arrowElement=i;e.offsets.arrow={};e.offsets.arrow[f]=Math.round(y);e.offsets.arrow[m]="";return e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(e,t){if(k(e.instance.modifiers,"inner")){return e}if(e.flipped&&e.placement===e.originalPlacement){return e}var o=w(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement),i=e.placement.split("-")[0],n=L(i),r=e.placement.split("-")[1]||"",p=[];switch(t.behavior){case de.FLIP:p=[i,n];break;case de.CLOCKWISE:p=K(i);break;case de.COUNTERCLOCKWISE:p=K(i,!0);break;default:p=t.behavior;}p.forEach(function(s,d){if(i!==s||p.length===d+1){return e}i=e.placement.split("-")[0];n=L(i);var a=e.offsets.popper,l=e.offsets.reference,f=Math.floor,m="left"===i&&f(a.right)>f(l.left)||"right"===i&&f(a.left)f(l.top)||"bottom"===i&&f(a.top)f(o.right),u=f(a.top)f(o.bottom),b="left"===i&&c||"right"===i&&h||"top"===i&&u||"bottom"===i&&g,y=-1!==["top","bottom"].indexOf(i),w=!!t.flipVariations&&(y&&"start"===r&&c||y&&"end"===r&&h||!y&&"start"===r&&u||!y&&"end"===r&&g);if(m||b||w){e.flipped=!0;if(m||b){i=p[d+1]}if(w){r=q(r)}e.placement=i+(r?"-"+r:"");e.offsets.popper=re({},e.offsets.popper,S(e.instance.popper,e.offsets.reference,e.placement));e=D(e.instance.modifiers,e,"flip")}});return e},behavior:"flip",padding:5,boundariesElement:"viewport"},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,o=t.split("-")[0],i=e.offsets,n=i.popper,r=i.reference,p=-1!==["left","right"].indexOf(o),s=-1===["top","left"].indexOf(o);n[p?"left":"top"]=r[o]-(s?n[p?"width":"height"]:0);e.placement=L(t);e.offsets.popper=h(n);return e}},hide:{order:800,enabled:!0,fn:function(e){if(!j(e.instance.modifiers,"hide","preventOverflow")){return e}var t=e.offsets.reference,o=T(e.instance.modifiers,function(e){return"preventOverflow"===e.name}).boundaries;if(t.bottomo.right||t.top>o.bottom||t.right=o.clientWidth&&i>=o.clientHeight}),l=0i[e]&&!t.escapeWithReference){n=Math.min(r[o],i[e]-("right"===e?r.width:r.height))}return L({},o,n)}};n.forEach(function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";r=S({},r,p[t](e))});e.offsets.popper=r;return e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,o=t.popper,i=t.reference,n=e.placement.split("-")[0],r=Math.floor,p=-1!==["top","bottom"].indexOf(n),s=p?"right":"bottom",d=p?"left":"top",a=p?"width":"height";if(o[s]r(i[s])){e.offsets.popper[d]=r(i[s])}return e}},arrow:{order:500,enabled:!0,fn:function(e,t){if(!ee(e.instance.modifiers,"arrow","keepTogether")){return e}var o=t.element;if("string"==typeof o){o=e.instance.popper.querySelector(o);if(!o){return e}}else{if(!e.instance.popper.contains(o)){console.warn("WARNING: `arrow.element` must be child of its popper element!");return e}}var i=e.placement.split("-")[0],n=e.offsets,r=n.popper,p=n.reference,s=-1!==["left","right"].indexOf(i),a=s?"height":"width",l=s?"Top":"Left",f=l.toLowerCase(),m=s?"left":"top",c=s?"bottom":"right",h=A(o)[a];if(p[c]-hr[c]){e.offsets.popper[f]+=p[f]+h-r[c]}var u=p[f]+p[a]/2-h/2,g=d(e.instance.popper,"margin"+l).replace("px",""),b=u-T(e.offsets.popper)[f]-g;b=Math.max(Math.min(r[a]-h,b),0);e.arrowElement=o;e.offsets.arrow={};e.offsets.arrow[f]=Math.round(b);e.offsets.arrow[m]="";return e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(e,t){if(j(e.instance.modifiers,"inner")){return e}if(e.flipped&&e.placement===e.originalPlacement){return e}var o=W(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement),i=e.placement.split("-")[0],n=I(i),r=e.placement.split("-")[1]||"",p=[];switch(t.behavior){case re.FLIP:p=[i,n];break;case re.CLOCKWISE:p=ne(i);break;case re.COUNTERCLOCKWISE:p=ne(i,!0);break;default:p=t.behavior;}p.forEach(function(s,d){if(i!==s||p.length===d+1){return e}i=e.placement.split("-")[0];n=I(i);var a=e.offsets.popper,l=e.offsets.reference,f=Math.floor,m="left"===i&&f(a.right)>f(l.left)||"right"===i&&f(a.left)f(l.top)||"bottom"===i&&f(a.top)f(o.right),u=f(a.top)f(o.bottom),b="left"===i&&c||"right"===i&&h||"top"===i&&u||"bottom"===i&&g,y=-1!==["top","bottom"].indexOf(i),w=!!t.flipVariations&&(y&&"start"===r&&c||y&&"end"===r&&h||!y&&"start"===r&&u||!y&&"end"===r&&g);if(m||b||w){e.flipped=!0;if(m||b){i=p[d+1]}if(w){r=te(r)}e.placement=i+(r?"-"+r:"");e.offsets.popper=S({},e.offsets.popper,M(e.instance.popper,e.offsets.reference,e.placement));e=Y(e.instance.modifiers,e,"flip")}});return e},behavior:"flip",padding:5,boundariesElement:"viewport"},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,o=t.split("-")[0],i=e.offsets,n=i.popper,r=i.reference,p=-1!==["left","right"].indexOf(o),s=-1===["top","left"].indexOf(o);n[p?"left":"top"]=r[o]-(s?n[p?"width":"height"]:0);e.placement=I(t);e.offsets.popper=T(n);return e}},hide:{order:800,enabled:!0,fn:function(e){if(!ee(e.instance.modifiers,"hide","preventOverflow")){return e}var t=e.offsets.reference,o=R(e.instance.modifiers,function(e){return"preventOverflow"===e.name}).boundaries;if(t.bottomo.right||t.top>o.bottom||t.right= 0) {\n timeoutDuration = 1;\n break;\n }\n}\n\nfunction microtaskDebounce(fn) {\n var called = false;\n return function () {\n if (called) {\n return;\n }\n called = true;\n Promise.resolve().then(function () {\n called = false;\n fn();\n });\n };\n}\n\nfunction taskDebounce(fn) {\n var scheduled = false;\n return function () {\n if (!scheduled) {\n scheduled = true;\n setTimeout(function () {\n scheduled = false;\n fn();\n }, timeoutDuration);\n }\n };\n}\n\nvar supportsMicroTasks = isBrowser && window.Promise;\n\n/**\n* Create a debounced version of a method, that's asynchronously deferred\n* but called in the minimum time possible.\n*\n* @method\n* @memberof Popper.Utils\n* @argument {Function} fn\n* @returns {Function}\n*/\nvar debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;\n\n/**\n * Check if the given variable is a function\n * @method\n * @memberof Popper.Utils\n * @argument {Any} functionToCheck - variable to check\n * @returns {Boolean} answer to: is a function?\n */\nfunction isFunction(functionToCheck) {\n var getType = {};\n return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';\n}\n\n/**\n * Get CSS computed property of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Eement} element\n * @argument {String} property\n */\nfunction getStyleComputedProperty(element, property) {\n if (element.nodeType !== 1) {\n return [];\n }\n // NOTE: 1 DOM access here\n var css = window.getComputedStyle(element, null);\n return property ? css[property] : css;\n}\n\n/**\n * Returns the parentNode or the host of the element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} parent\n */\nfunction getParentNode(element) {\n if (element.nodeName === 'HTML') {\n return element;\n }\n return element.parentNode || element.host;\n}\n\n/**\n * Returns the scrolling parent of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} scroll parent\n */\nfunction getScrollParent(element) {\n // Return body, `getScroll` will take care to get the correct `scrollTop` from it\n if (!element) {\n return window.document.body;\n }\n\n switch (element.nodeName) {\n case 'HTML':\n case 'BODY':\n return element.ownerDocument.body;\n case '#document':\n return element.body;\n }\n\n // Firefox want us to check `-x` and `-y` variations as well\n\n var _getStyleComputedProp = getStyleComputedProperty(element),\n overflow = _getStyleComputedProp.overflow,\n overflowX = _getStyleComputedProp.overflowX,\n overflowY = _getStyleComputedProp.overflowY;\n\n if (/(auto|scroll)/.test(overflow + overflowY + overflowX)) {\n return element;\n }\n\n return getScrollParent(getParentNode(element));\n}\n\n/**\n * Returns the offset parent of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} offset parent\n */\nfunction getOffsetParent(element) {\n // NOTE: 1 DOM access here\n var offsetParent = element && element.offsetParent;\n var nodeName = offsetParent && offsetParent.nodeName;\n\n if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {\n if (element) {\n return element.ownerDocument.documentElement;\n }\n\n return window.document.documentElement;\n }\n\n // .offsetParent will return the closest TD or TABLE in case\n // no offsetParent is present, I hate this job...\n if (['TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {\n return getOffsetParent(offsetParent);\n }\n\n return offsetParent;\n}\n\nfunction isOffsetContainer(element) {\n var nodeName = element.nodeName;\n\n if (nodeName === 'BODY') {\n return false;\n }\n return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;\n}\n\n/**\n * Finds the root node (document, shadowDOM root) of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} node\n * @returns {Element} root node\n */\nfunction getRoot(node) {\n if (node.parentNode !== null) {\n return getRoot(node.parentNode);\n }\n\n return node;\n}\n\n/**\n * Finds the offset parent common to the two provided nodes\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element1\n * @argument {Element} element2\n * @returns {Element} common offset parent\n */\nfunction findCommonOffsetParent(element1, element2) {\n // This check is needed to avoid errors in case one of the elements isn't defined for any reason\n if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {\n return window.document.documentElement;\n }\n\n // Here we make sure to give as \"start\" the element that comes first in the DOM\n var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;\n var start = order ? element1 : element2;\n var end = order ? element2 : element1;\n\n // Get common ancestor container\n var range = document.createRange();\n range.setStart(start, 0);\n range.setEnd(end, 0);\n var commonAncestorContainer = range.commonAncestorContainer;\n\n // Both nodes are inside #document\n\n if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {\n if (isOffsetContainer(commonAncestorContainer)) {\n return commonAncestorContainer;\n }\n\n return getOffsetParent(commonAncestorContainer);\n }\n\n // one of the nodes is inside shadowDOM, find which one\n var element1root = getRoot(element1);\n if (element1root.host) {\n return findCommonOffsetParent(element1root.host, element2);\n } else {\n return findCommonOffsetParent(element1, getRoot(element2).host);\n }\n}\n\n/**\n * Gets the scroll value of the given element in the given side (top and left)\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @argument {String} side `top` or `left`\n * @returns {number} amount of scrolled pixels\n */\nfunction getScroll(element) {\n var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';\n\n var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';\n var nodeName = element.nodeName;\n\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n var html = element.ownerDocument.documentElement;\n var scrollingElement = element.ownerDocument.scrollingElement || html;\n return scrollingElement[upperSide];\n }\n\n return element[upperSide];\n}\n\n/*\n * Sum or subtract the element scroll values (left and top) from a given rect object\n * @method\n * @memberof Popper.Utils\n * @param {Object} rect - Rect object you want to change\n * @param {HTMLElement} element - The element from the function reads the scroll values\n * @param {Boolean} subtract - set to true if you want to subtract the scroll values\n * @return {Object} rect - The modifier rect object\n */\nfunction includeScroll(rect, element) {\n var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n var scrollTop = getScroll(element, 'top');\n var scrollLeft = getScroll(element, 'left');\n var modifier = subtract ? -1 : 1;\n rect.top += scrollTop * modifier;\n rect.bottom += scrollTop * modifier;\n rect.left += scrollLeft * modifier;\n rect.right += scrollLeft * modifier;\n return rect;\n}\n\n/*\n * Helper to detect borders of a given element\n * @method\n * @memberof Popper.Utils\n * @param {CSSStyleDeclaration} styles\n * Result of `getStyleComputedProperty` on the given element\n * @param {String} axis - `x` or `y`\n * @return {number} borders - The borders size of the given axis\n */\n\nfunction getBordersSize(styles, axis) {\n var sideA = axis === 'x' ? 'Left' : 'Top';\n var sideB = sideA === 'Left' ? 'Right' : 'Bottom';\n\n return +styles['border' + sideA + 'Width'].split('px')[0] + +styles['border' + sideB + 'Width'].split('px')[0];\n}\n\n/**\n * Tells if you are running Internet Explorer 10\n * @method\n * @memberof Popper.Utils\n * @returns {Boolean} isIE10\n */\nvar isIE10 = undefined;\n\nvar isIE10$1 = function () {\n if (isIE10 === undefined) {\n isIE10 = navigator.appVersion.indexOf('MSIE 10') !== -1;\n }\n return isIE10;\n};\n\nfunction getSize(axis, body, html, computedStyle) {\n return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE10$1() ? html['offset' + axis] + computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')] + computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')] : 0);\n}\n\nfunction getWindowSizes() {\n var body = window.document.body;\n var html = window.document.documentElement;\n var computedStyle = isIE10$1() && window.getComputedStyle(html);\n\n return {\n height: getSize('Height', body, html, computedStyle),\n width: getSize('Width', body, html, computedStyle)\n };\n}\n\nvar classCallCheck = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\n\nvar createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\n\n\n\n\nvar defineProperty = function (obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n};\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\n/**\n * Given element offsets, generate an output similar to getBoundingClientRect\n * @method\n * @memberof Popper.Utils\n * @argument {Object} offsets\n * @returns {Object} ClientRect like output\n */\nfunction getClientRect(offsets) {\n return _extends({}, offsets, {\n right: offsets.left + offsets.width,\n bottom: offsets.top + offsets.height\n });\n}\n\n/**\n * Get bounding client rect of given element\n * @method\n * @memberof Popper.Utils\n * @param {HTMLElement} element\n * @return {Object} client rect\n */\nfunction getBoundingClientRect(element) {\n var rect = {};\n\n // IE10 10 FIX: Please, don't ask, the element isn't\n // considered in DOM in some circumstances...\n // This isn't reproducible in IE10 compatibility mode of IE11\n if (isIE10$1()) {\n try {\n rect = element.getBoundingClientRect();\n var scrollTop = getScroll(element, 'top');\n var scrollLeft = getScroll(element, 'left');\n rect.top += scrollTop;\n rect.left += scrollLeft;\n rect.bottom += scrollTop;\n rect.right += scrollLeft;\n } catch (err) {}\n } else {\n rect = element.getBoundingClientRect();\n }\n\n var result = {\n left: rect.left,\n top: rect.top,\n width: rect.right - rect.left,\n height: rect.bottom - rect.top\n };\n\n // subtract scrollbar size from sizes\n var sizes = element.nodeName === 'HTML' ? getWindowSizes() : {};\n var width = sizes.width || element.clientWidth || result.right - result.left;\n var height = sizes.height || element.clientHeight || result.bottom - result.top;\n\n var horizScrollbar = element.offsetWidth - width;\n var vertScrollbar = element.offsetHeight - height;\n\n // if an hypothetical scrollbar is detected, we must be sure it's not a `border`\n // we make this check conditional for performance reasons\n if (horizScrollbar || vertScrollbar) {\n var styles = getStyleComputedProperty(element);\n horizScrollbar -= getBordersSize(styles, 'x');\n vertScrollbar -= getBordersSize(styles, 'y');\n\n result.width -= horizScrollbar;\n result.height -= vertScrollbar;\n }\n\n return getClientRect(result);\n}\n\nfunction getOffsetRectRelativeToArbitraryNode(children, parent) {\n var isIE10 = isIE10$1();\n var isHTML = parent.nodeName === 'HTML';\n var childrenRect = getBoundingClientRect(children);\n var parentRect = getBoundingClientRect(parent);\n var scrollParent = getScrollParent(children);\n\n var styles = getStyleComputedProperty(parent);\n var borderTopWidth = +styles.borderTopWidth.split('px')[0];\n var borderLeftWidth = +styles.borderLeftWidth.split('px')[0];\n\n var offsets = getClientRect({\n top: childrenRect.top - parentRect.top - borderTopWidth,\n left: childrenRect.left - parentRect.left - borderLeftWidth,\n width: childrenRect.width,\n height: childrenRect.height\n });\n offsets.marginTop = 0;\n offsets.marginLeft = 0;\n\n // Subtract margins of documentElement in case it's being used as parent\n // we do this only on HTML because it's the only element that behaves\n // differently when margins are applied to it. The margins are included in\n // the box of the documentElement, in the other cases not.\n if (!isIE10 && isHTML) {\n var marginTop = +styles.marginTop.split('px')[0];\n var marginLeft = +styles.marginLeft.split('px')[0];\n\n offsets.top -= borderTopWidth - marginTop;\n offsets.bottom -= borderTopWidth - marginTop;\n offsets.left -= borderLeftWidth - marginLeft;\n offsets.right -= borderLeftWidth - marginLeft;\n\n // Attach marginTop and marginLeft because in some circumstances we may need them\n offsets.marginTop = marginTop;\n offsets.marginLeft = marginLeft;\n }\n\n if (isIE10 ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {\n offsets = includeScroll(offsets, parent);\n }\n\n return offsets;\n}\n\nfunction getViewportOffsetRectRelativeToArtbitraryNode(element) {\n var html = element.ownerDocument.documentElement;\n var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);\n var width = Math.max(html.clientWidth, window.innerWidth || 0);\n var height = Math.max(html.clientHeight, window.innerHeight || 0);\n\n var scrollTop = getScroll(html);\n var scrollLeft = getScroll(html, 'left');\n\n var offset = {\n top: scrollTop - relativeOffset.top + relativeOffset.marginTop,\n left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,\n width: width,\n height: height\n };\n\n return getClientRect(offset);\n}\n\n/**\n * Check if the given element is fixed or is inside a fixed parent\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @argument {Element} customContainer\n * @returns {Boolean} answer to \"isFixed?\"\n */\nfunction isFixed(element) {\n var nodeName = element.nodeName;\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n return false;\n }\n if (getStyleComputedProperty(element, 'position') === 'fixed') {\n return true;\n }\n return isFixed(getParentNode(element));\n}\n\n/**\n * Computed the boundaries limits and return them\n * @method\n * @memberof Popper.Utils\n * @param {HTMLElement} popper\n * @param {HTMLElement} reference\n * @param {number} padding\n * @param {HTMLElement} boundariesElement - Element used to define the boundaries\n * @returns {Object} Coordinates of the boundaries\n */\nfunction getBoundaries(popper, reference, padding, boundariesElement) {\n // NOTE: 1 DOM access here\n var boundaries = { top: 0, left: 0 };\n var offsetParent = findCommonOffsetParent(popper, reference);\n\n // Handle viewport case\n if (boundariesElement === 'viewport') {\n boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent);\n } else {\n // Handle other cases based on DOM element used as boundaries\n var boundariesNode = void 0;\n if (boundariesElement === 'scrollParent') {\n boundariesNode = getScrollParent(getParentNode(popper));\n if (boundariesNode.nodeName === 'BODY') {\n boundariesNode = popper.ownerDocument.documentElement;\n }\n } else if (boundariesElement === 'window') {\n boundariesNode = popper.ownerDocument.documentElement;\n } else {\n boundariesNode = boundariesElement;\n }\n\n var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent);\n\n // In case of HTML, we need a different computation\n if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {\n var _getWindowSizes = getWindowSizes(),\n height = _getWindowSizes.height,\n width = _getWindowSizes.width;\n\n boundaries.top += offsets.top - offsets.marginTop;\n boundaries.bottom = height + offsets.top;\n boundaries.left += offsets.left - offsets.marginLeft;\n boundaries.right = width + offsets.left;\n } else {\n // for all the other DOM elements, this one is good\n boundaries = offsets;\n }\n }\n\n // Add paddings\n boundaries.left += padding;\n boundaries.top += padding;\n boundaries.right -= padding;\n boundaries.bottom -= padding;\n\n return boundaries;\n}\n\nfunction getArea(_ref) {\n var width = _ref.width,\n height = _ref.height;\n\n return width * height;\n}\n\n/**\n * Utility used to transform the `auto` placement to the placement with more\n * available space.\n * @method\n * @memberof Popper.Utils\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {\n var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;\n\n if (placement.indexOf('auto') === -1) {\n return placement;\n }\n\n var boundaries = getBoundaries(popper, reference, padding, boundariesElement);\n\n var rects = {\n top: {\n width: boundaries.width,\n height: refRect.top - boundaries.top\n },\n right: {\n width: boundaries.right - refRect.right,\n height: boundaries.height\n },\n bottom: {\n width: boundaries.width,\n height: boundaries.bottom - refRect.bottom\n },\n left: {\n width: refRect.left - boundaries.left,\n height: boundaries.height\n }\n };\n\n var sortedAreas = Object.keys(rects).map(function (key) {\n return _extends({\n key: key\n }, rects[key], {\n area: getArea(rects[key])\n });\n }).sort(function (a, b) {\n return b.area - a.area;\n });\n\n var filteredAreas = sortedAreas.filter(function (_ref2) {\n var width = _ref2.width,\n height = _ref2.height;\n return width >= popper.clientWidth && height >= popper.clientHeight;\n });\n\n var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;\n\n var variation = placement.split('-')[1];\n\n return computedPlacement + (variation ? '-' + variation : '');\n}\n\n/**\n * Get offsets to the reference element\n * @method\n * @memberof Popper.Utils\n * @param {Object} state\n * @param {Element} popper - the popper element\n * @param {Element} reference - the reference element (the popper will be relative to this)\n * @returns {Object} An object containing the offsets which will be applied to the popper\n */\nfunction getReferenceOffsets(state, popper, reference) {\n var commonOffsetParent = findCommonOffsetParent(popper, reference);\n return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent);\n}\n\n/**\n * Get the outer sizes of the given element (offset size + margins)\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Object} object containing width and height properties\n */\nfunction getOuterSizes(element) {\n var styles = window.getComputedStyle(element);\n var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);\n var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);\n var result = {\n width: element.offsetWidth + y,\n height: element.offsetHeight + x\n };\n return result;\n}\n\n/**\n * Get the opposite placement of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement\n * @returns {String} flipped placement\n */\nfunction getOppositePlacement(placement) {\n var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}\n\n/**\n * Get offsets to the popper\n * @method\n * @memberof Popper.Utils\n * @param {Object} position - CSS position the Popper will get applied\n * @param {HTMLElement} popper - the popper element\n * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)\n * @param {String} placement - one of the valid placement options\n * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper\n */\nfunction getPopperOffsets(popper, referenceOffsets, placement) {\n placement = placement.split('-')[0];\n\n // Get popper node sizes\n var popperRect = getOuterSizes(popper);\n\n // Add position, width and height to our offsets object\n var popperOffsets = {\n width: popperRect.width,\n height: popperRect.height\n };\n\n // depending by the popper placement we have to compute its offsets slightly differently\n var isHoriz = ['right', 'left'].indexOf(placement) !== -1;\n var mainSide = isHoriz ? 'top' : 'left';\n var secondarySide = isHoriz ? 'left' : 'top';\n var measurement = isHoriz ? 'height' : 'width';\n var secondaryMeasurement = !isHoriz ? 'height' : 'width';\n\n popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;\n if (placement === secondarySide) {\n popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];\n } else {\n popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];\n }\n\n return popperOffsets;\n}\n\n/**\n * Mimics the `find` method of Array\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\nfunction find(arr, check) {\n // use native find if supported\n if (Array.prototype.find) {\n return arr.find(check);\n }\n\n // use `filter` to obtain the same behavior of `find`\n return arr.filter(check)[0];\n}\n\n/**\n * Return the index of the matching object\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\nfunction findIndex(arr, prop, value) {\n // use native findIndex if supported\n if (Array.prototype.findIndex) {\n return arr.findIndex(function (cur) {\n return cur[prop] === value;\n });\n }\n\n // use `find` + `indexOf` if `findIndex` isn't supported\n var match = find(arr, function (obj) {\n return obj[prop] === value;\n });\n return arr.indexOf(match);\n}\n\n/**\n * Loop trough the list of modifiers and run them in order,\n * each of them will then edit the data object.\n * @method\n * @memberof Popper.Utils\n * @param {dataObject} data\n * @param {Array} modifiers\n * @param {String} ends - Optional modifier name used as stopper\n * @returns {dataObject}\n */\nfunction runModifiers(modifiers, data, ends) {\n var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));\n\n modifiersToRun.forEach(function (modifier) {\n if (modifier['function']) {\n // eslint-disable-line dot-notation\n console.warn('`modifier.function` is deprecated, use `modifier.fn`!');\n }\n var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation\n if (modifier.enabled && isFunction(fn)) {\n // Add properties to offsets to make them a complete clientRect object\n // we do this before each modifier to make sure the previous one doesn't\n // mess with these values\n data.offsets.popper = getClientRect(data.offsets.popper);\n data.offsets.reference = getClientRect(data.offsets.reference);\n\n data = fn(data, modifier);\n }\n });\n\n return data;\n}\n\n/**\n * Updates the position of the popper, computing the new offsets and applying\n * the new style.
      \n * Prefer `scheduleUpdate` over `update` because of performance reasons.\n * @method\n * @memberof Popper\n */\nfunction update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n data.offsets.popper.position = 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}\n\n/**\n * Helper used to know if the given modifier is enabled.\n * @method\n * @memberof Popper.Utils\n * @returns {Boolean}\n */\nfunction isModifierEnabled(modifiers, modifierName) {\n return modifiers.some(function (_ref) {\n var name = _ref.name,\n enabled = _ref.enabled;\n return enabled && name === modifierName;\n });\n}\n\n/**\n * Get the prefixed supported property name\n * @method\n * @memberof Popper.Utils\n * @argument {String} property (camelCase)\n * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)\n */\nfunction getSupportedPropertyName(property) {\n var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];\n var upperProp = property.charAt(0).toUpperCase() + property.slice(1);\n\n for (var i = 0; i < prefixes.length - 1; i++) {\n var prefix = prefixes[i];\n var toCheck = prefix ? '' + prefix + upperProp : property;\n if (typeof window.document.body.style[toCheck] !== 'undefined') {\n return toCheck;\n }\n }\n return null;\n}\n\n/**\n * Destroy the popper\n * @method\n * @memberof Popper\n */\nfunction destroy() {\n this.state.isDestroyed = true;\n\n // touch DOM only if `applyStyle` modifier is enabled\n if (isModifierEnabled(this.modifiers, 'applyStyle')) {\n this.popper.removeAttribute('x-placement');\n this.popper.style.left = '';\n this.popper.style.position = '';\n this.popper.style.top = '';\n this.popper.style[getSupportedPropertyName('transform')] = '';\n }\n\n this.disableEventListeners();\n\n // remove the popper if user explicity asked for the deletion on destroy\n // do not use `remove` because IE11 doesn't support it\n if (this.options.removeOnDestroy) {\n this.popper.parentNode.removeChild(this.popper);\n }\n return this;\n}\n\n/**\n * Get the window associated with the element\n * @argument {Element} element\n * @returns {Window}\n */\nfunction getWindow(element) {\n var ownerDocument = element.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView : window;\n}\n\nfunction attachToScrollParents(scrollParent, event, callback, scrollParents) {\n var isBody = scrollParent.nodeName === 'BODY';\n var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;\n target.addEventListener(event, callback, { passive: true });\n\n if (!isBody) {\n attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);\n }\n scrollParents.push(target);\n}\n\n/**\n * Setup needed event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\nfunction setupEventListeners(reference, options, state, updateBound) {\n // Resize event listener on window\n state.updateBound = updateBound;\n getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });\n\n // Scroll event listener on scroll parents\n var scrollElement = getScrollParent(reference);\n attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);\n state.scrollElement = scrollElement;\n state.eventsEnabled = true;\n\n return state;\n}\n\n/**\n * It will add resize/scroll events and start recalculating\n * position of the popper element when they are triggered.\n * @method\n * @memberof Popper\n */\nfunction enableEventListeners() {\n if (!this.state.eventsEnabled) {\n this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);\n }\n}\n\n/**\n * Remove event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\nfunction removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}\n\n/**\n * It will remove resize/scroll events and won't recalculate popper position\n * when they are triggered. It also won't trigger onUpdate callback anymore,\n * unless you call `update` method manually.\n * @method\n * @memberof Popper\n */\nfunction disableEventListeners() {\n if (this.state.eventsEnabled) {\n window.cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n}\n\n/**\n * Tells if a given input is a number\n * @method\n * @memberof Popper.Utils\n * @param {*} input to check\n * @return {Boolean}\n */\nfunction isNumeric(n) {\n return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);\n}\n\n/**\n * Set the style to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the style to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\nfunction setStyles(element, styles) {\n Object.keys(styles).forEach(function (prop) {\n var unit = '';\n // add unit if the value is numeric and is one of the following\n if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {\n unit = 'px';\n }\n element.style[prop] = styles[prop] + unit;\n });\n}\n\n/**\n * Set the attributes to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the attributes to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\nfunction setAttributes(element, attributes) {\n Object.keys(attributes).forEach(function (prop) {\n var value = attributes[prop];\n if (value !== false) {\n element.setAttribute(prop, attributes[prop]);\n } else {\n element.removeAttribute(prop);\n }\n });\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} data.styles - List of style properties - values to apply to popper element\n * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The same data object\n */\nfunction applyStyle(data) {\n // any property present in `data.styles` will be applied to the popper,\n // in this way we can make the 3rd party modifiers add custom styles to it\n // Be aware, modifiers could override the properties defined in the previous\n // lines of this modifier!\n setStyles(data.instance.popper, data.styles);\n\n // any property present in `data.attributes` will be applied to the popper,\n // they will be set as HTML attributes of the element\n setAttributes(data.instance.popper, data.attributes);\n\n // if arrowElement is defined and arrowStyles has some properties\n if (data.arrowElement && Object.keys(data.arrowStyles).length) {\n setStyles(data.arrowElement, data.arrowStyles);\n }\n\n return data;\n}\n\n/**\n * Set the x-placement attribute before everything else because it could be used\n * to add margins to the popper margins needs to be calculated to get the\n * correct popper offsets.\n * @method\n * @memberof Popper.modifiers\n * @param {HTMLElement} reference - The reference element used to position the popper\n * @param {HTMLElement} popper - The HTML element used as popper.\n * @param {Object} options - Popper.js options\n */\nfunction applyStyleOnLoad(reference, popper, options, modifierOptions, state) {\n // compute reference element offsets\n var referenceOffsets = getReferenceOffsets(state, popper, reference);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);\n\n popper.setAttribute('x-placement', placement);\n\n // Apply `position` to popper before anything else because\n // without the position applied we can't guarantee correct computations\n setStyles(popper, { position: 'absolute' });\n\n return options;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction computeStyle(data, options) {\n var x = options.x,\n y = options.y;\n var popper = data.offsets.popper;\n\n // Remove this legacy support in Popper.js v2\n\n var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {\n return modifier.name === 'applyStyle';\n }).gpuAcceleration;\n if (legacyGpuAccelerationOption !== undefined) {\n console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');\n }\n var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;\n\n var offsetParent = getOffsetParent(data.instance.popper);\n var offsetParentRect = getBoundingClientRect(offsetParent);\n\n // Styles\n var styles = {\n position: popper.position\n };\n\n // floor sides to avoid blurry text\n var offsets = {\n left: Math.floor(popper.left),\n top: Math.floor(popper.top),\n bottom: Math.floor(popper.bottom),\n right: Math.floor(popper.right)\n };\n\n var sideA = x === 'bottom' ? 'top' : 'bottom';\n var sideB = y === 'right' ? 'left' : 'right';\n\n // if gpuAcceleration is set to `true` and transform is supported,\n // we use `translate3d` to apply the position to the popper we\n // automatically use the supported prefixed version if needed\n var prefixedProperty = getSupportedPropertyName('transform');\n\n // now, let's make a step back and look at this code closely (wtf?)\n // If the content of the popper grows once it's been positioned, it\n // may happen that the popper gets misplaced because of the new content\n // overflowing its reference element\n // To avoid this problem, we provide two options (x and y), which allow\n // the consumer to define the offset origin.\n // If we position a popper on top of a reference element, we can set\n // `x` to `top` to make the popper grow towards its top instead of\n // its bottom.\n var left = void 0,\n top = void 0;\n if (sideA === 'bottom') {\n top = -offsetParentRect.height + offsets.bottom;\n } else {\n top = offsets.top;\n }\n if (sideB === 'right') {\n left = -offsetParentRect.width + offsets.right;\n } else {\n left = offsets.left;\n }\n if (gpuAcceleration && prefixedProperty) {\n styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';\n styles[sideA] = 0;\n styles[sideB] = 0;\n styles.willChange = 'transform';\n } else {\n // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties\n var invertTop = sideA === 'bottom' ? -1 : 1;\n var invertLeft = sideB === 'right' ? -1 : 1;\n styles[sideA] = top * invertTop;\n styles[sideB] = left * invertLeft;\n styles.willChange = sideA + ', ' + sideB;\n }\n\n // Attributes\n var attributes = {\n 'x-placement': data.placement\n };\n\n // Update `data` attributes, styles and arrowStyles\n data.attributes = _extends({}, attributes, data.attributes);\n data.styles = _extends({}, styles, data.styles);\n data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);\n\n return data;\n}\n\n/**\n * Helper used to know if the given modifier depends from another one.
      \n * It checks if the needed modifier is listed and enabled.\n * @method\n * @memberof Popper.Utils\n * @param {Array} modifiers - list of modifiers\n * @param {String} requestingName - name of requesting modifier\n * @param {String} requestedName - name of requested modifier\n * @returns {Boolean}\n */\nfunction isModifierRequired(modifiers, requestingName, requestedName) {\n var requesting = find(modifiers, function (_ref) {\n var name = _ref.name;\n return name === requestingName;\n });\n\n var isRequired = !!requesting && modifiers.some(function (modifier) {\n return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;\n });\n\n if (!isRequired) {\n var _requesting = '`' + requestingName + '`';\n var requested = '`' + requestedName + '`';\n console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');\n }\n return isRequired;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction arrow(data, options) {\n // arrow depends on keepTogether in order to work\n if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {\n return data;\n }\n\n var arrowElement = options.element;\n\n // if arrowElement is a string, suppose it's a CSS selector\n if (typeof arrowElement === 'string') {\n arrowElement = data.instance.popper.querySelector(arrowElement);\n\n // if arrowElement is not found, don't run the modifier\n if (!arrowElement) {\n return data;\n }\n } else {\n // if the arrowElement isn't a query selector we must check that the\n // provided DOM node is child of its popper node\n if (!data.instance.popper.contains(arrowElement)) {\n console.warn('WARNING: `arrow.element` must be child of its popper element!');\n return data;\n }\n }\n\n var placement = data.placement.split('-')[0];\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var isVertical = ['left', 'right'].indexOf(placement) !== -1;\n\n var len = isVertical ? 'height' : 'width';\n var sideCapitalized = isVertical ? 'Top' : 'Left';\n var side = sideCapitalized.toLowerCase();\n var altSide = isVertical ? 'left' : 'top';\n var opSide = isVertical ? 'bottom' : 'right';\n var arrowElementSize = getOuterSizes(arrowElement)[len];\n\n //\n // extends keepTogether behavior making sure the popper and its\n // reference have enough pixels in conjuction\n //\n\n // top/left side\n if (reference[opSide] - arrowElementSize < popper[side]) {\n data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);\n }\n // bottom/right side\n if (reference[side] + arrowElementSize > popper[opSide]) {\n data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];\n }\n\n // compute center of the popper\n var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;\n\n // Compute the sideValue using the updated popper offsets\n // take popper margin in account because we don't have this info available\n var popperMarginSide = getStyleComputedProperty(data.instance.popper, 'margin' + sideCapitalized).replace('px', '');\n var sideValue = center - getClientRect(data.offsets.popper)[side] - popperMarginSide;\n\n // prevent arrowElement from being placed not contiguously to its popper\n sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);\n\n data.arrowElement = arrowElement;\n data.offsets.arrow = {};\n data.offsets.arrow[side] = Math.round(sideValue);\n data.offsets.arrow[altSide] = ''; // make sure to unset any eventual altSide value from the DOM node\n\n return data;\n}\n\n/**\n * Get the opposite placement variation of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement variation\n * @returns {String} flipped placement variation\n */\nfunction getOppositeVariation(variation) {\n if (variation === 'end') {\n return 'start';\n } else if (variation === 'start') {\n return 'end';\n }\n return variation;\n}\n\n/**\n * List of accepted placements to use as values of the `placement` option.
      \n * Valid placements are:\n * - `auto`\n * - `top`\n * - `right`\n * - `bottom`\n * - `left`\n *\n * Each placement can have a variation from this list:\n * - `-start`\n * - `-end`\n *\n * Variations are interpreted easily if you think of them as the left to right\n * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`\n * is right.
      \n * Vertically (`left` and `right`), `start` is top and `end` is bottom.\n *\n * Some valid examples are:\n * - `top-end` (on top of reference, right aligned)\n * - `right-start` (on right of reference, top aligned)\n * - `bottom` (on bottom, centered)\n * - `auto-right` (on the side with more space available, alignment depends by placement)\n *\n * @static\n * @type {Array}\n * @enum {String}\n * @readonly\n * @method placements\n * @memberof Popper\n */\nvar placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];\n\n// Get rid of `auto` `auto-start` and `auto-end`\nvar validPlacements = placements.slice(3);\n\n/**\n * Given an initial placement, returns all the subsequent placements\n * clockwise (or counter-clockwise).\n *\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement - A valid placement (it accepts variations)\n * @argument {Boolean} counter - Set to true to walk the placements counterclockwise\n * @returns {Array} placements including their variations\n */\nfunction clockwise(placement) {\n var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var index = validPlacements.indexOf(placement);\n var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));\n return counter ? arr.reverse() : arr;\n}\n\nvar BEHAVIORS = {\n FLIP: 'flip',\n CLOCKWISE: 'clockwise',\n COUNTERCLOCKWISE: 'counterclockwise'\n};\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction flip(data, options) {\n // if `inner` modifier is enabled, we can't use the `flip` modifier\n if (isModifierEnabled(data.instance.modifiers, 'inner')) {\n return data;\n }\n\n if (data.flipped && data.placement === data.originalPlacement) {\n // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides\n return data;\n }\n\n var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement);\n\n var placement = data.placement.split('-')[0];\n var placementOpposite = getOppositePlacement(placement);\n var variation = data.placement.split('-')[1] || '';\n\n var flipOrder = [];\n\n switch (options.behavior) {\n case BEHAVIORS.FLIP:\n flipOrder = [placement, placementOpposite];\n break;\n case BEHAVIORS.CLOCKWISE:\n flipOrder = clockwise(placement);\n break;\n case BEHAVIORS.COUNTERCLOCKWISE:\n flipOrder = clockwise(placement, true);\n break;\n default:\n flipOrder = options.behavior;\n }\n\n flipOrder.forEach(function (step, index) {\n if (placement !== step || flipOrder.length === index + 1) {\n return data;\n }\n\n placement = data.placement.split('-')[0];\n placementOpposite = getOppositePlacement(placement);\n\n var popperOffsets = data.offsets.popper;\n var refOffsets = data.offsets.reference;\n\n // using floor because the reference offsets may contain decimals we are not going to consider here\n var floor = Math.floor;\n var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);\n\n var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);\n var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);\n var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);\n var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);\n\n var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;\n\n // flip the variation if required\n var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n var flippedVariation = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);\n\n if (overlapsRef || overflowsBoundaries || flippedVariation) {\n // this boolean to detect any flip loop\n data.flipped = true;\n\n if (overlapsRef || overflowsBoundaries) {\n placement = flipOrder[index + 1];\n }\n\n if (flippedVariation) {\n variation = getOppositeVariation(variation);\n }\n\n data.placement = placement + (variation ? '-' + variation : '');\n\n // this object contains `position`, we want to preserve it along with\n // any additional property we may add in the future\n data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));\n\n data = runModifiers(data.instance.modifiers, data, 'flip');\n }\n });\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction keepTogether(data) {\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var placement = data.placement.split('-')[0];\n var floor = Math.floor;\n var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n var side = isVertical ? 'right' : 'bottom';\n var opSide = isVertical ? 'left' : 'top';\n var measurement = isVertical ? 'width' : 'height';\n\n if (popper[side] < floor(reference[opSide])) {\n data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];\n }\n if (popper[opSide] > floor(reference[side])) {\n data.offsets.popper[opSide] = floor(reference[side]);\n }\n\n return data;\n}\n\n/**\n * Converts a string containing value + unit into a px value number\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} str - Value + unit string\n * @argument {String} measurement - `height` or `width`\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @returns {Number|String}\n * Value in pixels, or original string if no values were extracted\n */\nfunction toValue(str, measurement, popperOffsets, referenceOffsets) {\n // separate value from unit\n var split = str.match(/((?:\\-|\\+)?\\d*\\.?\\d*)(.*)/);\n var value = +split[1];\n var unit = split[2];\n\n // If it's not a number it's an operator, I guess\n if (!value) {\n return str;\n }\n\n if (unit.indexOf('%') === 0) {\n var element = void 0;\n switch (unit) {\n case '%p':\n element = popperOffsets;\n break;\n case '%':\n case '%r':\n default:\n element = referenceOffsets;\n }\n\n var rect = getClientRect(element);\n return rect[measurement] / 100 * value;\n } else if (unit === 'vh' || unit === 'vw') {\n // if is a vh or vw, we calculate the size based on the viewport\n var size = void 0;\n if (unit === 'vh') {\n size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);\n } else {\n size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);\n }\n return size / 100 * value;\n } else {\n // if is an explicit pixel unit, we get rid of the unit and keep the value\n // if is an implicit unit, it's px, and we return just the value\n return value;\n }\n}\n\n/**\n * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} offset\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @argument {String} basePlacement\n * @returns {Array} a two cells array with x and y offsets in numbers\n */\nfunction parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {\n var offsets = [0, 0];\n\n // Use height if placement is left or right and index is 0 otherwise use width\n // in this way the first offset will use an axis and the second one\n // will use the other one\n var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;\n\n // Split the offset string to obtain a list of values and operands\n // The regex addresses values with the plus or minus sign in front (+10, -20, etc)\n var fragments = offset.split(/(\\+|\\-)/).map(function (frag) {\n return frag.trim();\n });\n\n // Detect if the offset string contains a pair of values or a single one\n // they could be separated by comma or space\n var divider = fragments.indexOf(find(fragments, function (frag) {\n return frag.search(/,|\\s/) !== -1;\n }));\n\n if (fragments[divider] && fragments[divider].indexOf(',') === -1) {\n console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');\n }\n\n // If divider is found, we divide the list of values and operands to divide\n // them by ofset X and Y.\n var splitRegex = /\\s*,\\s*|\\s+/;\n var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];\n\n // Convert the values with units to absolute pixels to allow our computations\n ops = ops.map(function (op, index) {\n // Most of the units rely on the orientation of the popper\n var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';\n var mergeWithPrevious = false;\n return op\n // This aggregates any `+` or `-` sign that aren't considered operators\n // e.g.: 10 + +5 => [10, +, +5]\n .reduce(function (a, b) {\n if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {\n a[a.length - 1] = b;\n mergeWithPrevious = true;\n return a;\n } else if (mergeWithPrevious) {\n a[a.length - 1] += b;\n mergeWithPrevious = false;\n return a;\n } else {\n return a.concat(b);\n }\n }, [])\n // Here we convert the string values into number values (in px)\n .map(function (str) {\n return toValue(str, measurement, popperOffsets, referenceOffsets);\n });\n });\n\n // Loop trough the offsets arrays and execute the operations\n ops.forEach(function (op, index) {\n op.forEach(function (frag, index2) {\n if (isNumeric(frag)) {\n offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);\n }\n });\n });\n return offsets;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @argument {Number|String} options.offset=0\n * The offset value as described in the modifier description\n * @returns {Object} The data object, properly modified\n */\nfunction offset(data, _ref) {\n var offset = _ref.offset;\n var placement = data.placement,\n _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var basePlacement = placement.split('-')[0];\n\n var offsets = void 0;\n if (isNumeric(+offset)) {\n offsets = [+offset, 0];\n } else {\n offsets = parseOffset(offset, popper, reference, basePlacement);\n }\n\n if (basePlacement === 'left') {\n popper.top += offsets[0];\n popper.left -= offsets[1];\n } else if (basePlacement === 'right') {\n popper.top += offsets[0];\n popper.left += offsets[1];\n } else if (basePlacement === 'top') {\n popper.left += offsets[0];\n popper.top -= offsets[1];\n } else if (basePlacement === 'bottom') {\n popper.left += offsets[0];\n popper.top += offsets[1];\n }\n\n data.popper = popper;\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction preventOverflow(data, options) {\n var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);\n\n // If offsetParent is the reference element, we really want to\n // go one step up and use the next offsetParent as reference to\n // avoid to make this modifier completely useless and look like broken\n if (data.instance.reference === boundariesElement) {\n boundariesElement = getOffsetParent(boundariesElement);\n }\n\n var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement);\n options.boundaries = boundaries;\n\n var order = options.priority;\n var popper = data.offsets.popper;\n\n var check = {\n primary: function primary(placement) {\n var value = popper[placement];\n if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {\n value = Math.max(popper[placement], boundaries[placement]);\n }\n return defineProperty({}, placement, value);\n },\n secondary: function secondary(placement) {\n var mainSide = placement === 'right' ? 'left' : 'top';\n var value = popper[mainSide];\n if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {\n value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));\n }\n return defineProperty({}, mainSide, value);\n }\n };\n\n order.forEach(function (placement) {\n var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';\n popper = _extends({}, popper, check[side](placement));\n });\n\n data.offsets.popper = popper;\n\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction shift(data) {\n var placement = data.placement;\n var basePlacement = placement.split('-')[0];\n var shiftvariation = placement.split('-')[1];\n\n // if shift shiftvariation is specified, run the modifier\n if (shiftvariation) {\n var _data$offsets = data.offsets,\n reference = _data$offsets.reference,\n popper = _data$offsets.popper;\n\n var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;\n var side = isVertical ? 'left' : 'top';\n var measurement = isVertical ? 'width' : 'height';\n\n var shiftOffsets = {\n start: defineProperty({}, side, reference[side]),\n end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])\n };\n\n data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);\n }\n\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction hide(data) {\n if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {\n return data;\n }\n\n var refRect = data.offsets.reference;\n var bound = find(data.instance.modifiers, function (modifier) {\n return modifier.name === 'preventOverflow';\n }).boundaries;\n\n if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {\n // Avoid unnecessary DOM access if visibility hasn't changed\n if (data.hide === true) {\n return data;\n }\n\n data.hide = true;\n data.attributes['x-out-of-boundaries'] = '';\n } else {\n // Avoid unnecessary DOM access if visibility hasn't changed\n if (data.hide === false) {\n return data;\n }\n\n data.hide = false;\n data.attributes['x-out-of-boundaries'] = false;\n }\n\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction inner(data) {\n var placement = data.placement;\n var basePlacement = placement.split('-')[0];\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;\n\n var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;\n\n popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);\n\n data.placement = getOppositePlacement(placement);\n data.offsets.popper = getClientRect(popper);\n\n return data;\n}\n\n/**\n * Modifier function, each modifier can have a function of this type assigned\n * to its `fn` property.
      \n * These functions will be called on each update, this means that you must\n * make sure they are performant enough to avoid performance bottlenecks.\n *\n * @function ModifierFn\n * @argument {dataObject} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {dataObject} The data object, properly modified\n */\n\n/**\n * Modifiers are plugins used to alter the behavior of your poppers.
      \n * Popper.js uses a set of 9 modifiers to provide all the basic functionalities\n * needed by the library.\n *\n * Usually you don't want to override the `order`, `fn` and `onLoad` props.\n * All the other properties are configurations that could be tweaked.\n * @namespace modifiers\n */\nvar modifiers = {\n /**\n * Modifier used to shift the popper on the start or end of its reference\n * element.
      \n * It will read the variation of the `placement` property.
      \n * It can be one either `-end` or `-start`.\n * @memberof modifiers\n * @inner\n */\n shift: {\n /** @prop {number} order=100 - Index used to define the order of execution */\n order: 100,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: shift\n },\n\n /**\n * The `offset` modifier can shift your popper on both its axis.\n *\n * It accepts the following units:\n * - `px` or unitless, interpreted as pixels\n * - `%` or `%r`, percentage relative to the length of the reference element\n * - `%p`, percentage relative to the length of the popper element\n * - `vw`, CSS viewport width unit\n * - `vh`, CSS viewport height unit\n *\n * For length is intended the main axis relative to the placement of the popper.
      \n * This means that if the placement is `top` or `bottom`, the length will be the\n * `width`. In case of `left` or `right`, it will be the height.\n *\n * You can provide a single value (as `Number` or `String`), or a pair of values\n * as `String` divided by a comma or one (or more) white spaces.
      \n * The latter is a deprecated method because it leads to confusion and will be\n * removed in v2.
      \n * Additionally, it accepts additions and subtractions between different units.\n * Note that multiplications and divisions aren't supported.\n *\n * Valid examples are:\n * ```\n * 10\n * '10%'\n * '10, 10'\n * '10%, 10'\n * '10 + 10%'\n * '10 - 5vh + 3%'\n * '-10px + 5vh, 5px - 6%'\n * ```\n * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap\n * > with their reference element, unfortunately, you will have to disable the `flip` modifier.\n * > More on this [reading this issue](https://github.com/FezVrasta/popper.js/issues/373)\n *\n * @memberof modifiers\n * @inner\n */\n offset: {\n /** @prop {number} order=200 - Index used to define the order of execution */\n order: 200,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: offset,\n /** @prop {Number|String} offset=0\n * The offset value as described in the modifier description\n */\n offset: 0\n },\n\n /**\n * Modifier used to prevent the popper from being positioned outside the boundary.\n *\n * An scenario exists where the reference itself is not within the boundaries.
      \n * We can say it has \"escaped the boundaries\" — or just \"escaped\".
      \n * In this case we need to decide whether the popper should either:\n *\n * - detach from the reference and remain \"trapped\" in the boundaries, or\n * - if it should ignore the boundary and \"escape with its reference\"\n *\n * When `escapeWithReference` is set to`true` and reference is completely\n * outside its boundaries, the popper will overflow (or completely leave)\n * the boundaries in order to remain attached to the edge of the reference.\n *\n * @memberof modifiers\n * @inner\n */\n preventOverflow: {\n /** @prop {number} order=300 - Index used to define the order of execution */\n order: 300,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: preventOverflow,\n /**\n * @prop {Array} [priority=['left','right','top','bottom']]\n * Popper will try to prevent overflow following these priorities by default,\n * then, it could overflow on the left and on top of the `boundariesElement`\n */\n priority: ['left', 'right', 'top', 'bottom'],\n /**\n * @prop {number} padding=5\n * Amount of pixel used to define a minimum distance between the boundaries\n * and the popper this makes sure the popper has always a little padding\n * between the edges of its container\n */\n padding: 5,\n /**\n * @prop {String|HTMLElement} boundariesElement='scrollParent'\n * Boundaries used by the modifier, can be `scrollParent`, `window`,\n * `viewport` or any DOM element.\n */\n boundariesElement: 'scrollParent'\n },\n\n /**\n * Modifier used to make sure the reference and its popper stay near eachothers\n * without leaving any gap between the two. Expecially useful when the arrow is\n * enabled and you want to assure it to point to its reference element.\n * It cares only about the first axis, you can still have poppers with margin\n * between the popper and its reference element.\n * @memberof modifiers\n * @inner\n */\n keepTogether: {\n /** @prop {number} order=400 - Index used to define the order of execution */\n order: 400,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: keepTogether\n },\n\n /**\n * This modifier is used to move the `arrowElement` of the popper to make\n * sure it is positioned between the reference element and its popper element.\n * It will read the outer size of the `arrowElement` node to detect how many\n * pixels of conjuction are needed.\n *\n * It has no effect if no `arrowElement` is provided.\n * @memberof modifiers\n * @inner\n */\n arrow: {\n /** @prop {number} order=500 - Index used to define the order of execution */\n order: 500,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: arrow,\n /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */\n element: '[x-arrow]'\n },\n\n /**\n * Modifier used to flip the popper's placement when it starts to overlap its\n * reference element.\n *\n * Requires the `preventOverflow` modifier before it in order to work.\n *\n * **NOTE:** this modifier will interrupt the current update cycle and will\n * restart it if it detects the need to flip the placement.\n * @memberof modifiers\n * @inner\n */\n flip: {\n /** @prop {number} order=600 - Index used to define the order of execution */\n order: 600,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: flip,\n /**\n * @prop {String|Array} behavior='flip'\n * The behavior used to change the popper's placement. It can be one of\n * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid\n * placements (with optional variations).\n */\n behavior: 'flip',\n /**\n * @prop {number} padding=5\n * The popper will flip if it hits the edges of the `boundariesElement`\n */\n padding: 5,\n /**\n * @prop {String|HTMLElement} boundariesElement='viewport'\n * The element which will define the boundaries of the popper position,\n * the popper will never be placed outside of the defined boundaries\n * (except if keepTogether is enabled)\n */\n boundariesElement: 'viewport'\n },\n\n /**\n * Modifier used to make the popper flow toward the inner of the reference element.\n * By default, when this modifier is disabled, the popper will be placed outside\n * the reference element.\n * @memberof modifiers\n * @inner\n */\n inner: {\n /** @prop {number} order=700 - Index used to define the order of execution */\n order: 700,\n /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */\n enabled: false,\n /** @prop {ModifierFn} */\n fn: inner\n },\n\n /**\n * Modifier used to hide the popper when its reference element is outside of the\n * popper boundaries. It will set a `x-out-of-boundaries` attribute which can\n * be used to hide with a CSS selector the popper when its reference is\n * out of boundaries.\n *\n * Requires the `preventOverflow` modifier before it in order to work.\n * @memberof modifiers\n * @inner\n */\n hide: {\n /** @prop {number} order=800 - Index used to define the order of execution */\n order: 800,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: hide\n },\n\n /**\n * Computes the style that will be applied to the popper element to gets\n * properly positioned.\n *\n * Note that this modifier will not touch the DOM, it just prepares the styles\n * so that `applyStyle` modifier can apply it. This separation is useful\n * in case you need to replace `applyStyle` with a custom implementation.\n *\n * This modifier has `850` as `order` value to maintain backward compatibility\n * with previous versions of Popper.js. Expect the modifiers ordering method\n * to change in future major versions of the library.\n *\n * @memberof modifiers\n * @inner\n */\n computeStyle: {\n /** @prop {number} order=850 - Index used to define the order of execution */\n order: 850,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: computeStyle,\n /**\n * @prop {Boolean} gpuAcceleration=true\n * If true, it uses the CSS 3d transformation to position the popper.\n * Otherwise, it will use the `top` and `left` properties.\n */\n gpuAcceleration: true,\n /**\n * @prop {string} [x='bottom']\n * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.\n * Change this if your popper should grow in a direction different from `bottom`\n */\n x: 'bottom',\n /**\n * @prop {string} [x='left']\n * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.\n * Change this if your popper should grow in a direction different from `right`\n */\n y: 'right'\n },\n\n /**\n * Applies the computed styles to the popper element.\n *\n * All the DOM manipulations are limited to this modifier. This is useful in case\n * you want to integrate Popper.js inside a framework or view library and you\n * want to delegate all the DOM manipulations to it.\n *\n * Note that if you disable this modifier, you must make sure the popper element\n * has its position set to `absolute` before Popper.js can do its work!\n *\n * Just disable this modifier and define you own to achieve the desired effect.\n *\n * @memberof modifiers\n * @inner\n */\n applyStyle: {\n /** @prop {number} order=900 - Index used to define the order of execution */\n order: 900,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: applyStyle,\n /** @prop {Function} */\n onLoad: applyStyleOnLoad,\n /**\n * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier\n * @prop {Boolean} gpuAcceleration=true\n * If true, it uses the CSS 3d transformation to position the popper.\n * Otherwise, it will use the `top` and `left` properties.\n */\n gpuAcceleration: undefined\n }\n};\n\n/**\n * The `dataObject` is an object containing all the informations used by Popper.js\n * this object get passed to modifiers and to the `onCreate` and `onUpdate` callbacks.\n * @name dataObject\n * @property {Object} data.instance The Popper.js instance\n * @property {String} data.placement Placement applied to popper\n * @property {String} data.originalPlacement Placement originally defined on init\n * @property {Boolean} data.flipped True if popper has been flipped by flip modifier\n * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper.\n * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier\n * @property {Object} data.styles Any CSS property defined here will be applied to the popper, it expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow, it expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.boundaries Offsets of the popper boundaries\n * @property {Object} data.offsets The measurements of popper, reference and arrow elements.\n * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0\n */\n\n/**\n * Default options provided to Popper.js constructor.
      \n * These can be overriden using the `options` argument of Popper.js.
      \n * To override an option, simply pass as 3rd argument an object with the same\n * structure of this object, example:\n * ```\n * new Popper(ref, pop, {\n * modifiers: {\n * preventOverflow: { enabled: false }\n * }\n * })\n * ```\n * @type {Object}\n * @static\n * @memberof Popper\n */\nvar Defaults = {\n /**\n * Popper's placement\n * @prop {Popper.placements} placement='bottom'\n */\n placement: 'bottom',\n\n /**\n * Whether events (resize, scroll) are initially enabled\n * @prop {Boolean} eventsEnabled=true\n */\n eventsEnabled: true,\n\n /**\n * Set to true if you want to automatically remove the popper when\n * you call the `destroy` method.\n * @prop {Boolean} removeOnDestroy=false\n */\n removeOnDestroy: false,\n\n /**\n * Callback called when the popper is created.
      \n * By default, is set to no-op.
      \n * Access Popper.js instance with `data.instance`.\n * @prop {onCreate}\n */\n onCreate: function onCreate() {},\n\n /**\n * Callback called when the popper is updated, this callback is not called\n * on the initialization/creation of the popper, but only on subsequent\n * updates.
      \n * By default, is set to no-op.
      \n * Access Popper.js instance with `data.instance`.\n * @prop {onUpdate}\n */\n onUpdate: function onUpdate() {},\n\n /**\n * List of modifiers used to modify the offsets before they are applied to the popper.\n * They provide most of the functionalities of Popper.js\n * @prop {modifiers}\n */\n modifiers: modifiers\n};\n\n/**\n * @callback onCreate\n * @param {dataObject} data\n */\n\n/**\n * @callback onUpdate\n * @param {dataObject} data\n */\n\n// Utils\n// Methods\nvar Popper = function () {\n /**\n * Create a new Popper.js instance\n * @class Popper\n * @param {HTMLElement|referenceObject} reference - The reference element used to position the popper\n * @param {HTMLElement} popper - The HTML element used as popper.\n * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)\n * @return {Object} instance - The generated Popper.js instance\n */\n function Popper(reference, popper) {\n var _this = this;\n\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n classCallCheck(this, Popper);\n\n this.scheduleUpdate = function () {\n return requestAnimationFrame(_this.update);\n };\n\n // make update() debounced, so that it only runs at most once-per-tick\n this.update = debounce(this.update.bind(this));\n\n // with {} we create a new object with the options inside it\n this.options = _extends({}, Popper.Defaults, options);\n\n // init state\n this.state = {\n isDestroyed: false,\n isCreated: false,\n scrollParents: []\n };\n\n // get reference and popper elements (allow jQuery wrappers)\n this.reference = reference && reference.jquery ? reference[0] : reference;\n this.popper = popper && popper.jquery ? popper[0] : popper;\n\n // Deep merge modifiers options\n this.options.modifiers = {};\n Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {\n _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});\n });\n\n // Refactoring modifiers' list (Object => Array)\n this.modifiers = Object.keys(this.options.modifiers).map(function (name) {\n return _extends({\n name: name\n }, _this.options.modifiers[name]);\n })\n // sort the modifiers by order\n .sort(function (a, b) {\n return a.order - b.order;\n });\n\n // modifiers have the ability to execute arbitrary code when Popper.js get inited\n // such code is executed in the same order of its modifier\n // they could add new properties to their options configuration\n // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!\n this.modifiers.forEach(function (modifierOptions) {\n if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {\n modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);\n }\n });\n\n // fire the first update to position the popper in the right place\n this.update();\n\n var eventsEnabled = this.options.eventsEnabled;\n if (eventsEnabled) {\n // setup event listeners, they will take care of update the position in specific situations\n this.enableEventListeners();\n }\n\n this.state.eventsEnabled = eventsEnabled;\n }\n\n // We can't use class properties because they don't get listed in the\n // class prototype and break stuff like Sinon stubs\n\n\n createClass(Popper, [{\n key: 'update',\n value: function update$$1() {\n return update.call(this);\n }\n }, {\n key: 'destroy',\n value: function destroy$$1() {\n return destroy.call(this);\n }\n }, {\n key: 'enableEventListeners',\n value: function enableEventListeners$$1() {\n return enableEventListeners.call(this);\n }\n }, {\n key: 'disableEventListeners',\n value: function disableEventListeners$$1() {\n return disableEventListeners.call(this);\n }\n\n /**\n * Schedule an update, it will run on the next UI update available\n * @method scheduleUpdate\n * @memberof Popper\n */\n\n\n /**\n * Collection of utilities useful when writing custom modifiers.\n * Starting from version 1.7, this method is available only if you\n * include `popper-utils.js` before `popper.js`.\n *\n * **DEPRECATION**: This way to access PopperUtils is deprecated\n * and will be removed in v2! Use the PopperUtils module directly instead.\n * Due to the high instability of the methods contained in Utils, we can't\n * guarantee them to follow semver. Use them at your own risk!\n * @static\n * @private\n * @type {Object}\n * @deprecated since version 1.8\n * @member Utils\n * @memberof Popper\n */\n\n }]);\n return Popper;\n}();\n\n/**\n * The `referenceObject` is an object that provides an interface compatible with Popper.js\n * and lets you use it as replacement of a real DOM node.
      \n * You can use this method to position a popper relatively to a set of coordinates\n * in case you don't have a DOM node to use as reference.\n *\n * ```\n * new Popper(referenceObject, popperNode);\n * ```\n *\n * NB: This feature isn't supported in Internet Explorer 10\n * @name referenceObject\n * @property {Function} data.getBoundingClientRect\n * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.\n * @property {number} data.clientWidth\n * An ES6 getter that will return the width of the virtual reference element.\n * @property {number} data.clientHeight\n * An ES6 getter that will return the height of the virtual reference element.\n */\n\n\nPopper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;\nPopper.placements = placements;\nPopper.Defaults = Defaults;\n\nreturn Popper;\n\n})));\n//# sourceMappingURL=popper.js.map\n"],"file":"popper.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/popper.js"],"names":["global","factory","exports","module","define","amd","Popper","isBrowser","window","document","longerTimeoutBrowsers","timeoutDuration","i","length","navigator","userAgent","indexOf","supportsMicroTasks","Promise","debounce","fn","called","resolve","then","scheduled","setTimeout","isFunction","functionToCheck","toString","call","getStyleComputedProperty","element","property","nodeType","css","getComputedStyle","getParentNode","nodeName","parentNode","host","getScrollParent","body","ownerDocument","_getStyleComputedProp","overflow","overflowX","overflowY","test","getOffsetParent","offsetParent","documentElement","isOffsetContainer","firstElementChild","getRoot","node","findCommonOffsetParent","element1","element2","order","compareDocumentPosition","Node","DOCUMENT_POSITION_FOLLOWING","start","end","range","createRange","setStart","setEnd","commonAncestorContainer","contains","element1root","getScroll","side","arguments","upperSide","html","scrollingElement","includeScroll","rect","subtract","scrollTop","scrollLeft","modifier","top","bottom","left","right","getBordersSize","styles","axis","sideA","sideB","split","isIE10","isIE10$1","appVersion","getSize","computedStyle","Math","max","getWindowSizes","height","width","classCallCheck","instance","Constructor","TypeError","createClass","defineProperties","target","props","descriptor","enumerable","configurable","writable","Object","defineProperty","key","protoProps","staticProps","prototype","obj","value","_extends","assign","source","hasOwnProperty","getClientRect","offsets","getBoundingClientRect","err","result","sizes","clientWidth","clientHeight","horizScrollbar","offsetWidth","vertScrollbar","offsetHeight","getOffsetRectRelativeToArbitraryNode","children","parent","isHTML","childrenRect","parentRect","scrollParent","borderTopWidth","borderLeftWidth","marginTop","marginLeft","getViewportOffsetRectRelativeToArtbitraryNode","relativeOffset","innerWidth","innerHeight","offset","isFixed","getBoundaries","popper","reference","padding","boundariesElement","boundaries","boundariesNode","_getWindowSizes","getArea","_ref","computeAutoPlacement","placement","refRect","rects","sortedAreas","keys","map","area","sort","a","b","filteredAreas","filter","_ref2","computedPlacement","variation","getReferenceOffsets","state","commonOffsetParent","getOuterSizes","x","parseFloat","marginBottom","y","marginRight","getOppositePlacement","hash","replace","matched","getPopperOffsets","referenceOffsets","popperRect","popperOffsets","isHoriz","mainSide","secondarySide","measurement","secondaryMeasurement","find","arr","check","Array","findIndex","prop","cur","match","runModifiers","modifiers","data","ends","modifiersToRun","slice","forEach","console","warn","enabled","update","isDestroyed","arrowStyles","attributes","flipped","options","flip","originalPlacement","position","isCreated","onCreate","onUpdate","isModifierEnabled","modifierName","some","name","getSupportedPropertyName","prefixes","upperProp","charAt","toUpperCase","prefix","toCheck","style","destroy","removeAttribute","disableEventListeners","removeOnDestroy","removeChild","getWindow","defaultView","attachToScrollParents","event","callback","scrollParents","isBody","addEventListener","passive","push","setupEventListeners","updateBound","scrollElement","eventsEnabled","enableEventListeners","scheduleUpdate","removeEventListeners","removeEventListener","cancelAnimationFrame","isNumeric","n","isNaN","isFinite","setStyles","unit","setAttributes","setAttribute","isModifierRequired","requestingName","requestedName","requesting","isRequired","_requesting","getOppositeVariation","placements","validPlacements","clockwise","counter","index","concat","reverse","BEHAVIORS","FLIP","CLOCKWISE","COUNTERCLOCKWISE","toValue","str","size","parseOffset","basePlacement","useHeight","fragments","frag","trim","divider","search","splitRegex","ops","op","mergeWithPrevious","reduce","index2","_data$offsets","_this","requestAnimationFrame","bind","Defaults","jquery","modifierOptions","onLoad","Utils","PopperUtils","shift","shiftvariation","isVertical","shiftOffsets","preventOverflow","priority","primary","escapeWithReference","secondary","min","keepTogether","floor","opSide","arrow","arrowElement","querySelector","len","sideCapitalized","toLowerCase","altSide","arrowElementSize","center","popperMarginSide","sideValue","round","placementOpposite","flipOrder","behavior","step","refOffsets","overlapsRef","overflowsLeft","overflowsRight","overflowsTop","overflowsBottom","overflowsBoundaries","flippedVariation","flipVariations","inner","subtractLength","hide","bound","computeStyle","legacyGpuAccelerationOption","gpuAcceleration","offsetParentRect","prefixedProperty","willChange","invertTop","invertLeft","applyStyle"],"mappings":"kRAwBC,UAAUA,CAAV,CAAkBC,CAAlB,CAA2B,CACP,QAAnB,uBAAOC,CAAAA,OAAP,qBAAOA,OAAP,IAAiD,WAAlB,QAAOC,CAAAA,MAAtC,CAA+DA,MAAM,CAACD,OAAP,CAAiBD,CAAO,EAAvF,CACkB,UAAlB,QAAOG,CAAAA,MAAP,EAAgCA,MAAM,CAACC,GAAvC,CAA6CD,OAAM,eAACH,CAAD,CAAnD,CACCD,CAAM,CAACM,MAAP,CAAgBL,CAAO,EACzB,CAJA,EAIC,IAJD,CAIQ,UAAY,CAAE,aAKvB,OAHIM,CAAAA,CAAS,CAAqB,WAAlB,QAAOC,CAAAA,MAAP,EAA4D,WAA3B,QAAOA,CAAAA,MAAM,CAACC,QAG/D,CAFIC,CAAqB,CAAG,CAAC,MAAD,CAAS,SAAT,CAAoB,SAApB,CAE5B,CADIC,CAAe,CAAG,CACtB,CAASC,CAAC,CAAG,CAAb,CAAgBA,CAAC,CAAGF,CAAqB,CAACG,MAA1C,CAAkDD,CAAC,EAAI,CAAvD,CAA0D,CACxD,GAAIL,CAAS,EAA6D,CAAzD,EAAAO,SAAS,CAACC,SAAV,CAAoBC,OAApB,CAA4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D,IAAP,CAAY2C,CAAI,CAACU,WAAjB,EAA8BnN,MAAvD,CAA+D,CAC7DqQ,CAAS,CAAC5D,CAAI,CAAC2H,YAAN,CAAoB3H,CAAI,CAACU,WAAzB,CACV,CAED,MAAOV,CAAAA,CACR,CA6hCa,CAQV0G,MAAM,CAzhCV,SAA0BlK,CAA1B,CAAqCD,CAArC,CAA6CsE,CAA7C,CAAsD4F,CAAtD,CAAuExI,CAAvE,CAA8E,IAExEa,CAAAA,CAAgB,CAAGd,CAAmB,CAACC,CAAD,CAAQ1B,CAAR,CAAgBC,CAAhB,CAFkC,CAOxES,CAAS,CAAGD,CAAoB,CAAC6D,CAAO,CAAC5D,SAAT,CAAoB6B,CAApB,CAAsCvC,CAAtC,CAA8CC,CAA9C,CAAyDqE,CAAO,CAACd,SAAR,CAAkBe,IAAlB,CAAuBpE,iBAAhF,CAAmGmE,CAAO,CAACd,SAAR,CAAkBe,IAAlB,CAAuBrE,OAA1H,CAPwC,CAS5EF,CAAM,CAACwH,YAAP,CAAoB,aAApB,CAAmC9G,CAAnC,EAIA2G,CAAS,CAACrH,CAAD,CAAS,CAAEyE,QAAQ,CAAE,UAAZ,CAAT,CAAT,CAEA,MAAOH,CAAAA,CACR,CAigCa,CAeV4I,eAAe,OAfL,CA5RE,CAkVD,CAiNf,CAEA,MAAOzW,CAAAA,EAEN,CAh3EA,CAAD","sourcesContent":["/**!\n * @fileOverview Kickass library to create and place poppers near their reference elements.\n * @version 1.12.6\n * @license\n * Copyright (c) 2016 Federico Zivolo and contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global.Popper = factory());\n}(this, (function () { 'use strict';\n\nvar isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';\nvar longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];\nvar timeoutDuration = 0;\nfor (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {\n if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {\n timeoutDuration = 1;\n break;\n }\n}\n\nfunction microtaskDebounce(fn) {\n var called = false;\n return function () {\n if (called) {\n return;\n }\n called = true;\n Promise.resolve().then(function () {\n called = false;\n fn();\n });\n };\n}\n\nfunction taskDebounce(fn) {\n var scheduled = false;\n return function () {\n if (!scheduled) {\n scheduled = true;\n setTimeout(function () {\n scheduled = false;\n fn();\n }, timeoutDuration);\n }\n };\n}\n\nvar supportsMicroTasks = isBrowser && window.Promise;\n\n/**\n* Create a debounced version of a method, that's asynchronously deferred\n* but called in the minimum time possible.\n*\n* @method\n* @memberof Popper.Utils\n* @argument {Function} fn\n* @returns {Function}\n*/\nvar debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;\n\n/**\n * Check if the given variable is a function\n * @method\n * @memberof Popper.Utils\n * @argument {Any} functionToCheck - variable to check\n * @returns {Boolean} answer to: is a function?\n */\nfunction isFunction(functionToCheck) {\n var getType = {};\n return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';\n}\n\n/**\n * Get CSS computed property of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Eement} element\n * @argument {String} property\n */\nfunction getStyleComputedProperty(element, property) {\n if (element.nodeType !== 1) {\n return [];\n }\n // NOTE: 1 DOM access here\n var css = window.getComputedStyle(element, null);\n return property ? css[property] : css;\n}\n\n/**\n * Returns the parentNode or the host of the element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} parent\n */\nfunction getParentNode(element) {\n if (element.nodeName === 'HTML') {\n return element;\n }\n return element.parentNode || element.host;\n}\n\n/**\n * Returns the scrolling parent of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} scroll parent\n */\nfunction getScrollParent(element) {\n // Return body, `getScroll` will take care to get the correct `scrollTop` from it\n if (!element) {\n return window.document.body;\n }\n\n switch (element.nodeName) {\n case 'HTML':\n case 'BODY':\n return element.ownerDocument.body;\n case '#document':\n return element.body;\n }\n\n // Firefox want us to check `-x` and `-y` variations as well\n\n var _getStyleComputedProp = getStyleComputedProperty(element),\n overflow = _getStyleComputedProp.overflow,\n overflowX = _getStyleComputedProp.overflowX,\n overflowY = _getStyleComputedProp.overflowY;\n\n if (/(auto|scroll)/.test(overflow + overflowY + overflowX)) {\n return element;\n }\n\n return getScrollParent(getParentNode(element));\n}\n\n/**\n * Returns the offset parent of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} offset parent\n */\nfunction getOffsetParent(element) {\n // NOTE: 1 DOM access here\n var offsetParent = element && element.offsetParent;\n var nodeName = offsetParent && offsetParent.nodeName;\n\n if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {\n if (element) {\n return element.ownerDocument.documentElement;\n }\n\n return window.document.documentElement;\n }\n\n // .offsetParent will return the closest TD or TABLE in case\n // no offsetParent is present, I hate this job...\n if (['TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {\n return getOffsetParent(offsetParent);\n }\n\n return offsetParent;\n}\n\nfunction isOffsetContainer(element) {\n var nodeName = element.nodeName;\n\n if (nodeName === 'BODY') {\n return false;\n }\n return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;\n}\n\n/**\n * Finds the root node (document, shadowDOM root) of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} node\n * @returns {Element} root node\n */\nfunction getRoot(node) {\n if (node.parentNode !== null) {\n return getRoot(node.parentNode);\n }\n\n return node;\n}\n\n/**\n * Finds the offset parent common to the two provided nodes\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element1\n * @argument {Element} element2\n * @returns {Element} common offset parent\n */\nfunction findCommonOffsetParent(element1, element2) {\n // This check is needed to avoid errors in case one of the elements isn't defined for any reason\n if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {\n return window.document.documentElement;\n }\n\n // Here we make sure to give as \"start\" the element that comes first in the DOM\n var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;\n var start = order ? element1 : element2;\n var end = order ? element2 : element1;\n\n // Get common ancestor container\n var range = document.createRange();\n range.setStart(start, 0);\n range.setEnd(end, 0);\n var commonAncestorContainer = range.commonAncestorContainer;\n\n // Both nodes are inside #document\n\n if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {\n if (isOffsetContainer(commonAncestorContainer)) {\n return commonAncestorContainer;\n }\n\n return getOffsetParent(commonAncestorContainer);\n }\n\n // one of the nodes is inside shadowDOM, find which one\n var element1root = getRoot(element1);\n if (element1root.host) {\n return findCommonOffsetParent(element1root.host, element2);\n } else {\n return findCommonOffsetParent(element1, getRoot(element2).host);\n }\n}\n\n/**\n * Gets the scroll value of the given element in the given side (top and left)\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @argument {String} side `top` or `left`\n * @returns {number} amount of scrolled pixels\n */\nfunction getScroll(element) {\n var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';\n\n var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';\n var nodeName = element.nodeName;\n\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n var html = element.ownerDocument.documentElement;\n var scrollingElement = element.ownerDocument.scrollingElement || html;\n return scrollingElement[upperSide];\n }\n\n return element[upperSide];\n}\n\n/*\n * Sum or subtract the element scroll values (left and top) from a given rect object\n * @method\n * @memberof Popper.Utils\n * @param {Object} rect - Rect object you want to change\n * @param {HTMLElement} element - The element from the function reads the scroll values\n * @param {Boolean} subtract - set to true if you want to subtract the scroll values\n * @return {Object} rect - The modifier rect object\n */\nfunction includeScroll(rect, element) {\n var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n var scrollTop = getScroll(element, 'top');\n var scrollLeft = getScroll(element, 'left');\n var modifier = subtract ? -1 : 1;\n rect.top += scrollTop * modifier;\n rect.bottom += scrollTop * modifier;\n rect.left += scrollLeft * modifier;\n rect.right += scrollLeft * modifier;\n return rect;\n}\n\n/*\n * Helper to detect borders of a given element\n * @method\n * @memberof Popper.Utils\n * @param {CSSStyleDeclaration} styles\n * Result of `getStyleComputedProperty` on the given element\n * @param {String} axis - `x` or `y`\n * @return {number} borders - The borders size of the given axis\n */\n\nfunction getBordersSize(styles, axis) {\n var sideA = axis === 'x' ? 'Left' : 'Top';\n var sideB = sideA === 'Left' ? 'Right' : 'Bottom';\n\n return +styles['border' + sideA + 'Width'].split('px')[0] + +styles['border' + sideB + 'Width'].split('px')[0];\n}\n\n/**\n * Tells if you are running Internet Explorer 10\n * @method\n * @memberof Popper.Utils\n * @returns {Boolean} isIE10\n */\nvar isIE10 = undefined;\n\nvar isIE10$1 = function () {\n if (isIE10 === undefined) {\n isIE10 = navigator.appVersion.indexOf('MSIE 10') !== -1;\n }\n return isIE10;\n};\n\nfunction getSize(axis, body, html, computedStyle) {\n return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE10$1() ? html['offset' + axis] + computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')] + computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')] : 0);\n}\n\nfunction getWindowSizes() {\n var body = window.document.body;\n var html = window.document.documentElement;\n var computedStyle = isIE10$1() && window.getComputedStyle(html);\n\n return {\n height: getSize('Height', body, html, computedStyle),\n width: getSize('Width', body, html, computedStyle)\n };\n}\n\nvar classCallCheck = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\n\nvar createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\n\n\n\n\nvar defineProperty = function (obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n};\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\n/**\n * Given element offsets, generate an output similar to getBoundingClientRect\n * @method\n * @memberof Popper.Utils\n * @argument {Object} offsets\n * @returns {Object} ClientRect like output\n */\nfunction getClientRect(offsets) {\n return _extends({}, offsets, {\n right: offsets.left + offsets.width,\n bottom: offsets.top + offsets.height\n });\n}\n\n/**\n * Get bounding client rect of given element\n * @method\n * @memberof Popper.Utils\n * @param {HTMLElement} element\n * @return {Object} client rect\n */\nfunction getBoundingClientRect(element) {\n var rect = {};\n\n // IE10 10 FIX: Please, don't ask, the element isn't\n // considered in DOM in some circumstances...\n // This isn't reproducible in IE10 compatibility mode of IE11\n if (isIE10$1()) {\n try {\n rect = element.getBoundingClientRect();\n var scrollTop = getScroll(element, 'top');\n var scrollLeft = getScroll(element, 'left');\n rect.top += scrollTop;\n rect.left += scrollLeft;\n rect.bottom += scrollTop;\n rect.right += scrollLeft;\n } catch (err) {}\n } else {\n rect = element.getBoundingClientRect();\n }\n\n var result = {\n left: rect.left,\n top: rect.top,\n width: rect.right - rect.left,\n height: rect.bottom - rect.top\n };\n\n // subtract scrollbar size from sizes\n var sizes = element.nodeName === 'HTML' ? getWindowSizes() : {};\n var width = sizes.width || element.clientWidth || result.right - result.left;\n var height = sizes.height || element.clientHeight || result.bottom - result.top;\n\n var horizScrollbar = element.offsetWidth - width;\n var vertScrollbar = element.offsetHeight - height;\n\n // if an hypothetical scrollbar is detected, we must be sure it's not a `border`\n // we make this check conditional for performance reasons\n if (horizScrollbar || vertScrollbar) {\n var styles = getStyleComputedProperty(element);\n horizScrollbar -= getBordersSize(styles, 'x');\n vertScrollbar -= getBordersSize(styles, 'y');\n\n result.width -= horizScrollbar;\n result.height -= vertScrollbar;\n }\n\n return getClientRect(result);\n}\n\nfunction getOffsetRectRelativeToArbitraryNode(children, parent) {\n var isIE10 = isIE10$1();\n var isHTML = parent.nodeName === 'HTML';\n var childrenRect = getBoundingClientRect(children);\n var parentRect = getBoundingClientRect(parent);\n var scrollParent = getScrollParent(children);\n\n var styles = getStyleComputedProperty(parent);\n var borderTopWidth = +styles.borderTopWidth.split('px')[0];\n var borderLeftWidth = +styles.borderLeftWidth.split('px')[0];\n\n var offsets = getClientRect({\n top: childrenRect.top - parentRect.top - borderTopWidth,\n left: childrenRect.left - parentRect.left - borderLeftWidth,\n width: childrenRect.width,\n height: childrenRect.height\n });\n offsets.marginTop = 0;\n offsets.marginLeft = 0;\n\n // Subtract margins of documentElement in case it's being used as parent\n // we do this only on HTML because it's the only element that behaves\n // differently when margins are applied to it. The margins are included in\n // the box of the documentElement, in the other cases not.\n if (!isIE10 && isHTML) {\n var marginTop = +styles.marginTop.split('px')[0];\n var marginLeft = +styles.marginLeft.split('px')[0];\n\n offsets.top -= borderTopWidth - marginTop;\n offsets.bottom -= borderTopWidth - marginTop;\n offsets.left -= borderLeftWidth - marginLeft;\n offsets.right -= borderLeftWidth - marginLeft;\n\n // Attach marginTop and marginLeft because in some circumstances we may need them\n offsets.marginTop = marginTop;\n offsets.marginLeft = marginLeft;\n }\n\n if (isIE10 ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {\n offsets = includeScroll(offsets, parent);\n }\n\n return offsets;\n}\n\nfunction getViewportOffsetRectRelativeToArtbitraryNode(element) {\n var html = element.ownerDocument.documentElement;\n var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);\n var width = Math.max(html.clientWidth, window.innerWidth || 0);\n var height = Math.max(html.clientHeight, window.innerHeight || 0);\n\n var scrollTop = getScroll(html);\n var scrollLeft = getScroll(html, 'left');\n\n var offset = {\n top: scrollTop - relativeOffset.top + relativeOffset.marginTop,\n left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,\n width: width,\n height: height\n };\n\n return getClientRect(offset);\n}\n\n/**\n * Check if the given element is fixed or is inside a fixed parent\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @argument {Element} customContainer\n * @returns {Boolean} answer to \"isFixed?\"\n */\nfunction isFixed(element) {\n var nodeName = element.nodeName;\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n return false;\n }\n if (getStyleComputedProperty(element, 'position') === 'fixed') {\n return true;\n }\n return isFixed(getParentNode(element));\n}\n\n/**\n * Computed the boundaries limits and return them\n * @method\n * @memberof Popper.Utils\n * @param {HTMLElement} popper\n * @param {HTMLElement} reference\n * @param {number} padding\n * @param {HTMLElement} boundariesElement - Element used to define the boundaries\n * @returns {Object} Coordinates of the boundaries\n */\nfunction getBoundaries(popper, reference, padding, boundariesElement) {\n // NOTE: 1 DOM access here\n var boundaries = { top: 0, left: 0 };\n var offsetParent = findCommonOffsetParent(popper, reference);\n\n // Handle viewport case\n if (boundariesElement === 'viewport') {\n boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent);\n } else {\n // Handle other cases based on DOM element used as boundaries\n var boundariesNode = void 0;\n if (boundariesElement === 'scrollParent') {\n boundariesNode = getScrollParent(getParentNode(popper));\n if (boundariesNode.nodeName === 'BODY') {\n boundariesNode = popper.ownerDocument.documentElement;\n }\n } else if (boundariesElement === 'window') {\n boundariesNode = popper.ownerDocument.documentElement;\n } else {\n boundariesNode = boundariesElement;\n }\n\n var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent);\n\n // In case of HTML, we need a different computation\n if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {\n var _getWindowSizes = getWindowSizes(),\n height = _getWindowSizes.height,\n width = _getWindowSizes.width;\n\n boundaries.top += offsets.top - offsets.marginTop;\n boundaries.bottom = height + offsets.top;\n boundaries.left += offsets.left - offsets.marginLeft;\n boundaries.right = width + offsets.left;\n } else {\n // for all the other DOM elements, this one is good\n boundaries = offsets;\n }\n }\n\n // Add paddings\n boundaries.left += padding;\n boundaries.top += padding;\n boundaries.right -= padding;\n boundaries.bottom -= padding;\n\n return boundaries;\n}\n\nfunction getArea(_ref) {\n var width = _ref.width,\n height = _ref.height;\n\n return width * height;\n}\n\n/**\n * Utility used to transform the `auto` placement to the placement with more\n * available space.\n * @method\n * @memberof Popper.Utils\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {\n var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;\n\n if (placement.indexOf('auto') === -1) {\n return placement;\n }\n\n var boundaries = getBoundaries(popper, reference, padding, boundariesElement);\n\n var rects = {\n top: {\n width: boundaries.width,\n height: refRect.top - boundaries.top\n },\n right: {\n width: boundaries.right - refRect.right,\n height: boundaries.height\n },\n bottom: {\n width: boundaries.width,\n height: boundaries.bottom - refRect.bottom\n },\n left: {\n width: refRect.left - boundaries.left,\n height: boundaries.height\n }\n };\n\n var sortedAreas = Object.keys(rects).map(function (key) {\n return _extends({\n key: key\n }, rects[key], {\n area: getArea(rects[key])\n });\n }).sort(function (a, b) {\n return b.area - a.area;\n });\n\n var filteredAreas = sortedAreas.filter(function (_ref2) {\n var width = _ref2.width,\n height = _ref2.height;\n return width >= popper.clientWidth && height >= popper.clientHeight;\n });\n\n var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;\n\n var variation = placement.split('-')[1];\n\n return computedPlacement + (variation ? '-' + variation : '');\n}\n\n/**\n * Get offsets to the reference element\n * @method\n * @memberof Popper.Utils\n * @param {Object} state\n * @param {Element} popper - the popper element\n * @param {Element} reference - the reference element (the popper will be relative to this)\n * @returns {Object} An object containing the offsets which will be applied to the popper\n */\nfunction getReferenceOffsets(state, popper, reference) {\n var commonOffsetParent = findCommonOffsetParent(popper, reference);\n return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent);\n}\n\n/**\n * Get the outer sizes of the given element (offset size + margins)\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Object} object containing width and height properties\n */\nfunction getOuterSizes(element) {\n var styles = window.getComputedStyle(element);\n var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);\n var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);\n var result = {\n width: element.offsetWidth + y,\n height: element.offsetHeight + x\n };\n return result;\n}\n\n/**\n * Get the opposite placement of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement\n * @returns {String} flipped placement\n */\nfunction getOppositePlacement(placement) {\n var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}\n\n/**\n * Get offsets to the popper\n * @method\n * @memberof Popper.Utils\n * @param {Object} position - CSS position the Popper will get applied\n * @param {HTMLElement} popper - the popper element\n * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)\n * @param {String} placement - one of the valid placement options\n * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper\n */\nfunction getPopperOffsets(popper, referenceOffsets, placement) {\n placement = placement.split('-')[0];\n\n // Get popper node sizes\n var popperRect = getOuterSizes(popper);\n\n // Add position, width and height to our offsets object\n var popperOffsets = {\n width: popperRect.width,\n height: popperRect.height\n };\n\n // depending by the popper placement we have to compute its offsets slightly differently\n var isHoriz = ['right', 'left'].indexOf(placement) !== -1;\n var mainSide = isHoriz ? 'top' : 'left';\n var secondarySide = isHoriz ? 'left' : 'top';\n var measurement = isHoriz ? 'height' : 'width';\n var secondaryMeasurement = !isHoriz ? 'height' : 'width';\n\n popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;\n if (placement === secondarySide) {\n popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];\n } else {\n popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];\n }\n\n return popperOffsets;\n}\n\n/**\n * Mimics the `find` method of Array\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\nfunction find(arr, check) {\n // use native find if supported\n if (Array.prototype.find) {\n return arr.find(check);\n }\n\n // use `filter` to obtain the same behavior of `find`\n return arr.filter(check)[0];\n}\n\n/**\n * Return the index of the matching object\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\nfunction findIndex(arr, prop, value) {\n // use native findIndex if supported\n if (Array.prototype.findIndex) {\n return arr.findIndex(function (cur) {\n return cur[prop] === value;\n });\n }\n\n // use `find` + `indexOf` if `findIndex` isn't supported\n var match = find(arr, function (obj) {\n return obj[prop] === value;\n });\n return arr.indexOf(match);\n}\n\n/**\n * Loop trough the list of modifiers and run them in order,\n * each of them will then edit the data object.\n * @method\n * @memberof Popper.Utils\n * @param {dataObject} data\n * @param {Array} modifiers\n * @param {String} ends - Optional modifier name used as stopper\n * @returns {dataObject}\n */\nfunction runModifiers(modifiers, data, ends) {\n var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));\n\n modifiersToRun.forEach(function (modifier) {\n if (modifier['function']) {\n // eslint-disable-line dot-notation\n console.warn('`modifier.function` is deprecated, use `modifier.fn`!');\n }\n var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation\n if (modifier.enabled && isFunction(fn)) {\n // Add properties to offsets to make them a complete clientRect object\n // we do this before each modifier to make sure the previous one doesn't\n // mess with these values\n data.offsets.popper = getClientRect(data.offsets.popper);\n data.offsets.reference = getClientRect(data.offsets.reference);\n\n data = fn(data, modifier);\n }\n });\n\n return data;\n}\n\n/**\n * Updates the position of the popper, computing the new offsets and applying\n * the new style.
      \n * Prefer `scheduleUpdate` over `update` because of performance reasons.\n * @method\n * @memberof Popper\n */\nfunction update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n data.offsets.popper.position = 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}\n\n/**\n * Helper used to know if the given modifier is enabled.\n * @method\n * @memberof Popper.Utils\n * @returns {Boolean}\n */\nfunction isModifierEnabled(modifiers, modifierName) {\n return modifiers.some(function (_ref) {\n var name = _ref.name,\n enabled = _ref.enabled;\n return enabled && name === modifierName;\n });\n}\n\n/**\n * Get the prefixed supported property name\n * @method\n * @memberof Popper.Utils\n * @argument {String} property (camelCase)\n * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)\n */\nfunction getSupportedPropertyName(property) {\n var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];\n var upperProp = property.charAt(0).toUpperCase() + property.slice(1);\n\n for (var i = 0; i < prefixes.length - 1; i++) {\n var prefix = prefixes[i];\n var toCheck = prefix ? '' + prefix + upperProp : property;\n if (typeof window.document.body.style[toCheck] !== 'undefined') {\n return toCheck;\n }\n }\n return null;\n}\n\n/**\n * Destroy the popper\n * @method\n * @memberof Popper\n */\nfunction destroy() {\n this.state.isDestroyed = true;\n\n // touch DOM only if `applyStyle` modifier is enabled\n if (isModifierEnabled(this.modifiers, 'applyStyle')) {\n this.popper.removeAttribute('x-placement');\n this.popper.style.left = '';\n this.popper.style.position = '';\n this.popper.style.top = '';\n this.popper.style[getSupportedPropertyName('transform')] = '';\n }\n\n this.disableEventListeners();\n\n // remove the popper if user explicity asked for the deletion on destroy\n // do not use `remove` because IE11 doesn't support it\n if (this.options.removeOnDestroy) {\n this.popper.parentNode.removeChild(this.popper);\n }\n return this;\n}\n\n/**\n * Get the window associated with the element\n * @argument {Element} element\n * @returns {Window}\n */\nfunction getWindow(element) {\n var ownerDocument = element.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView : window;\n}\n\nfunction attachToScrollParents(scrollParent, event, callback, scrollParents) {\n var isBody = scrollParent.nodeName === 'BODY';\n var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;\n target.addEventListener(event, callback, { passive: true });\n\n if (!isBody) {\n attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);\n }\n scrollParents.push(target);\n}\n\n/**\n * Setup needed event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\nfunction setupEventListeners(reference, options, state, updateBound) {\n // Resize event listener on window\n state.updateBound = updateBound;\n getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });\n\n // Scroll event listener on scroll parents\n var scrollElement = getScrollParent(reference);\n attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);\n state.scrollElement = scrollElement;\n state.eventsEnabled = true;\n\n return state;\n}\n\n/**\n * It will add resize/scroll events and start recalculating\n * position of the popper element when they are triggered.\n * @method\n * @memberof Popper\n */\nfunction enableEventListeners() {\n if (!this.state.eventsEnabled) {\n this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);\n }\n}\n\n/**\n * Remove event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\nfunction removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}\n\n/**\n * It will remove resize/scroll events and won't recalculate popper position\n * when they are triggered. It also won't trigger onUpdate callback anymore,\n * unless you call `update` method manually.\n * @method\n * @memberof Popper\n */\nfunction disableEventListeners() {\n if (this.state.eventsEnabled) {\n window.cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n}\n\n/**\n * Tells if a given input is a number\n * @method\n * @memberof Popper.Utils\n * @param {*} input to check\n * @return {Boolean}\n */\nfunction isNumeric(n) {\n return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);\n}\n\n/**\n * Set the style to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the style to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\nfunction setStyles(element, styles) {\n Object.keys(styles).forEach(function (prop) {\n var unit = '';\n // add unit if the value is numeric and is one of the following\n if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {\n unit = 'px';\n }\n element.style[prop] = styles[prop] + unit;\n });\n}\n\n/**\n * Set the attributes to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the attributes to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\nfunction setAttributes(element, attributes) {\n Object.keys(attributes).forEach(function (prop) {\n var value = attributes[prop];\n if (value !== false) {\n element.setAttribute(prop, attributes[prop]);\n } else {\n element.removeAttribute(prop);\n }\n });\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} data.styles - List of style properties - values to apply to popper element\n * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The same data object\n */\nfunction applyStyle(data) {\n // any property present in `data.styles` will be applied to the popper,\n // in this way we can make the 3rd party modifiers add custom styles to it\n // Be aware, modifiers could override the properties defined in the previous\n // lines of this modifier!\n setStyles(data.instance.popper, data.styles);\n\n // any property present in `data.attributes` will be applied to the popper,\n // they will be set as HTML attributes of the element\n setAttributes(data.instance.popper, data.attributes);\n\n // if arrowElement is defined and arrowStyles has some properties\n if (data.arrowElement && Object.keys(data.arrowStyles).length) {\n setStyles(data.arrowElement, data.arrowStyles);\n }\n\n return data;\n}\n\n/**\n * Set the x-placement attribute before everything else because it could be used\n * to add margins to the popper margins needs to be calculated to get the\n * correct popper offsets.\n * @method\n * @memberof Popper.modifiers\n * @param {HTMLElement} reference - The reference element used to position the popper\n * @param {HTMLElement} popper - The HTML element used as popper.\n * @param {Object} options - Popper.js options\n */\nfunction applyStyleOnLoad(reference, popper, options, modifierOptions, state) {\n // compute reference element offsets\n var referenceOffsets = getReferenceOffsets(state, popper, reference);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);\n\n popper.setAttribute('x-placement', placement);\n\n // Apply `position` to popper before anything else because\n // without the position applied we can't guarantee correct computations\n setStyles(popper, { position: 'absolute' });\n\n return options;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction computeStyle(data, options) {\n var x = options.x,\n y = options.y;\n var popper = data.offsets.popper;\n\n // Remove this legacy support in Popper.js v2\n\n var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {\n return modifier.name === 'applyStyle';\n }).gpuAcceleration;\n if (legacyGpuAccelerationOption !== undefined) {\n console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');\n }\n var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;\n\n var offsetParent = getOffsetParent(data.instance.popper);\n var offsetParentRect = getBoundingClientRect(offsetParent);\n\n // Styles\n var styles = {\n position: popper.position\n };\n\n // floor sides to avoid blurry text\n var offsets = {\n left: Math.floor(popper.left),\n top: Math.floor(popper.top),\n bottom: Math.floor(popper.bottom),\n right: Math.floor(popper.right)\n };\n\n var sideA = x === 'bottom' ? 'top' : 'bottom';\n var sideB = y === 'right' ? 'left' : 'right';\n\n // if gpuAcceleration is set to `true` and transform is supported,\n // we use `translate3d` to apply the position to the popper we\n // automatically use the supported prefixed version if needed\n var prefixedProperty = getSupportedPropertyName('transform');\n\n // now, let's make a step back and look at this code closely (wtf?)\n // If the content of the popper grows once it's been positioned, it\n // may happen that the popper gets misplaced because of the new content\n // overflowing its reference element\n // To avoid this problem, we provide two options (x and y), which allow\n // the consumer to define the offset origin.\n // If we position a popper on top of a reference element, we can set\n // `x` to `top` to make the popper grow towards its top instead of\n // its bottom.\n var left = void 0,\n top = void 0;\n if (sideA === 'bottom') {\n top = -offsetParentRect.height + offsets.bottom;\n } else {\n top = offsets.top;\n }\n if (sideB === 'right') {\n left = -offsetParentRect.width + offsets.right;\n } else {\n left = offsets.left;\n }\n if (gpuAcceleration && prefixedProperty) {\n styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';\n styles[sideA] = 0;\n styles[sideB] = 0;\n styles.willChange = 'transform';\n } else {\n // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties\n var invertTop = sideA === 'bottom' ? -1 : 1;\n var invertLeft = sideB === 'right' ? -1 : 1;\n styles[sideA] = top * invertTop;\n styles[sideB] = left * invertLeft;\n styles.willChange = sideA + ', ' + sideB;\n }\n\n // Attributes\n var attributes = {\n 'x-placement': data.placement\n };\n\n // Update `data` attributes, styles and arrowStyles\n data.attributes = _extends({}, attributes, data.attributes);\n data.styles = _extends({}, styles, data.styles);\n data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);\n\n return data;\n}\n\n/**\n * Helper used to know if the given modifier depends from another one.
      \n * It checks if the needed modifier is listed and enabled.\n * @method\n * @memberof Popper.Utils\n * @param {Array} modifiers - list of modifiers\n * @param {String} requestingName - name of requesting modifier\n * @param {String} requestedName - name of requested modifier\n * @returns {Boolean}\n */\nfunction isModifierRequired(modifiers, requestingName, requestedName) {\n var requesting = find(modifiers, function (_ref) {\n var name = _ref.name;\n return name === requestingName;\n });\n\n var isRequired = !!requesting && modifiers.some(function (modifier) {\n return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;\n });\n\n if (!isRequired) {\n var _requesting = '`' + requestingName + '`';\n var requested = '`' + requestedName + '`';\n console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');\n }\n return isRequired;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction arrow(data, options) {\n // arrow depends on keepTogether in order to work\n if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {\n return data;\n }\n\n var arrowElement = options.element;\n\n // if arrowElement is a string, suppose it's a CSS selector\n if (typeof arrowElement === 'string') {\n arrowElement = data.instance.popper.querySelector(arrowElement);\n\n // if arrowElement is not found, don't run the modifier\n if (!arrowElement) {\n return data;\n }\n } else {\n // if the arrowElement isn't a query selector we must check that the\n // provided DOM node is child of its popper node\n if (!data.instance.popper.contains(arrowElement)) {\n console.warn('WARNING: `arrow.element` must be child of its popper element!');\n return data;\n }\n }\n\n var placement = data.placement.split('-')[0];\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var isVertical = ['left', 'right'].indexOf(placement) !== -1;\n\n var len = isVertical ? 'height' : 'width';\n var sideCapitalized = isVertical ? 'Top' : 'Left';\n var side = sideCapitalized.toLowerCase();\n var altSide = isVertical ? 'left' : 'top';\n var opSide = isVertical ? 'bottom' : 'right';\n var arrowElementSize = getOuterSizes(arrowElement)[len];\n\n //\n // extends keepTogether behavior making sure the popper and its\n // reference have enough pixels in conjuction\n //\n\n // top/left side\n if (reference[opSide] - arrowElementSize < popper[side]) {\n data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);\n }\n // bottom/right side\n if (reference[side] + arrowElementSize > popper[opSide]) {\n data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];\n }\n\n // compute center of the popper\n var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;\n\n // Compute the sideValue using the updated popper offsets\n // take popper margin in account because we don't have this info available\n var popperMarginSide = getStyleComputedProperty(data.instance.popper, 'margin' + sideCapitalized).replace('px', '');\n var sideValue = center - getClientRect(data.offsets.popper)[side] - popperMarginSide;\n\n // prevent arrowElement from being placed not contiguously to its popper\n sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);\n\n data.arrowElement = arrowElement;\n data.offsets.arrow = {};\n data.offsets.arrow[side] = Math.round(sideValue);\n data.offsets.arrow[altSide] = ''; // make sure to unset any eventual altSide value from the DOM node\n\n return data;\n}\n\n/**\n * Get the opposite placement variation of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement variation\n * @returns {String} flipped placement variation\n */\nfunction getOppositeVariation(variation) {\n if (variation === 'end') {\n return 'start';\n } else if (variation === 'start') {\n return 'end';\n }\n return variation;\n}\n\n/**\n * List of accepted placements to use as values of the `placement` option.
      \n * Valid placements are:\n * - `auto`\n * - `top`\n * - `right`\n * - `bottom`\n * - `left`\n *\n * Each placement can have a variation from this list:\n * - `-start`\n * - `-end`\n *\n * Variations are interpreted easily if you think of them as the left to right\n * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`\n * is right.
      \n * Vertically (`left` and `right`), `start` is top and `end` is bottom.\n *\n * Some valid examples are:\n * - `top-end` (on top of reference, right aligned)\n * - `right-start` (on right of reference, top aligned)\n * - `bottom` (on bottom, centered)\n * - `auto-right` (on the side with more space available, alignment depends by placement)\n *\n * @static\n * @type {Array}\n * @enum {String}\n * @readonly\n * @method placements\n * @memberof Popper\n */\nvar placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];\n\n// Get rid of `auto` `auto-start` and `auto-end`\nvar validPlacements = placements.slice(3);\n\n/**\n * Given an initial placement, returns all the subsequent placements\n * clockwise (or counter-clockwise).\n *\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement - A valid placement (it accepts variations)\n * @argument {Boolean} counter - Set to true to walk the placements counterclockwise\n * @returns {Array} placements including their variations\n */\nfunction clockwise(placement) {\n var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var index = validPlacements.indexOf(placement);\n var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));\n return counter ? arr.reverse() : arr;\n}\n\nvar BEHAVIORS = {\n FLIP: 'flip',\n CLOCKWISE: 'clockwise',\n COUNTERCLOCKWISE: 'counterclockwise'\n};\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction flip(data, options) {\n // if `inner` modifier is enabled, we can't use the `flip` modifier\n if (isModifierEnabled(data.instance.modifiers, 'inner')) {\n return data;\n }\n\n if (data.flipped && data.placement === data.originalPlacement) {\n // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides\n return data;\n }\n\n var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement);\n\n var placement = data.placement.split('-')[0];\n var placementOpposite = getOppositePlacement(placement);\n var variation = data.placement.split('-')[1] || '';\n\n var flipOrder = [];\n\n switch (options.behavior) {\n case BEHAVIORS.FLIP:\n flipOrder = [placement, placementOpposite];\n break;\n case BEHAVIORS.CLOCKWISE:\n flipOrder = clockwise(placement);\n break;\n case BEHAVIORS.COUNTERCLOCKWISE:\n flipOrder = clockwise(placement, true);\n break;\n default:\n flipOrder = options.behavior;\n }\n\n flipOrder.forEach(function (step, index) {\n if (placement !== step || flipOrder.length === index + 1) {\n return data;\n }\n\n placement = data.placement.split('-')[0];\n placementOpposite = getOppositePlacement(placement);\n\n var popperOffsets = data.offsets.popper;\n var refOffsets = data.offsets.reference;\n\n // using floor because the reference offsets may contain decimals we are not going to consider here\n var floor = Math.floor;\n var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);\n\n var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);\n var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);\n var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);\n var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);\n\n var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;\n\n // flip the variation if required\n var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n var flippedVariation = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);\n\n if (overlapsRef || overflowsBoundaries || flippedVariation) {\n // this boolean to detect any flip loop\n data.flipped = true;\n\n if (overlapsRef || overflowsBoundaries) {\n placement = flipOrder[index + 1];\n }\n\n if (flippedVariation) {\n variation = getOppositeVariation(variation);\n }\n\n data.placement = placement + (variation ? '-' + variation : '');\n\n // this object contains `position`, we want to preserve it along with\n // any additional property we may add in the future\n data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));\n\n data = runModifiers(data.instance.modifiers, data, 'flip');\n }\n });\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction keepTogether(data) {\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var placement = data.placement.split('-')[0];\n var floor = Math.floor;\n var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n var side = isVertical ? 'right' : 'bottom';\n var opSide = isVertical ? 'left' : 'top';\n var measurement = isVertical ? 'width' : 'height';\n\n if (popper[side] < floor(reference[opSide])) {\n data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];\n }\n if (popper[opSide] > floor(reference[side])) {\n data.offsets.popper[opSide] = floor(reference[side]);\n }\n\n return data;\n}\n\n/**\n * Converts a string containing value + unit into a px value number\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} str - Value + unit string\n * @argument {String} measurement - `height` or `width`\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @returns {Number|String}\n * Value in pixels, or original string if no values were extracted\n */\nfunction toValue(str, measurement, popperOffsets, referenceOffsets) {\n // separate value from unit\n var split = str.match(/((?:\\-|\\+)?\\d*\\.?\\d*)(.*)/);\n var value = +split[1];\n var unit = split[2];\n\n // If it's not a number it's an operator, I guess\n if (!value) {\n return str;\n }\n\n if (unit.indexOf('%') === 0) {\n var element = void 0;\n switch (unit) {\n case '%p':\n element = popperOffsets;\n break;\n case '%':\n case '%r':\n default:\n element = referenceOffsets;\n }\n\n var rect = getClientRect(element);\n return rect[measurement] / 100 * value;\n } else if (unit === 'vh' || unit === 'vw') {\n // if is a vh or vw, we calculate the size based on the viewport\n var size = void 0;\n if (unit === 'vh') {\n size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);\n } else {\n size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);\n }\n return size / 100 * value;\n } else {\n // if is an explicit pixel unit, we get rid of the unit and keep the value\n // if is an implicit unit, it's px, and we return just the value\n return value;\n }\n}\n\n/**\n * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} offset\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @argument {String} basePlacement\n * @returns {Array} a two cells array with x and y offsets in numbers\n */\nfunction parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {\n var offsets = [0, 0];\n\n // Use height if placement is left or right and index is 0 otherwise use width\n // in this way the first offset will use an axis and the second one\n // will use the other one\n var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;\n\n // Split the offset string to obtain a list of values and operands\n // The regex addresses values with the plus or minus sign in front (+10, -20, etc)\n var fragments = offset.split(/(\\+|\\-)/).map(function (frag) {\n return frag.trim();\n });\n\n // Detect if the offset string contains a pair of values or a single one\n // they could be separated by comma or space\n var divider = fragments.indexOf(find(fragments, function (frag) {\n return frag.search(/,|\\s/) !== -1;\n }));\n\n if (fragments[divider] && fragments[divider].indexOf(',') === -1) {\n console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');\n }\n\n // If divider is found, we divide the list of values and operands to divide\n // them by ofset X and Y.\n var splitRegex = /\\s*,\\s*|\\s+/;\n var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];\n\n // Convert the values with units to absolute pixels to allow our computations\n ops = ops.map(function (op, index) {\n // Most of the units rely on the orientation of the popper\n var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';\n var mergeWithPrevious = false;\n return op\n // This aggregates any `+` or `-` sign that aren't considered operators\n // e.g.: 10 + +5 => [10, +, +5]\n .reduce(function (a, b) {\n if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {\n a[a.length - 1] = b;\n mergeWithPrevious = true;\n return a;\n } else if (mergeWithPrevious) {\n a[a.length - 1] += b;\n mergeWithPrevious = false;\n return a;\n } else {\n return a.concat(b);\n }\n }, [])\n // Here we convert the string values into number values (in px)\n .map(function (str) {\n return toValue(str, measurement, popperOffsets, referenceOffsets);\n });\n });\n\n // Loop trough the offsets arrays and execute the operations\n ops.forEach(function (op, index) {\n op.forEach(function (frag, index2) {\n if (isNumeric(frag)) {\n offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);\n }\n });\n });\n return offsets;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @argument {Number|String} options.offset=0\n * The offset value as described in the modifier description\n * @returns {Object} The data object, properly modified\n */\nfunction offset(data, _ref) {\n var offset = _ref.offset;\n var placement = data.placement,\n _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var basePlacement = placement.split('-')[0];\n\n var offsets = void 0;\n if (isNumeric(+offset)) {\n offsets = [+offset, 0];\n } else {\n offsets = parseOffset(offset, popper, reference, basePlacement);\n }\n\n if (basePlacement === 'left') {\n popper.top += offsets[0];\n popper.left -= offsets[1];\n } else if (basePlacement === 'right') {\n popper.top += offsets[0];\n popper.left += offsets[1];\n } else if (basePlacement === 'top') {\n popper.left += offsets[0];\n popper.top -= offsets[1];\n } else if (basePlacement === 'bottom') {\n popper.left += offsets[0];\n popper.top += offsets[1];\n }\n\n data.popper = popper;\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction preventOverflow(data, options) {\n var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);\n\n // If offsetParent is the reference element, we really want to\n // go one step up and use the next offsetParent as reference to\n // avoid to make this modifier completely useless and look like broken\n if (data.instance.reference === boundariesElement) {\n boundariesElement = getOffsetParent(boundariesElement);\n }\n\n var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement);\n options.boundaries = boundaries;\n\n var order = options.priority;\n var popper = data.offsets.popper;\n\n var check = {\n primary: function primary(placement) {\n var value = popper[placement];\n if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {\n value = Math.max(popper[placement], boundaries[placement]);\n }\n return defineProperty({}, placement, value);\n },\n secondary: function secondary(placement) {\n var mainSide = placement === 'right' ? 'left' : 'top';\n var value = popper[mainSide];\n if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {\n value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));\n }\n return defineProperty({}, mainSide, value);\n }\n };\n\n order.forEach(function (placement) {\n var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';\n popper = _extends({}, popper, check[side](placement));\n });\n\n data.offsets.popper = popper;\n\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction shift(data) {\n var placement = data.placement;\n var basePlacement = placement.split('-')[0];\n var shiftvariation = placement.split('-')[1];\n\n // if shift shiftvariation is specified, run the modifier\n if (shiftvariation) {\n var _data$offsets = data.offsets,\n reference = _data$offsets.reference,\n popper = _data$offsets.popper;\n\n var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;\n var side = isVertical ? 'left' : 'top';\n var measurement = isVertical ? 'width' : 'height';\n\n var shiftOffsets = {\n start: defineProperty({}, side, reference[side]),\n end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])\n };\n\n data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);\n }\n\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction hide(data) {\n if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {\n return data;\n }\n\n var refRect = data.offsets.reference;\n var bound = find(data.instance.modifiers, function (modifier) {\n return modifier.name === 'preventOverflow';\n }).boundaries;\n\n if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {\n // Avoid unnecessary DOM access if visibility hasn't changed\n if (data.hide === true) {\n return data;\n }\n\n data.hide = true;\n data.attributes['x-out-of-boundaries'] = '';\n } else {\n // Avoid unnecessary DOM access if visibility hasn't changed\n if (data.hide === false) {\n return data;\n }\n\n data.hide = false;\n data.attributes['x-out-of-boundaries'] = false;\n }\n\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction inner(data) {\n var placement = data.placement;\n var basePlacement = placement.split('-')[0];\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;\n\n var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;\n\n popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);\n\n data.placement = getOppositePlacement(placement);\n data.offsets.popper = getClientRect(popper);\n\n return data;\n}\n\n/**\n * Modifier function, each modifier can have a function of this type assigned\n * to its `fn` property.
      \n * These functions will be called on each update, this means that you must\n * make sure they are performant enough to avoid performance bottlenecks.\n *\n * @function ModifierFn\n * @argument {dataObject} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {dataObject} The data object, properly modified\n */\n\n/**\n * Modifiers are plugins used to alter the behavior of your poppers.
      \n * Popper.js uses a set of 9 modifiers to provide all the basic functionalities\n * needed by the library.\n *\n * Usually you don't want to override the `order`, `fn` and `onLoad` props.\n * All the other properties are configurations that could be tweaked.\n * @namespace modifiers\n */\nvar modifiers = {\n /**\n * Modifier used to shift the popper on the start or end of its reference\n * element.
      \n * It will read the variation of the `placement` property.
      \n * It can be one either `-end` or `-start`.\n * @memberof modifiers\n * @inner\n */\n shift: {\n /** @prop {number} order=100 - Index used to define the order of execution */\n order: 100,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: shift\n },\n\n /**\n * The `offset` modifier can shift your popper on both its axis.\n *\n * It accepts the following units:\n * - `px` or unitless, interpreted as pixels\n * - `%` or `%r`, percentage relative to the length of the reference element\n * - `%p`, percentage relative to the length of the popper element\n * - `vw`, CSS viewport width unit\n * - `vh`, CSS viewport height unit\n *\n * For length is intended the main axis relative to the placement of the popper.
      \n * This means that if the placement is `top` or `bottom`, the length will be the\n * `width`. In case of `left` or `right`, it will be the height.\n *\n * You can provide a single value (as `Number` or `String`), or a pair of values\n * as `String` divided by a comma or one (or more) white spaces.
      \n * The latter is a deprecated method because it leads to confusion and will be\n * removed in v2.
      \n * Additionally, it accepts additions and subtractions between different units.\n * Note that multiplications and divisions aren't supported.\n *\n * Valid examples are:\n * ```\n * 10\n * '10%'\n * '10, 10'\n * '10%, 10'\n * '10 + 10%'\n * '10 - 5vh + 3%'\n * '-10px + 5vh, 5px - 6%'\n * ```\n * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap\n * > with their reference element, unfortunately, you will have to disable the `flip` modifier.\n * > More on this [reading this issue](https://github.com/FezVrasta/popper.js/issues/373)\n *\n * @memberof modifiers\n * @inner\n */\n offset: {\n /** @prop {number} order=200 - Index used to define the order of execution */\n order: 200,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: offset,\n /** @prop {Number|String} offset=0\n * The offset value as described in the modifier description\n */\n offset: 0\n },\n\n /**\n * Modifier used to prevent the popper from being positioned outside the boundary.\n *\n * An scenario exists where the reference itself is not within the boundaries.
      \n * We can say it has \"escaped the boundaries\" — or just \"escaped\".
      \n * In this case we need to decide whether the popper should either:\n *\n * - detach from the reference and remain \"trapped\" in the boundaries, or\n * - if it should ignore the boundary and \"escape with its reference\"\n *\n * When `escapeWithReference` is set to`true` and reference is completely\n * outside its boundaries, the popper will overflow (or completely leave)\n * the boundaries in order to remain attached to the edge of the reference.\n *\n * @memberof modifiers\n * @inner\n */\n preventOverflow: {\n /** @prop {number} order=300 - Index used to define the order of execution */\n order: 300,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: preventOverflow,\n /**\n * @prop {Array} [priority=['left','right','top','bottom']]\n * Popper will try to prevent overflow following these priorities by default,\n * then, it could overflow on the left and on top of the `boundariesElement`\n */\n priority: ['left', 'right', 'top', 'bottom'],\n /**\n * @prop {number} padding=5\n * Amount of pixel used to define a minimum distance between the boundaries\n * and the popper this makes sure the popper has always a little padding\n * between the edges of its container\n */\n padding: 5,\n /**\n * @prop {String|HTMLElement} boundariesElement='scrollParent'\n * Boundaries used by the modifier, can be `scrollParent`, `window`,\n * `viewport` or any DOM element.\n */\n boundariesElement: 'scrollParent'\n },\n\n /**\n * Modifier used to make sure the reference and its popper stay near eachothers\n * without leaving any gap between the two. Expecially useful when the arrow is\n * enabled and you want to assure it to point to its reference element.\n * It cares only about the first axis, you can still have poppers with margin\n * between the popper and its reference element.\n * @memberof modifiers\n * @inner\n */\n keepTogether: {\n /** @prop {number} order=400 - Index used to define the order of execution */\n order: 400,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: keepTogether\n },\n\n /**\n * This modifier is used to move the `arrowElement` of the popper to make\n * sure it is positioned between the reference element and its popper element.\n * It will read the outer size of the `arrowElement` node to detect how many\n * pixels of conjuction are needed.\n *\n * It has no effect if no `arrowElement` is provided.\n * @memberof modifiers\n * @inner\n */\n arrow: {\n /** @prop {number} order=500 - Index used to define the order of execution */\n order: 500,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: arrow,\n /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */\n element: '[x-arrow]'\n },\n\n /**\n * Modifier used to flip the popper's placement when it starts to overlap its\n * reference element.\n *\n * Requires the `preventOverflow` modifier before it in order to work.\n *\n * **NOTE:** this modifier will interrupt the current update cycle and will\n * restart it if it detects the need to flip the placement.\n * @memberof modifiers\n * @inner\n */\n flip: {\n /** @prop {number} order=600 - Index used to define the order of execution */\n order: 600,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: flip,\n /**\n * @prop {String|Array} behavior='flip'\n * The behavior used to change the popper's placement. It can be one of\n * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid\n * placements (with optional variations).\n */\n behavior: 'flip',\n /**\n * @prop {number} padding=5\n * The popper will flip if it hits the edges of the `boundariesElement`\n */\n padding: 5,\n /**\n * @prop {String|HTMLElement} boundariesElement='viewport'\n * The element which will define the boundaries of the popper position,\n * the popper will never be placed outside of the defined boundaries\n * (except if keepTogether is enabled)\n */\n boundariesElement: 'viewport'\n },\n\n /**\n * Modifier used to make the popper flow toward the inner of the reference element.\n * By default, when this modifier is disabled, the popper will be placed outside\n * the reference element.\n * @memberof modifiers\n * @inner\n */\n inner: {\n /** @prop {number} order=700 - Index used to define the order of execution */\n order: 700,\n /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */\n enabled: false,\n /** @prop {ModifierFn} */\n fn: inner\n },\n\n /**\n * Modifier used to hide the popper when its reference element is outside of the\n * popper boundaries. It will set a `x-out-of-boundaries` attribute which can\n * be used to hide with a CSS selector the popper when its reference is\n * out of boundaries.\n *\n * Requires the `preventOverflow` modifier before it in order to work.\n * @memberof modifiers\n * @inner\n */\n hide: {\n /** @prop {number} order=800 - Index used to define the order of execution */\n order: 800,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: hide\n },\n\n /**\n * Computes the style that will be applied to the popper element to gets\n * properly positioned.\n *\n * Note that this modifier will not touch the DOM, it just prepares the styles\n * so that `applyStyle` modifier can apply it. This separation is useful\n * in case you need to replace `applyStyle` with a custom implementation.\n *\n * This modifier has `850` as `order` value to maintain backward compatibility\n * with previous versions of Popper.js. Expect the modifiers ordering method\n * to change in future major versions of the library.\n *\n * @memberof modifiers\n * @inner\n */\n computeStyle: {\n /** @prop {number} order=850 - Index used to define the order of execution */\n order: 850,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: computeStyle,\n /**\n * @prop {Boolean} gpuAcceleration=true\n * If true, it uses the CSS 3d transformation to position the popper.\n * Otherwise, it will use the `top` and `left` properties.\n */\n gpuAcceleration: true,\n /**\n * @prop {string} [x='bottom']\n * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.\n * Change this if your popper should grow in a direction different from `bottom`\n */\n x: 'bottom',\n /**\n * @prop {string} [x='left']\n * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.\n * Change this if your popper should grow in a direction different from `right`\n */\n y: 'right'\n },\n\n /**\n * Applies the computed styles to the popper element.\n *\n * All the DOM manipulations are limited to this modifier. This is useful in case\n * you want to integrate Popper.js inside a framework or view library and you\n * want to delegate all the DOM manipulations to it.\n *\n * Note that if you disable this modifier, you must make sure the popper element\n * has its position set to `absolute` before Popper.js can do its work!\n *\n * Just disable this modifier and define you own to achieve the desired effect.\n *\n * @memberof modifiers\n * @inner\n */\n applyStyle: {\n /** @prop {number} order=900 - Index used to define the order of execution */\n order: 900,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: applyStyle,\n /** @prop {Function} */\n onLoad: applyStyleOnLoad,\n /**\n * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier\n * @prop {Boolean} gpuAcceleration=true\n * If true, it uses the CSS 3d transformation to position the popper.\n * Otherwise, it will use the `top` and `left` properties.\n */\n gpuAcceleration: undefined\n }\n};\n\n/**\n * The `dataObject` is an object containing all the informations used by Popper.js\n * this object get passed to modifiers and to the `onCreate` and `onUpdate` callbacks.\n * @name dataObject\n * @property {Object} data.instance The Popper.js instance\n * @property {String} data.placement Placement applied to popper\n * @property {String} data.originalPlacement Placement originally defined on init\n * @property {Boolean} data.flipped True if popper has been flipped by flip modifier\n * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper.\n * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier\n * @property {Object} data.styles Any CSS property defined here will be applied to the popper, it expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow, it expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.boundaries Offsets of the popper boundaries\n * @property {Object} data.offsets The measurements of popper, reference and arrow elements.\n * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0\n */\n\n/**\n * Default options provided to Popper.js constructor.
      \n * These can be overriden using the `options` argument of Popper.js.
      \n * To override an option, simply pass as 3rd argument an object with the same\n * structure of this object, example:\n * ```\n * new Popper(ref, pop, {\n * modifiers: {\n * preventOverflow: { enabled: false }\n * }\n * })\n * ```\n * @type {Object}\n * @static\n * @memberof Popper\n */\nvar Defaults = {\n /**\n * Popper's placement\n * @prop {Popper.placements} placement='bottom'\n */\n placement: 'bottom',\n\n /**\n * Whether events (resize, scroll) are initially enabled\n * @prop {Boolean} eventsEnabled=true\n */\n eventsEnabled: true,\n\n /**\n * Set to true if you want to automatically remove the popper when\n * you call the `destroy` method.\n * @prop {Boolean} removeOnDestroy=false\n */\n removeOnDestroy: false,\n\n /**\n * Callback called when the popper is created.
      \n * By default, is set to no-op.
      \n * Access Popper.js instance with `data.instance`.\n * @prop {onCreate}\n */\n onCreate: function onCreate() {},\n\n /**\n * Callback called when the popper is updated, this callback is not called\n * on the initialization/creation of the popper, but only on subsequent\n * updates.
      \n * By default, is set to no-op.
      \n * Access Popper.js instance with `data.instance`.\n * @prop {onUpdate}\n */\n onUpdate: function onUpdate() {},\n\n /**\n * List of modifiers used to modify the offsets before they are applied to the popper.\n * They provide most of the functionalities of Popper.js\n * @prop {modifiers}\n */\n modifiers: modifiers\n};\n\n/**\n * @callback onCreate\n * @param {dataObject} data\n */\n\n/**\n * @callback onUpdate\n * @param {dataObject} data\n */\n\n// Utils\n// Methods\nvar Popper = function () {\n /**\n * Create a new Popper.js instance\n * @class Popper\n * @param {HTMLElement|referenceObject} reference - The reference element used to position the popper\n * @param {HTMLElement} popper - The HTML element used as popper.\n * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)\n * @return {Object} instance - The generated Popper.js instance\n */\n function Popper(reference, popper) {\n var _this = this;\n\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n classCallCheck(this, Popper);\n\n this.scheduleUpdate = function () {\n return requestAnimationFrame(_this.update);\n };\n\n // make update() debounced, so that it only runs at most once-per-tick\n this.update = debounce(this.update.bind(this));\n\n // with {} we create a new object with the options inside it\n this.options = _extends({}, Popper.Defaults, options);\n\n // init state\n this.state = {\n isDestroyed: false,\n isCreated: false,\n scrollParents: []\n };\n\n // get reference and popper elements (allow jQuery wrappers)\n this.reference = reference && reference.jquery ? reference[0] : reference;\n this.popper = popper && popper.jquery ? popper[0] : popper;\n\n // Deep merge modifiers options\n this.options.modifiers = {};\n Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {\n _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});\n });\n\n // Refactoring modifiers' list (Object => Array)\n this.modifiers = Object.keys(this.options.modifiers).map(function (name) {\n return _extends({\n name: name\n }, _this.options.modifiers[name]);\n })\n // sort the modifiers by order\n .sort(function (a, b) {\n return a.order - b.order;\n });\n\n // modifiers have the ability to execute arbitrary code when Popper.js get inited\n // such code is executed in the same order of its modifier\n // they could add new properties to their options configuration\n // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!\n this.modifiers.forEach(function (modifierOptions) {\n if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {\n modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);\n }\n });\n\n // fire the first update to position the popper in the right place\n this.update();\n\n var eventsEnabled = this.options.eventsEnabled;\n if (eventsEnabled) {\n // setup event listeners, they will take care of update the position in specific situations\n this.enableEventListeners();\n }\n\n this.state.eventsEnabled = eventsEnabled;\n }\n\n // We can't use class properties because they don't get listed in the\n // class prototype and break stuff like Sinon stubs\n\n\n createClass(Popper, [{\n key: 'update',\n value: function update$$1() {\n return update.call(this);\n }\n }, {\n key: 'destroy',\n value: function destroy$$1() {\n return destroy.call(this);\n }\n }, {\n key: 'enableEventListeners',\n value: function enableEventListeners$$1() {\n return enableEventListeners.call(this);\n }\n }, {\n key: 'disableEventListeners',\n value: function disableEventListeners$$1() {\n return disableEventListeners.call(this);\n }\n\n /**\n * Schedule an update, it will run on the next UI update available\n * @method scheduleUpdate\n * @memberof Popper\n */\n\n\n /**\n * Collection of utilities useful when writing custom modifiers.\n * Starting from version 1.7, this method is available only if you\n * include `popper-utils.js` before `popper.js`.\n *\n * **DEPRECATION**: This way to access PopperUtils is deprecated\n * and will be removed in v2! Use the PopperUtils module directly instead.\n * Due to the high instability of the methods contained in Utils, we can't\n * guarantee them to follow semver. Use them at your own risk!\n * @static\n * @private\n * @type {Object}\n * @deprecated since version 1.8\n * @member Utils\n * @memberof Popper\n */\n\n }]);\n return Popper;\n}();\n\n/**\n * The `referenceObject` is an object that provides an interface compatible with Popper.js\n * and lets you use it as replacement of a real DOM node.
      \n * You can use this method to position a popper relatively to a set of coordinates\n * in case you don't have a DOM node to use as reference.\n *\n * ```\n * new Popper(referenceObject, popperNode);\n * ```\n *\n * NB: This feature isn't supported in Internet Explorer 10\n * @name referenceObject\n * @property {Function} data.getBoundingClientRect\n * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.\n * @property {number} data.clientWidth\n * An ES6 getter that will return the width of the virtual reference element.\n * @property {number} data.clientHeight\n * An ES6 getter that will return the height of the virtual reference element.\n */\n\n\nPopper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;\nPopper.placements = placements;\nPopper.Defaults = Defaults;\n\nreturn Popper;\n\n})));\n//# sourceMappingURL=popper.js.map\n"],"file":"popper.min.js"} \ No newline at end of file diff --git a/lib/amd/build/prefetch.min.js b/lib/amd/build/prefetch.min.js index 95f70ab1cf8..c0945c238f8 100644 --- a/lib/amd/build/prefetch.min.js +++ b/lib/amd/build/prefetch.min.js @@ -1,2 +1,2 @@ -define ("core/prefetch",["exports","core/config"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.default=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);var i="undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:{};function c(a){return g(a)||f(a)||e(a)||d()}function d(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function e(a,b){if(!a)return;if("string"==typeof a)return h(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);if("Object"===c&&a.constructor)c=a.constructor.name;if("Map"===c||"Set"===c)return Array.from(c);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return h(a,b)}function f(a){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(a))return Array.from(a)}function g(a){if(Array.isArray(a))return h(a)}function h(a,b){if(null==b||b>a.length)b=a.length;for(var c=0,d=Array(b);ca.length)b=a.length;for(var c=0,d=Array(b);c.\n\n/**\n * Prefetch module to help lazily load content for use on the current page.\n *\n * @module core/prefetch\n * @class prefetch\n * @package core\n * @copyright 2020 Andrew Nicols \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport Config from 'core/config';\n\n// Keep track of whether the initial prefetch has occurred.\nlet initialPrefetchComplete = false;\n\n// Prefetch templates.\nlet templateList = [];\n\n// Prefetch strings.\nlet stringList = {};\n\nlet prefetchTimer;\n\n/**\n * Fetch all queued items in the queue.\n *\n * Should only be called via processQueue.\n */\nconst fetchQueue = () => {\n // Prefetch templates.\n if (templateList) {\n const templatesToLoad = templateList.slice();\n templateList = [];\n import('core/templates')\n .then(Templates => Templates.prefetchTemplates(templatesToLoad))\n .catch();\n }\n\n // Prefetch strings.\n const mappedStringsToFetch = stringList;\n stringList = {};\n\n const stringsToFetch = [];\n Object.keys(mappedStringsToFetch).forEach(component => {\n stringsToFetch.push(...mappedStringsToFetch[component].map(key => {\n return {component, key};\n }));\n });\n\n if (stringsToFetch) {\n import('core/str')\n .then(Str => Str.get_strings(stringsToFetch))\n .catch();\n }\n};\n\n/**\n * Process the prefetch queues as required.\n *\n * The initial call will queue the first fetch after a delay.\n * Subsequent fetches are immediate.\n */\nconst processQueue = () => {\n if (prefetchTimer) {\n // There is a live prefetch timer. The initial prefetch has been scheduled but is not complete.\n return;\n }\n\n // The initial prefetch has compelted. Just queue as normal.\n if (initialPrefetchComplete) {\n fetchQueue();\n\n return;\n }\n\n // Queue the initial prefetch in a short while.\n prefetchTimer = setTimeout(() => {\n initialPrefetchComplete = true;\n prefetchTimer = null;\n\n // Ensure that the icon system is loaded.\n // This can be quite slow and delay UI interactions if it is loaded on demand.\n import(Config.iconsystemmodule)\n .then(IconSystem => {\n const iconSystem = new IconSystem();\n prefetchTemplate(iconSystem.getTemplateName());\n\n return iconSystem;\n })\n .then(iconSystem => {\n fetchQueue();\n iconSystem.init();\n\n return;\n })\n .catch();\n }, 500);\n};\n\n/**\n * Add a set of templates to the prefetch queue.\n *\n * @param {Array} templatesNames\n */\nconst prefetchTemplates = templatesNames => {\n templateList = templateList.concat(templatesNames);\n\n processQueue();\n};\n\n/**\n * Add a single template to the prefetch queue.\n *\n * @param {String} templateName\n * @returns {undefined}\n */\nconst prefetchTemplate = templateName => prefetchTemplates([templateName]);\n\n/**\n * Add a set of strings from the same component to the prefetch queue.\n *\n * @param {String} component\n * @param {String[]} keys\n */\nconst prefetchStrings = (component, keys) => {\n if (!stringList[component]) {\n stringList[component] = [];\n }\n\n stringList[component] = stringList[component].concat(keys);\n\n processQueue();\n};\n\n/**\n * Add a single string to the prefetch queue.\n *\n * @param {String} component\n * @param {String} key\n */\nconst prefetchString = (component, key) => {\n if (!stringList[component]) {\n stringList[component] = [];\n }\n\n stringList[component].push(key);\n\n processQueue();\n};\n\n// Prefetch some commonly-used templates.\nprefetchTemplates([].concat(\n ['core/loading'],\n ['core/modal'],\n ['core/modal_backdrop'],\n));\n\n// And some commonly used strings.\nprefetchStrings('core', [\n 'cancel',\n 'closebuttontitle',\n 'loading',\n 'savechanges',\n]);\nprefetchStrings('core_form', [\n 'showless',\n 'showmore',\n]);\n\nexport default {\n prefetchTemplate,\n prefetchTemplates,\n prefetchString,\n prefetchStrings,\n};\n"],"file":"prefetch.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/prefetch.js"],"names":["initialPrefetchComplete","templateList","stringList","prefetchTimer","fetchQueue","templatesToLoad","slice","then","Templates","prefetchTemplates","catch","mappedStringsToFetch","stringsToFetch","Object","keys","forEach","component","push","map","key","Str","get_strings","processQueue","setTimeout","Config","iconsystemmodule","IconSystem","iconSystem","prefetchTemplate","getTemplateName","init","templatesNames","concat","templateName","prefetchStrings","prefetchString"],"mappings":"+IAwBA,uD,k3BAGIA,CAAAA,CAAuB,G,CAGvBC,CAAY,CAAG,E,CAGfC,CAAU,CAAG,E,CAEbC,C,CAOEC,CAAU,CAAG,UAAM,CAErB,GAAIH,CAAJ,CAAkB,CACd,GAAMI,CAAAA,CAAe,CAAGJ,CAAY,CAACK,KAAb,EAAxB,CACAL,CAAY,CAAG,EAAf,CACA,mSAAO,gBAAP,0CACCM,IADD,CACM,SAAAC,CAAS,QAAIA,CAAAA,CAAS,CAACC,iBAAV,CAA4BJ,CAA5B,CAAJ,CADf,EAECK,KAFD,EAGH,CAGD,GAAMC,CAAAA,CAAoB,CAAGT,CAA7B,CACAA,CAAU,CAAG,EAAb,CAEA,GAAMU,CAAAA,CAAc,CAAG,EAAvB,CACAC,MAAM,CAACC,IAAP,CAAYH,CAAZ,EAAkCI,OAAlC,CAA0C,SAAAC,CAAS,CAAI,CACnDJ,CAAc,CAACK,IAAf,OAAAL,CAAc,GAASD,CAAoB,CAACK,CAAD,CAApB,CAAgCE,GAAhC,CAAoC,SAAAC,CAAG,CAAI,CAC9D,MAAO,CAACH,SAAS,CAATA,CAAD,CAAYG,GAAG,CAAHA,CAAZ,CACV,CAFsB,CAAT,EAGjB,CAJD,EAOI,6RAAO,UAAP,oCACCZ,IADD,CACM,SAAAa,CAAG,QAAIA,CAAAA,CAAG,CAACC,WAAJ,CAAgBT,CAAhB,C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CAAU,CAACc,CAAD,CAAV,CAAwB,EAC3B,CAEDd,CAAU,CAACc,CAAD,CAAV,CAAsBC,IAAtB,CAA2BE,CAA3B,EAEAG,CAAY,EACf,C,CAGDb,CAAiB,CAAC,GAAGuB,MAAH,CACd,CAAC,cAAD,CADc,CAEd,CAAC,YAAD,CAFc,CAGd,CAAC,qBAAD,CAHc,CAAD,CAAjB,CAOAE,CAAe,CAAC,MAAD,CAAS,CACpB,QADoB,CAEpB,kBAFoB,CAGpB,SAHoB,CAIpB,aAJoB,CAAT,CAAf,CAMAA,CAAe,CAAC,WAAD,CAAc,CACzB,UADyB,CAEzB,UAFyB,CAAd,CAAf,C,UAKe,CACXN,gBAAgB,CAAhBA,CADW,CAEXnB,iBAAiB,CAAjBA,CAFW,CAGX0B,cAAc,CAAdA,CAHW,CAIXD,eAAe,CAAfA,CAJW,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Prefetch module to help lazily load content for use on the current page.\n *\n * @module core/prefetch\n * @class prefetch\n * @package core\n * @copyright 2020 Andrew Nicols \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport Config from 'core/config';\n\n// Keep track of whether the initial prefetch has occurred.\nlet initialPrefetchComplete = false;\n\n// Prefetch templates.\nlet templateList = [];\n\n// Prefetch strings.\nlet stringList = {};\n\nlet prefetchTimer;\n\n/**\n * Fetch all queued items in the queue.\n *\n * Should only be called via processQueue.\n */\nconst fetchQueue = () => {\n // Prefetch templates.\n if (templateList) {\n const templatesToLoad = templateList.slice();\n templateList = [];\n import('core/templates')\n .then(Templates => Templates.prefetchTemplates(templatesToLoad))\n .catch();\n }\n\n // Prefetch strings.\n const mappedStringsToFetch = stringList;\n stringList = {};\n\n const stringsToFetch = [];\n Object.keys(mappedStringsToFetch).forEach(component => {\n stringsToFetch.push(...mappedStringsToFetch[component].map(key => {\n return {component, key};\n }));\n });\n\n if (stringsToFetch) {\n import('core/str')\n .then(Str => Str.get_strings(stringsToFetch))\n .catch();\n }\n};\n\n/**\n * Process the prefetch queues as required.\n *\n * The initial call will queue the first fetch after a delay.\n * Subsequent fetches are immediate.\n */\nconst processQueue = () => {\n if (prefetchTimer) {\n // There is a live prefetch timer. The initial prefetch has been scheduled but is not complete.\n return;\n }\n\n // The initial prefetch has compelted. Just queue as normal.\n if (initialPrefetchComplete) {\n fetchQueue();\n\n return;\n }\n\n // Queue the initial prefetch in a short while.\n prefetchTimer = setTimeout(() => {\n initialPrefetchComplete = true;\n prefetchTimer = null;\n\n // Ensure that the icon system is loaded.\n // This can be quite slow and delay UI interactions if it is loaded on demand.\n import(Config.iconsystemmodule)\n .then(IconSystem => {\n const iconSystem = new IconSystem();\n prefetchTemplate(iconSystem.getTemplateName());\n\n return iconSystem;\n })\n .then(iconSystem => {\n fetchQueue();\n iconSystem.init();\n\n return;\n })\n .catch();\n }, 500);\n};\n\n/**\n * Add a set of templates to the prefetch queue.\n *\n * @param {Array} templatesNames\n */\nconst prefetchTemplates = templatesNames => {\n templateList = templateList.concat(templatesNames);\n\n processQueue();\n};\n\n/**\n * Add a single template to the prefetch queue.\n *\n * @param {String} templateName\n * @returns {undefined}\n */\nconst prefetchTemplate = templateName => prefetchTemplates([templateName]);\n\n/**\n * Add a set of strings from the same component to the prefetch queue.\n *\n * @param {String} component\n * @param {String[]} keys\n */\nconst prefetchStrings = (component, keys) => {\n if (!stringList[component]) {\n stringList[component] = [];\n }\n\n stringList[component] = stringList[component].concat(keys);\n\n processQueue();\n};\n\n/**\n * Add a single string to the prefetch queue.\n *\n * @param {String} component\n * @param {String} key\n */\nconst prefetchString = (component, key) => {\n if (!stringList[component]) {\n stringList[component] = [];\n }\n\n stringList[component].push(key);\n\n processQueue();\n};\n\n// Prefetch some commonly-used templates.\nprefetchTemplates([].concat(\n ['core/loading'],\n ['core/modal'],\n ['core/modal_backdrop'],\n));\n\n// And some commonly used strings.\nprefetchStrings('core', [\n 'cancel',\n 'closebuttontitle',\n 'loading',\n 'savechanges',\n]);\nprefetchStrings('core_form', [\n 'showless',\n 'showmore',\n]);\n\nexport default {\n prefetchTemplate,\n prefetchTemplates,\n prefetchString,\n prefetchStrings,\n};\n"],"file":"prefetch.min.js"} \ No newline at end of file diff --git a/lib/amd/build/pubsub.min.js b/lib/amd/build/pubsub.min.js index 0480eba5386..a85b5fc7cb2 100644 --- a/lib/amd/build/pubsub.min.js +++ b/lib/amd/build/pubsub.min.js @@ -1,2 +1,2 @@ -define ("core/pubsub",["exports","core/pending"],function(a,b){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.publish=a.unsubscribe=a.subscribe=void 0;b=function(a){return a&&a.__esModule?a:{default:a}}(b);var c={};a.subscribe=function subscribe(a,b){c[a]=c[a]||[];c[a].push(b)};a.unsubscribe=function unsubscribe(a,b){if(c[a]){for(var d=0;d=-0&&g<=e.width+0&&f>=-0&&f<=e.height+0){return{x:g,y:f,xRatio:e.width?g/e.width:0,yRatio:e.height?f/e.height:0}}return null};l.prototype.isListHorizontal=function(a){var b=this.config.isHorizontal;if(!0===b||!1===b){return b}return b(a)};l.prototype.dragHandler=function(a){a.preventDefault();a.stopPropagation();this.calculatePositionOnPage(a);this.proxy.offset({top:-1e3,left:-1e3});var c=b(document.elementFromPoint(a.clientX,a.clientY)),d=this.info.element[0],e=function(){return this!==d},f=c.closest("."+j.targetListClass+" > :not(."+j.isDraggedClass+")").filter(e),g=c.closest("."+j.targetListClass),h=this.proxy,i=function(){return!h||!h.length||this!==h[0]};b("."+j.overElementClass).removeClass(j.overElementClass);f.addClass(j.overElementClass);this.proxy.offset({top:this.proxyDelta.y+a.pageY,left:this.proxyDelta.x+a.pageX});if(g.length&&!g.children().filter(i).length){this.moveElement(g,b())}else if(1===f.length&&!this.info.element.find(f[0]).length){var k=this.getPositionInNode(a.pageX,a.pageY,f);if(k){var m=f.parent(),n=this.isListHorizontal(m)?k.xRatio:k.yRatio,o=f.find("."+j.targetListClass),p=!o.children().filter(i).filter(e).length;if(o.length&&p&&.2n){this.moveElement(o,b())}else if(.5q.endTime-q.startTime&&!q.positionChanged){this.clickHandler(a)}}};l.prototype.hasPositionChanged=function(a){return a.sourceList[0]!==a.targetList[0]||a.sourceNextElement.length!==a.targetNextElement.length||a.sourceNextElement.length&&a.sourceNextElement[0]!==a.targetNextElement[0]};l.prototype.moveElement=function(a,b){var c=this.info.element;if(b.length&&b[0]===c[0]){return}if(a[0]===this.info.targetList[0]&&b.length===this.info.targetNextElement.length&&b[0]===this.info.targetNextElement[0]){return}if(b.length){a[0].insertBefore(c[0],b[0])}else if(this.proxy&&this.proxy.parent().length&&this.proxy.parent()[0]===a[0]){a[0].insertBefore(c[0],this.proxy[0])}else{a[0].appendChild(c[0])}this.info.targetList=a;this.info.targetNextElement=b;this.executeCallback(l.EVENTS.DRAG)};l.prototype.finishDragging=function(){this.resetDraggedClasses();if(this.config.autoScroll){c.stop()}b(window).off("mousemove touchmove.notPassive mouseup touchend.notPassive",b.proxy(this.dragHandler,this));b(window).off("keypress",b.proxy(this.dragcancelHandler,this));this.executeCallback(l.EVENTS.DRAGEND);this.info=null};l.prototype.executeCallback=function(a){this.info.element.trigger(a,this.info)};l.prototype.dragcancelHandler=function(a){if("keypress"!==a.type||27!==a.originalEvent.keyCode){return}this.moveElement(this.info.sourceList,this.info.sourceNextElement);this.finishDragging()};l.prototype.getElementName=function(a){return b.Deferred().resolve(a.text())};l.prototype.getDestinationName=function(a,b){if(!b.length){return d.get_string("movecontenttothetop","moodle")}else{return this.getElementName(b).then(function(a){return d.get_string("movecontentafter","moodle",a)})}};l.prototype.getMoveDialogueTitle=function(a,c){if(c.attr("title")){return b.Deferred().resolve(c.attr("title"))}return this.getElementName(a).then(function(a){return d.get_string("movecontent","moodle",a)})};l.prototype.getDestinationsList=function(){var a=[],c=b(this.config.targetListSelector),d=b("
        ").addClass(j.keyboardDragClass),e=b.when().then(function(){return d}),f=b.proxy(function(c,f,g){if(f.is(this.info.element)||g.is(this.info.element)){return}if(b.contains(this.info.element[0],c[0])){return}e=e.then(b.proxy(function(){return this.getDestinationName(c,g)},this)).then(function(e){var g=b("
      • ").appendTo(d),h=b("").attr("data-core_sortable_list-quickmove",1).appendTo(g);h.data("parent-element",c).data("before-element",f).text(e);return d})},this),g=function(){if(-1!==b.inArray(this,a)){return}a.push(this);var d=b(this),e=d.children();e.each(function(){var a=b(this);f(d,a,a.prev());a.find(c).each(g)});f(d,b(),e.last())};c.each(g);return e};l.prototype.displayMoveDialogue=function(a){e.create({type:e.types.CANCEL,title:this.getMoveDialogueTitle(this.info.element,a),body:this.getDestinationsList()}).then(b.proxy(function(c){var d=b.proxy(function(d){d.preventDefault();d.stopPropagation();this.moveElement(b(d.currentTarget).data("parent-element"),b(d.currentTarget).data("before-element"));this.info.endTime=new Date().getTime();this.info.positionChanged=this.hasPositionChanged(this.info);this.info.dropped=!0;a.focus();this.executeCallback(l.EVENTS.DROP);c.hide()},this);c.getRoot().on("click","[data-core_sortable_list-quickmove]",d);c.getRoot().on(f.hidden,b.proxy(function(){c.getRoot().off("click","[data-core_sortable_list-quickmove]",d);c.destroy();this.finishDragging()},this));c.setLarge();c.show();return c},this)).catch(g.exception)};return l}); +function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}define ("core/sortable_list",["jquery","core/log","core/autoscroll","core/str","core/modal_factory","core/modal_events","core/notification"],function(b,a,c,d,e,f,g){var h={targetListSelector:null,moveHandlerSelector:"[data-drag-type=move]",isHorizontal:!1,autoScroll:!0},j={keyboardDragClass:"dragdrop-keyboard-drag",isDraggedClass:"sortable-list-is-dragged",currentPositionClass:"sortable-list-current-position",sourceListClass:"sortable-list-source",targetListClass:"sortable-list-target",overElementClass:"sortable-list-over-element"},k=function(a){return{setup:function setup(b,c,d){if(c.includes("notPassive")){this.addEventListener(a,d,{passive:!1});return!0}else{return!1}}}};if(function eventListenerOptionsSupported(){var a=!1,b;try{b=Object.defineProperty({},"passive",{get:function get(){a=!0}});document.addEventListener("testpassiveeventoptions",b,b);document.removeEventListener("testpassiveeventoptions",b,b)}catch(b){a=!1}return a}){b.event.special.touchstart=k("touchstart");b.event.special.touchmove=k("touchmove");b.event.special.touchend=k("touchend")}var l=function(a,c){this.info=null;this.proxy=null;this.proxyDelta=null;this.dragCounter=0;this.lastEvent=null;this.config=b.extend({},h,c||{});this.config.listSelector=a;if(!this.config.targetListSelector){this.config.targetListSelector=a}if("object"===_typeof(this.config.listSelector)){b(this.config.listSelector).on("mousedown touchstart.notPassive",b.proxy(this.dragStartHandler,this))}else{b("body").on("mousedown touchstart.notPassive",this.config.listSelector,b.proxy(this.dragStartHandler,this))}if(null!==this.config.moveHandlerSelector){b("body").on("click keypress",this.config.moveHandlerSelector,b.proxy(this.clickHandler,this))}};l.EVENTS={DRAGSTART:"sortablelist-dragstart",DRAG:"sortablelist-drag",DROP:"sortablelist-drop",DRAGEND:"sortablelist-dragend"};l.prototype.resetDraggedClasses=function(){var a=[j.isDraggedClass,j.currentPositionClass,j.overElementClass,j.targetListClass];for(var c in a){b("."+a[c]).removeClass(a[c])}if(this.proxy){this.proxy.remove();this.proxy=b()}};l.prototype.calculatePositionOnPage=function(a){if(a.originalEvent&&a.originalEvent.touches&&a.originalEvent.touches[0]!==void 0){var c=a.originalEvent.touches[0];a.pageX=c.pageX;a.pageY=c.pageY}if(a.pageX===void 0){a.pageX=this.lastEvent.pageX;a.pageY=this.lastEvent.pageY}else{this.lastEvent=a}if(a.clientX===void 0){a.clientX=Math.round(a.pageX-b(window).scrollLeft());a.clientY=Math.round(a.pageY-b(window).scrollTop())}};l.prototype.dragStartHandler=function(a){if(null!==this.info){if("click"===this.info.type||"touchend"===this.info.type){return}this.moveElement(this.info.sourceList,this.info.sourceNextElement);this.finishDragging()}if("mousedown"===a.type&&1!==a.which){return}this.calculatePositionOnPage(a);var d=b(a.target).closest(b(a.currentTarget).children());if(!d.length){return}if(null!==this.config.moveHandlerSelector){if(!b(a.target).closest(this.config.moveHandlerSelector,d).length){return}}a.stopPropagation();a.preventDefault();this.dragCounter++;this.info={element:d,sourceNextElement:d.next(),sourceList:d.parent(),targetNextElement:d.next(),targetList:d.parent(),type:a.type,dropped:!1,startX:a.pageX,startY:a.pageY,startTime:new Date().getTime()};b(this.config.targetListSelector).addClass(j.targetListClass);var e=d.offset();d.addClass(j.currentPositionClass);this.proxyDelta={x:e.left-a.pageX,y:e.top-a.pageY};this.proxy=b();var f=this.dragCounter;setTimeout(b.proxy(function(){if(null===this.info||"click"===this.info.type||"keypress"===this.info.type||this.dragCounter!==f){return}this.createProxy()},this),500);b(window).on("mousemove touchmove.notPassive mouseup touchend.notPassive",b.proxy(this.dragHandler,this));b(window).on("keypress",b.proxy(this.dragcancelHandler,this));if(this.config.autoScroll){c.start(function(){b(window).trigger("mousemove")})}this.executeCallback(l.EVENTS.DRAGSTART)};l.prototype.createProxy=function(){this.proxy=this.info.element.clone();this.info.sourceList.append(this.proxy);this.proxy.removeAttr("id").removeClass(j.currentPositionClass).addClass(j.isDraggedClass).css({position:"fixed"});this.proxy.offset({top:this.proxyDelta.y+this.lastEvent.pageY,left:this.proxyDelta.x+this.lastEvent.pageX})};l.prototype.clickHandler=function(a){if("keypress"===a.type&&13!==a.originalEvent.keyCode&&32!==a.originalEvent.keyCode){return}if(null!==this.info){return}var c=b(a.target).closest(this.config.moveHandlerSelector),d=c.closest(this.config.listSelector),e=c.closest(d.children());if(!e.length){return}a.preventDefault();a.stopPropagation();this.dragCounter++;this.info={element:e,sourceNextElement:e.next(),sourceList:d,targetNextElement:e.next(),targetList:d,dropped:!1,type:a.type,startTime:new Date().getTime()};this.executeCallback(l.EVENTS.DRAGSTART);this.displayMoveDialogue(c)};l.prototype.getPositionInNode=function(a,b,c){if(!c.length){return null}var d=c[0],e=d.getBoundingClientRect(),f=b-(e.top+window.scrollY),g=a-(e.left+window.scrollX);if(g>=-0&&g<=e.width+0&&f>=-0&&f<=e.height+0){return{x:g,y:f,xRatio:e.width?g/e.width:0,yRatio:e.height?f/e.height:0}}return null};l.prototype.isListHorizontal=function(a){var b=this.config.isHorizontal;if(!0===b||!1===b){return b}return b(a)};l.prototype.dragHandler=function(a){a.preventDefault();a.stopPropagation();this.calculatePositionOnPage(a);this.proxy.offset({top:-1e3,left:-1e3});var c=b(document.elementFromPoint(a.clientX,a.clientY)),d=this.info.element[0],e=function(){return this!==d},f=c.closest("."+j.targetListClass+" > :not(."+j.isDraggedClass+")").filter(e),g=c.closest("."+j.targetListClass),h=this.proxy,i=function(){return!h||!h.length||this!==h[0]};b("."+j.overElementClass).removeClass(j.overElementClass);f.addClass(j.overElementClass);this.proxy.offset({top:this.proxyDelta.y+a.pageY,left:this.proxyDelta.x+a.pageX});if(g.length&&!g.children().filter(i).length){this.moveElement(g,b())}else if(1===f.length&&!this.info.element.find(f[0]).length){var k=this.getPositionInNode(a.pageX,a.pageY,f);if(k){var m=f.parent(),n=this.isListHorizontal(m)?k.xRatio:k.yRatio,o=f.find("."+j.targetListClass),p=!o.children().filter(i).filter(e).length;if(o.length&&p&&.2n){this.moveElement(o,b())}else if(.5q.endTime-q.startTime&&!q.positionChanged){this.clickHandler(a)}}};l.prototype.hasPositionChanged=function(a){return a.sourceList[0]!==a.targetList[0]||a.sourceNextElement.length!==a.targetNextElement.length||a.sourceNextElement.length&&a.sourceNextElement[0]!==a.targetNextElement[0]};l.prototype.moveElement=function(a,b){var c=this.info.element;if(b.length&&b[0]===c[0]){return}if(a[0]===this.info.targetList[0]&&b.length===this.info.targetNextElement.length&&b[0]===this.info.targetNextElement[0]){return}if(b.length){a[0].insertBefore(c[0],b[0])}else if(this.proxy&&this.proxy.parent().length&&this.proxy.parent()[0]===a[0]){a[0].insertBefore(c[0],this.proxy[0])}else{a[0].appendChild(c[0])}this.info.targetList=a;this.info.targetNextElement=b;this.executeCallback(l.EVENTS.DRAG)};l.prototype.finishDragging=function(){this.resetDraggedClasses();if(this.config.autoScroll){c.stop()}b(window).off("mousemove touchmove.notPassive mouseup touchend.notPassive",b.proxy(this.dragHandler,this));b(window).off("keypress",b.proxy(this.dragcancelHandler,this));this.executeCallback(l.EVENTS.DRAGEND);this.info=null};l.prototype.executeCallback=function(a){this.info.element.trigger(a,this.info)};l.prototype.dragcancelHandler=function(a){if("keypress"!==a.type||27!==a.originalEvent.keyCode){return}this.moveElement(this.info.sourceList,this.info.sourceNextElement);this.finishDragging()};l.prototype.getElementName=function(a){return b.Deferred().resolve(a.text())};l.prototype.getDestinationName=function(a,b){if(!b.length){return d.get_string("movecontenttothetop","moodle")}else{return this.getElementName(b).then(function(a){return d.get_string("movecontentafter","moodle",a)})}};l.prototype.getMoveDialogueTitle=function(a,c){if(c.attr("title")){return b.Deferred().resolve(c.attr("title"))}return this.getElementName(a).then(function(a){return d.get_string("movecontent","moodle",a)})};l.prototype.getDestinationsList=function(){var a=[],c=b(this.config.targetListSelector),d=b("
          ").addClass(j.keyboardDragClass),e=b.when().then(function(){return d}),f=b.proxy(function(c,f,g){if(f.is(this.info.element)||g.is(this.info.element)){return}if(b.contains(this.info.element[0],c[0])){return}e=e.then(b.proxy(function(){return this.getDestinationName(c,g)},this)).then(function(e){var g=b("
        • ").appendTo(d),h=b("").attr("data-core_sortable_list-quickmove",1).appendTo(g);h.data("parent-element",c).data("before-element",f).text(e);return d})},this),g=function(){if(-1!==b.inArray(this,a)){return}a.push(this);var d=b(this),e=d.children();e.each(function(){var a=b(this);f(d,a,a.prev());a.find(c).each(g)});f(d,b(),e.last())};c.each(g);return e};l.prototype.displayMoveDialogue=function(a){e.create({type:e.types.CANCEL,title:this.getMoveDialogueTitle(this.info.element,a),body:this.getDestinationsList()}).then(b.proxy(function(c){var d=b.proxy(function(d){d.preventDefault();d.stopPropagation();this.moveElement(b(d.currentTarget).data("parent-element"),b(d.currentTarget).data("before-element"));this.info.endTime=new Date().getTime();this.info.positionChanged=this.hasPositionChanged(this.info);this.info.dropped=!0;a.focus();this.executeCallback(l.EVENTS.DROP);c.hide()},this);c.getRoot().on("click","[data-core_sortable_list-quickmove]",d);c.getRoot().on(f.hidden,b.proxy(function(){c.getRoot().off("click","[data-core_sortable_list-quickmove]",d);c.destroy();this.finishDragging()},this));c.setLarge();c.show();return c},this)).catch(g.exception)};return l}); //# sourceMappingURL=sortable_list.min.js.map diff --git a/lib/amd/build/sortable_list.min.js.map b/lib/amd/build/sortable_list.min.js.map index 2caed597cca..04290c4680c 100644 --- a/lib/amd/build/sortable_list.min.js.map +++ b/lib/amd/build/sortable_list.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/sortable_list.js"],"names":["define","$","log","autoScroll","str","ModalFactory","ModalEvents","Notification","defaultParameters","targetListSelector","moveHandlerSelector","isHorizontal","CSS","keyboardDragClass","isDraggedClass","currentPositionClass","sourceListClass","targetListClass","overElementClass","registerNotPassiveListeners","eventname","setup","x","ns","handle","includes","addEventListener","passive","eventListenerOptionsSupported","passivesupported","options","Object","defineProperty","get","document","removeEventListener","err","event","special","touchstart","touchmove","touchend","SortableList","root","config","info","proxy","proxyDelta","dragCounter","lastEvent","extend","listSelector","on","dragStartHandler","clickHandler","EVENTS","DRAGSTART","DRAG","DROP","DRAGEND","prototype","resetDraggedClasses","classes","i","removeClass","remove","calculatePositionOnPage","evt","originalEvent","touches","touch","pageX","pageY","clientX","Math","round","window","scrollLeft","clientY","scrollTop","type","moveElement","sourceList","sourceNextElement","finishDragging","which","movedElement","target","closest","currentTarget","children","length","stopPropagation","preventDefault","element","next","parent","targetNextElement","targetList","dropped","startX","startY","startTime","Date","getTime","addClass","offset","left","y","top","thisDragCounter","setTimeout","createProxy","dragHandler","dragcancelHandler","start","trigger","executeCallback","clone","append","removeAttr","css","position","keyCode","clickedElement","displayMoveDialogue","getPositionInNode","node","rect","getBoundingClientRect","scrollY","scrollX","width","height","xRatio","yRatio","isListHorizontal","elementFromPoint","mainElement","isNotSelf","current","filter","currentList","isNotProxy","find","coordinates","ratio","subList","subListEmpty","endX","endY","endTime","positionChanged","hasPositionChanged","oldinfo","parentElement","beforeElement","dragEl","insertBefore","appendChild","stop","off","eventName","getElementName","Deferred","resolve","text","getDestinationName","afterElement","get_string","then","name","getMoveDialogueTitle","handler","attr","getDestinationsList","addedLists","targets","destinations","result","when","createLink","is","contains","txt","li","appendTo","a","data","addList","inArray","push","list","each","prev","last","create","types","CANCEL","title","body","modal","quickMoveHandler","e","focus","hide","getRoot","hidden","destroy","setLarge","show","catch","exception"],"mappings":"mSA4DAA,OAAM,sBAAC,CAAC,QAAD,CAAW,UAAX,CAAuB,iBAAvB,CAA0C,UAA1C,CAAsD,oBAAtD,CAA4E,mBAA5E,CAAiG,mBAAjG,CAAD,CACN,SAASC,CAAT,CAAYC,CAAZ,CAAiBC,CAAjB,CAA6BC,CAA7B,CAAkCC,CAAlC,CAAgDC,CAAhD,CAA6DC,CAA7D,CAA2E,IAQnEC,CAAAA,CAAiB,CAAG,CACpBC,kBAAkB,CAAE,IADA,CAEpBC,mBAAmB,CAAE,uBAFD,CAGpBC,YAAY,GAHQ,CAIpBR,UAAU,GAJU,CAR+C,CAqBnES,CAAG,CAAG,CACNC,iBAAiB,CAAE,wBADb,CAENC,cAAc,CAAE,0BAFV,CAGNC,oBAAoB,CAAE,gCAHhB,CAINC,eAAe,CAAE,sBAJX,CAKNC,eAAe,CAAE,sBALX,CAMNC,gBAAgB,CAAE,4BANZ,CArB6D,CAkEnEC,CAA2B,CAAG,SAASC,CAAT,CAAoB,CAClD,MAAO,CACHC,KAAK,CAAE,eAASC,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CAAqB3E,CAAY,CAACa,MAAb,CAAoBG,IAAzC,EACA+I,CAAK,CAACI,IAAN,EACH,CAVsB,CAUpB,IAVoB,CAAvB,CAWAJ,CAAK,CAACK,OAAN,GAAgB1J,EAAhB,CAAmB,OAAnB,CAA4B,qCAA5B,CAAmEsJ,CAAnE,EACAD,CAAK,CAACK,OAAN,GAAgB1J,EAAhB,CAAmB9C,CAAW,CAACyM,MAA/B,CAAuC9M,CAAC,CAAC6C,KAAF,CAAQ,UAAW,CAEtD2J,CAAK,CAACK,OAAN,GAAgB7C,GAAhB,CAAoB,OAApB,CAA6B,qCAA7B,CAAoEyC,CAApE,EACAD,CAAK,CAACO,OAAN,GACA,KAAK5H,cAAL,EACH,CALsC,CAKpC,IALoC,CAAvC,EAMAqH,CAAK,CAACQ,QAAN,GACAR,CAAK,CAACS,IAAN,GACA,MAAOT,CAAAA,CACV,CAtBO,CAsBL,IAtBK,CAJR,EA0BUU,KA1BV,CA0BgB5M,CAAY,CAAC6M,SA1B7B,CA2BH,CA5BD,CA8BA,MAAO1K,CAAAA,CAEV,CA5rBK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * A javascript module to handle list items drag and drop\n *\n * Example of usage:\n *\n * Create a list (for example
            or ) where each draggable element has a drag handle.\n * The best practice is to use the template core/drag_handle:\n * $OUTPUT->render_from_template('core/drag_handle', ['movetitle' => get_string('movecontent', 'moodle', ELEMENTNAME)]);\n *\n * Attach this JS module to this list:\n *\n * Space between define and ( critical in comment but not allowed in code in order to function\n * correctly with Moodle's requirejs.php\n *\n * define (['jquery', 'core/sortable_list'], function($, SortableList) {\n * var list = new SortableList('ul.my-awesome-list'); // source list (usually
              or ) - selector or element\n *\n * // Listen to the events when element is dragged.\n * $('ul.my-awesome-list > *').on(SortableList.EVENTS.DROP, function(evt, info) {\n * console.log(info);\n * });\n *\n * // Advanced usage. Overwrite methods getElementName, getDestinationName, moveDialogueTitle, for example:\n * list.getElementName = function(element) {\n * return $.Deferred().resolve(element.attr('data-name'));\n * }\n * }\n *\n * More details: https://docs.moodle.org/dev/Sortable_list\n *\n * For the full list of possible parameters see var defaultParameters below.\n *\n * The following jQuery events are fired:\n * - SortableList.EVENTS.DRAGSTART : when user started dragging a list element\n * - SortableList.EVENTS.DRAG : when user dragged a list element to a new position\n * - SortableList.EVENTS.DROP : when user dropped a list element\n * - SortableList.EVENTS.DROPEND : when user finished dragging - either fired right after dropping or\n * if \"Esc\" was pressed during dragging\n *\n * @module core/sortable_list\n * @class sortable_list\n * @package core\n * @copyright 2018 Marina Glancy\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/log', 'core/autoscroll', 'core/str', 'core/modal_factory', 'core/modal_events', 'core/notification'],\nfunction($, log, autoScroll, str, ModalFactory, ModalEvents, Notification) {\n\n /**\n * Default parameters\n *\n * @private\n * @type {Object}\n */\n var defaultParameters = {\n targetListSelector: null,\n moveHandlerSelector: '[data-drag-type=move]',\n isHorizontal: false,\n autoScroll: true\n };\n\n /**\n * Class names for different elements that may be changed during sorting\n *\n * @private\n * @type {Object}\n */\n var CSS = {\n keyboardDragClass: 'dragdrop-keyboard-drag',\n isDraggedClass: 'sortable-list-is-dragged',\n currentPositionClass: 'sortable-list-current-position',\n sourceListClass: 'sortable-list-source',\n targetListClass: 'sortable-list-target',\n overElementClass: 'sortable-list-over-element'\n };\n\n /**\n * Test the browser support for options objects on event listeners.\n * @return {Boolean}\n */\n var eventListenerOptionsSupported = function() {\n var passivesupported = false,\n options,\n testeventname = \"testpassiveeventoptions\";\n\n // Options support testing example from:\n // https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener\n\n try {\n options = Object.defineProperty({}, \"passive\", {\n get: function() {\n passivesupported = true;\n }\n });\n\n // We use an event name that is not likely to conflict with any real event.\n document.addEventListener(testeventname, options, options);\n // We remove the event listener as we have tested the options already.\n document.removeEventListener(testeventname, options, options);\n } catch (err) {\n // It's already false.\n passivesupported = false;\n }\n return passivesupported;\n };\n\n /**\n * Allow to create non-passive touchstart listeners and prevent page scrolling when dragging\n * From: https://stackoverflow.com/a/48098097\n *\n * @type {Object}\n */\n var registerNotPassiveListeners = function(eventname) {\n return {\n setup: function(x, ns, handle) {\n if (ns.includes('notPassive')) {\n this.addEventListener(eventname, handle, {passive: false});\n return true;\n } else {\n return false;\n }\n }\n };\n };\n\n if (eventListenerOptionsSupported) {\n $.event.special.touchstart = registerNotPassiveListeners('touchstart');\n $.event.special.touchmove = registerNotPassiveListeners('touchmove');\n $.event.special.touchend = registerNotPassiveListeners('touchend');\n }\n\n /**\n * Initialise sortable list.\n *\n * @param {(String|jQuery|Element)} root JQuery/DOM element representing sortable list (i.e.
                , ) or CSS selector\n * @param {Object} config Parameters for the list. See defaultParameters above for examples.\n * @property {(String|jQuery|Element)} config.targetListSelector target lists, by default same as root\n * @property {String} config.moveHandlerSelector CSS selector for a drag handle. By default '[data-drag-type=move]'\n * @property {String} config.targetListSelector CSS selector for target lists. By default the same as root\n * @property {(Boolean|Function)} config.isHorizontal Set to true if the list is horizontal\n * (can also be a callback with list as an argument)\n * @property {Boolean} config.autoScroll Engages autoscroll module for automatic vertical scrolling of the\n * whole page, by default true\n */\n var SortableList = function(root, config) {\n\n this.info = null;\n this.proxy = null;\n this.proxyDelta = null;\n this.dragCounter = 0;\n this.lastEvent = null;\n\n this.config = $.extend({}, defaultParameters, config || {});\n this.config.listSelector = root;\n if (!this.config.targetListSelector) {\n this.config.targetListSelector = root;\n }\n if (typeof this.config.listSelector === 'object') {\n // The root is an element on the page. Register a listener for this element.\n $(this.config.listSelector).on('mousedown touchstart.notPassive', $.proxy(this.dragStartHandler, this));\n } else {\n // The root is a CSS selector. Register a listener that picks up the element dynamically.\n $('body').on('mousedown touchstart.notPassive', this.config.listSelector, $.proxy(this.dragStartHandler, this));\n }\n if (this.config.moveHandlerSelector !== null) {\n $('body').on('click keypress', this.config.moveHandlerSelector, $.proxy(this.clickHandler, this));\n }\n\n };\n\n /**\n * Events fired by this entity\n *\n * @public\n * @type {Object}\n */\n SortableList.EVENTS = {\n DRAGSTART: 'sortablelist-dragstart',\n DRAG: 'sortablelist-drag',\n DROP: 'sortablelist-drop',\n DRAGEND: 'sortablelist-dragend'\n };\n\n /**\n * Resets the temporary classes assigned during dragging\n * @private\n */\n SortableList.prototype.resetDraggedClasses = function() {\n var classes = [\n CSS.isDraggedClass,\n CSS.currentPositionClass,\n CSS.overElementClass,\n CSS.targetListClass,\n ];\n for (var i in classes) {\n $('.' + classes[i]).removeClass(classes[i]);\n }\n if (this.proxy) {\n this.proxy.remove();\n this.proxy = $();\n }\n };\n\n /**\n * Calculates evt.pageX, evt.pageY, evt.clientX and evt.clientY\n *\n * For touch events pageX and pageY are taken from the first touch;\n * For the emulated mousemove event they are taken from the last real event.\n *\n * @private\n * @param {Event} evt\n */\n SortableList.prototype.calculatePositionOnPage = function(evt) {\n\n if (evt.originalEvent && evt.originalEvent.touches && evt.originalEvent.touches[0] !== undefined) {\n // This is a touchmove or touchstart event, get position from the first touch position.\n var touch = evt.originalEvent.touches[0];\n evt.pageX = touch.pageX;\n evt.pageY = touch.pageY;\n }\n\n if (evt.pageX === undefined) {\n // Information is not present in case of touchend or when event was emulated by autoScroll.\n // Take the absolute mouse position from the last event.\n evt.pageX = this.lastEvent.pageX;\n evt.pageY = this.lastEvent.pageY;\n } else {\n this.lastEvent = evt;\n }\n\n if (evt.clientX === undefined) {\n // If not provided in event calculate relative mouse position.\n evt.clientX = Math.round(evt.pageX - $(window).scrollLeft());\n evt.clientY = Math.round(evt.pageY - $(window).scrollTop());\n }\n };\n\n /**\n * Handler from dragstart event\n *\n * @private\n * @param {Event} evt\n */\n SortableList.prototype.dragStartHandler = function(evt) {\n if (this.info !== null) {\n if (this.info.type === 'click' || this.info.type === 'touchend') {\n // Ignore double click.\n return;\n }\n // Mouse down or touch while already dragging, cancel previous dragging.\n this.moveElement(this.info.sourceList, this.info.sourceNextElement);\n this.finishDragging();\n }\n\n if (evt.type === 'mousedown' && evt.which !== 1) {\n // We only need left mouse click. If this is a mousedown event with right/middle click ignore it.\n return;\n }\n\n this.calculatePositionOnPage(evt);\n var movedElement = $(evt.target).closest($(evt.currentTarget).children());\n if (!movedElement.length) {\n // Can't find the element user wants to drag. They clicked on the list but outside of any element of the list.\n return;\n }\n\n // Check that we grabbed the element by the handle.\n if (this.config.moveHandlerSelector !== null) {\n if (!$(evt.target).closest(this.config.moveHandlerSelector, movedElement).length) {\n return;\n }\n }\n\n evt.stopPropagation();\n evt.preventDefault();\n\n // Information about moved element with original location.\n // This object is passed to event observers.\n this.dragCounter++;\n this.info = {\n element: movedElement,\n sourceNextElement: movedElement.next(),\n sourceList: movedElement.parent(),\n targetNextElement: movedElement.next(),\n targetList: movedElement.parent(),\n type: evt.type,\n dropped: false,\n startX: evt.pageX,\n startY: evt.pageY,\n startTime: new Date().getTime()\n };\n\n $(this.config.targetListSelector).addClass(CSS.targetListClass);\n\n var offset = movedElement.offset();\n movedElement.addClass(CSS.currentPositionClass);\n this.proxyDelta = {x: offset.left - evt.pageX, y: offset.top - evt.pageY};\n this.proxy = $();\n var thisDragCounter = this.dragCounter;\n setTimeout($.proxy(function() {\n // This mousedown event may in fact be a beginning of a 'click' event. Use timeout before showing the\n // dragged object so we can catch click event. When timeout finishes make sure that click event\n // has not happened during this half a second.\n // Verify dragcounter to make sure the user did not manage to do two very fast drag actions one after another.\n if (this.info === null || this.info.type === 'click' || this.info.type === 'keypress'\n || this.dragCounter !== thisDragCounter) {\n return;\n }\n\n // Create a proxy - the copy of the dragged element that moves together with a mouse.\n this.createProxy();\n }, this), 500);\n\n // Start drag.\n $(window).on('mousemove touchmove.notPassive mouseup touchend.notPassive', $.proxy(this.dragHandler, this));\n $(window).on('keypress', $.proxy(this.dragcancelHandler, this));\n\n // Start autoscrolling. Every time the page is scrolled emulate the mousemove event.\n if (this.config.autoScroll) {\n autoScroll.start(function() {\n $(window).trigger('mousemove');\n });\n }\n\n this.executeCallback(SortableList.EVENTS.DRAGSTART);\n };\n\n /**\n * Creates a \"proxy\" object - a copy of the element that is being moved that always follows the mouse\n * @private\n */\n SortableList.prototype.createProxy = function() {\n this.proxy = this.info.element.clone();\n this.info.sourceList.append(this.proxy);\n this.proxy.removeAttr('id').removeClass(CSS.currentPositionClass)\n .addClass(CSS.isDraggedClass).css({position: 'fixed'});\n this.proxy.offset({top: this.proxyDelta.y + this.lastEvent.pageY, left: this.proxyDelta.x + this.lastEvent.pageX});\n };\n\n /**\n * Handler for click event - when user clicks on the drag handler or presses Enter on keyboard\n *\n * @private\n * @param {Event} evt\n */\n SortableList.prototype.clickHandler = function(evt) {\n if (evt.type === 'keypress' && evt.originalEvent.keyCode !== 13 && evt.originalEvent.keyCode !== 32) {\n return;\n }\n if (this.info !== null) {\n // Ignore double click.\n return;\n }\n\n // Find the element that this draghandle belongs to.\n var clickedElement = $(evt.target).closest(this.config.moveHandlerSelector),\n sourceList = clickedElement.closest(this.config.listSelector),\n movedElement = clickedElement.closest(sourceList.children());\n if (!movedElement.length) {\n return;\n }\n\n evt.preventDefault();\n evt.stopPropagation();\n\n // Store information about moved element with original location.\n this.dragCounter++;\n this.info = {\n element: movedElement,\n sourceNextElement: movedElement.next(),\n sourceList: sourceList,\n targetNextElement: movedElement.next(),\n targetList: sourceList,\n dropped: false,\n type: evt.type,\n startTime: new Date().getTime()\n };\n\n this.executeCallback(SortableList.EVENTS.DRAGSTART);\n this.displayMoveDialogue(clickedElement);\n };\n\n /**\n * Finds the position of the mouse inside the element - on the top, on the bottom, on the right or on the left\\\n *\n * Used to determine if the moved element should be moved after or before the current element\n *\n * @private\n * @param {Number} pageX\n * @param {Number} pageY\n * @param {jQuery} element\n * @returns {(Object|null)}\n */\n SortableList.prototype.getPositionInNode = function(pageX, pageY, element) {\n if (!element.length) {\n return null;\n }\n var node = element[0],\n offset = 0,\n rect = node.getBoundingClientRect(),\n y = pageY - (rect.top + window.scrollY),\n x = pageX - (rect.left + window.scrollX);\n if (x >= -offset && x <= rect.width + offset && y >= -offset && y <= rect.height + offset) {\n return {\n x: x,\n y: y,\n xRatio: rect.width ? (x / rect.width) : 0,\n yRatio: rect.height ? (y / rect.height) : 0\n };\n }\n return null;\n };\n\n /**\n * Check if list is horizontal\n *\n * @param {jQuery} element\n * @return {Boolean}\n */\n SortableList.prototype.isListHorizontal = function(element) {\n var isHorizontal = this.config.isHorizontal;\n if (isHorizontal === true || isHorizontal === false) {\n return isHorizontal;\n }\n return isHorizontal(element);\n };\n\n /**\n * Handler for events mousemove touchmove mouseup touchend\n *\n * @private\n * @param {Event} evt\n */\n SortableList.prototype.dragHandler = function(evt) {\n\n evt.preventDefault();\n evt.stopPropagation();\n\n this.calculatePositionOnPage(evt);\n\n // We can not use evt.target here because it will most likely be our proxy.\n // Move the proxy out of the way so we can find the element at the current mouse position.\n this.proxy.offset({top: -1000, left: -1000});\n // Find the element at the current mouse position.\n var element = $(document.elementFromPoint(evt.clientX, evt.clientY));\n\n // Find the list element and the list over the mouse position.\n var mainElement = this.info.element[0],\n isNotSelf = function() {\n return this !== mainElement;\n },\n current = element.closest('.' + CSS.targetListClass + ' > :not(.' + CSS.isDraggedClass + ')').filter(isNotSelf),\n currentList = element.closest('.' + CSS.targetListClass),\n proxy = this.proxy,\n isNotProxy = function() {\n return !proxy || !proxy.length || this !== proxy[0];\n };\n\n // Add the specified class to the list element we are hovering.\n $('.' + CSS.overElementClass).removeClass(CSS.overElementClass);\n current.addClass(CSS.overElementClass);\n\n // Move proxy to the current position.\n this.proxy.offset({top: this.proxyDelta.y + evt.pageY, left: this.proxyDelta.x + evt.pageX});\n\n if (currentList.length && !currentList.children().filter(isNotProxy).length) {\n // Mouse is over an empty list.\n this.moveElement(currentList, $());\n } else if (current.length === 1 && !this.info.element.find(current[0]).length) {\n // Mouse is over an element in a list - find whether we should move the current position\n // above or below this element.\n var coordinates = this.getPositionInNode(evt.pageX, evt.pageY, current);\n if (coordinates) {\n var parent = current.parent(),\n ratio = this.isListHorizontal(parent) ? coordinates.xRatio : coordinates.yRatio,\n subList = current.find('.' + CSS.targetListClass),\n subListEmpty = !subList.children().filter(isNotProxy).filter(isNotSelf).length;\n if (subList.length && subListEmpty && ratio > 0.2 && ratio < 0.8) {\n // This is an element that is a parent of an empty list and we are around the middle of this element.\n // Treat it as if we are over this empty list.\n this.moveElement(subList, $());\n } else if (ratio > 0.5) {\n // Insert after this element.\n this.moveElement(parent, current.next().filter(isNotProxy));\n } else {\n // Insert before this element.\n this.moveElement(parent, current);\n }\n }\n }\n\n if (evt.type === 'mouseup' || evt.type === 'touchend') {\n // Drop the moved element.\n this.info.endX = evt.pageX;\n this.info.endY = evt.pageY;\n this.info.endTime = new Date().getTime();\n this.info.dropped = true;\n this.info.positionChanged = this.hasPositionChanged(this.info);\n var oldinfo = this.info;\n this.executeCallback(SortableList.EVENTS.DROP);\n this.finishDragging();\n\n if (evt.type === 'touchend'\n && this.config.moveHandlerSelector !== null\n && (oldinfo.endTime - oldinfo.startTime < 500)\n && !oldinfo.positionChanged) {\n // The click event is not triggered on touch screens because we call preventDefault in touchstart handler.\n // If the touchend quickly followed touchstart without moving, consider it a \"click\".\n this.clickHandler(evt);\n }\n }\n };\n\n /**\n * Checks if the position of the dragged element in the list has changed\n *\n * @private\n * @param {Object} info\n * @return {Boolean}\n */\n SortableList.prototype.hasPositionChanged = function(info) {\n return info.sourceList[0] !== info.targetList[0] ||\n info.sourceNextElement.length !== info.targetNextElement.length ||\n (info.sourceNextElement.length && info.sourceNextElement[0] !== info.targetNextElement[0]);\n };\n\n /**\n * Moves the current position of the dragged element\n *\n * @private\n * @param {jQuery} parentElement\n * @param {jQuery} beforeElement\n */\n SortableList.prototype.moveElement = function(parentElement, beforeElement) {\n var dragEl = this.info.element;\n if (beforeElement.length && beforeElement[0] === dragEl[0]) {\n // Insert before the current position of the dragged element - nothing to do.\n return;\n }\n if (parentElement[0] === this.info.targetList[0] &&\n beforeElement.length === this.info.targetNextElement.length &&\n beforeElement[0] === this.info.targetNextElement[0]) {\n // Insert in the same location as the current position - nothing to do.\n return;\n }\n\n if (beforeElement.length) {\n // Move the dragged element before the specified element.\n parentElement[0].insertBefore(dragEl[0], beforeElement[0]);\n } else if (this.proxy && this.proxy.parent().length && this.proxy.parent()[0] === parentElement[0]) {\n // We need to move to the end of the list but the last element in this list is a proxy.\n // Always leave the proxy in the end of the list.\n parentElement[0].insertBefore(dragEl[0], this.proxy[0]);\n } else {\n // Insert in the end of a list (when proxy is in another list).\n parentElement[0].appendChild(dragEl[0]);\n }\n\n // Save the current position of the dragged element in the list.\n this.info.targetList = parentElement;\n this.info.targetNextElement = beforeElement;\n this.executeCallback(SortableList.EVENTS.DRAG);\n };\n\n /**\n * Finish dragging (when dropped or cancelled).\n * @private\n */\n SortableList.prototype.finishDragging = function() {\n this.resetDraggedClasses();\n if (this.config.autoScroll) {\n autoScroll.stop();\n }\n $(window).off('mousemove touchmove.notPassive mouseup touchend.notPassive', $.proxy(this.dragHandler, this));\n $(window).off('keypress', $.proxy(this.dragcancelHandler, this));\n this.executeCallback(SortableList.EVENTS.DRAGEND);\n this.info = null;\n };\n\n /**\n * Executes callback specified in sortable list parameters\n *\n * @private\n * @param {String} eventName\n */\n SortableList.prototype.executeCallback = function(eventName) {\n this.info.element.trigger(eventName, this.info);\n };\n\n /**\n * Handler from keypress event (cancel dragging when Esc is pressed)\n *\n * @private\n * @param {Event} evt\n */\n SortableList.prototype.dragcancelHandler = function(evt) {\n if (evt.type !== 'keypress' || evt.originalEvent.keyCode !== 27) {\n // Only cancel dragging when Esc was pressed.\n return;\n }\n // Dragging was cancelled. Return item to the original position.\n this.moveElement(this.info.sourceList, this.info.sourceNextElement);\n this.finishDragging();\n };\n\n /**\n * Returns the name of the current element to be used in the move dialogue\n *\n * @public\n * @param {jQuery} element\n * @return {Promise}\n */\n SortableList.prototype.getElementName = function(element) {\n return $.Deferred().resolve(element.text());\n };\n\n /**\n * Returns the label for the potential move destination, i.e. \"After ElementX\" or \"To the top of the list\"\n *\n * Note that we use \"after\" in the label for better UX\n *\n * @public\n * @param {jQuery} parentElement\n * @param {jQuery} afterElement\n * @return {Promise}\n */\n SortableList.prototype.getDestinationName = function(parentElement, afterElement) {\n if (!afterElement.length) {\n return str.get_string('movecontenttothetop', 'moodle');\n } else {\n return this.getElementName(afterElement)\n .then(function(name) {\n return str.get_string('movecontentafter', 'moodle', name);\n });\n }\n };\n\n /**\n * Returns the title for the move dialogue (\"Move elementY\")\n *\n * @public\n * @param {jQuery} element\n * @param {jQuery} handler\n * @return {Promise}\n */\n SortableList.prototype.getMoveDialogueTitle = function(element, handler) {\n if (handler.attr('title')) {\n return $.Deferred().resolve(handler.attr('title'));\n }\n return this.getElementName(element).then(function(name) {\n return str.get_string('movecontent', 'moodle', name);\n });\n };\n\n /**\n * Returns the list of possible move destinations\n *\n * @private\n * @return {Promise}\n */\n SortableList.prototype.getDestinationsList = function() {\n var addedLists = [],\n targets = $(this.config.targetListSelector),\n destinations = $('
                  ').addClass(CSS.keyboardDragClass),\n result = $.when().then(function() {\n return destinations;\n }),\n createLink = $.proxy(function(parentElement, beforeElement, afterElement) {\n if (beforeElement.is(this.info.element) || afterElement.is(this.info.element)) {\n // Can not move before or after itself.\n return;\n }\n if ($.contains(this.info.element[0], parentElement[0])) {\n // Can not move to its own child.\n return;\n }\n result = result\n .then($.proxy(function() {\n return this.getDestinationName(parentElement, afterElement);\n }, this))\n .then(function(txt) {\n var li = $('
                • ').appendTo(destinations);\n var a = $('').attr('data-core_sortable_list-quickmove', 1).appendTo(li);\n a.data('parent-element', parentElement).data('before-element', beforeElement).text(txt);\n return destinations;\n });\n }, this),\n addList = function() {\n // Destination lists may be nested. We want to add all move destinations in the same\n // order they appear on the screen for the user.\n if ($.inArray(this, addedLists) !== -1) {\n return;\n }\n addedLists.push(this);\n var list = $(this),\n children = list.children();\n children.each(function() {\n var element = $(this);\n createLink(list, element, element.prev());\n // Add all nested lists.\n element.find(targets).each(addList);\n });\n createLink(list, $(), children.last());\n };\n targets.each(addList);\n return result;\n };\n\n /**\n * Displays the dialogue to move element.\n * @param {jQuery} clickedElement element to return focus to after the modal is closed\n * @private\n */\n SortableList.prototype.displayMoveDialogue = function(clickedElement) {\n ModalFactory.create({\n type: ModalFactory.types.CANCEL,\n title: this.getMoveDialogueTitle(this.info.element, clickedElement),\n body: this.getDestinationsList()\n }).then($.proxy(function(modal) {\n var quickMoveHandler = $.proxy(function(e) {\n e.preventDefault();\n e.stopPropagation();\n this.moveElement($(e.currentTarget).data('parent-element'), $(e.currentTarget).data('before-element'));\n this.info.endTime = new Date().getTime();\n this.info.positionChanged = this.hasPositionChanged(this.info);\n this.info.dropped = true;\n clickedElement.focus();\n this.executeCallback(SortableList.EVENTS.DROP);\n modal.hide();\n }, this);\n modal.getRoot().on('click', '[data-core_sortable_list-quickmove]', quickMoveHandler);\n modal.getRoot().on(ModalEvents.hidden, $.proxy(function() {\n // Always destroy when hidden, it is generated dynamically each time.\n modal.getRoot().off('click', '[data-core_sortable_list-quickmove]', quickMoveHandler);\n modal.destroy();\n this.finishDragging();\n }, this));\n modal.setLarge();\n modal.show();\n return modal;\n }, this)).catch(Notification.exception);\n };\n\n return SortableList;\n\n});\n"],"file":"sortable_list.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/sortable_list.js"],"names":["define","$","log","autoScroll","str","ModalFactory","ModalEvents","Notification","defaultParameters","targetListSelector","moveHandlerSelector","isHorizontal","CSS","keyboardDragClass","isDraggedClass","currentPositionClass","sourceListClass","targetListClass","overElementClass","registerNotPassiveListeners","eventname","setup","x","ns","handle","includes","addEventListener","passive","eventListenerOptionsSupported","passivesupported","options","Object","defineProperty","get","document","removeEventListener","err","event","special","touchstart","touchmove","touchend","SortableList","root","config","info","proxy","proxyDelta","dragCounter","lastEvent","extend","listSelector","on","dragStartHandler","clickHandler","EVENTS","DRAGSTART","DRAG","DROP","DRAGEND","prototype","resetDraggedClasses","classes","i","removeClass","remove","calculatePositionOnPage","evt","originalEvent","touches","touch","pageX","pageY","clientX","Math","round","window","scrollLeft","clientY","scrollTop","type","moveElement","sourceList","sourceNextElement","finishDragging","which","movedElement","target","closest","currentTarget","children","length","stopPropagation","preventDefault","element","next","parent","targetNextElement","targetList","dropped","startX","startY","startTime","Date","getTime","addClass","offset","left","y","top","thisDragCounter","setTimeout","createProxy","dragHandler","dragcancelHandler","start","trigger","executeCallback","clone","append","removeAttr","css","position","keyCode","clickedElement","displayMoveDialogue","getPositionInNode","node","rect","getBoundingClientRect","scrollY","scrollX","width","height","xRatio","yRatio","isListHorizontal","elementFromPoint","mainElement","isNotSelf","current","filter","currentList","isNotProxy","find","coordinates","ratio","subList","subListEmpty","endX","endY","endTime","positionChanged","hasPositionChanged","oldinfo","parentElement","beforeElement","dragEl","insertBefore","appendChild","stop","off","eventName","getElementName","Deferred","resolve","text","getDestinationName","afterElement","get_string","then","name","getMoveDialogueTitle","handler","attr","getDestinationsList","addedLists","targets","destinations","result","when","createLink","is","contains","txt","li","appendTo","a","data","addList","inArray","push","list","each","prev","last","create","types","CANCEL","title","body","modal","quickMoveHandler","e","focus","hide","getRoot","hidden","destroy","setLarge","show","catch","exception"],"mappings":"kRA4DAA,OAAM,sBAAC,CAAC,QAAD,CAAW,UAAX,CAAuB,iBAAvB,CAA0C,UAA1C,CAAsD,oBAAtD,CAA4E,mBAA5E,CAAiG,mBAAjG,CAAD,CACN,SAASC,CAAT,CAAYC,CAAZ,CAAiBC,CAAjB,CAA6BC,CAA7B,CAAkCC,CAAlC,CAAgDC,CAAhD,CAA6DC,CAA7D,CAA2E,IAQnEC,CA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ClH,aAAH,CAAD,CAAmBmG,IAAnB,CAAwB,gBAAxB,CAAjB,CAA4D3L,CAAC,CAAC0M,CAAC,CAAClH,aAAH,CAAD,CAAmBmG,IAAnB,CAAwB,gBAAxB,CAA5D,EACA,KAAK/I,IAAL,CAAU0G,OAAV,CAAoB,GAAIhD,CAAAA,IAAJ,GAAWC,OAAX,EAApB,CACA,KAAK3D,IAAL,CAAU2G,eAAV,CAA4B,KAAKC,kBAAL,CAAwB,KAAK5G,IAA7B,CAA5B,CACA,KAAKA,IAAL,CAAUsD,OAAV,IACAyB,CAAc,CAACgF,KAAf,GACA,KAAKvF,eAAL,CAAqB3E,CAAY,CAACa,MAAb,CAAoBG,IAAzC,EACA+I,CAAK,CAACI,IAAN,EACH,CAVsB,CAUpB,IAVoB,CAAvB,CAWAJ,CAAK,CAACK,OAAN,GAAgB1J,EAAhB,CAAmB,OAAnB,CAA4B,qCAA5B,CAAmEsJ,CAAnE,EACAD,CAAK,CAACK,OAAN,GAAgB1J,EAAhB,CAAmB9C,CAAW,CAACyM,MAA/B,CAAuC9M,CAAC,CAAC6C,KAAF,CAAQ,UAAW,CAEtD2J,CAAK,CAACK,OAAN,GAAgB7C,GAAhB,CAAoB,OAApB,CAA6B,qCAA7B,CAAoEyC,CAApE,EACAD,CAAK,CAACO,OAAN,GACA,KAAK5H,cAAL,EACH,CALsC,CAKpC,IALoC,CAAvC,EAMAqH,CAAK,CAACQ,QAAN,GACAR,CAAK,CAACS,IAAN,GACA,MAAOT,CAAAA,CACV,CAtBO,CAsBL,IAtBK,CAJR,EA0BUU,KA1BV,CA0BgB5M,CAAY,CAAC6M,SA1B7B,CA2BH,CA5BD,CA8BA,MAAO1K,CAAAA,CAEV,CA5rBK,CAAN","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * A javascript module to handle list items drag and drop\n *\n * Example of usage:\n *\n * Create a list (for example
                    or ) where each draggable element has a drag handle.\n * The best practice is to use the template core/drag_handle:\n * $OUTPUT->render_from_template('core/drag_handle', ['movetitle' => get_string('movecontent', 'moodle', ELEMENTNAME)]);\n *\n * Attach this JS module to this list:\n *\n * Space between define and ( critical in comment but not allowed in code in order to function\n * correctly with Moodle's requirejs.php\n *\n * define (['jquery', 'core/sortable_list'], function($, SortableList) {\n * var list = new SortableList('ul.my-awesome-list'); // source list (usually
                      or ) - selector or element\n *\n * // Listen to the events when element is dragged.\n * $('ul.my-awesome-list > *').on(SortableList.EVENTS.DROP, function(evt, info) {\n * console.log(info);\n * });\n *\n * // Advanced usage. Overwrite methods getElementName, getDestinationName, moveDialogueTitle, for example:\n * list.getElementName = function(element) {\n * return $.Deferred().resolve(element.attr('data-name'));\n * }\n * }\n *\n * More details: https://docs.moodle.org/dev/Sortable_list\n *\n * For the full list of possible parameters see var defaultParameters below.\n *\n * The following jQuery events are fired:\n * - SortableList.EVENTS.DRAGSTART : when user started dragging a list element\n * - SortableList.EVENTS.DRAG : when user dragged a list element to a new position\n * - SortableList.EVENTS.DROP : when user dropped a list element\n * - SortableList.EVENTS.DROPEND : when user finished dragging - either fired right after dropping or\n * if \"Esc\" was pressed during dragging\n *\n * @module core/sortable_list\n * @class sortable_list\n * @package core\n * @copyright 2018 Marina Glancy\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery', 'core/log', 'core/autoscroll', 'core/str', 'core/modal_factory', 'core/modal_events', 'core/notification'],\nfunction($, log, autoScroll, str, ModalFactory, ModalEvents, Notification) {\n\n /**\n * Default parameters\n *\n * @private\n * @type {Object}\n */\n var defaultParameters = {\n targetListSelector: null,\n moveHandlerSelector: '[data-drag-type=move]',\n isHorizontal: false,\n autoScroll: true\n };\n\n /**\n * Class names for different elements that may be changed during sorting\n *\n * @private\n * @type {Object}\n */\n var CSS = {\n keyboardDragClass: 'dragdrop-keyboard-drag',\n isDraggedClass: 'sortable-list-is-dragged',\n currentPositionClass: 'sortable-list-current-position',\n sourceListClass: 'sortable-list-source',\n targetListClass: 'sortable-list-target',\n overElementClass: 'sortable-list-over-element'\n };\n\n /**\n * Test the browser support for options objects on event listeners.\n * @return {Boolean}\n */\n var eventListenerOptionsSupported = function() {\n var passivesupported = false,\n options,\n testeventname = \"testpassiveeventoptions\";\n\n // Options support testing example from:\n // https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener\n\n try {\n options = Object.defineProperty({}, \"passive\", {\n get: function() {\n passivesupported = true;\n }\n });\n\n // We use an event name that is not likely to conflict with any real event.\n document.addEventListener(testeventname, options, options);\n // We remove the event listener as we have tested the options already.\n document.removeEventListener(testeventname, options, options);\n } catch (err) {\n // It's already false.\n passivesupported = false;\n }\n return passivesupported;\n };\n\n /**\n * Allow to create non-passive touchstart listeners and prevent page scrolling when dragging\n * From: https://stackoverflow.com/a/48098097\n *\n * @type {Object}\n */\n var registerNotPassiveListeners = function(eventname) {\n return {\n setup: function(x, ns, handle) {\n if (ns.includes('notPassive')) {\n this.addEventListener(eventname, handle, {passive: false});\n return true;\n } else {\n return false;\n }\n }\n };\n };\n\n if (eventListenerOptionsSupported) {\n $.event.special.touchstart = registerNotPassiveListeners('touchstart');\n $.event.special.touchmove = registerNotPassiveListeners('touchmove');\n $.event.special.touchend = registerNotPassiveListeners('touchend');\n }\n\n /**\n * Initialise sortable list.\n *\n * @param {(String|jQuery|Element)} root JQuery/DOM element representing sortable list (i.e.
                        , ) or CSS selector\n * @param {Object} config Parameters for the list. See defaultParameters above for examples.\n * @property {(String|jQuery|Element)} config.targetListSelector target lists, by default same as root\n * @property {String} config.moveHandlerSelector CSS selector for a drag handle. By default '[data-drag-type=move]'\n * @property {String} config.targetListSelector CSS selector for target lists. By default the same as root\n * @property {(Boolean|Function)} config.isHorizontal Set to true if the list is horizontal\n * (can also be a callback with list as an argument)\n * @property {Boolean} config.autoScroll Engages autoscroll module for automatic vertical scrolling of the\n * whole page, by default true\n */\n var SortableList = function(root, config) {\n\n this.info = null;\n this.proxy = null;\n this.proxyDelta = null;\n this.dragCounter = 0;\n this.lastEvent = null;\n\n this.config = $.extend({}, defaultParameters, config || {});\n this.config.listSelector = root;\n if (!this.config.targetListSelector) {\n this.config.targetListSelector = root;\n }\n if (typeof this.config.listSelector === 'object') {\n // The root is an element on the page. Register a listener for this element.\n $(this.config.listSelector).on('mousedown touchstart.notPassive', $.proxy(this.dragStartHandler, this));\n } else {\n // The root is a CSS selector. Register a listener that picks up the element dynamically.\n $('body').on('mousedown touchstart.notPassive', this.config.listSelector, $.proxy(this.dragStartHandler, this));\n }\n if (this.config.moveHandlerSelector !== null) {\n $('body').on('click keypress', this.config.moveHandlerSelector, $.proxy(this.clickHandler, this));\n }\n\n };\n\n /**\n * Events fired by this entity\n *\n * @public\n * @type {Object}\n */\n SortableList.EVENTS = {\n DRAGSTART: 'sortablelist-dragstart',\n DRAG: 'sortablelist-drag',\n DROP: 'sortablelist-drop',\n DRAGEND: 'sortablelist-dragend'\n };\n\n /**\n * Resets the temporary classes assigned during dragging\n * @private\n */\n SortableList.prototype.resetDraggedClasses = function() {\n var classes = [\n CSS.isDraggedClass,\n CSS.currentPositionClass,\n CSS.overElementClass,\n CSS.targetListClass,\n ];\n for (var i in classes) {\n $('.' + classes[i]).removeClass(classes[i]);\n }\n if (this.proxy) {\n this.proxy.remove();\n this.proxy = $();\n }\n };\n\n /**\n * Calculates evt.pageX, evt.pageY, evt.clientX and evt.clientY\n *\n * For touch events pageX and pageY are taken from the first touch;\n * For the emulated mousemove event they are taken from the last real event.\n *\n * @private\n * @param {Event} evt\n */\n SortableList.prototype.calculatePositionOnPage = function(evt) {\n\n if (evt.originalEvent && evt.originalEvent.touches && evt.originalEvent.touches[0] !== undefined) {\n // This is a touchmove or touchstart event, get position from the first touch position.\n var touch = evt.originalEvent.touches[0];\n evt.pageX = touch.pageX;\n evt.pageY = touch.pageY;\n }\n\n if (evt.pageX === undefined) {\n // Information is not present in case of touchend or when event was emulated by autoScroll.\n // Take the absolute mouse position from the last event.\n evt.pageX = this.lastEvent.pageX;\n evt.pageY = this.lastEvent.pageY;\n } else {\n this.lastEvent = evt;\n }\n\n if (evt.clientX === undefined) {\n // If not provided in event calculate relative mouse position.\n evt.clientX = Math.round(evt.pageX - $(window).scrollLeft());\n evt.clientY = Math.round(evt.pageY - $(window).scrollTop());\n }\n };\n\n /**\n * Handler from dragstart event\n *\n * @private\n * @param {Event} evt\n */\n SortableList.prototype.dragStartHandler = function(evt) {\n if (this.info !== null) {\n if (this.info.type === 'click' || this.info.type === 'touchend') {\n // Ignore double click.\n return;\n }\n // Mouse down or touch while already dragging, cancel previous dragging.\n this.moveElement(this.info.sourceList, this.info.sourceNextElement);\n this.finishDragging();\n }\n\n if (evt.type === 'mousedown' && evt.which !== 1) {\n // We only need left mouse click. If this is a mousedown event with right/middle click ignore it.\n return;\n }\n\n this.calculatePositionOnPage(evt);\n var movedElement = $(evt.target).closest($(evt.currentTarget).children());\n if (!movedElement.length) {\n // Can't find the element user wants to drag. They clicked on the list but outside of any element of the list.\n return;\n }\n\n // Check that we grabbed the element by the handle.\n if (this.config.moveHandlerSelector !== null) {\n if (!$(evt.target).closest(this.config.moveHandlerSelector, movedElement).length) {\n return;\n }\n }\n\n evt.stopPropagation();\n evt.preventDefault();\n\n // Information about moved element with original location.\n // This object is passed to event observers.\n this.dragCounter++;\n this.info = {\n element: movedElement,\n sourceNextElement: movedElement.next(),\n sourceList: movedElement.parent(),\n targetNextElement: movedElement.next(),\n targetList: movedElement.parent(),\n type: evt.type,\n dropped: false,\n startX: evt.pageX,\n startY: evt.pageY,\n startTime: new Date().getTime()\n };\n\n $(this.config.targetListSelector).addClass(CSS.targetListClass);\n\n var offset = movedElement.offset();\n movedElement.addClass(CSS.currentPositionClass);\n this.proxyDelta = {x: offset.left - evt.pageX, y: offset.top - evt.pageY};\n this.proxy = $();\n var thisDragCounter = this.dragCounter;\n setTimeout($.proxy(function() {\n // This mousedown event may in fact be a beginning of a 'click' event. Use timeout before showing the\n // dragged object so we can catch click event. When timeout finishes make sure that click event\n // has not happened during this half a second.\n // Verify dragcounter to make sure the user did not manage to do two very fast drag actions one after another.\n if (this.info === null || this.info.type === 'click' || this.info.type === 'keypress'\n || this.dragCounter !== thisDragCounter) {\n return;\n }\n\n // Create a proxy - the copy of the dragged element that moves together with a mouse.\n this.createProxy();\n }, this), 500);\n\n // Start drag.\n $(window).on('mousemove touchmove.notPassive mouseup touchend.notPassive', $.proxy(this.dragHandler, this));\n $(window).on('keypress', $.proxy(this.dragcancelHandler, this));\n\n // Start autoscrolling. Every time the page is scrolled emulate the mousemove event.\n if (this.config.autoScroll) {\n autoScroll.start(function() {\n $(window).trigger('mousemove');\n });\n }\n\n this.executeCallback(SortableList.EVENTS.DRAGSTART);\n };\n\n /**\n * Creates a \"proxy\" object - a copy of the element that is being moved that always follows the mouse\n * @private\n */\n SortableList.prototype.createProxy = function() {\n this.proxy = this.info.element.clone();\n this.info.sourceList.append(this.proxy);\n this.proxy.removeAttr('id').removeClass(CSS.currentPositionClass)\n .addClass(CSS.isDraggedClass).css({position: 'fixed'});\n this.proxy.offset({top: this.proxyDelta.y + this.lastEvent.pageY, left: this.proxyDelta.x + this.lastEvent.pageX});\n };\n\n /**\n * Handler for click event - when user clicks on the drag handler or presses Enter on keyboard\n *\n * @private\n * @param {Event} evt\n */\n SortableList.prototype.clickHandler = function(evt) {\n if (evt.type === 'keypress' && evt.originalEvent.keyCode !== 13 && evt.originalEvent.keyCode !== 32) {\n return;\n }\n if (this.info !== null) {\n // Ignore double click.\n return;\n }\n\n // Find the element that this draghandle belongs to.\n var clickedElement = $(evt.target).closest(this.config.moveHandlerSelector),\n sourceList = clickedElement.closest(this.config.listSelector),\n movedElement = clickedElement.closest(sourceList.children());\n if (!movedElement.length) {\n return;\n }\n\n evt.preventDefault();\n evt.stopPropagation();\n\n // Store information about moved element with original location.\n this.dragCounter++;\n this.info = {\n element: movedElement,\n sourceNextElement: movedElement.next(),\n sourceList: sourceList,\n targetNextElement: movedElement.next(),\n targetList: sourceList,\n dropped: false,\n type: evt.type,\n startTime: new Date().getTime()\n };\n\n this.executeCallback(SortableList.EVENTS.DRAGSTART);\n this.displayMoveDialogue(clickedElement);\n };\n\n /**\n * Finds the position of the mouse inside the element - on the top, on the bottom, on the right or on the left\\\n *\n * Used to determine if the moved element should be moved after or before the current element\n *\n * @private\n * @param {Number} pageX\n * @param {Number} pageY\n * @param {jQuery} element\n * @returns {(Object|null)}\n */\n SortableList.prototype.getPositionInNode = function(pageX, pageY, element) {\n if (!element.length) {\n return null;\n }\n var node = element[0],\n offset = 0,\n rect = node.getBoundingClientRect(),\n y = pageY - (rect.top + window.scrollY),\n x = pageX - (rect.left + window.scrollX);\n if (x >= -offset && x <= rect.width + offset && y >= -offset && y <= rect.height + offset) {\n return {\n x: x,\n y: y,\n xRatio: rect.width ? (x / rect.width) : 0,\n yRatio: rect.height ? (y / rect.height) : 0\n };\n }\n return null;\n };\n\n /**\n * Check if list is horizontal\n *\n * @param {jQuery} element\n * @return {Boolean}\n */\n SortableList.prototype.isListHorizontal = function(element) {\n var isHorizontal = this.config.isHorizontal;\n if (isHorizontal === true || isHorizontal === false) {\n return isHorizontal;\n }\n return isHorizontal(element);\n };\n\n /**\n * Handler for events mousemove touchmove mouseup touchend\n *\n * @private\n * @param {Event} evt\n */\n SortableList.prototype.dragHandler = function(evt) {\n\n evt.preventDefault();\n evt.stopPropagation();\n\n this.calculatePositionOnPage(evt);\n\n // We can not use evt.target here because it will most likely be our proxy.\n // Move the proxy out of the way so we can find the element at the current mouse position.\n this.proxy.offset({top: -1000, left: -1000});\n // Find the element at the current mouse position.\n var element = $(document.elementFromPoint(evt.clientX, evt.clientY));\n\n // Find the list element and the list over the mouse position.\n var mainElement = this.info.element[0],\n isNotSelf = function() {\n return this !== mainElement;\n },\n current = element.closest('.' + CSS.targetListClass + ' > :not(.' + CSS.isDraggedClass + ')').filter(isNotSelf),\n currentList = element.closest('.' + CSS.targetListClass),\n proxy = this.proxy,\n isNotProxy = function() {\n return !proxy || !proxy.length || this !== proxy[0];\n };\n\n // Add the specified class to the list element we are hovering.\n $('.' + CSS.overElementClass).removeClass(CSS.overElementClass);\n current.addClass(CSS.overElementClass);\n\n // Move proxy to the current position.\n this.proxy.offset({top: this.proxyDelta.y + evt.pageY, left: this.proxyDelta.x + evt.pageX});\n\n if (currentList.length && !currentList.children().filter(isNotProxy).length) {\n // Mouse is over an empty list.\n this.moveElement(currentList, $());\n } else if (current.length === 1 && !this.info.element.find(current[0]).length) {\n // Mouse is over an element in a list - find whether we should move the current position\n // above or below this element.\n var coordinates = this.getPositionInNode(evt.pageX, evt.pageY, current);\n if (coordinates) {\n var parent = current.parent(),\n ratio = this.isListHorizontal(parent) ? coordinates.xRatio : coordinates.yRatio,\n subList = current.find('.' + CSS.targetListClass),\n subListEmpty = !subList.children().filter(isNotProxy).filter(isNotSelf).length;\n if (subList.length && subListEmpty && ratio > 0.2 && ratio < 0.8) {\n // This is an element that is a parent of an empty list and we are around the middle of this element.\n // Treat it as if we are over this empty list.\n this.moveElement(subList, $());\n } else if (ratio > 0.5) {\n // Insert after this element.\n this.moveElement(parent, current.next().filter(isNotProxy));\n } else {\n // Insert before this element.\n this.moveElement(parent, current);\n }\n }\n }\n\n if (evt.type === 'mouseup' || evt.type === 'touchend') {\n // Drop the moved element.\n this.info.endX = evt.pageX;\n this.info.endY = evt.pageY;\n this.info.endTime = new Date().getTime();\n this.info.dropped = true;\n this.info.positionChanged = this.hasPositionChanged(this.info);\n var oldinfo = this.info;\n this.executeCallback(SortableList.EVENTS.DROP);\n this.finishDragging();\n\n if (evt.type === 'touchend'\n && this.config.moveHandlerSelector !== null\n && (oldinfo.endTime - oldinfo.startTime < 500)\n && !oldinfo.positionChanged) {\n // The click event is not triggered on touch screens because we call preventDefault in touchstart handler.\n // If the touchend quickly followed touchstart without moving, consider it a \"click\".\n this.clickHandler(evt);\n }\n }\n };\n\n /**\n * Checks if the position of the dragged element in the list has changed\n *\n * @private\n * @param {Object} info\n * @return {Boolean}\n */\n SortableList.prototype.hasPositionChanged = function(info) {\n return info.sourceList[0] !== info.targetList[0] ||\n info.sourceNextElement.length !== info.targetNextElement.length ||\n (info.sourceNextElement.length && info.sourceNextElement[0] !== info.targetNextElement[0]);\n };\n\n /**\n * Moves the current position of the dragged element\n *\n * @private\n * @param {jQuery} parentElement\n * @param {jQuery} beforeElement\n */\n SortableList.prototype.moveElement = function(parentElement, beforeElement) {\n var dragEl = this.info.element;\n if (beforeElement.length && beforeElement[0] === dragEl[0]) {\n // Insert before the current position of the dragged element - nothing to do.\n return;\n }\n if (parentElement[0] === this.info.targetList[0] &&\n beforeElement.length === this.info.targetNextElement.length &&\n beforeElement[0] === this.info.targetNextElement[0]) {\n // Insert in the same location as the current position - nothing to do.\n return;\n }\n\n if (beforeElement.length) {\n // Move the dragged element before the specified element.\n parentElement[0].insertBefore(dragEl[0], beforeElement[0]);\n } else if (this.proxy && this.proxy.parent().length && this.proxy.parent()[0] === parentElement[0]) {\n // We need to move to the end of the list but the last element in this list is a proxy.\n // Always leave the proxy in the end of the list.\n parentElement[0].insertBefore(dragEl[0], this.proxy[0]);\n } else {\n // Insert in the end of a list (when proxy is in another list).\n parentElement[0].appendChild(dragEl[0]);\n }\n\n // Save the current position of the dragged element in the list.\n this.info.targetList = parentElement;\n this.info.targetNextElement = beforeElement;\n this.executeCallback(SortableList.EVENTS.DRAG);\n };\n\n /**\n * Finish dragging (when dropped or cancelled).\n * @private\n */\n SortableList.prototype.finishDragging = function() {\n this.resetDraggedClasses();\n if (this.config.autoScroll) {\n autoScroll.stop();\n }\n $(window).off('mousemove touchmove.notPassive mouseup touchend.notPassive', $.proxy(this.dragHandler, this));\n $(window).off('keypress', $.proxy(this.dragcancelHandler, this));\n this.executeCallback(SortableList.EVENTS.DRAGEND);\n this.info = null;\n };\n\n /**\n * Executes callback specified in sortable list parameters\n *\n * @private\n * @param {String} eventName\n */\n SortableList.prototype.executeCallback = function(eventName) {\n this.info.element.trigger(eventName, this.info);\n };\n\n /**\n * Handler from keypress event (cancel dragging when Esc is pressed)\n *\n * @private\n * @param {Event} evt\n */\n SortableList.prototype.dragcancelHandler = function(evt) {\n if (evt.type !== 'keypress' || evt.originalEvent.keyCode !== 27) {\n // Only cancel dragging when Esc was pressed.\n return;\n }\n // Dragging was cancelled. Return item to the original position.\n this.moveElement(this.info.sourceList, this.info.sourceNextElement);\n this.finishDragging();\n };\n\n /**\n * Returns the name of the current element to be used in the move dialogue\n *\n * @public\n * @param {jQuery} element\n * @return {Promise}\n */\n SortableList.prototype.getElementName = function(element) {\n return $.Deferred().resolve(element.text());\n };\n\n /**\n * Returns the label for the potential move destination, i.e. \"After ElementX\" or \"To the top of the list\"\n *\n * Note that we use \"after\" in the label for better UX\n *\n * @public\n * @param {jQuery} parentElement\n * @param {jQuery} afterElement\n * @return {Promise}\n */\n SortableList.prototype.getDestinationName = function(parentElement, afterElement) {\n if (!afterElement.length) {\n return str.get_string('movecontenttothetop', 'moodle');\n } else {\n return this.getElementName(afterElement)\n .then(function(name) {\n return str.get_string('movecontentafter', 'moodle', name);\n });\n }\n };\n\n /**\n * Returns the title for the move dialogue (\"Move elementY\")\n *\n * @public\n * @param {jQuery} element\n * @param {jQuery} handler\n * @return {Promise}\n */\n SortableList.prototype.getMoveDialogueTitle = function(element, handler) {\n if (handler.attr('title')) {\n return $.Deferred().resolve(handler.attr('title'));\n }\n return this.getElementName(element).then(function(name) {\n return str.get_string('movecontent', 'moodle', name);\n });\n };\n\n /**\n * Returns the list of possible move destinations\n *\n * @private\n * @return {Promise}\n */\n SortableList.prototype.getDestinationsList = function() {\n var addedLists = [],\n targets = $(this.config.targetListSelector),\n destinations = $('
                          ').addClass(CSS.keyboardDragClass),\n result = $.when().then(function() {\n return destinations;\n }),\n createLink = $.proxy(function(parentElement, beforeElement, afterElement) {\n if (beforeElement.is(this.info.element) || afterElement.is(this.info.element)) {\n // Can not move before or after itself.\n return;\n }\n if ($.contains(this.info.element[0], parentElement[0])) {\n // Can not move to its own child.\n return;\n }\n result = result\n .then($.proxy(function() {\n return this.getDestinationName(parentElement, afterElement);\n }, this))\n .then(function(txt) {\n var li = $('
                        • ').appendTo(destinations);\n var a = $('').attr('data-core_sortable_list-quickmove', 1).appendTo(li);\n a.data('parent-element', parentElement).data('before-element', beforeElement).text(txt);\n return destinations;\n });\n }, this),\n addList = function() {\n // Destination lists may be nested. We want to add all move destinations in the same\n // order they appear on the screen for the user.\n if ($.inArray(this, addedLists) !== -1) {\n return;\n }\n addedLists.push(this);\n var list = $(this),\n children = list.children();\n children.each(function() {\n var element = $(this);\n createLink(list, element, element.prev());\n // Add all nested lists.\n element.find(targets).each(addList);\n });\n createLink(list, $(), children.last());\n };\n targets.each(addList);\n return result;\n };\n\n /**\n * Displays the dialogue to move element.\n * @param {jQuery} clickedElement element to return focus to after the modal is closed\n * @private\n */\n SortableList.prototype.displayMoveDialogue = function(clickedElement) {\n ModalFactory.create({\n type: ModalFactory.types.CANCEL,\n title: this.getMoveDialogueTitle(this.info.element, clickedElement),\n body: this.getDestinationsList()\n }).then($.proxy(function(modal) {\n var quickMoveHandler = $.proxy(function(e) {\n e.preventDefault();\n e.stopPropagation();\n this.moveElement($(e.currentTarget).data('parent-element'), $(e.currentTarget).data('before-element'));\n this.info.endTime = new Date().getTime();\n this.info.positionChanged = this.hasPositionChanged(this.info);\n this.info.dropped = true;\n clickedElement.focus();\n this.executeCallback(SortableList.EVENTS.DROP);\n modal.hide();\n }, this);\n modal.getRoot().on('click', '[data-core_sortable_list-quickmove]', quickMoveHandler);\n modal.getRoot().on(ModalEvents.hidden, $.proxy(function() {\n // Always destroy when hidden, it is generated dynamically each time.\n modal.getRoot().off('click', '[data-core_sortable_list-quickmove]', quickMoveHandler);\n modal.destroy();\n this.finishDragging();\n }, this));\n modal.setLarge();\n modal.show();\n return modal;\n }, this)).catch(Notification.exception);\n };\n\n return SortableList;\n\n});\n"],"file":"sortable_list.min.js"} \ No newline at end of file diff --git a/lib/amd/build/str.min.js b/lib/amd/build/str.min.js index 3f33a1bc8c0..117335df8b3 100644 --- a/lib/amd/build/str.min.js +++ b/lib/amd/build/str.min.js @@ -1,2 +1,2 @@ -define ("core/str",["exports","jquery","core/ajax","core/localstorage"],function(a,b,c,d){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.cache_strings=a.get_strings=a.get_string=void 0;b=e(b);c=e(c);d=e(d);function e(a){return a&&a.__esModule?a:{default:a}}function f(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);if(b)d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable});c.push.apply(c,d)}return c}function g(a){for(var b=1,c;b.\n\n/**\n * Fetch and render language strings.\n * Hooks into the old M.str global - but can also fetch missing strings on the fly.\n *\n * @module core/str\n * @class str\n * @package core\n * @copyright 2015 Damyon Wiese \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 2.9\n */\nimport $ from 'jquery';\nimport Ajax from 'core/ajax';\nimport LocalStorage from 'core/localstorage';\n\n// Module cache for the promises so that we don't make multiple\n// unnecessary requests.\nlet promiseCache = [];\n\n/**\n * Return a promise object that will be resolved into a string eventually (maybe immediately).\n *\n * @method get_string\n * @param {string} key The language string key\n * @param {string} component The language string component\n * @param {string} param The param for variable expansion in the string.\n * @param {string} lang The users language - if not passed it is deduced.\n * @return {Promise}\n */\nexport const get_string = (key, component, param, lang) => {\n return get_strings([{key, component, param, lang}])\n .then(results => results[0]);\n};\n\n/**\n * Make a batch request to load a set of strings\n *\n * @method get_strings\n * @param {Object[]} requests Array of { key: key, component: component, param: param, lang: lang };\n * See get_string for more info on these args.\n * @return {Promise}\n */\nexport const get_strings = (requests) => {\n let requestData = [];\n const pageLang = $('html').attr('lang').replace(/-/g, '_');\n // Helper function to construct the cache key.\n const getCacheKey = ({key, component, lang = pageLang}) => {\n if (!component) {\n component = 'core';\n }\n return `core_str/${key}/${component}/${lang}`;\n };\n\n const stringPromises = requests.map((request) => {\n const cacheKey = getCacheKey(request);\n const {component, key, param, lang = pageLang} = request;\n // Helper function to add the promise to cache.\n const buildReturn = (promise) => {\n // Make sure the promise cache contains our promise.\n promiseCache[cacheKey] = promise;\n return promise;\n };\n\n // Check if we can serve the string straight from M.str.\n if (component in M.str && key in M.str[component]) {\n return buildReturn(new Promise((resolve) => {\n resolve(M.util.get_string(key, component, param, lang));\n }));\n }\n\n // Check if the string is in the browser's local storage.\n const cached = LocalStorage.get(cacheKey);\n if (cached) {\n M.str[component] = {...M.str[component], [key]: cached};\n return buildReturn(new Promise((resolve) => {\n resolve(M.util.get_string(key, component, param, lang));\n }));\n }\n\n // Check if we've already loaded this string from the server.\n if (cacheKey in promiseCache) {\n return buildReturn(promiseCache[cacheKey]).then(() => {\n return M.util.get_string(key, component, param, lang);\n });\n } else {\n // We're going to have to ask the server for the string so\n // add this string to the list of requests to be sent.\n return buildReturn(new Promise((resolve, reject) => {\n requestData.push({\n methodname: 'core_get_string',\n args: {\n stringid: key,\n stringparams: [],\n component,\n lang,\n },\n done: (str) => {\n // When we get the response from the server\n // we should update M.str and the browser's\n // local storage before resolving this promise.\n M.str[component] = {...M.str[component], [key]: str};\n LocalStorage.set(cacheKey, str);\n resolve(M.util.get_string(key, component, param, lang));\n },\n fail: reject\n });\n }));\n }\n });\n\n if (requestData.length) {\n // If we need to load any strings from the server then send\n // off the request.\n Ajax.call(requestData, true, false, false, 0, M.cfg.langrev);\n }\n\n // We need to use jQuery here because some calling code uses the\n // .done handler instead of the .then handler.\n return $.when.apply($, stringPromises)\n .then((...strings) => strings);\n};\n\n/**\n * Add a list of strings to the caches.\n *\n * @method cache_strings\n * @param {Object[]} strings Array of { key: key, component: component, lang: lang, value: value }\n */\nexport const cache_strings = (strings) => {\n const defaultLang = $('html').attr('lang').replace(/-/g, '_');\n\n strings.forEach(({key, component, value, lang = defaultLang}) => {\n const cacheKey = ['core_str', key, component, lang].join('/');\n\n // Check M.str caching.\n if (!(component in M.str) || !(key in M.str[component])) {\n if (!(component in M.str)) {\n M.str[component] = {};\n }\n\n M.str[component][key] = value;\n }\n\n // Check local storage.\n if (!LocalStorage.get(cacheKey)) {\n LocalStorage.set(cacheKey, value);\n }\n\n // Check the promises cache.\n if (!(cacheKey in promiseCache)) {\n promiseCache[cacheKey] = $.Deferred().resolve(value).promise();\n }\n });\n};\n"],"file":"str.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/str.js"],"names":["promiseCache","get_string","key","component","param","lang","get_strings","then","results","requests","requestData","pageLang","attr","replace","getCacheKey","stringPromises","map","request","cacheKey","buildReturn","promise","M","str","Promise","resolve","util","cached","LocalStorage","get","reject","push","methodname","args","stringid","stringparams","done","set","fail","length","Ajax","call","cfg","langrev","$","when","apply","strings","cache_strings","defaultLang","forEach","value","join","Deferred"],"mappings":"0MA0BA,OACA,OACA,O,8uBAIIA,CAAAA,CAAY,CAAG,E,cAYO,QAAbC,CAAAA,UAAa,CAACC,CAAD,CAAMC,CAAN,CAAiBC,CAAjB,CAAwBC,CAAxB,CAAiC,CACvD,MAAOC,CAAAA,CAAW,CAAC,CAAC,CAACJ,GAAG,CAAHA,CAAD,CAAMC,SAAS,CAATA,CAAN,CAAiBC,KAAK,CAALA,CAAjB,CAAwBC,IAAI,CAAJA,CAAxB,CAAD,CAAD,CAAX,CACFE,IADE,CACG,SAAAC,CAAO,QAAIA,CAAAA,CAAO,CAAC,CAAD,CAAX,CADV,CAEV,C,CAUM,GAAMF,CAAAA,CAAW,CAAG,SAACG,CAAD,CAAc,IACjCC,CAAAA,CAAW,CAAG,EADmB,CAE/BC,CAAQ,CAAG,cAAE,MAAF,EAAUC,I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D,GAAI,CAACvB,UAAaC,GAAb,CAAiBV,CAAjB,CAAL,CAAiC,CAC7BS,UAAaS,GAAb,CAAiBlB,CAAjB,CAA2BgC,CAA3B,CACH,CAGD,GAAI,EAAEhC,CAAQ,GAAIlB,CAAAA,CAAd,CAAJ,CAAiC,CAC7BA,CAAY,CAACkB,CAAD,CAAZ,CAAyByB,UAAES,QAAF,GAAa5B,OAAb,CAAqB0B,CAArB,EAA4B9B,OAA5B,EAC5B,CACJ,CArBD,CAsBH,CAzBM,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Fetch and render language strings.\n * Hooks into the old M.str global - but can also fetch missing strings on the fly.\n *\n * @module core/str\n * @class str\n * @package core\n * @copyright 2015 Damyon Wiese \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since 2.9\n */\nimport $ from 'jquery';\nimport Ajax from 'core/ajax';\nimport LocalStorage from 'core/localstorage';\n\n// Module cache for the promises so that we don't make multiple\n// unnecessary requests.\nlet promiseCache = [];\n\n/**\n * Return a promise object that will be resolved into a string eventually (maybe immediately).\n *\n * @method get_string\n * @param {string} key The language string key\n * @param {string} component The language string component\n * @param {string} param The param for variable expansion in the string.\n * @param {string} lang The users language - if not passed it is deduced.\n * @return {Promise}\n */\nexport const get_string = (key, component, param, lang) => {\n return get_strings([{key, component, param, lang}])\n .then(results => results[0]);\n};\n\n/**\n * Make a batch request to load a set of strings\n *\n * @method get_strings\n * @param {Object[]} requests Array of { key: key, component: component, param: param, lang: lang };\n * See get_string for more info on these args.\n * @return {Promise}\n */\nexport const get_strings = (requests) => {\n let requestData = [];\n const pageLang = $('html').attr('lang').replace(/-/g, '_');\n // Helper function to construct the cache key.\n const getCacheKey = ({key, component, lang = pageLang}) => {\n if (!component) {\n component = 'core';\n }\n return `core_str/${key}/${component}/${lang}`;\n };\n\n const stringPromises = requests.map((request) => {\n const cacheKey = getCacheKey(request);\n const {component, key, param, lang = pageLang} = request;\n // Helper function to add the promise to cache.\n const buildReturn = (promise) => {\n // Make sure the promise cache contains our promise.\n promiseCache[cacheKey] = promise;\n return promise;\n };\n\n // Check if we can serve the string straight from M.str.\n if (component in M.str && key in M.str[component]) {\n return buildReturn(new Promise((resolve) => {\n resolve(M.util.get_string(key, component, param, lang));\n }));\n }\n\n // Check if the string is in the browser's local storage.\n const cached = LocalStorage.get(cacheKey);\n if (cached) {\n M.str[component] = {...M.str[component], [key]: cached};\n return buildReturn(new Promise((resolve) => {\n resolve(M.util.get_string(key, component, param, lang));\n }));\n }\n\n // Check if we've already loaded this string from the server.\n if (cacheKey in promiseCache) {\n return buildReturn(promiseCache[cacheKey]).then(() => {\n return M.util.get_string(key, component, param, lang);\n });\n } else {\n // We're going to have to ask the server for the string so\n // add this string to the list of requests to be sent.\n return buildReturn(new Promise((resolve, reject) => {\n requestData.push({\n methodname: 'core_get_string',\n args: {\n stringid: key,\n stringparams: [],\n component,\n lang,\n },\n done: (str) => {\n // When we get the response from the server\n // we should update M.str and the browser's\n // local storage before resolving this promise.\n M.str[component] = {...M.str[component], [key]: str};\n LocalStorage.set(cacheKey, str);\n resolve(M.util.get_string(key, component, param, lang));\n },\n fail: reject\n });\n }));\n }\n });\n\n if (requestData.length) {\n // If we need to load any strings from the server then send\n // off the request.\n Ajax.call(requestData, true, false, false, 0, M.cfg.langrev);\n }\n\n // We need to use jQuery here because some calling code uses the\n // .done handler instead of the .then handler.\n return $.when.apply($, stringPromises)\n .then((...strings) => strings);\n};\n\n/**\n * Add a list of strings to the caches.\n *\n * @method cache_strings\n * @param {Object[]} strings Array of { key: key, component: component, lang: lang, value: value }\n */\nexport const cache_strings = (strings) => {\n const defaultLang = $('html').attr('lang').replace(/-/g, '_');\n\n strings.forEach(({key, component, value, lang = defaultLang}) => {\n const cacheKey = ['core_str', key, component, lang].join('/');\n\n // Check M.str caching.\n if (!(component in M.str) || !(key in M.str[component])) {\n if (!(component in M.str)) {\n M.str[component] = {};\n }\n\n M.str[component][key] = value;\n }\n\n // Check local storage.\n if (!LocalStorage.get(cacheKey)) {\n LocalStorage.set(cacheKey, value);\n }\n\n // Check the promises cache.\n if (!(cacheKey in promiseCache)) {\n promiseCache[cacheKey] = $.Deferred().resolve(value).promise();\n }\n });\n};\n"],"file":"str.min.js"} \ No newline at end of file diff --git a/lib/amd/build/toast.min.js b/lib/amd/build/toast.min.js index 671212adcdc..5cf22c78684 100644 --- a/lib/amd/build/toast.min.js +++ b/lib/amd/build/toast.min.js @@ -1,2 +1,2 @@ -define ("core/toast",["exports","core/templates","core/notification","core/pending"],function(a,b,c,d){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.add=a.addToastRegion=void 0;b=e(b);c=e(c);d=e(d);function e(a){return a&&a.__esModule?a:{default:a}}function f(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);if(b)d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable});c.push.apply(c,d)}return c}function g(a){for(var b=1,c;b.\n\n/**\n * A system for displaying small snackbar notifications to users which disappear shortly after they are shown.\n *\n * @module core/toast\n * @package core\n * @copyright 2019 Andrew Nicols \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport Templates from 'core/templates';\nimport Notification from 'core/notification';\nimport Pending from 'core/pending';\n\n/**\n * Add a new region to place toasts in, taking in a parent element.\n *\n * @param {Element} parent\n */\nexport const addToastRegion = async(parent) => {\n const pendingPromise = new Pending('addToastRegion');\n\n try {\n const {html, js} = await Templates.renderForPromise('core/local/toast/wrapper', {});\n Templates.prependNodeContents(parent, html, js);\n } catch (e) {\n Notification.exception(e);\n }\n\n pendingPromise.resolve();\n};\n\n/**\n * Add a new toast or snackbar notification to the page.\n *\n * @param {String} message\n * @param {Object} configuration\n * @param {String} [configuration.title]\n * @param {String} [configuration.subtitle]\n * @param {Bool} [configuration.autohide=true]\n * @param {Number} [configuration.delay=4000]\n */\nexport const add = async(message, configuration) => {\n const pendingPromise = new Pending('addToastRegion');\n configuration = {\n closeButton: false,\n autohide: true,\n delay: 4000,\n ...configuration,\n };\n\n const templateName = `core/local/toast/message`;\n try {\n const targetNode = await getTargetNode();\n const {html, js} = await Templates.renderForPromise(templateName, {\n message,\n ...configuration\n });\n Templates.prependNodeContents(targetNode, html, js);\n } catch (e) {\n Notification.exception(e);\n }\n\n pendingPromise.resolve();\n};\n\nconst getTargetNode = async() => {\n const regions = document.querySelectorAll('.toast-wrapper');\n\n if (regions.length) {\n return regions[regions.length - 1];\n }\n\n await addToastRegion(document.body, 'fixed-bottom');\n return getTargetNode();\n};\n"],"file":"toast.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/toast.js"],"names":["addToastRegion","parent","pendingPromise","Pending","Templates","renderForPromise","html","js","prependNodeContents","Notification","exception","resolve","add","message","configuration","closeButton","autohide","delay","templateName","getTargetNode","targetNode","regions","document","querySelectorAll","length","body"],"mappings":"mMAuBA,OACA,OACA,O,0iCAOO,GAAMA,CAAAA,CAAc,4CAAG,WAAMC,CAAN,+FACpBC,CADoB,CACH,GAAIC,UAAJ,CAAY,gBAAZ,CADG,yBAIGC,WAAUC,gBAAV,CAA2B,0BAA3B,CAAuD,EAAvD,CAJH,iBAIfC,CAJe,GAIfA,IAJe,CAITC,CAJS,GAITA,EAJS,CAKtBH,UAAUI,mBAAV,CAA8BP,CAA9B,CAAsCK,CAAtC,CAA4CC,CAA5C,EALsB,qDAOtBE,UAAaC,SAAb,OAPsB,QAU1BR,CAAc,CAACS,OAAf,GAV0B,uDAAH,uDAApB,C,mBAuBA,GAAMC,CAAAA,CAAG,4CAAG,WAAMC,CAAN,CAAeC,CAAf,mGACTZ,CADS,CACQ,GAAIC,UAAJ,CAAY,gBAAZ,CADR,CAEfW,CAAa,IACTC,WAAW,GADF,CAETC,QAAQ,GAFC,CAGTC,KAAK,CAAE,GAHE,EAINH,CAJM,CAAb,CAOMI,CATS,oDAWcC,CAAAA,CAAa,EAX3B,QAWLC,CAXK,uBAYchB,WAAUC,gBAAV,CAA2Ba,CAA3B,IACrBL,OAAO,CAAPA,CADqB,EAElBC,CAFkB,EAZd,iBAYJR,CAZI,GAYJA,IAZI,CAYEC,CAZF,GAYEA,EAZF,CAgBXH,UAAUI,mBAAV,CAA8BY,CAA9B,CAA0Cd,CAA1C,CAAgDC,CAAhD,EAhBW,qDAkBXE,UAAaC,SAAb,OAlBW,QAqBfR,CAAc,CAACS,OAAf,GArBe,uDAAH,uDAAT,C,QAwBP,GAAMQ,CAAAA,CAAa,4CAAG,oGACZE,CADY,CACFC,QAAQ,CAACC,gBAAT,CAA0B,gBAA1B,CADE,KAGdF,CAAO,CAACG,MAHM,0CAIPH,CAAO,CAACA,CAAO,CAACG,MAAR,CAAiB,CAAlB,CAJA,wBAOZxB,CAAAA,CAAc,CAACsB,QAAQ,CAACG,IAAV,CAAgB,cAAhB,CAPF,iCAQXN,CAAa,EARF,0CAAH,uD","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * A system for displaying small snackbar notifications to users which disappear shortly after they are shown.\n *\n * @module core/toast\n * @package core\n * @copyright 2019 Andrew Nicols \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport Templates from 'core/templates';\nimport Notification from 'core/notification';\nimport Pending from 'core/pending';\n\n/**\n * Add a new region to place toasts in, taking in a parent element.\n *\n * @param {Element} parent\n */\nexport const addToastRegion = async(parent) => {\n const pendingPromise = new Pending('addToastRegion');\n\n try {\n const {html, js} = await Templates.renderForPromise('core/local/toast/wrapper', {});\n Templates.prependNodeContents(parent, html, js);\n } catch (e) {\n Notification.exception(e);\n }\n\n pendingPromise.resolve();\n};\n\n/**\n * Add a new toast or snackbar notification to the page.\n *\n * @param {String} message\n * @param {Object} configuration\n * @param {String} [configuration.title]\n * @param {String} [configuration.subtitle]\n * @param {Bool} [configuration.autohide=true]\n * @param {Number} [configuration.delay=4000]\n */\nexport const add = async(message, configuration) => {\n const pendingPromise = new Pending('addToastRegion');\n configuration = {\n closeButton: false,\n autohide: true,\n delay: 4000,\n ...configuration,\n };\n\n const templateName = `core/local/toast/message`;\n try {\n const targetNode = await getTargetNode();\n const {html, js} = await Templates.renderForPromise(templateName, {\n message,\n ...configuration\n });\n Templates.prependNodeContents(targetNode, html, js);\n } catch (e) {\n Notification.exception(e);\n }\n\n pendingPromise.resolve();\n};\n\nconst getTargetNode = async() => {\n const regions = document.querySelectorAll('.toast-wrapper');\n\n if (regions.length) {\n return regions[regions.length - 1];\n }\n\n await addToastRegion(document.body, 'fixed-bottom');\n return getTargetNode();\n};\n"],"file":"toast.min.js"} \ No newline at end of file diff --git a/lib/amd/build/utils.min.js b/lib/amd/build/utils.min.js index ba55c9c9e28..cac6dac72a3 100644 --- a/lib/amd/build/utils.min.js +++ b/lib/amd/build/utils.min.js @@ -1,2 +1,2 @@ -define ("core/utils",["exports"],function(a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});a.debounce=a.throttle=void 0;a.throttle=function throttle(a,b){var c=!1,d=null,e=function(){for(var f=arguments.length,g=Array(f),h=0;h');return t.append(this._getWarnings()),t.delegate("click",function(t){t.preventDefault();var e=this.get("host"),i=t.currentTarget.getData("sourceNode"),r=this.getDialogue();i?(r.set("focusAfterHide",this.editor).hide(),e.setSelection(e.getSelectionFromNode(i))):r.hide()},"a",this),t},_getWarnings:function(){var s,t=u.Node.create("
                          ");return s=[],this.editor.all("img").each(function(t){var e=t.getAttribute("alt");void 0!==e&&""!==e||"presentation"!==t.getAttribute("role")&&s.push(t)},this),this._addWarnings(t,M.util.get_string("imagesmissingalt",h),s,!0),s=[],this.editor.all("*").each(function(t){var e,i,r,o,n,a;if(""!==u.Lang.trim(t.get("text"))&&(e=u.Color.fromArray(this._getComputedBackgroundColor(t,t.getComputedStyle("color")),u.Color.TYPES.RGBA),i=u.Color.fromArray(this._getComputedBackgroundColor(t),u.Color.TYPES.RGBA),r=this._getLuminanceFromCssColor(e),((o=this._getLuminanceFromCssColor(i))"+M.util.get_string("nowarnings",h)+"

                          "),t},_addWarnings:function(t,e,i,r){var o,n,a,s,l,d,g,c;if(0"+e+"

                          "),n=u.Node.create('
                            '),a=a=0;a
                          1. "),(g=r?(s=i[a].getAttribute("src"),u.Node.create(' '+s+"")):(l="innerText"in i[a]?"innerText":"textContent",""===(c=i[a].get(l).trim())&&(c=M.util.get_string("emptytext",h)),i[a]===this.editor&&(c=M.util.get_string("entiredocument",h)),u.Node.create(''+c+""))).setData("sourceNode",i[a]),d.append(g),n.append(d);o.append(n),t.append(o)}},_getLuminanceFromCssColor:function(t){var e,i;return"transparent"===t&&(t="#ffffff"),.2126*(i=function(t){return(t=parseInt(t,10)/255)<=.03928?t/=12.92:t=Math.pow((t+.055)/1.055,2.4),t})((e=u.Color.toArray(u.Color.toRGB(t)))[0])+.7152*i(e[1])+.0722*i(e[2])},_getComputedBackgroundColor:function(t,e){var i,r,o;return"transparent"===(e=e||t.getComputedStyle("backgroundColor")).toLowerCase()&&(e="rgba(1, 1, 1, 0)"),1===(r=(i=u.Color.toArray(e))[3])?i:[(1-r)*(o=this._getComputedBackgroundColor(t.get("parentNode")))[0]+r*i[0],(1-r)*o[1]+r*i[1],(1-r)*o[2]+r*i[2],1]}})},"@VERSION@",{requires:["color-base","moodle-editor_atto-plugin"]}); \ No newline at end of file +YUI.add("moodle-atto_accessibilitychecker-button",function(d,t){var g="atto_accessibilitychecker";d.namespace("M.atto_accessibilitychecker").Button=d.Base.create("button",d.M.editor_atto.EditorPlugin,[],{initializer:function(){this.addButton({icon:"e/accessibility_checker",callback:this._displayDialogue})},_displayDialogue:function(){this.getDialogue({headerContent:M.util.get_string("pluginname",g),width:"500px",focusAfterHide:!0}).set("bodyContent",this._getDialogueContent()).show()},_getDialogueContent:function(){var t=d.Node.create('
                            ');return t.append(this._getWarnings()),t.delegate("click",function(t){t.preventDefault();var e=this.get("host"),t=t.currentTarget.getData("sourceNode"),i=this.getDialogue();t?(i.set("focusAfterHide",this.editor).hide(),e.setSelection(e.getSelectionFromNode(t))):i.hide()},"a",this),t},_getWarnings:function(){var t=d.Node.create("
                            "),n=[];return this.editor.all("img").each(function(t){var e=t.getAttribute("alt");void 0!==e&&""!==e||"presentation"!==t.getAttribute("role")&&n.push(t)},this),this._addWarnings(t,M.util.get_string("imagesmissingalt",g),n,!0),n=[],this.editor.all("*").each(function(t){var e,i,r,o;if(""!==d.Lang.trim(t.get("text"))&&(e=d.Color.fromArray(this._getComputedBackgroundColor(t,t.getComputedStyle("color")),d.Color.TYPES.RGBA),i=d.Color.fromArray(this._getComputedBackgroundColor(t),d.Color.TYPES.RGBA),e=this._getLuminanceFromCssColor(e),((i=this._getLuminanceFromCssColor(i))"+M.util.get_string("nowarnings",g)+"

                            "),t},_addWarnings:function(t,e,i,r){var o,n,a,s,l;if(0"+e+"

                            "),o=d.Node.create('
                              '),n=n=0;n"),(l=r?(a=i[n].getAttribute("src"),d.Node.create(' '+a+"")):(a="innerText"in i[n]?"innerText":"textContent",""===(l=i[n].get(a).trim())&&(l=M.util.get_string("emptytext",g)),i[n]===this.editor&&(l=M.util.get_string("entiredocument",g)),d.Node.create(''+l+""))).setData("sourceNode",i[n]),s.append(l),o.append(s);e.append(o),t.append(e)}},_getLuminanceFromCssColor:function(t){var e;return.2126*(e=function(t){return(t=parseInt(t,10)/255)<=.03928?t/=12.92:t=Math.pow((t+.055)/1.055,2.4),t})((t=d.Color.toArray(d.Color.toRGB(t="transparent"===t?"#ffffff":t)))[0])+.7152*e(t[1])+.0722*e(t[2])},_getComputedBackgroundColor:function(t,e){var i;return"transparent"===(e=e||t.getComputedStyle("backgroundColor")).toLowerCase()&&(e="rgba(1, 1, 1, 0)"),1===(i=(e=d.Color.toArray(e))[3])?e:[(1-i)*(t=this._getComputedBackgroundColor(t.get("parentNode")))[0]+i*e[0],(1-i)*t[1]+i*e[1],(1-i)*t[2]+i*e[2],1]}})},"@VERSION@",{requires:["color-base","moodle-editor_atto-plugin"]}); \ No newline at end of file diff --git a/lib/editor/atto/plugins/accessibilityhelper/yui/build/moodle-atto_accessibilityhelper-button/moodle-atto_accessibilityhelper-button-min.js b/lib/editor/atto/plugins/accessibilityhelper/yui/build/moodle-atto_accessibilityhelper-button/moodle-atto_accessibilityhelper-button-min.js index 6f2131df12d..ccabc14a3e8 100644 --- a/lib/editor/atto/plugins/accessibilityhelper/yui/build/moodle-atto_accessibilityhelper-button/moodle-atto_accessibilityhelper-button-min.js +++ b/lib/editor/atto/plugins/accessibilityhelper/yui/build/moodle-atto_accessibilityhelper-button/moodle-atto_accessibilityhelper-button-min.js @@ -1 +1 @@ -YUI.add("moodle-atto_accessibilityhelper-button",function(a,e){var n="atto_accessibilityhelper",i={STYLESLABEL:n+"_styleslabel",LINKSLABEL:n+"_linkslabel",IMAGESLABEL:n+"_imageslabel"};a.namespace("M.atto_accessibilityhelper").Button=a.Base.create("button",a.M.editor_atto.EditorPlugin,[],{initializer:function(){this.addButton({icon:"e/screenreader_helper",callback:this._displayDialogue})},_displayDialogue:function(){this.getDialogue({headerContent:M.util.get_string("pluginname",n),width:"800px",focusAfterHide:!0}).set("bodyContent",this._getDialogueContent()).show()},_getDialogueContent:function(){var e=a.Handlebars.compile('

                              {{get_string "liststyles" component}}

                              {{get_string "listlinks" component}}

                              {{get_string "listimages" component}}

                              '),t=a.Node.create(e({CSS:i,component:n}));return t.one(".listStyles").empty().appendChild(this._listStyles()),t.one(".listLinks").empty().appendChild(this._listLinks()),t.one(".listImages").empty().appendChild(this._listImages()),t},_listStyles:function(){var e,t=[],i=this.get("host").getSelectionParentNode();for(i=i&&a.one(i);i&&i!==this.editor;)void 0!==(e=i.get("tagName"))&&t.push(a.Escape.html(e)),i=i.ancestor();return 0===t.length&&t.push(M.util.get_string("nostyles",n)),t.reverse(),t.join(", ")},_listLinks:function(){var t,i,l=a.Node.create("
                                ");return this.editor.all("a").each(function(e){(i=a.Node.create(''+a.Escape.html(e.get("text"))+"")).setData("sourcelink",e),i.on("click",this._linkSelected,this),(t=a.Node.create("
                              1. ")).appendChild(i),l.appendChild(t)},this),l.hasChildNodes()||l.append("
                              2. "+M.util.get_string("nolinks",n)+"
                              3. "),l},_listImages:function(){var i,l,s=a.Node.create("
                                  ");return this.editor.all("img").each(function(e){var t=e.getAttribute("alt");""===t&&""===(t=e.getAttribute("title"))&&(t=e.getAttribute("src")),(l=a.Node.create(''+a.Escape.html(t)+"")).setData("sourceimage",e),l.on("click",this._imageSelected,this),(i=a.Node.create("
                                1. ")).append(l),s.append(i)},this),s.hasChildNodes()||s.append("
                                2. "+M.util.get_string("noimages",n)+"
                                3. "),s},_imageSelected:function(e){e.preventDefault(),this.getDialogue({focusAfterNode:null}).hide();var t=this.get("host"),i=e.target.getData("sourceimage");this.editor.focus(),t.setSelection(t.getSelectionFromNode(i))},_linkSelected:function(e){e.preventDefault(),this.getDialogue({focusAfterNode:null}).hide();var t=this.get("host"),i=e.target.getData("sourcelink");this.editor.focus(),t.setSelection(t.getSelectionFromNode(i))}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); \ No newline at end of file +YUI.add("moodle-atto_accessibilityhelper-button",function(a,e){var n="atto_accessibilityhelper",t={STYLESLABEL:n+"_styleslabel",LINKSLABEL:n+"_linkslabel",IMAGESLABEL:n+"_imageslabel"};a.namespace("M.atto_accessibilityhelper").Button=a.Base.create("button",a.M.editor_atto.EditorPlugin,[],{initializer:function(){this.addButton({icon:"e/screenreader_helper",callback:this._displayDialogue})},_displayDialogue:function(){this.getDialogue({headerContent:M.util.get_string("pluginname",n),width:"800px",focusAfterHide:!0}).set("bodyContent",this._getDialogueContent()).show()},_getDialogueContent:function(){var e=a.Handlebars.compile('

                                  {{get_string "liststyles" component}}

                                  {{get_string "listlinks" component}}

                                  {{get_string "listimages" component}}

                                  '),e=a.Node.create(e({CSS:t,component:n}));return e.one(".listStyles").empty().appendChild(this._listStyles()),e.one(".listLinks").empty().appendChild(this._listLinks()),e.one(".listImages").empty().appendChild(this._listImages()),e},_listStyles:function(){for(var e,t=[],i=(i=this.get("host").getSelectionParentNode())&&a.one(i);i&&i!==this.editor;)void 0!==(e=i.get("tagName"))&&t.push(a.Escape.html(e)),i=i.ancestor();return 0===t.length&&t.push(M.util.get_string("nostyles",n)),t.reverse(),t.join(", ")},_listLinks:function(){var t,i,l=a.Node.create("
                                    ");return this.editor.all("a").each(function(e){(i=a.Node.create(''+a.Escape.html(e.get("text"))+"")).setData("sourcelink",e),i.on("click",this._linkSelected,this),(t=a.Node.create("
                                  1. ")).appendChild(i),l.appendChild(t)},this),l.hasChildNodes()||l.append("
                                  2. "+M.util.get_string("nolinks",n)+"
                                  3. "),l},_listImages:function(){var i,l,s=a.Node.create("
                                      ");return this.editor.all("img").each(function(e){var t=e.getAttribute("alt");""===t&&""===(t=e.getAttribute("title"))&&(t=e.getAttribute("src")),(l=a.Node.create(''+a.Escape.html(t)+"")).setData("sourceimage",e),l.on("click",this._imageSelected,this),(i=a.Node.create("
                                    1. ")).append(l),s.append(i)},this),s.hasChildNodes()||s.append("
                                    2. "+M.util.get_string("noimages",n)+"
                                    3. "),s},_imageSelected:function(e){e.preventDefault(),this.getDialogue({focusAfterNode:null}).hide();var t=this.get("host"),e=e.target.getData("sourceimage");this.editor.focus(),t.setSelection(t.getSelectionFromNode(e))},_linkSelected:function(e){e.preventDefault(),this.getDialogue({focusAfterNode:null}).hide();var t=this.get("host"),e=e.target.getData("sourcelink");this.editor.focus(),t.setSelection(t.getSelectionFromNode(e))}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); \ No newline at end of file diff --git a/lib/editor/atto/plugins/align/yui/build/moodle-atto_align-button/moodle-atto_align-button-min.js b/lib/editor/atto/plugins/align/yui/build/moodle-atto_align-button/moodle-atto_align-button-min.js index 639746f7774..5d0151c3da6 100644 --- a/lib/editor/atto/plugins/align/yui/build/moodle-atto_align-button/moodle-atto_align-button-min.js +++ b/lib/editor/atto/plugins/align/yui/build/moodle-atto_align-button/moodle-atto_align-button-min.js @@ -1 +1 @@ -YUI.add("moodle-atto_align-button",function(t,e){t.namespace("M.atto_align").Button=t.Base.create("button",t.M.editor_atto.EditorPlugin,[],{initializer:function(){var t;t="justifyLeft",this.addButton({icon:"e/align_left",title:"leftalign",buttonName:t,callback:this._changeStyle,callbackArgs:t}),t="justifyCenter",this.addButton({icon:"e/align_center",title:"center",buttonName:t,callback:this._changeStyle,callbackArgs:t}),t="justifyRight",this.addButton({icon:"e/align_right",title:"rightalign",buttonName:t,callback:this._changeStyle,callbackArgs:t})},_changeStyle:function(t,e){var i=this.get("host");i.enableCssStyling(),document.execCommand(e,!1,null),this.editor.all("*[align]").each(function(t){var e=t.get("align");e&&(t.setStyle("text-align",e),t.removeAttribute("align"))},this),i.disableCssStyling(),this.markUpdated(),this.editor.focus()}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); \ No newline at end of file +YUI.add("moodle-atto_align-button",function(t,e){t.namespace("M.atto_align").Button=t.Base.create("button",t.M.editor_atto.EditorPlugin,[],{initializer:function(){var t="justifyLeft";this.addButton({icon:"e/align_left",title:"leftalign",buttonName:t,callback:this._changeStyle,callbackArgs:t}),this.addButton({icon:"e/align_center",title:"center",buttonName:t="justifyCenter",callback:this._changeStyle,callbackArgs:t}),this.addButton({icon:"e/align_right",title:"rightalign",buttonName:t="justifyRight",callback:this._changeStyle,callbackArgs:t})},_changeStyle:function(t,e){var i=this.get("host");i.enableCssStyling(),document.execCommand(e,!1,null),this.editor.all("*[align]").each(function(t){var e=t.get("align");e&&(t.setStyle("text-align",e),t.removeAttribute("align"))},this),i.disableCssStyling(),this.markUpdated(),this.editor.focus()}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); \ No newline at end of file diff --git a/lib/editor/atto/plugins/charmap/yui/build/moodle-atto_charmap-button/moodle-atto_charmap-button-min.js b/lib/editor/atto/plugins/charmap/yui/build/moodle-atto_charmap-button/moodle-atto_charmap-button-min.js index 06ef5d7a827..5feccf6942d 100644 --- a/lib/editor/atto/plugins/charmap/yui/build/moodle-atto_charmap-button/moodle-atto_charmap-button-min.js +++ b/lib/editor/atto/plugins/charmap/yui/build/moodle-atto_charmap-button/moodle-atto_charmap-button-min.js @@ -1,2 +1,2 @@ -YUI.add("moodle-atto_charmap-button",function(i,a){var t="atto_charmap",r={BUTTON:"atto_charmap_character",CHARMAP:"atto_charmap_selector"},s=[[" "," ",!0,"nobreakspace"],["&","&",!0,"ampersand"],[""",""",!0,"quotationmark"],["‽","‽",!0,"interrobang"],["¢","¢",!0,"centsign"],["€","€",!0,"eurosign"],["£","£",!0,"poundsign"],["¥","¥",!0,"yensign"],["©","©",!0,"copyrightsign"],["®","®",!0,"registeredsign"],["™","™",!0,"trademarksign"],["‰","‰",!0,"permillesign"],["µ","µ",!0,"microsign"],["·","·",!0,"middledot"],["•","•",!0,"bullet"],["…","…",!0,"threedotleader"],["′","′",!0,"minutesfeet"],["″","″",!0,"secondsinches"],["§","§",!0,"sectionsign"],["¶","¶",!0,"paragraphsign"],["ß","ß",!0,"sharpsesszed"],["‹","‹",!0,"singleleftpointinganglequotationmark"],["›","›",!0,"singlerightpointinganglequotationmark"],["«","«",!0,"leftpointingguillemet"],["»","»",!0,"rightpointingguillemet"],["‘","‘",!0,"leftsinglequotationmark"],["’","’",!0,"rightsinglequotationmark"],["“","“",!0,"leftdoublequotationmark"],["”","”",!0,"rightdoublequotationmark"],["‚","‚",!0,"singlelow9quotationmark"],["„","„",!0,"doublelow9quotationmark"],["<","<",!0,"lessthansign"],[">",">",!0,"greaterthansign"],["≤","≤",!0,"lessthanorequalto"],["≥","≥",!0,"greaterthanorequalto"],["–","–",!0,"endash"],["—","—",!0,"emdash"],["¯","¯",!0,"macron"],["‾","‾",!0,"overline"],["¤","¤",!0,"currencysign"],["¦","¦",!0,"brokenbar"],["¨","¨",!0,"diaeresis"],["¡","¡",!0,"invertedexclamationmark"],["¿","¿",!0,"turnedquestionmark"],["ˆ","ˆ",!0,"circumflexaccent"],["˜","˜",!0,"smalltilde"],["°","°",!0,"degreesign"],["−","−",!0,"minussign"],["±","±",!0,"plusminussign"],["÷","÷",!0,"divisionsign"],["⁄","⁄",!0,"fractionslash"],["×","×",!0,"multiplicationsign"],["¹","¹",!0,"superscriptone"],["²","²",!0,"superscripttwo"],["³","³",!0,"superscriptthree"],["¼","¼",!0,"fractiononequarter"],["½","½",!0,"fractiononehalf"],["¾","¾",!0,"fractionthreequarters"],["ƒ","ƒ",!0,"functionflorin"],["∫","∫",!0,"integral"],["∑","∑",!0,"narysumation"],["∞","∞",!0,"infinity"],["√","√",!0,"squareroot"],["∼","∼",!1,"similarto"],["≅","≅",!1,"approximatelyequalto"],["≈","≈",!0,"almostequalto"],["≠","≠",!0,"notequalto"],["≡","≡",!0,"identicalto"],["∈","∈",!1,"elementof"],["∉","∉",!1,"notanelementof"],["∋","∋",!1,"containsasmember"],["∏","∏",!0,"naryproduct"],["∧","∧",!1,"logicaland"],["∨","∨",!1,"logicalor"],["¬","¬",!0,"notsign"],["∩","∩",!0,"intersection"],["∪","∪",!1,"union"],["∂","∂",!0,"partialdifferential"],["∀","∀",!1,"forall"],["∃","∃",!1,"thereexists"],["∅","∅",!1,"diameter"],["∇","∇",!1,"backwarddifference"],["∗","∗",!1,"asteriskoperator"],["∝","∝",!1,"proportionalto"],["∠","∠",!1,"angle"],["´","´",!0,"acuteaccent"],["¸","¸",!0,"cedilla"],["ª","ª",!0,"feminineordinalindicator"],["º","º",!0,"masculineordinalindicator"],["†","†",!0,"dagger"],["‡","‡",!0,"doubledagger"],["À","À",!0,"agrave_caps"],["Á","Á",!0,"aacute_caps"],["Â","Â",!0,"acircumflex_caps"],["Ã","Ã",!0,"atilde_caps"],["Ä","Ä",!0,"adiaeresis_caps"],["Å","Å",!0,"aringabove_caps"],["Ā","Ā",!0,"amacron_caps"],["Æ","Æ",!0,"ligatureae_caps"],["Ç","Ç",!0,"ccedilla_caps"],["È","È",!0,"egrave_caps"],["É","É",!0,"eacute_caps"],["Ê","Ê",!0,"ecircumflex_caps"],["Ë","Ë",!0,"ediaeresis_caps"],["Ē","Ē",!0,"emacron_caps"],["Ì","Ì",!0,"igrave_caps"],["Í","Í",!0,"iacute_caps"],["Î","Î",!0,"icircumflex_caps"],["Ï","Ï",!0,"idiaeresis_caps"],["Ī","Ī",!0,"imacron_caps"],["Ð","Ð",!0,"eth_caps"],["Ñ","Ñ",!0,"ntilde_caps"],["Ò","Ò",!0,"ograve_caps"],["Ó","Ó",!0,"oacute_caps"],["Ô","Ô",!0,"ocircumflex_caps"],["Õ","Õ",!0,"otilde_caps"],["Ö","Ö",!0,"odiaeresis_caps"],["Ø","Ø",!0,"oslash_caps"],["Ō","Ō",!0,"omacron_caps"],["Œ","Œ",!0,"ligatureoe_caps"],["Š","Š",!0,"scaron_caps"],["Ù","Ù",!0,"ugrave_caps"],["Ú","Ú",!0,"uacute_caps"],["Û","Û",!0,"ucircumflex_caps"],["Ü","Ü",!0,"udiaeresis_caps"],["Ū","Ū",!0,"umacron_caps"],["Ý","Ý",!0,"yacute_caps"],["Ÿ","Ÿ",!0,"ydiaeresis_caps"],["Þ","Þ",!0,"thorn_caps"],["à","à",!0,"agrave"],["á","á",!0,"aacute"],["â","â",!0,"acircumflex"],["ã","ã",!0,"atilde"],["ä","ä",!0,"adiaeresis"],["å","å",!0,"aringabove"],["ā","ā",!0,"amacron"],["æ","æ",!0,"ligatureae"],["ç","ç",!0,"ccedilla"],["è","è",!0,"egrave"],["é","é",!0,"eacute"],["ê","ê",!0,"ecircumflex"],["ë","ë",!0,"ediaeresis"],["ē","ē",!0,"emacron"],["ì","ì",!0,"igrave"],["í","í",!0,"iacute"],["î","î",!0,"icircumflex"],["ï","ï",!0,"idiaeresis"],["ī","ī",!0, -"imacron"],["ð","ð",!0,"eth"],["ñ","ñ",!0,"ntilde"],["ò","ò",!0,"ograve"],["ó","ó",!0,"oacute"],["ô","ô",!0,"ocircumflex"],["õ","õ",!0,"otilde"],["ö","ö",!0,"odiaeresis"],["ø","ø",!0,"oslash"],["ō","ō",!0,"omacron"],["œ","œ",!0,"ligatureoe"],["š","š",!0,"scaron"],["ù","ù",!0,"ugrave"],["ú","ú",!0,"uacute"],["û","û",!0,"ucircumflex"],["ü","ü",!0,"udiaeresis"],["ū","ū",!0,"umacron"],["ý","ý",!0,"yacute"],["þ","þ",!0,"thorn"],["ÿ","ÿ",!0,"ydiaeresis"],["Α","Α",!0,"alpha_caps"],["Β","Β",!0,"beta_caps"],["Γ","Γ",!0,"gamma_caps"],["Δ","Δ",!0,"delta_caps"],["Ε","Ε",!0,"epsilon_caps"],["Ζ","Ζ",!0,"zeta_caps"],["Η","Η",!0,"eta_caps"],["Θ","Θ",!0,"theta_caps"],["Ι","Ι",!0,"iota_caps"],["Κ","Κ",!0,"kappa_caps"],["Λ","Λ",!0,"lambda_caps"],["Μ","Μ",!0,"mu_caps"],["Ν","Ν",!0,"nu_caps"],["Ξ","Ξ",!0,"xi_caps"],["Ο","Ο",!0,"omicron_caps"],["Π","Π",!0,"pi_caps"],["Ρ","Ρ",!0,"rho_caps"],["Σ","Σ",!0,"sigma_caps"],["Τ","Τ",!0,"tau_caps"],["Υ","Υ",!0,"upsilon_caps"],["Φ","Φ",!0,"phi_caps"],["Χ","Χ",!0,"chi_caps"],["Ψ","Ψ",!0,"psi_caps"],["Ω","Ω",!0,"omega_caps"],["α","α",!0,"alpha"],["β","β",!0,"beta"],["γ","γ",!0,"gamma"],["δ","δ",!0,"delta"],["ε","ε",!0,"epsilon"],["ζ","ζ",!0,"zeta"],["η","η",!0,"eta"],["θ","θ",!0,"theta"],["ι","ι",!0,"iota"],["κ","κ",!0,"kappa"],["λ","λ",!0,"lambda"],["μ","μ",!0,"mu"],["ν","ν",!0,"nu"],["ξ","ξ",!0,"xi"],["ο","ο",!0,"omicron"],["π","π",!0,"pi"],["ρ","ρ",!0,"rho"],["ς","ς",!0,"finalsigma"],["σ","σ",!0,"sigma"],["τ","τ",!0,"tau"],["υ","υ",!0,"upsilon"],["φ","φ",!0,"phi"],["χ","χ",!0,"chi"],["ψ","ψ",!0,"psi"],["ω","ω",!0,"omega"],["ℵ","ℵ",!1,"alefsymbol"],["ϖ","ϖ",!1,"pisymbol"],["ℜ","ℜ",!1,"realpartsymbol"],["ϑ","ϑ",!1,"thetasymbol"],["ϒ","ϒ",!1,"upsilonhooksymbol"],["℘","℘",!1,"weierstrassp"],["ℑ","ℑ",!1,"imaginarypart"],["←","←",!0,"leftwardsarrow"],["↑","↑",!0,"upwardsarrow"],["→","→",!0,"rightwardsarrow"],["↓","↓",!0,"downwardsarrow"],["↔","↔",!0,"leftrightarrow"],["↵","↵",!1,"carriagereturn"],["⇐","⇐",!1,"leftwardsdoublearrow"],["⇑","⇑",!1,"upwardsdoublearrow"],["⇒","⇒",!1,"rightwardsdoublearrow"],["⇓","⇓",!1,"downwardsdoublearrow"],["⇔","⇔",!1,"leftrightdoublearrow"],["∴","∴",!1,"therefore"],["⊂","⊂",!1,"subsetof"],["⊃","⊃",!1,"supersetof"],["⊄","⊄",!1,"notasubsetof"],["⊆","⊆",!1,"subsetoforequalto"],["⊇","⊇",!1,"supersetoforequalto"],["⊕","⊕",!1,"circledplus"],["⊗","⊗",!1,"circledtimes"],["⊥","⊥",!1,"perpendicular"],["⋅","⋅",!1,"dotoperator"],["⌈","⌈",!1,"leftceiling"],["⌉","⌉",!1,"rightceiling"],["⌊","⌊",!1,"leftfloor"],["⌋","⌋",!1,"rightfloor"],["⟨","〈",!1,"leftpointinganglebracket"],["⟩","〉",!1,"rightpointinganglebracket"],["◊","◊",!0,"lozenge"],["♠","♠",!0,"blackspadesuit"],["♣","♣",!0,"blackclubsuit"],["♥","♥",!0,"blackheartsuit"],["♦","♦",!0,"blackdiamondsuit"],[" "," ",!1,"enspace"],[" "," ",!1,"emspace"],[" "," ",!1,"thinspace"],["‌","‌",!1,"zerowidthnonjoiner"],["‍","‍",!1,"zerowidthjoiner"],["‎","‎",!1,"lefttorightmark"],["‏","‏",!1,"righttoleftmark"],["­","­",!1,"softhyphen"]];i.namespace("M.atto_charmap").Button=i.Base.create("button",i.M.editor_atto.EditorPlugin,[],{_currentSelection:null,initializer:function(){this.addButton({icon:"e/special_character",callback:this._displayDialogue})},_displayDialogue:function(){this._currentSelection=this.get("host").getSelection(),!1!==this._currentSelection&&this.getDialogue({headerContent:M.util.get_string("insertcharacter",t),focusAfterHide:!0},!0).set("bodyContent",this._getDialogueContent()).show()},_getDialogueContent:function(){var a=i.Handlebars.compile('
                                      {{#each CHARMAP}}{{#if this.[2]}}{{/if}}{{/each}}
                                      '),e=i.Node.create(a({component:t,CSS:r,CHARMAP:s}));return e.delegate("click",this._insertChar,"."+r.BUTTON,this),e},_insertChar:function(a){var e,i=a.target.getData("character");this.getDialogue({focusAfterHide:null}).hide(),(e=this.get("host")).setSelection(this._currentSelection),e.insertContentAtFocusPoint(i),this.markUpdated()}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); \ No newline at end of file +YUI.add("moodle-atto_charmap-button",function(e,a){var i="atto_charmap",t={BUTTON:"atto_charmap_character",CHARMAP:"atto_charmap_selector"},r=[[" "," ",!0,"nobreakspace"],["&","&",!0,"ampersand"],[""",""",!0,"quotationmark"],["‽","‽",!0,"interrobang"],["¢","¢",!0,"centsign"],["€","€",!0,"eurosign"],["£","£",!0,"poundsign"],["¥","¥",!0,"yensign"],["©","©",!0,"copyrightsign"],["®","®",!0,"registeredsign"],["™","™",!0,"trademarksign"],["‰","‰",!0,"permillesign"],["µ","µ",!0,"microsign"],["·","·",!0,"middledot"],["•","•",!0,"bullet"],["…","…",!0,"threedotleader"],["′","′",!0,"minutesfeet"],["″","″",!0,"secondsinches"],["§","§",!0,"sectionsign"],["¶","¶",!0,"paragraphsign"],["ß","ß",!0,"sharpsesszed"],["‹","‹",!0,"singleleftpointinganglequotationmark"],["›","›",!0,"singlerightpointinganglequotationmark"],["«","«",!0,"leftpointingguillemet"],["»","»",!0,"rightpointingguillemet"],["‘","‘",!0,"leftsinglequotationmark"],["’","’",!0,"rightsinglequotationmark"],["“","“",!0,"leftdoublequotationmark"],["”","”",!0,"rightdoublequotationmark"],["‚","‚",!0,"singlelow9quotationmark"],["„","„",!0,"doublelow9quotationmark"],["<","<",!0,"lessthansign"],[">",">",!0,"greaterthansign"],["≤","≤",!0,"lessthanorequalto"],["≥","≥",!0,"greaterthanorequalto"],["–","–",!0,"endash"],["—","—",!0,"emdash"],["¯","¯",!0,"macron"],["‾","‾",!0,"overline"],["¤","¤",!0,"currencysign"],["¦","¦",!0,"brokenbar"],["¨","¨",!0,"diaeresis"],["¡","¡",!0,"invertedexclamationmark"],["¿","¿",!0,"turnedquestionmark"],["ˆ","ˆ",!0,"circumflexaccent"],["˜","˜",!0,"smalltilde"],["°","°",!0,"degreesign"],["−","−",!0,"minussign"],["±","±",!0,"plusminussign"],["÷","÷",!0,"divisionsign"],["⁄","⁄",!0,"fractionslash"],["×","×",!0,"multiplicationsign"],["¹","¹",!0,"superscriptone"],["²","²",!0,"superscripttwo"],["³","³",!0,"superscriptthree"],["¼","¼",!0,"fractiononequarter"],["½","½",!0,"fractiononehalf"],["¾","¾",!0,"fractionthreequarters"],["ƒ","ƒ",!0,"functionflorin"],["∫","∫",!0,"integral"],["∑","∑",!0,"narysumation"],["∞","∞",!0,"infinity"],["√","√",!0,"squareroot"],["∼","∼",!1,"similarto"],["≅","≅",!1,"approximatelyequalto"],["≈","≈",!0,"almostequalto"],["≠","≠",!0,"notequalto"],["≡","≡",!0,"identicalto"],["∈","∈",!1,"elementof"],["∉","∉",!1,"notanelementof"],["∋","∋",!1,"containsasmember"],["∏","∏",!0,"naryproduct"],["∧","∧",!1,"logicaland"],["∨","∨",!1,"logicalor"],["¬","¬",!0,"notsign"],["∩","∩",!0,"intersection"],["∪","∪",!1,"union"],["∂","∂",!0,"partialdifferential"],["∀","∀",!1,"forall"],["∃","∃",!1,"thereexists"],["∅","∅",!1,"diameter"],["∇","∇",!1,"backwarddifference"],["∗","∗",!1,"asteriskoperator"],["∝","∝",!1,"proportionalto"],["∠","∠",!1,"angle"],["´","´",!0,"acuteaccent"],["¸","¸",!0,"cedilla"],["ª","ª",!0,"feminineordinalindicator"],["º","º",!0,"masculineordinalindicator"],["†","†",!0,"dagger"],["‡","‡",!0,"doubledagger"],["À","À",!0,"agrave_caps"],["Á","Á",!0,"aacute_caps"],["Â","Â",!0,"acircumflex_caps"],["Ã","Ã",!0,"atilde_caps"],["Ä","Ä",!0,"adiaeresis_caps"],["Å","Å",!0,"aringabove_caps"],["Ā","Ā",!0,"amacron_caps"],["Æ","Æ",!0,"ligatureae_caps"],["Ç","Ç",!0,"ccedilla_caps"],["È","È",!0,"egrave_caps"],["É","É",!0,"eacute_caps"],["Ê","Ê",!0,"ecircumflex_caps"],["Ë","Ë",!0,"ediaeresis_caps"],["Ē","Ē",!0,"emacron_caps"],["Ì","Ì",!0,"igrave_caps"],["Í","Í",!0,"iacute_caps"],["Î","Î",!0,"icircumflex_caps"],["Ï","Ï",!0,"idiaeresis_caps"],["Ī","Ī",!0,"imacron_caps"],["Ð","Ð",!0,"eth_caps"],["Ñ","Ñ",!0,"ntilde_caps"],["Ò","Ò",!0,"ograve_caps"],["Ó","Ó",!0,"oacute_caps"],["Ô","Ô",!0,"ocircumflex_caps"],["Õ","Õ",!0,"otilde_caps"],["Ö","Ö",!0,"odiaeresis_caps"],["Ø","Ø",!0,"oslash_caps"],["Ō","Ō",!0,"omacron_caps"],["Œ","Œ",!0,"ligatureoe_caps"],["Š","Š",!0,"scaron_caps"],["Ù","Ù",!0,"ugrave_caps"],["Ú","Ú",!0,"uacute_caps"],["Û","Û",!0,"ucircumflex_caps"],["Ü","Ü",!0,"udiaeresis_caps"],["Ū","Ū",!0,"umacron_caps"],["Ý","Ý",!0,"yacute_caps"],["Ÿ","Ÿ",!0,"ydiaeresis_caps"],["Þ","Þ",!0,"thorn_caps"],["à","à",!0,"agrave"],["á","á",!0,"aacute"],["â","â",!0,"acircumflex"],["ã","ã",!0,"atilde"],["ä","ä",!0,"adiaeresis"],["å","å",!0,"aringabove"],["ā","ā",!0,"amacron"],["æ","æ",!0,"ligatureae"],["ç","ç",!0,"ccedilla"],["è","è",!0,"egrave"],["é","é",!0,"eacute"],["ê","ê",!0,"ecircumflex"],["ë","ë",!0,"ediaeresis"],["ē","ē",!0,"emacron"],["ì","ì",!0,"igrave"],["í","í",!0,"iacute"],["î","î",!0,"icircumflex"],["ï","ï",!0,"idiaeresis"],["ī","ī",!0, +"imacron"],["ð","ð",!0,"eth"],["ñ","ñ",!0,"ntilde"],["ò","ò",!0,"ograve"],["ó","ó",!0,"oacute"],["ô","ô",!0,"ocircumflex"],["õ","õ",!0,"otilde"],["ö","ö",!0,"odiaeresis"],["ø","ø",!0,"oslash"],["ō","ō",!0,"omacron"],["œ","œ",!0,"ligatureoe"],["š","š",!0,"scaron"],["ù","ù",!0,"ugrave"],["ú","ú",!0,"uacute"],["û","û",!0,"ucircumflex"],["ü","ü",!0,"udiaeresis"],["ū","ū",!0,"umacron"],["ý","ý",!0,"yacute"],["þ","þ",!0,"thorn"],["ÿ","ÿ",!0,"ydiaeresis"],["Α","Α",!0,"alpha_caps"],["Β","Β",!0,"beta_caps"],["Γ","Γ",!0,"gamma_caps"],["Δ","Δ",!0,"delta_caps"],["Ε","Ε",!0,"epsilon_caps"],["Ζ","Ζ",!0,"zeta_caps"],["Η","Η",!0,"eta_caps"],["Θ","Θ",!0,"theta_caps"],["Ι","Ι",!0,"iota_caps"],["Κ","Κ",!0,"kappa_caps"],["Λ","Λ",!0,"lambda_caps"],["Μ","Μ",!0,"mu_caps"],["Ν","Ν",!0,"nu_caps"],["Ξ","Ξ",!0,"xi_caps"],["Ο","Ο",!0,"omicron_caps"],["Π","Π",!0,"pi_caps"],["Ρ","Ρ",!0,"rho_caps"],["Σ","Σ",!0,"sigma_caps"],["Τ","Τ",!0,"tau_caps"],["Υ","Υ",!0,"upsilon_caps"],["Φ","Φ",!0,"phi_caps"],["Χ","Χ",!0,"chi_caps"],["Ψ","Ψ",!0,"psi_caps"],["Ω","Ω",!0,"omega_caps"],["α","α",!0,"alpha"],["β","β",!0,"beta"],["γ","γ",!0,"gamma"],["δ","δ",!0,"delta"],["ε","ε",!0,"epsilon"],["ζ","ζ",!0,"zeta"],["η","η",!0,"eta"],["θ","θ",!0,"theta"],["ι","ι",!0,"iota"],["κ","κ",!0,"kappa"],["λ","λ",!0,"lambda"],["μ","μ",!0,"mu"],["ν","ν",!0,"nu"],["ξ","ξ",!0,"xi"],["ο","ο",!0,"omicron"],["π","π",!0,"pi"],["ρ","ρ",!0,"rho"],["ς","ς",!0,"finalsigma"],["σ","σ",!0,"sigma"],["τ","τ",!0,"tau"],["υ","υ",!0,"upsilon"],["φ","φ",!0,"phi"],["χ","χ",!0,"chi"],["ψ","ψ",!0,"psi"],["ω","ω",!0,"omega"],["ℵ","ℵ",!1,"alefsymbol"],["ϖ","ϖ",!1,"pisymbol"],["ℜ","ℜ",!1,"realpartsymbol"],["ϑ","ϑ",!1,"thetasymbol"],["ϒ","ϒ",!1,"upsilonhooksymbol"],["℘","℘",!1,"weierstrassp"],["ℑ","ℑ",!1,"imaginarypart"],["←","←",!0,"leftwardsarrow"],["↑","↑",!0,"upwardsarrow"],["→","→",!0,"rightwardsarrow"],["↓","↓",!0,"downwardsarrow"],["↔","↔",!0,"leftrightarrow"],["↵","↵",!1,"carriagereturn"],["⇐","⇐",!1,"leftwardsdoublearrow"],["⇑","⇑",!1,"upwardsdoublearrow"],["⇒","⇒",!1,"rightwardsdoublearrow"],["⇓","⇓",!1,"downwardsdoublearrow"],["⇔","⇔",!1,"leftrightdoublearrow"],["∴","∴",!1,"therefore"],["⊂","⊂",!1,"subsetof"],["⊃","⊃",!1,"supersetof"],["⊄","⊄",!1,"notasubsetof"],["⊆","⊆",!1,"subsetoforequalto"],["⊇","⊇",!1,"supersetoforequalto"],["⊕","⊕",!1,"circledplus"],["⊗","⊗",!1,"circledtimes"],["⊥","⊥",!1,"perpendicular"],["⋅","⋅",!1,"dotoperator"],["⌈","⌈",!1,"leftceiling"],["⌉","⌉",!1,"rightceiling"],["⌊","⌊",!1,"leftfloor"],["⌋","⌋",!1,"rightfloor"],["⟨","〈",!1,"leftpointinganglebracket"],["⟩","〉",!1,"rightpointinganglebracket"],["◊","◊",!0,"lozenge"],["♠","♠",!0,"blackspadesuit"],["♣","♣",!0,"blackclubsuit"],["♥","♥",!0,"blackheartsuit"],["♦","♦",!0,"blackdiamondsuit"],[" "," ",!1,"enspace"],[" "," ",!1,"emspace"],[" "," ",!1,"thinspace"],["‌","‌",!1,"zerowidthnonjoiner"],["‍","‍",!1,"zerowidthjoiner"],["‎","‎",!1,"lefttorightmark"],["‏","‏",!1,"righttoleftmark"],["­","­",!1,"softhyphen"]];e.namespace("M.atto_charmap").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{_currentSelection:null,initializer:function(){this.addButton({icon:"e/special_character",callback:this._displayDialogue})},_displayDialogue:function(){this._currentSelection=this.get("host").getSelection(),!1!==this._currentSelection&&this.getDialogue({headerContent:M.util.get_string("insertcharacter",i),focusAfterHide:!0},!0).set("bodyContent",this._getDialogueContent()).show()},_getDialogueContent:function(){var a=e.Handlebars.compile('
                                      {{#each CHARMAP}}{{#if this.[2]}}{{/if}}{{/each}}
                                      '),a=e.Node.create(a({component:i,CSS:t,CHARMAP:r}));return a.delegate("click",this._insertChar,"."+t.BUTTON,this),a},_insertChar:function(a){var e,a=a.target.getData("character");this.getDialogue({focusAfterHide:null}).hide(),(e=this.get("host")).setSelection(this._currentSelection),e.insertContentAtFocusPoint(a),this.markUpdated()}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); \ No newline at end of file diff --git a/lib/editor/atto/plugins/collapse/yui/build/moodle-atto_collapse-button/moodle-atto_collapse-button-min.js b/lib/editor/atto/plugins/collapse/yui/build/moodle-atto_collapse-button/moodle-atto_collapse-button-min.js index bf69dae776b..114f03a3280 100644 --- a/lib/editor/atto/plugins/collapse/yui/build/moodle-atto_collapse-button/moodle-atto_collapse-button-min.js +++ b/lib/editor/atto/plugins/collapse/yui/build/moodle-atto_collapse-button/moodle-atto_collapse-button-min.js @@ -1 +1 @@ -YUI.add("moodle-atto_collapse-button",function(s,t){var o="atto_collapse",e="showgroups",l="collapse",a="collapsed",n=".atto_group";s.namespace("M.atto_collapse").Button=s.Base.create("button",s.M.editor_atto.EditorPlugin,[],{initializer:function(){var t,i=s.Object.size(this.get("host").get("plugins"));i<=1+parseInt(this.get(e),10)||this.toolbar.all(n).size()>this.get(e)||(t=this.addButton({icon:"icon",iconComponent:o,callback:this._toggle}),this.get("host").on("pluginsloaded",function(t,i){this._setVisibility(i),this.toolbar.all(n).item(this.get(e)).insert('
                                      ',"before")},this,t))},_toggle:function(t){t.preventDefault();var i=this.buttons[l];i.getData(a)?(this.highlightButtons(l),this._setVisibility(i,!0)):(this.unHighlightButtons(l),this._setVisibility(i)),this.buttons[this.name].focus()},_setVisibility:function(t,i){var s=this.toolbar.all(n).slice(this.get(e));i?(t.set("title",M.util.get_string("showfewer",o)),s.show(),t.setData(a,!1)):(t.set("title",M.util.get_string("showmore",o)),s.hide(),t.setData(a,!0))}},{ATTRS:{showgroups:{value:3}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); \ No newline at end of file +YUI.add("moodle-atto_collapse-button",function(i,t){var o="atto_collapse",e="showgroups",s="collapse",l="collapsed",a=".atto_group";i.namespace("M.atto_collapse").Button=i.Base.create("button",i.M.editor_atto.EditorPlugin,[],{initializer:function(){var t=i.Object.size(this.get("host").get("plugins"));t<=1+parseInt(this.get(e),10)||this.toolbar.all(a).size()>this.get(e)||(t=this.addButton({icon:"icon",iconComponent:o,callback:this._toggle}),this.get("host").on("pluginsloaded",function(t,i){this._setVisibility(i),this.toolbar.all(a).item(this.get(e)).insert('
                                      ',"before")},this,t))},_toggle:function(t){t.preventDefault();t=this.buttons[s];t.getData(l)?(this.highlightButtons(s),this._setVisibility(t,!0)):(this.unHighlightButtons(s),this._setVisibility(t)),this.buttons[this.name].focus()},_setVisibility:function(t,i){var s=this.toolbar.all(a).slice(this.get(e));i?(t.set("title",M.util.get_string("showfewer",o)),s.show(),t.setData(l,!1)):(t.set("title",M.util.get_string("showmore",o)),s.hide(),t.setData(l,!0))}},{ATTRS:{showgroups:{value:3}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); \ No newline at end of file diff --git a/lib/editor/atto/plugins/emoticon/yui/build/moodle-atto_emoticon-button/moodle-atto_emoticon-button-min.js b/lib/editor/atto/plugins/emoticon/yui/build/moodle-atto_emoticon-button/moodle-atto_emoticon-button-min.js index 2465ed6a65a..af413e5203b 100644 --- a/lib/editor/atto/plugins/emoticon/yui/build/moodle-atto_emoticon-button/moodle-atto_emoticon-button-min.js +++ b/lib/editor/atto/plugins/emoticon/yui/build/moodle-atto_emoticon-button/moodle-atto_emoticon-button-min.js @@ -1 +1 @@ -YUI.add("moodle-atto_emoticon-button",function(i,t){var o={EMOTE:"atto_emoticon_emote",MAP:"atto_emoticon_map"},n=".atto_emoticon_emote";i.namespace("M.atto_emoticon").Button=i.Base.create("button",i.M.editor_atto.EditorPlugin,[],{_currentSelection:null,initializer:function(){this.addButton({icon:"e/emoticons",callback:this._displayDialogue})},_displayDialogue:function(){this._currentSelection=this.get("host").getSelection(),!1!==this._currentSelection&&this.getDialogue({headerContent:M.util.get_string("insertemoticon","atto_emoticon"),focusAfterHide:!0},!0).set("bodyContent",this._getDialogueContent()).show()},_insertEmote:function(t){var e,i=t.target.ancestor(n,!0),o=this.get("host");t.preventDefault(),this.getDialogue({focusAfterHide:null}).hide(),e=" "+i.getData("text")+" ",o.setSelection(this._currentSelection),o.insertContentAtFocusPoint(e),this.markUpdated()},_getDialogueContent:function(){var t=i.Handlebars.compile('
                                        {{#each emoticons}}
                                      • {{get_string altidentifier altcomponent}}
                                        {{text}}
                                        {{get_string altidentifier altcomponent}}
                                      • {{/each}}
                                      '),e=i.Node.create(t({emoticons:this.get("emoticons"),CSS:o}));return e.delegate("click",this._insertEmote,n,this),e.delegate("key",this._insertEmote,"32",n,this),e}},{ATTRS:{emoticons:{value:{}}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); \ No newline at end of file +YUI.add("moodle-atto_emoticon-button",function(e,t){var i={EMOTE:"atto_emoticon_emote",MAP:"atto_emoticon_map"},o=".atto_emoticon_emote";e.namespace("M.atto_emoticon").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{_currentSelection:null,initializer:function(){this.addButton({icon:"e/emoticons",callback:this._displayDialogue})},_displayDialogue:function(){this._currentSelection=this.get("host").getSelection(),!1!==this._currentSelection&&this.getDialogue({headerContent:M.util.get_string("insertemoticon","atto_emoticon"),focusAfterHide:!0},!0).set("bodyContent",this._getDialogueContent()).show()},_insertEmote:function(t){var e=t.target.ancestor(o,!0),i=this.get("host");t.preventDefault(),this.getDialogue({focusAfterHide:null}).hide(),t=" "+e.getData("text")+" ",i.setSelection(this._currentSelection),i.insertContentAtFocusPoint(t),this.markUpdated()},_getDialogueContent:function(){var t=e.Handlebars.compile('
                                        {{#each emoticons}}
                                      • {{get_string altidentifier altcomponent}}
                                        {{text}}
                                        {{get_string altidentifier altcomponent}}
                                      • {{/each}}
                                      '),t=e.Node.create(t({emoticons:this.get("emoticons"),CSS:i}));return t.delegate("click",this._insertEmote,o,this),t.delegate("key",this._insertEmote,"32",o,this),t}},{ATTRS:{emoticons:{value:{}}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); \ No newline at end of file diff --git a/lib/editor/atto/plugins/equation/yui/build/moodle-atto_equation-button/moodle-atto_equation-button-min.js b/lib/editor/atto/plugins/equation/yui/build/moodle-atto_equation-button/moodle-atto_equation-button-min.js index 4fb26ebdf5a..5828c5d8177 100644 --- a/lib/editor/atto/plugins/equation/yui/build/moodle-atto_equation-button/moodle-atto_equation-button-min.js +++ b/lib/editor/atto/plugins/equation/yui/build/moodle-atto_equation-button/moodle-atto_equation-button-min.js @@ -1,2 +1,2 @@ -YUI.add("moodle-atto_equation-button",function(r,t){var a="atto_equation",l={EQUATION_TEXT:"atto_equation_equation",EQUATION_PREVIEW:"atto_equation_preview",SUBMIT:"atto_equation_submit",LIBRARY:"atto_equation_library",LIBRARY_GROUPS:"atto_equation_groups",LIBRARY_GROUP_PREFIX:"atto_equation_group"},u={LIBRARY:"."+l.LIBRARY,LIBRARY_GROUP:"."+l.LIBRARY_GROUPS+" > div > div",EQUATION_TEXT:"."+l.EQUATION_TEXT,EQUATION_PREVIEW:"."+l.EQUATION_PREVIEW,SUBMIT:"."+l.SUBMIT,LIBRARY_BUTTON:"."+l.LIBRARY+" button"},c={START:"\\(",END:"\\)"},i='
                                      {{{library}}}
                                      {{get_string "cursorinfo" component}}

                                      ',h='
                                      {{#each library}}
                                      {{#split "\n" elements}}{{/split}}
                                      {{/each}}
                                      ';r.namespace("M.atto_equation").Button=r.Base.create("button",r.M.editor_atto.EditorPlugin,[],{_currentSelection:null,_lastCursorPos:0,_content:null,_sourceEquation:null,_groupFocus:null,_equationPatterns:[/\$\$([\S\s]+?)\$\$/,/\\\(([\S\s]+?)\\\)/,/\\\[([\S\s]+?)\\\]/,/\[tex\]([\S\s]+?)\[\/tex\]/],initializer:function(){this._groupFocus={},this.get("texfilteractive")&&(this.addButton({icon:"e/math",callback:this._displayDialogue}),this.get("host").on("atto:selectionchanged",function(){this._resolveEquation()?this.highlightButtons():this.unHighlightButtons()},this),this.editor.all("tex").each(function(t){var e=r.Node.create(""+c.START+" "+t.get("text")+" "+c.END+"");t.replace(e)}))},_displayDialogue:function(){var t,e,n;this._currentSelection=this.get("host").getSelection(),!1!==this._currentSelection&&(t=this._resolveEquation(),e=this.getDialogue({headerContent:M.util.get_string("pluginname",a),focusAfterHide:!0,width:600,focusOnShowSelector:u.EQUATION_TEXT}),n=this._getDialogueContent(),e.set("bodyContent",n),n.one(".nav-item:first-child .nav-link").getDOMNode().click(),e.show(),require(["core/event"],function(t){t.notifyFilterContentUpdated(e.get("boundingBox").getDOMNode())}),t&&n.one(u.EQUATION_TEXT).set("text",t),this._updatePreview(!1))},_resolveEquation:function(){var c,t=this.get("host").getSelectionParentNode(),h=this.get("host").getSelection(),d=!1;return!!this.get("host").isActive()&&(!!t&&(!(!h||0===h.length)&&(this.sourceEquation=null,h=h[0],c=r.one(t).get("text"),r.Array.find(this._equationPatterns,function(u){var t=c.match(new RegExp(u.source,"g"));if(t&&t.length)return r.Array.find(t,function(t){for(var e,n,i,o,s,a,r,l=0;-1!==c.indexOf(t,l);){if(n=(e=c.indexOf(t,l))+t.length,i=h.startOffset>=e&&h.startOffsete,i&&o&&(s=t.match(u))&&s.length)return r=(a=c.indexOf(s[1],e))+s[1].length,d=s[1],this.sourceEquation={startOuterPosition:e,endOuterPosition:n,outerMatch:t,startInnerPosition:a,endInnerPosition:r,innerMatch:s},!0;l=n}},this)},this),!1!==d&&(d=d.trim()),d)))},_setEquation:function(t){var e,n,i,o,s;o=this.get("host"),t.preventDefault(),this.getDialogue({focusAfterHide:null}).hide(),""!==(i=t.currentTarget.ancestor(".atto_form").one("textarea").get("value"))&&(o.setSelection(this._currentSelection),this.sourceEquation?(i=" "+i+" ",s=(n=(e=r.one(o.getSelectionParentNode())).get("text")).slice(0,this.sourceEquation.startInnerPosition)+i+n.slice(this.sourceEquation.endInnerPosition),e.set("text",s)):(i=c.START+" "+i+" "+c.END,o.insertContentAtFocusPoint(i)),this.markUpdated())},_throttle:function(n,i){var o=null;return function(){var t=this,e=arguments;clearTimeout(o),o=setTimeout(function(){n.apply(t,e)},i)}},_updatePreview:function(t){var e,n,i,o=this._content.one(u.EQUATION_TEXT),s=o.get("value"),a=o.get("selectionStart");for(t&&t.preventDefault(),a=a||0;"\\"===s.charAt(a)&&0<=a;)--a;if(n=/[a-zA-Z\{]/,0!==a&&"{"!=s.charAt(a-1))for(;n.test(s.charAt(a))&&a=o.size()&&(a=0),e=o.item(a),this._setGroupTabFocus(i,e),e.focus()},_setGroupTabFocus:function(t,e){var n=t.generateID();"undefined"!=typeof this._groupFocus[n]&&this._groupFocus[n].setAttribute("tabindex","-1"),(this._groupFocus[n]=e).setAttribute("tabindex",0),t.setAttribute("aria-activedescendant",e.generateID())},_selectLibraryItem:function(t){var e,n,i,o,s,a=t.currentTarget.getAttribute("data-tex"),r=0;t.preventDefault(),this._setGroupTabFocus(t.currentTarget.get("parentNode"),t.currentTarget)," "!==(n=(e=(i=t.currentTarget.ancestor(".atto_form").one("textarea")).get("value")).substring(0,this._lastCursorPos)).charAt(n.length-1)&&(n+=" "),r=(n+=a).length," "!==e.charAt(this._lastCursorPos)&&(n+=" "),n+=e.substring(this._lastCursorPos,e.length),i.set("value",n),i.focus(),"number"==typeof(o=i.getDOMNode()).selectionStart?o.selectionStart=o.selectionEnd=r:"undefined"!=typeof o.createTextRange&&((s=o.createTextRange()).moveToPoint(r),s.select()),this._updatePreview(!1)},_getLibraryContent:function(){var t,e,n,i=r.Handlebars.compile(h),o=this.get("library"),s="";return r.Handlebars.registerHelper("split",function(t,e,n){var i,o,s;if(void 0===t||void 0===e)return"";for(s="",i=e.trim().split(t);0 div > div",EQUATION_TEXT:"."+o.EQUATION_TEXT,EQUATION_PREVIEW:"."+o.EQUATION_PREVIEW,SUBMIT:"."+o.SUBMIT,LIBRARY_BUTTON:"."+o.LIBRARY+" button"},r={START:"\\(",END:"\\)"},l='
                                      {{{library}}}
                                      {{get_string "cursorinfo" component}}

                                      ',u='
                                      {{#each library}}
                                      {{#split "\n" elements}}{{/split}}
                                      {{/each}}
                                      ';s.namespace("M.atto_equation").Button=s.Base.create("button",s.M.editor_atto.EditorPlugin,[],{_currentSelection:null,_lastCursorPos:0,_content:null,_sourceEquation:null,_groupFocus:null,_equationPatterns:[/\$\$([\S\s]+?)\$\$/,/\\\(([\S\s]+?)\\\)/,/\\\[([\S\s]+?)\\\]/,/\[tex\]([\S\s]+?)\[\/tex\]/],initializer:function(){this._groupFocus={},this.get("texfilteractive")&&(this.addButton({icon:"e/math",callback:this._displayDialogue}),this.get("host").on("atto:selectionchanged",function(){this._resolveEquation()?this.highlightButtons():this.unHighlightButtons()},this),this.editor.all("tex").each(function(t){var e=s.Node.create(""+r.START+" "+t.get("text")+" "+r.END+"");t.replace(e)}))},_displayDialogue:function(){var t,e,n;this._currentSelection=this.get("host").getSelection(),!1!==this._currentSelection&&(t=this._resolveEquation(),e=this.getDialogue({headerContent:M.util.get_string("pluginname",i),focusAfterHide:!0,width:600,focusOnShowSelector:a.EQUATION_TEXT}),n=this._getDialogueContent(),e.set("bodyContent",n),n.one(".nav-item:first-child .nav-link").getDOMNode().click(),e.show(),require(["core/event"],function(t){t.notifyFilterContentUpdated(e.get("boundingBox").getDOMNode())}),t&&n.one(a.EQUATION_TEXT).set("text",t),this._updatePreview(!1))},_resolveEquation:function(){var l,t=this.get("host").getSelectionParentNode(),u=this.get("host").getSelection(),c=!1;return!!this.get("host").isActive()&&(!!t&&(!(!u||0===u.length)&&(this.sourceEquation=null,u=u[0],l=s.one(t).get("text"),s.Array.find(this._equationPatterns,function(r){var t=l.match(new RegExp(r.source,"g"));if(t&&t.length)return s.Array.find(t,function(t){for(var e,n,i,o,s,a=0;-1!==l.indexOf(t,a);){if(n=(e=l.indexOf(t,a))+t.length,o=u.startOffset>=e&&u.startOffsete,o&&s&&(i=t.match(r))&&i.length)return s=(o=l.indexOf(i[1],e))+i[1].length,c=i[1],this.sourceEquation={startOuterPosition:e,endOuterPosition:n,outerMatch:t,startInnerPosition:o,endInnerPosition:s,innerMatch:i},!0;a=n}},this)},this),c=!1!==c?c.trim():c)))},_setEquation:function(t){var e,n,i=this.get("host");t.preventDefault(),this.getDialogue({focusAfterHide:null}).hide(),""!==(t=t.currentTarget.ancestor(".atto_form").one("textarea").get("value"))&&(i.setSelection(this._currentSelection),this.sourceEquation?(t=" "+t+" ",n=(n=(e=s.one(i.getSelectionParentNode())).get("text")).slice(0,this.sourceEquation.startInnerPosition)+t+n.slice(this.sourceEquation.endInnerPosition),e.set("text",n)):i.insertContentAtFocusPoint(t=r.START+" "+t+" "+r.END),this.markUpdated())},_throttle:function(n,i){var o=null;return function(){var t=this,e=arguments;clearTimeout(o),o=setTimeout(function(){n.apply(t,e)},i)}},_updatePreview:function(t){var e,n=this._content.one(a.EQUATION_TEXT),i=n.get("value"),o=n.get("selectionStart");for(t&&t.preventDefault(),o=o||0;"\\"===i.charAt(o)&&0<=o;)--o;if(e=/[a-zA-Z\{]/,0!==o&&"{"!=i.charAt(o-1))for(;e.test(i.charAt(o))&&o=i.size()&&(e=0),t=i.item(e),this._setGroupTabFocus(n,t),t.focus()},_setGroupTabFocus:function(t,e){var n=t.generateID();"undefined"!=typeof this._groupFocus[n]&&this._groupFocus[n].setAttribute("tabindex","-1"),(this._groupFocus[n]=e).setAttribute("tabindex",0),t.setAttribute("aria-activedescendant",e.generateID())},_selectLibraryItem:function(t){var e,n,i=t.currentTarget.getAttribute("data-tex");t.preventDefault(),this._setGroupTabFocus(t.currentTarget.get("parentNode"),t.currentTarget)," "!==(n=(e=(t=t.currentTarget.ancestor(".atto_form").one("textarea")).get("value")).substring(0,this._lastCursorPos)).charAt(n.length-1)&&(n+=" "),i=(n+=i).length," "!==e.charAt(this._lastCursorPos)&&(n+=" "),n+=e.substring(this._lastCursorPos,e.length),t.set("value",n),t.focus(),"number"==typeof(e=t.getDOMNode()).selectionStart?e.selectionStart=e.selectionEnd=i:"undefined"!=typeof e.createTextRange&&((n=e.createTextRange()).moveToPoint(i),n.select()),this._updatePreview(!1)},_getLibraryContent:function(){var t=s.Handlebars.compile(u),e=this.get("library"),n="";return s.Handlebars.registerHelper("split",function(t,e,n){var i,o,s;if(void 0===t||void 0===e)return"";for(s="",i=e.trim().split(t);0

                                      {{/if}}
                                      {{{url}}}
                                      {{#if addParagraphs}}


                                      {{/if}}';p.namespace("M.atto_h5p").Button=p.Base.create("button",p.M.editor_atto.EditorPlugin,[],{_currentSelection:null,_form:null,_H5PDiv:null,_allowedmethods:"none",initializer:function(){this._allowedmethods=this.get("allowedmethods"),"none"!==this._allowedmethods&&(this.addButton({icon:"icon",iconComponent:"atto_h5p",callback:this._displayDialogue,tags:".h5p-placeholder",tagMatchRequiresAll:!1}),this.editor.all(".h5p-placeholder").setAttribute("contenteditable","false"),this.editor.delegate("dblclick",this._handleDblClick,".h5p-placeholder",this),this.editor.delegate("click",this._handleClick,".h5p-placeholder",this))},_handleDblClick:function(){this._displayDialogue()},_handleClick:function(t){var e=this.get("host").getSelectionFromNode(t.target);this.get("host").getSelection()!==e&&this.get("host").setSelection(e)},_displayDialogue:function(){this._currentSelection=this.get("host").getSelection(),!1!==this._currentSelection&&(this._getH5PDiv(),this.getDialogue({headerContent:M.util.get_string("pluginname",_),width:"auto",focusAfterHide:!0}).set("bodyContent",this._getDialogueContent()).show(),M.form.shortforms({formid:this.get("host").get("elementid")+"_atto_h5p_form"}))},_getH5PDiv:function(){var t=this.get("host").getSelectedNodes(),e=null;t.each(function(t){t.hasClass("h5p-placeholder")&&(e=t)}),this._H5PDiv=e},_getPermissions:function(){var t={canEmbed:!1,canUpload:!1,canUploadAndEmbed:!1};return this.get("host").canShowFilepicker("h5p")&&("both"===this._allowedmethods?(t.canUploadAndEmbed=!0,t.canUpload=!0):"upload"===this._allowedmethods&&(t.canUpload=!0)),"both"!==this._allowedmethods&&"embed"!==this._allowedmethods||(t.canEmbed=!0),t},_getDialogueContent:function(){var t,e,o,n,i,l,a,s,d,c=this._getPermissions(),r=!0;return this._H5PDiv&&(i=this._H5PDiv.get("innerHTML"),(l=M.cfg.wwwroot+"/draftfile.php")==i.substring(0,l.length)?(t=i.split("?")[0],(a=i.split("?")[1])&&(a.match(/export=1/)&&(r=!(e="checked")),a.match(/embed=1/)&&(r=!(o="checked")),a.match(/copyright=1/)&&(r=!(n="checked")))):t=i),s=p.Handlebars.compile('
                                      {{#if canUploadAndEmbed}}
                                      {{{get_string "instructions" component}}}
                                      {{/if}}
                                      {{#if canUpload}}{{/if}}
                                      {{#if canUpload}}
                                      {{get_string "h5poptions" component}}
                                      {{/if}}
                                      '),d=p.Node.create(s({elementid:this.get("host").get("elementid"),CSS:h,component:_,canUpload:c.canUpload,canEmbed:c.canEmbed,canUploadAndEmbed:c.canUploadAndEmbed,collapseOptions:r,fileURL:t,optionDownloadButton:e,optionEmbedButton:o,optionCopyrightButton:n})),this._form=d,this._setEventListeners(),d},_filepickerCallback:function(t){""!==t.url&&(this._form.one(r.INPUTH5PFILE).set("value",t.url),this._removeWarnings())}, -_setEventListeners:function(){var t=this._form,e=this._getPermissions();t.one(r.INPUTSUBMIT).on("click",this._setH5P,this),e.canUpload&&t.one(r.H5PBROWSER).on("click",function(){this.get("host").showFilepicker("h5p",this._filepickerCallback,this)},this),e.canUploadAndEmbed&&t.one(r.INPUTH5PFILE).on("change",function(){this._removeWarnings()},this)},_removeWarnings:function(){var t=this._form;t.one(r.URLWARNING).setStyle("display","none"),t.one(r.CONTENTWARNING).setStyle("display","none")},_setH5P:function(t){var e,o,n,i,l,a=this._form,s=this.get("host"),d=a.one(r.INPUTH5PFILE).get("value"),c=this._getPermissions();if(t.preventDefault(),!this._updateWarning()){if(s.focus(),o=!0,this._H5PDiv&&(this._H5PDiv.remove(),o=!1),""!==d){if(s.setSelection(this._currentSelection),d.startsWith(M.cfg.wwwroot)){if(n="",c.canUpload)for(l in i={},a.one(r.OPTION_DOWNLOAD_BUTTON).get("checked")&&(i["export"]="1"),a.one(r.OPTION_EMBED_BUTTON).get("checked")&&(i.embed="1"),a.one(r.OPTION_COPYRIGHT_BUTTON).get("checked")&&(i.copyright="1"),i)""===n&&-1===d.indexOf("?")?n+="?":n+="&",n+=l+"="+i[l];e=p.Handlebars.compile(m)({url:d+n,addParagraphs:o})}else e=p.Handlebars.compile(m)({url:d});s.insertContentAtFocusPoint(e),this.markUpdated()}this.getDialogue({focusAfterHide:null}).hide()}},_validEmbed:function(t){return!!new RegExp("^()").test(t)},_validURL:function(t){return!!new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*").test(t)},_updateWarning:function(){var t,e=this._form,o=!0,n=this._getPermissions();return(n.canUpload||n.canEmbed)&&(o=""!==(t=e.one(r.INPUTH5PFILE).get("value"))?(e.one(r.CONTENTWARNING).setStyle("display","none"),t.startsWith(M.cfg.wwwroot)||this._validURL(t)?(e.one(r.URLWARNING).setStyle("display","none"),!1):(e.one(r.URLWARNING).setStyle("display","block"),!0)):(e.one(r.CONTENTWARNING).setStyle("display","block"),!0)),o}},{ATTRS:{allowedmethods:{value:null}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); \ No newline at end of file +YUI.add("moodle-atto_h5p-button",function(c,t){var d={CONTENTWARNING:"att_h5p_contentwarning",H5PBROWSER:"openh5pbrowser",INPUTALT:"atto_h5p_altentry",INPUTH5PFILE:"atto_h5p_file",INPUTSUBMIT:"atto_h5p_urlentrysubmit",OPTION_DOWNLOAD_BUTTON:"atto_h5p_option_download_button",OPTION_COPYRIGHT_BUTTON:"atto_h5p_option_copyright_button",OPTION_EMBED_BUTTON:"atto_h5p_option_embed_button",URLWARNING:"atto_h5p_warning"},r={CONTENTWARNING:"."+d.CONTENTWARNING,H5PBROWSER:"."+d.H5PBROWSER,INPUTH5PFILE:"."+d.INPUTH5PFILE,INPUTSUBMIT:"."+d.INPUTSUBMIT,OPTION_DOWNLOAD_BUTTON:"."+d.OPTION_DOWNLOAD_BUTTON,OPTION_COPYRIGHT_BUTTON:"."+d.OPTION_COPYRIGHT_BUTTON,OPTION_EMBED_BUTTON:"."+d.OPTION_EMBED_BUTTON,URLWARNING:"."+d.URLWARNING},p="atto_h5p",h='{{#if addParagraphs}}


                                      {{/if}}
                                      {{{url}}}
                                      {{#if addParagraphs}}


                                      {{/if}}';c.namespace("M.atto_h5p").Button=c.Base.create("button",c.M.editor_atto.EditorPlugin,[],{_currentSelection:null,_form:null,_H5PDiv:null,_allowedmethods:"none",initializer:function(){this._allowedmethods=this.get("allowedmethods"),"none"!==this._allowedmethods&&(this.addButton({icon:"icon",iconComponent:"atto_h5p",callback:this._displayDialogue,tags:".h5p-placeholder",tagMatchRequiresAll:!1}),this.editor.all(".h5p-placeholder").setAttribute("contenteditable","false"),this.editor.delegate("dblclick",this._handleDblClick,".h5p-placeholder",this),this.editor.delegate("click",this._handleClick,".h5p-placeholder",this))},_handleDblClick:function(){this._displayDialogue()},_handleClick:function(t){t=this.get("host").getSelectionFromNode(t.target);this.get("host").getSelection()!==t&&this.get("host").setSelection(t)},_displayDialogue:function(){this._currentSelection=this.get("host").getSelection(),!1!==this._currentSelection&&(this._getH5PDiv(),this.getDialogue({headerContent:M.util.get_string("pluginname",p),width:"auto",focusAfterHide:!0}).set("bodyContent",this._getDialogueContent()).show(),M.form.shortforms({formid:this.get("host").get("elementid")+"_atto_h5p_form"}))},_getH5PDiv:function(){var t=this.get("host").getSelectedNodes(),e=null;t.each(function(t){t.hasClass("h5p-placeholder")&&(e=t)}),this._H5PDiv=e},_getPermissions:function(){var t={canEmbed:!1,canUpload:!1,canUploadAndEmbed:!1};return this.get("host").canShowFilepicker("h5p")&&("both"===this._allowedmethods?(t.canUploadAndEmbed=!0,t.canUpload=!0):"upload"===this._allowedmethods&&(t.canUpload=!0)),"both"!==this._allowedmethods&&"embed"!==this._allowedmethods||(t.canEmbed=!0),t},_getDialogueContent:function(){var t,e,o,n,i,l,a=this._getPermissions(),s=!0;return this._H5PDiv&&(l=this._H5PDiv.get("innerHTML"),(i=M.cfg.wwwroot+"/draftfile.php")==l.substring(0,i.length)?(t=l.split("?")[0],(i=l.split("?")[1])&&(i.match(/export=1/)&&(s=!(e="checked")),i.match(/embed=1/)&&(s=!(o="checked")),i.match(/copyright=1/)&&(s=!(n="checked")))):t=l),i=c.Handlebars.compile('
                                      {{#if canUploadAndEmbed}}
                                      {{{get_string "instructions" component}}}
                                      {{/if}}
                                      {{#if canUpload}}{{/if}}
                                      {{#if canUpload}}
                                      {{get_string "h5poptions" component}}
                                      {{/if}}
                                      '),l=c.Node.create(i({elementid:this.get("host").get("elementid"),CSS:d,component:p,canUpload:a.canUpload,canEmbed:a.canEmbed,canUploadAndEmbed:a.canUploadAndEmbed,collapseOptions:s,fileURL:t,optionDownloadButton:e,optionEmbedButton:o,optionCopyrightButton:n})),this._form=l,this._setEventListeners(),l},_filepickerCallback:function(t){""!==t.url&&(this._form.one(r.INPUTH5PFILE).set("value",t.url),this._removeWarnings())}, +_setEventListeners:function(){var t=this._form,e=this._getPermissions();t.one(r.INPUTSUBMIT).on("click",this._setH5P,this),e.canUpload&&t.one(r.H5PBROWSER).on("click",function(){this.get("host").showFilepicker("h5p",this._filepickerCallback,this)},this),e.canUploadAndEmbed&&t.one(r.INPUTH5PFILE).on("change",function(){this._removeWarnings()},this)},_removeWarnings:function(){var t=this._form;t.one(r.URLWARNING).setStyle("display","none"),t.one(r.CONTENTWARNING).setStyle("display","none")},_setH5P:function(t){var e,o,n,i,l=this._form,a=this.get("host"),s=l.one(r.INPUTH5PFILE).get("value"),d=this._getPermissions();if(t.preventDefault(),!this._updateWarning()){if(a.focus(),t=!0,this._H5PDiv&&(this._H5PDiv.remove(),t=!1),""!==s){if(a.setSelection(this._currentSelection),s.startsWith(M.cfg.wwwroot)){if(o="",d.canUpload)for(i in n={},l.one(r.OPTION_DOWNLOAD_BUTTON).get("checked")&&(n["export"]="1"),l.one(r.OPTION_EMBED_BUTTON).get("checked")&&(n.embed="1"),l.one(r.OPTION_COPYRIGHT_BUTTON).get("checked")&&(n.copyright="1"),n)""===o&&-1===s.indexOf("?")?o+="?":o+="&",o+=i+"="+n[i];e=c.Handlebars.compile(h)({url:s+o,addParagraphs:t})}else e=c.Handlebars.compile(h)({url:s});a.insertContentAtFocusPoint(e),this.markUpdated()}this.getDialogue({focusAfterHide:null}).hide()}},_validEmbed:function(t){return!!new RegExp("^()").test(t)},_validURL:function(t){return!!new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*").test(t)},_updateWarning:function(){var t=this._form,e=!0,o=this._getPermissions();return e=o.canUpload||o.canEmbed?""!==(o=t.one(r.INPUTH5PFILE).get("value"))?(t.one(r.CONTENTWARNING).setStyle("display","none"),o.startsWith(M.cfg.wwwroot)||this._validURL(o)?(t.one(r.URLWARNING).setStyle("display","none"),!1):(t.one(r.URLWARNING).setStyle("display","block"),!0)):(t.one(r.CONTENTWARNING).setStyle("display","block"),!0):e}},{ATTRS:{allowedmethods:{value:null}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); \ No newline at end of file diff --git a/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-beautify/moodle-atto_html-beautify-min.js b/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-beautify/moodle-atto_html-beautify-min.js index 4b61f7af29b..9e297f279bf 100644 --- a/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-beautify/moodle-atto_html-beautify-min.js +++ b/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-beautify/moodle-atto_html-beautify-min.js @@ -1,10 +1,10 @@ -YUI.add("moodle-atto_html-beautify",function(e,t){var n,i,r,s,_,a,o,l,u,c,h,p,f,d,T={},g=null,m=function(){return T};function E(e){if(i[e])return i[e].exports;var t=i[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,E),t.l=!0,t.exports}function x(e){if(a[e])return a[e].exports;var t=a[e]={i:e,l:!1,exports:{}};return _[e].call(t.exports,t,t.exports,x),t.l=!0,t.exports}function b(e){if(p[e])return p[e].exports;var t=p[e]={i:e,l:!1,exports:{}};return h[e].call(t.exports,t,t.exports,b),t.l=!0,t.exports}m(),e.namespace("M.atto_html").beautify=T,i={},E.m=n=[function(e,t){var n="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",i="̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ؚؠ-ىٲ-ۓۧ-ۨۻ-ۼܰ-݊ࠀ-ࠔࠛ-ࠣࠥ-ࠧࠩ-࠭ࡀ-ࡗࣤ-ࣾऀ-ःऺ-़ा-ॏ॑-ॗॢ-ॣ०-९ঁ-ঃ়া-ৄেৈৗয়-ৠਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୟ-ୠ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఁ-ఃె-ైొ-్ౕౖౢ-ౣ౦-౯ಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢ-ೣ೦-೯ംഃെ-ൈൗൢ-ൣ൦-൯ංඃ්ා-ුූෘ-ෟෲෳิ-ฺเ-ๅ๐-๙ິ-ູ່-ໍ໐-໙༘༙༠-༩༹༵༷ཁ-ཇཱ-྄྆-྇ྍ-ྗྙ-ྼ࿆က-ဩ၀-၉ၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟ᜎ-ᜐᜠ-ᜰᝀ-ᝐᝲᝳក-ឲ៝០-៩᠋-᠍᠐-᠙ᤠ-ᤫᤰ-᤻ᥑ-ᥭᦰ-ᧀᧈ-ᧉ᧐-᧙ᨀ-ᨕᨠ-ᩓ᩠-᩿᩼-᪉᪐-᪙ᭆ-ᭋ᭐-᭙᭫-᭳᮰-᮹᯦-᯳ᰀ-ᰢ᱀-᱉ᱛ-ᱽ᳐-᳒ᴀ-ᶾḁ-ἕ‌‍‿⁀⁔⃐-⃥⃜⃡-⃰ⶁ-ⶖⷠ-ⷿ〡-〨゙゚Ꙁ-ꙭꙴ-꙽ꚟ꛰-꛱ꟸ-ꠀ꠆ꠋꠣ-ꠧꢀ-ꢁꢴ-꣄꣐-꣙ꣳ-ꣷ꤀-꤉ꤦ-꤭ꤰ-ꥅꦀ-ꦃ꦳-꧀ꨀ-ꨧꩀ-ꩁꩌ-ꩍ꩐-꩙ꩻꫠ-ꫩꫲ-ꫳꯀ-ꯡ꯬꯭꯰-꯹ﬠ-ﬨ︀-️︠-︦︳︴﹍-﹏0-9_",r=new RegExp("["+n+"]"),s=new RegExp("["+n+i+"]");t.newline=/[\n\r\u2028\u2029]/,t.lineBreak=new RegExp("\r\n|"+t.newline.source),t.allLineBreaks=new RegExp(t.lineBreak.source,"g"),t.isIdentifierStart=function(e){return e<65?36===e||64===e:e<91||(e<97?95===e:e<123||170<=e&&r.test(String.fromCharCode(e)))},t.isIdentifierChar=function(e){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||170<=e&&s.test(String.fromCharCode(e))))}},function(e,t,n){var q,J,ee,te,ne=n(3).mergeOpts,ie=n(0),re=n(4).Output,se=n(7).Tokenizer;function _e(e,t){if(!t.multiline_frame&&t.mode!==te.ForInitializer&&t.mode!==te.Conditional){var n=t.start_line_index;e.remove_indent(n)}}function ae(e,t){for(var n=0;n"!==p.last_text)&&(ae(h,["TK_EQUALS","TK_START_EXPR","TK_COMMA","TK_OPERATOR"])||"TK_RESERVED"===h&&ae(p.last_text,["return","throw","import","default"]))?v(te.ObjectLiteral):v(te.BlockStatement);n=!e.comments_before.length&&"}"===e.text&&"function"===p.last_word&&"TK_END_EXPR"===h;if(f.brace_preserve_inline){i=0,r=null,p.inline_frame=!0;do{if((r=I(i+=1)).wanted_newline){p.inline_frame=!1;break}}while("TK_EOF"!==r.type&&("TK_END_BLOCK"!==r.type||r.opened!==c))}("expand"===f.brace_style||"none"===f.brace_style&&c.wanted_newline)&&!p.inline_frame?"TK_OPERATOR"!==h&&(n||"TK_EQUALS"===h||"TK_RESERVED"===h&&L(p.last_text)&&"else"!==p.last_text)?u.space_before_token=!0:R(!1,!0):(!S(_.mode -)||"TK_START_EXPR"!==h&&"TK_COMMA"!==h||("TK_COMMA"!==h&&!f.space_in_paren||(u.space_before_token=!0),("TK_COMMA"===h||"TK_START_EXPR"===h&&p.inline_frame)&&(k(),_.multiline_frame=_.multiline_frame||p.multiline_frame,p.multiline_frame=!1)),"TK_OPERATOR"!==h&&"TK_START_EXPR"!==h&&("TK_START_BLOCK"!==h||p.inline_frame?u.space_before_token=!0:R()));y(),O()},TK_END_BLOCK:function V(){w(c);for(;p.mode===te.Statement;)C();var e="TK_START_BLOCK"===h;p.inline_frame&&!e?u.space_before_token=!0:"expand"===f.brace_style?e||R():e||(S(p.mode)&&f.keep_array_indentation?(f.keep_array_indentation=!1,R(),f.keep_array_indentation=!0):R());C(),y()},TK_WORD:j,TK_RESERVED:j,TK_SEMICOLON:function U(){D()?u.space_before_token=!1:w(c);var e=I(1);for(;!(p.mode!==te.Statement||p.if_block&&e&&"TK_RESERVED"===e.type&&"else"===e.text||p.do_block);)C();p.import_block&&(p.import_block=!1);y()},TK_STRING:function z(){D()?u.space_before_token=!0:(w(c),"TK_RESERVED"===h||"TK_WORD"===h||p.inline_frame?u.space_before_token=!0:"TK_COMMA"===h||"TK_START_EXPR"===h||"TK_EQUALS"===h||"TK_OPERATOR"===h?N()||k():R());y()},TK_EQUALS:function W(){D()||w(c);p.declaration_statement&&(p.declaration_assignment=!0);u.space_before_token=!0,y(),u.space_before_token=!0},TK_OPERATOR:function G(){var e,t,n,i,r,s,_,a="*"===c.text&&("TK_RESERVED"===h&&ae(p.last_text,["function","yield"])||ae(h,["TK_START_BLOCK","TK_COMMA","TK_END_BLOCK","TK_SEMICOLON"])),o=ae(c.text,["-","+"])&&(ae(h,["TK_START_BLOCK","TK_START_EXPR","TK_EQUALS","TK_OPERATOR"])||ae(p.last_text,l.line_starters)||","===p.last_text);D()||w(c,!a);if("TK_RESERVED"===h&&L(p.last_text))return u.space_before_token=!0,void y();if("*"===c.text&&"TK_DOT"===h)return void y();if("::"===c.text)return void y();"TK_OPERATOR"===h&&ae(f.operator_position,ee)&&k();if(":"===c.text&&p.in_case)return p.case_body=!0,O(),y(),R(),void(p.in_case=!1);e=!0,t=!0,n=!1;":"===c.text?0===p.ternary_depth?e=!1:(--p.ternary_depth,n=!0):"?"===c.text&&(p.ternary_depth+=1);if(!o&&!a&&f.preserve_newlines&&ae(c.text,l.positionable_operators))switch(i=":"===c.text,r=i&&n,s=i&&!n,f.operator_position){case J.before_newline:return u.space_before_token=!s,y(),i&&!r||k(),void(u.space_before_token=!0);case J.after_newline:return u.space_before_token=!0,!i||r?I(1).wanted_newline?R(!1,!0):k():u.space_before_token=!1,y(),void(u.space_before_token=!0);case J.preserve_newline:return s||k(),e=!(u.just_added_newline()||s),u.space_before_token=e,y(),void(u.space_before_token=!0)}a?(k(),e=!1,_=I(1),t=_&&ae(_.type,["TK_WORD","TK_RESERVED"])):"..."===c.text?(k(),e="TK_START_BLOCK"===h,t=!1):(ae(c.text,["--","++","!","~"])||o)&&(t=e=!1,!c.wanted_newline||"--"!==c.text&&"++"!==c.text||R(!1,!0),";"===p.last_text&&A(p.mode)&&(e=!0),"TK_RESERVED"===h?e=!0:"TK_END_EXPR"===h?e=!("]"===p.last_text&&("--"===c.text||"++"===c.text)):"TK_OPERATOR"===h&&(e=ae(c.text,["--","-","++","+"])&&ae(p.last_text,["--","-","++","+"]),ae(c.text,["+","-"])&&ae(p.last_text,["--","++"])&&(t=!0)),(p.mode!==te.BlockStatement||p.inline_frame)&&p.mode!==te.Statement||"{"!==p.last_text&&";"!==p.last_text||R());u.space_before_token=u.space_before_token||e,y(),u.space_before_token=t},TK_COMMA:function X(){w(c,!0),y(),u.space_before_token=!0,p.declaration_statement?(A(p.parent.mode)&&(p.declaration_assignment=!1),p.declaration_assignment?R(p.declaration_assignment=!1,!0):f.comma_first&&k()):p.mode===te.ObjectLiteral||p.mode===te.Statement&&p.parent.mode===te.ObjectLiteral?(p.mode===te.Statement&&C(),p.inline_frame||R()):f.comma_first&&k()},TK_BLOCK_COMMENT:function F(e){if(u.raw)return u.add_raw_token(c),void(c.directives&&"end"===c.directives.preserve&&(u.raw=f.test_output_raw));if(c.directives)return R(!1,e),y(),"start"===c.directives.preserve&&(u.raw=!0),void R(!1,!0);if(!ie.newline.test(c.text)&&!c.wanted_newline)return u.space_before_token=!0,y(),void(u.space_before_token=!0);var t,n=function a(e){e=e.replace(ie.allLineBreaks,"\n");var t=[],n=e.indexOf("\n");for(;-1!==n;)t.push(e.substring(0,n)),e=e.substring(n+1),n=e.indexOf("\n");e.length&&t.push(e);return t}(c.text),i=!1,r=!1,s=c.whitespace_before,_=s.length;R(!1,e),1_?y(n[t].substring(_)):u.add_token(n[t]);R(!1,e)},TK_COMMENT:function $(e){c.wanted_newline?R(!1,e):u.trim(!0);u.space_before_token=!0,y(),R(!1,e)},TK_DOT:function Q(){D()||w(c,!0);"TK_RESERVED"===h&&L(p.last_text)?u.space_before_token=!0:k(")"===p.last_text&&f.break_chained_methods);y()},TK_UNKNOWN:function Y(e){y(),"\n"===c.text[c.text.length-1]&&R(!1,e)},TK_EOF:function Z(){for(;p.mode===te.Statement;)C();w(c)}};function b(e,t){var n=0;return e&&(n=e.indentation_level,!u.just_added_newline()&&e.line_indent_level>n&&(n=e.line_indent_level)),{mode:t,parent:e,last_text:e?e.last_text:"",last_word:e?e.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:n,line_indent_level:e?e.line_indent_level:n,start_line_index:u.get_line_number(),ternary_depth:0}}for(t=ne(t=t||{},"js"),f={},"expand-strict"===t.brace_style?t.brace_style="expand":"collapse-preserve-inline"===t.brace_style?t.brace_style="collapse,preserve-inline":t.braces_on_own_line!==undefined?t.brace_style=t.braces_on_own_line?"expand":"collapse":t.brace_style||(t.brace_style="collapse"),o=t.brace_style.split(/[^a-zA-Z0-9_\-]+/),f.brace_preserve_inline=!1,f.brace_style="collapse",d=0;df.max_preserve_newlines&&(s=f.max_preserve_newlines),f.preserve_newlines&&1=f.wrap_line_length&&R(!1,!0)}}function R(e,t){if(!t&&";"!==p.last_text&&","!==p.last_text&&"="!==p.last_text&&"TK_OPERATOR"!==h)for(var n=I(1);!(p.mode!==te.Statement||p.if_block&&n&&"TK_RESERVED"===n.type&&"else"===n.text||p.do_block);)C();u.add_new_line(e)&&(p.multiline_frame=!0)}function K(){u.just_added_newline()&&(f.keep_array_indentation&&S(p.mode)&&c.wanted_newline?(u.current_line.push(c.whitespace_before),u.space_before_token=!1):u.set_indent(p.indentation_level)&&(p.line_indent_level=p.indentation_level))}function y(e){if(u.raw)u.add_raw_token(c);else{if(f.comma_first&&"TK_COMMA"===h&&u.just_added_newline()&&","===u.previous_line.last()){var t=u.previous_line.pop();u.previous_line.is_empty()&&(u.previous_line.push(t),u.trim(!0),u.current_line.pop(),u.trim()),K(),u.add_token(","),u.space_before_token=!0}e=e||c.text,K(),u.add_token(e)}}function O(){p.indentation_level+=1}function v(e){_=p?(r.push(p),p):b(null,e),p=b(_,e)}function S(e){return e===te.ArrayLiteral}function A(e){return ae(e,[te.Expression,te.ForInitializer,te.Conditional])}function C(){0=m.length?null:m[t]}function j(){if("TK_RESERVED"===c.type&&(ae(c.text,["set","get"])&&p.mode!==te.ObjectLiteral||ae(c.text,["as","from"])&&!p.import_block||p.mode===te.ObjectLiteral&&":"===I(1).text)&&(c.type="TK_WORD"),D()?"TK_RESERVED"===h&&ae(p.last_text,["var","let","const"])&&"TK_WORD"===c.type&&(p.declaration_statement=!0):!c.wanted_newline||A(p.mode)||"TK_OPERATOR"===h&&"--"!==p.last_text&&"++"!==p.last_text||"TK_EQUALS"===h||!f.preserve_newlines&&"TK_RESERVED"===h&&ae(p.last_text,["var","let","const","set","get"])?w(c):(w(c),R()),p.do_block&&!p.do_while){if("TK_RESERVED"===c.type&&"while"===c.text)return u.space_before_token=!0,y(),u.space_before_token=!0,void(p.do_while=!0);R(),p.do_block=!1}if(p.if_block)if(p.else_block||"TK_RESERVED"!==c.type||"else"!==c.text){for(;p.mode===te.Statement;)C();p.if_block=!1,p.else_block=!1}else p.else_block=!0;return"TK_RESERVED"===c.type&&("case"===c.text||"default"===c.text&&p.in_case_statement)?(R(),(p.case_body||f.jslint_happy)&&(function e(){0p.parent.indentation_level)&&--p.indentation_level}(),p.case_body=!1),y(),p.in_case=!0,void(p.in_case_statement=!0)):("TK_COMMA"!==h&&"TK_START_EXPR"!==h&&"TK_EQUALS"!==h&&"TK_OPERATOR"!==h||N()||k(),"TK_RESERVED"===c.type&&"function"===c.text?((ae(p.last_text,["}",";"])||u.just_added_newline()&&!ae(p.last_text,["(","[","{",":","=",","])&&"TK_OPERATOR"!==h)&&(u.just_added_blankline()||c.comments_before.length||(R(),R(!0))),"TK_RESERVED"===h||"TK_WORD"===h?"TK_RESERVED"===h&&(ae(p.last_text,["get","set","new","export","async"])||ae(p.last_text,g))||"TK_RESERVED"===h&&"default"===p.last_text&&"export"===s?u.space_before_token=!0:R():"TK_OPERATOR"===h||"="===p.last_text?u.space_before_token=!0:!p.multiline_frame&&(A(p.mode)||S(p.mode))||R(),y(),void(p.last_word=c.text)):(a="NONE","TK_END_BLOCK"===h?_.inline_frame?a="SPACE":"TK_RESERVED"!==c.type||!ae(c.text,["else","catch","finally","from"])||"expand"===f.brace_style||"end-expand"===f.brace_style||"none"===f.brace_style&&c.wanted_newline?a="NEWLINE":(a="SPACE",u.space_before_token=!0):"TK_SEMICOLON"===h&&p.mode===te.BlockStatement?a="NEWLINE":"TK_SEMICOLON"===h&&A(p.mode)?a="SPACE":"TK_STRING"===h?a="NEWLINE":"TK_RESERVED"===h||"TK_WORD"===h||"*"===p.last_text&&(ae(s,["function","yield"])||p.mode===te.ObjectLiteral&&ae(s,["{",","]))?a="SPACE":"TK_START_BLOCK"===h?a=p.inline_frame?"SPACE":"NEWLINE":"TK_END_EXPR"===h&&(u.space_before_token=!0,a="NEWLINE"),"TK_RESERVED"===c.type&&ae(c.text,l.line_starters)&&")"!==p.last_text&&(a=p.inline_frame||"else"===p.last_text||"export"===p.last_text?"SPACE":"NEWLINE"),"TK_RESERVED"===c.type&&ae(c.text,["else","catch","finally"])?("TK_END_BLOCK"!==h||_.mode!==te.BlockStatement||"expand"===f.brace_style||"end-expand"===f.brace_style||"none"===f.brace_style&&c.wanted_newline)&&!p.inline_frame?R():(u.trim(!0),"}"!==u.current_line.last()&&R(),u.space_before_token=!0):"NEWLINE"===a?"TK_RESERVED"===h&&L(p.last_text)?u.space_before_token=!0:"TK_END_EXPR"!==h?"TK_START_EXPR"===h&&"TK_RESERVED"===c.type&&ae(c.text,["var","let","const"])||":"===p.last_text||("TK_RESERVED"===c.type&&"if"===c.text&&"else"===p.last_text?u.space_before_token=!0:R()):"TK_RESERVED"===c.type&&ae(c.text,l.line_starters)&&")"!==p.last_text&&R():p.multiline_frame&&S(p.mode)&&","===p.last_text&&"}"===s?R():"SPACE"===a&&(u.space_before_token=!0),y(),p.last_word=c.text,void("TK_RESERVED"===c.type&&("do"===c.text?p.do_block=!0:"if"===c.text?p.if_block=!0:"import"===c.text?p.import_block=!0:p.import_block&&"TK_RESERVED"===c.type&&"from"===c.text&&(p.import_block=!1)))))}h="TK_START_BLOCK",s="",(u=new re(i,E)).raw=f.test_output_raw,r=[],v(te.BlockStatement),this.beautify=function(){for(l=new se(e,f,i),m=l.tokenize(),n=0,c=I();c;)x[c.type](),s=p.last_text,h=c.type,p.last_text=c.text,n+=1,c=I();return u.get_code(f.end_with_newline,f.eol)},g=["break","continue","return","throw","yield"]}},function(e,t){e.exports.InputScanner=function s(e){var n=e,i=n.length,r=0;this.back=function(){--r},this.hasNext=function(){return r=this.indent_cache.length;)this.indent_cache.push(this.indent_cache[this.indent_cache.length-1]+this.indent_string);return this.current_line.set_indent(e),!0}return this.current_line.set_indent(0),!1},this.add_raw_token=function(e){for(var t=0;t/g,"`"===e||"'"===e||'"'===e||("/"===e||v.e4x&&"<"===e&&U.test(o,-1))&&("TK_RESERVED"===t.type&&Z(t.text,["return","case","throw","else","do","typeof","yield"])||"TK_END_EXPR"===t.type&&")"===t.text&&t.parent&&"TK_RESERVED"===t.parent.type&&Z(t.parent.text,["if","while","for"])||Z(t.type,["TK_COMMENT","TK_START_EXPR","TK_START_BLOCK","TK_END_BLOCK","TK_OPERATOR","TK_EQUALS","TK_EOF","TK_SEMICOLON","TK_COMMA"]))){if(c=u=!1,r=l=e,"/"===l)for(h=!1;U.hasNext()&&(u||h||U.peek()!==l)&&!U.testChar(Y.newline);)r+=U.peek(),u?u=!1:(u="\\"===U.peek(),"["===U.peek()?h=!0:"]"===U.peek()&&(h=!1)),U.next();else if(v.e4x&&"<"===l){if(p=/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\])(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/g,U.back(),f="",d=U.match(o)){for(g=0===(T=d[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}")).indexOf("{"),m=0;d&&(E=!!d[1],x=d[2],!(!!d[d.length-1]||"![CDATA["===x.slice(0,8))&&(x===T||g&&x.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(E?--m:++m),f+=d[0],!(m<=0));)d=U.match(p);return d||(f+=U.match(/[\s\S]*/g)[0]),[f=f.replace(Y.allLineBreaks,"\n"),"TK_STRING"]}}else b=function(e,t,n){for(var i;U.hasNext()&&(i=U.peek(),u||i!==e&&(t||!Y.newline.test(i)));)(u||t)&&Y.newline.test(i)?("\r"===i&&"\n"===U.peek(1)&&(U.next(),i=U.peek()),r+="\n"):r+=i,u=u?("x"!==i&&"u"!==i||(c=!0),!1):"\\"===i,U.next(),n&&-1!==r.indexOf(n,r.length-n.length)&&("`"===e?b("}",t,"`"):b("`",t,"${"),U.hasNext()&&(r+=U.next()))},"`"===l?b("`",!0,"${"):b(l);if(c&&v.unescape_strings&&(r=function y(e){var t="",n=0,i=new $(e),r=null;for(;i.hasNext();)if((r=i.match(/([\s]|[^\\]|\\\\)+/g))&&(t+=r[0]),"\\"===i.peek()){if(i.next(),"x"===i.peek())r=i.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==i.peek()){t+="\\",i.hasNext()&&(t+=i.next());continue}r=i.match(/u([0-9A-Fa-f]{4})/g)}if(!r)return e;if(126<(n=parseInt(r[1],16))&&n<=255&&0===r[0].indexOf("x"))return e;if(0<=n&&n<32){t+="\\"+r[0];continue}t+=34===n||39===n||92===n?"\\"+String.fromCharCode(n):String.fromCharCode(n)}return t}(r)),U.peek()===l&&(r+=l,U.next(),"/"===l))for(;U.hasNext()&&Y.isIdentifierStart(U.peekCharCode());)r+=U.next();return[r,"TK_STRING"]}if("#"===e){if(0===V.length&&"!"===U.peek()){for(r=e;U.hasNext()&&"\n"!==e;)e=U.next(),r+=e;return[function O(e){return e.replace(/^\s+|\s+$/g,"")}(r)+"\n","TK_UNKNOWN"]}if(w="#",U.hasNext()&&U.testChar(W)){for(;w+=e=U.next(),U.hasNext()&&"#"!==e&&"="!==e;);return"#"===e||("["===U.peek()&&"]"===U.peek(1)?(w+="[]",U.next(),U.next()):"{"===U.peek()&&"}"===U.peek(1)&&(w+="{}",U.next(),U.next())),[w,"TK_WORD"]}}if("<"===e&&("?"===U.peek()||"%"===U.peek())&&(U.back(),k=U.match(j)))return[e=(e=k[0]).replace(Y.allLineBreaks,"\n"),"TK_STRING"];if("<"===e&&U.match(/\!--/g)){for(e="\x3c!--";U.hasNext()&&!U.testChar(Y.newline);)e+=U.next();return M=!0,[e,"TK_COMMENT"]}if("-"===e&&M&&U.match(/->/g))return M=!1,["--\x3e","TK_COMMENT"];if("."===e)return"."===U.peek()&&"."===U.peek(1)?[e+=U.next()+U.next(),"TK_OPERATOR"]:[e,"TK_DOT"];if(Z(e,S)){for(;U.hasNext()&&Z(e+U.peek(),S)&&(e+=U.next(),U.hasNext()););return","===e?[e,"TK_COMMA"]:"="===e?[e,"TK_EQUALS"]:[e,"TK_OPERATOR"]}return[e,"TK_UNKNOWN"]}this.positionable_operators="!= !== % & && * ** + - / : < << <= == === > >= >> >>> ? ^ | ||".split(" "),S=this.positionable_operators.concat("! %= &= *= **= ++ += , -- -= /= :: <<= = => >>= >>>= ^= |= ~ ...".split(" ")), -this.line_starters="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),A=this.line_starters.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as"]),C=/([\s\S]*?)((?:\*\/)|$)/g,N=/([^\n\r\u2028\u2029]*)/g,D=/\/\* beautify( \w+[:]\w+)+ \*\//g,L=/ (\w+)[:](\w+)/g,I=/([\s\S]*?)((?:\/\*\sbeautify\signore:end\s\*\/)|$)/g,j=/((<\?php|<\?=)[\s\S]*?\?>)|(<%[\s\S]*?%>)/g,this.tokenize=function(){var e,t,n,i,r,s;for(U=new $(_),M=!1,V=[],i=null,r=[],s=[];!t||"TK_EOF"!==t.type;){for(n=a(),e=new Q(n[1],n[0],B,P);"TK_COMMENT"===e.type||"TK_BLOCK_COMMENT"===e.type||"TK_UNKNOWN"===e.type;)"TK_BLOCK_COMMENT"===e.type&&(e.directives=n[2]),s.push(e),n=a(),e=new Q(n[1],n[0],B,P);s.length&&(e.comments_before=s,s=[]),"TK_START_BLOCK"===e.type||"TK_START_EXPR"===e.type?(e.parent=t,r.push(i),i=e):("TK_END_BLOCK"===e.type||"TK_END_EXPR"===e.type)&&i&&("]"===e.text&&"["===i.text||")"===e.text&&"("===i.text||"}"===e.text&&"{"===i.text)&&(e.parent=i.parent,e.opened=i,i=r.pop()),V.push(e),t=e}return V}}}],E.c=i,E.i=function(e){return e},E.d=function(e,t,n){E.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},E.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return E.d(t,"a",t),t},E.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},E.p="",r=E(E.s=6),s=r,"function"==typeof g&&g.amd?g([],function(){return{js_beautify:s}}):void 0!==T?T.js_beautify=s:"undefined"!=typeof window?window.js_beautify=s:"undefined"!=typeof global&&(global.js_beautify=s),a={},x.m=_=[function(e,t,n){var _=n(2).mergeOpts,i=n(1),B=n(3).Output,a=i.lineBreak,o=i.allLineBreaks;e.exports.Beautifier=function l(i,e){var h,t,n,r,p,f,d,T,g,m,E,x,b,w,s,k,R,K,y;function O(){return(x=i.charAt(++E))||""}function v(e){var t="",n=E;return e&&A(),t=i.charAt(E+1)||"",E=n-1,O(),t}function S(e){for(var t=E;O();)if("\\"===x)O();else{if(-1!==e.indexOf(x))break;if("\n"===x)break}return i.substring(t,E+1)}function A(e){for(var t=0;m.test(v());)O(),"\n"===x&&e&&r&&(y.add_new_line(!0),t++);return h=t}function C(){var e="";for(x&&m.test(x)&&(e=x);m.test(O());)e+=x;return e}function N(){var e=E,t="/"===v();for(O();O();){if(!t&&"*"===x&&"/"===v()){O();break}if(t&&"\n"===x)return i.substring(e,E)}return i.substring(e,E)+x}function D(e){return i.substring(E-e.length,E).toLowerCase()===e}function L(){var e,t,n=0;for(e=E+1;e"===x||"+"===x||"~"===x)&&!t&&b<1?T?(y.space_before_token=!0,I(x),y.space_before_token=!0):(I(x),A(),x&&m.test(x)&&(x="")):"]"===x?I(x):"["===x?(j(_),I(x)):"="===x?(A(),I("="),m.test(x)&&(x="")):("!"===x?I(" "):j(_),I(x));return y.get_code(f,g)},this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0}}},function(e,t){ -var n="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",i="̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ؚؠ-ىٲ-ۓۧ-ۨۻ-ۼܰ-݊ࠀ-ࠔࠛ-ࠣࠥ-ࠧࠩ-࠭ࡀ-ࡗࣤ-ࣾऀ-ःऺ-़ा-ॏ॑-ॗॢ-ॣ०-९ঁ-ঃ়া-ৄেৈৗয়-ৠਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୟ-ୠ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఁ-ఃె-ైొ-్ౕౖౢ-ౣ౦-౯ಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢ-ೣ೦-೯ംഃെ-ൈൗൢ-ൣ൦-൯ංඃ්ා-ුූෘ-ෟෲෳิ-ฺเ-ๅ๐-๙ິ-ູ່-ໍ໐-໙༘༙༠-༩༹༵༷ཁ-ཇཱ-྄྆-྇ྍ-ྗྙ-ྼ࿆က-ဩ၀-၉ၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟ᜎ-ᜐᜠ-ᜰᝀ-ᝐᝲᝳក-ឲ៝០-៩᠋-᠍᠐-᠙ᤠ-ᤫᤰ-᤻ᥑ-ᥭᦰ-ᧀᧈ-ᧉ᧐-᧙ᨀ-ᨕᨠ-ᩓ᩠-᩿᩼-᪉᪐-᪙ᭆ-ᭋ᭐-᭙᭫-᭳᮰-᮹᯦-᯳ᰀ-ᰢ᱀-᱉ᱛ-ᱽ᳐-᳒ᴀ-ᶾḁ-ἕ‌‍‿⁀⁔⃐-⃥⃜⃡-⃰ⶁ-ⶖⷠ-ⷿ〡-〨゙゚Ꙁ-ꙭꙴ-꙽ꚟ꛰-꛱ꟸ-ꠀ꠆ꠋꠣ-ꠧꢀ-ꢁꢴ-꣄꣐-꣙ꣳ-ꣷ꤀-꤉ꤦ-꤭ꤰ-ꥅꦀ-ꦃ꦳-꧀ꨀ-ꨧꩀ-ꩁꩌ-ꩍ꩐-꩙ꩻꫠ-ꫩꫲ-ꫳꯀ-ꯡ꯬꯭꯰-꯹ﬠ-ﬨ︀-️︠-︦︳︴﹍-﹏0-9_",r=new RegExp("["+n+"]"),s=new RegExp("["+n+i+"]");t.newline=/[\n\r\u2028\u2029]/,t.lineBreak=new RegExp("\r\n|"+t.newline.source),t.allLineBreaks=new RegExp(t.lineBreak.source,"g"),t.isIdentifierStart=function(e){return e<65?36===e||64===e:e<91||(e<97?95===e:e<123||170<=e&&r.test(String.fromCharCode(e)))},t.isIdentifierChar=function(e){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||170<=e&&s.test(String.fromCharCode(e))))}},function(e,t){e.exports.mergeOpts=function r(e,t){var n,i={};for(n in e)n!==t&&(i[n]=e[n]);if(t in e)for(n in e[t])i[n]=e[t][n];return i}},function(e,t){function r(t){var n=0,i=-1,r=[],s=!0;this.set_indent=function(e){n=t.baseIndentLength+e*t.indent_length,i=e},this.get_character_count=function(){return n},this.is_empty=function(){return s},this.last=function(){return this._empty?null:r[r.length-1]},this.push=function(e){r.push(e),n+=e.length,s=!1},this.pop=function(){var e=null;return s||(e=r.pop(),n-=e.length,s=0===r.length),e},this.remove_indent=function(){0=this.indent_cache.length;)this.indent_cache.push(this.indent_cache[this.indent_cache.length-1]+this.indent_string);return this.current_line.set_indent(e),!0}return this.current_line.set_indent(0),!1},this.add_raw_token=function(e){for(var t=0;t=this.wrap_line_length?(this.print_newline(!1,e),this.print_indentation(e),!0):(this.line_char_count++,e.push(" "),!1)},this.get_content=function(){for(var e,t="",n=[],i=0;"<"!==this.input.charAt(this.pos)||2===i;){if(this.pos>=this.input.length)return n.length?n.join(""):["","TK_EOF"];if(i<2&&this.traverse_whitespace())this.space_or_wrap(n);else{if(t=this.input.charAt(this.pos),y){if("{"===t?i+=1:i<2&&(i=0),"}"===t&&0","igm")).lastIndex=this.pos,r=(i=n.exec(this.input))?i.index:this.input.length,this.pos=this.input.length)return e&&(this.pos=E,this.line_char_count=x),f.length?f.join(""):["","TK_EOF"];if(p=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(p,this.Utils.whitespace))T=!0;else{if("'"!==p&&'"'!==p||(p+=this.get_unformatted(p),T=!0),"="===p&&(T=!1),i=this.input.substr(this.pos-1),!S||!m||b||">"!==p&&"/"!==p||i.match(/^\/?\s*>/)&&(b=!(T=!1),this.print_newline(!1,f),this.print_indentation(f)),f.length&&"="!==f[f.length-1]&&">"!==p&&T){if(r=this.space_or_wrap(f)&&"/"!==p&&!v,T=!1,v&&"/"!==p&&(s=!1,S&&g&&(s=!(null!==i.match(/^\S*(="([^"]|\\")*")?\s*\/?\s*>/))),g&&!s||(this.print_newline(!1,f),this.print_indentation(f),r=!0)),r)for(m=!0,_=O,A&&(_=f.indexOf(" ")+1),a=0;a<_;a++)f.push(" ");if(g)for(o=0;o"!==p);return u=-1!==(l=f.join("")).indexOf(" ")?l.indexOf(" "):-1!==l.indexOf("\n")?l.indexOf("\n"):"{"===l.charAt(0)?l.indexOf("}"):l.indexOf(">"),c="<"!==l.charAt(0)&&y?"#"===l.charAt(2)?3:2:1,h=l.substring(c,u).toLowerCase(),"/"===l.charAt(l.length-2)||this.Utils.in_array(h,this.Utils.single_token)?e||(this.tag_type="SINGLE"):y&&"{"===l.charAt(0)&&"else"===h?e||(this.indent_to_tag("if"),this.tag_type="HANDLEBARS_ELSE",this.indent_content=!0,this.traverse_whitespace()):this.is_unformatted(h,R)||this.is_unformatted(h,K)?(d=this.get_unformatted("",l),f.push(d),this.pos,this.tag_type="SINGLE"):"script"===h&&(-1===l.search("type")||-1",r=!0):0===n.indexOf("",r=!0):0===n.indexOf("",r=!0):0===n.indexOf("\x3c!--")?(i="--\x3e",r=!0):0===n.indexOf("{{!--")?(i="--}}",r=!0):0===n.indexOf("{{!")?5===n.length&&-1===n.indexOf("{{!--")&&(i="}}",r=!0):0===n.indexOf("",r=!0):0===n.indexOf("<%")&&(i="%>",r=!0)),t=this.input.charAt(this.pos),this.pos++;return n},this.get_unformatted=function(e -,t){var n,i,r,s;if(t&&-1!==t.toLowerCase().indexOf(e))return"";r=!(i=n=""),s=function _(n){var i="",e=function(e){var t=i+e.toLowerCase();i=t.length<=n.length?t:t.substr(t.length-n.length,n.length)},t=function(){return-1===i.indexOf(n)};return{add:e,doesNotMatch:t}}(e);do{if(this.pos>=this.input.length)return i;if(n=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(n,this.Utils.whitespace)){if(!r){this.line_char_count--;continue}if("\n"===n||"\r"===n){i+="\n",this.line_char_count=0;continue}}i+=n,s.add(n),this.line_char_count++,r=!0,y&&"{"===n&&i.length&&"{"===i.charAt(i.length-2)&&(i+=this.get_unformatted("}}"))}while(s.doesNotMatch());return i},this.get_token=function(){var e,t;return"TK_TAG_SCRIPT"===this.last_token||"TK_TAG_STYLE"===this.last_token?(t=this.last_token.substr(7),"string"!=typeof(e=this.get_contents_to(t))?e:[e,"TK_"+t]):"CONTENT"===this.current_mode?"string"!=typeof(e=this.get_content())?e:[e,"TK_CONTENT"]:"TAG"===this.current_mode?"string"!=typeof(e=this.get_tag())?e:[e,"TK_TAG_"+this.tag_type]:void 0},this.get_full_indent=function(e){return(e=this.indent_level+e||0)<1?"":Array(e+1).join(this.indent_string)},this.is_unformatted=function(e,t){var n;return!!this.Utils.in_array(e,t)&&("a"!==e.toLowerCase()||!this.Utils.in_array("a",t)||!((n=(this.get_tag(!0)||"").match(/^\s*<\s*\/?([a-z]*)\s*[^>]*>\s*$/))&&!this.Utils.in_array(n[1],t)))},this.printer=function(e,t,n,i,r){this.input=e||"",this.input=this.input.replace(/\r\n|[\r\u2028\u2029]/g,"\n"),this.output=[],this.indent_character=t,this.indent_string="",this.indent_size=n,this.brace_style=r,this.indent_level=0,this.wrap_line_length=i;for(var s=this.line_char_count=0;s/)||!E.indent_head_inner_html&&E.token_text.match(//)||E.indent(),E.indent_content=!1),E.current_mode="CONTENT";break;case"TK_TAG_STYLE":case"TK_TAG_SCRIPT":E.print_newline(!1,E.output),E.print_token(E.token_text),E.current_mode="CONTENT";break;case"TK_TAG_END":"TK_CONTENT"===E.last_token&&""===E.last_text&&(t=(E.token_text.match(/\w+/)||[])[0],n=null,E.output.length&&(n=E.output[E.output.length-1].match(/(?:<|{{#)\s*(\w+)/)),null!==n&&(n[1]===t||E.Utils.in_array(n[1],R))||E.print_newline(!1,E.output)),E.print_token(E.token_text),E.current_mode="CONTENT";break;case"TK_TAG_SINGLE":(i=E.token_text.match(/^\s*<([a-z-]+)/i))&&E.Utils.in_array(i[1],R)||E.print_newline(!1,E.output),E.print_token(E.token_text),E.current_mode="CONTENT";break;case"TK_TAG_HANDLEBARS_ELSE":for(r=!1,s=E.output.length-1;0<=s&&"\n"!==E.output[s];s--)if(E.output[s].match(/{{#if/)){r=!0;break}r||E.print_newline(!1,E.output),E.print_token(E.token_text),E.indent_content&&(E.indent(),E.indent_content=!1), -E.current_mode="CONTENT";break;case"TK_TAG_HANDLEBARS_COMMENT":case"TK_CONTENT":E.print_token(E.token_text),E.current_mode="TAG";break;case"TK_STYLE":case"TK_SCRIPT":""!==E.token_text&&(E.print_newline(!1,E.output),_=E.token_text,o=1,"TK_SCRIPT"===E.token_type?a="function"==typeof g&&g:"TK_STYLE"===E.token_type&&(a="function"==typeof m&&m),"keep"===T.indent_scripts?o=0:"separate"===T.indent_scripts&&(o=-E.indent_level),l=E.get_full_indent(o),(_=a?((u=function(){this.eol="\n"}).prototype=T,c=new u,a(_.replace(/^\s*/,l),c)):(h=_.match(/^\s*/)[0].match(/[^\n\r]*$/)[0].split(E.indent_string).length-1,p=E.get_full_indent(o-h),_.replace(/^\s*/,l).replace(/\r\n|\r|\n/g,"\n"+p).replace(/\s+$/,"")))&&(E.print_token_raw(_),E.print_newline(!0,E.output))),E.current_mode="TAG";break;default:""!==E.token_text&&E.print_token(E.token_text)}E.last_token=E.token_type,E.last_text=E.token_text}return f=E.output.join("").replace(/[\r\n\t ]+$/,""),C&&(f+="\n"),"\n"!==N&&(f=f.replace(/[\n]/g,N)),f}}},function(e,t){var n="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",i="̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ؚؠ-ىٲ-ۓۧ-ۨۻ-ۼܰ-݊ࠀ-ࠔࠛ-ࠣࠥ-ࠧࠩ-࠭ࡀ-ࡗࣤ-ࣾऀ-ःऺ-़ा-ॏ॑-ॗॢ-ॣ०-९ঁ-ঃ়া-ৄেৈৗয়-ৠਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୟ-ୠ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఁ-ఃె-ైొ-్ౕౖౢ-ౣ౦-౯ಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢ-ೣ೦-೯ംഃെ-ൈൗൢ-ൣ൦-൯ංඃ්ා-ුූෘ-ෟෲෳิ-ฺเ-ๅ๐-๙ິ-ູ່-ໍ໐-໙༘༙༠-༩༹༵༷ཁ-ཇཱ-྄྆-྇ྍ-ྗྙ-ྼ࿆က-ဩ၀-၉ၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟ᜎ-ᜐᜠ-ᜰᝀ-ᝐᝲᝳក-ឲ៝០-៩᠋-᠍᠐-᠙ᤠ-ᤫᤰ-᤻ᥑ-ᥭᦰ-ᧀᧈ-ᧉ᧐-᧙ᨀ-ᨕᨠ-ᩓ᩠-᩿᩼-᪉᪐-᪙ᭆ-ᭋ᭐-᭙᭫-᭳᮰-᮹᯦-᯳ᰀ-ᰢ᱀-᱉ᱛ-ᱽ᳐-᳒ᴀ-ᶾḁ-ἕ‌‍‿⁀⁔⃐-⃥⃜⃡-⃰ⶁ-ⶖⷠ-ⷿ〡-〨゙゚Ꙁ-ꙭꙴ-꙽ꚟ꛰-꛱ꟸ-ꠀ꠆ꠋꠣ-ꠧꢀ-ꢁꢴ-꣄꣐-꣙ꣳ-ꣷ꤀-꤉ꤦ-꤭ꤰ-ꥅꦀ-ꦃ꦳-꧀ꨀ-ꨧꩀ-ꩁꩌ-ꩍ꩐-꩙ꩻꫠ-ꫩꫲ-ꫳꯀ-ꯡ꯬꯭꯰-꯹ﬠ-ﬨ︀-️︠-︦︳︴﹍-﹏0-9_",r=new RegExp("["+n+"]"),s=new RegExp("["+n+i+"]");t.newline=/[\n\r\u2028\u2029]/,t.lineBreak=new RegExp("\r\n|"+t.newline.source),t.allLineBreaks=new RegExp(t.lineBreak.source,"g"),t.isIdentifierStart=function(e){return e<65?36===e||64===e:e<91||(e<97?95===e:e<123||170<=e&&r.test(String.fromCharCode(e)))},t.isIdentifierChar=function(e){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||170<=e&&s.test(String.fromCharCode(e))))}},function(e,t){e.exports.mergeOpts=function r(e,t){var n,i={};for(n in e)n!==t&&(i[n]=e[n]);if(t in e)for(n in e[t])i[n]=e[t][n];return i}},function(e,t,n){var r=n(0).Beautifier;e.exports=function s(e,t,n,i){return new r(e,t,n,i).beautify()}}],b.c=p,b.i=function(e){return e},b.d=function(e,t,n){b.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},b.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return b.d(t,"a",t),t},b.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},b.p="",f=b(b.s=3),d=f,"function"==typeof g&&g.amd?g(["require","./beautify","./beautify-css"],function(e){var n=e("./beautify"),i=e("./beautify-css");return{html_beautify:function(e,t){return d(e,t,n.js_beautify,i.css_beautify)}}}):void 0!==T?(u=m("./beautify.js"),c=m("./beautify-css.js"),T.html_beautify=function(e,t){return d(e,t,u.js_beautify,c.css_beautify)}):"undefined"!=typeof window?window.html_beautify=function(e,t){return d(e,t,window.js_beautify,window.css_beautify)}:"undefined"!=typeof global&&(global.html_beautify=function(e,t){return d(e,t,global.js_beautify,global.css_beautify)})},"@VERSION@"); \ No newline at end of file +YUI.add("moodle-atto_html-beautify",function(e,u){var n,i,h,r,c,p,d,s,_,t={};function a(e){if(i[e])return i[e].exports;var t=i[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,a),t.l=!0,t.exports}function o(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return h[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}function l(e){if(s[e])return s[e].exports;var t=s[e]={i:e,l:!1,exports:{}};return d[e].call(t.exports,t,t.exports,l),t.l=!0,t.exports}e.namespace("M.atto_html").beautify=t,n=[function(e,t){var n="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",i=new RegExp("["+n+"]"),r=new RegExp("["+n+"̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ؚؠ-ىٲ-ۓۧ-ۨۻ-ۼܰ-݊ࠀ-ࠔࠛ-ࠣࠥ-ࠧࠩ-࠭ࡀ-ࡗࣤ-ࣾऀ-ःऺ-़ा-ॏ॑-ॗॢ-ॣ०-९ঁ-ঃ়া-ৄেৈৗয়-ৠਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୟ-ୠ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఁ-ఃె-ైొ-్ౕౖౢ-ౣ౦-౯ಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢ-ೣ೦-೯ംഃെ-ൈൗൢ-ൣ൦-൯ංඃ්ා-ුූෘ-ෟෲෳิ-ฺเ-ๅ๐-๙ິ-ູ່-ໍ໐-໙༘༙༠-༩༹༵༷ཁ-ཇཱ-྄྆-྇ྍ-ྗྙ-ྼ࿆က-ဩ၀-၉ၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟ᜎ-ᜐᜠ-ᜰᝀ-ᝐᝲᝳក-ឲ៝០-៩᠋-᠍᠐-᠙ᤠ-ᤫᤰ-᤻ᥑ-ᥭᦰ-ᧀᧈ-ᧉ᧐-᧙ᨀ-ᨕᨠ-ᩓ᩠-᩿᩼-᪉᪐-᪙ᭆ-ᭋ᭐-᭙᭫-᭳᮰-᮹᯦-᯳ᰀ-ᰢ᱀-᱉ᱛ-ᱽ᳐-᳒ᴀ-ᶾḁ-ἕ‌‍‿⁀⁔⃐-⃥⃜⃡-⃰ⶁ-ⶖⷠ-ⷿ〡-〨゙゚Ꙁ-ꙭꙴ-꙽ꚟ꛰-꛱ꟸ-ꠀ꠆ꠋꠣ-ꠧꢀ-ꢁꢴ-꣄꣐-꣙ꣳ-ꣷ꤀-꤉ꤦ-꤭ꤰ-ꥅꦀ-ꦃ꦳-꧀ꨀ-ꨧꩀ-ꩁꩌ-ꩍ꩐-꩙ꩻꫠ-ꫩꫲ-ꫳꯀ-ꯡ꯬꯭꯰-꯹ﬠ-ﬨ︀-️︠-︦︳︴﹍-﹏0-9_]");t.newline=/[\n\r\u2028\u2029]/,t.lineBreak=new RegExp("\r\n|"+t.newline.source),t.allLineBreaks=new RegExp(t.lineBreak.source,"g"),t.isIdentifierStart=function(e){return e<65?36===e||64===e:e<91||(e<97?95===e:e<123||170<=e&&i.test(String.fromCharCode(e)))},t.isIdentifierChar=function(e){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||170<=e&&r.test(String.fromCharCode(e))))}},function(e,n,t){var B,P,M,V,U=t(3).mergeOpts,z=t(0),X=t(4).Output,F=t(7).Tokenizer;function W(e,t){t.multiline_frame||t.mode===V.ForInitializer||t.mode===V.Conditional||(t=t.start_line_index,e.remove_indent(t))}function G(e,t){for(var n=0;n"!==h.last_text)&&(G(u,["TK_EQUALS","TK_START_EXPR","TK_COMMA","TK_OPERATOR"])||"TK_RESERVED"===u&&G(h.last_text,["return","throw","import","default"]))?v(V.ObjectLiteral):v(V.BlockStatement);t=!e.comments_before.length&&"}"===e.text&&"function"===h.last_word&&"TK_END_EXPR"===u;if(c.brace_preserve_inline){n=0,i=null,h.inline_frame=!0;do{if((i=I(n+=1)).wanted_newline){h.inline_frame=!1;break}}while("TK_EOF"!==i.type&&("TK_END_BLOCK"!==i.type||i.opened!==l))}("expand"===c.brace_style||"none"===c.brace_style&&l.wanted_newline)&&!h.inline_frame?"TK_OPERATOR"!==u&&(t||"TK_EQUALS"===u||"TK_RESERVED"===u&&L(h.last_text)&&"else"!==h.last_text)?o.space_before_token=!0:d(!1,!0):(!S(r.mode)||"TK_START_EXPR"!==u&&"TK_COMMA"!==u||("TK_COMMA"!==u&&!c.space_in_paren||(o.space_before_token=!0),( +"TK_COMMA"===u||"TK_START_EXPR"===u&&h.inline_frame)&&(p(),r.multiline_frame=r.multiline_frame||h.multiline_frame,h.multiline_frame=!1)),"TK_OPERATOR"!==u&&"TK_START_EXPR"!==u&&("TK_START_BLOCK"!==u||h.inline_frame?o.space_before_token=!0:d()));f(),O()},TK_END_BLOCK:function(){K(l);for(;h.mode===V.Statement;)C();var e="TK_START_BLOCK"===u;h.inline_frame&&!e?o.space_before_token=!0:"expand"===c.brace_style?e||d():e||(S(h.mode)&&c.keep_array_indentation?(c.keep_array_indentation=!1,d(),c.keep_array_indentation=!0):d());C(),f()},TK_WORD:j,TK_RESERVED:j,TK_SEMICOLON:function(){D()?o.space_before_token=!1:K(l);var e=I(1);for(;!(h.mode!==V.Statement||h.if_block&&e&&"TK_RESERVED"===e.type&&"else"===e.text||h.do_block);)C();h.import_block&&(h.import_block=!1);f()},TK_STRING:function(){D()?o.space_before_token=!0:(K(l),"TK_RESERVED"===u||"TK_WORD"===u||h.inline_frame?o.space_before_token=!0:"TK_COMMA"===u||"TK_START_EXPR"===u||"TK_EQUALS"===u||"TK_OPERATOR"===u?N()||p():d());f()},TK_EQUALS:function(){D()||K(l);h.declaration_statement&&(h.declaration_assignment=!0);o.space_before_token=!0,f(),o.space_before_token=!0},TK_OPERATOR:function(){var e,t,n,i,r,s,_="*"===l.text&&("TK_RESERVED"===u&&G(h.last_text,["function","yield"])||G(u,["TK_START_BLOCK","TK_COMMA","TK_END_BLOCK","TK_SEMICOLON"])),a=G(l.text,["-","+"])&&(G(u,["TK_START_BLOCK","TK_START_EXPR","TK_EQUALS","TK_OPERATOR"])||G(h.last_text,T.line_starters)||","===h.last_text);D()||K(l,!_);if("TK_RESERVED"===u&&L(h.last_text))o.space_before_token=!0,f();else if("*"!==l.text||"TK_DOT"!==u)if("::"!==l.text)if("TK_OPERATOR"===u&&G(c.operator_position,M)&&p(),":"===l.text&&h.in_case)h.case_body=!0,O(),f(),d(),h.in_case=!1;else{e=!0,t=!0,n=!1;if(":"===l.text?0===h.ternary_depth?e=!1:(--h.ternary_depth,n=!0):"?"===l.text&&(h.ternary_depth+=1),!a&&!_&&c.preserve_newlines&&G(l.text,T.positionable_operators)){i=":"===l.text,r=i&&n,s=i&&!n;switch(c.operator_position){case P.before_newline:return o.space_before_token=!s,f(),i&&!r||p(),void(o.space_before_token=!0);case P.after_newline:return o.space_before_token=!0,!i||r?I(1).wanted_newline?d(!1,!0):p():o.space_before_token=!1,f(),void(o.space_before_token=!0);case P.preserve_newline:return s||p(),e=!(o.just_added_newline()||s),o.space_before_token=e,f(),void(o.space_before_token=!0)}}_?(p(),e=!1,n=I(1),t=n&&G(n.type,["TK_WORD","TK_RESERVED"])):"..."===l.text?(p(),e="TK_START_BLOCK"===u,t=!1):(G(l.text,["--","++","!","~"])||a)&&(t=e=!1,!l.wanted_newline||"--"!==l.text&&"++"!==l.text||d(!1,!0),";"===h.last_text&&A(h.mode)&&(e=!0),"TK_RESERVED"===u?e=!0:"TK_END_EXPR"===u?e=!("]"===h.last_text&&("--"===l.text||"++"===l.text)):"TK_OPERATOR"===u&&(e=G(l.text,["--","-","++","+"])&&G(h.last_text,["--","-","++","+"]),G(l.text,["+","-"])&&G(h.last_text,["--","++"])&&(t=!0)),(h.mode!==V.BlockStatement||h.inline_frame)&&h.mode!==V.Statement||"{"!==h.last_text&&";"!==h.last_text||d()),o.space_before_token=o.space_before_token||e,f(),o.space_before_token=t}else f();else f()},TK_COMMA:function(){K(l,!0),f(),o.space_before_token=!0,h.declaration_statement?(A(h.parent.mode)&&(h.declaration_assignment=!1),h.declaration_assignment?d(h.declaration_assignment=!1,!0):c.comma_first&&p()):h.mode===V.ObjectLiteral||h.mode===V.Statement&&h.parent.mode===V.ObjectLiteral?(h.mode===V.Statement&&C(),h.inline_frame||d()):c.comma_first&&p()},TK_BLOCK_COMMENT:function(e){if(o.raw)o.add_raw_token(l),l.directives&&"end"===l.directives.preserve&&(o.raw=c.test_output_raw);else if(l.directives)d(!1,e),f(),"start"===l.directives.preserve&&(o.raw=!0),d(!1,!0);else if(z.newline.test(l.text)||l.wanted_newline){var t,n=function(e){e=e.replace(z.allLineBreaks,"\n");var t=[],n=e.indexOf("\n");for(;-1!==n;)t.push(e.substring(0,n)),e=e.substring(n+1),n=e.indexOf("\n");e.length&&t.push(e);return t}(l.text),i=!1,r=!1,s=l.whitespace_before,_=s.length;for(d(!1,e),1_?f(n[t].substring(_)):o.add_token(n[t]);d(!1,e)}else o.space_before_token=!0,f(),o.space_before_token=!0},TK_COMMENT:function(e){l.wanted_newline?d(!1,e):o.trim(!0);o.space_before_token=!0,f(),d(!1,e)},TK_DOT:function(){D()||K(l,!0);"TK_RESERVED"===u&&L(h.last_text)?o.space_before_token=!0:p(")"===h.last_text&&c.break_chained_methods);f()},TK_UNKNOWN:function(e){f(),"\n"===l.text[l.text.length-1]&&d(!1,e)},TK_EOF:function(){for(;h.mode===V.Statement;)C();K(l)}};function R(e,t){var n=0;return e&&(n=e.indentation_level,!o.just_added_newline()&&e.line_indent_level>n&&(n=e.line_indent_level)),{mode:t,parent:e,last_text:e?e.last_text:"",last_word:e?e.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:n,line_indent_level:e?e.line_indent_level:n,start_line_index:o.get_line_number(),ternary_depth:0}}for(e=U(e=e||{},"js"),c={},"expand-strict"===e.brace_style?e.brace_style="expand":"collapse-preserve-inline"===e.brace_style?e.brace_style="collapse,preserve-inline":e.braces_on_own_line!==undefined?e.brace_style=e.braces_on_own_line?"expand":"collapse":e.brace_style||(e.brace_style="collapse"),g=e.brace_style.split(/[^a-zA-Z0-9_\-]+/),c.brace_preserve_inline=!1,c.brace_style="collapse",E=0;Ec.max_preserve_newlines&&(r=c.max_preserve_newlines),c.preserve_newlines&&1=c.wrap_line_length&&d(!1,!0)))}function d(e,t){if(!t&&";"!==h.last_text&&","!==h.last_text&&"="!==h.last_text&&"TK_OPERATOR"!==u)for(var n=I(1);!(h.mode!==V.Statement||h.if_block&&n&&"TK_RESERVED"===n.type&&"else"===n.text||h.do_block);)C();o.add_new_line(e)&&(h.multiline_frame=!0)}function y(){o.just_added_newline()&&(c.keep_array_indentation&&S(h.mode)&&l.wanted_newline?(o.current_line.push(l.whitespace_before),o.space_before_token=!1):o.set_indent(h.indentation_level)&&(h.line_indent_level=h.indentation_level))}function f(e){var t;o.raw?o.add_raw_token(l):(c.comma_first&&"TK_COMMA"===u&&o.just_added_newline()&&","===o.previous_line.last()&&(t=o.previous_line.pop(),o.previous_line.is_empty()&&(o.previous_line.push(t),o.trim(!0),o.current_line.pop(),o.trim()),y(),o.add_token(","),o.space_before_token=!0),e=e||l.text,y(),o.add_token(e))}function O(){h.indentation_level+=1}function v(e){r=h?(_.push(h),h):R(null,e),h=R(r,e)}function S(e){return e===V.ArrayLiteral}function A(e){return G(e,[V.Expression,V.ForInitializer,V.Conditional])}function C(){0<_.length&&(r=h,h=_.pop(),r.mode!==V.Statement||c.unindent_chained_methods||W(o,r))}function N(){return h.parent.mode===V.ObjectLiteral&&h.mode===V.Statement&&(":"===h.last_text&&0===h.ternary_depth||"TK_RESERVED"===u&&G(h.last_text,["get","set"]))}function D(){return("TK_RESERVED"===u&&G(h.last_text,["var","let","const"])&&"TK_WORD"===l.type||"TK_RESERVED"===u&&"do"===h.last_text||"TK_RESERVED"===u&&G(h.last_text,x)&&!l.wanted_newline||"TK_RESERVED"===u&&"else"===h.last_text&&("TK_RESERVED"!==l.type||"if"!==l.text||l.comments_before.length)||"TK_END_EXPR"===u&&(r.mode===V.ForInitializer||r.mode===V.Conditional)||"TK_WORD"===u&&h.mode===V.BlockStatement&&!h.in_case&&"--"!==l.text&&"++"!==l.text&&"function"!==s&&"TK_WORD"!==l.type&&"TK_RESERVED"!==l.type||h.mode===V.ObjectLiteral&&(":"===h.last_text&&0===h.ternary_depth||"TK_RESERVED"===u&&G(h.last_text,["get","set"])))&&(v(V.Statement),c.unindent_chained_methods||O(),K(l,!0),N()||p("TK_RESERVED"===l.type&&G(l.text,["do","for","if","while"])),1)}function L(e){return G(e,["case","return","do","if","throw","else"])}function I(e){e=n+(e||0);return e<0||e>=b.length?null:b[e]}function j(){if("TK_RESERVED"===l.type&&(G(l.text,["set","get"])&&h.mode!==V.ObjectLiteral||G(l.text,["as","from"])&&!h.import_block||h.mode===V.ObjectLiteral&&":"===I(1).text)&&(l.type="TK_WORD"),D()?"TK_RESERVED"===u&&G(h.last_text,["var","let","const"])&&"TK_WORD"===l.type&&(h.declaration_statement=!0):!l.wanted_newline||A(h.mode)||"TK_OPERATOR"===u&&"--"!==h.last_text&&"++"!==h.last_text||"TK_EQUALS"===u||!c.preserve_newlines&&"TK_RESERVED"===u&&G(h.last_text,["var","let","const","set","get"])?K(l):(K(l),d()),h.do_block&&!h.do_while){if("TK_RESERVED"===l.type&&"while"===l.text)return o.space_before_token=!0,f(),o.space_before_token=!0,void(h.do_while=!0);d(),h.do_block=!1}if(h.if_block)if(h.else_block||"TK_RESERVED"!==l.type||"else"!==l.text){for(;h.mode===V.Statement;)C();h.if_block=!1,h.else_block=!1}else h.else_block=!0;return"TK_RESERVED"===l.type&&("case"===l.text||"default"===l.text&&h.in_case_statement)?(d(),(h.case_body||c.jslint_happy)&&(0h.parent.indentation_level)&&--h.indentation_level,h.case_body=!1),f(),h.in_case=!0,void(h.in_case_statement=!0)):("TK_COMMA"!==u&&"TK_START_EXPR"!==u&&"TK_EQUALS"!==u&&"TK_OPERATOR"!==u||N()||p(),"TK_RESERVED"===l.type&&"function"===l.text?((G(h.last_text,["}",";"])||o.just_added_newline()&&!G( +h.last_text,["(","[","{",":","=",","])&&"TK_OPERATOR"!==u)&&(o.just_added_blankline()||l.comments_before.length||(d(),d(!0))),"TK_RESERVED"===u||"TK_WORD"===u?"TK_RESERVED"===u&&(G(h.last_text,["get","set","new","export","async"])||G(h.last_text,x))||"TK_RESERVED"===u&&"default"===h.last_text&&"export"===s?o.space_before_token=!0:d():"TK_OPERATOR"===u||"="===h.last_text?o.space_before_token=!0:!h.multiline_frame&&(A(h.mode)||S(h.mode))||d(),f(),void(h.last_word=l.text)):(a="NONE","TK_END_BLOCK"===u?r.inline_frame?a="SPACE":"TK_RESERVED"!==l.type||!G(l.text,["else","catch","finally","from"])||"expand"===c.brace_style||"end-expand"===c.brace_style||"none"===c.brace_style&&l.wanted_newline?a="NEWLINE":(a="SPACE",o.space_before_token=!0):"TK_SEMICOLON"===u&&h.mode===V.BlockStatement?a="NEWLINE":"TK_SEMICOLON"===u&&A(h.mode)?a="SPACE":"TK_STRING"===u?a="NEWLINE":"TK_RESERVED"===u||"TK_WORD"===u||"*"===h.last_text&&(G(s,["function","yield"])||h.mode===V.ObjectLiteral&&G(s,["{",","]))?a="SPACE":"TK_START_BLOCK"===u?a=h.inline_frame?"SPACE":"NEWLINE":"TK_END_EXPR"===u&&(o.space_before_token=!0,a="NEWLINE"),"TK_RESERVED"===l.type&&G(l.text,T.line_starters)&&")"!==h.last_text&&(a=h.inline_frame||"else"===h.last_text||"export"===h.last_text?"SPACE":"NEWLINE"),"TK_RESERVED"===l.type&&G(l.text,["else","catch","finally"])?("TK_END_BLOCK"!==u||r.mode!==V.BlockStatement||"expand"===c.brace_style||"end-expand"===c.brace_style||"none"===c.brace_style&&l.wanted_newline)&&!h.inline_frame?d():(o.trim(!0),"}"!==o.current_line.last()&&d(),o.space_before_token=!0):"NEWLINE"===a?"TK_RESERVED"===u&&L(h.last_text)?o.space_before_token=!0:"TK_END_EXPR"!==u?"TK_START_EXPR"===u&&"TK_RESERVED"===l.type&&G(l.text,["var","let","const"])||":"===h.last_text||("TK_RESERVED"===l.type&&"if"===l.text&&"else"===h.last_text?o.space_before_token=!0:d()):"TK_RESERVED"===l.type&&G(l.text,T.line_starters)&&")"!==h.last_text&&d():h.multiline_frame&&S(h.mode)&&","===h.last_text&&"}"===s?d():"SPACE"===a&&(o.space_before_token=!0),f(),h.last_word=l.text,void("TK_RESERVED"===l.type&&("do"===l.text?h.do_block=!0:"if"===l.text?h.if_block=!0:"import"===l.text?h.import_block=!0:h.import_block&&"TK_RESERVED"===l.type&&"from"===l.text&&(h.import_block=!1)))))}u="TK_START_BLOCK",s="",(o=new X(i,w)).raw=c.test_output_raw,_=[],v(V.BlockStatement),this.beautify=function(){for(T=new F(t,c,i),b=T.tokenize(),n=0,l=I();l;)k[l.type](),s=h.last_text,u=l.type,h.last_text=l.text,n+=1,l=I();return o.get_code(c.end_with_newline,c.eol)},x=["break","continue","return","throw","yield"]}},function(e,t){e.exports.InputScanner=function(e){var n=e,i=n.length,r=0;this.back=function(){--r},this.hasNext=function(){return r=this.indent_cache.length;)this.indent_cache.push(this.indent_cache[this.indent_cache.length-1]+this.indent_string);return this.current_line.set_indent(e),!0}return this.current_line.set_indent(0),!1},this.add_raw_token=function(e){for(var t=0;t/g,"`"===e||"'"===e||'"'===e||("/"===e||R.e4x&&"<"===e&&N.test(s,-1))&&("TK_RESERVED"===t.type&&F(t.text,["return","case","throw","else","do","typeof","yield"])||"TK_END_EXPR"===t.type&&")"===t.text&&t.parent&&"TK_RESERVED"===t.parent.type&&F(t.parent.text,["if","while","for"])||F(t.type,["TK_COMMENT","TK_START_EXPR","TK_START_BLOCK","TK_END_BLOCK","TK_OPERATOR","TK_EQUALS","TK_EOF","TK_SEMICOLON","TK_COMMA"]))){if(c=a=!1,r=_=e,"/"===_)for(p=!1;N.hasNext()&&(a||p||N.peek()!==_)&&!N.testChar(X.newline);)r+=N.peek(),a?a=!1:(a="\\"===N.peek(),"["===N.peek()?p=!0:"]"===N.peek()&&(p=!1)),N.next();else if(R.e4x&&"<"===_){if(d=/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[\s\S]+?}|!\[CDATA\[[\s\S]*?\]\])(\s+{[\s\S]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{[\s\S]+?}))*\s*(\/?)\s*>/g,N.back(),o="",l=N.match(s)){for(T=0===(f=l[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}")).indexOf("{"),g=0;l&&(E=!!l[1],m=l[2],!(!!l[l.length-1]||"![CDATA["===m.slice(0,8))&&(m===f||T&&m.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(E?--g:++g),o+=l[0],!(g<=0));)l=N.match(d);return l||(o+=N.match(/[\s\S]*/g)[0]),[o=o.replace(X.allLineBreaks,"\n"),"TK_STRING"]}}else x=function(e,t,n){for(var i;N.hasNext()&&(i=N.peek(),a||i!==e&&(t||!X.newline.test(i)));)(a||t)&&X.newline.test(i)?("\r"===i&&"\n"===N.peek(1)&&(N.next(),i=N.peek()),r+="\n"):r+=i,a=a?("x"!==i&&"u"!==i||(c=!0),!1):"\\"===i,N.next(),n&&-1!==r.indexOf(n,r.length-n.length)&&("`"===e?x("}",t,"`"):x("`",t,"${"),N.hasNext()&&(r+=N.next()))},"`"===_?x("`",!0,"${"):x(_);if(c&&R.unescape_strings&&(r=function(e){var t="",n=0,i=new W(e),r=null;for(;i.hasNext();)if((r=i.match(/([\s]|[^\\]|\\\\)+/g))&&(t+=r[0]),"\\"===i.peek()){if(i.next(),"x"===i.peek())r=i.match(/x([0-9A-Fa-f]{2})/g);else{if("u"!==i.peek()){t+="\\",i.hasNext()&&(t+=i.next());continue}r=i.match(/u([0-9A-Fa-f]{4})/g)}if(!r)return e;if(126<(n=parseInt(r[1],16))&&n<=255&&0===r[0].indexOf("x"))return e;t+=0<=n&&n<32?"\\"+r[0]:34===n||39===n||92===n?"\\"+String.fromCharCode(n):String.fromCharCode(n)}return t}(r)),N.peek()===_&&(r+=_,N.next(),"/"===_))for(;N.hasNext()&&X.isIdentifierStart(N.peekCharCode());)r+=N.next();return[r,"TK_STRING"]}if("#"===e){if(0===C.length&&"!"===N.peek()){for(r=e;N.hasNext()&&"\n"!==e;)e=N.next(),r+=e;return[r.replace(/^\s+|\s+$/g,"")+"\n","TK_UNKNOWN"]}if(b="#",N.hasNext()&&N.testChar(D)){for(;b+=e=N.next(),N.hasNext()&&"#"!==e&&"="!==e;);return"#"===e||("["===N.peek()&&"]"===N.peek(1)?(b+="[]",N.next(),N.next()):"{"===N.peek()&&"}"===N.peek(1)&&(b+="{}",N.next(),N.next())),[b,"TK_WORD"]}}if("<"===e&&("?"===N.peek()||"%"===N.peek())&&(N.back(),w=N.match(P)))return[e=(e=w[0]).replace(X.allLineBreaks,"\n"),"TK_STRING"];if("<"===e&&N.match(/\!--/g)){for(e="\x3c!--";N.hasNext()&&!N.testChar(X.newline);)e+=N.next();return A=!0,[e,"TK_COMMENT"]}if("-"===e&&A&&N.match(/->/g))return A=!1,["--\x3e","TK_COMMENT"];if("."===e)return"."===N.peek()&&"."===N.peek(1)?[e+=N.next()+N.next(),"TK_OPERATOR"]:[e,"TK_DOT"];if(F(e,K)){for(;N.hasNext()&&F(e+N.peek(),K)&&(e+=N.next(),N.hasNext()););return","===e?[e,"TK_COMMA"]:"="===e?[e,"TK_EQUALS"]:[e,"TK_OPERATOR"]}return[e,"TK_UNKNOWN"]}this.positionable_operators="!= !== % & && * ** + - / : < << <= == === > >= >> >>> ? ^ | ||".split(" "),K=this.positionable_operators.concat("! %= &= *= **= ++ += , -- -= /= :: <<= = => >>= >>>= ^= |= ~ ...".split(" ")),this.line_starters="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),y=this.line_starters.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as"]),L=/([\s\S]*?)((?:\*\/)|$)/g,I=/([^\n\r\u2028\u2029]*)/g,j=/\/\* beautify( \w+[:]\w+)+ \*\//g,O=/ (\w+)[:](\w+)/g,B=/([\s\S]*?)((?:\/\*\sbeautify\signore:end\s\*\/)|$)/g, +P=/((<\?php|<\?=)[\s\S]*?\?>)|(<%[\s\S]*?%>)/g,this.tokenize=function(){var e,t,n,i,r,s;for(N=new W(_),A=!1,C=[],i=null,r=[],s=[];!t||"TK_EOF"!==t.type;){for(n=a(),e=new G(n[1],n[0],v,S);"TK_COMMENT"===e.type||"TK_BLOCK_COMMENT"===e.type||"TK_UNKNOWN"===e.type;)"TK_BLOCK_COMMENT"===e.type&&(e.directives=n[2]),s.push(e),n=a(),e=new G(n[1],n[0],v,S);s.length&&(e.comments_before=s,s=[]),"TK_START_BLOCK"===e.type||"TK_START_EXPR"===e.type?(e.parent=t,r.push(i),i=e):("TK_END_BLOCK"===e.type||"TK_END_EXPR"===e.type)&&i&&("]"===e.text&&"["===i.text||")"===e.text&&"("===i.text||"}"===e.text&&"{"===i.text)&&(e.parent=i.parent,e.opened=i,i=r.pop()),C.push(e),t=e}return C}}}],i={},a.m=n,a.c=i,a.i=function(e){return e},a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},a.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",e=a(a.s=6),void 0!==t?t.js_beautify=e:"undefined"!=typeof window?window.js_beautify=e:"undefined"!=typeof global&&(global.js_beautify=e),h=[function(e,t,n){var s=n(2).mergeOpts,i=n(1),N=n(3).Output,_=i.lineBreak,a=i.allLineBreaks;e.exports.Beautifier=function(o,e){var g,t,n,i,E,m,x,b,w,k,l,u,R,K,r,y,h,O,c;function p(){return(u=o.charAt(++l))||""}function d(e){var t=l;return e&&f(),e=o.charAt(l+1)||"",l=t-1,p(),e}function v(e){for(var t=l;p();)if("\\"===u)p();else{if(-1!==e.indexOf(u))break;if("\n"===u)break}return o.substring(t,l+1)}function f(e){for(var t=0;k.test(d());)p(),"\n"===u&&e&&i&&(c.add_new_line(!0),t++);return g=t}function S(){var e=l,t="/"===d();for(p();p();){if(!t&&"*"===u&&"/"===d()){p();break}if(t&&"\n"===u)return o.substring(e,l)}return o.substring(e,l)+u}function A(e){return o.substring(l-e.length,l).toLowerCase()===e}if(e=s(e=e||{},"css"),o=o||"",g=0,t=e.indent_size?parseInt(e.indent_size,10):4,n=e.indent_char||" ",i=e.preserve_newlines!==undefined&&e.preserve_newlines,E=e.selector_separator_newline===undefined||e.selector_separator_newline,m=e.end_with_newline!==undefined&&e.end_with_newline,x=e.newline_between_rules===undefined||e.newline_between_rules,b=e.space_around_combinator!==undefined&&e.space_around_combinator||e.space_around_selector_separator!==undefined&&e.space_around_selector_separator,w=e.eol||"auto",e.indent_with_tabs&&(n="\t",t=1),"auto"===w&&(w="\n",o&&_.test(o||"")&&(w=o.match(_)[0])),w=w.replace(/\\r/,"\r").replace(/\\n/,"\n"),o=o.replace(a,"\n"),k=/^\s+$/,l=-1,K="",r=R=0,o&&o.length){for(;" "===o.charAt(r)||"\t"===o.charAt(r);)r+=1;K=o.substring(0,r),o=o.substring(r)}function T(e){c.just_added_newline()&&c.set_indent(h),c.add_token(e)}function C(e){e&&(c.space_before_token=!0)}y=new Array(t+1).join(n),this.beautify=function(){var e,t,n,i,r,s,_,a;for(c=new N(y,K),u=null,R=O=h=0,n=t=e=!(l=-1),i="";;){if(r=""!==(_=function(){var e="";for(u&&k.test(u)&&(e=u);k.test(p());)e+=u;return e}()),_=-1!==_.indexOf("\n"),s=i,!(i=u))break;"/"===u&&"*"===d()?(a=0===h,(_||a)&&c.add_new_line(),T(S()),c.add_new_line(),a&&c.add_new_line(!0)):"/"===u&&"/"===d()?(_||"{"===s||c.trim(!0),c.space_before_token=!0,T(S()),c.add_new_line()):"@"===u?(C(r),"{"===d()?T(v("}")):(T(u),a=void 0,a=l,_=v(_=": ,;{}()[]/='\""),l=a-1,p(),(s=_).match(/[ :]$/)&&(p(),T(s=v(": ").replace(/\s$/,"")),c.space_before_token=!0),(s=s.replace(/\s$/,""))in this.NESTED_AT_RULE&&(O+=1,s in this.CONDITIONAL_GROUP_RULE&&(n=!0)))):"#"===u&&"{"===d()?(C(r),T(v("}"))):"{"===u?"}"===d(!0)?(f(),p(),c.space_before_token=!0,T("{}"),f(!0)||c.add_new_line(),g<2&&x&&0===h&&c.add_new_line(!0)):(h++,c.space_before_token=!0,T(u),f(!0)||c.add_new_line(),e=n?(n=!1,O"===u||"+"===u||"~"===u)&&!t&&R<1?b?(c.space_before_token=!0,T(u),c.space_before_token=!0):(T(u),f(),u&&k.test(u)&&(u="")):"]"===u?T(u):"["===u?(C(r),T(u)):"="===u?(f(),T("="),k.test(u)&&(u="")):("!"===u?T(" "):C(r),T(u))}return c.get_code(m,w)},this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0}}},function(e,t){var n="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",i=new RegExp("["+n+"]"),r=new RegExp( +"["+n+"̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ؚؠ-ىٲ-ۓۧ-ۨۻ-ۼܰ-݊ࠀ-ࠔࠛ-ࠣࠥ-ࠧࠩ-࠭ࡀ-ࡗࣤ-ࣾऀ-ःऺ-़ा-ॏ॑-ॗॢ-ॣ०-९ঁ-ঃ়া-ৄেৈৗয়-ৠਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୟ-ୠ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఁ-ఃె-ైొ-్ౕౖౢ-ౣ౦-౯ಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢ-ೣ೦-೯ംഃെ-ൈൗൢ-ൣ൦-൯ංඃ්ා-ුූෘ-ෟෲෳิ-ฺเ-ๅ๐-๙ິ-ູ່-ໍ໐-໙༘༙༠-༩༹༵༷ཁ-ཇཱ-྄྆-྇ྍ-ྗྙ-ྼ࿆က-ဩ၀-၉ၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟ᜎ-ᜐᜠ-ᜰᝀ-ᝐᝲᝳក-ឲ៝០-៩᠋-᠍᠐-᠙ᤠ-ᤫᤰ-᤻ᥑ-ᥭᦰ-ᧀᧈ-ᧉ᧐-᧙ᨀ-ᨕᨠ-ᩓ᩠-᩿᩼-᪉᪐-᪙ᭆ-ᭋ᭐-᭙᭫-᭳᮰-᮹᯦-᯳ᰀ-ᰢ᱀-᱉ᱛ-ᱽ᳐-᳒ᴀ-ᶾḁ-ἕ‌‍‿⁀⁔⃐-⃥⃜⃡-⃰ⶁ-ⶖⷠ-ⷿ〡-〨゙゚Ꙁ-ꙭꙴ-꙽ꚟ꛰-꛱ꟸ-ꠀ꠆ꠋꠣ-ꠧꢀ-ꢁꢴ-꣄꣐-꣙ꣳ-ꣷ꤀-꤉ꤦ-꤭ꤰ-ꥅꦀ-ꦃ꦳-꧀ꨀ-ꨧꩀ-ꩁꩌ-ꩍ꩐-꩙ꩻꫠ-ꫩꫲ-ꫳꯀ-ꯡ꯬꯭꯰-꯹ﬠ-ﬨ︀-️︠-︦︳︴﹍-﹏0-9_]");t.newline=/[\n\r\u2028\u2029]/,t.lineBreak=new RegExp("\r\n|"+t.newline.source),t.allLineBreaks=new RegExp(t.lineBreak.source,"g"),t.isIdentifierStart=function(e){return e<65?36===e||64===e:e<91||(e<97?95===e:e<123||170<=e&&i.test(String.fromCharCode(e)))},t.isIdentifierChar=function(e){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||170<=e&&r.test(String.fromCharCode(e))))}},function(e,t){e.exports.mergeOpts=function(e,t){var n,i={};for(n in e)n!==t&&(i[n]=e[n]);if(t in e)for(n in e[t])i[n]=e[t][n];return i}},function(e,t){function r(t){var n=0,i=-1,r=[],s=!0;this.set_indent=function(e){n=t.baseIndentLength+e*t.indent_length,i=e},this.get_character_count=function(){return n},this.is_empty=function(){return s},this.last=function(){return this._empty?null:r[r.length-1]},this.push=function(e){r.push(e),n+=e.length,s=!1},this.pop=function(){var e=null;return s||(e=r.pop(),n-=e.length,s=0===r.length),e},this.remove_indent=function(){0=this.indent_cache.length;)this.indent_cache.push(this.indent_cache[this.indent_cache.length-1]+this.indent_string);return this.current_line.set_indent(e),!0}return this.current_line.set_indent(0),!1},this.add_raw_token=function(e){for(var t=0;t=this.wrap_line_length?(this.print_newline(!1,e),this.print_indentation(e),!0):(this.line_char_count++,e.push(" "),!1)},this.get_content=function(){for(var e,t,n=[],i=0;"<"!==this.input.charAt(this.pos)||2===i;){if(this.pos>=this.input.length)return n.length?n.join(""):["","TK_EOF"];if(i<2&&this.traverse_whitespace())this.space_or_wrap(n);else{if(t=this.input.charAt(this.pos),b){if("{"===t?i+=1:i<2&&(i=0),"}"===t&&0","igm")).lastIndex=this.pos,e=(e=e.exec(this.input))?e.index:this.input.length,this.pos=this.input.length)return e&&(this.pos=g,this.line_char_count=E),o.length?o.join(""):["","TK_EOF"];if(a=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(a,this.Utils.whitespace))l=!0;else{if("'"!==a&&'"'!==a||(a+=this.get_unformatted(a),l=!0),"="===a&&(l=!1),u=this.input.substr(this.pos-1),!K||!T||m||">"!==a&&"/"!==a||u.match(/^\/?\s*>/)&&(this.print_newline(!(m=!(l=!1)),o),this.print_indentation(o)),o.length&&"="!==o[o.length-1]&&">"!==a&&l){if(h=this.space_or_wrap(o)&&"/"!==a&&!R,l=!1,R&&"/"!==a&&(c=!1,K&&f&&(c=!(null!==u.match(/^\S*(="([^"]|\\")*")?\s*\/?\s*>/))),f&&!c||(this.print_newline(!1,o),this.print_indentation(o),h=!0)),h)for(T=!0,p=k,y&&(p=o.indexOf(" ")+1),d=0;d"!==a);return _=-1!==(r=o.join("")).indexOf(" ")?r.indexOf(" "):-1!==r.indexOf("\n")?r.indexOf("\n"):"{"===r.charAt(0)?r.indexOf("}"):r.indexOf(">"),s="<"!==r.charAt(0)&&b?"#"===r.charAt(2)?3:2:1,s=r.substring(s,_).toLowerCase(),"/"===r.charAt(r.length-2)||this.Utils.in_array(s,this.Utils.single_token)?e||(this.tag_type="SINGLE"):b&&"{"===r.charAt(0)&&"else"===s?e||(this.indent_to_tag("if"),this.tag_type="HANDLEBARS_ELSE",this.indent_content=!0,this.traverse_whitespace()):this.is_unformatted(s,x)||this.is_unformatted(s,w)?(_=this.get_unformatted("",r),o.push(_),this.pos,this.tag_type="SINGLE"):"script"===s&&(-1===r.search("type")||-1",r=!0):0===n.indexOf("",r=!0):0===n.indexOf("",r=!0):0===n.indexOf("\x3c!--")?(i="--\x3e",r=!0):0===n.indexOf("{{!--")?(i="--}}",r=!0):0===n.indexOf("{{!")?5===n.length&&-1===n.indexOf("{{!--")&&(i="}}",r=!0):0===n.indexOf("",r=!0):0===n.indexOf("<%")&&(i="%>",r=!0)),t=this.input.charAt(this.pos),this.pos++;return n},this.get_unformatted=function(e,t){var n,i,r,s,_,a;if(t&&-1!==t.toLowerCase().indexOf(e))return"";r=!(i=""),_=e,a="",s={add:function(e){e=a+e.toLowerCase();a=e.length<=_.length?e:e.substr(e.length-_.length,_.length)},doesNotMatch:function(){return-1===a.indexOf(_)}};do{if(this.pos>=this.input.length)return i;if(n=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(n,this.Utils.whitespace)){if(!r){this.line_char_count--;continue}if("\n"===n||"\r"===n){i+="\n",this.line_char_count=0;continue}}i+=n,s.add(n),this.line_char_count++,r=!0,b&&"{"===n&&i.length&&"{"===i.charAt(i.length-2)&&(i+=this.get_unformatted("}}"))}while(s.doesNotMatch());return i},this.get_token=function(){var e,t;return"TK_TAG_SCRIPT"===this.last_token||"TK_TAG_STYLE"===this.last_token?(t=this.last_token.substr(7),"string"!=typeof(e=this.get_contents_to(t))?e:[e,"TK_"+t]):"CONTENT"===this.current_mode?"string"!=typeof(e=this.get_content())?e:[e,"TK_CONTENT"]:"TAG"===this.current_mode?"string"!=typeof(e=this.get_tag())?e:[e,"TK_TAG_"+this.tag_type]:void 0},this.get_full_indent=function(e){return( +e=this.indent_level+e||0)<1?"":Array(e+1).join(this.indent_string)},this.is_unformatted=function(e,t){return!!this.Utils.in_array(e,t)&&("a"!==e.toLowerCase()||!this.Utils.in_array("a",t)||!((e=(this.get_tag(!0)||"").match(/^\s*<\s*\/?([a-z]*)\s*[^>]*>\s*$/))&&!this.Utils.in_array(e[1],t)))},this.printer=function(e,t,n,i,r){this.input=e||"",this.input=this.input.replace(/\r\n|[\r\u2028\u2029]/g,"\n"),this.output=[],this.indent_character=t,this.indent_string="",this.indent_size=n,this.brace_style=r,this.indent_level=0,this.wrap_line_length=i;for(var s=this.line_char_count=0;s/)||!c.indent_head_inner_html&&c.token_text.match(//)||c.indent(),c.indent_content=!1),c.current_mode="CONTENT";break;case"TK_TAG_STYLE":case"TK_TAG_SCRIPT":c.print_newline(!1,c.output),c.print_token(c.token_text),c.current_mode="CONTENT";break;case"TK_TAG_END":"TK_CONTENT"===c.last_token&&""===c.last_text&&(t=(c.token_text.match(/\w+/)||[])[0],(r=null)!==(r=c.output.length?c.output[c.output.length-1].match(/(?:<|{{#)\s*(\w+)/):r)&&(r[1]===t||c.Utils.in_array(r[1],x))||c.print_newline(!1,c.output)),c.print_token(c.token_text),c.current_mode="CONTENT";break;case"TK_TAG_SINGLE":(t=c.token_text.match(/^\s*<([a-z-]+)/i))&&c.Utils.in_array(t[1],x)||c.print_newline(!1,c.output),c.print_token(c.token_text),c.current_mode="CONTENT";break;case"TK_TAG_HANDLEBARS_ELSE":for(n=!1,i=c.output.length-1;0<=i&&"\n"!==c.output[i];i--)if(c.output[i].match(/{{#if/)){n=!0;break}n||c.print_newline(!1,c.output),c.print_token(c.token_text),c.indent_content&&(c.indent(),c.indent_content=!1),c.current_mode="CONTENT";break;case"TK_TAG_HANDLEBARS_COMMENT":case"TK_CONTENT":c.print_token(c.token_text),c.current_mode="TAG";break;case"TK_STYLE":case"TK_SCRIPT":""!==c.token_text&&(c.print_newline(!1,c.output),r=c.token_text,o=1,"TK_SCRIPT"===c.token_type?s="function"==typeof T&&T:"TK_STYLE"===c.token_type&&(s="function"==typeof g&&g),"keep"===h.indent_scripts?o=0:"separate"===h.indent_scripts&&(o=-c.indent_level),_=c.get_full_indent(o),(r=s?((a=function(){this.eol="\n"}).prototype=h,a=new a,s(r.replace(/^\s*/,_),a)):(a=r.match(/^\s*/)[0].match(/[^\n\r]*$/)[0].split(c.indent_string).length-1,o=c.get_full_indent(o-a),r.replace(/^\s*/,_).replace(/\r\n|\r|\n/g,"\n"+o).replace(/\s+$/,"")))&&(c.print_token_raw(r),c.print_newline(!0,c.output))),c.current_mode="TAG";break;default:""!==c.token_text&&c.print_token(c.token_text)}c.last_token=c.token_type,c.last_text=c.token_text}return l=c.output.join("").replace(/[\r\n\t ]+$/,""),O&&(l+="\n"),l="\n"!==f?l.replace(/[\n]/g,f):l}}},function(e,t){ +var n="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",i=new RegExp("["+n+"]"),r=new RegExp("["+n+"̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ؚؠ-ىٲ-ۓۧ-ۨۻ-ۼܰ-݊ࠀ-ࠔࠛ-ࠣࠥ-ࠧࠩ-࠭ࡀ-ࡗࣤ-ࣾऀ-ःऺ-़ा-ॏ॑-ॗॢ-ॣ०-९ঁ-ঃ়া-ৄেৈৗয়-ৠਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୟ-ୠ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఁ-ఃె-ైొ-్ౕౖౢ-ౣ౦-౯ಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢ-ೣ೦-೯ംഃെ-ൈൗൢ-ൣ൦-൯ංඃ්ා-ුූෘ-ෟෲෳิ-ฺเ-ๅ๐-๙ິ-ູ່-ໍ໐-໙༘༙༠-༩༹༵༷ཁ-ཇཱ-྄྆-྇ྍ-ྗྙ-ྼ࿆က-ဩ၀-၉ၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟ᜎ-ᜐᜠ-ᜰᝀ-ᝐᝲᝳក-ឲ៝០-៩᠋-᠍᠐-᠙ᤠ-ᤫᤰ-᤻ᥑ-ᥭᦰ-ᧀᧈ-ᧉ᧐-᧙ᨀ-ᨕᨠ-ᩓ᩠-᩿᩼-᪉᪐-᪙ᭆ-ᭋ᭐-᭙᭫-᭳᮰-᮹᯦-᯳ᰀ-ᰢ᱀-᱉ᱛ-ᱽ᳐-᳒ᴀ-ᶾḁ-ἕ‌‍‿⁀⁔⃐-⃥⃜⃡-⃰ⶁ-ⶖⷠ-ⷿ〡-〨゙゚Ꙁ-ꙭꙴ-꙽ꚟ꛰-꛱ꟸ-ꠀ꠆ꠋꠣ-ꠧꢀ-ꢁꢴ-꣄꣐-꣙ꣳ-ꣷ꤀-꤉ꤦ-꤭ꤰ-ꥅꦀ-ꦃ꦳-꧀ꨀ-ꨧꩀ-ꩁꩌ-ꩍ꩐-꩙ꩻꫠ-ꫩꫲ-ꫳꯀ-ꯡ꯬꯭꯰-꯹ﬠ-ﬨ︀-️︠-︦︳︴﹍-﹏0-9_]");t.newline=/[\n\r\u2028\u2029]/,t.lineBreak=new RegExp("\r\n|"+t.newline.source),t.allLineBreaks=new RegExp(t.lineBreak.source,"g"),t.isIdentifierStart=function(e){return e<65?36===e||64===e:e<91||(e<97?95===e:e<123||170<=e&&i.test(String.fromCharCode(e)))},t.isIdentifierChar=function(e){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||170<=e&&r.test(String.fromCharCode(e))))}},function(e,t){e.exports.mergeOpts=function(e,t){var n,i={};for(n in e)n!==t&&(i[n]=e[n]);if(t in e)for(n in e[t])i[n]=e[t][n];return i}},function(e,t,n){var r=n(0).Beautifier;e.exports=function(e,t,n,i){return new r(e,t,n,i).beautify()}}],s={},l.m=d,l.c=s,l.i=function(e){return e},l.d=function(e,t,n){l.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},l.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="",e=l(l.s=3),_=e,void 0!==t?(p=c=t).html_beautify=function(e,t){return _(e,t,c.js_beautify,p.css_beautify)}:"undefined"!=typeof window?window.html_beautify=function(e,t){return _(e,t,window.js_beautify,window.css_beautify)}:"undefined"!=typeof global&&(global.html_beautify=function(e,t){return _(e,t,global.js_beautify,global.css_beautify)})},"@VERSION@"); \ No newline at end of file diff --git a/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-codemirror/moodle-atto_html-codemirror-min.js b/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-codemirror/moodle-atto_html-codemirror-min.js index e9ddc932125..499b99ca7bd 100644 --- a/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-codemirror/moodle-atto_html-codemirror-min.js +++ b/lib/editor/atto/plugins/html/yui/build/moodle-atto_html-codemirror/moodle-atto_html-codemirror-min.js @@ -1,37 +1,37 @@ -YUI.add("moodle-atto_html-codemirror",function(e,t){var n,r,i,o,l,a,s,c=window.codeMirror,u=null;r=this,i=function(){"use strict";var i,p,l,C,c,s,a,y,m,L,d,t,n,r,g,o,u,T,f,v,b,w,h,x,S,k,M,N,A,O,D,W,z,P,H,I,E,F,R,B,j,e,V,K,G,U,q,_,$,X,Y,Z,Q,J,ee,te,ne,re,ie,oe,le,ae,se,ce,ue,de,fe,he,pe,me,ge,ye,ve,be,we,xe,ke,Ce,Se,Le,Te,Me,Ne,Ae,Oe,De,We,ze=navigator.userAgent,Pe=navigator.platform,He=/gecko\/\d/i.test(ze),Ie=/MSIE \d/.test(ze),Ee=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ze),Fe=/Edge\/(\d+)/.exec(ze),Re=Ie||Ee||Fe,Be=Re&&(Ie?document.documentMode||6:+(Fe||Ee)[1]),je=!Fe&&/WebKit\//.test(ze),Ve=je&&/Qt\/\d+\.\d+/.test(ze),Ke=!Fe&&/Chrome\//.test(ze),Ge=/Opera\//.test(ze),Ue=/Apple Computer/.test(navigator.vendor),qe=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ze),_e=/PhantomJS/.test(ze),$e=!Fe&&/AppleWebKit/.test(ze)&&/Mobile\/\w+/.test(ze),Xe=/Android/.test(ze),Ye=$e||Xe||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ze),Ze=$e||/Mac/.test(Pe),Qe=/\bCrOS\b/.test(ze),Je=/win/i.test(Pe),et=Ge&&ze.match(/Version\/(\d*\.\d*)/);function tt(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function nt(e){for(var t=e.childNodes.length;0t)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:g=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:g=i)}return null!=r?r:g}function Mt(e,t,n){this.level=e,this.from=t,this.to=n}function Nt(e,t){var n=e.order;return null==n&&(n=e.order=o(e.text,t)),n}function At(e,t){return e._handlers&&e._handlers[t]||u}function Ot(e,t,n){var r,i,o;e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent?e.detachEvent("on"+t,n):(i=(r=e._handlers)&&r[t])&&-1<(o=ht(i,n))&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}function Dt(e,t){var n,r,i=At(e,t);if(i.length)for(n=Array.prototype.slice.call(arguments,2),r=0;r=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(n=e;!n.lines;)for(r=0;;++r){if(t<(o=(i=n.children[r]).chunkSize())){n=i;break}t-=o}return n.lines[t]}function Xt(e,n,r){var i=[],o=n.line;return e.iter(n.line,r.line+1,function(e){var t=e.text;o==r.line&&(t=t.slice(0,r.ch)),o==n.line&&(t=t.slice(n.ch)),i.push(t),++o}),i}function Yt(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function Zt(e,t){var n,r=t-e.height;if(r)for(n=e;n;n=n.parent)n.height+=r}function Qt(e){var t,n,r,i;if(null==e.parent)return null;for(n=ht((t=e.parent).lines,e),r=t.parent;r;r=(t=r).parent)for(i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function Jt(e,t){var n,r,i,o,l,a=e.first;e:do{for(n=0;n=e.first&&tn?nn(n,$t(e,n).text.length):function r(e,t){var n=e.ch;return null==n||te.options.maxHighlightLength&&Ut(e.doc.mode,r.state),o=fn(e,t,r),i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))),t.styles}function pn(n,r,e){var t,i,o,l=n.doc,a=n.display;return l.mode.startState?(i=(t=function d(e,t,n){var r,i,o,l,a,s,c,u;for(o=e.doc,l=n?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;ll.first&&$t(l,t-1).stateAfter,o=i?D.fromSaved(l,i,t):new D(l,_t(l.mode),t),l.iter(t,r,function(e){mn(n,e.text,o);var t=o.line;e.stateAfter=t==r-1||t%5==0||t>=a.viewFrom&&tt.start)return o;throw new Error("Mode "+e.name+" failed to advance stream.")}function vn(e,t,n,r){var i,o,l,a,s,c=e.doc,u=c.mode;for(o=$t(c,(t=un(c,t)).line),l=pn(e,t.line,n),a=new A(o.text,e.options.tabSize,l),r&&(s=[]);(r||a.pose.options.maxHighlightLength?(p=!1,l&&mn(e,t,r,c.pos),c.pos=t.length,null):bn(yn(n,c,r.state,d),o),d&&(f=d[0].name)&&(u="m-"+(u?f+" "+u:f)),!p||s!=u){for(;a=t:o.to>t),(r=r||[]).push(new xn(l,o.from, -a?null:o.to)));return r}(n,i,l=0==rn(t.from,t.to)),s=function k(e,t,n){var r,i,o,l,a;if(e)for(i=0;i=t:o.to>t))&&(o.from!=t||"bookmark"!=l.type||n&&!o.marker.insertLeft)||(a=null==o.from||(l.inclusiveLeft?o.from<=t:o.fromt)&&(!n||On(n,i.marker)<0)&&(n=i.marker);return n}function Hn(e,t,n,r,i){var o,l,a,s,c,u=$t(e,t),d=P&&u.markedSpans;if(d)for(o=0;oe.lastLine())return t;var n,r=$t(e,t);if(!Rn(e,r))return t;for(;n=zn(r);)r=n.find(1,!0).line;return Qt(r)+1}function Rn(e,t){var n,r,i=P&&t.markedSpans;if(i)for(n=void 0,r=0;rn.maxLineLength&&(n.maxLineLength=t,n.maxLine=e)})}function Gn(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?E:I;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Un(e,t){var n,r,i,o,l,a,s,c,u,d,f,h=ot("span",null,null,je?"padding-right: .1px":null),p={pre:ot("pre",[h],"CodeMirror-line"),content:h,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};for(t.measure={},n=0;n<=(t.rest?t.rest.length:0);n++)r=n?t.rest[n-1]:t.line,i=void 0,p.pos=0,p.addToken=_n,c=e.display.measure,f=d=u=void 0,(null!=b?b:(u=rt(c,document.createTextNode("AخA")),d=C(u,0,1).getBoundingClientRect(),f=C(u,1,2).getBoundingClientRect(),nt(c),d&&d.left!=d.right&&(b=f.right-d.right<3)))&&(i=Nt(r,e.doc.direction))&&(p.addToken=$n(p.addToken,i)),p.map=[],Yn(r,p,hn(e,r,t!=e.display.externalMeasured&&Qt(r))),r.styleClasses&&(r.styleClasses.bgClass&&(p.bgClass=ct(r.styleClasses.bgClass,p.bgClass||"")),r.styleClasses.textClass&&(p.textClass=ct(r.styleClasses.textClass,p.textClass||""))),0==p.map.length&&p.map.push(0,0,p.content.appendChild((l=e.display.measure,s=a=void 0,null==v&&(a=it("span","​"),rt(l,it("span",[a,document.createTextNode("x")])),0!=l.firstChild.offsetHeight&&(v=a.offsetWidth<=1&&2a&&c.from<=a);u++);if(c.to>=s)return d(e,t,n,r,i,o,l);d(e,t.slice(0,c.to-a),n,r,null,o,l),r=null,t=t.slice(c.to-a),a=c.to}}}function Xn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i=i||e.content.appendChild(document.createElement("span"))).setAttribute("cm-marker",n.id),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function Yn(e,t,n){var r,i,o,l,a,s,c,u,d,f,h,p,m,g,y,v,b,w,x,k,C,S,L,T,M=e.markedSpans,N=e.text,A=0;if(M)for(i=N.length,l=1,a="",u=o=0;;){if(u==o){for(d=f=h=c="",p=m=null,u=Infinity,g=[],y=void 0,v=0;vo||w.collapsed&&b.to==o&&b.from==o)){if(null!=b.to&&b.to!=o&&u>b.to&&(u=b.to,f=""),w.className&&(d+=" "+w.className),w.css&&(c=(c?c+";":"")+w.css),w.startStyle&&b.from==o&&(h+=" "+w.startStyle),w.endStyle&&b.to==u&&(y=y||[]).push(w.endStyle,b.to),w.title&&((m=m||{}).title=w.title),w.attributes)for(x in w.attributes)(m=m||{})[x]=w.attributes[x];w.collapsed&&(!p||On(p.marker,w)<0)&&(p=b)}else b.from>o&&u>b.from&&(u=b.from);if(y)for(k=0;kn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function xr(e,t,n,r){return Sr(e,Cr(e,t),n,r)}function kr(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(i=(o=s-a)-1,s<=t&&(l="right")),null!=i){if(r=e[c+2],a==s&&n==(r.insertLeft?"left":"right")&&(l=n),"left"==n&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[2+(c-=3)],l="left";if("right"==n&&i==s-a)for(;c=o.text.length?(t=o.text.length,n="before"):t<=0&&(t=0,n="after"),!s)return f("before"==n?t-1:t,"before"==n);function h(e,t,n){return f(n?e-1:e,1==s[t].level!=n)}return c=Tt(s,t,n),u=g,d=h(t,c,"before"==n),null!=u&&(d.other=h(t,u,"before"!=n)),d}function Er(e,t){var n,r,i=0;return t=un(e.doc,t),e.options.lineWrapping||(i=Ur(e.display)*t.ch),{left:i,right:i,top:r=jn(n=$t(e.doc,t.line))+pr(e.display),bottom:r+n.height}}function Fr(e,t,n,r,i){var o=nn(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Rr(e,t,n){var r,i,o,l,a,s,c=e.doc;if((n+=e.display.viewOffset)<0)return Fr(c.first,0,null,-1,-1);if(r=Jt(c,n),(i=c.first+c.size-1)r},o,i)}}function jr(e,t,n,r){return Br(e,t,n=n||Cr(e,t),zr(e,t,Sr(e,n,r),"line").top)}function Vr(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function Kr(n,e,t,r,i){var o,l,a,s,c,u,d,f,h,p,m,g,y,v,b,w;return i-=jn(e),o=Cr(n,e),l=Wr(e),a=0,s=e.text.length,c=!0,(u=Nt(e,n.doc.direction))&&(a=(c=1!=(d=(n.options.lineWrapping?function x(e,t,n,r,i,o,l){var a,s,c,u,d,f,h,p=Br(e,t,r,l),m=p.begin,g=p.end;/\s/.test(t.text.charAt(g-1))&&g--;for(a=null,s=null,c=0;c=g||u.to<=m||(d=1!=u.level,f=Sr(e,r,d?Math.min(g,u.to)-1:Math.max(m,u.from)).right,h=fg&&(a={from:a.from,to:g,level:a.level});return a}:function k(r,i,o,l,a,s,c){var e,t,n=Lt(function(e){var t=a[e],n=1!=t.level;return Vr(Ir(r,nn(o,n?t.to:t.from,n?"before":"after"),"line",i,l),s,c,!0)},0,a.length-1),u=a[n];0c&&(u=a[n-1]));return u})(n,e,t,o,u,r,i)).level)?d.from:d.to-1,s=c?d.to:d.from-1),h=f=null,p=Lt(function(e){var t=Sr(n,o,e);return t.top+=l,t.bottom+=l,Vr(t,r,i,!1)&&(t.top<=i&&t.left<=r&&(f=e,h=t),1)},a,s),y=!1,h?(v=r-h.left=w.bottom?1:0),Fr(t,p=St(e.text,p,1),g,y,r-m)}function Gr(e){var t,n;if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==j){for(j=it("pre",null,"CodeMirror-line-like"),t=0;t<49;++t)j.appendChild(document.createTextNode("x")),j.appendChild(it("br"));j.appendChild(document.createTextNode("x"))}return rt(e.measure,j),3<(n=j.offsetHeight/50)&&(e.cachedTextHeight=n),nt(e.measure),n||1}function Ur(e){var t,n,r,i;return null!=e.cachedCharWidth?e.cachedCharWidth:(t=it("span","xxxxxxxxxx"),n=it("pre",[t],"CodeMirror-line-like"),rt(e.measure,n),2<(i=((r=t.getBoundingClientRect()).right-r.left)/10)&&(e.cachedCharWidth=i),i||10)}function qr(e){var t,n,r,i=e.display,o={},l={},a=i.gutters.clientLeft;for(t=i.gutters.firstChild,n=0;t;t=t.nextSibling,++n)o[r=e.display.gutterSpecs[n].className]=t.offsetLeft+t.clientLeft+a,l[r]=t.clientWidth;return{fixedPos:_r(i),gutterTotalWidth:i.gutters.offsetWidth,gutterLeft:o,gutterWidth:l,wrapperWidth:i.wrapper.clientWidth}}function _r(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function $r(r){var i=Gr(r.display),o=r.options.lineWrapping, -l=o&&Math.max(5,r.display.scroller.clientWidth/Ur(r.display)-3);return function(e){var t,n;if(Rn(r.doc,e))return 0;if(t=0,e.widgets)for(n=0;n=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo?P&&En(e.doc,t)i.viewFrom?ei(e):(i.viewFrom+=r,i.viewTo+=r):t<=i.viewFrom&&n>=i.viewTo?ei(e):t<=i.viewFrom?(o=ti(e,n,n+r,1))?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):ei(e):n>=i.viewTo?(l=ti(e,t,t,-1))?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):ei(e):(a=ti(e,t,t,-1),s=ti(e,n,n+r,1),a&&s?(i.view=i.view.slice(0,a.index).concat(Qn(e,a.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):ei(e)),(c=i.externalMeasured)&&(n=i.lineN&&t=r.viewTo||null!=(o=r.view[Zr(e,t)]).node&&-1==ht(l=o.changes||(o.changes=[]),n)&&l.push(n)}function ei(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function ti(e,t,n,r){var i,o,l,a=Zr(e,t),s=e.display.view;if(!P||n==e.doc.first+e.doc.size)return{index:a,lineN:n};for(o=e.display.viewFrom,l=0;l=e.display.viewTo||a.to().linet||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),1==l.level?"rtl":"ltr",o),i=!0);i||r(t,n,"ltr")}(k=Nt(l,d.direction),v||0,null==b?C:b,function(e,t,n,r){var i,o,l,a,s,c,u,d="ltr"==n,f=S(e,d?"left":"right"),h=S(t-1,d?"right":"left"),p=null==v&&0==e,m=null==b&&t==C,g=0==r,y=!k||r==k.length-1;h.top-f.top<=3?(i=(N?m:p)&&y,o=(N?p:m)&&g?T:(d?f:h).left,l=i?M:(d?h:f).right,A(o,f.top,l-o,f.bottom)):(u=d?(a=N&&p&&g?T:f.left,s=N?M:L(e,n,"before"),c=N?T:L(t,n,"after"),N&&m&&y?M:h.right):(a=N?L(e,n,"before"):T,s=!N&&p&&g?M:f.right,c=!N&&m&&y?T:h.left,N?L(t,n,"after"):M),A(a,f.top,s-a,f.bottom),f.bottome.display.sizerWidth&&(u=Math.ceil(o/Ur(e.display)))>e.display.maxLineLength&&(e.display.maxLineLength=u,e.display.maxLine=n.line,e.display.maxLineChanged=!0)}}function pi(e){var t,n,r;if(e.widgets)for(t=0;t=o&&(i=Jt(t,jn($t(t,a))-e.wrapper.clientHeight),o=a)),{from:i,to:Math.max(o,i+1)}}function gi(e,t){var n,r,i,o,l,a,s,c,u,d,f=e.display,h=Gr(e.display);return t.top<0&&(t.top=0),n=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:f.scroller.scrollTop,r=br(e),i={},t.bottom-t.top>r&&(t.bottom=t.top+r),o=e.doc.height+mr(f),l=t.topo-h,t.topn+r&&(s=Math.min(t.top,(a?o:t.bottom)-r))!=n&&(i.scrollTop=s),c=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:f.scroller.scrollLeft,u=vr(e)-(e.options.fixedGutter?f.gutters.offsetWidth:0),(d=t.right-t.left>u)&&(t.right=t.left+u),t.left<10?i.scrollLeft=0:t.leftu+c-3&&(i.scrollLeft=t.right+(d?0:10)-u),i}function yi(e,t){null!=t&&(wi(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function vi(e){wi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function bi(e,t,n){null==t&&null==n||wi(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function wi(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,xi(e,Er(e,t.from),Er(e,t.to),t.margin))}function xi(e,t,n,r){var i=gi(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});bi(e,i.scrollLeft,i.scrollTop)}function ki(e,t){Math.abs(e.doc.scrollTop-t)<2||(He||Ki(e,{top:t}),Ci(e,t,!0),He&&Ki(e),Ri(e,100))}function Ci(e,t,n){t=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t),e.display.scroller.scrollTop==t&&!n||(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Si(e,t,n,r){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,qi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Li(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+mr(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+yr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function Ti(e,t){var n,r,i;for(t=t||Li(e),n=e.display.barWidth,r=e.display.barHeight,Mi(e,t),i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&hi(e),Mi(e,Li(e)),n=e.display.barWidth,r=e.display.barHeight}function Mi(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}function Ni(n){n.display.scrollbars&&(n.display.scrollbars.clear(),n.display.scrollbars.addClass&&l(n.display.wrapper,n.display.scrollbars.addClass)),n.display.scrollbars=new K[n.options.scrollbarStyle](function(e){n.display.wrapper.insertBefore(e,n.display.scrollbarFiller),T(e,"mousedown",function(){n.state.focused&&setTimeout(function(){return n.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,t){("horizontal"==t?Si:ki)(n,e)},n),n.display.scrollbars.addClass&&st(n.display.wrapper,n.display.scrollbars.addClass)}function Ai(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++G},function t(e){F?F.ops.push(e -):e.ownsGroup=F={ops:[e],delayedCallbacks:[]}}(e.curOp)}function Oi(e){var t=e.curOp;t&&Jn(t,function(e){for(var t=0;t=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new U(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Wi(e){var t=e.cm,n=t.display;e.updatedDisplay&&hi(t),e.barMeasure=Li(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=xr(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+yr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-vr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function zi(e){var t,n=e.cm;null!=e.adjustWidthTo&&(n.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null==i||_e||(o=it("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-pr(e.display))+"px;\n height: "+(t.bottom-t.top+yr(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;"),e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)))}(o,function f(e,t,n,r){var i,o,l,a,s,c,u,d;for(null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==(t=t.ch?nn(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?nn(t.line,t.ch+1,"before"):t),o=0;o<5&&(l=!1,a=Ir(e,t),s=n&&n!=t?Ir(e,n):a,c=gi(e,i={left:Math.min(a.left,s.left),top:Math.min(a.top,s.top)-r,right:Math.max(a.left,s.left),bottom:Math.max(a.bottom,s.bottom)+r}),u=e.doc.scrollTop,d=e.doc.scrollLeft,null!=c.scrollTop&&(ki(e,c.scrollTop),1=s.display.viewTo||(c=+new Date+s.options.workTime,u=pn(s,f.highlightFrontier),d=[],f.iter(u.line,Math.min(f.first+f.size,s.display.viewTo+500),function(e){var t,n,r,i,o,l,a;if(u.line>=s.display.viewFrom){for(t=e.styles,n=e.text.length>s.options.maxHighlightLength?Ut(f.mode,u.state):null,r=fn(s,e,u,!0),n&&(u.state=n),e.styles=r.styles,i=e.styleClasses,(o=r.classes)?e.styleClasses=o:i&&(e.styleClasses=null),l=!t||t.length!=e.styles.length||i!=o&&(!i||!o||i.bgClass!=o.bgClass||i.textClass!=o.textClass),a=0;!l&&ac)return Ri(s,s.options.workDelay),!0}),f.highlightFrontier=u.line,f.modeFrontier=Math.max(f.modeFrontier,u.line),d.length&&Hi(s,function(){for(var e=0;e=s.viewFrom&&t.visible.to<=s.viewTo&&(null==s.updateLineNumbers||s.updateLineNumbers>=s.viewTo)&&s.renderedView==s.view&&0==ni(e))&&(_i(e)&&(ei(e),t.dims=qr(e)),n=c.first+c.size,r=Math.max(t.visible.from-e.options.viewportMargin,c.first),i=Math.min(n,t.visible.to+e.options.viewportMargin),s.viewFromi&&s.viewTo-i<20&&(i=Math.min(n,s.viewTo)),P&&(r=En(e.doc,r),i=Fn(e.doc,i)),o=r!=s.viewFrom||i!=s.viewTo||s.lastWrapHeight!=t.wrapperHeight||s.lastWrapWidth!=t.wrapperWidth,function u(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=Qn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Qn(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Zr(e,n)))),r.viewTo=n}(e,r,i),s.viewOffset=jn($t(e.doc,s.viewFrom)),e.display.mover.style.top=s.viewOffset+"px",l=ni(e),!(!o&&0==l&&!t.force&&s.renderedView==s.view&&(null==s.updateLineNumbers||s.updateLineNumbers>=s.viewTo))&&(a=function d(e){var t,n,r;return!e.hasFocus()&&(t=at())&<(e.display.lineDiv,t)?(n={activeElt:t},window.getSelection&&(r=window.getSelection()).anchorNode&&r.extend&<(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset),n):null}(e),4=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&ji(e,t);n=!1)hi(e),r=Li(e),ri(e),Ti(e,r),Ui(e,r),t.force=!1;t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Ki(e,t){var n,r=new U(e,t);ji(e,r)&&(hi(e),Vi(e,r),n=Li(e),ri(e),Ti(e,n),Ui(e,n),r.finish())}function Gi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Ui(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+yr(e)+"px"}function qi(e){var t,n,r,i,o,l,a=e.display,s=a.view;if(a.alignWidgets||a.gutters.firstChild&&e.options.fixedGutter){for(t=_r(a)-a.scroller.scrollLeft+e.doc.scrollLeft,n=a.gutters.offsetWidth,r=t+"px",i=0;if.clientWidth,p=f.scrollHeight>f.clientHeight;if(c&&h||u&&p){if(u&&Ze&&je)e:for(n=t.target,r=d.view;n!=f;n=n.parentNode)for(i=0;ii-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function c(e,t){return t?(yo(e.done),gt(e.done)):e.done.length&&!gt(e.done).ranges?gt(e.done):1s.undoDepth;)s.done.shift(),s.done[0].ranges||s.done.shift();s.done.push(n),s.generation=++s.maxGeneration,s.lastModTime=s.lastSelTime=i,s.lastOp=s.lastSelOp=r,s.lastOrigin=s.lastSelOrigin=t.origin,l||Dt(e,"historyAdded")}function bo(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function l(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,gt(i.done),t))?i.done[i.done.length-1]=t:wo(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&yo(i.undone)}function wo(e,t){var n=gt(t);n&&n.ranges&&n.equals(e)||t.push(e)}function xo(t,n,e,r){var i=n["spans_"+t.id],o=0;t.iter(Math.max(t.first,e),Math.min(t.first+t.size,r),function(e){e.markedSpans&&((i=i||(n["spans_"+t.id]={}))[o]=e.markedSpans),++o})}function ko(e){var t,n;if(!e)return null;for(n=0;n=t.ch:l.to>t.ch))){if(i&&(Dt(a,"beforeCursorEnter"),a.explicitlyCleared)){if(h.markedSpans){--o;continue}break}if(!a.atomic)continue;return n&&(u=a.find(r<0?1:-1),d=void 0,(r<0?c:s)&&(u=Fo(e,u,-r,u&&u.line==t.line?h:null)),u&&u.line==t.line&&(d=rn(u,n))&&(r<0?d<0:0e.first?un(e,nn(t.line-1)):null:0e.lastLine()||(t.from.lineo&&(t={from:t.from,to:nn(o,$t(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Xt(e,t.from,t.to),n=n||oo(e,t),e.cm?function p(e,t,n){var r,i,o,l,a=e.doc,s=e.display,c=t.from,u=t.to,d=!1,f=c.line;e.options.lineWrapping||(f=Qt(In($t(a,c.line))),a.iter(f,u.line+1,function(e){if(e==s.maxLine)return d=!0}));-1s.maxLineLength&&(s.maxLine=e,s.maxLineLength=t,s.maxLineChanged=!0,d=!1)}),d&&(e.curOp.updateMaxLine=!0));(function h(e,t){var n,r,i;if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier=this.string.length},A.prototype.sol=function(){return this.pos==this.lineStart},A.prototype.peek=function(){return this.string.charAt(this.pos)||undefined},A.prototype.next=function(){if(this.post},A.prototype.eatSpace=function(){for(var e=this,t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++e.pos;return this.pos>t},A.prototype.skipToEnd=function(){this.pos=this.string.length},A.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(-1this.maxLookAhead&&(this.maxLookAhead=e),t},D.prototype.baseToken=function(e){var t,n=this;if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)n.baseTokenPos+=2;return{type:(t=this.baseTokens[this.baseTokenPos+1])&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},D.prototype.nextLine=function(){this.line++,0e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,o=e.nativeBarWidth;return i?(this.vert.style.display="block",this.vert.style.bottom=r?o+"px":"0",t=e.viewHeight-(r?o:0),this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+t)+"px"):(this.vert.style.display="",this.vert.firstChild.style.height="0"),r?(this.horiz.style.display="block",this.horiz.style.right=i?o+"px":"0",this.horiz.style.left=e.barLeft+"px",n=e.viewWidth-e.barLeft-(i?o:0),this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+n)+"px"):(this.horiz.style.display="",this.horiz.firstChild.style.width="0"),!this.checkedZeroWidth&&0e.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0);null!=r&&e&&this.collapsed&&Qr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Po(e.doc)),e&&er(e,"markerCleared",e,this,r,i),t&&Oi(e),this.parent&&this.parent.clear()}},Q.prototype.find=function(e,t){var n,r,i,o,l,a=this;for(null==e&&"bookmark"==this.type&&(e=1),i=0;i=e.ch)&&t.push(i.marker.parent||i.marker);return t},findMarks:function(i,o,l){i=un(this,i),o=un(this,o);var a=[],s=i.line;return this.iter(i.line,o.line+1,function(e){var t,n,r=e.markedSpans;if(r)for(t=0;t=n.to||null==n.from&&s!=i.line||null!=n.from&&s==o.line&&n.from>=o.ch||l&&!l(n.marker)||a.push(n.marker.parent||n.marker);++s}),a},getAllMarks:function(){var r=[];return this.iter(function(e){var t,n=e.markedSpans;if(n)for(t=0;tt&&(t=e.from),null!=e.to&&e.toe.text.length?null:r}function yl(e,t,n){var r=gl(e,t.ch,n);return null==r?null:new nn(t.line,r,n<0?"after":"before")}function vl(e,t,n,r,i){var o,l,a,s,c,u;return e&&(o=Nt(n,t.doc.direction))?(a=i<0==(1==(l=i<0?gt(o):o[0]).level)?"after":"before",0u&&t.push(new X(nn(a,u),nn(a,pt(c,l,n))));t.length||t.push(new X(v,v)),Do(S,to(y,k.ranges.slice(0,x).concat(t),x),{origin:"*mouse",scroll:!1}),y.scrollIntoView(e)}else d=w,f=Al(y,e,b.unit),h=d.anchor,h=0=t.to||i.linel.bottom?20:0)&&setTimeout(Ii(y,function(){a==r&&(s.scroller.scrollTop+=n,o(e))}),50))}:u)(e)}),i=Ii(y,u);y.state.selectingText=i,T(s.wrapper.ownerDocument,"mousemove",r),T(s.wrapper.ownerDocument,"mouseup",i)})(e,r,t,o)}(i,t,r,e):Bt(e)==o.scroller&&It(e):2==n?(t&&To(i.doc,t),setTimeout(function(){return o.input.focus()},20)):3==n&&(p?i.display.input.onContextMenu(e):ui(i)))))}function Al(e,t,n){if("char"==n)return new X(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new X(nn(t.line,0),un(e.doc,nn(t.line+1,0)));var r=n(e,t);return new X(r.from,r.to)}function Ol(e,t,n,r){var i,o,l,a,s,c;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{ -i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;if(r&&It(t),o>(a=(l=e.display).lineDiv.getBoundingClientRect()).bottom||!Pt(e,n))return Ft(t);for(o-=a.top-l.viewOffset,s=0;s=i)return Dt(e,n,e,Jt(e.doc,o),e.display.gutterSpecs[s].className,t),Ft(t)}function Dl(e,t){return Ol(e,t,"gutterClick",!0)}function Wl(e,t){hr(e.display,t)||function n(e,t){return Pt(e,"gutterContextMenu")&&Ol(e,t,"gutterContextMenu",!1)}(e,t)||Wt(e,t,"contextmenu")||p||e.display.input.onContextMenu(t)}function zl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Ar(e)}function Pl(e,t,n){var r,i,o=n&&n!=ge;!t!=!o&&(r=e.display.dragFunctions,(i=t?T:Ot)(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop))}function Hl(e){e.options.lineWrapping?(st(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(l(e.display.wrapper,"CodeMirror-wrap"),Kn(e)),Xr(e),Qr(e),Ar(e),setTimeout(function(){return Ti(e)},100)}function Il(e,t){var n,r,i,o,l,a=this;if(!(this instanceof Il))return new Il(e,t);for(o in this.options=t=t?dt(t):{},dt(ye,t,!1),"string"==typeof(n=t.value)?n=new te(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n,r=new Il.inputStyles[t.inputStyle](this),zl((i=this.display=new Zi(e,n,r,t)).wrapper.CodeMirror=this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ni(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new s,keySeq:null,specialChars:null},t.autofocus&&!Ye&&i.input.focus(),Re&&Be<11&&setTimeout(function(){return a.display.input.reset(!0)},20),function c(o){var r,i,e,l=o.display;T(l.scroller,"mousedown",Ii(o,Nl)),T(l.scroller,"dblclick",Re&&Be<11?Ii(o,function(e){var t,n;Wt(o,e)||!(t=Yr(o,e))||Dl(o,e)||hr(o.display,e)||(It(e),n=o.findWordAt(t),To(o.doc,n.anchor,n.head))}):function(e){return Wt(o,e)||It(e)});T(l.scroller,"contextmenu",function(e){return Wl(o,e)});i={end:0};function a(){l.activeTouch&&(r=setTimeout(function(){return l.activeTouch=null},1e3),(i=l.activeTouch).end=+new Date)}function s(e,t){if(null==t.left)return 1;var n=t.left-e.left,r=t.top-e.top;return 400g.first?ft($t(g,t-1).text,null,o):0:"add"==n?c=a+e.options.indentUnit:"subtract"==n?c=a-e.options.indentUnit:"number"==typeof n&&(c=a+n),c=Math.max(0,c),u="",d=0,e.options.indentWithTabs)for(f=Math.floor(c/o);f;--f)d+=o,u+="\t";if(do,a=w(t),s=null,l&&1o?"cut":"+input")},jo(e.doc,m),er(e,"inputRead",e,m);t&&!l&&jl(e,t),vi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=u),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Bl(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");return n&&(e.preventDefault(),t.isReadOnly()||t.options.disableInput||Hi(t,function(){return Rl(t,n,0,null,"paste")}),1)}function jl(e,t){var n,r,i,o,l,a;if(e.options.electricChars&&e.options.smartIndent)for(r=(n=e.doc.sel).ranges.length-1;0<=r;r--)if(!(100<(i=n.ranges[r]).head.ch||r&&n.ranges[r-1].head.line==i.head.line)){if(l=!1,(o=e.getModeAt(i.head)).electricChars){for(a=0;a=n.text.length?(a.ch=n.text.length,a.sticky="before"):a.ch<=0&&(a.ch=0,a.sticky="after"),r=Tt(g,a.ch,a.sticky),i=g[r],"ltr"==t.doc.direction&&i.level%2==0&&(0a.ch:i.from=i.from&&d>=c.begin))?!(p=(h=function(e,t,n){for(var r,i,o,l=function(e,t){return t?new nn(a.line,s(e,1),"before"):new nn(a.line,e,"after")};0<=e&&e=r.first+r.size)&&(i=new nn(e,i.ch,i.sticky),p=$t(r,e))}())return;i=vl(l,r.cm,p,i.line,o)}else i=t;return 1}if("char"==e)m();else if("column"==e)m(!0);else if("word"==e||"group"==e)for(t=null,n="group"==e,a=r.cm&&r.cm.getHelper(i,"wordChars"),s=!0;!(o<0)||m(!s);s=!1){if(u=xt(c=p.text.charAt(i.ch)||"\n",a)?"w":n&&"\n"==c?"n":!n||/\s/.test(c)?null:"p",!n||s||u||(u="s"),t&&t!=u){o<0&&(o=1,m(),i.sticky="after");break}if(u&&(t=u),0=s.height){a.hitSide=!0;break}i+=5*n}return a}function _l(e,t){var n,r,i,o,l,a=kr(e,t.line);return!a||a.hidden?null:(r=wr(a,n=$t(e.doc,t.line),t.line),o="left",(i=Nt(n,e.doc.direction))&&(o=Tt(i,t.ch)%2?"right":"left"),(l=Lr(r.map,t.ch,o)).offset="right"==l.collapse?l.end:l.start,l)}function $l(e,t){return t&&(e.bad=!0),e}function Xl(e,t,n){var r,i,o;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return $l(e.clipPos(nn(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(i=0;il.doc.first&&(r=$t(l.doc,t.line-1).text)&&(t=new nn(t.line,1),l.replaceRange(n.charAt(0)+l.doc.lineSeparator()+r.charAt(r.length-1),nn(t.line-1,r.length-1),t,"+transpose"))),o.push(new X(t,t)));l.setSelections(o)})},newlineAndIndent:function(r){return Hi(r,function(){var e,t,n=r.listSelections();for(e=n.length-1;0<=e;e--)r.replaceRange(r.doc.lineSeparator(),n[e].anchor,n[e].head,"+input");for(n=r.listSelections(),t=0;te&&0==rn(t,this.pos)&&n==this.button},ge={toString:function(){return"CodeMirror.Init"}},ye={},ve={},Il.defaults=ye,Il.optionHandlers=ve,be=[],Il.defineInitHook=function(e){return be.push(e)},we=null,(xe=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new s,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null}).prototype.init=function(e){var t=this,l=this,a=l.cm,s=l.div=e.lineDiv;function n(e){var t,n,r,i,o;if(!Wt(a,e)){if(a.somethingSelected())Fl({lineWise:!1,text:a.getSelections()}),"cut"==e.type&&a.replaceSelection("",null,"cut");else{if(!a.options.lineWiseCopyCut)return;Fl({lineWise:!0,text:(t=Vl(a)).text}),"cut"==e.type&&a.operation(function(){a.setSelections(t.ranges,0,m),a.replaceSelection("",null,"cut")})}e.clipboardData&&(e.clipboardData.clearData(),n=we.text.join("\n"),e.clipboardData.setData("Text",n),e.clipboardData.getData("Text")==n)?e.preventDefault():(i=(r=Gl()).firstChild,a.display.lineSpace.insertBefore(r,a.display.lineSpace.firstChild),i.value=we.text.join("\n"),o=document.activeElement,c(i),setTimeout(function(){a.display.lineSpace.removeChild(r),o.focus(),o==s&&l.showPrimarySelection()},50))}}Kl(s,a.options.spellcheck,a.options.autocorrect,a.options.autocapitalize),T(s,"paste",function(e){Wt(a,e)||Bl(e,a)||Be<=11&&setTimeout(Ii(a,function(){return t.updateFromDOM()}),20)}),T(s,"compositionstart",function(e){t.composing={data:e.data,done:!1}}),T(s,"compositionupdate",function(e){t.composing||(t.composing={data:e.data,done:!1})}),T(s,"compositionend",function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),T(s,"touchstart",function(){return l.forceCompositionEnd()}),T(s,"input",function(){t.composing||t.readFromDOMSoon()}),T(s,"copy",n),T(s,"cut",n)},xe.prototype.prepareSelection=function(){var e=ii(this.cm,!1);return e.focus=this.cm.state.focused,e},xe.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},xe.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},xe.prototype.showPrimarySelection=function(){var e,t,n,r,i,o,l,a,s,c=this.getSelection(),u=this.cm,d=u.doc.sel.primary(),f=d.from(),h=d.to();if(u.display.viewTo==u.display.viewFrom||f.line>=u.display.viewTo||h.line=u.display.viewFrom&&_l(u,f)||{node:n[0].measure.map[2],offset:0},i=(i=h.linee.firstLine()&&(r=nn(r.line-1,$t(e.doc,r.line-1).length)),i.ch==$t(e.doc,i.line).text.length&&i.linet.viewTo-1)return!1;if(a=r.line==t.viewFrom||0==(o=Zr(e,r.line))?(l=Qt(t.view[0].line),t.view[0].node):(l=Qt(t.view[o].line),t.view[o-1].node.nextSibling),u=(s=Zr(e,i.line))==t.view.length-1?(c=t.viewTo-1,t.lineDiv.lastChild):(c=Qt(t.view[s+1].line)-1,t.view[s+1].node.previousSibling),!a)return!1;for(d=e.doc.splitLines(function C(s,e,t,c,u){var n="",d=!1,f=s.doc.lineSeparator(),h=!1;function p(){d&&(n+=f,h&&(n+=f),d=h=!1)}function m(e){e&&(p(),n+=e)}function g(e){var t,n,r,i,o,l;if(1==e.nodeType){if(t=e.getAttribute("cm-text"))return void m(t);if(n=e.getAttribute("cm-marker"))return void((i=s.findMarks(nn(c,0),nn(u+1,0),function a(t){return function(e){return e.id==t}}(+n))).length&&(r=i[0].find(0))&&m(Xt(s.doc,r.from,r.to).join(f)));if("false"==e.getAttribute("contenteditable"))return;if(o=/^(pre|div|p|li|table|br)$/i.test(e.nodeName),!/^br$/i.test(e.nodeName)&&0==e.textContent.length)return;for(o&&p(),l=0;lr.ch&&v.charCodeAt(v.length-p-1)==b.charCodeAt(b.length-p-1);)h--,p++;return d[d.length-1]=v.slice(0,v.length-p).replace(/^\u200b+/,""),d[0]=d[0].slice(h).replace(/\u200b+$/,""),x=nn(l,h),k=nn(c,f.length?gt(f).length-p:0),1u&&(El(s,n.head.line,e,!0),u=n.head.line,t==s.doc.sel.primIndex&&vi(s));else{for(r=n.from(),i=n.to(),o=Math.max(u,r.line),u=Math.min(s.lastLine(),i.line-(i.ch?0:1))+1,l=o;l>1)?t[2*l-1]:0)>=i)r=l;else{if(!(t[2*l+1]a)&&e.top>t.offsetHeight?o=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=a&&(o=e.bottom),l+t.offsetWidth>s&&(l=s-t.offsetWidth)),t.style.top=o+"px",t.style.left=t.style.right="","right"==i?(l=c.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?l=0:"middle"==i&&(l=(c.sizer.clientWidth-t.offsetWidth)/2),t.style.left=l+"px"),n&&function u(e,t){var n=gi(e,t);null!=n.scrollTop&&ki(e,n.scrollTop), -null!=n.scrollLeft&&Si(e,n.scrollLeft)}(this,{left:l,top:o,right:l+t.offsetWidth,bottom:o+t.offsetHeight})},triggerOnKeyDown:Ei(Ll),triggerOnKeyPress:Ei(Ml),triggerOnKeyUp:Tl,triggerOnMouseDown:Ei(Nl),execCommand:function(e){if(ce.hasOwnProperty(e))return ce[e].call(null,this)},triggerElectric:Ei(function(e){jl(this,e)}),findPosH:function(e,t,n,r){var i,o,l=this,a=1;for(t<0&&(a=-1,t=-t),i=un(this.doc,e),o=0;o","i")}function l(e,t){var n,r,i,o;for(n in e)for(r=t[n]||(t[n]=[]),o=(i=e[n]).length-1;0<=o;o--)r.unshift(i[o])}i={},m.defineMode("htmlmixed",function(d,e){var t,f=m.getMode(d,{name:"xml",htmlMode:!0,multilineTagIndentFactor:e.multilineTagIndentFactor,multilineTagIndentPastTag:e.multilineTagIndentPastTag}),h={},n=e&&e.tags,r=e&&e.scriptTypes;if(l(o,h),n&&l(n,h),r)for(t=r.length-1;0<=t;t--)h.script.unshift(["type",r[t].matches,r[t].mode]);function p(e,t){var n,r,i,o,l,a,s=f.token(e,t.htmlState),c=/\btag\b/.test(s);return c&&!/[<>\s\/]/.test(e.current())&&(n=t.htmlState.tagName&&t.htmlState.tagName.toLowerCase())&&h.hasOwnProperty(n)?t.inTag=n+" ":t.inTag&&c&&/>$/.test(e.current())?(r=/^([\S]+) (.*)/.exec(t.inTag),t.inTag=null,i=">"==e.current()&&function u(e,t){var n,r;for(n=0;n")):null:t.match("--")?r(d("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),r(function i(r){return function(e,t){for(var n;null!=(n=e.next());){if("<"==n)return t.tokenize=i(r+1),t.tokenize(e,t);if(">"==n){if(1!=r)return t.tokenize=i(r-1),t.tokenize(e,t);t.tokenize=c;break}}return"meta"}}(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),n.tokenize=d("meta","?>"),"meta"):(o=t.eat("/")?"closeTag":"openTag",n.tokenize=u,"tag bracket"):"&"==e?(t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"))?"atom":"error":(t.eatWhile(/[^&<]/),null)}function u(e,t){var n,r=e.next();return">"==r||"/"==r&&e.eat(">")?(t.tokenize=c,o=">"==r?"endTag":"selfcloseTag","tag bracket"):"="==r?(o="equals",null):"<"==r?(t.tokenize=c,t.state=p,t.tagName=t.tagStart=null,(n=t.tokenize(e,t))?n+" tag error":"tag error"):/[\'\"]/.test(r)?( -t.tokenize=function i(n){var e=function(e,t){for(;!e.eol();)if(e.next()==n){t.tokenize=u;break}return"string"};return e.isInAttribute=!0,e}(r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function d(n,r){return function(e,t){for(;!e.eol();){if(e.match(r)){t.tokenize=c;break}e.next()}return n}}function f(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(s.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function i(e){e.context&&(e.context=e.context.prev)}function h(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!s.contextGrabbers.hasOwnProperty(n)||!s.contextGrabbers[n].hasOwnProperty(t))return;i(e)}}function p(e,t,n){return"openTag"==e?(n.tagStart=t.column(),m):"closeTag"==e?g:p}function m(e,t,n){return"word"==e?(n.tagName=t.current(),l="tag",b):s.allowMissingTagName&&"endTag"==e?(l="tag bracket",b(e,0,n)):(l="error",m)}function g(e,t,n){if("word"!=e)return s.allowMissingTagName&&"endTag"==e?(l="tag bracket",y(e,0,n)):(l="error",v);var r=t.current();return n.context&&n.context.tagName!=r&&s.implicitlyClosed.hasOwnProperty(n.context.tagName)&&i(n),n.context&&n.context.tagName==r||!1===s.matchClosing?(l="tag",y):(l="tag error",v)}function y(e,t,n){return"endTag"!=e?(l="error",y):(i(n),p)}function v(e,t,n){return l="error",y(e,0,n)}function b(e,t,n){if("word"==e)return l="attribute",w;if("endTag"!=e&&"selfcloseTag"!=e)return l="error",b;var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||s.autoSelfClosers.hasOwnProperty(r)?h(n,r):(h(n,r),n.context=new f(n,r,i==n.indented)),p}function w(e,t,n){return"equals"==e?x:(s.allowMissing||(l="error"),b(e,0,n))}function x(e,t,n){return"string"==e?k:"word"==e&&s.allowUnquoted?(l="string",b):(l="error",b(e,0,n))}function k(e,t,n){return"string"==e?k:b(e,0,n)}return c.isInText=!0,{startState:function(e){var t={tokenize:c,state:p,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;o=null;var n=t.tokenize(e,t);return(n||o)&&"comment"!=n&&(l=null,t.state=t.state(o||n,e,t),l&&(n="error"==l?n+" error":l)),n},indent:function(e,t,n){var r,i,o=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+a;if(o&&o.noIndent)return C.Pass;if(e.tokenize!=u&&e.tokenize!=c)return n?n.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==s.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+a*(s.multilineTagIndentFactor||1);if(s.alignCDATA&&/$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:s.htmlMode?"html":"xml",helperType:s.htmlMode?"html":"xml",skipAttribute:function(e){e.state==x&&(e.state=b)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){var t,n=[];for(t=e.context;t;t=t.prev)t.tagName&&n.push(t.tagName);return n.reverse()}}}),C.defineMIME("text/xml","xml"),C.defineMIME("application/xml","xml"),C.mimeModes.hasOwnProperty("text/html")||C.defineMIME("text/html",{name:"xml",htmlMode:!0})},"object"==typeof exports&&"object"==typeof module?l(require("../../lib/codemirror")):"function"==typeof u&&u.amd?u(["../../lib/codemirror"],l):l(n),a=function(tt){"use strict";tt.defineMode("javascript",function(e,u){var r,i,c,l,a,t,n,o,s,d,f,h,p=e.indentUnit,m=u.statementIndent,g=u.jsonld,y=u.json||g,v=u.typescript,b=u.wordCharacters||/[\w$\xa1-\uffff]/,w=(n=C("keyword a"),o=C("keyword b"),s=C("keyword c"),d=C("keyword d"),f=C("operator"),{"if":C("if"),"while":n,"with":n,"else":o,"do":o,"try":o,"finally":o,"return":d,"break":d,"continue":d,"new":C("new"),"delete":s,"void":s,"throw":s,"debugger":C("debugger"),"var":C("var"),"const":C("var"),"let":C("var"),"function":C("function"),"catch":C("catch"),"for":C("for"),"switch":C("switch"),"case":C("case"),"default":C("default"),"in":f,"typeof":f,"instanceof":f,"true":h={type:"atom",style:"atom"},"false":h,"null":h,undefined:h,NaN:h,Infinity:h,"this":C("this"),"class":C("class"),"super":C("atom"),"yield":s,"export":C("export"),"import":C("import"),"extends":s,await:s}),x=/[+\-*&%=<>!?|~^@]/,k=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function C(e){return{type:e,style:"keyword"}}function S(e,t,n){return r=e,i=n,t}function L(e,t){var n,r,i=e.next();if('"'==i||"'"==i)return t.tokenize=function o(i){return function(e,t){var n,r=!1;if(g&&"@"==e.peek()&&e.match(k))return t.tokenize=L,S("jsonld-keyword","meta");for(;null!=(n=e.next())&&(n!=i||r);)r=!r&&"\\"==n;return r||(t.tokenize=L),S("string","string")}}(i),t.tokenize(e,t);if("."==i&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return S("number","number");if("."==i&&e.match(".."))return S("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(i))return S(i);if("="==i&&e.eat(">"))return S("=>","operator");if("0"==i&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return S("number","number");if(/\d/.test(i))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),S("number","number");if("/"==i)return e.eat("*")?(t.tokenize=T)(e,t):e.eat("/")?(e.skipToEnd(),S("comment","comment")):et(e,t,1)?(function l(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),S("regexp","string-2")):(e.eat("="),S("operator","operator",e.current()));if("`"==i)return(t.tokenize=M)(e,t);if("#"==i)return e.skipToEnd(),S("error","error");if( -"<"==i&&e.match("!--")||"-"==i&&e.match("->"))return e.skipToEnd(),S("comment","comment");if(x.test(i))return">"==i&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=i&&"="!=i||e.eat("="):/[<>*+\-]/.test(i)&&(e.eat(i),">"==i&&e.eat(i))),S("operator","operator",e.current());if(b.test(i)){if(e.eatWhile(b),n=e.current(),"."!=t.lastType){if(w.propertyIsEnumerable(n))return S((r=w[n]).type,r.style,n);if("async"==n&&e.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/,!1))return S("async","keyword",n)}return S("variable","variable",n)}}function T(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=L;break}r="*"==n}return S("comment","comment")}function M(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=L;break}r=!r&&"\\"==n}return S("quasi","string-2",e.current())}function N(e,t){var n,r,i,o,l,a,s;if(t.fatArrowAt&&(t.fatArrowAt=null),!((n=e.string.indexOf("=>",e.start))<0)){for(v&&(r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n)))&&(n=r.index),i=0,o=!1,l=n-1;0<=l;--l)if(a=e.string.charAt(l),0<=(s=c.indexOf(a))&&s<3){if(!i){++l;break}if(0==--i){"("==a&&(o=!0);break}}else if(3<=s&&s<6)++i;else if(b.test(a))o=!0;else if(/["'\/`]/.test(a))for(;;--l){if(0==l)return;if(e.string.charAt(l-1)==a&&"\\"!=e.string.charAt(l-2)){l--;break}}else if(o&&!i){++l;break}o&&!i&&(t.fatArrowAt=l)}}function A(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function O(e,t){var n,r;for(n=e.localVars;n;n=n.next)if(n.name==t)return 1;for(r=e.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==t)return 1}function D(){for(var e=arguments.length-1;0<=e;e--)a.cc.push(arguments[e])}function W(){return D.apply(null,arguments),!0}function z(e,t){for(var n=t;n;n=n.next)if(n.name==e)return 1}function P(e){var t,n=a.state;if(a.marked="def",n.context)if("var"==n.lexical.info&&n.context&&n.context.block){if(null!=(t=function r(e,t){{if(t){if(t.block){var n=r(e,t.prev);return n?n==t.prev?t:new I(n,t.vars,!0):null}return z(e,t.vars)?t:new I(t.prev,new E(e,t.vars),!1)}return null}}(e,n.context)))return void(n.context=t)}else if(!z(e,n.localVars))return void(n.localVars=new E(e,n.localVars));u.globalVars&&!z(e,n.globalVars)&&(n.globalVars=new E(e,n.globalVars))}function H(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function I(e,t,n){this.prev=e,this.vars=t,this.block=n}function E(e,t){this.name=e,this.next=t}function F(){a.state.context=new I(a.state.context,a.state.localVars,!1),a.state.localVars=t}function R(){a.state.context=new I(a.state.context,a.state.localVars,!0),a.state.localVars=null}function B(){a.state.localVars=a.state.context.vars,a.state.context=a.state.context.prev}function j(r,i){var e=function(){var e,t=a.state,n=t.indented;if("stat"==t.lexical.type)n=t.lexical.indented;else for(e=t.lexical;e&&")"==e.type&&e.align;e=e.prev)n=e.indented;t.lexical=new A(n,a.stream.column(),r,null,t.lexical,i)};return e.lex=!0,e}function V(){var e=a.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function K(t){return function n(e){return e==t?W():";"==t||"}"==e||")"==e||"]"==e?D():W(n)}}function G(e,t){return"var"==e?W(j("vardef",t),Le,K(";"),V):"keyword a"==e?W(j("form"),$,G,V):"keyword b"==e?W(j("form"),G,V):"keyword d"==e?a.stream.match(/^\s*$/,!1)?W():W(j("stat"),Y,K(";"),V):"debugger"==e?W(K(";")):"{"==e?W(j("}"),R,fe,V,B):";"==e?W():"if"==e?("else"==a.state.lexical.info&&a.state.cc[a.state.cc.length-1]==V&&a.state.cc.pop()(),W(j("form"),$,G,V,De)):"function"==e?W(He):"for"==e?W(j("form"),We,G,V):"class"==e||v&&"interface"==t?(a.marked="keyword",W(j("form","class"==e?e:t),Be,V)):"variable"==e?v&&"declare"==t?(a.marked="keyword",W(G)):v&&("module"==t||"enum"==t||"type"==t)&&a.stream.match(/^\s*\w/,!1)?(a.marked="keyword","enum"==t?W(Qe):"type"==t?W(Ee,K("operator"),ye,K(";")):W(j("form"),Te,K("{"),j("}"),fe,V,V)):v&&"namespace"==t?(a.marked="keyword",W(j("form"),q,G,V)):v&&"abstract"==t?(a.marked="keyword",W(G)):W(j("stat"),oe):"switch"==e?W(j("form"),$,K("{"),j("}","switch"),R,fe,V,V,B):"case"==e?W(q,K(":")):"default"==e?W(K(":")):"catch"==e?W(j("form"),F,U,G,V,B):"export"==e?W(j("stat"),Ge,V):"import"==e?W(j("stat"),qe,V):"async"==e?W(G):"@"==t?W(q,G):D(j("stat"),q,K(";"),V)}function U(e){if("("==e)return W(Fe,K(")"))}function q(e,t){return X(e,t,!1)}function _(e,t){return X(e,t,!0)}function $(e){return"("!=e?D():W(j(")"),q,K(")"),V)}function X(e,t,n){var r,i;if(a.state.fatArrowAt==a.stream.start){if(r=n?ne:te,"("==e)return W(F,j(")"),ue(Fe,")"),V,K("=>"),r,B);if("variable"==e)return D(F,Te,K("=>"),r,B)}return i=n?Q:Z,l.hasOwnProperty(e)?W(i):"function"==e?W(He,i):"class"==e||v&&"interface"==t?(a.marked="keyword",W(j("form"),Re,V)):"keyword c"==e||"async"==e?W(n?_:q):"("==e?W(j(")"),Y,K(")"),V,i):"operator"==e||"spread"==e?W(n?_:q):"["==e?W(j("]"),Ze,V,i):"{"==e?de(ae,"}",null,i):"quasi"==e?D(J,i):"new"==e?W(function o(t){return function(e){return"."==e?W(t?ie:re):"variable"==e&&v?W(ke,t?Q:Z):D(t?_:q)}}(n)):"import"==e?W(q):W()}function Y(e){return e.match(/[;\}\)\],]/)?D():D(q)}function Z(e,t){return","==e?W(q):Q(e,t,!1)}function Q(e,t,n){var r=0==n?Z:Q,i=0==n?q:_;return"=>"==e?W(F,n?ne:te,B):"operator"==e?/\+\+|--/.test(t)||v&&"!"==t?W(r):v&&"<"==t&&a.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?W(j(">"),ue(ye,">"),V,r):"?"==t?W(q,K(":"),i):W(i):"quasi"==e?D(J,r):";"!=e?"("==e?de(_,")","call",r):"."==e?W(le,r):"["==e?W(j("]"),Y,K("]"),V,r):v&&"as"==t?(a.marked="keyword",W(ye,r)):"regexp"==e?(a.state.lastType=a.marked="operator",a.stream.backUp(a.stream.pos-a.stream.start-1),W(i)):void 0:void 0}function J(e,t){return"quasi"!=e?D():"${"!=t.slice(t.length-2)?W(J):W(q,ee)}function ee(e){if("}"==e)return a.marked="string-2",a.state.tokenize=M,W(J)}function te(e){return N(a.stream,a.state),D("{"==e?G:q)}function ne(e){return N(a.stream,a.state),D("{"==e?G:_)}function re(e,t){if("target"==t)return a.marked="keyword",W(Z)}function ie(e,t){ -if("target"==t)return a.marked="keyword",W(Q)}function oe(e){return":"==e?W(V,G):D(Z,K(";"),V)}function le(e){if("variable"==e)return a.marked="property",W()}function ae(e,t){if("async"==e)return a.marked="property",W(ae);if("variable"==e||"keyword"==a.style){return(a.marked="property","get"==t||"set"==t)?W(se):(v&&a.state.fatArrowAt==a.stream.start&&(n=a.stream.match(/^\s*:\s*/,!1))&&(a.state.fatArrowAt=a.stream.pos+n[0].length),W(ce));var n}else{if("number"==e||"string"==e)return a.marked=g?"property":a.style+" property",W(ce);if("jsonld-keyword"==e)return W(ce);if(v&&H(t))return a.marked="keyword",W(ae);if("["==e)return W(q,he,K("]"),ce);if("spread"==e)return W(_,ce);if("*"==t)return a.marked="keyword",W(ae);if(":"==e)return D(ce)}}function se(e){return"variable"!=e?D(ce):(a.marked="property",W(He))}function ce(e){return":"==e?W(_):"("==e?D(He):void 0}function ue(r,i,o){function l(e,t){if(o?-1"),ye):void 0}function ve(e){if("=>"==e)return W(ye)}function be(e,t){return"variable"==e||"keyword"==a.style?(a.marked="property",W(be)):"?"==t||"number"==e||"string"==e?W(be):":"==e?W(ye):"["==e?W(K("variable"),pe,K("]"),be):"("==e?D(Ie,be):void 0}function we(e,t){return"variable"==e&&a.stream.match(/^\s*[?:]/,!1)||"?"==t?W(we):":"==e?W(ye):"spread"==e?W(we):D(ye)}function xe(e,t){return"<"==t?W(j(">"),ue(ye,">"),V,xe):"|"==t||"."==e||"&"==t?W(ye):"["==e?W(ye,K("]"),xe):"extends"==t||"implements"==t?(a.marked="keyword",W(ye)):"?"==t?W(ye,K(":"),ye):void 0}function ke(e,t){if("<"==t)return W(j(">"),ue(ye,">"),V,xe)}function Ce(){return D(ye,Se)}function Se(e,t){if("="==t)return W(ye)}function Le(e,t){return"enum"==t?(a.marked="keyword",W(Qe)):D(Te,he,Ae,Oe)}function Te(e,t){return v&&H(t)?(a.marked="keyword",W(Te)):"variable"==e?(P(t),W()):"spread"==e?W(Te):"["==e?de(Ne,"]"):"{"==e?de(Me,"}"):void 0}function Me(e,t){return"variable"!=e||a.stream.match(/^\s*:/,!1)?("variable"==e&&(a.marked="property"),"spread"==e?W(Te):"}"==e?D():"["==e?W(q,K("]"),K(":"),Me):W(K(":"),Te,Ae)):(P(t),W(Ae))}function Ne(){return D(Te,Ae)}function Ae(e,t){if("="==t)return W(_)}function Oe(e){if(","==e)return W(Le)}function De(e,t){if("keyword b"==e&&"else"==t)return W(j("form","else"),G,V)}function We(e,t){return"await"==t?W(We):"("==e?W(j(")"),ze,V):void 0}function ze(e){return"var"==e?W(Le,Pe):("variable"==e?W:D)(Pe)}function Pe(e,t){return")"==e?W():";"==e?W(Pe):"in"==t||"of"==t?(a.marked="keyword",W(q,Pe)):D(q,Pe)}function He(e,t){return"*"==t?(a.marked="keyword",W(He)):"variable"==e?(P(t),W(He)):"("==e?W(F,j(")"),ue(Fe,")"),V,me,G,B):v&&"<"==t?W(j(">"),ue(Ce,">"),V,He):void 0}function Ie(e,t){return"*"==t?(a.marked="keyword",W(Ie)):"variable"==e?(P(t),W(Ie)):"("==e?W(F,j(")"),ue(Fe,")"),V,me,B):v&&"<"==t?W(j(">"),ue(Ce,">"),V,Ie):void 0}function Ee(e,t){return"keyword"==e||"variable"==e?(a.marked="type",W(Ee)):"<"==t?W(j(">"),ue(Ce,">"),V):void 0}function Fe(e,t){return"@"==t&&W(q,Fe),"spread"==e?W(Fe):v&&H(t)?(a.marked="keyword",W(Fe)):v&&"this"==e?W(he,Ae):D(Te,he,Ae)}function Re(e,t){return("variable"==e?Be:je)(e,t)}function Be(e,t){if("variable"==e)return P(t),W(je)}function je(e,t){return"<"==t?W(j(">"),ue(Ce,">"),V,je):"extends"==t||"implements"==t||v&&","==e?("implements"==t&&(a.marked="keyword"),W(v?ye:q,je)):"{"==e?W(j("}"),Ve,V):void 0}function Ve(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||v&&H(t))&&a.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(a.marked="keyword",W(Ve)):"variable"==e||"keyword"==a.style?(a.marked="property",W(v?Ke:He,Ve)):"number"==e||"string"==e?W(v?Ke:He,Ve):"["==e?W(q,he,K("]"),v?Ke:He,Ve):"*"==t?(a.marked="keyword",W(Ve)):v&&"("==e?D(Ie,Ve):";"==e||","==e?W(Ve):"}"==e?W():"@"==t?W(q,Ve):void 0}function Ke(e,t){if("?"==t)return W(Ke);if(":"==e)return W(ye,Ae);if("="==t)return W(_);var n=a.state.lexical.prev;return D(n&&"interface"==n.info?Ie:He)}function Ge(e,t){return"*"==t?(a.marked="keyword",W(Ye,K(";"))):"default"==t?(a.marked="keyword",W(q,K(";"))):"{"==e?W(ue(Ue,"}"),Ye,K(";")):D(G)}function Ue(e,t){return"as"==t?(a.marked="keyword",W(K("variable"))):"variable"==e?D(_,Ue):void 0}function qe(e){return"string"==e?W():"("==e?D(q):D(_e,$e,Ye)}function _e(e,t){return"{"==e?de(_e,"}"):("variable"==e&&P(t),"*"==t&&(a.marked="keyword"),W(Xe))}function $e(e){if(","==e)return W(_e,$e)}function Xe(e,t){if("as"==t)return a.marked="keyword",W(_e)}function Ye(e,t){if("from"==t)return a.marked="keyword",W(q)}function Ze(e){return"]"==e?W():D(ue(_,"]"))}function Qe(){return D(j("form"),Te,K("{"),j("}"),ue(Je,"}"),V,V)}function Je(){return D(Te,Ae)}function et(e,t,n){return t.tokenize==L&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return c="([{}])",l={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},a={state:null,column:null,marked:null,cc:null},t=new E("this",new E("arguments",null)),V.lex=B.lex=!0,{startState:function(e){var t={tokenize:L, -lastType:"sof",cc:[],lexical:new A((e||0)-p,0,"block",!1),localVars:u.localVars,context:u.localVars&&new I(null,null,!1),indented:e||0};return u.globalVars&&"object"==typeof u.globalVars&&(t.globalVars=u.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),N(e,t)),t.tokenize!=T&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==r?n:(t.lastType="operator"!=r||"++"!=i&&"--"!=i?r:"incdec",function l(e,t,n,r,i){var o=e.cc;for(a.state=e,a.stream=i,a.marked=null,a.cc=o,a.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():y?q:G)(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return a.marked?a.marked:"variable"==n&&O(e,r)?"variable-2":t}}(t,n,r,i,e))},indent:function(e,t){var n,r,i,o,l,a,s;if(e.tokenize==T)return tt.Pass;if(e.tokenize!=L)return 0;if(n=t&&t.charAt(0),r=e.lexical,!/^\s*else\b/.test(t))for(o=e.cc.length-1;0<=o;--o)if((l=e.cc[o])==V)r=r.prev;else if(l!=De)break;for(;("stat"==r.type||"form"==r.type)&&("}"==n||(i=e.cc[e.cc.length-1])&&(i==Z||i==Q)&&!/^[,\.=+\-*:?[\(]/.test(t));)r=r.prev;return m&&")"==r.type&&"stat"==r.prev.type&&(r=r.prev),s=n==(a=r.type),"vardef"==a?r.indented+("operator"==e.lastType||","==e.lastType?r.info.length+1:0):"form"==a&&"{"==n?r.indented:"form"==a?r.indented+p:"stat"==a?r.indented+(function c(e,t){return"operator"==e.lastType||","==e.lastType||x.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}(e,t)?m||p:0):"switch"!=r.info||s||0==u.doubleIndentSwitch?r.align?r.column+(s?0:1):r.indented+(s?0:p):r.indented+(/^(?:case|default)\b/.test(t)?p:2*p)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:y?null:"/*",blockCommentEnd:y?null:"*/",blockCommentContinue:y?null:" * ",lineComment:y?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:y?"json":"javascript",jsonldMode:g,jsonMode:y,expressionAllowed:et,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=q&&t!=_||e.cc.pop()}}}),tt.registerHelper("wordChars","javascript",/[\w$]/),tt.defineMIME("text/javascript","javascript"),tt.defineMIME("text/ecmascript","javascript"),tt.defineMIME("application/javascript","javascript"),tt.defineMIME("application/x-javascript","javascript"),tt.defineMIME("application/ecmascript","javascript"),tt.defineMIME("application/json",{name:"javascript",json:!0}),tt.defineMIME("application/x-json",{name:"javascript",json:!0}),tt.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),tt.defineMIME("text/typescript",{name:"javascript",typescript:!0}),tt.defineMIME("application/typescript",{name:"javascript",typescript:!0})},"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof u&&u.amd?u(["../../lib/codemirror"],a):a(n),s=function(O){"use strict";var e,t,n,r,i,o,l,a,s,c,u,d,f,h,p,m,g,y,v;function b(e){var t,n={};for(t=0;t*\/]/.test(r)?(y="select-op",null):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?y="qualifier":/[:;{}\[\]\(\)]/.test(r)?x(null,r):e.match(/[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/.test(e.current().toLowerCase())&&(t.tokenize=C),y="variable","variable callee"):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),y="word","property"):y=null:/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),y="unit","number"):e.match(/^-[\w\\\-]*/)?(e.eatWhile(/[\w\\\-]/),y=e.match(/^\s*:/,!1)?"variable-definition":"variable","variable-2"):e.match(/^\w+-/)?y="meta":void 0})(e,t);return n&&"object"==typeof n&&(y=n[1],n=n[0]),v=n,"comment"!=y&&(t.state=b[t.state](y,e,t)),v},indent:function(e,t){var n=e.context,r=t&&t.charAt(0),i=n.indent;return"prop"!=n.type||"}"!=r&&")"!=r||(n=n.prev),n.prev&&("}"!=r||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"!=r||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=r||"at"!=n.type&&"atBlock"!=n.type)||(i=Math.max(0,n.indent-o)):i=(n=n.prev).indent),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:n,fold:"brace"}}),t=b(e=["domain","regexp","url","url-prefix"]),r=b(n=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"]),o=b(i=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"]),a=b(l=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"]),c=b(s=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill", -"column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"]),d=b(u=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"]),f=b(["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),h=b(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),m=b(p=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen", -"linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]),y=b(g=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption", -"smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"]),v=e.concat(n).concat(i).concat(l).concat(s).concat(u).concat(p).concat(g),O.registerHelper("hintWords","css",v),O.defineMIME("text/css",{documentTypes:t,mediaTypes:r,mediaFeatures:o,mediaValueKeywords:a,propertyKeywords:c,nonStandardPropertyKeywords:d,fontProperties:f,counterDescriptors:h,colorKeywords:m,valueKeywords:y,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=w)(e,t)}},name:"css"}),O.defineMIME("text/x-scss",{mediaTypes:r,mediaFeatures:o,mediaValueKeywords:a,propertyKeywords:c,nonStandardPropertyKeywords:d,colorKeywords:m,valueKeywords:y,fontProperties:f,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=w)(e,t):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),O.defineMIME("text/x-less",{mediaTypes:r,mediaFeatures:o,mediaValueKeywords:a,propertyKeywords:c,nonStandardPropertyKeywords:d,colorKeywords:m,valueKeywords:y,fontProperties:f,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=w)(e,t):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),O.defineMIME("text/x-gss",{documentTypes:t,mediaTypes:r,mediaFeatures:o,propertyKeywords:c,nonStandardPropertyKeywords:d,fontProperties:f,counterDescriptors:h,colorKeywords:m,valueKeywords:y,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=w)(e,t)}},name:"css",helperType:"gss"})},"object"==typeof exports&&"object"==typeof module?s(require("../../lib/codemirror")):"function"==typeof u&&u.amd?u(["../../lib/codemirror"],s):s(n),e.namespace("M.atto_html").CodeMirror=n,window.CodeMirror=c},"@VERSION@",{requires:["moodle-atto_html-codemirror-skin"]}); \ No newline at end of file +YUI.add("moodle-atto_html-codemirror",function(e,t){var n,r,i=window.codeMirror;n=this,r=function(){"use strict";var i,f,l,y,s,p,a,g,v,C,c,r,o,u,h,d,m,w,b,S,L,T,D,W,z,P,H,I,E,F,R,B,j,V,K,G,U,q,_,$,X,Y,Z,Q,J,ee,te,x,ne,re,ie,oe,le,ae,se,ce,ue,de,he,fe,pe,me,ge,ye,ve,be,we,xe,ke,Ce,Se,Le,Te,Me,Ne,Ae,Oe,De,We,ze,Pe,He,Ie,Ee,e=navigator.userAgent,Fe=navigator.platform,Re=/gecko\/\d/i.test(e),Be=/MSIE \d/.test(e),je=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),t=/Edge\/(\d+)/.exec(e),Ve=Be||je||t,Ke=Ve&&(Be?document.documentMode||6:+(t||je)[1]),Ge=!t&&/WebKit\//.test(e),Be=Ge&&/Qt\/\d+\.\d+/.test(e),Ue=!t&&/Chrome\//.test(e),qe=/Opera\//.test(e),_e=/Apple Computer/.test(navigator.vendor),$e=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),Xe=/PhantomJS/.test(e),Ye=!t&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),Ze=/Android/.test(e),Qe=Ye||Ze||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),Je=Ye||/Mac/.test(Fe),et=/\bCrOS\b/.test(e),je=/win/i.test(Fe),t=qe&&e.match(/Version\/(\d*\.\d*)/);function tt(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function nt(e){for(var t=e.childNodes.length;0t)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:h=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:h=i)}return null!=r?r:h}function Tt(e,t,n){this.level=e,this.from=t,this.to=n}function Mt(e,t){var n=e.order;return n=null==n?e.order=d(e.text,t):n}function Nt(e,t){return e._handlers&&e._handlers[t]||m}function At(e,t,n){var r,i;e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent?e.detachEvent("on"+t,n):(r=(e=e._handlers)&&e[t])&&-1<(i=ht(r,n))&&(e[t]=r.slice(0,i).concat(r.slice(i+1)))}function Ot(e,t){var n,r,i=Nt(e,t);if(i.length)for(n=Array.prototype.slice.call(arguments,2),r=0;r=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(n=e;!n.lines;)for(r=0;;++r){if(t<(o=(i=n.children[r]).chunkSize())){n=i;break}t-=o}return n.lines[t]}function _t(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(e){e=e.text;i==n.line&&(e=e.slice(0,n.ch)),i==t.line&&(e=e.slice(t.ch)),r.push(e),++i}),r}function $t(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function Xt(e,t){var n,r=t-e.height;if(r)for(n=e;n;n=n.parent)n.height+=r}function Yt(e){var t,n,r,i;if(null==e.parent)return null;for(n=ht((t=e.parent).lines,e),r=t.parent;r;r=(t=r).parent)for(i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function Zt(e,t){var n,r,i,o,l,a=e.first;e:do{for(n=0;n=e.first&&tn?A(n,N(e,n).text.length):(e=N(e,(n=t).line).text.length,null==(t=n.ch)||ee.options.maxHighlightLength&&Gt(e.doc.mode,r.state),o=an(e,t,r),i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))),t.styles}function cn(n,r,e){var t,i,o,l=n.doc,a=n.display;return l.mode.startState?(i=(t=function(e,t,n){var r,i,o,l,a,s,c;for(o=e.doc,l=n?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;ll.first&&N(l,t-1).stateAfter,o=i?R.fromSaved(l,i,t):new R(l,qt(l.mode),t),l.iter(t,r,function(e){un(n,e.text,o);var t=o.line;e.stateAfter=t==r-1||t%5==0||t>=a.viewFrom&&tt.start)return i;throw new Error("Mode "+e.name+" failed to advance stream.")}function fn(e,t,n,r){var i,o,l=e.doc,a=l.mode,u=N(l,(t=O(l,t)).line),s=cn(e,t.line,n),c=new E(u.text,e.options.tabSize,s);for(r&&(o=[]);(r||c.pose.options.maxHighlightLength?(c=!1,h&&un(e,t,r,l.pos),l.pos=t.length,null):pn(hn(n,l,r.state,s),d),s&&(f=s[0].name)&&(a="m-"+(a?f+" "+a:f)),!c||o!=a){for(;i=t:o.to>t),(r=r||[]).push(new gn(l,o.from,a?null:o.to)));return r}(r,n,r=0==k(t.from,t.to)),o=function(e,t,n){var r,i,o,l,a;if(e)for(i=0;i=t:o.to>t))&&(o.from!=t||"bookmark"!=l.type||n&&!o.marker.insertLeft)||( +a=null==o.from||(l.inclusiveLeft?o.from<=t:o.frome.lastLine())return t;var n,r=N(e,t);if(!Wn(e,r))return t;for(;n=Mn(r);)r=n.find(1,!0).line;return Yt(r)+1}function Wn(e,t){var n,r,i=V&&t.markedSpans;if(i)for(r=0;rn.maxLineLength&&(n.maxLineLength=t,n.maxLine=e)})}function In(e,t){if(!e||/^\s*$/.test(e))return null;t=t.addModeClass?U:G;return t[e]||(t[e]=e.replace(/\S+/g,"cm-$&"))}function En(e,t){var n,r,i,o,l,a,s=it("span",null,null,Ge?"padding-right: .1px":null),c={pre:it("pre",[s],"CodeMirror-line"),content:s,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};for(t.measure={},n=0;n<=(t.rest?t.rest.length:0);n++)r=n?t.rest[n-1]:t.line,i=void 0,c.pos=0,c.addToken=Rn,o=e.display.measure,a=l=void 0,(null!=L?L:(a=rt(o,document.createTextNode("AخA")),l=y(a,0,1).getBoundingClientRect(),a=y(a,1,2).getBoundingClientRect(),nt(o),l&&l.left!=l.right&&(L=a.right-l.right<3)))&&(i=Mt(r,e.doc.direction))&&(c.addToken=function(d,h){return function(e,t,n,r,u,i,o){var l,a,s,c;for(n=n?n+" cm-force-border":"cm-force-border",a=(l=e.pos)+t.length;;){for(s=void 0,c=0;cl&&s.from<=l);c++);if(s.to>=a)return d(e,t,n,r,u,i,o);d(e,t.slice(0,s.to-l),n,r,null,i,o),r=null,t=t.slice(s.to-l),l=s.to}}}(c.addToken,i)),c.map=[],function(u,e,d){var h,t,f,n,p,m,r,g,y,v,i,o,b,l,w,a,s,x,k,C,c,S,L,T,M=u.markedSpans,N=u.text,A=0;if(M)for(h=N.length,t=0,f=1,n="",r=0;;){if(r==t){g=y=v=m="",i=o=null,r=Infinity;for(b=[],l=void 0,w=0;wt||s.collapsed&&a.to==t&&a.from==t)){if(null!=a.to&&a.to!=t&&r>a.to&&(r=a.to,y=""),s.className&&(g+=" "+s.className),s.css&&(m=(m?m+";":"")+s.css),s.startStyle&&a.from==t&&(v+=" "+s.startStyle),s.endStyle&&a.to==r&&(l=l||[]).push(s.endStyle,a.to),s.title&&((o=o||{}).title=s.title),s.attributes)for(x in s.attributes)(o=o||{})[x]=s.attributes[x];s.collapsed&&(!i||Sn(i.marker,s)<0)&&(i=a)}else a.from>t&&r>a.from&&(r=a.from)}if(l)for(k=0;kn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function ar(e,t,n,r){return ur(e,cr(e,t),n,r)}function sr(e,t){if(t>=e.display.viewFrom&&t=e.lineN&&tt)&&(i=(o=s-a)-1,s<=t&&(l="right")),null!=i){if(r=e[c+2],a==s&&n==(r.insertLeft?"left":"right")&&(l=n),"left"==n&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[2+(c-=3)],l="left";if("right"==n&&i==s-a)for(;c=r.text.length?(t=r.text.length,e="before"):t<=0&&(t=0,e="after"),o?(a=Lt(o,t,e),l=h,a=c(t,a,"before"==e),null!=l&&(a.other=c(t,l,"before"!=e)),a):s("before"==e?t-1:t,"before"==e);function c(e,t,n){return s(n?e-1:e,1==o[t].level!=n)}}function kr(e,t){var n=0;return t=O(e.doc,t),{left:n=e.options.lineWrapping?n:Dr(e.display)*t.ch,right:n,top:t=zn(n=N(e.doc,t.line))+er(e.display),bottom:t+n.height}}function Cr(e,t,n,r,i){e=A(e,t,n);return e.xRel=i,r&&(e.outside=r),e}function Sr(e,t,n){var r,i,o,l,a,s=e.doc;if((n+=e.display.viewOffset)<0)return Cr(s.first,0,null,-1,-1);if(r=Zt(s,n),(i=s.first+s.size-1)t)&&(!n||Sn(n,i.marker)<0)&&(n=i.marker);return n}(o,(a=function(n,e,u,r,i){var d,h,f,t,p,o,l,m,a,s,c;i-=zn(e);d=cr(n,e),h=yr(e),f=0,c=e.text.length,t=!0,l=Mt(e,n.doc.direction);l&&(l=(n.options.lineWrapping?Ar:Nr)(n,e,u,d,l,r,i),t=1!=l.level,f=t?l.from:l.to-1,c=t?l.to:l.from-1);p=null,o=null,l=St(function(e){var t=ur(n,d,e);return t.top+=h,t.bottom+=h,Mr(t,r,i,!1)&&(t.top<=i&&t.left<=r&&(p=e,o=t),1)},f,c),m=!1;o?(a=r-o.left=c.bottom?1:0);return l=Ct(e.text,l,1),Cr(u,l,s,m,r-a)}(e,o,r,t,n)).ch+(0r},i,e)}}function Tr(e,t,n,r){return Lr(e,t,n=n||cr(e,t),vr(e,t,ur(e,n,r),"line").top)}function Mr(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function Nr(n,r,i,o,l,a,s){var e,t=St(function(e){var e=l[e],t=1!=e.level;return Mr(xr(n,A(i,t?e.to:e.from,t?"before":"after"),"line",r,o),a,s,!0)},0,l.length-1),c=l[t];return 0s&&(c=l[t-1])),c}function Ar(u,d,h,f,e,t,n){var r,i,o,l,a,n=Lr(u,d,f,n),s=n.begin,c=n.end;for(/\s/.test(d.text.charAt(c-1))&&c--,i=r=null,o=0;o=c||l.to<=s||(a=(a=ur(u,f,1!=l.level?Math.min(c,l.to)-1:Math.max(s,l.from)).right)c?{from:r.from,to:c,level:r.level}:r}function Or(e){var t,n;if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==X){for(X=M("pre",null,"CodeMirror-line-like"),t=0;t<49;++t)X.appendChild(document.createTextNode("x")),X.appendChild(M("br"));X.appendChild(document.createTextNode("x"))}return rt(e.measure,X),3<(n=X.offsetHeight/50)&&(e.cachedTextHeight=n),nt(e.measure),n||1}function Dr(e){var t,n;return null!=e.cachedCharWidth?e.cachedCharWidth:(n=M("span","xxxxxxxxxx"),t=M("pre",[n],"CodeMirror-line-like"),rt(e.measure,t),2<(n=((t=n.getBoundingClientRect()).right-t.left)/10)&&(e.cachedCharWidth=n),n||10)}function Wr(e){for(var t,n=e.display,r={},i={},o=n.gutters.clientLeft,l=n.gutters.firstChild,a=0;l;l=l.nextSibling,++a)r[t=e.display.gutterSpecs[a].className]=l.offsetLeft+l.clientLeft+o,i[t]=l.clientWidth;return{fixedPos:zr(n),gutterTotalWidth:n.gutters.offsetWidth,gutterLeft:r,gutterWidth:i,wrapperWidth:n.wrapper.clientWidth}}function zr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Pr(r){var i=Or(r.display),o=r.options.lineWrapping,l=o&&Math.max(5,r.display.scroller.clientWidth/Dr(r.display)-3);return function(e){var t,n;if(Wn(r.doc,e))return 0;if(t=0,e.widgets)for(n=0;n=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(n=e.display.view, +r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo?V&&On(e.doc,t)i.viewFrom?Br(e):(i.viewFrom+=r,i.viewTo+=r):t<=i.viewFrom&&n>=i.viewTo?Br(e):t<=i.viewFrom?(l=jr(e,n,n+r,1))?(i.view=i.view.slice(l.index),i.viewFrom=l.lineN,i.viewTo+=r):Br(e):n>=i.viewTo?(l=jr(e,t,t,-1))?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):Br(e):(l=jr(e,t,t,-1),o=jr(e,n,n+r,1),l&&o?(i.view=i.view.slice(0,l.index).concat(Vn(e,l.lineN,o.lineN)).concat(i.view.slice(o.index)),i.viewTo+=r):Br(e)),(l=i.externalMeasured)&&(n=i.lineN&&t=r.viewTo||null!=(i=r.view[Er(e,t)]).node&&-1==ht(o=i.changes||(i.changes=[]),n)&&o.push(n)}function Br(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function jr(e,t,n,r){var i,o,l,a=Er(e,t),s=e.display.view;if(!V||n==e.doc.first+e.doc.size)return{index:a,lineN:n};for(o=e.display.viewFrom,l=0;l=e.display.viewTo||a.to().linet||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),1==l.level?"rtl":"ltr",o),i=!0);i||r(t,n,"ltr")}(b=Mt(r,o.direction),m||0,null==g?w:g,function(e,t,n,r){var u,i,d,o,l,a="ltr"==n,s=x(e,a?"left":"right"),c=x(t-1,a?"right":"left"),h=null==m&&0==e,f=null==g&&t==w,p=0==r,r=!b||r==b.length-1;c.top-s.top<=3?(u=(L?h:f)&&p?C:(a?s:c).left,l=(L?f:h)&&r?S:(a?c:s).right,T(u,s.top,l-u,s.bottom)):(l=a?(i=L&&h&&p?C:s.left,d=L?S:k(e,n,"before"),o=L?C:k(t,n,"after"),L&&f&&r?S:c.right):(i=L?k(e,n,"before"):C,d=!L&&h&&p?S:s.right,o=!L&&f&&r?C:c.left,L?k(t,n,"after"):S),T(i,s.top,d-i,s.bottom),s.bottome.display.sizerWidth&&(a=Math.ceil(r/Dr(e.display)))>e.display.maxLineLength&&(e.display.maxLineLength=a,e.display.maxLine=t.line,e.display.maxLineChanged=!0)}}function Jr(e){var t,n,r;if(e.widgets)for(t=0;t=o&&(i=Zt(t,zn(N(t,n))-e.wrapper.clientHeight),o=n)),{from:i,to:Math.max(o,i+1)}}function ti(e,t){var n,r,i,o,l,a,s=e.display,c=Or(e.display);return t.top<0&&(t.top=0),n=(e.curOp&&null!=e.curOp.scrollTop?e.curOp:s.scroller).scrollTop,r=or(e),i={},t.bottom-t.top>r&&(t.bottom=t.top+r),a=e.doc.height+tr(s),l=t.topa-c,t.topn+r&&(o=Math.min(t.top,(c?a:t.bottom)-r))!=n&&(i.scrollTop=o),l=(e.curOp&&null!=e.curOp.scrollLeft?e.curOp:s.scroller).scrollLeft,c=ir(e)-(e.options.fixedGutter?s.gutters.offsetWidth:0),(a=t.right-t.left>c)&&(t.right=t.left+c),t.left<10?i.scrollLeft=0:t.leftc+l-3&&(i.scrollLeft=t.right+(a?0:10)-c),i}function ni(e,t){null!=t&&(oi(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc:e.curOp).scrollTop+t)}function ri(e){oi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function ii(e,t,n){null==t&&null==n||oi(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function oi(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,li(e,kr(e,t.from),kr(e,t.to),t.margin))}function li(e,t,n,r){t=ti(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});ii(e,t.scrollLeft,t.scrollTop)}function ai(e,t){Math.abs(e.doc.scrollTop-t)<2||(Re||Si(e,{top:t}),si(e,t,!0),Re&&Si(e),wi(e,100))}function si(e,t,n){t=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t),e.display.scroller.scrollTop==t&&!n||(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function ci(e,t,n,r){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,Mi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function ui(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+tr(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+rr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function di(e,t){var n,r,i;for(t=t||ui(e),n=e.display.barWidth,r=e.display.barHeight,hi(e,t),i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Qr(e),hi(e,ui(e)),n=e.display.barWidth,r=e.display.barHeight}function hi(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}function fi(n){n.display.scrollbars&&(n.display.scrollbars.clear(),n.display.scrollbars.addClass&&l(n.display.wrapper,n.display.scrollbars.addClass)),n.display.scrollbars=new Y[n.options.scrollbarStyle](function(e){n.display.wrapper.insertBefore(e,n.display.scrollbarFiller),w(e,"mousedown",function(){n.state.focused&&setTimeout(function(){return n.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,t){("horizontal"==t?ci:ai)(n,e)},n),n.display.scrollbars.addClass&&at(n.display.wrapper,n.display.scrollbars.addClass)}function pi(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Z},e=e.curOp,q?q.ops.push(e):e.ownsGroup=q={ops:[e],delayedCallbacks:[]}}function mi(e){e=e.curOp;if(e){var t=function(u){for(var e,d,h,f,p,m,g=0;g=y.viewTo)||y.maxLineChanged&&n.options.lineWrapping,t.update=t.mustUpdate&&new Q(n,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}for(h=0;h(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),null==r||Xe||(i=M("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-er(e.display))+"px;\n height: "+(t.bottom-t.top+rr(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;"),e.display.lineSpace.appendChild(i),i.scrollIntoView(r),e.display.lineSpace.removeChild(i)))}(c,w));x=s.maybeHiddenMarkers,k=s.maybeUnhiddenMarkers;if(x)for(C=0;C=l.display.viewTo||(a=+new Date+l.options.workTime,s=cn(l,u.highlightFrontier),c=[],u.iter(s.line,Math.min(u.first+u.size,l.display.viewTo+500),function(e){var t,n,r,i,o;if(s.line>=l.display.viewFrom){for(t=e.styles,n=e.text.length>l.options.maxHighlightLength?Gt(u.mode,s.state):null,r=an(l,e,s,!0),n&&(s.state=n),e.styles=r.styles,n=e.styleClasses,(r=r.classes)?e.styleClasses=r:n&&(e.styleClasses=null),i=!t||t.length!=e.styles.length||n!=r&&(!n||!r||n.bgClass!=r.bgClass||n.textClass!=r.textClass),o=0;!i&&oa)return wi(l,l.options.workDelay),!0}),u.highlightFrontier=s.line,u.modeFrontier=Math.max(u.modeFrontier,s.line),c.length&&gi(l,function(){for(var e=0;e=a.viewFrom&&t.visible.to<=a.viewTo&&(null==a.updateLineNumbers||a.updateLineNumbers>=a.viewTo)&&a.renderedView==a.view&&0==Vr(e))return!1;if(Ni(e)&&(Br(e),t.dims=Wr(e)),n=u.first+u.size,c=Math.max(t.visible.from-e.options.viewportMargin,u.first),i=Math.min(n,t.visible.to+e.options.viewportMargin),a.viewFromi&&a.viewTo-i<20&&(i=Math.min(n,a.viewTo)),V&&(c=On(e.doc,c),i=Dn(e.doc,i)),u=c!=a.viewFrom||i!=a.viewTo||a.lastWrapHeight!=t.wrapperHeight||a.lastWrapWidth!=t.wrapperWidth,n=c,c=i,0==(r=(i=e).display).view.length||n>=r.viewTo||c<=r.viewFrom?(r.view=Vn(i,n,c),r.viewFrom=n):(r.viewFrom>n?r.view=Vn(i,n,r.viewFrom).concat(r.view):r.viewFromc&&(r.view=r.view.slice(0,Er(i,c)))),r.viewTo=c,a.viewOffset=zn(N(e.doc,a.viewFrom)), +e.display.mover.style.top=a.viewOffset+"px",n=Vr(e),!u&&0==n&&!t.force&&a.renderedView==a.view&&(null==a.updateLineNumbers||a.updateLineNumbers>=a.viewTo))return!1;r=!(i=e).hasFocus()&&(l=lt())&&ot(i.display.lineDiv,l)?(l={activeElt:l},window.getSelection&&(o=window.getSelection()).anchorNode&&o.extend&&ot(i.display.lineDiv,o.anchorNode)&&(l.anchorNode=o.anchorNode,l.anchorOffset=o.anchorOffset,l.focusNode=o.focusNode,l.focusOffset=o.focusOffset),l):null,4=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&ki(e,t);i=!1)Qr(e),n=ui(e),Kr(e),di(e,n),Ti(e,n),t.force=!1;t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Si(e,t){var n,t=new Q(e,t);ki(e,t)&&(Qr(e),Ci(e,t),n=ui(e),Kr(e),di(e,n),Ti(e,n),t.finish())}function Li(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Ti(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+rr(e)+"px"}function Mi(e){var t,n,r,i,o,l,a=e.display,s=a.view;if(a.alignWidgets||a.gutters.firstChild&&e.options.fixedGutter){for(t=zr(a)-a.scroller.scrollLeft+e.doc.scrollLeft,n=a.gutters.offsetWidth,r=t+"px",i=0;ia.clientWidth,c=a.scrollHeight>a.clientHeight;if(o&&s||i&&c){if(i&&Je&&Ge)e:for(t=u.target,d=l.view;t!=a;t=t.parentNode)for(n=0;ni-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(a=(a=s).lastOp==r?(Zi(a.done),mt(a.done)):a.done.length&&!mt(a.done).ranges?mt(a.done):1s.undoDepth;)s.done.shift(),s.done[0].ranges||s.done.shift();s.done.push(n),s.generation=++s.maxGeneration,s.lastModTime=s.lastSelTime=i,s.lastOp=s.lastSelOp=r,s.lastOrigin=s.lastSelOrigin=t.origin,o||Ot(e,"historyAdded")}function Ji(e,t,n,r){var i,o,l,a=e.history,s=r&&r.origin;n==a.lastSelOp||s&&a.lastSelOrigin==s&&(a.lastModTime==a.lastSelTime&&a.lastOrigin==s||(e=e,i=s,o=mt(a.done),l=t,"*"==(i=i.charAt(0))||"+"==i&&o.ranges.length==l.ranges.length&&o.somethingSelected( +)==l.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)))?a.done[a.done.length-1]=t:eo(t,a.done),a.lastSelTime=+new Date,a.lastSelOrigin=s,a.lastSelOp=n,r&&!1!==r.clearRedo&&Zi(a.undone)}function eo(e,t){var n=mt(t);n&&n.ranges&&n.equals(e)||t.push(e)}function to(t,n,e,r){var i=n["spans_"+t.id],o=0;t.iter(Math.max(t.first,e),Math.min(t.first+t.size,r),function(e){e.markedSpans&&((i=i||(n["spans_"+t.id]={}))[o]=e.markedSpans),++o})}function no(e,t){var n,r,i=t["spans_"+e.id];if(!i)return null;for(n=[],r=0;r=t.ch:s.to>t.ch))){if(d&&(Ot(i,"beforeCursorEnter"),i.explicitlyCleared)){if(c.markedSpans){--r;continue}break}if(i.atomic)return u&&(a=i.find(n<0?1:-1),s=void 0,(a=(n<0?l:o)?bo(e,a,-n,a&&a.line==t.line?c:null):a)&&a.line==t.line&&(s=k(a,u))&&(n<0?s<0:0e.first?O(e,A(t.line-1)):null:0e.lastLine())){if(t.from.liner?{from:t.from,to:A(r,N(e,r).text.length),text:[t.text[0]],origin:t.origin}:t).removed=_t(e,t.from,t.to),u=u||Bi(e,t),e.cm){var h,n,f,r=e.cm,i=t,o=d,l=r.doc,p=r.display,a=i.from,m=i.to,g=!1,s=a.line,c=(r.options.lineWrapping||(s=Yt(An(N(l,a.line))),l.iter(s,m.line+1,function(e){if(e==p.maxLine)return g=!0})),-1p.maxLineLength&&(p.maxLine=e,p.maxLineLength=t,p.maxLineChanged=!0,g=!1)}),g&&(r.curOp.updateMaxLine=!0)),l),y=a.line;if(c.modeFrontier=Math.min(c.modeFrontier,y),!(c.highlightFrontier=this.string.length},E.prototype.sol=function(){return this.pos==this.lineStart},E.prototype.peek=function(){return this.string.charAt(this.pos)||undefined},E.prototype.next=function(){if(this.post},E.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},E.prototype.skipToEnd=function(){this.pos=this.string.length},E.prototype.skipTo=function(e){e=this.string.indexOf(e,this.pos);if(-1this.maxLookAhead&&(this.maxLookAhead=e),t},R.prototype.baseToken=function(e){var t;if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;return{type:(t=this.baseTokens[this.baseTokenPos+1])&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},R.prototype.nextLine=function(){this.line++,0e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;return r?(this.vert.style.display="block",this.vert.style.bottom=n?i+"px":"0",t=e.viewHeight-(n?i:0),this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+t)+"px"):(this.vert.style.display="",this.vert.firstChild.style.height="0"),n?(this.horiz.style.display="block",this.horiz.style.right=r?i+"px":"0",this.horiz.style.left=e.barLeft+"px",t=e.viewWidth-e.barLeft-(r?i:0),this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+t)+"px"):(this.horiz.style.display="",this.horiz.firstChild.style.width="0"),!this.checkedZeroWidth&&0e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=d,e.display.maxLineChanged=!0);null!=r&&e&&this.collapsed&&Fr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&mo(e.doc)),e&&Kn(e,"markerCleared",e,this,r,i),t&&mi(e),this.parent&&this.parent.clear()}},ie.prototype.find=function(e,t){var n,r,i,o,l;for(null==e&&"bookmark"==this.type&&(e=1),i=0;i=e.ch)&&i.push(r.marker.parent||r.marker);return i},findMarks:function(i,o,l){i=O(this,i),o=O(this,o);var a=[],s=i.line;return this.iter(i.line,o.line+1,function(e){var t,n,r=e.markedSpans;if(r)for(t=0;t=n.to||null==n.from&&s!=i.line||null!=n.from&&s==o.line&&n.from>=o.ch||l&&!l(n.marker)||a.push(n.marker.parent||n.marker);++s}),a},getAllMarks:function(){var r=[];return this.iter(function(e){var t,n=e.markedSpans;if(n)for(t=0;tt&&(t=e.from),null!=e.to&&e.toe.text.length?null:t}function Zo(e,t,n){e=Yo(e,t.ch,n);return null==e?null:new A(t.line,e,n<0?"after":"before")}function Qo(e,t,n,r,i){var o,l,a,s;return e&&(o=Mt(n,t.doc.direction))?(o=i<0==(1==(e=i<0?mt(o):o[0]).level)?"after":"before",0a&&t.push(new x(A(o,a),A(o,ft(l,i,n))));t.length||t.push(new x(f,f)),ho(v,Ii(h,y.ranges.slice(0,g).concat(t),g),{origin:"*mouse",scroll:!1}),h.scrollIntoView(e)}else c=m,s=cl(h,e,p.unit),e=c.anchor,e=0=t.to||i.linea.bottom?20:0)&&setTimeout(yi(h,function(){s==r&&(l.scroller.scrollTop+=n,o(e))}),50))}:i)(e)}),r=yi(h,i);h.state.selectingText=r,w(l.wrapper.ownerDocument,"mousemove",n),w(l.wrapper.ownerDocument,"mouseup",r)})(t,u,n,d)):Rt(e)==c.scroller&&Ht(e):2==l?(o&&lo(s.doc,o),setTimeout(function(){return c.input.focus()},20)):3==l&&(f?s.display.input.onContextMenu(e):Xr(s)))))}function cl(e,t,n){if("char"==n)return new x(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new x(A(t.line,0),O(e.doc,A(t.line+1,0)));e=n(e,t);return new x(e.from,e.to)}function ul(e,t,n,r){var i,o,l,a,s;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;if(r&&Ht(t),o>(r=(l=e.display).lineDiv.getBoundingClientRect()).bottom||!zt(e,n))return Et(t);for(o-=r.top-l.viewOffset,a=0;a=i)return Ot(e,n,e,Zt(e.doc,o),e.display.gutterSpecs[a].className,t),Et(t)}function dl(e,t){return ul(e,t,"gutterClick",!0)}function hl(e,t){var n,r;Jn(e.display,t)||(r=t,zt(n=e,"gutterContextMenu")&&ul(n,r,"gutterContextMenu",!1))||Dt(e,t,"contextmenu")||f||e.display.input.onContextMenu(t)}function fl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),pr(e)}function pl(e,t,n){var n=n&&n!=xe;!t!=!n&&(n=e.display.dragFunctions,(t=t?w:At)(e.display.scroller,"dragstart",n.start),t(e.display.scroller,"dragenter",n.enter),t(e.display.scroller,"dragover",n.over),t(e.display.scroller,"dragleave",n.leave),t(e.display.scroller,"drop",n.drop))}function ml(e){e.options.lineWrapping?(at(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(l(e.display.wrapper,"CodeMirror-wrap"),Hn(e)),Hr(e),Fr(e),pr(e),setTimeout(function(){return di(e)},100)}function gl(e,t){var n,r,i,o=this;if(!(this instanceof gl))return new gl(e,t);this.options=t=t?ut(t):{},ut(ke,t,!1),"string"==typeof(n=t.value)?n=new ae(n,t.mode,null,t.lineSeparator, +t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n,a=new gl.inputStyles[t.inputStyle](this),fl((e=this.display=new Wi(e,n,a,t)).wrapper.CodeMirror=this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),fi(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new p,keySeq:null,specialChars:null},t.autofocus&&!Qe&&e.input.focus(),Ve&&Ke<11&&setTimeout(function(){return o.display.input.reset(!0)},20);var u,l,a,s=this,c=s.display;function d(){c.activeTouch&&(u=setTimeout(function(){return c.activeTouch=null},1e3),(l=c.activeTouch).end=+new Date)}function h(e,t){if(null==t.left)return 1;var n=t.left-e.left,t=t.top-e.top;return 400c.first?dt(N(c,t-1).text,null,r):0:"add"==n?l=h+e.options.indentUnit:"subtract"==n?l=h-e.options.indentUnit:"number"==typeof n&&(l=h+n),l=Math.max(0,l),a="",f=0,e.options.indentWithTabs)for(p=Math.floor(l/r);p;--p)f+=r,a+="\t";if(fh,i=T(t),o=null,r&&1h?"cut":"+input")},ko(e.doc,c),Kn(e,"inputRead",e,c);t&&!r&&xl(e,t),ri(e),e.curOp.updateInput<2&&(e.curOp.updateInput=p),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function wl(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");return n&&(e.preventDefault(),t.isReadOnly()||t.options.disableInput||gi(t,function(){return bl(t,n,0,null,"paste")}),1)}function xl(e,t){var n,r,i,o,l,a;if(e.options.electricChars&&e.options.smartIndent)for(r=(n=e.doc.sel).ranges.length-1;0<=r;r--)if(!(100<(i=n.ranges[r]).head.ch||r&&n.ranges[r-1].head.line==i.head.line)){if(l=!1,(o=e.getModeAt(i.head) +).electricChars){for(a=0;a=n.text.length?(a.ch=n.text.length,a.sticky="before"):a.ch<=0&&(a.ch=0,a.sticky="after"),o=Lt(c,a.ch,a.sticky),i=c[o],"ltr"==t.doc.direction&&i.level%2==0&&(0a.ch:i.from=i.from&&r>=l.begin))?!(o=(i=function(e,t,n){for(var r,i,o,l=function(e,t){return t?new A(a.line,s(e,1),"before"):new A(a.line,e,"after")};0<=e&&e=m.first+m.size||(g=new A(p,g.ch,g.sticky),!(v=N(m,p))))return;g=Qo(b,m.cm,v,g.line,y)}else g=l;return 1}if("char"==e)o();else if("column"==e)o(!0);else if("word"==e||"group"==e)for(t=null,n="group"==e,l=m.cm&&m.cm.getHelper(g,"wordChars"),r=!0;!(y<0)||o(!r);r=!1){if(i=wt(i=v.text.charAt(g.ch)||"\n",l)?"w":n&&"\n"==i?"n":!n||/\s/.test(i)?null:"p",!n||r||i||(i="s"),t&&t!=i){y<0&&(y=1,o(),g.sticky="after");break}if(i&&(t=i),0=a.height){l.hitSide=!0;break}i+=5*n}return l}function Ml(e,t){var n,r,i=sr(e,t.line);return!i||i.hidden?null:(n=lr(i,i=N(e.doc,t.line),t.line),r="left",(i=Mt(i,e.doc.direction))&&(r=Lt(i,t.ch)%2?"right":"left"),(e=dr(n.map,t.ch,r)).offset="right"==e.collapse?e.end:e.start,e)}function Nl(e,t){return t&&(e.bad=!0),e}function Al(e,u,d){var t,h;if(u==e.display.lineDiv){if(!(t=e.display.lineDiv.childNodes[d]))return Nl(e.clipPos(A(e.display.viewTo-1)),!0);u=null,d=0}else for(t=u;;t=t.parentNode){if(!t||t==e.display.lineDiv)return null;if(t.parentNode&&t.parentNode==e.display.lineDiv)break}for(h=0;hl.doc.first&&(n=N(l.doc,e.line-1).text)&&(e=new A(e.line,1),l.replaceRange(t.charAt(0)+l.doc.lineSeparator()+n.charAt(n.length-1),A(e.line-1,n.length-1),e,"+transpose"))),i.push(new x(e,e)));l.setSelections(i)})},newlineAndIndent:function(r){return gi(r,function(){for(var e,t=r.listSelections(),n=t.length-1;0<=n;n--)r.replaceRange(r.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");for(t=r.listSelections(),e=0;ee&&0==k(t,this.pos)&&n==this.button},xe={toString:function(){return"CodeMirror.Init"}},ke={},Ce={},gl.defaults=ke,gl.optionHandlers=Ce,Se=[],gl.defineInitHook=function(e){return Se.push(e)},Le=null,(t=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new p,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null}).prototype.init=function(e){var t=this,o=this,l=o.cm,a=o.div=e.lineDiv;function n( +e){var t,n,r,i;if(!Dt(l,e)){if(l.somethingSelected())vl({lineWise:!1,text:l.getSelections()}),"cut"==e.type&&l.replaceSelection("",null,"cut");else{if(!l.options.lineWiseCopyCut)return;vl({lineWise:!0,text:(t=kl(l)).text}),"cut"==e.type&&l.operation(function(){l.setSelections(t.ranges,0,v),l.replaceSelection("",null,"cut")})}e.clipboardData&&(e.clipboardData.clearData(),r=Le.text.join("\n"),e.clipboardData.setData("Text",r),e.clipboardData.getData("Text")==r)?e.preventDefault():(r=(n=Sl()).firstChild,l.display.lineSpace.insertBefore(n,l.display.lineSpace.firstChild),r.value=Le.text.join("\n"),i=document.activeElement,s(r),setTimeout(function(){l.display.lineSpace.removeChild(n),i.focus(),i==a&&o.showPrimarySelection()},50))}}Cl(a,l.options.spellcheck,l.options.autocorrect,l.options.autocapitalize),w(a,"paste",function(e){Dt(l,e)||wl(e,l)||Ke<=11&&setTimeout(yi(l,function(){return t.updateFromDOM()}),20)}),w(a,"compositionstart",function(e){t.composing={data:e.data,done:!1}}),w(a,"compositionupdate",function(e){t.composing||(t.composing={data:e.data,done:!1})}),w(a,"compositionend",function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),w(a,"touchstart",function(){return o.forceCompositionEnd()}),w(a,"input",function(){t.composing||t.readFromDOMSoon()}),w(a,"copy",n),w(a,"cut",n)},t.prototype.prepareSelection=function(){var e=Gr(this.cm,!1);return e.focus=this.cm.state.focused,e},t.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},t.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},t.prototype.showPrimarySelection=function(){var e,t,n,r=this.getSelection(),i=this.cm,o=i.doc.sel.primary(),l=o.from(),o=o.to();if(i.display.viewTo==i.display.viewFrom||l.line>=i.display.viewTo||o.line=i.display.viewFrom&&Ml(i,l)||{node:t[0].measure.map[2],offset:0},l=(l=o.linee.firstLine()&&(t=A(t.line-1,N(e.doc,t.line-1).length)),n.ch==N(e.doc,n.line).text.length&&n.lines.viewTo-1)return!1;if(c=t.line==s.viewFrom||0==(c=Er(e,t.line))?(u=Yt(s.view[0].line),s.view[0].node):(u=Yt(s.view[c].line),s.view[c-1].node.nextSibling),n=(n=Er(e,n.line))==s.view.length-1?(d=s.viewTo-1,s.lineDiv.lastChild):(d=Yt(s.view[n+1].line)-1,s.view[n+1].node.previousSibling),!c)return!1;for(r=e.doc.splitLines(function(l,e,t,f,p){var n="",a=!1,s=l.doc.lineSeparator(),c=!1;function u(){a&&(n+=s,c&&(n+=s),a=c=!1)}function d(e){e&&(u(),n+=e)}for(;!function h(e){var t,n,r,i,o;if(1==e.nodeType){if(n=e.getAttribute("cm-text"))d(n);else if(n=e.getAttribute("cm-marker"))(n=l.findMarks(A(f,0),A(p+1,0),(o=+n,function(e){return e.id==o}))).length&&(t=n[0].find(0))&&d(_t(l.doc,t.from,t.to).join(s));else if("false"!=e.getAttribute("contenteditable")&&( +r=/^(pre|div|p|li|table|br)$/i.test(e.nodeName),/^br$/i.test(e.nodeName)||0!=e.textContent.length)){for(r&&u(),i=0;it.ch&&a.charCodeAt(a.length-l-1)==m.charCodeAt(m.length-l-1);)o--,l++;return r[r.length-1]=a.slice(0,a.length-l).replace(/^\u200b+/,""),r[0]=r[0].slice(o).replace(/\u200b+$/,""),s=A(u,o),c=A(d,i.length?mt(i).length-l:0),1a&&(yl(o,i.head.line,e,!0),a=i.head.line,s==o.doc.sel.primIndex&&ri(o));else{for(t=i.from(),i=i.to(),n=Math.max(a,t.line),a=Math.min(o.lastLine(),i.line-(i.ch?0:1))+1,r=n;r>1)?t[2*l-1]:0)>=i)r=l;else{if(!(t[2*l+1]l)&&e.top>t.offsetHeight?s=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(s=e.bottom),c+t.offsetWidth>o&&(c=o-t.offsetWidth)),t.style.top=s+"px",t.style.left=t.style.right="","right"==i?(c=a.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?c=0:"middle"==i&&(c=(a.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),n&&(r=this,l={left:c,top:s,right:c+t.offsetWidth,bottom:s+t.offsetHeight},null!=(l=ti(r,l)).scrollTop&&ai(r,l.scrollTop),null!=l.scrollLeft&&ci(r,l.scrollLeft))},triggerOnKeyDown:vi(ol),triggerOnKeyPress:vi(al),triggerOnKeyUp:ll,triggerOnMouseDown:vi(sl),execCommand:function(e){if(me.hasOwnProperty(e))return me[e].call(null,this)},triggerElectric:vi(function(e){xl(this,e)}),findPosH:function(e,t,n,r){var i,o,l=1;for(t<0&&(l=-1,t=-t),i=O(this.doc,e),o=0;o","i")}function o(e,t){var n,r,i,o;for(n in e)for(r=t[n]||(t[n]=[]),o=(i=e[n]).length-1;0<=o;o--)r.unshift(i[o])}n={},d.defineMode("htmlmixed",function(a,e){var t,s=d.getMode(a,{name:"xml",htmlMode:!0,multilineTagIndentFactor:e.multilineTagIndentFactor,multilineTagIndentPastTag:e.multilineTagIndentPastTag}),c={},n=e&&e.tags,r=e&&e.scriptTypes;if(o(i,c),n&&o(n,c),r)for(t=r.length-1;0<=t;t--)c.script.unshift(["type",r[t].matches,r[t].mode]);function u(e,t){var n,o,l,r=s.token(e,t.htmlState),i=/\btag\b/.test(r);return i&&!/[<>\s\/]/.test(e.current())&&( +n=t.htmlState.tagName&&t.htmlState.tagName.toLowerCase())&&c.hasOwnProperty(n)?t.inTag=n+" ":t.inTag&&i&&/>$/.test(e.current())?(n=/^([\S]+) (.*)/.exec(t.inTag),t.inTag=null,i=">"==e.current()&&function(e,t){for(var n,r=0;r")):null:t.match("--")?r(f("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),r(function i(r){return function(e,t){for(var n;null!=(n=e.next());){if("<"==n)return t.tokenize=i(r+1),t.tokenize(e,t);if(">"==n){if(1!=r)return t.tokenize=i(r-1),t.tokenize(e,t);t.tokenize=c;break}}return"meta"}}(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),n.tokenize=f("meta","?>"),"meta"):(o=t.eat("/")?"closeTag":"openTag",n.tokenize=h,"tag bracket"):"&"==e?(t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"))?"atom":"error":(t.eatWhile(/[^&<]/),null)}function h(e,t){var n,r,i=e.next();return">"==i||"/"==i&&e.eat(">")?(t.tokenize=c,o=">"==i?"endTag":"selfcloseTag","tag bracket"):"="==i?(o="equals",null):"<"==i?(t.tokenize=c,t.state=u,t.tagName=t.tagStart=null,(r=t.tokenize(e,t))?r+" tag error":"tag error"):/[\'\"]/.test(i)?(t.tokenize=(n=i,(r=function(e,t){for(;!e.eol();)if(e.next()==n){t.tokenize=h;break}return"string"}).isInAttribute=!0,r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function f(n,r){return function(e,t){for(;!e.eol();){if(e.match(r)){t.tokenize=c;break}e.next()}return n}}function p(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(s.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function m(e){e.context&&(e.context=e.context.prev)}function g(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!s.contextGrabbers.hasOwnProperty(n)||!s.contextGrabbers[n].hasOwnProperty(t))return;m(e)}}function u(e,t,n){return"openTag"==e?(n.tagStart=t.column(),y):"closeTag"==e?v:u}function y(e,t,n){return"word"==e?(n.tagName=t.current(),l="tag",d):s.allowMissingTagName&&"endTag"==e?(l="tag bracket",d(e,0,n)):(l="error",y)}function v(e,t,n){var r;return"word"==e?(r=t.current(),n.context&&n.context.tagName!=r&&s.implicitlyClosed.hasOwnProperty(n.context.tagName)&&m(n),n.context&&n.context.tagName==r||!1===s.matchClosing?(l="tag",i):(l="tag error",b)):s.allowMissingTagName&&"endTag"==e?(l="tag bracket",i(e,0,n)):(l="error",b)}function i(e,t,n){return"endTag"!=e?(l="error",i):(m(n),u)}function b(e,t,n){return l="error",i(e,0,n)}function d(e,t,n){return"word"==e?(l="attribute",w):"endTag"==e||"selfcloseTag"==e?(r=n.tagName,i=n.tagStart,n.tagName=n.tagStart=null,"selfcloseTag"==e||s.autoSelfClosers.hasOwnProperty(r)?g(n,r):(g(n,r),n.context=new p(n,r,i==n.indented)),u):(l="error",d);var r,i}function w(e,t,n){return"equals"==e?x:(s.allowMissing||(l="error"),d(e,0,n))}function x(e,t,n){return"string"==e?k:"word"==e&&s.allowUnquoted?(l="string",d):(l="error",d(e,0,n))}function k(e,t,n){return"string"==e?k:d(e,0,n)}return c.isInText=!0,{startState:function(e){var t={tokenize:c,state:u,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;o=null;var n=t.tokenize(e,t);return(n||o)&&"comment"!=n&&(l=null,t.state=t.state(o||n,e,t),l&&(n="error"==l?n+" error":l)),n},indent:function(e,t,n +){var r,i,o=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+a;if(o&&o.noIndent)return C.Pass;if(e.tokenize!=h&&e.tokenize!=c)return n?n.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==s.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+a*(s.multilineTagIndentFactor||1);if(s.alignCDATA&&/$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:s.htmlMode?"html":"xml",helperType:s.htmlMode?"html":"xml",skipAttribute:function(e){e.state==x&&(e.state=d)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],n=e.context;n;n=n.prev)n.tagName&&t.push(n.tagName);return t.reverse()}}}),C.defineMIME("text/xml","xml"),C.defineMIME("application/xml","xml"),C.mimeModes.hasOwnProperty("text/html")||C.defineMIME("text/html",{name:"xml",htmlMode:!0})},"object"==typeof exports&&"object"==typeof module?r(require("../../lib/codemirror")):r(n),r=function(Qe){"use strict";Qe.defineMode("javascript",function(t,p){var r,i,m,a,n,g,y,v,b,w=t.indentUnit,x=p.statementIndent,k=p.jsonld,C=p.json||k,c=p.typescript,S=p.wordCharacters||/[\w$\xa1-\uffff]/,L=(t=e("keyword a"),g=e("keyword b"),y=e("keyword c"),v=e("keyword d"),b=e("operator"),{"if":e("if"),"while":t,"with":t,"else":g,"do":g,"try":g,"finally":g,"return":v,"break":v,"continue":v,"new":e("new"),"delete":y,"void":y,"throw":y,"debugger":e("debugger"),"var":e("var"),"const":e("var"),"let":e("var"),"function":e("function"),"catch":e("catch"),"for":e("for"),"switch":e("switch"),"case":e("case"),"default":e("default"),"in":b,"typeof":b,"instanceof":b,"true":t={type:"atom",style:"atom"},"false":t,"null":t,undefined:t,NaN:t,Infinity:t,"this":e("this"),"class":e("class"),"super":e("atom"),"yield":y,"export":e("export"),"import":e("import"),"extends":y,"await":y}),T=/[+\-*&%=<>!?|~^@]/,M=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function e(e){return{type:e,style:"keyword"}}function N(e,t,n){return r=e,i=n,t}function A(e,t){var i,n=e.next();if('"'==n||"'"==n)return t.tokenize=(i=n,function(e,t){var n,r=!1;if(k&&"@"==e.peek()&&e.match(M))return t.tokenize=A,N("jsonld-keyword","meta");for(;null!=(n=e.next())&&(n!=i||r);)r=!r&&"\\"==n;return r||(t.tokenize=A),N("string","string")}),t.tokenize(e,t);if("."==n&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return N("number","number");if("."==n&&e.match(".."))return N("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return N(n);if("="==n&&e.eat(">"))return N("=>","operator");if("0"==n&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return N("number","number");if(/\d/.test(n))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),N("number","number");if("/"==n)return e.eat("*")?(t.tokenize=O)(e,t):e.eat("/")?(e.skipToEnd(),N("comment","comment")):Ze(e,t,1)?(function(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),N("regexp","string-2")):(e.eat("="),N("operator","operator",e.current()));if("`"==n)return(t.tokenize=D)(e,t);if("#"==n)return e.skipToEnd(),N("error","error");if("<"==n&&e.match("!--")||"-"==n&&e.match("->"))return e.skipToEnd(),N("comment","comment");if(T.test(n))return">"==n&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=n&&"="!=n||e.eat("="):/[<>*+\-]/.test(n)&&(e.eat(n),">"==n&&e.eat(n))),N("operator","operator",e.current());if(S.test(n)){if(e.eatWhile(S),n=e.current(),"."!=t.lastType){if(L.propertyIsEnumerable(n))return N((t=L[n]).type,t.style,n);if("async"==n&&e.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/,!1))return N("async","keyword",n)}return N("variable","variable",n)}}function O(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=A;break}r="*"==n}return N("comment","comment")}function D(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=A;break}r=!r&&"\\"==n}return N("quasi","string-2",e.current())}function W(e,t){var n,r,i,o,l,a,s;if(t.fatArrowAt&&(t.fatArrowAt=null),!((n=e.string.indexOf("=>",e.start))<0)){for(i=0,o=!1,l=(n=c&&(r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n)))?r.index:n)-1;0<=l;--l)if(a=e.string.charAt(l),0<=(s="([{}])".indexOf(a))&&s<3){if(!i){++l;break}if(0==--i){"("==a&&(o=!0);break}}else if(3<=s&&s<6)++i;else if(S.test(a))o=!0;else if(/["'\/`]/.test(a))for(;;--l){if(0==l)return;if(e.string.charAt(l-1)==a&&"\\"!=e.string.charAt(l-2)){l--;break}}else if(o&&!i){++l;break}o&&!i&&(t.fatArrowAt=l)}}function z(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function P(e,t,n,r,i){var o=e.cc;for(a.state=e,a.stream=i,a.marked=null,a.cc=o,a.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():C?l:K)(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return a.marked?a.marked:"variable"==n&&function(e,t){for(var n,r=e.localVars;r;r=r.next)if(r.name==t)return 1;for(n=e.context;n;n=n.prev)for(r=n.vars;r;r=r.next)if(r.name==t)return 1}(e,r)?"variable-2":t}}function s(){for(var e=arguments.length-1;0<=e;e--)a.cc.push(arguments[e])}function u(){return s.apply(null,arguments),!0}function H(e,t){for(var n=t;n;n=n.next)if(n.name==e)return 1}function I(e){var t,n=a.state;if(a.marked="def",n.context)if("var"==n.lexical.info&&n.context&&n.context.block){if(null!=(t=function r(e,t){{var n;return t?t.block?(n=r(e,t.prev))?n==t.prev?t:new F(n,t.vars,!0):null:H(e,t.vars)?t:new F(t.prev,new R(e,t.vars),!1):null}}(e,n.context)))return void(n.context=t)}else if( +!H(e,n.localVars))return void(n.localVars=new R(e,n.localVars));p.globalVars&&!H(e,n.globalVars)&&(n.globalVars=new R(e,n.globalVars))}function E(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function F(e,t,n){this.prev=e,this.vars=t,this.block=n}function R(e,t){this.name=e,this.next=t}function B(){a.state.context=new F(a.state.context,a.state.localVars,!1),a.state.localVars=n}function j(){a.state.context=new F(a.state.context,a.state.localVars,!0),a.state.localVars=null}function V(){a.state.localVars=a.state.context.vars,a.state.context=a.state.context.prev}function o(r,i){var e=function(){var e,t=a.state,n=t.indented;if("stat"==t.lexical.type)n=t.lexical.indented;else for(e=t.lexical;e&&")"==e.type&&e.align;e=e.prev)n=e.indented;t.lexical=new z(n,a.stream.column(),r,null,t.lexical,i)};return e.lex=!0,e}function d(){var e=a.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function h(t){return function n(e){return e==t?u():";"==t||"}"==e||")"==e||"]"==e?s():u(n)}}function K(e,t){return"var"==e?u(o("vardef",t),ke,h(";"),d):"keyword a"==e?u(o("form"),q,K,d):"keyword b"==e?u(o("form"),K,d):"keyword d"==e?a.stream.match(/^\s*$/,!1)?u():u(o("stat"),$,h(";"),d):"debugger"==e?u(h(";")):"{"==e?u(o("}"),j,ue,d,V):";"==e?u():"if"==e?("else"==a.state.lexical.info&&a.state.cc[a.state.cc.length-1]==d&&a.state.cc.pop()(),u(o("form"),q,K,d,Ne)):"function"==e?u(We):"for"==e?u(o("form"),Ae,K,d):"class"==e||c&&"interface"==t?(a.marked="keyword",u(o("form","class"==e?e:t),Ee,d)):"variable"==e?c&&"declare"==t?(a.marked="keyword",u(K)):c&&("module"==t||"enum"==t||"type"==t)&&a.stream.match(/^\s*\w/,!1)?(a.marked="keyword","enum"==t?u(Xe):"type"==t?u(Pe,h("operator"),f,h(";")):u(o("form"),Ce,h("{"),o("}"),ue,d,d)):c&&"namespace"==t?(a.marked="keyword",u(o("form"),l,K,d)):c&&"abstract"==t?(a.marked="keyword",u(K)):u(o("stat"),re):"switch"==e?u(o("form"),q,h("{"),o("}","switch"),j,ue,d,d,V):"case"==e?u(l,h(":")):"default"==e?u(h(":")):"catch"==e?u(o("form"),B,G,K,d,V):"export"==e?u(o("stat"),je,d):"import"==e?u(o("stat"),Ke,d):"async"==e?u(K):"@"==t?u(l,K):s(o("stat"),l,h(";"),d)}function G(e){if("("==e)return u(He,h(")"))}function l(e,t){return _(e,t,!1)}function U(e,t){return _(e,t,!0)}function q(e){return"("!=e?s():u(o(")"),l,h(")"),d)}function _(e,t,n){var r,i;if(a.state.fatArrowAt==a.stream.start){if(r=n?ee:J,"("==e)return u(B,o(")"),se(He,")"),d,h("=>"),r,V);if("variable"==e)return s(B,Ce,h("=>"),r,V)}return r=n?Y:X,m.hasOwnProperty(e)?u(r):"function"==e?u(We,r):"class"==e||c&&"interface"==t?(a.marked="keyword",u(o("form"),Ie,d)):"keyword c"==e||"async"==e?u(n?U:l):"("==e?u(o(")"),$,h(")"),d,r):"operator"==e||"spread"==e?u(n?U:l):"["==e?u(o("]"),$e,d,r):"{"==e?ce(oe,"}",null,r):"quasi"==e?s(Z,r):"new"==e?u((i=n,function(e){return"."==e?u(i?ne:te):"variable"==e&&c?u(be,i?Y:X):s(i?U:l)})):"import"==e?u(l):u()}function $(e){return e.match(/[;\}\)\],]/)?s():s(l)}function X(e,t){return","==e?u(l):Y(e,t,!1)}function Y(e,t,n){var r=0==n?X:Y,i=0==n?l:U;return"=>"==e?u(B,n?ee:J,V):"operator"==e?/\+\+|--/.test(t)||c&&"!"==t?u(r):c&&"<"==t&&a.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?u(o(">"),se(f,">"),d,r):"?"==t?u(l,h(":"),i):u(i):"quasi"==e?s(Z,r):";"!=e?"("==e?ce(U,")","call",r):"."==e?u(ie,r):"["==e?u(o("]"),$,h("]"),d,r):c&&"as"==t?(a.marked="keyword",u(f,r)):"regexp"==e?(a.state.lastType=a.marked="operator",a.stream.backUp(a.stream.pos-a.stream.start-1),u(i)):void 0:void 0}function Z(e,t){return"quasi"!=e?s():"${"!=t.slice(t.length-2)?u(Z):u(l,Q)}function Q(e){if("}"==e)return a.marked="string-2",a.state.tokenize=D,u(Z)}function J(e){return W(a.stream,a.state),s("{"==e?K:l)}function ee(e){return W(a.stream,a.state),s("{"==e?K:U)}function te(e,t){if("target"==t)return a.marked="keyword",u(X)}function ne(e,t){if("target"==t)return a.marked="keyword",u(Y)}function re(e){return":"==e?u(d,K):s(X,h(";"),d)}function ie(e){if("variable"==e)return a.marked="property",u()}function oe(e,t){return"async"==e?(a.marked="property",u(oe)):"variable"!=e&&"keyword"!=a.style?"number"==e||"string"==e?(a.marked=k?"property":a.style+" property",u(ae)):"jsonld-keyword"==e?u(ae):c&&E(t)?(a.marked="keyword",u(oe)):"["==e?u(l,de,h("]"),ae):"spread"==e?u(U,ae):"*"==t?(a.marked="keyword",u(oe)):":"==e?s(ae):void 0:(a.marked="property","get"==t||"set"==t?u(le):(c&&a.state.fatArrowAt==a.stream.start&&(n=a.stream.match(/^\s*:\s*/,!1))&&(a.state.fatArrowAt=a.stream.pos+n[0].length),u(ae)));var n}function le(e){return"variable"!=e?s(ae):(a.marked="property",u(We))}function ae(e){return":"==e?u(U):"("==e?s(We):void 0}function se(r,i,o){function l(e,t){var n;return(o?-1"),f):void 0}function me(e){if("=>"==e)return u(f)}function ge(e,t){return"variable"==e||"keyword"==a.style?(a.marked="property",u(ge)):"?"==t||"number"==e||"string"==e?u(ge):":"==e?u(f):"["==e?u(h("variable"),he,h("]"),ge):"("==e?s(ze,ge):void 0}function ye(e,t){return"variable"==e&&a.stream.match(/^\s*[?:]/,!1)||"?"==t?u(ye):":"==e?u(f):"spread"==e?u(ye):s( +f)}function ve(e,t){return"<"==t?u(o(">"),se(f,">"),d,ve):"|"==t||"."==e||"&"==t?u(f):"["==e?u(f,h("]"),ve):"extends"==t||"implements"==t?(a.marked="keyword",u(f)):"?"==t?u(f,h(":"),f):void 0}function be(e,t){if("<"==t)return u(o(">"),se(f,">"),d,ve)}function we(){return s(f,xe)}function xe(e,t){if("="==t)return u(f)}function ke(e,t){return"enum"==t?(a.marked="keyword",u(Xe)):s(Ce,de,Te,Me)}function Ce(e,t){return c&&E(t)?(a.marked="keyword",u(Ce)):"variable"==e?(I(t),u()):"spread"==e?u(Ce):"["==e?ce(Le,"]"):"{"==e?ce(Se,"}"):void 0}function Se(e,t){return"variable"!=e||a.stream.match(/^\s*:/,!1)?("variable"==e&&(a.marked="property"),"spread"==e?u(Ce):"}"==e?s():"["==e?u(l,h("]"),h(":"),Se):u(h(":"),Ce,Te)):(I(t),u(Te))}function Le(){return s(Ce,Te)}function Te(e,t){if("="==t)return u(U)}function Me(e){if(","==e)return u(ke)}function Ne(e,t){if("keyword b"==e&&"else"==t)return u(o("form","else"),K,d)}function Ae(e,t){return"await"==t?u(Ae):"("==e?u(o(")"),Oe,d):void 0}function Oe(e){return"var"==e?u(ke,De):("variable"==e?u:s)(De)}function De(e,t){return")"==e?u():";"==e?u(De):"in"==t||"of"==t?(a.marked="keyword",u(l,De)):s(l,De)}function We(e,t){return"*"==t?(a.marked="keyword",u(We)):"variable"==e?(I(t),u(We)):"("==e?u(B,o(")"),se(He,")"),d,fe,K,V):c&&"<"==t?u(o(">"),se(we,">"),d,We):void 0}function ze(e,t){return"*"==t?(a.marked="keyword",u(ze)):"variable"==e?(I(t),u(ze)):"("==e?u(B,o(")"),se(He,")"),d,fe,V):c&&"<"==t?u(o(">"),se(we,">"),d,ze):void 0}function Pe(e,t){return"keyword"==e||"variable"==e?(a.marked="type",u(Pe)):"<"==t?u(o(">"),se(we,">"),d):void 0}function He(e,t){return"@"==t&&u(l,He),"spread"==e?u(He):c&&E(t)?(a.marked="keyword",u(He)):c&&"this"==e?u(de,Te):s(Ce,de,Te)}function Ie(e,t){return("variable"==e?Ee:Fe)(e,t)}function Ee(e,t){if("variable"==e)return I(t),u(Fe)}function Fe(e,t){return"<"==t?u(o(">"),se(we,">"),d,Fe):"extends"==t||"implements"==t||c&&","==e?("implements"==t&&(a.marked="keyword"),u(c?f:l,Fe)):"{"==e?u(o("}"),Re,d):void 0}function Re(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||c&&E(t))&&a.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(a.marked="keyword",u(Re)):"variable"==e||"keyword"==a.style?(a.marked="property",u(c?Be:We,Re)):"number"==e||"string"==e?u(c?Be:We,Re):"["==e?u(l,de,h("]"),c?Be:We,Re):"*"==t?(a.marked="keyword",u(Re)):c&&"("==e?s(ze,Re):";"==e||","==e?u(Re):"}"==e?u():"@"==t?u(l,Re):void 0}function Be(e,t){if("?"==t)return u(Be);if(":"==e)return u(f,Te);if("="==t)return u(U);e=a.state.lexical.prev;return s(e&&"interface"==e.info?ze:We)}function je(e,t){return"*"==t?(a.marked="keyword",u(_e,h(";"))):"default"==t?(a.marked="keyword",u(l,h(";"))):"{"==e?u(se(Ve,"}"),_e,h(";")):s(K)}function Ve(e,t){return"as"==t?(a.marked="keyword",u(h("variable"))):"variable"==e?s(U,Ve):void 0}function Ke(e){return"string"==e?u():"("==e?s(l):s(Ge,Ue,_e)}function Ge(e,t){return"{"==e?ce(Ge,"}"):("variable"==e&&I(t),"*"==t&&(a.marked="keyword"),u(qe))}function Ue(e){if(","==e)return u(Ge,Ue)}function qe(e,t){if("as"==t)return a.marked="keyword",u(Ge)}function _e(e,t){if("from"==t)return a.marked="keyword",u(l)}function $e(e){return"]"==e?u():s(se(U,"]"))}function Xe(){return s(o("form"),Ce,h("{"),o("}"),se(Ye,"}"),d,d)}function Ye(){return s(Ce,Te)}function Ze(e,t,n){return t.tokenize==A&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return m={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},a={state:null,column:null,marked:null,cc:null},n=new R("this",new R("arguments",null)),d.lex=V.lex=!0,{startState:function(e){e={tokenize:A,lastType:"sof",cc:[],lexical:new z((e||0)-w,0,"block",!1),localVars:p.localVars,context:p.localVars&&new F(null,null,!1),indented:e||0};return p.globalVars&&"object"==typeof p.globalVars&&(e.globalVars=p.globalVars),e},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),W(e,t)),t.tokenize!=O&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==r?n:(t.lastType="operator"!=r||"++"!=i&&"--"!=i?r:"incdec",P(t,n,r,i,e))},indent:function(e,t){var n,r,i,o,l,a,s,c;if(e.tokenize==O)return Qe.Pass;if(e.tokenize!=A)return 0;if(n=t&&t.charAt(0),r=e.lexical,!/^\s*else\b/.test(t))for(o=e.cc.length-1;0<=o;--o)if((l=e.cc[o])==d)r=r.prev;else if(l!=Ne)break;for(;("stat"==r.type||"form"==r.type)&&("}"==n||(i=e.cc[e.cc.length-1])&&(i==X||i==Y)&&!/^[,\.=+\-*:?[\(]/.test(t));)r=r.prev;return a=n==(c=(r=x&&")"==r.type&&"stat"==r.prev.type?r.prev:r).type),"vardef"==c?r.indented+("operator"==e.lastType||","==e.lastType?r.info.length+1:0):"form"==c&&"{"==n?r.indented:"form"==c?r.indented+w:"stat"==c?r.indented+(c=t,"operator"==(s=e).lastType||","==s.lastType||T.test(c.charAt(0))||/[,.]/.test(c.charAt(0))?x||w:0):"switch"!=r.info||a||0==p.doubleIndentSwitch?r.align?r.column+(a?0:1):r.indented+(a?0:w):r.indented+(/^(?:case|default)\b/.test(t)?w:2*w)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:C?null:"/*",blockCommentEnd:C?null:"*/",blockCommentContinue:C?null:" * ",lineComment:C?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:C?"json":"javascript",jsonldMode:k,jsonMode:C,expressionAllowed:Ze,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=l&&t!=U||e.cc.pop()}}}),Qe.registerHelper("wordChars","javascript",/[\w$]/),Qe.defineMIME("text/javascript","javascript"),Qe.defineMIME("text/ecmascript","javascript"),Qe.defineMIME("application/javascript","javascript"),Qe.defineMIME("application/x-javascript","javascript"),Qe.defineMIME("application/ecmascript","javascript"),Qe.defineMIME("application/json",{name:"javascript",json:!0}),Qe.defineMIME("application/x-json",{name:"javascript",json:!0}),Qe.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),Qe.defineMIME("text/typescript",{name:"javascript",typescript:!0}),Qe.defineMIME("application/typescript",{ +name:"javascript",typescript:!0})},"object"==typeof exports&&"object"==typeof module?r(require("../../lib/codemirror")):r(n),r=function(A){"use strict";var c,u,e,d,t,h,n,f,r,p,i,o,m,g,l,y,a,v;function s(e){for(var t={},n=0;n*\/]/.test(r)?( +o="select-op",null):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?o="qualifier":/[:;{}\[\]\(\)]/.test(r)?S(null,r):e.match(/[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/.test(e.current().toLowerCase())&&(t.tokenize=T),o="variable","variable callee"):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),o="word","property"):o=null})(e,t);return n&&"object"==typeof n&&(o=n[1],n=n[0]),l=n,"comment"!=o&&(t.state=a[t.state](o,e,t)),l},indent:function(e,t){var e=e.context,t=t&&t.charAt(0),n=e.indent;return(e="prop"!=e.type||"}"!=t&&")"!=t?e:e.prev).prev&&("}"!=t||"block"!=e.type&&"top"!=e.type&&"interpolation"!=e.type&&"restricted_atBlock"!=e.type?(")"!=t||"parens"!=e.type&&"atBlock_parens"!=e.type)&&("{"!=t||"at"!=e.type&&"atBlock"!=e.type)||(n=Math.max(0,e.indent-d)):n=(e=e.prev).indent),n},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:e,fold:"brace"}}),u=s(c=["domain","regexp","url","url-prefix"]),e=s(v=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"]),t=s(d=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"]),n=s(h=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"]),r=s(f=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold", +"shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"]),i=s(p=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"]),o=s(["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),m=s(["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"]),l=s(g=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]),a=s(y=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed", +"extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"]),v=c.concat(v).concat(d).concat(h).concat(f).concat(p).concat(g).concat(y),A.registerHelper("hintWords","css",v),A.defineMIME("text/css",{documentTypes:u,mediaTypes:e,mediaFeatures:t,mediaValueKeywords:n,propertyKeywords:r,nonStandardPropertyKeywords:i,fontProperties:o,counterDescriptors:m,colorKeywords:l,valueKeywords:a,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=b)(e,t)}},name:"css"}),A.defineMIME("text/x-scss",{mediaTypes:e,mediaFeatures:t,mediaValueKeywords:n,propertyKeywords:r,nonStandardPropertyKeywords:i,colorKeywords:l,valueKeywords:a,fontProperties:o,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=b)(e,t):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),A.defineMIME("text/x-less",{mediaTypes:e,mediaFeatures:t,mediaValueKeywords:n,propertyKeywords:r,nonStandardPropertyKeywords:i,colorKeywords:l,valueKeywords:a,fontProperties:o,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=b)(e,t):["operator","operator"]},"@":function(e){return e.eat( +"{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),A.defineMIME("text/x-gss",{documentTypes:u,mediaTypes:e,mediaFeatures:t,propertyKeywords:r,nonStandardPropertyKeywords:i,fontProperties:o,counterDescriptors:m,colorKeywords:l,valueKeywords:a,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=b)(e,t)}},name:"css",helperType:"gss"})},"object"==typeof exports&&"object"==typeof module?r(require("../../lib/codemirror")):r(n),e.namespace("M.atto_html").CodeMirror=n,window.CodeMirror=i},"@VERSION@",{requires:["moodle-atto_html-codemirror-skin"]}); \ No newline at end of file diff --git a/lib/editor/atto/plugins/image/yui/build/moodle-atto_image-button/moodle-atto_image-button-min.js b/lib/editor/atto/plugins/image/yui/build/moodle-atto_image-button/moodle-atto_image-button-min.js index 30dcf5cb0d3..03155095aa6 100644 --- a/lib/editor/atto/plugins/image/yui/build/moodle-atto_image-button/moodle-atto_image-button-min.js +++ b/lib/editor/atto/plugins/image/yui/build/moodle-atto_image-button/moodle-atto_image-button-min.js @@ -1,3 +1,3 @@ -YUI.add("moodle-atto_image-button",function(m,e){var u={RESPONSIVE:"img-responsive",INPUTALIGNMENT:"atto_image_alignment",INPUTALT:"atto_image_altentry",INPUTHEIGHT:"atto_image_heightentry",INPUTSUBMIT:"atto_image_urlentrysubmit",INPUTURL:"atto_image_urlentry",INPUTSIZE:"atto_image_size",INPUTWIDTH:"atto_image_widthentry",IMAGEALTWARNING:"atto_image_altwarning",IMAGEBROWSER:"openimagebrowser",IMAGEPRESENTATION:"atto_image_presentation",INPUTCONSTRAIN:"atto_image_constrain",INPUTCUSTOMSTYLE:"atto_image_customstyle",IMAGEPREVIEW:"atto_image_preview",IMAGEPREVIEWBOX:"atto_image_preview_box",ALIGNSETTINGS:"atto_image_button"},t={INPUTURL:"."+u.INPUTURL},a=[{name:"verticalAlign",str:"alignment_top",value:"text-top",margin:"0 0.5em"},{name:"verticalAlign",str:"alignment_middle",value:"middle",margin:"0 0.5em"},{name:"verticalAlign",str:"alignment_bottom",value:"text-bottom",margin:"0 0.5em",isDefault:!0},{name:"float",str:"alignment_left",value:"left",margin:"0 0.5em 0 0"},{name:"float",str:"alignment_right",value:"right",margin:"0 0 0 0.5em"}],I=/\d+%/,_="atto_image",p='{{alt}}';m.namespace("M.atto_image").Button=m.Base.create("button",m.M.editor_atto.EditorPlugin,[],{_currentSelection:null,_selectedImage:null,_form:null,_rawImageDimensions:null,initializer:function(){this.addButton({icon:"e/insert_edit_image",callback:this._displayDialogue,tags:"img",tagMatchRequiresAll:!1}),this.editor.delegate("dblclick",this._displayDialogue,"img",this),this.editor.delegate("click",this._handleClick,"img",this),this.editor.on("paste",this._handlePaste,this),this.editor.on("drop",this._handleDragDrop,this),this.editor.on("dragover",function(e){e.preventDefault()},this),this.editor.on("dragenter",function(e){e.preventDefault()},this)},_handleDragDrop:function(e){return!e._event||!e._event.dataTransfer||this._handlePasteOrDropHelper(e,e._event.dataTransfer)},_handlePaste:function(e){return!e._event||!e._event.clipboardData||this._handlePasteOrDropHelper(e,e._event.clipboardData)},_handlePasteOrDropHelper:function(e,t){var i,n,s=t.items,a=!1;for(i=0;i{{#if showFilepicker}}
                                      {{else}}
                                      {{/if}}
                                      0 / 125
                                      x

                                      '),t=this.get("host").canShowFilepicker("image"),i=m.Node.create(e({elementid:this.get("host").get("elementid"),CSS:u,component:_,showFilepicker:t,alignments:a}));return this._form=i,this._applyImageProperties(this._form),this._form.one("."+u.INPUTURL).on("blur",this._urlChanged,this),this._form.one("."+u.IMAGEPRESENTATION).on("change",this._updateWarning,this),this._form.one("."+u.INPUTALT).on("change",this._updateWarning,this),this._form.one("."+u.INPUTWIDTH).on("blur",this._autoAdjustSize,this),this._form.one("."+u.INPUTHEIGHT).on("blur",this._autoAdjustSize,this,!0),this._form.one("."+u.INPUTCONSTRAIN).on("change",function(e){e.target.get("checked")&&this._autoAdjustSize(e)},this),this._form.one("."+u.INPUTURL).on("blur",this._urlChanged,this),this._form.one("."+u.INPUTSUBMIT).on("click",this._setImage,this),t&&this._form.one("."+u.IMAGEBROWSER).on("click",function(){this.get("host").showFilepicker("image",this._filepickerCallback,this)},this),this._form.one("."+u.INPUTALT).on("keyup",this._handleKeyup,this),i},_autoAdjustSize:function(e,t){var i,n,s,a,o,l,r,h,g,d,c;t=t||!1,i=this._form.one("."+u.INPUTWIDTH),n="width",s=this._form.one("."+u.INPUTHEIGHT),a="height",o=this._form.one("."+u.INPUTCONSTRAIN),l=i.get("value"),r=s.get("value"),h=this._form.one("."+u.IMAGEPREVIEW),this._rawImageDimensions&&(""===l&&(l=this._rawImageDimensions[n],i.set("value",l),l=i.get("value")),h.setStyles({width:null,height:null}),o.get("checked")?(t&&(c=i,i=s,s=c,c=n,n=a,a=c,c=l,l=r,r=c),l.match(I)?(r=l,g=parseInt(l,10),d=this._rawImageDimensions.width/100*g,h.setStyle("width",d),d=this._rawImageDimensions.height/100*g,h.setStyle("height",d)):(r=Math.round(l/this._rawImageDimensions[n]*this._rawImageDimensions[a]),t?h.setStyles({width:r,height:l}):h.setStyles({width:l,height:r})),s.set("value",r)):(l.match(I)?(g=parseInt(l,10),d=this._rawImageDimensions.width/100*g,h.setStyle("width",d+"px")):h.setStyle("width",l+"px"),r.match(I)?(g=parseInt(r,10),d=this._rawImageDimensions.height/100*g,h.setStyle("height",d+"px")):h.setStyle("height",r+"px")))},_filepickerCallback:function(e){""!==e.url&&(this._form.one("."+u.INPUTURL).set("value",e.url),this._form.one("."+u.INPUTWIDTH).set("value",""),this._form.one("."+u.INPUTHEIGHT).set("value",""),this._loadPreviewImage(e.url))},_applyImageProperties:function(t){var e=this._getSelectedImageProperties(),i=t.one("."+u.IMAGEPREVIEW);if(!1===e)return i.setStyle("display","none"),void a.some(function(e){return!!e.isDefault&&(t.one("."+u.INPUTALIGNMENT).set("value",e.value),!0)},this);e.align&&t.one("."+u.INPUTALIGNMENT).set("value",e.align),e.customstyle&&t.one("."+u.INPUTCUSTOMSTYLE).set("value",e.customstyle),e.width&&t.one("."+u.INPUTWIDTH).set("value",e.width),e.height&&t.one("."+u.INPUTHEIGHT).set("value",e.height),e.alt&&t.one("."+u.INPUTALT).set("value",e.alt),e.src&&(t.one("."+u.INPUTURL).set("value",e.src), -this._loadPreviewImage(e.src)),e.presentation&&t.one("."+u.IMAGEPRESENTATION).set("checked","checked"),this._autoAdjustSize()},_getSelectedImageProperties:function(){var e,t,i,n,s={src:null,alt:null,width:null,height:null,align:"",presentation:!1},a=this.get("host").getSelectedNodes();return(a=a&&a.filter("img"))&&a.size()?(n=this._removeLegacyAlignment(a.item(0)),i=(this._selectedImage=n).getAttribute("style"),s.customstyle=i,(e=n.getAttribute("width")).match(I)||(e=parseInt(e,10)),(t=n.getAttribute("height")).match(I)||(t=parseInt(t,10)),0!==e&&(s.width=e),0!==t&&(s.height=t),this._getAlignmentPropeties(n,s),s.src=n.getAttribute("src"),s.alt=n.getAttribute("alt")||"",s.presentation="presentation"===n.get("role"),s):(this._selectedImage=null,!1)},_getAlignmentPropeties:function(i,n){var s;!a.some(function(e){var t=this._getAlignmentClass(e.value);return i.hasClass(t)?(n.align=e.value,!0):(e.isDefault&&(s=e.value),!1)},this)&&s&&(n.align=s)},_urlChanged:function(){var e=this._form.one("."+u.INPUTURL);""!==e.get("value")&&this._loadPreviewImage(e.get("value"))},_setImage:function(e){var t,i=this._form,n=i.one("."+u.INPUTURL).get("value"),s=i.one("."+u.INPUTALT).get("value"),a=i.one("."+u.INPUTWIDTH).get("value"),o=i.one("."+u.INPUTHEIGHT).get("value"),l=this._getAlignmentClass(i.one("."+u.INPUTALIGNMENT).get("value")),r=i.one("."+u.IMAGEPRESENTATION).get("checked"),h=i.one("."+u.INPUTCONSTRAIN).get("checked"),g=i.one("."+u.INPUTCUSTOMSTYLE).get("value"),d=[],c=this.get("host");if(e.preventDefault(),!this._updateWarning()){if(c.focus(),""!==n){if(this._selectedImage?c.setSelection(c.getSelectionFromNode(this._selectedImage)):c.setSelection(this._currentSelection),h&&d.push(u.RESPONSIVE),d.push(l),!a.match(I)&&isNaN(parseInt(a,10)))return void i.one("."+u.INPUTWIDTH).focus();if(!o.match(I)&&isNaN(parseInt(o,10)))return void i.one("."+u.INPUTHEIGHT).focus();t=m.Handlebars.compile(p)({url:n,alt:s,width:a,height:o,presentation:r,customstyle:g,classlist:d.join(" ")}),this.get("host").insertContentAtFocusPoint(t),this.markUpdated()}this.getDialogue({focusAfterHide:null}).hide()}},_removeLegacyAlignment:function(i){return i.getStyle("margin")&&a.some(function(e){if(i.getStyle(e.name)!==e.value)return!1;var t=m.Node.create("
                                      ");return t.setStyle("margin",e.margin),i.getStyle("margin")===t.getStyle("margin")&&(i.addClass(this._getAlignmentClass(e.value)),i.setStyle(e.name,null),i.setStyle("margin",null),!0)},this),i},_getAlignmentClass:function(e){return u.ALIGNSETTINGS+"_"+e},_updateWarning:function(){var e=this._form,t=!0,i=e.one("."+u.INPUTALT).get("value"),n=e.one("."+u.IMAGEPRESENTATION).get("checked");return t=""!==i||n?(e.one("."+u.IMAGEALTWARNING).setStyle("display","none"),e.one("."+u.INPUTALT).setAttribute("aria-invalid",!1),e.one("."+u.IMAGEPRESENTATION).setAttribute("aria-invalid",!1),!1):(e.one("."+u.IMAGEALTWARNING).setStyle("display","block"),e.one("."+u.INPUTALT).setAttribute("aria-invalid",!0),e.one("."+u.IMAGEPRESENTATION).setAttribute("aria-invalid",!0),!0),this.getDialogue().centerDialogue(),t},_handleKeyup:function(){var e=this._form,t=e.one("."+u.INPUTALT).get("value").length;e.one("#currentcount").setHTML(t)}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); \ No newline at end of file +YUI.add("moodle-atto_image-button",function(c,e){var m={RESPONSIVE:"img-responsive",INPUTALIGNMENT:"atto_image_alignment",INPUTALT:"atto_image_altentry",INPUTHEIGHT:"atto_image_heightentry",INPUTSUBMIT:"atto_image_urlentrysubmit",INPUTURL:"atto_image_urlentry",INPUTSIZE:"atto_image_size",INPUTWIDTH:"atto_image_widthentry",IMAGEALTWARNING:"atto_image_altwarning",IMAGEBROWSER:"openimagebrowser",IMAGEPRESENTATION:"atto_image_presentation",INPUTCONSTRAIN:"atto_image_constrain",INPUTCUSTOMSTYLE:"atto_image_customstyle",IMAGEPREVIEW:"atto_image_preview",IMAGEPREVIEWBOX:"atto_image_preview_box",ALIGNSETTINGS:"atto_image_button"},t={INPUTURL:"."+m.INPUTURL},a=[{name:"verticalAlign",str:"alignment_top",value:"text-top",margin:"0 0.5em"},{name:"verticalAlign",str:"alignment_middle",value:"middle",margin:"0 0.5em"},{name:"verticalAlign",str:"alignment_bottom",value:"text-bottom",margin:"0 0.5em",isDefault:!0},{name:"float",str:"alignment_left",value:"left",margin:"0 0.5em 0 0"},{name:"float",str:"alignment_right",value:"right",margin:"0 0 0 0.5em"}],u=/\d+%/,d="atto_image",I='{{alt}}';c.namespace("M.atto_image").Button=c.Base.create("button",c.M.editor_atto.EditorPlugin,[],{_currentSelection:null,_selectedImage:null,_form:null,_rawImageDimensions:null,initializer:function(){this.addButton({icon:"e/insert_edit_image",callback:this._displayDialogue,tags:"img",tagMatchRequiresAll:!1}),this.editor.delegate("dblclick",this._displayDialogue,"img",this),this.editor.delegate("click",this._handleClick,"img",this),this.editor.on("paste",this._handlePaste,this),this.editor.on("drop",this._handleDragDrop,this),this.editor.on("dragover",function(e){e.preventDefault()},this),this.editor.on("dragenter",function(e){e.preventDefault()},this)},_handleDragDrop:function(e){return!e._event||!e._event.dataTransfer||this._handlePasteOrDropHelper(e,e._event.dataTransfer)},_handlePaste:function(e){return!e._event||!e._event.clipboardData||this._handlePasteOrDropHelper(e,e._event.clipboardData)},_handlePasteOrDropHelper:function(e,t){for(var i,n=t.items,s=!1,a=0;a{{#if showFilepicker}}
                                      {{else}}
                                      {{/if}}
                                      0 / 125
                                      x

                                      '),t=this.get("host").canShowFilepicker("image"),e=c.Node.create(e({elementid:this.get("host").get("elementid"),CSS:m,component:d,showFilepicker:t,alignments:a}));return this._form=e,this._applyImageProperties(this._form),this._form.one("."+m.INPUTURL).on("blur",this._urlChanged,this),this._form.one("."+m.IMAGEPRESENTATION).on("change",this._updateWarning,this),this._form.one("."+m.INPUTALT).on("change",this._updateWarning,this),this._form.one("."+m.INPUTWIDTH).on("blur",this._autoAdjustSize,this),this._form.one("."+m.INPUTHEIGHT).on("blur",this._autoAdjustSize,this,!0),this._form.one("."+m.INPUTCONSTRAIN).on("change",function(e){e.target.get("checked")&&this._autoAdjustSize(e)},this),this._form.one("."+m.INPUTURL).on("blur",this._urlChanged,this),this._form.one("."+m.INPUTSUBMIT).on("click",this._setImage,this),t&&this._form.one("."+m.IMAGEBROWSER).on("click",function(){this.get("host").showFilepicker("image",this._filepickerCallback,this)},this),this._form.one("."+m.INPUTALT).on("keyup",this._handleKeyup,this),e},_autoAdjustSize:function(g,e){var t,i,n,d,s,a,o,l,r,h;e=e||!1,t=this._form.one("."+m.INPUTWIDTH),i="width",n=this._form.one("."+m.INPUTHEIGHT),d="height",h=this._form.one("."+m.INPUTCONSTRAIN),s=t.get("value"),a=n.get("value"),o=this._form.one("."+m.IMAGEPREVIEW),this._rawImageDimensions&&(""===s&&(s=this._rawImageDimensions[i],t.set("value",s),s=t.get("value")),o.setStyles({width:null,height:null}),h.get("checked")?(e&&(h=t,t=n,n=h,h=i,i=d,d=h,h=s,s=a,a=h),s.match(u)?(a=s,l=parseInt(s,10),r=this._rawImageDimensions.width/100*l,o.setStyle("width",r),r=this._rawImageDimensions.height/100*l,o.setStyle("height",r)):(a=Math.round(s/this._rawImageDimensions[i]*this._rawImageDimensions[d]),e?o.setStyles({width:a,height:s}):o.setStyles({width:s,height:a})),n.set("value",a)):(s.match(u)?(l=parseInt(s,10),r=this._rawImageDimensions.width/100*l,o.setStyle("width",r+"px")):o.setStyle("width",s+"px"),a.match(u)?(l=parseInt(a,10),r=this._rawImageDimensions.height/100*l,o.setStyle("height",r+"px")):o.setStyle("height",a+"px")))},_filepickerCallback:function(e){""!==e.url&&(this._form.one("."+m.INPUTURL).set("value",e.url),this._form.one("."+m.INPUTWIDTH).set("value",""),this._form.one("."+m.INPUTHEIGHT).set("value",""),this._loadPreviewImage(e.url))},_applyImageProperties:function(t){var e=this._getSelectedImageProperties(),i=t.one("."+m.IMAGEPREVIEW);if(!1===e)return i.setStyle("display","none"),void a.some(function(e){return!!e.isDefault&&(t.one("."+m.INPUTALIGNMENT).set("value",e.value),!0)},this);e.align&&t.one("."+m.INPUTALIGNMENT).set("value",e.align),e.customstyle&&t.one("."+m.INPUTCUSTOMSTYLE).set("value",e.customstyle),e.width&&t.one("."+m.INPUTWIDTH).set("value",e.width),e.height&&t.one("."+m.INPUTHEIGHT).set("value",e.height),e.alt&&t.one("."+m.INPUTALT).set("value",e.alt),e.src&&(t.one("."+m.INPUTURL).set("value",e.src),this._loadPreviewImage( +e.src)),e.presentation&&t.one("."+m.IMAGEPRESENTATION).set("checked","checked"),this._autoAdjustSize()},_getSelectedImageProperties:function(){var e,t,i={src:null,alt:null,width:null,height:null,align:"",presentation:!1},n=this.get("host").getSelectedNodes();return(n=n&&n.filter("img"))&&n.size()?(n=this._removeLegacyAlignment(n.item(0)),t=(this._selectedImage=n).getAttribute("style"),i.customstyle=t,(t=n.getAttribute("width")).match(u)||(t=parseInt(t,10)),(e=n.getAttribute("height")).match(u)||(e=parseInt(e,10)),0!==t&&(i.width=t),0!==e&&(i.height=e),this._getAlignmentPropeties(n,i),i.src=n.getAttribute("src"),i.alt=n.getAttribute("alt")||"",i.presentation="presentation"===n.get("role"),i):(this._selectedImage=null,!1)},_getAlignmentPropeties:function(i,n){var s;!a.some(function(e){var t=this._getAlignmentClass(e.value);return i.hasClass(t)?(n.align=e.value,!0):(e.isDefault&&(s=e.value),!1)},this)&&s&&(n.align=s)},_urlChanged:function(){var e=this._form.one("."+m.INPUTURL);""!==e.get("value")&&this._loadPreviewImage(e.get("value"))},_setImage:function(e){var t=this._form,i=t.one("."+m.INPUTURL).get("value"),n=t.one("."+m.INPUTALT).get("value"),s=t.one("."+m.INPUTWIDTH).get("value"),a=t.one("."+m.INPUTHEIGHT).get("value"),o=this._getAlignmentClass(t.one("."+m.INPUTALIGNMENT).get("value")),l=t.one("."+m.IMAGEPRESENTATION).get("checked"),g=t.one("."+m.INPUTCONSTRAIN).get("checked"),d=t.one("."+m.INPUTCUSTOMSTYLE).get("value"),r=[],h=this.get("host");if(e.preventDefault(),!this._updateWarning()){if(h.focus(),""!==i){if(this._selectedImage?h.setSelection(h.getSelectionFromNode(this._selectedImage)):h.setSelection(this._currentSelection),g&&r.push(m.RESPONSIVE),r.push(o),!s.match(u)&&isNaN(parseInt(s,10)))return void t.one("."+m.INPUTWIDTH).focus();if(!a.match(u)&&isNaN(parseInt(a,10)))return void t.one("."+m.INPUTHEIGHT).focus();e=c.Handlebars.compile(I)({url:i,alt:n,width:s,height:a,presentation:l,customstyle:d,classlist:r.join(" ")}),this.get("host").insertContentAtFocusPoint(e),this.markUpdated()}this.getDialogue({focusAfterHide:null}).hide()}},_removeLegacyAlignment:function(i){return i.getStyle("margin")&&a.some(function(e){if(i.getStyle(e.name)!==e.value)return!1;var t=c.Node.create("
                                      ");return t.setStyle("margin",e.margin),i.getStyle("margin")===t.getStyle("margin")&&(i.addClass(this._getAlignmentClass(e.value)),i.setStyle(e.name,null),i.setStyle("margin",null),!0)},this),i},_getAlignmentClass:function(e){return m.ALIGNSETTINGS+"_"+e},_updateWarning:function(){var e=this._form,t=!0,i=e.one("."+m.INPUTALT).get("value"),n=e.one("."+m.IMAGEPRESENTATION).get("checked"),t=""!==i||n?(e.one("."+m.IMAGEALTWARNING).setStyle("display","none"),e.one("."+m.INPUTALT).setAttribute("aria-invalid",!1),e.one("."+m.IMAGEPRESENTATION).setAttribute("aria-invalid",!1),!1):(e.one("."+m.IMAGEALTWARNING).setStyle("display","block"),e.one("."+m.INPUTALT).setAttribute("aria-invalid",!0),e.one("."+m.IMAGEPRESENTATION).setAttribute("aria-invalid",!0),!0);return this.getDialogue().centerDialogue(),t},_handleKeyup:function(){var e=this._form,t=e.one("."+m.INPUTALT).get("value").length;e.one("#currentcount").setHTML(t)}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); \ No newline at end of file diff --git a/lib/editor/atto/plugins/link/yui/build/moodle-atto_link-button/moodle-atto_link-button-min.js b/lib/editor/atto/plugins/link/yui/build/moodle-atto_link-button/moodle-atto_link-button-min.js index 278e768807c..97f3eb13742 100644 --- a/lib/editor/atto/plugins/link/yui/build/moodle-atto_link-button/moodle-atto_link-button-min.js +++ b/lib/editor/atto/plugins/link/yui/build/moodle-atto_link-button/moodle-atto_link-button-min.js @@ -1 +1 @@ -YUI.add("moodle-atto_link-button",function(l,t){var n="atto_link",i={NEWWINDOW:"atto_link_openinnewwindow",URLINPUT:"atto_link_urlentry"},e=".atto_link_urlentry";l.namespace("M.atto_link").Button=l.Base.create("button",l.M.editor_atto.EditorPlugin,[],{_currentSelection:null,_content:null,initializer:function(){this.addButton({icon:"e/insert_edit_link",keys:"75",callback:this._displayDialogue,tags:"a",tagMatchRequiresAll:!1}),this.addButton({buttonName:"unlink",callback:this._unlink,icon:"e/remove_link",title:"unlink",tags:"a",tagMatchRequiresAll:!1})},_displayDialogue:function(){if(this._currentSelection=this.get("host").getSelection(),!1!==this._currentSelection){var t=this.getDialogue({headerContent:M.util.get_string("createlink",n),width:"auto",focusAfterHide:!0,focusOnShowSelector:e});t.set("bodyContent",this._getDialogueContent()),this._resolveAnchors(),t.show()}},_resolveAnchors:function(){var t,e,n,i,o=this.get("host").getSelectionParentNode();o&&0<(t=this._findSelectedAnchors(l.one(o))).length&&(e=t[0],this._currentSelection=this.get("host").getSelectionFromNode(e),n=e.getAttribute("href"),i=e.getAttribute("target"),""!==n&&this._content.one(".url").setAttribute("value",n),"_blank"===i?this._content.one(".newwindow").setAttribute("checked","checked"):this._content.one(".newwindow").removeAttribute("checked"))},_filepickerCallback:function(t){this.getDialogue().set("focusAfterHide",null).hide(),""!==t.url&&(this._setLinkOnSelection(t.url),this.markUpdated())},_setLink:function(t){var e;t.preventDefault(),this.getDialogue({focusAfterHide:null}).hide(),""!==(e=this._content.one(".url").get("value"))&&(e=e.trim(),new RegExp(/^[a-zA-Z]*\.*\/|^#|^[a-zA-Z]*:/).test(e)||(e="http://"+e),this._setLinkOnSelection(e),this.markUpdated())},_setLinkOnSelection:function(t){var e,n,i,o=this.get("host");if(this.editor.focus(),o.setSelection(this._currentSelection),this._currentSelection[0].collapsed?((e=l.Node.create(""+t+"")).setAttribute("href",t),n=o.insertContentAtFocusPoint(e.get("outerHTML")),o.setSelection(o.getSelectionFromNode(n))):(document.execCommand("unlink",!1,null),document.execCommand("createLink",!1,t),n=o.getSelectionParentNode()),n)return i=this._findSelectedAnchors(l.one(n)),l.Array.each(i,function(t){this._content.one(".newwindow").get("checked")?t.setAttribute("target","_blank"):t.removeAttribute("target")},this),n},_findSelectedAnchors:function(t){var e,n,i=t.get("tagName");return i&&"a"===i.toLowerCase()?[t]:(n=[],t.all("a").each(function(t){!e&&this.get("host").selectionContainsNode(t)&&n.push(t)},this),0{{#if showFilepicker}}
                                      {{else}}
                                      {{/if}}

                                      ');return this._content=l.Node.create(e({showFilepicker:t,component:n,CSS:i})),this._content.one(".submit").on("click",this._setLink,this),t&&this._content.one(".openlinkbrowser").on("click",function(t){t.preventDefault(),this.get("host").showFilepicker("link",this._filepickerCallback,this)},this),this._content},_unlink:function(){var t,n=this.get("host"),e=n.getSelection();e&&e.length&&(e[0].startOffset===e[0].endOffset?(t=n.getSelectedNodes())&&(t.each(function(t){var e=t.ancestor("a",!0);e&&(n.setSelection(n.getSelectionFromNode(e)),document.execCommand("unlink",!1,null))},this),this.markUpdated()):(document.execCommand("unlink",!1,null),this.markUpdated()))}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); \ No newline at end of file +YUI.add("moodle-atto_link-button",function(i,t){var n="atto_link",o={NEWWINDOW:"atto_link_openinnewwindow",URLINPUT:"atto_link_urlentry"},e=".atto_link_urlentry";i.namespace("M.atto_link").Button=i.Base.create("button",i.M.editor_atto.EditorPlugin,[],{_currentSelection:null,_content:null,initializer:function(){this.addButton({icon:"e/insert_edit_link",keys:"75",callback:this._displayDialogue,tags:"a",tagMatchRequiresAll:!1}),this.addButton({buttonName:"unlink",callback:this._unlink,icon:"e/remove_link",title:"unlink",tags:"a",tagMatchRequiresAll:!1})},_displayDialogue:function(){var t;this._currentSelection=this.get("host").getSelection(),!1!==this._currentSelection&&((t=this.getDialogue({headerContent:M.util.get_string("createlink",n),width:"auto",focusAfterHide:!0,focusOnShowSelector:e})).set("bodyContent",this._getDialogueContent()),this._resolveAnchors(),t.show())},_resolveAnchors:function(){var t,e=this.get("host").getSelectionParentNode();e&&0<(t=this._findSelectedAnchors(i.one(e))).length&&(e=t[0],this._currentSelection=this.get("host").getSelectionFromNode(e),t=e.getAttribute("href"),e=e.getAttribute("target"),""!==t&&this._content.one(".url").setAttribute("value",t),"_blank"===e?this._content.one(".newwindow").setAttribute("checked","checked"):this._content.one(".newwindow").removeAttribute("checked"))},_filepickerCallback:function(t){this.getDialogue().set("focusAfterHide",null).hide(),""!==t.url&&(this._setLinkOnSelection(t.url),this.markUpdated())},_setLink:function(t){t.preventDefault(),this.getDialogue({focusAfterHide:null}).hide(),""!==(t=this._content.one(".url").get("value"))&&(t=t.trim(),new RegExp(/^[a-zA-Z]*\.*\/|^#|^[a-zA-Z]*:/).test(t)||(t="http://"+t),this._setLinkOnSelection(t),this.markUpdated())},_setLinkOnSelection:function(t){var e,n=this.get("host");if(this.editor.focus(),n.setSelection(this._currentSelection),this._currentSelection[0].collapsed?((e=i.Node.create(""+t+"")).setAttribute("href",t),e=n.insertContentAtFocusPoint(e.get("outerHTML")),n.setSelection(n.getSelectionFromNode(e))):(document.execCommand("unlink",!1,null),document.execCommand("createLink",!1,t),e=n.getSelectionParentNode()),e)return t=this._findSelectedAnchors(i.one(e)),i.Array.each(t,function(t){this._content.one(".newwindow").get("checked")?t.setAttribute("target","_blank"):t.removeAttribute("target")},this),e},_findSelectedAnchors:function(t){var e,n,i=t.get("tagName");return i&&"a"===i.toLowerCase()?[t]:(n=[],t.all("a").each(function(t){!e&&this.get("host").selectionContainsNode(t)&&n.push(t)},this),0{{#if showFilepicker}}
                                      {{else}}
                                      {{/if}}

                                      ');return this._content=i.Node.create(e({showFilepicker:t,component:n,CSS:o})),this._content.one(".submit").on("click",this._setLink,this),t&&this._content.one(".openlinkbrowser").on("click",function(t){t.preventDefault(),this.get("host").showFilepicker("link",this._filepickerCallback,this)},this),this._content},_unlink:function(){var e=this.get("host"),t=e.getSelection();t&&t.length&&(t[0].startOffset===t[0].endOffset?(t=e.getSelectedNodes())&&(t.each(function(t){t=t.ancestor("a",!0);t&&(e.setSelection(e.getSelectionFromNode(t)),document.execCommand("unlink",!1,null))},this),this.markUpdated()):(document.execCommand("unlink",!1,null),this.markUpdated()))}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); \ No newline at end of file diff --git a/lib/editor/atto/plugins/managefiles/yui/build/moodle-atto_managefiles-button/moodle-atto_managefiles-button-min.js b/lib/editor/atto/plugins/managefiles/yui/build/moodle-atto_managefiles-button/moodle-atto_managefiles-button-min.js index 16ab8ed38b2..e47a73d1d79 100644 --- a/lib/editor/atto/plugins/managefiles/yui/build/moodle-atto_managefiles-button/moodle-atto_managefiles-button-min.js +++ b/lib/editor/atto/plugins/managefiles/yui/build/moodle-atto_managefiles-button/moodle-atto_managefiles-button-min.js @@ -1 +1 @@ -YUI.add("moodle-atto_managefiles-button",function(a,e){a.namespace("M.atto_managefiles").Button=a.Base.create("button",a.M.editor_atto.EditorPlugin,[],{_currentSelection:null,initializer:function(){if(!this.get("disabled")){var e=this.get("host"),t=this.get("area"),i=e.get("filepickeroptions");i.image&&i.image.itemid&&(t.itemid=i.image.itemid,this.set("area",t),this.addButton({icon:"e/manage_files",callback:this._displayDialogue}))}},_displayDialogue:function(e){var t,i;e.preventDefault(),t=this.getDialogue({headerContent:M.util.get_string("managefiles","atto_managefiles"),width:"800px",focusAfterHide:!0}),(i=a.Node.create("")).setStyles({height:"700px",border:"none",width:"100%"}),i.setAttribute("src",this._getIframeURL()),t.set("bodyContent",i).show(),this.markUpdated()},_getIframeURL:function(){var e=a.mix({elementid:this.get("host").get("elementid")},this.get("area"));return M.cfg.wwwroot+"/lib/editor/atto/plugins/managefiles/manage.php?"+a.QueryString.stringify(e)}},{ATTRS:{disabled:{value:!0},area:{value:{}}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); \ No newline at end of file +YUI.add("moodle-atto_managefiles-button",function(i,e){i.namespace("M.atto_managefiles").Button=i.Base.create("button",i.M.editor_atto.EditorPlugin,[],{_currentSelection:null,initializer:function(){var e,t;this.get("disabled")||(t=this.get("host"),e=this.get("area"),(t=t.get("filepickeroptions")).image&&t.image.itemid&&(e.itemid=t.image.itemid,this.set("area",e),this.addButton({icon:"e/manage_files",callback:this._displayDialogue})))},_displayDialogue:function(e){var t;e.preventDefault(),e=this.getDialogue({headerContent:M.util.get_string("managefiles","atto_managefiles"),width:"800px",focusAfterHide:!0}),(t=i.Node.create("")).setStyles({height:"700px",border:"none",width:"100%"}),t.setAttribute("src",this._getIframeURL()),e.set("bodyContent",t).show(),this.markUpdated()},_getIframeURL:function(){var e=i.mix({elementid:this.get("host").get("elementid")},this.get("area"));return M.cfg.wwwroot+"/lib/editor/atto/plugins/managefiles/manage.php?"+i.QueryString.stringify(e)}},{ATTRS:{disabled:{value:!0},area:{value:{}}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); \ No newline at end of file diff --git a/lib/editor/atto/plugins/managefiles/yui/build/moodle-atto_managefiles-usedfiles/moodle-atto_managefiles-usedfiles-min.js b/lib/editor/atto/plugins/managefiles/yui/build/moodle-atto_managefiles-usedfiles/moodle-atto_managefiles-usedfiles-min.js index b5c6cad4461..90153d95dbf 100644 --- a/lib/editor/atto/plugins/managefiles/yui/build/moodle-atto_managefiles-usedfiles/moodle-atto_managefiles-usedfiles-min.js +++ b/lib/editor/atto/plugins/managefiles/yui/build/moodle-atto_managefiles-usedfiles/moodle-atto_managefiles-usedfiles-min.js @@ -1 +1 @@ -YUI.add("moodle-atto_managefiles-usedfiles",function(o,e){var f="has-missing-files",r="has-unused-files",u=".fitem",m="#atto_managefiles_manageform",g=".missing-files";M.atto_managefiles=M.atto_managefiles||{},M.atto_managefiles.usedfiles=M.atto_managefiles.usedfiles||{_usercontext:null,_itemid:null,_elementid:null,init:function(e){var i,n,t,s,l,a,d;if(this._usercontext=e.usercontext,this._itemid=e.itemid,this._elementid=e.elementid,i=e.files,(n=o.one(m))&&window.parent)if(t=this._getUsedFiles(),s=this.findUnusedFiles(i,t),l=this.findMissingFiles(i,t),0",d=0;d"+o.Escape.html(l[d])+"";a+="
                            ",n.one(g).setHTML("").append(a),n.addClass(f)}else n.removeClass(f)},_getUsedFiles:function(){for(var e=o.one(window.parent.document.getElementById(this._elementid+"editable")),i=M.cfg.wwwroot+"/draftfile.php/"+this._usercontext+"/user/draft/"+this._itemid+"/",n=new RegExp(i.replace(/[\-\/\\\^$*+?.()|\[\]{}]/g,"\\$&")+"(.+?)[\\?\"']","gm"),t="",s={};null!==(t=n.exec(e.get("innerHTML")));)s[decodeURIComponent(t[1])]=!0;return s},findUnusedFiles:function(e,i){var n,t=[];for(n in e)i[n]||t.push(n);return t},findMissingFiles:function(e,i){var n,t=[];for(n in i)e[n]||t.push(n);return t}}},"@VERSION@",{requires:["node","escape"]}); \ No newline at end of file +YUI.add("moodle-atto_managefiles-usedfiles",function(d,e){var o="has-missing-files",f="has-unused-files",r=".fitem",u="#atto_managefiles_manageform",m=".missing-files";M.atto_managefiles=M.atto_managefiles||{},M.atto_managefiles.usedfiles=M.atto_managefiles.usedfiles||{_usercontext:null,_itemid:null,_elementid:null,init:function(e){var i,n,t,s,l,a;if(this._usercontext=e.usercontext,this._itemid=e.itemid,this._elementid=e.elementid,e=e.files,(i=d.one(u))&&window.parent)if(n=this._getUsedFiles(),t=this.findUnusedFiles(e,n),s=this.findMissingFiles(e,n),0",a=0;a"+d.Escape.html(s[a])+"";l+="
                          ",i.one(m).setHTML("").append(l),i.addClass(o)}else i.removeClass(o)},_getUsedFiles:function(){for(var e,i=d.one(window.parent.document.getElementById(this._elementid+"editable")),n=M.cfg.wwwroot+"/draftfile.php/"+this._usercontext+"/user/draft/"+this._itemid+"/",t=new RegExp(n.replace(/[\-\/\\\^$*+?.()|\[\]{}]/g,"\\$&")+"(.+?)[\\?\"']","gm"),s={};null!==(e=t.exec(i.get("innerHTML")));)s[decodeURIComponent(e[1])]=!0;return s},findUnusedFiles:function(e,i){var n,t=[];for(n in e)i[n]||t.push(n);return t},findMissingFiles:function(e,i){var n,t=[];for(n in i)e[n]||t.push(n);return t}}},"@VERSION@",{requires:["node","escape"]}); \ No newline at end of file diff --git a/lib/editor/atto/plugins/media/yui/build/moodle-atto_media-button/moodle-atto_media-button-min.js b/lib/editor/atto/plugins/media/yui/build/moodle-atto_media-button/moodle-atto_media-button-min.js index 652046dba62..2c3f9b0de7f 100644 --- a/lib/editor/atto/plugins/media/yui/build/moodle-atto_media-button/moodle-atto_media-button-min.js +++ b/lib/editor/atto/plugins/media/yui/build/moodle-atto_media-button/moodle-atto_media-button-min.js @@ -1,5 +1,5 @@ -YUI.add("moodle-atto_media-button",function(d,e){var t="atto_media",i={LINK:"LINK",VIDEO:"VIDEO",AUDIO:"AUDIO"},a={SUBTITLES:"SUBTITLES",CAPTIONS:"CAPTIONS",DESCRIPTIONS:"DESCRIPTIONS",CHAPTERS:"CHAPTERS",METADATA:"METADATA"},l={SOURCE:"atto_media_source",TRACK:"atto_media_track",MEDIA_SOURCE:"atto_media_media_source",LINK_SOURCE:"atto_media_link_source",POSTER_SOURCE:"atto_media_poster_source",TRACK_SOURCE:"atto_media_track_source",DISPLAY_OPTIONS:"atto_media_display_options",NAME_INPUT:"atto_media_name_entry",TITLE_INPUT:"atto_media_title_entry",URL_INPUT:"atto_media_url_entry",POSTER_SIZE:"atto_media_poster_size",LINK_SIZE:"atto_media_link_size",WIDTH_INPUT:"atto_media_width_entry",HEIGHT_INPUT:"atto_media_height_entry",TRACK_KIND_INPUT:"atto_media_track_kind_entry",TRACK_LABEL_INPUT:"atto_media_track_label_entry",TRACK_LANG_INPUT:"atto_media_track_lang_entry",TRACK_DEFAULT_SELECT:"atto_media_track_default",MEDIA_CONTROLS_TOGGLE:"atto_media_controls",MEDIA_AUTOPLAY_TOGGLE:"atto_media_autoplay",MEDIA_MUTE_TOGGLE:"atto_media_mute",MEDIA_LOOP_TOGGLE:"atto_media_loop",ADVANCED_SETTINGS:"atto_media_advancedsettings",LINK:i.LINK.toLowerCase(),VIDEO:i.VIDEO.toLowerCase(),AUDIO:i.AUDIO.toLowerCase(),TRACK_SUBTITLES:a.SUBTITLES.toLowerCase(),TRACK_CAPTIONS:a.CAPTIONS.toLowerCase(),TRACK_DESCRIPTIONS:a.DESCRIPTIONS.toLowerCase(),TRACK_CHAPTERS:a.CHAPTERS.toLowerCase(),TRACK_METADATA:a.METADATA.toLowerCase()},s={SOURCE:"."+l.SOURCE,TRACK:"."+l.TRACK,MEDIA_SOURCE:"."+l.MEDIA_SOURCE,POSTER_SOURCE:"."+l.POSTER_SOURCE,TRACK_SOURCE:"."+l.TRACK_SOURCE,DISPLAY_OPTIONS:"."+l.DISPLAY_OPTIONS,NAME_INPUT:"."+l.NAME_INPUT,TITLE_INPUT:"."+l.TITLE_INPUT,URL_INPUT:"."+l.URL_INPUT,POSTER_SIZE:"."+l.POSTER_SIZE,LINK_SIZE:"."+l.LINK_SIZE,WIDTH_INPUT:"."+l.WIDTH_INPUT,HEIGHT_INPUT:"."+l.HEIGHT_INPUT,TRACK_KIND_INPUT:"."+l.TRACK_KIND_INPUT,TRACK_LABEL_INPUT:"."+l.TRACK_LABEL_INPUT,TRACK_LANG_INPUT:"."+l.TRACK_LANG_INPUT,TRACK_DEFAULT_SELECT:"."+l.TRACK_DEFAULT_SELECT,MEDIA_CONTROLS_TOGGLE:"."+l.MEDIA_CONTROLS_TOGGLE,MEDIA_AUTOPLAY_TOGGLE:"."+l.MEDIA_AUTOPLAY_TOGGLE,MEDIA_MUTE_TOGGLE:"."+l.MEDIA_MUTE_TOGGLE,MEDIA_LOOP_TOGGLE:"."+l.MEDIA_LOOP_TOGGLE,ADVANCED_SETTINGS:"."+l.ADVANCED_SETTINGS,LINK_TAB:'li[data-medium-type="'+l.LINK+'"]',LINK_PANE:'.tab-pane[data-medium-type="'+l.LINK+'"]',VIDEO_TAB:'li[data-medium-type="'+l.VIDEO+'"]',VIDEO_PANE:'.tab-pane[data-medium-type="'+l.VIDEO+'"]',AUDIO_TAB:'li[data-medium-type="'+l.AUDIO+'"]',AUDIO_PANE:'.tab-pane[data-medium-type="'+l.AUDIO+'"]',TRACK_SUBTITLES_TAB:'li[data-track-kind="'+l.TRACK_SUBTITLES+'"]',TRACK_SUBTITLES_PANE:'.tab-pane[data-track-kind="'+l.TRACK_SUBTITLES+'"]',TRACK_CAPTIONS_TAB:'li[data-track-kind="'+l.TRACK_CAPTIONS+'"]',TRACK_CAPTIONS_PANE:'.tab-pane[data-track-kind="'+l.TRACK_CAPTIONS+'"]',TRACK_DESCRIPTIONS_TAB:'li[data-track-kind="'+l.TRACK_DESCRIPTIONS+'"]',TRACK_DESCRIPTIONS_PANE:'.tab-pane[data-track-kind="'+l.TRACK_DESCRIPTIONS+'"]',TRACK_CHAPTERS_TAB:'li[data-track-kind="'+l.TRACK_CHAPTERS+'"]',TRACK_CHAPTERS_PANE:'.tab-pane[data-track-kind="'+l.TRACK_CHAPTERS+'"]',TRACK_METADATA_TAB:'li[data-track-kind="'+l.TRACK_METADATA+'"]',TRACK_METADATA_PANE:'.tab-pane[data-track-kind="'+l.TRACK_METADATA+'"]'},c={ROOT:'
                          {{> tab_panes.link}}
                          {{> tab_panes.video}}
                          {{> tab_panes.audio}}

                          ',TAB_PANES:{LINK:'{{renderPartial "form_components.source" context=this id=CSS.LINK_SOURCE}}', +YUI.add("moodle-atto_media-button",function(l,e){var t="atto_media",i={LINK:"LINK",VIDEO:"VIDEO",AUDIO:"AUDIO"},a={SUBTITLES:"SUBTITLES",CAPTIONS:"CAPTIONS",DESCRIPTIONS:"DESCRIPTIONS",CHAPTERS:"CHAPTERS",METADATA:"METADATA"},o={SOURCE:"atto_media_source",TRACK:"atto_media_track",MEDIA_SOURCE:"atto_media_media_source",LINK_SOURCE:"atto_media_link_source",POSTER_SOURCE:"atto_media_poster_source",TRACK_SOURCE:"atto_media_track_source",DISPLAY_OPTIONS:"atto_media_display_options",NAME_INPUT:"atto_media_name_entry",TITLE_INPUT:"atto_media_title_entry",URL_INPUT:"atto_media_url_entry",POSTER_SIZE:"atto_media_poster_size",LINK_SIZE:"atto_media_link_size",WIDTH_INPUT:"atto_media_width_entry",HEIGHT_INPUT:"atto_media_height_entry",TRACK_KIND_INPUT:"atto_media_track_kind_entry",TRACK_LABEL_INPUT:"atto_media_track_label_entry",TRACK_LANG_INPUT:"atto_media_track_lang_entry",TRACK_DEFAULT_SELECT:"atto_media_track_default",MEDIA_CONTROLS_TOGGLE:"atto_media_controls",MEDIA_AUTOPLAY_TOGGLE:"atto_media_autoplay",MEDIA_MUTE_TOGGLE:"atto_media_mute",MEDIA_LOOP_TOGGLE:"atto_media_loop",ADVANCED_SETTINGS:"atto_media_advancedsettings",LINK:i.LINK.toLowerCase(),VIDEO:i.VIDEO.toLowerCase(),AUDIO:i.AUDIO.toLowerCase(),TRACK_SUBTITLES:a.SUBTITLES.toLowerCase(),TRACK_CAPTIONS:a.CAPTIONS.toLowerCase(),TRACK_DESCRIPTIONS:a.DESCRIPTIONS.toLowerCase(),TRACK_CHAPTERS:a.CHAPTERS.toLowerCase(),TRACK_METADATA:a.METADATA.toLowerCase()},s={SOURCE:"."+o.SOURCE,TRACK:"."+o.TRACK,MEDIA_SOURCE:"."+o.MEDIA_SOURCE,POSTER_SOURCE:"."+o.POSTER_SOURCE,TRACK_SOURCE:"."+o.TRACK_SOURCE,DISPLAY_OPTIONS:"."+o.DISPLAY_OPTIONS,NAME_INPUT:"."+o.NAME_INPUT,TITLE_INPUT:"."+o.TITLE_INPUT,URL_INPUT:"."+o.URL_INPUT,POSTER_SIZE:"."+o.POSTER_SIZE,LINK_SIZE:"."+o.LINK_SIZE,WIDTH_INPUT:"."+o.WIDTH_INPUT,HEIGHT_INPUT:"."+o.HEIGHT_INPUT,TRACK_KIND_INPUT:"."+o.TRACK_KIND_INPUT,TRACK_LABEL_INPUT:"."+o.TRACK_LABEL_INPUT,TRACK_LANG_INPUT:"."+o.TRACK_LANG_INPUT,TRACK_DEFAULT_SELECT:"."+o.TRACK_DEFAULT_SELECT,MEDIA_CONTROLS_TOGGLE:"."+o.MEDIA_CONTROLS_TOGGLE,MEDIA_AUTOPLAY_TOGGLE:"."+o.MEDIA_AUTOPLAY_TOGGLE,MEDIA_MUTE_TOGGLE:"."+o.MEDIA_MUTE_TOGGLE,MEDIA_LOOP_TOGGLE:"."+o.MEDIA_LOOP_TOGGLE,ADVANCED_SETTINGS:"."+o.ADVANCED_SETTINGS,LINK_TAB:'li[data-medium-type="'+o.LINK+'"]',LINK_PANE:'.tab-pane[data-medium-type="'+o.LINK+'"]',VIDEO_TAB:'li[data-medium-type="'+o.VIDEO+'"]',VIDEO_PANE:'.tab-pane[data-medium-type="'+o.VIDEO+'"]',AUDIO_TAB:'li[data-medium-type="'+o.AUDIO+'"]',AUDIO_PANE:'.tab-pane[data-medium-type="'+o.AUDIO+'"]',TRACK_SUBTITLES_TAB:'li[data-track-kind="'+o.TRACK_SUBTITLES+'"]',TRACK_SUBTITLES_PANE:'.tab-pane[data-track-kind="'+o.TRACK_SUBTITLES+'"]',TRACK_CAPTIONS_TAB:'li[data-track-kind="'+o.TRACK_CAPTIONS+'"]',TRACK_CAPTIONS_PANE:'.tab-pane[data-track-kind="'+o.TRACK_CAPTIONS+'"]',TRACK_DESCRIPTIONS_TAB:'li[data-track-kind="'+o.TRACK_DESCRIPTIONS+'"]',TRACK_DESCRIPTIONS_PANE:'.tab-pane[data-track-kind="'+o.TRACK_DESCRIPTIONS+'"]',TRACK_CHAPTERS_TAB:'li[data-track-kind="'+o.TRACK_CHAPTERS+'"]',TRACK_CHAPTERS_PANE:'.tab-pane[data-track-kind="'+o.TRACK_CHAPTERS+'"]',TRACK_METADATA_TAB:'li[data-track-kind="'+o.TRACK_METADATA+'"]',TRACK_METADATA_PANE:'.tab-pane[data-track-kind="'+o.TRACK_METADATA+'"]'},r={ROOT:'
                          {{> tab_panes.link}}
                          {{> tab_panes.video}}
                          {{> tab_panes.audio}}

                          ',TAB_PANES:{LINK:'{{renderPartial "form_components.source" context=this id=CSS.LINK_SOURCE}}', VIDEO:'{{renderPartial "form_components.source" context=this id=CSS.MEDIA_SOURCE entersourcelabel="videosourcelabel" addcomponentlabel="addsource" multisource="true" addsourcehelp=helpStrings.addsource}}',AUDIO:'{{renderPartial "form_components.source" context=this id=CSS.MEDIA_SOURCE entersourcelabel="audiosourcelabel" addcomponentlabel="addsource" multisource="true" addsourcehelp=helpStrings.addsource}}'},FORM_COMPONENTS:{SOURCE:'
                          {{#multisource}}{{renderPartial "form_components.add_component" context=../this label=../addcomponentlabel help=../addsourcehelp}}{{/multisource}}
                          ',ADD_COMPONENT:'',REMOVE_COMPONENT:'',DISPLAY_OPTIONS:'
                          {{#mediatype_video}}
                          x
                          {{renderPartial "form_components.source" context=this id=CSS.POSTER_SOURCE entersourcelabel="poster"}}{{/mediatype_video}}
                          ',ADVANCED_SETTINGS:'
                          ', -TRACK_TABS:'
                          {{{helpStrings.subtitles}}}
                          {{renderPartial "form_components.track" context=this sourcelabel="subtitlessourcelabel" addcomponentlabel="addsubtitlestrack"}}
                          {{{helpStrings.captions}}}
                          {{renderPartial "form_components.track" context=this sourcelabel="captionssourcelabel" addcomponentlabel="addcaptionstrack"}}
                          {{{helpStrings.descriptions}}}
                          {{renderPartial "form_components.track" context=this sourcelabel="descriptionssourcelabel" addcomponentlabel="adddescriptionstrack"}}
                          {{{helpStrings.chapters}}}
                          {{renderPartial "form_components.track" context=this sourcelabel="chapterssourcelabel" addcomponentlabel="addchapterstrack"}}
                          {{{helpStrings.metadata}}}
                          {{renderPartial "form_components.track" context=this sourcelabel="metadatasourcelabel" addcomponentlabel="addmetadatatrack"}}
                          ',TRACK:'
                          {{renderPartial "form_components.source" context=this id=CSS.TRACK_SOURCE entersourcelabel=sourcelabel}}
                          {{renderPartial "form_components.add_component" context=this label=addcomponentlabel}}
                          '},HTML_MEDIA:{VIDEO:'  ',AUDIO:'  ',LINK:'{{#name}}{{../name}}{{/name}}{{^name}}{{../url}}{{/name}}'}};d.namespace("M.atto_media").Button=d.Base.create("button",d.M.editor_atto.EditorPlugin,[],{initializer:function(){this.get("host").canShowFilepicker("media")&&(this.editor.delegate("dblclick",this._displayDialogue,"video",this),this.editor.delegate("click",this._handleClick,"video",this),this.addButton({icon:"e/insert_edit_video",callback:this._displayDialogue,tags:"video, audio",tagMatchRequiresAll:!1}))},_getContext:function(e){return d.merge({elementid:this.get("host").get("elementid"),component:t,langsinstalled:this.get("langs").installed,langsavailable:this.get("langs").available,helpStrings:this.get("help"),CSS:l},e)},_handleClick:function(e){var t=e.target,a=this.get("host").getSelectionFromNode(t);this.get("host").getSelection()!==a&&this.get("host").setSelection(a)},_displayDialogue:function(){!1!==this.get("host").getSelection()&&( -"renderPartial"in d.Handlebars.helpers||(!function i(a,e){d.each(e,function(e,t){a.push(t),"object"!=typeof e?d.Handlebars.registerPartial(a.join(".").toLowerCase(),e):i(a,e),a.pop()})}([],c),d.Handlebars.registerHelper("renderPartial",function(e,t){var a,i,n;return e?(a=d.Handlebars.partials[e],i=t.hash.context?d.clone(t.hash.context):{},delete(n=d.merge(i,t.hash)).context,a?new d.Handlebars.SafeString(d.Handlebars.compile(a)(n)):""):""})),this.getDialogue({headerContent:M.util.get_string("createmedia",t),focusAfterHide:!0,width:660,focusOnShowSelector:s.URL_INPUT}).set("bodyContent",this._getDialogueContent(this.get("host").getSelection())).show(),M.form.shortforms({formid:this.get("host").get("elementid")+"_atto_media_form"}))},_getDialogueContent:function(e){var t=d.Node.create(d.Handlebars.compile(c.ROOT)(this._getContext())),a=this.get("host").getSelectedNodes().filter("video,audio").shift(),i=!!a&&this._getMediumProperties(a);return this._attachEvents(this._applyMediumProperties(t,i),e)},_attachEvents:function(e,i){return e.delegate("click",function(e){e.preventDefault(),this._addMediaSourceComponent(e.currentTarget)},s.MEDIA_SOURCE+" .addcomponent",this),e.delegate("click",function(e){e.preventDefault(),this._addTrackComponent(e.currentTarget)},s.TRACK+" .addcomponent",this),e.delegate("click",function(e){var t,a=e.currentTarget;a.get("checked")&&(t=function(e){return this._getTrackTypeFromTabPane(e.ancestor(".tab-pane"))}.bind(this),a.ancestor(".root.tab-content").all(s.TRACK_DEFAULT_SELECT).each(function(e){e!==a&&t(a)===t(e)&&e.set("checked",!1)}))},s.TRACK_DEFAULT_SELECT,this),e.delegate("click",function(e){var t=e.currentTarget,a=(t.ancestor(s.POSTER_SOURCE)?"image":t.ancestor(s.TRACK_SOURCE)&&"subtitle")||"media";e.preventDefault(),this.get("host").showFilepicker(a,this._getFilepickerCallback(t,a),this)},".openmediabrowser",this),e.all(".nav-item").on("click",function(e){e.currentTarget.get("parentNode").all(".active").removeClass("active")}),e.one(".submit").on("click",function(e){e.preventDefault();var t=this._getMediaHTML(e.currentTarget.ancestor(".atto_form")),a=this.get("host");this.getDialogue({focusAfterHide:null}).hide(),t&&(a.setSelection(i),a.insertContentAtFocusPoint(t),this.markUpdated())},this),e},_applyMediumProperties:function(e,t){var n,o,a;return t&&(n=function(e,t){e.one(s.TRACK_SOURCE+" "+s.URL_INPUT).set("value",t.src),e.one(s.TRACK_LANG_INPUT).set("value",t.srclang),e.one(s.TRACK_LABEL_INPUT).set("value",t.label),e.one(s.TRACK_DEFAULT_SELECT).set("checked",t.defaultTrack)},(o=e.one(".root.tab-content > .tab-pane#"+this.get("host").get("elementid")+"_"+t.type.toLowerCase())).one(s.MEDIA_SOURCE+" "+s.URL_INPUT).set("value",t.sources[0]),d.Array.each(t.sources.slice(1),function(t){this._addMediaSourceComponent(o.one(s.MEDIA_SOURCE+" .addcomponent"),function(e){e.one(s.URL_INPUT).set("value",t)})},this),d.Object.each(t.tracks,function(e,t){var a=e.length?e:[{src:"",srclang:"",label:"",defaultTrack:!1}],i=s["TRACK_"+t.toUpperCase()+"_PANE"];n(o.one(i+" "+s.TRACK),a[0]),d.Array.each(a.slice(1),function(t){this._addTrackComponent(o.one(i+" "+s.TRACK+" .addcomponent"),function(e){n(e,t)})},this)},this),o.one(s.TITLE_INPUT).set("value",t.title),o.one(s.MEDIA_CONTROLS_TOGGLE).set("checked",t.controls),o.one(s.MEDIA_AUTOPLAY_TOGGLE).set("checked",t.autoplay),o.one(s.MEDIA_MUTE_TOGGLE).set("checked",t.muted),o.one(s.MEDIA_LOOP_TOGGLE).set("checked",t.loop),"video"===(a=this._getMediumTypeFromTabPane(o))&&(o.one(s.POSTER_SOURCE+" "+s.URL_INPUT).setAttribute("value",t.poster),o.one(s.WIDTH_INPUT).set("value",t.width),o.one(s.HEIGHT_INPUT).set("value",t.height)),o.siblings(".active").removeClass("active"),e.all(".root.nav-tabs .nav-item a").removeClass("active"),o.addClass("active"),e.one(s[a.toUpperCase()+"_TAB"]+" a").addClass("active")),e},_getMediumProperties:function(e){var t=function(e,t){return e.hasAttribute(t)&&(e.getAttribute(t)||""===e.getAttribute(t))},a={subtitles:[],captions:[],descriptions:[],chapters:[],metadata:[]};return e.all("track").each(function(e){a[e.getAttribute("kind")].push({src:e.getAttribute("src"),srclang:e.getAttribute("srclang"),label:e.getAttribute("label"),defaultTrack:t(e,"default")})}),{type:e.test("video")?i.VIDEO:i.AUDIO,sources:e.all("source").get("src"),poster:e.getAttribute("poster"),title:e.getAttribute("title"),width:e.getAttribute("width"),height:e.getAttribute("height"),autoplay:t(e,"autoplay"),loop:t(e,"loop"),muted:t(e,"muted"),controls:t(e,"controls"),tracks:a}},_addTrackComponent:function(e,t){var a=this._getTrackTypeFromTabPane(e.ancestor(".tab-pane")),i=this._getContext({sourcelabel:a+"sourcelabel",addcomponentlabel:"add"+a+"track"});this._addComponent(e,c.FORM_COMPONENTS.TRACK,s.TRACK,i,t)},_addMediaSourceComponent:function(e,t){var a=this._getMediumTypeFromTabPane(e.ancestor(".tab-pane")),i=this._getContext({multisource:!0,id:l.MEDIA_SOURCE,entersourcelabel:a+"sourcelabel",addcomponentlabel:"addsource",addsourcehelp:this.get("help").addsource});this._addComponent(e,c.FORM_COMPONENTS.SOURCE,s.MEDIA_SOURCE,i,t)},_addComponent:function(e,t,a,i,n){var o,l=e.ancestor(a),s=d.Node.create(d.Handlebars.compile(t)(i)),r=this._getContext(i);r.label="remove",(o=d.Node.create(d.Handlebars.compile(c.FORM_COMPONENTS.REMOVE_COMPONENT)(r))).one(".removecomponent").on("click",function(e){e.preventDefault(),l.remove(!0)}),l.insert(s,"after"),e.ancestor().insert(o,"after"),e.ancestor().remove(!0),n&&n.call(this,s)},_getFilepickerCallback:function(n,o){return function(e){var t,a,i;""!==e.url&&(t=n.ancestor(".tab-pane"),n.ancestor(s.SOURCE).one(s.URL_INPUT).set("value",e.url),t.get("id")===this.get("host").get("elementid")+"_"+l.LINK&&t.one(s.NAME_INPUT).set("value",e.file),"subtitle"===o&&(a=e.file.split(".vtt")[0].split("-").slice(-1)[0],(i=this.get("langs").available.reduce(function(e,t){return t.code===a?t:e},!1))&&(n.ancestor(s.TRACK).one(s.TRACK_LABEL_INPUT).set("value",i.lang.substr(0,i.lang.lastIndexOf(" "))),n.ancestor(s.TRACK -).one(s.TRACK_LANG_INPUT).set("value",i.code))))}},_getMediumTypeFromTabPane:function(e){return e.getAttribute("data-medium-type")},_getTrackTypeFromTabPane:function(e){return e.getAttribute("data-track-kind")},_getMediaHTML:function(e){var t=this._getMediumTypeFromTabPane(e.one(".root.tab-content > .tab-pane.active")),a=e.one(s[t.toUpperCase()+"_PANE"]);return this["_getMediaHTML"+t[0].toUpperCase()+t.substr(1)](a)},_getMediaHTMLLink:function(e){var t={url:e.one(s.URL_INPUT).get("value"),name:e.one(s.NAME_INPUT).get("value")||!1};return t.url?d.Handlebars.compile(c.HTML_MEDIA.LINK)(t):""},_getMediaHTMLVideo:function(e){var t=this._getContextForMediaHTML(e);return t.width=e.one(s.WIDTH_INPUT).get("value")||!1,t.height=e.one(s.HEIGHT_INPUT).get("value")||!1,t.poster=e.one(s.POSTER_SOURCE+" "+s.URL_INPUT).get("value")||!1,t.sources.length?d.Handlebars.compile(c.HTML_MEDIA.VIDEO)(t):""},_getMediaHTMLAudio:function(e){var t=this._getContextForMediaHTML(e);return t.sources.length?d.Handlebars.compile(c.HTML_MEDIA.AUDIO)(t):""},_getContextForMediaHTML:function(e){var t=[];return e.all(s.TRACK).each(function(e){t.push({track:e.one(s.TRACK_SOURCE+" "+s.URL_INPUT).get("value"),kind:this._getTrackTypeFromTabPane(e.ancestor(".tab-pane")),label:e.one(s.TRACK_LABEL_INPUT).get("value")||e.one(s.TRACK_LANG_INPUT).get("value"),srclang:e.one(s.TRACK_LANG_INPUT).get("value"),defaultTrack:e.one(s.TRACK_DEFAULT_SELECT).get("checked")?"true":null})},this),{sources:e.all(s.MEDIA_SOURCE+" "+s.URL_INPUT).get("value").filter(function(e){return!!e}).map(function(e){return{source:e}}),description:e.one(s.MEDIA_SOURCE+" "+s.URL_INPUT).get("value")||!1,tracks:t.filter(function(e){return!!e.track}),showControls:e.one(s.MEDIA_CONTROLS_TOGGLE).get("checked"),autoplay:e.one(s.MEDIA_AUTOPLAY_TOGGLE).get("checked"),muted:e.one(s.MEDIA_MUTE_TOGGLE).get("checked"),loop:e.one(s.MEDIA_LOOP_TOGGLE).get("checked"),title:e.one(s.TITLE_INPUT).get("value")||!1}}},{ATTRS:{langs:{},help:{}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin","moodle-form-shortforms"]}); \ No newline at end of file +TRACK_TABS:'
                          {{{helpStrings.subtitles}}}
                          {{renderPartial "form_components.track" context=this sourcelabel="subtitlessourcelabel" addcomponentlabel="addsubtitlestrack"}}
                          {{{helpStrings.captions}}}
                          {{renderPartial "form_components.track" context=this sourcelabel="captionssourcelabel" addcomponentlabel="addcaptionstrack"}}
                          {{{helpStrings.descriptions}}}
                          {{renderPartial "form_components.track" context=this sourcelabel="descriptionssourcelabel" addcomponentlabel="adddescriptionstrack"}}
                          {{{helpStrings.chapters}}}
                          {{renderPartial "form_components.track" context=this sourcelabel="chapterssourcelabel" addcomponentlabel="addchapterstrack"}}
                          {{{helpStrings.metadata}}}
                          {{renderPartial "form_components.track" context=this sourcelabel="metadatasourcelabel" addcomponentlabel="addmetadatatrack"}}
                          ',TRACK:'
                          {{renderPartial "form_components.source" context=this id=CSS.TRACK_SOURCE entersourcelabel=sourcelabel}}
                          {{renderPartial "form_components.add_component" context=this label=addcomponentlabel}}
                          '},HTML_MEDIA:{VIDEO:'  ',AUDIO:'  ',LINK:'{{#name}}{{../name}}{{/name}}{{^name}}{{../url}}{{/name}}'}};l.namespace("M.atto_media").Button=l.Base.create("button",l.M.editor_atto.EditorPlugin,[],{initializer:function(){this.get("host").canShowFilepicker("media")&&(this.editor.delegate("dblclick",this._displayDialogue,"video",this),this.editor.delegate("click",this._handleClick,"video",this),this.addButton({icon:"e/insert_edit_video",callback:this._displayDialogue,tags:"video, audio",tagMatchRequiresAll:!1}))},_getContext:function(e){return l.merge({elementid:this.get("host").get("elementid"),component:t,langsinstalled:this.get("langs").installed,langsavailable:this.get("langs").available,helpStrings:this.get("help"),CSS:o},e)},_handleClick:function(e){e=e.target,e=this.get("host").getSelectionFromNode(e);this.get("host").getSelection()!==e&&this.get("host").setSelection(e)},_displayDialogue:function(){!1!==this.get("host").getSelection()&&("renderPartial"in l.Handlebars.helpers||( +function i(a,e){l.each(e,function(e,t){a.push(t),"object"!=typeof e?l.Handlebars.registerPartial(a.join(".").toLowerCase(),e):i(a,e),a.pop()})}([],r),l.Handlebars.registerHelper("renderPartial",function(e,t){var a;return e?(e=l.Handlebars.partials[e],a=t.hash.context?l.clone(t.hash.context):{},delete(a=l.merge(a,t.hash)).context,e?new l.Handlebars.SafeString(l.Handlebars.compile(e)(a)):""):""})),this.getDialogue({headerContent:M.util.get_string("createmedia",t),focusAfterHide:!0,width:660,focusOnShowSelector:s.URL_INPUT}).set("bodyContent",this._getDialogueContent(this.get("host").getSelection())).show(),M.form.shortforms({formid:this.get("host").get("elementid")+"_atto_media_form"}))},_getDialogueContent:function(e){var t=l.Node.create(l.Handlebars.compile(r.ROOT)(this._getContext())),a=this.get("host").getSelectedNodes().filter("video,audio").shift(),a=!!a&&this._getMediumProperties(a);return this._attachEvents(this._applyMediumProperties(t,a),e)},_attachEvents:function(e,a){return e.delegate("click",function(e){e.preventDefault(),this._addMediaSourceComponent(e.currentTarget)},s.MEDIA_SOURCE+" .addcomponent",this),e.delegate("click",function(e){e.preventDefault(),this._addTrackComponent(e.currentTarget)},s.TRACK+" .addcomponent",this),e.delegate("click",function(e){var t,a=e.currentTarget;a.get("checked")&&(t=function(e){return this._getTrackTypeFromTabPane(e.ancestor(".tab-pane"))}.bind(this),a.ancestor(".root.tab-content").all(s.TRACK_DEFAULT_SELECT).each(function(e){e!==a&&t(a)===t(e)&&e.set("checked",!1)}))},s.TRACK_DEFAULT_SELECT,this),e.delegate("click",function(e){var t=e.currentTarget,a=(t.ancestor(s.POSTER_SOURCE)?"image":t.ancestor(s.TRACK_SOURCE)&&"subtitle")||"media";e.preventDefault(),this.get("host").showFilepicker(a,this._getFilepickerCallback(t,a),this)},".openmediabrowser",this),e.all(".nav-item").on("click",function(e){e.currentTarget.get("parentNode").all(".active").removeClass("active")}),e.one(".submit").on("click",function(e){e.preventDefault();var e=this._getMediaHTML(e.currentTarget.ancestor(".atto_form")),t=this.get("host");this.getDialogue({focusAfterHide:null}).hide(),e&&(t.setSelection(a),t.insertContentAtFocusPoint(e),this.markUpdated())},this),e},_applyMediumProperties:function(e,t){var i,n,a;return t&&(i=function(e,t){e.one(s.TRACK_SOURCE+" "+s.URL_INPUT).set("value",t.src),e.one(s.TRACK_LANG_INPUT).set("value",t.srclang),e.one(s.TRACK_LABEL_INPUT).set("value",t.label),e.one(s.TRACK_DEFAULT_SELECT).set("checked",t.defaultTrack)},(n=e.one(".root.tab-content > .tab-pane#"+this.get("host").get("elementid")+"_"+t.type.toLowerCase())).one(s.MEDIA_SOURCE+" "+s.URL_INPUT).set("value",t.sources[0]),l.Array.each(t.sources.slice(1),function(t){this._addMediaSourceComponent(n.one(s.MEDIA_SOURCE+" .addcomponent"),function(e){e.one(s.URL_INPUT).set("value",t)})},this),l.Object.each(t.tracks,function(e,t){var e=e.length?e:[{src:"",srclang:"",label:"",defaultTrack:!1}],a=s["TRACK_"+t.toUpperCase()+"_PANE"];i(n.one(a+" "+s.TRACK),e[0]),l.Array.each(e.slice(1),function(t){this._addTrackComponent(n.one(a+" "+s.TRACK+" .addcomponent"),function(e){i(e,t)})},this)},this),n.one(s.TITLE_INPUT).set("value",t.title),n.one(s.MEDIA_CONTROLS_TOGGLE).set("checked",t.controls),n.one(s.MEDIA_AUTOPLAY_TOGGLE).set("checked",t.autoplay),n.one(s.MEDIA_MUTE_TOGGLE).set("checked",t.muted),n.one(s.MEDIA_LOOP_TOGGLE).set("checked",t.loop),"video"===(a=this._getMediumTypeFromTabPane(n))&&(n.one(s.POSTER_SOURCE+" "+s.URL_INPUT).setAttribute("value",t.poster),n.one(s.WIDTH_INPUT).set("value",t.width),n.one(s.HEIGHT_INPUT).set("value",t.height)),n.siblings(".active").removeClass("active"),e.all(".root.nav-tabs .nav-item a").removeClass("active"),n.addClass("active"),e.one(s[a.toUpperCase()+"_TAB"]+" a").addClass("active")),e},_getMediumProperties:function(e){var t=function(e,t){return e.hasAttribute(t)&&(e.getAttribute(t)||""===e.getAttribute(t))},a={subtitles:[],captions:[],descriptions:[],chapters:[],metadata:[]};return e.all("track").each(function(e){a[e.getAttribute("kind")].push({src:e.getAttribute("src"),srclang:e.getAttribute("srclang"),label:e.getAttribute("label"),defaultTrack:t(e,"default")})}),{type:e.test("video")?i.VIDEO:i.AUDIO,sources:e.all("source").get("src"),poster:e.getAttribute("poster"),title:e.getAttribute("title"),width:e.getAttribute("width"),height:e.getAttribute("height"),autoplay:t(e,"autoplay"),loop:t(e,"loop"),muted:t(e,"muted"),controls:t(e,"controls"),tracks:a}},_addTrackComponent:function(e,t){var a=this._getTrackTypeFromTabPane(e.ancestor(".tab-pane")),a=this._getContext({sourcelabel:a+"sourcelabel",addcomponentlabel:"add"+a+"track"});this._addComponent(e,r.FORM_COMPONENTS.TRACK,s.TRACK,a,t)},_addMediaSourceComponent:function(e,t){var a=this._getMediumTypeFromTabPane(e.ancestor(".tab-pane")),a=this._getContext({multisource:!0,id:o.MEDIA_SOURCE,entersourcelabel:a+"sourcelabel",addcomponentlabel:"addsource",addsourcehelp:this.get("help").addsource});this._addComponent(e,r.FORM_COMPONENTS.SOURCE,s.MEDIA_SOURCE,a,t)},_addComponent:function(e,t,a,i,n){var o=e.ancestor(a),a=l.Node.create(l.Handlebars.compile(t)(i)),t=this._getContext(i);t.label="remove",(i=l.Node.create(l.Handlebars.compile(r.FORM_COMPONENTS.REMOVE_COMPONENT)(t))).one(".removecomponent").on("click",function(e){e.preventDefault(),o.remove(!0)}),o.insert(a,"after"),e.ancestor().insert(i,"after"),e.ancestor().remove(!0),n&&n.call(this,a)},_getFilepickerCallback:function(i,n){return function(e){var a,t;""!==e.url&&(t=i.ancestor(".tab-pane"),i.ancestor(s.SOURCE).one(s.URL_INPUT).set("value",e.url),t.get("id")===this.get("host").get("elementid")+"_"+o.LINK&&t.one(s.NAME_INPUT).set("value",e.file),"subtitle"===n&&(a=e.file.split(".vtt")[0].split("-").slice(-1)[0],(t=this.get("langs").available.reduce(function(e,t){return t.code===a?t:e},!1))&&(i.ancestor(s.TRACK).one(s.TRACK_LABEL_INPUT).set("value",t.lang.substr(0,t.lang.lastIndexOf(" "))),i.ancestor(s.TRACK).one(s.TRACK_LANG_INPUT).set("value",t.code))))}}, +_getMediumTypeFromTabPane:function(e){return e.getAttribute("data-medium-type")},_getTrackTypeFromTabPane:function(e){return e.getAttribute("data-track-kind")},_getMediaHTML:function(e){var t=this._getMediumTypeFromTabPane(e.one(".root.tab-content > .tab-pane.active")),e=e.one(s[t.toUpperCase()+"_PANE"]);return this["_getMediaHTML"+t[0].toUpperCase()+t.substr(1)](e)},_getMediaHTMLLink:function(e){e={url:e.one(s.URL_INPUT).get("value"),name:e.one(s.NAME_INPUT).get("value")||!1};return e.url?l.Handlebars.compile(r.HTML_MEDIA.LINK)(e):""},_getMediaHTMLVideo:function(e){var t=this._getContextForMediaHTML(e);return t.width=e.one(s.WIDTH_INPUT).get("value")||!1,t.height=e.one(s.HEIGHT_INPUT).get("value")||!1,t.poster=e.one(s.POSTER_SOURCE+" "+s.URL_INPUT).get("value")||!1,t.sources.length?l.Handlebars.compile(r.HTML_MEDIA.VIDEO)(t):""},_getMediaHTMLAudio:function(e){e=this._getContextForMediaHTML(e);return e.sources.length?l.Handlebars.compile(r.HTML_MEDIA.AUDIO)(e):""},_getContextForMediaHTML:function(e){var t=[];return e.all(s.TRACK).each(function(e){t.push({track:e.one(s.TRACK_SOURCE+" "+s.URL_INPUT).get("value"),kind:this._getTrackTypeFromTabPane(e.ancestor(".tab-pane")),label:e.one(s.TRACK_LABEL_INPUT).get("value")||e.one(s.TRACK_LANG_INPUT).get("value"),srclang:e.one(s.TRACK_LANG_INPUT).get("value"),defaultTrack:e.one(s.TRACK_DEFAULT_SELECT).get("checked")?"true":null})},this),{sources:e.all(s.MEDIA_SOURCE+" "+s.URL_INPUT).get("value").filter(function(e){return!!e}).map(function(e){return{source:e}}),description:e.one(s.MEDIA_SOURCE+" "+s.URL_INPUT).get("value")||!1,tracks:t.filter(function(e){return!!e.track}),showControls:e.one(s.MEDIA_CONTROLS_TOGGLE).get("checked"),autoplay:e.one(s.MEDIA_AUTOPLAY_TOGGLE).get("checked"),muted:e.one(s.MEDIA_MUTE_TOGGLE).get("checked"),loop:e.one(s.MEDIA_LOOP_TOGGLE).get("checked"),title:e.one(s.TITLE_INPUT).get("value")||!1}}},{ATTRS:{langs:{},help:{}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin","moodle-form-shortforms"]}); \ No newline at end of file diff --git a/lib/editor/atto/plugins/recordrtc/yui/build/moodle-atto_recordrtc-button/moodle-atto_recordrtc-button-min.js b/lib/editor/atto/plugins/recordrtc/yui/build/moodle-atto_recordrtc-button/moodle-atto_recordrtc-button-min.js index 013087c2f2b..d14e0b58e52 100644 --- a/lib/editor/atto/plugins/recordrtc/yui/build/moodle-atto_recordrtc-button/moodle-atto_recordrtc-button-min.js +++ b/lib/editor/atto/plugins/recordrtc/yui/build/moodle-atto_recordrtc-button/moodle-atto_recordrtc-button-min.js @@ -1 +1 @@ -YUI.add("moodle-atto_recordrtc-button",function(s,t){var n="atto_recordrtc";s.namespace("M.atto_recordrtc").Button=s.Base.create("button",s.M.editor_atto.EditorPlugin,[],{_lang:"en",initializer:function(){var t,e,i;if(this.get("host").canShowFilepicker("media")){if(e=!1,"both"!==(t=this.get("allowedtypes"))&&"audio"!==t||(this._addButton("audio",this._audio),e=!0),"both"!==t&&"video"!==t||(this._addButton("video",this._video),e=!0),!e)return;(i=this.getDialogue({width:1e3,focusAfterHide:null})).after("visibleChange",function(){var t=!i.get("visible"),e=M.atto_recordrtc.commonmodule;t&&(window.clearInterval(e.countdownTicker),e.mediaRecorder&&"inactive"!==e.mediaRecorder.state&&e.mediaRecorder.stop(),e.stream&&e.stream.getTracks().forEach(function(t){"ended"!==t.readyState&&t.stop()}),this.getDialogue().set("bodyContent",""))},this),i.on("click",function(){this.centered()}),window.require(["core/adapter"],function(t){window.adapter=t})}},_addButton:function(t,e){this.addButton({buttonName:t,icon:this.get(t+"rtcicon"),iconComponent:n,callback:e,title:t+"rtc",tags:t+"rtc",tagMatchRequiresAll:!1})},_audio:function(){var t=this.getDialogue();t.set("headerContent",M.util.get_string("audiortc","atto_recordrtc")),t.set("bodyContent",this._createContent("audio")),t.show(),M.atto_recordrtc.audiomodule.init(this)},_video:function(){var t=this.getDialogue();t.set("headerContent",M.util.get_string("videortc","atto_recordrtc")),t.set("bodyContent",this._createContent("video")),t.show(),M.atto_recordrtc.videomodule.init(this)},_createContent:function(t){var e="audio"===t,i="row",o="col-",r="alert-danger",a="btn btn-lg btn-outline-danger btn-block",d=s.Handlebars.compile('
                          {{insecurealert_title}} {{insecurealert}}
                          {{#if isAudio}}
                          {{else}}
                          {{/if}}
                          ')({PLUGINNAME:n,isAudio:e,bs_row:i,bs_col:o,bs_al_dang:r,bs_ss_btn:a,insecurealert_title:M.util.get_string("insecurealert_title","atto_recordrtc"),insecurealert:M.util.get_string("insecurealert","atto_recordrtc"),startrecording:M.util.get_string("startrecording","atto_recordrtc"),attachrecording:M.util.get_string("attachrecording","atto_recordrtc")});return d},closeDialogue:function(t){t.getDialogue().hide(),t.editor.focus()},setLink:function(t,e){t.getDialogue().hide(),t.editor.focus(),t.get("host").insertContentAtFocusPoint(e),t.markUpdated()}},{ATTRS:{contextid:{value:null},sesskey:{value:null},allowedtypes:{value:null},audiobitrate:{value:null},videobitrate:{value:null},timelimit:{value:null},audiortcicon:{value:null},videortcicon:{value:null},maxrecsize:{value:null}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin","moodle-atto_recordrtc-recording"]}); \ No newline at end of file +YUI.add("moodle-atto_recordrtc-button",function(e,t){var i="atto_recordrtc";e.namespace("M.atto_recordrtc").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{_lang:"en",initializer:function(){var t,e,i;this.get("host").canShowFilepicker("media")&&(e=!1,"both"!==(t=this.get("allowedtypes"))&&"audio"!==t||(this._addButton("audio",this._audio),e=!0),"both"!==t&&"video"!==t||(this._addButton("video",this._video),e=!0),e&&((i=this.getDialogue({width:1e3,focusAfterHide:null})).after("visibleChange",function(){var t=!i.get("visible"),e=M.atto_recordrtc.commonmodule;t&&(window.clearInterval(e.countdownTicker),e.mediaRecorder&&"inactive"!==e.mediaRecorder.state&&e.mediaRecorder.stop(),e.stream&&e.stream.getTracks().forEach(function(t){"ended"!==t.readyState&&t.stop()}),this.getDialogue().set("bodyContent",""))},this),i.on("click",function(){this.centered()}),window.require(["core/adapter"],function(t){window.adapter=t})))},_addButton:function(t,e){this.addButton({buttonName:t,icon:this.get(t+"rtcicon"),iconComponent:i,callback:e,title:t+"rtc",tags:t+"rtc",tagMatchRequiresAll:!1})},_audio:function(){var t=this.getDialogue();t.set("headerContent",M.util.get_string("audiortc","atto_recordrtc")),t.set("bodyContent",this._createContent("audio")),t.show(),M.atto_recordrtc.audiomodule.init(this)},_video:function(){var t=this.getDialogue();t.set("headerContent",M.util.get_string("videortc","atto_recordrtc")),t.set("bodyContent",this._createContent("video")),t.show(),M.atto_recordrtc.videomodule.init(this)},_createContent:function(t){t="audio"===t,t=e.Handlebars.compile('
                          {{insecurealert_title}} {{insecurealert}}
                          {{#if isAudio}}
                          {{else}}
                          {{/if}}
                          ')({PLUGINNAME:i,isAudio:t,bs_row:"row",bs_col:"col-",bs_al_dang:"alert-danger",bs_ss_btn:"btn btn-lg btn-outline-danger btn-block",insecurealert_title:M.util.get_string("insecurealert_title","atto_recordrtc"),insecurealert:M.util.get_string("insecurealert","atto_recordrtc"),startrecording:M.util.get_string("startrecording","atto_recordrtc"),attachrecording:M.util.get_string("attachrecording","atto_recordrtc")});return t},closeDialogue:function(t){t.getDialogue().hide(),t.editor.focus()},setLink:function(t,e){t.getDialogue().hide(),t.editor.focus(),t.get("host").insertContentAtFocusPoint(e),t.markUpdated()}},{ATTRS:{contextid:{value:null},sesskey:{value:null},allowedtypes:{value:null},audiobitrate:{value:null},videobitrate:{value:null},timelimit:{value:null},audiortcicon:{value:null},videortcicon:{value:null},maxrecsize:{value:null}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin","moodle-atto_recordrtc-recording"]}); \ No newline at end of file diff --git a/lib/editor/atto/plugins/recordrtc/yui/build/moodle-atto_recordrtc-recording/moodle-atto_recordrtc-recording-min.js b/lib/editor/atto/plugins/recordrtc/yui/build/moodle-atto_recordrtc-recording/moodle-atto_recordrtc-recording-min.js index c50ca3e3e2f..6723f768127 100644 --- a/lib/editor/atto/plugins/recordrtc/yui/build/moodle-atto_recordrtc-recording/moodle-atto_recordrtc-recording-min.js +++ b/lib/editor/atto/plugins/recordrtc/yui/build/moodle-atto_recordrtc-recording/moodle-atto_recordrtc-recording-min.js @@ -1,2 +1,2 @@ -YUI.add("moodle-atto_recordrtc-recording",function(r,t){var l,a,e;M.atto_recordrtc=M.atto_recordrtc||{},l=M.atto_recordrtc.commonmodule,a=M.atto_recordrtc.abstractmodule,M.atto_recordrtc.commonmodule={editorScope:null,alertWarning:null,alertDanger:null,player:null,playerDOM:null,startStopBtn:null,uploadBtn:null,countdownSeconds:null,countdownTicker:null,recType:null,stream:null,mediaRecorder:null,chunks:null,blobSize:null,maxUploadSize:null,capture_user_media:function(t,e,o){window.navigator.mediaDevices.getUserMedia(t).then(e)["catch"](o)},handle_data_available:function(t){l.chunks.push(t.data),l.blobSize+=t.data.size,l.blobSize>=l.maxUploadSize&&(window.localStorage.getItem("alerted")?window.localStorage.removeItem("alerted"):(window.localStorage.setItem("alerted","true"),l.startStopBtn.simulate("click"),a.show_alert("nearingmaxsize")),l.chunks.pop())},handle_stop:function(){var t=new window.Blob(l.chunks,{type:l.mediaRecorder.mimeType});l.player.set("srcObject",null),l.player.set("src",window.URL.createObjectURL(t)),l.player.set("muted",!1),l.player.set("controls",!0),l.player.ancestor().ancestor().removeClass("hide"),l.uploadBtn.ancestor().ancestor().removeClass("hide"),l.uploadBtn.set("textContent",M.util.get_string("attachrecording","atto_recordrtc")),l.uploadBtn.set("disabled",!1),l.editorScope.getDialogue().centered(),l.uploadBtn.on("click",function(){0===l.chunks.length?a.show_alert("norecordingfound"):(l.uploadBtn.set("disabled",!0),l.upload_to_server(l.recType,function(t,e){"ended"===t?(l.uploadBtn.set("disabled",!1),l.insert_annotation(l.recType,e)):"upload-failed"===t?(l.uploadBtn.set("disabled",!1),l.uploadBtn.set("textContent",M.util.get_string("uploadfailed","atto_recordrtc")+" "+e)):"upload-failed-404"===t?(l.uploadBtn.set("disabled",!1),l.uploadBtn.set("textContent",M.util.get_string("uploadfailed404","atto_recordrtc"))):"upload-aborted"===t?(l.uploadBtn.set("disabled",!1),l.uploadBtn.set("textContent",M.util.get_string("uploadaborted","atto_recordrtc")+" "+e)):l.uploadBtn.set("textContent",t)}))})},start_recording:function(t,e){var o,r=a.select_rec_options(t);l.mediaRecorder=new window.MediaRecorder(e,r),l.mediaRecorder.ondataavailable=l.handle_data_available,l.mediaRecorder.onstop=l.handle_stop,l.mediaRecorder.start(1e3),l.player.set("muted",!0),l.countdownSeconds=l.editorScope.get("timelimit"),l.countdownSeconds++,o=M.util.get_string("stoprecording","atto_recordrtc"),o+=' (:)',l.startStopBtn.setHTML(o),l.set_time(),l.countdownTicker=window.setInterval(l.set_time,1e3),l.startStopBtn.set("disabled",!1)},stop_recording:function(t){var e,o;for(l.mediaRecorder.stop(),e=t.getTracks(),o=0;o":""},insert_annotation:function(t,e){var o=l.create_annotation(t,e);o?l.editorScope.setLink(l.editorScope,o):l.uploadBtn.set("textContent",M.util.get_string("attachrecording","atto_recordrtc"))}},M.atto_recordrtc=M.atto_recordrtc||{},l=M.atto_recordrtc.commonmodule,a=M.atto_recordrtc.abstractmodule,M.atto_recordrtc.compatcheckmodule={check_has_gum:function(){navigator.mediaDevices&&window.MediaRecorder||a.show_alert("nowebrtc",function(){l.editorScope.closeDialogue(l.editorScope)})},check_secure:function(){"https:"===window.location.protocol||-1!==window.location.host.indexOf("localhost")||l.alertDanger.ancestor().ancestor().removeClass("hide")}},M.atto_recordrtc=M.atto_recordrtc||{},l=M.atto_recordrtc.commonmodule,a=M.atto_recordrtc.abstractmodule,M.atto_recordrtc.abstractmodule={show_alert:function(e,o){r.use("moodle-core-notification-alert",function(){var t=new M.core.alert({title:M.util.get_string(e+"_title","atto_recordrtc"),message:M.util.get_string(e,"atto_recordrtc")});o&&t.after("complete",o)})},handle_gum_errors:function(t,e){var o=M.util.get_string("recordingfailed","atto_recordrtc"),r=function(){e.onMediaStopped(o)},n="gum"+t.name.replace("Error","").toLowerCase();"gumsecurity"!==n?a.show_alert(n,r):a.show_alert(n,function(){l.editorScope.closeDialogue(l.editorScope)})},select_rec_options:function(t){var e,o,r;return o="audio"===t?(e=[ -"audio/webm;codecs=opus","audio/ogg;codecs=opus"],{audioBitsPerSecond:window.parseInt(l.editorScope.get("audiobitrate"))}):(e=["video/webm;codecs=vp9,opus","video/webm;codecs=h264,opus","video/webm;codecs=vp8,opus"],{audioBitsPerSecond:window.parseInt(l.editorScope.get("audiobitrate")),videoBitsPerSecond:window.parseInt(l.editorScope.get("videobitrate"))}),0!==(r=e.filter(function(t){return window.MediaRecorder.isTypeSupported(t)})).length&&(o.mimeType=r[0]),o}},M.atto_recordrtc=M.atto_recordrtc||{},l=M.atto_recordrtc.commonmodule,a=M.atto_recordrtc.abstractmodule,e=M.atto_recordrtc.compatcheckmodule,M.atto_recordrtc.audiomodule={init:function(t){l.editorScope=t,l.alertWarning=r.one("div#alert-warning"),l.alertDanger=r.one("div#alert-danger"),l.player=r.one("audio#player"),l.playerDOM=document.querySelector("audio#player"),l.startStopBtn=r.one("button#start-stop"),l.uploadBtn=r.one("button#upload"),l.recType="audio",l.maxUploadSize=t.get("maxrecsize"),e.check_has_gum(),e.check_secure(),l.startStopBtn.on("click",function(){if(l.startStopBtn.set("disabled",!0),l.startStopBtn.get("textContent")===M.util.get_string("startrecording","atto_recordrtc")||l.startStopBtn.get("textContent")===M.util.get_string("recordagain","atto_recordrtc")||l.startStopBtn.get("textContent")===M.util.get_string("recordingfailed","atto_recordrtc")){l.player.ancestor().ancestor().addClass("hide"),l.uploadBtn.ancestor().ancestor().addClass("hide"),l.startStopBtn.replaceClass("btn-outline-danger","btn-danger"),l.chunks=[],l.blobSize=0,l.uploadBtn.detach("click");var e={onMediaCaptured:function(t){l.stream=t,l.start_recording(l.recType,l.stream)},onMediaStopped:function(t){l.startStopBtn.set("textContent",t),l.startStopBtn.set("disabled",!1),l.startStopBtn.replaceClass("btn-danger","btn-outline-danger")},onMediaCapturingFailed:function(t){a.handle_gum_errors(t,e)}};M.atto_recordrtc.audiomodule.capture_audio(e)}else window.clearInterval(l.countdownTicker),window.setTimeout(function(){l.startStopBtn.set("disabled",!1)},1e3),l.stop_recording(l.stream),l.startStopBtn.set("textContent",M.util.get_string("recordagain","atto_recordrtc")),l.startStopBtn.replaceClass("btn-danger","btn-outline-danger");l.editorScope.getDialogue().centered()})},capture_audio:function(e){l.capture_user_media({audio:!0},function(t){l.playerDOM.srcObject=t,e.onMediaCaptured(t)},function(t){e.onMediaCapturingFailed(t)})}},M.atto_recordrtc=M.atto_recordrtc||{},l=M.atto_recordrtc.commonmodule,a=M.atto_recordrtc.abstractmodule,e=M.atto_recordrtc.compatcheckmodule,M.atto_recordrtc.videomodule={init:function(t){l.editorScope=t,l.alertWarning=r.one("div#alert-warning"),l.alertDanger=r.one("div#alert-danger"),l.player=r.one("video#player"),l.playerDOM=document.querySelector("video#player"),l.startStopBtn=r.one("button#start-stop"),l.uploadBtn=r.one("button#upload"),l.recType="video",l.maxUploadSize=t.get("maxrecsize"),e.check_has_gum(),e.check_secure(),l.startStopBtn.on("click",function(){if(l.startStopBtn.set("disabled",!0),l.startStopBtn.get("textContent")===M.util.get_string("startrecording","atto_recordrtc")||l.startStopBtn.get("textContent")===M.util.get_string("recordagain","atto_recordrtc")||l.startStopBtn.get("textContent")===M.util.get_string("recordingfailed","atto_recordrtc")){l.uploadBtn.ancestor().ancestor().addClass("hide"),l.startStopBtn.replaceClass("btn-outline-danger","btn-danger"),l.chunks=[],l.blobSize=0,l.uploadBtn.detach("click");var e={onMediaCaptured:function(t){l.stream=t,l.start_recording(l.recType,l.stream)},onMediaStopped:function(t){l.startStopBtn.set("textContent",t),l.startStopBtn.set("disabled",!1),l.startStopBtn.replaceClass("btn-danger","btn-outline-danger")},onMediaCapturingFailed:function(t){a.handle_gum_errors(t,e)}};l.player.ancestor().ancestor().removeClass("hide"),l.player.set("controls",!1),M.atto_recordrtc.videomodule.capture_audio_video(e)}else window.clearInterval(l.countdownTicker),window.setTimeout(function(){l.startStopBtn.set("disabled",!1)},1e3),l.stop_recording(l.stream),l.startStopBtn.set("textContent",M.util.get_string("recordagain","atto_recordrtc")),l.startStopBtn.replaceClass("btn-danger","btn-outline-danger");l.editorScope.getDialogue().centered()})},capture_audio_video:function(e){l.capture_user_media({audio:!0,video:{width:{ideal:640},height:{ideal:480}}},function(t){l.playerDOM.srcObject=t,l.playerDOM.play(),e.onMediaCaptured(t)},function(t){e.onMediaCapturingFailed(t)})}}},"@VERSION@",{requires:["moodle-atto_recordrtc-button"]}); \ No newline at end of file +YUI.add("moodle-atto_recordrtc-recording",function(r,t){var s,n,e;M.atto_recordrtc=M.atto_recordrtc||{},s=M.atto_recordrtc.commonmodule,n=M.atto_recordrtc.abstractmodule,M.atto_recordrtc.commonmodule={editorScope:null,alertWarning:null,alertDanger:null,player:null,playerDOM:null,startStopBtn:null,uploadBtn:null,countdownSeconds:null,countdownTicker:null,recType:null,stream:null,mediaRecorder:null,chunks:null,blobSize:null,maxUploadSize:null,capture_user_media:function(t,e,o){window.navigator.mediaDevices.getUserMedia(t).then(e)["catch"](o)},handle_data_available:function(t){s.chunks.push(t.data),s.blobSize+=t.data.size,s.blobSize>=s.maxUploadSize&&(window.localStorage.getItem("alerted")?window.localStorage.removeItem("alerted"):(window.localStorage.setItem("alerted","true"),s.startStopBtn.simulate("click"),n.show_alert("nearingmaxsize")),s.chunks.pop())},handle_stop:function(){var t=new window.Blob(s.chunks,{type:s.mediaRecorder.mimeType});s.player.set("srcObject",null),s.player.set("src",window.URL.createObjectURL(t)),s.player.set("muted",!1),s.player.set("controls",!0),s.player.ancestor().ancestor().removeClass("hide"),s.uploadBtn.ancestor().ancestor().removeClass("hide"),s.uploadBtn.set("textContent",M.util.get_string("attachrecording","atto_recordrtc")),s.uploadBtn.set("disabled",!1),s.editorScope.getDialogue().centered(),s.uploadBtn.on("click",function(){0===s.chunks.length?n.show_alert("norecordingfound"):(s.uploadBtn.set("disabled",!0),s.upload_to_server(s.recType,function(t,e){"ended"===t?(s.uploadBtn.set("disabled",!1),s.insert_annotation(s.recType,e)):"upload-failed"===t?(s.uploadBtn.set("disabled",!1),s.uploadBtn.set("textContent",M.util.get_string("uploadfailed","atto_recordrtc")+" "+e)):"upload-failed-404"===t?(s.uploadBtn.set("disabled",!1),s.uploadBtn.set("textContent",M.util.get_string("uploadfailed404","atto_recordrtc"))):"upload-aborted"===t?(s.uploadBtn.set("disabled",!1),s.uploadBtn.set("textContent",M.util.get_string("uploadaborted","atto_recordrtc")+" "+e)):s.uploadBtn.set("textContent",t)}))})},start_recording:function(t,e){t=n.select_rec_options(t);s.mediaRecorder=new window.MediaRecorder(e,t),s.mediaRecorder.ondataavailable=s.handle_data_available,s.mediaRecorder.onstop=s.handle_stop,s.mediaRecorder.start(1e3),s.player.set("muted",!0),s.countdownSeconds=s.editorScope.get("timelimit"),s.countdownSeconds++,e=M.util.get_string("stoprecording","atto_recordrtc"),s.startStopBtn.setHTML(e+=' (:)'),s.set_time(),s.countdownTicker=window.setInterval(s.set_time,1e3),s.startStopBtn.set("disabled",!1)},stop_recording:function(t){var e,o;for(s.mediaRecorder.stop(),e=t.getTracks(),o=0;o":"")},insert_annotation:function(t,e){t=s.create_annotation(t,e);t?s.editorScope.setLink(s.editorScope,t):s.uploadBtn.set("textContent",M.util.get_string("attachrecording","atto_recordrtc"))}},M.atto_recordrtc=M.atto_recordrtc||{},s=M.atto_recordrtc.commonmodule,n=M.atto_recordrtc.abstractmodule,M.atto_recordrtc.compatcheckmodule={check_has_gum:function(){navigator.mediaDevices&&window.MediaRecorder||n.show_alert("nowebrtc",function(){s.editorScope.closeDialogue(s.editorScope)})},check_secure:function(){"https:"===window.location.protocol||-1!==window.location.host.indexOf("localhost")||s.alertDanger.ancestor().ancestor().removeClass("hide")}},M.atto_recordrtc=M.atto_recordrtc||{},s=M.atto_recordrtc.commonmodule,n=M.atto_recordrtc.abstractmodule,M.atto_recordrtc.abstractmodule={show_alert:function(e,o){r.use("moodle-core-notification-alert",function(){var t=new M.core.alert({title:M.util.get_string(e+"_title","atto_recordrtc"),message:M.util.get_string(e,"atto_recordrtc")});o&&t.after("complete",o)})},handle_gum_errors:function(t,e){var o=M.util.get_string("recordingfailed","atto_recordrtc"),r=function(){e.onMediaStopped(o)},t="gum"+t.name.replace("Error","").toLowerCase();"gumsecurity"!=t?n.show_alert(t,r):n.show_alert(t,function(){s.editorScope.closeDialogue(s.editorScope)})},select_rec_options:function(t){var t="audio"===t?(e=["audio/webm;codecs=opus","audio/ogg;codecs=opus"],{ +audioBitsPerSecond:window.parseInt(s.editorScope.get("audiobitrate"))}):(e=["video/webm;codecs=vp9,opus","video/webm;codecs=h264,opus","video/webm;codecs=vp8,opus"],{audioBitsPerSecond:window.parseInt(s.editorScope.get("audiobitrate")),videoBitsPerSecond:window.parseInt(s.editorScope.get("videobitrate"))}),e=e.filter(function(t){return window.MediaRecorder.isTypeSupported(t)});return 0!==e.length&&(t.mimeType=e[0]),t}},M.atto_recordrtc=M.atto_recordrtc||{},s=M.atto_recordrtc.commonmodule,n=M.atto_recordrtc.abstractmodule,e=M.atto_recordrtc.compatcheckmodule,M.atto_recordrtc.audiomodule={init:function(t){s.editorScope=t,s.alertWarning=r.one("div#alert-warning"),s.alertDanger=r.one("div#alert-danger"),s.player=r.one("audio#player"),s.playerDOM=document.querySelector("audio#player"),s.startStopBtn=r.one("button#start-stop"),s.uploadBtn=r.one("button#upload"),s.recType="audio",s.maxUploadSize=t.get("maxrecsize"),e.check_has_gum(),e.check_secure(),s.startStopBtn.on("click",function(){var e;s.startStopBtn.set("disabled",!0),s.startStopBtn.get("textContent")===M.util.get_string("startrecording","atto_recordrtc")||s.startStopBtn.get("textContent")===M.util.get_string("recordagain","atto_recordrtc")||s.startStopBtn.get("textContent")===M.util.get_string("recordingfailed","atto_recordrtc")?(s.player.ancestor().ancestor().addClass("hide"),s.uploadBtn.ancestor().ancestor().addClass("hide"),s.startStopBtn.replaceClass("btn-outline-danger","btn-danger"),s.chunks=[],s.blobSize=0,s.uploadBtn.detach("click"),e={onMediaCaptured:function(t){s.stream=t,s.start_recording(s.recType,s.stream)},onMediaStopped:function(t){s.startStopBtn.set("textContent",t),s.startStopBtn.set("disabled",!1),s.startStopBtn.replaceClass("btn-danger","btn-outline-danger")},onMediaCapturingFailed:function(t){n.handle_gum_errors(t,e)}},M.atto_recordrtc.audiomodule.capture_audio(e)):(window.clearInterval(s.countdownTicker),window.setTimeout(function(){s.startStopBtn.set("disabled",!1)},1e3),s.stop_recording(s.stream),s.startStopBtn.set("textContent",M.util.get_string("recordagain","atto_recordrtc")),s.startStopBtn.replaceClass("btn-danger","btn-outline-danger")),s.editorScope.getDialogue().centered()})},capture_audio:function(e){s.capture_user_media({audio:!0},function(t){s.playerDOM.srcObject=t,e.onMediaCaptured(t)},function(t){e.onMediaCapturingFailed(t)})}},M.atto_recordrtc=M.atto_recordrtc||{},s=M.atto_recordrtc.commonmodule,n=M.atto_recordrtc.abstractmodule,e=M.atto_recordrtc.compatcheckmodule,M.atto_recordrtc.videomodule={init:function(t){s.editorScope=t,s.alertWarning=r.one("div#alert-warning"),s.alertDanger=r.one("div#alert-danger"),s.player=r.one("video#player"),s.playerDOM=document.querySelector("video#player"),s.startStopBtn=r.one("button#start-stop"),s.uploadBtn=r.one("button#upload"),s.recType="video",s.maxUploadSize=t.get("maxrecsize"),e.check_has_gum(),e.check_secure(),s.startStopBtn.on("click",function(){var e;s.startStopBtn.set("disabled",!0),s.startStopBtn.get("textContent")===M.util.get_string("startrecording","atto_recordrtc")||s.startStopBtn.get("textContent")===M.util.get_string("recordagain","atto_recordrtc")||s.startStopBtn.get("textContent")===M.util.get_string("recordingfailed","atto_recordrtc")?(s.uploadBtn.ancestor().ancestor().addClass("hide"),s.startStopBtn.replaceClass("btn-outline-danger","btn-danger"),s.chunks=[],s.blobSize=0,s.uploadBtn.detach("click"),e={onMediaCaptured:function(t){s.stream=t,s.start_recording(s.recType,s.stream)},onMediaStopped:function(t){s.startStopBtn.set("textContent",t),s.startStopBtn.set("disabled",!1),s.startStopBtn.replaceClass("btn-danger","btn-outline-danger")},onMediaCapturingFailed:function(t){n.handle_gum_errors(t,e)}},s.player.ancestor().ancestor().removeClass("hide"),s.player.set("controls",!1),M.atto_recordrtc.videomodule.capture_audio_video(e)):(window.clearInterval(s.countdownTicker),window.setTimeout(function(){s.startStopBtn.set("disabled",!1)},1e3),s.stop_recording(s.stream),s.startStopBtn.set("textContent",M.util.get_string("recordagain","atto_recordrtc")),s.startStopBtn.replaceClass("btn-danger","btn-outline-danger")),s.editorScope.getDialogue().centered()})},capture_audio_video:function(e){s.capture_user_media({audio:!0,video:{width:{ideal:640},height:{ideal:480}}},function(t){s.playerDOM.srcObject=t,s.playerDOM.play(),e.onMediaCaptured(t)},function(t){e.onMediaCapturingFailed(t)})}}},"@VERSION@",{requires:["moodle-atto_recordrtc-button"]}); \ No newline at end of file diff --git a/lib/editor/atto/plugins/rtl/yui/build/moodle-atto_rtl-button/moodle-atto_rtl-button-min.js b/lib/editor/atto/plugins/rtl/yui/build/moodle-atto_rtl-button/moodle-atto_rtl-button-min.js index 8f144d4f034..910e6f5eba1 100644 --- a/lib/editor/atto/plugins/rtl/yui/build/moodle-atto_rtl-button/moodle-atto_rtl-button-min.js +++ b/lib/editor/atto/plugins/rtl/yui/build/moodle-atto_rtl-button/moodle-atto_rtl-button-min.js @@ -1 +1 @@ -YUI.add("moodle-atto_rtl-button",function(t,e){t.namespace("M.atto_rtl").Button=t.Base.create("button",t.M.editor_atto.EditorPlugin,[],{initializer:function(){var t;t="ltr",this.addButton({icon:"e/left_to_right",title:t,buttonName:t,callback:this._toggleRTL,callbackArgs:t,tags:"[dir=ltr]"}),t="rtl",this.addButton({icon:"e/right_to_left",title:t,buttonName:t,callback:this._toggleRTL,callbackArgs:t,tags:"[dir=rtl]"})},_toggleRTL:function(t,e){var i,l=this.get("host"),r=window.rangy.saveSelection(),o=l.getSelection(),a={rtl:"ltr",ltr:"rtl"},n={rtl:"right",ltr:"left"};o&&((i=l.formatSelectionBlock().getDOMNode()).getAttribute("dir")===e?(i.setAttribute("dir",a[e]),i.style.textAlign=n[a[e]]):(i.setAttribute("dir",e),i.style.textAlign=n[e]),window.rangy.restoreSelection(r),this.markUpdated())}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); \ No newline at end of file +YUI.add("moodle-atto_rtl-button",function(t,e){t.namespace("M.atto_rtl").Button=t.Base.create("button",t.M.editor_atto.EditorPlugin,[],{initializer:function(){var t="ltr";this.addButton({icon:"e/left_to_right",title:t,buttonName:t,callback:this._toggleRTL,callbackArgs:t,tags:"[dir=ltr]"}),this.addButton({icon:"e/right_to_left",title:t="rtl",buttonName:t,callback:this._toggleRTL,callbackArgs:t,tags:"[dir=rtl]"})},_toggleRTL:function(t,e){var i=this.get("host"),l=window.rangy.saveSelection(),r=i.getSelection(),o={rtl:"ltr",ltr:"rtl"},a={rtl:"right",ltr:"left"};r&&((r=i.formatSelectionBlock().getDOMNode()).getAttribute("dir")===e?(r.setAttribute("dir",o[e]),r.style.textAlign=a[o[e]]):(r.setAttribute("dir",e),r.style.textAlign=a[e]),window.rangy.restoreSelection(l),this.markUpdated())}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); \ No newline at end of file diff --git a/lib/editor/atto/plugins/table/yui/build/moodle-atto_table-button/moodle-atto_table-button-min.js b/lib/editor/atto/plugins/table/yui/build/moodle-atto_table-button/moodle-atto_table-button-min.js index 8c75af17dbf..47511adddeb 100644 --- a/lib/editor/atto/plugins/table/yui/build/moodle-atto_table-button/moodle-atto_table-button-min.js +++ b/lib/editor/atto/plugins/table/yui/build/moodle-atto_table-button/moodle-atto_table-button-min.js @@ -1,5 +1,5 @@ -YUI.add("moodle-atto_table-button",function(O,e){var C="atto_table",S="none",R="1",T="480px",l={CAPTION:"caption",CAPTIONPOSITION:"captionposition",HEADERS:"headers",ROWS:"rows",COLUMNS:"columns",SUBMIT:"submit",FORM:"atto_form",BORDERS:"borders",BORDERSIZE:"bordersize",BORDERSIZEUNIT:"px",BORDERCOLOUR:"bordercolour",BORDERSTYLE:"borderstyle",BACKGROUNDCOLOUR:"backgroundcolour",WIDTH:"customwidth",WIDTHUNIT:"%",AVAILABLECOLORS:"availablecolors",COLOURROW:"colourrow"},w={CAPTION:"."+l.CAPTION,CAPTIONPOSITION:"."+l.CAPTIONPOSITION,HEADERS:"."+l.HEADERS,ROWS:"."+l.ROWS,COLUMNS:"."+l.COLUMNS,SUBMIT:"."+l.SUBMIT,BORDERS:"."+l.BORDERS,BORDERSIZE:"."+l.BORDERSIZE,BORDERCOLOURS:"."+l.BORDERCOLOUR+' input[name="borderColour"]',SELECTEDBORDERCOLOUR:"."+l.BORDERCOLOUR+' input[name="borderColour"]:checked',BORDERSTYLE:"."+l.BORDERSTYLE,BACKGROUNDCOLOURS:"."+l.BACKGROUNDCOLOUR+' input[name="backgroundColour"]',SELECTEDBACKGROUNDCOLOUR:"."+l.BACKGROUNDCOLOUR+' input[name="backgroundColour"]:checked',FORM:".atto_form",WIDTH:"."+l.WIDTH,AVAILABLECOLORS:"."+l.AVAILABLECOLORS};O.namespace("M.atto_table").Button=O.Base.create("button",O.M.editor_atto.EditorPlugin,[],{_currentSelection:null,_contextMenu:null,_lastTarget:null,_menuOptions:null,initializer:function(){this.addButton({icon:"e/table",callback:this._displayTableEditor,tags:"table"}),O.UA.gecko&&(document.execCommand("enableInlineTableEditing",!1,!1),document.execCommand("enableObjectResizing",!1,!1))},_displayDialogue:function(){this._currentSelection=this.get("host").getSelection(),!1===this._currentSelection||this._currentSelection.collapsed||(this.getDialogue({headerContent:M.util.get_string("createtable",C),focusAfterHide:!0,focusOnShowSelector:w.CAPTION,width:T}).set("bodyContent",this._getDialogueContent(!1)).show(),this._updateAvailableSettings())},_displayTableEditor:function(e){var t=this._getSuitableTableCell();return t?(e.tableCell=t,this._showTableMenu(e)):this._displayDialogue(e)},_stopAtContentEditableFilter:function(e){return this.editor.contains(e)},_getDialogueContent:function(e){var t=O.Handlebars.compile( +YUI.add("moodle-atto_table-button",function(v,e){var m="atto_table",_="none",p="1",f="480px",r={CAPTION:"caption",CAPTIONPOSITION:"captionposition",HEADERS:"headers",ROWS:"rows",COLUMNS:"columns",SUBMIT:"submit",FORM:"atto_form",BORDERS:"borders",BORDERSIZE:"bordersize",BORDERSIZEUNIT:"px",BORDERCOLOUR:"bordercolour",BORDERSTYLE:"borderstyle",BACKGROUNDCOLOUR:"backgroundcolour",WIDTH:"customwidth",WIDTHUNIT:"%",AVAILABLECOLORS:"availablecolors",COLOURROW:"colourrow"},O={CAPTION:"."+r.CAPTION,CAPTIONPOSITION:"."+r.CAPTIONPOSITION,HEADERS:"."+r.HEADERS,ROWS:"."+r.ROWS,COLUMNS:"."+r.COLUMNS,SUBMIT:"."+r.SUBMIT,BORDERS:"."+r.BORDERS,BORDERSIZE:"."+r.BORDERSIZE,BORDERCOLOURS:"."+r.BORDERCOLOUR+' input[name="borderColour"]',SELECTEDBORDERCOLOUR:"."+r.BORDERCOLOUR+' input[name="borderColour"]:checked',BORDERSTYLE:"."+r.BORDERSTYLE,BACKGROUNDCOLOURS:"."+r.BACKGROUNDCOLOUR+' input[name="backgroundColour"]',SELECTEDBACKGROUNDCOLOUR:"."+r.BACKGROUNDCOLOUR+' input[name="backgroundColour"]:checked',FORM:".atto_form",WIDTH:"."+r.WIDTH,AVAILABLECOLORS:"."+r.AVAILABLECOLORS};v.namespace("M.atto_table").Button=v.Base.create("button",v.M.editor_atto.EditorPlugin,[],{_currentSelection:null,_contextMenu:null,_lastTarget:null,_menuOptions:null,initializer:function(){this.addButton({icon:"e/table",callback:this._displayTableEditor,tags:"table"}),v.UA.gecko&&(document.execCommand("enableInlineTableEditing",!1,!1),document.execCommand("enableObjectResizing",!1,!1))},_displayDialogue:function(){this._currentSelection=this.get("host").getSelection(),!1===this._currentSelection||this._currentSelection.collapsed||(this.getDialogue({headerContent:M.util.get_string("createtable",m),focusAfterHide:!0,focusOnShowSelector:O.CAPTION,width:f}).set("bodyContent",this._getDialogueContent(!1)).show(),this._updateAvailableSettings())},_displayTableEditor:function(e){var t=this._getSuitableTableCell();return t?(e.tableCell=t,this._showTableMenu(e)):this._displayDialogue(e)},_stopAtContentEditableFilter:function(e){return this.editor.contains(e)},_getDialogueContent:function(e){var t=v.Handlebars.compile( '
                          {{#if nonedit}}
                          {{/if}}{{#if allowStyling}}
                          {{get_string "appearance" component}}{{#if allowBorders}}
                          {{#each availableColours}}
                          {{/each}}
                          {{/if}}{{#if allowBackgroundColour}}
                          {{#each availableColours}}
                          {{/each}}
                          {{/if}}{{#if allowWidth}}
                          {{/if}}
                          {{/if}}

                          {{#if edit}}{{/if}}{{#if nonedit}}{{/if}}
                          ' -),o=this.get("allowBorders");return this._content=O.Node.create(t({CSS:l,elementid:this.get("host").get("elementid"),component:C,edit:e,nonedit:!e,allowStyling:this.get("allowStyling"),allowBorders:o,borderStyles:this.get("borderStyles"),allowBackgroundColour:this.get("allowBackgroundColour"),availableColours:this.get("availableColors"),allowWidth:this.get("allowWidth")})),e?this._content.one(".submit").on("click",this._updateTable,this):this._content.one(".submit").on("click",this._setTable,this),o&&this._content.one('[name="borders"]').on("change",this._updateAvailableSettings,this),this._content},_updateAvailableSettings:function(){var e=this._content,t=e.one('[name="borders"]'),o=e.one('[name="borderstyles"]'),a=e.one('[name="bordersize"]'),n=e.all('[name="borderColour"]'),r="removeAttribute";t&&("default"===t.get("value")&&(r="setAttribute"),o&&o[r]("disabled"),a&&a[r]("disabled"),n&&n[r]("disabled"))},_getSuitableTableCell:function(){var e,a=null,t=this.get("host"),n=O.bind(this._stopAtContentEditableFilter,this);return t.getSelectedNodes().some(function(e){var t,o;if(e.ancestor("td, th, caption",!0,n))return(t=(a=e).ancestor("caption",!0,n))&&(o=t.get("parentNode"))&&(a=o.one("td, th")),!0}),a&&(e=t.getSelectionFromNode(a),t.setSelection(e)),a},_changeNodeType:function(e,t){var o=O.Node.create("<"+t+">");return o.setAttrs(e.getAttrs()),e.get("childNodes").each(function(e){o.append(e.remove())}),e.replace(o),o},_updateTable:function(e){var t,o,a,n,r,l,i,s,d,c,u,g;e.preventDefault(),this.getDialogue({focusAfterHide:null}).hide(),t=e.currentTarget.ancestor(w.FORM).one(w.CAPTION),o=e.currentTarget.ancestor(w.FORM).one(w.CAPTIONPOSITION),a=e.currentTarget.ancestor(w.FORM).one(w.HEADERS),n=e.currentTarget.ancestor(w.FORM).one(w.BORDERS),r=e.currentTarget.ancestor(w.FORM).one(w.BORDERSIZE),i=e.currentTarget.ancestor(w.FORM).one(w.SELECTEDBORDERCOLOUR),l=e.currentTarget.ancestor(w.FORM).one(w.BORDERSTYLE),s=e.currentTarget.ancestor(w.FORM).one(w.SELECTEDBACKGROUNDCOLOUR),c=e.currentTarget.ancestor(w.FORM).one(w.WIDTH),d=this._lastTarget.ancestor("table"),this._setAppearance(d,{width:c,borders:n,borderColour:i,borderSize:r,borderStyle:l,backgroundColour:s}),(u=d.one("caption"))||(u=O.Node.create(""),d.insert(u,0)),u.setHTML(t.get("value")),u.setStyle("caption-side",o.get("value")),u.getAttribute("style")||u.removeAttribute("style"),"rows"!==a.get("value")&&"both"!==a.get("value")||d.all("tr").each(function(e){var t=e.all("th, td"),o=t.shift();"TD"===o.get("tagName")?this._changeNodeType(o,"th").setAttribute("scope","row"):o.setAttribute("scope","row"),t.each(function(e){"TH"===e.get("tagName")&&this._changeNodeType(e,"td").removeAttribute("scope")},this)},this),"columns"!==a.get("value")&&"both"!==a.get("value")||((g=d.all("tr")).shift().all("td, th").each(function(e){"TD"===e.get("tagName")?this._changeNodeType(e,"th").setAttribute("scope","col"):e.setAttribute("scope","col")},this),g.each(function(e){var t=e.all("th, td");"both"===a.get("value")&&t.shift(),t.each(function(e){"TH"===e.get("tagName")&&this._changeNodeType(e,"td").removeAttribute("scope")},this)},this)),this.markUpdated()},_setTable:function(e){var t,o,a,n,r,l,i,s,d,c,u,g,h,b,m,_,v,p;if(e.preventDefault(),this.getDialogue({focusAfterHide:null}).hide(),t=e.currentTarget.ancestor(w.FORM).one(w.CAPTION),o=e.currentTarget.ancestor(w.FORM).one(w.CAPTIONPOSITION),a=e.currentTarget.ancestor(w.FORM).one(w.BORDERS),n=e.currentTarget.ancestor(w.FORM).one(w.BORDERSIZE),l=e.currentTarget.ancestor(w.FORM).one(w.SELECTEDBORDERCOLOUR),r=e.currentTarget.ancestor(w.FORM).one(w.BORDERSTYLE),u=e.currentTarget.ancestor(w.FORM).one(w.SELECTEDBACKGROUNDCOLOUR),i=e.currentTarget.ancestor(w.FORM).one(w.ROWS),s=e.currentTarget.ancestor(w.FORM).one(w.COLUMNS),d=e.currentTarget.ancestor(w.FORM).one(w.HEADERS),g=e.currentTarget.ancestor(w.FORM).one(w.WIDTH),this.get("host").setSelection(this._currentSelection),c="
                          "+(m="\n")+''+m,v="",o.get("value")&&(v=' style="caption-side: '+o.get("value")+'"'),c+=""+O.Escape.html(t.get("value"))+""+m,h=0,"columns"===d.get("value")||"both"===d.get("value")){for(h=1,c+=""+m+""+m,b=0;b'+m;c+=""+m+""+m}for(c+=""+m;h"+m,b=0;b"+m:c+=''+m;c+=""+m}c+=""+m,c+="
                          "+m+"
                          ",this.get("host").insertContentAtFocusPoint(c),p=O.one("#"+_),this._setAppearance(p,{width:g,borders:a,borderColour:l,borderSize:n,borderStyle:r,backgroundColour:u}),p.removeAttribute("id"),this.markUpdated()},_findColumnCells:function(){var r=this._getColumnIndex(this._lastTarget),e=this._lastTarget.ancestor("table").all("tr"),l=new O.NodeList,i=new O.NodeList,s=new O.NodeList;return e.each(function(e){var t=e.all("td, th"),o=t.item(r),a=t.item(r-1),n=t.item(r+1);l.push(o),a&&i.push(a),n&&s.push(n)}),{current:l,prev:i,next:s}},_hideInvalidEntries:function(e){var t,o,a,n,r=this._lastTarget.ancestor("table"),l=this._lastTarget.ancestor("tr"),i=r.all("tr"),s=i.indexOf(l),d=i.item(s-1),c=d?d.one("td"):null;l&&c?e.one('[data-change="moverowup"]').show():e.one('[data-change="moverowup"]').hide(),t=i.item(s+1),o=!!l&&l.one("td"),l&&t&&o?e.one('[data-change="moverowdown"]').show():e.one('[data-change="moverowdown"]').hide(),0<(a=this._findColumnCells()).prev.filter("td").size()?e.one('[data-change="movecolumnleft"]').show():e.one('[data-change="movecolumnleft"]').hide(),n=0 "),1)},_removeCaption:function(){var e=this._lastTarget.ancestor("table").one("caption");e&&e.remove(!0)},_moveColumnRight:function(){var e,t,o,a=this._findColumnCells();if(0");e.replace(t),e=t}e.setHTML(" ")}),o.ancestor("thead")?(o=e,a.insert(t,o)):o.insert(t,"after"),this.markUpdated())},_addColumnAfter:function(){var e=this._findColumnCells(),o=!0,t=e.next;e.next.size()<=0&&(o=!1,t=e.current),O.each(t,function(e){var t=e.cloneNode();t.setHTML(" "),o?e.get("parentNode").insert(t,e):(e.get("parentNode").insert(t,e),e.swap(t))},this),this.markUpdated()}},{ATTRS:{allowBorders:{value:!0},borderStyles:{value:["none","solid","dashed","dotted"]},allowBackgroundColour:{value:!0},allowWidth:{value:!0},allowStyling:{readOnly:!0,getter:function(){return this.get("allowBorders")||this.get("allowBackgroundColour")||this.get("allowWidth")}},availableColors:{value:["#FFFFFF","#EF4540","#FFCF35","#98CA3E","#7D9FD3","#333333"],readOnly:!0}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin","moodle-editor_atto-menu","event","event-valuechange"]}); \ No newline at end of file +),o=this.get("allowBorders");return this._content=v.Node.create(t({CSS:r,elementid:this.get("host").get("elementid"),component:m,edit:e,nonedit:!e,allowStyling:this.get("allowStyling"),allowBorders:o,borderStyles:this.get("borderStyles"),allowBackgroundColour:this.get("allowBackgroundColour"),availableColours:this.get("availableColors"),allowWidth:this.get("allowWidth")})),e?this._content.one(".submit").on("click",this._updateTable,this):this._content.one(".submit").on("click",this._setTable,this),o&&this._content.one('[name="borders"]').on("change",this._updateAvailableSettings,this),this._content},_updateAvailableSettings:function(){var e=this._content,t=e.one('[name="borders"]'),o=e.one('[name="borderstyles"]'),a=e.one('[name="bordersize"]'),e=e.all('[name="borderColour"]'),n="removeAttribute";t&&("default"===t.get("value")&&(n="setAttribute"),o&&o[n]("disabled"),a&&a[n]("disabled"),e&&e[n]("disabled"))},_getSuitableTableCell:function(){var e,o=null,t=this.get("host"),a=v.bind(this._stopAtContentEditableFilter,this);return t.getSelectedNodes().some(function(e){var t;if(e.ancestor("td, th, caption",!0,a))return(e=(o=e).ancestor("caption",!0,a))&&(t=e.get("parentNode"))&&(o=t.one("td, th")),!0}),o&&(e=t.getSelectionFromNode(o),t.setSelection(e)),o},_changeNodeType:function(e,t){var o=v.Node.create("<"+t+">");return o.setAttrs(e.getAttrs()),e.get("childNodes").each(function(e){o.append(e.remove())}),e.replace(o),o},_updateTable:function(e){var t,o,a,n,l,r,i,s,d;e.preventDefault(),this.getDialogue({focusAfterHide:null}).hide(),t=e.currentTarget.ancestor(O.FORM).one(O.CAPTION),o=e.currentTarget.ancestor(O.FORM).one(O.CAPTIONPOSITION),a=e.currentTarget.ancestor(O.FORM).one(O.HEADERS),d=e.currentTarget.ancestor(O.FORM).one(O.BORDERS),n=e.currentTarget.ancestor(O.FORM).one(O.BORDERSIZE),r=e.currentTarget.ancestor(O.FORM).one(O.SELECTEDBORDERCOLOUR),l=e.currentTarget.ancestor(O.FORM).one(O.BORDERSTYLE),i=e.currentTarget.ancestor(O.FORM).one(O.SELECTEDBACKGROUNDCOLOUR),e=e.currentTarget.ancestor(O.FORM).one(O.WIDTH),s=this._lastTarget.ancestor("table"),this._setAppearance(s,{width:e,borders:d,borderColour:r,borderSize:n,borderStyle:l,backgroundColour:i}),(e=s.one("caption"))||(e=v.Node.create(""),s.insert(e,0)),e.setHTML(t.get("value")),e.setStyle("caption-side",o.get("value")),e.getAttribute("style")||e.removeAttribute("style"),"rows"!==a.get("value")&&"both"!==a.get("value")||s.all("tr").each(function(e){var e=e.all("th, td"),t=e.shift();("TD"===t.get("tagName")?this._changeNodeType(t,"th"):t).setAttribute("scope","row"),e.each(function(e){"TH"===e.get("tagName")&&this._changeNodeType(e,"td").removeAttribute("scope")},this)},this),"columns"!==a.get("value")&&"both"!==a.get("value")||((d=s.all("tr")).shift().all("td, th").each(function(e){("TD"===e.get("tagName")?this._changeNodeType(e,"th"):e).setAttribute("scope","col")},this),d.each(function(e){e=e.all("th, td");"both"===a.get("value")&&e.shift(),e.each(function(e){"TH"===e.get("tagName")&&this._changeNodeType(e,"td").removeAttribute("scope")},this)},this)),this.markUpdated()},_setTable:function(e){var t,c,u,g,h,b,o,a,n,m,l,r,i,_,s,d;if(e.preventDefault(),this.getDialogue({focusAfterHide:null}).hide(),t=e.currentTarget.ancestor(O.FORM).one(O.CAPTION),d=e.currentTarget.ancestor(O.FORM).one(O.CAPTIONPOSITION),c=e.currentTarget.ancestor(O.FORM).one(O.BORDERS),u=e.currentTarget.ancestor(O.FORM).one(O.BORDERSIZE),h=e.currentTarget.ancestor(O.FORM).one(O.SELECTEDBORDERCOLOUR),g=e.currentTarget.ancestor(O.FORM).one(O.BORDERSTYLE),m=e.currentTarget.ancestor(O.FORM).one(O.SELECTEDBACKGROUNDCOLOUR),b=e.currentTarget.ancestor(O.FORM).one(O.ROWS),o=e.currentTarget.ancestor(O.FORM).one(O.COLUMNS),a=e.currentTarget.ancestor(O.FORM).one(O.HEADERS),e=e.currentTarget.ancestor(O.FORM).one(O.WIDTH),this.get("host").setSelection(this._currentSelection),i="\n",n='
                          \n'+i,s="",n+=""+v.Escape.html(t.get("value"))+""+i,l=0,"columns"===a.get("value")||"both"===a.get("value")){for(l=1,n+="\n\n",r=0;r\n';n+="\n\n"}for(n+="\n";l\n",r=0;r\n":n+='\n';n+="\n"}n+="\n
                          \n
                          ",this.get("host").insertContentAtFocusPoint(n),d=v.one("#"+_),this._setAppearance(d,{width:e,borders:c,borderColour:h,borderSize:u,borderStyle:g,backgroundColour:m}),d.removeAttribute("id"),this.markUpdated()},_findColumnCells:function(){var a=this._getColumnIndex(this._lastTarget),e=this._lastTarget.ancestor("table").all("tr"),n=new v.NodeList,l=new v.NodeList,r=new v.NodeList;return e.each(function(e){var e=e.all("td, th"),t=e.item(a),o=e.item(a-1),e=e.item(a+1);n.push(t),o&&l.push(o),e&&r.push(e)}),{current:n,prev:l,next:r}},_hideInvalidEntries:function(e){var t=this._lastTarget.ancestor("table"),o=this._lastTarget.ancestor("tr"),t=t.all("tr"),a=t.indexOf(o),n=t.item(a-1),n=n?n.one("td"):null;o&&n?e.one('[data-change="moverowup"]').show():e.one('[data-change="moverowup"]').hide(),n=t.item(a+1),a=!!o&&o.one("td"),o&&n&&a?e.one('[data-change="moverowdown"]').show():e.one('[data-change="moverowdown"]').hide(),0<(t=this._findColumnCells()).prev.filter("td").size()?e.one('[data-change="movecolumnleft"]').show():e.one('[data-change="movecolumnleft"]').hide(),n=0 "),1)},_removeCaption:function(){var e=this._lastTarget.ancestor("table").one("caption");e&&e.remove(!0)},_moveColumnRight:function(){var e,t,o,a=this._findColumnCells();if(0"),e.replace(t),e=t),e.setHTML(" ")}),t.ancestor("thead")?(t=a,o.insert(e,t)):t.insert(e,"after"),this.markUpdated())},_addColumnAfter:function(){var e=this._findColumnCells(),o=!0,t=e.next;e.next.size()<=0&&(o=!1,t=e.current),v.each(t,function(e){var t=e.cloneNode();t.setHTML(" "),o?e.get("parentNode").insert(t,e):(e.get("parentNode").insert(t,e),e.swap(t))},this),this.markUpdated()}},{ATTRS:{allowBorders:{value:!0},borderStyles:{value:["none","solid","dashed","dotted"]},allowBackgroundColour:{value:!0},allowWidth:{value:!0},allowStyling:{readOnly:!0,getter:function(){return this.get("allowBorders")||this.get("allowBackgroundColour")||this.get("allowWidth")}},availableColors:{value:["#FFFFFF","#EF4540","#FFCF35","#98CA3E","#7D9FD3","#333333"],readOnly:!0}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin","moodle-editor_atto-menu","event","event-valuechange"]}); \ No newline at end of file diff --git a/lib/editor/atto/plugins/undo/yui/build/moodle-atto_undo-button/moodle-atto_undo-button-min.js b/lib/editor/atto/plugins/undo/yui/build/moodle-atto_undo-button/moodle-atto_undo-button-min.js index 703182100eb..b78787e0582 100644 --- a/lib/editor/atto/plugins/undo/yui/build/moodle-atto_undo-button/moodle-atto_undo-button-min.js +++ b/lib/editor/atto/plugins/undo/yui/build/moodle-atto_undo-button/moodle-atto_undo-button-min.js @@ -1 +1 @@ -YUI.add("moodle-atto_undo-button",function(t,e){t.namespace("M.atto_undo").Button=t.Base.create("button",t.M.editor_atto.EditorPlugin,[],{_maxUndos:40,_undoStack:null,_redoStack:null,initializer:function(){this._undoStack=[],this._redoStack=[],this.addButton({title:"undo",icon:"e/undo",callback:this._undoHandler,buttonName:"undo",keys:90}),this.addButton({title:"redo",icon:"e/redo",callback:this._redoHandler,buttonName:"redo",keys:89}),this.get("host").on("pluginsloaded",function(){this._addToUndo(this._getHTML()),this.get("host").on("atto:selectionchanged",this._changeListener,this)},this),this._updateButtonsStates()},_addToRedo:function(t){this._redoStack.push(t)},_addToUndo:function(t,e){for(void 0===e&&(e=!1),this._undoStack[this._undoStack.length-1]!==t&&(this._undoStack.push(t),e&&(this._redoStack=[]));this._undoStack.length>this._maxUndos;)this._undoStack.shift()},_getHTML:function(){return this.get("host").getCleanHTML()},_getRedo:function(){return this._redoStack.pop()},_getUndo:function(t){if(1===this._undoStack.length)return this._undoStack[0];var e=this._undoStack.pop();return e===t&&(e=this._undoStack.pop()),0===this._undoStack.length&&this._addToUndo(e),e},_restoreValue:function(t){this.editor.setHTML(t),this._addToUndo(t)},_updateButtonsStates:function(){1this._maxUndos;)this._undoStack.shift()},_getHTML:function(){return this.get("host").getCleanHTML()},_getRedo:function(){return this._redoStack.pop()},_getUndo:function(t){if(1===this._undoStack.length)return this._undoStack[0];var e=this._undoStack.pop();return e===t&&(e=this._undoStack.pop()),0===this._undoStack.length&&this._addToUndo(e),e},_restoreValue:function(t){this.editor.setHTML(t),this._addToUndo(t)},_updateButtonsStates:function(){1'),t=u.Handlebars.compile('
                          '),this.editor=u.Node.create(t({elementid:this.get("elementid"),CSS:a})),this.textareaLabel=u.one('[for="'+this.get("elementid")+'"]'),this.textareaLabel&&(this.textareaLabel.generateID(),this.editor.setAttribute("aria-labelledby",this.textareaLabel.get("id"))),this.coreDirection=u.one("body").hasClass("dir-rtl")?"rtl":"ltr",this.setupToolbar(),(i=u.Node.create('
                          ')).appendChild(this.editor),this._wrapper.appendChild(i),this.editor.setStyle("minHeight",20*this.textarea.getAttribute("rows")+8+"px"),0===u.UA.ie&&this.editor.setStyle("height",20*this.textarea.getAttribute("rows")+8+"px"),this.disableCssStyling(),document.queryCommandSupported("DefaultParagraphSeparator")&&document.execCommand("DefaultParagraphSeparator",!1,"p"),this.textarea.get("parentNode").insert(this._wrapper,this.textarea).setAttribute("class","editor_atto_wrap"),this.textarea.hide(),u.mix(u.Node.DOM_EVENTS,{"form:editorUpdated":!0}),this.textarea.on("form:editorUpdated",function(){this.updateEditorState()},this),this.updateFromTextArea(),this.publishEvents(),this.setupSelectionWatchers(),this.setupAutomaticPolling(),this.setupPlugins(),this.setupAutosave(),this.setupNotifications())},focus:function(){return this.editor.focus(),this},publishEvents:function(){return this.publish("change",{broadcast:!0,preventable:!0}),this.publish("pluginsloaded",{fireOnce:!0}),this.publish("atto:selectionchanged",{prefix:"atto"}),this},setupAutomaticPolling:function(){return this._registerEventHandle(this.editor.on(["keyup","cut"],this.updateOriginal,this)),this._registerEventHandle(this.editor.on("paste",this.pasteCleanup,this)),this._registerEventHandle(this.editor.on("drop",this.updateOriginalDelayed,this)),this},updateOriginalDelayed:function(){return u.soon(u.bind(this.updateOriginal,this)),this},setupPlugins:function(){var t,e,i,n,s,a;for(e in this.plugins={},t=this.get("plugins"))if((i=t[e]).plugins)for(n in i.plugins)s=i.plugins[n],a=u.mix({name:s.name,group:i.group,editor:this.editor,toolbar:this.toolbar,host:this},s),"undefined"!=typeof u.M["atto_"+s.name]&&(this.plugins[s.name]=new u.M["atto_"+s.name].Button(a));return this.fire("pluginsloaded"),this},enablePlugins:function(t){this._setPluginState(!0,t)},disablePlugins:function(t){this._setPluginState(!1,t)},_setPluginState:function(t,e){var i="disableButtons";t&&(i="enableButtons"),e?this.plugins[e][i]():u.Object.each(this.plugins,function(t){t[i]()},this)},updateEditorState:function(){var t=this.textarea.hasAttribute("readonly"),e=u.one("#"+this.get("elementid")+"editable");this._setPluginState(!t),e&&e.setAttribute("contenteditable",!t)},_registerEventHandle:function(t){this._eventHandles.push(t)}},{NS:"editor_atto",ATTRS:{elementid:{value:null,writeOnce:!0},contextid:{value:null,writeOnce:!0},plugins:{value:{},writeOnce:!0}}}),u.augment(e,u.EventTarget),u.namespace("M.editor_atto").Editor=e,u.namespace("M.editor_atto.Editor").init=function(t){return new u.M.editor_atto.Editor(t)},o="info",r="warning",i.ATTRS={},i.prototype={messageOverlay:null,hideTimer:null,setupNotifications:function(){var t=new Image,e=new Image;return t.src=M.util.image_url("i/warning","moodle"),e.src=M.util.image_url("i/info","moodle"),this},showMessage:function(t,e,i){var n,s,a="";return null===this.messageOverlay&&(this.messageOverlay=u.Node.create('
                          '),this.messageOverlay.hide(!0),this.textarea.get("parentNode").append(this.messageOverlay),this.messageOverlay.on("click",function(){this.messageOverlay.hide(!0)},this)),null!==this.hideTimer&&this.hideTimer.cancel(),e===r?a=''+M.util.get_string(':e===o&&(a=''+M.util.get_string('),(n=parseInt(i,10))<=0&&(n=6e4),e="atto_"+e,s=u.Node.create('"),this.messageOverlay.empty(),this.messageOverlay.append(s),this.messageOverlay.show(!0),this.hideTimer=u.later(n,this,function(){this.hideTimer=null,this.messageOverlay.inDoc()&&this.messageOverlay.hide(!0)}),this}},u.Base.mix(u.M.editor_atto.Editor,[i]),h.ATTRS={},h.prototype={_getEmptyContent:function(){var t;return t="rtl"===this.coreDirection?'style="text-align: right;"':'style="text-align: left;"',u.UA.ie&&u.UA.ie<10?'

                          ":'


                          "},updateFromTextArea:function(){return this.editor.setHTML("" -),this.editor.append(this._cleanHTML(this.textarea.get("value"),!0)),""===this.editor.getHTML()&&this.editor.setHTML(this._getEmptyContent()),this},updateOriginal:function(){var t=this.textarea.get("value"),e=this.getCleanHTML();return""===e&&this.isActive()&&(e=this._getEmptyContent()),t!==e&&(this.textarea.set("value",e),this.textarea.simulate("change"),this.fire("change")),this}},u.Base.mix(u.M.editor_atto.Editor,[h]),n=5e3,l=6e4,d.ATTRS={autosaveEnabled:{value:!0,writeOnce:!0},autosaveFrequency:{value:60,writeOnce:!0},pageHash:{value:"",writeOnce:!0}},d.prototype={lastText:"",autosaveInstance:null,autosaveTimer:null,setupAutosave:function(){var t,e,i,n=-1,s=null,a=this.get("filepickeroptions");if(this.get("autosaveEnabled")){for(s in this.autosaveInstance=u.stamp(this),a)"undefined"!=typeof a[s].itemid&&(n=a[s].itemid);return e={contextid:this.get("contextid"),action:"resume",draftid:n,elementid:this.get("elementid"),pageinstance:this.autosaveInstance,pagehash:this.get("pageHash")},this.autosaveIo(e,this,{success:function(t){if(null!==t&&t){["

                          ","


                          ","
                          ",'

                          ','


                          ','

                          ','


                          ',"

                           

                          ","


                           

                          ",'

                           

                          ','


                           

                          ','

                           

                          ','


                           

                          '].includes(t.result)&&(t.result=""),t.error||"undefined"==typeof t.result?this.showMessage(M.util.get_string("errortextrecovery","editor_atto"),r,l):t.result!==this.textarea.get("value")&&""!==t.result&&this.recoverText(t.result),this._fireSelectionChanged()}},failure:function(){this.showMessage(M.util.get_string("errortextrecovery","editor_atto"),r,l)}}),i=1e3*parseInt(this.get("autosaveFrequency"),10),this.autosaveTimer=u.later(i,this,this.saveDraft,!1,!0),(t=this.textarea.ancestor("form"))&&this.autosaveIoOnSubmit(t,{action:"reset",contextid:this.get("contextid"),elementid:this.get("elementid"),pageinstance:this.autosaveInstance,pagehash:this.get("pageHash")}),this}},recoverText:function(t){return this.editor.setHTML(t),this.saveSelection(),this.updateOriginal(),this.lastText=t,this.showMessage(M.util.get_string("textrecovered","editor_atto"),o,l),require(["core/event"],function(t){t.notifyEditorContentRestored()}),this},saveDraft:function(){var t,e,i;if(this.editor.getDOMNode())return this.editor.get("hidden")||this.updateOriginal(),(e=this.textarea.get("value"))!==this.lastText&&(M.cfg.wwwroot,this.get("autosaveAjaxScript"),t={sesskey:M.cfg.sesskey,contextid:this.get("contextid"),action:"save",drafttext:e,elementid:this.get("elementid"),pagehash:this.get("pageHash"),pageinstance:this.autosaveInstance},i=function(t){var e=1e3*parseInt(this.get("autosaveFrequency"),10);this.showMessage(M.util.get_string("autosavefailed","editor_atto"),r,e)},this.autosaveIo(t,this,{failure:i,success:function(t){t&&t.error?u.soon(u.bind(i,this,[t])):(this.lastText=e,this.showMessage(M.util.get_string("autosavesucceeded","editor_atto"),o,n))}})),this;this.autosaveTimer.cancel()}},u.Base.mix(u.M.editor_atto.Editor,[d]),s=null,g.NAME="EditorAutosaveIoDispatcher",g.ATTRS={autosaveAjaxScript:{value:"/lib/editor/atto/autosave-ajax.php",readOnly:!0},delay:{value:50,readOnly:!0}},u.extend(g,u.Base,{dispatch:function(t,e,i){this._throttle&&this._throttle.cancel(),this._throttle=u.later(this.get("delay"),this,this._processDispatchQueue),this._queue.push([t,e,i])},_processDispatchQueue:function(){var t=this._queue,i={};this._queue=[],t.length<1||(u.Array.each(t,function(t,e){i[e]=t[0]}),u.io(M.cfg.wwwroot+this.get("autosaveAjaxScript"),{method:"POST",data:u.QueryString.stringify({actions:i,sesskey:M.cfg.sesskey}),on:{start:this._makeIoEventCallback("start",t),complete:this._makeIoEventCallback("complete",t),failure:this._makeIoEventCallback("failure",t),end:this._makeIoEventCallback("end",t),success:this._makeIoEventCallback("success",t)}}))},_makeIoEventCallback:function(o,e){var r=function(){};return function(){var t=arguments[1],a={};"complete"!=o&&"success"!=o||void 0===t||"undefined"==typeof t.responseText||""===t.responseText||(a=JSON.parse(t.responseText)||{}),u.Array.each(e,function(t,e){var i,n=t[1],s=t[2]&&t[2][o]||r;a&&a.error?i=a:a&&(i=a[e]),s.apply(n,[i])})}},_onSubmit:function(t){var i={},e=t.currentTarget.generateID(),n=this._submitEvents[e];!n||n.ios.length<1||(u.Array.each(n.ios,function(t,e){i[e]=t}),u.io(M.cfg.wwwroot+this.get("autosaveAjaxScript"),{method:"POST",data:u.QueryString.stringify({actions:i,sesskey:M.cfg.sesskey}),sync:!0}))},whenSubmit:function(t,e){"undefined"==typeof this._submitEvents[t.generateID()]&&(this._submitEvents[t.generateID()]={event:t.on("submit",this._onSubmit,this),ajaxEvent:t.on(M.core.event.FORM_SUBMIT_AJAX,this._onSubmit,this),ios:[]}),this._submitEvents[t.get("id")].ios.push([e])}}),s=new g,p.prototype={autosaveIo:function(t,e,i){s.dispatch(t,e,i)},autosaveIoOnSubmit:function(t,e){s.whenSubmit(t,e)}},u.Base.mix(u.M.editor_atto.Editor,[p]),f.ATTRS={},f.prototype={getCleanHTML:function(){var t,e=this.editor.cloneNode(!0);return u.each(e.all('[id^="yui"]'),function(t){t.removeAttribute("id")}),e.all(".atto_control").remove(!0),t=e.get("innerHTML"),["

                          ","


                          ","
                          ",'

                          ','


                          ','

                          ','


                          ',"

                           

                          ","


                           

                          ",'

                           

                          ','


                           

                          ','

                           

                          ','


                           

                          '].includes(t)?"":this._cleanHTML(t)},cleanEditorHTML:function(){var t=this.editor.get("innerHTML");return this.editor.set("innerHTML", -this._cleanHTML(t)),this},_cleanHTML:function(t,e){return t=this._filterContentWithRules(t,[{regex:/]*>[\s\S]*?<\/style>/gi,replace:""},{regex:/)/gi,replace:""},{regex:/<\/?(?:title|meta|style|st\d|head\b|font|html|body|link)[^>]*?>/gi,replace:""}]),e&&(t=this._cleanHTMLLists(t)),t},_filterContentWithRules:function(t,e){var i=0;for(i=0;i([\s\S]+)$/gi,replace:""},{regex://gi,replace:""},{regex://gi,replace:""},{regex:/]*>[\s\S]*?<\/xml>/gi,replace:""},{regex:/<\?xml[^>]*>[\s\S]*?<\\\?xml>/gi,replace:""},{regex:/<\/?\w+:[^>]*>/gi,replace:""}],t=this._filterContentWithRules(t,e),0!==(t=this._cleanHTML(t)).length&&t.match(/\S/)?((i=document.createElement("div")).innerHTML=t,t=i.innerHTML,e=[{regex:/(<[^>]*?class\s*?=\s*?")([^>"]*)(")/gi,replace:function(t,e,i,n){return e+(i=(i=i.replace(/(?:^|[\s])[\s]*MSO[_a-zA-Z0-9\-]*/gi,"")).replace(/(?:^|[\s])[\s]*Apple-[_a-zA-Z0-9\-]*/gi,""))+n}},{regex:/]*?name\s*?=\s*?"OLE_LINK\d*?"[^>]*?>\s*?<\/a>/gi,replace:i.innerHTML=""}],t=this._cleanStyles(t),t=this._filterContentWithRules(t,e),t=this._cleanHTML(t),t=this._cleanSpans(t)):t):""},_cleanStyles:function(t){var e,i,n,s=document.createElement("div");for(s.innerHTML=t,e=s.querySelectorAll("[style]"),i=i=0;i]*?)(?:[\s]*(?:class|style|id)\s*?=\s*?"\s*?")+/gi,replace:"$1"}],t=this._filterContentWithRules(t,e),(i=document.createElement("div")).innerHTML=t,n=i.getElementsByTagName("span"),Array.prototype.slice.call(n,0).forEach(function(t){if(!t.hasAttributes()){for(;t.firstChild;)t.parentNode.insertBefore(t.firstChild,t);t.parentNode.removeChild(t)}}),i.innerHTML):t:""},_cleanHTMLLists:function(t){for(var e,i="",n=t,s=null,a=[],o=null,r=null;s=n.match(/<(\/?)(li|ul|ol)[^>]*>/i);){if(o={tag:s[2],tagLowerCase:s[2].toLowerCase(),fullTag:s[0],isOpen:1!=s[1].length},r=a.length?a[a.length-1]:null,i+=n.slice(0,s.index),n=n.slice(s.index+s[0].length),o.isOpen){if("li"===o.tagLowerCase){if(!r){if(e=(n.match(/<\/(ol)[ >]/gi)||[]).length,(n.match(/<(ol)[ >]/gi)||[]).length"+o.fullTag+n;continue}n="
                            "+o.fullTag+n;continue}if("li"===r.tagLowerCase){n=""+o.fullTag+n;continue}}a.push({tag:o.tag,tagLowerCase:o.tagLowerCase,position:i.length,length:o.fullTag.length})}else{if(0==a.length)continue;if(r.tagLowerCase===o.tagLowerCase)o.tag!=r.tag&&(o.fullTag=o.fullTag.replace(o.tag,r.tag)),a.pop(),r=a.length?a[a.length-1]:null;else if("li"===o.tagLowerCase&&r.liEnd&&r.liEnd",r.liEnd);else{if("li"!==o.tagLowerCase||r.liEnd||!(r.position+r.length"+o.fullTag+n;continue}i=this._insertString(i,"<"+o.tag+">",r.position+r.length)}"li"===o.tagLowerCase&&r&&(r.liEnd=i.length+o.fullTag.length)}i+=o.fullTag}if(i+=n,a.length)for(;o=a.pop();)i=o.liEnd?this._insertString(i,"",o.liEnd):i.slice(0,o.position)+i.slice(o.position+o.length);return i},_insertString:function(t,e,i){return t.slice(0,i)+e+t.slice(i)}},u.Base.mix(u.M.editor_atto.Editor,[f]),m.ATTRS={},m.prototype={applyFormat:function(t,e,i,n){var s,a;if(i=i||this,(s=window.rangy.getSelection()).isCollapsed)return a=this.editor.once("input",function o(t,e,i,n,s,a){u.soon(u.bind(function(t,e,i,n,s,a){var o=window.rangy.getSelection(),r=o.getRangeAt(0);r.setStart(s,a),o.setSingleRange(r),e.apply(i,[t,n]),o.collapseToEnd(),this.saveSelection(),this.updateOriginal()},this,t,e,i,n,s,a))},this,e,i,n,s.anchorNode,s.anchorOffset),void this.editor.onceAfter(["click","selectstart"],a.detach,a);e.apply(i,[t,n]),this.saveSelection(),this.updateOriginal()},replaceTags:function(t,e){var i,n,s,a;for(t.setAttribute("data-iterate",!0),i=this.editor.one('[data-iterate="true"]');i;){for(n=u.Node.create("<"+e+" />").setAttrs(i.getAttrs()).removeAttribute("data-iterate"),i.getAttribute("style")&&n.setAttribute("style",i.getAttribute("style")),i.getAttribute("class")&&n.setAttribute("class",i.getAttribute("class")),a=(s=i.getDOMNode().childNodes)[0];void 0!==a;)n.append(a),a=s[0];i.replace(n),i=this.editor.one( -'[data-iterate="true"]')}},changeToCSS:function(t,e){var i=window.rangy.saveSelection();this.editor.all(".rangySelectionBoundary").setStyle("display",null),this.editor.all(t).addClass(e),this.replaceTags(this.editor.all("."+e),"span"),window.rangy.restoreSelection(i)},changeToTags:function(e,i){var t=window.rangy.saveSelection();this.editor.all(".rangySelectionBoundary").setStyle("display",null),this.replaceTags(this.editor.all('span[class="'+e+'"]'),i),this.editor.all(i+'[class="'+e+'"]').removeAttribute("class"),this.editor.all("."+e).each(function(t){t.wrap("<"+i+"/>"),t.removeClass(e)}),this.editor.all('[class="'+e+'"]').removeAttribute("class"),this.editor.all(i).removeClass(e),window.rangy.restoreSelection(t)}},u.Base.mix(u.M.editor_atto.Editor,[m]),v.ATTRS={},v.prototype={toolbar:null,openMenus:null,setupToolbar:function(){return this.toolbar=u.Node.create(''),id:"dateselector-calendar-panel",constrain:!0}),this.panel.render(document.body),t=0,o.all(" [role=dialog], [role=menubar], .moodle-has-zindex").each(function(e){e=this.findZIndex(e);t')).setHTML(e.getHTML()),t.setAttribute("class",e.getAttribute("class")),t.setAttribute("role","button"),s=[],a.all(l).each(function(e){s[s.length]=e.generateID()}),t.setAttribute("aria-controls",s.join(" ")),t.on("click",this.set_state_all,this,!0),t.on("key",this.set_state_all,"down:enter,32",this,!0),e.replace(t),this.update_btns(a)))},process_fieldset:function(e){var t=e.one(d),s=r.Node.create('');return s.addClass(h),s.appendChild(t.get("firstChild")),s.setAttribute("role","button"),s.setAttribute("aria-controls",e.generateID()),t.ancestor(a)?s.setAttribute("aria-expanded","false"):s.setAttribute("aria-expanded","true"),t.prepend(s),this},set_state:function(e,t){var s,a=e.one(n);return t?(e.addClass(f),a&&a.setAttribute("aria-expanded","false")):(e.removeClass(f),a&&a.setAttribute("aria-expanded","true")),(s=this.form.one("input[name=mform_isexpanded_"+e.get("id")+"]"))&&s.set("value",t?0:1),this},set_state_all:function(e){e.preventDefault();var t=e.target.hasClass(c);this.form.all(i).each(function(e){this.set_state(e,t)},this),this.update_btns()},switch_state:function(e){e.preventDefault();var t=e.target.ancestor(i);this.set_state(t,!t.hasClass(f)),this.update_btns()},update_btns:function(){var e,t=0,s=!1;return(e=this.form.one(o))&&(this.form.all(i).each(function(e){e.hasClass(f)&&t++}),0!==t&&(s=!0),s?(e.removeClass(c),e.setHTML(M.util.get_string("expandall","moodle"))):(e.addClass(c),e.setHTML(M.util.get_string("collapseall","moodle")))),this},expand_fieldset:function(e){var t;e.stopPropagation(),e.formid===this.form.getAttribute("id")&&(t=r.one("#"+e.elementid).ancestor("fieldset"))&&this.set_state(t,!1)}},{NAME:"moodle-form-shortforms",ATTRS:s}),M.form=M.form||{},M.form.shortforms=M.form.shortforms||function(e){return new t(e)}},"@VERSION@",{requires:["node","base","selector-css3","moodle-core-event"]}); \ No newline at end of file +YUI.add("moodle-form-shortforms",function(r,e){function t(){t.superclass.constructor.apply(this,arguments)}var o=".collapsible-actions .collapseexpand",a=".collapsed",i="fieldset.collapsible",l="fieldset.collapsible .fheader",n=".fheader",d="legend.ftoggler",c="collapse-all",f="collapsed",h="fheader",s={formid:{value:null}};r.extend(t,r.Base,{form:null,initializer:function(){var e,t,s,a=r.one("#"+this.get("formid"));a&&((this.form=a).all(i).each(this.process_fieldset,this),a.delegate("click",this.switch_state,l,this),a.delegate("key",this.switch_state,"down:enter,32",l,this),r.Global.on(M.core.globalEvents.FORM_ERROR,this.expand_fieldset,this),(e=a.one(o))&&((t=r.Node.create('')).setHTML(e.getHTML()),t.setAttribute("class",e.getAttribute("class")),t.setAttribute("role","button"),s=[],a.all(l).each(function(e){s[s.length]=e.generateID()}),t.setAttribute("aria-controls",s.join(" ")),t.on("click",this.set_state_all,this,!0),t.on("key",this.set_state_all,"down:enter,32",this,!0),e.replace(t),this.update_btns(a)))},process_fieldset:function(e){var t=e.one(d),s=r.Node.create('');return s.addClass(h),s.appendChild(t.get("firstChild")),s.setAttribute("role","button"),s.setAttribute("aria-controls",e.generateID()),t.ancestor(a)?s.setAttribute("aria-expanded","false"):s.setAttribute("aria-expanded","true"),t.prepend(s),this},set_state:function(e,t){var s=e.one(n);return t?(e.addClass(f),s&&s.setAttribute("aria-expanded","false")):(e.removeClass(f),s&&s.setAttribute("aria-expanded","true")),(s=this.form.one("input[name=mform_isexpanded_"+e.get("id")+"]"))&&s.set("value",t?0:1),this},set_state_all:function(e){e.preventDefault();var t=e.target.hasClass(c);this.form.all(i).each(function(e){this.set_state(e,t)},this),this.update_btns()},switch_state:function(e){e.preventDefault();e=e.target.ancestor(i);this.set_state(e,!e.hasClass(f)),this.update_btns()},update_btns:function(){var t=0,e=!1,s=this.form.one(o);return s&&(this.form.all(i).each(function(e){e.hasClass(f)&&t++}),(e=0!==t?!0:e)?(s.removeClass(c),s.setHTML(M.util.get_string("expandall","moodle"))):(s.addClass(c),s.setHTML(M.util.get_string("collapseall","moodle")))),this},expand_fieldset:function(e){var t;e.stopPropagation(),e.formid===this.form.getAttribute("id")&&(t=r.one("#"+e.elementid).ancestor("fieldset"))&&this.set_state(t,!1)}},{NAME:"moodle-form-shortforms",ATTRS:s}),M.form=M.form||{},M.form.shortforms=M.form.shortforms||function(e){return new t(e)}},"@VERSION@",{requires:["node","base","selector-css3","moodle-core-event"]}); \ No newline at end of file diff --git a/lib/table/amd/build/dynamic.min.js b/lib/table/amd/build/dynamic.min.js index 2b10d71505c..7f3ec1bec18 100644 --- a/lib/table/amd/build/dynamic.min.js +++ b/lib/table/amd/build/dynamic.min.js @@ -1,2 +1,2 @@ -function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}define ("core_table/dynamic",["exports","core_table/local/dynamic/selectors","./local/dynamic/events","core/pending","core/loadingicon","core_table/local/dynamic/repository","core/notification"],function(a,b,c,d,e,f,g){"use strict";Object.defineProperty(a,"__esModule",{value:!0});Object.defineProperty(a,"Events",{enumerable:!0,get:function get(){return c.default}});a.getTableFromId=a.init=a.showColumn=a.hideColumn=a.getLastInitial=a.setLastInitial=a.getFirstInitial=a.setFirstInitial=a.getPageSize=a.setPageSize=a.getPageNumber=a.setPageNumber=a.setSortOrder=a.getFilters=a.setFilters=a.updateTable=a.refreshTableContent=void 0;b=j(b);c=h(c);d=h(d);g=h(g);function h(a){return a&&a.__esModule?a:{default:a}}function i(){if("function"!=typeof WeakMap)return null;var a=new WeakMap;i=function(){return a};return a}function j(a){if(a&&a.__esModule){return a}if(null===a||"object"!==_typeof(a)&&"function"!=typeof a){return{default:a}}var b=i();if(b&&b.has(a)){return b.get(a)}var c={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var e in a){if(Object.prototype.hasOwnProperty.call(a,e)){var f=d?Object.getOwnPropertyDescriptor(a,e):null;if(f&&(f.get||f.set)){Object.defineProperty(c,e,f)}else{c[e]=a[e]}}}c.default=a;if(b){b.set(a,c)}return c}function k(a){return o(a)||n(a)||m(a)||l()}function l(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function m(a,b){if(!a)return;if("string"==typeof a)return p(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);if("Object"===c&&a.constructor)c=a.constructor.name;if("Map"===c||"Set"===c)return Array.from(c);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return p(a,b)}function n(a){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(a))return Array.from(a)}function o(a){if(Array.isArray(a))return p(a)}function p(a,b){if(null==b||b>a.length)b=a.length;for(var c=0,d=Array(b);ca.length)b=a.length;for(var c=0,d=Array(b);c.\n\n/**\n * Module to handle dynamic table features.\n *\n * @module core_table/dynamic\n * @package core_table\n * @copyright 2020 Simey Lameze \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport * as Selectors from 'core_table/local/dynamic/selectors';\nimport Events from './local/dynamic/events';\nimport Pending from 'core/pending';\nimport {addIconToContainer} from 'core/loadingicon';\nimport {fetch as fetchTableData} from 'core_table/local/dynamic/repository';\nimport Notification from 'core/notification';\n\nlet watching = false;\n\n/**\n * Ensure that a table is a dynamic table.\n *\n * @param {HTMLElement} tableRoot\n * @returns {Bool}\n */\nconst checkTableIsDynamic = tableRoot => {\n if (!tableRoot) {\n // The table is not a dynamic table.\n throw new Error(\"The table specified is not a dynamic table and cannot be updated\");\n }\n\n if (!tableRoot.matches(Selectors.main.region)) {\n // The table is not a dynamic table.\n throw new Error(\"The table specified is not a dynamic table and cannot be updated\");\n }\n\n return true;\n};\n\n/**\n * Get the filterset data from a known dynamic table.\n *\n * @param {HTMLElement} tableRoot\n * @returns {Object}\n */\nconst getFiltersetFromTable = tableRoot => {\n return JSON.parse(tableRoot.dataset.tableFilters);\n};\n\n/**\n * Update the specified table based on its current values.\n *\n * @param {HTMLElement} tableRoot\n * @param {Bool} resetContent\n * @returns {Promise}\n */\nexport const refreshTableContent = (tableRoot, resetContent = false) => {\n const filterset = getFiltersetFromTable(tableRoot);\n addIconToContainer(tableRoot);\n\n const pendingPromise = new Pending('core_table/dynamic:refreshTableContent');\n\n return fetchTableData(\n tableRoot.dataset.tableComponent,\n tableRoot.dataset.tableHandler,\n tableRoot.dataset.tableUniqueid,\n {\n sortData: JSON.parse(tableRoot.dataset.tableSortData),\n joinType: filterset.jointype,\n filters: filterset.filters,\n firstinitial: tableRoot.dataset.tableFirstInitial,\n lastinitial: tableRoot.dataset.tableLastInitial,\n pageNumber: tableRoot.dataset.tablePageNumber,\n pageSize: tableRoot.dataset.tablePageSize,\n hiddenColumns: JSON.parse(tableRoot.dataset.tableHiddenColumns),\n },\n resetContent,\n )\n .then(data => {\n const placeholder = document.createElement('div');\n placeholder.innerHTML = data.html;\n tableRoot.replaceWith(...placeholder.childNodes);\n\n // Update the tableRoot.\n return getTableFromId(tableRoot.dataset.tableUniqueid);\n }).then(tableRoot => {\n tableRoot.dispatchEvent(new CustomEvent(Events.tableContentRefreshed, {\n bubbles: true,\n }));\n\n return tableRoot;\n })\n .then(tableRoot => {\n pendingPromise.resolve();\n\n return tableRoot;\n });\n};\n\nexport const updateTable = (tableRoot, {\n sortBy = null,\n sortOrder = null,\n filters = null,\n firstInitial = null,\n lastInitial = null,\n pageNumber = null,\n pageSize = null,\n hiddenColumns = null,\n} = {}, refreshContent = true) => {\n checkTableIsDynamic(tableRoot);\n\n const pendingPromise = new Pending('core_table/dynamic:updateTable');\n let tableConfigChanged = false;\n\n // Update sort fields.\n if (sortBy && sortOrder) {\n // Always update the table if requested and there were sort fields.\n // These fields are only ever normalised in the backend.\n tableConfigChanged = true;\n\n const sortData = JSON.parse(tableRoot.dataset.tableSortData);\n sortData.unshift({\n sortby: sortBy,\n sortorder: parseInt(sortOrder, 10),\n });\n tableRoot.dataset.tableSortData = JSON.stringify(sortData);\n }\n\n // Update initials.\n if (firstInitial !== null) {\n if (tableRoot.dataset.tableFirstInitial !== firstInitial) {\n tableConfigChanged = true;\n }\n\n tableRoot.dataset.tableFirstInitial = firstInitial;\n }\n\n if (lastInitial !== null) {\n if (tableRoot.dataset.tableLastInitial !== lastInitial) {\n tableConfigChanged = true;\n }\n\n tableRoot.dataset.tableLastInitial = lastInitial;\n }\n\n if (pageSize !== null) {\n if (tableRoot.dataset.tablePageSize != pageSize) {\n tableConfigChanged = true;\n }\n\n tableRoot.dataset.tablePageSize = pageSize;\n }\n\n // Update filters.\n if (filters) {\n const filterJson = JSON.stringify(filters);\n\n if (tableRoot.dataset.tableFilters !== filterJson) {\n tableConfigChanged = true;\n }\n\n tableRoot.dataset.tableFilters = filterJson;\n }\n\n // Reset to page 1 when table content is being altered by filtering or sorting.\n // This ensures the table page being loaded always exists, and gives a consistent experience.\n if (tableConfigChanged) {\n pageNumber = 1;\n }\n\n // Update hidden columns.\n if (hiddenColumns) {\n const columnJson = JSON.stringify(hiddenColumns);\n\n if (tableRoot.dataset.tableHiddenColumns !== columnJson) {\n tableConfigChanged = true;\n }\n\n tableRoot.dataset.tableHiddenColumns = columnJson;\n }\n\n if (pageNumber !== null) {\n if (tableRoot.dataset.tablePageNumber != pageNumber) {\n tableConfigChanged = true;\n }\n\n tableRoot.dataset.tablePageNumber = pageNumber;\n }\n\n // Refresh.\n if (refreshContent && tableConfigChanged) {\n return refreshTableContent(tableRoot)\n .then(tableRoot => {\n pendingPromise.resolve();\n return tableRoot;\n });\n } else {\n pendingPromise.resolve();\n return Promise.resolve(tableRoot);\n }\n};\n\n/**\n * Get the table dataset for the specified tableRoot, ensuring that the provided table is a dynamic table.\n *\n * @param {HTMLElement} tableRoot\n * @returns {DOMStringMap}\n */\nconst getTableData = tableRoot => {\n checkTableIsDynamic(tableRoot);\n\n return tableRoot.dataset;\n};\n\n/**\n * Update the specified table using the new filters.\n *\n * @param {HTMLElement} tableRoot\n * @param {Object} filters\n * @param {Bool} refreshContent\n * @returns {Promise}\n */\nexport const setFilters = (tableRoot, filters, refreshContent = true) =>\n updateTable(tableRoot, {filters}, refreshContent);\n\n/**\n * Get the filter data for the specified table.\n *\n * @param {HTMLElement} tableRoot\n * @returns {Object}\n */\nexport const getFilters = tableRoot => {\n checkTableIsDynamic(tableRoot);\n\n return getFiltersetFromTable(tableRoot);\n};\n\n/**\n * Update the sort order.\n *\n * @param {HTMLElement} tableRoot\n * @param {String} sortBy\n * @param {Number} sortOrder\n * @param {Bool} refreshContent\n * @returns {Promise}\n */\nexport const setSortOrder = (tableRoot, sortBy, sortOrder, refreshContent = true) =>\n updateTable(tableRoot, {sortBy, sortOrder}, refreshContent);\n\n/**\n * Set the page number.\n *\n * @param {HTMLElement} tableRoot\n * @param {String} pageNumber\n * @param {Bool} refreshContent\n * @returns {Promise}\n */\nexport const setPageNumber = (tableRoot, pageNumber, refreshContent = true) =>\n updateTable(tableRoot, {pageNumber}, refreshContent);\n\n/**\n * Get the current page number.\n *\n * @param {HTMLElement} tableRoot\n * @returns {Number}\n */\nexport const getPageNumber = tableRoot => getTableData(tableRoot).tablePageNumber;\n\n/**\n * Set the page size.\n *\n * @param {HTMLElement} tableRoot\n * @param {Number} pageSize\n * @param {Bool} refreshContent\n * @returns {Promise}\n */\nexport const setPageSize = (tableRoot, pageSize, refreshContent = true) =>\n updateTable(tableRoot, {pageSize, pageNumber: 1}, refreshContent);\n\n/**\n * Get the current page size.\n *\n * @param {HTMLElement} tableRoot\n * @returns {Number}\n */\nexport const getPageSize = tableRoot => getTableData(tableRoot).tablePageSize;\n\n/**\n * Update the first initial to show.\n *\n * @param {HTMLElement} tableRoot\n * @param {String} firstInitial\n * @param {Bool} refreshContent\n * @returns {Promise}\n */\nexport const setFirstInitial = (tableRoot, firstInitial, refreshContent = true) =>\n updateTable(tableRoot, {firstInitial}, refreshContent);\n\n/**\n * Get the current first initial filter.\n *\n * @param {HTMLElement} tableRoot\n * @returns {String}\n */\nexport const getFirstInitial = tableRoot => getTableData(tableRoot).tableFirstInitial;\n\n/**\n * Update the last initial to show.\n *\n * @param {HTMLElement} tableRoot\n * @param {String} lastInitial\n * @param {Bool} refreshContent\n * @returns {Promise}\n */\nexport const setLastInitial = (tableRoot, lastInitial, refreshContent = true) =>\n updateTable(tableRoot, {lastInitial}, refreshContent);\n\n/**\n * Get the current last initial filter.\n *\n * @param {HTMLElement} tableRoot\n * @returns {String}\n */\nexport const getLastInitial = tableRoot => getTableData(tableRoot).tableLastInitial;\n\n/**\n * Hide a column in the participants table.\n *\n * @param {HTMLElement} tableRoot\n * @param {String} columnToHide\n * @param {Bool} refreshContent\n * @returns {Promise}\n */\nexport const hideColumn = (tableRoot, columnToHide, refreshContent = true) => {\n const hiddenColumns = JSON.parse(tableRoot.dataset.tableHiddenColumns);\n hiddenColumns.push(columnToHide);\n\n return updateTable(tableRoot, {hiddenColumns}, refreshContent);\n};\n\n/**\n * Make a hidden column visible in the participants table.\n *\n * @param {HTMLElement} tableRoot\n * @param {String} columnToShow\n * @param {Bool} refreshContent\n * @returns {Promise}\n */\nexport const showColumn = (tableRoot, columnToShow, refreshContent = true) => {\n let hiddenColumns = JSON.parse(tableRoot.dataset.tableHiddenColumns);\n hiddenColumns = hiddenColumns.filter(columnName => columnName !== columnToShow);\n\n return updateTable(tableRoot, {hiddenColumns}, refreshContent);\n};\n\n/**\n * Reset table preferences.\n *\n * @param {HTMLElement} tableRoot\n * @returns {Promise}\n */\nconst resetTablePreferences = tableRoot => refreshTableContent(tableRoot, true);\n\n/**\n * Set up listeners to handle table updates.\n */\nexport const init = () => {\n if (watching) {\n // Already watching.\n return;\n }\n watching = true;\n\n document.addEventListener('click', e => {\n const tableRoot = e.target.closest(Selectors.main.region);\n\n if (!tableRoot) {\n return;\n }\n\n const sortableLink = e.target.closest(Selectors.table.links.sortableColumn);\n if (sortableLink) {\n e.preventDefault();\n\n setSortOrder(tableRoot, sortableLink.dataset.sortby, sortableLink.dataset.sortorder)\n .catch(Notification.exception);\n }\n\n const firstInitialLink = e.target.closest(Selectors.initialsBar.links.firstInitial);\n if (firstInitialLink !== null) {\n e.preventDefault();\n\n setFirstInitial(tableRoot, firstInitialLink.dataset.initial).catch(Notification.exception);\n }\n\n const lastInitialLink = e.target.closest(Selectors.initialsBar.links.lastInitial);\n if (lastInitialLink !== null) {\n e.preventDefault();\n\n setLastInitial(tableRoot, lastInitialLink.dataset.initial).catch(Notification.exception);\n }\n\n const pageItem = e.target.closest(Selectors.paginationBar.links.pageItem);\n if (pageItem) {\n e.preventDefault();\n\n setPageNumber(tableRoot, pageItem.dataset.pageNumber).catch(Notification.exception);\n }\n\n const hide = e.target.closest(Selectors.table.links.hide);\n if (hide) {\n e.preventDefault();\n\n hideColumn(tableRoot, hide.dataset.column).catch(Notification.exception);\n }\n\n const show = e.target.closest(Selectors.table.links.show);\n if (show) {\n e.preventDefault();\n\n showColumn(tableRoot, show.dataset.column).catch(Notification.exception);\n }\n\n const resetTablePreferencesLink = e.target.closest('.resettable a');\n if (resetTablePreferencesLink) {\n e.preventDefault();\n\n resetTablePreferences(tableRoot).catch(Notification.exception);\n }\n });\n};\n\n/**\n * Fetch the table via its table region id.\n *\n * @param {String} tableRegionId\n * @returns {HTMLElement}\n */\nexport const getTableFromId = tableRegionId => {\n const tableRoot = document.querySelector(Selectors.main.fromRegionId(tableRegionId));\n\n\n if (!tableRoot) {\n // The table is not a dynamic table.\n throw new Error(\"The table specified is not a dynamic table and cannot be updated\");\n }\n\n return tableRoot;\n};\n\nexport {\n Events\n};\n"],"file":"dynamic.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/dynamic.js"],"names":["watching","checkTableIsDynamic","tableRoot","Error","matches","Selectors","main","region","getFiltersetFromTable","JSON","parse","dataset","tableFilters","refreshTableContent","resetContent","filterset","pendingPromise","Pending","tableComponent","tableHandler","tableUniqueid","sortData","tableSortData","joinType","jointype","filters","firstinitial","tableFirstInitial","lastinitial","tableLastInitial","pageNumber","tablePageNumber","pageSize","tablePageSize","hiddenColumns","tableHiddenColumns","then","data","placeholder","document","createElement","innerHTML","html","replaceWith","childNodes","getTableFromId","dispatchEvent","CustomEvent","Events","tableContentRefreshed","bubbles","resolve","updateTable","sortBy","sortOrder","firstInitial","lastInitial","refreshContent","tableConfigChanged","unshift","sortby","sortorder","parseInt","stringify","filterJson","columnJson","Promise","getTableData","setFilters","getFilters","setSortOrder","setPageNumber","getPageNumber","setPageSize","getPageSize","setFirstInitial","getFirstInitial","setLastInitial","getLastInitial","hideColumn","columnToHide","push","showColumn","columnToShow","filter","columnName","resetTablePreferences","init","addEventListener","e","target","closest","sortableLink","table","links","sortableColumn","preventDefault","catch","Notification","exception","firstInitialLink","initialsBar","initial","lastInitialLink","pageItem","paginationBar","hide","column","show","resetTablePreferencesLink","tableRegionId","querySelector","fromRegionId"],"mappings":"04BAuBA,OACA,OACA,OAGA,O,24CAEIA,CAAAA,CAAQ,G,CAQNC,CAAmB,CAAG,SAAAC,CAAS,CAAI,CACrC,GAAI,CAACA,CAAL,CAAgB,CAEZ,KAAM,IAAIC,CAAAA,KAAJ,CAAU,kEAAV,CACT,CAED,GAAI,CAACD,CAAS,CAACE,OAAV,CAAkBC,CAAS,CAACC,IAAV,CAAeC,MAAjC,CAAL,CAA+C,CAE3C,KAAM,IAAIJ,CAAAA,KAAJ,CAAU,kEAAV,CACT,CAED,QACH,C,CAQKK,CAAqB,CAAG,SAAAN,CAAS,CAAI,CACvC,MAAOO,CAAAA,IAAI,CAACC,KAAL,CAAWR,CAAS,CAACS,OAAV,CAAkBC,YAA7B,CACV,C,CASYC,CAAmB,CAAG,SAACX,CAAD,CAAqC,IAAzBY,CAAAA,CAAyB,2DAC9DC,CAAS,CAAGP,CAAqB,CAACN,CAAD,CAD6B,CAEpE,yBAAmBA,CAAnB,EAEA,GAAMc,CAAAA,CAAc,CAAG,GAAIC,UAAJ,CAAY,wCAAZ,CAAvB,CAEA,MAAO,YACHf,CAAS,CAACS,OAAV,CAAkBO,cADf,CAEHhB,CAAS,CAACS,OAAV,CAAkBQ,YAFf,CAGHjB,CAAS,CAACS,OAAV,CAAkBS,aAHf,CAIH,CACIC,QAAQ,CAAEZ,IAAI,CAACC,KAAL,CAAWR,CAAS,CAACS,OAAV,CAAkBW,aAA7B,CADd,CAEIC,QAAQ,CAAER,CAAS,CAACS,QAFxB,CAGIC,OAAO,CAAEV,CAAS,CAACU,OAHvB,CAIIC,YAAY,CAAExB,CAAS,CAACS,OAAV,CAAkBgB,iBAJpC,CAKIC,WAAW,CAAE1B,CAAS,CAACS,OAAV,CAAkBkB,gBALnC,CAMIC,UAAU,CAAE5B,CAAS,CAACS,OA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SAAAiE,CAAa,CAAI,CAC3C,GAAM5G,CAAAA,CAAS,CAAGqC,QAAQ,CAACwE,aAAT,CAAuB1G,CAAS,CAACC,IAAV,CAAe0G,YAAf,CAA4BF,CAA5B,CAAvB,CAAlB,CAGA,GAAI,CAAC5G,CAAL,CAAgB,CAEZ,KAAM,IAAIC,CAAAA,KAAJ,CAAU,kEAAV,CACT,CAED,MAAOD,CAAAA,CACV,CAVM,C","sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n/**\n * Module to handle dynamic table features.\n *\n * @module core_table/dynamic\n * @package core_table\n * @copyright 2020 Simey Lameze \n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nimport * as Selectors from 'core_table/local/dynamic/selectors';\nimport Events from './local/dynamic/events';\nimport Pending from 'core/pending';\nimport {addIconToContainer} from 'core/loadingicon';\nimport {fetch as fetchTableData} from 'core_table/local/dynamic/repository';\nimport Notification from 'core/notification';\n\nlet watching = false;\n\n/**\n * Ensure that a table is a dynamic table.\n *\n * @param {HTMLElement} tableRoot\n * @returns {Bool}\n */\nconst checkTableIsDynamic = tableRoot => {\n if (!tableRoot) {\n // The table is not a dynamic table.\n throw new Error(\"The table specified is not a dynamic table and cannot be updated\");\n }\n\n if (!tableRoot.matches(Selectors.main.region)) {\n // The table is not a dynamic table.\n throw new Error(\"The table specified is not a dynamic table and cannot be updated\");\n }\n\n return true;\n};\n\n/**\n * Get the filterset data from a known dynamic table.\n *\n * @param {HTMLElement} tableRoot\n * @returns {Object}\n */\nconst getFiltersetFromTable = tableRoot => {\n return JSON.parse(tableRoot.dataset.tableFilters);\n};\n\n/**\n * Update the specified table based on its current values.\n *\n * @param {HTMLElement} tableRoot\n * @param {Bool} resetContent\n * @returns {Promise}\n */\nexport const refreshTableContent = (tableRoot, resetContent = false) => {\n const filterset = getFiltersetFromTable(tableRoot);\n addIconToContainer(tableRoot);\n\n const pendingPromise = new Pending('core_table/dynamic:refreshTableContent');\n\n return fetchTableData(\n tableRoot.dataset.tableComponent,\n tableRoot.dataset.tableHandler,\n tableRoot.dataset.tableUniqueid,\n {\n sortData: JSON.parse(tableRoot.dataset.tableSortData),\n joinType: filterset.jointype,\n filters: filterset.filters,\n firstinitial: tableRoot.dataset.tableFirstInitial,\n lastinitial: tableRoot.dataset.tableLastInitial,\n pageNumber: tableRoot.dataset.tablePageNumber,\n pageSize: tableRoot.dataset.tablePageSize,\n hiddenColumns: JSON.parse(tableRoot.dataset.tableHiddenColumns),\n },\n resetContent,\n )\n .then(data => {\n const placeholder = document.createElement('div');\n placeholder.innerHTML = data.html;\n tableRoot.replaceWith(...placeholder.childNodes);\n\n // Update the tableRoot.\n return getTableFromId(tableRoot.dataset.tableUniqueid);\n }).then(tableRoot => {\n tableRoot.dispatchEvent(new CustomEvent(Events.tableContentRefreshed, {\n bubbles: true,\n }));\n\n return tableRoot;\n })\n .then(tableRoot => {\n pendingPromise.resolve();\n\n return tableRoot;\n });\n};\n\nexport const updateTable = (tableRoot, {\n sortBy = null,\n sortOrder = null,\n filters = null,\n firstInitial = null,\n lastInitial = null,\n pageNumber = null,\n pageSize = null,\n hiddenColumns = null,\n} = {}, refreshContent = true) => {\n checkTableIsDynamic(tableRoot);\n\n const pendingPromise = new Pending('core_table/dynamic:updateTable');\n let tableConfigChanged = false;\n\n // Update sort fields.\n if (sortBy && sortOrder) {\n // Always update the table if requested and there were sort fields.\n // These fields are only ever normalised in the backend.\n tableConfigChanged = true;\n\n const sortData = JSON.parse(tableRoot.dataset.tableSortData);\n sortData.unshift({\n sortby: sortBy,\n sortorder: parseInt(sortOrder, 10),\n });\n tableRoot.dataset.tableSortData = JSON.stringify(sortData);\n }\n\n // Update initials.\n if (firstInitial !== null) {\n if (tableRoot.dataset.tableFirstInitial !== firstInitial) {\n tableConfigChanged = true;\n }\n\n tableRoot.dataset.tableFirstInitial = firstInitial;\n }\n\n if (lastInitial !== null) {\n if (tableRoot.dataset.tableLastInitial !== lastInitial) {\n tableConfigChanged = true;\n }\n\n tableRoot.dataset.tableLastInitial = lastInitial;\n }\n\n if (pageSize !== null) {\n if (tableRoot.dataset.tablePageSize != pageSize) {\n tableConfigChanged = true;\n }\n\n tableRoot.dataset.tablePageSize = pageSize;\n }\n\n // Update filters.\n if (filters) {\n const filterJson = JSON.stringify(filters);\n\n if (tableRoot.dataset.tableFilters !== filterJson) {\n tableConfigChanged = true;\n }\n\n tableRoot.dataset.tableFilters = filterJson;\n }\n\n // Reset to page 1 when table content is being altered by filtering or sorting.\n // This ensures the table page being loaded always exists, and gives a consistent experience.\n if (tableConfigChanged) {\n pageNumber = 1;\n }\n\n // Update hidden columns.\n if (hiddenColumns) {\n const columnJson = JSON.stringify(hiddenColumns);\n\n if (tableRoot.dataset.tableHiddenColumns !== columnJson) {\n tableConfigChanged = true;\n }\n\n tableRoot.dataset.tableHiddenColumns = columnJson;\n }\n\n if (pageNumber !== null) {\n if (tableRoot.dataset.tablePageNumber != pageNumber) {\n tableConfigChanged = true;\n }\n\n tableRoot.dataset.tablePageNumber = pageNumber;\n }\n\n // Refresh.\n if (refreshContent && tableConfigChanged) {\n return refreshTableContent(tableRoot)\n .then(tableRoot => {\n pendingPromise.resolve();\n return tableRoot;\n });\n } else {\n pendingPromise.resolve();\n return Promise.resolve(tableRoot);\n }\n};\n\n/**\n * Get the table dataset for the specified tableRoot, ensuring that the provided table is a dynamic table.\n *\n * @param {HTMLElement} tableRoot\n * @returns {DOMStringMap}\n */\nconst getTableData = tableRoot => {\n checkTableIsDynamic(tableRoot);\n\n return tableRoot.dataset;\n};\n\n/**\n * Update the specified table using the new filters.\n *\n * @param {HTMLElement} tableRoot\n * @param {Object} filters\n * @param {Bool} refreshContent\n * @returns {Promise}\n */\nexport const setFilters = (tableRoot, filters, refreshContent = true) =>\n updateTable(tableRoot, {filters}, refreshContent);\n\n/**\n * Get the filter data for the specified table.\n *\n * @param {HTMLElement} tableRoot\n * @returns {Object}\n */\nexport const getFilters = tableRoot => {\n checkTableIsDynamic(tableRoot);\n\n return getFiltersetFromTable(tableRoot);\n};\n\n/**\n * Update the sort order.\n *\n * @param {HTMLElement} tableRoot\n * @param {String} sortBy\n * @param {Number} sortOrder\n * @param {Bool} refreshContent\n * @returns {Promise}\n */\nexport const setSortOrder = (tableRoot, sortBy, sortOrder, refreshContent = true) =>\n updateTable(tableRoot, {sortBy, sortOrder}, refreshContent);\n\n/**\n * Set the page number.\n *\n * @param {HTMLElement} tableRoot\n * @param {String} pageNumber\n * @param {Bool} refreshContent\n * @returns {Promise}\n */\nexport const setPageNumber = (tableRoot, pageNumber, refreshContent = true) =>\n updateTable(tableRoot, {pageNumber}, refreshContent);\n\n/**\n * Get the current page number.\n *\n * @param {HTMLElement} tableRoot\n * @returns {Number}\n */\nexport const getPageNumber = tableRoot => getTableData(tableRoot).tablePageNumber;\n\n/**\n * Set the page size.\n *\n * @param {HTMLElement} tableRoot\n * @param {Number} pageSize\n * @param {Bool} refreshContent\n * @returns {Promise}\n */\nexport const setPageSize = (tableRoot, pageSize, refreshContent = true) =>\n updateTable(tableRoot, {pageSize, pageNumber: 1}, refreshContent);\n\n/**\n * Get the current page size.\n *\n * @param {HTMLElement} tableRoot\n * @returns {Number}\n */\nexport const getPageSize = tableRoot => getTableData(tableRoot).tablePageSize;\n\n/**\n * Update the first initial to show.\n *\n * @param {HTMLElement} tableRoot\n * @param {String} firstInitial\n * @param {Bool} refreshContent\n * @returns {Promise}\n */\nexport const setFirstInitial = (tableRoot, firstInitial, refreshContent = true) =>\n updateTable(tableRoot, {firstInitial}, refreshContent);\n\n/**\n * Get the current first initial filter.\n *\n * @param {HTMLElement} tableRoot\n * @returns {String}\n */\nexport const getFirstInitial = tableRoot => getTableData(tableRoot).tableFirstInitial;\n\n/**\n * Update the last initial to show.\n *\n * @param {HTMLElement} tableRoot\n * @param {String} lastInitial\n * @param {Bool} refreshContent\n * @returns {Promise}\n */\nexport const setLastInitial = (tableRoot, lastInitial, refreshContent = true) =>\n updateTable(tableRoot, {lastInitial}, refreshContent);\n\n/**\n * Get the current last initial filter.\n *\n * @param {HTMLElement} tableRoot\n * @returns {String}\n */\nexport const getLastInitial = tableRoot => getTableData(tableRoot).tableLastInitial;\n\n/**\n * Hide a column in the participants table.\n *\n * @param {HTMLElement} tableRoot\n * @param {String} columnToHide\n * @param {Bool} refreshContent\n * @returns {Promise}\n */\nexport const hideColumn = (tableRoot, columnToHide, refreshContent = true) => {\n const hiddenColumns = JSON.parse(tableRoot.dataset.tableHiddenColumns);\n hiddenColumns.push(columnToHide);\n\n return updateTable(tableRoot, {hiddenColumns}, refreshContent);\n};\n\n/**\n * Make a hidden column visible in the participants table.\n *\n * @param {HTMLElement} tableRoot\n * @param {String} columnToShow\n * @param {Bool} refreshContent\n * @returns {Promise}\n */\nexport const showColumn = (tableRoot, columnToShow, refreshContent = true) => {\n let hiddenColumns = JSON.parse(tableRoot.dataset.tableHiddenColumns);\n hiddenColumns = hiddenColumns.filter(columnName => columnName !== columnToShow);\n\n return updateTable(tableRoot, {hiddenColumns}, refreshContent);\n};\n\n/**\n * Reset table preferences.\n *\n * @param {HTMLElement} tableRoot\n * @returns {Promise}\n */\nconst resetTablePreferences = tableRoot => refreshTableContent(tableRoot, true);\n\n/**\n * Set up listeners to handle table updates.\n */\nexport const init = () => {\n if (watching) {\n // Already watching.\n return;\n }\n watching = true;\n\n document.addEventListener('click', e => {\n const tableRoot = e.target.closest(Selectors.main.region);\n\n if (!tableRoot) {\n return;\n }\n\n const sortableLink = e.target.closest(Selectors.table.links.sortableColumn);\n if (sortableLink) {\n e.preventDefault();\n\n setSortOrder(tableRoot, sortableLink.dataset.sortby, sortableLink.dataset.sortorder)\n .catch(Notification.exception);\n }\n\n const firstInitialLink = e.target.closest(Selectors.initialsBar.links.firstInitial);\n if (firstInitialLink !== null) {\n e.preventDefault();\n\n setFirstInitial(tableRoot, firstInitialLink.dataset.initial).catch(Notification.exception);\n }\n\n const lastInitialLink = e.target.closest(Selectors.initialsBar.links.lastInitial);\n if (lastInitialLink !== null) {\n e.preventDefault();\n\n setLastInitial(tableRoot, lastInitialLink.dataset.initial).catch(Notification.exception);\n }\n\n const pageItem = e.target.closest(Selectors.paginationBar.links.pageItem);\n if (pageItem) {\n e.preventDefault();\n\n setPageNumber(tableRoot, pageItem.dataset.pageNumber).catch(Notification.exception);\n }\n\n const hide = e.target.closest(Selectors.table.links.hide);\n if (hide) {\n e.preventDefault();\n\n hideColumn(tableRoot, hide.dataset.column).catch(Notification.exception);\n }\n\n const show = e.target.closest(Selectors.table.links.show);\n if (show) {\n e.preventDefault();\n\n showColumn(tableRoot, show.dataset.column).catch(Notification.exception);\n }\n\n const resetTablePreferencesLink = e.target.closest('.resettable a');\n if (resetTablePreferencesLink) {\n e.preventDefault();\n\n resetTablePreferences(tableRoot).catch(Notification.exception);\n }\n });\n};\n\n/**\n * Fetch the table via its table region id.\n *\n * @param {String} tableRegionId\n * @returns {HTMLElement}\n */\nexport const getTableFromId = tableRegionId => {\n const tableRoot = document.querySelector(Selectors.main.fromRegionId(tableRegionId));\n\n\n if (!tableRoot) {\n // The table is not a dynamic table.\n throw new Error(\"The table specified is not a dynamic table and cannot be updated\");\n }\n\n return tableRoot;\n};\n\nexport {\n Events\n};\n"],"file":"dynamic.min.js"} \ No newline at end of file diff --git a/lib/yui/build/moodle-core-actionmenu/moodle-core-actionmenu-min.js b/lib/yui/build/moodle-core-actionmenu/moodle-core-actionmenu-min.js index 9c095343bef..a5f02ccf740 100644 --- a/lib/yui/build/moodle-core-actionmenu/moodle-core-actionmenu-min.js +++ b/lib/yui/build/moodle-core-actionmenu/moodle-core-actionmenu-min.js @@ -1,2 +1,2 @@ -YUI.add("moodle-core-actionmenu",function(e,t){var n,s=e.one(e.config.doc.body),o="action-menu-shown",h={CAN_RECEIVE_FOCUS_SELECTOR:'input:not([type="hidden"]), a[href], button, textarea, select, [tabindex]',MENU:".moodle-actionmenu[data-enhance=moodle-core-actionmenu]",MENUBAR:'[role="menubar"]',MENUITEM:'[role="menuitem"]',MENUCONTENT:".menu[data-rel=menu-content]",MENUCONTENTCHILD:"li a",MENUCHILD:".menu li a",TOGGLE:".toggle-display",KEEPOPEN:'[data-keepopen="1"]',MENUBARITEMS:['[role="menubar"] > [role="menuitem"]','[role="menubar"] > [role="presentation"] > [role="menuitem"]'],MENUITEMS:['> [role="menuitem"]','> [role="presentation"] > [role="menuitem"]']},i="tr",u="br";(n=function(){n.superclass.constructor.apply(this,arguments)}).prototype={dialogue:null,events:[],owner:null,menulink:null,menuChildren:null,firstMenuChild:null,lastMenuChild:null,initializer:function(){e.all(h.MENU).each(this.enhance,this),s.delegate("key",this.moveMenuItem,"down:37,39",h.MENUBARITEMS.join(","),this),s.delegate("click",this.toggleMenu,h.MENU+" "+h.TOGGLE,this),s.delegate("key",this.showIfHidden,"down:enter,38,40",h.MENU+" "+h.TOGGLE,this),s.delegate("key",function(e){e.currentTarget.simulate("click"),e.preventDefault()},"down:32",h.MENUBARITEMS.join(","))},enhance:function(e){var t,n=e.one(h.MENUCONTENT);if(!n)return!1;t=n.getData("align")||this.get("align").join("-"),e.one(h.TOGGLE).set("aria-haspopup",!0),n.set("aria-hidden",!0),n.hasClass("align-"+t)||n.addClass("align-"+t),n.getDOMNode().childElementCount&&e.setAttribute("data-enhanced","1")},moveMenuItem:function(e){var t,n=e.target.ancestor(h.MENUITEM,!0);return 37===e.keyCode?t=this.getMenuItem(n,!0):39===e.keyCode&&(t=this.getMenuItem(n)),t&&t.focus(),this},getMenuItem:function(e,t){var n,i,s,o,u,l=e.ancestor(h.MENUBAR);if(!l)return null;if(!(n=l.all(h.MENUITEMS.join(","))))return null;if(1===(s=n.size()))return null;for(u=1,o=o=0;o=this.menuChildren.size()&&(i=0),t=this.menuChildren.item(i),++o [role="menuitem"]','[role="menubar"] > [role="presentation"] > [role="menuitem"]'],MENUITEMS:['> [role="menuitem"]','> [role="presentation"] > [role="menuitem"]']},n="tr",i="br",u=function(){u.superclass.constructor.apply(this,arguments)};e.extend(u,e.Base,u.prototype={dialogue:null,events:[],owner:null,menulink:null,menuChildren:null,firstMenuChild:null,lastMenuChild:null,initializer:function(){e.all(a.MENU).each(this.enhance,this),s.delegate("key",this.moveMenuItem,"down:37,39",a.MENUBARITEMS.join(","),this),s.delegate("click",this.toggleMenu,a.MENU+" "+a.TOGGLE,this),s.delegate("key",this.showIfHidden,"down:enter,38,40",a.MENU+" "+a.TOGGLE,this),s.delegate("key",function(e){e.currentTarget.simulate("click"),e.preventDefault()},"down:32",a.MENUBARITEMS.join(","))},enhance:function(e){var t,n=e.one(a.MENUCONTENT);if(!n)return!1;t=n.getData("align")||this.get("align").join("-"),e.one(a.TOGGLE).set("aria-haspopup",!0),n.set("aria-hidden",!0),n.hasClass("align-"+t)||n.addClass("align-"+t),n.getDOMNode().childElementCount&&e.setAttribute("data-enhanced","1")},moveMenuItem:function(e){var t,n=e.target.ancestor(a.MENUITEM,!0);return 37===e.keyCode?t=this.getMenuItem(n,!0):39===e.keyCode&&(t=this.getMenuItem(n)),t&&t.focus(),this},getMenuItem:function(e,t){var n,i,s,o,u,h=e.ancestor(a.MENUBAR);if(!h)return null;if(!(n=h.all(a.MENUITEMS.join(","))))return null;if(1===(s=n.size()))return null;for(u=1,o=o=0;o=this.menuChildren.size()&&(i=0),t=this.menuChildren.item(i),++o ."+p)).size()&&((o=e.item(0)).addClass(c),o.set("id",p),o.one("div").addClass(p)),0===(t=g.Node.all("div."+c)).size())return!1;t.size()!==this.get("regions").length&&(i=g.Node.create("
                            ").addClass(c),n=g.Node.create("
                            ").addClass(p),i.appendChild(n),s=t.filter("#region-pre"),r=t.filter("#region-post"),0===s.size()&&1===r.size()?(i.setAttrs({id:"region-pre"}),r.item(0).insert(i,"before"),t.unshift(i)):0===r.size()&&1===s.size()&&(i.setAttrs({id:"region-post"}),s.item(0).insert(i,"after"),t.push(i))),t.each(function(e){var o;new g.DD.Drop({node:e.one("div."+p),groups:this.groups,padding:"40 240 40 240"}),(o=new g.DD.Delegate({container:e,nodes:"."+d,target:!0,handles:[f.DRAGHANDLE],invalid:".block-hider-hide, .block-hider-show, .moveto",dragConfig:{groups:this.groups}})).dd.plug(g.Plugin.DDProxy,{moveOnEnd:!1}),o.dd.plug(g.Plugin.DDWinScroll),e.all("."+d).each(function(e){var o=e.one("a."+u);o&&(o.replace(this.get_drag_handle(o.getAttribute("title"),"","iconsmall",!0)),e.one(f.DRAGHANDLE).setStyle("cursor","move"))},this)},this)},get_block_id:function(e){return Number(e.get("id").replace(/inst/i,""))},get_block_region:function(e){var o=e.ancestor("div."+c).get("id").replace(/region-/i,"");return-1===g.Array.indexOf(this.get("regions"),o)?(window.right_to_left()&&("post"===o?o="pre":"pre"===o&&(o="post")),"side-"+o):o},get_region_id:function(e){return e.get("id").replace(/region-/i,"")},drag_start:function(e){var o=e.target;this.dragsourceregion=o.get("node").ancestor("div."+c),o.get("node").previous()&&o.get("node").previous().hasClass(h)&&(this.skipnodetop=o.get("node").previous()),o.get("node").next()&&o.get("node").next().hasClass(i)&&(this.skipnodebottom=o.get("node").next()),g.one("body").addClass(n)},drop_over:function(e){var o,t,i=e.drag.get("node"),n=e.drop.get("node");if(n.hasClass(this.parentnodeclass)&&n.one("."+l)&&n.one("."+l).next("."+d)&&n.prepend(i),this.dragsourceregion.contains(n))return!1;o=g.one("body"),t=this.get_region_id(this.dragsourceregion),o.hasClass("side-"+t+"-only")&&o.removeClass("side-"+t+"-only"),t=this.get_region_id(n.ancestor("div."+c)),0===this.dragsourceregion.all("."+d).size()&&this.dragsourceregion.get("id").match(/(region-pre|region-post)/i)&&(o.hasClass("side-"+t+"-only")||o.addClass("side-"+t+"-only"))},drag_end:function(){this.skipnodetop=null,this.skipnodebottom=null,this.dragsourceregion=null,g.one("body").removeClass(n)},drag_dropmiss:function(e){this.drop_hit(e)},drop_hit:function(i){var n,e,o=i.drag,t=o.get("node"),s=i.drop.get("node");t.previous()&&t.previous().hasClass(h)&&t.insert(t.previous(),"after"),this.skipnodetop&&t.insert(this.skipnodetop,"before"),this.skipnodebottom&&t.insert(this.skipnodebottom,"after"),n=M.util.add_lightbox(g,t),e={sesskey:M.cfg.sesskey,courseid:this.get("courseid"),pagelayout:this.get("pagelayout"),pagetype:this.get("pagetype"),subpage:this.get("subpage"),contextid:this.get("contextid"),action:"move",bui_moveid:this.get_block_id(t),bui_newregion:this.get_block_region(s)},this.get("cmid")&&(e.cmid=this.get("cmid")),t.next("."+this.samenodeclass)&&!t.next("."+this.samenodeclass).hasClass(l)&&(e.bui_beforeid=this.get_block_id(t.next("."+this.samenodeclass))),g.io(M.cfg.wwwroot+r,{method:"POST",data:e,on:{start:function(){n.show()},success:function(e,o){window.setTimeout(function(){n.hide()},250);try{var t=g.JSON.parse(o.responseText);t.error&&new M.core.ajaxException(t)}catch(i){}},failure:function(e,o){this.ajax_failure(o),n.hide()}},context:this})}},{NAME:"core-blocks-dragdrop",ATTRS:{courseid:{value:null},cmid:{value:null},contextid:{value:null},pagelayout:{value:null},pagetype:{value:null},subpage:{value:null},regions:{value:null}}}),M.core=M.core||{},M.core.blockdraganddrop=M.core.blockdraganddrop||{},M.core.blockdraganddrop._isusingnewblocksmethod=null,M.core.blockdraganddrop.is_using_blocks_render_method=function(){var e,o;return null===this._isusingnewblocksmethod&&(e=g.all(".block-region[data-blockregion]").size(),o=g.all(".block-region").size(),this._isusingnewblocksmethod=o===e),this._isusingnewblocksmethod},M.core.blockdraganddrop.init=function(e){new(this.is_using_blocks_render_method()?o:s)(e)},M.core_blocks=M.core_blocks||{},M.core_blocks.init_dragdrop=function(e){M.core.blockdraganddrop.init(e)},(o=function(){o.superclass.constructor.apply(this,arguments)}).prototype={skipnodetop:null,skipnodebottom:null,regionobjects:{},initializer:function(){var e,o,t,i,n,s=this.get("regions"),r=0;for(r in this.groups=["block"],this.samenodeclass=d,this.parentnodeclass=c,this.detectkeyboarddirection=!0,0<(i=g.Node.all("body#"+_+" #"+b+" > ."+p)).size()&&((n=i.item(0)).addClass(c),n.set("id",p),n.one("div").addClass(p)),s)o=s[r],e=new a({manager:this,region:o,node:g.one("#block-region-"+o)}),this.regionobjects[o]=e,new g.DD.Drop({node:e.get_droptarget(),groups:this.groups,padding:"40 240 40 240"}),(t=new g.DD.Delegate({container:e.get_droptarget(),nodes:"."+d,target:!0,handles:[f.DRAGHANDLE],invalid:".block-hider-hide, .block-hider-show, .moveto, .block_fake",dragConfig:{groups:this.groups}})).dd.plug(g.Plugin.DDProxy,{moveOnEnd:!1}),t.dd.plug(g.Plugin.DDWinScroll),g.DD.DDM.on("ddm:start",this.enable_all_regions,this),e.change_block_move_icons(this)},get_block_id:function(e){return Number(e.get("id").replace(/inst/i,""))},get_block_region:function(e){return e.test("[data-blockregion]")||( -e=e.ancestor("[data-blockregion]")),e.getData("blockregion")},get_region_object:function(e){return this.regionobjects[this.get_block_region(e)]},enable_all_regions:function(){var e,o=g.DD.DDM.activeDrag.get("groups");if(o&&-1!==g.Array.indexOf(o,"block"))for(e in this.regionobjects)this.regionobjects.hasOwnProperty(e)&&this.regionobjects[e].enable()},disable_regions_if_required:function(){var e=0;for(e in this.regionobjects)this.regionobjects[e].disable_if_required()},drag_start:function(e){var o=e.target;o.get("node").previous()&&o.get("node").previous().hasClass(h)&&(this.skipnodetop=o.get("node").previous()),o.get("node").next()&&o.get("node").next().hasClass(i)&&(this.skipnodebottom=o.get("node").next())},drop_over:function(e){var o=e.drag.get("node"),t=e.drop.get("node");t.hasClass(p)&&t.one("."+l)&&t.one("."+l).next("."+d)&&t.prepend(o)},drop_end:function(){this.skipnodetop=null,this.skipnodebottom=null,this.disable_regions_if_required()},drag_dropmiss:function(e){this.drop_hit(e)},drop_hit:function(i){var n,e,o=i.drag.get("node"),t=i.drop.get("node");o.previous()&&o.previous().hasClass(h)&&o.insert(o.previous(),"after"),this.skipnodetop&&o.insert(this.skipnodetop,"before"),this.skipnodebottom&&o.insert(this.skipnodebottom,"after"),n=M.util.add_lightbox(g,o),e={sesskey:M.cfg.sesskey,courseid:this.get("courseid"),pagelayout:this.get("pagelayout"),pagetype:this.get("pagetype"),subpage:this.get("subpage"),contextid:this.get("contextid"),action:"move",bui_moveid:this.get_block_id(o),bui_newregion:this.get_block_region(t)},this.get("cmid")&&(e.cmid=this.get("cmid")),o.next("."+d)&&!o.next("."+d).hasClass(l)&&(e.bui_beforeid=this.get_block_id(o.next("."+d))),g.io(M.cfg.wwwroot+r,{method:"POST",data:e,on:{start:function(){n.show()},success:function(e,o){window.setTimeout(function(){n.hide()},250);try{var t=g.JSON.parse(o.responseText);t.error&&new M.core.ajaxException(t)}catch(i){}},failure:function(e,o){this.ajax_failure(o),n.hide()},complete:function(){this.disable_regions_if_required()}},context:this})}},g.extend(o,M.core.dragdrop,o.prototype,{NAME:"core-blocks-dragdrop-manager",ATTRS:{courseid:{value:null},cmid:{value:null},contextid:{value:null},pagelayout:{value:null},pagetype:{value:null},subpage:{value:null},regions:{value:[]}}}),(a=function(){a.superclass.constructor.apply(this,arguments)}).prototype={initializer:function(){var e,o,t,i=this.get("node");i=i||this.create_and_add_node(),e=g.one("body"),o=0
                          ').addClass(c).setData("blockregion",n),r=this.get("manager").get("regions"),a=!1,d=!1,l=!1;for(e in r)r[e].match(/(pre|left)/)?a=r[e]:r[e].match(/(post|right)/)&&(d=r[e]);return!1!==a&&!1!==d&&(n===a?(t=g.one("#block-region-"+d))&&(t.insert(s,"before"),l=!0):(o=g.one("#block-region-"+a))&&(o.insert(s,"after"),l=!0)),!1===l&&g.one("body").append(s),this.set("node",s),s},change_block_move_icons:function(o){var t;this.get("node").all("."+d+" a."+u).each(function(e){e.setStyle("cursor","move"),t=o.get_drag_handle(e.getAttribute("title"),"","icon",!0),e.replace(t)})},get_has_region_class:function(){return"has-region-"+this.get("region")},get_empty_region_class:function(){return"empty-region-"+this.get("region")},get_used_region_class:function(){return"used-region-"+this.get("region")},get_droptarget:function(){var e=this.get("node");return e.test('[data-droptarget="1"]')?e:e.one('[data-droptarget="1"]')},enable:function(){g.one("body").addClass(this.get_used_region_class()).removeClass(this.get_empty_region_class())},disable_if_required:function(){0===this.get("node").all("."+d).size()&&g.one("body").addClass(this.get_empty_region_class()).removeClass(this.get_used_region_class())}},g.extend(a,g.Base,a.prototype,{NAME:"core-blocks-dragdrop-blockregion",ATTRS:{manager:{writeOnce:"initOnly",validator:function(e){return g.Lang.isObject(e)&&e instanceof o}},region:{writeOnce:"initOnly",validator:function(e){return g.Lang.isString(e)}},node:{validator:function(e){return g.Lang.isObject(e)||g.Lang.isNull(e)}},hasblocks:{value:!1,validator:function(e){return g.Lang.isBoolean(e)}}}})},"@VERSION@",{requires:["base","node","io","dom","dd","dd-scroll","moodle-core-dragdrop","moodle-core-notification"]}); \ No newline at end of file +YUI.add("moodle-core-blocks",function(a,e){var o,s,u="/lib/ajax/blocks.php",r="block",d="block-region",l="block_adminblock",n="editing_move",p="header",g="region-content",t="skip-block",h="skip-block-to",_="page-my-index",b="region-main",f="blocks-moving",c={DRAGHANDLE:"."+p+" .commands .moodle-core-dragdrop-draghandle"},i=function(){i.superclass.constructor.apply(this,arguments)};a.extend(i,M.core.dragdrop,{skipnodetop:null,skipnodebottom:null,dragsourceregion:null,initializer:function(){var e,o,t,i;if(this.groups=["block"],this.samenodeclass=r,this.parentnodeclass=g,0<(e=a.Node.all("body#"+_+" #"+b+" > ."+g)).size()&&((e=e.item(0)).addClass(d),e.set("id",g),e.one("div").addClass(g)),0===(e=a.Node.all("div."+d)).size())return!1;e.size()!==this.get("regions").length&&(o=a.Node.create("
                          ").addClass(d),t=a.Node.create("
                          ").addClass(g),o.appendChild(t),t=e.filter("#region-pre"),i=e.filter("#region-post"),0===t.size()&&1===i.size()?(o.setAttrs({id:"region-pre"}),i.item(0).insert(o,"before"),e.unshift(o)):0===i.size()&&1===t.size()&&(o.setAttrs({id:"region-post"}),t.item(0).insert(o,"after"),e.push(o))),e.each(function(e){var o;new a.DD.Drop({node:e.one("div."+g),groups:this.groups,padding:"40 240 40 240"}),(o=new a.DD.Delegate({container:e,nodes:"."+r,target:!0,handles:[c.DRAGHANDLE],invalid:".block-hider-hide, .block-hider-show, .moveto",dragConfig:{groups:this.groups}})).dd.plug(a.Plugin.DDProxy,{moveOnEnd:!1}),o.dd.plug(a.Plugin.DDWinScroll),e.all("."+r).each(function(e){var o=e.one("a."+n);o&&(o.replace(this.get_drag_handle(o.getAttribute("title"),"","iconsmall",!0)),e.one(c.DRAGHANDLE).setStyle("cursor","move"))},this)},this)},get_block_id:function(e){return Number(e.get("id").replace(/inst/i,""))},get_block_region:function(e){e=e.ancestor("div."+d).get("id").replace(/region-/i,"");return-1===a.Array.indexOf(this.get("regions"),e)?(window.right_to_left()&&("post"===e?e="pre":"pre"===e&&(e="post")),"side-"+e):e},get_region_id:function(e){return e.get("id").replace(/region-/i,"")},drag_start:function(e){e=e.target;this.dragsourceregion=e.get("node").ancestor("div."+d),e.get("node").previous()&&e.get("node").previous().hasClass(t)&&(this.skipnodetop=e.get("node").previous()),e.get("node").next()&&e.get("node").next().hasClass(h)&&(this.skipnodebottom=e.get("node").next()),a.one("body").addClass(f)},drop_over:function(e){var o,t=e.drag.get("node"),e=e.drop.get("node");if(e.hasClass(this.parentnodeclass)&&e.one("."+l)&&e.one("."+l).next("."+r)&&e.prepend(t),this.dragsourceregion.contains(e))return!1;t=a.one("body"),o=this.get_region_id(this.dragsourceregion),t.hasClass("side-"+o+"-only")&&t.removeClass("side-"+o+"-only"),o=this.get_region_id(e.ancestor("div."+d)),0===this.dragsourceregion.all("."+r).size()&&this.dragsourceregion.get("id").match(/(region-pre|region-post)/i)&&(t.hasClass("side-"+o+"-only")||t.addClass("side-"+o+"-only"))},drag_end:function(){this.skipnodetop=null,this.skipnodebottom=null,this.dragsourceregion=null,a.one("body").removeClass(f)},drag_dropmiss:function(e){this.drop_hit(e)},drop_hit:function(i){var n,e=i.drag,e=e.get("node"),o=i.drop.get("node");e.previous()&&e.previous().hasClass(t)&&e.insert(e.previous(),"after"),this.skipnodetop&&e.insert(this.skipnodetop,"before"),this.skipnodebottom&&e.insert(this.skipnodebottom,"after"),n=M.util.add_lightbox(a,e),o={sesskey:M.cfg.sesskey,courseid:this.get("courseid"),pagelayout:this.get("pagelayout"),pagetype:this.get("pagetype"),subpage:this.get("subpage"),contextid:this.get("contextid"),action:"move",bui_moveid:this.get_block_id(e),bui_newregion:this.get_block_region(o)},this.get("cmid")&&(o.cmid=this.get("cmid")),e.next("."+this.samenodeclass)&&!e.next("."+this.samenodeclass).hasClass(l)&&(o.bui_beforeid=this.get_block_id(e.next("."+this.samenodeclass))),a.io(M.cfg.wwwroot+u,{method:"POST",data:o,on:{start:function(){n.show()},success:function(e,o){window.setTimeout(function(){n.hide()},250);try{var t=a.JSON.parse(o.responseText);t.error&&new M.core.ajaxException(t)}catch(i){}},failure:function(e,o){this.ajax_failure(o),n.hide()}},context:this})}},{NAME:"core-blocks-dragdrop",ATTRS:{courseid:{value:null},cmid:{value:null},contextid:{value:null},pagelayout:{value:null},pagetype:{value:null},subpage:{value:null},regions:{value:null}}}),M.core=M.core||{},M.core.blockdraganddrop=M.core.blockdraganddrop||{},M.core.blockdraganddrop._isusingnewblocksmethod=null,M.core.blockdraganddrop.is_using_blocks_render_method=function(){var e,o;return null===this._isusingnewblocksmethod&&(e=a.all(".block-region[data-blockregion]").size(),o=a.all(".block-region").size(),this._isusingnewblocksmethod=o===e),this._isusingnewblocksmethod},M.core.blockdraganddrop.init=function(e){new(this.is_using_blocks_render_method()?o:i)(e)},M.core_blocks=M.core_blocks||{},M.core_blocks.init_dragdrop=function(e){M.core.blockdraganddrop.init(e)},(o=function(){o.superclass.constructor.apply(this,arguments)}).prototype={skipnodetop:null,skipnodebottom:null,regionobjects:{},initializer:function(){var e,o,t,i=this.get("regions"),n=0;for(n in this.groups=["block"],this.samenodeclass=r,this.parentnodeclass=d,this.detectkeyboarddirection=!0,0<(t=a.Node.all("body#"+_+" #"+b+" > ."+g)).size()&&((t=t.item(0)).addClass(d),t.set("id",g),t.one("div").addClass(g)),i)o=i[n],e=new s({manager:this,region:o,node:a.one("#block-region-"+o)}),this.regionobjects[o]=e,new a.DD.Drop({node:e.get_droptarget(),groups:this.groups,padding:"40 240 40 240"}),(o=new a.DD.Delegate({container:e.get_droptarget(),nodes:"."+r,target:!0,handles:[c.DRAGHANDLE],invalid:".block-hider-hide, .block-hider-show, .moveto, .block_fake",dragConfig:{groups:this.groups}})).dd.plug(a.Plugin.DDProxy,{moveOnEnd:!1}),o.dd.plug(a.Plugin.DDWinScroll),a.DD.DDM.on("ddm:start",this.enable_all_regions,this),e.change_block_move_icons(this)},get_block_id:function(e){return Number(e.get("id").replace(/inst/i,""))},get_block_region:function(e){return(e=e.test("[data-blockregion]")?e:e.ancestor( +"[data-blockregion]")).getData("blockregion")},get_region_object:function(e){return this.regionobjects[this.get_block_region(e)]},enable_all_regions:function(){var e,o=a.DD.DDM.activeDrag.get("groups");if(o&&-1!==a.Array.indexOf(o,"block"))for(e in this.regionobjects)this.regionobjects.hasOwnProperty(e)&&this.regionobjects[e].enable()},disable_regions_if_required:function(){var e=0;for(e in this.regionobjects)this.regionobjects[e].disable_if_required()},drag_start:function(e){e=e.target;e.get("node").previous()&&e.get("node").previous().hasClass(t)&&(this.skipnodetop=e.get("node").previous()),e.get("node").next()&&e.get("node").next().hasClass(h)&&(this.skipnodebottom=e.get("node").next())},drop_over:function(e){var o=e.drag.get("node"),e=e.drop.get("node");e.hasClass(g)&&e.one("."+l)&&e.one("."+l).next("."+r)&&e.prepend(o)},drop_end:function(){this.skipnodetop=null,this.skipnodebottom=null,this.disable_regions_if_required()},drag_dropmiss:function(e){this.drop_hit(e)},drop_hit:function(i){var n,e=i.drag.get("node"),o=i.drop.get("node");e.previous()&&e.previous().hasClass(t)&&e.insert(e.previous(),"after"),this.skipnodetop&&e.insert(this.skipnodetop,"before"),this.skipnodebottom&&e.insert(this.skipnodebottom,"after"),n=M.util.add_lightbox(a,e),o={sesskey:M.cfg.sesskey,courseid:this.get("courseid"),pagelayout:this.get("pagelayout"),pagetype:this.get("pagetype"),subpage:this.get("subpage"),contextid:this.get("contextid"),action:"move",bui_moveid:this.get_block_id(e),bui_newregion:this.get_block_region(o)},this.get("cmid")&&(o.cmid=this.get("cmid")),e.next("."+r)&&!e.next("."+r).hasClass(l)&&(o.bui_beforeid=this.get_block_id(e.next("."+r))),a.io(M.cfg.wwwroot+u,{method:"POST",data:o,on:{start:function(){n.show()},success:function(e,o){window.setTimeout(function(){n.hide()},250);try{var t=a.JSON.parse(o.responseText);t.error&&new M.core.ajaxException(t)}catch(i){}},failure:function(e,o){this.ajax_failure(o),n.hide()},complete:function(){this.disable_regions_if_required()}},context:this})}},a.extend(o,M.core.dragdrop,o.prototype,{NAME:"core-blocks-dragdrop-manager",ATTRS:{courseid:{value:null},cmid:{value:null},contextid:{value:null},pagelayout:{value:null},pagetype:{value:null},subpage:{value:null},regions:{value:[]}}}),(s=function(){s.superclass.constructor.apply(this,arguments)}).prototype={initializer:function(){var e=this.get("node"),e=e||this.create_and_add_node(),o=a.one("body"),e=0
                          ').addClass(d).setData("blockregion",t),i=this.get("manager").get("regions"),n=!1,s=!1,r=!1;for(e in i)i[e].match(/(pre|left)/)?n=i[e]:i[e].match(/(post|right)/)&&(s=i[e]);return!1!==n&&!1!==s&&(t===n?(t=a.one("#block-region-"+s))&&(t.insert(o,"before"),r=!0):(t=a.one("#block-region-"+n))&&(t.insert(o,"after"),r=!0)),!1===r&&a.one("body").append(o),this.set("node",o),o},change_block_move_icons:function(o){var t;this.get("node").all("."+r+" a."+n).each(function(e){e.setStyle("cursor","move"),t=o.get_drag_handle(e.getAttribute("title"),"","icon",!0),e.replace(t)})},get_has_region_class:function(){return"has-region-"+this.get("region")},get_empty_region_class:function(){return"empty-region-"+this.get("region")},get_used_region_class:function(){return"used-region-"+this.get("region")},get_droptarget:function(){var e=this.get("node");return e.test('[data-droptarget="1"]')?e:e.one('[data-droptarget="1"]')},enable:function(){a.one("body").addClass(this.get_used_region_class()).removeClass(this.get_empty_region_class())},disable_if_required:function(){0===this.get("node").all("."+r).size()&&a.one("body").addClass(this.get_empty_region_class()).removeClass(this.get_used_region_class())}},a.extend(s,a.Base,s.prototype,{NAME:"core-blocks-dragdrop-blockregion",ATTRS:{manager:{writeOnce:"initOnly",validator:function(e){return a.Lang.isObject(e)&&e instanceof o}},region:{writeOnce:"initOnly",validator:function(e){return a.Lang.isString(e)}},node:{validator:function(e){return a.Lang.isObject(e)||a.Lang.isNull(e)}},hasblocks:{value:!1,validator:function(e){return a.Lang.isBoolean(e)}}}})},"@VERSION@",{requires:["base","node","io","dom","dd","dd-scroll","moodle-core-dragdrop","moodle-core-notification"]}); \ No newline at end of file diff --git a/lib/yui/build/moodle-core-chooserdialogue/moodle-core-chooserdialogue-min.js b/lib/yui/build/moodle-core-chooserdialogue/moodle-core-chooserdialogue-min.js index 9af91eff2e2..56956595cd1 100644 --- a/lib/yui/build/moodle-core-chooserdialogue/moodle-core-chooserdialogue-min.js +++ b/lib/yui/build/moodle-core-chooserdialogue/moodle-core-chooserdialogue-min.js @@ -1 +1 @@ -YUI.add("moodle-core-chooserdialogue",function(s,e){var t=function(){t.superclass.constructor.apply(this,arguments)};s.extend(t,s.Base,{panel:null,submitbutton:null,container:null,listenevents:[],bodycontent:null,headercontent:null,instanceconfig:null,hiddenRadioValue:null,setup_chooser_dialogue:function(e,t,i){this.bodycontent=e,this.headercontent=t,this.instanceconfig=i},prepare_chooser:function(){if(!this.panel){s.one(s.config.doc.body).addClass("jschooser");var e,t={bodyContent:this.bodycontent.get("innerHTML"),headerContent:this.headercontent.get("innerHTML"),width:"540px",draggable:!0,visible:!1,zindex:100,modal:!0,shim:!0,closeButtonTitle:this.get("closeButtonTitle"),focusOnPreviousTargetAfterHide:!0,render:!1,extraClasses:this._getClassNames()};for(e in this.instanceconfig)t[e]=this.instanceconfig[e];this.panel=new M.core.dialogue(t),this.bodycontent.remove(),this.headercontent.remove(),this.panel.hide(),this.panel.render(),this.container=this.panel.get("boundingBox").one(".choosercontainer"),this.options=this.container.all(".option input[type=radio]"),this.hiddenRadioValue=s.Node.create(''),this.container.one("form").appendChild(this.hiddenRadioValue),this.panel.get("boundingBox").addClass("chooserdialogue")}},display_chooser:function(e){var t,i,n;this.prepare_chooser(),e.preventDefault(),t=this.panel.get("boundingBox"),i=this.container.one(".alloptions"),n=s.one("document").on("orientationchange",function(){this.center_dialogue(i)},this),this.listenevents.push(n),n=s.one("window").on("resize",function(){this.center_dialogue(i)},this),this.listenevents.push(n),n=this.container.on("click",this.check_options,this),this.listenevents.push(n),n=this.container.on("key_up",this.check_options,this),this.listenevents.push(n),n=this.container.on("dblclick",function(e){e.target.ancestor("div.option")&&(this.check_options(),this.submitbutton.setAttribute("disabled","disabled"),this.options.setAttribute("disabled","disabled"),this.cancel_listenevents(),this.container.one("form").submit())},this),this.listenevents.push(n),this.container.one("form").on("submit",function(){this.submitbutton.setAttribute("disabled","disabled"),this.options.setAttribute("disabled","disabled"),this.cancel_listenevents()},this),n=this.container.one(".addcancel").on("click",this.cancel_popup,this),this.listenevents.push(n),n=t.one("button.closebutton").on("click",this.cancel_popup,this),this.listenevents.push(n),n=s.one("document").on("keydown",this.handle_key_press,this),this.listenevents.push(n),this.submitbutton=this.container.one(".submitbutton"),this.submitbutton.set("disabled","true"),this.options.removeAttribute("disabled"),this.panel.show(e),this.center_dialogue(i),this.container.one(".option input[type=radio]").focus(),this.check_options()},cancel_listenevents:function(){for(;this.listenevents.length;)this.listenevents.shift().detach()},center_dialogue:function(e){var t,i,n,s=this.panel.get("boundingBox"),o=s.get("winHeight");if(this.panel.shouldResizeFullscreen())return e.setStyle("maxHeight","100%"),e.setStyle("height","auto"),void this.panel.makeResponsive();o<=(t=this.get("maxheight"))&&(t=o<=this.get("minheight")?this.get("minheight"):o),t>this.get("minheight")?this.panel.lockScroll&&!this.panel.lockScroll.isActive()&&this.panel.lockScroll.enableScrollLock(!0):this.panel.lockScroll&&this.panel.lockScroll.isActive()&&this.panel.lockScroll.disableScrollLock(),i=t,t-=156,e.setStyle("maxHeight",t+"px"),(n=(n=s.getStyle("height")).match(/.*px$/)?n.replace(/px$/,""):i)'),this.container.one("form").appendChild(this.hiddenRadioValue),this.panel.get("boundingBox").addClass("chooserdialogue")}},display_chooser:function(e){var t,i,n;this.prepare_chooser(),e.preventDefault(),t=this.panel.get("boundingBox"),i=this.container.one(".alloptions"),n=s.one("document").on("orientationchange",function(){this.center_dialogue(i)},this),this.listenevents.push(n),n=s.one("window").on("resize",function(){this.center_dialogue(i)},this),this.listenevents.push(n),n=this.container.on("click",this.check_options,this),this.listenevents.push(n),n=this.container.on("key_up",this.check_options,this),this.listenevents.push(n),n=this.container.on("dblclick",function(e){e.target.ancestor("div.option")&&(this.check_options(),this.submitbutton.setAttribute("disabled","disabled"),this.options.setAttribute("disabled","disabled"),this.cancel_listenevents(),this.container.one("form").submit())},this),this.listenevents.push(n),this.container.one("form").on("submit",function(){this.submitbutton.setAttribute("disabled","disabled"),this.options.setAttribute("disabled","disabled"),this.cancel_listenevents()},this),n=this.container.one(".addcancel").on("click",this.cancel_popup,this),this.listenevents.push(n),n=t.one("button.closebutton").on("click",this.cancel_popup,this),this.listenevents.push(n),n=s.one("document").on("keydown",this.handle_key_press,this),this.listenevents.push(n),this.submitbutton=this.container.one(".submitbutton"),this.submitbutton.set("disabled","true"),this.options.removeAttribute("disabled"),this.panel.show(e),this.center_dialogue(i),this.container.one(".option input[type=radio]").focus(),this.check_options()},cancel_listenevents:function(){for(;this.listenevents.length;)this.listenevents.shift().detach()},center_dialogue:function(e){var t,i=this.panel.get("boundingBox"),n=i.get("winHeight");if(this.panel.shouldResizeFullscreen())return e.setStyle("maxHeight","100%"),e.setStyle("height","auto"),void this.panel.makeResponsive();(t=n<=(t=this.get("maxheight"))?n<=this.get("minheight")?this.get("minheight"):n:t)>this.get("minheight")?this.panel.lockScroll&&!this.panel.lockScroll.isActive()&&this.panel.lockScroll.enableScrollLock(!0):this.panel.lockScroll&&this.panel.lockScroll.isActive()&&this.panel.lockScroll.disableScrollLock(),n=t,e.setStyle("maxHeight",(t-=156)+"px"),(t=(t=i.getStyle("height")).match(/.*px$/)?t.replace(/px$/,""):n)").addClass(e).setAttribute("title",t).setAttribute("tabIndex",0).setAttribute("data-draggroups",this.groups).setAttribute("role","button");return r.addClass(i),window.require(["core/templates"],function(t){t.renderPix("i/move_2d","core").then(function(t){var e=h.Node.create(t);e.setStyle("cursor","move"),void 0!==o&&e.addClass(o),r.appendChild(e)})}),r},lock_drag_handle:function(t,e){t.removeHandle("."+e)},unlock_drag_handle:function(t,e){t.addHandle("."+e),t.get("activeHandle").focus()},ajax_failure:function(t){var e={name:t.status+" "+t.statusText,message:t.responseText};return new M.core.exception(e)},in_group:function(e){var o=!1;return h.each(this.groups,function(t){e._groups[t]&&(o=!0)},this),o},global_drag_start:function(t){var e=t.target;this.in_group(e)&&(this.originalstyle=e.get("node").getAttribute("style"),e.get("node").setStyle("opacity",".25"),e.get("dragNode").setStyles({opacity:".75",borderColor:e.get("node").getStyle("borderColor"),backgroundColor:e.get("node").getStyle("backgroundColor")}),e.get("dragNode").empty(),this.drag_start(t))},global_drag_end:function(t){var e=t.target;this.in_group(e)&&(e.get("node").setAttribute("style",this.originalstyle),this.drag_end(t))},global_drag_drag:function(t){var e=t.target,o=t.info;this.in_group(e)&&(o.start[1]o.xy[1]&&(this.absgoingup=!1),o.delta[1]<0?this.goingup=!0:0
                        ")).addClass("dragdrop-keyboard-drag"),h.all("."+this.samenodeclass+", ."+this.parentnodeclass).each(function(t){var e,o,r,a=!1,n=t,d=t.getAttribute("class").split(" ").join(", .");if(t.drop&&t.drop.inGroup(this.groups)&&t.drop.get("node")!==i&&(t.next(d)!==i||this.detectkeyboarddirection))a=!0;else for(e=t.getAttribute("data-draggroups").split(" "),o=0;o"),p=h.Node.create(""),s=this.find_element_text(n),u=this.samenodelabel&&t.hasClass(this.samenodeclass)?M.util.get_string(this.samenodelabel.identifier,this.samenodelabel.component,s):this.parentnodelabel&&t.hasClass(this.parentnodeclass)?M.util.get_string(this.parentnodelabel.identifier,this.parentnodelabel.component,s):M.util.get_string("tocontent","moodle",s),p.setContent(u),p.setAttribute("data-drop-target",t.get("id")),p.setAttribute("tabindex","0"),p.on("click",this.global_keyboard_drop,this),p.on("key",this.global_keyboard_drop,"down:enter,32",this),g.append(p),l.append(g))},this),M.core.dragdrop.dropui=new M.core.dialogue({headerContent:o,bodyContent:l,draggable:!0,visible:!0,center:!0,modal:!0}),M.core.dragdrop.dropui.after("visibleChange",function(t){t.prevVal&&!t.newVal&&this.global_cancel_keyboard_drag()},this),l.one("a")&&l.one("a").focus()},simulated_drag_drop_event:function(t,e){var o=function(t){this.node=t};o.prototype.get=function(t){return"node"===t||"dragNode"===t||"dropNode"===t?this.node:"activeHandle"===t?this.node.one(".editing_move"):null},o.prototype.inGroup=function(){return!0},o.prototype.addHandle=function(){},o.prototype.removeHandle=function(){},this.drop=new o(e),this.drag=new o(t),this.target=this.drop},global_keyboard_drop:function(t){var e,o,r=M.core.dragdrop.keydragcontainer,a=h.one("#"+t.target.getAttribute("data-drop-target"));M.core.dragdrop.dropui.hide(),t.preventDefault(),this.detectkeyboarddirection&&r.getY()>a.getY()?(this.absgoingup=!0,this.goingup=!0):( -this.absgoingup=!1,this.goingup=!1),e=new this.simulated_drag_drop_event(r,r),o=new this.simulated_drag_drop_event(r,a),this.drag_start(e),this.global_drop_over(o),a.hasClass(this.parentnodeclass)&&a.contains(r)&&a.prepend(r),this.global_drop_hit(o)},global_cancel_keyboard_drag:function(){M.core.dragdrop.keydragcontainer&&(M.core.dragdrop.keydraghandle.focus(),M.core.dragdrop.keydragcontainer=null),M.core.dragdrop.dropui&&M.core.dragdrop.dropui.destroy()},global_keydown:function(t){var e,o,r,a,n,d=t.target.ancestor("."+i,!0);if(null!==d){if(27===t.keyCode)return this.global_cancel_keyboard_drag(),void t.preventDefault();if(d.hasClass(i)&&(13===t.keyCode||32===t.keyCode||"click"===t.type)){for(o=d.getAttribute("data-draggroups").split(" "),n=!1,r=0;r").addClass(e).setAttribute("title",t).setAttribute("tabIndex",0).setAttribute("data-draggroups",this.groups).setAttribute("role","button");return r.addClass(i),window.require(["core/templates"],function(t){t.renderPix("i/move_2d","core").then(function(t){t=h.Node.create(t);t.setStyle("cursor","move"),void 0!==o&&t.addClass(o),r.appendChild(t)})}),r},lock_drag_handle:function(t,e){t.removeHandle("."+e)},unlock_drag_handle:function(t,e){t.addHandle("."+e),t.get("activeHandle").focus()},ajax_failure:function(t){t={name:t.status+" "+t.statusText,message:t.responseText};return new M.core.exception(t)},in_group:function(e){var o=!1;return h.each(this.groups,function(t){e._groups[t]&&(o=!0)},this),o},global_drag_start:function(t){var e=t.target;this.in_group(e)&&(this.originalstyle=e.get("node").getAttribute("style"),e.get("node").setStyle("opacity",".25"),e.get("dragNode").setStyles({opacity:".75",borderColor:e.get("node").getStyle("borderColor"),backgroundColor:e.get("node").getStyle("backgroundColor")}),e.get("dragNode").empty(),this.drag_start(t))},global_drag_end:function(t){var e=t.target;this.in_group(e)&&(e.get("node").setAttribute("style",this.originalstyle),this.drag_end(t))},global_drag_drag:function(t){var e=t.target,o=t.info;this.in_group(e)&&(o.start[1]o.xy[1]&&(this.absgoingup=!1),o.delta[1]<0?this.goingup=!0:0
                      ")).addClass("dragdrop-keyboard-drag"),h.all("."+this.samenodeclass+", ."+this.parentnodeclass).each(function(t){var e,o,r,a=!1,n=t,d=t.getAttribute("class").split(" ").join(", .");if(t.drop&&t.drop.inGroup(this.groups)&&t.drop.get("node")!==i&&(t.next(d)!==i||this.detectkeyboarddirection))a=!0;else for(e=t.getAttribute("data-draggroups").split(" "),o=0;o
                    • "),p=h.Node.create(""),s=this.find_element_text(n),u=this.samenodelabel&&t.hasClass(this.samenodeclass)?M.util.get_string(this.samenodelabel.identifier,this.samenodelabel.component,s):this.parentnodelabel&&t.hasClass(this.parentnodeclass)?M.util.get_string(this.parentnodelabel.identifier,this.parentnodelabel.component,s):M.util.get_string("tocontent","moodle",s),p.setContent(u),p.setAttribute("data-drop-target",t.get("id")),p.setAttribute("tabindex","0"),p.on("click",this.global_keyboard_drop,this),p.on("key",this.global_keyboard_drop,"down:enter,32",this),g.append(p),l.append(g))},this),M.core.dragdrop.dropui=new M.core.dialogue({headerContent:e,bodyContent:l,draggable:!0,visible:!0,center:!0,modal:!0}),M.core.dragdrop.dropui.after("visibleChange",function(t){t.prevVal&&!t.newVal&&this.global_cancel_keyboard_drag()},this),l.one("a")&&l.one("a").focus()},simulated_drag_drop_event:function(t,e){var o=function(t){this.node=t};o.prototype.get=function(t){return"node"===t||"dragNode"===t||"dropNode"===t?this.node:"activeHandle"===t?this.node.one(".editing_move"):null},o.prototype.inGroup=function(){return!0},o.prototype.addHandle=function(){},o.prototype.removeHandle=function(){},this.drop=new o(e),this.drag=new o(t),this.target=this.drop},global_keyboard_drop:function(t){var e,o=M.core.dragdrop.keydragcontainer,r=h.one("#"+t.target.getAttribute("data-drop-target"));M.core.dragdrop.dropui.hide(),t.preventDefault(),this.detectkeyboarddirection&&o.getY()>r.getY()?(this.absgoingup=!0,this.goingup=!0):(this.absgoingup=!1, +this.goingup=!1),t=new this.simulated_drag_drop_event(o,o),e=new this.simulated_drag_drop_event(o,r),this.drag_start(t),this.global_drop_over(e),r.hasClass(this.parentnodeclass)&&r.contains(o)&&r.prepend(o),this.global_drop_hit(e)},global_cancel_keyboard_drag:function(){M.core.dragdrop.keydragcontainer&&(M.core.dragdrop.keydraghandle.focus(),M.core.dragdrop.keydragcontainer=null),M.core.dragdrop.dropui&&M.core.dragdrop.dropui.destroy()},global_keydown:function(t){var e,o,r,a,n,d=t.target.ancestor("."+i,!0);if(null!==d){if(27===t.keyCode)return this.global_cancel_keyboard_drag(),void t.preventDefault();if(d.hasClass(i)&&(13===t.keyCode||32===t.keyCode||"click"===t.type)){for(o=d.getAttribute("data-draggroups").split(" "),n=!1,r=0;r'+d.Escape.html(e.name)+"",d.WidgetStdMod.REPLACE),t=d.Node.create('
                      ').append(d.Node.create('
                      '+d.Escape.html(this.get("error"))+"
                      ")).append(d.Node.create('")).append(d.Node.create('")).append(d.Node.create('")),M.cfg.developerdebug&&t.all(".moodle-exception-param").removeClass("hidden"),this.setStdModContent(d.WidgetStdMod.BODY,t,d.WidgetStdMod.REPLACE),o&&(this._hideTimeout=setTimeout(function(){i.hide()},o)),this.after("visibleChange",this.visibilityChanged,this),this._keypress=d.on("key",this.hide,window,"down:13, 27",this),this.centerDialogue()},visibilityChanged:function(e){if("visible"===e.attrName&&e.prevVal&&!e.newVal){var t=this;this._keypress.detach(),setTimeout(function(){t.destroy()},1e3)}}},{NAME:t,CSS_PREFIX:"moodle-dialogue",ATTRS:{error:{validator:d.Lang.isString,value:M.util.get_string("unknownerror","moodle")},debuginfo:{value:null},stacktrace:{value:null},reproductionlink:{setter:function(e){return null!==e&&(e=''+e.replace(M.cfg.wwwroot,"")+""),e},value:null},hideTimeoutDelay:{validator:d.Lang.isNumber,value:null}}}),M.core.ajaxException=i},"@VERSION@",{requires:["moodle-core-notification-dialogue"]}); \ No newline at end of file +YUI.add("moodle-core-notification-ajaxexception",function(a,e){var t;M.core=M.core||{},a.extend(t=function(e){e.name=e.name||M.util.get_string("error","moodle"),e.closeButton=!0,t.superclass.constructor.apply(this,[e])},M.core.notification.info,{_keypress:null,initializer:function(e){var t=this,i=this.get("hideTimeoutDelay"),o=M.util.get_string("labelsep","langconfig");this.get("notificationBase").addClass("moodle-dialogue-exception"),this.setStdModContent(a.WidgetStdMod.HEADER,'

                      '+a.Escape.html(e.name)+"

                      ",a.WidgetStdMod.REPLACE),e=a.Node.create('
                      ').append(a.Node.create('
                      '+a.Escape.html(this.get("error"))+"
                      ")).append(a.Node.create('")).append(a.Node.create('")).append(a.Node.create('")),M.cfg.developerdebug&&e.all(".moodle-exception-param").removeClass("hidden"),this.setStdModContent(a.WidgetStdMod.BODY,e,a.WidgetStdMod.REPLACE),i&&(this._hideTimeout=setTimeout(function(){t.hide()},i)),this.after("visibleChange",this.visibilityChanged,this),this._keypress=a.on("key",this.hide,window,"down:13, 27",this),this.centerDialogue()},visibilityChanged:function(e){var t;"visible"===e.attrName&&e.prevVal&&!e.newVal&&((t=this)._keypress.detach(),setTimeout(function(){t.destroy()},1e3))}},{NAME:"Moodle AJAX exception",CSS_PREFIX:"moodle-dialogue",ATTRS:{error:{validator:a.Lang.isString,value:M.util.get_string("unknownerror","moodle")},debuginfo:{value:null},stacktrace:{value:null},reproductionlink:{setter:function(e){return e=null!==e?''+e.replace(M.cfg.wwwroot,"")+"":e},value:null},hideTimeoutDelay:{validator:a.Lang.isNumber,value:null}}}),M.core.ajaxException=t},"@VERSION@",{requires:["moodle-core-notification-dialogue"]}); \ No newline at end of file diff --git a/lib/yui/build/moodle-core-notification-alert/moodle-core-notification-alert-min.js b/lib/yui/build/moodle-core-notification-alert/moodle-core-notification-alert-min.js index eeebc2cd61b..8b33ceff805 100644 --- a/lib/yui/build/moodle-core-notification-alert/moodle-core-notification-alert-min.js +++ b/lib/yui/build/moodle-core-notification-alert/moodle-core-notification-alert-min.js @@ -1 +1 @@ -YUI.add("moodle-core-notification-alert",function(o,t){var e,i;M.core=M.core||{},e="Moodle alert",i=function(t){t.closeButton=!1,i.superclass.constructor.apply(this,[t])},o.extend(i,M.core.notification.info,{_closeEvents:null,initializer:function(){var t,e,i;this._closeEvents=[],this.publish("complete"),t=o.Node.create(''),e=o.Node.create('
                      ').append(o.Node.create('
                      '+this.get("message")+"
                      ")).append(o.Node.create('
                      ').append(t)),this.get("notificationBase").addClass("moodle-dialogue-confirm"),this.setStdModContent(o.WidgetStdMod.BODY,e,o.WidgetStdMod.REPLACE),this.setStdModContent(o.WidgetStdMod.HEADER,'

                      '+this.get("title")+"

                      ",o.WidgetStdMod.REPLACE),this._closeEvents.push(o.on("key",this.submit,window,"down:13",this),t.on("click",this.submit,this)),(i=this.get("boundingBox").one(".closebutton"))&&this._closeEvents.push(i.on("click",this.submit,this))},submit:function(){new o.EventHandle(this._closeEvents).detach(),this.fire("complete"),this.hide(),this.destroy()}},{NAME:e,CSS_PREFIX:"moodle-dialogue",ATTRS:{title:{validator:o.Lang.isString,value:"Alert"},message:{validator:o.Lang.isString,value:"Confirm"},yesLabel:{validator:o.Lang.isString,setter:function(t){return t=t||"OK"},value:"OK"}}}),M.core.alert=i},"@VERSION@",{requires:["moodle-core-notification-dialogue"]}); \ No newline at end of file +YUI.add("moodle-core-notification-alert",function(i,t){var e;M.core=M.core||{},i.extend(e=function(t){t.closeButton=!1,e.superclass.constructor.apply(this,[t])},M.core.notification.info,{_closeEvents:null,initializer:function(){var t,e;this._closeEvents=[],this.publish("complete"),t=i.Node.create(''),e=i.Node.create('
                      ').append(i.Node.create('
                      '+this.get("message")+"
                      ")).append(i.Node.create('
                      ').append(t)),this.get("notificationBase").addClass("moodle-dialogue-confirm"),this.setStdModContent(i.WidgetStdMod.BODY,e,i.WidgetStdMod.REPLACE),this.setStdModContent(i.WidgetStdMod.HEADER,'

                      '+this.get("title")+"

                      ",i.WidgetStdMod.REPLACE),this._closeEvents.push(i.on("key",this.submit,window,"down:13",this),t.on("click",this.submit,this)),(e=this.get("boundingBox").one(".closebutton"))&&this._closeEvents.push(e.on("click",this.submit,this))},submit:function(){new i.EventHandle(this._closeEvents).detach(),this.fire("complete"),this.hide(),this.destroy()}},{NAME:"Moodle alert",CSS_PREFIX:"moodle-dialogue",ATTRS:{title:{validator:i.Lang.isString,value:"Alert"},message:{validator:i.Lang.isString,value:"Confirm"},yesLabel:{validator:i.Lang.isString,setter:function(t){return t=t||"OK"},value:"OK"}}}),M.core.alert=e},"@VERSION@",{requires:["moodle-core-notification-dialogue"]}); \ No newline at end of file diff --git a/lib/yui/build/moodle-core-notification-confirm/moodle-core-notification-confirm-min.js b/lib/yui/build/moodle-core-notification-confirm/moodle-core-notification-confirm-min.js index 35f40f7d72a..ebed1037822 100644 --- a/lib/yui/build/moodle-core-notification-confirm/moodle-core-notification-confirm-min.js +++ b/lib/yui/build/moodle-core-notification-confirm/moodle-core-notification-confirm-min.js @@ -1 +1 @@ -YUI.add("moodle-core-notification-confirm",function(i,t){var e,o;M.core=M.core||{},e="Moodle confirmation dialogue",o=function(t){o.superclass.constructor.apply(this,[t])},i.extend(o,M.core.notification.info,{_closeEvents:null,_yesButton:null,_noButton:null,_question:null,initializer:function(){var t,e;this._closeEvents=[],this.publish("complete"),this.publish("complete-yes"),this.publish("complete-no"),this._yesButton=i.Node.create(''),this._noButton=i.Node.create(''),this._question=i.Node.create('
                      '+this.get("question")+"
                      "),t=i.Node.create('
                      ').append(this._question).append(i.Node.create('
                      ').append(this._yesButton).append(this._noButton)),this.get("notificationBase").addClass("moodle-dialogue-confirm"),this.setStdModContent(i.WidgetStdMod.BODY,t,i.WidgetStdMod.REPLACE),this.setStdModContent(i.WidgetStdMod.HEADER,'

                      '+this.get("title")+"

                      ",i.WidgetStdMod.REPLACE),this._closeEvents.push(i.on("key",this.submit,window,"down:27",this,!1),this._yesButton.on("click",this.submit,this,!0),this._noButton.on("click",this.submit,this,!1)),(e=this.get("boundingBox").one(".closebutton"))&&this._closeEvents.push(e.on("click",this.submit,this))},submit:function(t,e){new i.EventHandle(this._closeEvents).detach(),this.fire("complete",e),e?this.fire("complete-yes"):this.fire("complete-no"),this.hide(),this.destroy()}},{NAME:e,CSS_PREFIX:"moodle-dialogue",ATTRS:{yesLabel:{validator:i.Lang.isString,valueFn:function(){return M.util.get_string("yes","moodle")},setter:function(t){return this._yesButton&&this._yesButton.set("value",t),t}},noLabel:{validator:i.Lang.isString,valueFn:function(){return M.util.get_string("no","moodle")},setter:function(t){return this._noButton&&this._noButton.set("value",t),t}},title:{validator:i.Lang.isString,value:M.util.get_string("confirm","moodle")},question:{validator:i.Lang.isString,valueFn:function(){return M.util.get_string("areyousure","moodle")},setter:function(t){return this._question&&this._question.set("value",t),t}}}}),i.augment(o,i.EventTarget),M.core.confirm=o},"@VERSION@",{requires:["moodle-core-notification-dialogue"]}); \ No newline at end of file +YUI.add("moodle-core-notification-confirm",function(i,t){var e;M.core=M.core||{},i.extend(e=function(t){e.superclass.constructor.apply(this,[t])},M.core.notification.info,{_closeEvents:null,_yesButton:null,_noButton:null,_question:null,initializer:function(){var t;this._closeEvents=[],this.publish("complete"),this.publish("complete-yes"),this.publish("complete-no"),this._yesButton=i.Node.create(''),this._noButton=i.Node.create(''),this._question=i.Node.create('
                      '+this.get("question")+"
                      "),t=i.Node.create('
                      ').append(this._question).append(i.Node.create('
                      ').append(this._yesButton).append(this._noButton)),this.get("notificationBase").addClass("moodle-dialogue-confirm"),this.setStdModContent(i.WidgetStdMod.BODY,t,i.WidgetStdMod.REPLACE),this.setStdModContent(i.WidgetStdMod.HEADER,'

                      '+this.get("title")+"

                      ",i.WidgetStdMod.REPLACE),this._closeEvents.push(i.on("key",this.submit,window,"down:27",this,!1),this._yesButton.on("click",this.submit,this,!0),this._noButton.on("click",this.submit,this,!1)),(t=this.get("boundingBox").one(".closebutton"))&&this._closeEvents.push(t.on("click",this.submit,this))},submit:function(t,e){new i.EventHandle(this._closeEvents).detach(),this.fire("complete",e),e?this.fire("complete-yes"):this.fire("complete-no"),this.hide(),this.destroy()}},{NAME:"Moodle confirmation dialogue",CSS_PREFIX:"moodle-dialogue",ATTRS:{yesLabel:{validator:i.Lang.isString,valueFn:function(){return M.util.get_string("yes","moodle")},setter:function(t){return this._yesButton&&this._yesButton.set("value",t),t}},noLabel:{validator:i.Lang.isString,valueFn:function(){return M.util.get_string("no","moodle")},setter:function(t){return this._noButton&&this._noButton.set("value",t),t}},title:{validator:i.Lang.isString,value:M.util.get_string("confirm","moodle")},question:{validator:i.Lang.isString,valueFn:function(){return M.util.get_string("areyousure","moodle")},setter:function(t){return this._question&&this._question.set("value",t),t}}}}),i.augment(e,i.EventTarget),M.core.confirm=e},"@VERSION@",{requires:["moodle-core-notification-dialogue"]}); \ No newline at end of file diff --git a/lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue-min.js b/lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue-min.js index 56cfc98f8fa..106e363fa3e 100644 --- a/lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue-min.js +++ b/lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue-min.js @@ -1,2 +1,2 @@ -YUI.add("moodle-core-notification-dialogue",function(n,e){var t,a,i,s,l,d,r,u,h,o,c,g="moodle-dialogue",f="notificationBase",v={BASE:"moodle-dialogue-base",WRAP:"moodle-dialogue-wrap",HEADER:"moodle-dialogue-hd",BODY:"moodle-dialogue-bd",CONTENT:"moodle-dialogue-content",FOOTER:"moodle-dialogue-ft",HIDDEN:"hidden",LIGHTBOX:"moodle-dialogue-lightbox"};M.core=M.core||{},t="Moodle dialogue",i=g+"-fullscreen",s=g+"-hidden",l=" [role=dialog]",d="[role=menubar]",r=".",u="moodle-has-zindex",h='input:not([type="hidden"]), a[href], button, textarea, select, [tabindex]',o="form",a=function(e){var t="moodle-dialogue-"+n.stamp(this)+"-wrap";e.notificationBase=n.Node.create('
                      ').append(n.Node.create('').append(n.Node.create('
                      ')).append(n.Node.create('
                      ')).append(n.Node.create('
                      '))),n.one(document.body).append(e.notificationBase),e.srcNode="#"+t,delete e.buttons,a.superclass.constructor.apply(this,[e])},n.extend(a,n.Panel,{_resizeevent:null,_orientationevent:null,_calculatedzindex:!1,_currentMaskNodeId:null,_originalPosition:null,_hiddenSiblings:null,hideIfNotForm:function(){null===this.get("boundingBox").one(o)&&this.hide()},initializer:function(){var e,t,i,o;!1!==this.get("closeButton")&&(t=this.get("closeButtonTitle"),this.get("buttons").header[0].setAttribute("title",t),this.get("buttons").header[0].setAttribute("aria-label",t)),this._hiddenSiblings=[],this.get("render")&&this.render(),this.after("visibleChange",this.visibilityChanged,this),this.get("center")&&this.centerDialogue(),this.get("modal")&&(this.get(f).set("aria-hidden","true"),this.plug(n.M.core.LockScroll)),this.set("focusOn",n.Array(this.get("focusOn")).filter(function(e){return"focusoutside"!==e.eventName})),(e=this.get("boundingBox")).addClass(u),n.Array.each(this.get("extraClasses"),e.addClass,e),this.get("visible")&&this.applyZIndex(),this.on("maskShow",this.applyZIndex),this.on("maskShow",function(){var e,t=n.one(n.config.win),i=this.get("boundingBox");this.get("center")||(this._originalPosition=i.getXY()),e=this.get("maskNode"),this._currentMaskNodeId!==e.get("_yuid")&&(this._currentMaskNodeId=e.get("_yuid"),e.on("click",this.hideIfNotForm,this)),"fixed"!==i.getStyle("position")&&i.setStyles({top:t.get("scrollTop"),left:t.get("scrollLeft")})},this),i=this.get("notificationBase"),""!==(o=this.get("additionalBaseClass"))&&i.addClass(o),this.after("destroyedChange",function(){this.get(f).remove(!0)},this)},applyZIndex:function(){var i=1040,e=1,t=this.get("boundingBox"),o=this.get("maskNode"),s=this.get("zIndex");0===s||this._calculatedzindex?(n.all(l+", "+d+", "+r+u).each(function(e){var t=this.findZIndex(e);i').append(n.Node.create('').append(n.Node.create('
                      ')).append(n.Node.create('
                      ')).append(n.Node.create('
                      '))),n.one(document.body).append(e.notificationBase),e.srcNode="#"+t,delete e.buttons,a.superclass.constructor.apply(this,[e])},n.Panel,{_resizeevent:null,_orientationevent:null,_calculatedzindex:!"form",_currentMaskNodeId:null,_originalPosition:null,_hiddenSiblings:null,hideIfNotForm:function(){null===this.get("boundingBox").one("form")&&this.hide()},initializer:function(){var e,t;!1!==this.get("closeButton")&&(e=this.get("closeButtonTitle"),this.get("buttons").header[0].setAttribute("title",e),this.get("buttons").header[0].setAttribute("aria-label",e)),this._hiddenSiblings=[],this.get("render")&&this.render(),this.after("visibleChange",this.visibilityChanged,this),this.get("center")&&this.centerDialogue(),this.get("modal")&&(this.get(o).set("aria-hidden","true"),this.plug(n.M.core.LockScroll)),this.set("focusOn",n.Array(this.get("focusOn")).filter(function(e){return"focusoutside"!==e.eventName})),(e=this.get("boundingBox")).addClass(l),n.Array.each(this.get("extraClasses"),e.addClass,e),this.get("visible")&&this.applyZIndex(),this.on("maskShow",this.applyZIndex),this.on("maskShow",function(){var e,t=n.one(n.config.win),i=this.get("boundingBox");this.get("center")||(this._originalPosition=i.getXY()),e=this.get("maskNode"),this._currentMaskNodeId!==e.get("_yuid")&&(this._currentMaskNodeId=e.get("_yuid"),e.on("click",this.hideIfNotForm,this)),"fixed"!==i.getStyle("position")&&i.setStyles({top:t.get("scrollTop"),left:t.get("scrollLeft")})},this),e=this.get("notificationBase"),""!==(t=this.get("additionalBaseClass"))&&e.addClass(t),this.after("destroyedChange",function(){this.get(o).remove(!0)},this)},applyZIndex:function(){var e,t=1040,i=this.get("boundingBox"),o=this.get("maskNode"),s=this.get("zIndex");0===s||this._calculatedzindex?(n.all(" [role=dialog], [role=menubar], ."+l).each(function(e){e=this.findZIndex(e);t'+l.Escape.html(e.name)+"",l.WidgetStdMod.REPLACE),i=l.Node.create('
                      ').append(l.Node.create('
                      '+l.Escape.html(this.get("message"))+"
                      ")).append(l.Node.create('")).append(l.Node.create('")).append(l.Node.create('")),M.cfg.developerdebug&&i.all(".moodle-exception-param").removeClass("hidden"),this.setStdModContent(l.WidgetStdMod.BODY,i,l.WidgetStdMod.REPLACE),a&&(this._hideTimeout=setTimeout(function(){t.hide()},a)),this.after("visibleChange",this.visibilityChanged,this),this._keypress=l.on("key",this.hide,window,"down:13,27",this),this.centerDialogue()},visibilityChanged:function(e){if("visible"===e.attrName&&e.prevVal&&!e.newVal){this._keypress&&this._keypress.detach();var i=this;setTimeout(function(){i.destroy()},1e3)}}},{NAME:i,CSS_PREFIX:"moodle-dialogue",ATTRS:{message:{value:""},name:{value:""},fileName:{value:""},lineNumber:{value:""},stack:{setter:function(e){var i,t=l.Escape.html(e).split("\n"),a=new RegExp("^(.+)@("+M.cfg.wwwroot+")?(.{0,75}).*:(\\d+)$");for(i in t)t[i]=t[i].replace(a,"
                      ln: $4
                      $3
                      $1
                      ");return t.join("\n")},value:""},hideTimeoutDelay:{validator:l.Lang.isNumber,value:null}}}),M.core.exception=a},"@VERSION@",{requires:["moodle-core-notification-dialogue"]}); \ No newline at end of file +YUI.add("moodle-core-notification-exception",function(o,e){var a;M.core=M.core||{},o.extend(a=function(i){var t=o.mix({},i);t.width=t.width||M.cfg.developerdebug?Math.floor(o.one(document.body).get("winWidth")/3)+"px":null,t.closeButton=!0,o.Array.each(["message","name","fileName","lineNumber","stack"],function(e){t[e]=i[e]}),a.superclass.constructor.apply(this,[t])},M.core.notification.info,{_hideTimeout:null,_keypress:null,initializer:function(e){var i=this,t=this.get("hideTimeoutDelay"),a=M.util.get_string("labelsep","langconfig");this.get("notificationBase").addClass("moodle-dialogue-exception"),this.setStdModContent(o.WidgetStdMod.HEADER,'

                      '+o.Escape.html(e.name)+"

                      ",o.WidgetStdMod.REPLACE),e=o.Node.create('
                      ').append(o.Node.create('
                      '+o.Escape.html(this.get("message"))+"
                      ")).append(o.Node.create('")).append(o.Node.create('")).append(o.Node.create('")),M.cfg.developerdebug&&e.all(".moodle-exception-param").removeClass("hidden"),this.setStdModContent(o.WidgetStdMod.BODY,e,o.WidgetStdMod.REPLACE),t&&(this._hideTimeout=setTimeout(function(){i.hide()},t)),this.after("visibleChange",this.visibilityChanged,this),this._keypress=o.on("key",this.hide,window,"down:13,27",this),this.centerDialogue()},visibilityChanged:function(e){var i;"visible"===e.attrName&&e.prevVal&&!e.newVal&&(this._keypress&&this._keypress.detach(),i=this,setTimeout(function(){i.destroy()},1e3))}},{NAME:"Moodle exception",CSS_PREFIX:"moodle-dialogue",ATTRS:{message:{value:""},name:{value:""},fileName:{value:""},lineNumber:{value:""},stack:{setter:function(e){var i,t=o.Escape.html(e).split("\n"),a=new RegExp("^(.+)@("+M.cfg.wwwroot+")?(.{0,75}).*:(\\d+)$");for(i in t)t[i]=t[i].replace(a,"
                      ln: $4
                      $3
                      $1
                      ");return t.join("\n")},value:""},hideTimeoutDelay:{validator:o.Lang.isNumber,value:null}}}),M.core.exception=a},"@VERSION@",{requires:["moodle-core-notification-dialogue"]}); \ No newline at end of file diff --git a/lib/yui/build/moodle-core-tooltip/moodle-core-tooltip-min.js b/lib/yui/build/moodle-core-tooltip/moodle-core-tooltip-min.js index 1a073a47cea..052d95171ab 100644 --- a/lib/yui/build/moodle-core-tooltip/moodle-core-tooltip-min.js +++ b/lib/yui/build/moodle-core-tooltip/moodle-core-tooltip-min.js @@ -1 +1 @@ -YUI.add("moodle-core-tooltip",function(a,e){function t(e){"undefined"==typeof(e=e||{}).draggable&&(e.draggable=!0),"undefined"==typeof e.constrain&&(e.constrain=!0),t.superclass.constructor.apply(this,[e])}var l=".closebutton",n="tooltiptext",o={pix:"i/loading_small",component:"moodle"},i={};t.NAME="moodle-core-tooltip",t.CSS_PREFIX="moodle-dialogue",(t.ATTRS=i).initialheadertext={value:""},i.initialbodytext={value:"",setter:function(e){var t,i;return t=a.Node.create("
                      ").addClass(n),i=a.Node.create("").setAttribute("src",M.util.image_url(o.pix,o.component)).addClass("spinner"),e?(t.set("text",e),i.addClass("iconsmall")):t.addClass("content-lightbox"),t.append(i),t}},i.initialfootertext={value:null,setter:function(e){if(e)return a.Node.create("
                      ").set("text",e)}},i.headerhandler={value:"set_header_content"},i.bodyhandler={value:"set_body_content"},i.footerhandler={value:null},i.urlmodifier={value:null},i.textcache={value:null},i.textcachesize={value:10},a.extend(t,M.core.dialogue,{bb:null,listenevents:[],textcache:null,alignpoints:[a.WidgetPositionAlign.TL,a.WidgetPositionAlign.RC],initializer:function(){return this.get("headerhandler")||this.set("headerhandler",this.set_header_content),this.get("bodyhandler")||this.set("bodyhandler",this.set_body_content),this.get("footerhandler")||this.set("footerhandler",function(){}),this.get("urlmodifier")||this.set("urlmodifier",this.modify_url),this.setAttrs({headerContent:this.get("initialheadertext"),bodyContent:this.get("initialbodytext"),footerContent:this.get("initialfootertext")}),this.hide(),this.render(),this.bb=this.get("boundingBox"),this.bb.addClass("moodle-dialogue-tooltip"),window.right_to_left()&&(this.alignpoints=[a.WidgetPositionAlign.TR,a.WidgetPositionAlign.LC]),this.get("textcache")||this.set("textcache",new a.Cache({max:this.get("textcachesize")})),M.cfg.developerdebug&&this.get("textcache").set("max",0),this},display_panel:function(e){var t,i,n,o,s;e.preventDefault(),this.cancel_events(),t=e.target.ancestor("a",!0),this.setAttrs({headerContent:this.get("initialheadertext"),bodyContent:this.get("initialbodytext"),footerContent:this.get("initialfootertext")}),this.show(e),this.align(t,this.alignpoints),i=this.bb.delegate("click",this.close_panel,l,this),this.listenevents.push(i),i=a.one("body").on("key",this.close_panel,"esc",this),this.listenevents.push(i),i=this.bb.on("mousedownoutside",this.close_panel,this),this.listenevents.push(i),n=a.bind(this.get("urlmodifier"),this,t.get("href"))(),(s=this.get("textcache").retrieve(n))?this._set_panel_contents(s.response):(o={method:"get",context:this,sync:!1,on:{complete:function(e,t){this._set_panel_contents(t.responseText,n)}}},a.io(n,o))},_set_panel_contents:function(e,t){var i;try{if((i=a.JSON.parse(e)).error)return this.close_panel(),a.use("moodle-core-notification-ajaxexception",function(){return new M.core.ajaxException(i).show()}),this}catch(n){return this.close_panel(),a.use("moodle-core-notification-exception",function(){return new M.core.exception(n).show()}),this}a.bind(this.get("headerhandler"),this,i)(),a.bind(this.get("bodyhandler"),this,i)(),a.bind(this.get("footerhandler"),this,i)(),t&&this.get("textcache").add(t,e),this.get("buttons").header[0].focus()},set_header_content:function(e){this.set("headerContent",e.heading)},set_body_content:function(e){var t=a.Node.create("
                      ").set("innerHTML",e.text).setAttribute("role","alert").addClass(n);this.set("bodyContent",t)},modify_url:function(e){return e.replace(/\.php\?/,"_ajax.php?")},close_panel:function(e){this.hide(e),this.cancel_events(),e&&e.preventDefault()},cancel_events:function(){for(;this.listenevents.length;)this.listenevents.shift().detach()}}),a.Base.modifyAttrs(t,{modal:{value:!1},focusOnPreviousTargetAfterHide:{value:!0}}),M.core=M.core||{},M.core.tooltip=M.core.tooltip=t},"@VERSION@",{requires:["base","node","io-base","moodle-core-notification-dialogue","json-parse","widget-position","widget-position-align","event-outside","cache-base"]}); \ No newline at end of file +YUI.add("moodle-core-tooltip",function(o,e){function t(e){"undefined"==typeof(e=e||{}).draggable&&(e.draggable=!0),"undefined"==typeof e.constrain&&(e.constrain=!0),t.superclass.constructor.apply(this,[e])}var n=".closebutton",s="tooltiptext",a={pix:"i/loading_small",component:"moodle"},i={};t.NAME="moodle-core-tooltip",t.CSS_PREFIX="moodle-dialogue",(t.ATTRS=i).initialheadertext={value:""},i.initialbodytext={value:"",setter:function(e){var t=o.Node.create("
                      ").addClass(s),i=o.Node.create("").setAttribute("src",M.util.image_url(a.pix,a.component)).addClass("spinner");return e?(t.set("text",e),i.addClass("iconsmall")):t.addClass("content-lightbox"),t.append(i),t}},i.initialfootertext={value:null,setter:function(e){if(e)return o.Node.create("
                      ").set("text",e)}},i.headerhandler={value:"set_header_content"},i.bodyhandler={value:"set_body_content"},i.footerhandler={value:null},i.urlmodifier={value:null},i.textcache={value:null},i.textcachesize={value:10},o.extend(t,M.core.dialogue,{bb:null,listenevents:[],textcache:null,alignpoints:[o.WidgetPositionAlign.TL,o.WidgetPositionAlign.RC],initializer:function(){return this.get("headerhandler")||this.set("headerhandler",this.set_header_content),this.get("bodyhandler")||this.set("bodyhandler",this.set_body_content),this.get("footerhandler")||this.set("footerhandler",function(){}),this.get("urlmodifier")||this.set("urlmodifier",this.modify_url),this.setAttrs({headerContent:this.get("initialheadertext"),bodyContent:this.get("initialbodytext"),footerContent:this.get("initialfootertext")}),this.hide(),this.render(),this.bb=this.get("boundingBox"),this.bb.addClass("moodle-dialogue-tooltip"),window.right_to_left()&&(this.alignpoints=[o.WidgetPositionAlign.TR,o.WidgetPositionAlign.LC]),this.get("textcache")||this.set("textcache",new o.Cache({max:this.get("textcachesize")})),M.cfg.developerdebug&&this.get("textcache").set("max",0),this},display_panel:function(e){var t,i;e.preventDefault(),this.cancel_events(),t=e.target.ancestor("a",!0),this.setAttrs({headerContent:this.get("initialheadertext"),bodyContent:this.get("initialbodytext"),footerContent:this.get("initialfootertext")}),this.show(e),this.align(t,this.alignpoints),e=this.bb.delegate("click",this.close_panel,n,this),this.listenevents.push(e),e=o.one("body").on("key",this.close_panel,"esc",this),this.listenevents.push(e),e=this.bb.on("mousedownoutside",this.close_panel,this),this.listenevents.push(e),i=o.bind(this.get("urlmodifier"),this,t.get("href"))(),(e=this.get("textcache").retrieve(i))?this._set_panel_contents(e.response):o.io(i,{method:"get",context:this,sync:!1,on:{complete:function(e,t){this._set_panel_contents(t.responseText,i)}}})},_set_panel_contents:function(e,t){var i;try{if((i=o.JSON.parse(e)).error)return this.close_panel(),o.use("moodle-core-notification-ajaxexception",function(){return new M.core.ajaxException(i).show()}),this}catch(n){return this.close_panel(),o.use("moodle-core-notification-exception",function(){return new M.core.exception(n).show()}),this}o.bind(this.get("headerhandler"),this,i)(),o.bind(this.get("bodyhandler"),this,i)(),o.bind(this.get("footerhandler"),this,i)(),t&&this.get("textcache").add(t,e),this.get("buttons").header[0].focus()},set_header_content:function(e){this.set("headerContent",e.heading)},set_body_content:function(e){e=o.Node.create("
                      ").set("innerHTML",e.text).setAttribute("role","alert").addClass(s);this.set("bodyContent",e)},modify_url:function(e){return e.replace(/\.php\?/,"_ajax.php?")},close_panel:function(e){this.hide(e),this.cancel_events(),e&&e.preventDefault()},cancel_events:function(){for(;this.listenevents.length;)this.listenevents.shift().detach()}}),o.Base.modifyAttrs(t,{modal:{value:!1},focusOnPreviousTargetAfterHide:{value:!0}}),M.core=M.core||{},M.core.tooltip=M.core.tooltip=t},"@VERSION@",{requires:["base","node","io-base","moodle-core-notification-dialogue","json-parse","widget-position","widget-position-align","event-outside","cache-base"]}); \ No newline at end of file diff --git a/lib/yui/build/moodle-core-widget-focusafterclose/moodle-core-widget-focusafterclose-min.js b/lib/yui/build/moodle-core-widget-focusafterclose/moodle-core-widget-focusafterclose-min.js index 0fb8dcd9536..1f9f964d6a8 100644 --- a/lib/yui/build/moodle-core-widget-focusafterclose/moodle-core-widget-focusafterclose-min.js +++ b/lib/yui/build/moodle-core-widget-focusafterclose/moodle-core-widget-focusafterclose-min.js @@ -1 +1 @@ -YUI.add("moodle-core-widget-focusafterclose",function(i,e){var s='input:not([type="hidden"]), a[href], button, textarea, select, [tabindex], [contenteditable="true"]';function t(){i.after(this._bindUIFocusAfterHide,this,"bindUI"),this.get("rendered")&&this._bindUIFocusAfterHide()}t.ATTRS={focusOnPreviousTargetAfterHide:{value:!1},focusAfterHide:{value:null,type:i.Node}},t.prototype={_uiHandlesFocusAfterHide:[],_showFocusAfterHide:null,_previousTargetFocusAfterHide:null,initializer:function(){this.get("focusOnPreviousTargetAfterHide")&&this.show&&(this._showFocusAfterHide=this.show,this.show=function(e){this._showFocusAfterHide.apply(this,arguments),this._previousTargetFocusAfterHide=null,e&&e.currentTarget&&(this._previousTargetFocusAfterHide=e.currentTarget)})},destructor:function(){new i.EventHandle(this.uiHandleFocusAfterHide).detach()},_bindUIFocusAfterHide:function(){new i.EventHandle(this.uiHandleFocusAfterHide).detach(),this.uiHandleFocusAfterHide=[this.after("visibleChange",this._afterHostVisibleChangeFocusAfterHide)]},_afterHostVisibleChangeFocusAfterHide:function(){this.get("visible")||this._attemptFocus(this._previousTargetFocusAfterHide)||this._attemptFocus(this.get("focusAfterHide"))},_attemptFocus:function(e){var t=i.one(e);return!!(t=t&&t.ancestor(s,!0))&&(t.focus(),!0)}},i.namespace("M.core").WidgetFocusAfterHide=t},"@VERSION@",{requires:["base-build","widget"]}); \ No newline at end of file +YUI.add("moodle-core-widget-focusafterclose",function(t,e){function i(){t.after(this._bindUIFocusAfterHide,this,"bindUI"),this.get("rendered")&&this._bindUIFocusAfterHide()}i.ATTRS={focusOnPreviousTargetAfterHide:{value:!1},focusAfterHide:{value:null,type:t.Node}},i.prototype={_uiHandlesFocusAfterHide:[],_showFocusAfterHide:null,_previousTargetFocusAfterHide:null,initializer:function(){this.get("focusOnPreviousTargetAfterHide")&&this.show&&(this._showFocusAfterHide=this.show,this.show=function(e){this._showFocusAfterHide.apply(this,arguments),this._previousTargetFocusAfterHide=null,e&&e.currentTarget&&(this._previousTargetFocusAfterHide=e.currentTarget)})},destructor:function(){new t.EventHandle(this.uiHandleFocusAfterHide).detach()},_bindUIFocusAfterHide:function(){new t.EventHandle(this.uiHandleFocusAfterHide).detach(),this.uiHandleFocusAfterHide=[this.after("visibleChange",this._afterHostVisibleChangeFocusAfterHide)]},_afterHostVisibleChangeFocusAfterHide:function(){this.get("visible")||this._attemptFocus(this._previousTargetFocusAfterHide)||this._attemptFocus(this.get("focusAfterHide"))},_attemptFocus:function(e){e=t.one(e);return!!(e=e&&e.ancestor('input:not([type="hidden"]), a[href], button, textarea, select, [tabindex], [contenteditable="true"]',!0))&&(e.focus(),!0)}},t.namespace("M.core").WidgetFocusAfterHide=i},"@VERSION@",{requires:["base-build","widget"]}); \ No newline at end of file diff --git a/media/player/videojs/amd/build/Youtube-lazy.min.js b/media/player/videojs/amd/build/Youtube-lazy.min.js index d5393e9ece4..75f2d8ece1e 100644 --- a/media/player/videojs/amd/build/Youtube-lazy.min.js +++ b/media/player/videojs/amd/build/Youtube-lazy.min.js @@ -1,2 +1,2 @@ -function _typeof(a){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof=function(a){return typeof a}}else{_typeof=function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a}}return _typeof(a)}(function(a,b){if("object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module){var c=require("video.js");module.exports=b(c.default||c)}else if("function"==typeof define&&define.amd){define ("media_videojs/Youtube-lazy",["media_videojs/video-lazy"],function(c){return a.Youtube=b(c)})}else{a.Youtube=b(a.videojs)}})(this,function(a){'use strict';var e=a.browser.IS_IOS||a.browser.IS_NATIVE_ANDROID,f=a.getTech("Tech"),g=a.extend(f,{constructor:function constructor(a,b){f.call(this,a,b);this.setPoster(a.poster);this.setSrc(this.options_.source,!0);this.setTimeout(function(){if(this.el_){this.el_.parentNode.className+=" vjs-youtube";if(e){this.el_.parentNode.className+=" vjs-youtube-mobile"}if(g.isApiReady){this.initYTPlayer()}else{g.apiReadyQueue.push(this)}}}.bind(this))},dispose:function dispose(){if(this.ytPlayer){if(this.ytPlayer.stopVideo){this.ytPlayer.stopVideo()}if(this.ytPlayer.destroy){this.ytPlayer.destroy()}}else{var a=g.apiReadyQueue.indexOf(this);if(-1!==a){g.apiReadyQueue.splice(a,1)}}this.ytPlayer=null;this.el_.parentNode.className=this.el_.parentNode.className.replace(" vjs-youtube","").replace(" vjs-youtube-mobile","");this.el_.parentNode.removeChild(this.el_);f.prototype.dispose.call(this)},createEl:function createEl(){var a=document.createElement("div");a.setAttribute("id",this.options_.techId);a.setAttribute("style","width:100%;height:100%;top:0;left:0;position:absolute");a.setAttribute("class","vjs-tech");var b=document.createElement("div");b.appendChild(a);if(!e&&!this.options_.ytControls){var c=document.createElement("div");c.setAttribute("class","vjs-iframe-blocker");c.setAttribute("style","position:absolute;top:0;left:0;width:100%;height:100%");c.onclick=function(){this.pause()}.bind(this);b.appendChild(c)}return b},initYTPlayer:function initYTPlayer(){var a={controls:0,modestbranding:1,rel:0,showinfo:0,loop:this.options_.loop?1:0};if("undefined"!=typeof this.options_.autohide){a.autohide=this.options_.autohide}if("undefined"!=typeof this.options_.cc_load_policy){a.cc_load_policy=this.options_.cc_load_policy}if("undefined"!=typeof this.options_.ytControls){a.controls=this.options_.ytControls}if("undefined"!=typeof this.options_.disablekb){a.disablekb=this.options_.disablekb}if("undefined"!=typeof this.options_.color){a.color=this.options_.color}if(!a.controls){a.fs=0}else if("undefined"!=typeof this.options_.fs){a.fs=this.options_.fs}if(-1!==this.options_.source.src.indexOf("end=")){var b=this.options_.source.src.match(/end=([0-9]*)/);this.options_.end=parseInt(b[1])}if("undefined"!=typeof this.options_.end){a.end=this.options_.end}if("undefined"!=typeof this.options_.hl){a.hl=this.options_.hl}else if("undefined"!=typeof this.options_.language){a.hl=this.options_.language.substr(0,2)}if("undefined"!=typeof this.options_.iv_load_policy){a.iv_load_policy=this.options_.iv_load_policy}if("undefined"!=typeof this.options_.list){a.list=this.options_.list}else if(this.url&&"undefined"!=typeof this.url.listId){a.list=this.url.listId}if("undefined"!=typeof this.options_.listType){a.listType=this.options_.listType}if("undefined"!=typeof this.options_.modestbranding){a.modestbranding=this.options_.modestbranding}if("undefined"!=typeof this.options_.playlist){a.playlist=this.options_.playlist}if("undefined"!=typeof this.options_.playsinline){a.playsinline=this.options_.playsinline}if("undefined"!=typeof this.options_.rel){a.rel=this.options_.rel}if("undefined"!=typeof this.options_.showinfo){a.showinfo=this.options_.showinfo}if(-1!==this.options_.source.src.indexOf("start=")){var c=this.options_.source.src.match(/start=([0-9]*)/);this.options_.start=parseInt(c[1])}if("undefined"!=typeof this.options_.start){a.start=this.options_.start}if("undefined"!=typeof this.options_.theme){a.theme=this.options_.theme}if("undefined"!=typeof this.options_.customVars){var d=this.options_.customVars;Object.keys(d).forEach(function(b){a[b]=d[b]})}this.activeVideoId=this.url?this.url.videoId:null;this.activeList=a.list;var e={videoId:this.activeVideoId,playerVars:a,events:{onReady:this.onPlayerReady.bind(this),onPlaybackQualityChange:this.onPlayerPlaybackQualityChange.bind(this),onPlaybackRateChange:this.onPlayerPlaybackRateChange.bind(this),onStateChange:this.onPlayerStateChange.bind(this),onVolumeChange:this.onPlayerVolumeChange.bind(this),onError:this.onPlayerError.bind(this)}};if("undefined"!=typeof this.options_.enablePrivacyEnhancedMode&&this.options_.enablePrivacyEnhancedMode){e.host="https://www.youtube-nocookie.com"}this.ytPlayer=new YT.Player(this.options_.techId,e)},onPlayerReady:function onPlayerReady(){if(this.options_.muted){this.ytPlayer.mute()}var a=this.ytPlayer.getAvailablePlaybackRates();if(1=b.naturalHeight||120>=b.naturalWidth){return}}else if(90>=b.height||120>=b.width){return}this.poster_=a;this.trigger("posterchange")}.bind(this);b.onerror=function(){};b.src=a}catch(a){}}});g.isSupported=function(){return!0};g.canPlaySource=function(a){return g.canPlayType(a.type)};g.canPlayType=function(a){return"video/youtube"===a};g.parseUrl=function(a){var b={videoId:null},c=a.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/);if(c&&11===c[2].length){b.videoId=c[2]}c=a.match(/[?&]list=([^#\&\?]+)/);if(c&&c[1]){b.listId=c[1]}return b};function b(){YT.ready(function(){g.isApiReady=!0;for(var a=0;a=b.naturalHeight||120>=b.naturalWidth){return}}else if(90>=b.height||120>=b.width){return}this.poster_=a;this.trigger("posterchange")}.bind(this);b.onerror=function(){};b.src=a}catch(a){}}});d.isSupported=function(){return!0};d.canPlaySource=function(a){return d.canPlayType(a.type)};d.canPlayType=function(a){return"video/youtube"===a};d.parseUrl=function(a){var b={videoId:null},c=a.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/);if(c&&11===c[2].length){b.videoId=c[2]}c=a.match(/[?&]list=([^#\&\?]+)/);if(c&&c[1]){b.listId=c[1]}return b};function e(){YT.ready(function(){d.isApiReady=!0;for(var a=0;a\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE. */\n/*global define, YT*/\n(function (root, factory) {\n if(typeof exports==='object' && typeof module!=='undefined') {\n var videojs = require('video.js');\n module.exports = factory(videojs.default || videojs);\n } else if(typeof define === 'function' && define.amd) {\n define(['media_videojs/video-lazy'], function(videojs){\n return (root.Youtube = factory(videojs));\n });\n } else {\n root.Youtube = factory(root.videojs);\n }\n}(this, function(videojs) {\n 'use strict';\n\n var _isOnMobile = videojs.browser.IS_IOS || videojs.browser.IS_NATIVE_ANDROID;\n var Tech = videojs.getTech('Tech');\n\n var Youtube = videojs.extend(Tech, {\n\n constructor: function(options, ready) {\n Tech.call(this, options, ready);\n\n this.setPoster(options.poster);\n this.setSrc(this.options_.source, true);\n\n // Set the vjs-youtube class to the player\n // Parent is not set yet so we have to wait a tick\n this.setTimeout(function() {\n if (this.el_) {\n this.el_.parentNode.className += ' vjs-youtube';\n\n if (_isOnMobile) {\n this.el_.parentNode.className += ' vjs-youtube-mobile';\n }\n\n if (Youtube.isApiReady) {\n this.initYTPlayer();\n } else {\n Youtube.apiReadyQueue.push(this);\n }\n }\n }.bind(this));\n },\n\n dispose: function() {\n if (this.ytPlayer) {\n //Dispose of the YouTube Player\n if (this.ytPlayer.stopVideo) {\n this.ytPlayer.stopVideo();\n }\n if (this.ytPlayer.destroy) {\n this.ytPlayer.destroy();\n }\n } else {\n //YouTube API hasn't finished loading or the player is already disposed\n var index = Youtube.apiReadyQueue.indexOf(this);\n if (index !== -1) {\n Youtube.apiReadyQueue.splice(index, 1);\n }\n }\n this.ytPlayer = null;\n\n this.el_.parentNode.className = this.el_.parentNode.className\n .replace(' vjs-youtube', '')\n .replace(' vjs-youtube-mobile', '');\n this.el_.parentNode.removeChild(this.el_);\n\n //Needs to be called after the YouTube player is destroyed, otherwise there will be a null reference exception\n Tech.prototype.dispose.call(this);\n },\n\n createEl: function() {\n var div = document.createElement('div');\n div.setAttribute('id', this.options_.techId);\n div.setAttribute('style', 'width:100%;height:100%;top:0;left:0;position:absolute');\n div.setAttribute('class', 'vjs-tech');\n\n var divWrapper = document.createElement('div');\n divWrapper.appendChild(div);\n\n if (!_isOnMobile && !this.options_.ytControls) {\n var divBlocker = document.createElement('div');\n divBlocker.setAttribute('class', 'vjs-iframe-blocker');\n divBlocker.setAttribute('style', 'position:absolute;top:0;left:0;width:100%;height:100%');\n\n // In case the blocker is still there and we want to pause\n divBlocker.onclick = function() {\n this.pause();\n }.bind(this);\n\n divWrapper.appendChild(divBlocker);\n }\n\n return divWrapper;\n },\n\n initYTPlayer: function() {\n var playerVars = {\n controls: 0,\n modestbranding: 1,\n rel: 0,\n showinfo: 0,\n loop: this.options_.loop ? 1 : 0\n };\n\n // Let the user set any YouTube parameter\n // https://developers.google.com/youtube/player_parameters?playerVersion=HTML5#Parameters\n // To use YouTube controls, you must use ytControls instead\n // To use the loop or autoplay, use the video.js settings\n\n if (typeof this.options_.autohide !== 'undefined') {\n playerVars.autohide = this.options_.autohide;\n }\n\n if (typeof this.options_['cc_load_policy'] !== 'undefined') {\n playerVars['cc_load_policy'] = this.options_['cc_load_policy'];\n }\n\n if (typeof this.options_.ytControls !== 'undefined') {\n playerVars.controls = this.options_.ytControls;\n }\n\n if (typeof this.options_.disablekb !== 'undefined') {\n playerVars.disablekb = this.options_.disablekb;\n }\n\n if (typeof this.options_.color !== 'undefined') {\n playerVars.color = this.options_.color;\n }\n\n if (!playerVars.controls) {\n // Let video.js handle the fullscreen unless it is the YouTube native controls\n playerVars.fs = 0;\n } else if (typeof this.options_.fs !== 'undefined') {\n playerVars.fs = this.options_.fs;\n }\n\n if (this.options_.source.src.indexOf('end=') !== -1) {\n var srcEndTime = this.options_.source.src.match(/end=([0-9]*)/);\n this.options_.end = parseInt(srcEndTime[1]);\n }\n\n if (typeof this.options_.end !== 'undefined') {\n playerVars.end = this.options_.end;\n }\n\n if (typeof this.options_.hl !== 'undefined') {\n playerVars.hl = this.options_.hl;\n } else if (typeof this.options_.language !== 'undefined') {\n // Set the YouTube player on the same language than video.js\n playerVars.hl = this.options_.language.substr(0, 2);\n }\n\n if (typeof this.options_['iv_load_policy'] !== 'undefined') {\n playerVars['iv_load_policy'] = this.options_['iv_load_policy'];\n }\n\n if (typeof this.options_.list !== 'undefined') {\n playerVars.list = this.options_.list;\n } else if (this.url && typeof this.url.listId !== 'undefined') {\n playerVars.list = this.url.listId;\n }\n\n if (typeof this.options_.listType !== 'undefined') {\n playerVars.listType = this.options_.listType;\n }\n\n if (typeof this.options_.modestbranding !== 'undefined') {\n playerVars.modestbranding = this.options_.modestbranding;\n }\n\n if (typeof this.options_.playlist !== 'undefined') {\n playerVars.playlist = this.options_.playlist;\n }\n\n if (typeof this.options_.playsinline !== 'undefined') {\n playerVars.playsinline = this.options_.playsinline;\n }\n\n if (typeof this.options_.rel !== 'undefined') {\n playerVars.rel = this.options_.rel;\n }\n\n if (typeof this.options_.showinfo !== 'undefined') {\n playerVars.showinfo = this.options_.showinfo;\n }\n\n if (this.options_.source.src.indexOf('start=') !== -1) {\n var srcStartTime = this.options_.source.src.match(/start=([0-9]*)/);\n this.options_.start = parseInt(srcStartTime[1]);\n }\n\n if (typeof this.options_.start !== 'undefined') {\n playerVars.start = this.options_.start;\n }\n\n if (typeof this.options_.theme !== 'undefined') {\n playerVars.theme = this.options_.theme;\n }\n\n // Allow undocumented options to be passed along via customVars\n if (typeof this.options_.customVars !== 'undefined') {\n var customVars = this.options_.customVars;\n Object.keys(customVars).forEach(function(key) {\n playerVars[key] = customVars[key];\n });\n }\n\n this.activeVideoId = this.url ? this.url.videoId : null;\n this.activeList = playerVars.list;\n\n var playerConfig = {\n videoId: this.activeVideoId,\n playerVars: playerVars,\n events: {\n onReady: this.onPlayerReady.bind(this),\n onPlaybackQualityChange: this.onPlayerPlaybackQualityChange.bind(this),\n onPlaybackRateChange: this.onPlayerPlaybackRateChange.bind(this),\n onStateChange: this.onPlayerStateChange.bind(this),\n onVolumeChange: this.onPlayerVolumeChange.bind(this),\n onError: this.onPlayerError.bind(this)\n }\n };\n\n if (typeof this.options_.enablePrivacyEnhancedMode !== 'undefined' && this.options_.enablePrivacyEnhancedMode) {\n playerConfig.host = 'https://www.youtube-nocookie.com';\n }\n\n this.ytPlayer = new YT.Player(this.options_.techId, playerConfig);\n },\n\n onPlayerReady: function() {\n if (this.options_.muted) {\n this.ytPlayer.mute();\n }\n\n var playbackRates = this.ytPlayer.getAvailablePlaybackRates();\n if (playbackRates.length > 1) {\n this.featuresPlaybackRate = true;\n }\n\n this.playerReady_ = true;\n this.triggerReady();\n\n if (this.playOnReady) {\n this.play();\n } else if (this.cueOnReady) {\n this.cueVideoById_(this.url.videoId);\n this.activeVideoId = this.url.videoId;\n }\n },\n\n onPlayerPlaybackQualityChange: function() {\n\n },\n\n onPlayerPlaybackRateChange: function() {\n this.trigger('ratechange');\n },\n\n onPlayerStateChange: function(e) {\n var state = e.data;\n\n if (state === this.lastState || this.errorNumber) {\n return;\n }\n\n this.lastState = state;\n\n switch (state) {\n case -1:\n this.trigger('loadstart');\n this.trigger('loadedmetadata');\n this.trigger('durationchange');\n this.trigger('ratechange');\n break;\n\n case YT.PlayerState.ENDED:\n this.trigger('ended');\n break;\n\n case YT.PlayerState.PLAYING:\n this.trigger('timeupdate');\n this.trigger('durationchange');\n this.trigger('playing');\n this.trigger('play');\n\n if (this.isSeeking) {\n this.onSeeked();\n }\n break;\n\n case YT.PlayerState.PAUSED:\n this.trigger('canplay');\n if (this.isSeeking) {\n this.onSeeked();\n } else {\n this.trigger('pause');\n }\n break;\n\n case YT.PlayerState.BUFFERING:\n this.player_.trigger('timeupdate');\n this.player_.trigger('waiting');\n break;\n }\n },\n\n onPlayerVolumeChange: function() {\n this.trigger('volumechange');\n },\n\n onPlayerError: function(e) {\n this.errorNumber = e.data;\n this.trigger('pause');\n this.trigger('error');\n },\n\n error: function() {\n var code = 1000 + this.errorNumber; // as smaller codes are reserved\n switch (this.errorNumber) {\n case 5:\n return { code: code, message: 'Error while trying to play the video' };\n\n case 2:\n case 100:\n return { code: code, message: 'Unable to find the video' };\n\n case 101:\n case 150:\n return {\n code: code,\n message: 'Playback on other Websites has been disabled by the video owner.'\n };\n }\n\n return { code: code, message: 'YouTube unknown error (' + this.errorNumber + ')' };\n },\n\n loadVideoById_: function(id) {\n var options = {\n videoId: id\n };\n if (this.options_.start) {\n options.startSeconds = this.options_.start;\n }\n if (this.options_.end) {\n options.endSeconds = this.options_.end;\n }\n this.ytPlayer.loadVideoById(options);\n },\n\n cueVideoById_: function(id) {\n var options = {\n videoId: id\n };\n if (this.options_.start) {\n options.startSeconds = this.options_.start;\n }\n if (this.options_.end) {\n options.endSeconds = this.options_.end;\n }\n this.ytPlayer.cueVideoById(options);\n },\n\n src: function(src) {\n if (src) {\n this.setSrc({ src: src });\n }\n\n return this.source;\n },\n\n poster: function() {\n // You can't start programmaticlly a video with a mobile\n // through the iframe so we hide the poster and the play button (with CSS)\n if (_isOnMobile) {\n return null;\n }\n\n return this.poster_;\n },\n\n setPoster: function(poster) {\n this.poster_ = poster;\n },\n\n setSrc: function(source) {\n if (!source || !source.src) {\n return;\n }\n\n delete this.errorNumber;\n this.source = source;\n this.url = Youtube.parseUrl(source.src);\n\n if (!this.options_.poster) {\n if (this.url.videoId) {\n // Set the low resolution first\n this.poster_ = 'https://img.youtube.com/vi/' + this.url.videoId + '/0.jpg';\n this.trigger('posterchange');\n\n // Check if their is a high res\n this.checkHighResPoster();\n }\n }\n\n if (this.options_.autoplay && !_isOnMobile) {\n if (this.isReady_) {\n this.play();\n } else {\n this.playOnReady = true;\n }\n } else if (this.activeVideoId !== this.url.videoId) {\n if (this.isReady_) {\n this.cueVideoById_(this.url.videoId);\n this.activeVideoId = this.url.videoId;\n } else {\n this.cueOnReady = true;\n }\n }\n },\n\n autoplay: function() {\n return this.options_.autoplay;\n },\n\n setAutoplay: function(val) {\n this.options_.autoplay = val;\n },\n\n loop: function() {\n return this.options_.loop;\n },\n\n setLoop: function(val) {\n this.options_.loop = val;\n },\n\n play: function() {\n if (!this.url || !this.url.videoId) {\n return;\n }\n\n this.wasPausedBeforeSeek = false;\n\n if (this.isReady_) {\n if (this.url.listId) {\n if (this.activeList === this.url.listId) {\n this.ytPlayer.playVideo();\n } else {\n this.ytPlayer.loadPlaylist(this.url.listId);\n this.activeList = this.url.listId;\n }\n }\n\n if (this.activeVideoId === this.url.videoId) {\n this.ytPlayer.playVideo();\n } else {\n this.loadVideoById_(this.url.videoId);\n this.activeVideoId = this.url.videoId;\n }\n } else {\n this.trigger('waiting');\n this.playOnReady = true;\n }\n },\n\n pause: function() {\n if (this.ytPlayer) {\n this.ytPlayer.pauseVideo();\n }\n },\n\n paused: function() {\n return (this.ytPlayer) ?\n (this.lastState !== YT.PlayerState.PLAYING && this.lastState !== YT.PlayerState.BUFFERING)\n : true;\n },\n\n currentTime: function() {\n return this.ytPlayer ? this.ytPlayer.getCurrentTime() : 0;\n },\n\n setCurrentTime: function(seconds) {\n if (this.lastState === YT.PlayerState.PAUSED) {\n this.timeBeforeSeek = this.currentTime();\n }\n\n if (!this.isSeeking) {\n this.wasPausedBeforeSeek = this.paused();\n }\n\n this.ytPlayer.seekTo(seconds, true);\n this.trigger('timeupdate');\n this.trigger('seeking');\n this.isSeeking = true;\n\n // A seek event during pause does not return an event to trigger a seeked event,\n // so run an interval timer to look for the currentTime to change\n if (this.lastState === YT.PlayerState.PAUSED && this.timeBeforeSeek !== seconds) {\n clearInterval(this.checkSeekedInPauseInterval);\n this.checkSeekedInPauseInterval = setInterval(function() {\n if (this.lastState !== YT.PlayerState.PAUSED || !this.isSeeking) {\n // If something changed while we were waiting for the currentTime to change,\n // clear the interval timer\n clearInterval(this.checkSeekedInPauseInterval);\n } else if (this.currentTime() !== this.timeBeforeSeek) {\n this.trigger('timeupdate');\n this.onSeeked();\n }\n }.bind(this), 250);\n }\n },\n\n seeking: function () {\n return this.isSeeking;\n },\n\n seekable: function () {\n if(!this.ytPlayer) {\n return videojs.createTimeRange();\n }\n\n return videojs.createTimeRange(0, this.ytPlayer.getDuration());\n },\n\n onSeeked: function() {\n clearInterval(this.checkSeekedInPauseInterval);\n this.isSeeking = false;\n\n if (this.wasPausedBeforeSeek) {\n this.pause();\n }\n\n this.trigger('seeked');\n },\n\n playbackRate: function() {\n return this.ytPlayer ? this.ytPlayer.getPlaybackRate() : 1;\n },\n\n setPlaybackRate: function(suggestedRate) {\n if (!this.ytPlayer) {\n return;\n }\n\n this.ytPlayer.setPlaybackRate(suggestedRate);\n },\n\n duration: function() {\n return this.ytPlayer ? this.ytPlayer.getDuration() : 0;\n },\n\n currentSrc: function() {\n return this.source && this.source.src;\n },\n\n ended: function() {\n return this.ytPlayer ? (this.lastState === YT.PlayerState.ENDED) : false;\n },\n\n volume: function() {\n return this.ytPlayer ? this.ytPlayer.getVolume() / 100.0 : 1;\n },\n\n setVolume: function(percentAsDecimal) {\n if (!this.ytPlayer) {\n return;\n }\n\n this.ytPlayer.setVolume(percentAsDecimal * 100.0);\n },\n\n muted: function() {\n return this.ytPlayer ? this.ytPlayer.isMuted() : false;\n },\n\n setMuted: function(mute) {\n if (!this.ytPlayer) {\n return;\n }\n else{\n this.muted(true);\n }\n\n if (mute) {\n this.ytPlayer.mute();\n } else {\n this.ytPlayer.unMute();\n }\n this.setTimeout( function(){\n this.trigger('volumechange');\n }, 50);\n },\n\n buffered: function() {\n if(!this.ytPlayer || !this.ytPlayer.getVideoLoadedFraction) {\n return videojs.createTimeRange();\n }\n\n var bufferedEnd = this.ytPlayer.getVideoLoadedFraction() * this.ytPlayer.getDuration();\n\n return videojs.createTimeRange(0, bufferedEnd);\n },\n\n // TODO: Can we really do something with this on YouTUbe?\n preload: function() {},\n load: function() {},\n reset: function() {},\n networkState: function () {\n if (!this.ytPlayer) {\n return 0; //NETWORK_EMPTY\n }\n switch (this.ytPlayer.getPlayerState()) {\n case -1: //unstarted\n return 0; //NETWORK_EMPTY\n case 3: //buffering\n return 2; //NETWORK_LOADING\n default:\n return 1; //NETWORK_IDLE\n }\n },\n readyState: function () {\n if (!this.ytPlayer) {\n return 0; //HAVE_NOTHING\n }\n switch (this.ytPlayer.getPlayerState()) {\n case -1: //unstarted\n return 0; //HAVE_NOTHING\n case 5: //video cued\n return 1; //HAVE_METADATA\n case 3: //buffering\n return 2; //HAVE_CURRENT_DATA\n default:\n return 4; //HAVE_ENOUGH_DATA\n }\n },\n\n supportsFullScreen: function() {\n return document.fullscreenEnabled ||\n document.webkitFullscreenEnabled ||\n document.mozFullScreenEnabled ||\n document.msFullscreenEnabled;\n },\n\n // Tries to get the highest resolution thumbnail available for the video\n checkHighResPoster: function(){\n var uri = 'https://img.youtube.com/vi/' + this.url.videoId + '/maxresdefault.jpg';\n\n try {\n var image = new Image();\n image.onload = function(){\n // Onload may still be called if YouTube returns the 120x90 error thumbnail\n if('naturalHeight' in image){\n if (image.naturalHeight <= 90 || image.naturalWidth <= 120) {\n return;\n }\n } else if(image.height <= 90 || image.width <= 120) {\n return;\n }\n\n this.poster_ = uri;\n this.trigger('posterchange');\n }.bind(this);\n image.onerror = function(){};\n image.src = uri;\n }\n catch(e){}\n }\n });\n\n Youtube.isSupported = function() {\n return true;\n };\n\n Youtube.canPlaySource = function(e) {\n return Youtube.canPlayType(e.type);\n };\n\n Youtube.canPlayType = function(e) {\n return (e === 'video/youtube');\n };\n\n Youtube.parseUrl = function(url) {\n var result = {\n videoId: null\n };\n\n var regex = /^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=)([^#\\&\\?]*).*/;\n var match = url.match(regex);\n\n if (match && match[2].length === 11) {\n result.videoId = match[2];\n }\n\n var regPlaylist = /[?&]list=([^#\\&\\?]+)/;\n match = url.match(regPlaylist);\n\n if(match && match[1]) {\n result.listId = match[1];\n }\n\n return result;\n };\n\n function apiLoaded() {\n YT.ready(function() {\n Youtube.isApiReady = true;\n\n for (var i = 0; i < Youtube.apiReadyQueue.length; ++i) {\n Youtube.apiReadyQueue[i].initYTPlayer();\n }\n });\n }\n\n function loadScript(src, callback) {\n var loaded = false;\n var tag = document.createElement('script');\n var firstScriptTag = document.getElementsByTagName('script')[0];\n if (!firstScriptTag) {\n // when loaded in jest without jsdom setup it doesn't get any element.\n // In jest it doesn't really make sense to do anything, because no one is watching youtube in jest\n return;\n }\n firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);\n tag.onload = function () {\n if (!loaded) {\n loaded = true;\n callback();\n }\n };\n tag.onreadystatechange = function () {\n if (!loaded && (this.readyState === 'complete' || this.readyState === 'loaded')) {\n loaded = true;\n callback();\n }\n };\n tag.src = src;\n }\n\n function injectCss() {\n var css = // iframe blocker to catch mouse events\n '.vjs-youtube .vjs-iframe-blocker { display: none; }' +\n '.vjs-youtube.vjs-user-inactive .vjs-iframe-blocker { display: block; }' +\n '.vjs-youtube .vjs-poster { background-size: cover; }' +\n '.vjs-youtube-mobile .vjs-big-play-button { display: none; }';\n\n var head = document.head || document.getElementsByTagName('head')[0];\n\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (style.styleSheet){\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n\n head.appendChild(style);\n }\n\n Youtube.apiReadyQueue = [];\n\n if (typeof document !== 'undefined'){\n loadScript('https://www.youtube.com/iframe_api', apiLoaded);\n injectCss();\n }\n\n // Older versions of VJS5 doesn't have the registerTech function\n if (typeof videojs.registerTech !== 'undefined') {\n videojs.registerTech('Youtube', Youtube);\n } else {\n videojs.registerComponent('Youtube', Youtube);\n }\n}));\n"],"file":"Youtube-lazy.min.js"} \ No newline at end of file +{"version":3,"sources":["../src/Youtube-lazy.js"],"names":["root","factory","exports","module","videojs","require","default","define","amd","Youtube","_isOnMobile","browser","IS_IOS","IS_NATIVE_ANDROID","Tech","getTech","extend","constructor","options","ready","call","setPoster","poster","setSrc","options_","source","setTimeout","el_","parentNode","className","isApiReady","initYTPlayer","apiReadyQueue","push","bind","dispose","ytPlayer","stopVideo","destroy","index","indexOf","splice","replace","removeChild","prototype","createEl","div","document","createElement","setAttribute","techId","divWrapper","appendChild","ytControls","divBlocker","onclick","pause","playerVars","controls","modestbranding","rel","showinfo","loop","autohide","disablekb","color","fs","src","srcEndTime","match","end","parseInt","hl","language","substr","list","url","listId","listType","playlist","playsinline","srcStartTime","start","theme","customVars","Object","keys","forEach","key","activeVideoId","videoId","activeList","playerConfig","events","onReady","onPlayerReady","onPlaybackQualityChange","onPlayerPlaybackQualityChange","onPlaybackRateChange","onPlayerPlaybackRateChange","onStateChange","onPlayerStateChange","onVolumeChange","onPlayerVolumeChange","onError","onPlayerError","enablePrivacyEnhancedMode","host","YT","Player","muted","mute","playbackRates","getAvailablePlaybackRates","length","featuresPlaybackRate","playerReady_","triggerReady","playOnReady","play","cueOnReady","cueVideoById_","trigger","e","state","data","lastState","errorNumber","PlayerState","ENDED","PLAYING","isSeeking","onSeeked","PAUSED","BUFFERING","player_","error","code","message","loadVideoById_","id","startSeconds","endSeconds","loadVideoById","cueVideoById","poster_","parseUrl","checkHighResPoster","autoplay","isReady_","setAutoplay","val","setLoop","wasPausedBeforeSeek","playVideo","loadPlaylist","pauseVideo","paused","currentTime","getCurrentTime","setCurrentTime","seconds","timeBeforeSeek","seekTo","clearInterval","checkSeekedInPauseInterval","setInterval","seeking","seekable","createTimeRange","getDuration","playbackRate","getPlaybackRate","setPlaybackRate","suggestedRate","duration","currentSrc","ended","volume","getVolume","setVolume","percentAsDecimal","isMuted","setMuted","unMute","buffered","getVideoLoadedFraction","bufferedEnd","preload","load","reset","networkState","getPlayerState","readyState","supportsFullScreen","fullscreenEnabled","webkitFullscreenEnabled","mozFullScreenEnabled","msFullscreenEnabled","uri","image","Image","onload","naturalHeight","naturalWidth","height","width","onerror","isSupported","canPlaySource","canPlayType","type","result","apiLoaded","i","loadScript","callback","loaded","tag","firstScriptTag","getElementsByTagName","insertBefore","onreadystatechange","injectCss","head","style","styleSheet","cssText","createTextNode","registerTech","registerComponent"],"mappings":"kRAsBC,UAAUA,CAAV,CAAgBC,CAAhB,CAAyB,CACxB,GAAoB,QAAjB,uBAAOC,CAAAA,OAAP,qBAAOA,OAAP,IAA6C,WAAhB,QAAOC,CAAAA,MAAvC,CAA6D,CAC3D,GAAIC,CAAAA,CAAO,CAAGC,OAAO,CAAC,UAAD,CAArB,CACAF,MAAM,CAACD,OAAP,CAAiBD,CAAO,CAACG,CAAO,CAACE,OAAR,EAAmBF,CAApB,CACzB,CAHD,IAGO,IAAqB,UAAlB,QAAOG,CAAAA,MAAP,EAAgCA,MAAM,CAACC,GAA1C,CAA+C,CACpDD,OAAM,8BAAC,CAAC,0BAAD,CAAD,CAA+B,SAASH,CAAT,CAAiB,CACpD,MAAQJ,CAAAA,CAAI,CAACS,OAAL,CAAeR,CAAO,CAACG,CAAD,CAC/B,CAFK,CAGP,CAJM,IAIA,CACLJ,CAAI,CAACS,OAAL,CAAeR,CAAO,CAACD,CAAI,CAACI,OAAN,CACvB,CACF,CAXA,EAWC,IAXD,CAWO,SAASA,CAAT,CAAkB,CACxB,aADwB,GAGpBM,CAAAA,CAAW,CAAGN,CAAO,CAACO,OAAR,CAAgBC,MAAhB,EAA0BR,CAAO,CAACO,OAAR,CAAgBE,iBAHpC,CAIpBC,CAAI,CAAGV,CAAO,CAACW,OAAR,CAAgB,MAAhB,CAJa,CAMpBN,CAAO,CAAGL,CAAO,CAACY,MAAR,CAAeF,CAAf,CAAqB,CAEjCG,WAAW,CAAE,qBAASC,CAAT,CAAkBC,CAAlB,CAAyB,CACpCL,CAAI,CAACM,IAAL,CAAU,IAAV,CAAgBF,CAAhB,CAAyBC,CAAzB,EAEA,KAAKE,SAAL,CAAeH,CAAO,CAACI,MAAvB,EACA,KAAKC,MAAL,CAAY,KAAKC,QAAL,CAAcC,MAA1B,KAIA,KAAKC,UAAL,CAAgB,UAAW,CACzB,GAAI,KA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B,OAAvB,CATO,CAUnBiL,CAAK,CAACd,IAAN,CAAa,UAAb,CAEA,GAAIc,CAAK,CAACC,UAAV,CAAqB,CACnBD,CAAK,CAACC,UAAN,CAAiBC,OAAjB,2OACD,CAFD,IAEO,CACLF,CAAK,CAAC7K,WAAN,CAAkBL,QAAQ,CAACqL,cAAT,4OAAlB,CACD,CAEDJ,CAAI,CAAC5K,WAAL,CAAiB6K,CAAjB,CACD,CAEDxN,CAAO,CAACuB,aAAR,CAAwB,EAAxB,CAEA,GAAwB,WAApB,QAAOe,CAAAA,QAAX,CAAoC,CAClCwK,CAAU,CAAC,oCAAD,CAAuCF,CAAvC,CAAV,CACAU,CAAS,EACV,CAGD,GAAoC,WAAhC,QAAO3N,CAAAA,CAAO,CAACiO,YAAnB,CAAiD,CAC/CjO,CAAO,CAACiO,YAAR,CAAqB,SAArB,CAAgC5N,CAAhC,CACD,CAFD,IAEO,CACLL,CAAO,CAACkO,iBAAR,CAA0B,SAA1B,CAAqC7N,CAArC,CACD,CACF,CAvwBA,CAAD","sourcesContent":["/* The MIT License (MIT)\n\nCopyright (c) 2014-2015 Benoit Tremblay \n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE. */\n/*global define, YT*/\n(function (root, factory) {\n if(typeof exports==='object' && typeof module!=='undefined') {\n var videojs = require('video.js');\n module.exports = factory(videojs.default || videojs);\n } else if(typeof define === 'function' && define.amd) {\n define(['media_videojs/video-lazy'], function(videojs){\n return (root.Youtube = factory(videojs));\n });\n } else {\n root.Youtube = factory(root.videojs);\n }\n}(this, function(videojs) {\n 'use strict';\n\n var _isOnMobile = videojs.browser.IS_IOS || videojs.browser.IS_NATIVE_ANDROID;\n var Tech = videojs.getTech('Tech');\n\n var Youtube = videojs.extend(Tech, {\n\n constructor: function(options, ready) {\n Tech.call(this, options, ready);\n\n this.setPoster(options.poster);\n this.setSrc(this.options_.source, true);\n\n // Set the vjs-youtube class to the player\n // Parent is not set yet so we have to wait a tick\n this.setTimeout(function() {\n if (this.el_) {\n this.el_.parentNode.className += ' vjs-youtube';\n\n if (_isOnMobile) {\n this.el_.parentNode.className += ' vjs-youtube-mobile';\n }\n\n if (Youtube.isApiReady) {\n this.initYTPlayer();\n } else {\n Youtube.apiReadyQueue.push(this);\n }\n }\n }.bind(this));\n },\n\n dispose: function() {\n if (this.ytPlayer) {\n //Dispose of the YouTube Player\n if (this.ytPlayer.stopVideo) {\n this.ytPlayer.stopVideo();\n }\n if (this.ytPlayer.destroy) {\n this.ytPlayer.destroy();\n }\n } else {\n //YouTube API hasn't finished loading or the player is already disposed\n var index = Youtube.apiReadyQueue.indexOf(this);\n if (index !== -1) {\n Youtube.apiReadyQueue.splice(index, 1);\n }\n }\n this.ytPlayer = null;\n\n this.el_.parentNode.className = this.el_.parentNode.className\n .replace(' vjs-youtube', '')\n .replace(' vjs-youtube-mobile', '');\n this.el_.parentNode.removeChild(this.el_);\n\n //Needs to be called after the YouTube player is destroyed, otherwise there will be a null reference exception\n Tech.prototype.dispose.call(this);\n },\n\n createEl: function() {\n var div = document.createElement('div');\n div.setAttribute('id', this.options_.techId);\n div.setAttribute('style', 'width:100%;height:100%;top:0;left:0;position:absolute');\n div.setAttribute('class', 'vjs-tech');\n\n var divWrapper = document.createElement('div');\n divWrapper.appendChild(div);\n\n if (!_isOnMobile && !this.options_.ytControls) {\n var divBlocker = document.createElement('div');\n divBlocker.setAttribute('class', 'vjs-iframe-blocker');\n divBlocker.setAttribute('style', 'position:absolute;top:0;left:0;width:100%;height:100%');\n\n // In case the blocker is still there and we want to pause\n divBlocker.onclick = function() {\n this.pause();\n }.bind(this);\n\n divWrapper.appendChild(divBlocker);\n }\n\n return divWrapper;\n },\n\n initYTPlayer: function() {\n var playerVars = {\n controls: 0,\n modestbranding: 1,\n rel: 0,\n showinfo: 0,\n loop: this.options_.loop ? 1 : 0\n };\n\n // Let the user set any YouTube parameter\n // https://developers.google.com/youtube/player_parameters?playerVersion=HTML5#Parameters\n // To use YouTube controls, you must use ytControls instead\n // To use the loop or autoplay, use the video.js settings\n\n if (typeof this.options_.autohide !== 'undefined') {\n playerVars.autohide = this.options_.autohide;\n }\n\n if (typeof this.options_['cc_load_policy'] !== 'undefined') {\n playerVars['cc_load_policy'] = this.options_['cc_load_policy'];\n }\n\n if (typeof this.options_.ytControls !== 'undefined') {\n playerVars.controls = this.options_.ytControls;\n }\n\n if (typeof this.options_.disablekb !== 'undefined') {\n playerVars.disablekb = this.options_.disablekb;\n }\n\n if (typeof this.options_.color !== 'undefined') {\n playerVars.color = this.options_.color;\n }\n\n if (!playerVars.controls) {\n // Let video.js handle the fullscreen unless it is the YouTube native controls\n playerVars.fs = 0;\n } else if (typeof this.options_.fs !== 'undefined') {\n playerVars.fs = this.options_.fs;\n }\n\n if (this.options_.source.src.indexOf('end=') !== -1) {\n var srcEndTime = this.options_.source.src.match(/end=([0-9]*)/);\n this.options_.end = parseInt(srcEndTime[1]);\n }\n\n if (typeof this.options_.end !== 'undefined') {\n playerVars.end = this.options_.end;\n }\n\n if (typeof this.options_.hl !== 'undefined') {\n playerVars.hl = this.options_.hl;\n } else if (typeof this.options_.language !== 'undefined') {\n // Set the YouTube player on the same language than video.js\n playerVars.hl = this.options_.language.substr(0, 2);\n }\n\n if (typeof this.options_['iv_load_policy'] !== 'undefined') {\n playerVars['iv_load_policy'] = this.options_['iv_load_policy'];\n }\n\n if (typeof this.options_.list !== 'undefined') {\n playerVars.list = this.options_.list;\n } else if (this.url && typeof this.url.listId !== 'undefined') {\n playerVars.list = this.url.listId;\n }\n\n if (typeof this.options_.listType !== 'undefined') {\n playerVars.listType = this.options_.listType;\n }\n\n if (typeof this.options_.modestbranding !== 'undefined') {\n playerVars.modestbranding = this.options_.modestbranding;\n }\n\n if (typeof this.options_.playlist !== 'undefined') {\n playerVars.playlist = this.options_.playlist;\n }\n\n if (typeof this.options_.playsinline !== 'undefined') {\n playerVars.playsinline = this.options_.playsinline;\n }\n\n if (typeof this.options_.rel !== 'undefined') {\n playerVars.rel = this.options_.rel;\n }\n\n if (typeof this.options_.showinfo !== 'undefined') {\n playerVars.showinfo = this.options_.showinfo;\n }\n\n if (this.options_.source.src.indexOf('start=') !== -1) {\n var srcStartTime = this.options_.source.src.match(/start=([0-9]*)/);\n this.options_.start = parseInt(srcStartTime[1]);\n }\n\n if (typeof this.options_.start !== 'undefined') {\n playerVars.start = this.options_.start;\n }\n\n if (typeof this.options_.theme !== 'undefined') {\n playerVars.theme = this.options_.theme;\n }\n\n // Allow undocumented options to be passed along via customVars\n if (typeof this.options_.customVars !== 'undefined') {\n var customVars = this.options_.customVars;\n Object.keys(customVars).forEach(function(key) {\n playerVars[key] = customVars[key];\n });\n }\n\n this.activeVideoId = this.url ? this.url.videoId : null;\n this.activeList = playerVars.list;\n\n var playerConfig = {\n videoId: this.activeVideoId,\n playerVars: playerVars,\n events: {\n onReady: this.onPlayerReady.bind(this),\n onPlaybackQualityChange: this.onPlayerPlaybackQualityChange.bind(this),\n onPlaybackRateChange: this.onPlayerPlaybackRateChange.bind(this),\n onStateChange: this.onPlayerStateChange.bind(this),\n onVolumeChange: this.onPlayerVolumeChange.bind(this),\n onError: this.onPlayerError.bind(this)\n }\n };\n\n if (typeof this.options_.enablePrivacyEnhancedMode !== 'undefined' && this.options_.enablePrivacyEnhancedMode) {\n playerConfig.host = 'https://www.youtube-nocookie.com';\n }\n\n this.ytPlayer = new YT.Player(this.options_.techId, playerConfig);\n },\n\n onPlayerReady: function() {\n if (this.options_.muted) {\n this.ytPlayer.mute();\n }\n\n var playbackRates = this.ytPlayer.getAvailablePlaybackRates();\n if (playbackRates.length > 1) {\n this.featuresPlaybackRate = true;\n }\n\n this.playerReady_ = true;\n this.triggerReady();\n\n if (this.playOnReady) {\n this.play();\n } else if (this.cueOnReady) {\n this.cueVideoById_(this.url.videoId);\n this.activeVideoId = this.url.videoId;\n }\n },\n\n onPlayerPlaybackQualityChange: function() {\n\n },\n\n onPlayerPlaybackRateChange: function() {\n this.trigger('ratechange');\n },\n\n onPlayerStateChange: function(e) {\n var state = e.data;\n\n if (state === this.lastState || this.errorNumber) {\n return;\n }\n\n this.lastState = state;\n\n switch (state) {\n case -1:\n this.trigger('loadstart');\n this.trigger('loadedmetadata');\n this.trigger('durationchange');\n this.trigger('ratechange');\n break;\n\n case YT.PlayerState.ENDED:\n this.trigger('ended');\n break;\n\n case YT.PlayerState.PLAYING:\n this.trigger('timeupdate');\n this.trigger('durationchange');\n this.trigger('playing');\n this.trigger('play');\n\n if (this.isSeeking) {\n this.onSeeked();\n }\n break;\n\n case YT.PlayerState.PAUSED:\n this.trigger('canplay');\n if (this.isSeeking) {\n this.onSeeked();\n } else {\n this.trigger('pause');\n }\n break;\n\n case YT.PlayerState.BUFFERING:\n this.player_.trigger('timeupdate');\n this.player_.trigger('waiting');\n break;\n }\n },\n\n onPlayerVolumeChange: function() {\n this.trigger('volumechange');\n },\n\n onPlayerError: function(e) {\n this.errorNumber = e.data;\n this.trigger('pause');\n this.trigger('error');\n },\n\n error: function() {\n var code = 1000 + this.errorNumber; // as smaller codes are reserved\n switch (this.errorNumber) {\n case 5:\n return { code: code, message: 'Error while trying to play the video' };\n\n case 2:\n case 100:\n return { code: code, message: 'Unable to find the video' };\n\n case 101:\n case 150:\n return {\n code: code,\n message: 'Playback on other Websites has been disabled by the video owner.'\n };\n }\n\n return { code: code, message: 'YouTube unknown error (' + this.errorNumber + ')' };\n },\n\n loadVideoById_: function(id) {\n var options = {\n videoId: id\n };\n if (this.options_.start) {\n options.startSeconds = this.options_.start;\n }\n if (this.options_.end) {\n options.endSeconds = this.options_.end;\n }\n this.ytPlayer.loadVideoById(options);\n },\n\n cueVideoById_: function(id) {\n var options = {\n videoId: id\n };\n if (this.options_.start) {\n options.startSeconds = this.options_.start;\n }\n if (this.options_.end) {\n options.endSeconds = this.options_.end;\n }\n this.ytPlayer.cueVideoById(options);\n },\n\n src: function(src) {\n if (src) {\n this.setSrc({ src: src });\n }\n\n return this.source;\n },\n\n poster: function() {\n // You can't start programmaticlly a video with a mobile\n // through the iframe so we hide the poster and the play button (with CSS)\n if (_isOnMobile) {\n return null;\n }\n\n return this.poster_;\n },\n\n setPoster: function(poster) {\n this.poster_ = poster;\n },\n\n setSrc: function(source) {\n if (!source || !source.src) {\n return;\n }\n\n delete this.errorNumber;\n this.source = source;\n this.url = Youtube.parseUrl(source.src);\n\n if (!this.options_.poster) {\n if (this.url.videoId) {\n // Set the low resolution first\n this.poster_ = 'https://img.youtube.com/vi/' + this.url.videoId + '/0.jpg';\n this.trigger('posterchange');\n\n // Check if their is a high res\n this.checkHighResPoster();\n }\n }\n\n if (this.options_.autoplay && !_isOnMobile) {\n if (this.isReady_) {\n this.play();\n } else {\n this.playOnReady = true;\n }\n } else if (this.activeVideoId !== this.url.videoId) {\n if (this.isReady_) {\n this.cueVideoById_(this.url.videoId);\n this.activeVideoId = this.url.videoId;\n } else {\n this.cueOnReady = true;\n }\n }\n },\n\n autoplay: function() {\n return this.options_.autoplay;\n },\n\n setAutoplay: function(val) {\n this.options_.autoplay = val;\n },\n\n loop: function() {\n return this.options_.loop;\n },\n\n setLoop: function(val) {\n this.options_.loop = val;\n },\n\n play: function() {\n if (!this.url || !this.url.videoId) {\n return;\n }\n\n this.wasPausedBeforeSeek = false;\n\n if (this.isReady_) {\n if (this.url.listId) {\n if (this.activeList === this.url.listId) {\n this.ytPlayer.playVideo();\n } else {\n this.ytPlayer.loadPlaylist(this.url.listId);\n this.activeList = this.url.listId;\n }\n }\n\n if (this.activeVideoId === this.url.videoId) {\n this.ytPlayer.playVideo();\n } else {\n this.loadVideoById_(this.url.videoId);\n this.activeVideoId = this.url.videoId;\n }\n } else {\n this.trigger('waiting');\n this.playOnReady = true;\n }\n },\n\n pause: function() {\n if (this.ytPlayer) {\n this.ytPlayer.pauseVideo();\n }\n },\n\n paused: function() {\n return (this.ytPlayer) ?\n (this.lastState !== YT.PlayerState.PLAYING && this.lastState !== YT.PlayerState.BUFFERING)\n : true;\n },\n\n currentTime: function() {\n return this.ytPlayer ? this.ytPlayer.getCurrentTime() : 0;\n },\n\n setCurrentTime: function(seconds) {\n if (this.lastState === YT.PlayerState.PAUSED) {\n this.timeBeforeSeek = this.currentTime();\n }\n\n if (!this.isSeeking) {\n this.wasPausedBeforeSeek = this.paused();\n }\n\n this.ytPlayer.seekTo(seconds, true);\n this.trigger('timeupdate');\n this.trigger('seeking');\n this.isSeeking = true;\n\n // A seek event during pause does not return an event to trigger a seeked event,\n // so run an interval timer to look for the currentTime to change\n if (this.lastState === YT.PlayerState.PAUSED && this.timeBeforeSeek !== seconds) {\n clearInterval(this.checkSeekedInPauseInterval);\n this.checkSeekedInPauseInterval = setInterval(function() {\n if (this.lastState !== YT.PlayerState.PAUSED || !this.isSeeking) {\n // If something changed while we were waiting for the currentTime to change,\n // clear the interval timer\n clearInterval(this.checkSeekedInPauseInterval);\n } else if (this.currentTime() !== this.timeBeforeSeek) {\n this.trigger('timeupdate');\n this.onSeeked();\n }\n }.bind(this), 250);\n }\n },\n\n seeking: function () {\n return this.isSeeking;\n },\n\n seekable: function () {\n if(!this.ytPlayer) {\n return videojs.createTimeRange();\n }\n\n return videojs.createTimeRange(0, this.ytPlayer.getDuration());\n },\n\n onSeeked: function() {\n clearInterval(this.checkSeekedInPauseInterval);\n this.isSeeking = false;\n\n if (this.wasPausedBeforeSeek) {\n this.pause();\n }\n\n this.trigger('seeked');\n },\n\n playbackRate: function() {\n return this.ytPlayer ? this.ytPlayer.getPlaybackRate() : 1;\n },\n\n setPlaybackRate: function(suggestedRate) {\n if (!this.ytPlayer) {\n return;\n }\n\n this.ytPlayer.setPlaybackRate(suggestedRate);\n },\n\n duration: function() {\n return this.ytPlayer ? this.ytPlayer.getDuration() : 0;\n },\n\n currentSrc: function() {\n return this.source && this.source.src;\n },\n\n ended: function() {\n return this.ytPlayer ? (this.lastState === YT.PlayerState.ENDED) : false;\n },\n\n volume: function() {\n return this.ytPlayer ? this.ytPlayer.getVolume() / 100.0 : 1;\n },\n\n setVolume: function(percentAsDecimal) {\n if (!this.ytPlayer) {\n return;\n }\n\n this.ytPlayer.setVolume(percentAsDecimal * 100.0);\n },\n\n muted: function() {\n return this.ytPlayer ? this.ytPlayer.isMuted() : false;\n },\n\n setMuted: function(mute) {\n if (!this.ytPlayer) {\n return;\n }\n else{\n this.muted(true);\n }\n\n if (mute) {\n this.ytPlayer.mute();\n } else {\n this.ytPlayer.unMute();\n }\n this.setTimeout( function(){\n this.trigger('volumechange');\n }, 50);\n },\n\n buffered: function() {\n if(!this.ytPlayer || !this.ytPlayer.getVideoLoadedFraction) {\n return videojs.createTimeRange();\n }\n\n var bufferedEnd = this.ytPlayer.getVideoLoadedFraction() * this.ytPlayer.getDuration();\n\n return videojs.createTimeRange(0, bufferedEnd);\n },\n\n // TODO: Can we really do something with this on YouTUbe?\n preload: function() {},\n load: function() {},\n reset: function() {},\n networkState: function () {\n if (!this.ytPlayer) {\n return 0; //NETWORK_EMPTY\n }\n switch (this.ytPlayer.getPlayerState()) {\n case -1: //unstarted\n return 0; //NETWORK_EMPTY\n case 3: //buffering\n return 2; //NETWORK_LOADING\n default:\n return 1; //NETWORK_IDLE\n }\n },\n readyState: function () {\n if (!this.ytPlayer) {\n return 0; //HAVE_NOTHING\n }\n switch (this.ytPlayer.getPlayerState()) {\n case -1: //unstarted\n return 0; //HAVE_NOTHING\n case 5: //video cued\n return 1; //HAVE_METADATA\n case 3: //buffering\n return 2; //HAVE_CURRENT_DATA\n default:\n return 4; //HAVE_ENOUGH_DATA\n }\n },\n\n supportsFullScreen: function() {\n return document.fullscreenEnabled ||\n document.webkitFullscreenEnabled ||\n document.mozFullScreenEnabled ||\n document.msFullscreenEnabled;\n },\n\n // Tries to get the highest resolution thumbnail available for the video\n checkHighResPoster: function(){\n var uri = 'https://img.youtube.com/vi/' + this.url.videoId + '/maxresdefault.jpg';\n\n try {\n var image = new Image();\n image.onload = function(){\n // Onload may still be called if YouTube returns the 120x90 error thumbnail\n if('naturalHeight' in image){\n if (image.naturalHeight <= 90 || image.naturalWidth <= 120) {\n return;\n }\n } else if(image.height <= 90 || image.width <= 120) {\n return;\n }\n\n this.poster_ = uri;\n this.trigger('posterchange');\n }.bind(this);\n image.onerror = function(){};\n image.src = uri;\n }\n catch(e){}\n }\n });\n\n Youtube.isSupported = function() {\n return true;\n };\n\n Youtube.canPlaySource = function(e) {\n return Youtube.canPlayType(e.type);\n };\n\n Youtube.canPlayType = function(e) {\n return (e === 'video/youtube');\n };\n\n Youtube.parseUrl = function(url) {\n var result = {\n videoId: null\n };\n\n var regex = /^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=)([^#\\&\\?]*).*/;\n var match = url.match(regex);\n\n if (match && match[2].length === 11) {\n result.videoId = match[2];\n }\n\n var regPlaylist = /[?&]list=([^#\\&\\?]+)/;\n match = url.match(regPlaylist);\n\n if(match && match[1]) {\n result.listId = match[1];\n }\n\n return result;\n };\n\n function apiLoaded() {\n YT.ready(function() {\n Youtube.isApiReady = true;\n\n for (var i = 0; i < Youtube.apiReadyQueue.length; ++i) {\n Youtube.apiReadyQueue[i].initYTPlayer();\n }\n });\n }\n\n function loadScript(src, callback) {\n var loaded = false;\n var tag = document.createElement('script');\n var firstScriptTag = document.getElementsByTagName('script')[0];\n if (!firstScriptTag) {\n // when loaded in jest without jsdom setup it doesn't get any element.\n // In jest it doesn't really make sense to do anything, because no one is watching youtube in jest\n return;\n }\n firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);\n tag.onload = function () {\n if (!loaded) {\n loaded = true;\n callback();\n }\n };\n tag.onreadystatechange = function () {\n if (!loaded && (this.readyState === 'complete' || this.readyState === 'loaded')) {\n loaded = true;\n callback();\n }\n };\n tag.src = src;\n }\n\n function injectCss() {\n var css = // iframe blocker to catch mouse events\n '.vjs-youtube .vjs-iframe-blocker { display: none; }' +\n '.vjs-youtube.vjs-user-inactive .vjs-iframe-blocker { display: block; }' +\n '.vjs-youtube .vjs-poster { background-size: cover; }' +\n '.vjs-youtube-mobile .vjs-big-play-button { display: none; }';\n\n var head = document.head || document.getElementsByTagName('head')[0];\n\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (style.styleSheet){\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n\n head.appendChild(style);\n }\n\n Youtube.apiReadyQueue = [];\n\n if (typeof document !== 'undefined'){\n loadScript('https://www.youtube.com/iframe_api', apiLoaded);\n injectCss();\n }\n\n // Older versions of VJS5 doesn't have the registerTech function\n if (typeof videojs.registerTech !== 'undefined') {\n videojs.registerTech('Youtube', Youtube);\n } else {\n videojs.registerComponent('Youtube', Youtube);\n }\n}));\n"],"file":"Youtube-lazy.min.js"} \ No newline at end of file diff --git a/media/player/videojs/amd/build/video-lazy.min.js b/media/player/videojs/amd/build/video-lazy.min.js index a8f41610f62..4c306334a16 100644 --- a/media/player/videojs/amd/build/video-lazy.min.js +++ b/media/player/videojs/amd/build/video-lazy.min.js @@ -1,2 +1,2 @@ -function _typeof2(e){"@babel/helpers - typeof";if("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator){_typeof2=function(e){return typeof e}}else{_typeof2=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e}}return _typeof2(e)}(function(e,t){"object"===("undefined"==typeof exports?"undefined":_typeof2(exports))&&"undefined"!=typeof module?module.exports=t(require("global/window"),require("global/document")):"function"==typeof define&&define.amd?define ("media_videojs/video-lazy",["./window","./document"],t):(e=e||self,e.videojs=t(e.window,e.document))})(this,function(e,t){'use strict';e=e&&e.hasOwnProperty("default")?e["default"]:e;t=t&&t.hasOwnProperty("default")?t["default"]:t;var ua=[],ca=function(t,a){return function(n,r,i){var s=a.levels[r],o=new RegExp("^("+s+")$");if("log"!==n){i.unshift(n.toUpperCase()+":")}i.unshift(t+":");if(ua){ua.push([].concat(i));var l=ua.length-1e3;ua.splice(0,0=Object.getOwnPropertyNames(a.handlers).length){delete a.handlers;delete a.dispatcher;delete a.disabled}if(0===Object.getOwnPropertyNames(a).length){xa["delete"](e)}}function z(e,t,a,n){a.forEach(function(a){e(t,a,n)})}function G(a){if(a.fixed_){return a}function n(){return!0}function r(){return!1}if(!a||!a.isPropagationStopped){var i=a||e.event;a={};for(var s in i){if("layerX"!=s&&"layerY"!==s&&"keyLocation"!==s&&"webkitMovementX"!==s&&"webkitMovementY"!==s){if(!("returnValue"===s&&i.preventDefault)){a[s]=i[s]}}}if(!a.target){a.target=a.srcElement||t}if(!a.relatedTarget){a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement}a.preventDefault=function(){if(i.preventDefault){i.preventDefault()}a.returnValue=!1;i.returnValue=!1;a.defaultPrevented=!0};a.defaultPrevented=!1;a.stopPropagation=function(){if(i.stopPropagation){i.stopPropagation()}a.cancelBubble=!0;i.cancelBubble=!0;a.isPropagationStopped=n};a.isPropagationStopped=r;a.stopImmediatePropagation=function(){if(i.stopImmediatePropagation){i.stopImmediatePropagation()}a.isImmediatePropagationStopped=n;a.stopPropagation()};a.isImmediatePropagationStopped=r;if(null!==a.clientX&&a.clientX!==void 0){var o=t.documentElement,l=t.body;a.pageX=a.clientX+(o&&o.scrollLeft||l&&l.scrollLeft||0)-(o&&o.clientLeft||l&&l.clientLeft||0);a.pageY=a.clientY+(o&&o.scrollTop||l&&l.scrollTop||0)-(o&&o.clientTop||l&&l.clientTop||0)}a.which=a.charCode||a.keyCode;if(null!==a.button&&a.button!==void 0){a.button=1&a.button?0:4&a.button?1:2&a.button?2:0}}a.fixed_=!0;return a}var La,Pa=function(){if("boolean"!=typeof La){La=!1;try{var t=Object.defineProperty({},"passive",{get:function(){La=!0}});e.addEventListener("test",null,t);e.removeEventListener("test",null,t)}catch(t){}}return La},Da=["touchstart","touchmove"];function K(e,t,a){if(Array.isArray(t)){return z(K,e,t,a)}if(!xa.has(e)){xa.set(e,{})}var r=xa.get(e);if(!r.handlers){r.handlers={}}if(!r.handlers[t]){r.handlers[t]=[]}if(!a.guid){a.guid=V()}r.handlers[t].push(a);if(!r.dispatcher){r.disabled=!1;r.dispatcher=function(t,a){if(r.disabled){return}t=G(t);var i=r.handlers[t.type];if(i){for(var s=i.slice(0),o=0,l=s.length;o=a){t.apply(void 0,arguments);n=r}};return r},Na=function(t,a,n,r){if(void 0===r){r=e}var i,s=function(){r.clearTimeout(i);i=null},o=function(){var e=this,s=arguments,o=function(){i=null;o=null;if(!n){t.apply(e,s)}};if(!i&&n){t.apply(e,s)}r.clearTimeout(i);i=r.setTimeout(o,a)};o.cancel=s;return o},Ua=function(){};Ua.prototype.allowedEvents_={};Ua.prototype.on=function(e,t){var a=this.addEventListener;this.addEventListener=function(){};K(this,e,t);this.addEventListener=a};Ua.prototype.addEventListener=Ua.prototype.on;Ua.prototype.off=function(e,t){Y(this,e,t)};Ua.prototype.removeEventListener=Ua.prototype.off;Ua.prototype.one=function(e,t){var a=this.addEventListener;this.addEventListener=function(){};Q(this,e,t);this.addEventListener=a};Ua.prototype.any=function(e,t){var a=this.addEventListener;this.addEventListener=function(){};J(this,e,t);this.addEventListener=a};Ua.prototype.trigger=function(e){var t=e.type||e;if("string"==typeof e){e={type:t}}e=G(e);if(this.allowedEvents_[t]&&this["on"+t]){this["on"+t](e)}X(this,e)};Ua.prototype.dispatchEvent=Ua.prototype.trigger;var Ma;Ua.prototype.queueTrigger=function(t){var a=this;if(!Ma){Ma=new Map}var n=t.type||t,r=Ma.get(this);if(!r){r=new Map;Ma.set(this,r)}var i=r.get(n);r["delete"](n);e.clearTimeout(i);var s=e.setTimeout(function(){if(0===r.size){r=null;Ma["delete"](a)}a.trigger(t)},0);r.set(n,s)};var Ba=function(e){return e instanceof Ua||!!e.eventBusEl_&&["on","one","off","trigger"].every(function(t){return"function"==typeof e[t]})},ja=function(e,t){if(Ba(e)){t()}else{if(!e.eventedCallbacks){e.eventedCallbacks=[]}e.eventedCallbacks.push(t)}},Fa=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},Ha=function(e){if(!e.nodeName&&!Ba(e)){throw new Error("Invalid target; must be a DOM node or evented object.")}},qa=function(e){if(!Fa(e)){throw new Error("Invalid event type; must be a non-empty string or array.")}},Va=function(e){if("function"!=typeof e){throw new Error("Invalid listener; must be a function.")}},Wa=function(e,t){var a=3>t.length||t[0]===e||t[0]===e.eventBusEl_,n,r,i;if(a){n=e.eventBusEl_;if(3<=t.length){t.shift()}r=t[0];i=t[1]}else{n=t[0];r=t[1];i=t[2]}Ha(n);qa(r);Va(i);i=Oa(e,i);return{isTargetingSelf:a,target:n,type:r,listener:i}},za=function(e,t,a,n){Ha(e);if(e.nodeName){wa[t](e,a,n)}else{e[t](a,n)}},Ga={on:function(){for(var e=this,t=arguments.length,a=Array(t),n=0;n10){n=!1}}});var r=function(){n=!1};this.on("touchleave",r);this.on("touchcancel",r);this.on("touchend",function(r){a=null;if(!0===n){var i=e.performance.now()-t;if(i<200){r.preventDefault();this.trigger("tap")}}})};a.enableTouchActivity=function(){if(!this.player()||!this.player().reportUserActivity){return}var e=Oa(this.player(),this.player().reportUserActivity),t;this.on("touchstart",function(){e();this.clearInterval(t);t=this.setInterval(e,250)});var a=function(){e();this.clearInterval(t)};this.on("touchmove",e);this.on("touchend",a);this.on("touchcancel",a)};a.setTimeout=function(t,a){var n=this,r;t=Oa(this,t);this.clearTimersOnDispose_();r=e.setTimeout(function(){if(n.setTimeoutIds_.has(r)){n.setTimeoutIds_["delete"](r)}t()},a);this.setTimeoutIds_.add(r);return r};a.clearTimeout=function(t){if(this.setTimeoutIds_.has(t)){this.setTimeoutIds_["delete"](t);e.clearTimeout(t)}return t};a.setInterval=function(t,a){t=Oa(this,t);this.clearTimersOnDispose_();var n=e.setInterval(t,a);this.setIntervalIds_.add(n);return n};a.clearInterval=function(t){if(this.setIntervalIds_.has(t)){this.setIntervalIds_["delete"](t);e.clearInterval(t)}return t};a.requestAnimationFrame=function(t){var a=this;if(!this.supportsRaf_){return this.setTimeout(t,1e3/60)}this.clearTimersOnDispose_();var n;t=Oa(this,t);n=e.requestAnimationFrame(function(){if(a.rafIds_.has(n)){a.rafIds_["delete"](n)}t()});this.rafIds_.add(n);return n};a.cancelAnimationFrame=function(t){if(!this.supportsRaf_){return this.clearTimeout(t)}if(this.rafIds_.has(t)){this.rafIds_["delete"](t);e.cancelAnimationFrame(t)}return t};a.clearTimersOnDispose_=function(){var e=this;if(this.clearingTimersOnDispose_){return}this.clearingTimersOnDispose_=!0;this.one("dispose",function(){[["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(function(t){var a=t[0],n=t[1];e[a].forEach(e[n],e)});e.clearingTimersOnDispose_=!1})};t.registerComponent=function(e,a){if("string"!=typeof e||!e){throw new Error("Illegal component name, \""+e+"\"; must be a non-empty string.")}var n=t.getComponent("Tech"),r=n&&n.isTech(a),i=t===a||t.prototype.isPrototypeOf(a.prototype);if(r||!i){var s;if(r){s="techs must be registered using Tech.registerTech()"}else{s="must be a Component subclass"}throw new Error("Illegal component, \""+e+"\"; "+s+".")}e=Xa(e);if(!t.components_){t.components_={}}var o=t.getComponent("Player");if("Player"===e&&o&&o.players){var l=o.players,d=Object.keys(l);if(l&&0dn&&537>rn,un=/Firefox/i.test(an),cn=/Edg/i.test(an),mn=!cn&&(/Chrome/i.test(an)||/CriOS/i.test(an)),gn=function(){var e=an.match(/(Chrome|CriOS)\/(\d+)/);if(e&&e[2]){return parseFloat(e[2])}return null}(),yn=function(){var e=/MSIE\s(\d+)\.\d/.exec(an),t=e&&parseFloat(e[1]);return"7.7.6"}(),hn=/Safari/i.test(an)&&!mn&&!ln&&!cn,_n=/Windows/i.test(an),fn=g()&&("ontouchstart"in e||e.navigator.maxTouchPoints||e.DocumentTouch&&e.document instanceof e.DocumentTouch),Tn=/iPad/i.test(an)||hn&&fn&&!/iPhone/i.test(an),bn=/iPhone/i.test(an)&&!Tn,vn=bn||Tn||sn,Sn=(hn||vn)&&!mn,kn=Object.freeze({IS_IPOD:sn,IOS_VERSION:on,IS_ANDROID:ln,ANDROID_VERSION:dn,IS_NATIVE_ANDROID:pn,IS_FIREFOX:un,IS_EDGE:cn,IS_CHROME:mn,CHROME_VERSION:gn,IE_VERSION:yn,IS_SAFARI:hn,IS_WINDOWS:_n,TOUCH_ENABLED:fn,IS_IPAD:Tn,IS_IPHONE:bn,IS_IOS:vn,IS_ANY_SAFARI:Sn});function ae(e,t,a){if("number"!=typeof t||0>t||t>a){throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+a+").")}}function ne(e,t,a,n){ae(e,n,a.length-1);return a[n][t]}function re(e){if(e===void 0||0===e.length){return{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}}return{length:e.length,start:ne.bind(null,"start",0,e),end:ne.bind(null,"end",1,e)}}function ie(e,t){if(Array.isArray(e)){return re(e)}else if(e===void 0||t===void 0){return re()}return re([[e,t]])}function se(e,t){var a=0,n,r;if(!t){return 0}if(!e||!e.length){e=ie(0,0)}for(var s=0;st){r=t}a+=r-n}return a/t}for(var Cn={prefixed:!0},En=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]],In=En[0],xn,Ln=0;Lns;s++){n[String.fromCharCode(s)]=s-32}for(var s=48;58>s;s++){n[s-48]=s}for(s=1;13>s;s++){n["f"+s]=s+111}for(s=0;10>s;s++){n["numpad "+s]=s+96}var o=t.names=t.title={};for(s in n){o[n[s]]=s}for(var l in r){n[l]=r[l]}}),Nn=Rn.code,Un=Rn.codes,Mn=Rn.aliases,Bn=Rn.names,jn=Rn.title,Fn="vjs-modal-dialog",Hn=function(a){tn(n,a);function n(e,t){var n=a.call(this,e,t)||this;n.opened_=n.hasBeenOpened_=n.hasBeenFilled_=!1;n.closeable(!n.options_.uncloseable);n.content(n.options_.content);n.contentEl_=f("div",{className:Fn+"-content"},{role:"document"});n.descEl_=f("p",{className:Fn+"-description vjs-control-text",id:n.el().getAttribute("aria-describedby")});T(n.descEl_,n.description());n.el_.appendChild(n.descEl_);n.el_.appendChild(n.contentEl_);return n}var r=n.prototype;r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})};r.dispose=function(){this.contentEl_=null;this.descEl_=null;this.previouslyActiveEl_=null;a.prototype.dispose.call(this)};r.buildCSSClass=function(){return Fn+" vjs-hidden "+a.prototype.buildCSSClass.call(this)};r.label=function(){return this.localize(this.options_.label||"Modal Window")};r.description=function(){var e=this.options_.description||this.localize("This is a modal window.");if(this.closeable()){e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")}return e};r.open=function(){if(!this.opened_){var e=this.player();this.trigger("beforemodalopen");this.opened_=!0;if(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_){this.fill()}this.wasPlaying_=!e.paused();if(this.options_.pauseOnOpen&&this.wasPlaying_){e.pause()}this.on("keydown",this.handleKeyDown);this.hadControls_=e.controls();e.controls(!1);this.show();this.conditionalFocus_();this.el().setAttribute("aria-hidden","false");this.trigger("modalopen");this.hasBeenOpened_=!0}};r.opened=function(e){if("boolean"==typeof e){this[e?"open":"close"]()}return this.opened_};r.close=function(){if(!this.opened_){return}var e=this.player();this.trigger("beforemodalclose");this.opened_=!1;if(this.wasPlaying_&&this.options_.pauseOnOpen){e.play()}this.off("keydown",this.handleKeyDown);if(this.hadControls_){e.controls(!0)}this.hide();this.el().setAttribute("aria-hidden","true");this.trigger("modalclose");this.conditionalBlur_();if(this.options_.temporary){this.dispose()}};r.closeable=function e(t){if("boolean"==typeof t){var e=this.closeable_=!!t,a=this.getChild("closeButton");if(e&&!a){var n=this.contentEl_;this.contentEl_=this.el_;a=this.addChild("closeButton",{controlText:"Close Modal Dialog"});this.contentEl_=n;this.on(a,"close",this.close)}if(!e&&a){this.off(a,"close",this.close);this.removeChild(a);a.dispose()}}return this.closeable_};r.fill=function(){this.fillWith(this.content())};r.fillWith=function(e){var t=this.contentEl(),a=t.parentNode,n=t.nextSibling;this.trigger("beforemodalfill");this.hasBeenFilled_=!0;a.removeChild(t);this.empty();j(t,e);this.trigger("modalfill");if(n){a.insertBefore(t,n)}else{a.appendChild(t)}var r=this.getChild("closeButton");if(r){a.appendChild(r.el_)}};r.empty=function(){this.trigger("beforemodalempty");U(this.contentEl());this.trigger("modalempty")};r.content=function(e){if("undefined"!=typeof e){this.content_=e}return this.content_};r.conditionalFocus_=function(){var e=t.activeElement,a=this.player_.el_;this.previouslyActiveEl_=null;if(a.contains(e)||a===e){this.previouslyActiveEl_=e;this.focus()}};r.conditionalBlur_=function(){if(this.previouslyActiveEl_){this.previouslyActiveEl_.focus();this.previouslyActiveEl_=null}};r.handleKeyDown=function(e){e.stopPropagation();if(Rn.isEventKey(e,"Escape")&&this.closeable()){e.preventDefault();this.close();return}if(!Rn.isEventKey(e,"Tab")){return}for(var a=this.focusableEls_(),n=this.el_.querySelector(":focus"),r,s=0;s";s=l.firstChild;l.setAttribute("style","display:none; position:absolute;");t.body.appendChild(l)}for(var d={},p=0;px";e=a.firstChild.href}return e},rr=function(e){if("string"==typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e);if(t){return t.pop().toLowerCase()}}return""},ir=function(t,a){if(void 0===a){a=e.location}var n=ar(t),r=":"===n.protocol?a.protocol:n.protocol,i=r+n.host!==a.protocol+a.host;return i},sr=Object.freeze({parseUrl:ar,getAbsoluteURL:nr,getFileExtension:rr,isCrossOrigin:ir}),or=function(e){var t=lr.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)},lr=Object.prototype.toString;var dr=function(e){var t={};if(!e){return t}e.trim().split("\n").forEach(function(e){var a=e.indexOf(":"),n=e.slice(0,a).trim().toLowerCase(),r=e.slice(a+1).trim();if("undefined"==typeof t[n]){t[n]=r}else if(Array.isArray(t[n])){t[n].push(r)}else{t[n]=[t[n],r]}});return t},pr=me;me.XMLHttpRequest=e.XMLHttpRequest||function(){};me.XDomainRequest="withCredentials"in new me.XMLHttpRequest?me.XMLHttpRequest:e.XDomainRequest;pe(["get","put","post","patch","head","delete"],function(e){me["delete"===e?"del":e]=function(t,a,n){a=ce(t,a,n);a.method=e.toUpperCase();return ge(a)}});function pe(e,t){for(var a=0;a=e){t.push(r)}else if(r.startTime===r.endTime&&r.startTime<=e&&r.startTime+.5>=e){t.push(r)}}d=!1;if(t.length!==this.activeCues_.length){d=!0}else{for(var s=0;s=t){this.set(e,t);return!0}}return!1}};function Te(e,t,a,n){var r=n?e.split(n):[e];for(var s in r){if("string"!=typeof r[s]){continue}var i=r[s].split(a);if(2!==i.length){continue}var o=i[0],l=i[1];t(o,l)}}function be(e,t,a){var s=e;function n(){var t=_e(e);if(null===t){throw new he(he.Errors.BadTimeStamp,"Malformed timestamp: "+s)}e=e.replace(/^[^\sa-zA-Z-]+/,"");return t}function r(e,t){var n=new fe;Te(e,function(e,t){switch(e){case"region":for(var r=a.length-1;0<=r;r--){if(a[r].id===t){n.set(e,a[r].region);break}}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":var s=t.split(","),o=s[0];n.integer(e,o);n.percent(e,o)?n.set("snapToLines",!1):null;n.alt(e,o,["auto"]);if(2===s.length){n.alt("lineAlign",s[1],["start","center","end"])}break;case"position":s=t.split(",");n.percent(e,s[0]);if(2===s.length){n.alt("positionAlign",s[1],["start","center","end"])}break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start","center","end","left","right"]);break;}},/:/,/\s/);t.region=n.get("region",null);t.vertical=n.get("vertical","");try{t.line=n.get("line","auto")}catch(t){}t.lineAlign=n.get("lineAlign","start");t.snapToLines=n.get("snapToLines",!0);t.size=n.get("size",100);try{t.align=n.get("align","center")}catch(a){t.align=n.get("align","middle")}try{t.position=n.get("position","auto")}catch(a){t.position=n.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=n.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}function i(){e=e.replace(/^\s+/,"")}i();t.startTime=n();i();if("-->"!==e.substr(0,3)){throw new he(he.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+s)}e=e.substr(3);i();t.endTime=n();i();r(e,t)}var kr=t.createElement("textarea"),Cr={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},Er={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},Ir={v:"title",lang:"lang"},xr={rt:"ruby"};function ve(e,a){function n(){if(!a){return null}function e(e){a=a.substr(e.length);return e}var t=a.match(/^([^<]*)(<[^>]*>?)?/);return e(t[1]?t[1]:t[2])}function r(e){kr.innerHTML=e;e=kr.textContent;kr.textContent="";return e}function i(e,t){return!xr[t.localName]||xr[t.localName]===e.localName}function s(t,a){var n=Cr[t];if(!n){return null}var r=e.document.createElement(n),i=Ir[t];if(i&&a){r[i]=a.trim()}return r}var o=e.document.createElement("div"),l=o,d,p=[];while(null!==(d=n())){if("<"===d[0]){if("/"===d[1]){if(p.length&&p[p.length-1]===d.substr(2).replace(">","")){p.pop();l=l.parentNode}continue}var u=_e(d.substr(1,d.length-2)),c;if(u){c=e.document.createProcessingInstruction("timestamp",u);l.appendChild(c);continue}var g=d.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!g){continue}c=s(g[1],g[3]);if(!c){continue}if(!i(l,c)){continue}if(g[2]){var m=g[2].split(".");m.forEach(function(e){var t=/^bg_/.test(e),a=t?e.slice(3):e;if(Er.hasOwnProperty(a)){var n=t?"background-color":"color",r=Er[a];c.style[n]=r}});c.className=m.join(" ")}p.push(g[1]);l.appendChild(c);l=c;continue}l.appendChild(e.document.createTextNode(r(d)))}return o}var Lr=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function Se(e){for(var t=0,a;t=a[0]&&e<=a[1]){return!0}}return!1}function ke(e){var n=[],r="",s;if(!e||!e.childNodes){return"ltr"}function t(e,t){for(var a=t.childNodes.length-1;0<=a;a--){e.push(t.childNodes[a])}}function a(e){if(!e||!e.length){return null}var n=e.pop(),r=n.textContent||n.innerText;if(r){var i=r.match(/^.*(\n|\r)/);if(i){e.length=0;return i[0]}return r}if("ruby"===n.tagName){return a(e)}if(n.childNodes){t(e,n);return a(e)}}t(n,e);while(r=a(n)){for(var o=0;o=e.line)){return e.line}if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement){return-1}for(var t=e.track,a=t.textTrackList,n=0,r=0;re.left&&this.tope.top};xe.prototype.overlapsAny=function(e){for(var t=0;t=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right};xe.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.lefte.right;case"+y":return this.tope.bottom;}};xe.prototype.intersectPercentage=function(e){var t=Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left)),a=Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top));return t*a/(this.height*this.width)};xe.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}};xe.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,a=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e;var r={left:e.left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||a};return r};function Le(e,t,a,n){function r(e,t){for(var r,s=new xe(e),o=1,l=0;ld){r=new xe(e);o=d}e=new xe(s)}return r||s}var i=new xe(t),s=t.cue,o=Ce(s),l=[];if(s.snapToLines){var d;switch(s.vertical){case"":l=["+y","-y"];d="height";break;case"rl":l=["+x","-x"];d="width";break;case"lr":l=["-x","+x"];d="width";break;}var p=i.lineHeight,u=p*Math.round(o),c=a[d]+p,m=l[0];if(Math.abs(u)>c){u=0>u?-1:1;u*=Math.ceil(c/p)*p}if(0>o){u+=""===s.vertical?a.height:a.width;l=l.reverse()}i.move(m,u)}else{var g=100*(i.lineHeight/a.height);switch(s.lineAlign){case"center":o-=g/2;break;case"end":o-=g;break;}switch(s.vertical){case"":t.applyStyles({top:t.formatStyle(o,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(o,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(o,"%")});break;}l=["+y","-x","+x","-y"];i=new xe(t)}var y=r(i,l);t.move(y.toCSSCompatValues(a))}function Pe(){}Pe.StringDecoder=function(){return{decode:function(e){if(!e){return""}if("string"!=typeof e){throw new Error("Error - expected string data.")}return decodeURIComponent(encodeURIComponent(e))}}};Pe.convertCueToDOMTree=function(e,t){if(!e||!t){return null}return ve(e,t)};Pe.processCues=function(e,t,a){if(!e||!t||!a){return null}while(a.firstChild){a.removeChild(a.firstChild)}var r=e.document.createElement("div");r.style.position="absolute";r.style.left="0";r.style.right="0";r.style.top="0";r.style.bottom="0";r.style.margin="1.5%";a.appendChild(r);function n(e){for(var t=0;t")){i.cue.id=s;continue}case"CUE":try{be(s,i.cue,i.regionList)}catch(t){i.reportOrThrowError(t);i.cue=null;i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":var d=-1!==s.indexOf("-->");if(!s||d&&(l=!0)){i.oncue&&i.oncue(i.cue);i.cue=null;i.state="ID";continue}if(i.cue.text){i.cue.text+="\n"}i.cue.text+=s.replace(/\u2028/g,"\n").replace(/u2029/g,"\n");continue;case"BADCUE":if(!s){i.state="ID"}continue;}}}catch(t){i.reportOrThrowError(t);if("CUETEXT"===i.state&&i.cue&&i.oncue){i.oncue(i.cue)}i.cue=null;i.state="INITIAL"===i.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var t=this;try{t.buffer+=t.decoder.decode();if(t.cue||"HEADER"===t.state){t.buffer+="\n\n";t.parse()}if("INITIAL"===t.state){throw new he(he.Errors.BadSignature)}}catch(a){t.reportOrThrowError(a)}t.onflush&&t.onflush();return this}};var Pr={"":1,lr:1,rl:1},Dr={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function De(e){if("string"!=typeof e){return!1}var t=Pr[e.toLowerCase()];return t?e.toLowerCase():!1}function we(e){if("string"!=typeof e){return!1}var t=Dr[e.toLowerCase()];return t?e.toLowerCase():!1}function Ae(e,t,a){this.hasBeenReset=!1;var n="",r=!1,i=e,s=t,o=a,l=null,d="",p=!0,u="auto",c="start",m="auto",g="auto",y=100,h="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return n},set:function(e){n=""+e}},pauseOnExit:{enumerable:!0,get:function(){return r},set:function(e){r=!!e}},startTime:{enumerable:!0,get:function(){return i},set:function(e){if("number"!=typeof e){throw new TypeError("Start time must be set to a number.")}i=e;this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e){throw new TypeError("End time must be set to a number.")}s=e;this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return o},set:function(e){o=""+e;this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return l},set:function(e){l=e;this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return d},set:function(e){var t=De(e);if(!1===t){throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.")}d=t;this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return p},set:function(e){p=!!e;this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e&&e!=="auto"){throw new SyntaxError("Line: an invalid number or illegal string was specified.")}u=e;this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return c},set:function(e){var t=we(e);if(!t){console.warn("lineAlign: an invalid or illegal string was specified.")}else{c=t;this.hasBeenReset=!0}}},position:{enumerable:!0,get:function(){return m},set:function(e){if(0>e||100e||100=e}var Ar=function(){var e=100,t=3,a=0,n=100,r=0,i=100,s="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!Re(t)){throw new Error("Width must be between 0 and 100.")}e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!=typeof e){throw new TypeError("Lines must be set to a number.")}t=e}},regionAnchorY:{enumerable:!0,get:function(){return n},set:function(e){if(!Re(e)){throw new Error("RegionAnchorX must be between 0 and 100.")}n=e}},regionAnchorX:{enumerable:!0,get:function(){return a},set:function(e){if(!Re(e)){throw new Error("RegionAnchorY must be between 0 and 100.")}a=e}},viewportAnchorY:{enumerable:!0,get:function(){return i},set:function(e){if(!Re(e)){throw new Error("ViewportAnchorY must be between 0 and 100.")}i=e}},viewportAnchorX:{enumerable:!0,get:function(){return r},set:function(e){if(!Re(e)){throw new Error("ViewportAnchorX must be between 0 and 100.")}r=e}},scroll:{enumerable:!0,get:function(){return s},set:function(e){var t=Oe(e);if(!1===t){console.warn("Scroll: an invalid or illegal string was specified.")}else{s=t}}}})},Or=n(function(t){var a=t.exports={WebVTT:Pe,VTTCue:Ae,VTTRegion:Ar};e.vttjs=a;e.WebVTT=a.WebVTT;var n=a.VTTCue,r=a.VTTRegion,i=e.VTTCue,s=e.VTTRegion;a.shim=function(){e.VTTCue=n;e.VTTRegion=r};a.restore=function(){e.VTTCue=i;e.VTTRegion=s};if(!e.VTTCue){a.shim()}}),Rr=Or.WebVTT,Nr=Or.VTTCue,Ur=Or.VTTRegion;function Ne(e,t,a,n,r){if(void 0===r){r={}}var i=e.textTracks();r.kind=t;if(a){r.label=a}if(n){r.language=n}r.tech=e;var s=new vr.text.TrackClass(r);i.addTrack(s);return s}var Mr=function(a){tn(n,a);function n(e,t){var n;if(void 0===e){e={}}if(void 0===t){t=function(){}}e.reportTouchActivity=!1;n=a.call(this,null,e,t)||this;n.hasStarted_=!1;n.on("playing",function(){this.hasStarted_=!0});n.on("loadstart",function(){this.hasStarted_=!1});vr.names.forEach(function(t){var a=vr[t];if(e&&e[a.getterName]){n[a.privateName]=e[a.getterName]}});if(!n.featuresProgressEvents){n.manualProgressOn()}if(!n.featuresTimeupdateEvents){n.manualTimeUpdatesOn()}["Text","Audio","Video"].forEach(function(t){if(!1===e["native"+t+"Tracks"]){n["featuresNative"+t+"Tracks"]=!1}});if(!1===e.nativeCaptions||!1===e.nativeTextTracks){n.featuresNativeTextTracks=!1}else if(!0===e.nativeCaptions||!0===e.nativeTextTracks){n.featuresNativeTextTracks=!0}if(!n.featuresNativeTextTracks){n.emulateTextTracks()}n.preloadTextTracks=!1!==e.preloadTextTracks;n.autoRemoteTextTracks_=new vr.text.ListClass;n.initTrackListeners();if(!e.nativeControlsForTouch){n.emitTapEvents()}if(n.constructor){n.name_=n.constructor.name||"Unknown Tech"}return n}var r=n.prototype;r.triggerSourceset=function(e){var t=this;if(!this.isReady_){this.one("ready",function(){return t.setTimeout(function(){return t.triggerSourceset(e)},1)})}this.trigger({src:e,type:"sourceset"})};r.manualProgressOn=function(){this.on("durationchange",this.onDurationChange);this.manualProgress=!0;this.one("ready",this.trackProgress)};r.manualProgressOff=function(){this.manualProgress=!1;this.stopTrackingProgress();this.off("durationchange",this.onDurationChange)};r.trackProgress=function(){this.stopTrackingProgress();this.progressInterval=this.setInterval(Oa(this,function(){var e=this.bufferedPercent();if(this.bufferedPercent_!==e){this.trigger("progress")}this.bufferedPercent_=e;if(1===e){this.stopTrackingProgress()}}),500)};r.onDurationChange=function(){this.duration_=this.duration()};r.buffered=function(){return ie(0,0)};r.bufferedPercent=function(){return se(this.buffered(),this.duration_)};r.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)};r.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0;this.on("play",this.trackCurrentTime);this.on("pause",this.stopTrackingCurrentTime)};r.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1;this.stopTrackingCurrentTime();this.off("play",this.trackCurrentTime);this.off("pause",this.stopTrackingCurrentTime)};r.trackCurrentTime=function(){if(this.currentTimeInterval){this.stopTrackingCurrentTime()}this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)};r.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval);this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})};r.dispose=function(){this.clearTracks(Tr.names);if(this.manualProgress){this.manualProgressOff()}if(this.manualTimeUpdates){this.manualTimeUpdatesOff()}a.prototype.dispose.call(this)};r.clearTracks=function(e){var t=this;e=[].concat(e);e.forEach(function(e){var a=t[e+"Tracks"]()||[],n=a.length;while(n--){var r=a[n];if("text"===e){t.removeRemoteTextTrack(r)}a.removeTrack(r)}})};r.cleanupAutoTextTracks=function(){var e=this.autoRemoteTextTracks_||[],t=e.length;while(t--){var a=e[t];this.removeRemoteTextTrack(a)}};r.reset=function(){};r.error=function(e){if(e!==void 0){this.error_=new oe(e);this.trigger("error")}return this.error_};r.played=function(){if(this.hasStarted_){return ie(0,0)}return ie()};r.setCurrentTime=function(){if(this.manualTimeUpdates){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}};r.initTrackListeners=function(){var e=this;Tr.names.forEach(function(t){var a=Tr[t],n=function(){e.trigger(t+"trackchange")},r=e[a.getterName]();r.addEventListener("removetrack",n);r.addEventListener("addtrack",n);e.on("dispose",function(){r.removeEventListener("removetrack",n);r.removeEventListener("addtrack",n)})})};r.addWebVttScript_=function(){var a=this;if(e.WebVTT){return}if(t.body.contains(this.el())){if(!this.options_["vtt.js"]&&d(Or)&&0",className:this.buildCSSClass(),tabIndex:0},a);if("button"===t){ma.error("Creating a ClickableComponent with an HTML element of "+t+" is not supported; use a Button instead.")}n=o({role:"button"},n);this.tabIndex_=a.tabIndex;var r=e.prototype.createEl.call(this,t,a,n);this.createControlTextEl(r);return r};a.dispose=function(){this.controlTextEl_=null;e.prototype.dispose.call(this)};a.createControlTextEl=function(e){this.controlTextEl_=f("span",{className:"vjs-control-text"},{"aria-live":"polite"});if(e){e.appendChild(this.controlTextEl_)}this.controlText(this.controlText_,e);return this.controlTextEl_};a.controlText=function(e,t){if(void 0===t){t=this.el()}if(e===void 0){return this.controlText_||"Need Text"}var a=this.localize(e);this.controlText_=e;T(this.controlTextEl_,a);if(!this.nonIconControl){t.setAttribute("title",a)}};a.buildCSSClass=function(){return"vjs-control vjs-button "+e.prototype.buildCSSClass.call(this)};a.enable=function(){if(!this.enabled_){this.enabled_=!0;this.removeClass("vjs-disabled");this.el_.setAttribute("aria-disabled","false");if("undefined"!=typeof this.tabIndex_){this.el_.setAttribute("tabIndex",this.tabIndex_)}this.on(["tap","click"],this.handleClick);this.on("keydown",this.handleKeyDown)}};a.disable=function(){this.enabled_=!1;this.addClass("vjs-disabled");this.el_.setAttribute("aria-disabled","true");if("undefined"!=typeof this.tabIndex_){this.el_.removeAttribute("tabIndex")}this.off("mouseover",this.handleMouseOver);this.off("mouseout",this.handleMouseOut);this.off(["tap","click"],this.handleClick);this.off("keydown",this.handleKeyDown)};a.handleClick=function(){if(this.options_.clickHandler){this.options_.clickHandler.call(this,arguments)}};a.handleKeyDown=function(t){if(Rn.isEventKey(t,"Space")||Rn.isEventKey(t,"Enter")){t.preventDefault();t.stopPropagation();this.trigger("click")}else{e.prototype.handleKeyDown.call(this,t)}};return t}(Qa);Qa.registerComponent("ClickableComponent",Xr);var $r=function(e){tn(t,e);function t(t,a){var n=e.call(this,t,a)||this;n.update();t.on("posterchange",Oa(Ja(n),n.update));return n}var a=t.prototype;a.dispose=function(){this.player().off("posterchange",this.update);e.prototype.dispose.call(this)};a.createEl=function(){var e=f("div",{className:"vjs-poster",tabIndex:-1});return e};a.update=function(){var e=this.player().poster();this.setSrc(e);if(e){this.show()}else{this.hide()}};a.setSrc=function(e){var t="";if(e){t="url(\""+e+"\")"}this.el_.style.backgroundImage=t};a.handleClick=function(){if(!this.player_.controls()){return}var e=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&0",className:this.buildCSSClass()},t);a=o({type:"button"},a);var n=Qa.prototype.createEl.call(this,e,t,a);this.createControlTextEl(n);return n};a.addChild=function(e,t){if(void 0===t){t={}}var a=this.constructor.name;ma.warn("Adding an actionable (user controllable) child to a Button ("+a+") is not supported; use a ClickableComponent instead.");return Qa.prototype.addChild.call(this,e,t)};a.enable=function(){e.prototype.enable.call(this);this.el_.removeAttribute("disabled")};a.disable=function(){e.prototype.disable.call(this);this.el_.setAttribute("disabled","disabled")};a.handleKeyDown=function(t){if(Rn.isEventKey(t,"Space")||Rn.isEventKey(t,"Enter")){t.stopPropagation();return}e.prototype.handleKeyDown.call(this,t)};return t}(Xr);Qa.registerComponent("Button",ti);var ai=function(e){tn(t,e);function t(t,a){var n=e.call(this,t,a)||this;n.mouseused_=!1;n.on("mousedown",n.handleMouseDown);return n}var a=t.prototype;a.buildCSSClass=function(){return"vjs-big-play-button"};a.handleClick=function(e){var t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY){var a=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&0e?0:e;var a=Math.floor(e%60),n=Math.floor(e/60%60),r=Math.floor(e/3600),i=Math.floor(t/60%60),o=Math.floor(t/3600);if(isNaN(e)||e===1/0){r=n=a="-"}r=0n?"0"+n:n)+":";a=10>a?"0"+a:a;return r+n+a},si=ii;function Xe(e,t){if(void 0===t){t=e}return si(e,t)}var oi=function(e){tn(a,e);function a(t,a){var n=e.call(this,t,a)||this;n.on(t,["timeupdate","ended"],n.updateContent);n.updateTextNode_();return n}var n=a.prototype;n.createEl=function(){var t=this.buildCSSClass(),a=e.prototype.createEl.call(this,"div",{className:t+" vjs-time-control vjs-control",innerHTML:""+this.localize(this.labelText_)+"\xA0"});this.contentEl_=f("span",{className:t+"-display"},{"aria-live":"off",role:"presentation"});a.appendChild(this.contentEl_);return a};n.dispose=function(){this.contentEl_=null;this.textNode_=null;e.prototype.dispose.call(this)};n.updateTextNode_=function(e){var a=this;if(void 0===e){e=0}e=Xe(e);if(this.formattedTime_===e){return}this.formattedTime_=e;this.requestAnimationFrame(function(){if(!a.contentEl_){return}var e=a.textNode_;a.textNode_=t.createTextNode(a.formattedTime_);if(!a.textNode_){return}if(e){a.contentEl_.replaceChild(a.textNode_,e)}else{a.contentEl_.appendChild(a.textNode_)}})};n.updateContent=function(){};return a}(Qa);oi.prototype.labelText_="Time";oi.prototype.controlText_="Time";Qa.registerComponent("TimeDisplay",oi);var li=function(e){tn(t,e);function t(){return e.apply(this,arguments)||this}var a=t.prototype;a.buildCSSClass=function(){return"vjs-current-time"};a.updateContent=function(){var e;if(this.player_.ended()){e=this.player_.duration()}else{e=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}this.updateTextNode_(e)};return t}(oi);li.prototype.labelText_="Current Time";li.prototype.controlText_="Current Time";Qa.registerComponent("CurrentTimeDisplay",li);var di=function(e){tn(t,e);function t(t,a){var n=e.call(this,t,a)||this;n.on(t,"durationchange",n.updateContent);n.on(t,"loadstart",n.updateContent);n.on(t,"loadedmetadata",n.updateContent);return n}var a=t.prototype;a.buildCSSClass=function(){return"vjs-duration"};a.updateContent=function(){var e=this.player_.duration();this.updateTextNode_(e)};return t}(oi);di.prototype.labelText_="Duration";di.prototype.controlText_="Duration";Qa.registerComponent("DurationDisplay",di);var pi=function(e){tn(t,e);function t(){return e.apply(this,arguments)||this}var a=t.prototype;a.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"
                      /
                      "},{"aria-hidden":!0})};return t}(Qa);Qa.registerComponent("TimeDivider",pi);var ui=function(e){tn(t,e);function t(t,a){var n=e.call(this,t,a)||this;n.on(t,"durationchange",n.updateContent);return n}var a=t.prototype;a.buildCSSClass=function(){return"vjs-remaining-time"};a.createEl=function(){var t=e.prototype.createEl.call(this);t.insertBefore(f("span",{},{"aria-hidden":!0},"-"),this.contentEl_);return t};a.updateContent=function(){if("number"!=typeof this.player_.duration()){return}var e;if(this.player_.ended()){e=0}else if(this.player_.remainingTimeDisplay){e=this.player_.remainingTimeDisplay()}else{e=this.player_.remainingTime()}this.updateTextNode_(e)};return t}(oi);ui.prototype.labelText_="Remaining Time";ui.prototype.controlText_="Remaining Time";Qa.registerComponent("RemainingTimeDisplay",ui);var ci=function(e){tn(t,e);function t(t,a){var n=e.call(this,t,a)||this;n.updateShowing();n.on(n.player(),"durationchange",n.updateShowing);return n}var a=t.prototype;a.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});this.contentEl_=f("div",{className:"vjs-live-display",innerHTML:""+this.localize("Stream Type")+"\xA0"+this.localize("LIVE")},{"aria-live":"off"});t.appendChild(this.contentEl_);return t};a.dispose=function(){this.contentEl_=null;e.prototype.dispose.call(this)};a.updateShowing=function(){if(this.player().duration()===1/0){this.show()}else{this.hide()}};return t}(Qa);Qa.registerComponent("LiveDisplay",ci);var mi=function(e){tn(t,e);function t(t,a){var n=e.call(this,t,a)||this;n.updateLiveEdgeStatus();if(n.player_.liveTracker){n.on(n.player_.liveTracker,"liveedgechange",n.updateLiveEdgeStatus)}return n}var a=t.prototype;a.createEl=function(){var t=e.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});this.textEl_=f("span",{className:"vjs-seek-to-live-text",innerHTML:this.localize("LIVE")},{"aria-hidden":"true"});t.appendChild(this.textEl_);return t};a.updateLiveEdgeStatus=function(){if(!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()){this.setAttribute("aria-disabled",!0);this.addClass("vjs-at-live-edge");this.controlText("Seek to live, currently playing live")}else{this.setAttribute("aria-disabled",!1);this.removeClass("vjs-at-live-edge");this.controlText("Seek to live, currently behind live")}};a.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()};a.dispose=function(){if(this.player_.liveTracker){this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatus)}this.textEl_=null;e.prototype.dispose.call(this)};return t}(ti);mi.prototype.controlText_="Seek to live, currently playing live";Qa.registerComponent("SeekToLive",mi);var gi=function(e,t,a){e=+e;return Math.min(a,Math.max(t,isNaN(e)?t:e))},yi=function(e){tn(t,e);function t(t,a){var n=e.call(this,t,a)||this;n.bar=n.getChild(n.options_.barName);n.vertical(!!n.options_.vertical);n.enable();return n}var a=t.prototype;a.enabled=function(){return this.enabled_};a.enable=function(){if(this.enabled()){return}this.on("mousedown",this.handleMouseDown);this.on("touchstart",this.handleMouseDown);this.on("keydown",this.handleKeyDown);this.on("click",this.handleClick);this.on(this.player_,"controlsvisible",this.update);if(this.playerEvent){this.on(this.player_,this.playerEvent,this.update)}this.removeClass("disabled");this.setAttribute("tabindex",0);this.enabled_=!0};a.disable=function(){if(!this.enabled()){return}var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown);this.off("touchstart",this.handleMouseDown);this.off("keydown",this.handleKeyDown);this.off("click",this.handleClick);this.off(this.player_,"controlsvisible",this.update);this.off(e,"mousemove",this.handleMouseMove);this.off(e,"mouseup",this.handleMouseUp);this.off(e,"touchmove",this.handleMouseMove);this.off(e,"touchend",this.handleMouseUp);this.removeAttribute("tabindex");this.addClass("disabled");if(this.playerEvent){this.off(this.player_,this.playerEvent,this.update)}this.enabled_=!1};a.createEl=function(t,a,n){if(void 0===a){a={}}if(void 0===n){n={}}a.className=a.className+" vjs-slider";a=o({tabIndex:0},a);n=o({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},n);return e.prototype.createEl.call(this,t,a,n)};a.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;if("mousedown"===e.type){e.preventDefault()}if("touchstart"===e.type&&!mn){e.preventDefault()}D();this.addClass("vjs-sliding");this.trigger("slideractive");this.on(t,"mousemove",this.handleMouseMove);this.on(t,"mouseup",this.handleMouseUp);this.on(t,"touchmove",this.handleMouseMove);this.on(t,"touchend",this.handleMouseUp);this.handleMouseMove(e)};a.handleMouseMove=function(){};a.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;w();this.removeClass("vjs-sliding");this.trigger("sliderinactive");this.off(e,"mousemove",this.handleMouseMove);this.off(e,"mouseup",this.handleMouseUp);this.off(e,"touchmove",this.handleMouseMove);this.off(e,"touchend",this.handleMouseUp);this.update()};a.update=function(){var e=this;if(!this.el_||!this.bar){return}var t=this.getProgress();if(t===this.progress_){return t}this.progress_=t;this.requestAnimationFrame(function(){var a=e.vertical()?"height":"width";e.bar.el().style[a]=(100*t).toFixed(2)+"%"});return t};a.getProgress=function(){return+gi(this.getPercent(),0,1).toFixed(4)};a.calculateDistance=function(e){var t=R(this.el_,e);if(this.vertical()){return t.y}return t.x};a.handleKeyDown=function(t){if(Rn.isEventKey(t,"Left")||Rn.isEventKey(t,"Down")){t.preventDefault();t.stopPropagation();this.stepBack()}else if(Rn.isEventKey(t,"Right")||Rn.isEventKey(t,"Up")){t.preventDefault();t.stopPropagation();this.stepForward()}else{e.prototype.handleKeyDown.call(this,t)}};a.handleClick=function(e){e.stopPropagation();e.preventDefault()};a.vertical=function(e){if(e===void 0){return this.vertical_||!1}this.vertical_=!!e;if(this.vertical_){this.addClass("vjs-slider-vertical")}else{this.addClass("vjs-slider-horizontal")}};return t}(Qa);Qa.registerComponent("Slider",yi);var hi=function(e,t){return gi(100*(e/t),0,100).toFixed(2)+"%"},fi=function(e){tn(a,e);function a(t,a){var n=e.call(this,t,a)||this;n.partEls_=[];n.on(t,"progress",n.update);return n}var n=a.prototype;n.createEl=function(){var a=e.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),n=f("span",{className:"vjs-control-text"}),r=f("span",{textContent:this.localize("Loaded")}),i=t.createTextNode(": ");this.percentageEl_=f("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"});a.appendChild(n);n.appendChild(r);n.appendChild(i);n.appendChild(this.percentageEl_);return a};n.dispose=function(){this.partEls_=null;this.percentageEl_=null;e.prototype.dispose.call(this)};n.update=function(){var e=this;this.requestAnimationFrame(function(){var t=e.player_.liveTracker,a=e.player_.buffered(),n=t&&t.isLive()?t.seekableEnd():e.player_.duration(),r=e.player_.bufferedEnd(),s=e.partEls_,o=hi(r,n);if(e.percent_!==o){e.el_.style.width=o;T(e.percentageEl_,o);e.percent_=o}for(var l=0;la.length;c--){e.el_.removeChild(s[c-1])}s.length=a.length})};return a}(Qa);Qa.registerComponent("LoadProgressBar",fi);var Ti=function(e){tn(t,e);function t(t,a){var n=e.call(this,t,a)||this;n.update=Ra(Oa(Ja(n),n.update),Aa);return n}var a=t.prototype;a.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})};a.update=function(e,t,a){var n=A(this.el_),r=A(this.player_.el()),i=e.width*t;if(!r||!n){return}var s=e.left-r.left+i,o=e.width-i+(r.right-e.right),l=n.width/2;if(sl){l=0}else if(l>n.width){l=n.width}this.el_.style.right="-"+l+"px";this.write(a)};a.write=function(e){T(this.el_,e)};a.updateTime=function(e,t,a,n){var r=this;if(this.rafId_){this.cancelAnimationFrame(this.rafId_)}this.rafId_=this.requestAnimationFrame(function(){var i,s=r.player_.duration();if(r.player_.liveTracker&&r.player_.liveTracker.isLive()){var o=r.player_.liveTracker.liveWindow(),l=o-t*o;i=(1>l?"":"-")+Xe(l,o)}else{i=Xe(a,s)}r.update(e,t,i);if(n){n()}})};return t}(Qa);Qa.registerComponent("TimeTooltip",Ti);var bi=function(e){tn(t,e);function t(t,a){var n=e.call(this,t,a)||this;n.update=Ra(Oa(Ja(n),n.update),Aa);return n}var a=t.prototype;a.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})};a.update=function(e,t){var a=this.getChild("timeTooltip");if(!a){return}var n=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();a.updateTime(e,t,n)};return t}(Qa);bi.prototype.options_={children:[]};if(!vn&&!ln){bi.prototype.options_.children.push("timeTooltip")}Qa.registerComponent("PlayProgressBar",bi);var vi=function(e){tn(t,e);function t(t,a){var n=e.call(this,t,a)||this;n.update=Ra(Oa(Ja(n),n.update),Aa);return n}var a=t.prototype;a.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})};a.update=function(e,t){var a=this,n=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,n,function(){a.el_.style.left=e.width*t+"px"})};return t}(Qa);vi.prototype.options_={children:["timeTooltip"]};Qa.registerComponent("MouseTimeDisplay",vi);var Si=12,ki=function(e){tn(a,e);function a(t,a){var n=e.call(this,t,a)||this;n.setEventHandlers_();return n}var n=a.prototype;n.setEventHandlers_=function(){this.update_=Oa(this,this.update);this.update=Ra(this.update_,Aa);this.on(this.player_,["ended","durationchange","timeupdate"],this.update);if(this.player_.liveTracker){this.on(this.player_.liveTracker,"liveedgechange",this.update)}this.updateInterval=null;this.on(this.player_,["playing"],this.enableInterval_);this.on(this.player_,["ended","pause","waiting"],this.disableInterval_);if("hidden"in t&&"visibilityState"in t){this.on(t,"visibilitychange",this.toggleVisibility_)}};n.toggleVisibility_=function(a){if(t.hidden){this.disableInterval_(a)}else{this.enableInterval_();this.update()}};n.enableInterval_=function(){if(this.updateInterval){return}this.updateInterval=this.setInterval(this.update,Aa)};n.disableInterval_=function(t){if(this.player_.liveTracker&&this.player_.liveTracker.isLive()&&"ended"!==t.type){return}if(!this.updateInterval){return}this.clearInterval(this.updateInterval);this.updateInterval=null};n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})};n.update=function(){var t=this,a=e.prototype.update.call(this);this.requestAnimationFrame(function(){var e=t.player_.ended()?t.player_.duration():t.getCurrentTime_(),n=t.player_.liveTracker,r=t.player_.duration();if(n&&n.isLive()){r=t.player_.liveTracker.liveCurrentTime()}if(t.percent_!==a){t.el_.setAttribute("aria-valuenow",(100*a).toFixed(2));t.percent_=a}if(t.currentTime_!==e||t.duration_!==r){t.el_.setAttribute("aria-valuetext",t.localize("progress bar timing: currentTime={1} duration={2}",[Xe(e,r),Xe(r,r)],"{1} of {2}"));t.currentTime_=e;t.duration_=r}if(t.bar){t.bar.update(A(t.el()),t.getProgress())}});return a};n.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()};n.getPercent=function(){var e=this.getCurrentTime_(),t,a=this.player_.liveTracker;if(a&&a.isLive()){t=(e-a.seekableStart())/a.liveWindow();if(a.atLiveEdge()){t=1}}else{t=e/this.player_.duration()}return t};n.handleMouseDown=function(t){if(!F(t)){return}t.stopPropagation();this.player_.scrubbing(!0);this.videoWasPlaying=!this.player_.paused();this.player_.pause();e.prototype.handleMouseDown.call(this,t)};n.handleMouseMove=function(e){if(!F(e)){return}var t,a=this.calculateDistance(e),n=this.player_.liveTracker;if(!n||!n.isLive()){t=a*this.player_.duration();if(t===this.player_.duration()){t=t-.1}}else{var r=n.seekableStart(),i=n.liveCurrentTime();t=r+a*n.liveWindow();if(t>=i){t=i}if(t<=r){t=r+.1}if(t===1/0){return}}this.player_.currentTime(t)};n.enable=function(){e.prototype.enable.call(this);var t=this.getChild("mouseTimeDisplay");if(!t){return}t.show()};n.disable=function(){e.prototype.disable.call(this);var t=this.getChild("mouseTimeDisplay");if(!t){return}t.hide()};n.handleMouseUp=function(t){e.prototype.handleMouseUp.call(this,t);if(t){t.stopPropagation()}this.player_.scrubbing(!1);this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0});if(this.videoWasPlaying){de(this.player_.play())}else{this.update_()}};n.stepForward=function(){this.player_.currentTime(this.player_.currentTime()+5)};n.stepBack=function(){this.player_.currentTime(this.player_.currentTime()-5)};n.handleAction=function(){if(this.player_.paused()){this.player_.play()}else{this.player_.pause()}};n.handleKeyDown=function(t){if(Rn.isEventKey(t,"Space")||Rn.isEventKey(t,"Enter")){t.preventDefault();t.stopPropagation();this.handleAction(t)}else if(Rn.isEventKey(t,"Home")){t.preventDefault();t.stopPropagation();this.player_.currentTime(0)}else if(Rn.isEventKey(t,"End")){t.preventDefault();t.stopPropagation();this.player_.currentTime(this.player_.duration())}else if(/^[0-9]$/.test(Rn(t))){t.preventDefault();t.stopPropagation();var a=10*(Rn.codes[Rn(t)]-Rn.codes[0])/100;this.player_.currentTime(this.player_.duration()*a)}else if(Rn.isEventKey(t,"PgDn")){t.preventDefault();t.stopPropagation();this.player_.currentTime(this.player_.currentTime()-5*Si)}else if(Rn.isEventKey(t,"PgUp")){t.preventDefault();t.stopPropagation();this.player_.currentTime(this.player_.currentTime()+5*Si)}else{e.prototype.handleKeyDown.call(this,t)}};return a}(yi);ki.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};if(!vn&&!ln){ki.prototype.options_.children.splice(1,0,"mouseTimeDisplay")}Qa.registerComponent("SeekBar",ki);var Ci=function(e){tn(t,e);function t(t,a){var n=e.call(this,t,a)||this;n.handleMouseMove=Ra(Oa(Ja(n),n.handleMouseMove),Aa);n.throttledHandleMouseSeek=Ra(Oa(Ja(n),n.handleMouseSeek),Aa);n.enable();return n}var a=t.prototype;a.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})};a.handleMouseMove=function(e){var t=this.getChild("seekBar");if(!t){return}var a=t.getChild("playProgressBar"),n=t.getChild("mouseTimeDisplay");if(!a&&!n){return}var r=t.el(),i=A(r),s=R(r,e).x;s=gi(0,1,s);if(n){n.update(i,s)}if(a){a.update(i,t.getProgress())}};a.handleMouseSeek=function(e){var t=this.getChild("seekBar");if(t){t.handleMouseMove(e)}};a.enabled=function(){return this.enabled_};a.disable=function(){this.children().forEach(function(e){return e.disable&&e.disable()});if(!this.enabled()){return}this.off(["mousedown","touchstart"],this.handleMouseDown);this.off(this.el_,"mousemove",this.handleMouseMove);this.handleMouseUp();this.addClass("disabled");this.enabled_=!1};a.enable=function(){this.children().forEach(function(e){return e.enable&&e.enable()});if(this.enabled()){return}this.on(["mousedown","touchstart"],this.handleMouseDown);this.on(this.el_,"mousemove",this.handleMouseMove);this.removeClass("disabled");this.enabled_=!0};a.handleMouseDown=function(e){var t=this.el_.ownerDocument,a=this.getChild("seekBar");if(a){a.handleMouseDown(e)}this.on(t,"mousemove",this.throttledHandleMouseSeek);this.on(t,"touchmove",this.throttledHandleMouseSeek);this.on(t,"mouseup",this.handleMouseUp);this.on(t,"touchend",this.handleMouseUp)};a.handleMouseUp=function(e){var t=this.el_.ownerDocument,a=this.getChild("seekBar");if(a){a.handleMouseUp(e)}this.off(t,"mousemove",this.throttledHandleMouseSeek);this.off(t,"touchmove",this.throttledHandleMouseSeek);this.off(t,"mouseup",this.handleMouseUp);this.off(t,"touchend",this.handleMouseUp)};return t}(Qa);Ci.prototype.options_={children:["seekBar"]};Qa.registerComponent("ProgressControl",Ci);var Ei=function(e){tn(a,e);function a(a,n){var r=e.call(this,a,n)||this;r.on(a,["enterpictureinpicture","leavepictureinpicture"],r.handlePictureInPictureChange);if(!t.pictureInPictureEnabled){r.disable()}return r}var n=a.prototype;n.buildCSSClass=function(){return"vjs-picture-in-picture-control "+e.prototype.buildCSSClass.call(this)};n.handlePictureInPictureChange=function(){if(this.player_.isInPictureInPicture()){this.controlText("Exit Picture-in-Picture")}else{this.controlText("Picture-in-Picture")}};n.handleClick=function(){if(!this.player_.isInPictureInPicture()){this.player_.requestPictureInPicture()}else{this.player_.exitPictureInPicture()}};return a}(ti);Ei.prototype.controlText_="Picture-in-Picture";Qa.registerComponent("PictureInPictureToggle",Ei);var Ii=function(e){tn(a,e);function a(a,n){var r=e.call(this,a,n)||this;r.on(a,"fullscreenchange",r.handleFullscreenChange);if(!1===t[a.fsApi_.fullscreenEnabled]){r.disable()}return r}var n=a.prototype;n.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this)};n.handleFullscreenChange=function(){if(this.player_.isFullscreen()){this.controlText("Non-Fullscreen")}else{this.controlText("Fullscreen")}};n.handleClick=function(){if(!this.player_.isFullscreen()){this.player_.requestFullscreen()}else{this.player_.exitFullscreen()}};return a}(ti);Ii.prototype.controlText_="Fullscreen";Qa.registerComponent("FullscreenToggle",Ii);var xi=function(e,t){if(t.tech_&&!t.tech_.featuresVolumeControl){e.addClass("vjs-hidden")}e.on(t,"loadstart",function(){if(!t.tech_.featuresVolumeControl){e.addClass("vjs-hidden")}else{e.removeClass("vjs-hidden")}})},Li=function(e){tn(t,e);function t(){return e.apply(this,arguments)||this}var a=t.prototype;a.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:""})};return t}(Qa);Qa.registerComponent("VolumeLevel",Li);var Pi=function(e){tn(t,e);function t(t,a){var n=e.call(this,t,a)||this;n.on("slideractive",n.updateLastVolume_);n.on(t,"volumechange",n.updateARIAAttributes);t.ready(function(){return n.updateARIAAttributes()});return n}var a=t.prototype;a.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})};a.handleMouseDown=function(t){if(!F(t)){return}e.prototype.handleMouseDown.call(this,t)};a.handleMouseMove=function(e){if(!F(e)){return}this.checkMuted();this.player_.volume(this.calculateDistance(e))};a.checkMuted=function(){if(this.player_.muted()){this.player_.muted(!1)}};a.getPercent=function(){if(this.player_.muted()){return 0}return this.player_.volume()};a.stepForward=function(){this.checkMuted();this.player_.volume(this.player_.volume()+.1)};a.stepBack=function(){this.checkMuted();this.player_.volume(this.player_.volume()-.1)};a.updateARIAAttributes=function(){var e=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",e);this.el_.setAttribute("aria-valuetext",e+"%")};a.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())};a.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",function(){if(0===e.player_.volume()){e.player_.lastVolume_(t)}})};return t}(yi);Pi.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};Pi.prototype.playerEvent="volumechange";Qa.registerComponent("VolumeBar",Pi);var Di=function(e){tn(t,e);function t(t,a){var n;if(void 0===a){a={}}a.vertical=a.vertical||!1;if("undefined"==typeof a.volumeBar||d(a.volumeBar)){a.volumeBar=a.volumeBar||{};a.volumeBar.vertical=a.vertical}n=e.call(this,t,a)||this;xi(Ja(n),t);n.throttledHandleMouseMove=Ra(Oa(Ja(n),n.handleMouseMove),Aa);n.on("mousedown",n.handleMouseDown);n.on("touchstart",n.handleMouseDown);n.on(n.volumeBar,["focus","slideractive"],function(){n.volumeBar.addClass("vjs-slider-active");n.addClass("vjs-slider-active");n.trigger("slideractive")});n.on(n.volumeBar,["blur","sliderinactive"],function(){n.volumeBar.removeClass("vjs-slider-active");n.removeClass("vjs-slider-active");n.trigger("sliderinactive")});return n}var a=t.prototype;a.createEl=function(){var t="vjs-volume-horizontal";if(this.options_.vertical){t="vjs-volume-vertical"}return e.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+t})};a.handleMouseDown=function(){var e=this.el_.ownerDocument;this.on(e,"mousemove",this.throttledHandleMouseMove);this.on(e,"touchmove",this.throttledHandleMouseMove);this.on(e,"mouseup",this.handleMouseUp);this.on(e,"touchend",this.handleMouseUp)};a.handleMouseUp=function(){var e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseMove);this.off(e,"touchmove",this.throttledHandleMouseMove);this.off(e,"mouseup",this.handleMouseUp);this.off(e,"touchend",this.handleMouseUp)};a.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)};return t}(Qa);Di.prototype.options_={children:["volumeBar"]};Qa.registerComponent("VolumeControl",Di);var wi=function(e,t){if(t.tech_&&!t.tech_.featuresMuteControl){e.addClass("vjs-hidden")}e.on(t,"loadstart",function(){if(!t.tech_.featuresMuteControl){e.addClass("vjs-hidden")}else{e.removeClass("vjs-hidden")}})},Ai=function(e){tn(t,e);function t(t,a){var n=e.call(this,t,a)||this;wi(Ja(n),t);n.on(t,["loadstart","volumechange"],n.update);return n}var a=t.prototype;a.buildCSSClass=function(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this)};a.handleClick=function(){var e=this.player_.volume(),t=this.player_.lastVolume_();if(0===e){var a=.1>t?.1:t;this.player_.volume(a);this.player_.muted(!1)}else{this.player_.muted(this.player_.muted()?!1:!0)}};a.update=function(){this.updateIcon_();this.updateControlText_()};a.updateIcon_=function(){var e=this.player_.volume(),t=3;if(vn&&this.player_.tech_&&this.player_.tech_.el_){this.player_.muted(this.player_.tech_.el_.muted)}if(0===e||this.player_.muted()){t=0}else if(.33>e){t=1}else if(.67>e){t=2}for(var a=0;4>a;a++){k(this.el_,"vjs-vol-"+a)}S(this.el_,"vjs-vol-"+t)};a.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume(),t=e?"Unmute":"Mute";if(this.controlText()!==t){this.controlText(t)}};return t}(ti);Ai.prototype.controlText_="Mute";Qa.registerComponent("MuteToggle",Ai);var Oi=function(e){tn(a,e);function a(t,a){var n;if(void 0===a){a={}}if("undefined"!=typeof a.inline){a.inline=a.inline}else{a.inline=!0}if("undefined"==typeof a.volumeControl||d(a.volumeControl)){a.volumeControl=a.volumeControl||{};a.volumeControl.vertical=!a.inline}n=e.call(this,t,a)||this;n.on(t,["loadstart"],n.volumePanelState_);n.on(n.muteToggle,"keyup",n.handleKeyPress);n.on(n.volumeControl,"keyup",n.handleVolumeControlKeyUp);n.on("keydown",n.handleKeyPress);n.on("mouseover",n.handleMouseOver);n.on("mouseout",n.handleMouseOut);n.on(n.volumeControl,["slideractive"],n.sliderActive_);n.on(n.volumeControl,["sliderinactive"],n.sliderInactive_);return n}var n=a.prototype;n.sliderActive_=function(){this.addClass("vjs-slider-active")};n.sliderInactive_=function(){this.removeClass("vjs-slider-active")};n.volumePanelState_=function(){if(this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")){this.addClass("vjs-hidden")}if(this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")){this.addClass("vjs-mute-toggle-only")}};n.createEl=function(){var t="vjs-volume-panel-horizontal";if(!this.options_.inline){t="vjs-volume-panel-vertical"}return e.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+t})};n.dispose=function(){this.handleMouseOut();e.prototype.dispose.call(this)};n.handleVolumeControlKeyUp=function(e){if(Rn.isEventKey(e,"Esc")){this.muteToggle.focus()}};n.handleMouseOver=function(){this.addClass("vjs-hover");K(t,"keyup",Oa(this,this.handleKeyPress))};n.handleMouseOut=function(){this.removeClass("vjs-hover");Y(t,"keyup",Oa(this,this.handleKeyPress))};n.handleKeyPress=function(e){if(Rn.isEventKey(e,"Esc")){this.handleMouseOut()}};return a}(Qa);Oi.prototype.options_={children:["muteToggle","volumeControl"]};Qa.registerComponent("VolumePanel",Oi);var Ri=function(e){tn(a,e);function a(t,a){var n=e.call(this,t,a)||this;if(a){n.menuButton_=a.menuButton}n.focusedChild_=-1;n.on("keydown",n.handleKeyDown);n.boundHandleBlur_=Oa(Ja(n),n.handleBlur);n.boundHandleTapClick_=Oa(Ja(n),n.handleTapClick);return n}var n=a.prototype;n.addEventListenerForItem=function(e){if(!(e instanceof Qa)){return}this.on(e,"blur",this.boundHandleBlur_);this.on(e,["tap","click"],this.boundHandleTapClick_)};n.removeEventListenerForItem=function(e){if(!(e instanceof Qa)){return}this.off(e,"blur",this.boundHandleBlur_);this.off(e,["tap","click"],this.boundHandleTapClick_)};n.removeChild=function(t){if("string"==typeof t){t=this.getChild(t)}this.removeEventListenerForItem(t);e.prototype.removeChild.call(this,t)};n.addItem=function(e){var t=this.addChild(e);if(t){this.addEventListenerForItem(t)}};n.createEl=function(){var t=this.options_.contentElType||"ul";this.contentEl_=f(t,{className:"vjs-menu-content"});this.contentEl_.setAttribute("role","menu");var a=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});a.appendChild(this.contentEl_);K(a,"click",function(e){e.preventDefault();e.stopImmediatePropagation()});return a};n.dispose=function(){this.contentEl_=null;this.boundHandleBlur_=null;this.boundHandleTapClick_=null;e.prototype.dispose.call(this)};n.handleBlur=function(e){var a=e.relatedTarget||t.activeElement;if(!this.children().some(function(e){return e.el()===a})){var n=this.menuButton_;if(n&&n.buttonPressed_&&a!==n.el().firstChild){n.unpressButton()}}};n.handleTapClick=function(e){if(this.menuButton_){this.menuButton_.unpressButton();var t=this.children();if(!Array.isArray(t)){return}var a=t.filter(function(t){return t.el()===e.target})[0];if(!a){return}if("CaptionSettingsMenuItem"!==a.name()){this.menuButton_.focus()}}};n.handleKeyDown=function(e){if(Rn.isEventKey(e,"Left")||Rn.isEventKey(e,"Down")){e.preventDefault();e.stopPropagation();this.stepForward()}else if(Rn.isEventKey(e,"Right")||Rn.isEventKey(e,"Up")){e.preventDefault();e.stopPropagation();this.stepBack()}};n.stepForward=function(){var e=0;if(this.focusedChild_!==void 0){e=this.focusedChild_+1}this.focus(e)};n.stepBack=function(){var e=0;if(this.focusedChild_!==void 0){e=this.focusedChild_-1}this.focus(e)};n.focus=function(e){if(void 0===e){e=0}var t=this.children().slice(),a=t.length&&t[0].className&&/vjs-menu-title/.test(t[0].className);if(a){t.shift()}if(0e){e=0}else if(e>=t.length){e=t.length-1}this.focusedChild_=e;t[e].el_.focus()}};return a}(Qa);Qa.registerComponent("Menu",Ri);var Ni=function(e){tn(a,e);function a(a,n){var r;if(void 0===n){n={}}r=e.call(this,a,n)||this;r.menuButton_=new ti(a,n);r.menuButton_.controlText(r.controlText_);r.menuButton_.el_.setAttribute("aria-haspopup","true");var i=ti.prototype.buildCSSClass();r.menuButton_.el_.className=r.buildCSSClass()+" "+i;r.menuButton_.removeClass("vjs-control");r.addChild(r.menuButton_);r.update();r.enabled_=!0;r.on(r.menuButton_,"tap",r.handleClick);r.on(r.menuButton_,"click",r.handleClick);r.on(r.menuButton_,"keydown",r.handleKeyDown);r.on(r.menuButton_,"mouseenter",function(){r.addClass("vjs-hover");r.menu.show();K(t,"keyup",Oa(Ja(r),r.handleMenuKeyUp))});r.on("mouseleave",r.handleMouseLeave);r.on("keydown",r.handleSubmenuKeyDown);return r}var n=a.prototype;n.update=function(){var e=this.createMenu();if(this.menu){this.menu.dispose();this.removeChild(this.menu)}this.menu=e;this.addChild(e);this.buttonPressed_=!1;this.menuButton_.el_.setAttribute("aria-expanded","false");if(this.items&&this.items.length<=this.hideThreshold_){this.hide()}else{this.show()}};n.createMenu=function(){var e=new Ri(this.player_,{menuButton:this});this.hideThreshold_=0;if(this.options_.title){var t=f("li",{className:"vjs-menu-title",innerHTML:Xa(this.options_.title),tabIndex:-1});this.hideThreshold_+=1;var a=new Qa(this.player_,{el:t});e.addItem(a)}this.items=this.createItems();if(this.items){for(var n=0;n=n.items.length){n.hide()}if(!r){return Ja(n)}var i=Oa(Ja(n),n.update);r.addEventListener("removetrack",i);r.addEventListener("addtrack",i);n.player_.on("ready",i);n.player_.on("dispose",function(){r.removeEventListener("removetrack",i);r.removeEventListener("addtrack",i)});return n}return t}(Ni);Qa.registerComponent("TrackButton",Ui);var Mi=["Tab","Esc","Up","Down","Right","Left"],Bi=function(e){tn(t,e);function t(t,a){var n=e.call(this,t,a)||this;n.selectable=a.selectable;n.isSelected_=a.selected||!1;n.multiSelectable=a.multiSelectable;n.selected(n.isSelected_);if(n.selectable){if(n.multiSelectable){n.el_.setAttribute("role","menuitemcheckbox")}else{n.el_.setAttribute("role","menuitemradio")}}else{n.el_.setAttribute("role","menuitem")}return n}var a=t.prototype;a.createEl=function(t,a,n){this.nonIconControl=!0;return e.prototype.createEl.call(this,"li",o({className:"vjs-menu-item",innerHTML:""+this.localize(this.options_.label)+"",tabIndex:-1},a),n)};a.handleKeyDown=function(t){if(!Mi.some(function(e){return Rn.isEventKey(t,e)})){e.prototype.handleKeyDown.call(this,t)}};a.handleClick=function(){this.selected(!0)};a.selected=function(e){if(this.selectable){if(e){this.addClass("vjs-selected");this.el_.setAttribute("aria-checked","true");this.controlText(", selected");this.isSelected_=!0}else{this.removeClass("vjs-selected");this.el_.setAttribute("aria-checked","false");this.controlText("");this.isSelected_=!1}}};return t}(Xr);Qa.registerComponent("MenuItem",Bi);var ji=function(a){tn(n,a);function n(n,r){var i,s=r.track,o=n.textTracks();r.label=s.label||s.language||"Unknown";r.selected="showing"===s.mode;i=a.call(this,n,r)||this;i.track=s;i.kinds=(r.kinds||[r.kind||i.track.kind]).filter(Boolean);var l=function(){for(var e=arguments.length,t=Array(e),a=0;a"+this.localize(this.options_.label);if("captions"===this.options_.track.kind){r+="\n \n "+this.localize("Captions")+"\n "}r+="";var i=e.prototype.createEl.call(this,t,o({innerHTML:r},a),n);return i};return t}(ji);Qa.registerComponent("SubsCapsMenuItem",Yi);var Xi=function(e){tn(t,e);function t(t,a){var n;if(void 0===a){a={}}n=e.call(this,t,a)||this;n.label_="subtitles";if(-1<["en","en-us","en-ca","fr-ca"].indexOf(n.player_.language_)){n.label_="captions"}n.menuButton_.controlText(Xa(n.label_));return n}var a=t.prototype;a.buildCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildCSSClass.call(this)};a.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildWrapperCSSClass.call(this)};a.createItems=function(){var t=[];if(!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")){t.push(new Gi(this.player_,{kind:this.label_}));this.hideThreshold_+=1}t=e.prototype.createItems.call(this,t,Yi);return t};return t}(Hi);Xi.prototype.kinds_=["captions","subtitles"];Xi.prototype.controlText_="Subtitles";Qa.registerComponent("SubsCapsButton",Xi);var $i=function(e){tn(t,e);function t(t,a){var n,r=a.track,i=t.audioTracks();a.label=r.label||r.language||"Unknown";a.selected=r.enabled;n=e.call(this,t,a)||this;n.track=r;n.addClass("vjs-"+r.kind+"-menu-item");var s=function(){for(var e=arguments.length,t=Array(e),a=0;a"+this.localize(this.options_.label);if("main-desc"===this.options_.track.kind){r+="\n \n "+this.localize("Descriptions")+"\n "}r+="";var i=e.prototype.createEl.call(this,t,o({innerHTML:r},a),n);return i};a.handleClick=function(t){var a=this.player_.audioTracks();e.prototype.handleClick.call(this,t);for(var n=0,r;ne){a=t[n];break}}this.player().playbackRate(a)};a.playbackRates=function(){return this.options_.playbackRates||this.options_.playerOptions&&this.options_.playerOptions.playbackRates};a.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&0 select",id:"captions-background-color-%s",label:"Color",options:[rs,ps,ds,os,is,us,ls,ss]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[cs,ms,gs]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[ps,rs,ds,os,is,us,ls,ss]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(e){return"1.00"===e?null:+e}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[cs,ms]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[gs,ms,cs]}};ys.windowColor.options=ys.backgroundColor.options;function $e(e,t){if(t){e=t(e)}if(e&&"none"!==e){return e}}function Qe(e,t){var a=e.options[e.options.selectedIndex].value;return $e(a,t)}function Je(e,t,a){if(!t){return}for(var n=0;n",this.localize(r.label),"","").join("")};n.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return["
                      ","",this.localize("Text"),"",this.createElSelect_("color",e),"",this.createElSelect_("textOpacity",e),"","
                      "].join("")};n.createElBgColor_=function(){var e="captions-background-"+this.id_;return["
                      ","",this.localize("Background"),"",this.createElSelect_("backgroundColor",e),"",this.createElSelect_("backgroundOpacity",e),"","
                      "].join("")};n.createElWinColor_=function(){var e="captions-window-"+this.id_;return["
                      ","",this.localize("Window"),"",this.createElSelect_("windowColor",e),"",this.createElSelect_("windowOpacity",e),"","
                      "].join("")};n.createElColors_=function(){return f("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})};n.createElFont_=function(){return f("div",{className:"vjs-track-settings-font",innerHTML:["
                      ",this.createElSelect_("fontPercent","","legend"),"
                      ","
                      ",this.createElSelect_("edgeStyle","","legend"),"
                      ","
                      ",this.createElSelect_("fontFamily","","legend"),"
                      "].join("")})};n.createElControls_=function(){var e=this.localize("restore all settings to the default values");return f("div",{className:"vjs-track-settings-controls",innerHTML:["",""].join("")})};n.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]};n.label=function(){return this.localize("Caption Settings Dialog")};n.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")};n.buildCSSClass=function(){return t.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"};n.getValues=function(){var e=this;return s(ys,function(t,a,n){var r=Qe(e.$(a.selector),a.parser);if(r!==void 0){t[n]=r}return t},{})};n.setValues=function(e){var t=this;r(ys,function(a,n){Je(t.$(a.selector),e[n],a.parser)})};n.setDefaults=function(){var e=this;r(ys,function(t){var a=t.hasOwnProperty("default")?t["default"]:0;e.$(t.selector).selectedIndex=a})};n.restoreSettings=function(){var t;try{t=JSON.parse(e.localStorage.getItem("vjs-text-track-settings"))}catch(e){ma.warn(e)}if(t){this.setValues(t)}};n.saveSettings=function(){if(!this.options_.persistTextTrackSettings){return}var t=this.getValues();try{if(Object.keys(t).length){e.localStorage.setItem("vjs-text-track-settings",JSON.stringify(t))}else{e.localStorage.removeItem("vjs-text-track-settings")}}catch(e){ma.warn(e)}};n.updateDisplay=function(){var e=this.player_.getChild("textTrackDisplay");if(e){e.updateDisplay()}};n.conditionalBlur_=function(){this.previouslyActiveEl_=null;var e=this.player_.controlBar,t=e&&e.subsCapsButton,a=e&&e.captionsButton;if(t){t.focus()}else if(a){a.focus()}};return a}(Hn);Qa.registerComponent("TextTrackSettings",hs);var _s=function(t){tn(a,t);function a(a,n){var r,i=n.ResizeObserver||e.ResizeObserver;if(null===n.ResizeObserver){i=!1}var s=te({createEl:!i,reportTouchActivity:!1},n);r=t.call(this,a,s)||this;r.ResizeObserver=n.ResizeObserver||e.ResizeObserver;r.loadListener_=null;r.resizeObserver_=null;r.debouncedHandler_=Na(function(){r.resizeHandler()},100,!1,Ja(r));if(i){r.resizeObserver_=new r.ResizeObserver(r.debouncedHandler_);r.resizeObserver_.observe(a.el())}else{r.loadListener_=function(){if(!r.el_||!r.el_.contentWindow){return}var e=r.debouncedHandler_,t=r.unloadListener_=function(){Y(this,"resize",e);Y(this,"unload",t);t=null};K(r.el_.contentWindow,"unload",t);K(r.el_.contentWindow,"resize",e)};r.one("load",r.loadListener_)}return r}var n=a.prototype;n.createEl=function(){return t.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager",tabIndex:-1},{"aria-hidden":"true"})};n.resizeHandler=function(){if(!this.player_||!this.player_.trigger){return}this.player_.trigger("playerresize")};n.dispose=function(){if(this.debouncedHandler_){this.debouncedHandler_.cancel()}if(this.resizeObserver_){if(this.player_.el()){this.resizeObserver_.unobserve(this.player_.el())}this.resizeObserver_.disconnect()}if(this.loadListener_){this.off("load",this.loadListener_)}if(this.el_&&this.el_.contentWindow&&this.unloadListener_){this.unloadListener_.call(this.el_.contentWindow)}this.ResizeObserver=null;this.resizeObserver=null;this.debouncedHandler_=null;this.loadListener_=null;t.prototype.dispose.call(this)};return a}(Qa);Qa.registerComponent("ResizeManager",_s);var fs=function(e){var t=Math.floor(e.length/2),a=[].concat(e).sort(function(e,t){return e-t});return 0!=e.length%2?a[t]:(a[t-1]+a[t])/2},Ts={trackingThreshold:30},bs=function(e){tn(a,e);function a(a,n){var r,i=te(Ts,n,{createEl:!1});r=e.call(this,a,i)||this;r.reset_();r.on(r.player_,"durationchange",r.handleDurationchange);if(yn&&"hidden"in t&&"visibilityState"in t){r.on(t,"visibilitychange",r.handleVisibilityChange)}return r}var n=a.prototype;n.handleVisibilityChange=function(){if(this.player_.duration()!==1/0){return}if(t.hidden){this.stopTracking()}else{this.startTracking()}};n.isBehind_=function(){if(!this.timeupdateSeen_){return!1}var e=this.liveCurrentTime(),t=this.player_.currentTime(),a=2*this.seekableIncrement_+.07;return e!==1/0&&e-a>=t};n.trackLive_=function(){this.pastSeekEnd_=this.pastSeekEnd_;var e=this.player_.seekable();if(!e||!e.length){return}var t=this.seekableEnd();if(t!==this.lastSeekEnd_){if(this.lastSeekEnd_){this.seekableIncrementList_=this.seekableIncrementList_.slice(-11);this.seekableIncrementList_.push(Math.abs(t-this.lastSeekEnd_));if(31.5*this.seekableIncrement_){this.pastSeekEnd_=0}else{this.pastSeekEnd_=this.pastSeekEnd()+.03}if(this.isBehind_()!==this.behindLiveEdge()){this.behindLiveEdge_=this.isBehind_();this.trigger("liveedgechange")}};n.handleDurationchange=function(){if(this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold){if(this.player_.options_.liveui){this.player_.addClass("vjs-liveui")}this.startTracking()}else{this.player_.removeClass("vjs-liveui");this.stopTracking()}};n.startTracking=function(){var e=this;if(this.isTracking()){return}if(!this.timeupdateSeen_){this.timeupdateSeen_=this.player_.hasStarted()}this.trackingInterval_=this.setInterval(this.trackLive_,Aa);this.trackLive_();this.on(this.player_,"play",this.trackLive_);this.on(this.player_,"pause",this.trackLive_);if(!this.timeupdateSeen_){this.one(this.player_,"play",this.handlePlay);this.handleTimeupdate=function(){e.timeupdateSeen_=!0;e.handleTimeupdate=null};this.one(this.player_,"timeupdate",this.handleTimeupdate)}};n.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge)};n.reset_=function(){this.pastSeekEnd_=0;this.lastSeekEnd_=null;this.behindLiveEdge_=null;this.timeupdateSeen_=!1;this.clearInterval(this.trackingInterval_);this.trackingInterval_=null;this.seekableIncrement_=12;this.seekableIncrementList_=[];this.off(this.player_,"play",this.trackLive_);this.off(this.player_,"pause",this.trackLive_);this.off(this.player_,"play",this.handlePlay);this.off(this.player_,"timeupdate",this.seekToLiveEdge);if(this.handleTimeupdate){this.off(this.player_,"timeupdate",this.handleTimeupdate);this.handleTimeupdate=null}};n.stopTracking=function(){if(!this.isTracking()){return}this.reset_()};n.seekableEnd=function(){var e=this.player_.seekable(),t=[],a=e?e.length:0;while(a--){t.push(e.end(a))}return t.length?t.sort()[t.length-1]:1/0};n.seekableStart=function(){var e=this.player_.seekable(),t=[],a=e?e.length:0;while(a--){t.push(e.start(a))}return t.length?t.sort()[0]:0};n.liveWindow=function(){var e=this.liveCurrentTime();if(e===1/0){return 1/0}return e-this.seekableStart()};n.isLive=function(){return this.isTracking()};n.atLiveEdge=function(){return!this.behindLiveEdge()};n.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()};n.pastSeekEnd=function(){return this.pastSeekEnd_};n.behindLiveEdge=function(){return this.behindLiveEdge_};n.isTracking=function(){return"number"==typeof this.trackingInterval_};n.seekToLiveEdge=function(){if(this.atLiveEdge()){return}this.player_.currentTime(this.liveCurrentTime());if(this.player_.paused()){this.player_.play()}};n.dispose=function(){this.stopTracking();e.prototype.dispose.call(this)};return a}(Qa);Qa.registerComponent("LiveTracker",bs);var vs=function(e){var t=e.el();if(t.hasAttribute("src")){e.triggerSourceset(t.src);return!0}var a=e.$$("source"),n=[],r="";if(!a.length){return!1}for(var s=0,o;sgn){return!1}try{var e=Ds.TEST_VID.playbackRate;Ds.TEST_VID.playbackRate=e/2+.1;return e!==Ds.TEST_VID.playbackRate}catch(t){return!1}};Ds.canOverrideAttributes=function(){try{var e=function(){};Object.defineProperty(t.createElement("video"),"src",{get:e,set:e});Object.defineProperty(t.createElement("audio"),"src",{get:e,set:e});Object.defineProperty(t.createElement("video"),"innerHTML",{get:e,set:e});Object.defineProperty(t.createElement("audio"),"innerHTML",{get:e,set:e})}catch(t){return!1}return!0};Ds.supportsNativeTextTracks=function(){return Sn||vn&&mn};Ds.supportsNativeVideoTracks=function(){return!!(Ds.TEST_VID&&Ds.TEST_VID.videoTracks)};Ds.supportsNativeAudioTracks=function(){return!!(Ds.TEST_VID&&Ds.TEST_VID.audioTracks)};Ds.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"];[["featuresVolumeControl","canControlVolume"],["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function(e){var t=e[0],a=e[1];Ps(Ds.prototype,t,function(){return Ds[a]()},!0)});Ds.prototype.movingMediaElementInDOM=!vn;Ds.prototype.featuresFullscreenResize=!0;Ds.prototype.featuresProgressEvents=!0;Ds.prototype.featuresTimeupdateEvents=!0;var ws;Ds.patchCanPlayType=function(){if(4<=dn&&!un&&!mn){ws=Ds.TEST_VID&&Ds.TEST_VID.constructor.prototype.canPlayType;Ds.TEST_VID.constructor.prototype.canPlayType=function(e){if(e&&/^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(e)){return"maybe"}return ws.call(this,e)}}};Ds.unpatchCanPlayType=function(){var e=Ds.TEST_VID.constructor.prototype.canPlayType;if(ws){Ds.TEST_VID.constructor.prototype.canPlayType=ws}return e};Ds.patchCanPlayType();Ds.disposeMediaElement=function(e){if(!e){return}if(e.parentNode){e.parentNode.removeChild(e)}while(e.hasChildNodes()){e.removeChild(e.firstChild)}e.removeAttribute("src");if("function"==typeof e.load){(function(){try{e.load()}catch(t){}})()}};Ds.resetMediaElement=function(e){if(!e){return}var t=e.querySelectorAll("source"),a=t.length;while(a--){e.removeChild(t[a])}e.removeAttribute("src");if("function"==typeof e.load){(function(){try{e.load()}catch(t){}})()}};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(e){Ds.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(e){Ds.prototype["set"+Xa(e)]=function(t){this.el_[e]=t;if(t){this.el_.setAttribute(e,e)}else{this.el_.removeAttribute(e)}}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","played","networkState","readyState","videoWidth","videoHeight"].forEach(function(e){Ds.prototype[e]=function(){return this.el_[e]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate"].forEach(function(e){Ds.prototype["set"+Xa(e)]=function(t){this.el_[e]=t}});["pause","load","play"].forEach(function(e){Ds.prototype[e]=function(){return this.el_[e]()}});Mr.withSourceHandlers(Ds);Ds.nativeSourceHandler={};Ds.nativeSourceHandler.canPlayType=function(e){try{return Ds.TEST_VID.canPlayType(e)}catch(t){return""}};Ds.nativeSourceHandler.canHandleSource=function(e){if(e.type){return Ds.nativeSourceHandler.canPlayType(e.type)}else if(e.src){var t=rr(e.src);return Ds.nativeSourceHandler.canPlayType("video/"+t)}return""};Ds.nativeSourceHandler.handleSource=function(e,t){t.setSrc(e.src)};Ds.nativeSourceHandler.dispose=function(){};Ds.registerSourceHandler(Ds.nativeSourceHandler);Mr.registerTech("Html5",Ds);var As=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Os={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Rs=["tiny","xsmall","small","medium","large","xlarge","huge"],Ns={};Rs.forEach(function(e){var t="x"===e.charAt(0)?"x-"+e.substring(1):e;Ns[e]="vjs-layout-"+t});var Us={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Ms=function(a){tn(n,a);function n(e,r,i){var s;e.id=e.id||r.id||"vjs_video_"+V();r=o(n.getTagSettings(e),r);r.initChildren=!1;r.createEl=!1;r.evented=!1;r.reportTouchActivity=!1;if(!r.language){if("function"==typeof e.closest){var l=e.closest("[lang]");if(l&&l.getAttribute){r.language=l.getAttribute("lang")}}else{var d=e;while(d&&1===d.nodeType){if(I(d).hasOwnProperty("lang")){r.language=d.getAttribute("lang");break}d=d.parentNode}}}s=a.call(this,null,r,i)||this;s.boundDocumentFullscreenChange_=Oa(Ja(s),s.documentFullscreenChange_);s.boundFullWindowOnEscKey_=Oa(Ja(s),s.fullWindowOnEscKey);s.isFullscreen_=!1;s.log=ga(s.id_);s.fsApi_=Cn;s.isPosterFromTech_=!1;s.queuedCallbacks_=[];s.isReady_=!1;s.hasStarted_=!1;s.userActive_=!1;if(!s.options_||!s.options_.techOrder||!s.options_.techOrder.length){throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?")}s.tag=e;s.tagAttributes=e&&I(e);s.language(s.options_.language);if(r.languages){var p={};Object.getOwnPropertyNames(r.languages).forEach(function(e){p[e.toLowerCase()]=r.languages[e]});s.languages_=p}else{s.languages_=n.prototype.options_.languages}s.resetCache_();s.poster_=r.poster||"";s.controls_=!!r.controls;e.controls=!1;e.removeAttribute("controls");s.changingSrc_=!1;s.playCallbacks_=[];s.playTerminatedQueue_=[];if(e.hasAttribute("autoplay")){s.autoplay(!0)}else{s.autoplay(s.options_.autoplay)}if(r.plugins){Object.keys(r.plugins).forEach(function(e){if("function"!=typeof s[e]){throw new Error("plugin \""+e+"\" does not exist")}})}s.scrubbing_=!1;s.el_=s.createEl();Z(Ja(s),{eventBusKey:"el_"});if(s.fsApi_.requestFullscreen){K(t,s.fsApi_.fullscreenchange,s.boundDocumentFullscreenChange_);s.on(s.fsApi_.fullscreenchange,s.boundDocumentFullscreenChange_)}if(s.fluid_){s.on("playerreset",s.updateStyleEl_)}var u=te(s.options_);if(r.plugins){Object.keys(r.plugins).forEach(function(e){s[e](r.plugins[e])})}s.options_.playerOptions=u;s.middleware_=[];s.initChildren();s.isAudio("audio"===e.nodeName.toLowerCase());if(s.controls()){s.addClass("vjs-controls-enabled")}else{s.addClass("vjs-controls-disabled")}s.el_.setAttribute("role","region");if(s.isAudio()){s.el_.setAttribute("aria-label",s.localize("Audio Player"))}else{s.el_.setAttribute("aria-label",s.localize("Video Player"))}if(s.isAudio()){s.addClass("vjs-audio")}if(s.flexNotSupported_()){s.addClass("vjs-no-flex")}if(fn){s.addClass("vjs-touch-enabled")}if(!vn){s.addClass("vjs-workinghover")}n.players[s.id_]=Ja(s);var c="7.7.6".split(".")[0];s.addClass("vjs-v"+c);s.userActive(!0);s.reportUserActivity();s.one("play",s.listenForUserActivity_);s.on("stageclick",s.handleStageClick_);s.on("keydown",s.handleKeyDown);s.breakpoints(s.options_.breakpoints);s.responsive(s.options_.responsive);return s}var r=n.prototype;r.dispose=function(){var e=this;this.trigger("dispose");this.off("dispose");Y(t,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_);Y(t,"keydown",this.boundFullWindowOnEscKey_);if(this.styleEl_&&this.styleEl_.parentNode){this.styleEl_.parentNode.removeChild(this.styleEl_);this.styleEl_=null}n.players[this.id_]=null;if(this.tag&&this.tag.player){this.tag.player=null}if(this.el_&&this.el_.player){this.el_.player=null}if(this.tech_){this.tech_.dispose();this.isPosterFromTech_=!1;this.poster_=""}if(this.playerElIngest_){this.playerElIngest_=null}if(this.tag){this.tag=null}Ve(this);vr.names.forEach(function(t){var a=vr[t],n=e[a.getterName]();if(n&&n.off){n.off()}});a.prototype.dispose.call(this)};r.createEl=function(){var n=this.tag,r,s=this.playerElIngest_=n.parentNode&&n.parentNode.hasAttribute&&n.parentNode.hasAttribute("data-vjs-player"),o="video-js"===this.tag.tagName.toLowerCase();if(s){r=this.el_=n.parentNode}else if(!o){r=this.el_=a.prototype.createEl.call(this,"div")}var l=I(n);if(o){r=this.el_=n;n=this.tag=t.createElement("video");while(r.children.length){n.appendChild(r.firstChild)}if(!v(r,"video-js")){S(r,"video-js")}r.appendChild(n);s=this.playerElIngest_=r;Object.keys(r).forEach(function(e){try{n[e]=r[e]}catch(t){}})}n.setAttribute("tabindex","-1");l.tabindex="-1";if(yn||mn&&_n){n.setAttribute("role","application");l.role="application"}n.removeAttribute("width");n.removeAttribute("height");if("width"in l){delete l.width}if("height"in l){delete l.height}Object.getOwnPropertyNames(l).forEach(function(e){if(!(o&&"class"===e)){r.setAttribute(e,l[e])}if(o){n.setAttribute(e,l[e])}});n.playerId=n.id;n.id+="_html5_api";n.className="vjs-tech";n.player=r.player=this;this.addClass("vjs-paused");if(!0!==e.VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=ka("vjs-styles-dimensions");var d=fa(".vjs-styles-defaults"),p=fa("head");p.insertBefore(this.styleEl_,d?d.nextSibling:p.firstChild)}this.fill_=!1;this.fluid_=!1;this.width(this.options_.width);this.height(this.options_.height);this.fill(this.options_.fill);this.fluid(this.options_.fluid);this.aspectRatio(this.options_.aspectRatio);for(var u=n.getElementsByTagName("a"),c=0,m;ce){e=0}this.techCall_("setCurrentTime",e);return}this.cache_.currentTime=this.techGet_("currentTime")||0;return this.cache_.currentTime};r.duration=function(e){if(e===void 0){return this.cache_.duration!==void 0?this.cache_.duration:NaN}e=parseFloat(e);if(0>e){e=1/0}if(e!==this.cache_.duration){this.cache_.duration=e;if(e===1/0){this.addClass("vjs-live")}else{this.removeClass("vjs-live")}if(!isNaN(e)){this.trigger("durationchange")}}};r.remainingTime=function(){return this.duration()-this.currentTime()};r.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())};r.buffered=function e(){var e=this.techGet_("buffered");if(!e||!e.length){e=ie(0,0)}return e};r.bufferedPercent=function(){return se(this.buffered(),this.duration())};r.bufferedEnd=function(){var e=this.buffered(),t=this.duration(),a=e.end(e.length-1);if(a>t){a=t}return a};r.volume=function(e){var t;if(e!==void 0){t=Math.max(0,Math.min(1,parseFloat(e)));this.cache_.volume=t;this.techCall_("setVolume",t);if(0=e){return}l=this.setTimeout(function(){if(!this.userActivity_){this.userActive(!1)}},e)},250)};r.playbackRate=function(e){if(e!==void 0){this.techCall_("setPlaybackRate",e);return}if(this.tech_&&this.tech_.featuresPlaybackRate){return this.cache_.lastPlaybackRate||this.techGet_("playbackRate")}return 1};r.defaultPlaybackRate=function(e){if(e!==void 0){return this.techCall_("setDefaultPlaybackRate",e)}if(this.tech_&&this.tech_.featuresPlaybackRate){return this.techGet_("defaultPlaybackRate")}return 1};r.isAudio=function(e){if(e!==void 0){this.isAudio_=!!e;return}return!!this.isAudio_};r.addTextTrack=function(e,t,a){if(this.tech_){return this.tech_.addTextTrack(e,t,a)}};r.addRemoteTextTrack=function(e,t){if(this.tech_){return this.tech_.addRemoteTextTrack(e,t)}};r.removeRemoteTextTrack=function(e){if(void 0===e){e={}}var t=e,a=t.track;if(!a){a=e}if(this.tech_){return this.tech_.removeRemoteTextTrack(a)}};r.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")};r.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0};r.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0};r.language=function(e){if(e===void 0){return this.language_}this.language_=(e+"").toLowerCase()};r.languages=function(){return te(n.prototype.options_.languages,this.languages_)};r.toJSON=function(){var e=te(this.options_),t=e.tracks;e.tracks=[];for(var a=0,n;a=a){return!1}Ze.hooks_[e]=Ze.hooks_[e].slice();Ze.hooks_[e].splice(a,1);return!0};if(!0!==e.VIDEOJS_NO_DYNAMIC_STYLE&&g()){var to=fa(".vjs-styles-defaults");if(!to){to=ka("vjs-styles-defaults");var ao=fa("head");if(ao){ao.insertBefore(to,ao.firstChild)}Ca(to,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid {\n padding-top: 56.25%\n }\n ")}}H(1,Ze);Ze.VERSION="7.7.6";Ze.options=Ms.prototype.options_;Ze.getPlayers=function(){return Ms.players};Ze.getPlayer=function(e){var t=Ms.players,a;if("string"==typeof e){var n=eo(e),r=t[n];if(r){return r}a=fa("#"+n)}else{a=e}if(y(a)){var i=a,s=i.player,o=i.playerId;if(s||t[o]){return s||t[o]}}};Ze.getAllPlayers=function(){return Object.keys(Ms.players).map(function(e){return Ms.players[e]}).filter(Boolean)};Ze.players=Ms.players;Ze.getComponent=Qa.getComponent;Ze.registerComponent=function(e,t){if(Mr.isTech(t)){ma.warn("The "+e+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)")}Qa.registerComponent.call(Qa,e,t)};Ze.getTech=Mr.getTech;Ze.registerTech=Mr.registerTech;Ze.use=function(e,t){Br[e]=Br[e]||[];Br[e].push(t)};Object.defineProperty(Ze,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(Ze.middleware,"TERMINATOR",{value:Fr,writeable:!1,enumerable:!0});Ze.browser=kn;Ze.TOUCH_ENABLED=fn;Ze.extend=Zs;Ze.mergeOptions=te;Ze.bind=Oa;Ze.registerPlugin=Qs.registerPlugin;Ze.deregisterPlugin=Qs.deregisterPlugin;Ze.plugin=function(e,t){ma.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead");return Qs.registerPlugin(e,t)};Ze.getPlugins=Qs.getPlugins;Ze.getPlugin=Qs.getPlugin;Ze.getPluginVersion=Qs.getPluginVersion;Ze.addLanguage=function(e,t){var a;e=(""+e).toLowerCase();Ze.options.languages=te(Ze.options.languages,(a={},a[e]=t,a));return Ze.options.languages[e]};Ze.log=ma;Ze.createLogger=ga;Ze.createTimeRange=Ze.createTimeRanges=ie;Ze.formatTime=Xe;Ze.setFormatTime=function(e){si=e};Ze.resetFormatTime=function(){si=ii};Ze.parseUrl=ar;Ze.isCrossOrigin=ir;Ze.EventTarget=Ua;Ze.on=K;Ze.one=Q;Ze.off=Y;Ze.trigger=X;Ze.xhr=pr;Ze.TextTrack=mr;Ze.AudioTrack=gr;Ze.VideoTrack=yr;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(function(e){Ze[e]=function(){ma.warn("videojs."+e+"() is deprecated; use videojs.dom."+e+"() instead");return Ta[e].apply(null,arguments)}});Ze.computedStyle=p;Ze.dom=Ta;Ze.url=sr;Ze.defineLazyProperty=Ps;var no=n(function(e){(function(){var t={buildAbsoluteURL:function(e,a,n){n=n||{};e=e.trim();a=a.trim();if(!a){if(!n.alwaysNormalize){return e}var r=t.parseURL(e);if(!r){throw new Error("Error trying to parse base URL.")}r.path=t.normalizePath(r.path);return t.buildURLFromParts(r)}var i=t.parseURL(a);if(!i){throw new Error("Error trying to parse relative URL.")}if(i.scheme){if(!n.alwaysNormalize){return a}i.path=t.normalizePath(i.path);return t.buildURLFromParts(i)}var s=t.parseURL(e);if(!s){throw new Error("Error trying to parse base URL.")}if(!s.netLoc&&s.path&&"/"!==s.path[0]){var o=/^([^\/?#]*)(.*)$/.exec(s.path);s.netLoc=o[1];s.path=o[2]}if(s.netLoc&&!s.path){s.path="/"}var l={scheme:s.scheme,netLoc:i.netLoc,path:null,params:i.params,query:i.query,fragment:i.fragment};if(!i.netLoc){l.netLoc=s.netLoc;if("/"!==i.path[0]){if(!i.path){l.path=s.path;if(!i.params){l.params=s.params;if(!i.query){l.query=s.query}}}else{var d=s.path,p=d.substring(0,d.lastIndexOf("/")+1)+i.path;l.path=t.normalizePath(p)}}}if(null===l.path){l.path=n.alwaysNormalize?t.normalizePath(i.path):i.path}return t.buildURLFromParts(l)},parseURL:function(e){var t=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/\?#]*\/)*.*?)??(;.*?)?(\?.*?)?(#.*?)?$/.exec(e);if(!t){return null}return{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}},normalizePath:function(e){e=e.split("").reverse().join("").replace(/(?:\/|^)\.(?=\/)/g,"");while(e.length!==(e=e.replace(/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,"")).length){}return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};e.exports=t})()});function et(){et=Object.assign||function(e){for(var t=1,a;te.duration){this.trigger("warn",{message:"ignoring invalid target duration: "+e.duration});return}this.manifest.targetDuration=e.duration},totalduration:function(){if(!isFinite(e.duration)||0>e.duration){this.trigger("warn",{message:"ignoring invalid total duration: "+e.duration});return}this.manifest.totalDuration=e.duration},start:function(){if(!e.attributes||isNaN(e.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:e.attributes["TIME-OFFSET"],precise:e.attributes.PRECISE}},"cue-out":function(){r.cueOut=e.data},"cue-out-cont":function(){r.cueOutCont=e.data},"cue-in":function(){r.cueIn=e.data}})[e.tagType]||o).call(a)},uri:function(){r.uri=e.uri;n.push(r);if(this.manifest.targetDuration&&!("duration"in r)){this.trigger("warn",{message:"defaulting segment duration to the target duration"});r.duration=this.manifest.targetDuration}if(s){r.key=s}r.timeline=d;if(i){r.map=i}r={}},comment:function(){},custom:function(){if(e.segment){r.custom=r.custom||{};r.custom[e.customType]=e.data}else{this.manifest.custom=this.manifest.custom||{};this.manifest.custom[e.customType]=e.data}}})[e.type].call(a)});return t}var a=t.prototype;a.push=function(e){this.lineStream.push(e)};a.end=function(){this.lineStream.push("\n")};a.addParser=function(e){this.parseStream.addParser(e)};a.addTagMapper=function(e){this.parseStream.addTagMapper(e)};return t}(ro);function rt(e){return e&&"object"===_typeof2(e)&&"default"in e?e["default"]:e}var uo=rt(no),co=rt(e),mo=function(e,t){if(/^[a-z]+:/i.test(t)){return t}if(!/\/\//i.test(e)){e=uo.buildAbsoluteURL(co.location&&co.location.href||"",e)}return uo.buildAbsoluteURL(e,t)};function it(e){return e&&"object"===_typeof2(e)&&"default"in e?e["default"]:e}var go=it(e),yo=function(e){return go.atob?go.atob(e):Buffer.from(e,"base64").toString("binary")};function st(e){for(var t=yo(e),a=new Uint8Array(t.length),n=0;n>10),a=56320+(1023&e);return String.fromCharCode(t,a)}else{return String.fromCharCode(e)}}function l(e){var t=e.slice(1,-1);if(t in n){return n[t]}else if("#"===t.charAt(0)){return o(parseInt(t.substr(1).replace("x","0x")))}else{s.error("entity not found:"+e);return e}}function d(t){if(t>f){var a=e.substring(f,t).replace(/&#?\w+;/g,l);y&&p(f);r.characters(a,0,t-f);f=t}}function p(t,a){while(t>=c&&(a=g.exec(e))){u=a.index;c=u+a[0].length;y.lineNumber++}y.columnNumber=t-u+1}var u=0,c=0,g=/.*(?:\r\n?|\n)|.*$/g,y=r.locator,h=[{currentNSMap:t}],_={},f=0;while(!0){try{var T=e.indexOf("<",f);if(0>T){if(!e.substr(f).match(/^\s*$/)){var b=r.doc,v=b.createTextNode(e.substr(f));b.appendChild(v);r.currentElement=v}return}if(T>f){d(T)}switch(e.charAt(T+1)){case"/":var S=e.indexOf(">",T+3),k=e.substring(T+2,S),C=h.pop();if(0>S){k=e.substring(T+2).replace(/[\s<].*/,"");s.error("end tag name: "+k+" is not complete:"+C.tagName);S=T+1+k.length}else if(k.match(/\sf){f=S}else{d(Math.max(T,f)+1)}}}function dt(e,a){a.lineNumber=e.lineNumber;a.columnNumber=e.columnNumber;return a}function pt(e,t,a,n,r,i){var o,l,d=++t,u=To;while(!0){var m=e.charAt(d);switch(m){case"=":if(u===bo){o=e.slice(t,d);u=So}else if(u===vo){u=So}else{throw new Error("attribute equal must after attrName")}break;case"'":case"\"":if(u===So||u===bo){if(u===bo){i.warning("attribute value must after \"=\"");o=e.slice(t,d)}t=d+1;d=e.indexOf(m,t);if(0":switch(u){case To:a.setTagName(e.slice(t,d));case Co:case Eo:case Io:break;case ko:case bo:l=e.slice(t,d);if("/"===l.slice(-1)){a.closed=!0;l=l.slice(0,-1)}case vo:if(u===vo){l=o}if(u==ko){i.warning("attribute \""+l+"\" missed quot(\")!!");a.add(o,l.replace(/&#?\w+;/g,r),t)}else{if("http://www.w3.org/1999/xhtml"!==n[""]||!l.match(/^(?:disabled|checked|selected)$/i)){i.warning("attribute \""+l+"\" missed value!! \""+l+"\" instead!!")}a.add(l,l,t)}break;case So:throw new Error("attribute value missed!!");}return d;case"\x80":m=" ";default:if(" ">=m){switch(u){case To:a.setTagName(e.slice(t,d));u=Eo;break;case bo:o=e.slice(t,d);u=vo;break;case ko:var l=e.slice(t,d).replace(/&#?\w+;/g,r);i.warning("attribute \""+l+"\" missed quot(\")!!");a.add(o,l,t);case Co:u=Eo;break;}}else{switch(u){case vo:a.tagName;if("http://www.w3.org/1999/xhtml"!==n[""]||!o.match(/^(?:disabled|checked|selected)$/i)){i.warning("attribute \""+o+"\" missed value!! \""+o+"\" instead2!!")}a.add(o,o,t);t=d;u=bo;break;case Co:i.warning("attribute space is required\""+o+"\"!!");case Eo:u=bo;t=d;break;case So:u=ko;t=d;break;case Io:throw new Error("elements closed character '/' and '>' must be connected to");}}}d++}}function ut(e,t,n){var r=e.tagName,s=null,o=e.length;while(o--){var l=e[o],d=l.qName,p=l.value,u=d.indexOf(":");if(0",t),s=e.substring(t+1,i);if(/[&<]/.test(s)){if(/^script$/i.test(a)){r.characters(s,0,s.length);return i}s=s.replace(/&#?\w+;/g,n);r.characters(s,0,s.length);return i}}return t+1}function mt(e,t,a,n){var r=n[a];if(null==r){r=e.lastIndexOf("");if(r",t+4);if(i>t){a.comment(e,t+4,i-t-4);return i+3}else{n.error("Unclosed comment");return-1}}else{return-1}default:if("CDATA["==e.substr(t+3,6)){var i=e.indexOf("]]>",t+9);a.startCDATA();a.characters(e,t+9,i-t-9);a.endCDATA();return i+3}var s=Tt(e,t),o=s.length;if(1",t);if(n){var r=e.substring(t,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(r){r[0].length;a.processingInstruction(r[1],r[2]);return n+2}else{return-1}}return-1}function _t(){}_t.prototype={setTagName:function(e){if(!fo.test(e)){throw new Error("invalid tagName:"+e)}this.tagName=e},add:function(e,t,a){if(!fo.test(e)){throw new Error("invalid attribute:"+e)}this[this.length++]={qName:e,value:t,offset:a}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}};function ft(e,t){e.__proto__=t;return e}if(!(ft({},ft.prototype)instanceof ft)){ft=function(e,t){function a(){}a.prototype=t;a=new a;for(t in e){a[t]=e[t]}return a}}function Tt(e,t){var a,n=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;r.lastIndex=t;r.exec(e);while(a=r.exec(e)){n.push(a);if(a[1])return n}}var xo={XMLReader:ot};function bt(e,t){for(var a in e){t[a]=e[a]}}function vt(e,a){var n=e.prototype;if(Object.create){var r=Object.create(a.prototype);n.__proto__=r}if(!(n instanceof a)){var i=function(){};i.prototype=a.prototype;i=new i;bt(n,i);e.prototype=n=i}if(n.constructor!=e){if("function"!=typeof e){console.error("unknow Class:"+e)}n.constructor=e}}var Lo={},Po=Lo.ELEMENT_NODE=1,Do=Lo.ATTRIBUTE_NODE=2,wo=Lo.TEXT_NODE=3,Ao=Lo.CDATA_SECTION_NODE=4,Oo=Lo.ENTITY_REFERENCE_NODE=5,Ro=Lo.ENTITY_NODE=6,No=Lo.PROCESSING_INSTRUCTION_NODE=7,Uo=Lo.COMMENT_NODE=8,Mo=Lo.DOCUMENT_NODE=9,Bo=Lo.DOCUMENT_TYPE_NODE=10,jo=Lo.DOCUMENT_FRAGMENT_NODE=11,Fo=Lo.NOTATION_NODE=12,Ho={},qo={},Vo=Ho.INDEX_SIZE_ERR=(qo[1]="Index size error",1),Wo=Ho.DOMSTRING_SIZE_ERR=(qo[2]="DOMString size error",2),zo=Ho.HIERARCHY_REQUEST_ERR=(qo[3]="Hierarchy request error",3),Go=Ho.WRONG_DOCUMENT_ERR=(qo[4]="Wrong document",4),Ko=Ho.INVALID_CHARACTER_ERR=(qo[5]="Invalid character",5),Yo=Ho.NO_DATA_ALLOWED_ERR=(qo[6]="No data allowed",6),Xo=Ho.NO_MODIFICATION_ALLOWED_ERR=(qo[7]="No modification allowed",7),$o=Ho.NOT_FOUND_ERR=(qo[8]="Not found",8),Qo=Ho.NOT_SUPPORTED_ERR=(qo[9]="Not supported",9),Jo=Ho.INUSE_ATTRIBUTE_ERR=(qo[10]="Attribute in use",10),Zo=Ho.INVALID_STATE_ERR=(qo[11]="Invalid state",11),el=Ho.SYNTAX_ERR=(qo[12]="Syntax error",12),tl=Ho.INVALID_MODIFICATION_ERR=(qo[13]="Invalid modification",13),al=Ho.NAMESPACE_ERR=(qo[14]="Invalid namespace",14),nl=Ho.INVALID_ACCESS_ERR=(qo[15]="Invalid access",15);function St(e,t){if(t instanceof Error){var a=t}else{a=this;Error.call(this,qo[e]);this.message=qo[e];if(Error.captureStackTrace)Error.captureStackTrace(this,St)}a.code=e;if(t)this.message=this.message+": "+t;return a}St.prototype=Error.prototype;bt(Ho,St);function kt(){}kt.prototype={length:0,item:function(e){return this[e]||null},toString:function(e,t){for(var a=[],n=0;n"==e&&">"||"&"==e&&"&"||"\""==e&&"""||"&#"+e.charCodeAt()+";"}bt(Lo,wt);bt(Lo,wt.prototype);function Ot(e,t){if(t(e)){return!0}if(e=e.firstChild){do{if(Ot(e,t)){return!0}}while(e=e.nextSibling)}}function Rt(){}function Nt(e,t,a){e&&e._inc++;var n=a.namespaceURI;if("http://www.w3.org/2000/xmlns/"==n){t._nsMap[a.prefix?a.localName:""]=a.value}}function Ut(e,t,a){e&&e._inc++;var n=a.namespaceURI;if("http://www.w3.org/2000/xmlns/"==n){delete t._nsMap[a.prefix?a.localName:""]}}function Mt(e,t,a){if(e&&e._inc){e._inc++;var n=t.childNodes;if(a){n[n.length++]=a}else{var r=t.firstChild,s=0;while(r){n[s++]=r;r=r.nextSibling}n.length=s}}}function Bt(e,t){var a=t.previousSibling,n=t.nextSibling;if(a){a.nextSibling=n}else{e.firstChild=n}if(n){n.previousSibling=a}else{e.lastChild=a}Mt(e.ownerDocument,e);return t}function jt(e,t,a){var n=t.parentNode;if(n){n.removeChild(t)}if(t.nodeType===jo){var r=t.firstChild;if(null==r){return t}var i=t.lastChild}else{r=i=t}var s=a?a.previousSibling:e.lastChild;r.previousSibling=s;i.nextSibling=a;if(s){s.nextSibling=r}else{e.firstChild=r}if(null==a){e.lastChild=i}else{a.previousSibling=i}do{r.parentNode=e}while(r!==i&&(r=r.nextSibling));Mt(e.ownerDocument||e,e);if(t.nodeType==jo){t.firstChild=t.lastChild=null}return t}function Ft(e,t){var a=t.parentNode;if(a){var n=e.lastChild;a.removeChild(t);var n=e.lastChild}var n=e.lastChild;t.parentNode=e;t.previousSibling=n;t.nextSibling=null;if(n){n.nextSibling=t}else{e.firstChild=t}e.lastChild=t;Mt(e.ownerDocument,e,t);return t}Rt.prototype={nodeName:"#document",nodeType:Mo,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==jo){var a=e.firstChild;while(a){var n=a.nextSibling;this.insertBefore(a,t);a=n}return e}if(null==this.documentElement&&e.nodeType==Po){this.documentElement=e}return jt(this,e,t),e.ownerDocument=this,e},removeChild:function(e){if(this.documentElement==e){this.documentElement=null}return Bt(this,e)},importNode:function(e,t){return na(this,e,t)},getElementById:function(e){var t=null;Ot(this.documentElement,function(a){if(a.nodeType==Po){if(a.getAttribute("id")==e){t=a;return!0}}});return t},createElement:function(e){var t=new Ht;t.ownerDocument=this;t.nodeName=e;t.tagName=e;t.childNodes=new kt;var a=t.attributes=new It;a._ownerElement=t;return t},createDocumentFragment:function(){var e=new Qt;e.ownerDocument=this;e.childNodes=new kt;return e},createTextNode:function(e){var t=new Wt;t.ownerDocument=this;t.appendData(e);return t},createComment:function(e){var t=new zt;t.ownerDocument=this;t.appendData(e);return t},createCDATASection:function(e){var t=new Gt;t.ownerDocument=this;t.appendData(e);return t},createProcessingInstruction:function(e,t){var a=new Jt;a.ownerDocument=this;a.tagName=a.target=e;a.nodeValue=a.data=t;return a},createAttribute:function(e){var t=new qt;t.ownerDocument=this;t.name=e;t.nodeName=e;t.localName=e;t.specified=!0;return t},createEntityReference:function(e){var t=new $t;t.ownerDocument=this;t.nodeName=e;return t},createElementNS:function(e,t){var a=new Ht,n=t.split(":"),r=a.attributes=new It;a.childNodes=new kt;a.ownerDocument=this;a.nodeName=t;a.tagName=t;a.namespaceURI=e;if(2==n.length){a.prefix=n[0];a.localName=n[1]}else{a.localName=t}r._ownerElement=a;return a},createAttributeNS:function(e,t){var a=new qt,n=t.split(":");a.ownerDocument=this;a.nodeName=t;a.name=t;a.namespaceURI=e;a.specified=!0;if(2==n.length){a.prefix=n[0];a.localName=n[1]}else{a.localName=t}return a}};vt(Rt,wt);function Ht(){this._nsMap={}}Ht.prototype={nodeType:Po,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var a=this.ownerDocument.createAttribute(e);a.value=a.nodeValue=""+t;this.setAttributeNode(a)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){if(e.nodeType===jo){return this.insertBefore(e,null)}else{return Ft(this,e)}},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var a=this.getAttributeNodeNS(e,t);a&&this.removeAttributeNode(a)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var a=this.getAttributeNodeNS(e,t);return a&&a.value||""},setAttributeNS:function(e,t,a){var n=this.ownerDocument.createAttributeNS(e,t);n.value=n.nodeValue=""+a;this.setAttributeNode(n)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new Ct(this,function(t){var a=[];Ot(t,function(n){if(n!==t&&n.nodeType==Po&&("*"===e||n.tagName==e)){a.push(n)}});return a})},getElementsByTagNameNS:function(e,t){return new Ct(this,function(a){var n=[];Ot(a,function(r){if(r!==a&&r.nodeType===Po&&("*"===e||r.namespaceURI===e)&&("*"===t||r.localName==t)){n.push(r)}});return n})}};Rt.prototype.getElementsByTagName=Ht.prototype.getElementsByTagName;Rt.prototype.getElementsByTagNameNS=Ht.prototype.getElementsByTagNameNS;vt(Ht,wt);function qt(){}qt.prototype.nodeType=Do;vt(qt,wt);function Vt(){}Vt.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e;this.nodeValue=this.data=e;this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(){throw new Error(qo[zo])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,a){var n=this.data.substring(0,e),r=this.data.substring(e+t);a=n+a+r;this.nodeValue=this.data=a;this.length=a.length}};vt(Vt,wt);function Wt(){}Wt.prototype={nodeName:"#text",nodeType:wo,splitText:function(e){var t=this.data,a=t.substring(e);t=t.substring(0,e);this.data=this.nodeValue=t;this.length=t.length;var n=this.ownerDocument.createTextNode(a);if(this.parentNode){this.parentNode.insertBefore(n,this.nextSibling)}return n}};vt(Wt,Vt);function zt(){}zt.prototype={nodeName:"#comment",nodeType:Uo};vt(zt,Vt);function Gt(){}Gt.prototype={nodeName:"#cdata-section",nodeType:Ao};vt(Gt,Vt);function Kt(){}Kt.prototype.nodeType=Bo;vt(Kt,wt);function Yt(){}Yt.prototype.nodeType=Fo;vt(Yt,wt);function Xt(){}Xt.prototype.nodeType=Ro;vt(Xt,wt);function $t(){}$t.prototype.nodeType=Oo;vt($t,wt);function Qt(){}Qt.prototype.nodeName="#document-fragment";Qt.prototype.nodeType=jo;vt(Qt,wt);function Jt(){}Jt.prototype.nodeType=No;vt(Jt,wt);function Zt(){}Zt.prototype.serializeToString=function(e,t,a){return ea.call(e,t,a)};wt.prototype.toString=ea;function ea(e,t){var a=[],n=9==this.nodeType?this.documentElement:this,r=n.prefix,i=n.namespaceURI;if(i&&null==r){var r=n.lookupPrefix(i);if(null==r){var s=[{namespace:i,prefix:null}]}}aa(this,a,e,t,s);return a.join("")}function ta(e,t,a){var n=e.prefix||"",r=e.namespaceURI;if(!n&&!r){return!1}if("xml"===n&&"http://www.w3.org/XML/1998/namespace"===r||"http://www.w3.org/2000/xmlns/"==r){return!1}var s=a.length;while(s--){var o=a[s];if(o.prefix==n){return o.namespace!=r}}return!0}function aa(e,t,a,n,r){if(n){e=n(e);if(e){if("string"==typeof e){t.push(e);return}}else{return}}switch(e.nodeType){case Po:if(!r)r=[];var s=r.length,o=e.attributes,l=o.length,d=e.firstChild,p=e.tagName;a="http://www.w3.org/1999/xhtml"===e.namespaceURI||a;t.push("<",p);for(var u=0,c;u");if(a&&/^script$/i.test(p)){while(d){if(d.data){t.push(d.data)}else{aa(d,t,a,n,r)}d=d.nextSibling}}else{while(d){aa(d,t,a,n,r);d=d.nextSibling}}t.push("")}else{t.push("/>")}return;case Mo:case jo:var d=e.firstChild;while(d){aa(d,t,a,n,r);d=d.nextSibling}return;case Do:return t.push(" ",e.name,"=\"",e.value.replace(/[<&"]/g,At),"\"");case wo:return t.push(e.data.replace(/[<&]/g,At));case Ao:return t.push("");case Uo:return t.push("");case Bo:var h=e.publicId,_=e.systemId;t.push("")}else if(_&&"."!=_){t.push(" SYSTEM \"",_,"\">")}else{var f=e.internalSubset;if(f){t.push(" [",f,"]")}t.push(">")}return;case No:return t.push("");case Oo:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName);}}function na(e,t,a){var n;switch(t.nodeType){case Po:n=t.cloneNode(!1);n.ownerDocument=e;case jo:break;case Do:a=!0;break;}if(!n){n=t.cloneNode(!1)}n.ownerDocument=e;n.parentNode=null;if(a){var r=t.firstChild;while(r){n.appendChild(na(e,r,a));r=r.nextSibling}}return n}function ra(e,t,a){var r=new t.constructor;for(var s in t){var n=t[s];if("object"!=_typeof2(n)){if(n!=r[s]){r[s]=n}}}if(t.childNodes){r.childNodes=new kt}r.ownerDocument=e;switch(r.nodeType){case Po:var o=t.attributes,l=r.attributes=new It,d=o.length;l._ownerElement=r;for(var p=0;p",amp:"&",quot:"\"",apos:"'"};if(l){s.setDocumentLocator(l)}i.errorHandler=n(o,s,l);i.domBuilder=a.domBuilder||s;if(/\/x?html?$/.test(t)){u.nbsp="\xA0";u.copy="\xA9";d[""]="http://www.w3.org/1999/xhtml"}d.xml=d.xml||"http://www.w3.org/XML/1998/namespace";if(e){i.parse(e,d,u)}else{i.errorHandler.error("invalid doc source")}return s.doc};function n(e,t,a){if(!e){if(t instanceof r){return t}e=t}var i={},s=e instanceof Function;a=a||{};function n(t){var n=e[t];if(!n&&s){n=2==e.length?function(a){e(t,a)}:e}i[t]=n&&function(e){n("[xmldom "+t+"]\t"+e+o(a))}||function(){}}n("warning");n("error");n("fatalError");return i}function r(){this.cdata=!1}function s(e,t){t.lineNumber=e.lineNumber;t.columnNumber=e.columnNumber}r.prototype={startDocument:function(){this.doc=new u().createDocument(null,null,null);if(this.locator){this.doc.documentURI=this.locator.systemId}},startElement:function(e,t,a,n){var r=this.doc,o=r.createElementNS(e,a||t),l=n.length;d(this,o);this.currentElement=o;this.locator&&s(this.locator,o);for(var p=0;p=t+a||t){return new java.lang.String(e,t,a)+""}return e}}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(e){r.prototype[e]=function(){return null}});function d(e,t){if(!e.currentElement){e.doc.appendChild(t)}else{e.currentElement.appendChild(t)}}var p=xo.XMLReader,u=t.DOMImplementation=il.DOMImplementation;t.XMLSerializer=il.XMLSerializer;t.DOMParser=a}),ol=sl.DOMImplementation,ll=sl.XMLSerializer,dl=sl.DOMParser,pl=function(e){return!!e&&"object"===_typeof2(e)},ul=function e(){for(var t=arguments.length,a=Array(t),n=0;na.attributes.bandwidth){return e}e[s]={language:i,autoselect:!0,default:"main"===r,playlists:Il([xl(a)],t),uri:""};if("undefined"==typeof n&&"main"===r){n=a;n["default"]=!0}return e},{});if(!n){var i=Object.keys(r)[0];r[i]["default"]=!0}return r},Dl=function(e,t){if(void 0===t){t={}}return e.reduce(function(e,a){var n=a.attributes.lang||"text";if(e[n]){return e}e[n]={language:n,default:!1,autoselect:!1,playlists:Il([Ll(a)],t),uri:""};return e},{})},wl=function(e){var t,a=e.attributes,n=e.segments,r=e.sidx,i={attributes:(t={NAME:a.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:a.width,height:a.height},CODECS:a.codecs,BANDWIDTH:a.bandwidth},t["PROGRAM-ID"]=1,t),uri:"",endList:"static"===(a.type||"static"),timeline:a.periodIndex,resolvedUri:"",targetDuration:a.duration,segments:n,mediaSequence:n.length?n[0].number:1};if(a.contentProtection){i.contentProtection=a.contentProtection}if(r){i.sidx=r}return i},Al=function(e,t){var a;if(void 0===t){t={}}if(!e.length){return{}}var n=e[0].attributes,r=n.sourceDuration,i=n.type,s=void 0===i?"static":i,o=n.suggestedPresentationDelay,l=n.minimumUpdatePeriod,d=void 0===l?0:l,p=El(e.filter(function(e){var t=e.attributes;return"video/mp4"===t.mimeType||"video"===t.contentType})).map(wl),u=El(e.filter(function(e){var t=e.attributes;return"audio/mp4"===t.mimeType||"audio"===t.contentType})),c=e.filter(function(e){var t=e.attributes;return"text/vtt"===t.mimeType||"text"===t.contentType}),m={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(a={AUDIO:{},VIDEO:{}},a["CLOSED-CAPTIONS"]={},a.SUBTITLES={},a),uri:"",duration:r,playlists:Il(p,t),minimumUpdatePeriod:1e3*d};if("dynamic"===s){m.suggestedPresentationDelay=o}if(u.length){m.mediaGroups.AUDIO.audio=Pl(u,t)}if(c.length){m.mediaGroups.SUBTITLES.subs=Dl(c,t)}return m},Ol=function(e,t,a){var n=e.NOW,r=e.clientOffset,i=e.availabilityStartTime,s=e.timescale,o=void 0===s?1:s,l=e.start,d=void 0===l?0:l,p=e.minimumUpdatePeriod,u=void 0===p?0:p;return Math.ceil((((n+r)/1e3+u-(i+d))*o-t)/a)},Rl=function(e,t){for(var a=e.type,n=void 0===a?"static":a,r=e.minimumUpdatePeriod,i=void 0===r?0:r,s=e.media,o=void 0===s?"":s,l=e.sourceDuration,d=e.timescale,p=void 0===d?1:d,u=e.startNumber,c=void 0===u?1:u,m=e.periodIndex,g=[],y=-1,h=0;hy){y=b}if(b&&b>y){y=b}var v=void 0;if(0>T){var S=h+1;if(S===t.length){if("dynamic"===n&&0=r){return i}return""+Array(r-i.length+1).join("0")+i}},Ul=function(e,t){return e.replace(/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,Nl(t))},Ml=function(e,t){if(!e.duration&&!t){return[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodIndex}]}if(e.duration){return Sl(e)}return Rl(e,t)},Bl=function(e,t){var a={RepresentationID:e.id,Bandwidth:e.bandwidth||0},n=e.initialization,r=void 0===n?{sourceURL:"",range:""}:n,i=fl({baseUrl:e.baseUrl,source:Ul(r.sourceURL,a),range:r.range}),s=Ml(e,t);return s.map(function(t){a.Number=t.number;a.Time=t.time;var n=Ul(e.media||"",a);return{uri:n,timeline:t.timeline,duration:t.duration,resolvedUri:mo(e.baseUrl||"",n),map:i,number:t.number}})},jl=function(e,t){var a=e.baseUrl,n=e.initialization,r=void 0===n?{}:n,i=fl({baseUrl:a,source:r.sourceURL,range:r.range}),s=fl({baseUrl:a,source:t.media,range:t.mediaRange});s.map=i;return s},Fl=function(e,t){var a=e.duration,n=e.segmentUrls,r=void 0===n?[]:n;if(!a&&!t||a&&t){throw new Error(_l.SEGMENT_TIME_UNSPECIFIED)}var i=r.map(function(t){return jl(e,t)}),s;if(a){s=Sl(e)}if(t){s=Rl(e,t)}var o=s.map(function(e,t){if(i[t]){var a=i[t];a.timeline=e.timeline;a.duration=e.duration;a.number=e.number;return a}}).filter(function(e){return e});return o},Hl=function(e){var t=e.attributes,a=e.segmentInfo,n,r;if(a.template){r=Bl;n=ul(t,a.template)}else if(a.base){r=kl;n=ul(t,a.base)}else if(a.list){r=Fl;n=ul(t,a.list)}var i={attributes:t};if(!r){return i}var s=r(n,a.timeline);if(n.duration){var o=n,l=o.duration,d=o.timescale,p=void 0===d?1:d;n.duration=l/p}else if(s.length){n.duration=s.reduce(function(e,t){return Math.max(e,Math.ceil(t.duration))},0)}else{n.duration=0}i.attributes=n;i.segments=s;if(a.base&&n.indexRange){i.sidx=s[0];i.segments=[]}return i},ql=function(e){return e.map(Hl)},Vl=function(e,t){return yl(e.childNodes).filter(function(e){var a=e.tagName;return a===t})},Wl=function(e){return e.textContent.trim()},zl=function(e){var t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!t){return 0}var a=t.slice(1),n=a[0],r=a[1],i=a[2],s=a[3],o=a[4],l=a[5];return parseFloat(n||0)*31536000+parseFloat(r||0)*2592000+parseFloat(i||0)*86400+parseFloat(s||0)*3600+parseFloat(o||0)*60+parseFloat(l||0)},Gl=function(e){if(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(e)){e+="Z"}return Date.parse(e)},Kl={mediaPresentationDuration:function(e){return zl(e)},availabilityStartTime:function(e){return Gl(e)/1e3},minimumUpdatePeriod:function(e){return zl(e)},suggestedPresentationDelay:function(e){return zl(e)},type:function(e){return e},timeShiftBufferDepth:function(e){return zl(e)},start:function(e){return zl(e)},width:function(e){return parseInt(e,10)},height:function(e){return parseInt(e,10)},bandwidth:function(e){return parseInt(e,10)},startNumber:function(e){return parseInt(e,10)},timescale:function(e){return parseInt(e,10)},duration:function(e){var t=parseInt(e,10);if(isNaN(t)){return zl(e)}return t},d:function(e){return parseInt(e,10)},t:function(e){return parseInt(e,10)},r:function(e){return parseInt(e,10)},DEFAULT:function(e){return e}},Yl=function(e){if(!(e&&e.attributes)){return{}}return yl(e.attributes).reduce(function(t,a){var e=Kl[a.name]||Kl.DEFAULT;t[a.name]=e(a.value);return t},{})},Xl={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"},$l=function(e,t){if(!t.length){return e}return gl(e.map(function(e){return t.map(function(t){return mo(e,Wl(t))})}))},Ql=function(e){var t=Vl(e,"SegmentTemplate")[0],a=Vl(e,"SegmentList")[0],n=a&&Vl(a,"SegmentURL").map(function(e){return ul({tag:"SegmentURL"},Yl(e))}),r=Vl(e,"SegmentBase")[0],i=a||t,s=i&&Vl(i,"SegmentTimeline")[0],o=a||r||t,l=o&&Vl(o,"Initialization")[0],d=t&&Yl(t);if(d&&l){d.initialization=l&&Yl(l)}else if(d&&d.initialization){d.initialization={sourceURL:d.initialization}}var p={template:d,timeline:s&&Vl(s,"S").map(function(e){return Yl(e)}),list:a&&ul(Yl(a),{segmentUrls:n,initialization:Yl(l)}),base:r&&ul(Yl(r),{initialization:Yl(l)})};Object.keys(p).forEach(function(e){if(!p[e]){delete p[e]}});return p},Jl=function(e,t,a){return function(n){var r=Vl(n,"BaseURL"),i=$l(t,r),s=ul(e,Yl(n)),o=Ql(n);return i.map(function(e){return{segmentInfo:ul(a,o),attributes:ul(s,{baseUrl:e})}})}},Zl=function(e){return e.reduce(function(e,t){var a=Yl(t),n=Xl[a.schemeIdUri];if(n){e[n]={attributes:a};var r=Vl(t,"cenc:pssh")[0];if(r){var i=Wl(r),s=i&&st(i);e[n].pssh=s}}return e},{})},ed=function(e,t,a){return function(n){var r=Yl(n),i=$l(t,Vl(n,"BaseURL")),s=Vl(n,"Role")[0],o={role:Yl(s)},l=ul(e,r,o),d=Zl(Vl(n,"ContentProtection"));if(Object.keys(d).length){l=ul(l,{contentProtection:d})}var p=Ql(n),u=Vl(n,"Representation"),c=ul(a,p);return gl(u.map(Jl(l,i,c)))}},td=function(t,a){return function(n,r){var i=$l(a,Vl(n,"BaseURL")),s=Yl(n),o=parseInt(s.id,10),l=e.isNaN(o)?r:o,d=ul(t,{periodIndex:l}),p=Vl(n,"AdaptationSet"),u=Ql(n);return gl(p.map(ed(d,i,u)))}},ad=function(e,t){if(void 0===t){t={}}var a=t,n=a.manifestUri,r=void 0===n?"":n,i=a.NOW,s=void 0===i?Date.now():i,o=a.clientOffset,l=void 0===o?0:o,d=Vl(e,"Period");if(!d.length){throw new Error(_l.INVALID_NUMBER_OF_PERIOD)}var p=Yl(e),u=$l([r],Vl(e,"BaseURL"));p.sourceDuration=p.mediaPresentationDuration||0;p.NOW=s;p.clientOffset=l;return gl(d.map(td(p,u)))},nd=function(e){if(""===e){throw new Error(_l.DASH_EMPTY_MANIFEST)}var t=new dl,a=t.parseFromString(e,"application/xml"),n=a&&"MPD"===a.documentElement.tagName?a.documentElement:null;if(!n||n&&0>>0},toHexString:function(e){return("00"+e.toString(16)).slice(-2)}},ld,dd,pd=od.toUnsigned,ud=function(e){return new Date(1e3*e-20828448e5)},cd=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},md=function(e){var t="";t+=String.fromCharCode(e[0]);t+=String.fromCharCode(e[1]);t+=String.fromCharCode(e[2]);t+=String.fromCharCode(e[3]);return t},gd=function e(t,a){var n=[],r,s,o,l,d;if(!a.length){return null}for(r=0;r=r){a.push("MALFORMED DATA");continue}switch(31&e[n]){case 1:a.push("slice_layer_without_partitioning_rbsp");break;case 5:a.push("slice_layer_without_partitioning_rbsp_idr");break;case 6:a.push("sei_rbsp");break;case 7:a.push("seq_parameter_set_rbsp");break;case 8:a.push("pic_parameter_set_rbsp");break;case 9:a.push("access_unit_delimiter_rbsp");break;default:a.push(31&"UNKNOWN NAL - "+e[n]);break;}}return a},hd={avc1:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{dataReferenceIndex:t.getUint16(6),width:t.getUint16(24),height:t.getUint16(26),horizresolution:t.getUint16(28)+t.getUint16(30)/16,vertresolution:t.getUint16(32)+t.getUint16(34)/16,frameCount:t.getUint16(40),depth:t.getUint16(74),config:ld(e.subarray(78,e.byteLength))}},avcC:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),a={configurationVersion:e[0],avcProfileIndication:e[1],profileCompatibility:e[2],avcLevelIndication:e[3],lengthSizeMinusOne:3&e[4],sps:[],pps:[]},n=31&e[5],r,s,o,l;o=6;for(l=0;l>>2,bufferSize:e[13]<<16|e[14]<<8|e[15],maxBitrate:e[16]<<24|e[17]<<16|e[18]<<8|e[19],avgBitrate:e[20]<<24|e[21]<<16|e[22]<<8|e[23],decoderConfigDescriptor:{tag:e[24],length:e[25],audioObjectType:31&e[26]>>>3,samplingFrequencyIndex:(7&e[26])<<1|1&e[27]>>>7,channelConfiguration:15&e[27]>>>3}}}},ftyp:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),a={majorBrand:md(e.subarray(0,4)),minorVersion:t.getUint32(4),compatibleBrands:[]},n=8;while(n>10)+96);r.language+=String.fromCharCode(((992&n)>>5)+96);r.language+=String.fromCharCode((31&n)+96);return r},mdia:function(e){return{boxes:ld(e)}},mfhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sequenceNumber:e[4]<<24|e[5]<<16|e[6]<<8|e[7]}},minf:function(e){return{boxes:ld(e)}},mp4a:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),a={dataReferenceIndex:t.getUint16(6),channelcount:t.getUint16(16),samplesize:t.getUint16(18),samplerate:t.getUint16(24)+t.getUint16(26)/65536};if(28>4,isDependedOn:(12&e[a])>>2,hasRedundancy:3&e[a]})}return t},sidx:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),a={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8),earliestPresentationTime:t.getUint32(12),firstOffset:t.getUint32(16)},n=t.getUint16(22),r;for(r=24;n;r+=12,n--){a.references.push({referenceType:(128&e[r])>>>7,referencedSize:2147483647&t.getUint32(r),subsegmentDuration:t.getUint32(r+4),startsWithSap:!!(128&e[r+8]),sapType:(112&e[r+8])>>>4,sapDeltaTime:268435455&t.getUint32(r+8)})}return a},smhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),balance:e[4]+e[5]/256}},stbl:function(e){return{boxes:ld(e)}},stco:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),a={version:e[0],flags:new Uint8Array(e.subarray(1,4)),chunkOffsets:[]},n=t.getUint32(4),r;for(r=8;n;r+=4,n--){a.chunkOffsets.push(t.getUint32(r))}return a},stsc:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),a=t.getUint32(4),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleToChunks:[]},r;for(r=8;a;r+=12,a--){n.sampleToChunks.push({firstChunk:t.getUint32(r),samplesPerChunk:t.getUint32(r+4),sampleDescriptionIndex:t.getUint32(r+8)})}return n},stsd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleDescriptions:ld(e.subarray(8))}},stsz:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),a={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleSize:t.getUint32(4),entries:[]},n;for(n=12;n>6,sampleHasRedundancy:(48&e[21])>>4,samplePaddingValue:(14&e[21])>>1,sampleIsDifferenceSample:!!(1&e[21]),sampleDegradationPriority:t.getUint16(22)}},trun:function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},a=new DataView(e.buffer,e.byteOffset,e.byteLength),n=1&t.flags[2],r=4&t.flags[2],i=1&t.flags[1],s=2&t.flags[1],o=4&t.flags[1],l=8&t.flags[1],d=a.getUint32(4),p=8,u;if(n){t.dataOffset=a.getInt32(p);p+=4}if(r&&d){u={flags:cd(e.subarray(p,p+4))};p+=4;if(i){u.duration=a.getUint32(p);p+=4}if(s){u.size=a.getUint32(p);p+=4}if(l){u.compositionTimeOffset=a.getUint32(p);p+=4}t.samples.push(u);d--}while(d--){u={};if(i){u.duration=a.getUint32(p);p+=4}if(s){u.size=a.getUint32(p);p+=4}if(o){u.flags=cd(e.subarray(p,p+4));p+=4}if(l){u.compositionTimeOffset=a.getUint32(p);p+=4}t.samples.push(u)}return t},"url ":function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4))}},vmhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),graphicsmode:t.getUint16(4),opcolor:new Uint16Array([t.getUint16(6),t.getUint16(8),t.getUint16(10)])}}};ld=function(e){for(var t=0,a=[],n,r,s,o,l,d=new ArrayBuffer(e.length),p=new Uint8Array(d),u=0;u"}if(1===i.length){return n+"<"+i.join("").slice(1)+">"}return n+"<\n"+i.map(function(e){return a+" "+e}).join("\n")+"\n"+a+" >"}return n+JSON.stringify(r,null,2).split("\n").map(function(e,t){if(0===t){return e}return a+" "+e}).join("\n")}).join("\n")+(e.boxes?"\n"+dd(e.boxes,t+1):"")}).join("\n")};var _d={inspect:ld,textify:dd,parseType:md,findBox:gd,parseTraf:hd.traf,parseTfdt:hd.tfdt,parseHdlr:hd.hdlr,parseTfhd:hd.tfhd,parseTrun:hd.trun,parseSidx:hd.sidx},fd=od.toUnsigned,Td=od.toHexString,bd,vd,Sd,kd,Cd;bd=function(e){var t=_d.findBox(e,["moov","trak"]);return t.reduce(function(e,t){var a,n,r,i,s;a=_d.findBox(t,["tkhd"])[0];if(!a){return null}n=a[0];r=0===n?12:20;i=fd(a[r]<<24|a[r+1]<<16|a[r+2]<<8|a[r+3]);s=_d.findBox(t,["mdia","mdhd"])[0];if(!s){return null}n=s[0];r=0===n?12:20;e[i]=fd(s[r]<<24|s[r+1]<<16|s[r+2]<<8|s[r+3]);return e},{})};vd=function(e,t){var a,n,r;a=_d.findBox(t,["moof","traf"]);n=[].concat.apply([],a.map(function(t){return _d.findBox(t,["tfhd"]).map(function(a){var n,r,i;n=fd(a[4]<<24|a[5]<<16|a[6]<<8|a[7]);r=e[n]||9e4;i=_d.findBox(t,["tfdt"]).map(function(e){var t,a;t=e[0];a=fd(e[4]<<24|e[5]<<16|e[6]<<8|e[7]);if(1===t){a*=Math.pow(2,32);a+=fd(e[8]<<24|e[9]<<16|e[10]<<8|e[11])}return a})[0];i=i||1/0;return i/r})}));r=Math.min.apply(null,n);return isFinite(r)?r:0};Sd=function(e,t){var a=_d.findBox(t,["moof","traf"]),n=0,r=0,s;if(a&&a.length){for(var o=_d.parseTraf(a[0]),l=0;l>>2).replace(/^0/,"")}else{t.codec="mp4a.40.2"}}}}var c=_d.findBox(e,["mdia","mdhd"])[0];if(c&&n){20;t.timescale=fd(c[20]<<24|c[21]<<16|c[22]<<8|c[23])}a.push(t)});return a};var Ed={findBox:_d.findBox,parseType:_d.parseType,timescale:bd,startTime:vd,compositionStartTime:Sd,videoTrackIds:kd,tracks:Cd},Id=4,xd=function(e){var t=0,a={payloadType:-1,payloadSize:0},n=0,r=0;while(te.type){this.dispatchCea608Packet(e)}},this);this.captionPackets_.length=0;this.flushCCStreams(e)};Od.prototype.flush=function(){return this.flushStream("flush")};Od.prototype.partialFlush=function(){return this.flushStream("partialFlush")};Od.prototype.reset=function(){this.latestDts_=null;this.ignoreNextEqualDts_=!1;this.numSameDts_=0;this.activeCea608Channel_=[null,null];this.ccStreams_.forEach(function(e){e.reset()})};Od.prototype.dispatchCea608Packet=function(e){if(this.setsTextOrXDSActive(e)){this.activeCea608Channel_[e.type]=null}else if(this.setsChannel1Active(e)){this.activeCea608Channel_[e.type]=0}else if(this.setsChannel2Active(e)){this.activeCea608Channel_[e.type]=1}if(null===this.activeCea608Channel_[e.type]){return}this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)};Od.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)};Od.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)};Od.prototype.setsTextOrXDSActive=function(e){return 256==(28928&e.ccData)||4138==(30974&e.ccData)||6186==(30974&e.ccData)};var Rd={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Nd=function(e){if(null===e){return""}e=Rd[e]||e;return String.fromCharCode(e)},Ud=14,Md=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Bd=function(){var e=[],t=Ud+1;while(t--){e.push("")}return e},jd=function e(t,a){e.prototype.init.call(this);this.field_=t||0;this.dataChannel_=a||0;this.name_="CC"+((this.field_<<1|this.dataChannel_)+1);this.setConstants();this.reset();this.push=function(e){var t,a,n,r,i;t=32639&e.ccData;if(t===this.lastControlCode_){this.lastControlCode_=null;return}if(4096==(61440&t)){this.lastControlCode_=t}else if(t!==this.PADDING_){this.lastControlCode_=null}n=t>>>8;r=255&t;if(t===this.PADDING_){}else if(t===this.RESUME_CAPTION_LOADING_){this.mode_="popOn"}else if(t===this.END_OF_CAPTION_){this.mode_="popOn";this.clearFormatting(e.pts);this.flushDisplayed(e.pts);a=this.displayed_;this.displayed_=this.nonDisplayed_;this.nonDisplayed_=a;this.startPts_=e.pts}else if(t===this.ROLL_UP_2_ROWS_){this.rollUpRows_=2;this.setRollUp(e.pts)}else if(t===this.ROLL_UP_3_ROWS_){this.rollUpRows_=3;this.setRollUp(e.pts)}else if(t===this.ROLL_UP_4_ROWS_){this.rollUpRows_=4;this.setRollUp(e.pts)}else if(t===this.CARRIAGE_RETURN_){this.clearFormatting(e.pts);this.flushDisplayed(e.pts);this.shiftRowsUp_();this.startPts_=e.pts}else if(t===this.BACKSPACE_){if("popOn"===this.mode_){this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1)}else{this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1)}}else if(t===this.ERASE_DISPLAYED_MEMORY_){this.flushDisplayed(e.pts);this.displayed_=Bd()}else if(t===this.ERASE_NON_DISPLAYED_MEMORY_){this.nonDisplayed_=Bd()}else if(t===this.RESUME_DIRECT_CAPTIONING_){if("paintOn"!==this.mode_){this.flushDisplayed(e.pts);this.displayed_=Bd()}this.mode_="paintOn";this.startPts_=e.pts}else if(this.isSpecialCharacter(n,r)){n=(3&n)<<8;i=Nd(n|r);this[this.mode_](e.pts,i);this.column_++}else if(this.isExtCharacter(n,r)){if("popOn"===this.mode_){this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1)}else{this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1)}n=(3&n)<<8;i=Nd(n|r);this[this.mode_](e.pts,i);this.column_++}else if(this.isMidRowCode(n,r)){this.clearFormatting(e.pts);this[this.mode_](e.pts," ");this.column_++;if(14==(14&r)){this.addFormatting(e.pts,["i"])}if(1==(1&r)){this.addFormatting(e.pts,["u"])}}else if(this.isOffsetControlCode(n,r)){this.column_+=3&r}else if(this.isPAC(n,r)){var s=Md.indexOf(7968&t);if("rollUp"===this.mode_){if(0>s-this.rollUpRows_+1){s=this.rollUpRows_-1}this.setRollUp(e.pts,s)}if(s!==this.row_){this.clearFormatting(e.pts);this.row_=s}if(1&r&&-1===this.formatting_.indexOf("u")){this.addFormatting(e.pts,["u"])}if(16==(16&t)){this.column_=4*((14&t)>>1)}if(this.isColorPAC(r)){if(14==(14&r)){this.addFormatting(e.pts,["i"])}}}else if(this.isNormalChar(n)){if(0===r){r=null}i=Nd(n);i+=Nd(r);this[this.mode_](e.pts,i);this.column_+=i.length}}};jd.prototype=new Ad;jd.prototype.flushDisplayed=function(e){var t=this.displayed_.map(function(e){try{return e.trim()}catch(t){console.error("Skipping malformed caption.");return""}}).join("\n").replace(/^\n+|\n+$/g,"");if(t.length){this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})}};jd.prototype.reset=function(){this.mode_="popOn";this.topRow_=0;this.startPts_=0;this.displayed_=Bd();this.nonDisplayed_=Bd();this.lastControlCode_=null;this.column_=0;this.row_=Ud;this.rollUpRows_=2;this.formatting_=[]};jd.prototype.setConstants=function(){if(0===this.dataChannel_){this.BASE_=16;this.EXT_=17;this.CONTROL_=(20|this.field_)<<8;this.OFFSET_=23}else if(1===this.dataChannel_){this.BASE_=24;this.EXT_=25;this.CONTROL_=(28|this.field_)<<8;this.OFFSET_=31}this.PADDING_=0;this.RESUME_CAPTION_LOADING_=32|this.CONTROL_;this.END_OF_CAPTION_=47|this.CONTROL_;this.ROLL_UP_2_ROWS_=37|this.CONTROL_;this.ROLL_UP_3_ROWS_=38|this.CONTROL_;this.ROLL_UP_4_ROWS_=39|this.CONTROL_;this.CARRIAGE_RETURN_=45|this.CONTROL_;this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_;this.BACKSPACE_=33|this.CONTROL_;this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_;this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_};jd.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&48<=t&&63>=t};jd.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&32<=t&&63>=t};jd.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&32<=t&&47>=t};jd.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&33<=t&&35>=t};jd.prototype.isPAC=function(e,t){return e>=this.BASE_&&e=t};jd.prototype.isColorPAC=function(e){return 64<=e&&79>=e||96<=e&&127>=e};jd.prototype.isNormalChar=function(e){return 32<=e&&127>=e};jd.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_){this.row_=Ud;this.mode_="rollUp";this.flushDisplayed(e);this.nonDisplayed_=Bd();this.displayed_=Bd()}if(t!==void 0&&t!==this.row_){for(var a=0;a"},"");this[this.mode_](e,a)};jd.prototype.clearFormatting=function(e){if(!this.formatting_.length){return}var t=this.formatting_.reverse().reduce(function(e,t){return e+""},"");this.formatting_=[];this[this.mode_](e,t)};jd.prototype.popOn=function(e,t){var a=this.nonDisplayed_[this.row_];a+=t;this.nonDisplayed_[this.row_]=a};jd.prototype.rollUp=function(e,t){var a=this.displayed_[this.row_];a+=t;this.displayed_[this.row_]=a};jd.prototype.shiftRowsUp_=function(){var e;for(e=0;e=l){continue}switch(31&e[o]){case 6:var p=e.subarray(o+1,o+1+l),u=qd(o,t);s={nalUnitType:"sei_rbsp",size:l,data:p,escapedRBSP:Fd(p),trackId:a};if(u){s.pts=u.pts;s.dts=u.dts;d=u}else{s.pts=d.pts;s.dts=d.dts}r.push(s);break;default:break;}}return r},Wd=function(e,t,a){var n=t,r=a.defaultSampleDuration||0,i=a.defaultSampleSize||0,s=a.trackId,o=[];e.forEach(function(e){var t=_d.parseTrun(e),a=t.samples;a.forEach(function(e){if(e.duration===void 0){e.duration=r}if(e.size===void 0){e.size=i}e.trackId=s;e.dts=n;if(e.compositionTimeOffset===void 0){e.compositionTimeOffset=0}e.pts=n+e.compositionTimeOffset;n+=e.duration});o=o.concat(a)});return o},zd=function(e,t){var a=Ed.findBox(e,["moof","traf"]),n=Ed.findBox(e,["mdat"]),r={},i=[];n.forEach(function(e,t){var n=a[t];i.push({mdat:e,traf:n})});i.forEach(function(e){var a=e.mdat,n=e.traf,i=Ed.findBox(n,["tfhd"]),s=_d.parseTfhd(i[0]),o=s.trackId,l=Ed.findBox(n,["tfdt"]),d=0t){a=-1}while(Math.abs(t-e)>4294967296){e+=a*8589934592}return e},Qd=function e(t){var a,n;e.prototype.init.call(this);this.type_=t||Xd;this.push=function(e){if(this.type_!==Xd&&e.type!==this.type_){return}if(n===void 0){n=e.dts}e.dts=$d(e.dts,n);e.pts=$d(e.pts,n);a=e.dts;this.trigger("data",e)};this.flush=function(){n=a;this.trigger("done")};this.endTimeline=function(){this.flush();this.trigger("endedtimeline")};this.discontinuity=function(){n=void 0;a=void 0};this.reset=function(){this.discontinuity();this.trigger("reset")}};Qd.prototype=new Ad;var Jd=function(e){var t=31&e[1];t<<=8;t|=e[2];return t},Zd=function(e){return!!(64&e[1])},ep=function(e){var t=0;if(1<(48&e[3])>>>4){t+=e[4]+1}return t},tp=function(e){var t={},a=Zd(e),n=4+ep(e);if(a){n+=e[n]+1}if(!(1&e[n+5])){return}var r,s,o;r=(15&e[n+1])<<8|e[n+2];s=3+r-4;o=(15&e[n+10])<<8|e[n+11];var l=12+o;while(l>>2]}return null},lp=function(e){var t,a,n,r;t=10;if(64&e[5]){t+=4;t+=rp(e.subarray(10,14))}do{a=rp(e.subarray(t+4,t+8));if(1>a){return null}r=String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3]);if("PRIV"===r){n=e.subarray(t+10,t+a+10);for(var s=0;s>>2;d*=4;d+=3&l[7];return d}break}}}t+=10;t+=a}while(t=e.byteLength){return null}var n=null,r;r=e[a+7];if(192&r){n={};n.pts=(14&e[a+9])<<27|(255&e[a+10])<<20|(254&e[a+11])<<12|(255&e[a+12])<<5|(254&e[a+13])>>>3;n.pts*=4;n.pts+=(6&e[a+13])>>>1;n.dts=n.pts;if(64&r){n.dts=(14&e[a+14])<<27|(255&e[a+15])<<20|(254&e[a+16])<<12|(255&e[a+17])<<5|(254&e[a+18])>>>3;n.dts*=4;n.dts+=(6&e[a+18])>>>1}}return n},videoPacketContainsKeyFrame:function(e){var t=4+ep(e),a=e.subarray(t),n=0,r=0,i=!1,s;for(;r>4){return a+20}return a+10},parseAdtsSize:function(e,t){var a=(224&e[t+5])>>5,n=e[t+4]<<3,r=e[t+3]&6144;return r|n|a},parseType:function(e,t){if(e[t]===73&&e[t+1]===68&&e[t+2]===51){return"timed-metadata"}else if(e[t]&!0&&240==(240&e[t+1])){return"audio"}return null},parseSampleRate:op,parseAacTimestamp:lp};var bp=_p.ONE_SECOND_IN_TS,vp=188,Sp=71,kp=function(e,t){var a=0,n=vp,r,i;while(ne.length-s){t=!0;break}i=Tp.aac.parseId3TagSize(e,s);if(i>e.length){t=!0;break}if(null===r){o=e.subarray(s,s+i);r=Tp.aac.parseAacTimestamp(o)}s+=i;break;case"audio":if(7>e.length-s){t=!0;break}i=Tp.aac.parseAdtsSize(e,s);if(i>e.length){t=!0;break}if(null===n){o=e.subarray(s,s+i);n=Tp.aac.parseSampleRate(o)}a++;s+=i;break;default:s++;break;}if(t){return null}}if(null===n||null===r){return null}var d=bp/n,p={audio:[{type:"audio",dts:r,pts:r},{type:"audio",dts:r+1024*a*d,pts:r+1024*a*d}]};return p},Lp=function(e){var t={pid:null,table:null},a={};kp(e,t);for(var n in t.table){if(t.table.hasOwnProperty(n)){var r=t.table[n];switch(r){case Yd.H264_STREAM_TYPE:a.video=[];Ep(e,t,a);if(0===a.video.length){delete a.video}break;case Yd.ADTS_STREAM_TYPE:a.audio=[];Cp(e,t,a);if(0===a.audio.length){delete a.audio}break;default:break;}}}return a};function sa(e){return e.subarray(0,e.byteLength-e[e.byteLength-1])}var Pp=function(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}},Dp=function(){function e(e,t){for(var a=0,n;ao;o++){d[(u[o]=o<<1^283*(o>>7))^o]=o}for(l=p=0;!n[l];l^=c||1,p=d[p]||1){y=p^p<<1^p<<2^p<<3^p<<4;y=99^(y>>8^255&y);n[l]=y;r[y]=l;g=u[m=u[c=u[l]]];_=16843009*g^65537*m^257*c^16843008*l;h=257*u[y]^16843008*y;for(o=0;4>o;o++){t[o][l]=h=h<<24^h>>>8;a[o][y]=_=_<<24^_>>>8}}for(o=0;5>o;o++){t[o]=t[o].slice(0);a[o]=a[o].slice(0)}return e},Rp=null,Np=function(){function e(t){Pp(this,e);if(!Rp){Rp=Op()}this._tables=[[Rp[0][0].slice(),Rp[0][1].slice(),Rp[0][2].slice(),Rp[0][3].slice(),Rp[0][4].slice()],[Rp[1][0].slice(),Rp[1][1].slice(),Rp[1][2].slice(),Rp[1][3].slice(),Rp[1][4].slice()]];var a=void 0,n=void 0,r=void 0,s=void 0,o=void 0,l=this._tables[0][4],d=this._tables[1],p=t.length,u=1;if(4!==p&&6!==p&&8!==p){throw new Error("Invalid aes key size")}s=t.slice(0);o=[];this._key=[s,o];for(a=p;a<4*p+28;a++){r=s[a-1];if(0==a%p||8===p&&4==a%p){r=l[r>>>24]<<24^l[255&r>>16]<<16^l[255&r>>8]<<8^l[255&r];if(0==a%p){r=r<<8^r>>>24^u<<24;u=u<<1^283*(u>>7)}}s[a]=s[a-p]^r}for(n=0;a;n++,a--){r=s[3&n?a:a-4];if(4>=a||4>n){o[n]=r}else{o[n]=d[0][l[r>>>24]]^d[1][l[255&r>>16]]^d[2][l[255&r>>8]]^d[3][l[255&r]]}}}e.prototype.decrypt=function(e,t,n,r,s,o){var l=this._key[1],p=e^l[0],u=r^l[1],m=n^l[2],g=t^l[3],y=void 0,h=void 0,_=void 0,f=l.length/4-2,T=void 0,v=4,S=this._tables[1],k=S[0],C=S[1],E=S[2],I=S[3],x=S[4];for(T=0;T>>24]^C[255&u>>16]^E[255&m>>8]^I[255&g]^l[v];h=k[u>>>24]^C[255&m>>16]^E[255&g>>8]^I[255&p]^l[v+1];_=k[m>>>24]^C[255&g>>16]^E[255&p>>8]^I[255&u]^l[v+2];g=k[g>>>24]^C[255&p>>16]^E[255&u>>8]^I[255&m]^l[v+3];v+=4;p=y;u=h;m=_}for(T=0;4>T;T++){s[(3&-T)+o]=x[p>>>24]<<24^x[255&u>>16]<<16^x[255&m>>8]<<8^x[255&g]^l[v++];y=p;p=u;u=m;m=g;g=y}};return e}(),Up=function(){function e(){Pp(this,e);this.listeners={}}e.prototype.on=function(e,t){if(!this.listeners[e]){this.listeners[e]=[]}this.listeners[e].push(t)};e.prototype.off=function(e,t){if(!this.listeners[e]){return!1}var a=this.listeners[e].indexOf(t);this.listeners[e].splice(a,1);return-1>8|e>>>24},jp=function(e,t,a){var n=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),r=new Np(Array.prototype.slice.call(t)),i=new Uint8Array(e.byteLength),s=new Int32Array(i.buffer),o=void 0,l=void 0,d=void 0,p=void 0,u=void 0,c=void 0,m=void 0,g=void 0,y=void 0;o=a[0];l=a[1];d=a[2];p=a[3];for(y=0;ya){var r=[a,t];t=r[0];a=r[1]}if(0>t){for(var s=t;s=r){break}}return Math.max(0,a)},gu=function(e,t,a,n){if(!e||!e.segments){return null}if(e.endList){return uu(e)}if(null===t){return null}t=t||0;var r=a?mu(e,n):e.segments.length;return pu(e,e.mediaSequence+r,t)},yu=function(e){return 0==e-Math.floor(e)},hu=function(e,t){if(yu(t)){return t+.1*e}for(var a=t.toString().split(".")[1].length,n=1;n<=a;n++){var r=Math.pow(10,n),s=t*r;if(yu(s)||n===a){return(s+e)/r}}},_u=hu.bind(null,1),fu=hu.bind(null,-1),Tu=function(e,t,a,n){var r=void 0,s=void 0,o=e.segments.length,l=t-n;if(0>l){if(0a){for(r=a;0>r;r++){l-=e.targetDuration;if(0>l){return{mediaIndex:0,startTime:t}}}a=0}for(r=a;rl){return{mediaIndex:r,startTime:n+cu(e,a,r)}}}return{mediaIndex:o-1,startTime:t}},bu=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},vu=function(e){return e.excludeUntil&&e.excludeUntil===1/0},Su=function(e){var t=bu(e);return!e.disabled&&!t},ku=function(e){for(var t=0;tt){return String.fromCharCode(t)}return"."},Uu=function(e){var t={};Object.keys(e).forEach(function(a){var n=e[a];if(ArrayBuffer.isView(n)){t[a]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}}else{t[a]=n}});return t},Mu=function(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},Bu=function(e){return e.resolvedUri},ju=function(e){for(var t=Array.prototype.slice.call(e),a=16,n="",r=void 0,i=void 0,s=0;sp){return null}if(a>l){n=o}return{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:xu.duration(t,t.mediaSequence+t.segments.indexOf(n)),type:n.videoTimingInfo?"accurate":"estimate"}},Gu=function(e,t){if(!t||!t.segments||0===t.segments.length){return null}for(var a=0,n=void 0,r=0;ra){if(e>a+s.duration*qu){return null}n=s}return{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:a-n.duration,type:n.videoTimingInfo?"accurate":"estimate"}},Ku=function(e,t){var a=void 0,n=void 0;try{a=new Date(e);n=new Date(t)}catch(t){}var r=a.getTime(),i=n.getTime();return(i-r)/1e3},Yu=function(e){if(!e.segments||0===e.segments.length){return!1}for(var t=0,a;t=t})},tc=function(e,t){return Zu(e,function(e){return e-Qu>=t})},ac=function(e){if(2>e.length){return Ze.createTimeRanges()}for(var t=[],a=1;a "+e.end(a))}return t.join(", ")},rc=function(e,t){var a=2=e){a.removeCue(r)}}},lc=function(e){Object.defineProperties(e.frame,{id:{get:function(){Ze.log.warn("cue.frame.id is deprecated. Use cue.value.key instead.");return e.value.key}},value:{get:function(){Ze.log.warn("cue.frame.value is deprecated. Use cue.value.data instead.");return e.value.data}},privateData:{get:function(){Ze.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead.");return e.value.data}}})},dc=function(e){var t;if(isNaN(e)||Math.abs(e)===1/0){t=Number.MAX_VALUE}else{t=e}return t},pc=function(t,a,n){var r=e.WebKitDataCue||e.VTTCue;if(a){a.forEach(function(e){var t=e.stream;this.inbandTextTracks_[t].addCue(new r(e.startTime+this.timestampOffset,e.endTime+this.timestampOffset,e.text))},t)}if(n){var s=dc(t.mediaSource_.duration);n.forEach(function(t){var a=t.cueTime+this.timestampOffset;if("number"!=typeof a||e.isNaN(a)||0>a||!(a<1/0)){return}t.frames.forEach(function(e){var t=new r(a,a,e.value||e.url||e.data||"");t.frame=e;t.value=e;lc(t);this.metadataTrack_.addCue(t)},this)},t);if(t.metadataTrack_&&t.metadataTrack_.cues&&t.metadataTrack_.cues.length){for(var o=t.metadataTrack_.cues,l=[],d=0;d>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))};o=function(){return r(I.ftyp,x,L,x,P)};T=function(e){return r(I.hdlr,A[e])};l=function(e){return r(I.mdat,e)};f=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,255&e.duration>>>24,255&e.duration>>>16,255&e.duration>>>8,255&e.duration,85,196,0,0]);if(e.samplerate){t[12]=255&e.samplerate>>>24;t[13]=255&e.samplerate>>>16;t[14]=255&e.samplerate>>>8;t[15]=255&e.samplerate}return r(I.mdhd,t)};_=function(e){return r(I.mdia,f(e),T(e.type),p(e))};d=function(e){return r(I.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))};p=function(e){return r(I.minf,"video"===e.type?r(I.vmhd,O):r(I.smhd,R),i(),v(e))};u=function(e,t){var a=[],n=t.length;while(n--){a[n]=k(t[n])}return r.apply(null,[I.moof,d(e)].concat(a))};c=function(e){var t=e.length,a=[];while(t--){a[t]=y(e[t])}return r.apply(null,[I.moov,g(4294967295)].concat(a).concat(m(e)))};m=function(e){var t=e.length,a=[];while(t--){a[t]=C(e[t])}return r.apply(null,[I.mvex].concat(a))};g=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return r(I.mvhd,t)};b=function(e){var t=e.samples||[],a=new Uint8Array(4+t.length),n,s;for(s=0;s>>8);n.push(255&t[o].byteLength);n=n.concat(Array.prototype.slice.call(t[o]))}for(o=0;o>>8);s.push(255&a[o].byteLength);s=s.concat(Array.prototype.slice.call(a[o]))}l=[I.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),r(I.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([t.length],n,[a.length],s))),r(I.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))];if(e.sarRatio){var d=e.sarRatio[0],p=e.sarRatio[1];l.push(r(I.pasp,new Uint8Array([(4278190080&d)>>24,(16711680&d)>>16,(65280&d)>>8,255&d,(4278190080&p)>>24,(16711680&p)>>16,(65280&p)>>8,255&p])))}return r.apply(null,l)};t=function(e){return r(I.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),s(e))}})();h=function(e){var t=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return r(I.tkhd,t)};k=function(e){var t,a,i,s,o,l,d;t=r(I.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0]));l=Math.floor(e.baseMediaDecodeTime/(n+1));d=Math.floor(e.baseMediaDecodeTime%(n+1));a=r(I.tfdt,new Uint8Array([1,0,0,0,255&l>>>24,255&l>>>16,255&l>>>8,255&l,255&d>>>24,255&d>>>16,255&d>>>8,255&d]));o=92;if("audio"===e.type){i=E(e,o);return r(I.traf,t,a,i)}s=b(e);i=E(e,s.length+o);return r(I.traf,t,a,i,s)};y=function(e){e.duration=e.duration||4294967295;return r(I.trak,h(e),_(e))};C=function(e){var t=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);if("video"!==e.type){t[t.length-1]=0}return r(I.trex,t)};(function(){var e,t,a;a=function(e,t){var a=0,n=0,r=0,i=0;if(e.length){if(e[0].duration!==void 0){a=1}if(e[0].size!==void 0){n=2}if(e[0].flags!==void 0){r=4}if(e[0].compositionTimeOffset!==void 0){i=8}}return[0,0,a|n|r|i,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]};t=function(e,t){var n,s,o,l;s=e.samples||[];t+=20+16*s.length;n=a(s,t);for(l=0;l>>24,(16711680&o.duration)>>>16,(65280&o.duration)>>>8,255&o.duration,(4278190080&o.size)>>>24,(16711680&o.size)>>>16,(65280&o.size)>>>8,255&o.size,o.flags.isLeading<<2|o.flags.dependsOn,o.flags.isDependedOn<<6|o.flags.hasRedundancy<<4|o.flags.paddingValue<<1|o.flags.isNonSyncSample,o.flags.degradationPriority&61440,15&o.flags.degradationPriority,(4278190080&o.compositionTimeOffset)>>>24,(16711680&o.compositionTimeOffset)>>>16,(65280&o.compositionTimeOffset)>>>8,255&o.compositionTimeOffset])}return r(I.trun,new Uint8Array(n))};e=function(e,t){var n,s,o,l;s=e.samples||[];t+=20+8*s.length;n=a(s,t);for(l=0;l>>24,(16711680&o.duration)>>>16,(65280&o.duration)>>>8,255&o.duration,(4278190080&o.size)>>>24,(16711680&o.size)>>>16,(65280&o.size)>>>8,255&o.size])}return r(I.trun,new Uint8Array(n))};E=function(a,n){if("audio"===a.type){return e(a,n)}return t(a,n)}})();var F={ftyp:o,mdat:l,moof:u,moov:c,initSegment:function(e){var t=o(),a=c(e),n;n=new Uint8Array(t.byteLength+a.byteLength);n.set(t);n.set(a,t.byteLength);return n}},H=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},q=function(e,t){var a=H();a.dataOffset=t;a.compositionTimeOffset=e.pts-e.dts;a.duration=e.duration;a.size=4*e.length;a.size+=e.byteLength;if(e.keyFrame){a.flags.dependsOn=2;a.flags.isNonSyncSample=0}return a},V={groupNalsIntoFrames:function(e){var t,a,n=[],r=[];r.byteLength=0;r.nalCount=0;r.duration=0;n.byteLength=0;for(t=0;t=n.duration)){n.duration=r[r.length-1].duration}r.byteLength+=n.byteLength;r.nalCount+=n.length;r.duration+=n.duration;r.push(n);return r},groupFramesIntoGops:function(e){var t,a,n=[],r=[];n.byteLength=0;n.nalCount=0;n.duration=0;n.pts=e[0].pts;n.dts=e[0].dts;r.byteLength=0;r.nalCount=0;r.duration=0;r.pts=e[0].pts;r.dts=e[0].dts;for(t=0;t=n.duration){n.duration=r[r.length-1].duration}r.byteLength+=n.byteLength;r.nalCount+=n.nalCount;r.duration+=n.duration;r.push(n);return r},extendFirstKeyFrame:function(e){var t;if(!e[0][0].keyFrame&&1l||d>ne.ONE_SECOND_IN_TS/2){return}p=Y[e.samplerate];if(!p){p=t[0].data}for(u=0;u=a){return e}t.minSegmentDts=1/0;return e.filter(function(e){if(e.dts>=a){t.minSegmentDts=Math.min(t.minSegmentDts,e.dts);t.minSegmentPts=t.minSegmentDts;return!0}return!1})},generateSampleTable:function(e){var t,a,n=[];for(t=0;te.type){this.dispatchCea608Packet(e)}},this);this.captionPackets_.length=0;this.flushCCStreams(e)};pe.prototype.flush=function(){return this.flushStream("flush")};pe.prototype.partialFlush=function(){return this.flushStream("partialFlush")};pe.prototype.reset=function(){this.latestDts_=null;this.ignoreNextEqualDts_=!1;this.numSameDts_=0;this.activeCea608Channel_=[null,null];this.ccStreams_.forEach(function(e){e.reset()})};pe.prototype.dispatchCea608Packet=function(e){if(this.setsTextOrXDSActive(e)){this.activeCea608Channel_[e.type]=null}else if(this.setsChannel1Active(e)){this.activeCea608Channel_[e.type]=0}else if(this.setsChannel2Active(e)){this.activeCea608Channel_[e.type]=1}if(null===this.activeCea608Channel_[e.type]){return}this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)};pe.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)};pe.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)};pe.prototype.setsTextOrXDSActive=function(e){return 256==(28928&e.ccData)||4138==(30974&e.ccData)||6186==(30974&e.ccData)};var ue={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},ce=function(e){if(null===e){return""}e=ue[e]||e;return String.fromCharCode(e)},me=14,ge=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],ye=function(){var e=[],t=me+1;while(t--){e.push("")}return e},he=function e(t,a){e.prototype.init.call(this);this.field_=t||0;this.dataChannel_=a||0;this.name_="CC"+((this.field_<<1|this.dataChannel_)+1);this.setConstants();this.reset();this.push=function(e){var t,a,n,r,i;t=32639&e.ccData;if(t===this.lastControlCode_){this.lastControlCode_=null;return}if(4096==(61440&t)){this.lastControlCode_=t}else if(t!==this.PADDING_){this.lastControlCode_=null}n=t>>>8;r=255&t;if(t===this.PADDING_){}else if(t===this.RESUME_CAPTION_LOADING_){this.mode_="popOn"}else if(t===this.END_OF_CAPTION_){this.mode_="popOn";this.clearFormatting(e.pts);this.flushDisplayed(e.pts);a=this.displayed_;this.displayed_=this.nonDisplayed_;this.nonDisplayed_=a;this.startPts_=e.pts}else if(t===this.ROLL_UP_2_ROWS_){this.rollUpRows_=2;this.setRollUp(e.pts)}else if(t===this.ROLL_UP_3_ROWS_){this.rollUpRows_=3;this.setRollUp(e.pts)}else if(t===this.ROLL_UP_4_ROWS_){this.rollUpRows_=4;this.setRollUp(e.pts)}else if(t===this.CARRIAGE_RETURN_){this.clearFormatting(e.pts);this.flushDisplayed(e.pts);this.shiftRowsUp_();this.startPts_=e.pts}else if(t===this.BACKSPACE_){if("popOn"===this.mode_){this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1)}else{this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1)}}else if(t===this.ERASE_DISPLAYED_MEMORY_){this.flushDisplayed(e.pts);this.displayed_=ye()}else if(t===this.ERASE_NON_DISPLAYED_MEMORY_){this.nonDisplayed_=ye()}else if(t===this.RESUME_DIRECT_CAPTIONING_){if("paintOn"!==this.mode_){this.flushDisplayed(e.pts);this.displayed_=ye()}this.mode_="paintOn";this.startPts_=e.pts}else if(this.isSpecialCharacter(n,r)){n=(3&n)<<8;i=ce(n|r);this[this.mode_](e.pts,i);this.column_++}else if(this.isExtCharacter(n,r)){if("popOn"===this.mode_){this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1)}else{this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1)}n=(3&n)<<8;i=ce(n|r);this[this.mode_](e.pts,i);this.column_++}else if(this.isMidRowCode(n,r)){this.clearFormatting(e.pts);this[this.mode_](e.pts," ");this.column_++;if(14==(14&r)){this.addFormatting(e.pts,["i"])}if(1==(1&r)){this.addFormatting(e.pts,["u"])}}else if(this.isOffsetControlCode(n,r)){this.column_+=3&r}else if(this.isPAC(n,r)){var s=ge.indexOf(7968&t);if("rollUp"===this.mode_){if(0>s-this.rollUpRows_+1){s=this.rollUpRows_-1}this.setRollUp(e.pts,s)}if(s!==this.row_){this.clearFormatting(e.pts);this.row_=s}if(1&r&&-1===this.formatting_.indexOf("u")){this.addFormatting(e.pts,["u"])}if(16==(16&t)){this.column_=4*((14&t)>>1)}if(this.isColorPAC(r)){if(14==(14&r)){this.addFormatting(e.pts,["i"])}}}else if(this.isNormalChar(n)){if(0===r){r=null}i=ce(n);i+=ce(r);this[this.mode_](e.pts,i);this.column_+=i.length}}};he.prototype=new a;he.prototype.flushDisplayed=function(e){var t=this.displayed_.map(function(e){try{return e.trim()}catch(t){console.error("Skipping malformed caption.");return""}}).join("\n").replace(/^\n+|\n+$/g,"");if(t.length){this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})}};he.prototype.reset=function(){this.mode_="popOn";this.topRow_=0;this.startPts_=0;this.displayed_=ye();this.nonDisplayed_=ye();this.lastControlCode_=null;this.column_=0;this.row_=me;this.rollUpRows_=2;this.formatting_=[]};he.prototype.setConstants=function(){if(0===this.dataChannel_){this.BASE_=16;this.EXT_=17;this.CONTROL_=(20|this.field_)<<8;this.OFFSET_=23}else if(1===this.dataChannel_){this.BASE_=24;this.EXT_=25;this.CONTROL_=(28|this.field_)<<8;this.OFFSET_=31}this.PADDING_=0;this.RESUME_CAPTION_LOADING_=32|this.CONTROL_;this.END_OF_CAPTION_=47|this.CONTROL_;this.ROLL_UP_2_ROWS_=37|this.CONTROL_;this.ROLL_UP_3_ROWS_=38|this.CONTROL_;this.ROLL_UP_4_ROWS_=39|this.CONTROL_;this.CARRIAGE_RETURN_=45|this.CONTROL_;this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_;this.BACKSPACE_=33|this.CONTROL_;this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_;this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_};he.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&48<=t&&63>=t};he.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&32<=t&&63>=t};he.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&32<=t&&47>=t};he.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&33<=t&&35>=t};he.prototype.isPAC=function(e,t){return e>=this.BASE_&&e=t};he.prototype.isColorPAC=function(e){return 64<=e&&79>=e||96<=e&&127>=e};he.prototype.isNormalChar=function(e){return 32<=e&&127>=e};he.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_){this.row_=me;this.mode_="rollUp";this.flushDisplayed(e);this.nonDisplayed_=ye();this.displayed_=ye()}if(t!==void 0&&t!==this.row_){for(var a=0;a"},"");this[this.mode_](e,a)};he.prototype.clearFormatting=function(e){if(!this.formatting_.length){return}var t=this.formatting_.reverse().reduce(function(e,t){return e+""},"");this.formatting_=[];this[this.mode_](e,t)};he.prototype.popOn=function(e,t){var a=this.nonDisplayed_[this.row_];a+=t;this.nonDisplayed_[this.row_]=a};he.prototype.rollUp=function(e,t){var a=this.displayed_[this.row_];a+=t;this.displayed_[this.row_]=a};he.prototype.shiftRowsUp_=function(){var e;for(e=0;et){a=-1}while(Math.abs(t-e)>4294967296){e+=a*8589934592}return e},ve=function e(t){var a,n;e.prototype.init.call(this);this.type_=t||Te;this.push=function(e){if(this.type_!==Te&&e.type!==this.type_){return}if(n===void 0){n=e.dts}e.dts=be(e.dts,n);e.pts=be(e.pts,n);a=e.dts;this.trigger("data",e)};this.flush=function(){n=a;this.trigger("done")};this.endTimeline=function(){this.flush();this.trigger("endedtimeline")};this.discontinuity=function(){n=void 0;a=void 0};this.reset=function(){this.discontinuity();this.trigger("reset")}};ve.prototype=new a;var Se=function(e,t,a){var n,r="";for(n=t;ne.data.length||e.data[0]!==73||e.data[1]!==68||e.data[2]!==51)){if(t.debug){console.log("Skipping unrecognized metadata packet")}return}n.push(e);r+=e.data.byteLength;if(1===n.length){a=Ee(e.data.subarray(6,10));a+=10}if(rl){return console.log("Malformed ID3 frame encountered. Skipping metadata parsing.")}c=String.fromCharCode(s.data[o],s.data[o+1],s.data[o+2],s.data[o+3]);p={id:c,data:s.data.subarray(o+10,o+l+10)};p.key=p.id;if(Ie[p.id]){Ie[p.id](p);if("com.apple.streaming.transportStreamTimestamp"===p.owner){var m=p.data,d=(1&m[3])<<30|m[4]<<22|m[5]<<14|m[6]<<6|m[7]>>>2;d*=4;d+=3&m[7];p.timeStamp=d;if(s.pts===void 0&&s.dts===void 0){s.pts=p.timeStamp;s.dts=p.timeStamp}this.trigger("timestamp",p)}}s.frames.push(p);o+=10;o+=l}while(o>>4){n+=t[n]+1}if(0===a.pid){a.type="pat";e(t.subarray(n),a);this.trigger("data",a)}else if(a.pid===this.pmtPid){a.type="pmt";e(t.subarray(n),a);this.trigger("data",a);while(this.packetsWaitingForPmt.length){this.processPes_.apply(this,this.packetsWaitingForPmt.shift())}}else if(this.programMapTable===void 0){this.packetsWaitingForPmt.push([t,n,a])}else{this.processPes_(t,n,a)}};this.processPes_=function(e,t,a){if(a.pid===this.programMapTable.video){a.streamType=fe.H264_STREAM_TYPE}else if(a.pid===this.programMapTable.audio){a.streamType=fe.ADTS_STREAM_TYPE}else{a.streamType=this.programMapTable["timed-metadata"][a.pid]}a.type="pes";a.data=e.subarray(t);this.trigger("data",a)}};we.prototype=new a;we.STREAM_TYPES={h264:27,adts:15};Ae=function(){var e=this,t={data:[],size:0},a={data:[],size:0},n={data:[],size:0},r,s=function(e,t){var a;t.packetLength=6+(e[4]<<8|e[5]);t.dataAlignmentIndicator=0!=(4&e[6]);a=e[7];if(192&a){t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3;t.pts*=4;t.pts+=(6&e[13])>>>1;t.dts=t.pts;if(64&a){t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3;t.dts*=4;t.dts+=(6&e[18])>>>1}}t.data=e.subarray(9+e[8])},o=function(t,a,n){var r=new Uint8Array(t.size),o={type:a},l=0,d=0,p=!1,u;if(!t.data.length||9>t.size){return}o.trackId=t.data[0].pid;for(l=0;l>5;p=1024*((3&t[r+6])+1);u=p*Be/Fe[(60&t[r+2])>>>2];l=r+s;if(t.byteLength>>6)+1,channelcount:(1&t[r+2])<<2|(192&t[r+3])>>>6,samplerate:Fe[(60&t[r+2])>>>2],samplingfrequencyindex:(60&t[r+2])>>>2,samplesize:16,data:t.subarray(r+7+o,l)});a++;if(t.byteLength===l){t=void 0;return}t=t.subarray(l)}};this.flush=function(){a=0;this.trigger("done")};this.reset=function(){t=void 0;this.trigger("reset")};this.endTimeline=function(){t=void 0;this.trigger("endedtimeline")}};je.prototype=new a;var He=je,qe;qe=function(e){var t=e.byteLength,a=0,n=0;this.length=function(){return 8*t};this.bitsAvailable=function(){return 8*t+n};this.loadWord=function(){var r=e.byteLength-t,i=new Uint8Array(4),s=Math.min(4,t);if(0===s){throw new Error("no bytes available")}i.set(e.subarray(r,r+s));a=new DataView(i.buffer).getUint32(0);n=8*s;t-=s};this.skipBits=function(e){var r;if(n>e){a<<=e;n-=e}else{e-=n;r=Math.floor(e/8);e-=8*r;t-=r;this.loadWord();a<<=e;n-=e}};this.readBits=function(e){var r=Math.min(n,e),i=a>>>32-r;n-=r;if(0>>e)){a<<=e;n-=e;return e}}this.loadWord();return e+this.skipLeadingZeros()};this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())};this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())};this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1};this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();if(1&e){return 1+e>>>1}return-1*(e>>>1)};this.readBoolean=function(){return 1===this.readBits(1)};this.readUnsignedByte=function(){return this.readBits(8)};this.loadWord()};var Ve=qe,We,ze,Ge;ze=function(){var e=0,t,a;ze.prototype.init.call(this);this.push=function(n){var r;if(!a){a=n.data}else{r=new Uint8Array(a.byteLength+n.data.byteLength);r.set(a);r.set(n.data,a.byteLength);a=r}var i=a.byteLength;for(;ev){o(16,l)}else{o(64,l)}}}}}l.skipUnsignedExpGolomb();m=l.readUnsignedExpGolomb();if(0===m){l.readUnsignedExpGolomb()}else if(1===m){l.skipBits(1);l.skipExpGolomb();l.skipExpGolomb();g=l.readUnsignedExpGolomb();for(v=0;v>4){return a+20}return a+10},parseAdtsSize:function(e,t){var a=(224&e[t+5])>>5,n=e[t+4]<<3,r=e[t+3]&6144;return r|n|a},parseType:function(e,t){if(e[t]===73&&e[t+1]===68&&e[t+2]===51){return"timed-metadata"}else if(e[t]&!0&&240==(240&e[t+1])){return"audio"}return null},parseSampleRate:function(e){var t=0;while(t+5>>2]}return null},parseAacTimestamp:function(e){var t,a,n,r;t=10;if(64&e[5]){t+=4;t+=Xe(e.subarray(10,14))}do{a=Xe(e.subarray(t+4,t+8));if(1>a){return null}r=String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3]);if("PRIV"===r){n=e.subarray(t+10,t+a+10);for(var s=0;s>>2;d*=4;d+=3&l[7];return d}break}}}t+=10;t+=a}while(te.length-r){break}n=Je.parseId3TagSize(e,r);if(r+n>e.length){break}s={type:"timed-metadata",data:e.subarray(r,r+n)};this.trigger("data",s);r+=n;continue}else if(255==(255&e[r])&&240==(240&e[r+1])){if(7>e.length-r){break}n=Je.parseAdtsSize(e,r);if(r+n>e.length){break}o={type:"audio",data:e.subarray(r,r+n),pts:t,dts:t};this.trigger("data",o);r+=n;continue}r++}i=e.length-r;if(0=-10000&&n<=45000){if(!r||a>n){r=o;a=n}}}if(r){return r.gop}return null};this.alignGopsAtStart_=function(e){var t,a,n,i,s,o,l,d;s=e.byteLength;o=e.nalCount;l=e.duration;t=a=0;while(tn.pts){t++;continue}a++;s-=i.byteLength;o-=i.nalCount;l-=i.duration}if(0===a){return e}if(a===e.length){return null}d=e.slice(a);d.byteLength=s;d.duration=l;d.nalCount=o;d.pts=d[0].pts;d.dts=d[0].dts;return d};this.alignGopsAtEnd_=function(e){var t,a,n,i,s,o;t=r.length-1;a=e.length-1;s=null;o=!1;while(0<=t&&0<=a){n=r[t];i=e[a];if(n.pts===i.pts){o=!0;break}if(n.pts>i.pts){t--;continue}if(t===r.length-1){s=a}a--}if(!o&&null===s){return null}var l;if(o){l=a}else{l=s}if(0===l){return e}var d=e.slice(l),p=d.reduce(function(e,t){e.byteLength+=t.byteLength;e.duration+=t.duration;e.nalCount+=t.nalCount;return e},{byteLength:0,duration:0,nalCount:0});d.byteLength=p.byteLength;d.duration=p.duration;d.nalCount=p.nalCount;d.pts=d[0].pts;d.dts=d[0].dts;return d};this.alignGopsWith=function(e){r=e}};st.prototype=new a;dt=function(e,t){this.numberOfTracks=0;this.metadataStream=t;e=e||{};if("undefined"!=typeof e.remux){this.remuxTracks=!!e.remux}else{this.remuxTracks=!0}if("boolean"==typeof e.keepOriginalTimestamps){this.keepOriginalTimestamps=e.keepOriginalTimestamps}else{this.keepOriginalTimestamps=!1}this.pendingTracks=[];this.videoTrack=null;this.pendingBoxes=[];this.pendingCaptions=[];this.pendingMetadata=[];this.pendingBytes=0;this.emittedTracks=0;dt.prototype.init.call(this);this.push=function(e){if(e.text){return this.pendingCaptions.push(e)}if(e.frames){return this.pendingMetadata.push(e)}this.pendingTracks.push(e.track);this.pendingBytes+=e.boxes.byteLength;if("video"===e.track.type){this.videoTrack=e.track;this.pendingBoxes.push(e.boxes)}if("audio"===e.track.type){this.audioTrack=e.track;this.pendingBoxes.unshift(e.boxes)}}};dt.prototype=new a;dt.prototype.flush=function(e){var t=0,a={captions:[],captionStreams:{},metadata:[],info:{}},n,r,s,o=0,l;if(this.pendingTracks.length=this.numberOfTracks){this.trigger("done");this.emittedTracks=0}return}}if(this.videoTrack){o=this.videoTrack.timelineStartInfo.pts;it.forEach(function(e){a.info[e]=this.videoTrack[e]},this)}else if(this.audioTrack){o=this.audioTrack.timelineStartInfo.pts;rt.forEach(function(e){a.info[e]=this.audioTrack[e]},this)}if(this.videoTrack||this.audioTrack){if(1===this.pendingTracks.length){a.type=this.pendingTracks[0].type}else{a.type="combined"}this.emittedTracks+=this.pendingTracks.length;s=F.initSegment(this.pendingTracks);a.initSegment=new Uint8Array(s.byteLength);a.initSegment.set(s);a.data=new Uint8Array(this.pendingBytes);for(l=0;l=this.numberOfTracks){this.trigger("done");this.emittedTracks=0}};dt.prototype.setRemux=function(e){this.remuxTracks=e};lt=function(e){var t=this,a=!0,n,r;lt.prototype.init.call(this);e=e||{};this.baseMediaDecodeTime=e.baseMediaDecodeTime||0;this.transmuxPipeline_={};this.setupAacPipeline=function(){var a={};this.transmuxPipeline_=a;a.type="aac";a.metadataStream=new Me.MetadataStream;a.aacStream=new et;a.audioTimestampRolloverStream=new Me.TimestampRolloverStream("audio");a.timedMetadataTimestampRolloverStream=new Me.TimestampRolloverStream("timed-metadata");a.adtsStream=new He;a.coalesceStream=new dt(e,a.metadataStream);a.headOfPipeline=a.aacStream;a.aacStream.pipe(a.audioTimestampRolloverStream).pipe(a.adtsStream);a.aacStream.pipe(a.timedMetadataTimestampRolloverStream).pipe(a.metadataStream).pipe(a.coalesceStream);a.metadataStream.on("timestamp",function(e){a.aacStream.setTimestamp(e.timeStamp)});a.aacStream.on("data",function(i){if("timed-metadata"===i.type&&!a.audioSegmentStream){r=r||{timelineStartInfo:{baseMediaDecodeTime:t.baseMediaDecodeTime},codec:"adts",type:"audio"};a.coalesceStream.numberOfTracks++;a.audioSegmentStream=new ot(r,e);a.audioSegmentStream.on("timingInfo",t.trigger.bind(t,"audioTimingInfo"));a.adtsStream.pipe(a.audioSegmentStream).pipe(a.coalesceStream)}t.trigger("trackinfo",{hasAudio:!!r,hasVideo:!!n})});a.coalesceStream.on("data",this.trigger.bind(this,"data"));a.coalesceStream.on("done",this.trigger.bind(this,"done"))};this.setupTsPipeline=function(){var a={};this.transmuxPipeline_=a;a.type="ts";a.metadataStream=new Me.MetadataStream;a.packetStream=new Me.TransportPacketStream;a.parseStream=new Me.TransportParseStream;a.elementaryStream=new Me.ElementaryStream;a.timestampRolloverStream=new Me.TimestampRolloverStream;a.adtsStream=new He;a.h264Stream=new tt;a.captionStream=new Me.CaptionStream;a.coalesceStream=new dt(e,a.metadataStream);a.headOfPipeline=a.packetStream;a.packetStream.pipe(a.parseStream).pipe(a.elementaryStream).pipe(a.timestampRolloverStream);a.timestampRolloverStream.pipe(a.h264Stream);a.timestampRolloverStream.pipe(a.adtsStream);a.timestampRolloverStream.pipe(a.metadataStream).pipe(a.coalesceStream);a.h264Stream.pipe(a.captionStream).pipe(a.coalesceStream);a.elementaryStream.on("data",function(s){var o;if("metadata"===s.type){o=s.tracks.length;while(o--){if(!n&&"video"===s.tracks[o].type){n=s.tracks[o];n.timelineStartInfo.baseMediaDecodeTime=t.baseMediaDecodeTime}else if(!r&&"audio"===s.tracks[o].type){r=s.tracks[o];r.timelineStartInfo.baseMediaDecodeTime=t.baseMediaDecodeTime}}if(n&&!a.videoSegmentStream){a.coalesceStream.numberOfTracks++;a.videoSegmentStream=new st(n,e);a.videoSegmentStream.on("timelineStartInfo",function(e){if(r){r.timelineStartInfo=e;a.audioSegmentStream.setEarliestDts(e.dts)}});a.videoSegmentStream.on("processedGopsInfo",t.trigger.bind(t,"gopInfo"));a.videoSegmentStream.on("segmentTimingInfo",t.trigger.bind(t,"videoSegmentTimingInfo"));a.videoSegmentStream.on("baseMediaDecodeTime",function(e){if(r){a.audioSegmentStream.setVideoBaseMediaDecodeTime(e)}});a.videoSegmentStream.on("timingInfo",t.trigger.bind(t,"videoTimingInfo"));a.h264Stream.pipe(a.videoSegmentStream).pipe(a.coalesceStream)}if(r&&!a.audioSegmentStream){a.coalesceStream.numberOfTracks++;a.audioSegmentStream=new ot(r,e);a.audioSegmentStream.on("timingInfo",t.trigger.bind(t,"audioTimingInfo"));a.adtsStream.pipe(a.audioSegmentStream).pipe(a.coalesceStream)}t.trigger("trackinfo",{hasAudio:!!r,hasVideo:!!n})}});a.coalesceStream.on("data",this.trigger.bind(this,"data"));a.coalesceStream.on("id3Frame",function(e){e.dispatchType=a.metadataStream.dispatchType;t.trigger("id3Frame",e)});a.coalesceStream.on("caption",this.trigger.bind(this,"caption"));a.coalesceStream.on("done",this.trigger.bind(this,"done"))};this.setBaseMediaDecodeTime=function(t){var a=this.transmuxPipeline_;if(!e.keepOriginalTimestamps){this.baseMediaDecodeTime=t}if(r){r.timelineStartInfo.dts=void 0;r.timelineStartInfo.pts=void 0;oe.clearDtsInfo(r);if(!e.keepOriginalTimestamps){r.timelineStartInfo.baseMediaDecodeTime=t}if(a.audioTimestampRolloverStream){a.audioTimestampRolloverStream.discontinuity()}}if(n){if(a.videoSegmentStream){a.videoSegmentStream.gopCache_=[]}n.timelineStartInfo.dts=void 0;n.timelineStartInfo.pts=void 0;oe.clearDtsInfo(n);a.captionStream.reset();if(!e.keepOriginalTimestamps){n.timelineStartInfo.baseMediaDecodeTime=t}}if(a.timestampRolloverStream){a.timestampRolloverStream.discontinuity()}};this.setAudioAppendStart=function(e){if(r){this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)}};this.setRemux=function(t){var a=this.transmuxPipeline_;e.remux=t;if(a&&a.coalesceStream){a.coalesceStream.setRemux(t)}};this.alignGopsWith=function(e){if(n&&this.transmuxPipeline_.videoSegmentStream){this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)}};this.push=function(e){if(a){var t=at(e);if(t&&"aac"!==this.transmuxPipeline_.type){this.setupAacPipeline()}else if(!t&&"ts"!==this.transmuxPipeline_.type){this.setupTsPipeline()}a=!1}this.transmuxPipeline_.headOfPipeline.push(e)};this.flush=function(){a=!0;this.transmuxPipeline_.headOfPipeline.flush()};this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()};this.reset=function(){if(this.transmuxPipeline_.headOfPipeline){this.transmuxPipeline_.headOfPipeline.reset()}};this.resetCaptions=function(){if(this.transmuxPipeline_.captionStream){this.transmuxPipeline_.captionStream.reset()}}};lt.prototype=new a;var ct={Transmuxer:lt,VideoSegmentStream:st,AudioSegmentStream:ot,AUDIO_PROPERTIES:rt,VIDEO_PROPERTIES:it,generateVideoSegmentTimingInfo:ut},mt=function(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}},gt=function(){function e(e,t){for(var a=0,n;an){break}}return e.slice(r)},Oc=function(e,t,a){if(!t.length){return e}if(a){return t.slice()}var n=t[0].pts,r=0;for(r;r=n){break}}return e.slice(0,r).concat(t)},Rc=function(e,t,a,n){var r=Math.ceil(9e4*(t-n)),s=Math.ceil(9e4*(a-n)),o=e.slice(),l=e.length;while(l--){if(e[l].pts<=s){break}}if(-1===l){return o}var d=l+1;while(d--){if(e[d].pts<=r){break}}d=Math.max(d,0);o.splice(d,l-d+1);return o},Nc=function(e,t,a){var n=null,r=null,i=0,s=[],o=[];if(!e&&!t){return Ze.createTimeRange()}if(!e){return t.buffered}if(!t){return e.buffered}if(a){return e.buffered}if(0===e.buffered.length&&0===t.buffered.length){return Ze.createTimeRange()}var l=e.buffered,d=t.buffered,p=l.length;while(p--){s.push({time:l.start(p),type:"start"});s.push({time:l.end(p),type:"end"})}p=d.length;while(p--){s.push({time:d.start(p),type:"start"});s.push({time:d.end(p),type:"end"})}s.sort(function(e,t){return e.time-t.time});for(p=0;pthis.nativeMediaSource_.duration||isNaN(this.nativeMediaSource_.duration)){this.nativeMediaSource_.duration=t}}},{key:"addSourceBuffer",value:function(e){var t=void 0,a=Pc(e);if(/^(video|audio)\/mp2t$/i.test(a.type)){var n=[];if(a.parameters&&a.parameters.codecs){n=a.parameters.codecs.split(",");n=vc(n);n=n.filter(function(e){return Dc(e)||wc(e)})}if(0===n.length){n=["avc1.4d400d","mp4a.40.2"]}t=new Bc(this,n);if(0!==this.sourceBuffers.length){this.sourceBuffers[0].createRealSourceBuffers_();t.createRealSourceBuffers_();this.sourceBuffers[0].audioDisabled_=!0}}else{t=this.nativeMediaSource_.addSourceBuffer(e)}this.sourceBuffers.push(t);return t}},{key:"dispose",value:function(){this.trigger("dispose");this.off();this.sourceBuffers.forEach(function(e){if(e.dispose){e.dispose()}});this.sourceBuffers.length=0}}]);return n}(Ze.EventTarget),Fc=0;Ze.mediaSources={};var Hc=function(e,t){var a=Ze.mediaSources[e];if(a){a.trigger({type:"sourceopen",swfId:t})}else{throw new Error("Media Source not found (Video.js)")}},qc=function(){return!!e.MediaSource&&!!e.MediaSource.isTypeSupported&&e.MediaSource.isTypeSupported("video/mp4;codecs=\"avc1.4d400d,mp4a.40.2\"")},Vc=function(){this.MediaSource={open:Hc,supportsNativeMediaSources:qc};if(qc()){return new jc}throw new Error("Cannot use create a virtual MediaSource for this video")};Vc.open=Hc;Vc.supportsNativeMediaSources=qc;var Wc={createObjectURL:function(t){var a=void 0;if(t instanceof jc){a=e.URL.createObjectURL(t.nativeMediaSource_);t.url_=a;return a}if(!(t instanceof jc)){a=e.URL.createObjectURL(t);t.url_=a;return a}a="blob:vjs-media-source/"+Fc;Fc++;Ze.mediaSources[a]=t;return a}};Ze.MediaSource=Vc;Ze.URL=Wc;var zc=Ze.EventTarget,Gc=Ze.mergeOptions,Kc=function(e,t){for(var a=void 0,n=Gc(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod}),r=0,s;r")}return function(){}};function pa(){}var tm=function(){function e(t,a,n,r){Vp(this,e);this.callbacks_=[];this.pendingCallback_=null;this.timestampOffset_=0;this.mediaSource=t;this.processedAppend_=!1;this.type_=n;this.mimeType_=a;this.logger_=em("SourceUpdater["+n+"]["+a+"]");if("closed"===t.readyState){t.addEventListener("sourceopen",this.createSourceBuffer_.bind(this,a,r))}else{this.createSourceBuffer_(a,r)}}Wp(e,[{key:"createSourceBuffer_",value:function(e,t){var a=this;this.sourceBuffer_=this.mediaSource.addSourceBuffer(e);this.logger_("created SourceBuffer");if(t){t.trigger("sourcebufferadded");if(2>this.mediaSource.sourceBuffers.length){t.on("sourcebufferadded",function(){a.start_()});return}}this.start_()}},{key:"start_",value:function(){var e=this;this.started_=!0;this.onUpdateendCallback_=function(){var t=e.pendingCallback_;e.pendingCallback_=null;e.sourceBuffer_.removing=!1;e.logger_("buffered ["+nc(e.buffered())+"]");if(t){t()}e.runCallback_()};this.sourceBuffer_.addEventListener("updateend",this.onUpdateendCallback_);this.runCallback_()}},{key:"abort",value:function(e){var t=this;if(this.processedAppend_){this.queueCallback_(function(){t.sourceBuffer_.abort()},e)}}},{key:"appendBuffer",value:function(e,t){var a=this;this.processedAppend_=!0;this.queueCallback_(function(){if(e.videoSegmentTimingInfoCallback){a.sourceBuffer_.addEventListener("videoSegmentTimingInfo",e.videoSegmentTimingInfoCallback)}a.sourceBuffer_.appendBuffer(e.bytes)},function(){if(e.videoSegmentTimingInfoCallback){a.sourceBuffer_.removeEventListener("videoSegmentTimingInfo",e.videoSegmentTimingInfoCallback)}t()})}},{key:"buffered",value:function(){if(!this.sourceBuffer_){return Ze.createTimeRanges()}return this.sourceBuffer_.buffered}},{key:"remove",value:function(e,t){var a=this,n=2 "+t+"]");a.sourceBuffer_.removing=!0;a.sourceBuffer_.remove(e,t)},n)}}},{key:"updating",value:function(){return!this.sourceBuffer_||this.sourceBuffer_.updating||!!this.pendingCallback_&&this.pendingCallback_!==pa}},{key:"timestampOffset",value:function(e){var t=this;if("undefined"!=typeof e){this.queueCallback_(function(){t.sourceBuffer_.timestampOffset=e;t.runCallback_()});this.timestampOffset_=e}return this.timestampOffset_}},{key:"queueCallback_",value:function(e,t){this.callbacks_.push([e.bind(this),t]);this.runCallback_()}},{key:"runCallback_",value:function(){var e;if(!this.updating()&&this.callbacks_.length&&this.started_){e=this.callbacks_.shift();this.pendingCallback_=e[1];e[0]()}}},{key:"dispose",value:function(){var e=this,t=function t(){if(e.sourceBuffer_&&"open"===e.mediaSource.readyState){e.sourceBuffer_.abort()}e.sourceBuffer_.removeEventListener("updateend",t)};this.sourceBuffer_.removeEventListener("updateend",this.onUpdateendCallback_);if(this.sourceBuffer_.removing){this.sourceBuffer_.addEventListener("updateend",t)}else{t()}}}]);return e}(),am={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,BUFFER_LOW_WATER_LINE_RATE:1},nm={FAILURE:2,TIMEOUT:-101,ABORTED:-102},rm=function(e){e.forEach(function(e){e.abort()})},im=function(e){return{bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}},sm=function(e){var t=e.target,a=Date.now()-t.requestTime,n={bandwidth:1/0,bytesReceived:0,roundTripTime:a||0};n.bytesReceived=e.loaded;n.bandwidth=Math.floor(1e3*(8*(n.bytesReceived/n.roundTripTime)));return n},om=function(e,t){if(t.timedout){return{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:nm.TIMEOUT,xhr:t}}if(t.aborted){return{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:nm.ABORTED,xhr:t}}if(e){return{status:t.status,message:"HLS request errored at URL: "+t.uri,code:nm.FAILURE,xhr:t}}return null},lm=function(e,t){return function(a,n){var r=n.response,i=om(a,n);if(i){return t(i,e)}if(16!==r.byteLength){return t({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:nm.FAILURE,xhr:n},e)}var s=new DataView(r);e.key.bytes=new Uint32Array([s.getUint32(0),s.getUint32(4),s.getUint32(8),s.getUint32(12)]);return t(null,e)}},dm=function(e,t,a){return function(n,r){var i=r.response,s=om(n,r);if(s){return a(s,e)}if(0===i.byteLength){return a({status:r.status,message:"Empty HLS segment content at URL: "+r.uri,code:nm.FAILURE,xhr:r},e)}e.map.bytes=new Uint8Array(r.response);if(t&&!t.isInitialized()){t.init()}e.map.timescales=Ed.timescale(e.map.bytes);e.map.videoTrackIds=Ed.videoTrackIds(e.map.bytes);return a(null,e)}},pm=function(e,t,a){return function(n,r){var i=r.response,s=om(n,r),o=void 0;if(s){return a(s,e)}if(0===i.byteLength){return a({status:r.status,message:"Empty HLS segment content at URL: "+r.uri,code:nm.FAILURE,xhr:r},e)}e.stats=im(r);if(e.key){e.encryptedBytes=new Uint8Array(r.response)}else{e.bytes=new Uint8Array(r.response)}if(t&&e.map&&e.map.bytes){if(!t.isInitialized()){t.init()}o=t.parse(e.bytes,e.map.videoTrackIds,e.map.timescales);if(o&&o.captions){e.captionStreams=o.captionStreams;e.fmp4Captions=o.captions}}return a(null,e)}},um=function(e,t,a){e.addEventListener("message",function n(r){if(r.data.source===t.requestId){e.removeEventListener("message",n);var i=r.data.decrypted;t.bytes=new Uint8Array(i.bytes,i.byteOffset,i.byteLength);return a(null,t)}});var n;if(t.key.bytes.slice){n=t.key.bytes.slice()}else{n=new Uint32Array(Array.prototype.slice.call(t.key.bytes))}e.postMessage(Uu({source:t.requestId,encrypted:t.encryptedBytes,key:n,iv:t.key.iv}),[t.encryptedBytes.buffer,n.buffer])},cm=function(e,t,a){var n=0,r=!1;return function(i,s){if(r){return}if(i){r=!0;rm(e);return a(i,s)}n+=1;if(n===e.length){s.endOfAllRequests=Date.now();if(s.encryptedBytes){return um(t,s,a)}return a(null,s)}}},mm=function(e,t){return function(a){e.stats=Ze.mergeOptions(e.stats,sm(a));if(!e.stats.firstBytesReceivedAt&&e.stats.bytesReceived){e.stats.firstBytesReceivedAt=Date.now()}return t(a,e)}},gm=function(e,t,a,n,r,i,s){var o=[],l=cm(o,a,s);if(r.key&&!r.key.bytes){var d=Ze.mergeOptions(t,{uri:r.key.resolvedUri,responseType:"arraybuffer"}),p=lm(r,l),u=e(d,p);o.push(u)}if(r.map&&!r.map.bytes){var c=Ze.mergeOptions(t,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:Au(r.map)}),m=dm(r,n,l),g=e(c,m);o.push(g)}var y=Ze.mergeOptions(t,{uri:r.resolvedUri,responseType:"arraybuffer",headers:Au(r)}),h=pm(r,n,l),_=e(y,h);_.addEventListener("progress",mm(r,i));o.push(_);return function(){return rm(o)}},ym=function(t,a){var n;if(!t){return""}n=e.getComputedStyle(t);if(!n){return""}return n[a]},hm=function(e,t){var a=e.slice();e.sort(function(e,n){var r=t(e,n);if(0===r){return a.indexOf(e)-a.indexOf(n)}return r})},_m=function(t,a){var n=void 0,r=void 0;if(t.attributes.BANDWIDTH){n=t.attributes.BANDWIDTH}n=n||e.Number.MAX_VALUE;if(a.attributes.BANDWIDTH){r=a.attributes.BANDWIDTH}r=r||e.Number.MAX_VALUE;return n-r},fm=function(t,a){var n=void 0,r=void 0;if(t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width){n=t.attributes.RESOLUTION.width}n=n||e.Number.MAX_VALUE;if(a.attributes.RESOLUTION&&a.attributes.RESOLUTION.width){r=a.attributes.RESOLUTION.width}r=r||e.Number.MAX_VALUE;if(n===r&&t.attributes.BANDWIDTH&&a.attributes.BANDWIDTH){return t.attributes.BANDWIDTH-a.attributes.BANDWIDTH}return n-r},Tm=function(t,a,n,r,i){var s=t.playlists.map(function(t){var a=void 0,n=void 0,r=void 0;a=t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width;n=t.attributes.RESOLUTION&&t.attributes.RESOLUTION.height;r=t.attributes.BANDWIDTH;r=r||e.Number.MAX_VALUE;return{bandwidth:r,width:a,height:n,playlist:t}});hm(s,function(e,t){return e.bandwidth-t.bandwidth});s=s.filter(function(e){return!xu.isIncompatible(e.playlist)});var o=s.filter(function(e){return xu.isEnabled(e.playlist)});if(!o.length){o=s.filter(function(e){return!xu.isDisabled(e.playlist)})}var l=o.filter(function(e){return e.bandwidth*am.BANDWIDTH_VARIANCEn||e.height>r});h=y.filter(function(e){return e.width===y[0].width&&e.height===y[0].height});d=h[h.length-1];_=h.filter(function(e){return e.bandwidth===d.bandwidth})[0]}var f=_||g||p||o[0]||s[0];return f?f.playlist:null},bm=function(e){var t=e.master,a=e.currentTime,n=e.bandwidth,r=e.duration,i=e.segmentDuration,s=e.timeUntilRebuffer,o=e.currentTimeline,l=e.syncController,d=t.playlists.filter(function(e){return!xu.isIncompatible(e)}),p=d.filter(xu.isEnabled);if(!p.length){p=d.filter(function(e){return!xu.isDisabled(e)})}var u=p.filter(xu.hasAttribute.bind(null,"BANDWIDTH")),c=u.map(function(e){var t=l.getSyncPoint(e,r,o,a),d=t?1:2,p=xu.estimateSegmentRequestTime(i,n,e);return{playlist:e,rebufferingImpact:p*d-s}}),m=c.filter(function(e){return 0>=e.rebufferingImpact});hm(m,function(e,t){return _m(t.playlist,e.playlist)});if(m.length){return m[0]}hm(c,function(e,t){return e.rebufferingImpact-t.rebufferingImpact});return c[0]||null},vm=function(e,t,a){for(var n in a){if(!e[n]){t.trigger({type:"usage",name:"hls-608"});var r=t.textTracks().getTrackById(n);if(r){e[n]=r}else{e[n]=t.addRemoteTextTrack({kind:"captions",id:n,label:n},!1).track}}}},Sm=function(e){var t=e.inbandTextTracks,a=e.captionArray,n=e.timestampOffset;if(!a){return}var r=window.WebKitDataCue||window.VTTCue;a.forEach(function(e){var a=e.stream,i=e.startTime,s=e.endTime;if(!t[a]){return}i+=n;s+=n;t[a].addCue(new r(i,s,e.text))})},km=function(e,t,a){if(!e||!t){return!1}var n=e.segments,r=a===n.length;return e.endList&&"open"===t.readyState&&r},Cm=function(e){return"number"==typeof e&&isFinite(e)},Em=function(e,t,a){if("main"!==e||!t||!a){return null}if(!a.containsAudio&&!a.containsVideo){return"Neither audio nor video found in segment."}if(t.containsVideo&&!a.containsVideo){return"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest."}if(!t.containsVideo&&a.containsVideo){return"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest."}return null},Im=function(e,t,a){var n=t-30;if(e.length){n=Math.max(n,e.start(0))}return Math.min(t-a,n)},xm=function(e){var t=e.segment,a=t.start,n=t.end,r=e.playlist,i=r.mediaSequence,s=r.id,o=r.segments,l=o===void 0?[]:o,d=e.mediaIndex,p=e.timeline;return["appending ["+d+"] of ["+i+", "+(i+l.length)+"] from playlist ["+s+"]","["+a+" => "+n+"] in timeline ["+p+"]"].join(" ")},Lm=function(t){Gp(a,t);function a(e){Vp(this,a);var t=Kp(this,(a.__proto__||Object.getPrototypeOf(a)).call(this));if(!e){throw new TypeError("Initialization settings are required")}if("function"!=typeof e.currentTime){throw new TypeError("No currentTime getter specified")}if(!e.mediaSource){throw new TypeError("No MediaSource specified")}t.bandwidth=e.bandwidth;t.throughput={rate:0,count:0};t.roundTrip=NaN;t.resetStats_();t.mediaIndex=null;t.hasPlayed_=e.hasPlayed;t.currentTime_=e.currentTime;t.seekable_=e.seekable;t.seeking_=e.seeking;t.duration_=e.duration;t.mediaSource_=e.mediaSource;t.hls_=e.hls;t.loaderType_=e.loaderType;t.startingMedia_=void 0;t.segmentMetadataTrack_=e.segmentMetadataTrack;t.goalBufferLength_=e.goalBufferLength;t.sourceType_=e.sourceType;t.inbandTextTracks_=e.inbandTextTracks;t.state_="INIT";t.checkBufferTimeout_=null;t.error_=void 0;t.currentTimeline_=-1;t.pendingSegment_=null;t.mimeType_=null;t.sourceUpdater_=null;t.xhrOptions_=null;t.activeInitSegmentId_=null;t.initSegments_={};t.cacheEncryptionKeys_=e.cacheEncryptionKeys;t.keyCache_={};if("main"===t.loaderType_){t.captionParser_=new Kd}else{t.captionParser_=null}t.decrypter_=e.decrypter;t.syncController_=e.syncController;t.syncPoint_={segmentIndex:0,time:0};t.triggerSyncInfoUpdate_=function(){return t.trigger("syncinfoupdate")};t.syncController_.on("syncinfoupdate",t.triggerSyncInfoUpdate_);t.mediaSource_.addEventListener("sourceopen",function(){return t.ended_=!1});t.fetchAtBuffer_=!1;t.logger_=em("SegmentLoader["+t.loaderType_+"]");Object.defineProperty(t,"state",{get:function(){return this.state_},set:function(e){if(e!==this.state_){this.logger_(this.state_+" -> "+e);this.state_=e}}});return t}Wp(a,[{key:"resetStats_",value:function(){this.mediaBytesTransferred=0;this.mediaRequests=0;this.mediaRequestsAborted=0;this.mediaRequestsTimedout=0;this.mediaRequestsErrored=0;this.mediaTransferDuration=0;this.mediaSecondsLoaded=0}},{key:"dispose",value:function(){this.trigger("dispose");this.state="DISPOSED";this.pause();this.abort_();if(this.sourceUpdater_){this.sourceUpdater_.dispose()}this.resetStats_();if(this.captionParser_){this.captionParser_.reset()}if(this.checkBufferTimeout_){e.clearTimeout(this.checkBufferTimeout_)}if(this.syncController_&&this.triggerSyncInfoUpdate_){this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_)}this.off()}},{key:"abort",value:function(){if("WAITING"!==this.state){if(this.pendingSegment_){this.pendingSegment_=null}return}this.abort_();this.state="READY";if(!this.paused()){this.monitorBuffer_()}}},{key:"abort_",value:function(){if(this.pendingSegment_){this.pendingSegment_.abortRequests()}this.pendingSegment_=null}},{key:"error",value:function(e){if("undefined"!=typeof e){this.error_=e}this.pendingSegment_=null;return this.error_}},{key:"endOfStream",value:function(){this.ended_=!0;this.pause();this.trigger("ended")}},{key:"buffered_",value:function(){if(!this.sourceUpdater_){return Ze.createTimeRanges()}return this.sourceUpdater_.buffered()}},{key:"initSegment",value:function(e){var t=1 "+(e.id||e.uri)+"]");this.trigger("syncinfoupdate");if("INIT"===this.state&&this.couldBeginLoading_()){return this.init_()}if(!a||a.uri!==e.uri){if(null!==this.mediaIndex){this.resyncLoader()}return}var i=e.mediaSequence-a.mediaSequence;this.logger_("live window shift ["+i+"]");if(null!==this.mediaIndex){this.mediaIndex-=i}if(n){n.mediaIndex-=i;if(0<=n.mediaIndex){n.segment=e.segments[n.mediaIndex]}}this.syncController_.saveExpiredSegmentInfo(a,e)}},{key:"pause",value:function(){if(this.checkBufferTimeout_){e.clearTimeout(this.checkBufferTimeout_);this.checkBufferTimeout_=null}}},{key:"paused",value:function(){return null===this.checkBufferTimeout_}},{key:"mimeType",value:function(e,t){if(this.mimeType_){return}this.mimeType_=e;this.sourceBufferEmitter_=t;if("INIT"===this.state&&this.couldBeginLoading_()){this.init_()}}},{key:"resetEverything",value:function(e){this.ended_=!1;this.resetLoader();this.remove(0,1/0,e);if(this.captionParser_){this.captionParser_.clearAllCaptions()}this.trigger("reseteverything")}},{key:"resetLoader",value:function(){this.fetchAtBuffer_=!1;this.resyncLoader()}},{key:"resyncLoader",value:function(){this.mediaIndex=null;this.syncPoint_=null;this.abort()}},{key:"remove",value:function(e,t,a){if(t===1/0){t=this.duration_()}if(this.sourceUpdater_){this.sourceUpdater_.remove(e,t,a)}oc(e,t,this.segmentMetadataTrack_);if(this.inbandTextTracks_){for(var n in this.inbandTextTracks_){oc(e,t,this.inbandTextTracks_[n])}}}},{key:"monitorBuffer_",value:function(){if(this.checkBufferTimeout_){e.clearTimeout(this.checkBufferTimeout_)}this.checkBufferTimeout_=e.setTimeout(this.monitorBufferTick_.bind(this),1)}},{key:"monitorBufferTick_",value:function(){if("READY"===this.state){this.fillBuffer_()}if(this.checkBufferTimeout_){e.clearTimeout(this.checkBufferTimeout_)}this.checkBufferTimeout_=e.setTimeout(this.monitorBufferTick_.bind(this),500)}},{key:"fillBuffer_",value:function(){if(this.sourceUpdater_.updating()){return}if(!this.syncPoint_){this.syncPoint_=this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_())}var e=this.checkBuffer_(this.buffered_(),this.playlist_,this.mediaIndex,this.hasPlayed_(),this.currentTime_(),this.syncPoint_);if(!e){return}if(this.isEndOfStream_(e.mediaIndex)){this.endOfStream();return}if(e.mediaIndex===this.playlist_.segments.length-1&&"ended"===this.mediaSource_.readyState&&!this.seeking_()){return}if(e.timeline!==this.currentTimeline_){this.syncController_.reset();e.timestampOffset=e.startOfSegment;if(this.captionParser_){this.captionParser_.clearAllCaptions()}}this.loadSegment_(e)}},{key:"isEndOfStream_",value:function(e){var t=1=this.goalBufferLength_()){return null}if(!n&&1<=l){return null}if(null===i){a=this.getSyncSegmentCandidate_(t);return this.generateSegmentInfo_(t,a,null,!0)}if(null!==a){t.segments[a];o=s;return this.generateSegmentInfo_(t,a+1,o,!1)}if(this.fetchAtBuffer_){var d=xu.getMediaInfoForTime(t,s,i.segmentIndex,i.time);a=d.mediaIndex;o=d.startTime}else{var p=xu.getMediaInfoForTime(t,r,i.segmentIndex,i.time);a=p.mediaIndex;o=p.startTime}return this.generateSegmentInfo_(t,a,o,!1)}},{key:"getSyncSegmentCandidate_",value:function(e){var t=this;if(-1===this.currentTimeline_){return 0}var a=e.segments.map(function(e,t){return{timeline:e.timeline,segmentIndex:t}}).filter(function(e){return e.timeline===t.currentTimeline_});if(a.length){return a[Math.min(a.length-1,1)].segmentIndex}return Math.max(e.segments.length-1,0)}},{key:"generateSegmentInfo_",value:function(e,t,a,n){if(0>t||t>=e.segments.length){return null}var r=e.segments[t];return{requestId:"segment-loader-"+Math.random(),uri:r.resolvedUri,mediaIndex:t,isSyncRequest:n,startOfSegment:a,playlist:e,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:r.timeline,duration:r.duration,segment:r}}},{key:"abortRequestEarly_",value:function(e){if(this.hls_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH){return!1}if(1e3>Date.now()-(e.firstBytesReceivedAt||Date.now())){return!1}var t=this.currentTime_(),a=e.bandwidth,n=this.pendingSegment_.duration,r=xu.estimateSegmentRequestTime(n,a,this.playlist_,e.bytesReceived),i=rc(this.buffered_(),t,this.hls_.tech_.playbackRate())-1;if(r<=i){return!1}var s=bm({master:this.hls_.playlists.master,currentTime:t,bandwidth:a,duration:this.duration_(),segmentDuration:n,timeUntilRebuffer:i,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!s){return}var o=r-i-s.rebufferingImpact,l=.5;if(i<=Qu){l=1}if(!s.playlist||s.playlist.uri===this.playlist_.uri||o3*e.playlist.targetDuration){this.resetEverything();return}if(a){this.trigger("bandwidthupdate")}this.trigger("progress");if(this.isEndOfStream_(e.mediaIndex+1,e.playlist)){this.endOfStream()}if(!this.paused()){this.monitorBuffer_()}}},{key:"recordThroughput_",value:function(e){var t=this.throughput.rate,a=Date.now()-e.endOfAllRequests+1,n=Math.floor(1e3*(8*(e.byteLength/a)));this.throughput.rate+=(n-t)/++this.throughput.count}},{key:"addSegmentMetadataCue_",value:function(t){if(!this.segmentMetadataTrack_){return}var a=t.segment,n=a.start,r=a.end;if(!Cm(n)||!Cm(r)){return}oc(n,r,this.segmentMetadataTrack_);var i=e.WebKitDataCue||e.VTTCue,s={custom:a.custom,dateTimeObject:a.dateTimeObject,dateTimeString:a.dateTimeString,bandwidth:t.playlist.attributes.BANDWIDTH,resolution:t.playlist.attributes.RESOLUTION,codecs:t.playlist.attributes.CODECS,byteLength:t.byteLength,uri:t.uri,timeline:t.timeline,playlist:t.playlist.id,start:n,end:r},o=JSON.stringify(s),l=new i(n,r,o);l.value=s;this.segmentMetadataTrack_.addCue(l)}}]);return a}(Ze.EventTarget),Pm=function(e){return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))},Dm=new Uint8Array(["\n","\n"].map(function(e){return e.charCodeAt(0)})),wm=function(t){Gp(a,t);function a(e){var t=1=r.adStartTime&&t<=r.adEndTime){return r}}return null},Om=function(t,a){var n=2=u){l=u;o={time:p.start,segmentIndex:d}}}}return o}},{name:"Discontinuity",run:function(e,t,a,n,r){var s=null;r=r||0;if(t.discontinuityStarts&&t.discontinuityStarts.length){for(var o=null,l=0;l=c){o=c;s={time:u.time,segmentIndex:d}}}}}return s}},{name:"Playlist",run:function(e,t){if(t.syncInfo){var a={time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence};return a}return null}}],Um=function(e){Gp(t,e);function t(){Vp(this,t);var e=Kp(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));e.inspectCache_=void 0;e.timelines=[];e.discontinuities=[];e.datetimeToDisplayTime=null;e.logger_=em("SyncController");return e}Wp(t,[{key:"getSyncPoint",value:function(e,t,a,n){var r=this.runStrategies_(e,t,a,n);if(!r.length){return null}return this.selectSyncPoint_(r,{key:"time",value:n})}},{key:"getExpiredTime",value:function(e,t){if(!e||!e.segments){return null}var a=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!a.length){return null}var n=this.selectSyncPoint_(a,{key:"segmentIndex",value:0});if(0l){var d=void 0;if(0>o){d=a.start-cu(t,e.mediaIndex,r)}else{d=a.end+cu(t,e.mediaIndex+1,r)}this.discontinuities[s]={time:d,accuracy:l}}}}}},{key:"dispose",value:function(){this.trigger("dispose");this.off()}}]);return t}(Ze.EventTarget),Mm=new oa("./decrypter-worker.worker.js",function(){var e=this,t=function(){function t(e){return e.subarray(0,e.byteLength-e[e.byteLength-1])}var a=function(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}},n=function(){function e(e,t){for(var a=0,n;ao;o++){d[(u[o]=o<<1^283*(o>>7))^o]=o}for(l=p=0;!n[l];l^=c||1,p=d[p]||1){y=p^p<<1^p<<2^p<<3^p<<4;y=99^(y>>8^255&y);n[l]=y;r[y]=l;g=u[m=u[c=u[l]]];_=16843009*g^65537*m^257*c^16843008*l;h=257*u[y]^16843008*y;for(o=0;4>o;o++){t[o][l]=h=h<<24^h>>>8;a[o][y]=_=_<<24^_>>>8}}for(o=0;5>o;o++){t[o]=t[o].slice(0);a[o]=a[o].slice(0)}return e},o=null,l=function(){function e(t){a(this,e);if(!o){o=s()}this._tables=[[o[0][0].slice(),o[0][1].slice(),o[0][2].slice(),o[0][3].slice(),o[0][4].slice()],[o[1][0].slice(),o[1][1].slice(),o[1][2].slice(),o[1][3].slice(),o[1][4].slice()]];var n=void 0,r=void 0,l=void 0,d=void 0,p=void 0,u=this._tables[0][4],c=this._tables[1],m=t.length,g=1;if(4!==m&&6!==m&&8!==m){throw new Error("Invalid aes key size")}d=t.slice(0);p=[];this._key=[d,p];for(n=m;n<4*m+28;n++){l=d[n-1];if(0==n%m||8===m&&4==n%m){l=u[l>>>24]<<24^u[255&l>>16]<<16^u[255&l>>8]<<8^u[255&l];if(0==n%m){l=l<<8^l>>>24^g<<24;g=g<<1^283*(g>>7)}}d[n]=d[n-m]^l}for(r=0;n;r++,n--){l=d[3&r?n:n-4];if(4>=n||4>r){p[r]=l}else{p[r]=c[0][u[l>>>24]]^c[1][u[255&l>>16]]^c[2][u[255&l>>8]]^c[3][u[255&l]]}}}e.prototype.decrypt=function(e,t,n,r,s,o){var l=this._key[1],p=e^l[0],u=r^l[1],m=n^l[2],g=t^l[3],y=void 0,h=void 0,_=void 0,f=l.length/4-2,T=void 0,v=4,S=this._tables[1],k=S[0],C=S[1],E=S[2],I=S[3],x=S[4];for(T=0;T>>24]^C[255&u>>16]^E[255&m>>8]^I[255&g]^l[v];h=k[u>>>24]^C[255&m>>16]^E[255&g>>8]^I[255&p]^l[v+1];_=k[m>>>24]^C[255&g>>16]^E[255&p>>8]^I[255&u]^l[v+2];g=k[g>>>24]^C[255&p>>16]^E[255&u>>8]^I[255&m]^l[v+3];v+=4;p=y;u=h;m=_}for(T=0;4>T;T++){s[(3&-T)+o]=x[p>>>24]<<24^x[255&u>>16]<<16^x[255&m>>8]<<8^x[255&g]^l[v++];y=p;p=u;u=m;m=g;g=y}};return e}(),d=function(){function e(){a(this,e);this.listeners={}}e.prototype.on=function(e,t){if(!this.listeners[e]){this.listeners[e]=[]}this.listeners[e].push(t)};e.prototype.off=function(e,t){if(!this.listeners[e]){return!1}var a=this.listeners[e].indexOf(t);this.listeners[e].splice(a,1);return-1>8|e>>>24},c=function(e,t,a){var n=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),r=new l(Array.prototype.slice.call(t)),i=new Uint8Array(e.byteLength),s=new Int32Array(i.buffer),o=void 0,d=void 0,p=void 0,c=void 0,m=void 0,g=void 0,y=void 0,h=void 0,_=void 0;o=a[0];d=a[1];p=a[2];c=a[3];for(_=0;_=i){e.masterPlaylistLoader_.media(t)}e.tech_.trigger("bandwidthupdate")});this.mainSegmentLoader_.on("progress",function(){e.trigger("progress")});this.mainSegmentLoader_.on("error",function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())});this.mainSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_()});this.mainSegmentLoader_.on("timestampoffset",function(){e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})});this.audioSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_()});this.mainSegmentLoader_.on("ended",function(){e.onEndOfStream()});this.mainSegmentLoader_.on("earlyabort",function(){e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120)});this.mainSegmentLoader_.on("reseteverything",function(){e.tech_.trigger("hls-reset")});this.mainSegmentLoader_.on("segmenttimemapping",function(t){e.tech_.trigger({type:"hls-segment-time-mapping",mapping:t.mapping})});this.audioSegmentLoader_.on("ended",function(){e.onEndOfStream()})}},{key:"mediaSecondsLoaded_",value:function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}},{key:"load",value:function(){this.mainSegmentLoader_.load();if(this.mediaTypes_.AUDIO.activePlaylistLoader){this.audioSegmentLoader_.load()}if(this.mediaTypes_.SUBTITLES.activePlaylistLoader){this.subtitleSegmentLoader_.load()}}},{key:"smoothQualityChange_",value:function(){var e=this.selectPlaylist();if(e!==this.masterPlaylistLoader_.media()){this.masterPlaylistLoader_.media(e);this.mainSegmentLoader_.resetLoader()}}},{key:"fastQualityChange_",value:function(){var e=this,t=this.selectPlaylist();if(t===this.masterPlaylistLoader_.media()){return}this.masterPlaylistLoader_.media(t);this.mainSegmentLoader_.resetEverything(function(){if(Ze.browser.IE_VERSION||Ze.browser.IS_EDGE){e.tech_.setCurrentTime(e.tech_.currentTime()+.04)}else{e.tech_.setCurrentTime(e.tech_.currentTime())}})}},{key:"play",value:function(){if(this.setupFirstPlay()){return}if(this.tech_.ended()){this.seekTo_(0)}if(this.hasPlayed_){this.load()}var e=this.tech_.seekable();if(this.tech_.duration()===1/0){if(this.tech_.currentTime()r.end(0)||r.start(0)>e.end(0)){this.seekable_=r}else{this.seekable_=Ze.createTimeRanges([[e.start(0)>r.start(0)?e.start(0):r.start(0),e.end(0) "+a);try{e.mediaSource.duration=a}catch(t){Ze.log.warn("Failed to set media source duration",t)}e.tech_.trigger("durationchange");e.mediaSource.removeEventListener("sourceopen",t)};if(0t.length){this.error="No compatible SourceBuffer configuration for the variant stream:"+e.resolvedUri;return this.mediaSource.endOfStream("decode")}this.configureLoaderMimeTypes_(t);this.excludeIncompatibleVariants_(e)}},{key:"configureLoaderMimeTypes_",value:function(e){var t=1=t.end(t.length-1))){return this.techWaiting_()}if(5<=this.consecutiveUpdates&&e===this.lastRecordedTime){this.consecutiveUpdates++;this.waiting_()}else if(e===this.lastRecordedTime){this.consecutiveUpdates++}else{this.consecutiveUpdates=0;this.lastRecordedTime=e}}},{key:"cancelTimer_",value:function(){this.consecutiveUpdates=0;if(this.timer_){this.logger_("cancelTimer_");clearTimeout(this.timer_)}this.timer_=null}},{key:"fixesBadSeeks_",value:function(){var e=this.tech_.seeking();if(!e){return!1}var t=this.seekable(),a=this.tech_.currentTime(),n=this.afterSeekableWindow_(t,a,this.media(),this.allowSeeksWithinUnsafeLiveWindow),r=void 0;if(n){var i=t.end(t.length-1);r=i}if(this.beforeSeekableWindow_(t,a)){var s=t.start(0);r=s+Ju}if("undefined"!=typeof r){this.logger_("Trying to seek outside of seekable at time "+a+" with "+("seekable range "+nc(t)+". Seeking to ")+(r+"."));this.seekTo(r);return!0}return!1}},{key:"waiting_",value:function(){if(this.techWaiting_()){return}var e=this.tech_.currentTime(),t=this.tech_.buffered(),a=ec(t,e);if(a.length&&e+3<=a.end(0)){this.cancelTimer_();this.seekTo(e);this.logger_("Stopped at "+e+" while inside a buffered region "+("["+a.start(0)+" -> "+a.end(0)+"]. Attempting to resume playback by seeking to the current time."));this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})}}},{key:"techWaiting_",value:function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()&&this.fixesBadSeeks_()){return!0}if(this.tech_.seeking()||null!==this.timer_){return!0}if(this.beforeSeekableWindow_(e,t)){var a=e.end(e.length-1);this.logger_("Fell out of live window at time "+t+". Seeking to "+("live point (seekable end) "+a));this.cancelTimer_();this.seekTo(a);this.tech_.trigger({type:"usage",name:"hls-live-resync"});return!0}var n=this.tech_.buffered(),r=tc(n,t);if(this.videoUnderflow_(r,n,t)){this.cancelTimer_();this.seekTo(t);this.tech_.trigger({type:"usage",name:"hls-video-underflow"});return!0}if(0r){return!0}return!1}},{key:"beforeSeekableWindow_",value:function(e,t){if(e.length&&0t-r&&2t){Ze.log.warn("value of Hls."+e+" must be greater than or equal to 0");return}am[e]=t}})});var dg=function(e){if(/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i.test(e)){return"hls"}if(/^application\/dash\+xml/i.test(e)){return"dash"}return null},pg=function(e,t){for(var a=t.media(),n=-1,r=0;r=Object.getOwnPropertyNames(a.handlers).length){delete a.handlers;delete a.dispatcher;delete a.disabled}if(0===Object.getOwnPropertyNames(a).length){oe["delete"](e)}}function de(e,t,a,n){a.forEach(function(a){e(t,a,n)})}function pe(a){if(a.fixed_){return a}function n(){return!0}function r(){return!1}if(!a||!a.isPropagationStopped){var i=a||e.event;a={};for(var s in i){if("layerX"!=s&&"layerY"!==s&&"keyLocation"!==s&&"webkitMovementX"!==s&&"webkitMovementY"!==s){if(!("returnValue"===s&&i.preventDefault)){a[s]=i[s]}}}if(!a.target){a.target=a.srcElement||t}if(!a.relatedTarget){a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement}a.preventDefault=function(){if(i.preventDefault){i.preventDefault()}a.returnValue=!1;i.returnValue=!1;a.defaultPrevented=!0};a.defaultPrevented=!1;a.stopPropagation=function(){if(i.stopPropagation){i.stopPropagation()}a.cancelBubble=!0;i.cancelBubble=!0;a.isPropagationStopped=n};a.isPropagationStopped=r;a.stopImmediatePropagation=function(){if(i.stopImmediatePropagation){i.stopImmediatePropagation()}a.isImmediatePropagationStopped=n;a.stopPropagation()};a.isImmediatePropagationStopped=r;if(null!==a.clientX&&a.clientX!==void 0){var o=t.documentElement,l=t.body;a.pageX=a.clientX+(o&&o.scrollLeft||l&&l.scrollLeft||0)-(o&&o.clientLeft||l&&l.clientLeft||0);a.pageY=a.clientY+(o&&o.scrollTop||l&&l.scrollTop||0)-(o&&o.clientTop||l&&l.clientTop||0)}a.which=a.charCode||a.keyCode;if(null!==a.button&&a.button!==void 0){a.button=1&a.button?0:4&a.button?1:2&a.button?2:0}}a.fixed_=!0;return a}var ue,ce=function(){if("boolean"!=typeof ue){ue=!1;try{var t=Object.defineProperty({},"passive",{get:function(){ue=!0}});e.addEventListener("test",null,t);e.removeEventListener("test",null,t)}catch(t){}}return ue},me=["touchstart","touchmove"];function ge(e,t,a){if(Array.isArray(t)){return de(ge,e,t,a)}if(!oe.has(e)){oe.set(e,{})}var r=oe.get(e);if(!r.handlers){r.handlers={}}if(!r.handlers[t]){r.handlers[t]=[]}if(!a.guid){a.guid=ie()}r.handlers[t].push(a);if(!r.dispatcher){r.disabled=!1;r.dispatcher=function(t,a){if(r.disabled){return}t=pe(t);var i=r.handlers[t.type];if(i){for(var o=i.slice(0),l=0,d=o.length;l=a){t.apply(void 0,arguments);n=r}};return r},ke=function(t,a,n,r){if(void 0===r){r=e}var i,s=function(){r.clearTimeout(i);i=null},o=function(){var e=this,s=arguments,o=function(){i=null;o=null;if(!n){t.apply(e,s)}};if(!i&&n){t.apply(e,s)}r.clearTimeout(i);i=r.setTimeout(o,a)};o.cancel=s;return o},Ce=function(){};Ce.prototype.allowedEvents_={};Ce.prototype.on=function(e,t){var a=this.addEventListener;this.addEventListener=function(){};ge(this,e,t);this.addEventListener=a};Ce.prototype.addEventListener=Ce.prototype.on;Ce.prototype.off=function(e,t){ye(this,e,t)};Ce.prototype.removeEventListener=Ce.prototype.off;Ce.prototype.one=function(e,t){var a=this.addEventListener;this.addEventListener=function(){};_e(this,e,t);this.addEventListener=a};Ce.prototype.any=function(e,t){var a=this.addEventListener;this.addEventListener=function(){};fe(this,e,t);this.addEventListener=a};Ce.prototype.trigger=function(e){var t=e.type||e;if("string"==typeof e){e={type:t}}e=pe(e);if(this.allowedEvents_[t]&&this["on"+t]){this["on"+t](e)}he(this,e)};Ce.prototype.dispatchEvent=Ce.prototype.trigger;var Ee;Ce.prototype.queueTrigger=function(t){var a=this;if(!Ee){Ee=new Map}var n=t.type||t,r=Ee.get(this);if(!r){r=new Map;Ee.set(this,r)}var i=r.get(n);r["delete"](n);e.clearTimeout(i);var s=e.setTimeout(function(){if(0===r.size){r=null;Ee["delete"](a)}a.trigger(t)},0);r.set(n,s)};var Ie=function(e){return e instanceof Ce||!!e.eventBusEl_&&["on","one","off","trigger"].every(function(t){return"function"==typeof e[t]})},xe=function(e,t){if(Ie(e)){t()}else{if(!e.eventedCallbacks){e.eventedCallbacks=[]}e.eventedCallbacks.push(t)}},Le=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},Pe=function(e){if(!e.nodeName&&!Ie(e)){throw new Error("Invalid target; must be a DOM node or evented object.")}},De=function(e){if(!Le(e)){throw new Error("Invalid event type; must be a non-empty string or array.")}},we=function(e){if("function"!=typeof e){throw new Error("Invalid listener; must be a function.")}},Ae=function(e,t){var a=3>t.length||t[0]===e||t[0]===e.eventBusEl_,n,r,i;if(a){n=e.eventBusEl_;if(3<=t.length){t.shift()}r=t[0];i=t[1]}else{n=t[0];r=t[1];i=t[2]}Pe(n);De(r);we(i);i=ve(e,i);return{isTargetingSelf:a,target:n,type:r,listener:i}},Oe=function(e,t,a,n){Pe(e);if(e.nodeName){Te[t](e,a,n)}else{e[t](a,n)}},Re={on:function(){for(var e=this,t=arguments.length,a=Array(t),n=0;n10){n=!1}}});var r=function(){n=!1};this.on("touchleave",r);this.on("touchcancel",r);this.on("touchend",function(r){a=null;if(!0===n){var i=e.performance.now()-t;if(i<200){r.preventDefault();this.trigger("tap")}}})};a.enableTouchActivity=function(){if(!this.player()||!this.player().reportUserActivity){return}var e=ve(this.player(),this.player().reportUserActivity),t;this.on("touchstart",function(){e();this.clearInterval(t);t=this.setInterval(e,250)});var a=function(){e();this.clearInterval(t)};this.on("touchmove",e);this.on("touchend",a);this.on("touchcancel",a)};a.setTimeout=function(t,a){var n=this,r;t=ve(this,t);this.clearTimersOnDispose_();r=e.setTimeout(function(){if(n.setTimeoutIds_.has(r)){n.setTimeoutIds_["delete"](r)}t()},a);this.setTimeoutIds_.add(r);return r};a.clearTimeout=function(t){if(this.setTimeoutIds_.has(t)){this.setTimeoutIds_["delete"](t);e.clearTimeout(t)}return t};a.setInterval=function(t,a){t=ve(this,t);this.clearTimersOnDispose_();var n=e.setInterval(t,a);this.setIntervalIds_.add(n);return n};a.clearInterval=function(t){if(this.setIntervalIds_.has(t)){this.setIntervalIds_["delete"](t);e.clearInterval(t)}return t};a.requestAnimationFrame=function(t){var a=this;if(!this.supportsRaf_){return this.setTimeout(t,1e3/60)}this.clearTimersOnDispose_();var n;t=ve(this,t);n=e.requestAnimationFrame(function(){if(a.rafIds_.has(n)){a.rafIds_["delete"](n)}t()});this.rafIds_.add(n);return n};a.cancelAnimationFrame=function(t){if(!this.supportsRaf_){return this.clearTimeout(t)}if(this.rafIds_.has(t)){this.rafIds_["delete"](t);e.cancelAnimationFrame(t)}return t};a.clearTimersOnDispose_=function(){var e=this;if(this.clearingTimersOnDispose_){return}this.clearingTimersOnDispose_=!0;this.one("dispose",function(){[["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(function(t){var a=t[0],n=t[1];e[a].forEach(e[n],e)});e.clearingTimersOnDispose_=!1})};t.registerComponent=function(e,a){if("string"!=typeof e||!e){throw new Error("Illegal component name, \""+e+"\"; must be a non-empty string.")}var n=t.getComponent("Tech"),r=n&&n.isTech(a),i=t===a||t.prototype.isPrototypeOf(a.prototype);if(r||!i){var s;if(r){s="techs must be registered using Tech.registerTech()"}else{s="must be a Component subclass"}throw new Error("Illegal component, \""+e+"\"; "+s+".")}e=je(e);if(!t.components_){t.components_={}}var o=t.getComponent("Player");if("Player"===e&&o&&o.players){var l=o.players,d=Object.keys(l);if(l&&0Ze&&537>Xe,tt=/Firefox/i.test(Ke),at=/Edg/i.test(Ke),nt=!at&&(/Chrome/i.test(Ke)||/CriOS/i.test(Ke)),rt=function(){var e=Ke.match(/(Chrome|CriOS)\/(\d+)/);if(e&&e[2]){return parseFloat(e[2])}return null}(),it=function(){var e=/MSIE\s(\d+)\.\d/.exec(Ke),t=e&&parseFloat(e[1]);return"7.7.6"}(),st=/Safari/i.test(Ke)&&!nt&&!Je&&!at,ot=/Windows/i.test(Ke),lt=v()&&("ontouchstart"in e||e.navigator.maxTouchPoints||e.DocumentTouch&&e.document instanceof e.DocumentTouch),dt=/iPad/i.test(Ke)||st&<&&!/iPhone/i.test(Ke),pt=/iPhone/i.test(Ke)&&!dt,ut=pt||dt||$e,ct=(st||ut)&&!nt,mt=Object.freeze({IS_IPOD:$e,IOS_VERSION:Qe,IS_ANDROID:Je,ANDROID_VERSION:Ze,IS_NATIVE_ANDROID:et,IS_FIREFOX:tt,IS_EDGE:at,IS_CHROME:nt,CHROME_VERSION:rt,IE_VERSION:it,IS_SAFARI:st,IS_WINDOWS:ot,TOUCH_ENABLED:lt,IS_IPAD:dt,IS_IPHONE:pt,IS_IOS:ut,IS_ANY_SAFARI:ct});function gt(e,t,a){if("number"!=typeof t||0>t||t>a){throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+a+").")}}function yt(e,t,a,n){gt(e,n,a.length-1);return a[n][t]}function ht(e){if(e===void 0||0===e.length){return{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}}return{length:e.length,start:yt.bind(null,"start",0,e),end:yt.bind(null,"end",1,e)}}function _t(e,t){if(Array.isArray(e)){return ht(e)}else if(e===void 0||t===void 0){return ht()}return ht([[e,t]])}function ft(e,t){var a=0,n,r;if(!t){return 0}if(!e||!e.length){e=_t(0,0)}for(var s=0;st){r=t}a+=r-n}return a/t}for(var Tt={prefixed:!0},bt=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]],vt=bt[0],St,kt=0;kts;s++){n[String.fromCharCode(s)]=s-32}for(var s=48;58>s;s++){n[s-48]=s}for(s=1;13>s;s++){n["f"+s]=s+111}for(s=0;10>s;s++){n["numpad "+s]=s+96}var o=t.names=t.title={};for(s in n){o[n[s]]=s}for(var l in r){n[l]=r[l]}}),At=wt.code,Ot=wt.codes,Rt=wt.aliases,Nt=wt.names,Ut=wt.title,Mt="vjs-modal-dialog",Bt=function(a){Ge(n,a);function n(e,t){var n=a.call(this,e,t)||this;n.opened_=n.hasBeenOpened_=n.hasBeenFilled_=!1;n.closeable(!n.options_.uncloseable);n.content(n.options_.content);n.contentEl_=E("div",{className:Mt+"-content"},{role:"document"});n.descEl_=E("p",{className:Mt+"-description vjs-control-text",id:n.el().getAttribute("aria-describedby")});I(n.descEl_,n.description());n.el_.appendChild(n.descEl_);n.el_.appendChild(n.contentEl_);return n}var r=n.prototype;r.createEl=function(){return a.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})};r.dispose=function(){this.contentEl_=null;this.descEl_=null;this.previouslyActiveEl_=null;a.prototype.dispose.call(this)};r.buildCSSClass=function(){return Mt+" vjs-hidden "+a.prototype.buildCSSClass.call(this)};r.label=function(){return this.localize(this.options_.label||"Modal Window")};r.description=function(){var e=this.options_.description||this.localize("This is a modal window.");if(this.closeable()){e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")}return e};r.open=function(){if(!this.opened_){var e=this.player();this.trigger("beforemodalopen");this.opened_=!0;if(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_){this.fill()}this.wasPlaying_=!e.paused();if(this.options_.pauseOnOpen&&this.wasPlaying_){e.pause()}this.on("keydown",this.handleKeyDown);this.hadControls_=e.controls();e.controls(!1);this.show();this.conditionalFocus_();this.el().setAttribute("aria-hidden","false");this.trigger("modalopen");this.hasBeenOpened_=!0}};r.opened=function(e){if("boolean"==typeof e){this[e?"open":"close"]()}return this.opened_};r.close=function(){if(!this.opened_){return}var e=this.player();this.trigger("beforemodalclose");this.opened_=!1;if(this.wasPlaying_&&this.options_.pauseOnOpen){e.play()}this.off("keydown",this.handleKeyDown);if(this.hadControls_){e.controls(!0)}this.hide();this.el().setAttribute("aria-hidden","true");this.trigger("modalclose");this.conditionalBlur_();if(this.options_.temporary){this.dispose()}};r.closeable=function t(e){if("boolean"==typeof e){var t=this.closeable_=!!e,a=this.getChild("closeButton");if(t&&!a){var n=this.contentEl_;this.contentEl_=this.el_;a=this.addChild("closeButton",{controlText:"Close Modal Dialog"});this.contentEl_=n;this.on(a,"close",this.close)}if(!t&&a){this.off(a,"close",this.close);this.removeChild(a);a.dispose()}}return this.closeable_};r.fill=function(){this.fillWith(this.content())};r.fillWith=function(e){var t=this.contentEl(),a=t.parentNode,n=t.nextSibling;this.trigger("beforemodalfill");this.hasBeenFilled_=!0;a.removeChild(t);this.empty();G(t,e);this.trigger("modalfill");if(n){a.insertBefore(t,n)}else{a.appendChild(t)}var r=this.getChild("closeButton");if(r){a.appendChild(r.el_)}};r.empty=function(){this.trigger("beforemodalempty");V(this.contentEl());this.trigger("modalempty")};r.content=function(e){if("undefined"!=typeof e){this.content_=e}return this.content_};r.conditionalFocus_=function(){var e=t.activeElement,a=this.player_.el_;this.previouslyActiveEl_=null;if(a.contains(e)||a===e){this.previouslyActiveEl_=e;this.focus()}};r.conditionalBlur_=function(){if(this.previouslyActiveEl_){this.previouslyActiveEl_.focus();this.previouslyActiveEl_=null}};r.handleKeyDown=function(e){e.stopPropagation();if(wt.isEventKey(e,"Escape")&&this.closeable()){e.preventDefault();this.close();return}if(!wt.isEventKey(e,"Tab")){return}for(var a=this.focusableEls_(),n=this.el_.querySelector(":focus"),r,s=0;s";s=l.firstChild;l.setAttribute("style","display:none; position:absolute;");t.body.appendChild(l)}for(var d={},p=0;px";e=a.firstChild.href}return e},ta=function(e){if("string"==typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e);if(t){return t.pop().toLowerCase()}}return""},aa=function(t,a){if(void 0===a){a=e.location}var n=Zt(t),r=":"===n.protocol?a.protocol:n.protocol,i=r+n.host!==a.protocol+a.host;return i},na=Object.freeze({parseUrl:Zt,getAbsoluteURL:ea,getFileExtension:ta,isCrossOrigin:aa}),ra=Object.prototype.toString;var ia=function(e){var t={};if(!e){return t}e.trim().split("\n").forEach(function(e){var a=e.indexOf(":"),n=e.slice(0,a).trim().toLowerCase(),r=e.slice(a+1).trim();if("undefined"==typeof t[n]){t[n]=r}else if(Array.isArray(t[n])){t[n].push(r)}else{t[n]=[t[n],r]}});return t},sa=pa;pa.XMLHttpRequest=e.XMLHttpRequest||function(){};pa.XDomainRequest="withCredentials"in new pa.XMLHttpRequest?pa.XMLHttpRequest:e.XDomainRequest;oa(["get","put","post","patch","head","delete"],function(e){pa["delete"===e?"del":e]=function(t,a,n){a=da(t,a,n);a.method=e.toUpperCase();return ua(a)}});function oa(e,t){for(var a=0;a=e){t.push(r)}else if(r.startTime===r.endTime&&r.startTime<=e&&r.startTime+.5>=e){t.push(r)}}d=!1;if(t.length!==this.activeCues_.length){d=!0}else{for(var s=0;s=t){this.set(e,t);return!0}}return!1}};function La(e,t,a,n){var r=n?e.split(n):[e];for(var s in r){if("string"!=typeof r[s]){continue}var i=r[s].split(a);if(2!==i.length){continue}var o=i[0],l=i[1];t(o,l)}}function Pa(e,t,a){var n=e;function r(){var t=Ia(e);if(null===t){throw new Ea(Ea.Errors.BadTimeStamp,"Malformed timestamp: "+n)}e=e.replace(/^[^\sa-zA-Z-]+/,"");return t}function i(e,t){var n=new xa;La(e,function(e,t){switch(e){case"region":for(var r=a.length-1;0<=r;r--){if(a[r].id===t){n.set(e,a[r].region);break}}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":var s=t.split(","),o=s[0];n.integer(e,o);n.percent(e,o)?n.set("snapToLines",!1):null;n.alt(e,o,["auto"]);if(2===s.length){n.alt("lineAlign",s[1],["start","center","end"])}break;case"position":s=t.split(",");n.percent(e,s[0]);if(2===s.length){n.alt("positionAlign",s[1],["start","center","end"])}break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start","center","end","left","right"]);break;}},/:/,/\s/);t.region=n.get("region",null);t.vertical=n.get("vertical","");try{t.line=n.get("line","auto")}catch(t){}t.lineAlign=n.get("lineAlign","start");t.snapToLines=n.get("snapToLines",!0);t.size=n.get("size",100);try{t.align=n.get("align","center")}catch(a){t.align=n.get("align","middle")}try{t.position=n.get("position","auto")}catch(a){t.position=n.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=n.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}function s(){e=e.replace(/^\s+/,"")}s();t.startTime=r();s();if("-->"!==e.substr(0,3)){throw new Ea(Ea.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+n)}e=e.substr(3);s();t.endTime=r();s();i(e,t)}var Da=t.createElement("textarea"),wa={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},Aa={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},Oa={v:"title",lang:"lang"},Ra={rt:"ruby"};function Na(e,a){function n(){if(!a){return null}function e(e){a=a.substr(e.length);return e}var t=a.match(/^([^<]*)(<[^>]*>?)?/);return e(t[1]?t[1]:t[2])}function r(e){Da.innerHTML=e;e=Da.textContent;Da.textContent="";return e}function i(e,t){return!Ra[t.localName]||Ra[t.localName]===e.localName}function s(t,a){var n=wa[t];if(!n){return null}var r=e.document.createElement(n),i=Oa[t];if(i&&a){r[i]=a.trim()}return r}var o=e.document.createElement("div"),l=o,d,p=[];while(null!==(d=n())){if("<"===d[0]){if("/"===d[1]){if(p.length&&p[p.length-1]===d.substr(2).replace(">","")){p.pop();l=l.parentNode}continue}var u=Ia(d.substr(1,d.length-2)),c;if(u){c=e.document.createProcessingInstruction("timestamp",u);l.appendChild(c);continue}var g=d.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!g){continue}c=s(g[1],g[3]);if(!c){continue}if(!i(l,c)){continue}if(g[2]){var m=g[2].split(".");m.forEach(function(e){var t=/^bg_/.test(e),a=t?e.slice(3):e;if(Aa.hasOwnProperty(a)){var n=t?"background-color":"color",r=Aa[a];c.style[n]=r}});c.className=m.join(" ")}p.push(g[1]);l.appendChild(c);l=c;continue}l.appendChild(e.document.createTextNode(r(d)))}return o}var Ua=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function Ma(e){for(var t=0,a;t=a[0]&&e<=a[1]){return!0}}return!1}function Ba(e){var t=[],a="",n;if(!e||!e.childNodes){return"ltr"}function r(e,t){for(var a=t.childNodes.length-1;0<=a;a--){e.push(t.childNodes[a])}}function s(e){if(!e||!e.length){return null}var t=e.pop(),a=t.textContent||t.innerText;if(a){var n=a.match(/^.*(\n|\r)/);if(n){e.length=0;return n[0]}return a}if("ruby"===t.tagName){return s(e)}if(t.childNodes){r(e,t);return s(e)}}r(t,e);while(a=s(t)){for(var o=0;o=e.line)){return e.line}if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement){return-1}for(var t=e.track,a=t.textTrackList,n=0,r=0;re.left&&this.tope.top};qa.prototype.overlapsAny=function(e){for(var t=0;t=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right};qa.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.lefte.right;case"+y":return this.tope.bottom;}};qa.prototype.intersectPercentage=function(e){var t=Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left)),a=Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top));return t*a/(this.height*this.width)};qa.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}};qa.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,a=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e;var r={left:e.left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||a};return r};function Va(e,t,a,n){function r(e,t){for(var r,s=new qa(e),o=1,l=0;ld){r=new qa(e);o=d}e=new qa(s)}return r||s}var i=new qa(t),s=t.cue,o=ja(s),l=[];if(s.snapToLines){var d;switch(s.vertical){case"":l=["+y","-y"];d="height";break;case"rl":l=["+x","-x"];d="width";break;case"lr":l=["-x","+x"];d="width";break;}var p=i.lineHeight,u=p*Math.round(o),c=a[d]+p,m=l[0];if(Math.abs(u)>c){u=0>u?-1:1;u*=Math.ceil(c/p)*p}if(0>o){u+=""===s.vertical?a.height:a.width;l=l.reverse()}i.move(m,u)}else{var g=100*(i.lineHeight/a.height);switch(s.lineAlign){case"center":o-=g/2;break;case"end":o-=g;break;}switch(s.vertical){case"":t.applyStyles({top:t.formatStyle(o,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(o,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(o,"%")});break;}l=["+y","-x","+x","-y"];i=new qa(t)}var y=r(i,l);t.move(y.toCSSCompatValues(a))}function Wa(){}Wa.StringDecoder=function(){return{decode:function(e){if(!e){return""}if("string"!=typeof e){throw new Error("Error - expected string data.")}return decodeURIComponent(encodeURIComponent(e))}}};Wa.convertCueToDOMTree=function(e,t){if(!e||!t){return null}return Na(e,t)};Wa.processCues=function(e,t,a){if(!e||!t||!a){return null}while(a.firstChild){a.removeChild(a.firstChild)}var n=e.document.createElement("div");n.style.position="absolute";n.style.left="0";n.style.right="0";n.style.top="0";n.style.bottom="0";n.style.margin="1.5%";a.appendChild(n);function r(e){for(var t=0;t")){t.cue.id=s;continue}case"CUE":try{Pa(s,t.cue,t.regionList)}catch(a){t.reportOrThrowError(a);t.cue=null;t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":var d=-1!==s.indexOf("-->");if(!s||d&&(l=!0)){t.oncue&&t.oncue(t.cue);t.cue=null;t.state="ID";continue}if(t.cue.text){t.cue.text+="\n"}t.cue.text+=s.replace(/\u2028/g,"\n").replace(/u2029/g,"\n");continue;case"BADCUE":if(!s){t.state="ID"}continue;}}}catch(a){t.reportOrThrowError(a);if("CUETEXT"===t.state&&t.cue&&t.oncue){t.oncue(t.cue)}t.cue=null;t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var t=this;try{t.buffer+=t.decoder.decode();if(t.cue||"HEADER"===t.state){t.buffer+="\n\n";t.parse()}if("INITIAL"===t.state){throw new Ea(Ea.Errors.BadSignature)}}catch(a){t.reportOrThrowError(a)}t.onflush&&t.onflush();return this}};var za={"":1,lr:1,rl:1},Ga={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function Ka(e){if("string"!=typeof e){return!1}var t=za[e.toLowerCase()];return t?e.toLowerCase():!1}function Ya(e){if("string"!=typeof e){return!1}var t=Ga[e.toLowerCase()];return t?e.toLowerCase():!1}function Xa(e,t,a){this.hasBeenReset=!1;var n="",r=!1,i=e,s=t,o=a,l=null,d="",p=!0,u="auto",c="start",m="auto",g="auto",y=100,h="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return n},set:function(e){n=""+e}},pauseOnExit:{enumerable:!0,get:function(){return r},set:function(e){r=!!e}},startTime:{enumerable:!0,get:function(){return i},set:function(e){if("number"!=typeof e){throw new TypeError("Start time must be set to a number.")}i=e;this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e){throw new TypeError("End time must be set to a number.")}s=e;this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return o},set:function(e){o=""+e;this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return l},set:function(e){l=e;this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return d},set:function(e){var t=Ka(e);if(!1===t){throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.")}d=t;this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return p},set:function(e){p=!!e;this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e&&e!=="auto"){throw new SyntaxError("Line: an invalid number or illegal string was specified.")}u=e;this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return c},set:function(e){var t=Ya(e);if(!t){console.warn("lineAlign: an invalid or illegal string was specified.")}else{c=t;this.hasBeenReset=!0}}},position:{enumerable:!0,get:function(){return m},set:function(e){if(0>e||100e||100=e}var Za=function(){var e=100,t=3,a=0,n=100,r=0,i=100,s="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!Ja(t)){throw new Error("Width must be between 0 and 100.")}e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!=typeof e){throw new TypeError("Lines must be set to a number.")}t=e}},regionAnchorY:{enumerable:!0,get:function(){return n},set:function(e){if(!Ja(e)){throw new Error("RegionAnchorX must be between 0 and 100.")}n=e}},regionAnchorX:{enumerable:!0,get:function(){return a},set:function(e){if(!Ja(e)){throw new Error("RegionAnchorY must be between 0 and 100.")}a=e}},viewportAnchorY:{enumerable:!0,get:function(){return i},set:function(e){if(!Ja(e)){throw new Error("ViewportAnchorY must be between 0 and 100.")}i=e}},viewportAnchorX:{enumerable:!0,get:function(){return r},set:function(e){if(!Ja(e)){throw new Error("ViewportAnchorX must be between 0 and 100.")}r=e}},scroll:{enumerable:!0,get:function(){return s},set:function(e){var t=Qa(e);if(!1===t){console.warn("Scroll: an invalid or illegal string was specified.")}else{s=t}}}})},en=l(function(t){var a=t.exports={WebVTT:Wa,VTTCue:Xa,VTTRegion:Za};e.vttjs=a;e.WebVTT=a.WebVTT;var n=a.VTTCue,r=a.VTTRegion,i=e.VTTCue,s=e.VTTRegion;a.shim=function(){e.VTTCue=n;e.VTTRegion=r};a.restore=function(){e.VTTCue=i;e.VTTRegion=s};if(!e.VTTCue){a.shim()}}),tn=en.WebVTT,an=en.VTTCue,nn=en.VTTRegion;function rn(e,t,a,n,r){if(void 0===r){r={}}var i=e.textTracks();r.kind=t;if(a){r.label=a}if(n){r.language=n}r.tech=e;var s=new ka.text.TrackClass(r);i.addTrack(s);return s}var sn=function(a){Ge(n,a);function n(e,t){var n;if(void 0===e){e={}}if(void 0===t){t=function(){}}e.reportTouchActivity=!1;n=a.call(this,null,e,t)||this;n.hasStarted_=!1;n.on("playing",function(){this.hasStarted_=!0});n.on("loadstart",function(){this.hasStarted_=!1});ka.names.forEach(function(t){var a=ka[t];if(e&&e[a.getterName]){n[a.privateName]=e[a.getterName]}});if(!n.featuresProgressEvents){n.manualProgressOn()}if(!n.featuresTimeupdateEvents){n.manualTimeUpdatesOn()}["Text","Audio","Video"].forEach(function(t){if(!1===e["native"+t+"Tracks"]){n["featuresNative"+t+"Tracks"]=!1}});if(!1===e.nativeCaptions||!1===e.nativeTextTracks){n.featuresNativeTextTracks=!1}else if(!0===e.nativeCaptions||!0===e.nativeTextTracks){n.featuresNativeTextTracks=!0}if(!n.featuresNativeTextTracks){n.emulateTextTracks()}n.preloadTextTracks=!1!==e.preloadTextTracks;n.autoRemoteTextTracks_=new ka.text.ListClass;n.initTrackListeners();if(!e.nativeControlsForTouch){n.emitTapEvents()}if(n.constructor){n.name_=n.constructor.name||"Unknown Tech"}return n}var r=n.prototype;r.triggerSourceset=function(e){var t=this;if(!this.isReady_){this.one("ready",function(){return t.setTimeout(function(){return t.triggerSourceset(e)},1)})}this.trigger({src:e,type:"sourceset"})};r.manualProgressOn=function(){this.on("durationchange",this.onDurationChange);this.manualProgress=!0;this.one("ready",this.trackProgress)};r.manualProgressOff=function(){this.manualProgress=!1;this.stopTrackingProgress();this.off("durationchange",this.onDurationChange)};r.trackProgress=function(){this.stopTrackingProgress();this.progressInterval=this.setInterval(ve(this,function(){var e=this.bufferedPercent();if(this.bufferedPercent_!==e){this.trigger("progress")}this.bufferedPercent_=e;if(1===e){this.stopTrackingProgress()}}),500)};r.onDurationChange=function(){this.duration_=this.duration()};r.buffered=function(){return _t(0,0)};r.bufferedPercent=function(){return ft(this.buffered(),this.duration_)};r.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)};r.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0;this.on("play",this.trackCurrentTime);this.on("pause",this.stopTrackingCurrentTime)};r.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1;this.stopTrackingCurrentTime();this.off("play",this.trackCurrentTime);this.off("pause",this.stopTrackingCurrentTime)};r.trackCurrentTime=function(){if(this.currentTimeInterval){this.stopTrackingCurrentTime()}this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)};r.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval);this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})};r.dispose=function(){this.clearTracks(va.names);if(this.manualProgress){this.manualProgressOff()}if(this.manualTimeUpdates){this.manualTimeUpdatesOff()}a.prototype.dispose.call(this)};r.clearTracks=function(e){var t=this;e=[].concat(e);e.forEach(function(e){var a=t[e+"Tracks"]()||[],n=a.length;while(n--){var r=a[n];if("text"===e){t.removeRemoteTextTrack(r)}a.removeTrack(r)}})};r.cleanupAutoTextTracks=function(){var e=this.autoRemoteTextTracks_||[],t=e.length;while(t--){var a=e[t];this.removeRemoteTextTrack(a)}};r.reset=function(){};r.error=function(e){if(e!==void 0){this.error_=new Et(e);this.trigger("error")}return this.error_};r.played=function(){if(this.hasStarted_){return _t(0,0)}return _t()};r.setCurrentTime=function(){if(this.manualTimeUpdates){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}};r.initTrackListeners=function(){var e=this;va.names.forEach(function(t){var a=va[t],n=function(){e.trigger(t+"trackchange")},r=e[a.getterName]();r.addEventListener("removetrack",n);r.addEventListener("addtrack",n);e.on("dispose",function(){r.removeEventListener("removetrack",n);r.removeEventListener("addtrack",n)})})};r.addWebVttScript_=function(){var a=this;if(e.WebVTT){return}if(t.body.contains(this.el())){if(!this.options_["vtt.js"]&&h(en)&&0",className:this.buildCSSClass(),tabIndex:0},a);if("button"===t){s.error("Creating a ClickableComponent with an HTML element of "+t+" is not supported; use a Button instead.")}n=g({role:"button"},n);this.tabIndex_=a.tabIndex;var r=e.prototype.createEl.call(this,t,a,n);this.createControlTextEl(r);return r};a.dispose=function(){this.controlTextEl_=null;e.prototype.dispose.call(this)};a.createControlTextEl=function(e){this.controlTextEl_=E("span",{className:"vjs-control-text"},{"aria-live":"polite"});if(e){e.appendChild(this.controlTextEl_)}this.controlText(this.controlText_,e);return this.controlTextEl_};a.controlText=function(e,t){if(void 0===t){t=this.el()}if(e===void 0){return this.controlText_||"Need Text"}var a=this.localize(e);this.controlText_=e;I(this.controlTextEl_,a);if(!this.nonIconControl){t.setAttribute("title",a)}};a.buildCSSClass=function(){return"vjs-control vjs-button "+e.prototype.buildCSSClass.call(this)};a.enable=function(){if(!this.enabled_){this.enabled_=!0;this.removeClass("vjs-disabled");this.el_.setAttribute("aria-disabled","false");if("undefined"!=typeof this.tabIndex_){this.el_.setAttribute("tabIndex",this.tabIndex_)}this.on(["tap","click"],this.handleClick);this.on("keydown",this.handleKeyDown)}};a.disable=function(){this.enabled_=!1;this.addClass("vjs-disabled");this.el_.setAttribute("aria-disabled","true");if("undefined"!=typeof this.tabIndex_){this.el_.removeAttribute("tabIndex")}this.off("mouseover",this.handleMouseOver);this.off("mouseout",this.handleMouseOut);this.off(["tap","click"],this.handleClick);this.off("keydown",this.handleKeyDown)};a.handleClick=function(){if(this.options_.clickHandler){this.options_.clickHandler.call(this,arguments)}};a.handleKeyDown=function(t){if(wt.isEventKey(t,"Space")||wt.isEventKey(t,"Enter")){t.preventDefault();t.stopPropagation();this.trigger("click")}else{e.prototype.handleKeyDown.call(this,t)}};return t}(qe);qe.registerComponent("ClickableComponent",Pn);var Dn=function(e){Ge(t,e);function t(t,a){var n=e.call(this,t,a)||this;n.update();t.on("posterchange",ve(Ve(n),n.update));return n}var a=t.prototype;a.dispose=function(){this.player().off("posterchange",this.update);e.prototype.dispose.call(this)};a.createEl=function(){var e=E("div",{className:"vjs-poster",tabIndex:-1});return e};a.update=function(){var e=this.player().poster();this.setSrc(e);if(e){this.show()}else{this.hide()}};a.setSrc=function(e){var t="";if(e){t="url(\""+e+"\")"}this.el_.style.backgroundImage=t};a.handleClick=function(){if(!this.player_.controls()){return}var e=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&0",className:this.buildCSSClass()},t);a=g({type:"button"},a);var n=qe.prototype.createEl.call(this,e,t,a);this.createControlTextEl(n);return n};a.addChild=function(e,t){if(void 0===t){t={}}var a=this.constructor.name;s.warn("Adding an actionable (user controllable) child to a Button ("+a+") is not supported; use a ClickableComponent instead.");return qe.prototype.addChild.call(this,e,t)};a.enable=function(){e.prototype.enable.call(this);this.el_.removeAttribute("disabled")};a.disable=function(){e.prototype.disable.call(this);this.el_.setAttribute("disabled","disabled")};a.handleKeyDown=function(t){if(wt.isEventKey(t,"Space")||wt.isEventKey(t,"Enter")){t.stopPropagation();return}e.prototype.handleKeyDown.call(this,t)};return t}(Pn);qe.registerComponent("Button",Mn);var Bn=function(e){Ge(t,e);function t(t,a){var n=e.call(this,t,a)||this;n.mouseused_=!1;n.on("mousedown",n.handleMouseDown);return n}var a=t.prototype;a.buildCSSClass=function(){return"vjs-big-play-button"};a.handleClick=function(e){var t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY){var a=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&0e?0:e;var a=Math.floor(e%60),n=Math.floor(e/60%60),r=Math.floor(e/3600),i=Math.floor(t/60%60),o=Math.floor(t/3600);if(isNaN(e)||e===1/0){r=n=a="-"}r=0n?"0"+n:n)+":";a=10>a?"0"+a:a;return r+n+a},qn=Hn;function Vn(e,t){if(void 0===t){t=e}return qn(e,t)}var Wn=function(e){Ge(a,e);function a(t,a){var n=e.call(this,t,a)||this;n.on(t,["timeupdate","ended"],n.updateContent);n.updateTextNode_();return n}var n=a.prototype;n.createEl=function(){var t=this.buildCSSClass(),a=e.prototype.createEl.call(this,"div",{className:t+" vjs-time-control vjs-control",innerHTML:""+this.localize(this.labelText_)+"\xA0"});this.contentEl_=E("span",{className:t+"-display"},{"aria-live":"off",role:"presentation"});a.appendChild(this.contentEl_);return a};n.dispose=function(){this.contentEl_=null;this.textNode_=null;e.prototype.dispose.call(this)};n.updateTextNode_=function(e){var a=this;if(void 0===e){e=0}e=Vn(e);if(this.formattedTime_===e){return}this.formattedTime_=e;this.requestAnimationFrame(function(){if(!a.contentEl_){return}var e=a.textNode_;a.textNode_=t.createTextNode(a.formattedTime_);if(!a.textNode_){return}if(e){a.contentEl_.replaceChild(a.textNode_,e)}else{a.contentEl_.appendChild(a.textNode_)}})};n.updateContent=function(){};return a}(qe);Wn.prototype.labelText_="Time";Wn.prototype.controlText_="Time";qe.registerComponent("TimeDisplay",Wn);var zn=function(e){Ge(t,e);function t(){return e.apply(this,arguments)||this}var a=t.prototype;a.buildCSSClass=function(){return"vjs-current-time"};a.updateContent=function(){var e;if(this.player_.ended()){e=this.player_.duration()}else{e=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}this.updateTextNode_(e)};return t}(Wn);zn.prototype.labelText_="Current Time";zn.prototype.controlText_="Current Time";qe.registerComponent("CurrentTimeDisplay",zn);var Gn=function(e){Ge(t,e);function t(t,a){var n=e.call(this,t,a)||this;n.on(t,"durationchange",n.updateContent);n.on(t,"loadstart",n.updateContent);n.on(t,"loadedmetadata",n.updateContent);return n}var a=t.prototype;a.buildCSSClass=function(){return"vjs-duration"};a.updateContent=function(){var e=this.player_.duration();this.updateTextNode_(e)};return t}(Wn);Gn.prototype.labelText_="Duration";Gn.prototype.controlText_="Duration";qe.registerComponent("DurationDisplay",Gn);var Kn=function(e){Ge(t,e);function t(){return e.apply(this,arguments)||this}var a=t.prototype;a.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"
                      /
                      "},{"aria-hidden":!0})};return t}(qe);qe.registerComponent("TimeDivider",Kn);var Yn=function(e){Ge(t,e);function t(t,a){var n=e.call(this,t,a)||this;n.on(t,"durationchange",n.updateContent);return n}var a=t.prototype;a.buildCSSClass=function(){return"vjs-remaining-time"};a.createEl=function(){var t=e.prototype.createEl.call(this);t.insertBefore(E("span",{},{"aria-hidden":!0},"-"),this.contentEl_);return t};a.updateContent=function(){if("number"!=typeof this.player_.duration()){return}var e;if(this.player_.ended()){e=0}else if(this.player_.remainingTimeDisplay){e=this.player_.remainingTimeDisplay()}else{e=this.player_.remainingTime()}this.updateTextNode_(e)};return t}(Wn);Yn.prototype.labelText_="Remaining Time";Yn.prototype.controlText_="Remaining Time";qe.registerComponent("RemainingTimeDisplay",Yn);var Xn=function(e){Ge(t,e);function t(t,a){var n=e.call(this,t,a)||this;n.updateShowing();n.on(n.player(),"durationchange",n.updateShowing);return n}var a=t.prototype;a.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});this.contentEl_=E("div",{className:"vjs-live-display",innerHTML:""+this.localize("Stream Type")+"\xA0"+this.localize("LIVE")},{"aria-live":"off"});t.appendChild(this.contentEl_);return t};a.dispose=function(){this.contentEl_=null;e.prototype.dispose.call(this)};a.updateShowing=function(){if(this.player().duration()===1/0){this.show()}else{this.hide()}};return t}(qe);qe.registerComponent("LiveDisplay",Xn);var $n=function(e){Ge(t,e);function t(t,a){var n=e.call(this,t,a)||this;n.updateLiveEdgeStatus();if(n.player_.liveTracker){n.on(n.player_.liveTracker,"liveedgechange",n.updateLiveEdgeStatus)}return n}var a=t.prototype;a.createEl=function(){var t=e.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});this.textEl_=E("span",{className:"vjs-seek-to-live-text",innerHTML:this.localize("LIVE")},{"aria-hidden":"true"});t.appendChild(this.textEl_);return t};a.updateLiveEdgeStatus=function(){if(!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()){this.setAttribute("aria-disabled",!0);this.addClass("vjs-at-live-edge");this.controlText("Seek to live, currently playing live")}else{this.setAttribute("aria-disabled",!1);this.removeClass("vjs-at-live-edge");this.controlText("Seek to live, currently behind live")}};a.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()};a.dispose=function(){if(this.player_.liveTracker){this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatus)}this.textEl_=null;e.prototype.dispose.call(this)};return t}(Mn);$n.prototype.controlText_="Seek to live, currently playing live";qe.registerComponent("SeekToLive",$n);var Qn=function(e,t,a){e=+e;return Math.min(a,Math.max(t,isNaN(e)?t:e))},Jn=function(e){Ge(t,e);function t(t,a){var n=e.call(this,t,a)||this;n.bar=n.getChild(n.options_.barName);n.vertical(!!n.options_.vertical);n.enable();return n}var a=t.prototype;a.enabled=function(){return this.enabled_};a.enable=function(){if(this.enabled()){return}this.on("mousedown",this.handleMouseDown);this.on("touchstart",this.handleMouseDown);this.on("keydown",this.handleKeyDown);this.on("click",this.handleClick);this.on(this.player_,"controlsvisible",this.update);if(this.playerEvent){this.on(this.player_,this.playerEvent,this.update)}this.removeClass("disabled");this.setAttribute("tabindex",0);this.enabled_=!0};a.disable=function(){if(!this.enabled()){return}var e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown);this.off("touchstart",this.handleMouseDown);this.off("keydown",this.handleKeyDown);this.off("click",this.handleClick);this.off(this.player_,"controlsvisible",this.update);this.off(e,"mousemove",this.handleMouseMove);this.off(e,"mouseup",this.handleMouseUp);this.off(e,"touchmove",this.handleMouseMove);this.off(e,"touchend",this.handleMouseUp);this.removeAttribute("tabindex");this.addClass("disabled");if(this.playerEvent){this.off(this.player_,this.playerEvent,this.update)}this.enabled_=!1};a.createEl=function(t,a,n){if(void 0===a){a={}}if(void 0===n){n={}}a.className=a.className+" vjs-slider";a=g({tabIndex:0},a);n=g({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},n);return e.prototype.createEl.call(this,t,a,n)};a.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;if("mousedown"===e.type){e.preventDefault()}if("touchstart"===e.type&&!nt){e.preventDefault()}M();this.addClass("vjs-sliding");this.trigger("slideractive");this.on(t,"mousemove",this.handleMouseMove);this.on(t,"mouseup",this.handleMouseUp);this.on(t,"touchmove",this.handleMouseMove);this.on(t,"touchend",this.handleMouseUp);this.handleMouseMove(e)};a.handleMouseMove=function(){};a.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;B();this.removeClass("vjs-sliding");this.trigger("sliderinactive");this.off(e,"mousemove",this.handleMouseMove);this.off(e,"mouseup",this.handleMouseUp);this.off(e,"touchmove",this.handleMouseMove);this.off(e,"touchend",this.handleMouseUp);this.update()};a.update=function(){var e=this;if(!this.el_||!this.bar){return}var t=this.getProgress();if(t===this.progress_){return t}this.progress_=t;this.requestAnimationFrame(function(){var a=e.vertical()?"height":"width";e.bar.el().style[a]=(100*t).toFixed(2)+"%"});return t};a.getProgress=function(){return+Qn(this.getPercent(),0,1).toFixed(4)};a.calculateDistance=function(e){var t=H(this.el_,e);if(this.vertical()){return t.y}return t.x};a.handleKeyDown=function(t){if(wt.isEventKey(t,"Left")||wt.isEventKey(t,"Down")){t.preventDefault();t.stopPropagation();this.stepBack()}else if(wt.isEventKey(t,"Right")||wt.isEventKey(t,"Up")){t.preventDefault();t.stopPropagation();this.stepForward()}else{e.prototype.handleKeyDown.call(this,t)}};a.handleClick=function(e){e.stopPropagation();e.preventDefault()};a.vertical=function(e){if(e===void 0){return this.vertical_||!1}this.vertical_=!!e;if(this.vertical_){this.addClass("vjs-slider-vertical")}else{this.addClass("vjs-slider-horizontal")}};return t}(qe);qe.registerComponent("Slider",Jn);var Zn=function(e,t){return Qn(100*(e/t),0,100).toFixed(2)+"%"},er=function(e){Ge(a,e);function a(t,a){var n=e.call(this,t,a)||this;n.partEls_=[];n.on(t,"progress",n.update);return n}var n=a.prototype;n.createEl=function(){var a=e.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),n=E("span",{className:"vjs-control-text"}),r=E("span",{textContent:this.localize("Loaded")}),i=t.createTextNode(": ");this.percentageEl_=E("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"});a.appendChild(n);n.appendChild(r);n.appendChild(i);n.appendChild(this.percentageEl_);return a};n.dispose=function(){this.partEls_=null;this.percentageEl_=null;e.prototype.dispose.call(this)};n.update=function(){var e=this;this.requestAnimationFrame(function(){var t=e.player_.liveTracker,a=e.player_.buffered(),n=t&&t.isLive()?t.seekableEnd():e.player_.duration(),r=e.player_.bufferedEnd(),s=e.partEls_,o=Zn(r,n);if(e.percent_!==o){e.el_.style.width=o;I(e.percentageEl_,o);e.percent_=o}for(var l=0;la.length;c--){e.el_.removeChild(s[c-1])}s.length=a.length})};return a}(qe);qe.registerComponent("LoadProgressBar",er);var tr=function(e){Ge(t,e);function t(t,a){var n=e.call(this,t,a)||this;n.update=Se(ve(Ve(n),n.update),be);return n}var a=t.prototype;a.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})};a.update=function(e,t,a){var n=j(this.el_),r=j(this.player_.el()),i=e.width*t;if(!r||!n){return}var s=e.left-r.left+i,o=e.width-i+(r.right-e.right),l=n.width/2;if(sl){l=0}else if(l>n.width){l=n.width}this.el_.style.right="-"+l+"px";this.write(a)};a.write=function(e){I(this.el_,e)};a.updateTime=function(e,t,a,n){var r=this;if(this.rafId_){this.cancelAnimationFrame(this.rafId_)}this.rafId_=this.requestAnimationFrame(function(){var i,s=r.player_.duration();if(r.player_.liveTracker&&r.player_.liveTracker.isLive()){var o=r.player_.liveTracker.liveWindow(),l=o-t*o;i=(1>l?"":"-")+Vn(l,o)}else{i=Vn(a,s)}r.update(e,t,i);if(n){n()}})};return t}(qe);qe.registerComponent("TimeTooltip",tr);var ar=function(e){Ge(t,e);function t(t,a){var n=e.call(this,t,a)||this;n.update=Se(ve(Ve(n),n.update),be);return n}var a=t.prototype;a.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})};a.update=function(e,t){var a=this.getChild("timeTooltip");if(!a){return}var n=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();a.updateTime(e,t,n)};return t}(qe);ar.prototype.options_={children:[]};if(!ut&&!Je){ar.prototype.options_.children.push("timeTooltip")}qe.registerComponent("PlayProgressBar",ar);var nr=function(e){Ge(t,e);function t(t,a){var n=e.call(this,t,a)||this;n.update=Se(ve(Ve(n),n.update),be);return n}var a=t.prototype;a.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})};a.update=function(e,t){var a=this,n=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,n,function(){a.el_.style.left=e.width*t+"px"})};return t}(qe);nr.prototype.options_={children:["timeTooltip"]};qe.registerComponent("MouseTimeDisplay",nr);var rr=12,ir=function(e){Ge(a,e);function a(t,a){var n=e.call(this,t,a)||this;n.setEventHandlers_();return n}var n=a.prototype;n.setEventHandlers_=function(){this.update_=ve(this,this.update);this.update=Se(this.update_,be);this.on(this.player_,["ended","durationchange","timeupdate"],this.update);if(this.player_.liveTracker){this.on(this.player_.liveTracker,"liveedgechange",this.update)}this.updateInterval=null;this.on(this.player_,["playing"],this.enableInterval_);this.on(this.player_,["ended","pause","waiting"],this.disableInterval_);if("hidden"in t&&"visibilityState"in t){this.on(t,"visibilitychange",this.toggleVisibility_)}};n.toggleVisibility_=function(a){if(t.hidden){this.disableInterval_(a)}else{this.enableInterval_();this.update()}};n.enableInterval_=function(){if(this.updateInterval){return}this.updateInterval=this.setInterval(this.update,be)};n.disableInterval_=function(t){if(this.player_.liveTracker&&this.player_.liveTracker.isLive()&&"ended"!==t.type){return}if(!this.updateInterval){return}this.clearInterval(this.updateInterval);this.updateInterval=null};n.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})};n.update=function(){var t=this,a=e.prototype.update.call(this);this.requestAnimationFrame(function(){var e=t.player_.ended()?t.player_.duration():t.getCurrentTime_(),n=t.player_.liveTracker,r=t.player_.duration();if(n&&n.isLive()){r=t.player_.liveTracker.liveCurrentTime()}if(t.percent_!==a){t.el_.setAttribute("aria-valuenow",(100*a).toFixed(2));t.percent_=a}if(t.currentTime_!==e||t.duration_!==r){t.el_.setAttribute("aria-valuetext",t.localize("progress bar timing: currentTime={1} duration={2}",[Vn(e,r),Vn(r,r)],"{1} of {2}"));t.currentTime_=e;t.duration_=r}if(t.bar){t.bar.update(j(t.el()),t.getProgress())}});return a};n.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()};n.getPercent=function(){var e=this.getCurrentTime_(),t,a=this.player_.liveTracker;if(a&&a.isLive()){t=(e-a.seekableStart())/a.liveWindow();if(a.atLiveEdge()){t=1}}else{t=e/this.player_.duration()}return t};n.handleMouseDown=function(t){if(!K(t)){return}t.stopPropagation();this.player_.scrubbing(!0);this.videoWasPlaying=!this.player_.paused();this.player_.pause();e.prototype.handleMouseDown.call(this,t)};n.handleMouseMove=function(e){if(!K(e)){return}var t,a=this.calculateDistance(e),n=this.player_.liveTracker;if(!n||!n.isLive()){t=a*this.player_.duration();if(t===this.player_.duration()){t=t-.1}}else{var r=n.seekableStart(),i=n.liveCurrentTime();t=r+a*n.liveWindow();if(t>=i){t=i}if(t<=r){t=r+.1}if(t===1/0){return}}this.player_.currentTime(t)};n.enable=function(){e.prototype.enable.call(this);var t=this.getChild("mouseTimeDisplay");if(!t){return}t.show()};n.disable=function(){e.prototype.disable.call(this);var t=this.getChild("mouseTimeDisplay");if(!t){return}t.hide()};n.handleMouseUp=function(t){e.prototype.handleMouseUp.call(this,t);if(t){t.stopPropagation()}this.player_.scrubbing(!1);this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0});if(this.videoWasPlaying){Lt(this.player_.play())}else{this.update_()}};n.stepForward=function(){this.player_.currentTime(this.player_.currentTime()+5)};n.stepBack=function(){this.player_.currentTime(this.player_.currentTime()-5)};n.handleAction=function(){if(this.player_.paused()){this.player_.play()}else{this.player_.pause()}};n.handleKeyDown=function(t){if(wt.isEventKey(t,"Space")||wt.isEventKey(t,"Enter")){t.preventDefault();t.stopPropagation();this.handleAction(t)}else if(wt.isEventKey(t,"Home")){t.preventDefault();t.stopPropagation();this.player_.currentTime(0)}else if(wt.isEventKey(t,"End")){t.preventDefault();t.stopPropagation();this.player_.currentTime(this.player_.duration())}else if(/^[0-9]$/.test(wt(t))){t.preventDefault();t.stopPropagation();var a=10*(wt.codes[wt(t)]-wt.codes[0])/100;this.player_.currentTime(this.player_.duration()*a)}else if(wt.isEventKey(t,"PgDn")){t.preventDefault();t.stopPropagation();this.player_.currentTime(this.player_.currentTime()-5*rr)}else if(wt.isEventKey(t,"PgUp")){t.preventDefault();t.stopPropagation();this.player_.currentTime(this.player_.currentTime()+5*rr)}else{e.prototype.handleKeyDown.call(this,t)}};return a}(Jn);ir.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};if(!ut&&!Je){ir.prototype.options_.children.splice(1,0,"mouseTimeDisplay")}qe.registerComponent("SeekBar",ir);var sr=function(e){Ge(t,e);function t(t,a){var n=e.call(this,t,a)||this;n.handleMouseMove=Se(ve(Ve(n),n.handleMouseMove),be);n.throttledHandleMouseSeek=Se(ve(Ve(n),n.handleMouseSeek),be);n.enable();return n}var a=t.prototype;a.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})};a.handleMouseMove=function(e){var t=this.getChild("seekBar");if(!t){return}var a=t.getChild("playProgressBar"),n=t.getChild("mouseTimeDisplay");if(!a&&!n){return}var r=t.el(),i=j(r),s=H(r,e).x;s=Qn(0,1,s);if(n){n.update(i,s)}if(a){a.update(i,t.getProgress())}};a.handleMouseSeek=function(e){var t=this.getChild("seekBar");if(t){t.handleMouseMove(e)}};a.enabled=function(){return this.enabled_};a.disable=function(){this.children().forEach(function(e){return e.disable&&e.disable()});if(!this.enabled()){return}this.off(["mousedown","touchstart"],this.handleMouseDown);this.off(this.el_,"mousemove",this.handleMouseMove);this.handleMouseUp();this.addClass("disabled");this.enabled_=!1};a.enable=function(){this.children().forEach(function(e){return e.enable&&e.enable()});if(this.enabled()){return}this.on(["mousedown","touchstart"],this.handleMouseDown);this.on(this.el_,"mousemove",this.handleMouseMove);this.removeClass("disabled");this.enabled_=!0};a.handleMouseDown=function(e){var t=this.el_.ownerDocument,a=this.getChild("seekBar");if(a){a.handleMouseDown(e)}this.on(t,"mousemove",this.throttledHandleMouseSeek);this.on(t,"touchmove",this.throttledHandleMouseSeek);this.on(t,"mouseup",this.handleMouseUp);this.on(t,"touchend",this.handleMouseUp)};a.handleMouseUp=function(e){var t=this.el_.ownerDocument,a=this.getChild("seekBar");if(a){a.handleMouseUp(e)}this.off(t,"mousemove",this.throttledHandleMouseSeek);this.off(t,"touchmove",this.throttledHandleMouseSeek);this.off(t,"mouseup",this.handleMouseUp);this.off(t,"touchend",this.handleMouseUp)};return t}(qe);sr.prototype.options_={children:["seekBar"]};qe.registerComponent("ProgressControl",sr);var or=function(e){Ge(a,e);function a(a,n){var r=e.call(this,a,n)||this;r.on(a,["enterpictureinpicture","leavepictureinpicture"],r.handlePictureInPictureChange);if(!t.pictureInPictureEnabled){r.disable()}return r}var n=a.prototype;n.buildCSSClass=function(){return"vjs-picture-in-picture-control "+e.prototype.buildCSSClass.call(this)};n.handlePictureInPictureChange=function(){if(this.player_.isInPictureInPicture()){this.controlText("Exit Picture-in-Picture")}else{this.controlText("Picture-in-Picture")}};n.handleClick=function(){if(!this.player_.isInPictureInPicture()){this.player_.requestPictureInPicture()}else{this.player_.exitPictureInPicture()}};return a}(Mn);or.prototype.controlText_="Picture-in-Picture";qe.registerComponent("PictureInPictureToggle",or);var lr=function(e){Ge(a,e);function a(a,n){var r=e.call(this,a,n)||this;r.on(a,"fullscreenchange",r.handleFullscreenChange);if(!1===t[a.fsApi_.fullscreenEnabled]){r.disable()}return r}var n=a.prototype;n.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this)};n.handleFullscreenChange=function(){if(this.player_.isFullscreen()){this.controlText("Non-Fullscreen")}else{this.controlText("Fullscreen")}};n.handleClick=function(){if(!this.player_.isFullscreen()){this.player_.requestFullscreen()}else{this.player_.exitFullscreen()}};return a}(Mn);lr.prototype.controlText_="Fullscreen";qe.registerComponent("FullscreenToggle",lr);var dr=function(e,t){if(t.tech_&&!t.tech_.featuresVolumeControl){e.addClass("vjs-hidden")}e.on(t,"loadstart",function(){if(!t.tech_.featuresVolumeControl){e.addClass("vjs-hidden")}else{e.removeClass("vjs-hidden")}})},pr=function(e){Ge(t,e);function t(){return e.apply(this,arguments)||this}var a=t.prototype;a.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:""})};return t}(qe);qe.registerComponent("VolumeLevel",pr);var ur=function(e){Ge(t,e);function t(t,a){var n=e.call(this,t,a)||this;n.on("slideractive",n.updateLastVolume_);n.on(t,"volumechange",n.updateARIAAttributes);t.ready(function(){return n.updateARIAAttributes()});return n}var a=t.prototype;a.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})};a.handleMouseDown=function(t){if(!K(t)){return}e.prototype.handleMouseDown.call(this,t)};a.handleMouseMove=function(e){if(!K(e)){return}this.checkMuted();this.player_.volume(this.calculateDistance(e))};a.checkMuted=function(){if(this.player_.muted()){this.player_.muted(!1)}};a.getPercent=function(){if(this.player_.muted()){return 0}return this.player_.volume()};a.stepForward=function(){this.checkMuted();this.player_.volume(this.player_.volume()+.1)};a.stepBack=function(){this.checkMuted();this.player_.volume(this.player_.volume()-.1)};a.updateARIAAttributes=function(){var e=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",e);this.el_.setAttribute("aria-valuetext",e+"%")};a.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())};a.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",function(){if(0===e.player_.volume()){e.player_.lastVolume_(t)}})};return t}(Jn);ur.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};ur.prototype.playerEvent="volumechange";qe.registerComponent("VolumeBar",ur);var cr=function(e){Ge(t,e);function t(t,a){var n;if(void 0===a){a={}}a.vertical=a.vertical||!1;if("undefined"==typeof a.volumeBar||h(a.volumeBar)){a.volumeBar=a.volumeBar||{};a.volumeBar.vertical=a.vertical}n=e.call(this,t,a)||this;dr(Ve(n),t);n.throttledHandleMouseMove=Se(ve(Ve(n),n.handleMouseMove),be);n.on("mousedown",n.handleMouseDown);n.on("touchstart",n.handleMouseDown);n.on(n.volumeBar,["focus","slideractive"],function(){n.volumeBar.addClass("vjs-slider-active");n.addClass("vjs-slider-active");n.trigger("slideractive")});n.on(n.volumeBar,["blur","sliderinactive"],function(){n.volumeBar.removeClass("vjs-slider-active");n.removeClass("vjs-slider-active");n.trigger("sliderinactive")});return n}var a=t.prototype;a.createEl=function(){var t="vjs-volume-horizontal";if(this.options_.vertical){t="vjs-volume-vertical"}return e.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+t})};a.handleMouseDown=function(){var e=this.el_.ownerDocument;this.on(e,"mousemove",this.throttledHandleMouseMove);this.on(e,"touchmove",this.throttledHandleMouseMove);this.on(e,"mouseup",this.handleMouseUp);this.on(e,"touchend",this.handleMouseUp)};a.handleMouseUp=function(){var e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseMove);this.off(e,"touchmove",this.throttledHandleMouseMove);this.off(e,"mouseup",this.handleMouseUp);this.off(e,"touchend",this.handleMouseUp)};a.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)};return t}(qe);cr.prototype.options_={children:["volumeBar"]};qe.registerComponent("VolumeControl",cr);var mr=function(e,t){if(t.tech_&&!t.tech_.featuresMuteControl){e.addClass("vjs-hidden")}e.on(t,"loadstart",function(){if(!t.tech_.featuresMuteControl){e.addClass("vjs-hidden")}else{e.removeClass("vjs-hidden")}})},gr=function(e){Ge(t,e);function t(t,a){var n=e.call(this,t,a)||this;mr(Ve(n),t);n.on(t,["loadstart","volumechange"],n.update);return n}var a=t.prototype;a.buildCSSClass=function(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this)};a.handleClick=function(){var e=this.player_.volume(),t=this.player_.lastVolume_();if(0===e){var a=.1>t?.1:t;this.player_.volume(a);this.player_.muted(!1)}else{this.player_.muted(this.player_.muted()?!1:!0)}};a.update=function(){this.updateIcon_();this.updateControlText_()};a.updateIcon_=function(){var e=this.player_.volume(),t=3;if(ut&&this.player_.tech_&&this.player_.tech_.el_){this.player_.muted(this.player_.tech_.el_.muted)}if(0===e||this.player_.muted()){t=0}else if(.33>e){t=1}else if(.67>e){t=2}for(var a=0;4>a;a++){D(this.el_,"vjs-vol-"+a)}P(this.el_,"vjs-vol-"+t)};a.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume(),t=e?"Unmute":"Mute";if(this.controlText()!==t){this.controlText(t)}};return t}(Mn);gr.prototype.controlText_="Mute";qe.registerComponent("MuteToggle",gr);var yr=function(e){Ge(a,e);function a(t,a){var n;if(void 0===a){a={}}if("undefined"!=typeof a.inline){a.inline=a.inline}else{a.inline=!0}if("undefined"==typeof a.volumeControl||h(a.volumeControl)){a.volumeControl=a.volumeControl||{};a.volumeControl.vertical=!a.inline}n=e.call(this,t,a)||this;n.on(t,["loadstart"],n.volumePanelState_);n.on(n.muteToggle,"keyup",n.handleKeyPress);n.on(n.volumeControl,"keyup",n.handleVolumeControlKeyUp);n.on("keydown",n.handleKeyPress);n.on("mouseover",n.handleMouseOver);n.on("mouseout",n.handleMouseOut);n.on(n.volumeControl,["slideractive"],n.sliderActive_);n.on(n.volumeControl,["sliderinactive"],n.sliderInactive_);return n}var n=a.prototype;n.sliderActive_=function(){this.addClass("vjs-slider-active")};n.sliderInactive_=function(){this.removeClass("vjs-slider-active")};n.volumePanelState_=function(){if(this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")){this.addClass("vjs-hidden")}if(this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")){this.addClass("vjs-mute-toggle-only")}};n.createEl=function(){var t="vjs-volume-panel-horizontal";if(!this.options_.inline){t="vjs-volume-panel-vertical"}return e.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+t})};n.dispose=function(){this.handleMouseOut();e.prototype.dispose.call(this)};n.handleVolumeControlKeyUp=function(e){if(wt.isEventKey(e,"Esc")){this.muteToggle.focus()}};n.handleMouseOver=function(){this.addClass("vjs-hover");ge(t,"keyup",ve(this,this.handleKeyPress))};n.handleMouseOut=function(){this.removeClass("vjs-hover");ye(t,"keyup",ve(this,this.handleKeyPress))};n.handleKeyPress=function(e){if(wt.isEventKey(e,"Esc")){this.handleMouseOut()}};return a}(qe);yr.prototype.options_={children:["muteToggle","volumeControl"]};qe.registerComponent("VolumePanel",yr);var hr=function(e){Ge(a,e);function a(t,a){var n=e.call(this,t,a)||this;if(a){n.menuButton_=a.menuButton}n.focusedChild_=-1;n.on("keydown",n.handleKeyDown);n.boundHandleBlur_=ve(Ve(n),n.handleBlur);n.boundHandleTapClick_=ve(Ve(n),n.handleTapClick);return n}var n=a.prototype;n.addEventListenerForItem=function(e){if(!(e instanceof qe)){return}this.on(e,"blur",this.boundHandleBlur_);this.on(e,["tap","click"],this.boundHandleTapClick_)};n.removeEventListenerForItem=function(e){if(!(e instanceof qe)){return}this.off(e,"blur",this.boundHandleBlur_);this.off(e,["tap","click"],this.boundHandleTapClick_)};n.removeChild=function(t){if("string"==typeof t){t=this.getChild(t)}this.removeEventListenerForItem(t);e.prototype.removeChild.call(this,t)};n.addItem=function(e){var t=this.addChild(e);if(t){this.addEventListenerForItem(t)}};n.createEl=function(){var t=this.options_.contentElType||"ul";this.contentEl_=E(t,{className:"vjs-menu-content"});this.contentEl_.setAttribute("role","menu");var a=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});a.appendChild(this.contentEl_);ge(a,"click",function(e){e.preventDefault();e.stopImmediatePropagation()});return a};n.dispose=function(){this.contentEl_=null;this.boundHandleBlur_=null;this.boundHandleTapClick_=null;e.prototype.dispose.call(this)};n.handleBlur=function(e){var a=e.relatedTarget||t.activeElement;if(!this.children().some(function(e){return e.el()===a})){var n=this.menuButton_;if(n&&n.buttonPressed_&&a!==n.el().firstChild){n.unpressButton()}}};n.handleTapClick=function(e){if(this.menuButton_){this.menuButton_.unpressButton();var t=this.children();if(!Array.isArray(t)){return}var a=t.filter(function(t){return t.el()===e.target})[0];if(!a){return}if("CaptionSettingsMenuItem"!==a.name()){this.menuButton_.focus()}}};n.handleKeyDown=function(e){if(wt.isEventKey(e,"Left")||wt.isEventKey(e,"Down")){e.preventDefault();e.stopPropagation();this.stepForward()}else if(wt.isEventKey(e,"Right")||wt.isEventKey(e,"Up")){e.preventDefault();e.stopPropagation();this.stepBack()}};n.stepForward=function(){var e=0;if(this.focusedChild_!==void 0){e=this.focusedChild_+1}this.focus(e)};n.stepBack=function(){var e=0;if(this.focusedChild_!==void 0){e=this.focusedChild_-1}this.focus(e)};n.focus=function(e){if(void 0===e){e=0}var t=this.children().slice(),a=t.length&&t[0].className&&/vjs-menu-title/.test(t[0].className);if(a){t.shift()}if(0e){e=0}else if(e>=t.length){e=t.length-1}this.focusedChild_=e;t[e].el_.focus()}};return a}(qe);qe.registerComponent("Menu",hr);var _r=function(e){Ge(a,e);function a(a,n){var r;if(void 0===n){n={}}r=e.call(this,a,n)||this;r.menuButton_=new Mn(a,n);r.menuButton_.controlText(r.controlText_);r.menuButton_.el_.setAttribute("aria-haspopup","true");var i=Mn.prototype.buildCSSClass();r.menuButton_.el_.className=r.buildCSSClass()+" "+i;r.menuButton_.removeClass("vjs-control");r.addChild(r.menuButton_);r.update();r.enabled_=!0;r.on(r.menuButton_,"tap",r.handleClick);r.on(r.menuButton_,"click",r.handleClick);r.on(r.menuButton_,"keydown",r.handleKeyDown);r.on(r.menuButton_,"mouseenter",function(){r.addClass("vjs-hover");r.menu.show();ge(t,"keyup",ve(Ve(r),r.handleMenuKeyUp))});r.on("mouseleave",r.handleMouseLeave);r.on("keydown",r.handleSubmenuKeyDown);return r}var n=a.prototype;n.update=function(){var e=this.createMenu();if(this.menu){this.menu.dispose();this.removeChild(this.menu)}this.menu=e;this.addChild(e);this.buttonPressed_=!1;this.menuButton_.el_.setAttribute("aria-expanded","false");if(this.items&&this.items.length<=this.hideThreshold_){this.hide()}else{this.show()}};n.createMenu=function(){var e=new hr(this.player_,{menuButton:this});this.hideThreshold_=0;if(this.options_.title){var t=E("li",{className:"vjs-menu-title",innerHTML:je(this.options_.title),tabIndex:-1});this.hideThreshold_+=1;var a=new qe(this.player_,{el:t});e.addItem(a)}this.items=this.createItems();if(this.items){for(var n=0;n=n.items.length){n.hide()}if(!r){return Ve(n)}var i=ve(Ve(n),n.update);r.addEventListener("removetrack",i);r.addEventListener("addtrack",i);n.player_.on("ready",i);n.player_.on("dispose",function(){r.removeEventListener("removetrack",i);r.removeEventListener("addtrack",i)});return n}return t}(_r);qe.registerComponent("TrackButton",fr);var Tr=["Tab","Esc","Up","Down","Right","Left"],br=function(e){Ge(t,e);function t(t,a){var n=e.call(this,t,a)||this;n.selectable=a.selectable;n.isSelected_=a.selected||!1;n.multiSelectable=a.multiSelectable;n.selected(n.isSelected_);if(n.selectable){if(n.multiSelectable){n.el_.setAttribute("role","menuitemcheckbox")}else{n.el_.setAttribute("role","menuitemradio")}}else{n.el_.setAttribute("role","menuitem")}return n}var a=t.prototype;a.createEl=function(t,a,n){this.nonIconControl=!0;return e.prototype.createEl.call(this,"li",g({className:"vjs-menu-item",innerHTML:""+this.localize(this.options_.label)+"",tabIndex:-1},a),n)};a.handleKeyDown=function(t){if(!Tr.some(function(e){return wt.isEventKey(t,e)})){e.prototype.handleKeyDown.call(this,t)}};a.handleClick=function(){this.selected(!0)};a.selected=function(e){if(this.selectable){if(e){this.addClass("vjs-selected");this.el_.setAttribute("aria-checked","true");this.controlText(", selected");this.isSelected_=!0}else{this.removeClass("vjs-selected");this.el_.setAttribute("aria-checked","false");this.controlText("");this.isSelected_=!1}}};return t}(Pn);qe.registerComponent("MenuItem",br);var vr=function(a){Ge(n,a);function n(n,r){var i,s=r.track,o=n.textTracks();r.label=s.label||s.language||"Unknown";r.selected="showing"===s.mode;i=a.call(this,n,r)||this;i.track=s;i.kinds=(r.kinds||[r.kind||i.track.kind]).filter(Boolean);var l=function(){for(var e=arguments.length,t=Array(e),a=0;a"+this.localize(this.options_.label);if("captions"===this.options_.track.kind){r+="\n \n "+this.localize("Captions")+"\n "}r+="";var i=e.prototype.createEl.call(this,t,g({innerHTML:r},a),n);return i};return t}(vr);qe.registerComponent("SubsCapsMenuItem",Dr);var wr=function(e){Ge(t,e);function t(t,a){var n;if(void 0===a){a={}}n=e.call(this,t,a)||this;n.label_="subtitles";if(-1<["en","en-us","en-ca","fr-ca"].indexOf(n.player_.language_)){n.label_="captions"}n.menuButton_.controlText(je(n.label_));return n}var a=t.prototype;a.buildCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildCSSClass.call(this)};a.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildWrapperCSSClass.call(this)};a.createItems=function(){var t=[];if(!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")){t.push(new Lr(this.player_,{kind:this.label_}));this.hideThreshold_+=1}t=e.prototype.createItems.call(this,t,Dr);return t};return t}(kr);wr.prototype.kinds_=["captions","subtitles"];wr.prototype.controlText_="Subtitles";qe.registerComponent("SubsCapsButton",wr);var Ar=function(e){Ge(t,e);function t(t,a){var n,r=a.track,i=t.audioTracks();a.label=r.label||r.language||"Unknown";a.selected=r.enabled;n=e.call(this,t,a)||this;n.track=r;n.addClass("vjs-"+r.kind+"-menu-item");var s=function(){for(var e=arguments.length,t=Array(e),a=0;a"+this.localize(this.options_.label);if("main-desc"===this.options_.track.kind){r+="\n \n "+this.localize("Descriptions")+"\n "}r+="";var i=e.prototype.createEl.call(this,t,g({innerHTML:r},a),n);return i};a.handleClick=function(t){var a=this.player_.audioTracks();e.prototype.handleClick.call(this,t);for(var n=0,r;ne){a=t[n];break}}this.player().playbackRate(a)};a.playbackRates=function(){return this.options_.playbackRates||this.options_.playerOptions&&this.options_.playerOptions.playbackRates};a.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&0 select",id:"captions-background-color-%s",label:"Color",options:[Fr,Gr,zr,Vr,Hr,Kr,Wr,qr]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[Yr,Xr,$r]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Gr,Fr,zr,Vr,Hr,Kr,Wr,qr]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(e){return"1.00"===e?null:+e}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[Yr,Xr]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[$r,Xr,Yr]}};Qr.windowColor.options=Qr.backgroundColor.options;function Jr(e,t){if(t){e=t(e)}if(e&&"none"!==e){return e}}function Zr(e,t){var a=e.options[e.options.selectedIndex].value;return Jr(a,t)}function ei(e,t,a){if(!t){return}for(var n=0;n",this.localize(r.label),"","").join("")};n.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return["
                      ","",this.localize("Text"),"",this.createElSelect_("color",e),"",this.createElSelect_("textOpacity",e),"","
                      "].join("")};n.createElBgColor_=function(){var e="captions-background-"+this.id_;return["
                      ","",this.localize("Background"),"",this.createElSelect_("backgroundColor",e),"",this.createElSelect_("backgroundOpacity",e),"","
                      "].join("")};n.createElWinColor_=function(){var e="captions-window-"+this.id_;return["
                      ","",this.localize("Window"),"",this.createElSelect_("windowColor",e),"",this.createElSelect_("windowOpacity",e),"","
                      "].join("")};n.createElColors_=function(){return E("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})};n.createElFont_=function(){return E("div",{className:"vjs-track-settings-font",innerHTML:["
                      ",this.createElSelect_("fontPercent","","legend"),"
                      ","
                      ",this.createElSelect_("edgeStyle","","legend"),"
                      ","
                      ",this.createElSelect_("fontFamily","","legend"),"
                      "].join("")})};n.createElControls_=function(){var e=this.localize("restore all settings to the default values");return E("div",{className:"vjs-track-settings-controls",innerHTML:["",""].join("")})};n.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]};n.label=function(){return this.localize("Caption Settings Dialog")};n.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")};n.buildCSSClass=function(){return t.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"};n.getValues=function(){var e=this;return m(Qr,function(t,a,n){var r=Zr(e.$(a.selector),a.parser);if(r!==void 0){t[n]=r}return t},{})};n.setValues=function(e){var t=this;c(Qr,function(a,n){ei(t.$(a.selector),e[n],a.parser)})};n.setDefaults=function(){var e=this;c(Qr,function(t){var a=t.hasOwnProperty("default")?t["default"]:0;e.$(t.selector).selectedIndex=a})};n.restoreSettings=function(){var t;try{t=JSON.parse(e.localStorage.getItem("vjs-text-track-settings"))}catch(e){s.warn(e)}if(t){this.setValues(t)}};n.saveSettings=function(){if(!this.options_.persistTextTrackSettings){return}var t=this.getValues();try{if(Object.keys(t).length){e.localStorage.setItem("vjs-text-track-settings",JSON.stringify(t))}else{e.localStorage.removeItem("vjs-text-track-settings")}}catch(e){s.warn(e)}};n.updateDisplay=function(){var e=this.player_.getChild("textTrackDisplay");if(e){e.updateDisplay()}};n.conditionalBlur_=function(){this.previouslyActiveEl_=null;var e=this.player_.controlBar,t=e&&e.subsCapsButton,a=e&&e.captionsButton;if(t){t.focus()}else if(a){a.focus()}};return a}(Bt);qe.registerComponent("TextTrackSettings",ti);var ai=function(t){Ge(a,t);function a(a,n){var r,i=n.ResizeObserver||e.ResizeObserver;if(null===n.ResizeObserver){i=!1}var s=He({createEl:!i,reportTouchActivity:!1},n);r=t.call(this,a,s)||this;r.ResizeObserver=n.ResizeObserver||e.ResizeObserver;r.loadListener_=null;r.resizeObserver_=null;r.debouncedHandler_=ke(function(){r.resizeHandler()},100,!1,Ve(r));if(i){r.resizeObserver_=new r.ResizeObserver(r.debouncedHandler_);r.resizeObserver_.observe(a.el())}else{r.loadListener_=function(){if(!r.el_||!r.el_.contentWindow){return}var e=r.debouncedHandler_,t=r.unloadListener_=function(){ye(this,"resize",e);ye(this,"unload",t);t=null};ge(r.el_.contentWindow,"unload",t);ge(r.el_.contentWindow,"resize",e)};r.one("load",r.loadListener_)}return r}var n=a.prototype;n.createEl=function(){return t.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager",tabIndex:-1},{"aria-hidden":"true"})};n.resizeHandler=function(){if(!this.player_||!this.player_.trigger){return}this.player_.trigger("playerresize")};n.dispose=function(){if(this.debouncedHandler_){this.debouncedHandler_.cancel()}if(this.resizeObserver_){if(this.player_.el()){this.resizeObserver_.unobserve(this.player_.el())}this.resizeObserver_.disconnect()}if(this.loadListener_){this.off("load",this.loadListener_)}if(this.el_&&this.el_.contentWindow&&this.unloadListener_){this.unloadListener_.call(this.el_.contentWindow)}this.ResizeObserver=null;this.resizeObserver=null;this.debouncedHandler_=null;this.loadListener_=null;t.prototype.dispose.call(this)};return a}(qe);qe.registerComponent("ResizeManager",ai);var ni=function(e){var t=Math.floor(e.length/2),a=[].concat(e).sort(function(e,t){return e-t});return 0!=e.length%2?a[t]:(a[t-1]+a[t])/2},ri={trackingThreshold:30},ii=function(e){Ge(a,e);function a(a,n){var r,i=He(ri,n,{createEl:!1});r=e.call(this,a,i)||this;r.reset_();r.on(r.player_,"durationchange",r.handleDurationchange);if(it&&"hidden"in t&&"visibilityState"in t){r.on(t,"visibilitychange",r.handleVisibilityChange)}return r}var n=a.prototype;n.handleVisibilityChange=function(){if(this.player_.duration()!==1/0){return}if(t.hidden){this.stopTracking()}else{this.startTracking()}};n.isBehind_=function(){if(!this.timeupdateSeen_){return!1}var e=this.liveCurrentTime(),t=this.player_.currentTime(),a=2*this.seekableIncrement_+.07;return e!==1/0&&e-a>=t};n.trackLive_=function(){this.pastSeekEnd_=this.pastSeekEnd_;var e=this.player_.seekable();if(!e||!e.length){return}var t=this.seekableEnd();if(t!==this.lastSeekEnd_){if(this.lastSeekEnd_){this.seekableIncrementList_=this.seekableIncrementList_.slice(-11);this.seekableIncrementList_.push(Math.abs(t-this.lastSeekEnd_));if(31.5*this.seekableIncrement_){this.pastSeekEnd_=0}else{this.pastSeekEnd_=this.pastSeekEnd()+.03}if(this.isBehind_()!==this.behindLiveEdge()){this.behindLiveEdge_=this.isBehind_();this.trigger("liveedgechange")}};n.handleDurationchange=function(){if(this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold){if(this.player_.options_.liveui){this.player_.addClass("vjs-liveui")}this.startTracking()}else{this.player_.removeClass("vjs-liveui");this.stopTracking()}};n.startTracking=function(){var e=this;if(this.isTracking()){return}if(!this.timeupdateSeen_){this.timeupdateSeen_=this.player_.hasStarted()}this.trackingInterval_=this.setInterval(this.trackLive_,be);this.trackLive_();this.on(this.player_,"play",this.trackLive_);this.on(this.player_,"pause",this.trackLive_);if(!this.timeupdateSeen_){this.one(this.player_,"play",this.handlePlay);this.handleTimeupdate=function(){e.timeupdateSeen_=!0;e.handleTimeupdate=null};this.one(this.player_,"timeupdate",this.handleTimeupdate)}};n.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge)};n.reset_=function(){this.pastSeekEnd_=0;this.lastSeekEnd_=null;this.behindLiveEdge_=null;this.timeupdateSeen_=!1;this.clearInterval(this.trackingInterval_);this.trackingInterval_=null;this.seekableIncrement_=12;this.seekableIncrementList_=[];this.off(this.player_,"play",this.trackLive_);this.off(this.player_,"pause",this.trackLive_);this.off(this.player_,"play",this.handlePlay);this.off(this.player_,"timeupdate",this.seekToLiveEdge);if(this.handleTimeupdate){this.off(this.player_,"timeupdate",this.handleTimeupdate);this.handleTimeupdate=null}};n.stopTracking=function(){if(!this.isTracking()){return}this.reset_()};n.seekableEnd=function(){var e=this.player_.seekable(),t=[],a=e?e.length:0;while(a--){t.push(e.end(a))}return t.length?t.sort()[t.length-1]:1/0};n.seekableStart=function(){var e=this.player_.seekable(),t=[],a=e?e.length:0;while(a--){t.push(e.start(a))}return t.length?t.sort()[0]:0};n.liveWindow=function(){var e=this.liveCurrentTime();if(e===1/0){return 1/0}return e-this.seekableStart()};n.isLive=function(){return this.isTracking()};n.atLiveEdge=function(){return!this.behindLiveEdge()};n.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()};n.pastSeekEnd=function(){return this.pastSeekEnd_};n.behindLiveEdge=function(){return this.behindLiveEdge_};n.isTracking=function(){return"number"==typeof this.trackingInterval_};n.seekToLiveEdge=function(){if(this.atLiveEdge()){return}this.player_.currentTime(this.liveCurrentTime());if(this.player_.paused()){this.player_.play()}};n.dispose=function(){this.stopTracking();e.prototype.dispose.call(this)};return a}(qe);qe.registerComponent("LiveTracker",ii);var si=function(e){var t=e.el();if(t.hasAttribute("src")){e.triggerSourceset(t.src);return!0}var a=e.$$("source"),n=[],r="";if(!a.length){return!1}for(var s=0,o;srt){return!1}try{var e=yi.TEST_VID.playbackRate;yi.TEST_VID.playbackRate=e/2+.1;return e!==yi.TEST_VID.playbackRate}catch(t){return!1}};yi.canOverrideAttributes=function(){try{var e=function(){};Object.defineProperty(t.createElement("video"),"src",{get:e,set:e});Object.defineProperty(t.createElement("audio"),"src",{get:e,set:e});Object.defineProperty(t.createElement("video"),"innerHTML",{get:e,set:e});Object.defineProperty(t.createElement("audio"),"innerHTML",{get:e,set:e})}catch(t){return!1}return!0};yi.supportsNativeTextTracks=function(){return ct||ut&&nt};yi.supportsNativeVideoTracks=function(){return!!(yi.TEST_VID&&yi.TEST_VID.videoTracks)};yi.supportsNativeAudioTracks=function(){return!!(yi.TEST_VID&&yi.TEST_VID.audioTracks)};yi.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"];[["featuresVolumeControl","canControlVolume"],["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function(e){var t=e[0],a=e[1];gi(yi.prototype,t,function(){return yi[a]()},!0)});yi.prototype.movingMediaElementInDOM=!ut;yi.prototype.featuresFullscreenResize=!0;yi.prototype.featuresProgressEvents=!0;yi.prototype.featuresTimeupdateEvents=!0;var hi;yi.patchCanPlayType=function(){if(4<=Ze&&!tt&&!nt){hi=yi.TEST_VID&&yi.TEST_VID.constructor.prototype.canPlayType;yi.TEST_VID.constructor.prototype.canPlayType=function(e){if(e&&/^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(e)){return"maybe"}return hi.call(this,e)}}};yi.unpatchCanPlayType=function(){var e=yi.TEST_VID.constructor.prototype.canPlayType;if(hi){yi.TEST_VID.constructor.prototype.canPlayType=hi}return e};yi.patchCanPlayType();yi.disposeMediaElement=function(e){if(!e){return}if(e.parentNode){e.parentNode.removeChild(e)}while(e.hasChildNodes()){e.removeChild(e.firstChild)}e.removeAttribute("src");if("function"==typeof e.load){(function(){try{e.load()}catch(t){}})()}};yi.resetMediaElement=function(e){if(!e){return}var t=e.querySelectorAll("source"),a=t.length;while(a--){e.removeChild(t[a])}e.removeAttribute("src");if("function"==typeof e.load){(function(){try{e.load()}catch(t){}})()}};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(e){yi.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(e){yi.prototype["set"+je(e)]=function(t){this.el_[e]=t;if(t){this.el_.setAttribute(e,e)}else{this.el_.removeAttribute(e)}}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","played","networkState","readyState","videoWidth","videoHeight"].forEach(function(e){yi.prototype[e]=function(){return this.el_[e]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate"].forEach(function(e){yi.prototype["set"+je(e)]=function(t){this.el_[e]=t}});["pause","load","play"].forEach(function(e){yi.prototype[e]=function(){return this.el_[e]()}});sn.withSourceHandlers(yi);yi.nativeSourceHandler={};yi.nativeSourceHandler.canPlayType=function(e){try{return yi.TEST_VID.canPlayType(e)}catch(t){return""}};yi.nativeSourceHandler.canHandleSource=function(e){if(e.type){return yi.nativeSourceHandler.canPlayType(e.type)}else if(e.src){var t=ta(e.src);return yi.nativeSourceHandler.canPlayType("video/"+t)}return""};yi.nativeSourceHandler.handleSource=function(e,t){t.setSrc(e.src)};yi.nativeSourceHandler.dispose=function(){};yi.registerSourceHandler(yi.nativeSourceHandler);sn.registerTech("Html5",yi);var fi=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Ti={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},bi=["tiny","xsmall","small","medium","large","xlarge","huge"],vi={};bi.forEach(function(e){var t="x"===e.charAt(0)?"x-"+e.substring(1):e;vi[e]="vjs-layout-"+t});var Si={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},ki=function(a){Ge(n,a);function n(e,r,i){var s;e.id=e.id||r.id||"vjs_video_"+ie();r=g(n.getTagSettings(e),r);r.initChildren=!1;r.createEl=!1;r.evented=!1;r.reportTouchActivity=!1;if(!r.language){if("function"==typeof e.closest){var l=e.closest("[lang]");if(l&&l.getAttribute){r.language=l.getAttribute("lang")}}else{var d=e;while(d&&1===d.nodeType){if(O(d).hasOwnProperty("lang")){r.language=d.getAttribute("lang");break}d=d.parentNode}}}s=a.call(this,null,r,i)||this;s.boundDocumentFullscreenChange_=ve(Ve(s),s.documentFullscreenChange_);s.boundFullWindowOnEscKey_=ve(Ve(s),s.fullWindowOnEscKey);s.isFullscreen_=!1;s.log=o(s.id_);s.fsApi_=Tt;s.isPosterFromTech_=!1;s.queuedCallbacks_=[];s.isReady_=!1;s.hasStarted_=!1;s.userActive_=!1;if(!s.options_||!s.options_.techOrder||!s.options_.techOrder.length){throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?")}s.tag=e;s.tagAttributes=e&&O(e);s.language(s.options_.language);if(r.languages){var p={};Object.getOwnPropertyNames(r.languages).forEach(function(e){p[e.toLowerCase()]=r.languages[e]});s.languages_=p}else{s.languages_=n.prototype.options_.languages}s.resetCache_();s.poster_=r.poster||"";s.controls_=!!r.controls;e.controls=!1;e.removeAttribute("controls");s.changingSrc_=!1;s.playCallbacks_=[];s.playTerminatedQueue_=[];if(e.hasAttribute("autoplay")){s.autoplay(!0)}else{s.autoplay(s.options_.autoplay)}if(r.plugins){Object.keys(r.plugins).forEach(function(e){if("function"!=typeof s[e]){throw new Error("plugin \""+e+"\" does not exist")}})}s.scrubbing_=!1;s.el_=s.createEl();Ne(Ve(s),{eventBusKey:"el_"});if(s.fsApi_.requestFullscreen){ge(t,s.fsApi_.fullscreenchange,s.boundDocumentFullscreenChange_);s.on(s.fsApi_.fullscreenchange,s.boundDocumentFullscreenChange_)}if(s.fluid_){s.on("playerreset",s.updateStyleEl_)}var u=He(s.options_);if(r.plugins){Object.keys(r.plugins).forEach(function(e){s[e](r.plugins[e])})}s.options_.playerOptions=u;s.middleware_=[];s.initChildren();s.isAudio("audio"===e.nodeName.toLowerCase());if(s.controls()){s.addClass("vjs-controls-enabled")}else{s.addClass("vjs-controls-disabled")}s.el_.setAttribute("role","region");if(s.isAudio()){s.el_.setAttribute("aria-label",s.localize("Audio Player"))}else{s.el_.setAttribute("aria-label",s.localize("Video Player"))}if(s.isAudio()){s.addClass("vjs-audio")}if(s.flexNotSupported_()){s.addClass("vjs-no-flex")}if(lt){s.addClass("vjs-touch-enabled")}if(!ut){s.addClass("vjs-workinghover")}n.players[s.id_]=Ve(s);var c="7.7.6".split(".")[0];s.addClass("vjs-v"+c);s.userActive(!0);s.reportUserActivity();s.one("play",s.listenForUserActivity_);s.on("stageclick",s.handleStageClick_);s.on("keydown",s.handleKeyDown);s.breakpoints(s.options_.breakpoints);s.responsive(s.options_.responsive);return s}var r=n.prototype;r.dispose=function(){var e=this;this.trigger("dispose");this.off("dispose");ye(t,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_);ye(t,"keydown",this.boundFullWindowOnEscKey_);if(this.styleEl_&&this.styleEl_.parentNode){this.styleEl_.parentNode.removeChild(this.styleEl_);this.styleEl_=null}n.players[this.id_]=null;if(this.tag&&this.tag.player){this.tag.player=null}if(this.el_&&this.el_.player){this.el_.player=null}if(this.tech_){this.tech_.dispose();this.isPosterFromTech_=!1;this.poster_=""}if(this.playerElIngest_){this.playerElIngest_=null}if(this.tag){this.tag=null}bn(this);ka.names.forEach(function(t){var a=ka[t],n=e[a.getterName]();if(n&&n.off){n.off()}});a.prototype.dispose.call(this)};r.createEl=function(){var n=this.tag,r,s=this.playerElIngest_=n.parentNode&&n.parentNode.hasAttribute&&n.parentNode.hasAttribute("data-vjs-player"),o="video-js"===this.tag.tagName.toLowerCase();if(s){r=this.el_=n.parentNode}else if(!o){r=this.el_=a.prototype.createEl.call(this,"div")}var l=O(n);if(o){r=this.el_=n;n=this.tag=t.createElement("video");while(r.children.length){n.appendChild(r.firstChild)}if(!L(r,"video-js")){P(r,"video-js")}r.appendChild(n);s=this.playerElIngest_=r;Object.keys(r).forEach(function(e){try{n[e]=r[e]}catch(t){}})}n.setAttribute("tabindex","-1");l.tabindex="-1";if(it||nt&&ot){n.setAttribute("role","application");l.role="application"}n.removeAttribute("width");n.removeAttribute("height");if("width"in l){delete l.width}if("height"in l){delete l.height}Object.getOwnPropertyNames(l).forEach(function(e){if(!(o&&"class"===e)){r.setAttribute(e,l[e])}if(o){n.setAttribute(e,l[e])}});n.playerId=n.id;n.id+="_html5_api";n.className="vjs-tech";n.player=r.player=this;this.addClass("vjs-paused");if(!0!==e.VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=ae("vjs-styles-dimensions");var d=Y(".vjs-styles-defaults"),p=Y("head");p.insertBefore(this.styleEl_,d?d.nextSibling:p.firstChild)}this.fill_=!1;this.fluid_=!1;this.width(this.options_.width);this.height(this.options_.height);this.fill(this.options_.fill);this.fluid(this.options_.fluid);this.aspectRatio(this.options_.aspectRatio);for(var u=n.getElementsByTagName("a"),c=0,m;ce){e=0}this.techCall_("setCurrentTime",e);return}this.cache_.currentTime=this.techGet_("currentTime")||0;return this.cache_.currentTime};r.duration=function(e){if(e===void 0){return this.cache_.duration!==void 0?this.cache_.duration:NaN}e=parseFloat(e);if(0>e){e=1/0}if(e!==this.cache_.duration){this.cache_.duration=e;if(e===1/0){this.addClass("vjs-live")}else{this.removeClass("vjs-live")}if(!isNaN(e)){this.trigger("durationchange")}}};r.remainingTime=function(){return this.duration()-this.currentTime()};r.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())};r.buffered=function e(){var e=this.techGet_("buffered");if(!e||!e.length){e=_t(0,0)}return e};r.bufferedPercent=function(){return ft(this.buffered(),this.duration())};r.bufferedEnd=function(){var e=this.buffered(),t=this.duration(),a=e.end(e.length-1);if(a>t){a=t}return a};r.volume=function(e){var t;if(e!==void 0){t=Math.max(0,Math.min(1,parseFloat(e)));this.cache_.volume=t;this.techCall_("setVolume",t);if(0=e){return}l=this.setTimeout(function(){if(!this.userActivity_){this.userActive(!1)}},e)},250)};r.playbackRate=function(e){if(e!==void 0){this.techCall_("setPlaybackRate",e);return}if(this.tech_&&this.tech_.featuresPlaybackRate){return this.cache_.lastPlaybackRate||this.techGet_("playbackRate")}return 1};r.defaultPlaybackRate=function(e){if(e!==void 0){return this.techCall_("setDefaultPlaybackRate",e)}if(this.tech_&&this.tech_.featuresPlaybackRate){return this.techGet_("defaultPlaybackRate")}return 1};r.isAudio=function(e){if(e!==void 0){this.isAudio_=!!e;return}return!!this.isAudio_};r.addTextTrack=function(e,t,a){if(this.tech_){return this.tech_.addTextTrack(e,t,a)}};r.addRemoteTextTrack=function(e,t){if(this.tech_){return this.tech_.addRemoteTextTrack(e,t)}};r.removeRemoteTextTrack=function(e){if(void 0===e){e={}}var t=e,a=t.track;if(!a){a=e}if(this.tech_){return this.tech_.removeRemoteTextTrack(a)}};r.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")};r.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0};r.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0};r.language=function(e){if(e===void 0){return this.language_}this.language_=(e+"").toLowerCase()};r.languages=function(){return He(n.prototype.options_.languages,this.languages_)};r.toJSON=function(){var e=He(this.options_),t=e.tracks;e.tracks=[];for(var a=0,n;a=a){return!1}Hi.hooks_[e]=Hi.hooks_[e].slice();Hi.hooks_[e].splice(a,1);return!0};if(!0!==e.VIDEOJS_NO_DYNAMIC_STYLE&&v()){var qi=Y(".vjs-styles-defaults");if(!qi){qi=ae("vjs-styles-defaults");var Vi=Y("head");if(Vi){Vi.insertBefore(qi,Vi.firstChild)}ne(qi,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid {\n padding-top: 56.25%\n }\n ")}}ee(1,Hi);Hi.VERSION="7.7.6";Hi.options=ki.prototype.options_;Hi.getPlayers=function(){return ki.players};Hi.getPlayer=function(e){var t=ki.players,a;if("string"==typeof e){var n=Fi(e),r=t[n];if(r){return r}a=Y("#"+n)}else{a=e}if(S(a)){var i=a,s=i.player,o=i.playerId;if(s||t[o]){return s||t[o]}}};Hi.getAllPlayers=function(){return Object.keys(ki.players).map(function(e){return ki.players[e]}).filter(Boolean)};Hi.players=ki.players;Hi.getComponent=qe.getComponent;Hi.registerComponent=function(e,t){if(sn.isTech(t)){s.warn("The "+e+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)")}qe.registerComponent.call(qe,e,t)};Hi.getTech=sn.getTech;Hi.registerTech=sn.registerTech;Hi.use=function(e,t){on[e]=on[e]||[];on[e].push(t)};Object.defineProperty(Hi,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(Hi.middleware,"TERMINATOR",{value:dn,writeable:!1,enumerable:!0});Hi.browser=mt;Hi.TOUCH_ENABLED=lt;Hi.extend=ji;Hi.mergeOptions=He;Hi.bind=ve;Hi.registerPlugin=Mi.registerPlugin;Hi.deregisterPlugin=Mi.deregisterPlugin;Hi.plugin=function(e,t){s.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead");return Mi.registerPlugin(e,t)};Hi.getPlugins=Mi.getPlugins;Hi.getPlugin=Mi.getPlugin;Hi.getPluginVersion=Mi.getPluginVersion;Hi.addLanguage=function(e,t){var a;e=(""+e).toLowerCase();Hi.options.languages=He(Hi.options.languages,(a={},a[e]=t,a));return Hi.options.languages[e]};Hi.log=s;Hi.createLogger=o;Hi.createTimeRange=Hi.createTimeRanges=_t;Hi.formatTime=Vn;Hi.setFormatTime=function(e){qn=e};Hi.resetFormatTime=function(){qn=Hn};Hi.parseUrl=Zt;Hi.isCrossOrigin=aa;Hi.EventTarget=Ce;Hi.on=ge;Hi.one=_e;Hi.off=ye;Hi.trigger=he;Hi.xhr=sa;Hi.TextTrack=ya;Hi.AudioTrack=ha;Hi.VideoTrack=_a;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(function(e){Hi[e]=function(){s.warn("videojs."+e+"() is deprecated; use videojs.dom."+e+"() instead");return $[e].apply(null,arguments)}});Hi.computedStyle=_;Hi.dom=$;Hi.url=na;Hi.defineLazyProperty=gi;var Wi=l(function(e){(function(){var t={buildAbsoluteURL:function(e,a,n){n=n||{};e=e.trim();a=a.trim();if(!a){if(!n.alwaysNormalize){return e}var r=t.parseURL(e);if(!r){throw new Error("Error trying to parse base URL.")}r.path=t.normalizePath(r.path);return t.buildURLFromParts(r)}var i=t.parseURL(a);if(!i){throw new Error("Error trying to parse relative URL.")}if(i.scheme){if(!n.alwaysNormalize){return a}i.path=t.normalizePath(i.path);return t.buildURLFromParts(i)}var s=t.parseURL(e);if(!s){throw new Error("Error trying to parse base URL.")}if(!s.netLoc&&s.path&&"/"!==s.path[0]){var o=/^([^\/?#]*)(.*)$/.exec(s.path);s.netLoc=o[1];s.path=o[2]}if(s.netLoc&&!s.path){s.path="/"}var l={scheme:s.scheme,netLoc:i.netLoc,path:null,params:i.params,query:i.query,fragment:i.fragment};if(!i.netLoc){l.netLoc=s.netLoc;if("/"!==i.path[0]){if(!i.path){l.path=s.path;if(!i.params){l.params=s.params;if(!i.query){l.query=s.query}}}else{var d=s.path,p=d.substring(0,d.lastIndexOf("/")+1)+i.path;l.path=t.normalizePath(p)}}}if(null===l.path){l.path=n.alwaysNormalize?t.normalizePath(i.path):i.path}return t.buildURLFromParts(l)},parseURL:function(e){var t=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/\?#]*\/)*.*?)??(;.*?)?(\?.*?)?(#.*?)?$/.exec(e);if(!t){return null}return{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}},normalizePath:function(e){e=e.split("").reverse().join("").replace(/(?:\/|^)\.(?=\/)/g,"");while(e.length!==(e=e.replace(/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,"")).length){}return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};e.exports=t})()});function zi(){zi=Object.assign||function(e){for(var t=1,a;te.duration){this.trigger("warn",{message:"ignoring invalid target duration: "+e.duration});return}this.manifest.targetDuration=e.duration},totalduration:function(){if(!isFinite(e.duration)||0>e.duration){this.trigger("warn",{message:"ignoring invalid total duration: "+e.duration});return}this.manifest.totalDuration=e.duration},start:function(){if(!e.attributes||isNaN(e.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:e.attributes["TIME-OFFSET"],precise:e.attributes.PRECISE}},"cue-out":function(){r.cueOut=e.data},"cue-out-cont":function(){r.cueOutCont=e.data},"cue-in":function(){r.cueIn=e.data}})[e.tagType]||o).call(a)},uri:function(){r.uri=e.uri;n.push(r);if(this.manifest.targetDuration&&!("duration"in r)){this.trigger("warn",{message:"defaulting segment duration to the target duration"});r.duration=this.manifest.targetDuration}if(s){r.key=s}r.timeline=d;if(i){r.map=i}r={}},comment:function(){},custom:function(){if(e.segment){r.custom=r.custom||{};r.custom[e.customType]=e.data}else{this.manifest.custom=this.manifest.custom||{};this.manifest.custom[e.customType]=e.data}}})[e.type].call(a)});return t}var a=t.prototype;a.push=function(e){this.lineStream.push(e)};a.end=function(){this.lineStream.push("\n")};a.addParser=function(e){this.parseStream.addParser(e)};a.addTagMapper=function(e){this.parseStream.addTagMapper(e)};return t}(Yi);function ts(e){return e&&"object"===_typeof2(e)&&"default"in e?e["default"]:e}var as=ts(Wi),ns=ts(e),rs=function(e,t){if(/^[a-z]+:/i.test(t)){return t}if(!/\/\//i.test(e)){e=as.buildAbsoluteURL(ns.location&&ns.location.href||"",e)}return as.buildAbsoluteURL(e,t)};function is(e){return e&&"object"===_typeof2(e)&&"default"in e?e["default"]:e}var ss=is(e),os=function(e){return ss.atob?ss.atob(e):Buffer.from(e,"base64").toString("binary")};function ls(e){for(var t=os(e),a=new Uint8Array(t.length),n=0;n>10),a=56320+(1023&e);return String.fromCharCode(t,a)}else{return String.fromCharCode(e)}}function l(e){var t=e.slice(1,-1);if(t in n){return n[t]}else if("#"===t.charAt(0)){return o(parseInt(t.substr(1).replace("x","0x")))}else{s.error("entity not found:"+e);return e}}function d(t){if(t>f){var a=e.substring(f,t).replace(/&#?\w+;/g,l);y&&p(f);r.characters(a,0,t-f);f=t}}function p(t,a){while(t>=c&&(a=g.exec(e))){u=a.index;c=u+a[0].length;y.lineNumber++}y.columnNumber=t-u+1}var u=0,c=0,g=/.*(?:\r\n?|\n)|.*$/g,y=r.locator,h=[{currentNSMap:t}],_={},f=0;while(!0){try{var T=e.indexOf("<",f);if(0>T){if(!e.substr(f).match(/^\s*$/)){var b=r.doc,v=b.createTextNode(e.substr(f));b.appendChild(v);r.currentElement=v}return}if(T>f){d(T)}switch(e.charAt(T+1)){case"/":var S=e.indexOf(">",T+3),k=e.substring(T+2,S),C=h.pop();if(0>S){k=e.substring(T+2).replace(/[\s<].*/,"");s.error("end tag name: "+k+" is not complete:"+C.tagName);S=T+1+k.length}else if(k.match(/\sf){f=S}else{d(Math.max(T,f)+1)}}}function Ss(e,a){a.lineNumber=e.lineNumber;a.columnNumber=e.columnNumber;return a}function ks(e,t,a,n,r,i){var o,l,d=++t,u=cs;while(!0){var m=e.charAt(d);switch(m){case"=":if(u===ms){o=e.slice(t,d);u=ys}else if(u===gs){u=ys}else{throw new Error("attribute equal must after attrName")}break;case"'":case"\"":if(u===ys||u===ms){if(u===ms){i.warning("attribute value must after \"=\"");o=e.slice(t,d)}t=d+1;d=e.indexOf(m,t);if(0":switch(u){case cs:a.setTagName(e.slice(t,d));case _s:case fs:case Ts:break;case hs:case ms:l=e.slice(t,d);if("/"===l.slice(-1)){a.closed=!0;l=l.slice(0,-1)}case gs:if(u===gs){l=o}if(u==hs){i.warning("attribute \""+l+"\" missed quot(\")!!");a.add(o,l.replace(/&#?\w+;/g,r),t)}else{if("http://www.w3.org/1999/xhtml"!==n[""]||!l.match(/^(?:disabled|checked|selected)$/i)){i.warning("attribute \""+l+"\" missed value!! \""+l+"\" instead!!")}a.add(l,l,t)}break;case ys:throw new Error("attribute value missed!!");}return d;case"\x80":m=" ";default:if(" ">=m){switch(u){case cs:a.setTagName(e.slice(t,d));u=fs;break;case ms:o=e.slice(t,d);u=gs;break;case hs:var l=e.slice(t,d).replace(/&#?\w+;/g,r);i.warning("attribute \""+l+"\" missed quot(\")!!");a.add(o,l,t);case _s:u=fs;break;}}else{switch(u){case gs:a.tagName;if("http://www.w3.org/1999/xhtml"!==n[""]||!o.match(/^(?:disabled|checked|selected)$/i)){i.warning("attribute \""+o+"\" missed value!! \""+o+"\" instead2!!")}a.add(o,o,t);t=d;u=ms;break;case _s:i.warning("attribute space is required\""+o+"\"!!");case fs:u=ms;t=d;break;case ys:u=hs;t=d;break;case Ts:throw new Error("elements closed character '/' and '>' must be connected to");}}}d++}}function Cs(e,t,n){var r=e.tagName,s=null,o=e.length;while(o--){var l=e[o],d=l.qName,p=l.value,u=d.indexOf(":");if(0",t),s=e.substring(t+1,i);if(/[&<]/.test(s)){if(/^script$/i.test(a)){r.characters(s,0,s.length);return i}s=s.replace(/&#?\w+;/g,n);r.characters(s,0,s.length);return i}}return t+1}function Is(e,t,a,n){var r=n[a];if(null==r){r=e.lastIndexOf("");if(r",t+4);if(i>t){a.comment(e,t+4,i-t-4);return i+3}else{n.error("Unclosed comment");return-1}}else{return-1}default:if("CDATA["==e.substr(t+3,6)){var i=e.indexOf("]]>",t+9);a.startCDATA();a.characters(e,t+9,i-t-9);a.endCDATA();return i+3}var s=As(e,t),o=s.length;if(1",t);if(n){var r=e.substring(t,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(r){r[0].length;a.processingInstruction(r[1],r[2]);return n+2}else{return-1}}return-1}function Ds(){}Ds.prototype={setTagName:function(e){if(!us.test(e)){throw new Error("invalid tagName:"+e)}this.tagName=e},add:function(e,t,a){if(!us.test(e)){throw new Error("invalid attribute:"+e)}this[this.length++]={qName:e,value:t,offset:a}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}};function ws(e,t){e.__proto__=t;return e}if(!(ws({},ws.prototype)instanceof ws)){ws=function(e,t){function a(){}a.prototype=t;a=new a;for(t in e){a[t]=e[t]}return a}}function As(e,t){var a,n=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;r.lastIndex=t;r.exec(e);while(a=r.exec(e)){n.push(a);if(a[1])return n}}var Os={XMLReader:bs};function Rs(e,t){for(var a in e){t[a]=e[a]}}function Ns(e,a){var n=e.prototype;if(Object.create){var r=Object.create(a.prototype);n.__proto__=r}if(!(n instanceof a)){var i=function(){};i.prototype=a.prototype;i=new i;Rs(n,i);e.prototype=n=i}if(n.constructor!=e){if("function"!=typeof e){console.error("unknow Class:"+e)}n.constructor=e}}var Us={},Ms=Us.ELEMENT_NODE=1,Bs=Us.ATTRIBUTE_NODE=2,js=Us.TEXT_NODE=3,Fs=Us.CDATA_SECTION_NODE=4,Hs=Us.ENTITY_REFERENCE_NODE=5,qs=Us.ENTITY_NODE=6,Vs=Us.PROCESSING_INSTRUCTION_NODE=7,Ws=Us.COMMENT_NODE=8,zs=Us.DOCUMENT_NODE=9,Gs=Us.DOCUMENT_TYPE_NODE=10,Ks=Us.DOCUMENT_FRAGMENT_NODE=11,Ys=Us.NOTATION_NODE=12,Xs={},$s={},Qs=Xs.INDEX_SIZE_ERR=($s[1]="Index size error",1),Js=Xs.DOMSTRING_SIZE_ERR=($s[2]="DOMString size error",2),Zs=Xs.HIERARCHY_REQUEST_ERR=($s[3]="Hierarchy request error",3),eo=Xs.WRONG_DOCUMENT_ERR=($s[4]="Wrong document",4),to=Xs.INVALID_CHARACTER_ERR=($s[5]="Invalid character",5),ao=Xs.NO_DATA_ALLOWED_ERR=($s[6]="No data allowed",6),no=Xs.NO_MODIFICATION_ALLOWED_ERR=($s[7]="No modification allowed",7),ro=Xs.NOT_FOUND_ERR=($s[8]="Not found",8),io=Xs.NOT_SUPPORTED_ERR=($s[9]="Not supported",9),so=Xs.INUSE_ATTRIBUTE_ERR=($s[10]="Attribute in use",10),oo=Xs.INVALID_STATE_ERR=($s[11]="Invalid state",11),lo=Xs.SYNTAX_ERR=($s[12]="Syntax error",12),po=Xs.INVALID_MODIFICATION_ERR=($s[13]="Invalid modification",13),uo=Xs.NAMESPACE_ERR=($s[14]="Invalid namespace",14),co=Xs.INVALID_ACCESS_ERR=($s[15]="Invalid access",15);function mo(e,t){if(t instanceof Error){var a=t}else{a=this;Error.call(this,$s[e]);this.message=$s[e];if(Error.captureStackTrace)Error.captureStackTrace(this,mo)}a.code=e;if(t)this.message=this.message+": "+t;return a}mo.prototype=Error.prototype;Rs(Xs,mo);function go(){}go.prototype={length:0,item:function(e){return this[e]||null},toString:function(e,t){for(var a=[],n=0;n"==e&&">"||"&"==e&&"&"||"\""==e&&"""||"&#"+e.charCodeAt()+";"}Rs(Us,So);Rs(Us,So.prototype);function Co(e,t){if(t(e)){return!0}if(e=e.firstChild){do{if(Co(e,t)){return!0}}while(e=e.nextSibling)}}function Eo(){}function Io(e,t,a){e&&e._inc++;var n=a.namespaceURI;if("http://www.w3.org/2000/xmlns/"==n){t._nsMap[a.prefix?a.localName:""]=a.value}}function xo(e,t,a){e&&e._inc++;var n=a.namespaceURI;if("http://www.w3.org/2000/xmlns/"==n){delete t._nsMap[a.prefix?a.localName:""]}}function Lo(e,t,a){if(e&&e._inc){e._inc++;var n=t.childNodes;if(a){n[n.length++]=a}else{var r=t.firstChild,s=0;while(r){n[s++]=r;r=r.nextSibling}n.length=s}}}function Po(e,t){var a=t.previousSibling,n=t.nextSibling;if(a){a.nextSibling=n}else{e.firstChild=n}if(n){n.previousSibling=a}else{e.lastChild=a}Lo(e.ownerDocument,e);return t}function Do(e,t,a){var n=t.parentNode;if(n){n.removeChild(t)}if(t.nodeType===Ks){var r=t.firstChild;if(null==r){return t}var i=t.lastChild}else{r=i=t}var s=a?a.previousSibling:e.lastChild;r.previousSibling=s;i.nextSibling=a;if(s){s.nextSibling=r}else{e.firstChild=r}if(null==a){e.lastChild=i}else{a.previousSibling=i}do{r.parentNode=e}while(r!==i&&(r=r.nextSibling));Lo(e.ownerDocument||e,e);if(t.nodeType==Ks){t.firstChild=t.lastChild=null}return t}function wo(e,t){var a=t.parentNode;if(a){var n=e.lastChild;a.removeChild(t);var n=e.lastChild}var n=e.lastChild;t.parentNode=e;t.previousSibling=n;t.nextSibling=null;if(n){n.nextSibling=t}else{e.firstChild=t}e.lastChild=t;Lo(e.ownerDocument,e,t);return t}Eo.prototype={nodeName:"#document",nodeType:zs,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==Ks){var a=e.firstChild;while(a){var n=a.nextSibling;this.insertBefore(a,t);a=n}return e}if(null==this.documentElement&&e.nodeType==Ms){this.documentElement=e}return Do(this,e,t),e.ownerDocument=this,e},removeChild:function(e){if(this.documentElement==e){this.documentElement=null}return Po(this,e)},importNode:function(e,t){return Yo(this,e,t)},getElementById:function(e){var t=null;Co(this.documentElement,function(a){if(a.nodeType==Ms){if(a.getAttribute("id")==e){t=a;return!0}}});return t},createElement:function(e){var t=new Ao;t.ownerDocument=this;t.nodeName=e;t.tagName=e;t.childNodes=new go;var a=t.attributes=new _o;a._ownerElement=t;return t},createDocumentFragment:function(){var e=new qo;e.ownerDocument=this;e.childNodes=new go;return e},createTextNode:function(e){var t=new No;t.ownerDocument=this;t.appendData(e);return t},createComment:function(e){var t=new Uo;t.ownerDocument=this;t.appendData(e);return t},createCDATASection:function(e){var t=new Mo;t.ownerDocument=this;t.appendData(e);return t},createProcessingInstruction:function(e,t){var a=new Vo;a.ownerDocument=this;a.tagName=a.target=e;a.nodeValue=a.data=t;return a},createAttribute:function(e){var t=new Oo;t.ownerDocument=this;t.name=e;t.nodeName=e;t.localName=e;t.specified=!0;return t},createEntityReference:function(e){var t=new Ho;t.ownerDocument=this;t.nodeName=e;return t},createElementNS:function(e,t){var a=new Ao,n=t.split(":"),r=a.attributes=new _o;a.childNodes=new go;a.ownerDocument=this;a.nodeName=t;a.tagName=t;a.namespaceURI=e;if(2==n.length){a.prefix=n[0];a.localName=n[1]}else{a.localName=t}r._ownerElement=a;return a},createAttributeNS:function(e,t){var a=new Oo,n=t.split(":");a.ownerDocument=this;a.nodeName=t;a.name=t;a.namespaceURI=e;a.specified=!0;if(2==n.length){a.prefix=n[0];a.localName=n[1]}else{a.localName=t}return a}};Ns(Eo,So);function Ao(){this._nsMap={}}Ao.prototype={nodeType:Ms,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var a=this.ownerDocument.createAttribute(e);a.value=a.nodeValue=""+t;this.setAttributeNode(a)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){if(e.nodeType===Ks){return this.insertBefore(e,null)}else{return wo(this,e)}},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var a=this.getAttributeNodeNS(e,t);a&&this.removeAttributeNode(a)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var a=this.getAttributeNodeNS(e,t);return a&&a.value||""},setAttributeNS:function(e,t,a){var n=this.ownerDocument.createAttributeNS(e,t);n.value=n.nodeValue=""+a;this.setAttributeNode(n)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new yo(this,function(t){var a=[];Co(t,function(n){if(n!==t&&n.nodeType==Ms&&("*"===e||n.tagName==e)){a.push(n)}});return a})},getElementsByTagNameNS:function(e,t){return new yo(this,function(a){var n=[];Co(a,function(r){if(r!==a&&r.nodeType===Ms&&("*"===e||r.namespaceURI===e)&&("*"===t||r.localName==t)){n.push(r)}});return n})}};Eo.prototype.getElementsByTagName=Ao.prototype.getElementsByTagName;Eo.prototype.getElementsByTagNameNS=Ao.prototype.getElementsByTagNameNS;Ns(Ao,So);function Oo(){}Oo.prototype.nodeType=Bs;Ns(Oo,So);function Ro(){}Ro.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e;this.nodeValue=this.data=e;this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(){throw new Error($s[Zs])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,a){var n=this.data.substring(0,e),r=this.data.substring(e+t);a=n+a+r;this.nodeValue=this.data=a;this.length=a.length}};Ns(Ro,So);function No(){}No.prototype={nodeName:"#text",nodeType:js,splitText:function(e){var t=this.data,a=t.substring(e);t=t.substring(0,e);this.data=this.nodeValue=t;this.length=t.length;var n=this.ownerDocument.createTextNode(a);if(this.parentNode){this.parentNode.insertBefore(n,this.nextSibling)}return n}};Ns(No,Ro);function Uo(){}Uo.prototype={nodeName:"#comment",nodeType:Ws};Ns(Uo,Ro);function Mo(){}Mo.prototype={nodeName:"#cdata-section",nodeType:Fs};Ns(Mo,Ro);function Bo(){}Bo.prototype.nodeType=Gs;Ns(Bo,So);function jo(){}jo.prototype.nodeType=Ys;Ns(jo,So);function Fo(){}Fo.prototype.nodeType=qs;Ns(Fo,So);function Ho(){}Ho.prototype.nodeType=Hs;Ns(Ho,So);function qo(){}qo.prototype.nodeName="#document-fragment";qo.prototype.nodeType=Ks;Ns(qo,So);function Vo(){}Vo.prototype.nodeType=Vs;Ns(Vo,So);function Wo(){}Wo.prototype.serializeToString=function(e,t,a){return zo.call(e,t,a)};So.prototype.toString=zo;function zo(e,t){var a=[],n=9==this.nodeType?this.documentElement:this,r=n.prefix,i=n.namespaceURI;if(i&&null==r){var r=n.lookupPrefix(i);if(null==r){var s=[{namespace:i,prefix:null}]}}Ko(this,a,e,t,s);return a.join("")}function Go(e,t,a){var n=e.prefix||"",r=e.namespaceURI;if(!n&&!r){return!1}if("xml"===n&&"http://www.w3.org/XML/1998/namespace"===r||"http://www.w3.org/2000/xmlns/"==r){return!1}var s=a.length;while(s--){var o=a[s];if(o.prefix==n){return o.namespace!=r}}return!0}function Ko(e,t,a,n,r){if(n){e=n(e);if(e){if("string"==typeof e){t.push(e);return}}else{return}}switch(e.nodeType){case Ms:if(!r)r=[];var s=r.length,o=e.attributes,l=o.length,d=e.firstChild,p=e.tagName;a="http://www.w3.org/1999/xhtml"===e.namespaceURI||a;t.push("<",p);for(var u=0,c;u");if(a&&/^script$/i.test(p)){while(d){if(d.data){t.push(d.data)}else{Ko(d,t,a,n,r)}d=d.nextSibling}}else{while(d){Ko(d,t,a,n,r);d=d.nextSibling}}t.push("")}else{t.push("/>")}return;case zs:case Ks:var d=e.firstChild;while(d){Ko(d,t,a,n,r);d=d.nextSibling}return;case Bs:return t.push(" ",e.name,"=\"",e.value.replace(/[<&"]/g,ko),"\"");case js:return t.push(e.data.replace(/[<&]/g,ko));case Fs:return t.push("");case Ws:return t.push("");case Gs:var h=e.publicId,_=e.systemId;t.push("")}else if(_&&"."!=_){t.push(" SYSTEM \"",_,"\">")}else{var f=e.internalSubset;if(f){t.push(" [",f,"]")}t.push(">")}return;case Vs:return t.push("");case Hs:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName);}}function Yo(e,t,a){var n;switch(t.nodeType){case Ms:n=t.cloneNode(!1);n.ownerDocument=e;case Ks:break;case Bs:a=!0;break;}if(!n){n=t.cloneNode(!1)}n.ownerDocument=e;n.parentNode=null;if(a){var r=t.firstChild;while(r){n.appendChild(Yo(e,r,a));r=r.nextSibling}}return n}function Xo(e,t,a){var r=new t.constructor;for(var s in t){var n=t[s];if("object"!=_typeof2(n)){if(n!=r[s]){r[s]=n}}}if(t.childNodes){r.childNodes=new go}r.ownerDocument=e;switch(r.nodeType){case Ms:var o=t.attributes,l=r.attributes=new _o,d=o.length;l._ownerElement=r;for(var p=0;p",amp:"&",quot:"\"",apos:"'"};if(l){s.setDocumentLocator(l)}i.errorHandler=n(o,s,l);i.domBuilder=a.domBuilder||s;if(/\/x?html?$/.test(t)){u.nbsp="\xA0";u.copy="\xA9";d[""]="http://www.w3.org/1999/xhtml"}d.xml=d.xml||"http://www.w3.org/XML/1998/namespace";if(e){i.parse(e,d,u)}else{i.errorHandler.error("invalid doc source")}return s.doc};function n(e,t,a){if(!e){if(t instanceof r){return t}e=t}var n={},i=e instanceof Function;a=a||{};function s(t){var r=e[t];if(!r&&i){r=2==e.length?function(a){e(t,a)}:e}n[t]=r&&function(e){r("[xmldom "+t+"]\t"+e+o(a))}||function(){}}s("warning");s("error");s("fatalError");return n}function r(){this.cdata=!1}function s(e,t){t.lineNumber=e.lineNumber;t.columnNumber=e.columnNumber}r.prototype={startDocument:function(){this.doc=new u().createDocument(null,null,null);if(this.locator){this.doc.documentURI=this.locator.systemId}},startElement:function(e,t,a,n){var r=this.doc,o=r.createElementNS(e,a||t),l=n.length;d(this,o);this.currentElement=o;this.locator&&s(this.locator,o);for(var p=0;p=t+a||t){return new java.lang.String(e,t,a)+""}return e}}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(e){r.prototype[e]=function(){return null}});function d(e,t){if(!e.currentElement){e.doc.appendChild(t)}else{e.currentElement.appendChild(t)}}var p=Os.XMLReader,u=t.DOMImplementation=Jo.DOMImplementation;t.XMLSerializer=Jo.XMLSerializer;t.DOMParser=a}),el=Zo.DOMImplementation,tl=Zo.XMLSerializer,al=Zo.DOMParser,nl=function(e){return!!e&&"object"===_typeof2(e)},rl=function e(){for(var t=arguments.length,a=Array(t),n=0;na.attributes.bandwidth){return e}e[s]={language:i,autoselect:!0,default:"main"===r,playlists:Tl([bl(a)],t),uri:""};if("undefined"==typeof n&&"main"===r){n=a;n["default"]=!0}return e},{});if(!n){var i=Object.keys(r)[0];r[i]["default"]=!0}return r},kl=function(e,t){if(void 0===t){t={}}return e.reduce(function(e,a){var n=a.attributes.lang||"text";if(e[n]){return e}e[n]={language:n,default:!1,autoselect:!1,playlists:Tl([vl(a)],t),uri:""};return e},{})},Cl=function(e){var t,a=e.attributes,n=e.segments,r=e.sidx,i={attributes:(t={NAME:a.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:a.width,height:a.height},CODECS:a.codecs,BANDWIDTH:a.bandwidth},t["PROGRAM-ID"]=1,t),uri:"",endList:"static"===(a.type||"static"),timeline:a.periodIndex,resolvedUri:"",targetDuration:a.duration,segments:n,mediaSequence:n.length?n[0].number:1};if(a.contentProtection){i.contentProtection=a.contentProtection}if(r){i.sidx=r}return i},El=function(e,t){var a;if(void 0===t){t={}}if(!e.length){return{}}var n=e[0].attributes,r=n.sourceDuration,i=n.type,s=void 0===i?"static":i,o=n.suggestedPresentationDelay,l=n.minimumUpdatePeriod,d=void 0===l?0:l,p=fl(e.filter(function(e){var t=e.attributes;return"video/mp4"===t.mimeType||"video"===t.contentType})).map(Cl),u=fl(e.filter(function(e){var t=e.attributes;return"audio/mp4"===t.mimeType||"audio"===t.contentType})),c=e.filter(function(e){var t=e.attributes;return"text/vtt"===t.mimeType||"text"===t.contentType}),m={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(a={AUDIO:{},VIDEO:{}},a["CLOSED-CAPTIONS"]={},a.SUBTITLES={},a),uri:"",duration:r,playlists:Tl(p,t),minimumUpdatePeriod:1e3*d};if("dynamic"===s){m.suggestedPresentationDelay=o}if(u.length){m.mediaGroups.AUDIO.audio=Sl(u,t)}if(c.length){m.mediaGroups.SUBTITLES.subs=kl(c,t)}return m},Il=function(e,t,a){var n=e.NOW,r=e.clientOffset,i=e.availabilityStartTime,s=e.timescale,o=void 0===s?1:s,l=e.start,d=void 0===l?0:l,p=e.minimumUpdatePeriod,u=void 0===p?0:p;return Math.ceil((((n+r)/1e3+u-(i+d))*o-t)/a)},xl=function(e,t){for(var a=e.type,n=void 0===a?"static":a,r=e.minimumUpdatePeriod,i=void 0===r?0:r,s=e.media,o=void 0===s?"":s,l=e.sourceDuration,d=e.timescale,p=void 0===d?1:d,u=e.startNumber,c=void 0===u?1:u,m=e.periodIndex,g=[],y=-1,h=0;hy){y=b}if(b&&b>y){y=b}var v=void 0;if(0>T){var S=h+1;if(S===t.length){if("dynamic"===n&&0=r){return i}return""+Array(r-i.length+1).join("0")+i}},Pl=function(e,t){return e.replace(/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,Ll(t))},Dl=function(e,t){if(!e.duration&&!t){return[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodIndex}]}if(e.duration){return yl(e)}return xl(e,t)},wl=function(e,t){var a={RepresentationID:e.id,Bandwidth:e.bandwidth||0},n=e.initialization,r=void 0===n?{sourceURL:"",range:""}:n,i=ul({baseUrl:e.baseUrl,source:Pl(r.sourceURL,a),range:r.range}),s=Dl(e,t);return s.map(function(t){a.Number=t.number;a.Time=t.time;var n=Pl(e.media||"",a);return{uri:n,timeline:t.timeline,duration:t.duration,resolvedUri:rs(e.baseUrl||"",n),map:i,number:t.number}})},Al=function(e,t){var a=e.baseUrl,n=e.initialization,r=void 0===n?{}:n,i=ul({baseUrl:a,source:r.sourceURL,range:r.range}),s=ul({baseUrl:a,source:t.media,range:t.mediaRange});s.map=i;return s},Ol=function(e,t){var a=e.duration,n=e.segmentUrls,r=void 0===n?[]:n;if(!a&&!t||a&&t){throw new Error(pl.SEGMENT_TIME_UNSPECIFIED)}var i=r.map(function(t){return Al(e,t)}),s;if(a){s=yl(e)}if(t){s=xl(e,t)}var o=s.map(function(e,t){if(i[t]){var a=i[t];a.timeline=e.timeline;a.duration=e.duration;a.number=e.number;return a}}).filter(function(e){return e});return o},Rl=function(e){var t=e.attributes,a=e.segmentInfo,n,r;if(a.template){r=wl;n=rl(t,a.template)}else if(a.base){r=hl;n=rl(t,a.base)}else if(a.list){r=Ol;n=rl(t,a.list)}var i={attributes:t};if(!r){return i}var s=r(n,a.timeline);if(n.duration){var o=n,l=o.duration,d=o.timescale,p=void 0===d?1:d;n.duration=l/p}else if(s.length){n.duration=s.reduce(function(e,t){return Math.max(e,Math.ceil(t.duration))},0)}else{n.duration=0}i.attributes=n;i.segments=s;if(a.base&&n.indexRange){i.sidx=s[0];i.segments=[]}return i},Nl=function(e){return e.map(Rl)},Ul=function(e,t){return ll(e.childNodes).filter(function(e){var a=e.tagName;return a===t})},Ml=function(e){return e.textContent.trim()},Bl=function(e){var t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!t){return 0}var a=t.slice(1),n=a[0],r=a[1],i=a[2],s=a[3],o=a[4],l=a[5];return parseFloat(n||0)*31536000+parseFloat(r||0)*2592000+parseFloat(i||0)*86400+parseFloat(s||0)*3600+parseFloat(o||0)*60+parseFloat(l||0)},jl=function(e){if(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(e)){e+="Z"}return Date.parse(e)},Fl={mediaPresentationDuration:function(e){return Bl(e)},availabilityStartTime:function(e){return jl(e)/1e3},minimumUpdatePeriod:function(e){return Bl(e)},suggestedPresentationDelay:function(e){return Bl(e)},type:function(e){return e},timeShiftBufferDepth:function(e){return Bl(e)},start:function(e){return Bl(e)},width:function(e){return parseInt(e,10)},height:function(e){return parseInt(e,10)},bandwidth:function(e){return parseInt(e,10)},startNumber:function(e){return parseInt(e,10)},timescale:function(e){return parseInt(e,10)},duration:function(e){var t=parseInt(e,10);if(isNaN(t)){return Bl(e)}return t},d:function(e){return parseInt(e,10)},t:function(e){return parseInt(e,10)},r:function(e){return parseInt(e,10)},DEFAULT:function(e){return e}},Hl=function(e){if(!(e&&e.attributes)){return{}}return ll(e.attributes).reduce(function(t,a){var e=Fl[a.name]||Fl.DEFAULT;t[a.name]=e(a.value);return t},{})},ql={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"},Vl=function(e,t){if(!t.length){return e}return ol(e.map(function(e){return t.map(function(t){return rs(e,Ml(t))})}))},Wl=function(e){var t=Ul(e,"SegmentTemplate")[0],a=Ul(e,"SegmentList")[0],n=a&&Ul(a,"SegmentURL").map(function(e){return rl({tag:"SegmentURL"},Hl(e))}),r=Ul(e,"SegmentBase")[0],i=a||t,s=i&&Ul(i,"SegmentTimeline")[0],o=a||r||t,l=o&&Ul(o,"Initialization")[0],d=t&&Hl(t);if(d&&l){d.initialization=l&&Hl(l)}else if(d&&d.initialization){d.initialization={sourceURL:d.initialization}}var p={template:d,timeline:s&&Ul(s,"S").map(function(e){return Hl(e)}),list:a&&rl(Hl(a),{segmentUrls:n,initialization:Hl(l)}),base:r&&rl(Hl(r),{initialization:Hl(l)})};Object.keys(p).forEach(function(e){if(!p[e]){delete p[e]}});return p},zl=function(e,t,a){return function(n){var r=Ul(n,"BaseURL"),i=Vl(t,r),s=rl(e,Hl(n)),o=Wl(n);return i.map(function(e){return{segmentInfo:rl(a,o),attributes:rl(s,{baseUrl:e})}})}},Gl=function(e){return e.reduce(function(e,t){var a=Hl(t),n=ql[a.schemeIdUri];if(n){e[n]={attributes:a};var r=Ul(t,"cenc:pssh")[0];if(r){var i=Ml(r),s=i&&ls(i);e[n].pssh=s}}return e},{})},Kl=function(e,t,a){return function(n){var r=Hl(n),i=Vl(t,Ul(n,"BaseURL")),s=Ul(n,"Role")[0],o={role:Hl(s)},l=rl(e,r,o),d=Gl(Ul(n,"ContentProtection"));if(Object.keys(d).length){l=rl(l,{contentProtection:d})}var p=Wl(n),u=Ul(n,"Representation"),c=rl(a,p);return ol(u.map(zl(l,i,c)))}},Yl=function(t,a){return function(n,r){var i=Vl(a,Ul(n,"BaseURL")),s=Hl(n),o=parseInt(s.id,10),l=e.isNaN(o)?r:o,d=rl(t,{periodIndex:l}),p=Ul(n,"AdaptationSet"),u=Wl(n);return ol(p.map(Kl(d,i,u)))}},Xl=function(e,t){if(void 0===t){t={}}var a=t,n=a.manifestUri,r=void 0===n?"":n,i=a.NOW,s=void 0===i?Date.now():i,o=a.clientOffset,l=void 0===o?0:o,d=Ul(e,"Period");if(!d.length){throw new Error(pl.INVALID_NUMBER_OF_PERIOD)}var p=Hl(e),u=Vl([r],Ul(e,"BaseURL"));p.sourceDuration=p.mediaPresentationDuration||0;p.NOW=s;p.clientOffset=l;return ol(d.map(Yl(p,u)))},$l=function(e){if(""===e){throw new Error(pl.DASH_EMPTY_MANIFEST)}var t=new al,a=t.parseFromString(e,"application/xml"),n=a&&"MPD"===a.documentElement.tagName?a.documentElement:null;if(!n||n&&0>>0},toHexString:function(e){return("00"+e.toString(16)).slice(-2)}},td,ad,nd=ed.toUnsigned,rd=function(e){return new Date(1e3*e-20828448e5)},id=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},sd=function(e){var t="";t+=String.fromCharCode(e[0]);t+=String.fromCharCode(e[1]);t+=String.fromCharCode(e[2]);t+=String.fromCharCode(e[3]);return t},od=function a(e,t){var n=[],r,s,o,l,d;if(!t.length){return null}for(r=0;r=r){a.push("MALFORMED DATA");continue}switch(31&e[n]){case 1:a.push("slice_layer_without_partitioning_rbsp");break;case 5:a.push("slice_layer_without_partitioning_rbsp_idr");break;case 6:a.push("sei_rbsp");break;case 7:a.push("seq_parameter_set_rbsp");break;case 8:a.push("pic_parameter_set_rbsp");break;case 9:a.push("access_unit_delimiter_rbsp");break;default:a.push(31&"UNKNOWN NAL - "+e[n]);break;}}return a},dd={avc1:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{dataReferenceIndex:t.getUint16(6),width:t.getUint16(24),height:t.getUint16(26),horizresolution:t.getUint16(28)+t.getUint16(30)/16,vertresolution:t.getUint16(32)+t.getUint16(34)/16,frameCount:t.getUint16(40),depth:t.getUint16(74),config:td(e.subarray(78,e.byteLength))}},avcC:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),a={configurationVersion:e[0],avcProfileIndication:e[1],profileCompatibility:e[2],avcLevelIndication:e[3],lengthSizeMinusOne:3&e[4],sps:[],pps:[]},n=31&e[5],r,s,o,l;o=6;for(l=0;l>>2,bufferSize:e[13]<<16|e[14]<<8|e[15],maxBitrate:e[16]<<24|e[17]<<16|e[18]<<8|e[19],avgBitrate:e[20]<<24|e[21]<<16|e[22]<<8|e[23],decoderConfigDescriptor:{tag:e[24],length:e[25],audioObjectType:31&e[26]>>>3,samplingFrequencyIndex:(7&e[26])<<1|1&e[27]>>>7,channelConfiguration:15&e[27]>>>3}}}},ftyp:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),a={majorBrand:sd(e.subarray(0,4)),minorVersion:t.getUint32(4),compatibleBrands:[]},n=8;while(n>10)+96);r.language+=String.fromCharCode(((992&n)>>5)+96);r.language+=String.fromCharCode((31&n)+96);return r},mdia:function(e){return{boxes:td(e)}},mfhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sequenceNumber:e[4]<<24|e[5]<<16|e[6]<<8|e[7]}},minf:function(e){return{boxes:td(e)}},mp4a:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),a={dataReferenceIndex:t.getUint16(6),channelcount:t.getUint16(16),samplesize:t.getUint16(18),samplerate:t.getUint16(24)+t.getUint16(26)/65536};if(28>4,isDependedOn:(12&e[a])>>2,hasRedundancy:3&e[a]})}return t},sidx:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),a={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8),earliestPresentationTime:t.getUint32(12),firstOffset:t.getUint32(16)},n=t.getUint16(22),r;for(r=24;n;r+=12,n--){a.references.push({referenceType:(128&e[r])>>>7,referencedSize:2147483647&t.getUint32(r),subsegmentDuration:t.getUint32(r+4),startsWithSap:!!(128&e[r+8]),sapType:(112&e[r+8])>>>4,sapDeltaTime:268435455&t.getUint32(r+8)})}return a},smhd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),balance:e[4]+e[5]/256}},stbl:function(e){return{boxes:td(e)}},stco:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),a={version:e[0],flags:new Uint8Array(e.subarray(1,4)),chunkOffsets:[]},n=t.getUint32(4),r;for(r=8;n;r+=4,n--){a.chunkOffsets.push(t.getUint32(r))}return a},stsc:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),a=t.getUint32(4),n={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleToChunks:[]},r;for(r=8;a;r+=12,a--){n.sampleToChunks.push({firstChunk:t.getUint32(r),samplesPerChunk:t.getUint32(r+4),sampleDescriptionIndex:t.getUint32(r+8)})}return n},stsd:function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleDescriptions:td(e.subarray(8))}},stsz:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),a={version:e[0],flags:new Uint8Array(e.subarray(1,4)),sampleSize:t.getUint32(4),entries:[]},n;for(n=12;n>6,sampleHasRedundancy:(48&e[21])>>4,samplePaddingValue:(14&e[21])>>1,sampleIsDifferenceSample:!!(1&e[21]),sampleDegradationPriority:t.getUint16(22)}},trun:function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},a=new DataView(e.buffer,e.byteOffset,e.byteLength),n=1&t.flags[2],r=4&t.flags[2],i=1&t.flags[1],s=2&t.flags[1],o=4&t.flags[1],l=8&t.flags[1],d=a.getUint32(4),p=8,u;if(n){t.dataOffset=a.getInt32(p);p+=4}if(r&&d){u={flags:id(e.subarray(p,p+4))};p+=4;if(i){u.duration=a.getUint32(p);p+=4}if(s){u.size=a.getUint32(p);p+=4}if(l){u.compositionTimeOffset=a.getUint32(p);p+=4}t.samples.push(u);d--}while(d--){u={};if(i){u.duration=a.getUint32(p);p+=4}if(s){u.size=a.getUint32(p);p+=4}if(o){u.flags=id(e.subarray(p,p+4));p+=4}if(l){u.compositionTimeOffset=a.getUint32(p);p+=4}t.samples.push(u)}return t},"url ":function(e){return{version:e[0],flags:new Uint8Array(e.subarray(1,4))}},vmhd:function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);return{version:e[0],flags:new Uint8Array(e.subarray(1,4)),graphicsmode:t.getUint16(4),opcolor:new Uint16Array([t.getUint16(6),t.getUint16(8),t.getUint16(10)])}}};td=function(e){for(var t=0,a=[],n,r,s,o,l,d=new ArrayBuffer(e.length),p=new Uint8Array(d),u=0;u"}if(1===i.length){return n+"<"+i.join("").slice(1)+">"}return n+"<\n"+i.map(function(e){return a+" "+e}).join("\n")+"\n"+a+" >"}return n+JSON.stringify(r,null,2).split("\n").map(function(e,t){if(0===t){return e}return a+" "+e}).join("\n")}).join("\n")+(e.boxes?"\n"+ad(e.boxes,t+1):"")}).join("\n")};var pd={inspect:td,textify:ad,parseType:sd,findBox:od,parseTraf:dd.traf,parseTfdt:dd.tfdt,parseHdlr:dd.hdlr,parseTfhd:dd.tfhd,parseTrun:dd.trun,parseSidx:dd.sidx},ud=ed.toUnsigned,cd=ed.toHexString,md,gd,yd,hd,_d;md=function(e){var t=pd.findBox(e,["moov","trak"]);return t.reduce(function(e,t){var a,n,r,i,s;a=pd.findBox(t,["tkhd"])[0];if(!a){return null}n=a[0];r=0===n?12:20;i=ud(a[r]<<24|a[r+1]<<16|a[r+2]<<8|a[r+3]);s=pd.findBox(t,["mdia","mdhd"])[0];if(!s){return null}n=s[0];r=0===n?12:20;e[i]=ud(s[r]<<24|s[r+1]<<16|s[r+2]<<8|s[r+3]);return e},{})};gd=function(e,t){var a,n,r;a=pd.findBox(t,["moof","traf"]);n=[].concat.apply([],a.map(function(t){return pd.findBox(t,["tfhd"]).map(function(a){var n,r,i;n=ud(a[4]<<24|a[5]<<16|a[6]<<8|a[7]);r=e[n]||9e4;i=pd.findBox(t,["tfdt"]).map(function(e){var t,a;t=e[0];a=ud(e[4]<<24|e[5]<<16|e[6]<<8|e[7]);if(1===t){a*=Math.pow(2,32);a+=ud(e[8]<<24|e[9]<<16|e[10]<<8|e[11])}return a})[0];i=i||1/0;return i/r})}));r=Math.min.apply(null,n);return isFinite(r)?r:0};yd=function(e,t){var a=pd.findBox(t,["moof","traf"]),n=0,r=0,s;if(a&&a.length){for(var o=pd.parseTraf(a[0]),l=0;l>>2).replace(/^0/,"")}else{t.codec="mp4a.40.2"}}}}var c=pd.findBox(e,["mdia","mdhd"])[0];if(c&&n){20;t.timescale=ud(c[20]<<24|c[21]<<16|c[22]<<8|c[23])}a.push(t)});return a};var fd={findBox:pd.findBox,parseType:pd.parseType,timescale:md,startTime:gd,compositionStartTime:yd,videoTrackIds:hd,tracks:_d},Td=4,bd=function(e){var t=0,a={payloadType:-1,payloadSize:0},n=0,r=0;while(te.type){this.dispatchCea608Packet(e)}},this);this.captionPackets_.length=0;this.flushCCStreams(e)};Id.prototype.flush=function(){return this.flushStream("flush")};Id.prototype.partialFlush=function(){return this.flushStream("partialFlush")};Id.prototype.reset=function(){this.latestDts_=null;this.ignoreNextEqualDts_=!1;this.numSameDts_=0;this.activeCea608Channel_=[null,null];this.ccStreams_.forEach(function(e){e.reset()})};Id.prototype.dispatchCea608Packet=function(e){if(this.setsTextOrXDSActive(e)){this.activeCea608Channel_[e.type]=null}else if(this.setsChannel1Active(e)){this.activeCea608Channel_[e.type]=0}else if(this.setsChannel2Active(e)){this.activeCea608Channel_[e.type]=1}if(null===this.activeCea608Channel_[e.type]){return}this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)};Id.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)};Id.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)};Id.prototype.setsTextOrXDSActive=function(e){return 256==(28928&e.ccData)||4138==(30974&e.ccData)||6186==(30974&e.ccData)};var xd={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Ld=function(e){if(null===e){return""}e=xd[e]||e;return String.fromCharCode(e)},Pd=14,Dd=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],wd=function(){var e=[],t=Pd+1;while(t--){e.push("")}return e},Ad=function a(e,t){a.prototype.init.call(this);this.field_=e||0;this.dataChannel_=t||0;this.name_="CC"+((this.field_<<1|this.dataChannel_)+1);this.setConstants();this.reset();this.push=function(e){var t,a,n,r,i;t=32639&e.ccData;if(t===this.lastControlCode_){this.lastControlCode_=null;return}if(4096==(61440&t)){this.lastControlCode_=t}else if(t!==this.PADDING_){this.lastControlCode_=null}n=t>>>8;r=255&t;if(t===this.PADDING_){}else if(t===this.RESUME_CAPTION_LOADING_){this.mode_="popOn"}else if(t===this.END_OF_CAPTION_){this.mode_="popOn";this.clearFormatting(e.pts);this.flushDisplayed(e.pts);a=this.displayed_;this.displayed_=this.nonDisplayed_;this.nonDisplayed_=a;this.startPts_=e.pts}else if(t===this.ROLL_UP_2_ROWS_){this.rollUpRows_=2;this.setRollUp(e.pts)}else if(t===this.ROLL_UP_3_ROWS_){this.rollUpRows_=3;this.setRollUp(e.pts)}else if(t===this.ROLL_UP_4_ROWS_){this.rollUpRows_=4;this.setRollUp(e.pts)}else if(t===this.CARRIAGE_RETURN_){this.clearFormatting(e.pts);this.flushDisplayed(e.pts);this.shiftRowsUp_();this.startPts_=e.pts}else if(t===this.BACKSPACE_){if("popOn"===this.mode_){this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1)}else{this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1)}}else if(t===this.ERASE_DISPLAYED_MEMORY_){this.flushDisplayed(e.pts);this.displayed_=wd()}else if(t===this.ERASE_NON_DISPLAYED_MEMORY_){this.nonDisplayed_=wd()}else if(t===this.RESUME_DIRECT_CAPTIONING_){if("paintOn"!==this.mode_){this.flushDisplayed(e.pts);this.displayed_=wd()}this.mode_="paintOn";this.startPts_=e.pts}else if(this.isSpecialCharacter(n,r)){n=(3&n)<<8;i=Ld(n|r);this[this.mode_](e.pts,i);this.column_++}else if(this.isExtCharacter(n,r)){if("popOn"===this.mode_){this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1)}else{this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1)}n=(3&n)<<8;i=Ld(n|r);this[this.mode_](e.pts,i);this.column_++}else if(this.isMidRowCode(n,r)){this.clearFormatting(e.pts);this[this.mode_](e.pts," ");this.column_++;if(14==(14&r)){this.addFormatting(e.pts,["i"])}if(1==(1&r)){this.addFormatting(e.pts,["u"])}}else if(this.isOffsetControlCode(n,r)){this.column_+=3&r}else if(this.isPAC(n,r)){var s=Dd.indexOf(7968&t);if("rollUp"===this.mode_){if(0>s-this.rollUpRows_+1){s=this.rollUpRows_-1}this.setRollUp(e.pts,s)}if(s!==this.row_){this.clearFormatting(e.pts);this.row_=s}if(1&r&&-1===this.formatting_.indexOf("u")){this.addFormatting(e.pts,["u"])}if(16==(16&t)){this.column_=4*((14&t)>>1)}if(this.isColorPAC(r)){if(14==(14&r)){this.addFormatting(e.pts,["i"])}}}else if(this.isNormalChar(n)){if(0===r){r=null}i=Ld(n);i+=Ld(r);this[this.mode_](e.pts,i);this.column_+=i.length}}};Ad.prototype=new Ed;Ad.prototype.flushDisplayed=function(e){var t=this.displayed_.map(function(e){try{return e.trim()}catch(t){console.error("Skipping malformed caption.");return""}}).join("\n").replace(/^\n+|\n+$/g,"");if(t.length){this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})}};Ad.prototype.reset=function(){this.mode_="popOn";this.topRow_=0;this.startPts_=0;this.displayed_=wd();this.nonDisplayed_=wd();this.lastControlCode_=null;this.column_=0;this.row_=Pd;this.rollUpRows_=2;this.formatting_=[]};Ad.prototype.setConstants=function(){if(0===this.dataChannel_){this.BASE_=16;this.EXT_=17;this.CONTROL_=(20|this.field_)<<8;this.OFFSET_=23}else if(1===this.dataChannel_){this.BASE_=24;this.EXT_=25;this.CONTROL_=(28|this.field_)<<8;this.OFFSET_=31}this.PADDING_=0;this.RESUME_CAPTION_LOADING_=32|this.CONTROL_;this.END_OF_CAPTION_=47|this.CONTROL_;this.ROLL_UP_2_ROWS_=37|this.CONTROL_;this.ROLL_UP_3_ROWS_=38|this.CONTROL_;this.ROLL_UP_4_ROWS_=39|this.CONTROL_;this.CARRIAGE_RETURN_=45|this.CONTROL_;this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_;this.BACKSPACE_=33|this.CONTROL_;this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_;this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_};Ad.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&48<=t&&63>=t};Ad.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&32<=t&&63>=t};Ad.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&32<=t&&47>=t};Ad.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&33<=t&&35>=t};Ad.prototype.isPAC=function(e,t){return e>=this.BASE_&&e=t};Ad.prototype.isColorPAC=function(e){return 64<=e&&79>=e||96<=e&&127>=e};Ad.prototype.isNormalChar=function(e){return 32<=e&&127>=e};Ad.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_){this.row_=Pd;this.mode_="rollUp";this.flushDisplayed(e);this.nonDisplayed_=wd();this.displayed_=wd()}if(t!==void 0&&t!==this.row_){for(var a=0;a"},"");this[this.mode_](e,a)};Ad.prototype.clearFormatting=function(e){if(!this.formatting_.length){return}var t=this.formatting_.reverse().reduce(function(e,t){return e+""},"");this.formatting_=[];this[this.mode_](e,t)};Ad.prototype.popOn=function(e,t){var a=this.nonDisplayed_[this.row_];a+=t;this.nonDisplayed_[this.row_]=a};Ad.prototype.rollUp=function(e,t){var a=this.displayed_[this.row_];a+=t;this.displayed_[this.row_]=a};Ad.prototype.shiftRowsUp_=function(){var e;for(e=0;e=l){continue}switch(31&e[o]){case 6:var p=e.subarray(o+1,o+1+l),u=Nd(o,t);s={nalUnitType:"sei_rbsp",size:l,data:p,escapedRBSP:Od(p),trackId:a};if(u){s.pts=u.pts;s.dts=u.dts;d=u}else{s.pts=d.pts;s.dts=d.dts}r.push(s);break;default:break;}}return r},Md=function(e,t,a){var n=t,r=a.defaultSampleDuration||0,i=a.defaultSampleSize||0,s=a.trackId,o=[];e.forEach(function(e){var t=pd.parseTrun(e),a=t.samples;a.forEach(function(e){if(e.duration===void 0){e.duration=r}if(e.size===void 0){e.size=i}e.trackId=s;e.dts=n;if(e.compositionTimeOffset===void 0){e.compositionTimeOffset=0}e.pts=n+e.compositionTimeOffset;n+=e.duration});o=o.concat(a)});return o},Bd=function(e,t){var a=fd.findBox(e,["moof","traf"]),n=fd.findBox(e,["mdat"]),r={},i=[];n.forEach(function(e,t){var n=a[t];i.push({mdat:e,traf:n})});i.forEach(function(e){var a=e.mdat,n=e.traf,i=fd.findBox(n,["tfhd"]),s=pd.parseTfhd(i[0]),o=s.trackId,l=fd.findBox(n,["tfdt"]),d=0t){a=-1}while(Math.abs(t-e)>4294967296){e+=a*8589934592}return e},Wd=function t(e){var a,n;t.prototype.init.call(this);this.type_=e||qd;this.push=function(e){if(this.type_!==qd&&e.type!==this.type_){return}if(n===void 0){n=e.dts}e.dts=Vd(e.dts,n);e.pts=Vd(e.pts,n);a=e.dts;this.trigger("data",e)};this.flush=function(){n=a;this.trigger("done")};this.endTimeline=function(){this.flush();this.trigger("endedtimeline")};this.discontinuity=function(){n=void 0;a=void 0};this.reset=function(){this.discontinuity();this.trigger("reset")}};Wd.prototype=new Ed;var zd=function(e){var t=31&e[1];t<<=8;t|=e[2];return t},Gd=function(e){return!!(64&e[1])},Kd=function(e){var t=0;if(1<(48&e[3])>>>4){t+=e[4]+1}return t},Yd=function(e){var t={},a=Gd(e),n=4+Kd(e);if(a){n+=e[n]+1}if(!(1&e[n+5])){return}var r,s,o;r=(15&e[n+1])<<8|e[n+2];s=3+r-4;o=(15&e[n+10])<<8|e[n+11];var l=12+o;while(l>>2]}return null},tp=function(e){var t,a,n,r;t=10;if(64&e[5]){t+=4;t+=Qd(e.subarray(10,14))}do{a=Qd(e.subarray(t+4,t+8));if(1>a){return null}r=String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3]);if("PRIV"===r){n=e.subarray(t+10,t+a+10);for(var s=0;s>>2;d*=4;d+=3&l[7];return d}break}}}t+=10;t+=a}while(t=e.byteLength){return null}var n=null,r;r=e[a+7];if(192&r){n={};n.pts=(14&e[a+9])<<27|(255&e[a+10])<<20|(254&e[a+11])<<12|(255&e[a+12])<<5|(254&e[a+13])>>>3;n.pts*=4;n.pts+=(6&e[a+13])>>>1;n.dts=n.pts;if(64&r){n.dts=(14&e[a+14])<<27|(255&e[a+15])<<20|(254&e[a+16])<<12|(255&e[a+17])<<5|(254&e[a+18])>>>3;n.dts*=4;n.dts+=(6&e[a+18])>>>1}}return n},videoPacketContainsKeyFrame:function(e){var t=4+Kd(e),a=e.subarray(t),n=0,r=0,i=!1,s;for(;r>4){return a+20}return a+10},parseAdtsSize:function(e,t){var a=(224&e[t+5])>>5,n=e[t+4]<<3,r=e[t+3]&6144;return r|n|a},parseType:function(e,t){if(e[t]===73&&e[t+1]===68&&e[t+2]===51){return"timed-metadata"}else if(e[t]&!0&&240==(240&e[t+1])){return"audio"}return null},parseSampleRate:ep,parseAacTimestamp:tp};var mp=pp.ONE_SECOND_IN_TS,gp=188,yp=71,hp=function(e,t){var a=0,n=gp,r,i;while(ne.length-s){t=!0;break}i=cp.aac.parseId3TagSize(e,s);if(i>e.length){t=!0;break}if(null===r){o=e.subarray(s,s+i);r=cp.aac.parseAacTimestamp(o)}s+=i;break;case"audio":if(7>e.length-s){t=!0;break}i=cp.aac.parseAdtsSize(e,s);if(i>e.length){t=!0;break}if(null===n){o=e.subarray(s,s+i);n=cp.aac.parseSampleRate(o)}a++;s+=i;break;default:s++;break;}if(t){return null}}if(null===n||null===r){return null}var d=mp/n,p={audio:[{type:"audio",dts:r,pts:r},{type:"audio",dts:r+1024*a*d,pts:r+1024*a*d}]};return p},vp=function(e){var t={pid:null,table:null},a={};hp(e,t);for(var n in t.table){if(t.table.hasOwnProperty(n)){var r=t.table[n];switch(r){case Hd.H264_STREAM_TYPE:a.video=[];fp(e,t,a);if(0===a.video.length){delete a.video}break;case Hd.ADTS_STREAM_TYPE:a.audio=[];_p(e,t,a);if(0===a.audio.length){delete a.audio}break;default:break;}}}return a};function Sp(e){return e.subarray(0,e.byteLength-e[e.byteLength-1])}var kp=function(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}},Cp=function(){function e(e,t){for(var a=0,n;ao;o++){d[(u[o]=o<<1^283*(o>>7))^o]=o}for(l=p=0;!n[l];l^=c||1,p=d[p]||1){y=p^p<<1^p<<2^p<<3^p<<4;y=99^(y>>8^255&y);n[l]=y;r[y]=l;g=u[m=u[c=u[l]]];_=16843009*g^65537*m^257*c^16843008*l;h=257*u[y]^16843008*y;for(o=0;4>o;o++){t[o][l]=h=h<<24^h>>>8;a[o][y]=_=_<<24^_>>>8}}for(o=0;5>o;o++){t[o]=t[o].slice(0);a[o]=a[o].slice(0)}return e},Lp=null,Pp=function(){function e(t){kp(this,e);if(!Lp){Lp=xp()}this._tables=[[Lp[0][0].slice(),Lp[0][1].slice(),Lp[0][2].slice(),Lp[0][3].slice(),Lp[0][4].slice()],[Lp[1][0].slice(),Lp[1][1].slice(),Lp[1][2].slice(),Lp[1][3].slice(),Lp[1][4].slice()]];var a=void 0,n=void 0,r=void 0,s=void 0,o=void 0,l=this._tables[0][4],d=this._tables[1],p=t.length,u=1;if(4!==p&&6!==p&&8!==p){throw new Error("Invalid aes key size")}s=t.slice(0);o=[];this._key=[s,o];for(a=p;a<4*p+28;a++){r=s[a-1];if(0==a%p||8===p&&4==a%p){r=l[r>>>24]<<24^l[255&r>>16]<<16^l[255&r>>8]<<8^l[255&r];if(0==a%p){r=r<<8^r>>>24^u<<24;u=u<<1^283*(u>>7)}}s[a]=s[a-p]^r}for(n=0;a;n++,a--){r=s[3&n?a:a-4];if(4>=a||4>n){o[n]=r}else{o[n]=d[0][l[r>>>24]]^d[1][l[255&r>>16]]^d[2][l[255&r>>8]]^d[3][l[255&r]]}}}e.prototype.decrypt=function(e,t,n,r,s,o){var l=this._key[1],p=e^l[0],u=r^l[1],m=n^l[2],g=t^l[3],y=void 0,h=void 0,_=void 0,f=l.length/4-2,T=void 0,v=4,S=this._tables[1],k=S[0],C=S[1],E=S[2],I=S[3],x=S[4];for(T=0;T>>24]^C[255&u>>16]^E[255&m>>8]^I[255&g]^l[v];h=k[u>>>24]^C[255&m>>16]^E[255&g>>8]^I[255&p]^l[v+1];_=k[m>>>24]^C[255&g>>16]^E[255&p>>8]^I[255&u]^l[v+2];g=k[g>>>24]^C[255&p>>16]^E[255&u>>8]^I[255&m]^l[v+3];v+=4;p=y;u=h;m=_}for(T=0;4>T;T++){s[(3&-T)+o]=x[p>>>24]<<24^x[255&u>>16]<<16^x[255&m>>8]<<8^x[255&g]^l[v++];y=p;p=u;u=m;m=g;g=y}};return e}(),Dp=function(){function e(){kp(this,e);this.listeners={}}e.prototype.on=function(e,t){if(!this.listeners[e]){this.listeners[e]=[]}this.listeners[e].push(t)};e.prototype.off=function(e,t){if(!this.listeners[e]){return!1}var a=this.listeners[e].indexOf(t);this.listeners[e].splice(a,1);return-1>8|e>>>24},Op=function(e,t,a){var n=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),r=new Pp(Array.prototype.slice.call(t)),i=new Uint8Array(e.byteLength),s=new Int32Array(i.buffer),o=void 0,l=void 0,d=void 0,p=void 0,u=void 0,c=void 0,m=void 0,g=void 0,y=void 0;o=a[0];l=a[1];d=a[2];p=a[3];for(y=0;ya){var r=[a,t];t=r[0];a=r[1]}if(0>t){for(var s=t;s=r){break}}return Math.max(0,a)},lu=function(e,t,a,n){if(!e||!e.segments){return null}if(e.endList){return iu(e)}if(null===t){return null}t=t||0;var r=a?ou(e,n):e.segments.length;return ru(e,e.mediaSequence+r,t)},du=function(e){return 0==e-Math.floor(e)},pu=function(e,t){if(du(t)){return t+.1*e}for(var a=t.toString().split(".")[1].length,n=1;n<=a;n++){var r=Math.pow(10,n),s=t*r;if(du(s)||n===a){return(s+e)/r}}},uu=pu.bind(null,1),cu=pu.bind(null,-1),mu=function(e,t,a,n){var r=void 0,s=void 0,o=e.segments.length,l=t-n;if(0>l){if(0a){for(r=a;0>r;r++){l-=e.targetDuration;if(0>l){return{mediaIndex:0,startTime:t}}}a=0}for(r=a;rl){return{mediaIndex:r,startTime:n+su(e,a,r)}}}return{mediaIndex:o-1,startTime:t}},gu=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},yu=function(e){return e.excludeUntil&&e.excludeUntil===1/0},hu=function(e){var t=gu(e);return!e.disabled&&!t},_u=function(e){for(var t=0;tt){return String.fromCharCode(t)}return"."},Du=function(e){var t={};Object.keys(e).forEach(function(a){var n=e[a];if(ArrayBuffer.isView(n)){t[a]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}}else{t[a]=n}});return t},wu=function(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},Au=function(e){return e.resolvedUri},Ou=function(e){for(var t=Array.prototype.slice.call(e),a=16,n="",r=void 0,i=void 0,s=0;sp){return null}if(a>l){n=o}return{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:vu.duration(t,t.mediaSequence+t.segments.indexOf(n)),type:n.videoTimingInfo?"accurate":"estimate"}},Fu=function(e,t){if(!t||!t.segments||0===t.segments.length){return null}for(var a=0,n=void 0,r=0;ra){if(e>a+s.duration*Uu){return null}n=s}return{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:a-n.duration,type:n.videoTimingInfo?"accurate":"estimate"}},Hu=function(e,t){var a=void 0,n=void 0;try{a=new Date(e);n=new Date(t)}catch(t){}var r=a.getTime(),i=n.getTime();return(i-r)/1e3},qu=function(e){if(!e.segments||0===e.segments.length){return!1}for(var t=0,a;t=t})},Xu=function(e,t){return Ku(e,function(e){return e-zu>=t})},$u=function(e){if(2>e.length){return Hi.createTimeRanges()}for(var t=[],a=1;a "+e.end(a))}return t.join(", ")},Ju=function(e,t){var a=2=e){a.removeCue(r)}}},ac=function(e){Object.defineProperties(e.frame,{id:{get:function(){Hi.log.warn("cue.frame.id is deprecated. Use cue.value.key instead.");return e.value.key}},value:{get:function(){Hi.log.warn("cue.frame.value is deprecated. Use cue.value.data instead.");return e.value.data}},privateData:{get:function(){Hi.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead.");return e.value.data}}})},nc=function(e){var t;if(isNaN(e)||Math.abs(e)===1/0){t=Number.MAX_VALUE}else{t=e}return t},rc=function(t,a,n){var r=e.WebKitDataCue||e.VTTCue;if(a){a.forEach(function(e){var t=e.stream;this.inbandTextTracks_[t].addCue(new r(e.startTime+this.timestampOffset,e.endTime+this.timestampOffset,e.text))},t)}if(n){var s=nc(t.mediaSource_.duration);n.forEach(function(t){var a=t.cueTime+this.timestampOffset;if("number"!=typeof a||e.isNaN(a)||0>a||!(a<1/0)){return}t.frames.forEach(function(e){var t=new r(a,a,e.value||e.url||e.data||"");t.frame=e;t.value=e;ac(t);this.metadataTrack_.addCue(t)},this)},t);if(t.metadataTrack_&&t.metadataTrack_.cues&&t.metadataTrack_.cues.length){for(var o=t.metadataTrack_.cues,l=[],d=0;d>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))};o=function(){return r(I.ftyp,x,L,x,P)};T=function(e){return r(I.hdlr,A[e])};l=function(e){return r(I.mdat,e)};f=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,255&e.duration>>>24,255&e.duration>>>16,255&e.duration>>>8,255&e.duration,85,196,0,0]);if(e.samplerate){t[12]=255&e.samplerate>>>24;t[13]=255&e.samplerate>>>16;t[14]=255&e.samplerate>>>8;t[15]=255&e.samplerate}return r(I.mdhd,t)};_=function(e){return r(I.mdia,f(e),T(e.type),p(e))};d=function(e){return r(I.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))};p=function(e){return r(I.minf,"video"===e.type?r(I.vmhd,O):r(I.smhd,R),i(),v(e))};u=function(e,t){var a=[],n=t.length;while(n--){a[n]=k(t[n])}return r.apply(null,[I.moof,d(e)].concat(a))};c=function(e){var t=e.length,a=[];while(t--){a[t]=y(e[t])}return r.apply(null,[I.moov,g(4294967295)].concat(a).concat(m(e)))};m=function(e){var t=e.length,a=[];while(t--){a[t]=C(e[t])}return r.apply(null,[I.mvex].concat(a))};g=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return r(I.mvhd,t)};b=function(e){var t=e.samples||[],a=new Uint8Array(4+t.length),n,s;for(s=0;s>>8);n.push(255&t[o].byteLength);n=n.concat(Array.prototype.slice.call(t[o]))}for(o=0;o>>8);s.push(255&a[o].byteLength);s=s.concat(Array.prototype.slice.call(a[o]))}l=[I.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),r(I.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([t.length],n,[a.length],s))),r(I.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))];if(e.sarRatio){var d=e.sarRatio[0],p=e.sarRatio[1];l.push(r(I.pasp,new Uint8Array([(4278190080&d)>>24,(16711680&d)>>16,(65280&d)>>8,255&d,(4278190080&p)>>24,(16711680&p)>>16,(65280&p)>>8,255&p])))}return r.apply(null,l)};t=function(e){return r(I.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),s(e))}})();h=function(e){var t=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return r(I.tkhd,t)};k=function(e){var t,a,i,s,o,l,d;t=r(I.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0]));l=Math.floor(e.baseMediaDecodeTime/(n+1));d=Math.floor(e.baseMediaDecodeTime%(n+1));a=r(I.tfdt,new Uint8Array([1,0,0,0,255&l>>>24,255&l>>>16,255&l>>>8,255&l,255&d>>>24,255&d>>>16,255&d>>>8,255&d]));o=92;if("audio"===e.type){i=E(e,o);return r(I.traf,t,a,i)}s=b(e);i=E(e,s.length+o);return r(I.traf,t,a,i,s)};y=function(e){e.duration=e.duration||4294967295;return r(I.trak,h(e),_(e))};C=function(e){var t=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);if("video"!==e.type){t[t.length-1]=0}return r(I.trex,t)};(function(){var e,t,a;a=function(e,t){var a=0,n=0,r=0,i=0;if(e.length){if(e[0].duration!==void 0){a=1}if(e[0].size!==void 0){n=2}if(e[0].flags!==void 0){r=4}if(e[0].compositionTimeOffset!==void 0){i=8}}return[0,0,a|n|r|i,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]};t=function(e,t){var n,s,o,l;s=e.samples||[];t+=20+16*s.length;n=a(s,t);for(l=0;l>>24,(16711680&o.duration)>>>16,(65280&o.duration)>>>8,255&o.duration,(4278190080&o.size)>>>24,(16711680&o.size)>>>16,(65280&o.size)>>>8,255&o.size,o.flags.isLeading<<2|o.flags.dependsOn,o.flags.isDependedOn<<6|o.flags.hasRedundancy<<4|o.flags.paddingValue<<1|o.flags.isNonSyncSample,o.flags.degradationPriority&61440,15&o.flags.degradationPriority,(4278190080&o.compositionTimeOffset)>>>24,(16711680&o.compositionTimeOffset)>>>16,(65280&o.compositionTimeOffset)>>>8,255&o.compositionTimeOffset])}return r(I.trun,new Uint8Array(n))};e=function(e,t){var n,s,o,l;s=e.samples||[];t+=20+8*s.length;n=a(s,t);for(l=0;l>>24,(16711680&o.duration)>>>16,(65280&o.duration)>>>8,255&o.duration,(4278190080&o.size)>>>24,(16711680&o.size)>>>16,(65280&o.size)>>>8,255&o.size])}return r(I.trun,new Uint8Array(n))};E=function(a,n){if("audio"===a.type){return e(a,n)}return t(a,n)}})();var F={ftyp:o,mdat:l,moof:u,moov:c,initSegment:function(e){var t=o(),a=c(e),n;n=new Uint8Array(t.byteLength+a.byteLength);n.set(t);n.set(a,t.byteLength);return n}},H=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},q=function(e,t){var a=H();a.dataOffset=t;a.compositionTimeOffset=e.pts-e.dts;a.duration=e.duration;a.size=4*e.length;a.size+=e.byteLength;if(e.keyFrame){a.flags.dependsOn=2;a.flags.isNonSyncSample=0}return a},V={groupNalsIntoFrames:function(e){var t,a,n=[],r=[];r.byteLength=0;r.nalCount=0;r.duration=0;n.byteLength=0;for(t=0;t=n.duration)){n.duration=r[r.length-1].duration}r.byteLength+=n.byteLength;r.nalCount+=n.length;r.duration+=n.duration;r.push(n);return r},groupFramesIntoGops:function(e){var t,a,n=[],r=[];n.byteLength=0;n.nalCount=0;n.duration=0;n.pts=e[0].pts;n.dts=e[0].dts;r.byteLength=0;r.nalCount=0;r.duration=0;r.pts=e[0].pts;r.dts=e[0].dts;for(t=0;t=n.duration){n.duration=r[r.length-1].duration}r.byteLength+=n.byteLength;r.nalCount+=n.nalCount;r.duration+=n.duration;r.push(n);return r},extendFirstKeyFrame:function(e){var t;if(!e[0][0].keyFrame&&1l||d>ne.ONE_SECOND_IN_TS/2){return}p=Y[e.samplerate];if(!p){p=t[0].data}for(u=0;u=a){return e}t.minSegmentDts=1/0;return e.filter(function(e){if(e.dts>=a){t.minSegmentDts=Math.min(t.minSegmentDts,e.dts);t.minSegmentPts=t.minSegmentDts;return!0}return!1})},generateSampleTable:function(e){var t,a,n=[];for(t=0;te.type){this.dispatchCea608Packet(e)}},this);this.captionPackets_.length=0;this.flushCCStreams(e)};pe.prototype.flush=function(){return this.flushStream("flush")};pe.prototype.partialFlush=function(){return this.flushStream("partialFlush")};pe.prototype.reset=function(){this.latestDts_=null;this.ignoreNextEqualDts_=!1;this.numSameDts_=0;this.activeCea608Channel_=[null,null];this.ccStreams_.forEach(function(e){e.reset()})};pe.prototype.dispatchCea608Packet=function(e){if(this.setsTextOrXDSActive(e)){this.activeCea608Channel_[e.type]=null}else if(this.setsChannel1Active(e)){this.activeCea608Channel_[e.type]=0}else if(this.setsChannel2Active(e)){this.activeCea608Channel_[e.type]=1}if(null===this.activeCea608Channel_[e.type]){return}this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)};pe.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)};pe.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)};pe.prototype.setsTextOrXDSActive=function(e){return 256==(28928&e.ccData)||4138==(30974&e.ccData)||6186==(30974&e.ccData)};var ue={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},ce=function(e){if(null===e){return""}e=ue[e]||e;return String.fromCharCode(e)},me=14,ge=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],ye=function(){var e=[],t=me+1;while(t--){e.push("")}return e},he=function a(e,t){a.prototype.init.call(this);this.field_=e||0;this.dataChannel_=t||0;this.name_="CC"+((this.field_<<1|this.dataChannel_)+1);this.setConstants();this.reset();this.push=function(e){var t,a,n,r,i;t=32639&e.ccData;if(t===this.lastControlCode_){this.lastControlCode_=null;return}if(4096==(61440&t)){this.lastControlCode_=t}else if(t!==this.PADDING_){this.lastControlCode_=null}n=t>>>8;r=255&t;if(t===this.PADDING_){}else if(t===this.RESUME_CAPTION_LOADING_){this.mode_="popOn"}else if(t===this.END_OF_CAPTION_){this.mode_="popOn";this.clearFormatting(e.pts);this.flushDisplayed(e.pts);a=this.displayed_;this.displayed_=this.nonDisplayed_;this.nonDisplayed_=a;this.startPts_=e.pts}else if(t===this.ROLL_UP_2_ROWS_){this.rollUpRows_=2;this.setRollUp(e.pts)}else if(t===this.ROLL_UP_3_ROWS_){this.rollUpRows_=3;this.setRollUp(e.pts)}else if(t===this.ROLL_UP_4_ROWS_){this.rollUpRows_=4;this.setRollUp(e.pts)}else if(t===this.CARRIAGE_RETURN_){this.clearFormatting(e.pts);this.flushDisplayed(e.pts);this.shiftRowsUp_();this.startPts_=e.pts}else if(t===this.BACKSPACE_){if("popOn"===this.mode_){this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1)}else{this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1)}}else if(t===this.ERASE_DISPLAYED_MEMORY_){this.flushDisplayed(e.pts);this.displayed_=ye()}else if(t===this.ERASE_NON_DISPLAYED_MEMORY_){this.nonDisplayed_=ye()}else if(t===this.RESUME_DIRECT_CAPTIONING_){if("paintOn"!==this.mode_){this.flushDisplayed(e.pts);this.displayed_=ye()}this.mode_="paintOn";this.startPts_=e.pts}else if(this.isSpecialCharacter(n,r)){n=(3&n)<<8;i=ce(n|r);this[this.mode_](e.pts,i);this.column_++}else if(this.isExtCharacter(n,r)){if("popOn"===this.mode_){this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1)}else{this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1)}n=(3&n)<<8;i=ce(n|r);this[this.mode_](e.pts,i);this.column_++}else if(this.isMidRowCode(n,r)){this.clearFormatting(e.pts);this[this.mode_](e.pts," ");this.column_++;if(14==(14&r)){this.addFormatting(e.pts,["i"])}if(1==(1&r)){this.addFormatting(e.pts,["u"])}}else if(this.isOffsetControlCode(n,r)){this.column_+=3&r}else if(this.isPAC(n,r)){var s=ge.indexOf(7968&t);if("rollUp"===this.mode_){if(0>s-this.rollUpRows_+1){s=this.rollUpRows_-1}this.setRollUp(e.pts,s)}if(s!==this.row_){this.clearFormatting(e.pts);this.row_=s}if(1&r&&-1===this.formatting_.indexOf("u")){this.addFormatting(e.pts,["u"])}if(16==(16&t)){this.column_=4*((14&t)>>1)}if(this.isColorPAC(r)){if(14==(14&r)){this.addFormatting(e.pts,["i"])}}}else if(this.isNormalChar(n)){if(0===r){r=null}i=ce(n);i+=ce(r);this[this.mode_](e.pts,i);this.column_+=i.length}}};he.prototype=new a;he.prototype.flushDisplayed=function(e){var t=this.displayed_.map(function(e){try{return e.trim()}catch(t){console.error("Skipping malformed caption.");return""}}).join("\n").replace(/^\n+|\n+$/g,"");if(t.length){this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})}};he.prototype.reset=function(){this.mode_="popOn";this.topRow_=0;this.startPts_=0;this.displayed_=ye();this.nonDisplayed_=ye();this.lastControlCode_=null;this.column_=0;this.row_=me;this.rollUpRows_=2;this.formatting_=[]};he.prototype.setConstants=function(){if(0===this.dataChannel_){this.BASE_=16;this.EXT_=17;this.CONTROL_=(20|this.field_)<<8;this.OFFSET_=23}else if(1===this.dataChannel_){this.BASE_=24;this.EXT_=25;this.CONTROL_=(28|this.field_)<<8;this.OFFSET_=31}this.PADDING_=0;this.RESUME_CAPTION_LOADING_=32|this.CONTROL_;this.END_OF_CAPTION_=47|this.CONTROL_;this.ROLL_UP_2_ROWS_=37|this.CONTROL_;this.ROLL_UP_3_ROWS_=38|this.CONTROL_;this.ROLL_UP_4_ROWS_=39|this.CONTROL_;this.CARRIAGE_RETURN_=45|this.CONTROL_;this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_;this.BACKSPACE_=33|this.CONTROL_;this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_;this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_};he.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&48<=t&&63>=t};he.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&32<=t&&63>=t};he.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&32<=t&&47>=t};he.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&33<=t&&35>=t};he.prototype.isPAC=function(e,t){return e>=this.BASE_&&e=t};he.prototype.isColorPAC=function(e){return 64<=e&&79>=e||96<=e&&127>=e};he.prototype.isNormalChar=function(e){return 32<=e&&127>=e};he.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_){this.row_=me;this.mode_="rollUp";this.flushDisplayed(e);this.nonDisplayed_=ye();this.displayed_=ye()}if(t!==void 0&&t!==this.row_){for(var a=0;a"},"");this[this.mode_](e,a)};he.prototype.clearFormatting=function(e){if(!this.formatting_.length){return}var t=this.formatting_.reverse().reduce(function(e,t){return e+""},"");this.formatting_=[];this[this.mode_](e,t)};he.prototype.popOn=function(e,t){var a=this.nonDisplayed_[this.row_];a+=t;this.nonDisplayed_[this.row_]=a};he.prototype.rollUp=function(e,t){var a=this.displayed_[this.row_];a+=t;this.displayed_[this.row_]=a};he.prototype.shiftRowsUp_=function(){var e;for(e=0;et){a=-1}while(Math.abs(t-e)>4294967296){e+=a*8589934592}return e},ve=function t(e){var a,n;t.prototype.init.call(this);this.type_=e||Te;this.push=function(e){if(this.type_!==Te&&e.type!==this.type_){return}if(n===void 0){n=e.dts}e.dts=be(e.dts,n);e.pts=be(e.pts,n);a=e.dts;this.trigger("data",e)};this.flush=function(){n=a;this.trigger("done")};this.endTimeline=function(){this.flush();this.trigger("endedtimeline")};this.discontinuity=function(){n=void 0;a=void 0};this.reset=function(){this.discontinuity();this.trigger("reset")}};ve.prototype=new a;var Se=function(e,t,a){var n,r="";for(n=t;ne.data.length||e.data[0]!==73||e.data[1]!==68||e.data[2]!==51)){if(t.debug){console.log("Skipping unrecognized metadata packet")}return}n.push(e);r+=e.data.byteLength;if(1===n.length){a=Ee(e.data.subarray(6,10));a+=10}if(rl){return console.log("Malformed ID3 frame encountered. Skipping metadata parsing.")}c=String.fromCharCode(s.data[o],s.data[o+1],s.data[o+2],s.data[o+3]);p={id:c,data:s.data.subarray(o+10,o+l+10)};p.key=p.id;if(Ie[p.id]){Ie[p.id](p);if("com.apple.streaming.transportStreamTimestamp"===p.owner){var m=p.data,d=(1&m[3])<<30|m[4]<<22|m[5]<<14|m[6]<<6|m[7]>>>2;d*=4;d+=3&m[7];p.timeStamp=d;if(s.pts===void 0&&s.dts===void 0){s.pts=p.timeStamp;s.dts=p.timeStamp}this.trigger("timestamp",p)}}s.frames.push(p);o+=10;o+=l}while(o>>4){n+=t[n]+1}if(0===a.pid){a.type="pat";e(t.subarray(n),a);this.trigger("data",a)}else if(a.pid===this.pmtPid){a.type="pmt";e(t.subarray(n),a);this.trigger("data",a);while(this.packetsWaitingForPmt.length){this.processPes_.apply(this,this.packetsWaitingForPmt.shift())}}else if(this.programMapTable===void 0){this.packetsWaitingForPmt.push([t,n,a])}else{this.processPes_(t,n,a)}};this.processPes_=function(e,t,a){if(a.pid===this.programMapTable.video){a.streamType=fe.H264_STREAM_TYPE}else if(a.pid===this.programMapTable.audio){a.streamType=fe.ADTS_STREAM_TYPE}else{a.streamType=this.programMapTable["timed-metadata"][a.pid]}a.type="pes";a.data=e.subarray(t);this.trigger("data",a)}};we.prototype=new a;we.STREAM_TYPES={h264:27,adts:15};Ae=function(){var e=this,t={data:[],size:0},a={data:[],size:0},n={data:[],size:0},r,s=function(e,t){var a;t.packetLength=6+(e[4]<<8|e[5]);t.dataAlignmentIndicator=0!=(4&e[6]);a=e[7];if(192&a){t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3;t.pts*=4;t.pts+=(6&e[13])>>>1;t.dts=t.pts;if(64&a){t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3;t.dts*=4;t.dts+=(6&e[18])>>>1}}t.data=e.subarray(9+e[8])},o=function(t,a,n){var r=new Uint8Array(t.size),o={type:a},l=0,d=0,p=!1,u;if(!t.data.length||9>t.size){return}o.trackId=t.data[0].pid;for(l=0;l>5;p=1024*((3&t[r+6])+1);u=p*Be/Fe[(60&t[r+2])>>>2];l=r+s;if(t.byteLength>>6)+1,channelcount:(1&t[r+2])<<2|(192&t[r+3])>>>6,samplerate:Fe[(60&t[r+2])>>>2],samplingfrequencyindex:(60&t[r+2])>>>2,samplesize:16,data:t.subarray(r+7+o,l)});a++;if(t.byteLength===l){t=void 0;return}t=t.subarray(l)}};this.flush=function(){a=0;this.trigger("done")};this.reset=function(){t=void 0;this.trigger("reset")};this.endTimeline=function(){t=void 0;this.trigger("endedtimeline")}};je.prototype=new a;var He=je,qe;qe=function(e){var t=e.byteLength,a=0,n=0;this.length=function(){return 8*t};this.bitsAvailable=function(){return 8*t+n};this.loadWord=function(){var r=e.byteLength-t,i=new Uint8Array(4),s=Math.min(4,t);if(0===s){throw new Error("no bytes available")}i.set(e.subarray(r,r+s));a=new DataView(i.buffer).getUint32(0);n=8*s;t-=s};this.skipBits=function(e){var r;if(n>e){a<<=e;n-=e}else{e-=n;r=Math.floor(e/8);e-=8*r;t-=r;this.loadWord();a<<=e;n-=e}};this.readBits=function(e){var r=Math.min(n,e),i=a>>>32-r;n-=r;if(0>>e)){a<<=e;n-=e;return e}}this.loadWord();return e+this.skipLeadingZeros()};this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())};this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())};this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1};this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();if(1&e){return 1+e>>>1}return-1*(e>>>1)};this.readBoolean=function(){return 1===this.readBits(1)};this.readUnsignedByte=function(){return this.readBits(8)};this.loadWord()};var Ve=qe,We,ze,Ge;ze=function(){var e=0,t,a;ze.prototype.init.call(this);this.push=function(n){var r;if(!a){a=n.data}else{r=new Uint8Array(a.byteLength+n.data.byteLength);r.set(a);r.set(n.data,a.byteLength);a=r}var i=a.byteLength;for(;ev){o(16,l)}else{o(64,l)}}}}}l.skipUnsignedExpGolomb();m=l.readUnsignedExpGolomb();if(0===m){l.readUnsignedExpGolomb()}else if(1===m){l.skipBits(1);l.skipExpGolomb();l.skipExpGolomb();g=l.readUnsignedExpGolomb();for(v=0;v>4){return a+20}return a+10},parseAdtsSize:function(e,t){var a=(224&e[t+5])>>5,n=e[t+4]<<3,r=e[t+3]&6144;return r|n|a},parseType:function(e,t){if(e[t]===73&&e[t+1]===68&&e[t+2]===51){return"timed-metadata"}else if(e[t]&!0&&240==(240&e[t+1])){return"audio"}return null},parseSampleRate:function(e){var t=0;while(t+5>>2]}return null},parseAacTimestamp:function(e){var t,a,n,r;t=10;if(64&e[5]){t+=4;t+=Xe(e.subarray(10,14))}do{a=Xe(e.subarray(t+4,t+8));if(1>a){return null}r=String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3]);if("PRIV"===r){n=e.subarray(t+10,t+a+10);for(var s=0;s>>2;d*=4;d+=3&l[7];return d}break}}}t+=10;t+=a}while(te.length-r){break}n=Je.parseId3TagSize(e,r);if(r+n>e.length){break}s={type:"timed-metadata",data:e.subarray(r,r+n)};this.trigger("data",s);r+=n;continue}else if(255==(255&e[r])&&240==(240&e[r+1])){if(7>e.length-r){break}n=Je.parseAdtsSize(e,r);if(r+n>e.length){break}o={type:"audio",data:e.subarray(r,r+n),pts:t,dts:t};this.trigger("data",o);r+=n;continue}r++}i=e.length-r;if(0=-10000&&n<=45000){if(!r||a>n){r=o;a=n}}}if(r){return r.gop}return null};this.alignGopsAtStart_=function(e){var t,a,n,i,s,o,l,d;s=e.byteLength;o=e.nalCount;l=e.duration;t=a=0;while(tn.pts){t++;continue}a++;s-=i.byteLength;o-=i.nalCount;l-=i.duration}if(0===a){return e}if(a===e.length){return null}d=e.slice(a);d.byteLength=s;d.duration=l;d.nalCount=o;d.pts=d[0].pts;d.dts=d[0].dts;return d};this.alignGopsAtEnd_=function(e){var t,a,n,i,s,o;t=r.length-1;a=e.length-1;s=null;o=!1;while(0<=t&&0<=a){n=r[t];i=e[a];if(n.pts===i.pts){o=!0;break}if(n.pts>i.pts){t--;continue}if(t===r.length-1){s=a}a--}if(!o&&null===s){return null}var l;if(o){l=a}else{l=s}if(0===l){return e}var d=e.slice(l),p=d.reduce(function(e,t){e.byteLength+=t.byteLength;e.duration+=t.duration;e.nalCount+=t.nalCount;return e},{byteLength:0,duration:0,nalCount:0});d.byteLength=p.byteLength;d.duration=p.duration;d.nalCount=p.nalCount;d.pts=d[0].pts;d.dts=d[0].dts;return d};this.alignGopsWith=function(e){r=e}};st.prototype=new a;dt=function(e,t){this.numberOfTracks=0;this.metadataStream=t;e=e||{};if("undefined"!=typeof e.remux){this.remuxTracks=!!e.remux}else{this.remuxTracks=!0}if("boolean"==typeof e.keepOriginalTimestamps){this.keepOriginalTimestamps=e.keepOriginalTimestamps}else{this.keepOriginalTimestamps=!1}this.pendingTracks=[];this.videoTrack=null;this.pendingBoxes=[];this.pendingCaptions=[];this.pendingMetadata=[];this.pendingBytes=0;this.emittedTracks=0;dt.prototype.init.call(this);this.push=function(e){if(e.text){return this.pendingCaptions.push(e)}if(e.frames){return this.pendingMetadata.push(e)}this.pendingTracks.push(e.track);this.pendingBytes+=e.boxes.byteLength;if("video"===e.track.type){this.videoTrack=e.track;this.pendingBoxes.push(e.boxes)}if("audio"===e.track.type){this.audioTrack=e.track;this.pendingBoxes.unshift(e.boxes)}}};dt.prototype=new a;dt.prototype.flush=function(e){var t=0,a={captions:[],captionStreams:{},metadata:[],info:{}},n,r,s,o=0,l;if(this.pendingTracks.length=this.numberOfTracks){this.trigger("done");this.emittedTracks=0}return}}if(this.videoTrack){o=this.videoTrack.timelineStartInfo.pts;it.forEach(function(e){a.info[e]=this.videoTrack[e]},this)}else if(this.audioTrack){o=this.audioTrack.timelineStartInfo.pts;rt.forEach(function(e){a.info[e]=this.audioTrack[e]},this)}if(this.videoTrack||this.audioTrack){if(1===this.pendingTracks.length){a.type=this.pendingTracks[0].type}else{a.type="combined"}this.emittedTracks+=this.pendingTracks.length;s=F.initSegment(this.pendingTracks);a.initSegment=new Uint8Array(s.byteLength);a.initSegment.set(s);a.data=new Uint8Array(this.pendingBytes);for(l=0;l=this.numberOfTracks){this.trigger("done");this.emittedTracks=0}};dt.prototype.setRemux=function(e){this.remuxTracks=e};lt=function(e){var t=this,a=!0,n,r;lt.prototype.init.call(this);e=e||{};this.baseMediaDecodeTime=e.baseMediaDecodeTime||0;this.transmuxPipeline_={};this.setupAacPipeline=function(){var a={};this.transmuxPipeline_=a;a.type="aac";a.metadataStream=new Me.MetadataStream;a.aacStream=new et;a.audioTimestampRolloverStream=new Me.TimestampRolloverStream("audio");a.timedMetadataTimestampRolloverStream=new Me.TimestampRolloverStream("timed-metadata");a.adtsStream=new He;a.coalesceStream=new dt(e,a.metadataStream);a.headOfPipeline=a.aacStream;a.aacStream.pipe(a.audioTimestampRolloverStream).pipe(a.adtsStream);a.aacStream.pipe(a.timedMetadataTimestampRolloverStream).pipe(a.metadataStream).pipe(a.coalesceStream);a.metadataStream.on("timestamp",function(e){a.aacStream.setTimestamp(e.timeStamp)});a.aacStream.on("data",function(i){if("timed-metadata"===i.type&&!a.audioSegmentStream){r=r||{timelineStartInfo:{baseMediaDecodeTime:t.baseMediaDecodeTime},codec:"adts",type:"audio"};a.coalesceStream.numberOfTracks++;a.audioSegmentStream=new ot(r,e);a.audioSegmentStream.on("timingInfo",t.trigger.bind(t,"audioTimingInfo"));a.adtsStream.pipe(a.audioSegmentStream).pipe(a.coalesceStream)}t.trigger("trackinfo",{hasAudio:!!r,hasVideo:!!n})});a.coalesceStream.on("data",this.trigger.bind(this,"data"));a.coalesceStream.on("done",this.trigger.bind(this,"done"))};this.setupTsPipeline=function(){var a={};this.transmuxPipeline_=a;a.type="ts";a.metadataStream=new Me.MetadataStream;a.packetStream=new Me.TransportPacketStream;a.parseStream=new Me.TransportParseStream;a.elementaryStream=new Me.ElementaryStream;a.timestampRolloverStream=new Me.TimestampRolloverStream;a.adtsStream=new He;a.h264Stream=new tt;a.captionStream=new Me.CaptionStream;a.coalesceStream=new dt(e,a.metadataStream);a.headOfPipeline=a.packetStream;a.packetStream.pipe(a.parseStream).pipe(a.elementaryStream).pipe(a.timestampRolloverStream);a.timestampRolloverStream.pipe(a.h264Stream);a.timestampRolloverStream.pipe(a.adtsStream);a.timestampRolloverStream.pipe(a.metadataStream).pipe(a.coalesceStream);a.h264Stream.pipe(a.captionStream).pipe(a.coalesceStream);a.elementaryStream.on("data",function(s){var o;if("metadata"===s.type){o=s.tracks.length;while(o--){if(!n&&"video"===s.tracks[o].type){n=s.tracks[o];n.timelineStartInfo.baseMediaDecodeTime=t.baseMediaDecodeTime}else if(!r&&"audio"===s.tracks[o].type){r=s.tracks[o];r.timelineStartInfo.baseMediaDecodeTime=t.baseMediaDecodeTime}}if(n&&!a.videoSegmentStream){a.coalesceStream.numberOfTracks++;a.videoSegmentStream=new st(n,e);a.videoSegmentStream.on("timelineStartInfo",function(e){if(r){r.timelineStartInfo=e;a.audioSegmentStream.setEarliestDts(e.dts)}});a.videoSegmentStream.on("processedGopsInfo",t.trigger.bind(t,"gopInfo"));a.videoSegmentStream.on("segmentTimingInfo",t.trigger.bind(t,"videoSegmentTimingInfo"));a.videoSegmentStream.on("baseMediaDecodeTime",function(e){if(r){a.audioSegmentStream.setVideoBaseMediaDecodeTime(e)}});a.videoSegmentStream.on("timingInfo",t.trigger.bind(t,"videoTimingInfo"));a.h264Stream.pipe(a.videoSegmentStream).pipe(a.coalesceStream)}if(r&&!a.audioSegmentStream){a.coalesceStream.numberOfTracks++;a.audioSegmentStream=new ot(r,e);a.audioSegmentStream.on("timingInfo",t.trigger.bind(t,"audioTimingInfo"));a.adtsStream.pipe(a.audioSegmentStream).pipe(a.coalesceStream)}t.trigger("trackinfo",{hasAudio:!!r,hasVideo:!!n})}});a.coalesceStream.on("data",this.trigger.bind(this,"data"));a.coalesceStream.on("id3Frame",function(e){e.dispatchType=a.metadataStream.dispatchType;t.trigger("id3Frame",e)});a.coalesceStream.on("caption",this.trigger.bind(this,"caption"));a.coalesceStream.on("done",this.trigger.bind(this,"done"))};this.setBaseMediaDecodeTime=function(t){var a=this.transmuxPipeline_;if(!e.keepOriginalTimestamps){this.baseMediaDecodeTime=t}if(r){r.timelineStartInfo.dts=void 0;r.timelineStartInfo.pts=void 0;oe.clearDtsInfo(r);if(!e.keepOriginalTimestamps){r.timelineStartInfo.baseMediaDecodeTime=t}if(a.audioTimestampRolloverStream){a.audioTimestampRolloverStream.discontinuity()}}if(n){if(a.videoSegmentStream){a.videoSegmentStream.gopCache_=[]}n.timelineStartInfo.dts=void 0;n.timelineStartInfo.pts=void 0;oe.clearDtsInfo(n);a.captionStream.reset();if(!e.keepOriginalTimestamps){n.timelineStartInfo.baseMediaDecodeTime=t}}if(a.timestampRolloverStream){a.timestampRolloverStream.discontinuity()}};this.setAudioAppendStart=function(e){if(r){this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)}};this.setRemux=function(t){var a=this.transmuxPipeline_;e.remux=t;if(a&&a.coalesceStream){a.coalesceStream.setRemux(t)}};this.alignGopsWith=function(e){if(n&&this.transmuxPipeline_.videoSegmentStream){this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)}};this.push=function(e){if(a){var t=at(e);if(t&&"aac"!==this.transmuxPipeline_.type){this.setupAacPipeline()}else if(!t&&"ts"!==this.transmuxPipeline_.type){this.setupTsPipeline()}a=!1}this.transmuxPipeline_.headOfPipeline.push(e)};this.flush=function(){a=!0;this.transmuxPipeline_.headOfPipeline.flush()};this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()};this.reset=function(){if(this.transmuxPipeline_.headOfPipeline){this.transmuxPipeline_.headOfPipeline.reset()}};this.resetCaptions=function(){if(this.transmuxPipeline_.captionStream){this.transmuxPipeline_.captionStream.reset()}}};lt.prototype=new a;var ct={Transmuxer:lt,VideoSegmentStream:st,AudioSegmentStream:ot,AUDIO_PROPERTIES:rt,VIDEO_PROPERTIES:it,generateVideoSegmentTimingInfo:ut},mt=function(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}},gt=function(){function e(e,t){for(var a=0,n;an){break}}return e.slice(r)},Dc=function(e,t,a){if(!t.length){return e}if(a){return t.slice()}var n=t[0].pts,r=0;for(r;r=n){break}}return e.slice(0,r).concat(t)},wc=function(e,t,a,n){var r=Math.ceil(9e4*(t-n)),s=Math.ceil(9e4*(a-n)),o=e.slice(),l=e.length;while(l--){if(e[l].pts<=s){break}}if(-1===l){return o}var d=l+1;while(d--){if(e[d].pts<=r){break}}d=Math.max(d,0);o.splice(d,l-d+1);return o},Ac=function(e,t,a){var n=null,r=null,i=0,s=[],o=[];if(!e&&!t){return Hi.createTimeRange()}if(!e){return t.buffered}if(!t){return e.buffered}if(a){return e.buffered}if(0===e.buffered.length&&0===t.buffered.length){return Hi.createTimeRange()}var l=e.buffered,d=t.buffered,p=l.length;while(p--){s.push({time:l.start(p),type:"start"});s.push({time:l.end(p),type:"end"})}p=d.length;while(p--){s.push({time:d.start(p),type:"start"});s.push({time:d.end(p),type:"end"})}s.sort(function(e,t){return e.time-t.time});for(p=0;pthis.nativeMediaSource_.duration||isNaN(this.nativeMediaSource_.duration)){this.nativeMediaSource_.duration=t}}},{key:"addSourceBuffer",value:function(e){var t=void 0,a=Ic(e);if(/^(video|audio)\/mp2t$/i.test(a.type)){var n=[];if(a.parameters&&a.parameters.codecs){n=a.parameters.codecs.split(",");n=fc(n);n=n.filter(function(e){return xc(e)||Lc(e)})}if(0===n.length){n=["avc1.4d400d","mp4a.40.2"]}t=new Nc(this,n);if(0!==this.sourceBuffers.length){this.sourceBuffers[0].createRealSourceBuffers_();t.createRealSourceBuffers_();this.sourceBuffers[0].audioDisabled_=!0}}else{t=this.nativeMediaSource_.addSourceBuffer(e)}this.sourceBuffers.push(t);return t}},{key:"dispose",value:function(){this.trigger("dispose");this.off();this.sourceBuffers.forEach(function(e){if(e.dispose){e.dispose()}});this.sourceBuffers.length=0}}]);return n}(Hi.EventTarget),Mc=0;Hi.mediaSources={};var Bc=function(e,t){var a=Hi.mediaSources[e];if(a){a.trigger({type:"sourceopen",swfId:t})}else{throw new Error("Media Source not found (Video.js)")}},jc=function(){return!!e.MediaSource&&!!e.MediaSource.isTypeSupported&&e.MediaSource.isTypeSupported("video/mp4;codecs=\"avc1.4d400d,mp4a.40.2\"")},Fc=function(){this.MediaSource={open:Bc,supportsNativeMediaSources:jc};if(jc()){return new Uc}throw new Error("Cannot use create a virtual MediaSource for this video")};Fc.open=Bc;Fc.supportsNativeMediaSources=jc;var Hc={createObjectURL:function(t){var a=void 0;if(t instanceof Uc){a=e.URL.createObjectURL(t.nativeMediaSource_);t.url_=a;return a}if(!(t instanceof Uc)){a=e.URL.createObjectURL(t);t.url_=a;return a}a="blob:vjs-media-source/"+Mc;Mc++;Hi.mediaSources[a]=t;return a}};Hi.MediaSource=Fc;Hi.URL=Hc;var qc=Hi.EventTarget,Vc=Hi.mergeOptions,Wc=function(e,t){for(var a=void 0,n=Vc(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod}),r=0,s;r")}return function(){}};function Jc(){}var Zc=function(){function e(t,a,n,r){Mp(this,e);this.callbacks_=[];this.pendingCallback_=null;this.timestampOffset_=0;this.mediaSource=t;this.processedAppend_=!1;this.type_=n;this.mimeType_=a;this.logger_=Qc("SourceUpdater["+n+"]["+a+"]");if("closed"===t.readyState){t.addEventListener("sourceopen",this.createSourceBuffer_.bind(this,a,r))}else{this.createSourceBuffer_(a,r)}}Bp(e,[{key:"createSourceBuffer_",value:function(e,t){var a=this;this.sourceBuffer_=this.mediaSource.addSourceBuffer(e);this.logger_("created SourceBuffer");if(t){t.trigger("sourcebufferadded");if(2>this.mediaSource.sourceBuffers.length){t.on("sourcebufferadded",function(){a.start_()});return}}this.start_()}},{key:"start_",value:function(){var e=this;this.started_=!0;this.onUpdateendCallback_=function(){var t=e.pendingCallback_;e.pendingCallback_=null;e.sourceBuffer_.removing=!1;e.logger_("buffered ["+Qu(e.buffered())+"]");if(t){t()}e.runCallback_()};this.sourceBuffer_.addEventListener("updateend",this.onUpdateendCallback_);this.runCallback_()}},{key:"abort",value:function(e){var t=this;if(this.processedAppend_){this.queueCallback_(function(){t.sourceBuffer_.abort()},e)}}},{key:"appendBuffer",value:function(e,t){var a=this;this.processedAppend_=!0;this.queueCallback_(function(){if(e.videoSegmentTimingInfoCallback){a.sourceBuffer_.addEventListener("videoSegmentTimingInfo",e.videoSegmentTimingInfoCallback)}a.sourceBuffer_.appendBuffer(e.bytes)},function(){if(e.videoSegmentTimingInfoCallback){a.sourceBuffer_.removeEventListener("videoSegmentTimingInfo",e.videoSegmentTimingInfoCallback)}t()})}},{key:"buffered",value:function(){if(!this.sourceBuffer_){return Hi.createTimeRanges()}return this.sourceBuffer_.buffered}},{key:"remove",value:function(e,t){var a=this,n=2 "+t+"]");a.sourceBuffer_.removing=!0;a.sourceBuffer_.remove(e,t)},n)}}},{key:"updating",value:function(){return!this.sourceBuffer_||this.sourceBuffer_.updating||!!this.pendingCallback_&&this.pendingCallback_!==Jc}},{key:"timestampOffset",value:function(e){var t=this;if("undefined"!=typeof e){this.queueCallback_(function(){t.sourceBuffer_.timestampOffset=e;t.runCallback_()});this.timestampOffset_=e}return this.timestampOffset_}},{key:"queueCallback_",value:function(e,t){this.callbacks_.push([e.bind(this),t]);this.runCallback_()}},{key:"runCallback_",value:function(){var e;if(!this.updating()&&this.callbacks_.length&&this.started_){e=this.callbacks_.shift();this.pendingCallback_=e[1];e[0]()}}},{key:"dispose",value:function(){var e=this,t=function t(){if(e.sourceBuffer_&&"open"===e.mediaSource.readyState){e.sourceBuffer_.abort()}e.sourceBuffer_.removeEventListener("updateend",t)};this.sourceBuffer_.removeEventListener("updateend",this.onUpdateendCallback_);if(this.sourceBuffer_.removing){this.sourceBuffer_.addEventListener("updateend",t)}else{t()}}}]);return e}(),em={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,BUFFER_LOW_WATER_LINE_RATE:1},tm={FAILURE:2,TIMEOUT:-101,ABORTED:-102},am=function(e){e.forEach(function(e){e.abort()})},nm=function(e){return{bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}},rm=function(e){var t=e.target,a=Date.now()-t.requestTime,n={bandwidth:1/0,bytesReceived:0,roundTripTime:a||0};n.bytesReceived=e.loaded;n.bandwidth=Math.floor(1e3*(8*(n.bytesReceived/n.roundTripTime)));return n},im=function(e,t){if(t.timedout){return{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:tm.TIMEOUT,xhr:t}}if(t.aborted){return{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:tm.ABORTED,xhr:t}}if(e){return{status:t.status,message:"HLS request errored at URL: "+t.uri,code:tm.FAILURE,xhr:t}}return null},sm=function(e,t){return function(a,n){var r=n.response,i=im(a,n);if(i){return t(i,e)}if(16!==r.byteLength){return t({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:tm.FAILURE,xhr:n},e)}var s=new DataView(r);e.key.bytes=new Uint32Array([s.getUint32(0),s.getUint32(4),s.getUint32(8),s.getUint32(12)]);return t(null,e)}},om=function(e,t,a){return function(n,r){var i=r.response,s=im(n,r);if(s){return a(s,e)}if(0===i.byteLength){return a({status:r.status,message:"Empty HLS segment content at URL: "+r.uri,code:tm.FAILURE,xhr:r},e)}e.map.bytes=new Uint8Array(r.response);if(t&&!t.isInitialized()){t.init()}e.map.timescales=fd.timescale(e.map.bytes);e.map.videoTrackIds=fd.videoTrackIds(e.map.bytes);return a(null,e)}},lm=function(e,t,a){return function(n,r){var i=r.response,s=im(n,r),o=void 0;if(s){return a(s,e)}if(0===i.byteLength){return a({status:r.status,message:"Empty HLS segment content at URL: "+r.uri,code:tm.FAILURE,xhr:r},e)}e.stats=nm(r);if(e.key){e.encryptedBytes=new Uint8Array(r.response)}else{e.bytes=new Uint8Array(r.response)}if(t&&e.map&&e.map.bytes){if(!t.isInitialized()){t.init()}o=t.parse(e.bytes,e.map.videoTrackIds,e.map.timescales);if(o&&o.captions){e.captionStreams=o.captionStreams;e.fmp4Captions=o.captions}}return a(null,e)}},dm=function(e,t,a){e.addEventListener("message",function r(n){if(n.data.source===t.requestId){e.removeEventListener("message",r);var i=n.data.decrypted;t.bytes=new Uint8Array(i.bytes,i.byteOffset,i.byteLength);return a(null,t)}});var n;if(t.key.bytes.slice){n=t.key.bytes.slice()}else{n=new Uint32Array(Array.prototype.slice.call(t.key.bytes))}e.postMessage(Du({source:t.requestId,encrypted:t.encryptedBytes,key:n,iv:t.key.iv}),[t.encryptedBytes.buffer,n.buffer])},pm=function(e,t,a){var n=0,r=!1;return function(i,s){if(r){return}if(i){r=!0;am(e);return a(i,s)}n+=1;if(n===e.length){s.endOfAllRequests=Date.now();if(s.encryptedBytes){return dm(t,s,a)}return a(null,s)}}},um=function(e,t){return function(a){e.stats=Hi.mergeOptions(e.stats,rm(a));if(!e.stats.firstBytesReceivedAt&&e.stats.bytesReceived){e.stats.firstBytesReceivedAt=Date.now()}return t(a,e)}},cm=function(e,t,a,n,r,i,s){var o=[],l=pm(o,a,s);if(r.key&&!r.key.bytes){var d=Hi.mergeOptions(t,{uri:r.key.resolvedUri,responseType:"arraybuffer"}),p=sm(r,l),u=e(d,p);o.push(u)}if(r.map&&!r.map.bytes){var c=Hi.mergeOptions(t,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:Iu(r.map)}),m=om(r,n,l),g=e(c,m);o.push(g)}var y=Hi.mergeOptions(t,{uri:r.resolvedUri,responseType:"arraybuffer",headers:Iu(r)}),h=lm(r,n,l),_=e(y,h);_.addEventListener("progress",um(r,i));o.push(_);return function(){return am(o)}},mm=function(t,a){var n;if(!t){return""}n=e.getComputedStyle(t);if(!n){return""}return n[a]},gm=function(e,t){var a=e.slice();e.sort(function(e,n){var r=t(e,n);if(0===r){return a.indexOf(e)-a.indexOf(n)}return r})},ym=function(t,a){var n=void 0,r=void 0;if(t.attributes.BANDWIDTH){n=t.attributes.BANDWIDTH}n=n||e.Number.MAX_VALUE;if(a.attributes.BANDWIDTH){r=a.attributes.BANDWIDTH}r=r||e.Number.MAX_VALUE;return n-r},hm=function(t,a){var n=void 0,r=void 0;if(t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width){n=t.attributes.RESOLUTION.width}n=n||e.Number.MAX_VALUE;if(a.attributes.RESOLUTION&&a.attributes.RESOLUTION.width){r=a.attributes.RESOLUTION.width}r=r||e.Number.MAX_VALUE;if(n===r&&t.attributes.BANDWIDTH&&a.attributes.BANDWIDTH){return t.attributes.BANDWIDTH-a.attributes.BANDWIDTH}return n-r},_m=function(t,a,n,r,i){var s=t.playlists.map(function(t){var a=void 0,n=void 0,r=void 0;a=t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width;n=t.attributes.RESOLUTION&&t.attributes.RESOLUTION.height;r=t.attributes.BANDWIDTH;r=r||e.Number.MAX_VALUE;return{bandwidth:r,width:a,height:n,playlist:t}});gm(s,function(e,t){return e.bandwidth-t.bandwidth});s=s.filter(function(e){return!vu.isIncompatible(e.playlist)});var o=s.filter(function(e){return vu.isEnabled(e.playlist)});if(!o.length){o=s.filter(function(e){return!vu.isDisabled(e.playlist)})}var l=o.filter(function(e){return e.bandwidth*em.BANDWIDTH_VARIANCEn||e.height>r});h=y.filter(function(e){return e.width===y[0].width&&e.height===y[0].height});d=h[h.length-1];_=h.filter(function(e){return e.bandwidth===d.bandwidth})[0]}var f=_||g||p||o[0]||s[0];return f?f.playlist:null},fm=function(e){var t=e.master,a=e.currentTime,n=e.bandwidth,r=e.duration,i=e.segmentDuration,s=e.timeUntilRebuffer,o=e.currentTimeline,l=e.syncController,d=t.playlists.filter(function(e){return!vu.isIncompatible(e)}),p=d.filter(vu.isEnabled);if(!p.length){p=d.filter(function(e){return!vu.isDisabled(e)})}var u=p.filter(vu.hasAttribute.bind(null,"BANDWIDTH")),c=u.map(function(e){var t=l.getSyncPoint(e,r,o,a),d=t?1:2,p=vu.estimateSegmentRequestTime(i,n,e);return{playlist:e,rebufferingImpact:p*d-s}}),m=c.filter(function(e){return 0>=e.rebufferingImpact});gm(m,function(e,t){return ym(t.playlist,e.playlist)});if(m.length){return m[0]}gm(c,function(e,t){return e.rebufferingImpact-t.rebufferingImpact});return c[0]||null},Tm=function(e,t,a){for(var n in a){if(!e[n]){t.trigger({type:"usage",name:"hls-608"});var r=t.textTracks().getTrackById(n);if(r){e[n]=r}else{e[n]=t.addRemoteTextTrack({kind:"captions",id:n,label:n},!1).track}}}},bm=function(e){var t=e.inbandTextTracks,a=e.captionArray,n=e.timestampOffset;if(!a){return}var r=window.WebKitDataCue||window.VTTCue;a.forEach(function(e){var a=e.stream,i=e.startTime,s=e.endTime;if(!t[a]){return}i+=n;s+=n;t[a].addCue(new r(i,s,e.text))})},vm=function(e,t,a){if(!e||!t){return!1}var n=e.segments,r=a===n.length;return e.endList&&"open"===t.readyState&&r},Sm=function(e){return"number"==typeof e&&isFinite(e)},km=function(e,t,a){if("main"!==e||!t||!a){return null}if(!a.containsAudio&&!a.containsVideo){return"Neither audio nor video found in segment."}if(t.containsVideo&&!a.containsVideo){return"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest."}if(!t.containsVideo&&a.containsVideo){return"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest."}return null},Cm=function(e,t,a){var n=t-30;if(e.length){n=Math.max(n,e.start(0))}return Math.min(t-a,n)},Em=function(e){var t=e.segment,a=t.start,n=t.end,r=e.playlist,i=r.mediaSequence,s=r.id,o=r.segments,l=o===void 0?[]:o,d=e.mediaIndex,p=e.timeline;return["appending ["+d+"] of ["+i+", "+(i+l.length)+"] from playlist ["+s+"]","["+a+" => "+n+"] in timeline ["+p+"]"].join(" ")},Im=function(t){Fp(a,t);function a(e){Mp(this,a);var t=Hp(this,(a.__proto__||Object.getPrototypeOf(a)).call(this));if(!e){throw new TypeError("Initialization settings are required")}if("function"!=typeof e.currentTime){throw new TypeError("No currentTime getter specified")}if(!e.mediaSource){throw new TypeError("No MediaSource specified")}t.bandwidth=e.bandwidth;t.throughput={rate:0,count:0};t.roundTrip=NaN;t.resetStats_();t.mediaIndex=null;t.hasPlayed_=e.hasPlayed;t.currentTime_=e.currentTime;t.seekable_=e.seekable;t.seeking_=e.seeking;t.duration_=e.duration;t.mediaSource_=e.mediaSource;t.hls_=e.hls;t.loaderType_=e.loaderType;t.startingMedia_=void 0;t.segmentMetadataTrack_=e.segmentMetadataTrack;t.goalBufferLength_=e.goalBufferLength;t.sourceType_=e.sourceType;t.inbandTextTracks_=e.inbandTextTracks;t.state_="INIT";t.checkBufferTimeout_=null;t.error_=void 0;t.currentTimeline_=-1;t.pendingSegment_=null;t.mimeType_=null;t.sourceUpdater_=null;t.xhrOptions_=null;t.activeInitSegmentId_=null;t.initSegments_={};t.cacheEncryptionKeys_=e.cacheEncryptionKeys;t.keyCache_={};if("main"===t.loaderType_){t.captionParser_=new Fd}else{t.captionParser_=null}t.decrypter_=e.decrypter;t.syncController_=e.syncController;t.syncPoint_={segmentIndex:0,time:0};t.triggerSyncInfoUpdate_=function(){return t.trigger("syncinfoupdate")};t.syncController_.on("syncinfoupdate",t.triggerSyncInfoUpdate_);t.mediaSource_.addEventListener("sourceopen",function(){return t.ended_=!1});t.fetchAtBuffer_=!1;t.logger_=Qc("SegmentLoader["+t.loaderType_+"]");Object.defineProperty(t,"state",{get:function(){return this.state_},set:function(e){if(e!==this.state_){this.logger_(this.state_+" -> "+e);this.state_=e}}});return t}Bp(a,[{key:"resetStats_",value:function(){this.mediaBytesTransferred=0;this.mediaRequests=0;this.mediaRequestsAborted=0;this.mediaRequestsTimedout=0;this.mediaRequestsErrored=0;this.mediaTransferDuration=0;this.mediaSecondsLoaded=0}},{key:"dispose",value:function(){this.trigger("dispose");this.state="DISPOSED";this.pause();this.abort_();if(this.sourceUpdater_){this.sourceUpdater_.dispose()}this.resetStats_();if(this.captionParser_){this.captionParser_.reset()}if(this.checkBufferTimeout_){e.clearTimeout(this.checkBufferTimeout_)}if(this.syncController_&&this.triggerSyncInfoUpdate_){this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_)}this.off()}},{key:"abort",value:function(){if("WAITING"!==this.state){if(this.pendingSegment_){this.pendingSegment_=null}return}this.abort_();this.state="READY";if(!this.paused()){this.monitorBuffer_()}}},{key:"abort_",value:function(){if(this.pendingSegment_){this.pendingSegment_.abortRequests()}this.pendingSegment_=null}},{key:"error",value:function(e){if("undefined"!=typeof e){this.error_=e}this.pendingSegment_=null;return this.error_}},{key:"endOfStream",value:function(){this.ended_=!0;this.pause();this.trigger("ended")}},{key:"buffered_",value:function(){if(!this.sourceUpdater_){return Hi.createTimeRanges()}return this.sourceUpdater_.buffered()}},{key:"initSegment",value:function(e){var t=1 "+(e.id||e.uri)+"]");this.trigger("syncinfoupdate");if("INIT"===this.state&&this.couldBeginLoading_()){return this.init_()}if(!a||a.uri!==e.uri){if(null!==this.mediaIndex){this.resyncLoader()}return}var i=e.mediaSequence-a.mediaSequence;this.logger_("live window shift ["+i+"]");if(null!==this.mediaIndex){this.mediaIndex-=i}if(n){n.mediaIndex-=i;if(0<=n.mediaIndex){n.segment=e.segments[n.mediaIndex]}}this.syncController_.saveExpiredSegmentInfo(a,e)}},{key:"pause",value:function(){if(this.checkBufferTimeout_){e.clearTimeout(this.checkBufferTimeout_);this.checkBufferTimeout_=null}}},{key:"paused",value:function(){return null===this.checkBufferTimeout_}},{key:"mimeType",value:function(e,t){if(this.mimeType_){return}this.mimeType_=e;this.sourceBufferEmitter_=t;if("INIT"===this.state&&this.couldBeginLoading_()){this.init_()}}},{key:"resetEverything",value:function(e){this.ended_=!1;this.resetLoader();this.remove(0,1/0,e);if(this.captionParser_){this.captionParser_.clearAllCaptions()}this.trigger("reseteverything")}},{key:"resetLoader",value:function(){this.fetchAtBuffer_=!1;this.resyncLoader()}},{key:"resyncLoader",value:function(){this.mediaIndex=null;this.syncPoint_=null;this.abort()}},{key:"remove",value:function(e,t,a){if(t===1/0){t=this.duration_()}if(this.sourceUpdater_){this.sourceUpdater_.remove(e,t,a)}tc(e,t,this.segmentMetadataTrack_);if(this.inbandTextTracks_){for(var n in this.inbandTextTracks_){tc(e,t,this.inbandTextTracks_[n])}}}},{key:"monitorBuffer_",value:function(){if(this.checkBufferTimeout_){e.clearTimeout(this.checkBufferTimeout_)}this.checkBufferTimeout_=e.setTimeout(this.monitorBufferTick_.bind(this),1)}},{key:"monitorBufferTick_",value:function(){if("READY"===this.state){this.fillBuffer_()}if(this.checkBufferTimeout_){e.clearTimeout(this.checkBufferTimeout_)}this.checkBufferTimeout_=e.setTimeout(this.monitorBufferTick_.bind(this),500)}},{key:"fillBuffer_",value:function(){if(this.sourceUpdater_.updating()){return}if(!this.syncPoint_){this.syncPoint_=this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_())}var e=this.checkBuffer_(this.buffered_(),this.playlist_,this.mediaIndex,this.hasPlayed_(),this.currentTime_(),this.syncPoint_);if(!e){return}if(this.isEndOfStream_(e.mediaIndex)){this.endOfStream();return}if(e.mediaIndex===this.playlist_.segments.length-1&&"ended"===this.mediaSource_.readyState&&!this.seeking_()){return}if(e.timeline!==this.currentTimeline_){this.syncController_.reset();e.timestampOffset=e.startOfSegment;if(this.captionParser_){this.captionParser_.clearAllCaptions()}}this.loadSegment_(e)}},{key:"isEndOfStream_",value:function(e){var t=1=this.goalBufferLength_()){return null}if(!n&&1<=l){return null}if(null===i){a=this.getSyncSegmentCandidate_(t);return this.generateSegmentInfo_(t,a,null,!0)}if(null!==a){t.segments[a];o=s;return this.generateSegmentInfo_(t,a+1,o,!1)}if(this.fetchAtBuffer_){var d=vu.getMediaInfoForTime(t,s,i.segmentIndex,i.time);a=d.mediaIndex;o=d.startTime}else{var p=vu.getMediaInfoForTime(t,r,i.segmentIndex,i.time);a=p.mediaIndex;o=p.startTime}return this.generateSegmentInfo_(t,a,o,!1)}},{key:"getSyncSegmentCandidate_",value:function(e){var t=this;if(-1===this.currentTimeline_){return 0}var a=e.segments.map(function(e,t){return{timeline:e.timeline,segmentIndex:t}}).filter(function(e){return e.timeline===t.currentTimeline_});if(a.length){return a[Math.min(a.length-1,1)].segmentIndex}return Math.max(e.segments.length-1,0)}},{key:"generateSegmentInfo_",value:function(e,t,a,n){if(0>t||t>=e.segments.length){return null}var r=e.segments[t];return{requestId:"segment-loader-"+Math.random(),uri:r.resolvedUri,mediaIndex:t,isSyncRequest:n,startOfSegment:a,playlist:e,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:r.timeline,duration:r.duration,segment:r}}},{key:"abortRequestEarly_",value:function(e){if(this.hls_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH){return!1}if(1e3>Date.now()-(e.firstBytesReceivedAt||Date.now())){return!1}var t=this.currentTime_(),a=e.bandwidth,n=this.pendingSegment_.duration,r=vu.estimateSegmentRequestTime(n,a,this.playlist_,e.bytesReceived),i=Ju(this.buffered_(),t,this.hls_.tech_.playbackRate())-1;if(r<=i){return!1}var s=fm({master:this.hls_.playlists.master,currentTime:t,bandwidth:a,duration:this.duration_(),segmentDuration:n,timeUntilRebuffer:i,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!s){return}var o=r-i-s.rebufferingImpact,l=.5;if(i<=zu){l=1}if(!s.playlist||s.playlist.uri===this.playlist_.uri||o3*e.playlist.targetDuration){this.resetEverything();return}if(a){this.trigger("bandwidthupdate")}this.trigger("progress");if(this.isEndOfStream_(e.mediaIndex+1,e.playlist)){this.endOfStream()}if(!this.paused()){this.monitorBuffer_()}}},{key:"recordThroughput_",value:function(e){var t=this.throughput.rate,a=Date.now()-e.endOfAllRequests+1,n=Math.floor(1e3*(8*(e.byteLength/a)));this.throughput.rate+=(n-t)/++this.throughput.count}},{key:"addSegmentMetadataCue_",value:function(t){if(!this.segmentMetadataTrack_){return}var a=t.segment,n=a.start,r=a.end;if(!Sm(n)||!Sm(r)){return}tc(n,r,this.segmentMetadataTrack_);var i=e.WebKitDataCue||e.VTTCue,s={custom:a.custom,dateTimeObject:a.dateTimeObject,dateTimeString:a.dateTimeString,bandwidth:t.playlist.attributes.BANDWIDTH,resolution:t.playlist.attributes.RESOLUTION,codecs:t.playlist.attributes.CODECS,byteLength:t.byteLength,uri:t.uri,timeline:t.timeline,playlist:t.playlist.id,start:n,end:r},o=JSON.stringify(s),l=new i(n,r,o);l.value=s;this.segmentMetadataTrack_.addCue(l)}}]);return a}(Hi.EventTarget),xm=function(e){return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))},Lm=new Uint8Array(["\n","\n"].map(function(e){return e.charCodeAt(0)})),Pm=function(t){Fp(a,t);function a(e){var t=1=r.adStartTime&&t<=r.adEndTime){return r}}return null},wm=function(t,a){var n=2=u){l=u;o={time:p.start,segmentIndex:d}}}}return o}},{name:"Discontinuity",run:function(e,t,a,n,r){var s=null;r=r||0;if(t.discontinuityStarts&&t.discontinuityStarts.length){for(var o=null,l=0;l=c){o=c;s={time:u.time,segmentIndex:d}}}}}return s}},{name:"Playlist",run:function(e,t){if(t.syncInfo){var a={time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence};return a}return null}}],Rm=function(e){Fp(t,e);function t(){Mp(this,t);var e=Hp(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));e.inspectCache_=void 0;e.timelines=[];e.discontinuities=[];e.datetimeToDisplayTime=null;e.logger_=Qc("SyncController");return e}Bp(t,[{key:"getSyncPoint",value:function(e,t,a,n){var r=this.runStrategies_(e,t,a,n);if(!r.length){return null}return this.selectSyncPoint_(r,{key:"time",value:n})}},{key:"getExpiredTime",value:function(e,t){if(!e||!e.segments){return null}var a=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!a.length){return null}var n=this.selectSyncPoint_(a,{key:"segmentIndex",value:0});if(0l){var d=void 0;if(0>o){d=a.start-su(t,e.mediaIndex,r)}else{d=a.end+su(t,e.mediaIndex+1,r)}this.discontinuities[s]={time:d,accuracy:l}}}}}},{key:"dispose",value:function(){this.trigger("dispose");this.off()}}]);return t}(Hi.EventTarget),Nm=new pc("./decrypter-worker.worker.js",function(){var e=this,t=function(){function t(e){return e.subarray(0,e.byteLength-e[e.byteLength-1])}var a=function(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}},n=function(){function e(e,t){for(var a=0,n;ao;o++){d[(u[o]=o<<1^283*(o>>7))^o]=o}for(l=p=0;!n[l];l^=c||1,p=d[p]||1){y=p^p<<1^p<<2^p<<3^p<<4;y=99^(y>>8^255&y);n[l]=y;r[y]=l;g=u[m=u[c=u[l]]];_=16843009*g^65537*m^257*c^16843008*l;h=257*u[y]^16843008*y;for(o=0;4>o;o++){t[o][l]=h=h<<24^h>>>8;a[o][y]=_=_<<24^_>>>8}}for(o=0;5>o;o++){t[o]=t[o].slice(0);a[o]=a[o].slice(0)}return e},o=null,l=function(){function e(t){a(this,e);if(!o){o=s()}this._tables=[[o[0][0].slice(),o[0][1].slice(),o[0][2].slice(),o[0][3].slice(),o[0][4].slice()],[o[1][0].slice(),o[1][1].slice(),o[1][2].slice(),o[1][3].slice(),o[1][4].slice()]];var n=void 0,r=void 0,l=void 0,d=void 0,p=void 0,u=this._tables[0][4],c=this._tables[1],m=t.length,g=1;if(4!==m&&6!==m&&8!==m){throw new Error("Invalid aes key size")}d=t.slice(0);p=[];this._key=[d,p];for(n=m;n<4*m+28;n++){l=d[n-1];if(0==n%m||8===m&&4==n%m){l=u[l>>>24]<<24^u[255&l>>16]<<16^u[255&l>>8]<<8^u[255&l];if(0==n%m){l=l<<8^l>>>24^g<<24;g=g<<1^283*(g>>7)}}d[n]=d[n-m]^l}for(r=0;n;r++,n--){l=d[3&r?n:n-4];if(4>=n||4>r){p[r]=l}else{p[r]=c[0][u[l>>>24]]^c[1][u[255&l>>16]]^c[2][u[255&l>>8]]^c[3][u[255&l]]}}}e.prototype.decrypt=function(e,t,n,r,s,o){var l=this._key[1],p=e^l[0],u=r^l[1],m=n^l[2],g=t^l[3],y=void 0,h=void 0,_=void 0,f=l.length/4-2,T=void 0,v=4,S=this._tables[1],k=S[0],C=S[1],E=S[2],I=S[3],x=S[4];for(T=0;T>>24]^C[255&u>>16]^E[255&m>>8]^I[255&g]^l[v];h=k[u>>>24]^C[255&m>>16]^E[255&g>>8]^I[255&p]^l[v+1];_=k[m>>>24]^C[255&g>>16]^E[255&p>>8]^I[255&u]^l[v+2];g=k[g>>>24]^C[255&p>>16]^E[255&u>>8]^I[255&m]^l[v+3];v+=4;p=y;u=h;m=_}for(T=0;4>T;T++){s[(3&-T)+o]=x[p>>>24]<<24^x[255&u>>16]<<16^x[255&m>>8]<<8^x[255&g]^l[v++];y=p;p=u;u=m;m=g;g=y}};return e}(),d=function(){function e(){a(this,e);this.listeners={}}e.prototype.on=function(e,t){if(!this.listeners[e]){this.listeners[e]=[]}this.listeners[e].push(t)};e.prototype.off=function(e,t){if(!this.listeners[e]){return!1}var a=this.listeners[e].indexOf(t);this.listeners[e].splice(a,1);return-1>8|e>>>24},c=function(e,t,a){var n=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),r=new l(Array.prototype.slice.call(t)),i=new Uint8Array(e.byteLength),s=new Int32Array(i.buffer),o=void 0,d=void 0,p=void 0,c=void 0,m=void 0,g=void 0,y=void 0,h=void 0,_=void 0;o=a[0];d=a[1];p=a[2];c=a[3];for(_=0;_=i){e.masterPlaylistLoader_.media(t)}e.tech_.trigger("bandwidthupdate")});this.mainSegmentLoader_.on("progress",function(){e.trigger("progress")});this.mainSegmentLoader_.on("error",function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())});this.mainSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_()});this.mainSegmentLoader_.on("timestampoffset",function(){e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})});this.audioSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_()});this.mainSegmentLoader_.on("ended",function(){e.onEndOfStream()});this.mainSegmentLoader_.on("earlyabort",function(){e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120)});this.mainSegmentLoader_.on("reseteverything",function(){e.tech_.trigger("hls-reset")});this.mainSegmentLoader_.on("segmenttimemapping",function(t){e.tech_.trigger({type:"hls-segment-time-mapping",mapping:t.mapping})});this.audioSegmentLoader_.on("ended",function(){e.onEndOfStream()})}},{key:"mediaSecondsLoaded_",value:function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}},{key:"load",value:function(){this.mainSegmentLoader_.load();if(this.mediaTypes_.AUDIO.activePlaylistLoader){this.audioSegmentLoader_.load()}if(this.mediaTypes_.SUBTITLES.activePlaylistLoader){this.subtitleSegmentLoader_.load()}}},{key:"smoothQualityChange_",value:function(){var e=this.selectPlaylist();if(e!==this.masterPlaylistLoader_.media()){this.masterPlaylistLoader_.media(e);this.mainSegmentLoader_.resetLoader()}}},{key:"fastQualityChange_",value:function(){var e=this,t=this.selectPlaylist();if(t===this.masterPlaylistLoader_.media()){return}this.masterPlaylistLoader_.media(t);this.mainSegmentLoader_.resetEverything(function(){if(Hi.browser.IE_VERSION||Hi.browser.IS_EDGE){e.tech_.setCurrentTime(e.tech_.currentTime()+.04)}else{e.tech_.setCurrentTime(e.tech_.currentTime())}})}},{key:"play",value:function(){if(this.setupFirstPlay()){return}if(this.tech_.ended()){this.seekTo_(0)}if(this.hasPlayed_){this.load()}var e=this.tech_.seekable();if(this.tech_.duration()===1/0){if(this.tech_.currentTime()r.end(0)||r.start(0)>e.end(0)){this.seekable_=r}else{this.seekable_=Hi.createTimeRanges([[e.start(0)>r.start(0)?e.start(0):r.start(0),e.end(0) "+a);try{e.mediaSource.duration=a}catch(t){Hi.log.warn("Failed to set media source duration",t)}e.tech_.trigger("durationchange");e.mediaSource.removeEventListener("sourceopen",t)};if(0t.length){this.error="No compatible SourceBuffer configuration for the variant stream:"+e.resolvedUri;return this.mediaSource.endOfStream("decode")}this.configureLoaderMimeTypes_(t);this.excludeIncompatibleVariants_(e)}},{key:"configureLoaderMimeTypes_",value:function(e){var t=1=t.end(t.length-1))){return this.techWaiting_()}if(5<=this.consecutiveUpdates&&e===this.lastRecordedTime){this.consecutiveUpdates++;this.waiting_()}else if(e===this.lastRecordedTime){this.consecutiveUpdates++}else{this.consecutiveUpdates=0;this.lastRecordedTime=e}}},{key:"cancelTimer_",value:function(){this.consecutiveUpdates=0;if(this.timer_){this.logger_("cancelTimer_");clearTimeout(this.timer_)}this.timer_=null}},{key:"fixesBadSeeks_",value:function(){var e=this.tech_.seeking();if(!e){return!1}var t=this.seekable(),a=this.tech_.currentTime(),n=this.afterSeekableWindow_(t,a,this.media(),this.allowSeeksWithinUnsafeLiveWindow),r=void 0;if(n){var i=t.end(t.length-1);r=i}if(this.beforeSeekableWindow_(t,a)){var s=t.start(0);r=s+Gu}if("undefined"!=typeof r){this.logger_("Trying to seek outside of seekable at time "+a+" with "+("seekable range "+Qu(t)+". Seeking to ")+(r+"."));this.seekTo(r);return!0}return!1}},{key:"waiting_",value:function(){if(this.techWaiting_()){return}var e=this.tech_.currentTime(),t=this.tech_.buffered(),a=Yu(t,e);if(a.length&&e+3<=a.end(0)){this.cancelTimer_();this.seekTo(e);this.logger_("Stopped at "+e+" while inside a buffered region "+("["+a.start(0)+" -> "+a.end(0)+"]. Attempting to resume playback by seeking to the current time."));this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})}}},{key:"techWaiting_",value:function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()&&this.fixesBadSeeks_()){return!0}if(this.tech_.seeking()||null!==this.timer_){return!0}if(this.beforeSeekableWindow_(e,t)){var a=e.end(e.length-1);this.logger_("Fell out of live window at time "+t+". Seeking to "+("live point (seekable end) "+a));this.cancelTimer_();this.seekTo(a);this.tech_.trigger({type:"usage",name:"hls-live-resync"});return!0}var n=this.tech_.buffered(),r=Xu(n,t);if(this.videoUnderflow_(r,n,t)){this.cancelTimer_();this.seekTo(t);this.tech_.trigger({type:"usage",name:"hls-video-underflow"});return!0}if(0r){return!0}return!1}},{key:"beforeSeekableWindow_",value:function(e,t){if(e.length&&0t-r&&2t){Hi.log.warn("value of Hls."+e+" must be greater than or equal to 0");return}em[e]=t}})});var og=function(e){if(/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i.test(e)){return"hls"}if(/^application\/dash\+xml/i.test(e)){return"dash"}return null},lg=function(e,t){for(var a=t.media(),n=-1,r=0;r\n * Copyright Brightcove, Inc. \n * Available under Apache License Version 2.0\n * \n *\n * Includes vtt.js \n * Available under Apache License Version 2.0\n * \n */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('global/window'), require('global/document')) :\n typeof define === 'function' && define.amd ? define(['./window', './document'], factory) :\n (global = global || self, global.videojs = factory(global.window, global.document));\n}(this, function (window$3, document) { 'use strict';\n\n window$3 = window$3 && window$3.hasOwnProperty('default') ? window$3['default'] : window$3;\n document = document && document.hasOwnProperty('default') ? document['default'] : document;\n\n var version = \"7.7.6\";\n\n /**\n * @file create-logger.js\n * @module create-logger\n */\n\n var history = [];\n /**\n * Log messages to the console and history based on the type of message\n *\n * @private\n * @param {string} type\n * The name of the console method to use.\n *\n * @param {Array} args\n * The arguments to be passed to the matching console method.\n */\n\n var LogByTypeFactory = function LogByTypeFactory(name, log) {\n return function (type, level, args) {\n var lvl = log.levels[level];\n var lvlRegExp = new RegExp(\"^(\" + lvl + \")$\");\n\n if (type !== 'log') {\n // Add the type to the front of the message when it's not \"log\".\n args.unshift(type.toUpperCase() + ':');\n } // Add console prefix after adding to history.\n\n\n args.unshift(name + ':'); // Add a clone of the args at this point to history.\n\n if (history) {\n history.push([].concat(args)); // only store 1000 history entries\n\n var splice = history.length - 1000;\n history.splice(0, splice > 0 ? splice : 0);\n } // If there's no console then don't try to output messages, but they will\n // still be stored in history.\n\n\n if (!window$3.console) {\n return;\n } // Was setting these once outside of this function, but containing them\n // in the function makes it easier to test cases where console doesn't exist\n // when the module is executed.\n\n\n var fn = window$3.console[type];\n\n if (!fn && type === 'debug') {\n // Certain browsers don't have support for console.debug. For those, we\n // should default to the closest comparable log.\n fn = window$3.console.info || window$3.console.log;\n } // Bail out if there's no console or if this type is not allowed by the\n // current logging level.\n\n\n if (!fn || !lvl || !lvlRegExp.test(type)) {\n return;\n }\n\n fn[Array.isArray(args) ? 'apply' : 'call'](window$3.console, args);\n };\n };\n\n function createLogger(name) {\n // This is the private tracking variable for logging level.\n var level = 'info'; // the curried logByType bound to the specific log and history\n\n var logByType;\n /**\n * Logs plain debug messages. Similar to `console.log`.\n *\n * Due to [limitations](https://github.com/jsdoc3/jsdoc/issues/955#issuecomment-313829149)\n * of our JSDoc template, we cannot properly document this as both a function\n * and a namespace, so its function signature is documented here.\n *\n * #### Arguments\n * ##### *args\n * Mixed[]\n *\n * Any combination of values that could be passed to `console.log()`.\n *\n * #### Return Value\n *\n * `undefined`\n *\n * @namespace\n * @param {Mixed[]} args\n * One or more messages or objects that should be logged.\n */\n\n var log = function log() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n logByType('log', level, args);\n }; // This is the logByType helper that the logging methods below use\n\n\n logByType = LogByTypeFactory(name, log);\n /**\n * Create a new sublogger which chains the old name to the new name.\n *\n * For example, doing `videojs.log.createLogger('player')` and then using that logger will log the following:\n * ```js\n * mylogger('foo');\n * // > VIDEOJS: player: foo\n * ```\n *\n * @param {string} name\n * The name to add call the new logger\n * @return {Object}\n */\n\n log.createLogger = function (subname) {\n return createLogger(name + ': ' + subname);\n };\n /**\n * Enumeration of available logging levels, where the keys are the level names\n * and the values are `|`-separated strings containing logging methods allowed\n * in that logging level. These strings are used to create a regular expression\n * matching the function name being called.\n *\n * Levels provided by Video.js are:\n *\n * - `off`: Matches no calls. Any value that can be cast to `false` will have\n * this effect. The most restrictive.\n * - `all`: Matches only Video.js-provided functions (`debug`, `log`,\n * `log.warn`, and `log.error`).\n * - `debug`: Matches `log.debug`, `log`, `log.warn`, and `log.error` calls.\n * - `info` (default): Matches `log`, `log.warn`, and `log.error` calls.\n * - `warn`: Matches `log.warn` and `log.error` calls.\n * - `error`: Matches only `log.error` calls.\n *\n * @type {Object}\n */\n\n\n log.levels = {\n all: 'debug|log|warn|error',\n off: '',\n debug: 'debug|log|warn|error',\n info: 'log|warn|error',\n warn: 'warn|error',\n error: 'error',\n DEFAULT: level\n };\n /**\n * Get or set the current logging level.\n *\n * If a string matching a key from {@link module:log.levels} is provided, acts\n * as a setter.\n *\n * @param {string} [lvl]\n * Pass a valid level to set a new logging level.\n *\n * @return {string}\n * The current logging level.\n */\n\n log.level = function (lvl) {\n if (typeof lvl === 'string') {\n if (!log.levels.hasOwnProperty(lvl)) {\n throw new Error(\"\\\"\" + lvl + \"\\\" in not a valid log level\");\n }\n\n level = lvl;\n }\n\n return level;\n };\n /**\n * Returns an array containing everything that has been logged to the history.\n *\n * This array is a shallow clone of the internal history record. However, its\n * contents are _not_ cloned; so, mutating objects inside this array will\n * mutate them in history.\n *\n * @return {Array}\n */\n\n\n log.history = function () {\n return history ? [].concat(history) : [];\n };\n /**\n * Allows you to filter the history by the given logger name\n *\n * @param {string} fname\n * The name to filter by\n *\n * @return {Array}\n * The filtered list to return\n */\n\n\n log.history.filter = function (fname) {\n return (history || []).filter(function (historyItem) {\n // if the first item in each historyItem includes `fname`, then it's a match\n return new RegExp(\".*\" + fname + \".*\").test(historyItem[0]);\n });\n };\n /**\n * Clears the internal history tracking, but does not prevent further history\n * tracking.\n */\n\n\n log.history.clear = function () {\n if (history) {\n history.length = 0;\n }\n };\n /**\n * Disable history tracking if it is currently enabled.\n */\n\n\n log.history.disable = function () {\n if (history !== null) {\n history.length = 0;\n history = null;\n }\n };\n /**\n * Enable history tracking if it is currently disabled.\n */\n\n\n log.history.enable = function () {\n if (history === null) {\n history = [];\n }\n };\n /**\n * Logs error messages. Similar to `console.error`.\n *\n * @param {Mixed[]} args\n * One or more messages or objects that should be logged as an error\n */\n\n\n log.error = function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return logByType('error', level, args);\n };\n /**\n * Logs warning messages. Similar to `console.warn`.\n *\n * @param {Mixed[]} args\n * One or more messages or objects that should be logged as a warning.\n */\n\n\n log.warn = function () {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n return logByType('warn', level, args);\n };\n /**\n * Logs debug messages. Similar to `console.debug`, but may also act as a comparable\n * log if `console.debug` is not available\n *\n * @param {Mixed[]} args\n * One or more messages or objects that should be logged as debug.\n */\n\n\n log.debug = function () {\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n\n return logByType('debug', level, args);\n };\n\n return log;\n }\n\n /**\n * @file log.js\n * @module log\n */\n var log = createLogger('VIDEOJS');\n var createLogger$1 = log.createLogger;\n\n function createCommonjsModule(fn, module) {\n \treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n }\n\n var _extends_1 = createCommonjsModule(function (module) {\n function _extends() {\n module.exports = _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n }\n\n module.exports = _extends;\n });\n\n /**\n * @file obj.js\n * @module obj\n */\n\n /**\n * @callback obj:EachCallback\n *\n * @param {Mixed} value\n * The current key for the object that is being iterated over.\n *\n * @param {string} key\n * The current key-value for object that is being iterated over\n */\n\n /**\n * @callback obj:ReduceCallback\n *\n * @param {Mixed} accum\n * The value that is accumulating over the reduce loop.\n *\n * @param {Mixed} value\n * The current key for the object that is being iterated over.\n *\n * @param {string} key\n * The current key-value for object that is being iterated over\n *\n * @return {Mixed}\n * The new accumulated value.\n */\n var toString = Object.prototype.toString;\n /**\n * Get the keys of an Object\n *\n * @param {Object}\n * The Object to get the keys from\n *\n * @return {string[]}\n * An array of the keys from the object. Returns an empty array if the\n * object passed in was invalid or had no keys.\n *\n * @private\n */\n\n var keys = function keys(object) {\n return isObject(object) ? Object.keys(object) : [];\n };\n /**\n * Array-like iteration for objects.\n *\n * @param {Object} object\n * The object to iterate over\n *\n * @param {obj:EachCallback} fn\n * The callback function which is called for each key in the object.\n */\n\n\n function each(object, fn) {\n keys(object).forEach(function (key) {\n return fn(object[key], key);\n });\n }\n /**\n * Array-like reduce for objects.\n *\n * @param {Object} object\n * The Object that you want to reduce.\n *\n * @param {Function} fn\n * A callback function which is called for each key in the object. It\n * receives the accumulated value and the per-iteration value and key\n * as arguments.\n *\n * @param {Mixed} [initial = 0]\n * Starting value\n *\n * @return {Mixed}\n * The final accumulated value.\n */\n\n function reduce(object, fn, initial) {\n if (initial === void 0) {\n initial = 0;\n }\n\n return keys(object).reduce(function (accum, key) {\n return fn(accum, object[key], key);\n }, initial);\n }\n /**\n * Object.assign-style object shallow merge/extend.\n *\n * @param {Object} target\n * @param {Object} ...sources\n * @return {Object}\n */\n\n function assign(target) {\n for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n sources[_key - 1] = arguments[_key];\n }\n\n if (Object.assign) {\n return _extends_1.apply(void 0, [target].concat(sources));\n }\n\n sources.forEach(function (source) {\n if (!source) {\n return;\n }\n\n each(source, function (value, key) {\n target[key] = value;\n });\n });\n return target;\n }\n /**\n * Returns whether a value is an object of any kind - including DOM nodes,\n * arrays, regular expressions, etc. Not functions, though.\n *\n * This avoids the gotcha where using `typeof` on a `null` value\n * results in `'object'`.\n *\n * @param {Object} value\n * @return {boolean}\n */\n\n function isObject(value) {\n return !!value && typeof value === 'object';\n }\n /**\n * Returns whether an object appears to be a \"plain\" object - that is, a\n * direct instance of `Object`.\n *\n * @param {Object} value\n * @return {boolean}\n */\n\n function isPlain(value) {\n return isObject(value) && toString.call(value) === '[object Object]' && value.constructor === Object;\n }\n\n /**\n * @file computed-style.js\n * @module computed-style\n */\n /**\n * A safe getComputedStyle.\n *\n * This is needed because in Firefox, if the player is loaded in an iframe with\n * `display:none`, then `getComputedStyle` returns `null`, so, we do a\n * null-check to make sure that the player doesn't break in these cases.\n *\n * @function\n * @param {Element} el\n * The element you want the computed style of\n *\n * @param {string} prop\n * The property name you want\n *\n * @see https://bugzilla.mozilla.org/show_bug.cgi?id=548397\n */\n\n function computedStyle(el, prop) {\n if (!el || !prop) {\n return '';\n }\n\n if (typeof window$3.getComputedStyle === 'function') {\n var computedStyleValue = window$3.getComputedStyle(el);\n return computedStyleValue ? computedStyleValue.getPropertyValue(prop) || computedStyleValue[prop] : '';\n }\n\n return '';\n }\n\n /**\n * @file dom.js\n * @module dom\n */\n /**\n * Detect if a value is a string with any non-whitespace characters.\n *\n * @private\n * @param {string} str\n * The string to check\n *\n * @return {boolean}\n * Will be `true` if the string is non-blank, `false` otherwise.\n *\n */\n\n function isNonBlankString(str) {\n // we use str.trim as it will trim any whitespace characters\n // from the front or back of non-whitespace characters. aka\n // Any string that contains non-whitespace characters will\n // still contain them after `trim` but whitespace only strings\n // will have a length of 0, failing this check.\n return typeof str === 'string' && Boolean(str.trim());\n }\n /**\n * Throws an error if the passed string has whitespace. This is used by\n * class methods to be relatively consistent with the classList API.\n *\n * @private\n * @param {string} str\n * The string to check for whitespace.\n *\n * @throws {Error}\n * Throws an error if there is whitespace in the string.\n */\n\n\n function throwIfWhitespace(str) {\n // str.indexOf instead of regex because str.indexOf is faster performance wise.\n if (str.indexOf(' ') >= 0) {\n throw new Error('class has illegal whitespace characters');\n }\n }\n /**\n * Produce a regular expression for matching a className within an elements className.\n *\n * @private\n * @param {string} className\n * The className to generate the RegExp for.\n *\n * @return {RegExp}\n * The RegExp that will check for a specific `className` in an elements\n * className.\n */\n\n\n function classRegExp(className) {\n return new RegExp('(^|\\\\s)' + className + '($|\\\\s)');\n }\n /**\n * Whether the current DOM interface appears to be real (i.e. not simulated).\n *\n * @return {boolean}\n * Will be `true` if the DOM appears to be real, `false` otherwise.\n */\n\n\n function isReal() {\n // Both document and window will never be undefined thanks to `global`.\n return document === window$3.document;\n }\n /**\n * Determines, via duck typing, whether or not a value is a DOM element.\n *\n * @param {Mixed} value\n * The value to check.\n *\n * @return {boolean}\n * Will be `true` if the value is a DOM element, `false` otherwise.\n */\n\n function isEl(value) {\n return isObject(value) && value.nodeType === 1;\n }\n /**\n * Determines if the current DOM is embedded in an iframe.\n *\n * @return {boolean}\n * Will be `true` if the DOM is embedded in an iframe, `false`\n * otherwise.\n */\n\n function isInFrame() {\n // We need a try/catch here because Safari will throw errors when attempting\n // to get either `parent` or `self`\n try {\n return window$3.parent !== window$3.self;\n } catch (x) {\n return true;\n }\n }\n /**\n * Creates functions to query the DOM using a given method.\n *\n * @private\n * @param {string} method\n * The method to create the query with.\n *\n * @return {Function}\n * The query method\n */\n\n function createQuerier(method) {\n return function (selector, context) {\n if (!isNonBlankString(selector)) {\n return document[method](null);\n }\n\n if (isNonBlankString(context)) {\n context = document.querySelector(context);\n }\n\n var ctx = isEl(context) ? context : document;\n return ctx[method] && ctx[method](selector);\n };\n }\n /**\n * Creates an element and applies properties, attributes, and inserts content.\n *\n * @param {string} [tagName='div']\n * Name of tag to be created.\n *\n * @param {Object} [properties={}]\n * Element properties to be applied.\n *\n * @param {Object} [attributes={}]\n * Element attributes to be applied.\n *\n * @param {module:dom~ContentDescriptor} content\n * A content descriptor object.\n *\n * @return {Element}\n * The element that was created.\n */\n\n\n function createEl(tagName, properties, attributes, content) {\n if (tagName === void 0) {\n tagName = 'div';\n }\n\n if (properties === void 0) {\n properties = {};\n }\n\n if (attributes === void 0) {\n attributes = {};\n }\n\n var el = document.createElement(tagName);\n Object.getOwnPropertyNames(properties).forEach(function (propName) {\n var val = properties[propName]; // See #2176\n // We originally were accepting both properties and attributes in the\n // same object, but that doesn't work so well.\n\n if (propName.indexOf('aria-') !== -1 || propName === 'role' || propName === 'type') {\n log.warn('Setting attributes in the second argument of createEl()\\n' + 'has been deprecated. Use the third argument instead.\\n' + (\"createEl(type, properties, attributes). Attempting to set \" + propName + \" to \" + val + \".\"));\n el.setAttribute(propName, val); // Handle textContent since it's not supported everywhere and we have a\n // method for it.\n } else if (propName === 'textContent') {\n textContent(el, val);\n } else if (el[propName] !== val) {\n el[propName] = val;\n }\n });\n Object.getOwnPropertyNames(attributes).forEach(function (attrName) {\n el.setAttribute(attrName, attributes[attrName]);\n });\n\n if (content) {\n appendContent(el, content);\n }\n\n return el;\n }\n /**\n * Injects text into an element, replacing any existing contents entirely.\n *\n * @param {Element} el\n * The element to add text content into\n *\n * @param {string} text\n * The text content to add.\n *\n * @return {Element}\n * The element with added text content.\n */\n\n function textContent(el, text) {\n if (typeof el.textContent === 'undefined') {\n el.innerText = text;\n } else {\n el.textContent = text;\n }\n\n return el;\n }\n /**\n * Insert an element as the first child node of another\n *\n * @param {Element} child\n * Element to insert\n *\n * @param {Element} parent\n * Element to insert child into\n */\n\n function prependTo(child, parent) {\n if (parent.firstChild) {\n parent.insertBefore(child, parent.firstChild);\n } else {\n parent.appendChild(child);\n }\n }\n /**\n * Check if an element has a class name.\n *\n * @param {Element} element\n * Element to check\n *\n * @param {string} classToCheck\n * Class name to check for\n *\n * @return {boolean}\n * Will be `true` if the element has a class, `false` otherwise.\n *\n * @throws {Error}\n * Throws an error if `classToCheck` has white space.\n */\n\n function hasClass(element, classToCheck) {\n throwIfWhitespace(classToCheck);\n\n if (element.classList) {\n return element.classList.contains(classToCheck);\n }\n\n return classRegExp(classToCheck).test(element.className);\n }\n /**\n * Add a class name to an element.\n *\n * @param {Element} element\n * Element to add class name to.\n *\n * @param {string} classToAdd\n * Class name to add.\n *\n * @return {Element}\n * The DOM element with the added class name.\n */\n\n function addClass(element, classToAdd) {\n if (element.classList) {\n element.classList.add(classToAdd); // Don't need to `throwIfWhitespace` here because `hasElClass` will do it\n // in the case of classList not being supported.\n } else if (!hasClass(element, classToAdd)) {\n element.className = (element.className + ' ' + classToAdd).trim();\n }\n\n return element;\n }\n /**\n * Remove a class name from an element.\n *\n * @param {Element} element\n * Element to remove a class name from.\n *\n * @param {string} classToRemove\n * Class name to remove\n *\n * @return {Element}\n * The DOM element with class name removed.\n */\n\n function removeClass(element, classToRemove) {\n if (element.classList) {\n element.classList.remove(classToRemove);\n } else {\n throwIfWhitespace(classToRemove);\n element.className = element.className.split(/\\s+/).filter(function (c) {\n return c !== classToRemove;\n }).join(' ');\n }\n\n return element;\n }\n /**\n * The callback definition for toggleClass.\n *\n * @callback module:dom~PredicateCallback\n * @param {Element} element\n * The DOM element of the Component.\n *\n * @param {string} classToToggle\n * The `className` that wants to be toggled\n *\n * @return {boolean|undefined}\n * If `true` is returned, the `classToToggle` will be added to the\n * `element`. If `false`, the `classToToggle` will be removed from\n * the `element`. If `undefined`, the callback will be ignored.\n */\n\n /**\n * Adds or removes a class name to/from an element depending on an optional\n * condition or the presence/absence of the class name.\n *\n * @param {Element} element\n * The element to toggle a class name on.\n *\n * @param {string} classToToggle\n * The class that should be toggled.\n *\n * @param {boolean|module:dom~PredicateCallback} [predicate]\n * See the return value for {@link module:dom~PredicateCallback}\n *\n * @return {Element}\n * The element with a class that has been toggled.\n */\n\n function toggleClass(element, classToToggle, predicate) {\n // This CANNOT use `classList` internally because IE11 does not support the\n // second parameter to the `classList.toggle()` method! Which is fine because\n // `classList` will be used by the add/remove functions.\n var has = hasClass(element, classToToggle);\n\n if (typeof predicate === 'function') {\n predicate = predicate(element, classToToggle);\n }\n\n if (typeof predicate !== 'boolean') {\n predicate = !has;\n } // If the necessary class operation matches the current state of the\n // element, no action is required.\n\n\n if (predicate === has) {\n return;\n }\n\n if (predicate) {\n addClass(element, classToToggle);\n } else {\n removeClass(element, classToToggle);\n }\n\n return element;\n }\n /**\n * Apply attributes to an HTML element.\n *\n * @param {Element} el\n * Element to add attributes to.\n *\n * @param {Object} [attributes]\n * Attributes to be applied.\n */\n\n function setAttributes(el, attributes) {\n Object.getOwnPropertyNames(attributes).forEach(function (attrName) {\n var attrValue = attributes[attrName];\n\n if (attrValue === null || typeof attrValue === 'undefined' || attrValue === false) {\n el.removeAttribute(attrName);\n } else {\n el.setAttribute(attrName, attrValue === true ? '' : attrValue);\n }\n });\n }\n /**\n * Get an element's attribute values, as defined on the HTML tag.\n *\n * Attributes are not the same as properties. They're defined on the tag\n * or with setAttribute.\n *\n * @param {Element} tag\n * Element from which to get tag attributes.\n *\n * @return {Object}\n * All attributes of the element. Boolean attributes will be `true` or\n * `false`, others will be strings.\n */\n\n function getAttributes(tag) {\n var obj = {}; // known boolean attributes\n // we can check for matching boolean properties, but not all browsers\n // and not all tags know about these attributes, so, we still want to check them manually\n\n var knownBooleans = ',' + 'autoplay,controls,playsinline,loop,muted,default,defaultMuted' + ',';\n\n if (tag && tag.attributes && tag.attributes.length > 0) {\n var attrs = tag.attributes;\n\n for (var i = attrs.length - 1; i >= 0; i--) {\n var attrName = attrs[i].name;\n var attrVal = attrs[i].value; // check for known booleans\n // the matching element property will return a value for typeof\n\n if (typeof tag[attrName] === 'boolean' || knownBooleans.indexOf(',' + attrName + ',') !== -1) {\n // the value of an included boolean attribute is typically an empty\n // string ('') which would equal false if we just check for a false value.\n // we also don't want support bad code like autoplay='false'\n attrVal = attrVal !== null ? true : false;\n }\n\n obj[attrName] = attrVal;\n }\n }\n\n return obj;\n }\n /**\n * Get the value of an element's attribute.\n *\n * @param {Element} el\n * A DOM element.\n *\n * @param {string} attribute\n * Attribute to get the value of.\n *\n * @return {string}\n * The value of the attribute.\n */\n\n function getAttribute(el, attribute) {\n return el.getAttribute(attribute);\n }\n /**\n * Set the value of an element's attribute.\n *\n * @param {Element} el\n * A DOM element.\n *\n * @param {string} attribute\n * Attribute to set.\n *\n * @param {string} value\n * Value to set the attribute to.\n */\n\n function setAttribute(el, attribute, value) {\n el.setAttribute(attribute, value);\n }\n /**\n * Remove an element's attribute.\n *\n * @param {Element} el\n * A DOM element.\n *\n * @param {string} attribute\n * Attribute to remove.\n */\n\n function removeAttribute(el, attribute) {\n el.removeAttribute(attribute);\n }\n /**\n * Attempt to block the ability to select text.\n */\n\n function blockTextSelection() {\n document.body.focus();\n\n document.onselectstart = function () {\n return false;\n };\n }\n /**\n * Turn off text selection blocking.\n */\n\n function unblockTextSelection() {\n document.onselectstart = function () {\n return true;\n };\n }\n /**\n * Identical to the native `getBoundingClientRect` function, but ensures that\n * the method is supported at all (it is in all browsers we claim to support)\n * and that the element is in the DOM before continuing.\n *\n * This wrapper function also shims properties which are not provided by some\n * older browsers (namely, IE8).\n *\n * Additionally, some browsers do not support adding properties to a\n * `ClientRect`/`DOMRect` object; so, we shallow-copy it with the standard\n * properties (except `x` and `y` which are not widely supported). This helps\n * avoid implementations where keys are non-enumerable.\n *\n * @param {Element} el\n * Element whose `ClientRect` we want to calculate.\n *\n * @return {Object|undefined}\n * Always returns a plain object - or `undefined` if it cannot.\n */\n\n function getBoundingClientRect(el) {\n if (el && el.getBoundingClientRect && el.parentNode) {\n var rect = el.getBoundingClientRect();\n var result = {};\n ['bottom', 'height', 'left', 'right', 'top', 'width'].forEach(function (k) {\n if (rect[k] !== undefined) {\n result[k] = rect[k];\n }\n });\n\n if (!result.height) {\n result.height = parseFloat(computedStyle(el, 'height'));\n }\n\n if (!result.width) {\n result.width = parseFloat(computedStyle(el, 'width'));\n }\n\n return result;\n }\n }\n /**\n * Represents the position of a DOM element on the page.\n *\n * @typedef {Object} module:dom~Position\n *\n * @property {number} left\n * Pixels to the left.\n *\n * @property {number} top\n * Pixels from the top.\n */\n\n /**\n * Get the position of an element in the DOM.\n *\n * Uses `getBoundingClientRect` technique from John Resig.\n *\n * @see http://ejohn.org/blog/getboundingclientrect-is-awesome/\n *\n * @param {Element} el\n * Element from which to get offset.\n *\n * @return {module:dom~Position}\n * The position of the element that was passed in.\n */\n\n function findPosition(el) {\n var box;\n\n if (el.getBoundingClientRect && el.parentNode) {\n box = el.getBoundingClientRect();\n }\n\n if (!box) {\n return {\n left: 0,\n top: 0\n };\n }\n\n var docEl = document.documentElement;\n var body = document.body;\n var clientLeft = docEl.clientLeft || body.clientLeft || 0;\n var scrollLeft = window$3.pageXOffset || body.scrollLeft;\n var left = box.left + scrollLeft - clientLeft;\n var clientTop = docEl.clientTop || body.clientTop || 0;\n var scrollTop = window$3.pageYOffset || body.scrollTop;\n var top = box.top + scrollTop - clientTop; // Android sometimes returns slightly off decimal values, so need to round\n\n return {\n left: Math.round(left),\n top: Math.round(top)\n };\n }\n /**\n * Represents x and y coordinates for a DOM element or mouse pointer.\n *\n * @typedef {Object} module:dom~Coordinates\n *\n * @property {number} x\n * x coordinate in pixels\n *\n * @property {number} y\n * y coordinate in pixels\n */\n\n /**\n * Get the pointer position within an element.\n *\n * The base on the coordinates are the bottom left of the element.\n *\n * @param {Element} el\n * Element on which to get the pointer position on.\n *\n * @param {EventTarget~Event} event\n * Event object.\n *\n * @return {module:dom~Coordinates}\n * A coordinates object corresponding to the mouse position.\n *\n */\n\n function getPointerPosition(el, event) {\n var position = {};\n var box = findPosition(el);\n var boxW = el.offsetWidth;\n var boxH = el.offsetHeight;\n var boxY = box.top;\n var boxX = box.left;\n var pageY = event.pageY;\n var pageX = event.pageX;\n\n if (event.changedTouches) {\n pageX = event.changedTouches[0].pageX;\n pageY = event.changedTouches[0].pageY;\n }\n\n position.y = Math.max(0, Math.min(1, (boxY - pageY + boxH) / boxH));\n position.x = Math.max(0, Math.min(1, (pageX - boxX) / boxW));\n return position;\n }\n /**\n * Determines, via duck typing, whether or not a value is a text node.\n *\n * @param {Mixed} value\n * Check if this value is a text node.\n *\n * @return {boolean}\n * Will be `true` if the value is a text node, `false` otherwise.\n */\n\n function isTextNode(value) {\n return isObject(value) && value.nodeType === 3;\n }\n /**\n * Empties the contents of an element.\n *\n * @param {Element} el\n * The element to empty children from\n *\n * @return {Element}\n * The element with no children\n */\n\n function emptyEl(el) {\n while (el.firstChild) {\n el.removeChild(el.firstChild);\n }\n\n return el;\n }\n /**\n * This is a mixed value that describes content to be injected into the DOM\n * via some method. It can be of the following types:\n *\n * Type | Description\n * -----------|-------------\n * `string` | The value will be normalized into a text node.\n * `Element` | The value will be accepted as-is.\n * `TextNode` | The value will be accepted as-is.\n * `Array` | A one-dimensional array of strings, elements, text nodes, or functions. These functions should return a string, element, or text node (any other return value, like an array, will be ignored).\n * `Function` | A function, which is expected to return a string, element, text node, or array - any of the other possible values described above. This means that a content descriptor could be a function that returns an array of functions, but those second-level functions must return strings, elements, or text nodes.\n *\n * @typedef {string|Element|TextNode|Array|Function} module:dom~ContentDescriptor\n */\n\n /**\n * Normalizes content for eventual insertion into the DOM.\n *\n * This allows a wide range of content definition methods, but helps protect\n * from falling into the trap of simply writing to `innerHTML`, which could\n * be an XSS concern.\n *\n * The content for an element can be passed in multiple types and\n * combinations, whose behavior is as follows:\n *\n * @param {module:dom~ContentDescriptor} content\n * A content descriptor value.\n *\n * @return {Array}\n * All of the content that was passed in, normalized to an array of\n * elements or text nodes.\n */\n\n function normalizeContent(content) {\n // First, invoke content if it is a function. If it produces an array,\n // that needs to happen before normalization.\n if (typeof content === 'function') {\n content = content();\n } // Next up, normalize to an array, so one or many items can be normalized,\n // filtered, and returned.\n\n\n return (Array.isArray(content) ? content : [content]).map(function (value) {\n // First, invoke value if it is a function to produce a new value,\n // which will be subsequently normalized to a Node of some kind.\n if (typeof value === 'function') {\n value = value();\n }\n\n if (isEl(value) || isTextNode(value)) {\n return value;\n }\n\n if (typeof value === 'string' && /\\S/.test(value)) {\n return document.createTextNode(value);\n }\n }).filter(function (value) {\n return value;\n });\n }\n /**\n * Normalizes and appends content to an element.\n *\n * @param {Element} el\n * Element to append normalized content to.\n *\n * @param {module:dom~ContentDescriptor} content\n * A content descriptor value.\n *\n * @return {Element}\n * The element with appended normalized content.\n */\n\n function appendContent(el, content) {\n normalizeContent(content).forEach(function (node) {\n return el.appendChild(node);\n });\n return el;\n }\n /**\n * Normalizes and inserts content into an element; this is identical to\n * `appendContent()`, except it empties the element first.\n *\n * @param {Element} el\n * Element to insert normalized content into.\n *\n * @param {module:dom~ContentDescriptor} content\n * A content descriptor value.\n *\n * @return {Element}\n * The element with inserted normalized content.\n */\n\n function insertContent(el, content) {\n return appendContent(emptyEl(el), content);\n }\n /**\n * Check if an event was a single left click.\n *\n * @param {EventTarget~Event} event\n * Event object.\n *\n * @return {boolean}\n * Will be `true` if a single left click, `false` otherwise.\n */\n\n function isSingleLeftClick(event) {\n // Note: if you create something draggable, be sure to\n // call it on both `mousedown` and `mousemove` event,\n // otherwise `mousedown` should be enough for a button\n if (event.button === undefined && event.buttons === undefined) {\n // Why do we need `buttons` ?\n // Because, middle mouse sometimes have this:\n // e.button === 0 and e.buttons === 4\n // Furthermore, we want to prevent combination click, something like\n // HOLD middlemouse then left click, that would be\n // e.button === 0, e.buttons === 5\n // just `button` is not gonna work\n // Alright, then what this block does ?\n // this is for chrome `simulate mobile devices`\n // I want to support this as well\n return true;\n }\n\n if (event.button === 0 && event.buttons === undefined) {\n // Touch screen, sometimes on some specific device, `buttons`\n // doesn't have anything (safari on ios, blackberry...)\n return true;\n } // `mouseup` event on a single left click has\n // `button` and `buttons` equal to 0\n\n\n if (event.type === 'mouseup' && event.button === 0 && event.buttons === 0) {\n return true;\n }\n\n if (event.button !== 0 || event.buttons !== 1) {\n // This is the reason we have those if else block above\n // if any special case we can catch and let it slide\n // we do it above, when get to here, this definitely\n // is-not-left-click\n return false;\n }\n\n return true;\n }\n /**\n * Finds a single DOM element matching `selector` within the optional\n * `context` of another DOM element (defaulting to `document`).\n *\n * @param {string} selector\n * A valid CSS selector, which will be passed to `querySelector`.\n *\n * @param {Element|String} [context=document]\n * A DOM element within which to query. Can also be a selector\n * string in which case the first matching element will be used\n * as context. If missing (or no element matches selector), falls\n * back to `document`.\n *\n * @return {Element|null}\n * The element that was found or null.\n */\n\n var $ = createQuerier('querySelector');\n /**\n * Finds a all DOM elements matching `selector` within the optional\n * `context` of another DOM element (defaulting to `document`).\n *\n * @param {string} selector\n * A valid CSS selector, which will be passed to `querySelectorAll`.\n *\n * @param {Element|String} [context=document]\n * A DOM element within which to query. Can also be a selector\n * string in which case the first matching element will be used\n * as context. If missing (or no element matches selector), falls\n * back to `document`.\n *\n * @return {NodeList}\n * A element list of elements that were found. Will be empty if none\n * were found.\n *\n */\n\n var $$ = createQuerier('querySelectorAll');\n\n var Dom = /*#__PURE__*/Object.freeze({\n isReal: isReal,\n isEl: isEl,\n isInFrame: isInFrame,\n createEl: createEl,\n textContent: textContent,\n prependTo: prependTo,\n hasClass: hasClass,\n addClass: addClass,\n removeClass: removeClass,\n toggleClass: toggleClass,\n setAttributes: setAttributes,\n getAttributes: getAttributes,\n getAttribute: getAttribute,\n setAttribute: setAttribute,\n removeAttribute: removeAttribute,\n blockTextSelection: blockTextSelection,\n unblockTextSelection: unblockTextSelection,\n getBoundingClientRect: getBoundingClientRect,\n findPosition: findPosition,\n getPointerPosition: getPointerPosition,\n isTextNode: isTextNode,\n emptyEl: emptyEl,\n normalizeContent: normalizeContent,\n appendContent: appendContent,\n insertContent: insertContent,\n isSingleLeftClick: isSingleLeftClick,\n $: $,\n $$: $$\n });\n\n /**\n * @file setup.js - Functions for setting up a player without\n * user interaction based on the data-setup `attribute` of the video tag.\n *\n * @module setup\n */\n var _windowLoaded = false;\n var videojs;\n /**\n * Set up any tags that have a data-setup `attribute` when the player is started.\n */\n\n var autoSetup = function autoSetup() {\n // Protect against breakage in non-browser environments and check global autoSetup option.\n if (!isReal() || videojs.options.autoSetup === false) {\n return;\n }\n\n var vids = Array.prototype.slice.call(document.getElementsByTagName('video'));\n var audios = Array.prototype.slice.call(document.getElementsByTagName('audio'));\n var divs = Array.prototype.slice.call(document.getElementsByTagName('video-js'));\n var mediaEls = vids.concat(audios, divs); // Check if any media elements exist\n\n if (mediaEls && mediaEls.length > 0) {\n for (var i = 0, e = mediaEls.length; i < e; i++) {\n var mediaEl = mediaEls[i]; // Check if element exists, has getAttribute func.\n\n if (mediaEl && mediaEl.getAttribute) {\n // Make sure this player hasn't already been set up.\n if (mediaEl.player === undefined) {\n var options = mediaEl.getAttribute('data-setup'); // Check if data-setup attr exists.\n // We only auto-setup if they've added the data-setup attr.\n\n if (options !== null) {\n // Create new video.js instance.\n videojs(mediaEl);\n }\n } // If getAttribute isn't defined, we need to wait for the DOM.\n\n } else {\n autoSetupTimeout(1);\n break;\n }\n } // No videos were found, so keep looping unless page is finished loading.\n\n } else if (!_windowLoaded) {\n autoSetupTimeout(1);\n }\n };\n /**\n * Wait until the page is loaded before running autoSetup. This will be called in\n * autoSetup if `hasLoaded` returns false.\n *\n * @param {number} wait\n * How long to wait in ms\n *\n * @param {module:videojs} [vjs]\n * The videojs library function\n */\n\n\n function autoSetupTimeout(wait, vjs) {\n if (vjs) {\n videojs = vjs;\n }\n\n window$3.setTimeout(autoSetup, wait);\n }\n /**\n * Used to set the internal tracking of window loaded state to true.\n *\n * @private\n */\n\n\n function setWindowLoaded() {\n _windowLoaded = true;\n window$3.removeEventListener('load', setWindowLoaded);\n }\n\n if (isReal()) {\n if (document.readyState === 'complete') {\n setWindowLoaded();\n } else {\n /**\n * Listen for the load event on window, and set _windowLoaded to true.\n *\n * We use a standard event listener here to avoid incrementing the GUID\n * before any players are created.\n *\n * @listens load\n */\n window$3.addEventListener('load', setWindowLoaded);\n }\n }\n\n /**\n * @file stylesheet.js\n * @module stylesheet\n */\n /**\n * Create a DOM syle element given a className for it.\n *\n * @param {string} className\n * The className to add to the created style element.\n *\n * @return {Element}\n * The element that was created.\n */\n\n var createStyleElement = function createStyleElement(className) {\n var style = document.createElement('style');\n style.className = className;\n return style;\n };\n /**\n * Add text to a DOM element.\n *\n * @param {Element} el\n * The Element to add text content to.\n *\n * @param {string} content\n * The text to add to the element.\n */\n\n var setTextContent = function setTextContent(el, content) {\n if (el.styleSheet) {\n el.styleSheet.cssText = content;\n } else {\n el.textContent = content;\n }\n };\n\n /**\n * @file guid.js\n * @module guid\n */\n // Default value for GUIDs. This allows us to reset the GUID counter in tests.\n //\n // The initial GUID is 3 because some users have come to rely on the first\n // default player ID ending up as `vjs_video_3`.\n //\n // See: https://github.com/videojs/video.js/pull/6216\n var _initialGuid = 3;\n /**\n * Unique ID for an element or function\n *\n * @type {Number}\n */\n\n var _guid = _initialGuid;\n /**\n * Get a unique auto-incrementing ID by number that has not been returned before.\n *\n * @return {number}\n * A new unique ID.\n */\n\n function newGUID() {\n return _guid++;\n }\n\n /**\n * @file dom-data.js\n * @module dom-data\n */\n var FakeWeakMap;\n\n if (!window$3.WeakMap) {\n FakeWeakMap = /*#__PURE__*/function () {\n function FakeWeakMap() {\n this.vdata = 'vdata' + Math.floor(window$3.performance && window$3.performance.now() || Date.now());\n this.data = {};\n }\n\n var _proto = FakeWeakMap.prototype;\n\n _proto.set = function set(key, value) {\n var access = key[this.vdata] || newGUID();\n\n if (!key[this.vdata]) {\n key[this.vdata] = access;\n }\n\n this.data[access] = value;\n return this;\n };\n\n _proto.get = function get(key) {\n var access = key[this.vdata]; // we have data, return it\n\n if (access) {\n return this.data[access];\n } // we don't have data, return nothing.\n // return undefined explicitly as that's the contract for this method\n\n\n log('We have no data for this element', key);\n return undefined;\n };\n\n _proto.has = function has(key) {\n var access = key[this.vdata];\n return access in this.data;\n };\n\n _proto[\"delete\"] = function _delete(key) {\n var access = key[this.vdata];\n\n if (access) {\n delete this.data[access];\n delete key[this.vdata];\n }\n };\n\n return FakeWeakMap;\n }();\n }\n /**\n * Element Data Store.\n *\n * Allows for binding data to an element without putting it directly on the\n * element. Ex. Event listeners are stored here.\n * (also from jsninja.com, slightly modified and updated for closure compiler)\n *\n * @type {Object}\n * @private\n */\n\n\n var DomData = window$3.WeakMap ? new WeakMap() : new FakeWeakMap();\n\n /**\n * @file events.js. An Event System (John Resig - Secrets of a JS Ninja http://jsninja.com/)\n * (Original book version wasn't completely usable, so fixed some things and made Closure Compiler compatible)\n * This should work very similarly to jQuery's events, however it's based off the book version which isn't as\n * robust as jquery's, so there's probably some differences.\n *\n * @file events.js\n * @module events\n */\n /**\n * Clean up the listener cache and dispatchers\n *\n * @param {Element|Object} elem\n * Element to clean up\n *\n * @param {string} type\n * Type of event to clean up\n */\n\n function _cleanUpEvents(elem, type) {\n if (!DomData.has(elem)) {\n return;\n }\n\n var data = DomData.get(elem); // Remove the events of a particular type if there are none left\n\n if (data.handlers[type].length === 0) {\n delete data.handlers[type]; // data.handlers[type] = null;\n // Setting to null was causing an error with data.handlers\n // Remove the meta-handler from the element\n\n if (elem.removeEventListener) {\n elem.removeEventListener(type, data.dispatcher, false);\n } else if (elem.detachEvent) {\n elem.detachEvent('on' + type, data.dispatcher);\n }\n } // Remove the events object if there are no types left\n\n\n if (Object.getOwnPropertyNames(data.handlers).length <= 0) {\n delete data.handlers;\n delete data.dispatcher;\n delete data.disabled;\n } // Finally remove the element data if there is no data left\n\n\n if (Object.getOwnPropertyNames(data).length === 0) {\n DomData[\"delete\"](elem);\n }\n }\n /**\n * Loops through an array of event types and calls the requested method for each type.\n *\n * @param {Function} fn\n * The event method we want to use.\n *\n * @param {Element|Object} elem\n * Element or object to bind listeners to\n *\n * @param {string} type\n * Type of event to bind to.\n *\n * @param {EventTarget~EventListener} callback\n * Event listener.\n */\n\n\n function _handleMultipleEvents(fn, elem, types, callback) {\n types.forEach(function (type) {\n // Call the event method for each one of the types\n fn(elem, type, callback);\n });\n }\n /**\n * Fix a native event to have standard property values\n *\n * @param {Object} event\n * Event object to fix.\n *\n * @return {Object}\n * Fixed event object.\n */\n\n\n function fixEvent(event) {\n if (event.fixed_) {\n return event;\n }\n\n function returnTrue() {\n return true;\n }\n\n function returnFalse() {\n return false;\n } // Test if fixing up is needed\n // Used to check if !event.stopPropagation instead of isPropagationStopped\n // But native events return true for stopPropagation, but don't have\n // other expected methods like isPropagationStopped. Seems to be a problem\n // with the Javascript Ninja code. So we're just overriding all events now.\n\n\n if (!event || !event.isPropagationStopped) {\n var old = event || window$3.event;\n event = {}; // Clone the old object so that we can modify the values event = {};\n // IE8 Doesn't like when you mess with native event properties\n // Firefox returns false for event.hasOwnProperty('type') and other props\n // which makes copying more difficult.\n // TODO: Probably best to create a whitelist of event props\n\n for (var key in old) {\n // Safari 6.0.3 warns you if you try to copy deprecated layerX/Y\n // Chrome warns you if you try to copy deprecated keyboardEvent.keyLocation\n // and webkitMovementX/Y\n if (key !== 'layerX' && key !== 'layerY' && key !== 'keyLocation' && key !== 'webkitMovementX' && key !== 'webkitMovementY') {\n // Chrome 32+ warns if you try to copy deprecated returnValue, but\n // we still want to if preventDefault isn't supported (IE8).\n if (!(key === 'returnValue' && old.preventDefault)) {\n event[key] = old[key];\n }\n }\n } // The event occurred on this element\n\n\n if (!event.target) {\n event.target = event.srcElement || document;\n } // Handle which other element the event is related to\n\n\n if (!event.relatedTarget) {\n event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement;\n } // Stop the default browser action\n\n\n event.preventDefault = function () {\n if (old.preventDefault) {\n old.preventDefault();\n }\n\n event.returnValue = false;\n old.returnValue = false;\n event.defaultPrevented = true;\n };\n\n event.defaultPrevented = false; // Stop the event from bubbling\n\n event.stopPropagation = function () {\n if (old.stopPropagation) {\n old.stopPropagation();\n }\n\n event.cancelBubble = true;\n old.cancelBubble = true;\n event.isPropagationStopped = returnTrue;\n };\n\n event.isPropagationStopped = returnFalse; // Stop the event from bubbling and executing other handlers\n\n event.stopImmediatePropagation = function () {\n if (old.stopImmediatePropagation) {\n old.stopImmediatePropagation();\n }\n\n event.isImmediatePropagationStopped = returnTrue;\n event.stopPropagation();\n };\n\n event.isImmediatePropagationStopped = returnFalse; // Handle mouse position\n\n if (event.clientX !== null && event.clientX !== undefined) {\n var doc = document.documentElement;\n var body = document.body;\n event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);\n event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);\n } // Handle key presses\n\n\n event.which = event.charCode || event.keyCode; // Fix button for mouse clicks:\n // 0 == left; 1 == middle; 2 == right\n\n if (event.button !== null && event.button !== undefined) {\n // The following is disabled because it does not pass videojs-standard\n // and... yikes.\n\n /* eslint-disable */\n event.button = event.button & 1 ? 0 : event.button & 4 ? 1 : event.button & 2 ? 2 : 0;\n /* eslint-enable */\n }\n }\n\n event.fixed_ = true; // Returns fixed-up instance\n\n return event;\n }\n /**\n * Whether passive event listeners are supported\n */\n\n var _supportsPassive;\n\n var supportsPassive = function supportsPassive() {\n if (typeof _supportsPassive !== 'boolean') {\n _supportsPassive = false;\n\n try {\n var opts = Object.defineProperty({}, 'passive', {\n get: function get() {\n _supportsPassive = true;\n }\n });\n window$3.addEventListener('test', null, opts);\n window$3.removeEventListener('test', null, opts);\n } catch (e) {// disregard\n }\n }\n\n return _supportsPassive;\n };\n /**\n * Touch events Chrome expects to be passive\n */\n\n\n var passiveEvents = ['touchstart', 'touchmove'];\n /**\n * Add an event listener to element\n * It stores the handler function in a separate cache object\n * and adds a generic handler to the element's event,\n * along with a unique id (guid) to the element.\n *\n * @param {Element|Object} elem\n * Element or object to bind listeners to\n *\n * @param {string|string[]} type\n * Type of event to bind to.\n *\n * @param {EventTarget~EventListener} fn\n * Event listener.\n */\n\n function on(elem, type, fn) {\n if (Array.isArray(type)) {\n return _handleMultipleEvents(on, elem, type, fn);\n }\n\n if (!DomData.has(elem)) {\n DomData.set(elem, {});\n }\n\n var data = DomData.get(elem); // We need a place to store all our handler data\n\n if (!data.handlers) {\n data.handlers = {};\n }\n\n if (!data.handlers[type]) {\n data.handlers[type] = [];\n }\n\n if (!fn.guid) {\n fn.guid = newGUID();\n }\n\n data.handlers[type].push(fn);\n\n if (!data.dispatcher) {\n data.disabled = false;\n\n data.dispatcher = function (event, hash) {\n if (data.disabled) {\n return;\n }\n\n event = fixEvent(event);\n var handlers = data.handlers[event.type];\n\n if (handlers) {\n // Copy handlers so if handlers are added/removed during the process it doesn't throw everything off.\n var handlersCopy = handlers.slice(0);\n\n for (var m = 0, n = handlersCopy.length; m < n; m++) {\n if (event.isImmediatePropagationStopped()) {\n break;\n } else {\n try {\n handlersCopy[m].call(elem, event, hash);\n } catch (e) {\n log.error(e);\n }\n }\n }\n }\n };\n }\n\n if (data.handlers[type].length === 1) {\n if (elem.addEventListener) {\n var options = false;\n\n if (supportsPassive() && passiveEvents.indexOf(type) > -1) {\n options = {\n passive: true\n };\n }\n\n elem.addEventListener(type, data.dispatcher, options);\n } else if (elem.attachEvent) {\n elem.attachEvent('on' + type, data.dispatcher);\n }\n }\n }\n /**\n * Removes event listeners from an element\n *\n * @param {Element|Object} elem\n * Object to remove listeners from.\n *\n * @param {string|string[]} [type]\n * Type of listener to remove. Don't include to remove all events from element.\n *\n * @param {EventTarget~EventListener} [fn]\n * Specific listener to remove. Don't include to remove listeners for an event\n * type.\n */\n\n function off(elem, type, fn) {\n // Don't want to add a cache object through getElData if not needed\n if (!DomData.has(elem)) {\n return;\n }\n\n var data = DomData.get(elem); // If no events exist, nothing to unbind\n\n if (!data.handlers) {\n return;\n }\n\n if (Array.isArray(type)) {\n return _handleMultipleEvents(off, elem, type, fn);\n } // Utility function\n\n\n var removeType = function removeType(el, t) {\n data.handlers[t] = [];\n\n _cleanUpEvents(el, t);\n }; // Are we removing all bound events?\n\n\n if (type === undefined) {\n for (var t in data.handlers) {\n if (Object.prototype.hasOwnProperty.call(data.handlers || {}, t)) {\n removeType(elem, t);\n }\n }\n\n return;\n }\n\n var handlers = data.handlers[type]; // If no handlers exist, nothing to unbind\n\n if (!handlers) {\n return;\n } // If no listener was provided, remove all listeners for type\n\n\n if (!fn) {\n removeType(elem, type);\n return;\n } // We're only removing a single handler\n\n\n if (fn.guid) {\n for (var n = 0; n < handlers.length; n++) {\n if (handlers[n].guid === fn.guid) {\n handlers.splice(n--, 1);\n }\n }\n }\n\n _cleanUpEvents(elem, type);\n }\n /**\n * Trigger an event for an element\n *\n * @param {Element|Object} elem\n * Element to trigger an event on\n *\n * @param {EventTarget~Event|string} event\n * A string (the type) or an event object with a type attribute\n *\n * @param {Object} [hash]\n * data hash to pass along with the event\n *\n * @return {boolean|undefined}\n * Returns the opposite of `defaultPrevented` if default was\n * prevented. Otherwise, returns `undefined`\n */\n\n function trigger(elem, event, hash) {\n // Fetches element data and a reference to the parent (for bubbling).\n // Don't want to add a data object to cache for every parent,\n // so checking hasElData first.\n var elemData = DomData.has(elem) ? DomData.get(elem) : {};\n var parent = elem.parentNode || elem.ownerDocument; // type = event.type || event,\n // handler;\n // If an event name was passed as a string, creates an event out of it\n\n if (typeof event === 'string') {\n event = {\n type: event,\n target: elem\n };\n } else if (!event.target) {\n event.target = elem;\n } // Normalizes the event properties.\n\n\n event = fixEvent(event); // If the passed element has a dispatcher, executes the established handlers.\n\n if (elemData.dispatcher) {\n elemData.dispatcher.call(elem, event, hash);\n } // Unless explicitly stopped or the event does not bubble (e.g. media events)\n // recursively calls this function to bubble the event up the DOM.\n\n\n if (parent && !event.isPropagationStopped() && event.bubbles === true) {\n trigger.call(null, parent, event, hash); // If at the top of the DOM, triggers the default action unless disabled.\n } else if (!parent && !event.defaultPrevented && event.target && event.target[event.type]) {\n if (!DomData.has(event.target)) {\n DomData.set(event.target, {});\n }\n\n var targetData = DomData.get(event.target); // Checks if the target has a default action for this event.\n\n if (event.target[event.type]) {\n // Temporarily disables event dispatching on the target as we have already executed the handler.\n targetData.disabled = true; // Executes the default action.\n\n if (typeof event.target[event.type] === 'function') {\n event.target[event.type]();\n } // Re-enables event dispatching.\n\n\n targetData.disabled = false;\n }\n } // Inform the triggerer if the default was prevented by returning false\n\n\n return !event.defaultPrevented;\n }\n /**\n * Trigger a listener only once for an event.\n *\n * @param {Element|Object} elem\n * Element or object to bind to.\n *\n * @param {string|string[]} type\n * Name/type of event\n *\n * @param {Event~EventListener} fn\n * Event listener function\n */\n\n function one(elem, type, fn) {\n if (Array.isArray(type)) {\n return _handleMultipleEvents(one, elem, type, fn);\n }\n\n var func = function func() {\n off(elem, type, func);\n fn.apply(this, arguments);\n }; // copy the guid to the new function so it can removed using the original function's ID\n\n\n func.guid = fn.guid = fn.guid || newGUID();\n on(elem, type, func);\n }\n /**\n * Trigger a listener only once and then turn if off for all\n * configured events\n *\n * @param {Element|Object} elem\n * Element or object to bind to.\n *\n * @param {string|string[]} type\n * Name/type of event\n *\n * @param {Event~EventListener} fn\n * Event listener function\n */\n\n function any(elem, type, fn) {\n var func = function func() {\n off(elem, type, func);\n fn.apply(this, arguments);\n }; // copy the guid to the new function so it can removed using the original function's ID\n\n\n func.guid = fn.guid = fn.guid || newGUID(); // multiple ons, but one off for everything\n\n on(elem, type, func);\n }\n\n var Events = /*#__PURE__*/Object.freeze({\n fixEvent: fixEvent,\n on: on,\n off: off,\n trigger: trigger,\n one: one,\n any: any\n });\n\n /**\n * @file fn.js\n * @module fn\n */\n var UPDATE_REFRESH_INTERVAL = 30;\n /**\n * Bind (a.k.a proxy or context). A simple method for changing the context of\n * a function.\n *\n * It also stores a unique id on the function so it can be easily removed from\n * events.\n *\n * @function\n * @param {Mixed} context\n * The object to bind as scope.\n *\n * @param {Function} fn\n * The function to be bound to a scope.\n *\n * @param {number} [uid]\n * An optional unique ID for the function to be set\n *\n * @return {Function}\n * The new function that will be bound into the context given\n */\n\n var bind = function bind(context, fn, uid) {\n // Make sure the function has a unique ID\n if (!fn.guid) {\n fn.guid = newGUID();\n } // Create the new function that changes the context\n\n\n var bound = fn.bind(context); // Allow for the ability to individualize this function\n // Needed in the case where multiple objects might share the same prototype\n // IF both items add an event listener with the same function, then you try to remove just one\n // it will remove both because they both have the same guid.\n // when using this, you need to use the bind method when you remove the listener as well.\n // currently used in text tracks\n\n bound.guid = uid ? uid + '_' + fn.guid : fn.guid;\n return bound;\n };\n /**\n * Wraps the given function, `fn`, with a new function that only invokes `fn`\n * at most once per every `wait` milliseconds.\n *\n * @function\n * @param {Function} fn\n * The function to be throttled.\n *\n * @param {number} wait\n * The number of milliseconds by which to throttle.\n *\n * @return {Function}\n */\n\n var throttle = function throttle(fn, wait) {\n var last = window$3.performance.now();\n\n var throttled = function throttled() {\n var now = window$3.performance.now();\n\n if (now - last >= wait) {\n fn.apply(void 0, arguments);\n last = now;\n }\n };\n\n return throttled;\n };\n /**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked.\n *\n * Inspired by lodash and underscore implementations.\n *\n * @function\n * @param {Function} func\n * The function to wrap with debounce behavior.\n *\n * @param {number} wait\n * The number of milliseconds to wait after the last invocation.\n *\n * @param {boolean} [immediate]\n * Whether or not to invoke the function immediately upon creation.\n *\n * @param {Object} [context=window]\n * The \"context\" in which the debounced function should debounce. For\n * example, if this function should be tied to a Video.js player,\n * the player can be passed here. Alternatively, defaults to the\n * global `window` object.\n *\n * @return {Function}\n * A debounced function.\n */\n\n var debounce = function debounce(func, wait, immediate, context) {\n if (context === void 0) {\n context = window$3;\n }\n\n var timeout;\n\n var cancel = function cancel() {\n context.clearTimeout(timeout);\n timeout = null;\n };\n /* eslint-disable consistent-this */\n\n\n var debounced = function debounced() {\n var self = this;\n var args = arguments;\n\n var _later = function later() {\n timeout = null;\n _later = null;\n\n if (!immediate) {\n func.apply(self, args);\n }\n };\n\n if (!timeout && immediate) {\n func.apply(self, args);\n }\n\n context.clearTimeout(timeout);\n timeout = context.setTimeout(_later, wait);\n };\n /* eslint-enable consistent-this */\n\n\n debounced.cancel = cancel;\n return debounced;\n };\n\n /**\n * @file src/js/event-target.js\n */\n /**\n * `EventTarget` is a class that can have the same API as the DOM `EventTarget`. It\n * adds shorthand functions that wrap around lengthy functions. For example:\n * the `on` function is a wrapper around `addEventListener`.\n *\n * @see [EventTarget Spec]{@link https://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-EventTarget}\n * @class EventTarget\n */\n\n var EventTarget = function EventTarget() {};\n /**\n * A Custom DOM event.\n *\n * @typedef {Object} EventTarget~Event\n * @see [Properties]{@link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent}\n */\n\n /**\n * All event listeners should follow the following format.\n *\n * @callback EventTarget~EventListener\n * @this {EventTarget}\n *\n * @param {EventTarget~Event} event\n * the event that triggered this function\n *\n * @param {Object} [hash]\n * hash of data sent during the event\n */\n\n /**\n * An object containing event names as keys and booleans as values.\n *\n * > NOTE: If an event name is set to a true value here {@link EventTarget#trigger}\n * will have extra functionality. See that function for more information.\n *\n * @property EventTarget.prototype.allowedEvents_\n * @private\n */\n\n\n EventTarget.prototype.allowedEvents_ = {};\n /**\n * Adds an `event listener` to an instance of an `EventTarget`. An `event listener` is a\n * function that will get called when an event with a certain name gets triggered.\n *\n * @param {string|string[]} type\n * An event name or an array of event names.\n *\n * @param {EventTarget~EventListener} fn\n * The function to call with `EventTarget`s\n */\n\n EventTarget.prototype.on = function (type, fn) {\n // Remove the addEventListener alias before calling Events.on\n // so we don't get into an infinite type loop\n var ael = this.addEventListener;\n\n this.addEventListener = function () {};\n\n on(this, type, fn);\n this.addEventListener = ael;\n };\n /**\n * An alias of {@link EventTarget#on}. Allows `EventTarget` to mimic\n * the standard DOM API.\n *\n * @function\n * @see {@link EventTarget#on}\n */\n\n\n EventTarget.prototype.addEventListener = EventTarget.prototype.on;\n /**\n * Removes an `event listener` for a specific event from an instance of `EventTarget`.\n * This makes it so that the `event listener` will no longer get called when the\n * named event happens.\n *\n * @param {string|string[]} type\n * An event name or an array of event names.\n *\n * @param {EventTarget~EventListener} fn\n * The function to remove.\n */\n\n EventTarget.prototype.off = function (type, fn) {\n off(this, type, fn);\n };\n /**\n * An alias of {@link EventTarget#off}. Allows `EventTarget` to mimic\n * the standard DOM API.\n *\n * @function\n * @see {@link EventTarget#off}\n */\n\n\n EventTarget.prototype.removeEventListener = EventTarget.prototype.off;\n /**\n * This function will add an `event listener` that gets triggered only once. After the\n * first trigger it will get removed. This is like adding an `event listener`\n * with {@link EventTarget#on} that calls {@link EventTarget#off} on itself.\n *\n * @param {string|string[]} type\n * An event name or an array of event names.\n *\n * @param {EventTarget~EventListener} fn\n * The function to be called once for each event name.\n */\n\n EventTarget.prototype.one = function (type, fn) {\n // Remove the addEventListener aliasing Events.on\n // so we don't get into an infinite type loop\n var ael = this.addEventListener;\n\n this.addEventListener = function () {};\n\n one(this, type, fn);\n this.addEventListener = ael;\n };\n\n EventTarget.prototype.any = function (type, fn) {\n // Remove the addEventListener aliasing Events.on\n // so we don't get into an infinite type loop\n var ael = this.addEventListener;\n\n this.addEventListener = function () {};\n\n any(this, type, fn);\n this.addEventListener = ael;\n };\n /**\n * This function causes an event to happen. This will then cause any `event listeners`\n * that are waiting for that event, to get called. If there are no `event listeners`\n * for an event then nothing will happen.\n *\n * If the name of the `Event` that is being triggered is in `EventTarget.allowedEvents_`.\n * Trigger will also call the `on` + `uppercaseEventName` function.\n *\n * Example:\n * 'click' is in `EventTarget.allowedEvents_`, so, trigger will attempt to call\n * `onClick` if it exists.\n *\n * @param {string|EventTarget~Event|Object} event\n * The name of the event, an `Event`, or an object with a key of type set to\n * an event name.\n */\n\n\n EventTarget.prototype.trigger = function (event) {\n var type = event.type || event; // deprecation\n // In a future version we should default target to `this`\n // similar to how we default the target to `elem` in\n // `Events.trigger`. Right now the default `target` will be\n // `document` due to the `Event.fixEvent` call.\n\n if (typeof event === 'string') {\n event = {\n type: type\n };\n }\n\n event = fixEvent(event);\n\n if (this.allowedEvents_[type] && this['on' + type]) {\n this['on' + type](event);\n }\n\n trigger(this, event);\n };\n /**\n * An alias of {@link EventTarget#trigger}. Allows `EventTarget` to mimic\n * the standard DOM API.\n *\n * @function\n * @see {@link EventTarget#trigger}\n */\n\n\n EventTarget.prototype.dispatchEvent = EventTarget.prototype.trigger;\n var EVENT_MAP;\n\n EventTarget.prototype.queueTrigger = function (event) {\n var _this = this;\n\n // only set up EVENT_MAP if it'll be used\n if (!EVENT_MAP) {\n EVENT_MAP = new Map();\n }\n\n var type = event.type || event;\n var map = EVENT_MAP.get(this);\n\n if (!map) {\n map = new Map();\n EVENT_MAP.set(this, map);\n }\n\n var oldTimeout = map.get(type);\n map[\"delete\"](type);\n window$3.clearTimeout(oldTimeout);\n var timeout = window$3.setTimeout(function () {\n // if we cleared out all timeouts for the current target, delete its map\n if (map.size === 0) {\n map = null;\n EVENT_MAP[\"delete\"](_this);\n }\n\n _this.trigger(event);\n }, 0);\n map.set(type, timeout);\n };\n\n /**\n * @file mixins/evented.js\n * @module evented\n */\n /**\n * Returns whether or not an object has had the evented mixin applied.\n *\n * @param {Object} object\n * An object to test.\n *\n * @return {boolean}\n * Whether or not the object appears to be evented.\n */\n\n var isEvented = function isEvented(object) {\n return object instanceof EventTarget || !!object.eventBusEl_ && ['on', 'one', 'off', 'trigger'].every(function (k) {\n return typeof object[k] === 'function';\n });\n };\n /**\n * Adds a callback to run after the evented mixin applied.\n *\n * @param {Object} object\n * An object to Add\n * @param {Function} callback\n * The callback to run.\n */\n\n\n var addEventedCallback = function addEventedCallback(target, callback) {\n if (isEvented(target)) {\n callback();\n } else {\n if (!target.eventedCallbacks) {\n target.eventedCallbacks = [];\n }\n\n target.eventedCallbacks.push(callback);\n }\n };\n /**\n * Whether a value is a valid event type - non-empty string or array.\n *\n * @private\n * @param {string|Array} type\n * The type value to test.\n *\n * @return {boolean}\n * Whether or not the type is a valid event type.\n */\n\n\n var isValidEventType = function isValidEventType(type) {\n return (// The regex here verifies that the `type` contains at least one non-\n // whitespace character.\n typeof type === 'string' && /\\S/.test(type) || Array.isArray(type) && !!type.length\n );\n };\n /**\n * Validates a value to determine if it is a valid event target. Throws if not.\n *\n * @private\n * @throws {Error}\n * If the target does not appear to be a valid event target.\n *\n * @param {Object} target\n * The object to test.\n */\n\n\n var validateTarget = function validateTarget(target) {\n if (!target.nodeName && !isEvented(target)) {\n throw new Error('Invalid target; must be a DOM node or evented object.');\n }\n };\n /**\n * Validates a value to determine if it is a valid event target. Throws if not.\n *\n * @private\n * @throws {Error}\n * If the type does not appear to be a valid event type.\n *\n * @param {string|Array} type\n * The type to test.\n */\n\n\n var validateEventType = function validateEventType(type) {\n if (!isValidEventType(type)) {\n throw new Error('Invalid event type; must be a non-empty string or array.');\n }\n };\n /**\n * Validates a value to determine if it is a valid listener. Throws if not.\n *\n * @private\n * @throws {Error}\n * If the listener is not a function.\n *\n * @param {Function} listener\n * The listener to test.\n */\n\n\n var validateListener = function validateListener(listener) {\n if (typeof listener !== 'function') {\n throw new Error('Invalid listener; must be a function.');\n }\n };\n /**\n * Takes an array of arguments given to `on()` or `one()`, validates them, and\n * normalizes them into an object.\n *\n * @private\n * @param {Object} self\n * The evented object on which `on()` or `one()` was called. This\n * object will be bound as the `this` value for the listener.\n *\n * @param {Array} args\n * An array of arguments passed to `on()` or `one()`.\n *\n * @return {Object}\n * An object containing useful values for `on()` or `one()` calls.\n */\n\n\n var normalizeListenArgs = function normalizeListenArgs(self, args) {\n // If the number of arguments is less than 3, the target is always the\n // evented object itself.\n var isTargetingSelf = args.length < 3 || args[0] === self || args[0] === self.eventBusEl_;\n var target;\n var type;\n var listener;\n\n if (isTargetingSelf) {\n target = self.eventBusEl_; // Deal with cases where we got 3 arguments, but we are still listening to\n // the evented object itself.\n\n if (args.length >= 3) {\n args.shift();\n }\n\n type = args[0];\n listener = args[1];\n } else {\n target = args[0];\n type = args[1];\n listener = args[2];\n }\n\n validateTarget(target);\n validateEventType(type);\n validateListener(listener);\n listener = bind(self, listener);\n return {\n isTargetingSelf: isTargetingSelf,\n target: target,\n type: type,\n listener: listener\n };\n };\n /**\n * Adds the listener to the event type(s) on the target, normalizing for\n * the type of target.\n *\n * @private\n * @param {Element|Object} target\n * A DOM node or evented object.\n *\n * @param {string} method\n * The event binding method to use (\"on\" or \"one\").\n *\n * @param {string|Array} type\n * One or more event type(s).\n *\n * @param {Function} listener\n * A listener function.\n */\n\n\n var listen = function listen(target, method, type, listener) {\n validateTarget(target);\n\n if (target.nodeName) {\n Events[method](target, type, listener);\n } else {\n target[method](type, listener);\n }\n };\n /**\n * Contains methods that provide event capabilities to an object which is passed\n * to {@link module:evented|evented}.\n *\n * @mixin EventedMixin\n */\n\n\n var EventedMixin = {\n /**\n * Add a listener to an event (or events) on this object or another evented\n * object.\n *\n * @param {string|Array|Element|Object} targetOrType\n * If this is a string or array, it represents the event type(s)\n * that will trigger the listener.\n *\n * Another evented object can be passed here instead, which will\n * cause the listener to listen for events on _that_ object.\n *\n * In either case, the listener's `this` value will be bound to\n * this object.\n *\n * @param {string|Array|Function} typeOrListener\n * If the first argument was a string or array, this should be the\n * listener function. Otherwise, this is a string or array of event\n * type(s).\n *\n * @param {Function} [listener]\n * If the first argument was another evented object, this will be\n * the listener function.\n */\n on: function on() {\n var _this = this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var _normalizeListenArgs = normalizeListenArgs(this, args),\n isTargetingSelf = _normalizeListenArgs.isTargetingSelf,\n target = _normalizeListenArgs.target,\n type = _normalizeListenArgs.type,\n listener = _normalizeListenArgs.listener;\n\n listen(target, 'on', type, listener); // If this object is listening to another evented object.\n\n if (!isTargetingSelf) {\n // If this object is disposed, remove the listener.\n var removeListenerOnDispose = function removeListenerOnDispose() {\n return _this.off(target, type, listener);\n }; // Use the same function ID as the listener so we can remove it later it\n // using the ID of the original listener.\n\n\n removeListenerOnDispose.guid = listener.guid; // Add a listener to the target's dispose event as well. This ensures\n // that if the target is disposed BEFORE this object, we remove the\n // removal listener that was just added. Otherwise, we create a memory leak.\n\n var removeRemoverOnTargetDispose = function removeRemoverOnTargetDispose() {\n return _this.off('dispose', removeListenerOnDispose);\n }; // Use the same function ID as the listener so we can remove it later\n // it using the ID of the original listener.\n\n\n removeRemoverOnTargetDispose.guid = listener.guid;\n listen(this, 'on', 'dispose', removeListenerOnDispose);\n listen(target, 'on', 'dispose', removeRemoverOnTargetDispose);\n }\n },\n\n /**\n * Add a listener to an event (or events) on this object or another evented\n * object. The listener will be called once per event and then removed.\n *\n * @param {string|Array|Element|Object} targetOrType\n * If this is a string or array, it represents the event type(s)\n * that will trigger the listener.\n *\n * Another evented object can be passed here instead, which will\n * cause the listener to listen for events on _that_ object.\n *\n * In either case, the listener's `this` value will be bound to\n * this object.\n *\n * @param {string|Array|Function} typeOrListener\n * If the first argument was a string or array, this should be the\n * listener function. Otherwise, this is a string or array of event\n * type(s).\n *\n * @param {Function} [listener]\n * If the first argument was another evented object, this will be\n * the listener function.\n */\n one: function one() {\n var _this2 = this;\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n var _normalizeListenArgs2 = normalizeListenArgs(this, args),\n isTargetingSelf = _normalizeListenArgs2.isTargetingSelf,\n target = _normalizeListenArgs2.target,\n type = _normalizeListenArgs2.type,\n listener = _normalizeListenArgs2.listener; // Targeting this evented object.\n\n\n if (isTargetingSelf) {\n listen(target, 'one', type, listener); // Targeting another evented object.\n } else {\n // TODO: This wrapper is incorrect! It should only\n // remove the wrapper for the event type that called it.\n // Instead all listners are removed on the first trigger!\n // see https://github.com/videojs/video.js/issues/5962\n var wrapper = function wrapper() {\n _this2.off(target, type, wrapper);\n\n for (var _len3 = arguments.length, largs = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n largs[_key3] = arguments[_key3];\n }\n\n listener.apply(null, largs);\n }; // Use the same function ID as the listener so we can remove it later\n // it using the ID of the original listener.\n\n\n wrapper.guid = listener.guid;\n listen(target, 'one', type, wrapper);\n }\n },\n\n /**\n * Add a listener to an event (or events) on this object or another evented\n * object. The listener will only be called once for the first event that is triggered\n * then removed.\n *\n * @param {string|Array|Element|Object} targetOrType\n * If this is a string or array, it represents the event type(s)\n * that will trigger the listener.\n *\n * Another evented object can be passed here instead, which will\n * cause the listener to listen for events on _that_ object.\n *\n * In either case, the listener's `this` value will be bound to\n * this object.\n *\n * @param {string|Array|Function} typeOrListener\n * If the first argument was a string or array, this should be the\n * listener function. Otherwise, this is a string or array of event\n * type(s).\n *\n * @param {Function} [listener]\n * If the first argument was another evented object, this will be\n * the listener function.\n */\n any: function any() {\n var _this3 = this;\n\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n\n var _normalizeListenArgs3 = normalizeListenArgs(this, args),\n isTargetingSelf = _normalizeListenArgs3.isTargetingSelf,\n target = _normalizeListenArgs3.target,\n type = _normalizeListenArgs3.type,\n listener = _normalizeListenArgs3.listener; // Targeting this evented object.\n\n\n if (isTargetingSelf) {\n listen(target, 'any', type, listener); // Targeting another evented object.\n } else {\n var wrapper = function wrapper() {\n _this3.off(target, type, wrapper);\n\n for (var _len5 = arguments.length, largs = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n largs[_key5] = arguments[_key5];\n }\n\n listener.apply(null, largs);\n }; // Use the same function ID as the listener so we can remove it later\n // it using the ID of the original listener.\n\n\n wrapper.guid = listener.guid;\n listen(target, 'any', type, wrapper);\n }\n },\n\n /**\n * Removes listener(s) from event(s) on an evented object.\n *\n * @param {string|Array|Element|Object} [targetOrType]\n * If this is a string or array, it represents the event type(s).\n *\n * Another evented object can be passed here instead, in which case\n * ALL 3 arguments are _required_.\n *\n * @param {string|Array|Function} [typeOrListener]\n * If the first argument was a string or array, this may be the\n * listener function. Otherwise, this is a string or array of event\n * type(s).\n *\n * @param {Function} [listener]\n * If the first argument was another evented object, this will be\n * the listener function; otherwise, _all_ listeners bound to the\n * event type(s) will be removed.\n */\n off: function off$1(targetOrType, typeOrListener, listener) {\n // Targeting this evented object.\n if (!targetOrType || isValidEventType(targetOrType)) {\n off(this.eventBusEl_, targetOrType, typeOrListener); // Targeting another evented object.\n } else {\n var target = targetOrType;\n var type = typeOrListener; // Fail fast and in a meaningful way!\n\n validateTarget(target);\n validateEventType(type);\n validateListener(listener); // Ensure there's at least a guid, even if the function hasn't been used\n\n listener = bind(this, listener); // Remove the dispose listener on this evented object, which was given\n // the same guid as the event listener in on().\n\n this.off('dispose', listener);\n\n if (target.nodeName) {\n off(target, type, listener);\n off(target, 'dispose', listener);\n } else if (isEvented(target)) {\n target.off(type, listener);\n target.off('dispose', listener);\n }\n }\n },\n\n /**\n * Fire an event on this evented object, causing its listeners to be called.\n *\n * @param {string|Object} event\n * An event type or an object with a type property.\n *\n * @param {Object} [hash]\n * An additional object to pass along to listeners.\n *\n * @return {boolean}\n * Whether or not the default behavior was prevented.\n */\n trigger: function trigger$1(event, hash) {\n return trigger(this.eventBusEl_, event, hash);\n }\n };\n /**\n * Applies {@link module:evented~EventedMixin|EventedMixin} to a target object.\n *\n * @param {Object} target\n * The object to which to add event methods.\n *\n * @param {Object} [options={}]\n * Options for customizing the mixin behavior.\n *\n * @param {string} [options.eventBusKey]\n * By default, adds a `eventBusEl_` DOM element to the target object,\n * which is used as an event bus. If the target object already has a\n * DOM element that should be used, pass its key here.\n *\n * @return {Object}\n * The target object.\n */\n\n function evented(target, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n eventBusKey = _options.eventBusKey; // Set or create the eventBusEl_.\n\n if (eventBusKey) {\n if (!target[eventBusKey].nodeName) {\n throw new Error(\"The eventBusKey \\\"\" + eventBusKey + \"\\\" does not refer to an element.\");\n }\n\n target.eventBusEl_ = target[eventBusKey];\n } else {\n target.eventBusEl_ = createEl('span', {\n className: 'vjs-event-bus'\n });\n }\n\n assign(target, EventedMixin);\n\n if (target.eventedCallbacks) {\n target.eventedCallbacks.forEach(function (callback) {\n callback();\n });\n } // When any evented object is disposed, it removes all its listeners.\n\n\n target.on('dispose', function () {\n target.off();\n window$3.setTimeout(function () {\n target.eventBusEl_ = null;\n }, 0);\n });\n return target;\n }\n\n /**\n * @file mixins/stateful.js\n * @module stateful\n */\n /**\n * Contains methods that provide statefulness to an object which is passed\n * to {@link module:stateful}.\n *\n * @mixin StatefulMixin\n */\n\n var StatefulMixin = {\n /**\n * A hash containing arbitrary keys and values representing the state of\n * the object.\n *\n * @type {Object}\n */\n state: {},\n\n /**\n * Set the state of an object by mutating its\n * {@link module:stateful~StatefulMixin.state|state} object in place.\n *\n * @fires module:stateful~StatefulMixin#statechanged\n * @param {Object|Function} stateUpdates\n * A new set of properties to shallow-merge into the plugin state.\n * Can be a plain object or a function returning a plain object.\n *\n * @return {Object|undefined}\n * An object containing changes that occurred. If no changes\n * occurred, returns `undefined`.\n */\n setState: function setState(stateUpdates) {\n var _this = this;\n\n // Support providing the `stateUpdates` state as a function.\n if (typeof stateUpdates === 'function') {\n stateUpdates = stateUpdates();\n }\n\n var changes;\n each(stateUpdates, function (value, key) {\n // Record the change if the value is different from what's in the\n // current state.\n if (_this.state[key] !== value) {\n changes = changes || {};\n changes[key] = {\n from: _this.state[key],\n to: value\n };\n }\n\n _this.state[key] = value;\n }); // Only trigger \"statechange\" if there were changes AND we have a trigger\n // function. This allows us to not require that the target object be an\n // evented object.\n\n if (changes && isEvented(this)) {\n /**\n * An event triggered on an object that is both\n * {@link module:stateful|stateful} and {@link module:evented|evented}\n * indicating that its state has changed.\n *\n * @event module:stateful~StatefulMixin#statechanged\n * @type {Object}\n * @property {Object} changes\n * A hash containing the properties that were changed and\n * the values they were changed `from` and `to`.\n */\n this.trigger({\n changes: changes,\n type: 'statechanged'\n });\n }\n\n return changes;\n }\n };\n /**\n * Applies {@link module:stateful~StatefulMixin|StatefulMixin} to a target\n * object.\n *\n * If the target object is {@link module:evented|evented} and has a\n * `handleStateChanged` method, that method will be automatically bound to the\n * `statechanged` event on itself.\n *\n * @param {Object} target\n * The object to be made stateful.\n *\n * @param {Object} [defaultState]\n * A default set of properties to populate the newly-stateful object's\n * `state` property.\n *\n * @return {Object}\n * Returns the `target`.\n */\n\n function stateful(target, defaultState) {\n assign(target, StatefulMixin); // This happens after the mixing-in because we need to replace the `state`\n // added in that step.\n\n target.state = assign({}, target.state, defaultState); // Auto-bind the `handleStateChanged` method of the target object if it exists.\n\n if (typeof target.handleStateChanged === 'function' && isEvented(target)) {\n target.on('statechanged', target.handleStateChanged);\n }\n\n return target;\n }\n\n /**\n * @file string-cases.js\n * @module to-lower-case\n */\n\n /**\n * Lowercase the first letter of a string.\n *\n * @param {string} string\n * String to be lowercased\n *\n * @return {string}\n * The string with a lowercased first letter\n */\n var toLowerCase = function toLowerCase(string) {\n if (typeof string !== 'string') {\n return string;\n }\n\n return string.replace(/./, function (w) {\n return w.toLowerCase();\n });\n };\n /**\n * Uppercase the first letter of a string.\n *\n * @param {string} string\n * String to be uppercased\n *\n * @return {string}\n * The string with an uppercased first letter\n */\n\n var toTitleCase = function toTitleCase(string) {\n if (typeof string !== 'string') {\n return string;\n }\n\n return string.replace(/./, function (w) {\n return w.toUpperCase();\n });\n };\n /**\n * Compares the TitleCase versions of the two strings for equality.\n *\n * @param {string} str1\n * The first string to compare\n *\n * @param {string} str2\n * The second string to compare\n *\n * @return {boolean}\n * Whether the TitleCase versions of the strings are equal\n */\n\n var titleCaseEquals = function titleCaseEquals(str1, str2) {\n return toTitleCase(str1) === toTitleCase(str2);\n };\n\n /**\n * @file merge-options.js\n * @module merge-options\n */\n /**\n * Merge two objects recursively.\n *\n * Performs a deep merge like\n * {@link https://lodash.com/docs/4.17.10#merge|lodash.merge}, but only merges\n * plain objects (not arrays, elements, or anything else).\n *\n * Non-plain object values will be copied directly from the right-most\n * argument.\n *\n * @static\n * @param {Object[]} sources\n * One or more objects to merge into a new object.\n *\n * @return {Object}\n * A new object that is the merged result of all sources.\n */\n\n function mergeOptions() {\n var result = {};\n\n for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) {\n sources[_key] = arguments[_key];\n }\n\n sources.forEach(function (source) {\n if (!source) {\n return;\n }\n\n each(source, function (value, key) {\n if (!isPlain(value)) {\n result[key] = value;\n return;\n }\n\n if (!isPlain(result[key])) {\n result[key] = {};\n }\n\n result[key] = mergeOptions(result[key], value);\n });\n });\n return result;\n }\n\n /**\n * Player Component - Base class for all UI objects\n *\n * @file component.js\n */\n /**\n * Base class for all UI Components.\n * Components are UI objects which represent both a javascript object and an element\n * in the DOM. They can be children of other components, and can have\n * children themselves.\n *\n * Components can also use methods from {@link EventTarget}\n */\n\n var Component = /*#__PURE__*/function () {\n /**\n * A callback that is called when a component is ready. Does not have any\n * paramters and any callback value will be ignored.\n *\n * @callback Component~ReadyCallback\n * @this Component\n */\n\n /**\n * Creates an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Object[]} [options.children]\n * An array of children objects to intialize this component with. Children objects have\n * a name property that will be used if more than one component of the same type needs to be\n * added.\n *\n * @param {Component~ReadyCallback} [ready]\n * Function that gets called when the `Component` is ready.\n */\n function Component(player, options, ready) {\n // The component might be the player itself and we can't pass `this` to super\n if (!player && this.play) {\n this.player_ = player = this; // eslint-disable-line\n } else {\n this.player_ = player;\n }\n\n this.isDisposed_ = false; // Hold the reference to the parent component via `addChild` method\n\n this.parentComponent_ = null; // Make a copy of prototype.options_ to protect against overriding defaults\n\n this.options_ = mergeOptions({}, this.options_); // Updated options with supplied options\n\n options = this.options_ = mergeOptions(this.options_, options); // Get ID from options or options element if one is supplied\n\n this.id_ = options.id || options.el && options.el.id; // If there was no ID from the options, generate one\n\n if (!this.id_) {\n // Don't require the player ID function in the case of mock players\n var id = player && player.id && player.id() || 'no_player';\n this.id_ = id + \"_component_\" + newGUID();\n }\n\n this.name_ = options.name || null; // Create element if one wasn't provided in options\n\n if (options.el) {\n this.el_ = options.el;\n } else if (options.createEl !== false) {\n this.el_ = this.createEl();\n } // if evented is anything except false, we want to mixin in evented\n\n\n if (options.evented !== false) {\n // Make this an evented object and use `el_`, if available, as its event bus\n evented(this, {\n eventBusKey: this.el_ ? 'el_' : null\n });\n }\n\n stateful(this, this.constructor.defaultState);\n this.children_ = [];\n this.childIndex_ = {};\n this.childNameIndex_ = {};\n var SetSham;\n\n if (!window$3.Set) {\n SetSham = /*#__PURE__*/function () {\n function SetSham() {\n this.set_ = {};\n }\n\n var _proto2 = SetSham.prototype;\n\n _proto2.has = function has(key) {\n return key in this.set_;\n };\n\n _proto2[\"delete\"] = function _delete(key) {\n var has = this.has(key);\n delete this.set_[key];\n return has;\n };\n\n _proto2.add = function add(key) {\n this.set_[key] = 1;\n return this;\n };\n\n _proto2.forEach = function forEach(callback, thisArg) {\n for (var key in this.set_) {\n callback.call(thisArg, key, key, this);\n }\n };\n\n return SetSham;\n }();\n }\n\n this.setTimeoutIds_ = window$3.Set ? new Set() : new SetSham();\n this.setIntervalIds_ = window$3.Set ? new Set() : new SetSham();\n this.rafIds_ = window$3.Set ? new Set() : new SetSham();\n this.clearingTimersOnDispose_ = false; // Add any child components in options\n\n if (options.initChildren !== false) {\n this.initChildren();\n }\n\n this.ready(ready); // Don't want to trigger ready here or it will before init is actually\n // finished for all children that run this constructor\n\n if (options.reportTouchActivity !== false) {\n this.enableTouchActivity();\n }\n }\n /**\n * Dispose of the `Component` and all child components.\n *\n * @fires Component#dispose\n */\n\n\n var _proto = Component.prototype;\n\n _proto.dispose = function dispose() {\n // Bail out if the component has already been disposed.\n if (this.isDisposed_) {\n return;\n }\n /**\n * Triggered when a `Component` is disposed.\n *\n * @event Component#dispose\n * @type {EventTarget~Event}\n *\n * @property {boolean} [bubbles=false]\n * set to false so that the dispose event does not\n * bubble up\n */\n\n\n this.trigger({\n type: 'dispose',\n bubbles: false\n });\n this.isDisposed_ = true; // Dispose all children.\n\n if (this.children_) {\n for (var i = this.children_.length - 1; i >= 0; i--) {\n if (this.children_[i].dispose) {\n this.children_[i].dispose();\n }\n }\n } // Delete child references\n\n\n this.children_ = null;\n this.childIndex_ = null;\n this.childNameIndex_ = null;\n this.parentComponent_ = null;\n\n if (this.el_) {\n // Remove element from DOM\n if (this.el_.parentNode) {\n this.el_.parentNode.removeChild(this.el_);\n }\n\n if (DomData.has(this.el_)) {\n DomData[\"delete\"](this.el_);\n }\n\n this.el_ = null;\n } // remove reference to the player after disposing of the element\n\n\n this.player_ = null;\n }\n /**\n * Determine whether or not this component has been disposed.\n *\n * @return {boolean}\n * If the component has been disposed, will be `true`. Otherwise, `false`.\n */\n ;\n\n _proto.isDisposed = function isDisposed() {\n return Boolean(this.isDisposed_);\n }\n /**\n * Return the {@link Player} that the `Component` has attached to.\n *\n * @return {Player}\n * The player that this `Component` has attached to.\n */\n ;\n\n _proto.player = function player() {\n return this.player_;\n }\n /**\n * Deep merge of options objects with new options.\n * > Note: When both `obj` and `options` contain properties whose values are objects.\n * The two properties get merged using {@link module:mergeOptions}\n *\n * @param {Object} obj\n * The object that contains new options.\n *\n * @return {Object}\n * A new object of `this.options_` and `obj` merged together.\n */\n ;\n\n _proto.options = function options(obj) {\n if (!obj) {\n return this.options_;\n }\n\n this.options_ = mergeOptions(this.options_, obj);\n return this.options_;\n }\n /**\n * Get the `Component`s DOM element\n *\n * @return {Element}\n * The DOM element for this `Component`.\n */\n ;\n\n _proto.el = function el() {\n return this.el_;\n }\n /**\n * Create the `Component`s DOM element.\n *\n * @param {string} [tagName]\n * Element's DOM node type. e.g. 'div'\n *\n * @param {Object} [properties]\n * An object of properties that should be set.\n *\n * @param {Object} [attributes]\n * An object of attributes that should be set.\n *\n * @return {Element}\n * The element that gets created.\n */\n ;\n\n _proto.createEl = function createEl$1(tagName, properties, attributes) {\n return createEl(tagName, properties, attributes);\n }\n /**\n * Localize a string given the string in english.\n *\n * If tokens are provided, it'll try and run a simple token replacement on the provided string.\n * The tokens it looks for look like `{1}` with the index being 1-indexed into the tokens array.\n *\n * If a `defaultValue` is provided, it'll use that over `string`,\n * if a value isn't found in provided language files.\n * This is useful if you want to have a descriptive key for token replacement\n * but have a succinct localized string and not require `en.json` to be included.\n *\n * Currently, it is used for the progress bar timing.\n * ```js\n * {\n * \"progress bar timing: currentTime={1} duration={2}\": \"{1} of {2}\"\n * }\n * ```\n * It is then used like so:\n * ```js\n * this.localize('progress bar timing: currentTime={1} duration{2}',\n * [this.player_.currentTime(), this.player_.duration()],\n * '{1} of {2}');\n * ```\n *\n * Which outputs something like: `01:23 of 24:56`.\n *\n *\n * @param {string} string\n * The string to localize and the key to lookup in the language files.\n * @param {string[]} [tokens]\n * If the current item has token replacements, provide the tokens here.\n * @param {string} [defaultValue]\n * Defaults to `string`. Can be a default value to use for token replacement\n * if the lookup key is needed to be separate.\n *\n * @return {string}\n * The localized string or if no localization exists the english string.\n */\n ;\n\n _proto.localize = function localize(string, tokens, defaultValue) {\n if (defaultValue === void 0) {\n defaultValue = string;\n }\n\n var code = this.player_.language && this.player_.language();\n var languages = this.player_.languages && this.player_.languages();\n var language = languages && languages[code];\n var primaryCode = code && code.split('-')[0];\n var primaryLang = languages && languages[primaryCode];\n var localizedString = defaultValue;\n\n if (language && language[string]) {\n localizedString = language[string];\n } else if (primaryLang && primaryLang[string]) {\n localizedString = primaryLang[string];\n }\n\n if (tokens) {\n localizedString = localizedString.replace(/\\{(\\d+)\\}/g, function (match, index) {\n var value = tokens[index - 1];\n var ret = value;\n\n if (typeof value === 'undefined') {\n ret = match;\n }\n\n return ret;\n });\n }\n\n return localizedString;\n }\n /**\n * Return the `Component`s DOM element. This is where children get inserted.\n * This will usually be the the same as the element returned in {@link Component#el}.\n *\n * @return {Element}\n * The content element for this `Component`.\n */\n ;\n\n _proto.contentEl = function contentEl() {\n return this.contentEl_ || this.el_;\n }\n /**\n * Get this `Component`s ID\n *\n * @return {string}\n * The id of this `Component`\n */\n ;\n\n _proto.id = function id() {\n return this.id_;\n }\n /**\n * Get the `Component`s name. The name gets used to reference the `Component`\n * and is set during registration.\n *\n * @return {string}\n * The name of this `Component`.\n */\n ;\n\n _proto.name = function name() {\n return this.name_;\n }\n /**\n * Get an array of all child components\n *\n * @return {Array}\n * The children\n */\n ;\n\n _proto.children = function children() {\n return this.children_;\n }\n /**\n * Returns the child `Component` with the given `id`.\n *\n * @param {string} id\n * The id of the child `Component` to get.\n *\n * @return {Component|undefined}\n * The child `Component` with the given `id` or undefined.\n */\n ;\n\n _proto.getChildById = function getChildById(id) {\n return this.childIndex_[id];\n }\n /**\n * Returns the child `Component` with the given `name`.\n *\n * @param {string} name\n * The name of the child `Component` to get.\n *\n * @return {Component|undefined}\n * The child `Component` with the given `name` or undefined.\n */\n ;\n\n _proto.getChild = function getChild(name) {\n if (!name) {\n return;\n }\n\n return this.childNameIndex_[name];\n }\n /**\n * Add a child `Component` inside the current `Component`.\n *\n *\n * @param {string|Component} child\n * The name or instance of a child to add.\n *\n * @param {Object} [options={}]\n * The key/value store of options that will get passed to children of\n * the child.\n *\n * @param {number} [index=this.children_.length]\n * The index to attempt to add a child into.\n *\n * @return {Component}\n * The `Component` that gets added as a child. When using a string the\n * `Component` will get created by this process.\n */\n ;\n\n _proto.addChild = function addChild(child, options, index) {\n if (options === void 0) {\n options = {};\n }\n\n if (index === void 0) {\n index = this.children_.length;\n }\n\n var component;\n var componentName; // If child is a string, create component with options\n\n if (typeof child === 'string') {\n componentName = toTitleCase(child);\n var componentClassName = options.componentClass || componentName; // Set name through options\n\n options.name = componentName; // Create a new object & element for this controls set\n // If there's no .player_, this is a player\n\n var ComponentClass = Component.getComponent(componentClassName);\n\n if (!ComponentClass) {\n throw new Error(\"Component \" + componentClassName + \" does not exist\");\n } // data stored directly on the videojs object may be\n // misidentified as a component to retain\n // backwards-compatibility with 4.x. check to make sure the\n // component class can be instantiated.\n\n\n if (typeof ComponentClass !== 'function') {\n return null;\n }\n\n component = new ComponentClass(this.player_ || this, options); // child is a component instance\n } else {\n component = child;\n }\n\n if (component.parentComponent_) {\n component.parentComponent_.removeChild(component);\n }\n\n this.children_.splice(index, 0, component);\n component.parentComponent_ = this;\n\n if (typeof component.id === 'function') {\n this.childIndex_[component.id()] = component;\n } // If a name wasn't used to create the component, check if we can use the\n // name function of the component\n\n\n componentName = componentName || component.name && toTitleCase(component.name());\n\n if (componentName) {\n this.childNameIndex_[componentName] = component;\n this.childNameIndex_[toLowerCase(componentName)] = component;\n } // Add the UI object's element to the container div (box)\n // Having an element is not required\n\n\n if (typeof component.el === 'function' && component.el()) {\n // If inserting before a component, insert before that component's element\n var refNode = null;\n\n if (this.children_[index + 1] && this.children_[index + 1].el_) {\n refNode = this.children_[index + 1].el_;\n }\n\n this.contentEl().insertBefore(component.el(), refNode);\n } // Return so it can stored on parent object if desired.\n\n\n return component;\n }\n /**\n * Remove a child `Component` from this `Component`s list of children. Also removes\n * the child `Component`s element from this `Component`s element.\n *\n * @param {Component} component\n * The child `Component` to remove.\n */\n ;\n\n _proto.removeChild = function removeChild(component) {\n if (typeof component === 'string') {\n component = this.getChild(component);\n }\n\n if (!component || !this.children_) {\n return;\n }\n\n var childFound = false;\n\n for (var i = this.children_.length - 1; i >= 0; i--) {\n if (this.children_[i] === component) {\n childFound = true;\n this.children_.splice(i, 1);\n break;\n }\n }\n\n if (!childFound) {\n return;\n }\n\n component.parentComponent_ = null;\n this.childIndex_[component.id()] = null;\n this.childNameIndex_[toTitleCase(component.name())] = null;\n this.childNameIndex_[toLowerCase(component.name())] = null;\n var compEl = component.el();\n\n if (compEl && compEl.parentNode === this.contentEl()) {\n this.contentEl().removeChild(component.el());\n }\n }\n /**\n * Add and initialize default child `Component`s based upon options.\n */\n ;\n\n _proto.initChildren = function initChildren() {\n var _this = this;\n\n var children = this.options_.children;\n\n if (children) {\n // `this` is `parent`\n var parentOptions = this.options_;\n\n var handleAdd = function handleAdd(child) {\n var name = child.name;\n var opts = child.opts; // Allow options for children to be set at the parent options\n // e.g. videojs(id, { controlBar: false });\n // instead of videojs(id, { children: { controlBar: false });\n\n if (parentOptions[name] !== undefined) {\n opts = parentOptions[name];\n } // Allow for disabling default components\n // e.g. options['children']['posterImage'] = false\n\n\n if (opts === false) {\n return;\n } // Allow options to be passed as a simple boolean if no configuration\n // is necessary.\n\n\n if (opts === true) {\n opts = {};\n } // We also want to pass the original player options\n // to each component as well so they don't need to\n // reach back into the player for options later.\n\n\n opts.playerOptions = _this.options_.playerOptions; // Create and add the child component.\n // Add a direct reference to the child by name on the parent instance.\n // If two of the same component are used, different names should be supplied\n // for each\n\n var newChild = _this.addChild(name, opts);\n\n if (newChild) {\n _this[name] = newChild;\n }\n }; // Allow for an array of children details to passed in the options\n\n\n var workingChildren;\n var Tech = Component.getComponent('Tech');\n\n if (Array.isArray(children)) {\n workingChildren = children;\n } else {\n workingChildren = Object.keys(children);\n }\n\n workingChildren // children that are in this.options_ but also in workingChildren would\n // give us extra children we do not want. So, we want to filter them out.\n .concat(Object.keys(this.options_).filter(function (child) {\n return !workingChildren.some(function (wchild) {\n if (typeof wchild === 'string') {\n return child === wchild;\n }\n\n return child === wchild.name;\n });\n })).map(function (child) {\n var name;\n var opts;\n\n if (typeof child === 'string') {\n name = child;\n opts = children[name] || _this.options_[name] || {};\n } else {\n name = child.name;\n opts = child;\n }\n\n return {\n name: name,\n opts: opts\n };\n }).filter(function (child) {\n // we have to make sure that child.name isn't in the techOrder since\n // techs are registerd as Components but can't aren't compatible\n // See https://github.com/videojs/video.js/issues/2772\n var c = Component.getComponent(child.opts.componentClass || toTitleCase(child.name));\n return c && !Tech.isTech(c);\n }).forEach(handleAdd);\n }\n }\n /**\n * Builds the default DOM class name. Should be overriden by sub-components.\n *\n * @return {string}\n * The DOM class name for this object.\n *\n * @abstract\n */\n ;\n\n _proto.buildCSSClass = function buildCSSClass() {\n // Child classes can include a function that does:\n // return 'CLASS NAME' + this._super();\n return '';\n }\n /**\n * Bind a listener to the component's ready state.\n * Different from event listeners in that if the ready event has already happened\n * it will trigger the function immediately.\n *\n * @return {Component}\n * Returns itself; method can be chained.\n */\n ;\n\n _proto.ready = function ready(fn, sync) {\n if (sync === void 0) {\n sync = false;\n }\n\n if (!fn) {\n return;\n }\n\n if (!this.isReady_) {\n this.readyQueue_ = this.readyQueue_ || [];\n this.readyQueue_.push(fn);\n return;\n }\n\n if (sync) {\n fn.call(this);\n } else {\n // Call the function asynchronously by default for consistency\n this.setTimeout(fn, 1);\n }\n }\n /**\n * Trigger all the ready listeners for this `Component`.\n *\n * @fires Component#ready\n */\n ;\n\n _proto.triggerReady = function triggerReady() {\n this.isReady_ = true; // Ensure ready is triggered asynchronously\n\n this.setTimeout(function () {\n var readyQueue = this.readyQueue_; // Reset Ready Queue\n\n this.readyQueue_ = [];\n\n if (readyQueue && readyQueue.length > 0) {\n readyQueue.forEach(function (fn) {\n fn.call(this);\n }, this);\n } // Allow for using event listeners also\n\n /**\n * Triggered when a `Component` is ready.\n *\n * @event Component#ready\n * @type {EventTarget~Event}\n */\n\n\n this.trigger('ready');\n }, 1);\n }\n /**\n * Find a single DOM element matching a `selector`. This can be within the `Component`s\n * `contentEl()` or another custom context.\n *\n * @param {string} selector\n * A valid CSS selector, which will be passed to `querySelector`.\n *\n * @param {Element|string} [context=this.contentEl()]\n * A DOM element within which to query. Can also be a selector string in\n * which case the first matching element will get used as context. If\n * missing `this.contentEl()` gets used. If `this.contentEl()` returns\n * nothing it falls back to `document`.\n *\n * @return {Element|null}\n * the dom element that was found, or null\n *\n * @see [Information on CSS Selectors](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_Started/Selectors)\n */\n ;\n\n _proto.$ = function $$1(selector, context) {\n return $(selector, context || this.contentEl());\n }\n /**\n * Finds all DOM element matching a `selector`. This can be within the `Component`s\n * `contentEl()` or another custom context.\n *\n * @param {string} selector\n * A valid CSS selector, which will be passed to `querySelectorAll`.\n *\n * @param {Element|string} [context=this.contentEl()]\n * A DOM element within which to query. Can also be a selector string in\n * which case the first matching element will get used as context. If\n * missing `this.contentEl()` gets used. If `this.contentEl()` returns\n * nothing it falls back to `document`.\n *\n * @return {NodeList}\n * a list of dom elements that were found\n *\n * @see [Information on CSS Selectors](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_Started/Selectors)\n */\n ;\n\n _proto.$$ = function $$$1(selector, context) {\n return $$(selector, context || this.contentEl());\n }\n /**\n * Check if a component's element has a CSS class name.\n *\n * @param {string} classToCheck\n * CSS class name to check.\n *\n * @return {boolean}\n * - True if the `Component` has the class.\n * - False if the `Component` does not have the class`\n */\n ;\n\n _proto.hasClass = function hasClass$1(classToCheck) {\n return hasClass(this.el_, classToCheck);\n }\n /**\n * Add a CSS class name to the `Component`s element.\n *\n * @param {string} classToAdd\n * CSS class name to add\n */\n ;\n\n _proto.addClass = function addClass$1(classToAdd) {\n addClass(this.el_, classToAdd);\n }\n /**\n * Remove a CSS class name from the `Component`s element.\n *\n * @param {string} classToRemove\n * CSS class name to remove\n */\n ;\n\n _proto.removeClass = function removeClass$1(classToRemove) {\n removeClass(this.el_, classToRemove);\n }\n /**\n * Add or remove a CSS class name from the component's element.\n * - `classToToggle` gets added when {@link Component#hasClass} would return false.\n * - `classToToggle` gets removed when {@link Component#hasClass} would return true.\n *\n * @param {string} classToToggle\n * The class to add or remove based on (@link Component#hasClass}\n *\n * @param {boolean|Dom~predicate} [predicate]\n * An {@link Dom~predicate} function or a boolean\n */\n ;\n\n _proto.toggleClass = function toggleClass$1(classToToggle, predicate) {\n toggleClass(this.el_, classToToggle, predicate);\n }\n /**\n * Show the `Component`s element if it is hidden by removing the\n * 'vjs-hidden' class name from it.\n */\n ;\n\n _proto.show = function show() {\n this.removeClass('vjs-hidden');\n }\n /**\n * Hide the `Component`s element if it is currently showing by adding the\n * 'vjs-hidden` class name to it.\n */\n ;\n\n _proto.hide = function hide() {\n this.addClass('vjs-hidden');\n }\n /**\n * Lock a `Component`s element in its visible state by adding the 'vjs-lock-showing'\n * class name to it. Used during fadeIn/fadeOut.\n *\n * @private\n */\n ;\n\n _proto.lockShowing = function lockShowing() {\n this.addClass('vjs-lock-showing');\n }\n /**\n * Unlock a `Component`s element from its visible state by removing the 'vjs-lock-showing'\n * class name from it. Used during fadeIn/fadeOut.\n *\n * @private\n */\n ;\n\n _proto.unlockShowing = function unlockShowing() {\n this.removeClass('vjs-lock-showing');\n }\n /**\n * Get the value of an attribute on the `Component`s element.\n *\n * @param {string} attribute\n * Name of the attribute to get the value from.\n *\n * @return {string|null}\n * - The value of the attribute that was asked for.\n * - Can be an empty string on some browsers if the attribute does not exist\n * or has no value\n * - Most browsers will return null if the attibute does not exist or has\n * no value.\n *\n * @see [DOM API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttribute}\n */\n ;\n\n _proto.getAttribute = function getAttribute$1(attribute) {\n return getAttribute(this.el_, attribute);\n }\n /**\n * Set the value of an attribute on the `Component`'s element\n *\n * @param {string} attribute\n * Name of the attribute to set.\n *\n * @param {string} value\n * Value to set the attribute to.\n *\n * @see [DOM API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute}\n */\n ;\n\n _proto.setAttribute = function setAttribute$1(attribute, value) {\n setAttribute(this.el_, attribute, value);\n }\n /**\n * Remove an attribute from the `Component`s element.\n *\n * @param {string} attribute\n * Name of the attribute to remove.\n *\n * @see [DOM API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Element/removeAttribute}\n */\n ;\n\n _proto.removeAttribute = function removeAttribute$1(attribute) {\n removeAttribute(this.el_, attribute);\n }\n /**\n * Get or set the width of the component based upon the CSS styles.\n * See {@link Component#dimension} for more detailed information.\n *\n * @param {number|string} [num]\n * The width that you want to set postfixed with '%', 'px' or nothing.\n *\n * @param {boolean} [skipListeners]\n * Skip the componentresize event trigger\n *\n * @return {number|string}\n * The width when getting, zero if there is no width. Can be a string\n * postpixed with '%' or 'px'.\n */\n ;\n\n _proto.width = function width(num, skipListeners) {\n return this.dimension('width', num, skipListeners);\n }\n /**\n * Get or set the height of the component based upon the CSS styles.\n * See {@link Component#dimension} for more detailed information.\n *\n * @param {number|string} [num]\n * The height that you want to set postfixed with '%', 'px' or nothing.\n *\n * @param {boolean} [skipListeners]\n * Skip the componentresize event trigger\n *\n * @return {number|string}\n * The width when getting, zero if there is no width. Can be a string\n * postpixed with '%' or 'px'.\n */\n ;\n\n _proto.height = function height(num, skipListeners) {\n return this.dimension('height', num, skipListeners);\n }\n /**\n * Set both the width and height of the `Component` element at the same time.\n *\n * @param {number|string} width\n * Width to set the `Component`s element to.\n *\n * @param {number|string} height\n * Height to set the `Component`s element to.\n */\n ;\n\n _proto.dimensions = function dimensions(width, height) {\n // Skip componentresize listeners on width for optimization\n this.width(width, true);\n this.height(height);\n }\n /**\n * Get or set width or height of the `Component` element. This is the shared code\n * for the {@link Component#width} and {@link Component#height}.\n *\n * Things to know:\n * - If the width or height in an number this will return the number postfixed with 'px'.\n * - If the width/height is a percent this will return the percent postfixed with '%'\n * - Hidden elements have a width of 0 with `window.getComputedStyle`. This function\n * defaults to the `Component`s `style.width` and falls back to `window.getComputedStyle`.\n * See [this]{@link http://www.foliotek.com/devblog/getting-the-width-of-a-hidden-element-with-jquery-using-width/}\n * for more information\n * - If you want the computed style of the component, use {@link Component#currentWidth}\n * and {@link {Component#currentHeight}\n *\n * @fires Component#componentresize\n *\n * @param {string} widthOrHeight\n 8 'width' or 'height'\n *\n * @param {number|string} [num]\n 8 New dimension\n *\n * @param {boolean} [skipListeners]\n * Skip componentresize event trigger\n *\n * @return {number}\n * The dimension when getting or 0 if unset\n */\n ;\n\n _proto.dimension = function dimension(widthOrHeight, num, skipListeners) {\n if (num !== undefined) {\n // Set to zero if null or literally NaN (NaN !== NaN)\n if (num === null || num !== num) {\n num = 0;\n } // Check if using css width/height (% or px) and adjust\n\n\n if (('' + num).indexOf('%') !== -1 || ('' + num).indexOf('px') !== -1) {\n this.el_.style[widthOrHeight] = num;\n } else if (num === 'auto') {\n this.el_.style[widthOrHeight] = '';\n } else {\n this.el_.style[widthOrHeight] = num + 'px';\n } // skipListeners allows us to avoid triggering the resize event when setting both width and height\n\n\n if (!skipListeners) {\n /**\n * Triggered when a component is resized.\n *\n * @event Component#componentresize\n * @type {EventTarget~Event}\n */\n this.trigger('componentresize');\n }\n\n return;\n } // Not setting a value, so getting it\n // Make sure element exists\n\n\n if (!this.el_) {\n return 0;\n } // Get dimension value from style\n\n\n var val = this.el_.style[widthOrHeight];\n var pxIndex = val.indexOf('px');\n\n if (pxIndex !== -1) {\n // Return the pixel value with no 'px'\n return parseInt(val.slice(0, pxIndex), 10);\n } // No px so using % or no style was set, so falling back to offsetWidth/height\n // If component has display:none, offset will return 0\n // TODO: handle display:none and no dimension style using px\n\n\n return parseInt(this.el_['offset' + toTitleCase(widthOrHeight)], 10);\n }\n /**\n * Get the computed width or the height of the component's element.\n *\n * Uses `window.getComputedStyle`.\n *\n * @param {string} widthOrHeight\n * A string containing 'width' or 'height'. Whichever one you want to get.\n *\n * @return {number}\n * The dimension that gets asked for or 0 if nothing was set\n * for that dimension.\n */\n ;\n\n _proto.currentDimension = function currentDimension(widthOrHeight) {\n var computedWidthOrHeight = 0;\n\n if (widthOrHeight !== 'width' && widthOrHeight !== 'height') {\n throw new Error('currentDimension only accepts width or height value');\n }\n\n computedWidthOrHeight = computedStyle(this.el_, widthOrHeight); // remove 'px' from variable and parse as integer\n\n computedWidthOrHeight = parseFloat(computedWidthOrHeight); // if the computed value is still 0, it's possible that the browser is lying\n // and we want to check the offset values.\n // This code also runs wherever getComputedStyle doesn't exist.\n\n if (computedWidthOrHeight === 0 || isNaN(computedWidthOrHeight)) {\n var rule = \"offset\" + toTitleCase(widthOrHeight);\n computedWidthOrHeight = this.el_[rule];\n }\n\n return computedWidthOrHeight;\n }\n /**\n * An object that contains width and height values of the `Component`s\n * computed style. Uses `window.getComputedStyle`.\n *\n * @typedef {Object} Component~DimensionObject\n *\n * @property {number} width\n * The width of the `Component`s computed style.\n *\n * @property {number} height\n * The height of the `Component`s computed style.\n */\n\n /**\n * Get an object that contains computed width and height values of the\n * component's element.\n *\n * Uses `window.getComputedStyle`.\n *\n * @return {Component~DimensionObject}\n * The computed dimensions of the component's element.\n */\n ;\n\n _proto.currentDimensions = function currentDimensions() {\n return {\n width: this.currentDimension('width'),\n height: this.currentDimension('height')\n };\n }\n /**\n * Get the computed width of the component's element.\n *\n * Uses `window.getComputedStyle`.\n *\n * @return {number}\n * The computed width of the component's element.\n */\n ;\n\n _proto.currentWidth = function currentWidth() {\n return this.currentDimension('width');\n }\n /**\n * Get the computed height of the component's element.\n *\n * Uses `window.getComputedStyle`.\n *\n * @return {number}\n * The computed height of the component's element.\n */\n ;\n\n _proto.currentHeight = function currentHeight() {\n return this.currentDimension('height');\n }\n /**\n * Set the focus to this component\n */\n ;\n\n _proto.focus = function focus() {\n this.el_.focus();\n }\n /**\n * Remove the focus from this component\n */\n ;\n\n _proto.blur = function blur() {\n this.el_.blur();\n }\n /**\n * When this Component receives a `keydown` event which it does not process,\n * it passes the event to the Player for handling.\n *\n * @param {EventTarget~Event} event\n * The `keydown` event that caused this function to be called.\n */\n ;\n\n _proto.handleKeyDown = function handleKeyDown(event) {\n if (this.player_) {\n // We only stop propagation here because we want unhandled events to fall\n // back to the browser.\n event.stopPropagation();\n this.player_.handleKeyDown(event);\n }\n }\n /**\n * Many components used to have a `handleKeyPress` method, which was poorly\n * named because it listened to a `keydown` event. This method name now\n * delegates to `handleKeyDown`. This means anyone calling `handleKeyPress`\n * will not see their method calls stop working.\n *\n * @param {EventTarget~Event} event\n * The event that caused this function to be called.\n */\n ;\n\n _proto.handleKeyPress = function handleKeyPress(event) {\n this.handleKeyDown(event);\n }\n /**\n * Emit a 'tap' events when touch event support gets detected. This gets used to\n * support toggling the controls through a tap on the video. They get enabled\n * because every sub-component would have extra overhead otherwise.\n *\n * @private\n * @fires Component#tap\n * @listens Component#touchstart\n * @listens Component#touchmove\n * @listens Component#touchleave\n * @listens Component#touchcancel\n * @listens Component#touchend\n */\n ;\n\n _proto.emitTapEvents = function emitTapEvents() {\n // Track the start time so we can determine how long the touch lasted\n var touchStart = 0;\n var firstTouch = null; // Maximum movement allowed during a touch event to still be considered a tap\n // Other popular libs use anywhere from 2 (hammer.js) to 15,\n // so 10 seems like a nice, round number.\n\n var tapMovementThreshold = 10; // The maximum length a touch can be while still being considered a tap\n\n var touchTimeThreshold = 200;\n var couldBeTap;\n this.on('touchstart', function (event) {\n // If more than one finger, don't consider treating this as a click\n if (event.touches.length === 1) {\n // Copy pageX/pageY from the object\n firstTouch = {\n pageX: event.touches[0].pageX,\n pageY: event.touches[0].pageY\n }; // Record start time so we can detect a tap vs. \"touch and hold\"\n\n touchStart = window$3.performance.now(); // Reset couldBeTap tracking\n\n couldBeTap = true;\n }\n });\n this.on('touchmove', function (event) {\n // If more than one finger, don't consider treating this as a click\n if (event.touches.length > 1) {\n couldBeTap = false;\n } else if (firstTouch) {\n // Some devices will throw touchmoves for all but the slightest of taps.\n // So, if we moved only a small distance, this could still be a tap\n var xdiff = event.touches[0].pageX - firstTouch.pageX;\n var ydiff = event.touches[0].pageY - firstTouch.pageY;\n var touchDistance = Math.sqrt(xdiff * xdiff + ydiff * ydiff);\n\n if (touchDistance > tapMovementThreshold) {\n couldBeTap = false;\n }\n }\n });\n\n var noTap = function noTap() {\n couldBeTap = false;\n }; // TODO: Listen to the original target. http://youtu.be/DujfpXOKUp8?t=13m8s\n\n\n this.on('touchleave', noTap);\n this.on('touchcancel', noTap); // When the touch ends, measure how long it took and trigger the appropriate\n // event\n\n this.on('touchend', function (event) {\n firstTouch = null; // Proceed only if the touchmove/leave/cancel event didn't happen\n\n if (couldBeTap === true) {\n // Measure how long the touch lasted\n var touchTime = window$3.performance.now() - touchStart; // Make sure the touch was less than the threshold to be considered a tap\n\n if (touchTime < touchTimeThreshold) {\n // Don't let browser turn this into a click\n event.preventDefault();\n /**\n * Triggered when a `Component` is tapped.\n *\n * @event Component#tap\n * @type {EventTarget~Event}\n */\n\n this.trigger('tap'); // It may be good to copy the touchend event object and change the\n // type to tap, if the other event properties aren't exact after\n // Events.fixEvent runs (e.g. event.target)\n }\n }\n });\n }\n /**\n * This function reports user activity whenever touch events happen. This can get\n * turned off by any sub-components that wants touch events to act another way.\n *\n * Report user touch activity when touch events occur. User activity gets used to\n * determine when controls should show/hide. It is simple when it comes to mouse\n * events, because any mouse event should show the controls. So we capture mouse\n * events that bubble up to the player and report activity when that happens.\n * With touch events it isn't as easy as `touchstart` and `touchend` toggle player\n * controls. So touch events can't help us at the player level either.\n *\n * User activity gets checked asynchronously. So what could happen is a tap event\n * on the video turns the controls off. Then the `touchend` event bubbles up to\n * the player. Which, if it reported user activity, would turn the controls right\n * back on. We also don't want to completely block touch events from bubbling up.\n * Furthermore a `touchmove` event and anything other than a tap, should not turn\n * controls back on.\n *\n * @listens Component#touchstart\n * @listens Component#touchmove\n * @listens Component#touchend\n * @listens Component#touchcancel\n */\n ;\n\n _proto.enableTouchActivity = function enableTouchActivity() {\n // Don't continue if the root player doesn't support reporting user activity\n if (!this.player() || !this.player().reportUserActivity) {\n return;\n } // listener for reporting that the user is active\n\n\n var report = bind(this.player(), this.player().reportUserActivity);\n var touchHolding;\n this.on('touchstart', function () {\n report(); // For as long as the they are touching the device or have their mouse down,\n // we consider them active even if they're not moving their finger or mouse.\n // So we want to continue to update that they are active\n\n this.clearInterval(touchHolding); // report at the same interval as activityCheck\n\n touchHolding = this.setInterval(report, 250);\n });\n\n var touchEnd = function touchEnd(event) {\n report(); // stop the interval that maintains activity if the touch is holding\n\n this.clearInterval(touchHolding);\n };\n\n this.on('touchmove', report);\n this.on('touchend', touchEnd);\n this.on('touchcancel', touchEnd);\n }\n /**\n * A callback that has no parameters and is bound into `Component`s context.\n *\n * @callback Component~GenericCallback\n * @this Component\n */\n\n /**\n * Creates a function that runs after an `x` millisecond timeout. This function is a\n * wrapper around `window.setTimeout`. There are a few reasons to use this one\n * instead though:\n * 1. It gets cleared via {@link Component#clearTimeout} when\n * {@link Component#dispose} gets called.\n * 2. The function callback will gets turned into a {@link Component~GenericCallback}\n *\n * > Note: You can't use `window.clearTimeout` on the id returned by this function. This\n * will cause its dispose listener not to get cleaned up! Please use\n * {@link Component#clearTimeout} or {@link Component#dispose} instead.\n *\n * @param {Component~GenericCallback} fn\n * The function that will be run after `timeout`.\n *\n * @param {number} timeout\n * Timeout in milliseconds to delay before executing the specified function.\n *\n * @return {number}\n * Returns a timeout ID that gets used to identify the timeout. It can also\n * get used in {@link Component#clearTimeout} to clear the timeout that\n * was set.\n *\n * @listens Component#dispose\n * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setTimeout}\n */\n ;\n\n _proto.setTimeout = function setTimeout(fn, timeout) {\n var _this2 = this;\n\n // declare as variables so they are properly available in timeout function\n // eslint-disable-next-line\n var timeoutId;\n fn = bind(this, fn);\n this.clearTimersOnDispose_();\n timeoutId = window$3.setTimeout(function () {\n if (_this2.setTimeoutIds_.has(timeoutId)) {\n _this2.setTimeoutIds_[\"delete\"](timeoutId);\n }\n\n fn();\n }, timeout);\n this.setTimeoutIds_.add(timeoutId);\n return timeoutId;\n }\n /**\n * Clears a timeout that gets created via `window.setTimeout` or\n * {@link Component#setTimeout}. If you set a timeout via {@link Component#setTimeout}\n * use this function instead of `window.clearTimout`. If you don't your dispose\n * listener will not get cleaned up until {@link Component#dispose}!\n *\n * @param {number} timeoutId\n * The id of the timeout to clear. The return value of\n * {@link Component#setTimeout} or `window.setTimeout`.\n *\n * @return {number}\n * Returns the timeout id that was cleared.\n *\n * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/clearTimeout}\n */\n ;\n\n _proto.clearTimeout = function clearTimeout(timeoutId) {\n if (this.setTimeoutIds_.has(timeoutId)) {\n this.setTimeoutIds_[\"delete\"](timeoutId);\n window$3.clearTimeout(timeoutId);\n }\n\n return timeoutId;\n }\n /**\n * Creates a function that gets run every `x` milliseconds. This function is a wrapper\n * around `window.setInterval`. There are a few reasons to use this one instead though.\n * 1. It gets cleared via {@link Component#clearInterval} when\n * {@link Component#dispose} gets called.\n * 2. The function callback will be a {@link Component~GenericCallback}\n *\n * @param {Component~GenericCallback} fn\n * The function to run every `x` seconds.\n *\n * @param {number} interval\n * Execute the specified function every `x` milliseconds.\n *\n * @return {number}\n * Returns an id that can be used to identify the interval. It can also be be used in\n * {@link Component#clearInterval} to clear the interval.\n *\n * @listens Component#dispose\n * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setInterval}\n */\n ;\n\n _proto.setInterval = function setInterval(fn, interval) {\n fn = bind(this, fn);\n this.clearTimersOnDispose_();\n var intervalId = window$3.setInterval(fn, interval);\n this.setIntervalIds_.add(intervalId);\n return intervalId;\n }\n /**\n * Clears an interval that gets created via `window.setInterval` or\n * {@link Component#setInterval}. If you set an inteval via {@link Component#setInterval}\n * use this function instead of `window.clearInterval`. If you don't your dispose\n * listener will not get cleaned up until {@link Component#dispose}!\n *\n * @param {number} intervalId\n * The id of the interval to clear. The return value of\n * {@link Component#setInterval} or `window.setInterval`.\n *\n * @return {number}\n * Returns the interval id that was cleared.\n *\n * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/clearInterval}\n */\n ;\n\n _proto.clearInterval = function clearInterval(intervalId) {\n if (this.setIntervalIds_.has(intervalId)) {\n this.setIntervalIds_[\"delete\"](intervalId);\n window$3.clearInterval(intervalId);\n }\n\n return intervalId;\n }\n /**\n * Queues up a callback to be passed to requestAnimationFrame (rAF), but\n * with a few extra bonuses:\n *\n * - Supports browsers that do not support rAF by falling back to\n * {@link Component#setTimeout}.\n *\n * - The callback is turned into a {@link Component~GenericCallback} (i.e.\n * bound to the component).\n *\n * - Automatic cancellation of the rAF callback is handled if the component\n * is disposed before it is called.\n *\n * @param {Component~GenericCallback} fn\n * A function that will be bound to this component and executed just\n * before the browser's next repaint.\n *\n * @return {number}\n * Returns an rAF ID that gets used to identify the timeout. It can\n * also be used in {@link Component#cancelAnimationFrame} to cancel\n * the animation frame callback.\n *\n * @listens Component#dispose\n * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame}\n */\n ;\n\n _proto.requestAnimationFrame = function requestAnimationFrame(fn) {\n var _this3 = this;\n\n // Fall back to using a timer.\n if (!this.supportsRaf_) {\n return this.setTimeout(fn, 1000 / 60);\n }\n\n this.clearTimersOnDispose_(); // declare as variables so they are properly available in rAF function\n // eslint-disable-next-line\n\n var id;\n fn = bind(this, fn);\n id = window$3.requestAnimationFrame(function () {\n if (_this3.rafIds_.has(id)) {\n _this3.rafIds_[\"delete\"](id);\n }\n\n fn();\n });\n this.rafIds_.add(id);\n return id;\n }\n /**\n * Cancels a queued callback passed to {@link Component#requestAnimationFrame}\n * (rAF).\n *\n * If you queue an rAF callback via {@link Component#requestAnimationFrame},\n * use this function instead of `window.cancelAnimationFrame`. If you don't,\n * your dispose listener will not get cleaned up until {@link Component#dispose}!\n *\n * @param {number} id\n * The rAF ID to clear. The return value of {@link Component#requestAnimationFrame}.\n *\n * @return {number}\n * Returns the rAF ID that was cleared.\n *\n * @see [Similar to]{@link https://developer.mozilla.org/en-US/docs/Web/API/window/cancelAnimationFrame}\n */\n ;\n\n _proto.cancelAnimationFrame = function cancelAnimationFrame(id) {\n // Fall back to using a timer.\n if (!this.supportsRaf_) {\n return this.clearTimeout(id);\n }\n\n if (this.rafIds_.has(id)) {\n this.rafIds_[\"delete\"](id);\n window$3.cancelAnimationFrame(id);\n }\n\n return id;\n }\n /**\n * A function to setup `requestAnimationFrame`, `setTimeout`,\n * and `setInterval`, clearing on dispose.\n *\n * > Previously each timer added and removed dispose listeners on it's own.\n * For better performance it was decided to batch them all, and use `Set`s\n * to track outstanding timer ids.\n *\n * @private\n */\n ;\n\n _proto.clearTimersOnDispose_ = function clearTimersOnDispose_() {\n var _this4 = this;\n\n if (this.clearingTimersOnDispose_) {\n return;\n }\n\n this.clearingTimersOnDispose_ = true;\n this.one('dispose', function () {\n [['rafIds_', 'cancelAnimationFrame'], ['setTimeoutIds_', 'clearTimeout'], ['setIntervalIds_', 'clearInterval']].forEach(function (_ref) {\n var idName = _ref[0],\n cancelName = _ref[1];\n\n _this4[idName].forEach(_this4[cancelName], _this4);\n });\n _this4.clearingTimersOnDispose_ = false;\n });\n }\n /**\n * Register a `Component` with `videojs` given the name and the component.\n *\n * > NOTE: {@link Tech}s should not be registered as a `Component`. {@link Tech}s\n * should be registered using {@link Tech.registerTech} or\n * {@link videojs:videojs.registerTech}.\n *\n * > NOTE: This function can also be seen on videojs as\n * {@link videojs:videojs.registerComponent}.\n *\n * @param {string} name\n * The name of the `Component` to register.\n *\n * @param {Component} ComponentToRegister\n * The `Component` class to register.\n *\n * @return {Component}\n * The `Component` that was registered.\n */\n ;\n\n Component.registerComponent = function registerComponent(name, ComponentToRegister) {\n if (typeof name !== 'string' || !name) {\n throw new Error(\"Illegal component name, \\\"\" + name + \"\\\"; must be a non-empty string.\");\n }\n\n var Tech = Component.getComponent('Tech'); // We need to make sure this check is only done if Tech has been registered.\n\n var isTech = Tech && Tech.isTech(ComponentToRegister);\n var isComp = Component === ComponentToRegister || Component.prototype.isPrototypeOf(ComponentToRegister.prototype);\n\n if (isTech || !isComp) {\n var reason;\n\n if (isTech) {\n reason = 'techs must be registered using Tech.registerTech()';\n } else {\n reason = 'must be a Component subclass';\n }\n\n throw new Error(\"Illegal component, \\\"\" + name + \"\\\"; \" + reason + \".\");\n }\n\n name = toTitleCase(name);\n\n if (!Component.components_) {\n Component.components_ = {};\n }\n\n var Player = Component.getComponent('Player');\n\n if (name === 'Player' && Player && Player.players) {\n var players = Player.players;\n var playerNames = Object.keys(players); // If we have players that were disposed, then their name will still be\n // in Players.players. So, we must loop through and verify that the value\n // for each item is not null. This allows registration of the Player component\n // after all players have been disposed or before any were created.\n\n if (players && playerNames.length > 0 && playerNames.map(function (pname) {\n return players[pname];\n }).every(Boolean)) {\n throw new Error('Can not register Player component after player has been created.');\n }\n }\n\n Component.components_[name] = ComponentToRegister;\n Component.components_[toLowerCase(name)] = ComponentToRegister;\n return ComponentToRegister;\n }\n /**\n * Get a `Component` based on the name it was registered with.\n *\n * @param {string} name\n * The Name of the component to get.\n *\n * @return {Component}\n * The `Component` that got registered under the given name.\n *\n * @deprecated In `videojs` 6 this will not return `Component`s that were not\n * registered using {@link Component.registerComponent}. Currently we\n * check the global `videojs` object for a `Component` name and\n * return that if it exists.\n */\n ;\n\n Component.getComponent = function getComponent(name) {\n if (!name || !Component.components_) {\n return;\n }\n\n return Component.components_[name];\n };\n\n return Component;\n }();\n /**\n * Whether or not this component supports `requestAnimationFrame`.\n *\n * This is exposed primarily for testing purposes.\n *\n * @private\n * @type {Boolean}\n */\n\n\n Component.prototype.supportsRaf_ = typeof window$3.requestAnimationFrame === 'function' && typeof window$3.cancelAnimationFrame === 'function';\n Component.registerComponent('Component', Component);\n\n function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n }\n\n var assertThisInitialized = _assertThisInitialized;\n\n var _typeof_1 = createCommonjsModule(function (module) {\n function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n }\n\n module.exports = _typeof;\n });\n\n var getPrototypeOf = createCommonjsModule(function (module) {\n function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n }\n\n module.exports = _getPrototypeOf;\n });\n\n function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n }\n\n var inheritsLoose = _inheritsLoose;\n\n /**\n * @file browser.js\n * @module browser\n */\n var USER_AGENT = window$3.navigator && window$3.navigator.userAgent || '';\n var webkitVersionMap = /AppleWebKit\\/([\\d.]+)/i.exec(USER_AGENT);\n var appleWebkitVersion = webkitVersionMap ? parseFloat(webkitVersionMap.pop()) : null;\n /**\n * Whether or not this device is an iPod.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\n var IS_IPOD = /iPod/i.test(USER_AGENT);\n /**\n * The detected iOS version - or `null`.\n *\n * @static\n * @const\n * @type {string|null}\n */\n\n var IOS_VERSION = function () {\n var match = USER_AGENT.match(/OS (\\d+)_/i);\n\n if (match && match[1]) {\n return match[1];\n }\n\n return null;\n }();\n /**\n * Whether or not this is an Android device.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\n var IS_ANDROID = /Android/i.test(USER_AGENT);\n /**\n * The detected Android version - or `null`.\n *\n * @static\n * @const\n * @type {number|string|null}\n */\n\n var ANDROID_VERSION = function () {\n // This matches Android Major.Minor.Patch versions\n // ANDROID_VERSION is Major.Minor as a Number, if Minor isn't available, then only Major is returned\n var match = USER_AGENT.match(/Android (\\d+)(?:\\.(\\d+))?(?:\\.(\\d+))*/i);\n\n if (!match) {\n return null;\n }\n\n var major = match[1] && parseFloat(match[1]);\n var minor = match[2] && parseFloat(match[2]);\n\n if (major && minor) {\n return parseFloat(match[1] + '.' + match[2]);\n } else if (major) {\n return major;\n }\n\n return null;\n }();\n /**\n * Whether or not this is a native Android browser.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\n var IS_NATIVE_ANDROID = IS_ANDROID && ANDROID_VERSION < 5 && appleWebkitVersion < 537;\n /**\n * Whether or not this is Mozilla Firefox.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\n var IS_FIREFOX = /Firefox/i.test(USER_AGENT);\n /**\n * Whether or not this is Microsoft Edge.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\n var IS_EDGE = /Edg/i.test(USER_AGENT);\n /**\n * Whether or not this is Google Chrome.\n *\n * This will also be `true` for Chrome on iOS, which will have different support\n * as it is actually Safari under the hood.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\n var IS_CHROME = !IS_EDGE && (/Chrome/i.test(USER_AGENT) || /CriOS/i.test(USER_AGENT));\n /**\n * The detected Google Chrome version - or `null`.\n *\n * @static\n * @const\n * @type {number|null}\n */\n\n var CHROME_VERSION = function () {\n var match = USER_AGENT.match(/(Chrome|CriOS)\\/(\\d+)/);\n\n if (match && match[2]) {\n return parseFloat(match[2]);\n }\n\n return null;\n }();\n /**\n * The detected Internet Explorer version - or `null`.\n *\n * @static\n * @const\n * @type {number|null}\n */\n\n var IE_VERSION = function () {\n var result = /MSIE\\s(\\d+)\\.\\d/.exec(USER_AGENT);\n var version = result && parseFloat(result[1]);\n\n if (!version && /Trident\\/7.0/i.test(USER_AGENT) && /rv:11.0/.test(USER_AGENT)) {\n // IE 11 has a different user agent string than other IE versions\n version = 11.0;\n }\n\n return version;\n }();\n /**\n * Whether or not this is desktop Safari.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\n var IS_SAFARI = /Safari/i.test(USER_AGENT) && !IS_CHROME && !IS_ANDROID && !IS_EDGE;\n /**\n * Whether or not this is a Windows machine.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\n var IS_WINDOWS = /Windows/i.test(USER_AGENT);\n /**\n * Whether or not this device is touch-enabled.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\n var TOUCH_ENABLED = isReal() && ('ontouchstart' in window$3 || window$3.navigator.maxTouchPoints || window$3.DocumentTouch && window$3.document instanceof window$3.DocumentTouch);\n /**\n * Whether or not this device is an iPad.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\n var IS_IPAD = /iPad/i.test(USER_AGENT) || IS_SAFARI && TOUCH_ENABLED && !/iPhone/i.test(USER_AGENT);\n /**\n * Whether or not this device is an iPhone.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n // The Facebook app's UIWebView identifies as both an iPhone and iPad, so\n // to identify iPhones, we need to exclude iPads.\n // http://artsy.github.io/blog/2012/10/18/the-perils-of-ios-user-agent-sniffing/\n\n var IS_IPHONE = /iPhone/i.test(USER_AGENT) && !IS_IPAD;\n /**\n * Whether or not this is an iOS device.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\n var IS_IOS = IS_IPHONE || IS_IPAD || IS_IPOD;\n /**\n * Whether or not this is any flavor of Safari - including iOS.\n *\n * @static\n * @const\n * @type {Boolean}\n */\n\n var IS_ANY_SAFARI = (IS_SAFARI || IS_IOS) && !IS_CHROME;\n\n var browser = /*#__PURE__*/Object.freeze({\n IS_IPOD: IS_IPOD,\n IOS_VERSION: IOS_VERSION,\n IS_ANDROID: IS_ANDROID,\n ANDROID_VERSION: ANDROID_VERSION,\n IS_NATIVE_ANDROID: IS_NATIVE_ANDROID,\n IS_FIREFOX: IS_FIREFOX,\n IS_EDGE: IS_EDGE,\n IS_CHROME: IS_CHROME,\n CHROME_VERSION: CHROME_VERSION,\n IE_VERSION: IE_VERSION,\n IS_SAFARI: IS_SAFARI,\n IS_WINDOWS: IS_WINDOWS,\n TOUCH_ENABLED: TOUCH_ENABLED,\n IS_IPAD: IS_IPAD,\n IS_IPHONE: IS_IPHONE,\n IS_IOS: IS_IOS,\n IS_ANY_SAFARI: IS_ANY_SAFARI\n });\n\n /**\n * @file time-ranges.js\n * @module time-ranges\n */\n\n /**\n * Returns the time for the specified index at the start or end\n * of a TimeRange object.\n *\n * @typedef {Function} TimeRangeIndex\n *\n * @param {number} [index=0]\n * The range number to return the time for.\n *\n * @return {number}\n * The time offset at the specified index.\n *\n * @deprecated The index argument must be provided.\n * In the future, leaving it out will throw an error.\n */\n\n /**\n * An object that contains ranges of time.\n *\n * @typedef {Object} TimeRange\n *\n * @property {number} length\n * The number of time ranges represented by this object.\n *\n * @property {module:time-ranges~TimeRangeIndex} start\n * Returns the time offset at which a specified time range begins.\n *\n * @property {module:time-ranges~TimeRangeIndex} end\n * Returns the time offset at which a specified time range ends.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/TimeRanges\n */\n\n /**\n * Check if any of the time ranges are over the maximum index.\n *\n * @private\n * @param {string} fnName\n * The function name to use for logging\n *\n * @param {number} index\n * The index to check\n *\n * @param {number} maxIndex\n * The maximum possible index\n *\n * @throws {Error} if the timeRanges provided are over the maxIndex\n */\n function rangeCheck(fnName, index, maxIndex) {\n if (typeof index !== 'number' || index < 0 || index > maxIndex) {\n throw new Error(\"Failed to execute '\" + fnName + \"' on 'TimeRanges': The index provided (\" + index + \") is non-numeric or out of bounds (0-\" + maxIndex + \").\");\n }\n }\n /**\n * Get the time for the specified index at the start or end\n * of a TimeRange object.\n *\n * @private\n * @param {string} fnName\n * The function name to use for logging\n *\n * @param {string} valueIndex\n * The property that should be used to get the time. should be\n * 'start' or 'end'\n *\n * @param {Array} ranges\n * An array of time ranges\n *\n * @param {Array} [rangeIndex=0]\n * The index to start the search at\n *\n * @return {number}\n * The time that offset at the specified index.\n *\n * @deprecated rangeIndex must be set to a value, in the future this will throw an error.\n * @throws {Error} if rangeIndex is more than the length of ranges\n */\n\n\n function getRange(fnName, valueIndex, ranges, rangeIndex) {\n rangeCheck(fnName, rangeIndex, ranges.length - 1);\n return ranges[rangeIndex][valueIndex];\n }\n /**\n * Create a time range object given ranges of time.\n *\n * @private\n * @param {Array} [ranges]\n * An array of time ranges.\n */\n\n\n function createTimeRangesObj(ranges) {\n if (ranges === undefined || ranges.length === 0) {\n return {\n length: 0,\n start: function start() {\n throw new Error('This TimeRanges object is empty');\n },\n end: function end() {\n throw new Error('This TimeRanges object is empty');\n }\n };\n }\n\n return {\n length: ranges.length,\n start: getRange.bind(null, 'start', 0, ranges),\n end: getRange.bind(null, 'end', 1, ranges)\n };\n }\n /**\n * Create a `TimeRange` object which mimics an\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/TimeRanges|HTML5 TimeRanges instance}.\n *\n * @param {number|Array[]} start\n * The start of a single range (a number) or an array of ranges (an\n * array of arrays of two numbers each).\n *\n * @param {number} end\n * The end of a single range. Cannot be used with the array form of\n * the `start` argument.\n */\n\n\n function createTimeRanges(start, end) {\n if (Array.isArray(start)) {\n return createTimeRangesObj(start);\n } else if (start === undefined || end === undefined) {\n return createTimeRangesObj();\n }\n\n return createTimeRangesObj([[start, end]]);\n }\n\n /**\n * @file buffer.js\n * @module buffer\n */\n /**\n * Compute the percentage of the media that has been buffered.\n *\n * @param {TimeRange} buffered\n * The current `TimeRange` object representing buffered time ranges\n *\n * @param {number} duration\n * Total duration of the media\n *\n * @return {number}\n * Percent buffered of the total duration in decimal form.\n */\n\n function bufferedPercent(buffered, duration) {\n var bufferedDuration = 0;\n var start;\n var end;\n\n if (!duration) {\n return 0;\n }\n\n if (!buffered || !buffered.length) {\n buffered = createTimeRanges(0, 0);\n }\n\n for (var i = 0; i < buffered.length; i++) {\n start = buffered.start(i);\n end = buffered.end(i); // buffered end can be bigger than duration by a very small fraction\n\n if (end > duration) {\n end = duration;\n }\n\n bufferedDuration += end - start;\n }\n\n return bufferedDuration / duration;\n }\n\n /**\n * @file fullscreen-api.js\n * @module fullscreen-api\n * @private\n */\n /**\n * Store the browser-specific methods for the fullscreen API.\n *\n * @type {Object}\n * @see [Specification]{@link https://fullscreen.spec.whatwg.org}\n * @see [Map Approach From Screenfull.js]{@link https://github.com/sindresorhus/screenfull.js}\n */\n\n var FullscreenApi = {\n prefixed: true\n }; // browser API methods\n\n var apiMap = [['requestFullscreen', 'exitFullscreen', 'fullscreenElement', 'fullscreenEnabled', 'fullscreenchange', 'fullscreenerror', 'fullscreen'], // WebKit\n ['webkitRequestFullscreen', 'webkitExitFullscreen', 'webkitFullscreenElement', 'webkitFullscreenEnabled', 'webkitfullscreenchange', 'webkitfullscreenerror', '-webkit-full-screen'], // Mozilla\n ['mozRequestFullScreen', 'mozCancelFullScreen', 'mozFullScreenElement', 'mozFullScreenEnabled', 'mozfullscreenchange', 'mozfullscreenerror', '-moz-full-screen'], // Microsoft\n ['msRequestFullscreen', 'msExitFullscreen', 'msFullscreenElement', 'msFullscreenEnabled', 'MSFullscreenChange', 'MSFullscreenError', '-ms-fullscreen']];\n var specApi = apiMap[0];\n var browserApi; // determine the supported set of functions\n\n for (var i = 0; i < apiMap.length; i++) {\n // check for exitFullscreen function\n if (apiMap[i][1] in document) {\n browserApi = apiMap[i];\n break;\n }\n } // map the browser API names to the spec API names\n\n\n if (browserApi) {\n for (var _i = 0; _i < browserApi.length; _i++) {\n FullscreenApi[specApi[_i]] = browserApi[_i];\n }\n\n FullscreenApi.prefixed = browserApi[0] !== specApi[0];\n }\n\n /**\n * @file media-error.js\n */\n /**\n * A Custom `MediaError` class which mimics the standard HTML5 `MediaError` class.\n *\n * @param {number|string|Object|MediaError} value\n * This can be of multiple types:\n * - number: should be a standard error code\n * - string: an error message (the code will be 0)\n * - Object: arbitrary properties\n * - `MediaError` (native): used to populate a video.js `MediaError` object\n * - `MediaError` (video.js): will return itself if it's already a\n * video.js `MediaError` object.\n *\n * @see [MediaError Spec]{@link https://dev.w3.org/html5/spec-author-view/video.html#mediaerror}\n * @see [Encrypted MediaError Spec]{@link https://www.w3.org/TR/2013/WD-encrypted-media-20130510/#error-codes}\n *\n * @class MediaError\n */\n\n function MediaError(value) {\n // Allow redundant calls to this constructor to avoid having `instanceof`\n // checks peppered around the code.\n if (value instanceof MediaError) {\n return value;\n }\n\n if (typeof value === 'number') {\n this.code = value;\n } else if (typeof value === 'string') {\n // default code is zero, so this is a custom error\n this.message = value;\n } else if (isObject(value)) {\n // We assign the `code` property manually because native `MediaError` objects\n // do not expose it as an own/enumerable property of the object.\n if (typeof value.code === 'number') {\n this.code = value.code;\n }\n\n assign(this, value);\n }\n\n if (!this.message) {\n this.message = MediaError.defaultMessages[this.code] || '';\n }\n }\n /**\n * The error code that refers two one of the defined `MediaError` types\n *\n * @type {Number}\n */\n\n\n MediaError.prototype.code = 0;\n /**\n * An optional message that to show with the error. Message is not part of the HTML5\n * video spec but allows for more informative custom errors.\n *\n * @type {String}\n */\n\n MediaError.prototype.message = '';\n /**\n * An optional status code that can be set by plugins to allow even more detail about\n * the error. For example a plugin might provide a specific HTTP status code and an\n * error message for that code. Then when the plugin gets that error this class will\n * know how to display an error message for it. This allows a custom message to show\n * up on the `Player` error overlay.\n *\n * @type {Array}\n */\n\n MediaError.prototype.status = null;\n /**\n * Errors indexed by the W3C standard. The order **CANNOT CHANGE**! See the\n * specification listed under {@link MediaError} for more information.\n *\n * @enum {array}\n * @readonly\n * @property {string} 0 - MEDIA_ERR_CUSTOM\n * @property {string} 1 - MEDIA_ERR_ABORTED\n * @property {string} 2 - MEDIA_ERR_NETWORK\n * @property {string} 3 - MEDIA_ERR_DECODE\n * @property {string} 4 - MEDIA_ERR_SRC_NOT_SUPPORTED\n * @property {string} 5 - MEDIA_ERR_ENCRYPTED\n */\n\n MediaError.errorTypes = ['MEDIA_ERR_CUSTOM', 'MEDIA_ERR_ABORTED', 'MEDIA_ERR_NETWORK', 'MEDIA_ERR_DECODE', 'MEDIA_ERR_SRC_NOT_SUPPORTED', 'MEDIA_ERR_ENCRYPTED'];\n /**\n * The default `MediaError` messages based on the {@link MediaError.errorTypes}.\n *\n * @type {Array}\n * @constant\n */\n\n MediaError.defaultMessages = {\n 1: 'You aborted the media playback',\n 2: 'A network error caused the media download to fail part-way.',\n 3: 'The media playback was aborted due to a corruption problem or because the media used features your browser did not support.',\n 4: 'The media could not be loaded, either because the server or network failed or because the format is not supported.',\n 5: 'The media is encrypted and we do not have the keys to decrypt it.'\n }; // Add types as properties on MediaError\n // e.g. MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED = 4;\n\n for (var errNum = 0; errNum < MediaError.errorTypes.length; errNum++) {\n MediaError[MediaError.errorTypes[errNum]] = errNum; // values should be accessible on both the class and instance\n\n MediaError.prototype[MediaError.errorTypes[errNum]] = errNum;\n } // jsdocs for instance/static members added above\n\n var tuple = SafeParseTuple;\n\n function SafeParseTuple(obj, reviver) {\n var json;\n var error = null;\n\n try {\n json = JSON.parse(obj, reviver);\n } catch (err) {\n error = err;\n }\n\n return [error, json];\n }\n\n /**\n * Returns whether an object is `Promise`-like (i.e. has a `then` method).\n *\n * @param {Object} value\n * An object that may or may not be `Promise`-like.\n *\n * @return {boolean}\n * Whether or not the object is `Promise`-like.\n */\n function isPromise(value) {\n return value !== undefined && value !== null && typeof value.then === 'function';\n }\n /**\n * Silence a Promise-like object.\n *\n * This is useful for avoiding non-harmful, but potentially confusing \"uncaught\n * play promise\" rejection error messages.\n *\n * @param {Object} value\n * An object that may or may not be `Promise`-like.\n */\n\n function silencePromise(value) {\n if (isPromise(value)) {\n value.then(null, function (e) {});\n }\n }\n\n /**\n * @file text-track-list-converter.js Utilities for capturing text track state and\n * re-creating tracks based on a capture.\n *\n * @module text-track-list-converter\n */\n\n /**\n * Examine a single {@link TextTrack} and return a JSON-compatible javascript object that\n * represents the {@link TextTrack}'s state.\n *\n * @param {TextTrack} track\n * The text track to query.\n *\n * @return {Object}\n * A serializable javascript representation of the TextTrack.\n * @private\n */\n var trackToJson_ = function trackToJson_(track) {\n var ret = ['kind', 'label', 'language', 'id', 'inBandMetadataTrackDispatchType', 'mode', 'src'].reduce(function (acc, prop, i) {\n if (track[prop]) {\n acc[prop] = track[prop];\n }\n\n return acc;\n }, {\n cues: track.cues && Array.prototype.map.call(track.cues, function (cue) {\n return {\n startTime: cue.startTime,\n endTime: cue.endTime,\n text: cue.text,\n id: cue.id\n };\n })\n });\n return ret;\n };\n /**\n * Examine a {@link Tech} and return a JSON-compatible javascript array that represents the\n * state of all {@link TextTrack}s currently configured. The return array is compatible with\n * {@link text-track-list-converter:jsonToTextTracks}.\n *\n * @param {Tech} tech\n * The tech object to query\n *\n * @return {Array}\n * A serializable javascript representation of the {@link Tech}s\n * {@link TextTrackList}.\n */\n\n\n var textTracksToJson = function textTracksToJson(tech) {\n var trackEls = tech.$$('track');\n var trackObjs = Array.prototype.map.call(trackEls, function (t) {\n return t.track;\n });\n var tracks = Array.prototype.map.call(trackEls, function (trackEl) {\n var json = trackToJson_(trackEl.track);\n\n if (trackEl.src) {\n json.src = trackEl.src;\n }\n\n return json;\n });\n return tracks.concat(Array.prototype.filter.call(tech.textTracks(), function (track) {\n return trackObjs.indexOf(track) === -1;\n }).map(trackToJson_));\n };\n /**\n * Create a set of remote {@link TextTrack}s on a {@link Tech} based on an array of javascript\n * object {@link TextTrack} representations.\n *\n * @param {Array} json\n * An array of `TextTrack` representation objects, like those that would be\n * produced by `textTracksToJson`.\n *\n * @param {Tech} tech\n * The `Tech` to create the `TextTrack`s on.\n */\n\n\n var jsonToTextTracks = function jsonToTextTracks(json, tech) {\n json.forEach(function (track) {\n var addedTrack = tech.addRemoteTextTrack(track).track;\n\n if (!track.src && track.cues) {\n track.cues.forEach(function (cue) {\n return addedTrack.addCue(cue);\n });\n }\n });\n return tech.textTracks();\n };\n\n var textTrackConverter = {\n textTracksToJson: textTracksToJson,\n jsonToTextTracks: jsonToTextTracks,\n trackToJson_: trackToJson_\n };\n\n var keycode = createCommonjsModule(function (module, exports) {\n // Source: http://jsfiddle.net/vWx8V/\n // http://stackoverflow.com/questions/5603195/full-list-of-javascript-keycodes\n\n /**\n * Conenience method returns corresponding value for given keyName or keyCode.\n *\n * @param {Mixed} keyCode {Number} or keyName {String}\n * @return {Mixed}\n * @api public\n */\n function keyCode(searchInput) {\n // Keyboard Events\n if (searchInput && 'object' === typeof searchInput) {\n var hasKeyCode = searchInput.which || searchInput.keyCode || searchInput.charCode;\n if (hasKeyCode) searchInput = hasKeyCode;\n } // Numbers\n\n\n if ('number' === typeof searchInput) return names[searchInput]; // Everything else (cast to string)\n\n var search = String(searchInput); // check codes\n\n var foundNamedKey = codes[search.toLowerCase()];\n if (foundNamedKey) return foundNamedKey; // check aliases\n\n var foundNamedKey = aliases[search.toLowerCase()];\n if (foundNamedKey) return foundNamedKey; // weird character?\n\n if (search.length === 1) return search.charCodeAt(0);\n return undefined;\n }\n /**\n * Compares a keyboard event with a given keyCode or keyName.\n *\n * @param {Event} event Keyboard event that should be tested\n * @param {Mixed} keyCode {Number} or keyName {String}\n * @return {Boolean}\n * @api public\n */\n\n\n keyCode.isEventKey = function isEventKey(event, nameOrCode) {\n if (event && 'object' === typeof event) {\n var keyCode = event.which || event.keyCode || event.charCode;\n\n if (keyCode === null || keyCode === undefined) {\n return false;\n }\n\n if (typeof nameOrCode === 'string') {\n // check codes\n var foundNamedKey = codes[nameOrCode.toLowerCase()];\n\n if (foundNamedKey) {\n return foundNamedKey === keyCode;\n } // check aliases\n\n\n var foundNamedKey = aliases[nameOrCode.toLowerCase()];\n\n if (foundNamedKey) {\n return foundNamedKey === keyCode;\n }\n } else if (typeof nameOrCode === 'number') {\n return nameOrCode === keyCode;\n }\n\n return false;\n }\n };\n\n exports = module.exports = keyCode;\n /**\n * Get by name\n *\n * exports.code['enter'] // => 13\n */\n\n var codes = exports.code = exports.codes = {\n 'backspace': 8,\n 'tab': 9,\n 'enter': 13,\n 'shift': 16,\n 'ctrl': 17,\n 'alt': 18,\n 'pause/break': 19,\n 'caps lock': 20,\n 'esc': 27,\n 'space': 32,\n 'page up': 33,\n 'page down': 34,\n 'end': 35,\n 'home': 36,\n 'left': 37,\n 'up': 38,\n 'right': 39,\n 'down': 40,\n 'insert': 45,\n 'delete': 46,\n 'command': 91,\n 'left command': 91,\n 'right command': 93,\n 'numpad *': 106,\n 'numpad +': 107,\n 'numpad -': 109,\n 'numpad .': 110,\n 'numpad /': 111,\n 'num lock': 144,\n 'scroll lock': 145,\n 'my computer': 182,\n 'my calculator': 183,\n ';': 186,\n '=': 187,\n ',': 188,\n '-': 189,\n '.': 190,\n '/': 191,\n '`': 192,\n '[': 219,\n '\\\\': 220,\n ']': 221,\n \"'\": 222\n }; // Helper aliases\n\n var aliases = exports.aliases = {\n 'windows': 91,\n '⇧': 16,\n '⌥': 18,\n '⌃': 17,\n '⌘': 91,\n 'ctl': 17,\n 'control': 17,\n 'option': 18,\n 'pause': 19,\n 'break': 19,\n 'caps': 20,\n 'return': 13,\n 'escape': 27,\n 'spc': 32,\n 'spacebar': 32,\n 'pgup': 33,\n 'pgdn': 34,\n 'ins': 45,\n 'del': 46,\n 'cmd': 91\n };\n /*!\n * Programatically add the following\n */\n // lower case chars\n\n for (i = 97; i < 123; i++) {\n codes[String.fromCharCode(i)] = i - 32;\n } // numbers\n\n\n for (var i = 48; i < 58; i++) {\n codes[i - 48] = i;\n } // function keys\n\n\n for (i = 1; i < 13; i++) {\n codes['f' + i] = i + 111;\n } // numpad keys\n\n\n for (i = 0; i < 10; i++) {\n codes['numpad ' + i] = i + 96;\n }\n /**\n * Get by code\n *\n * exports.name[13] // => 'Enter'\n */\n\n\n var names = exports.names = exports.title = {}; // title for backward compat\n // Create reverse mapping\n\n for (i in codes) {\n names[codes[i]] = i;\n } // Add aliases\n\n\n for (var alias in aliases) {\n codes[alias] = aliases[alias];\n }\n });\n var keycode_1 = keycode.code;\n var keycode_2 = keycode.codes;\n var keycode_3 = keycode.aliases;\n var keycode_4 = keycode.names;\n var keycode_5 = keycode.title;\n\n var MODAL_CLASS_NAME = 'vjs-modal-dialog';\n /**\n * The `ModalDialog` displays over the video and its controls, which blocks\n * interaction with the player until it is closed.\n *\n * Modal dialogs include a \"Close\" button and will close when that button\n * is activated - or when ESC is pressed anywhere.\n *\n * @extends Component\n */\n\n var ModalDialog = /*#__PURE__*/function (_Component) {\n inheritsLoose(ModalDialog, _Component);\n\n /**\n * Create an instance of this class.\n *\n * @param {Player} player\n * The `Player` that this class should be attached to.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Mixed} [options.content=undefined]\n * Provide customized content for this modal.\n *\n * @param {string} [options.description]\n * A text description for the modal, primarily for accessibility.\n *\n * @param {boolean} [options.fillAlways=false]\n * Normally, modals are automatically filled only the first time\n * they open. This tells the modal to refresh its content\n * every time it opens.\n *\n * @param {string} [options.label]\n * A text label for the modal, primarily for accessibility.\n *\n * @param {boolean} [options.pauseOnOpen=true]\n * If `true`, playback will will be paused if playing when\n * the modal opens, and resumed when it closes.\n *\n * @param {boolean} [options.temporary=true]\n * If `true`, the modal can only be opened once; it will be\n * disposed as soon as it's closed.\n *\n * @param {boolean} [options.uncloseable=false]\n * If `true`, the user will not be able to close the modal\n * through the UI in the normal ways. Programmatic closing is\n * still possible.\n */\n function ModalDialog(player, options) {\n var _this;\n\n _this = _Component.call(this, player, options) || this;\n _this.opened_ = _this.hasBeenOpened_ = _this.hasBeenFilled_ = false;\n\n _this.closeable(!_this.options_.uncloseable);\n\n _this.content(_this.options_.content); // Make sure the contentEl is defined AFTER any children are initialized\n // because we only want the contents of the modal in the contentEl\n // (not the UI elements like the close button).\n\n\n _this.contentEl_ = createEl('div', {\n className: MODAL_CLASS_NAME + \"-content\"\n }, {\n role: 'document'\n });\n _this.descEl_ = createEl('p', {\n className: MODAL_CLASS_NAME + \"-description vjs-control-text\",\n id: _this.el().getAttribute('aria-describedby')\n });\n textContent(_this.descEl_, _this.description());\n\n _this.el_.appendChild(_this.descEl_);\n\n _this.el_.appendChild(_this.contentEl_);\n\n return _this;\n }\n /**\n * Create the `ModalDialog`'s DOM element\n *\n * @return {Element}\n * The DOM element that gets created.\n */\n\n\n var _proto = ModalDialog.prototype;\n\n _proto.createEl = function createEl() {\n return _Component.prototype.createEl.call(this, 'div', {\n className: this.buildCSSClass(),\n tabIndex: -1\n }, {\n 'aria-describedby': this.id() + \"_description\",\n 'aria-hidden': 'true',\n 'aria-label': this.label(),\n 'role': 'dialog'\n });\n };\n\n _proto.dispose = function dispose() {\n this.contentEl_ = null;\n this.descEl_ = null;\n this.previouslyActiveEl_ = null;\n\n _Component.prototype.dispose.call(this);\n }\n /**\n * Builds the default DOM `className`.\n *\n * @return {string}\n * The DOM `className` for this object.\n */\n ;\n\n _proto.buildCSSClass = function buildCSSClass() {\n return MODAL_CLASS_NAME + \" vjs-hidden \" + _Component.prototype.buildCSSClass.call(this);\n }\n /**\n * Returns the label string for this modal. Primarily used for accessibility.\n *\n * @return {string}\n * the localized or raw label of this modal.\n */\n ;\n\n _proto.label = function label() {\n return this.localize(this.options_.label || 'Modal Window');\n }\n /**\n * Returns the description string for this modal. Primarily used for\n * accessibility.\n *\n * @return {string}\n * The localized or raw description of this modal.\n */\n ;\n\n _proto.description = function description() {\n var desc = this.options_.description || this.localize('This is a modal window.'); // Append a universal closeability message if the modal is closeable.\n\n if (this.closeable()) {\n desc += ' ' + this.localize('This modal can be closed by pressing the Escape key or activating the close button.');\n }\n\n return desc;\n }\n /**\n * Opens the modal.\n *\n * @fires ModalDialog#beforemodalopen\n * @fires ModalDialog#modalopen\n */\n ;\n\n _proto.open = function open() {\n if (!this.opened_) {\n var player = this.player();\n /**\n * Fired just before a `ModalDialog` is opened.\n *\n * @event ModalDialog#beforemodalopen\n * @type {EventTarget~Event}\n */\n\n this.trigger('beforemodalopen');\n this.opened_ = true; // Fill content if the modal has never opened before and\n // never been filled.\n\n if (this.options_.fillAlways || !this.hasBeenOpened_ && !this.hasBeenFilled_) {\n this.fill();\n } // If the player was playing, pause it and take note of its previously\n // playing state.\n\n\n this.wasPlaying_ = !player.paused();\n\n if (this.options_.pauseOnOpen && this.wasPlaying_) {\n player.pause();\n }\n\n this.on('keydown', this.handleKeyDown); // Hide controls and note if they were enabled.\n\n this.hadControls_ = player.controls();\n player.controls(false);\n this.show();\n this.conditionalFocus_();\n this.el().setAttribute('aria-hidden', 'false');\n /**\n * Fired just after a `ModalDialog` is opened.\n *\n * @event ModalDialog#modalopen\n * @type {EventTarget~Event}\n */\n\n this.trigger('modalopen');\n this.hasBeenOpened_ = true;\n }\n }\n /**\n * If the `ModalDialog` is currently open or closed.\n *\n * @param {boolean} [value]\n * If given, it will open (`true`) or close (`false`) the modal.\n *\n * @return {boolean}\n * the current open state of the modaldialog\n */\n ;\n\n _proto.opened = function opened(value) {\n if (typeof value === 'boolean') {\n this[value ? 'open' : 'close']();\n }\n\n return this.opened_;\n }\n /**\n * Closes the modal, does nothing if the `ModalDialog` is\n * not open.\n *\n * @fires ModalDialog#beforemodalclose\n * @fires ModalDialog#modalclose\n */\n ;\n\n _proto.close = function close() {\n if (!this.opened_) {\n return;\n }\n\n var player = this.player();\n /**\n * Fired just before a `ModalDialog` is closed.\n *\n * @event ModalDialog#beforemodalclose\n * @type {EventTarget~Event}\n */\n\n this.trigger('beforemodalclose');\n this.opened_ = false;\n\n if (this.wasPlaying_ && this.options_.pauseOnOpen) {\n player.play();\n }\n\n this.off('keydown', this.handleKeyDown);\n\n if (this.hadControls_) {\n player.controls(true);\n }\n\n this.hide();\n this.el().setAttribute('aria-hidden', 'true');\n /**\n * Fired just after a `ModalDialog` is closed.\n *\n * @event ModalDialog#modalclose\n * @type {EventTarget~Event}\n */\n\n this.trigger('modalclose');\n this.conditionalBlur_();\n\n if (this.options_.temporary) {\n this.dispose();\n }\n }\n /**\n * Check to see if the `ModalDialog` is closeable via the UI.\n *\n * @param {boolean} [value]\n * If given as a boolean, it will set the `closeable` option.\n *\n * @return {boolean}\n * Returns the final value of the closable option.\n */\n ;\n\n _proto.closeable = function closeable(value) {\n if (typeof value === 'boolean') {\n var closeable = this.closeable_ = !!value;\n var close = this.getChild('closeButton'); // If this is being made closeable and has no close button, add one.\n\n if (closeable && !close) {\n // The close button should be a child of the modal - not its\n // content element, so temporarily change the content element.\n var temp = this.contentEl_;\n this.contentEl_ = this.el_;\n close = this.addChild('closeButton', {\n controlText: 'Close Modal Dialog'\n });\n this.contentEl_ = temp;\n this.on(close, 'close', this.close);\n } // If this is being made uncloseable and has a close button, remove it.\n\n\n if (!closeable && close) {\n this.off(close, 'close', this.close);\n this.removeChild(close);\n close.dispose();\n }\n }\n\n return this.closeable_;\n }\n /**\n * Fill the modal's content element with the modal's \"content\" option.\n * The content element will be emptied before this change takes place.\n */\n ;\n\n _proto.fill = function fill() {\n this.fillWith(this.content());\n }\n /**\n * Fill the modal's content element with arbitrary content.\n * The content element will be emptied before this change takes place.\n *\n * @fires ModalDialog#beforemodalfill\n * @fires ModalDialog#modalfill\n *\n * @param {Mixed} [content]\n * The same rules apply to this as apply to the `content` option.\n */\n ;\n\n _proto.fillWith = function fillWith(content) {\n var contentEl = this.contentEl();\n var parentEl = contentEl.parentNode;\n var nextSiblingEl = contentEl.nextSibling;\n /**\n * Fired just before a `ModalDialog` is filled with content.\n *\n * @event ModalDialog#beforemodalfill\n * @type {EventTarget~Event}\n */\n\n this.trigger('beforemodalfill');\n this.hasBeenFilled_ = true; // Detach the content element from the DOM before performing\n // manipulation to avoid modifying the live DOM multiple times.\n\n parentEl.removeChild(contentEl);\n this.empty();\n insertContent(contentEl, content);\n /**\n * Fired just after a `ModalDialog` is filled with content.\n *\n * @event ModalDialog#modalfill\n * @type {EventTarget~Event}\n */\n\n this.trigger('modalfill'); // Re-inject the re-filled content element.\n\n if (nextSiblingEl) {\n parentEl.insertBefore(contentEl, nextSiblingEl);\n } else {\n parentEl.appendChild(contentEl);\n } // make sure that the close button is last in the dialog DOM\n\n\n var closeButton = this.getChild('closeButton');\n\n if (closeButton) {\n parentEl.appendChild(closeButton.el_);\n }\n }\n /**\n * Empties the content element. This happens anytime the modal is filled.\n *\n * @fires ModalDialog#beforemodalempty\n * @fires ModalDialog#modalempty\n */\n ;\n\n _proto.empty = function empty() {\n /**\n * Fired just before a `ModalDialog` is emptied.\n *\n * @event ModalDialog#beforemodalempty\n * @type {EventTarget~Event}\n */\n this.trigger('beforemodalempty');\n emptyEl(this.contentEl());\n /**\n * Fired just after a `ModalDialog` is emptied.\n *\n * @event ModalDialog#modalempty\n * @type {EventTarget~Event}\n */\n\n this.trigger('modalempty');\n }\n /**\n * Gets or sets the modal content, which gets normalized before being\n * rendered into the DOM.\n *\n * This does not update the DOM or fill the modal, but it is called during\n * that process.\n *\n * @param {Mixed} [value]\n * If defined, sets the internal content value to be used on the\n * next call(s) to `fill`. This value is normalized before being\n * inserted. To \"clear\" the internal content value, pass `null`.\n *\n * @return {Mixed}\n * The current content of the modal dialog\n */\n ;\n\n _proto.content = function content(value) {\n if (typeof value !== 'undefined') {\n this.content_ = value;\n }\n\n return this.content_;\n }\n /**\n * conditionally focus the modal dialog if focus was previously on the player.\n *\n * @private\n */\n ;\n\n _proto.conditionalFocus_ = function conditionalFocus_() {\n var activeEl = document.activeElement;\n var playerEl = this.player_.el_;\n this.previouslyActiveEl_ = null;\n\n if (playerEl.contains(activeEl) || playerEl === activeEl) {\n this.previouslyActiveEl_ = activeEl;\n this.focus();\n }\n }\n /**\n * conditionally blur the element and refocus the last focused element\n *\n * @private\n */\n ;\n\n _proto.conditionalBlur_ = function conditionalBlur_() {\n if (this.previouslyActiveEl_) {\n this.previouslyActiveEl_.focus();\n this.previouslyActiveEl_ = null;\n }\n }\n /**\n * Keydown handler. Attached when modal is focused.\n *\n * @listens keydown\n */\n ;\n\n _proto.handleKeyDown = function handleKeyDown(event) {\n // Do not allow keydowns to reach out of the modal dialog.\n event.stopPropagation();\n\n if (keycode.isEventKey(event, 'Escape') && this.closeable()) {\n event.preventDefault();\n this.close();\n return;\n } // exit early if it isn't a tab key\n\n\n if (!keycode.isEventKey(event, 'Tab')) {\n return;\n }\n\n var focusableEls = this.focusableEls_();\n var activeEl = this.el_.querySelector(':focus');\n var focusIndex;\n\n for (var i = 0; i < focusableEls.length; i++) {\n if (activeEl === focusableEls[i]) {\n focusIndex = i;\n break;\n }\n }\n\n if (document.activeElement === this.el_) {\n focusIndex = 0;\n }\n\n if (event.shiftKey && focusIndex === 0) {\n focusableEls[focusableEls.length - 1].focus();\n event.preventDefault();\n } else if (!event.shiftKey && focusIndex === focusableEls.length - 1) {\n focusableEls[0].focus();\n event.preventDefault();\n }\n }\n /**\n * get all focusable elements\n *\n * @private\n */\n ;\n\n _proto.focusableEls_ = function focusableEls_() {\n var allChildren = this.el_.querySelectorAll('*');\n return Array.prototype.filter.call(allChildren, function (child) {\n return (child instanceof window$3.HTMLAnchorElement || child instanceof window$3.HTMLAreaElement) && child.hasAttribute('href') || (child instanceof window$3.HTMLInputElement || child instanceof window$3.HTMLSelectElement || child instanceof window$3.HTMLTextAreaElement || child instanceof window$3.HTMLButtonElement) && !child.hasAttribute('disabled') || child instanceof window$3.HTMLIFrameElement || child instanceof window$3.HTMLObjectElement || child instanceof window$3.HTMLEmbedElement || child.hasAttribute('tabindex') && child.getAttribute('tabindex') !== -1 || child.hasAttribute('contenteditable');\n });\n };\n\n return ModalDialog;\n }(Component);\n /**\n * Default options for `ModalDialog` default options.\n *\n * @type {Object}\n * @private\n */\n\n\n ModalDialog.prototype.options_ = {\n pauseOnOpen: true,\n temporary: true\n };\n Component.registerComponent('ModalDialog', ModalDialog);\n\n /**\n * Common functionaliy between {@link TextTrackList}, {@link AudioTrackList}, and\n * {@link VideoTrackList}\n *\n * @extends EventTarget\n */\n\n var TrackList = /*#__PURE__*/function (_EventTarget) {\n inheritsLoose(TrackList, _EventTarget);\n\n /**\n * Create an instance of this class\n *\n * @param {Track[]} tracks\n * A list of tracks to initialize the list with.\n *\n * @abstract\n */\n function TrackList(tracks) {\n var _this;\n\n if (tracks === void 0) {\n tracks = [];\n }\n\n _this = _EventTarget.call(this) || this;\n _this.tracks_ = [];\n /**\n * @memberof TrackList\n * @member {number} length\n * The current number of `Track`s in the this Trackist.\n * @instance\n */\n\n Object.defineProperty(assertThisInitialized(_this), 'length', {\n get: function get() {\n return this.tracks_.length;\n }\n });\n\n for (var i = 0; i < tracks.length; i++) {\n _this.addTrack(tracks[i]);\n }\n\n return _this;\n }\n /**\n * Add a {@link Track} to the `TrackList`\n *\n * @param {Track} track\n * The audio, video, or text track to add to the list.\n *\n * @fires TrackList#addtrack\n */\n\n\n var _proto = TrackList.prototype;\n\n _proto.addTrack = function addTrack(track) {\n var index = this.tracks_.length;\n\n if (!('' + index in this)) {\n Object.defineProperty(this, index, {\n get: function get() {\n return this.tracks_[index];\n }\n });\n } // Do not add duplicate tracks\n\n\n if (this.tracks_.indexOf(track) === -1) {\n this.tracks_.push(track);\n /**\n * Triggered when a track is added to a track list.\n *\n * @event TrackList#addtrack\n * @type {EventTarget~Event}\n * @property {Track} track\n * A reference to track that was added.\n */\n\n this.trigger({\n track: track,\n type: 'addtrack',\n target: this\n });\n }\n }\n /**\n * Remove a {@link Track} from the `TrackList`\n *\n * @param {Track} rtrack\n * The audio, video, or text track to remove from the list.\n *\n * @fires TrackList#removetrack\n */\n ;\n\n _proto.removeTrack = function removeTrack(rtrack) {\n var track;\n\n for (var i = 0, l = this.length; i < l; i++) {\n if (this[i] === rtrack) {\n track = this[i];\n\n if (track.off) {\n track.off();\n }\n\n this.tracks_.splice(i, 1);\n break;\n }\n }\n\n if (!track) {\n return;\n }\n /**\n * Triggered when a track is removed from track list.\n *\n * @event TrackList#removetrack\n * @type {EventTarget~Event}\n * @property {Track} track\n * A reference to track that was removed.\n */\n\n\n this.trigger({\n track: track,\n type: 'removetrack',\n target: this\n });\n }\n /**\n * Get a Track from the TrackList by a tracks id\n *\n * @param {string} id - the id of the track to get\n * @method getTrackById\n * @return {Track}\n * @private\n */\n ;\n\n _proto.getTrackById = function getTrackById(id) {\n var result = null;\n\n for (var i = 0, l = this.length; i < l; i++) {\n var track = this[i];\n\n if (track.id === id) {\n result = track;\n break;\n }\n }\n\n return result;\n };\n\n return TrackList;\n }(EventTarget);\n /**\n * Triggered when a different track is selected/enabled.\n *\n * @event TrackList#change\n * @type {EventTarget~Event}\n */\n\n /**\n * Events that can be called with on + eventName. See {@link EventHandler}.\n *\n * @property {Object} TrackList#allowedEvents_\n * @private\n */\n\n\n TrackList.prototype.allowedEvents_ = {\n change: 'change',\n addtrack: 'addtrack',\n removetrack: 'removetrack'\n }; // emulate attribute EventHandler support to allow for feature detection\n\n for (var event in TrackList.prototype.allowedEvents_) {\n TrackList.prototype['on' + event] = null;\n }\n\n /**\n * Anywhere we call this function we diverge from the spec\n * as we only support one enabled audiotrack at a time\n *\n * @param {AudioTrackList} list\n * list to work on\n *\n * @param {AudioTrack} track\n * The track to skip\n *\n * @private\n */\n\n var disableOthers = function disableOthers(list, track) {\n for (var i = 0; i < list.length; i++) {\n if (!Object.keys(list[i]).length || track.id === list[i].id) {\n continue;\n } // another audio track is enabled, disable it\n\n\n list[i].enabled = false;\n }\n };\n /**\n * The current list of {@link AudioTrack} for a media file.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#audiotracklist}\n * @extends TrackList\n */\n\n\n var AudioTrackList = /*#__PURE__*/function (_TrackList) {\n inheritsLoose(AudioTrackList, _TrackList);\n\n /**\n * Create an instance of this class.\n *\n * @param {AudioTrack[]} [tracks=[]]\n * A list of `AudioTrack` to instantiate the list with.\n */\n function AudioTrackList(tracks) {\n var _this;\n\n if (tracks === void 0) {\n tracks = [];\n }\n\n // make sure only 1 track is enabled\n // sorted from last index to first index\n for (var i = tracks.length - 1; i >= 0; i--) {\n if (tracks[i].enabled) {\n disableOthers(tracks, tracks[i]);\n break;\n }\n }\n\n _this = _TrackList.call(this, tracks) || this;\n _this.changing_ = false;\n return _this;\n }\n /**\n * Add an {@link AudioTrack} to the `AudioTrackList`.\n *\n * @param {AudioTrack} track\n * The AudioTrack to add to the list\n *\n * @fires TrackList#addtrack\n */\n\n\n var _proto = AudioTrackList.prototype;\n\n _proto.addTrack = function addTrack(track) {\n var _this2 = this;\n\n if (track.enabled) {\n disableOthers(this, track);\n }\n\n _TrackList.prototype.addTrack.call(this, track); // native tracks don't have this\n\n\n if (!track.addEventListener) {\n return;\n }\n\n track.enabledChange_ = function () {\n // when we are disabling other tracks (since we don't support\n // more than one track at a time) we will set changing_\n // to true so that we don't trigger additional change events\n if (_this2.changing_) {\n return;\n }\n\n _this2.changing_ = true;\n disableOthers(_this2, track);\n _this2.changing_ = false;\n\n _this2.trigger('change');\n };\n /**\n * @listens AudioTrack#enabledchange\n * @fires TrackList#change\n */\n\n\n track.addEventListener('enabledchange', track.enabledChange_);\n };\n\n _proto.removeTrack = function removeTrack(rtrack) {\n _TrackList.prototype.removeTrack.call(this, rtrack);\n\n if (rtrack.removeEventListener && rtrack.enabledChange_) {\n rtrack.removeEventListener('enabledchange', rtrack.enabledChange_);\n rtrack.enabledChange_ = null;\n }\n };\n\n return AudioTrackList;\n }(TrackList);\n\n /**\n * Un-select all other {@link VideoTrack}s that are selected.\n *\n * @param {VideoTrackList} list\n * list to work on\n *\n * @param {VideoTrack} track\n * The track to skip\n *\n * @private\n */\n\n var disableOthers$1 = function disableOthers(list, track) {\n for (var i = 0; i < list.length; i++) {\n if (!Object.keys(list[i]).length || track.id === list[i].id) {\n continue;\n } // another video track is enabled, disable it\n\n\n list[i].selected = false;\n }\n };\n /**\n * The current list of {@link VideoTrack} for a video.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#videotracklist}\n * @extends TrackList\n */\n\n\n var VideoTrackList = /*#__PURE__*/function (_TrackList) {\n inheritsLoose(VideoTrackList, _TrackList);\n\n /**\n * Create an instance of this class.\n *\n * @param {VideoTrack[]} [tracks=[]]\n * A list of `VideoTrack` to instantiate the list with.\n */\n function VideoTrackList(tracks) {\n var _this;\n\n if (tracks === void 0) {\n tracks = [];\n }\n\n // make sure only 1 track is enabled\n // sorted from last index to first index\n for (var i = tracks.length - 1; i >= 0; i--) {\n if (tracks[i].selected) {\n disableOthers$1(tracks, tracks[i]);\n break;\n }\n }\n\n _this = _TrackList.call(this, tracks) || this;\n _this.changing_ = false;\n /**\n * @member {number} VideoTrackList#selectedIndex\n * The current index of the selected {@link VideoTrack`}.\n */\n\n Object.defineProperty(assertThisInitialized(_this), 'selectedIndex', {\n get: function get() {\n for (var _i = 0; _i < this.length; _i++) {\n if (this[_i].selected) {\n return _i;\n }\n }\n\n return -1;\n },\n set: function set() {}\n });\n return _this;\n }\n /**\n * Add a {@link VideoTrack} to the `VideoTrackList`.\n *\n * @param {VideoTrack} track\n * The VideoTrack to add to the list\n *\n * @fires TrackList#addtrack\n */\n\n\n var _proto = VideoTrackList.prototype;\n\n _proto.addTrack = function addTrack(track) {\n var _this2 = this;\n\n if (track.selected) {\n disableOthers$1(this, track);\n }\n\n _TrackList.prototype.addTrack.call(this, track); // native tracks don't have this\n\n\n if (!track.addEventListener) {\n return;\n }\n\n track.selectedChange_ = function () {\n if (_this2.changing_) {\n return;\n }\n\n _this2.changing_ = true;\n disableOthers$1(_this2, track);\n _this2.changing_ = false;\n\n _this2.trigger('change');\n };\n /**\n * @listens VideoTrack#selectedchange\n * @fires TrackList#change\n */\n\n\n track.addEventListener('selectedchange', track.selectedChange_);\n };\n\n _proto.removeTrack = function removeTrack(rtrack) {\n _TrackList.prototype.removeTrack.call(this, rtrack);\n\n if (rtrack.removeEventListener && rtrack.selectedChange_) {\n rtrack.removeEventListener('selectedchange', rtrack.selectedChange_);\n rtrack.selectedChange_ = null;\n }\n };\n\n return VideoTrackList;\n }(TrackList);\n\n /**\n * The current list of {@link TextTrack} for a media file.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttracklist}\n * @extends TrackList\n */\n\n var TextTrackList = /*#__PURE__*/function (_TrackList) {\n inheritsLoose(TextTrackList, _TrackList);\n\n function TextTrackList() {\n return _TrackList.apply(this, arguments) || this;\n }\n\n var _proto = TextTrackList.prototype;\n\n /**\n * Add a {@link TextTrack} to the `TextTrackList`\n *\n * @param {TextTrack} track\n * The text track to add to the list.\n *\n * @fires TrackList#addtrack\n */\n _proto.addTrack = function addTrack(track) {\n var _this = this;\n\n _TrackList.prototype.addTrack.call(this, track);\n\n if (!this.queueChange_) {\n this.queueChange_ = function () {\n return _this.queueTrigger('change');\n };\n }\n\n if (!this.triggerSelectedlanguagechange) {\n this.triggerSelectedlanguagechange_ = function () {\n return _this.trigger('selectedlanguagechange');\n };\n }\n /**\n * @listens TextTrack#modechange\n * @fires TrackList#change\n */\n\n\n track.addEventListener('modechange', this.queueChange_);\n var nonLanguageTextTrackKind = ['metadata', 'chapters'];\n\n if (nonLanguageTextTrackKind.indexOf(track.kind) === -1) {\n track.addEventListener('modechange', this.triggerSelectedlanguagechange_);\n }\n };\n\n _proto.removeTrack = function removeTrack(rtrack) {\n _TrackList.prototype.removeTrack.call(this, rtrack); // manually remove the event handlers we added\n\n\n if (rtrack.removeEventListener) {\n if (this.queueChange_) {\n rtrack.removeEventListener('modechange', this.queueChange_);\n }\n\n if (this.selectedlanguagechange_) {\n rtrack.removeEventListener('modechange', this.triggerSelectedlanguagechange_);\n }\n }\n };\n\n return TextTrackList;\n }(TrackList);\n\n /**\n * @file html-track-element-list.js\n */\n\n /**\n * The current list of {@link HtmlTrackElement}s.\n */\n var HtmlTrackElementList = /*#__PURE__*/function () {\n /**\n * Create an instance of this class.\n *\n * @param {HtmlTrackElement[]} [tracks=[]]\n * A list of `HtmlTrackElement` to instantiate the list with.\n */\n function HtmlTrackElementList(trackElements) {\n if (trackElements === void 0) {\n trackElements = [];\n }\n\n this.trackElements_ = [];\n /**\n * @memberof HtmlTrackElementList\n * @member {number} length\n * The current number of `Track`s in the this Trackist.\n * @instance\n */\n\n Object.defineProperty(this, 'length', {\n get: function get() {\n return this.trackElements_.length;\n }\n });\n\n for (var i = 0, length = trackElements.length; i < length; i++) {\n this.addTrackElement_(trackElements[i]);\n }\n }\n /**\n * Add an {@link HtmlTrackElement} to the `HtmlTrackElementList`\n *\n * @param {HtmlTrackElement} trackElement\n * The track element to add to the list.\n *\n * @private\n */\n\n\n var _proto = HtmlTrackElementList.prototype;\n\n _proto.addTrackElement_ = function addTrackElement_(trackElement) {\n var index = this.trackElements_.length;\n\n if (!('' + index in this)) {\n Object.defineProperty(this, index, {\n get: function get() {\n return this.trackElements_[index];\n }\n });\n } // Do not add duplicate elements\n\n\n if (this.trackElements_.indexOf(trackElement) === -1) {\n this.trackElements_.push(trackElement);\n }\n }\n /**\n * Get an {@link HtmlTrackElement} from the `HtmlTrackElementList` given an\n * {@link TextTrack}.\n *\n * @param {TextTrack} track\n * The track associated with a track element.\n *\n * @return {HtmlTrackElement|undefined}\n * The track element that was found or undefined.\n *\n * @private\n */\n ;\n\n _proto.getTrackElementByTrack_ = function getTrackElementByTrack_(track) {\n var trackElement_;\n\n for (var i = 0, length = this.trackElements_.length; i < length; i++) {\n if (track === this.trackElements_[i].track) {\n trackElement_ = this.trackElements_[i];\n break;\n }\n }\n\n return trackElement_;\n }\n /**\n * Remove a {@link HtmlTrackElement} from the `HtmlTrackElementList`\n *\n * @param {HtmlTrackElement} trackElement\n * The track element to remove from the list.\n *\n * @private\n */\n ;\n\n _proto.removeTrackElement_ = function removeTrackElement_(trackElement) {\n for (var i = 0, length = this.trackElements_.length; i < length; i++) {\n if (trackElement === this.trackElements_[i]) {\n if (this.trackElements_[i].track && typeof this.trackElements_[i].track.off === 'function') {\n this.trackElements_[i].track.off();\n }\n\n if (typeof this.trackElements_[i].off === 'function') {\n this.trackElements_[i].off();\n }\n\n this.trackElements_.splice(i, 1);\n break;\n }\n }\n };\n\n return HtmlTrackElementList;\n }();\n\n /**\n * @file text-track-cue-list.js\n */\n\n /**\n * @typedef {Object} TextTrackCueList~TextTrackCue\n *\n * @property {string} id\n * The unique id for this text track cue\n *\n * @property {number} startTime\n * The start time for this text track cue\n *\n * @property {number} endTime\n * The end time for this text track cue\n *\n * @property {boolean} pauseOnExit\n * Pause when the end time is reached if true.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackcue}\n */\n\n /**\n * A List of TextTrackCues.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackcuelist}\n */\n var TextTrackCueList = /*#__PURE__*/function () {\n /**\n * Create an instance of this class..\n *\n * @param {Array} cues\n * A list of cues to be initialized with\n */\n function TextTrackCueList(cues) {\n TextTrackCueList.prototype.setCues_.call(this, cues);\n /**\n * @memberof TextTrackCueList\n * @member {number} length\n * The current number of `TextTrackCue`s in the TextTrackCueList.\n * @instance\n */\n\n Object.defineProperty(this, 'length', {\n get: function get() {\n return this.length_;\n }\n });\n }\n /**\n * A setter for cues in this list. Creates getters\n * an an index for the cues.\n *\n * @param {Array} cues\n * An array of cues to set\n *\n * @private\n */\n\n\n var _proto = TextTrackCueList.prototype;\n\n _proto.setCues_ = function setCues_(cues) {\n var oldLength = this.length || 0;\n var i = 0;\n var l = cues.length;\n this.cues_ = cues;\n this.length_ = cues.length;\n\n var defineProp = function defineProp(index) {\n if (!('' + index in this)) {\n Object.defineProperty(this, '' + index, {\n get: function get() {\n return this.cues_[index];\n }\n });\n }\n };\n\n if (oldLength < l) {\n i = oldLength;\n\n for (; i < l; i++) {\n defineProp.call(this, i);\n }\n }\n }\n /**\n * Get a `TextTrackCue` that is currently in the `TextTrackCueList` by id.\n *\n * @param {string} id\n * The id of the cue that should be searched for.\n *\n * @return {TextTrackCueList~TextTrackCue|null}\n * A single cue or null if none was found.\n */\n ;\n\n _proto.getCueById = function getCueById(id) {\n var result = null;\n\n for (var i = 0, l = this.length; i < l; i++) {\n var cue = this[i];\n\n if (cue.id === id) {\n result = cue;\n break;\n }\n }\n\n return result;\n };\n\n return TextTrackCueList;\n }();\n\n /**\n * @file track-kinds.js\n */\n\n /**\n * All possible `VideoTrackKind`s\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-videotrack-kind\n * @typedef VideoTrack~Kind\n * @enum\n */\n var VideoTrackKind = {\n alternative: 'alternative',\n captions: 'captions',\n main: 'main',\n sign: 'sign',\n subtitles: 'subtitles',\n commentary: 'commentary'\n };\n /**\n * All possible `AudioTrackKind`s\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-audiotrack-kind\n * @typedef AudioTrack~Kind\n * @enum\n */\n\n var AudioTrackKind = {\n 'alternative': 'alternative',\n 'descriptions': 'descriptions',\n 'main': 'main',\n 'main-desc': 'main-desc',\n 'translation': 'translation',\n 'commentary': 'commentary'\n };\n /**\n * All possible `TextTrackKind`s\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#dom-texttrack-kind\n * @typedef TextTrack~Kind\n * @enum\n */\n\n var TextTrackKind = {\n subtitles: 'subtitles',\n captions: 'captions',\n descriptions: 'descriptions',\n chapters: 'chapters',\n metadata: 'metadata'\n };\n /**\n * All possible `TextTrackMode`s\n *\n * @see https://html.spec.whatwg.org/multipage/embedded-content.html#texttrackmode\n * @typedef TextTrack~Mode\n * @enum\n */\n\n var TextTrackMode = {\n disabled: 'disabled',\n hidden: 'hidden',\n showing: 'showing'\n };\n\n /**\n * A Track class that contains all of the common functionality for {@link AudioTrack},\n * {@link VideoTrack}, and {@link TextTrack}.\n *\n * > Note: This class should not be used directly\n *\n * @see {@link https://html.spec.whatwg.org/multipage/embedded-content.html}\n * @extends EventTarget\n * @abstract\n */\n\n var Track = /*#__PURE__*/function (_EventTarget) {\n inheritsLoose(Track, _EventTarget);\n\n /**\n * Create an instance of this class.\n *\n * @param {Object} [options={}]\n * Object of option names and values\n *\n * @param {string} [options.kind='']\n * A valid kind for the track type you are creating.\n *\n * @param {string} [options.id='vjs_track_' + Guid.newGUID()]\n * A unique id for this AudioTrack.\n *\n * @param {string} [options.label='']\n * The menu label for this track.\n *\n * @param {string} [options.language='']\n * A valid two character language code.\n *\n * @abstract\n */\n function Track(options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n _this = _EventTarget.call(this) || this;\n var trackProps = {\n id: options.id || 'vjs_track_' + newGUID(),\n kind: options.kind || '',\n label: options.label || '',\n language: options.language || ''\n };\n /**\n * @memberof Track\n * @member {string} id\n * The id of this track. Cannot be changed after creation.\n * @instance\n *\n * @readonly\n */\n\n /**\n * @memberof Track\n * @member {string} kind\n * The kind of track that this is. Cannot be changed after creation.\n * @instance\n *\n * @readonly\n */\n\n /**\n * @memberof Track\n * @member {string} label\n * The label of this track. Cannot be changed after creation.\n * @instance\n *\n * @readonly\n */\n\n /**\n * @memberof Track\n * @member {string} language\n * The two letter language code for this track. Cannot be changed after\n * creation.\n * @instance\n *\n * @readonly\n */\n\n var _loop = function _loop(key) {\n Object.defineProperty(assertThisInitialized(_this), key, {\n get: function get() {\n return trackProps[key];\n },\n set: function set() {}\n });\n };\n\n for (var key in trackProps) {\n _loop(key);\n }\n\n return _this;\n }\n\n return Track;\n }(EventTarget);\n\n /**\n * @file url.js\n * @module url\n */\n /**\n * @typedef {Object} url:URLObject\n *\n * @property {string} protocol\n * The protocol of the url that was parsed.\n *\n * @property {string} hostname\n * The hostname of the url that was parsed.\n *\n * @property {string} port\n * The port of the url that was parsed.\n *\n * @property {string} pathname\n * The pathname of the url that was parsed.\n *\n * @property {string} search\n * The search query of the url that was parsed.\n *\n * @property {string} hash\n * The hash of the url that was parsed.\n *\n * @property {string} host\n * The host of the url that was parsed.\n */\n\n /**\n * Resolve and parse the elements of a URL.\n *\n * @function\n * @param {String} url\n * The url to parse\n *\n * @return {url:URLObject}\n * An object of url details\n */\n\n var parseUrl = function parseUrl(url) {\n var props = ['protocol', 'hostname', 'port', 'pathname', 'search', 'hash', 'host']; // add the url to an anchor and let the browser parse the URL\n\n var a = document.createElement('a');\n a.href = url; // IE8 (and 9?) Fix\n // ie8 doesn't parse the URL correctly until the anchor is actually\n // added to the body, and an innerHTML is needed to trigger the parsing\n\n var addToBody = a.host === '' && a.protocol !== 'file:';\n var div;\n\n if (addToBody) {\n div = document.createElement('div');\n div.innerHTML = \"\";\n a = div.firstChild; // prevent the div from affecting layout\n\n div.setAttribute('style', 'display:none; position:absolute;');\n document.body.appendChild(div);\n } // Copy the specific URL properties to a new object\n // This is also needed for IE8 because the anchor loses its\n // properties when it's removed from the dom\n\n\n var details = {};\n\n for (var i = 0; i < props.length; i++) {\n details[props[i]] = a[props[i]];\n } // IE9 adds the port to the host property unlike everyone else. If\n // a port identifier is added for standard ports, strip it.\n\n\n if (details.protocol === 'http:') {\n details.host = details.host.replace(/:80$/, '');\n }\n\n if (details.protocol === 'https:') {\n details.host = details.host.replace(/:443$/, '');\n }\n\n if (!details.protocol) {\n details.protocol = window$3.location.protocol;\n }\n\n if (addToBody) {\n document.body.removeChild(div);\n }\n\n return details;\n };\n /**\n * Get absolute version of relative URL. Used to tell Flash the correct URL.\n *\n * @function\n * @param {string} url\n * URL to make absolute\n *\n * @return {string}\n * Absolute URL\n *\n * @see http://stackoverflow.com/questions/470832/getting-an-absolute-url-from-a-relative-one-ie6-issue\n */\n\n var getAbsoluteURL = function getAbsoluteURL(url) {\n // Check if absolute URL\n if (!url.match(/^https?:\\/\\//)) {\n // Convert to absolute URL. Flash hosted off-site needs an absolute URL.\n var div = document.createElement('div');\n div.innerHTML = \"x\";\n url = div.firstChild.href;\n }\n\n return url;\n };\n /**\n * Returns the extension of the passed file name. It will return an empty string\n * if passed an invalid path.\n *\n * @function\n * @param {string} path\n * The fileName path like '/path/to/file.mp4'\n *\n * @return {string}\n * The extension in lower case or an empty string if no\n * extension could be found.\n */\n\n var getFileExtension = function getFileExtension(path) {\n if (typeof path === 'string') {\n var splitPathRe = /^(\\/?)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?)(\\.([^\\.\\/\\?]+)))(?:[\\/]*|[\\?].*)$/;\n var pathParts = splitPathRe.exec(path);\n\n if (pathParts) {\n return pathParts.pop().toLowerCase();\n }\n }\n\n return '';\n };\n /**\n * Returns whether the url passed is a cross domain request or not.\n *\n * @function\n * @param {string} url\n * The url to check.\n *\n * @param {Object} [winLoc]\n * the domain to check the url against, defaults to window.location\n *\n * @param {string} [winLoc.protocol]\n * The window location protocol defaults to window.location.protocol\n *\n * @param {string} [winLoc.host]\n * The window location host defaults to window.location.host\n *\n * @return {boolean}\n * Whether it is a cross domain request or not.\n */\n\n var isCrossOrigin = function isCrossOrigin(url, winLoc) {\n if (winLoc === void 0) {\n winLoc = window$3.location;\n }\n\n var urlInfo = parseUrl(url); // IE8 protocol relative urls will return ':' for protocol\n\n var srcProtocol = urlInfo.protocol === ':' ? winLoc.protocol : urlInfo.protocol; // Check if url is for another domain/origin\n // IE8 doesn't know location.origin, so we won't rely on it here\n\n var crossOrigin = srcProtocol + urlInfo.host !== winLoc.protocol + winLoc.host;\n return crossOrigin;\n };\n\n var Url = /*#__PURE__*/Object.freeze({\n parseUrl: parseUrl,\n getAbsoluteURL: getAbsoluteURL,\n getFileExtension: getFileExtension,\n isCrossOrigin: isCrossOrigin\n });\n\n var isFunction_1 = isFunction;\n var toString$1 = Object.prototype.toString;\n\n function isFunction(fn) {\n var string = toString$1.call(fn);\n return string === '[object Function]' || typeof fn === 'function' && string !== '[object RegExp]' || typeof window !== 'undefined' && ( // IE8 and below\n fn === window.setTimeout || fn === window.alert || fn === window.confirm || fn === window.prompt);\n }\n\n /**\n * @license\n * slighly modified parse-headers 2.0.2 \n * Copyright (c) 2014 David Björklund\n * Available under the MIT license\n * \n */\n\n\n var parseHeaders = function parseHeaders(headers) {\n var result = {};\n\n if (!headers) {\n return result;\n }\n\n headers.trim().split('\\n').forEach(function (row) {\n var index = row.indexOf(':');\n var key = row.slice(0, index).trim().toLowerCase();\n var value = row.slice(index + 1).trim();\n\n if (typeof result[key] === 'undefined') {\n result[key] = value;\n } else if (Array.isArray(result[key])) {\n result[key].push(value);\n } else {\n result[key] = [result[key], value];\n }\n });\n return result;\n };\n\n var xhr = createXHR; // Allow use of default import syntax in TypeScript\n\n var default_1 = createXHR;\n createXHR.XMLHttpRequest = window$3.XMLHttpRequest || noop;\n createXHR.XDomainRequest = \"withCredentials\" in new createXHR.XMLHttpRequest() ? createXHR.XMLHttpRequest : window$3.XDomainRequest;\n forEachArray([\"get\", \"put\", \"post\", \"patch\", \"head\", \"delete\"], function (method) {\n createXHR[method === \"delete\" ? \"del\" : method] = function (uri, options, callback) {\n options = initParams(uri, options, callback);\n options.method = method.toUpperCase();\n return _createXHR(options);\n };\n });\n\n function forEachArray(array, iterator) {\n for (var i = 0; i < array.length; i++) {\n iterator(array[i]);\n }\n }\n\n function isEmpty(obj) {\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) return false;\n }\n\n return true;\n }\n\n function initParams(uri, options, callback) {\n var params = uri;\n\n if (isFunction_1(options)) {\n callback = options;\n\n if (typeof uri === \"string\") {\n params = {\n uri: uri\n };\n }\n } else {\n params = _extends_1({}, options, {\n uri: uri\n });\n }\n\n params.callback = callback;\n return params;\n }\n\n function createXHR(uri, options, callback) {\n options = initParams(uri, options, callback);\n return _createXHR(options);\n }\n\n function _createXHR(options) {\n if (typeof options.callback === \"undefined\") {\n throw new Error(\"callback argument missing\");\n }\n\n var called = false;\n\n var callback = function cbOnce(err, response, body) {\n if (!called) {\n called = true;\n options.callback(err, response, body);\n }\n };\n\n function readystatechange() {\n if (xhr.readyState === 4) {\n setTimeout(loadFunc, 0);\n }\n }\n\n function getBody() {\n // Chrome with requestType=blob throws errors arround when even testing access to responseText\n var body = undefined;\n\n if (xhr.response) {\n body = xhr.response;\n } else {\n body = xhr.responseText || getXml(xhr);\n }\n\n if (isJson) {\n try {\n body = JSON.parse(body);\n } catch (e) {}\n }\n\n return body;\n }\n\n function errorFunc(evt) {\n clearTimeout(timeoutTimer);\n\n if (!(evt instanceof Error)) {\n evt = new Error(\"\" + (evt || \"Unknown XMLHttpRequest Error\"));\n }\n\n evt.statusCode = 0;\n return callback(evt, failureResponse);\n } // will load the data & process the response in a special response object\n\n\n function loadFunc() {\n if (aborted) return;\n var status;\n clearTimeout(timeoutTimer);\n\n if (options.useXDR && xhr.status === undefined) {\n //IE8 CORS GET successful response doesn't have a status field, but body is fine\n status = 200;\n } else {\n status = xhr.status === 1223 ? 204 : xhr.status;\n }\n\n var response = failureResponse;\n var err = null;\n\n if (status !== 0) {\n response = {\n body: getBody(),\n statusCode: status,\n method: method,\n headers: {},\n url: uri,\n rawRequest: xhr\n };\n\n if (xhr.getAllResponseHeaders) {\n //remember xhr can in fact be XDR for CORS in IE\n response.headers = parseHeaders(xhr.getAllResponseHeaders());\n }\n } else {\n err = new Error(\"Internal XMLHttpRequest Error\");\n }\n\n return callback(err, response, response.body);\n }\n\n var xhr = options.xhr || null;\n\n if (!xhr) {\n if (options.cors || options.useXDR) {\n xhr = new createXHR.XDomainRequest();\n } else {\n xhr = new createXHR.XMLHttpRequest();\n }\n }\n\n var key;\n var aborted;\n var uri = xhr.url = options.uri || options.url;\n var method = xhr.method = options.method || \"GET\";\n var body = options.body || options.data;\n var headers = xhr.headers = options.headers || {};\n var sync = !!options.sync;\n var isJson = false;\n var timeoutTimer;\n var failureResponse = {\n body: undefined,\n headers: {},\n statusCode: 0,\n method: method,\n url: uri,\n rawRequest: xhr\n };\n\n if (\"json\" in options && options.json !== false) {\n isJson = true;\n headers[\"accept\"] || headers[\"Accept\"] || (headers[\"Accept\"] = \"application/json\"); //Don't override existing accept header declared by user\n\n if (method !== \"GET\" && method !== \"HEAD\") {\n headers[\"content-type\"] || headers[\"Content-Type\"] || (headers[\"Content-Type\"] = \"application/json\"); //Don't override existing accept header declared by user\n\n body = JSON.stringify(options.json === true ? body : options.json);\n }\n }\n\n xhr.onreadystatechange = readystatechange;\n xhr.onload = loadFunc;\n xhr.onerror = errorFunc; // IE9 must have onprogress be set to a unique function.\n\n xhr.onprogress = function () {// IE must die\n };\n\n xhr.onabort = function () {\n aborted = true;\n };\n\n xhr.ontimeout = errorFunc;\n xhr.open(method, uri, !sync, options.username, options.password); //has to be after open\n\n if (!sync) {\n xhr.withCredentials = !!options.withCredentials;\n } // Cannot set timeout with sync request\n // not setting timeout on the xhr object, because of old webkits etc. not handling that correctly\n // both npm's request and jquery 1.x use this kind of timeout, so this is being consistent\n\n\n if (!sync && options.timeout > 0) {\n timeoutTimer = setTimeout(function () {\n if (aborted) return;\n aborted = true; //IE9 may still call readystatechange\n\n xhr.abort(\"timeout\");\n var e = new Error(\"XMLHttpRequest timeout\");\n e.code = \"ETIMEDOUT\";\n errorFunc(e);\n }, options.timeout);\n }\n\n if (xhr.setRequestHeader) {\n for (key in headers) {\n if (headers.hasOwnProperty(key)) {\n xhr.setRequestHeader(key, headers[key]);\n }\n }\n } else if (options.headers && !isEmpty(options.headers)) {\n throw new Error(\"Headers cannot be set on an XDomainRequest object\");\n }\n\n if (\"responseType\" in options) {\n xhr.responseType = options.responseType;\n }\n\n if (\"beforeSend\" in options && typeof options.beforeSend === \"function\") {\n options.beforeSend(xhr);\n } // Microsoft Edge browser sends \"undefined\" when send is called with undefined value.\n // XMLHttpRequest spec says to pass null as body to indicate no body\n // See https://github.com/naugtur/xhr/issues/100.\n\n\n xhr.send(body || null);\n return xhr;\n }\n\n function getXml(xhr) {\n // xhr.responseXML will throw Exception \"InvalidStateError\" or \"DOMException\"\n // See https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseXML.\n try {\n if (xhr.responseType === \"document\") {\n return xhr.responseXML;\n }\n\n var firefoxBugTakenEffect = xhr.responseXML && xhr.responseXML.documentElement.nodeName === \"parsererror\";\n\n if (xhr.responseType === \"\" && !firefoxBugTakenEffect) {\n return xhr.responseXML;\n }\n } catch (e) {}\n\n return null;\n }\n\n function noop() {}\n xhr[\"default\"] = default_1;\n\n /**\n * Takes a webvtt file contents and parses it into cues\n *\n * @param {string} srcContent\n * webVTT file contents\n *\n * @param {TextTrack} track\n * TextTrack to add cues to. Cues come from the srcContent.\n *\n * @private\n */\n\n var parseCues = function parseCues(srcContent, track) {\n var parser = new window$3.WebVTT.Parser(window$3, window$3.vttjs, window$3.WebVTT.StringDecoder());\n var errors = [];\n\n parser.oncue = function (cue) {\n track.addCue(cue);\n };\n\n parser.onparsingerror = function (error) {\n errors.push(error);\n };\n\n parser.onflush = function () {\n track.trigger({\n type: 'loadeddata',\n target: track\n });\n };\n\n parser.parse(srcContent);\n\n if (errors.length > 0) {\n if (window$3.console && window$3.console.groupCollapsed) {\n window$3.console.groupCollapsed(\"Text Track parsing errors for \" + track.src);\n }\n\n errors.forEach(function (error) {\n return log.error(error);\n });\n\n if (window$3.console && window$3.console.groupEnd) {\n window$3.console.groupEnd();\n }\n }\n\n parser.flush();\n };\n /**\n * Load a `TextTrack` from a specified url.\n *\n * @param {string} src\n * Url to load track from.\n *\n * @param {TextTrack} track\n * Track to add cues to. Comes from the content at the end of `url`.\n *\n * @private\n */\n\n\n var loadTrack = function loadTrack(src, track) {\n var opts = {\n uri: src\n };\n var crossOrigin = isCrossOrigin(src);\n\n if (crossOrigin) {\n opts.cors = crossOrigin;\n }\n\n xhr(opts, bind(this, function (err, response, responseBody) {\n if (err) {\n return log.error(err, response);\n }\n\n track.loaded_ = true; // Make sure that vttjs has loaded, otherwise, wait till it finished loading\n // NOTE: this is only used for the alt/video.novtt.js build\n\n if (typeof window$3.WebVTT !== 'function') {\n if (track.tech_) {\n // to prevent use before define eslint error, we define loadHandler\n // as a let here\n track.tech_.any(['vttjsloaded', 'vttjserror'], function (event) {\n if (event.type === 'vttjserror') {\n log.error(\"vttjs failed to load, stopping trying to process \" + track.src);\n return;\n }\n\n return parseCues(responseBody, track);\n });\n }\n } else {\n parseCues(responseBody, track);\n }\n }));\n };\n /**\n * A representation of a single `TextTrack`.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#texttrack}\n * @extends Track\n */\n\n\n var TextTrack = /*#__PURE__*/function (_Track) {\n inheritsLoose(TextTrack, _Track);\n\n /**\n * Create an instance of this class.\n *\n * @param {Object} options={}\n * Object of option names and values\n *\n * @param {Tech} options.tech\n * A reference to the tech that owns this TextTrack.\n *\n * @param {TextTrack~Kind} [options.kind='subtitles']\n * A valid text track kind.\n *\n * @param {TextTrack~Mode} [options.mode='disabled']\n * A valid text track mode.\n *\n * @param {string} [options.id='vjs_track_' + Guid.newGUID()]\n * A unique id for this TextTrack.\n *\n * @param {string} [options.label='']\n * The menu label for this track.\n *\n * @param {string} [options.language='']\n * A valid two character language code.\n *\n * @param {string} [options.srclang='']\n * A valid two character language code. An alternative, but deprioritized\n * version of `options.language`\n *\n * @param {string} [options.src]\n * A url to TextTrack cues.\n *\n * @param {boolean} [options.default]\n * If this track should default to on or off.\n */\n function TextTrack(options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n if (!options.tech) {\n throw new Error('A tech was not provided.');\n }\n\n var settings = mergeOptions(options, {\n kind: TextTrackKind[options.kind] || 'subtitles',\n language: options.language || options.srclang || ''\n });\n var mode = TextTrackMode[settings.mode] || 'disabled';\n var default_ = settings[\"default\"];\n\n if (settings.kind === 'metadata' || settings.kind === 'chapters') {\n mode = 'hidden';\n }\n\n _this = _Track.call(this, settings) || this;\n _this.tech_ = settings.tech;\n _this.cues_ = [];\n _this.activeCues_ = [];\n _this.preload_ = _this.tech_.preloadTextTracks !== false;\n var cues = new TextTrackCueList(_this.cues_);\n var activeCues = new TextTrackCueList(_this.activeCues_);\n var changed = false;\n var timeupdateHandler = bind(assertThisInitialized(_this), function () {\n // Accessing this.activeCues for the side-effects of updating itself\n // due to its nature as a getter function. Do not remove or cues will\n // stop updating!\n // Use the setter to prevent deletion from uglify (pure_getters rule)\n this.activeCues = this.activeCues;\n\n if (changed) {\n this.trigger('cuechange');\n changed = false;\n }\n });\n\n if (mode !== 'disabled') {\n _this.tech_.ready(function () {\n _this.tech_.on('timeupdate', timeupdateHandler);\n }, true);\n }\n\n Object.defineProperties(assertThisInitialized(_this), {\n /**\n * @memberof TextTrack\n * @member {boolean} default\n * If this track was set to be on or off by default. Cannot be changed after\n * creation.\n * @instance\n *\n * @readonly\n */\n \"default\": {\n get: function get() {\n return default_;\n },\n set: function set() {}\n },\n\n /**\n * @memberof TextTrack\n * @member {string} mode\n * Set the mode of this TextTrack to a valid {@link TextTrack~Mode}. Will\n * not be set if setting to an invalid mode.\n * @instance\n *\n * @fires TextTrack#modechange\n */\n mode: {\n get: function get() {\n return mode;\n },\n set: function set(newMode) {\n var _this2 = this;\n\n if (!TextTrackMode[newMode]) {\n return;\n }\n\n mode = newMode;\n\n if (!this.preload_ && mode !== 'disabled' && this.cues.length === 0) {\n // On-demand load.\n loadTrack(this.src, this);\n }\n\n if (mode !== 'disabled') {\n this.tech_.ready(function () {\n _this2.tech_.on('timeupdate', timeupdateHandler);\n }, true);\n } else {\n this.tech_.off('timeupdate', timeupdateHandler);\n }\n /**\n * An event that fires when mode changes on this track. This allows\n * the TextTrackList that holds this track to act accordingly.\n *\n * > Note: This is not part of the spec!\n *\n * @event TextTrack#modechange\n * @type {EventTarget~Event}\n */\n\n\n this.trigger('modechange');\n }\n },\n\n /**\n * @memberof TextTrack\n * @member {TextTrackCueList} cues\n * The text track cue list for this TextTrack.\n * @instance\n */\n cues: {\n get: function get() {\n if (!this.loaded_) {\n return null;\n }\n\n return cues;\n },\n set: function set() {}\n },\n\n /**\n * @memberof TextTrack\n * @member {TextTrackCueList} activeCues\n * The list text track cues that are currently active for this TextTrack.\n * @instance\n */\n activeCues: {\n get: function get() {\n if (!this.loaded_) {\n return null;\n } // nothing to do\n\n\n if (this.cues.length === 0) {\n return activeCues;\n }\n\n var ct = this.tech_.currentTime();\n var active = [];\n\n for (var i = 0, l = this.cues.length; i < l; i++) {\n var cue = this.cues[i];\n\n if (cue.startTime <= ct && cue.endTime >= ct) {\n active.push(cue);\n } else if (cue.startTime === cue.endTime && cue.startTime <= ct && cue.startTime + 0.5 >= ct) {\n active.push(cue);\n }\n }\n\n changed = false;\n\n if (active.length !== this.activeCues_.length) {\n changed = true;\n } else {\n for (var _i = 0; _i < active.length; _i++) {\n if (this.activeCues_.indexOf(active[_i]) === -1) {\n changed = true;\n }\n }\n }\n\n this.activeCues_ = active;\n activeCues.setCues_(this.activeCues_);\n return activeCues;\n },\n // /!\\ Keep this setter empty (see the timeupdate handler above)\n set: function set() {}\n }\n });\n\n if (settings.src) {\n _this.src = settings.src;\n\n if (!_this.preload_) {\n // Tracks will load on-demand.\n // Act like we're loaded for other purposes.\n _this.loaded_ = true;\n }\n\n if (_this.preload_ || default_ || settings.kind !== 'subtitles' && settings.kind !== 'captions') {\n loadTrack(_this.src, assertThisInitialized(_this));\n }\n } else {\n _this.loaded_ = true;\n }\n\n return _this;\n }\n /**\n * Add a cue to the internal list of cues.\n *\n * @param {TextTrack~Cue} cue\n * The cue to add to our internal list\n */\n\n\n var _proto = TextTrack.prototype;\n\n _proto.addCue = function addCue(originalCue) {\n var cue = originalCue;\n\n if (window$3.vttjs && !(originalCue instanceof window$3.vttjs.VTTCue)) {\n cue = new window$3.vttjs.VTTCue(originalCue.startTime, originalCue.endTime, originalCue.text);\n\n for (var prop in originalCue) {\n if (!(prop in cue)) {\n cue[prop] = originalCue[prop];\n }\n } // make sure that `id` is copied over\n\n\n cue.id = originalCue.id;\n cue.originalCue_ = originalCue;\n }\n\n var tracks = this.tech_.textTracks();\n\n for (var i = 0; i < tracks.length; i++) {\n if (tracks[i] !== this) {\n tracks[i].removeCue(cue);\n }\n }\n\n this.cues_.push(cue);\n this.cues.setCues_(this.cues_);\n }\n /**\n * Remove a cue from our internal list\n *\n * @param {TextTrack~Cue} removeCue\n * The cue to remove from our internal list\n */\n ;\n\n _proto.removeCue = function removeCue(_removeCue) {\n var i = this.cues_.length;\n\n while (i--) {\n var cue = this.cues_[i];\n\n if (cue === _removeCue || cue.originalCue_ && cue.originalCue_ === _removeCue) {\n this.cues_.splice(i, 1);\n this.cues.setCues_(this.cues_);\n break;\n }\n }\n };\n\n return TextTrack;\n }(Track);\n /**\n * cuechange - One or more cues in the track have become active or stopped being active.\n */\n\n\n TextTrack.prototype.allowedEvents_ = {\n cuechange: 'cuechange'\n };\n\n /**\n * A representation of a single `AudioTrack`. If it is part of an {@link AudioTrackList}\n * only one `AudioTrack` in the list will be enabled at a time.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#audiotrack}\n * @extends Track\n */\n\n var AudioTrack = /*#__PURE__*/function (_Track) {\n inheritsLoose(AudioTrack, _Track);\n\n /**\n * Create an instance of this class.\n *\n * @param {Object} [options={}]\n * Object of option names and values\n *\n * @param {AudioTrack~Kind} [options.kind='']\n * A valid audio track kind\n *\n * @param {string} [options.id='vjs_track_' + Guid.newGUID()]\n * A unique id for this AudioTrack.\n *\n * @param {string} [options.label='']\n * The menu label for this track.\n *\n * @param {string} [options.language='']\n * A valid two character language code.\n *\n * @param {boolean} [options.enabled]\n * If this track is the one that is currently playing. If this track is part of\n * an {@link AudioTrackList}, only one {@link AudioTrack} will be enabled.\n */\n function AudioTrack(options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n var settings = mergeOptions(options, {\n kind: AudioTrackKind[options.kind] || ''\n });\n _this = _Track.call(this, settings) || this;\n var enabled = false;\n /**\n * @memberof AudioTrack\n * @member {boolean} enabled\n * If this `AudioTrack` is enabled or not. When setting this will\n * fire {@link AudioTrack#enabledchange} if the state of enabled is changed.\n * @instance\n *\n * @fires VideoTrack#selectedchange\n */\n\n Object.defineProperty(assertThisInitialized(_this), 'enabled', {\n get: function get() {\n return enabled;\n },\n set: function set(newEnabled) {\n // an invalid or unchanged value\n if (typeof newEnabled !== 'boolean' || newEnabled === enabled) {\n return;\n }\n\n enabled = newEnabled;\n /**\n * An event that fires when enabled changes on this track. This allows\n * the AudioTrackList that holds this track to act accordingly.\n *\n * > Note: This is not part of the spec! Native tracks will do\n * this internally without an event.\n *\n * @event AudioTrack#enabledchange\n * @type {EventTarget~Event}\n */\n\n this.trigger('enabledchange');\n }\n }); // if the user sets this track to selected then\n // set selected to that true value otherwise\n // we keep it false\n\n if (settings.enabled) {\n _this.enabled = settings.enabled;\n }\n\n _this.loaded_ = true;\n return _this;\n }\n\n return AudioTrack;\n }(Track);\n\n /**\n * A representation of a single `VideoTrack`.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#videotrack}\n * @extends Track\n */\n\n var VideoTrack = /*#__PURE__*/function (_Track) {\n inheritsLoose(VideoTrack, _Track);\n\n /**\n * Create an instance of this class.\n *\n * @param {Object} [options={}]\n * Object of option names and values\n *\n * @param {string} [options.kind='']\n * A valid {@link VideoTrack~Kind}\n *\n * @param {string} [options.id='vjs_track_' + Guid.newGUID()]\n * A unique id for this AudioTrack.\n *\n * @param {string} [options.label='']\n * The menu label for this track.\n *\n * @param {string} [options.language='']\n * A valid two character language code.\n *\n * @param {boolean} [options.selected]\n * If this track is the one that is currently playing.\n */\n function VideoTrack(options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n var settings = mergeOptions(options, {\n kind: VideoTrackKind[options.kind] || ''\n });\n _this = _Track.call(this, settings) || this;\n var selected = false;\n /**\n * @memberof VideoTrack\n * @member {boolean} selected\n * If this `VideoTrack` is selected or not. When setting this will\n * fire {@link VideoTrack#selectedchange} if the state of selected changed.\n * @instance\n *\n * @fires VideoTrack#selectedchange\n */\n\n Object.defineProperty(assertThisInitialized(_this), 'selected', {\n get: function get() {\n return selected;\n },\n set: function set(newSelected) {\n // an invalid or unchanged value\n if (typeof newSelected !== 'boolean' || newSelected === selected) {\n return;\n }\n\n selected = newSelected;\n /**\n * An event that fires when selected changes on this track. This allows\n * the VideoTrackList that holds this track to act accordingly.\n *\n * > Note: This is not part of the spec! Native tracks will do\n * this internally without an event.\n *\n * @event VideoTrack#selectedchange\n * @type {EventTarget~Event}\n */\n\n this.trigger('selectedchange');\n }\n }); // if the user sets this track to selected then\n // set selected to that true value otherwise\n // we keep it false\n\n if (settings.selected) {\n _this.selected = settings.selected;\n }\n\n return _this;\n }\n\n return VideoTrack;\n }(Track);\n\n /**\n * @memberof HTMLTrackElement\n * @typedef {HTMLTrackElement~ReadyState}\n * @enum {number}\n */\n\n var NONE = 0;\n var LOADING = 1;\n var LOADED = 2;\n var ERROR = 3;\n /**\n * A single track represented in the DOM.\n *\n * @see [Spec]{@link https://html.spec.whatwg.org/multipage/embedded-content.html#htmltrackelement}\n * @extends EventTarget\n */\n\n var HTMLTrackElement = /*#__PURE__*/function (_EventTarget) {\n inheritsLoose(HTMLTrackElement, _EventTarget);\n\n /**\n * Create an instance of this class.\n *\n * @param {Object} options={}\n * Object of option names and values\n *\n * @param {Tech} options.tech\n * A reference to the tech that owns this HTMLTrackElement.\n *\n * @param {TextTrack~Kind} [options.kind='subtitles']\n * A valid text track kind.\n *\n * @param {TextTrack~Mode} [options.mode='disabled']\n * A valid text track mode.\n *\n * @param {string} [options.id='vjs_track_' + Guid.newGUID()]\n * A unique id for this TextTrack.\n *\n * @param {string} [options.label='']\n * The menu label for this track.\n *\n * @param {string} [options.language='']\n * A valid two character language code.\n *\n * @param {string} [options.srclang='']\n * A valid two character language code. An alternative, but deprioritized\n * vesion of `options.language`\n *\n * @param {string} [options.src]\n * A url to TextTrack cues.\n *\n * @param {boolean} [options.default]\n * If this track should default to on or off.\n */\n function HTMLTrackElement(options) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n _this = _EventTarget.call(this) || this;\n var readyState;\n var track = new TextTrack(options);\n _this.kind = track.kind;\n _this.src = track.src;\n _this.srclang = track.language;\n _this.label = track.label;\n _this[\"default\"] = track[\"default\"];\n Object.defineProperties(assertThisInitialized(_this), {\n /**\n * @memberof HTMLTrackElement\n * @member {HTMLTrackElement~ReadyState} readyState\n * The current ready state of the track element.\n * @instance\n */\n readyState: {\n get: function get() {\n return readyState;\n }\n },\n\n /**\n * @memberof HTMLTrackElement\n * @member {TextTrack} track\n * The underlying TextTrack object.\n * @instance\n *\n */\n track: {\n get: function get() {\n return track;\n }\n }\n });\n readyState = NONE;\n /**\n * @listens TextTrack#loadeddata\n * @fires HTMLTrackElement#load\n */\n\n track.addEventListener('loadeddata', function () {\n readyState = LOADED;\n\n _this.trigger({\n type: 'load',\n target: assertThisInitialized(_this)\n });\n });\n return _this;\n }\n\n return HTMLTrackElement;\n }(EventTarget);\n\n HTMLTrackElement.prototype.allowedEvents_ = {\n load: 'load'\n };\n HTMLTrackElement.NONE = NONE;\n HTMLTrackElement.LOADING = LOADING;\n HTMLTrackElement.LOADED = LOADED;\n HTMLTrackElement.ERROR = ERROR;\n\n /*\n * This file contains all track properties that are used in\n * player.js, tech.js, html5.js and possibly other techs in the future.\n */\n\n var NORMAL = {\n audio: {\n ListClass: AudioTrackList,\n TrackClass: AudioTrack,\n capitalName: 'Audio'\n },\n video: {\n ListClass: VideoTrackList,\n TrackClass: VideoTrack,\n capitalName: 'Video'\n },\n text: {\n ListClass: TextTrackList,\n TrackClass: TextTrack,\n capitalName: 'Text'\n }\n };\n Object.keys(NORMAL).forEach(function (type) {\n NORMAL[type].getterName = type + \"Tracks\";\n NORMAL[type].privateName = type + \"Tracks_\";\n });\n var REMOTE = {\n remoteText: {\n ListClass: TextTrackList,\n TrackClass: TextTrack,\n capitalName: 'RemoteText',\n getterName: 'remoteTextTracks',\n privateName: 'remoteTextTracks_'\n },\n remoteTextEl: {\n ListClass: HtmlTrackElementList,\n TrackClass: HTMLTrackElement,\n capitalName: 'RemoteTextTrackEls',\n getterName: 'remoteTextTrackEls',\n privateName: 'remoteTextTrackEls_'\n }\n };\n\n var ALL = _extends_1({}, NORMAL, REMOTE);\n\n REMOTE.names = Object.keys(REMOTE);\n NORMAL.names = Object.keys(NORMAL);\n ALL.names = [].concat(REMOTE.names).concat(NORMAL.names);\n\n /**\n * Copyright 2013 vtt.js Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n\n /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */\n\n var _objCreate = Object.create || function () {\n function F() {}\n\n return function (o) {\n if (arguments.length !== 1) {\n throw new Error('Object.create shim only accepts one parameter.');\n }\n\n F.prototype = o;\n return new F();\n };\n }(); // Creates a new ParserError object from an errorData object. The errorData\n // object should have default code and message properties. The default message\n // property can be overriden by passing in a message parameter.\n // See ParsingError.Errors below for acceptable errors.\n\n\n function ParsingError(errorData, message) {\n this.name = \"ParsingError\";\n this.code = errorData.code;\n this.message = message || errorData.message;\n }\n\n ParsingError.prototype = _objCreate(Error.prototype);\n ParsingError.prototype.constructor = ParsingError; // ParsingError metadata for acceptable ParsingErrors.\n\n ParsingError.Errors = {\n BadSignature: {\n code: 0,\n message: \"Malformed WebVTT signature.\"\n },\n BadTimeStamp: {\n code: 1,\n message: \"Malformed time stamp.\"\n }\n }; // Try to parse input as a time stamp.\n\n function parseTimeStamp(input) {\n function computeSeconds(h, m, s, f) {\n return (h | 0) * 3600 + (m | 0) * 60 + (s | 0) + (f | 0) / 1000;\n }\n\n var m = input.match(/^(\\d+):(\\d{1,2})(:\\d{1,2})?\\.(\\d{3})/);\n\n if (!m) {\n return null;\n }\n\n if (m[3]) {\n // Timestamp takes the form of [hours]:[minutes]:[seconds].[milliseconds]\n return computeSeconds(m[1], m[2], m[3].replace(\":\", \"\"), m[4]);\n } else if (m[1] > 59) {\n // Timestamp takes the form of [hours]:[minutes].[milliseconds]\n // First position is hours as it's over 59.\n return computeSeconds(m[1], m[2], 0, m[4]);\n } else {\n // Timestamp takes the form of [minutes]:[seconds].[milliseconds]\n return computeSeconds(0, m[1], m[2], m[4]);\n }\n } // A settings object holds key/value pairs and will ignore anything but the first\n // assignment to a specific key.\n\n\n function Settings() {\n this.values = _objCreate(null);\n }\n\n Settings.prototype = {\n // Only accept the first assignment to any key.\n set: function set(k, v) {\n if (!this.get(k) && v !== \"\") {\n this.values[k] = v;\n }\n },\n // Return the value for a key, or a default value.\n // If 'defaultKey' is passed then 'dflt' is assumed to be an object with\n // a number of possible default values as properties where 'defaultKey' is\n // the key of the property that will be chosen; otherwise it's assumed to be\n // a single value.\n get: function get(k, dflt, defaultKey) {\n if (defaultKey) {\n return this.has(k) ? this.values[k] : dflt[defaultKey];\n }\n\n return this.has(k) ? this.values[k] : dflt;\n },\n // Check whether we have a value for a key.\n has: function has(k) {\n return k in this.values;\n },\n // Accept a setting if its one of the given alternatives.\n alt: function alt(k, v, a) {\n for (var n = 0; n < a.length; ++n) {\n if (v === a[n]) {\n this.set(k, v);\n break;\n }\n }\n },\n // Accept a setting if its a valid (signed) integer.\n integer: function integer(k, v) {\n if (/^-?\\d+$/.test(v)) {\n // integer\n this.set(k, parseInt(v, 10));\n }\n },\n // Accept a setting if its a valid percentage.\n percent: function percent(k, v) {\n var m;\n\n if (m = v.match(/^([\\d]{1,3})(\\.[\\d]*)?%$/)) {\n v = parseFloat(v);\n\n if (v >= 0 && v <= 100) {\n this.set(k, v);\n return true;\n }\n }\n\n return false;\n }\n }; // Helper function to parse input into groups separated by 'groupDelim', and\n // interprete each group as a key/value pair separated by 'keyValueDelim'.\n\n function parseOptions(input, callback, keyValueDelim, groupDelim) {\n var groups = groupDelim ? input.split(groupDelim) : [input];\n\n for (var i in groups) {\n if (typeof groups[i] !== \"string\") {\n continue;\n }\n\n var kv = groups[i].split(keyValueDelim);\n\n if (kv.length !== 2) {\n continue;\n }\n\n var k = kv[0];\n var v = kv[1];\n callback(k, v);\n }\n }\n\n function parseCue(input, cue, regionList) {\n // Remember the original input if we need to throw an error.\n var oInput = input; // 4.1 WebVTT timestamp\n\n function consumeTimeStamp() {\n var ts = parseTimeStamp(input);\n\n if (ts === null) {\n throw new ParsingError(ParsingError.Errors.BadTimeStamp, \"Malformed timestamp: \" + oInput);\n } // Remove time stamp from input.\n\n\n input = input.replace(/^[^\\sa-zA-Z-]+/, \"\");\n return ts;\n } // 4.4.2 WebVTT cue settings\n\n\n function consumeCueSettings(input, cue) {\n var settings = new Settings();\n parseOptions(input, function (k, v) {\n switch (k) {\n case \"region\":\n // Find the last region we parsed with the same region id.\n for (var i = regionList.length - 1; i >= 0; i--) {\n if (regionList[i].id === v) {\n settings.set(k, regionList[i].region);\n break;\n }\n }\n\n break;\n\n case \"vertical\":\n settings.alt(k, v, [\"rl\", \"lr\"]);\n break;\n\n case \"line\":\n var vals = v.split(\",\"),\n vals0 = vals[0];\n settings.integer(k, vals0);\n settings.percent(k, vals0) ? settings.set(\"snapToLines\", false) : null;\n settings.alt(k, vals0, [\"auto\"]);\n\n if (vals.length === 2) {\n settings.alt(\"lineAlign\", vals[1], [\"start\", \"center\", \"end\"]);\n }\n\n break;\n\n case \"position\":\n vals = v.split(\",\");\n settings.percent(k, vals[0]);\n\n if (vals.length === 2) {\n settings.alt(\"positionAlign\", vals[1], [\"start\", \"center\", \"end\"]);\n }\n\n break;\n\n case \"size\":\n settings.percent(k, v);\n break;\n\n case \"align\":\n settings.alt(k, v, [\"start\", \"center\", \"end\", \"left\", \"right\"]);\n break;\n }\n }, /:/, /\\s/); // Apply default values for any missing fields.\n\n cue.region = settings.get(\"region\", null);\n cue.vertical = settings.get(\"vertical\", \"\");\n\n try {\n cue.line = settings.get(\"line\", \"auto\");\n } catch (e) {}\n\n cue.lineAlign = settings.get(\"lineAlign\", \"start\");\n cue.snapToLines = settings.get(\"snapToLines\", true);\n cue.size = settings.get(\"size\", 100); // Safari still uses the old middle value and won't accept center\n\n try {\n cue.align = settings.get(\"align\", \"center\");\n } catch (e) {\n cue.align = settings.get(\"align\", \"middle\");\n }\n\n try {\n cue.position = settings.get(\"position\", \"auto\");\n } catch (e) {\n cue.position = settings.get(\"position\", {\n start: 0,\n left: 0,\n center: 50,\n middle: 50,\n end: 100,\n right: 100\n }, cue.align);\n }\n\n cue.positionAlign = settings.get(\"positionAlign\", {\n start: \"start\",\n left: \"start\",\n center: \"center\",\n middle: \"center\",\n end: \"end\",\n right: \"end\"\n }, cue.align);\n }\n\n function skipWhitespace() {\n input = input.replace(/^\\s+/, \"\");\n } // 4.1 WebVTT cue timings.\n\n\n skipWhitespace();\n cue.startTime = consumeTimeStamp(); // (1) collect cue start time\n\n skipWhitespace();\n\n if (input.substr(0, 3) !== \"-->\") {\n // (3) next characters must match \"-->\"\n throw new ParsingError(ParsingError.Errors.BadTimeStamp, \"Malformed time stamp (time stamps must be separated by '-->'): \" + oInput);\n }\n\n input = input.substr(3);\n skipWhitespace();\n cue.endTime = consumeTimeStamp(); // (5) collect cue end time\n // 4.1 WebVTT cue settings list.\n\n skipWhitespace();\n consumeCueSettings(input, cue);\n }\n\n var TEXTAREA_ELEMENT = document.createElement(\"textarea\");\n var TAG_NAME = {\n c: \"span\",\n i: \"i\",\n b: \"b\",\n u: \"u\",\n ruby: \"ruby\",\n rt: \"rt\",\n v: \"span\",\n lang: \"span\"\n }; // 5.1 default text color\n // 5.2 default text background color is equivalent to text color with bg_ prefix\n\n var DEFAULT_COLOR_CLASS = {\n white: 'rgba(255,255,255,1)',\n lime: 'rgba(0,255,0,1)',\n cyan: 'rgba(0,255,255,1)',\n red: 'rgba(255,0,0,1)',\n yellow: 'rgba(255,255,0,1)',\n magenta: 'rgba(255,0,255,1)',\n blue: 'rgba(0,0,255,1)',\n black: 'rgba(0,0,0,1)'\n };\n var TAG_ANNOTATION = {\n v: \"title\",\n lang: \"lang\"\n };\n var NEEDS_PARENT = {\n rt: \"ruby\"\n }; // Parse content into a document fragment.\n\n function parseContent(window, input) {\n function nextToken() {\n // Check for end-of-string.\n if (!input) {\n return null;\n } // Consume 'n' characters from the input.\n\n\n function consume(result) {\n input = input.substr(result.length);\n return result;\n }\n\n var m = input.match(/^([^<]*)(<[^>]*>?)?/); // If there is some text before the next tag, return it, otherwise return\n // the tag.\n\n return consume(m[1] ? m[1] : m[2]);\n }\n\n function unescape(s) {\n TEXTAREA_ELEMENT.innerHTML = s;\n s = TEXTAREA_ELEMENT.textContent;\n TEXTAREA_ELEMENT.textContent = \"\";\n return s;\n }\n\n function shouldAdd(current, element) {\n return !NEEDS_PARENT[element.localName] || NEEDS_PARENT[element.localName] === current.localName;\n } // Create an element for this tag.\n\n\n function createElement(type, annotation) {\n var tagName = TAG_NAME[type];\n\n if (!tagName) {\n return null;\n }\n\n var element = window.document.createElement(tagName);\n var name = TAG_ANNOTATION[type];\n\n if (name && annotation) {\n element[name] = annotation.trim();\n }\n\n return element;\n }\n\n var rootDiv = window.document.createElement(\"div\"),\n current = rootDiv,\n t,\n tagStack = [];\n\n while ((t = nextToken()) !== null) {\n if (t[0] === '<') {\n if (t[1] === \"/\") {\n // If the closing tag matches, move back up to the parent node.\n if (tagStack.length && tagStack[tagStack.length - 1] === t.substr(2).replace(\">\", \"\")) {\n tagStack.pop();\n current = current.parentNode;\n } // Otherwise just ignore the end tag.\n\n\n continue;\n }\n\n var ts = parseTimeStamp(t.substr(1, t.length - 2));\n var node;\n\n if (ts) {\n // Timestamps are lead nodes as well.\n node = window.document.createProcessingInstruction(\"timestamp\", ts);\n current.appendChild(node);\n continue;\n }\n\n var m = t.match(/^<([^.\\s/0-9>]+)(\\.[^\\s\\\\>]+)?([^>\\\\]+)?(\\\\?)>?$/); // If we can't parse the tag, skip to the next tag.\n\n if (!m) {\n continue;\n } // Try to construct an element, and ignore the tag if we couldn't.\n\n\n node = createElement(m[1], m[3]);\n\n if (!node) {\n continue;\n } // Determine if the tag should be added based on the context of where it\n // is placed in the cuetext.\n\n\n if (!shouldAdd(current, node)) {\n continue;\n } // Set the class list (as a list of classes, separated by space).\n\n\n if (m[2]) {\n var classes = m[2].split('.');\n classes.forEach(function (cl) {\n var bgColor = /^bg_/.test(cl); // slice out `bg_` if it's a background color\n\n var colorName = bgColor ? cl.slice(3) : cl;\n\n if (DEFAULT_COLOR_CLASS.hasOwnProperty(colorName)) {\n var propName = bgColor ? 'background-color' : 'color';\n var propValue = DEFAULT_COLOR_CLASS[colorName];\n node.style[propName] = propValue;\n }\n });\n node.className = classes.join(' ');\n } // Append the node to the current node, and enter the scope of the new\n // node.\n\n\n tagStack.push(m[1]);\n current.appendChild(node);\n current = node;\n continue;\n } // Text nodes are leaf nodes.\n\n\n current.appendChild(window.document.createTextNode(unescape(t)));\n }\n\n return rootDiv;\n } // This is a list of all the Unicode characters that have a strong\n // right-to-left category. What this means is that these characters are\n // written right-to-left for sure. It was generated by pulling all the strong\n // right-to-left characters out of the Unicode data table. That table can\n // found at: http://www.unicode.org/Public/UNIDATA/UnicodeData.txt\n\n\n var strongRTLRanges = [[0x5be, 0x5be], [0x5c0, 0x5c0], [0x5c3, 0x5c3], [0x5c6, 0x5c6], [0x5d0, 0x5ea], [0x5f0, 0x5f4], [0x608, 0x608], [0x60b, 0x60b], [0x60d, 0x60d], [0x61b, 0x61b], [0x61e, 0x64a], [0x66d, 0x66f], [0x671, 0x6d5], [0x6e5, 0x6e6], [0x6ee, 0x6ef], [0x6fa, 0x70d], [0x70f, 0x710], [0x712, 0x72f], [0x74d, 0x7a5], [0x7b1, 0x7b1], [0x7c0, 0x7ea], [0x7f4, 0x7f5], [0x7fa, 0x7fa], [0x800, 0x815], [0x81a, 0x81a], [0x824, 0x824], [0x828, 0x828], [0x830, 0x83e], [0x840, 0x858], [0x85e, 0x85e], [0x8a0, 0x8a0], [0x8a2, 0x8ac], [0x200f, 0x200f], [0xfb1d, 0xfb1d], [0xfb1f, 0xfb28], [0xfb2a, 0xfb36], [0xfb38, 0xfb3c], [0xfb3e, 0xfb3e], [0xfb40, 0xfb41], [0xfb43, 0xfb44], [0xfb46, 0xfbc1], [0xfbd3, 0xfd3d], [0xfd50, 0xfd8f], [0xfd92, 0xfdc7], [0xfdf0, 0xfdfc], [0xfe70, 0xfe74], [0xfe76, 0xfefc], [0x10800, 0x10805], [0x10808, 0x10808], [0x1080a, 0x10835], [0x10837, 0x10838], [0x1083c, 0x1083c], [0x1083f, 0x10855], [0x10857, 0x1085f], [0x10900, 0x1091b], [0x10920, 0x10939], [0x1093f, 0x1093f], [0x10980, 0x109b7], [0x109be, 0x109bf], [0x10a00, 0x10a00], [0x10a10, 0x10a13], [0x10a15, 0x10a17], [0x10a19, 0x10a33], [0x10a40, 0x10a47], [0x10a50, 0x10a58], [0x10a60, 0x10a7f], [0x10b00, 0x10b35], [0x10b40, 0x10b55], [0x10b58, 0x10b72], [0x10b78, 0x10b7f], [0x10c00, 0x10c48], [0x1ee00, 0x1ee03], [0x1ee05, 0x1ee1f], [0x1ee21, 0x1ee22], [0x1ee24, 0x1ee24], [0x1ee27, 0x1ee27], [0x1ee29, 0x1ee32], [0x1ee34, 0x1ee37], [0x1ee39, 0x1ee39], [0x1ee3b, 0x1ee3b], [0x1ee42, 0x1ee42], [0x1ee47, 0x1ee47], [0x1ee49, 0x1ee49], [0x1ee4b, 0x1ee4b], [0x1ee4d, 0x1ee4f], [0x1ee51, 0x1ee52], [0x1ee54, 0x1ee54], [0x1ee57, 0x1ee57], [0x1ee59, 0x1ee59], [0x1ee5b, 0x1ee5b], [0x1ee5d, 0x1ee5d], [0x1ee5f, 0x1ee5f], [0x1ee61, 0x1ee62], [0x1ee64, 0x1ee64], [0x1ee67, 0x1ee6a], [0x1ee6c, 0x1ee72], [0x1ee74, 0x1ee77], [0x1ee79, 0x1ee7c], [0x1ee7e, 0x1ee7e], [0x1ee80, 0x1ee89], [0x1ee8b, 0x1ee9b], [0x1eea1, 0x1eea3], [0x1eea5, 0x1eea9], [0x1eeab, 0x1eebb], [0x10fffd, 0x10fffd]];\n\n function isStrongRTLChar(charCode) {\n for (var i = 0; i < strongRTLRanges.length; i++) {\n var currentRange = strongRTLRanges[i];\n\n if (charCode >= currentRange[0] && charCode <= currentRange[1]) {\n return true;\n }\n }\n\n return false;\n }\n\n function determineBidi(cueDiv) {\n var nodeStack = [],\n text = \"\",\n charCode;\n\n if (!cueDiv || !cueDiv.childNodes) {\n return \"ltr\";\n }\n\n function pushNodes(nodeStack, node) {\n for (var i = node.childNodes.length - 1; i >= 0; i--) {\n nodeStack.push(node.childNodes[i]);\n }\n }\n\n function nextTextNode(nodeStack) {\n if (!nodeStack || !nodeStack.length) {\n return null;\n }\n\n var node = nodeStack.pop(),\n text = node.textContent || node.innerText;\n\n if (text) {\n // TODO: This should match all unicode type B characters (paragraph\n // separator characters). See issue #115.\n var m = text.match(/^.*(\\n|\\r)/);\n\n if (m) {\n nodeStack.length = 0;\n return m[0];\n }\n\n return text;\n }\n\n if (node.tagName === \"ruby\") {\n return nextTextNode(nodeStack);\n }\n\n if (node.childNodes) {\n pushNodes(nodeStack, node);\n return nextTextNode(nodeStack);\n }\n }\n\n pushNodes(nodeStack, cueDiv);\n\n while (text = nextTextNode(nodeStack)) {\n for (var i = 0; i < text.length; i++) {\n charCode = text.charCodeAt(i);\n\n if (isStrongRTLChar(charCode)) {\n return \"rtl\";\n }\n }\n }\n\n return \"ltr\";\n }\n\n function computeLinePos(cue) {\n if (typeof cue.line === \"number\" && (cue.snapToLines || cue.line >= 0 && cue.line <= 100)) {\n return cue.line;\n }\n\n if (!cue.track || !cue.track.textTrackList || !cue.track.textTrackList.mediaElement) {\n return -1;\n }\n\n var track = cue.track,\n trackList = track.textTrackList,\n count = 0;\n\n for (var i = 0; i < trackList.length && trackList[i] !== track; i++) {\n if (trackList[i].mode === \"showing\") {\n count++;\n }\n }\n\n return ++count * -1;\n }\n\n function StyleBox() {} // Apply styles to a div. If there is no div passed then it defaults to the\n // div on 'this'.\n\n\n StyleBox.prototype.applyStyles = function (styles, div) {\n div = div || this.div;\n\n for (var prop in styles) {\n if (styles.hasOwnProperty(prop)) {\n div.style[prop] = styles[prop];\n }\n }\n };\n\n StyleBox.prototype.formatStyle = function (val, unit) {\n return val === 0 ? 0 : val + unit;\n }; // Constructs the computed display state of the cue (a div). Places the div\n // into the overlay which should be a block level element (usually a div).\n\n\n function CueStyleBox(window, cue, styleOptions) {\n StyleBox.call(this);\n this.cue = cue; // Parse our cue's text into a DOM tree rooted at 'cueDiv'. This div will\n // have inline positioning and will function as the cue background box.\n\n this.cueDiv = parseContent(window, cue.text);\n var styles = {\n color: \"rgba(255, 255, 255, 1)\",\n backgroundColor: \"rgba(0, 0, 0, 0.8)\",\n position: \"relative\",\n left: 0,\n right: 0,\n top: 0,\n bottom: 0,\n display: \"inline\",\n writingMode: cue.vertical === \"\" ? \"horizontal-tb\" : cue.vertical === \"lr\" ? \"vertical-lr\" : \"vertical-rl\",\n unicodeBidi: \"plaintext\"\n };\n this.applyStyles(styles, this.cueDiv); // Create an absolutely positioned div that will be used to position the cue\n // div. Note, all WebVTT cue-setting alignments are equivalent to the CSS\n // mirrors of them except middle instead of center on Safari.\n\n this.div = window.document.createElement(\"div\");\n styles = {\n direction: determineBidi(this.cueDiv),\n writingMode: cue.vertical === \"\" ? \"horizontal-tb\" : cue.vertical === \"lr\" ? \"vertical-lr\" : \"vertical-rl\",\n unicodeBidi: \"plaintext\",\n textAlign: cue.align === \"middle\" ? \"center\" : cue.align,\n font: styleOptions.font,\n whiteSpace: \"pre-line\",\n position: \"absolute\"\n };\n this.applyStyles(styles);\n this.div.appendChild(this.cueDiv); // Calculate the distance from the reference edge of the viewport to the text\n // position of the cue box. The reference edge will be resolved later when\n // the box orientation styles are applied.\n\n var textPos = 0;\n\n switch (cue.positionAlign) {\n case \"start\":\n textPos = cue.position;\n break;\n\n case \"center\":\n textPos = cue.position - cue.size / 2;\n break;\n\n case \"end\":\n textPos = cue.position - cue.size;\n break;\n } // Horizontal box orientation; textPos is the distance from the left edge of the\n // area to the left edge of the box and cue.size is the distance extending to\n // the right from there.\n\n\n if (cue.vertical === \"\") {\n this.applyStyles({\n left: this.formatStyle(textPos, \"%\"),\n width: this.formatStyle(cue.size, \"%\")\n }); // Vertical box orientation; textPos is the distance from the top edge of the\n // area to the top edge of the box and cue.size is the height extending\n // downwards from there.\n } else {\n this.applyStyles({\n top: this.formatStyle(textPos, \"%\"),\n height: this.formatStyle(cue.size, \"%\")\n });\n }\n\n this.move = function (box) {\n this.applyStyles({\n top: this.formatStyle(box.top, \"px\"),\n bottom: this.formatStyle(box.bottom, \"px\"),\n left: this.formatStyle(box.left, \"px\"),\n right: this.formatStyle(box.right, \"px\"),\n height: this.formatStyle(box.height, \"px\"),\n width: this.formatStyle(box.width, \"px\")\n });\n };\n }\n\n CueStyleBox.prototype = _objCreate(StyleBox.prototype);\n CueStyleBox.prototype.constructor = CueStyleBox; // Represents the co-ordinates of an Element in a way that we can easily\n // compute things with such as if it overlaps or intersects with another Element.\n // Can initialize it with either a StyleBox or another BoxPosition.\n\n function BoxPosition(obj) {\n // Either a BoxPosition was passed in and we need to copy it, or a StyleBox\n // was passed in and we need to copy the results of 'getBoundingClientRect'\n // as the object returned is readonly. All co-ordinate values are in reference\n // to the viewport origin (top left).\n var lh, height, width, top;\n\n if (obj.div) {\n height = obj.div.offsetHeight;\n width = obj.div.offsetWidth;\n top = obj.div.offsetTop;\n var rects = (rects = obj.div.childNodes) && (rects = rects[0]) && rects.getClientRects && rects.getClientRects();\n obj = obj.div.getBoundingClientRect(); // In certain cases the outter div will be slightly larger then the sum of\n // the inner div's lines. This could be due to bold text, etc, on some platforms.\n // In this case we should get the average line height and use that. This will\n // result in the desired behaviour.\n\n lh = rects ? Math.max(rects[0] && rects[0].height || 0, obj.height / rects.length) : 0;\n }\n\n this.left = obj.left;\n this.right = obj.right;\n this.top = obj.top || top;\n this.height = obj.height || height;\n this.bottom = obj.bottom || top + (obj.height || height);\n this.width = obj.width || width;\n this.lineHeight = lh !== undefined ? lh : obj.lineHeight;\n } // Move the box along a particular axis. Optionally pass in an amount to move\n // the box. If no amount is passed then the default is the line height of the\n // box.\n\n\n BoxPosition.prototype.move = function (axis, toMove) {\n toMove = toMove !== undefined ? toMove : this.lineHeight;\n\n switch (axis) {\n case \"+x\":\n this.left += toMove;\n this.right += toMove;\n break;\n\n case \"-x\":\n this.left -= toMove;\n this.right -= toMove;\n break;\n\n case \"+y\":\n this.top += toMove;\n this.bottom += toMove;\n break;\n\n case \"-y\":\n this.top -= toMove;\n this.bottom -= toMove;\n break;\n }\n }; // Check if this box overlaps another box, b2.\n\n\n BoxPosition.prototype.overlaps = function (b2) {\n return this.left < b2.right && this.right > b2.left && this.top < b2.bottom && this.bottom > b2.top;\n }; // Check if this box overlaps any other boxes in boxes.\n\n\n BoxPosition.prototype.overlapsAny = function (boxes) {\n for (var i = 0; i < boxes.length; i++) {\n if (this.overlaps(boxes[i])) {\n return true;\n }\n }\n\n return false;\n }; // Check if this box is within another box.\n\n\n BoxPosition.prototype.within = function (container) {\n return this.top >= container.top && this.bottom <= container.bottom && this.left >= container.left && this.right <= container.right;\n }; // Check if this box is entirely within the container or it is overlapping\n // on the edge opposite of the axis direction passed. For example, if \"+x\" is\n // passed and the box is overlapping on the left edge of the container, then\n // return true.\n\n\n BoxPosition.prototype.overlapsOppositeAxis = function (container, axis) {\n switch (axis) {\n case \"+x\":\n return this.left < container.left;\n\n case \"-x\":\n return this.right > container.right;\n\n case \"+y\":\n return this.top < container.top;\n\n case \"-y\":\n return this.bottom > container.bottom;\n }\n }; // Find the percentage of the area that this box is overlapping with another\n // box.\n\n\n BoxPosition.prototype.intersectPercentage = function (b2) {\n var x = Math.max(0, Math.min(this.right, b2.right) - Math.max(this.left, b2.left)),\n y = Math.max(0, Math.min(this.bottom, b2.bottom) - Math.max(this.top, b2.top)),\n intersectArea = x * y;\n return intersectArea / (this.height * this.width);\n }; // Convert the positions from this box to CSS compatible positions using\n // the reference container's positions. This has to be done because this\n // box's positions are in reference to the viewport origin, whereas, CSS\n // values are in referecne to their respective edges.\n\n\n BoxPosition.prototype.toCSSCompatValues = function (reference) {\n return {\n top: this.top - reference.top,\n bottom: reference.bottom - this.bottom,\n left: this.left - reference.left,\n right: reference.right - this.right,\n height: this.height,\n width: this.width\n };\n }; // Get an object that represents the box's position without anything extra.\n // Can pass a StyleBox, HTMLElement, or another BoxPositon.\n\n\n BoxPosition.getSimpleBoxPosition = function (obj) {\n var height = obj.div ? obj.div.offsetHeight : obj.tagName ? obj.offsetHeight : 0;\n var width = obj.div ? obj.div.offsetWidth : obj.tagName ? obj.offsetWidth : 0;\n var top = obj.div ? obj.div.offsetTop : obj.tagName ? obj.offsetTop : 0;\n obj = obj.div ? obj.div.getBoundingClientRect() : obj.tagName ? obj.getBoundingClientRect() : obj;\n var ret = {\n left: obj.left,\n right: obj.right,\n top: obj.top || top,\n height: obj.height || height,\n bottom: obj.bottom || top + (obj.height || height),\n width: obj.width || width\n };\n return ret;\n }; // Move a StyleBox to its specified, or next best, position. The containerBox\n // is the box that contains the StyleBox, such as a div. boxPositions are\n // a list of other boxes that the styleBox can't overlap with.\n\n\n function moveBoxToLinePosition(window, styleBox, containerBox, boxPositions) {\n // Find the best position for a cue box, b, on the video. The axis parameter\n // is a list of axis, the order of which, it will move the box along. For example:\n // Passing [\"+x\", \"-x\"] will move the box first along the x axis in the positive\n // direction. If it doesn't find a good position for it there it will then move\n // it along the x axis in the negative direction.\n function findBestPosition(b, axis) {\n var bestPosition,\n specifiedPosition = new BoxPosition(b),\n percentage = 1; // Highest possible so the first thing we get is better.\n\n for (var i = 0; i < axis.length; i++) {\n while (b.overlapsOppositeAxis(containerBox, axis[i]) || b.within(containerBox) && b.overlapsAny(boxPositions)) {\n b.move(axis[i]);\n } // We found a spot where we aren't overlapping anything. This is our\n // best position.\n\n\n if (b.within(containerBox)) {\n return b;\n }\n\n var p = b.intersectPercentage(containerBox); // If we're outside the container box less then we were on our last try\n // then remember this position as the best position.\n\n if (percentage > p) {\n bestPosition = new BoxPosition(b);\n percentage = p;\n } // Reset the box position to the specified position.\n\n\n b = new BoxPosition(specifiedPosition);\n }\n\n return bestPosition || specifiedPosition;\n }\n\n var boxPosition = new BoxPosition(styleBox),\n cue = styleBox.cue,\n linePos = computeLinePos(cue),\n axis = []; // If we have a line number to align the cue to.\n\n if (cue.snapToLines) {\n var size;\n\n switch (cue.vertical) {\n case \"\":\n axis = [\"+y\", \"-y\"];\n size = \"height\";\n break;\n\n case \"rl\":\n axis = [\"+x\", \"-x\"];\n size = \"width\";\n break;\n\n case \"lr\":\n axis = [\"-x\", \"+x\"];\n size = \"width\";\n break;\n }\n\n var step = boxPosition.lineHeight,\n position = step * Math.round(linePos),\n maxPosition = containerBox[size] + step,\n initialAxis = axis[0]; // If the specified intial position is greater then the max position then\n // clamp the box to the amount of steps it would take for the box to\n // reach the max position.\n\n if (Math.abs(position) > maxPosition) {\n position = position < 0 ? -1 : 1;\n position *= Math.ceil(maxPosition / step) * step;\n } // If computed line position returns negative then line numbers are\n // relative to the bottom of the video instead of the top. Therefore, we\n // need to increase our initial position by the length or width of the\n // video, depending on the writing direction, and reverse our axis directions.\n\n\n if (linePos < 0) {\n position += cue.vertical === \"\" ? containerBox.height : containerBox.width;\n axis = axis.reverse();\n } // Move the box to the specified position. This may not be its best\n // position.\n\n\n boxPosition.move(initialAxis, position);\n } else {\n // If we have a percentage line value for the cue.\n var calculatedPercentage = boxPosition.lineHeight / containerBox.height * 100;\n\n switch (cue.lineAlign) {\n case \"center\":\n linePos -= calculatedPercentage / 2;\n break;\n\n case \"end\":\n linePos -= calculatedPercentage;\n break;\n } // Apply initial line position to the cue box.\n\n\n switch (cue.vertical) {\n case \"\":\n styleBox.applyStyles({\n top: styleBox.formatStyle(linePos, \"%\")\n });\n break;\n\n case \"rl\":\n styleBox.applyStyles({\n left: styleBox.formatStyle(linePos, \"%\")\n });\n break;\n\n case \"lr\":\n styleBox.applyStyles({\n right: styleBox.formatStyle(linePos, \"%\")\n });\n break;\n }\n\n axis = [\"+y\", \"-x\", \"+x\", \"-y\"]; // Get the box position again after we've applied the specified positioning\n // to it.\n\n boxPosition = new BoxPosition(styleBox);\n }\n\n var bestPosition = findBestPosition(boxPosition, axis);\n styleBox.move(bestPosition.toCSSCompatValues(containerBox));\n }\n\n function WebVTT$1() {} // Nothing\n // Helper to allow strings to be decoded instead of the default binary utf8 data.\n\n\n WebVTT$1.StringDecoder = function () {\n return {\n decode: function decode(data) {\n if (!data) {\n return \"\";\n }\n\n if (typeof data !== \"string\") {\n throw new Error(\"Error - expected string data.\");\n }\n\n return decodeURIComponent(encodeURIComponent(data));\n }\n };\n };\n\n WebVTT$1.convertCueToDOMTree = function (window, cuetext) {\n if (!window || !cuetext) {\n return null;\n }\n\n return parseContent(window, cuetext);\n };\n\n var FONT_SIZE_PERCENT = 0.05;\n var FONT_STYLE = \"sans-serif\";\n var CUE_BACKGROUND_PADDING = \"1.5%\"; // Runs the processing model over the cues and regions passed to it.\n // @param overlay A block level element (usually a div) that the computed cues\n // and regions will be placed into.\n\n WebVTT$1.processCues = function (window, cues, overlay) {\n if (!window || !cues || !overlay) {\n return null;\n } // Remove all previous children.\n\n\n while (overlay.firstChild) {\n overlay.removeChild(overlay.firstChild);\n }\n\n var paddedOverlay = window.document.createElement(\"div\");\n paddedOverlay.style.position = \"absolute\";\n paddedOverlay.style.left = \"0\";\n paddedOverlay.style.right = \"0\";\n paddedOverlay.style.top = \"0\";\n paddedOverlay.style.bottom = \"0\";\n paddedOverlay.style.margin = CUE_BACKGROUND_PADDING;\n overlay.appendChild(paddedOverlay); // Determine if we need to compute the display states of the cues. This could\n // be the case if a cue's state has been changed since the last computation or\n // if it has not been computed yet.\n\n function shouldCompute(cues) {\n for (var i = 0; i < cues.length; i++) {\n if (cues[i].hasBeenReset || !cues[i].displayState) {\n return true;\n }\n }\n\n return false;\n } // We don't need to recompute the cues' display states. Just reuse them.\n\n\n if (!shouldCompute(cues)) {\n for (var i = 0; i < cues.length; i++) {\n paddedOverlay.appendChild(cues[i].displayState);\n }\n\n return;\n }\n\n var boxPositions = [],\n containerBox = BoxPosition.getSimpleBoxPosition(paddedOverlay),\n fontSize = Math.round(containerBox.height * FONT_SIZE_PERCENT * 100) / 100;\n var styleOptions = {\n font: fontSize + \"px \" + FONT_STYLE\n };\n\n (function () {\n var styleBox, cue;\n\n for (var i = 0; i < cues.length; i++) {\n cue = cues[i]; // Compute the intial position and styles of the cue div.\n\n styleBox = new CueStyleBox(window, cue, styleOptions);\n paddedOverlay.appendChild(styleBox.div); // Move the cue div to it's correct line position.\n\n moveBoxToLinePosition(window, styleBox, containerBox, boxPositions); // Remember the computed div so that we don't have to recompute it later\n // if we don't have too.\n\n cue.displayState = styleBox.div;\n boxPositions.push(BoxPosition.getSimpleBoxPosition(styleBox));\n }\n })();\n };\n\n WebVTT$1.Parser = function (window, vttjs, decoder) {\n if (!decoder) {\n decoder = vttjs;\n vttjs = {};\n }\n\n if (!vttjs) {\n vttjs = {};\n }\n\n this.window = window;\n this.vttjs = vttjs;\n this.state = \"INITIAL\";\n this.buffer = \"\";\n this.decoder = decoder || new TextDecoder(\"utf8\");\n this.regionList = [];\n };\n\n WebVTT$1.Parser.prototype = {\n // If the error is a ParsingError then report it to the consumer if\n // possible. If it's not a ParsingError then throw it like normal.\n reportOrThrowError: function reportOrThrowError(e) {\n if (e instanceof ParsingError) {\n this.onparsingerror && this.onparsingerror(e);\n } else {\n throw e;\n }\n },\n parse: function parse(data) {\n var self = this; // If there is no data then we won't decode it, but will just try to parse\n // whatever is in buffer already. This may occur in circumstances, for\n // example when flush() is called.\n\n if (data) {\n // Try to decode the data that we received.\n self.buffer += self.decoder.decode(data, {\n stream: true\n });\n }\n\n function collectNextLine() {\n var buffer = self.buffer;\n var pos = 0;\n\n while (pos < buffer.length && buffer[pos] !== '\\r' && buffer[pos] !== '\\n') {\n ++pos;\n }\n\n var line = buffer.substr(0, pos); // Advance the buffer early in case we fail below.\n\n if (buffer[pos] === '\\r') {\n ++pos;\n }\n\n if (buffer[pos] === '\\n') {\n ++pos;\n }\n\n self.buffer = buffer.substr(pos);\n return line;\n } // 3.4 WebVTT region and WebVTT region settings syntax\n\n\n function parseRegion(input) {\n var settings = new Settings();\n parseOptions(input, function (k, v) {\n switch (k) {\n case \"id\":\n settings.set(k, v);\n break;\n\n case \"width\":\n settings.percent(k, v);\n break;\n\n case \"lines\":\n settings.integer(k, v);\n break;\n\n case \"regionanchor\":\n case \"viewportanchor\":\n var xy = v.split(',');\n\n if (xy.length !== 2) {\n break;\n } // We have to make sure both x and y parse, so use a temporary\n // settings object here.\n\n\n var anchor = new Settings();\n anchor.percent(\"x\", xy[0]);\n anchor.percent(\"y\", xy[1]);\n\n if (!anchor.has(\"x\") || !anchor.has(\"y\")) {\n break;\n }\n\n settings.set(k + \"X\", anchor.get(\"x\"));\n settings.set(k + \"Y\", anchor.get(\"y\"));\n break;\n\n case \"scroll\":\n settings.alt(k, v, [\"up\"]);\n break;\n }\n }, /=/, /\\s/); // Create the region, using default values for any values that were not\n // specified.\n\n if (settings.has(\"id\")) {\n var region = new (self.vttjs.VTTRegion || self.window.VTTRegion)();\n region.width = settings.get(\"width\", 100);\n region.lines = settings.get(\"lines\", 3);\n region.regionAnchorX = settings.get(\"regionanchorX\", 0);\n region.regionAnchorY = settings.get(\"regionanchorY\", 100);\n region.viewportAnchorX = settings.get(\"viewportanchorX\", 0);\n region.viewportAnchorY = settings.get(\"viewportanchorY\", 100);\n region.scroll = settings.get(\"scroll\", \"\"); // Register the region.\n\n self.onregion && self.onregion(region); // Remember the VTTRegion for later in case we parse any VTTCues that\n // reference it.\n\n self.regionList.push({\n id: settings.get(\"id\"),\n region: region\n });\n }\n } // draft-pantos-http-live-streaming-20\n // https://tools.ietf.org/html/draft-pantos-http-live-streaming-20#section-3.5\n // 3.5 WebVTT\n\n\n function parseTimestampMap(input) {\n var settings = new Settings();\n parseOptions(input, function (k, v) {\n switch (k) {\n case \"MPEGT\":\n settings.integer(k + 'S', v);\n break;\n\n case \"LOCA\":\n settings.set(k + 'L', parseTimeStamp(v));\n break;\n }\n }, /[^\\d]:/, /,/);\n self.ontimestampmap && self.ontimestampmap({\n \"MPEGTS\": settings.get(\"MPEGTS\"),\n \"LOCAL\": settings.get(\"LOCAL\")\n });\n } // 3.2 WebVTT metadata header syntax\n\n\n function parseHeader(input) {\n if (input.match(/X-TIMESTAMP-MAP/)) {\n // This line contains HLS X-TIMESTAMP-MAP metadata\n parseOptions(input, function (k, v) {\n switch (k) {\n case \"X-TIMESTAMP-MAP\":\n parseTimestampMap(v);\n break;\n }\n }, /=/);\n } else {\n parseOptions(input, function (k, v) {\n switch (k) {\n case \"Region\":\n // 3.3 WebVTT region metadata header syntax\n parseRegion(v);\n break;\n }\n }, /:/);\n }\n } // 5.1 WebVTT file parsing.\n\n\n try {\n var line;\n\n if (self.state === \"INITIAL\") {\n // We can't start parsing until we have the first line.\n if (!/\\r\\n|\\n/.test(self.buffer)) {\n return this;\n }\n\n line = collectNextLine();\n var m = line.match(/^WEBVTT([ \\t].*)?$/);\n\n if (!m || !m[0]) {\n throw new ParsingError(ParsingError.Errors.BadSignature);\n }\n\n self.state = \"HEADER\";\n }\n\n var alreadyCollectedLine = false;\n\n while (self.buffer) {\n // We can't parse a line until we have the full line.\n if (!/\\r\\n|\\n/.test(self.buffer)) {\n return this;\n }\n\n if (!alreadyCollectedLine) {\n line = collectNextLine();\n } else {\n alreadyCollectedLine = false;\n }\n\n switch (self.state) {\n case \"HEADER\":\n // 13-18 - Allow a header (metadata) under the WEBVTT line.\n if (/:/.test(line)) {\n parseHeader(line);\n } else if (!line) {\n // An empty line terminates the header and starts the body (cues).\n self.state = \"ID\";\n }\n\n continue;\n\n case \"NOTE\":\n // Ignore NOTE blocks.\n if (!line) {\n self.state = \"ID\";\n }\n\n continue;\n\n case \"ID\":\n // Check for the start of NOTE blocks.\n if (/^NOTE($|[ \\t])/.test(line)) {\n self.state = \"NOTE\";\n break;\n } // 19-29 - Allow any number of line terminators, then initialize new cue values.\n\n\n if (!line) {\n continue;\n }\n\n self.cue = new (self.vttjs.VTTCue || self.window.VTTCue)(0, 0, \"\"); // Safari still uses the old middle value and won't accept center\n\n try {\n self.cue.align = \"center\";\n } catch (e) {\n self.cue.align = \"middle\";\n }\n\n self.state = \"CUE\"; // 30-39 - Check if self line contains an optional identifier or timing data.\n\n if (line.indexOf(\"-->\") === -1) {\n self.cue.id = line;\n continue;\n }\n\n // Process line as start of a cue.\n\n /*falls through*/\n\n case \"CUE\":\n // 40 - Collect cue timings and settings.\n try {\n parseCue(line, self.cue, self.regionList);\n } catch (e) {\n self.reportOrThrowError(e); // In case of an error ignore rest of the cue.\n\n self.cue = null;\n self.state = \"BADCUE\";\n continue;\n }\n\n self.state = \"CUETEXT\";\n continue;\n\n case \"CUETEXT\":\n var hasSubstring = line.indexOf(\"-->\") !== -1; // 34 - If we have an empty line then report the cue.\n // 35 - If we have the special substring '-->' then report the cue,\n // but do not collect the line as we need to process the current\n // one as a new cue.\n\n if (!line || hasSubstring && (alreadyCollectedLine = true)) {\n // We are done parsing self cue.\n self.oncue && self.oncue(self.cue);\n self.cue = null;\n self.state = \"ID\";\n continue;\n }\n\n if (self.cue.text) {\n self.cue.text += \"\\n\";\n }\n\n self.cue.text += line.replace(/\\u2028/g, '\\n').replace(/u2029/g, '\\n');\n continue;\n\n case \"BADCUE\":\n // BADCUE\n // 54-62 - Collect and discard the remaining cue.\n if (!line) {\n self.state = \"ID\";\n }\n\n continue;\n }\n }\n } catch (e) {\n self.reportOrThrowError(e); // If we are currently parsing a cue, report what we have.\n\n if (self.state === \"CUETEXT\" && self.cue && self.oncue) {\n self.oncue(self.cue);\n }\n\n self.cue = null; // Enter BADWEBVTT state if header was not parsed correctly otherwise\n // another exception occurred so enter BADCUE state.\n\n self.state = self.state === \"INITIAL\" ? \"BADWEBVTT\" : \"BADCUE\";\n }\n\n return this;\n },\n flush: function flush() {\n var self = this;\n\n try {\n // Finish decoding the stream.\n self.buffer += self.decoder.decode(); // Synthesize the end of the current cue or region.\n\n if (self.cue || self.state === \"HEADER\") {\n self.buffer += \"\\n\\n\";\n self.parse();\n } // If we've flushed, parsed, and we're still on the INITIAL state then\n // that means we don't have enough of the stream to parse the first\n // line.\n\n\n if (self.state === \"INITIAL\") {\n throw new ParsingError(ParsingError.Errors.BadSignature);\n }\n } catch (e) {\n self.reportOrThrowError(e);\n }\n\n self.onflush && self.onflush();\n return this;\n }\n };\n var vtt = WebVTT$1;\n\n /**\n * Copyright 2013 vtt.js Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n var autoKeyword = \"auto\";\n var directionSetting = {\n \"\": 1,\n \"lr\": 1,\n \"rl\": 1\n };\n var alignSetting = {\n \"start\": 1,\n \"center\": 1,\n \"end\": 1,\n \"left\": 1,\n \"right\": 1,\n \"auto\": 1,\n \"line-left\": 1,\n \"line-right\": 1\n };\n\n function findDirectionSetting(value) {\n if (typeof value !== \"string\") {\n return false;\n }\n\n var dir = directionSetting[value.toLowerCase()];\n return dir ? value.toLowerCase() : false;\n }\n\n function findAlignSetting(value) {\n if (typeof value !== \"string\") {\n return false;\n }\n\n var align = alignSetting[value.toLowerCase()];\n return align ? value.toLowerCase() : false;\n }\n\n function VTTCue(startTime, endTime, text) {\n /**\n * Shim implementation specific properties. These properties are not in\n * the spec.\n */\n // Lets us know when the VTTCue's data has changed in such a way that we need\n // to recompute its display state. This lets us compute its display state\n // lazily.\n this.hasBeenReset = false;\n /**\n * VTTCue and TextTrackCue properties\n * http://dev.w3.org/html5/webvtt/#vttcue-interface\n */\n\n var _id = \"\";\n var _pauseOnExit = false;\n var _startTime = startTime;\n var _endTime = endTime;\n var _text = text;\n var _region = null;\n var _vertical = \"\";\n var _snapToLines = true;\n var _line = \"auto\";\n var _lineAlign = \"start\";\n var _position = \"auto\";\n var _positionAlign = \"auto\";\n var _size = 100;\n var _align = \"center\";\n Object.defineProperties(this, {\n \"id\": {\n enumerable: true,\n get: function get() {\n return _id;\n },\n set: function set(value) {\n _id = \"\" + value;\n }\n },\n \"pauseOnExit\": {\n enumerable: true,\n get: function get() {\n return _pauseOnExit;\n },\n set: function set(value) {\n _pauseOnExit = !!value;\n }\n },\n \"startTime\": {\n enumerable: true,\n get: function get() {\n return _startTime;\n },\n set: function set(value) {\n if (typeof value !== \"number\") {\n throw new TypeError(\"Start time must be set to a number.\");\n }\n\n _startTime = value;\n this.hasBeenReset = true;\n }\n },\n \"endTime\": {\n enumerable: true,\n get: function get() {\n return _endTime;\n },\n set: function set(value) {\n if (typeof value !== \"number\") {\n throw new TypeError(\"End time must be set to a number.\");\n }\n\n _endTime = value;\n this.hasBeenReset = true;\n }\n },\n \"text\": {\n enumerable: true,\n get: function get() {\n return _text;\n },\n set: function set(value) {\n _text = \"\" + value;\n this.hasBeenReset = true;\n }\n },\n \"region\": {\n enumerable: true,\n get: function get() {\n return _region;\n },\n set: function set(value) {\n _region = value;\n this.hasBeenReset = true;\n }\n },\n \"vertical\": {\n enumerable: true,\n get: function get() {\n return _vertical;\n },\n set: function set(value) {\n var setting = findDirectionSetting(value); // Have to check for false because the setting an be an empty string.\n\n if (setting === false) {\n throw new SyntaxError(\"Vertical: an invalid or illegal direction string was specified.\");\n }\n\n _vertical = setting;\n this.hasBeenReset = true;\n }\n },\n \"snapToLines\": {\n enumerable: true,\n get: function get() {\n return _snapToLines;\n },\n set: function set(value) {\n _snapToLines = !!value;\n this.hasBeenReset = true;\n }\n },\n \"line\": {\n enumerable: true,\n get: function get() {\n return _line;\n },\n set: function set(value) {\n if (typeof value !== \"number\" && value !== autoKeyword) {\n throw new SyntaxError(\"Line: an invalid number or illegal string was specified.\");\n }\n\n _line = value;\n this.hasBeenReset = true;\n }\n },\n \"lineAlign\": {\n enumerable: true,\n get: function get() {\n return _lineAlign;\n },\n set: function set(value) {\n var setting = findAlignSetting(value);\n\n if (!setting) {\n console.warn(\"lineAlign: an invalid or illegal string was specified.\");\n } else {\n _lineAlign = setting;\n this.hasBeenReset = true;\n }\n }\n },\n \"position\": {\n enumerable: true,\n get: function get() {\n return _position;\n },\n set: function set(value) {\n if (value < 0 || value > 100) {\n throw new Error(\"Position must be between 0 and 100.\");\n }\n\n _position = value;\n this.hasBeenReset = true;\n }\n },\n \"positionAlign\": {\n enumerable: true,\n get: function get() {\n return _positionAlign;\n },\n set: function set(value) {\n var setting = findAlignSetting(value);\n\n if (!setting) {\n console.warn(\"positionAlign: an invalid or illegal string was specified.\");\n } else {\n _positionAlign = setting;\n this.hasBeenReset = true;\n }\n }\n },\n \"size\": {\n enumerable: true,\n get: function get() {\n return _size;\n },\n set: function set(value) {\n if (value < 0 || value > 100) {\n throw new Error(\"Size must be between 0 and 100.\");\n }\n\n _size = value;\n this.hasBeenReset = true;\n }\n },\n \"align\": {\n enumerable: true,\n get: function get() {\n return _align;\n },\n set: function set(value) {\n var setting = findAlignSetting(value);\n\n if (!setting) {\n throw new SyntaxError(\"align: an invalid or illegal alignment string was specified.\");\n }\n\n _align = setting;\n this.hasBeenReset = true;\n }\n }\n });\n /**\n * Other spec defined properties\n */\n // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#text-track-cue-display-state\n\n this.displayState = undefined;\n }\n /**\n * VTTCue methods\n */\n\n\n VTTCue.prototype.getCueAsHTML = function () {\n // Assume WebVTT.convertCueToDOMTree is on the global.\n return WebVTT.convertCueToDOMTree(window, this.text);\n };\n\n var vttcue = VTTCue;\n\n /**\n * Copyright 2013 vtt.js Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n var scrollSetting = {\n \"\": true,\n \"up\": true\n };\n\n function findScrollSetting(value) {\n if (typeof value !== \"string\") {\n return false;\n }\n\n var scroll = scrollSetting[value.toLowerCase()];\n return scroll ? value.toLowerCase() : false;\n }\n\n function isValidPercentValue(value) {\n return typeof value === \"number\" && value >= 0 && value <= 100;\n } // VTTRegion shim http://dev.w3.org/html5/webvtt/#vttregion-interface\n\n\n function VTTRegion() {\n var _width = 100;\n var _lines = 3;\n var _regionAnchorX = 0;\n var _regionAnchorY = 100;\n var _viewportAnchorX = 0;\n var _viewportAnchorY = 100;\n var _scroll = \"\";\n Object.defineProperties(this, {\n \"width\": {\n enumerable: true,\n get: function get() {\n return _width;\n },\n set: function set(value) {\n if (!isValidPercentValue(value)) {\n throw new Error(\"Width must be between 0 and 100.\");\n }\n\n _width = value;\n }\n },\n \"lines\": {\n enumerable: true,\n get: function get() {\n return _lines;\n },\n set: function set(value) {\n if (typeof value !== \"number\") {\n throw new TypeError(\"Lines must be set to a number.\");\n }\n\n _lines = value;\n }\n },\n \"regionAnchorY\": {\n enumerable: true,\n get: function get() {\n return _regionAnchorY;\n },\n set: function set(value) {\n if (!isValidPercentValue(value)) {\n throw new Error(\"RegionAnchorX must be between 0 and 100.\");\n }\n\n _regionAnchorY = value;\n }\n },\n \"regionAnchorX\": {\n enumerable: true,\n get: function get() {\n return _regionAnchorX;\n },\n set: function set(value) {\n if (!isValidPercentValue(value)) {\n throw new Error(\"RegionAnchorY must be between 0 and 100.\");\n }\n\n _regionAnchorX = value;\n }\n },\n \"viewportAnchorY\": {\n enumerable: true,\n get: function get() {\n return _viewportAnchorY;\n },\n set: function set(value) {\n if (!isValidPercentValue(value)) {\n throw new Error(\"ViewportAnchorY must be between 0 and 100.\");\n }\n\n _viewportAnchorY = value;\n }\n },\n \"viewportAnchorX\": {\n enumerable: true,\n get: function get() {\n return _viewportAnchorX;\n },\n set: function set(value) {\n if (!isValidPercentValue(value)) {\n throw new Error(\"ViewportAnchorX must be between 0 and 100.\");\n }\n\n _viewportAnchorX = value;\n }\n },\n \"scroll\": {\n enumerable: true,\n get: function get() {\n return _scroll;\n },\n set: function set(value) {\n var setting = findScrollSetting(value); // Have to check for false as an empty string is a legal value.\n\n if (setting === false) {\n console.warn(\"Scroll: an invalid or illegal string was specified.\");\n } else {\n _scroll = setting;\n }\n }\n }\n });\n }\n\n var vttregion = VTTRegion;\n\n var browserIndex = createCommonjsModule(function (module) {\n /**\n * Copyright 2013 vtt.js Contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n // Default exports for Node. Export the extended versions of VTTCue and\n // VTTRegion in Node since we likely want the capability to convert back and\n // forth between JSON. If we don't then it's not that big of a deal since we're\n // off browser.\n var vttjs = module.exports = {\n WebVTT: vtt,\n VTTCue: vttcue,\n VTTRegion: vttregion\n };\n window$3.vttjs = vttjs;\n window$3.WebVTT = vttjs.WebVTT;\n var cueShim = vttjs.VTTCue;\n var regionShim = vttjs.VTTRegion;\n var nativeVTTCue = window$3.VTTCue;\n var nativeVTTRegion = window$3.VTTRegion;\n\n vttjs.shim = function () {\n window$3.VTTCue = cueShim;\n window$3.VTTRegion = regionShim;\n };\n\n vttjs.restore = function () {\n window$3.VTTCue = nativeVTTCue;\n window$3.VTTRegion = nativeVTTRegion;\n };\n\n if (!window$3.VTTCue) {\n vttjs.shim();\n }\n });\n var browserIndex_1 = browserIndex.WebVTT;\n var browserIndex_2 = browserIndex.VTTCue;\n var browserIndex_3 = browserIndex.VTTRegion;\n\n /**\n * An Object containing a structure like: `{src: 'url', type: 'mimetype'}` or string\n * that just contains the src url alone.\n * * `var SourceObject = {src: 'http://ex.com/video.mp4', type: 'video/mp4'};`\n * `var SourceString = 'http://example.com/some-video.mp4';`\n *\n * @typedef {Object|string} Tech~SourceObject\n *\n * @property {string} src\n * The url to the source\n *\n * @property {string} type\n * The mime type of the source\n */\n\n /**\n * A function used by {@link Tech} to create a new {@link TextTrack}.\n *\n * @private\n *\n * @param {Tech} self\n * An instance of the Tech class.\n *\n * @param {string} kind\n * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata)\n *\n * @param {string} [label]\n * Label to identify the text track\n *\n * @param {string} [language]\n * Two letter language abbreviation\n *\n * @param {Object} [options={}]\n * An object with additional text track options\n *\n * @return {TextTrack}\n * The text track that was created.\n */\n\n function createTrackHelper(self, kind, label, language, options) {\n if (options === void 0) {\n options = {};\n }\n\n var tracks = self.textTracks();\n options.kind = kind;\n\n if (label) {\n options.label = label;\n }\n\n if (language) {\n options.language = language;\n }\n\n options.tech = self;\n var track = new ALL.text.TrackClass(options);\n tracks.addTrack(track);\n return track;\n }\n /**\n * This is the base class for media playback technology controllers, such as\n * {@link Flash} and {@link HTML5}\n *\n * @extends Component\n */\n\n\n var Tech = /*#__PURE__*/function (_Component) {\n inheritsLoose(Tech, _Component);\n\n /**\n * Create an instance of this Tech.\n *\n * @param {Object} [options]\n * The key/value store of player options.\n *\n * @param {Component~ReadyCallback} ready\n * Callback function to call when the `HTML5` Tech is ready.\n */\n function Tech(options, ready) {\n var _this;\n\n if (options === void 0) {\n options = {};\n }\n\n if (ready === void 0) {\n ready = function ready() {};\n }\n\n // we don't want the tech to report user activity automatically.\n // This is done manually in addControlsListeners\n options.reportTouchActivity = false;\n _this = _Component.call(this, null, options, ready) || this; // keep track of whether the current source has played at all to\n // implement a very limited played()\n\n _this.hasStarted_ = false;\n\n _this.on('playing', function () {\n this.hasStarted_ = true;\n });\n\n _this.on('loadstart', function () {\n this.hasStarted_ = false;\n });\n\n ALL.names.forEach(function (name) {\n var props = ALL[name];\n\n if (options && options[props.getterName]) {\n _this[props.privateName] = options[props.getterName];\n }\n }); // Manually track progress in cases where the browser/flash player doesn't report it.\n\n if (!_this.featuresProgressEvents) {\n _this.manualProgressOn();\n } // Manually track timeupdates in cases where the browser/flash player doesn't report it.\n\n\n if (!_this.featuresTimeupdateEvents) {\n _this.manualTimeUpdatesOn();\n }\n\n ['Text', 'Audio', 'Video'].forEach(function (track) {\n if (options[\"native\" + track + \"Tracks\"] === false) {\n _this[\"featuresNative\" + track + \"Tracks\"] = false;\n }\n });\n\n if (options.nativeCaptions === false || options.nativeTextTracks === false) {\n _this.featuresNativeTextTracks = false;\n } else if (options.nativeCaptions === true || options.nativeTextTracks === true) {\n _this.featuresNativeTextTracks = true;\n }\n\n if (!_this.featuresNativeTextTracks) {\n _this.emulateTextTracks();\n }\n\n _this.preloadTextTracks = options.preloadTextTracks !== false;\n _this.autoRemoteTextTracks_ = new ALL.text.ListClass();\n\n _this.initTrackListeners(); // Turn on component tap events only if not using native controls\n\n\n if (!options.nativeControlsForTouch) {\n _this.emitTapEvents();\n }\n\n if (_this.constructor) {\n _this.name_ = _this.constructor.name || 'Unknown Tech';\n }\n\n return _this;\n }\n /**\n * A special function to trigger source set in a way that will allow player\n * to re-trigger if the player or tech are not ready yet.\n *\n * @fires Tech#sourceset\n * @param {string} src The source string at the time of the source changing.\n */\n\n\n var _proto = Tech.prototype;\n\n _proto.triggerSourceset = function triggerSourceset(src) {\n var _this2 = this;\n\n if (!this.isReady_) {\n // on initial ready we have to trigger source set\n // 1ms after ready so that player can watch for it.\n this.one('ready', function () {\n return _this2.setTimeout(function () {\n return _this2.triggerSourceset(src);\n }, 1);\n });\n }\n /**\n * Fired when the source is set on the tech causing the media element\n * to reload.\n *\n * @see {@link Player#event:sourceset}\n * @event Tech#sourceset\n * @type {EventTarget~Event}\n */\n\n\n this.trigger({\n src: src,\n type: 'sourceset'\n });\n }\n /* Fallbacks for unsupported event types\n ================================================================================ */\n\n /**\n * Polyfill the `progress` event for browsers that don't support it natively.\n *\n * @see {@link Tech#trackProgress}\n */\n ;\n\n _proto.manualProgressOn = function manualProgressOn() {\n this.on('durationchange', this.onDurationChange);\n this.manualProgress = true; // Trigger progress watching when a source begins loading\n\n this.one('ready', this.trackProgress);\n }\n /**\n * Turn off the polyfill for `progress` events that was created in\n * {@link Tech#manualProgressOn}\n */\n ;\n\n _proto.manualProgressOff = function manualProgressOff() {\n this.manualProgress = false;\n this.stopTrackingProgress();\n this.off('durationchange', this.onDurationChange);\n }\n /**\n * This is used to trigger a `progress` event when the buffered percent changes. It\n * sets an interval function that will be called every 500 milliseconds to check if the\n * buffer end percent has changed.\n *\n * > This function is called by {@link Tech#manualProgressOn}\n *\n * @param {EventTarget~Event} event\n * The `ready` event that caused this to run.\n *\n * @listens Tech#ready\n * @fires Tech#progress\n */\n ;\n\n _proto.trackProgress = function trackProgress(event) {\n this.stopTrackingProgress();\n this.progressInterval = this.setInterval(bind(this, function () {\n // Don't trigger unless buffered amount is greater than last time\n var numBufferedPercent = this.bufferedPercent();\n\n if (this.bufferedPercent_ !== numBufferedPercent) {\n /**\n * See {@link Player#progress}\n *\n * @event Tech#progress\n * @type {EventTarget~Event}\n */\n this.trigger('progress');\n }\n\n this.bufferedPercent_ = numBufferedPercent;\n\n if (numBufferedPercent === 1) {\n this.stopTrackingProgress();\n }\n }), 500);\n }\n /**\n * Update our internal duration on a `durationchange` event by calling\n * {@link Tech#duration}.\n *\n * @param {EventTarget~Event} event\n * The `durationchange` event that caused this to run.\n *\n * @listens Tech#durationchange\n */\n ;\n\n _proto.onDurationChange = function onDurationChange(event) {\n this.duration_ = this.duration();\n }\n /**\n * Get and create a `TimeRange` object for buffering.\n *\n * @return {TimeRange}\n * The time range object that was created.\n */\n ;\n\n _proto.buffered = function buffered() {\n return createTimeRanges(0, 0);\n }\n /**\n * Get the percentage of the current video that is currently buffered.\n *\n * @return {number}\n * A number from 0 to 1 that represents the decimal percentage of the\n * video that is buffered.\n *\n */\n ;\n\n _proto.bufferedPercent = function bufferedPercent$1() {\n return bufferedPercent(this.buffered(), this.duration_);\n }\n /**\n * Turn off the polyfill for `progress` events that was created in\n * {@link Tech#manualProgressOn}\n * Stop manually tracking progress events by clearing the interval that was set in\n * {@link Tech#trackProgress}.\n */\n ;\n\n _proto.stopTrackingProgress = function stopTrackingProgress() {\n this.clearInterval(this.progressInterval);\n }\n /**\n * Polyfill the `timeupdate` event for browsers that don't support it.\n *\n * @see {@link Tech#trackCurrentTime}\n */\n ;\n\n _proto.manualTimeUpdatesOn = function manualTimeUpdatesOn() {\n this.manualTimeUpdates = true;\n this.on('play', this.trackCurrentTime);\n this.on('pause', this.stopTrackingCurrentTime);\n }\n /**\n * Turn off the polyfill for `timeupdate` events that was created in\n * {@link Tech#manualTimeUpdatesOn}\n */\n ;\n\n _proto.manualTimeUpdatesOff = function manualTimeUpdatesOff() {\n this.manualTimeUpdates = false;\n this.stopTrackingCurrentTime();\n this.off('play', this.trackCurrentTime);\n this.off('pause', this.stopTrackingCurrentTime);\n }\n /**\n * Sets up an interval function to track current time and trigger `timeupdate` every\n * 250 milliseconds.\n *\n * @listens Tech#play\n * @triggers Tech#timeupdate\n */\n ;\n\n _proto.trackCurrentTime = function trackCurrentTime() {\n if (this.currentTimeInterval) {\n this.stopTrackingCurrentTime();\n }\n\n this.currentTimeInterval = this.setInterval(function () {\n /**\n * Triggered at an interval of 250ms to indicated that time is passing in the video.\n *\n * @event Tech#timeupdate\n * @type {EventTarget~Event}\n */\n this.trigger({\n type: 'timeupdate',\n target: this,\n manuallyTriggered: true\n }); // 42 = 24 fps // 250 is what Webkit uses // FF uses 15\n }, 250);\n }\n /**\n * Stop the interval function created in {@link Tech#trackCurrentTime} so that the\n * `timeupdate` event is no longer triggered.\n *\n * @listens {Tech#pause}\n */\n ;\n\n _proto.stopTrackingCurrentTime = function stopTrackingCurrentTime() {\n this.clearInterval(this.currentTimeInterval); // #1002 - if the video ends right before the next timeupdate would happen,\n // the progress bar won't make it all the way to the end\n\n this.trigger({\n type: 'timeupdate',\n target: this,\n manuallyTriggered: true\n });\n }\n /**\n * Turn off all event polyfills, clear the `Tech`s {@link AudioTrackList},\n * {@link VideoTrackList}, and {@link TextTrackList}, and dispose of this Tech.\n *\n * @fires Component#dispose\n */\n ;\n\n _proto.dispose = function dispose() {\n // clear out all tracks because we can't reuse them between techs\n this.clearTracks(NORMAL.names); // Turn off any manual progress or timeupdate tracking\n\n if (this.manualProgress) {\n this.manualProgressOff();\n }\n\n if (this.manualTimeUpdates) {\n this.manualTimeUpdatesOff();\n }\n\n _Component.prototype.dispose.call(this);\n }\n /**\n * Clear out a single `TrackList` or an array of `TrackLists` given their names.\n *\n * > Note: Techs without source handlers should call this between sources for `video`\n * & `audio` tracks. You don't want to use them between tracks!\n *\n * @param {string[]|string} types\n * TrackList names to clear, valid names are `video`, `audio`, and\n * `text`.\n */\n ;\n\n _proto.clearTracks = function clearTracks(types) {\n var _this3 = this;\n\n types = [].concat(types); // clear out all tracks because we can't reuse them between techs\n\n types.forEach(function (type) {\n var list = _this3[type + \"Tracks\"]() || [];\n var i = list.length;\n\n while (i--) {\n var track = list[i];\n\n if (type === 'text') {\n _this3.removeRemoteTextTrack(track);\n }\n\n list.removeTrack(track);\n }\n });\n }\n /**\n * Remove any TextTracks added via addRemoteTextTrack that are\n * flagged for automatic garbage collection\n */\n ;\n\n _proto.cleanupAutoTextTracks = function cleanupAutoTextTracks() {\n var list = this.autoRemoteTextTracks_ || [];\n var i = list.length;\n\n while (i--) {\n var track = list[i];\n this.removeRemoteTextTrack(track);\n }\n }\n /**\n * Reset the tech, which will removes all sources and reset the internal readyState.\n *\n * @abstract\n */\n ;\n\n _proto.reset = function reset() {}\n /**\n * Get or set an error on the Tech.\n *\n * @param {MediaError} [err]\n * Error to set on the Tech\n *\n * @return {MediaError|null}\n * The current error object on the tech, or null if there isn't one.\n */\n ;\n\n _proto.error = function error(err) {\n if (err !== undefined) {\n this.error_ = new MediaError(err);\n this.trigger('error');\n }\n\n return this.error_;\n }\n /**\n * Returns the `TimeRange`s that have been played through for the current source.\n *\n * > NOTE: This implementation is incomplete. It does not track the played `TimeRange`.\n * It only checks whether the source has played at all or not.\n *\n * @return {TimeRange}\n * - A single time range if this video has played\n * - An empty set of ranges if not.\n */\n ;\n\n _proto.played = function played() {\n if (this.hasStarted_) {\n return createTimeRanges(0, 0);\n }\n\n return createTimeRanges();\n }\n /**\n * Causes a manual time update to occur if {@link Tech#manualTimeUpdatesOn} was\n * previously called.\n *\n * @fires Tech#timeupdate\n */\n ;\n\n _proto.setCurrentTime = function setCurrentTime() {\n // improve the accuracy of manual timeupdates\n if (this.manualTimeUpdates) {\n /**\n * A manual `timeupdate` event.\n *\n * @event Tech#timeupdate\n * @type {EventTarget~Event}\n */\n this.trigger({\n type: 'timeupdate',\n target: this,\n manuallyTriggered: true\n });\n }\n }\n /**\n * Turn on listeners for {@link VideoTrackList}, {@link {AudioTrackList}, and\n * {@link TextTrackList} events.\n *\n * This adds {@link EventTarget~EventListeners} for `addtrack`, and `removetrack`.\n *\n * @fires Tech#audiotrackchange\n * @fires Tech#videotrackchange\n * @fires Tech#texttrackchange\n */\n ;\n\n _proto.initTrackListeners = function initTrackListeners() {\n var _this4 = this;\n\n /**\n * Triggered when tracks are added or removed on the Tech {@link AudioTrackList}\n *\n * @event Tech#audiotrackchange\n * @type {EventTarget~Event}\n */\n\n /**\n * Triggered when tracks are added or removed on the Tech {@link VideoTrackList}\n *\n * @event Tech#videotrackchange\n * @type {EventTarget~Event}\n */\n\n /**\n * Triggered when tracks are added or removed on the Tech {@link TextTrackList}\n *\n * @event Tech#texttrackchange\n * @type {EventTarget~Event}\n */\n NORMAL.names.forEach(function (name) {\n var props = NORMAL[name];\n\n var trackListChanges = function trackListChanges() {\n _this4.trigger(name + \"trackchange\");\n };\n\n var tracks = _this4[props.getterName]();\n\n tracks.addEventListener('removetrack', trackListChanges);\n tracks.addEventListener('addtrack', trackListChanges);\n\n _this4.on('dispose', function () {\n tracks.removeEventListener('removetrack', trackListChanges);\n tracks.removeEventListener('addtrack', trackListChanges);\n });\n });\n }\n /**\n * Emulate TextTracks using vtt.js if necessary\n *\n * @fires Tech#vttjsloaded\n * @fires Tech#vttjserror\n */\n ;\n\n _proto.addWebVttScript_ = function addWebVttScript_() {\n var _this5 = this;\n\n if (window$3.WebVTT) {\n return;\n } // Initially, Tech.el_ is a child of a dummy-div wait until the Component system\n // signals that the Tech is ready at which point Tech.el_ is part of the DOM\n // before inserting the WebVTT script\n\n\n if (document.body.contains(this.el())) {\n // load via require if available and vtt.js script location was not passed in\n // as an option. novtt builds will turn the above require call into an empty object\n // which will cause this if check to always fail.\n if (!this.options_['vtt.js'] && isPlain(browserIndex) && Object.keys(browserIndex).length > 0) {\n this.trigger('vttjsloaded');\n return;\n } // load vtt.js via the script location option or the cdn of no location was\n // passed in\n\n\n var script = document.createElement('script');\n script.src = this.options_['vtt.js'] || 'https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js';\n\n script.onload = function () {\n /**\n * Fired when vtt.js is loaded.\n *\n * @event Tech#vttjsloaded\n * @type {EventTarget~Event}\n */\n _this5.trigger('vttjsloaded');\n };\n\n script.onerror = function () {\n /**\n * Fired when vtt.js was not loaded due to an error\n *\n * @event Tech#vttjsloaded\n * @type {EventTarget~Event}\n */\n _this5.trigger('vttjserror');\n };\n\n this.on('dispose', function () {\n script.onload = null;\n script.onerror = null;\n }); // but have not loaded yet and we set it to true before the inject so that\n // we don't overwrite the injected window.WebVTT if it loads right away\n\n window$3.WebVTT = true;\n this.el().parentNode.appendChild(script);\n } else {\n this.ready(this.addWebVttScript_);\n }\n }\n /**\n * Emulate texttracks\n *\n */\n ;\n\n _proto.emulateTextTracks = function emulateTextTracks() {\n var _this6 = this;\n\n var tracks = this.textTracks();\n var remoteTracks = this.remoteTextTracks();\n\n var handleAddTrack = function handleAddTrack(e) {\n return tracks.addTrack(e.track);\n };\n\n var handleRemoveTrack = function handleRemoveTrack(e) {\n return tracks.removeTrack(e.track);\n };\n\n remoteTracks.on('addtrack', handleAddTrack);\n remoteTracks.on('removetrack', handleRemoveTrack);\n this.addWebVttScript_();\n\n var updateDisplay = function updateDisplay() {\n return _this6.trigger('texttrackchange');\n };\n\n var textTracksChanges = function textTracksChanges() {\n updateDisplay();\n\n for (var i = 0; i < tracks.length; i++) {\n var track = tracks[i];\n track.removeEventListener('cuechange', updateDisplay);\n\n if (track.mode === 'showing') {\n track.addEventListener('cuechange', updateDisplay);\n }\n }\n };\n\n textTracksChanges();\n tracks.addEventListener('change', textTracksChanges);\n tracks.addEventListener('addtrack', textTracksChanges);\n tracks.addEventListener('removetrack', textTracksChanges);\n this.on('dispose', function () {\n remoteTracks.off('addtrack', handleAddTrack);\n remoteTracks.off('removetrack', handleRemoveTrack);\n tracks.removeEventListener('change', textTracksChanges);\n tracks.removeEventListener('addtrack', textTracksChanges);\n tracks.removeEventListener('removetrack', textTracksChanges);\n\n for (var i = 0; i < tracks.length; i++) {\n var track = tracks[i];\n track.removeEventListener('cuechange', updateDisplay);\n }\n });\n }\n /**\n * Create and returns a remote {@link TextTrack} object.\n *\n * @param {string} kind\n * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata)\n *\n * @param {string} [label]\n * Label to identify the text track\n *\n * @param {string} [language]\n * Two letter language abbreviation\n *\n * @return {TextTrack}\n * The TextTrack that gets created.\n */\n ;\n\n _proto.addTextTrack = function addTextTrack(kind, label, language) {\n if (!kind) {\n throw new Error('TextTrack kind is required but was not provided');\n }\n\n return createTrackHelper(this, kind, label, language);\n }\n /**\n * Create an emulated TextTrack for use by addRemoteTextTrack\n *\n * This is intended to be overridden by classes that inherit from\n * Tech in order to create native or custom TextTracks.\n *\n * @param {Object} options\n * The object should contain the options to initialize the TextTrack with.\n *\n * @param {string} [options.kind]\n * `TextTrack` kind (subtitles, captions, descriptions, chapters, or metadata).\n *\n * @param {string} [options.label].\n * Label to identify the text track\n *\n * @param {string} [options.language]\n * Two letter language abbreviation.\n *\n * @return {HTMLTrackElement}\n * The track element that gets created.\n */\n ;\n\n _proto.createRemoteTextTrack = function createRemoteTextTrack(options) {\n var track = mergeOptions(options, {\n tech: this\n });\n return new REMOTE.remoteTextEl.TrackClass(track);\n }\n /**\n * Creates a remote text track object and returns an html track element.\n *\n * > Note: This can be an emulated {@link HTMLTrackElement} or a native one.\n *\n * @param {Object} options\n * See {@link Tech#createRemoteTextTrack} for more detailed properties.\n *\n * @param {boolean} [manualCleanup=true]\n * - When false: the TextTrack will be automatically removed from the video\n * element whenever the source changes\n * - When True: The TextTrack will have to be cleaned up manually\n *\n * @return {HTMLTrackElement}\n * An Html Track Element.\n *\n * @deprecated The default functionality for this function will be equivalent\n * to \"manualCleanup=false\" in the future. The manualCleanup parameter will\n * also be removed.\n */\n ;\n\n _proto.addRemoteTextTrack = function addRemoteTextTrack(options, manualCleanup) {\n var _this7 = this;\n\n if (options === void 0) {\n options = {};\n }\n\n var htmlTrackElement = this.createRemoteTextTrack(options);\n\n if (manualCleanup !== true && manualCleanup !== false) {\n // deprecation warning\n log.warn('Calling addRemoteTextTrack without explicitly setting the \"manualCleanup\" parameter to `true` is deprecated and default to `false` in future version of video.js');\n manualCleanup = true;\n } // store HTMLTrackElement and TextTrack to remote list\n\n\n this.remoteTextTrackEls().addTrackElement_(htmlTrackElement);\n this.remoteTextTracks().addTrack(htmlTrackElement.track);\n\n if (manualCleanup !== true) {\n // create the TextTrackList if it doesn't exist\n this.ready(function () {\n return _this7.autoRemoteTextTracks_.addTrack(htmlTrackElement.track);\n });\n }\n\n return htmlTrackElement;\n }\n /**\n * Remove a remote text track from the remote `TextTrackList`.\n *\n * @param {TextTrack} track\n * `TextTrack` to remove from the `TextTrackList`\n */\n ;\n\n _proto.removeRemoteTextTrack = function removeRemoteTextTrack(track) {\n var trackElement = this.remoteTextTrackEls().getTrackElementByTrack_(track); // remove HTMLTrackElement and TextTrack from remote list\n\n this.remoteTextTrackEls().removeTrackElement_(trackElement);\n this.remoteTextTracks().removeTrack(track);\n this.autoRemoteTextTracks_.removeTrack(track);\n }\n /**\n * Gets available media playback quality metrics as specified by the W3C's Media\n * Playback Quality API.\n *\n * @see [Spec]{@link https://wicg.github.io/media-playback-quality}\n *\n * @return {Object}\n * An object with supported media playback quality metrics\n *\n * @abstract\n */\n ;\n\n _proto.getVideoPlaybackQuality = function getVideoPlaybackQuality() {\n return {};\n }\n /**\n * Attempt to create a floating video window always on top of other windows\n * so that users may continue consuming media while they interact with other\n * content sites, or applications on their device.\n *\n * @see [Spec]{@link https://wicg.github.io/picture-in-picture}\n *\n * @return {Promise|undefined}\n * A promise with a Picture-in-Picture window if the browser supports\n * Promises (or one was passed in as an option). It returns undefined\n * otherwise.\n *\n * @abstract\n */\n ;\n\n _proto.requestPictureInPicture = function requestPictureInPicture() {\n var PromiseClass = this.options_.Promise || window$3.Promise;\n\n if (PromiseClass) {\n return PromiseClass.reject();\n }\n }\n /**\n * A method to set a poster from a `Tech`.\n *\n * @abstract\n */\n ;\n\n _proto.setPoster = function setPoster() {}\n /**\n * A method to check for the presence of the 'playsinline'