From 4abf5043c48d7b99d2437819da42a2c8e6afa8f3 Mon Sep 17 00:00:00 2001 From: Jordan Lovato Date: Tue, 24 Dec 2019 00:11:45 -0800 Subject: [PATCH 1/7] Bump `dockerine/collections` `1.5.x-dev` tags appears to no longer be getting picked up by composer. Bumped tag in `composer.json` to `1.6.x-dev`. --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 3d1ad9fc0..5fd1cc31c 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "paypal/merchant-sdk-php" : "3.12.*", "monolog/monolog" : "1.x-dev", "doctrine/inflector": "1.3.x-dev", - "doctrine/collections": "1.5.x-dev", + "doctrine/collections": "1.6.x-dev", "doctrine/cache": "1.8.x-dev", "doctrine/annotations": "1.7.x-dev", "doctrine/common": "2.10.x-dev", @@ -26,4 +26,4 @@ "autoload": { "psr-0": {"Destiny":"lib/"} } -} \ No newline at end of file +} From 0a27dfc4e6ce7c467f2603372b325037405428cc Mon Sep 17 00:00:00 2001 From: Jordan Lovato Date: Tue, 24 Dec 2019 11:17:54 -0800 Subject: [PATCH 2/7] Booting with Docker Introduce docker: added redis, mysql, nginx, and fpm. Builds from `Dockerfile`. I didn't want to adjust the cfg in `config/nginx/dgg.conf`, So I created a new folder for nginx to mount `config/nginx/local`. I adjusted the config and only incorporated the website. I intend to port over the rest of the rewrites. Also updated the README with install instructions. --- .gitignore | 3 + Dockerfile | 49 + README.md | 10 +- config/local.mysql.cnf | 3 + config/local.php.ini | 7 + config/manifest.php | 26 +- config/nginx/local/dgg.conf | 50 + config/nginx/local/dgg_csp.conf | 1 + data/mysql/.gitignore | 2 + data/redis/.gitignore | 2 + docker-compose.yml | 75 + lib/boot.app.php | 2 +- lib/boot.test.php | 2 +- package.json | 148 +- public/index.php | 2 +- static/admin.9fc5b6e9bfd006201b92.js | 8 + static/admin.ff5a37819698288553df.js | 8 - ...1.js => bigscreen.3d4fff2acef5a2bb6394.js} | 0 ...19b8fd.js => chat.54838c41c1e57dfefc3f.js} | 0 static/chat.vendor.010a03adb03b4b1c96c6.css | 3 + static/chat.vendor.32a21117ec538f592a5a.js | 1 + static/chat.vendor.921603439ba1b85e5c7b.css | 3 - static/chat.vendor.b8a1ff790976d978fa47.js | 1 - ... => common.vendor.577ea20b04af95464fb9.js} | 0 static/font/fa-brands-400.eot | Bin 129916 -> 131930 bytes static/font/fa-brands-400.svg | 216 +- static/font/fa-brands-400.ttf | Bin 129612 -> 131624 bytes static/font/fa-brands-400.woff | Bin 87688 -> 89100 bytes static/font/fa-brands-400.woff2 | Bin 74768 -> 75936 bytes static/font/fa-regular-400.eot | Bin 34388 -> 34390 bytes static/font/fa-regular-400.svg | 20 +- static/font/fa-regular-400.ttf | Bin 34092 -> 34092 bytes static/font/fa-regular-400.woff | Bin 16804 -> 16800 bytes static/font/fa-regular-400.woff2 | Bin 13552 -> 13576 bytes static/font/fa-solid-900.eot | Bin 186728 -> 194066 bytes static/font/fa-solid-900.svg | 301 +- static/font/fa-solid-900.ttf | Bin 186444 -> 193780 bytes static/font/fa-solid-900.woff | Bin 96256 -> 98996 bytes static/font/fa-solid-900.woff2 | Bin 74256 -> 76084 bytes static/img/320x240.gif | Bin 3735 -> 0 bytes static/img/64x64.gif | Bin 1651 -> 0 bytes static/img/amazon.png | Bin 19903 -> 0 bytes static/img/dbh-cocoa.png | Bin 197919 -> 0 bytes static/img/dbh-duckerz.png | Bin 280077 -> 0 bytes static/img/dbh-hood1.png | Bin 125105 -> 0 bytes static/img/dbh-mug2.png | Bin 336318 -> 0 bytes static/img/dbh-mug3.png | Bin 370377 -> 0 bytes static/img/dbh-shirt1.png | Bin 172822 -> 0 bytes static/img/dbh-shirt2.png | Bin 117701 -> 0 bytes static/img/dbh-shirt3.png | Bin 234909 -> 0 bytes static/img/dbh-sticker1.png | Bin 61527 -> 0 bytes static/img/dgg-icon.svg | 10 - static/img/dgg-logo.svg | 18 - static/img/emote-splat.png | Bin 5486 -> 0 bytes static/img/icon-close.svg | 4 - static/img/icon-emotes.svg | 4 - static/img/icon-settings.svg | 2 - static/img/icon-share.svg | 2 - static/img/icon-users.svg | 2 - static/img/icon-whispers.svg | 2 - static/img/icons.png | Bin 4059 -> 0 bytes static/img/image-bad.svg | 1 - static/img/podcast80.png | Bin 8916 -> 0 bytes static/img/sl-logo.png | Bin 5904 -> 0 bytes ...073.js => profile.1920d4ed83f2244fb9e0.js} | 0 ...c27.js => runtime.60aabece63b63766f770.js} | 0 ....js => streamchat.fc6a61bd6f9b041e4a70.js} | 0 ...53.js => votechat.d2c2c05a6ca0bd568699.js} | 0 static/web.3d80f8efc87e3264a92f.js | 40 + static/web.44a3fca3a7cf0c30f49b.css | 4563 ---------------- static/web.72821aa16bb1adf7c9d1.js | 40 - static/web.8bebfff54dde79230dda.css | 4617 +++++++++++++++++ 72 files changed, 5294 insertions(+), 4954 deletions(-) create mode 100644 Dockerfile create mode 100644 config/local.mysql.cnf create mode 100644 config/local.php.ini create mode 100644 config/nginx/local/dgg.conf create mode 100644 config/nginx/local/dgg_csp.conf create mode 100644 data/mysql/.gitignore create mode 100644 data/redis/.gitignore create mode 100644 docker-compose.yml create mode 100644 static/admin.9fc5b6e9bfd006201b92.js delete mode 100644 static/admin.ff5a37819698288553df.js rename static/{bigscreen.ed9caa26b60c54b64521.js => bigscreen.3d4fff2acef5a2bb6394.js} (100%) rename static/{chat.81ec13ebf502ab19b8fd.js => chat.54838c41c1e57dfefc3f.js} (100%) create mode 100644 static/chat.vendor.010a03adb03b4b1c96c6.css create mode 100644 static/chat.vendor.32a21117ec538f592a5a.js delete mode 100644 static/chat.vendor.921603439ba1b85e5c7b.css delete mode 100644 static/chat.vendor.b8a1ff790976d978fa47.js rename static/{common.vendor.a180bcf84872f6b5b06c.js => common.vendor.577ea20b04af95464fb9.js} (100%) delete mode 100644 static/img/320x240.gif delete mode 100644 static/img/64x64.gif delete mode 100644 static/img/amazon.png delete mode 100644 static/img/dbh-cocoa.png delete mode 100644 static/img/dbh-duckerz.png delete mode 100644 static/img/dbh-hood1.png delete mode 100644 static/img/dbh-mug2.png delete mode 100644 static/img/dbh-mug3.png delete mode 100644 static/img/dbh-shirt1.png delete mode 100644 static/img/dbh-shirt2.png delete mode 100644 static/img/dbh-shirt3.png delete mode 100644 static/img/dbh-sticker1.png delete mode 100644 static/img/dgg-icon.svg delete mode 100644 static/img/dgg-logo.svg delete mode 100644 static/img/emote-splat.png delete mode 100644 static/img/icon-close.svg delete mode 100644 static/img/icon-emotes.svg delete mode 100644 static/img/icon-settings.svg delete mode 100644 static/img/icon-share.svg delete mode 100644 static/img/icon-users.svg delete mode 100644 static/img/icon-whispers.svg delete mode 100644 static/img/icons.png delete mode 100644 static/img/image-bad.svg delete mode 100644 static/img/podcast80.png delete mode 100644 static/img/sl-logo.png rename static/{profile.de314aa1ff7e45d8b073.js => profile.1920d4ed83f2244fb9e0.js} (100%) rename static/{runtime.f820323d7f69fc9aac27.js => runtime.60aabece63b63766f770.js} (100%) rename static/{streamchat.435bdb77c1f249e56b82.js => streamchat.fc6a61bd6f9b041e4a70.js} (100%) rename static/{votechat.8011db95d14764c04653.js => votechat.d2c2c05a6ca0bd568699.js} (100%) create mode 100644 static/web.3d80f8efc87e3264a92f.js delete mode 100644 static/web.44a3fca3a7cf0c30f49b.css delete mode 100644 static/web.72821aa16bb1adf7c9d1.js create mode 100644 static/web.8bebfff54dde79230dda.css diff --git a/.gitignore b/.gitignore index 0ef26d6d6..40006221b 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,9 @@ config/config.local.php /config/*.pem /config/*.csr +/data/mysql +/data/redis + /public/*.txt /public/files /public/*.html diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..aa82c61a2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,49 @@ +FROM php:7.3-fpm + +# Copy composer.lock and composer.json +COPY composer.json /var/www/ + +# Set working directory +WORKDIR /var/www + +# Install dependencies +RUN apt-get update && apt-get install -y \ + build-essential \ + mysql-client-* \ + libpng-dev \ + libjpeg62-turbo-dev \ + libfreetype6-dev \ + libzip-dev \ + locales \ + zip \ + jpegoptim optipng pngquant gifsicle \ + vim \ + unzip \ + git \ + curl + +# Clear cache +RUN apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install extensions +RUN docker-php-ext-install pdo_mysql mbstring zip exif pcntl +RUN docker-php-ext-configure gd --with-gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include/ +RUN docker-php-ext-install gd + +## Redis +RUN pecl install -o -f redis \ + && rm -rf /tmp/pear \ + && docker-php-ext-enable redis + +# Install composer +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer + +# Copy existing application directory contents +COPY . /var/www + +# Copy existing application directory permissions +COPY --chown=www-data:www-data . /var/www + +# Expose port 9000 and start php-fpm server +EXPOSE 9000 +CMD ["php-fpm"] diff --git a/README.md b/README.md index 698a48be4..b717ee0d8 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ See [LICENSE.md](LICENSE.md) ### Building +[docker](https://www.docker.com/) Docker + [nodejs](http://nodejs.org/) Dependency manager [webpack](https://webpack.github.io/) Project builder @@ -25,10 +27,10 @@ See [LICENSE.md](LICENSE.md) ## Getting Started - -Create the configuration file "config/config.local.php" and override what you need. - -Create and load the database using `destiny.gg.sql` +1. Create the configuration file `cp config/config.dgg.conf config/config.local.conf` and override what you need. +2. Install `docker-compose up -d` +3. Create and load the database using `docker-compose exec -T db mysql -uroot -pdgg dgg < destiny.gg.sql` +4. Load Seed Data `docker-compose exec -T db mysql -uroot -pdgg dgg < destiny.gg.data.sql` ### Dependencies diff --git a/config/local.mysql.cnf b/config/local.mysql.cnf new file mode 100644 index 000000000..1c50b0266 --- /dev/null +++ b/config/local.mysql.cnf @@ -0,0 +1,3 @@ +[mysqld] +general_log = 1 +general_log_file = /var/lib/mysql/general.log diff --git a/config/local.php.ini b/config/local.php.ini new file mode 100644 index 000000000..03ba8a010 --- /dev/null +++ b/config/local.php.ini @@ -0,0 +1,7 @@ +upload_max_filesize=40M +post_max_size=40M + +log_errors = on +display_errors = off +error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_DEPRECATED +error_log = /var/log/error.log diff --git a/config/manifest.php b/config/manifest.php index 9b983ced2..7eaea8ea4 100644 --- a/config/manifest.php +++ b/config/manifest.php @@ -1,18 +1,18 @@ "common.vendor.a180bcf84872f6b5b06c.js", - "runtime.js" => "runtime.f820323d7f69fc9aac27.js", - "chat.vendor.css" => "chat.vendor.921603439ba1b85e5c7b.css", - "chat.vendor.js" => "chat.vendor.b8a1ff790976d978fa47.js", - "admin.js" => "admin.ff5a37819698288553df.js", - "bigscreen.js" => "bigscreen.ed9caa26b60c54b64521.js", - "chat.js" => "chat.81ec13ebf502ab19b8fd.js", - "profile.js" => "profile.de314aa1ff7e45d8b073.js", - "streamchat.js" => "streamchat.435bdb77c1f249e56b82.js", - "votechat.js" => "votechat.8011db95d14764c04653.js", - "web.css" => "web.44a3fca3a7cf0c30f49b.css", - "web.js" => "web.72821aa16bb1adf7c9d1.js", + "common.vendor.js" => "common.vendor.577ea20b04af95464fb9.js", + "runtime.js" => "runtime.60aabece63b63766f770.js", + "chat.vendor.css" => "chat.vendor.010a03adb03b4b1c96c6.css", + "chat.vendor.js" => "chat.vendor.32a21117ec538f592a5a.js", + "admin.js" => "admin.9fc5b6e9bfd006201b92.js", + "bigscreen.js" => "bigscreen.3d4fff2acef5a2bb6394.js", + "chat.js" => "chat.54838c41c1e57dfefc3f.js", + "profile.js" => "profile.1920d4ed83f2244fb9e0.js", + "streamchat.js" => "streamchat.fc6a61bd6f9b041e4a70.js", + "votechat.js" => "votechat.d2c2c05a6ca0bd568699.js", + "web.css" => "web.8bebfff54dde79230dda.css", + "web.js" => "web.3d80f8efc87e3264a92f.js", "font/style.scss" => "font/fa-solid-900.woff2", "img/style.scss" => "img/sl-logo.png" ]; \ No newline at end of file diff --git a/config/nginx/local/dgg.conf b/config/nginx/local/dgg.conf new file mode 100644 index 000000000..10ba97596 --- /dev/null +++ b/config/nginx/local/dgg.conf @@ -0,0 +1,50 @@ +server { + listen 80; + server_name www.destiny.gg 127.0.0.1; + index index.php index.html; + error_log /var/log/nginx/error.log; + access_log /var/log/nginx/access.log; + root /var/www/public; + + location ~ ^/\. { deny all; } + location /n/ { + rewrite ^(.*) "https://blog.destiny.gg/$1" permanent; + } + location /n { + rewrite .* "https://blog.destiny.gg/" permanent; + } + + location ~* \.(jpg|jpeg|png|gif|ico|css|js|map|svg)$ { + expires 365d; + } + + #location @phprewrite { + # rewrite ^/.*$ /public/index.php; + #} + + location ~ \.php$ { + if ($request_uri !~ "^/embed") { + add_header X-Frame-Options "SAMEORIGIN"; + add_header X-XSS-Protection "1; mode=block"; + add_header Content-Security-Policy "default-src *; script-src 'unsafe-inline' *.destiny.gg https://apis.google.com www.google.com www.google-analytics.com https://ssl.google-analytics.com https://*.googlesyndication.com https://googleads.g.doubleclick.net https://*.gstatic.com; object-src 'none'; style-src 'self' data: 'unsafe-inline' *.destiny.gg fonts.googleapis.com; img-src 'self' data: *.destiny.gg www.google-analytics.com https://ssl.google-analytics.com https://ting.7eer.net https://adn-ssl.impactradius.com https://ssl.gstatic.com; media-src 'none'; frame-src 'self' https://www.google.com www.twitch.tv clips.twitch.tv player.twitch.tv googleads.g.doubleclick.net; font-src *.destiny.gg fonts.googleapis.com fonts.gstatic.com; connect-src *"; + } + + add_header X-XSS-Protection "1; mode=block"; + add_header Strict-Transport-Security "max-age=2700000; includeSubDomains; preload"; + + include conf.d/dgg_csp.conf; + + try_files $uri =404; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass dgg_php:9000; + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PATH_INFO $fastcgi_path_info; + } + + location / { + try_files $uri $uri/ /index.php?$query_string; + gzip_static on; + } +} diff --git a/config/nginx/local/dgg_csp.conf b/config/nginx/local/dgg_csp.conf new file mode 100644 index 000000000..db77239bc --- /dev/null +++ b/config/nginx/local/dgg_csp.conf @@ -0,0 +1 @@ +add_header Content-Security-Policy "default-src *; script-src 'unsafe-inline' *.destiny.gg https://apis.google.com www.google.com www.google-analytics.com https://ssl.google-analytics.com https://*.googlesyndication.com https://googleads.g.doubleclick.net https://*.gstatic.com; object-src 'none'; style-src 'self' data: 'unsafe-inline' *.destiny.gg fonts.googleapis.com; img-src 'self' data: *.destiny.gg www.google-analytics.com https://ssl.google-analytics.com https://ting.7eer.net https://adn-ssl.impactradius.com https://ssl.gstatic.com; media-src 'none'; frame-src 'self' https://www.google.com www.twitch.tv clips.twitch.tv player.twitch.tv googleads.g.doubleclick.net; font-src *.destiny.gg fonts.googleapis.com fonts.gstatic.com; connect-src 'self' wss://*.destiny.gg"; diff --git a/data/mysql/.gitignore b/data/mysql/.gitignore new file mode 100644 index 000000000..d6b7ef32c --- /dev/null +++ b/data/mysql/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/data/redis/.gitignore b/data/redis/.gitignore new file mode 100644 index 000000000..d6b7ef32c --- /dev/null +++ b/data/redis/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..27799c78f --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,75 @@ +version: '3' +services: + + #PHP Service + dgg_php: + build: + context: . + dockerfile: Dockerfile + container_name: dgg_php + restart: unless-stopped + tty: true + working_dir: /var/www + volumes: + - ./:/var/www + - ./config/local.php.ini:/usr/local/etc/php/conf.d/local.ini + networks: + - dgg-network + + #Nginx Service + dgg_web: + image: nginx:alpine + container_name: dgg_web + restart: unless-stopped + tty: true + ports: + - "9380:80" + - "9443:443" + volumes: + - ./:/var/www + - ./config/nginx/local/:/etc/nginx/conf.d/ + networks: + - dgg-network + + #MySQL Service + dgg_mysql: + image: mysql:5.7.22 + container_name: dgg_mysql + restart: unless-stopped + tty: true + ports: + - "9306:3306" + environment: + MYSQL_DATABASE: dgg + MYSQL_ROOT_PASSWORD: dgg + SERVICE_TAGS: dev + SERVICE_NAME: mysql + volumes: + - dbdatamysql:/var/lib/mysql/ + - ./config/local.mysql.cnf:/etc/mysql/my.cnf + networks: + - dgg-network + + #Redis Service + dgg_redis: + container_name: dgg_redis + image: redis + ports: + - "9379:6379" + volumes: + - dbdataredis:/data + restart: always + networks: + - dgg-network + +#Docker Networks +networks: + dgg-network: + driver: bridge + +#Volumes +volumes: + dbdatamysql: + driver: local + dbdataredis: + driver: local diff --git a/lib/boot.app.php b/lib/boot.app.php index 01055ee1d..4992ef7c0 100644 --- a/lib/boot.app.php +++ b/lib/boot.app.php @@ -11,7 +11,7 @@ use Monolog\Logger; use Monolog\Processor\PsrLogMessageProcessor; -define('_APP_VERSION', '2.13.0'); // auto-generated: 1573074900222 +define('_APP_VERSION', '2.13.0'); // auto-generated: 1577215047913 define('_BASEDIR', realpath(__DIR__ . '/../')); $loader = require _BASEDIR . '/vendor/autoload.php'; diff --git a/lib/boot.test.php b/lib/boot.test.php index 61ede2835..a7d88a02a 100644 --- a/lib/boot.test.php +++ b/lib/boot.test.php @@ -8,7 +8,7 @@ use Monolog\Logger; use Monolog\Processor\PsrLogMessageProcessor; -define('_APP_VERSION', '2.13.0'); // auto-generated: 1573074900226 +define('_APP_VERSION', '2.13.0'); // auto-generated: 1577215047919 define('_BASEDIR', realpath(__DIR__ . '/../')); $loader = require _BASEDIR . '/vendor/autoload.php'; diff --git a/package.json b/package.json index 8e167583e..f868fa964 100644 --- a/package.json +++ b/package.json @@ -1,74 +1,74 @@ -{ - "name": "dgg-website", - "version": "2.13.0", - "description": "Destiny.gg front-end", - "main": "destiny", - "scripts": { - "ini": "node scripts/tasks/ini.js", - "watch": "webpack -w", - "build": "webpack -p --verbose --mode=production && npm run ini" - }, - "repository": { - "type": "git", - "url": "git://github.com/destinygg/website.git" - }, - "keywords": [ - "destiny.gg", - "destinygg", - "dgg" - ], - "browserslist": [ - "> 0.25%", - "not dead" - ], - "author": "Destiny.gg Foundation", - "contributors": [], - "homepage": "http://www.destiny.gg/", - "license": "SEE LICENSE IN ", - "bugs": "https://github.com/destinygg/website/issues", - "directories": { - "lib": "./lib", - "assets": "./assets", - "scripts": "./scripts", - "public": "./public", - "static": "./static" - }, - "dependencies": { - "@fortawesome/fontawesome-free": "^5.10.2", - "bootstrap": "^4.3.1", - "chart.js": "^2.8.0", - "dgg-chat-gui": "git://github.com/destinygg/chat-gui.git#9f07cab1c982801ac1c48517b9797cad32f5c6e8", - "jquery": "^3.4.1", - "jquery-validation": "^1.19.1", - "moment": "^2.24.0", - "popper.js": "^1.15.0", - "roboto-fontface": "^0.10.0", - "throttle-debounce": "^2.1.0", - "webpack-manifest-plugin": "^2.0.4", - "whatwg-fetch": "^3.0.0" - }, - "devDependencies": { - "@babel/core": "^7.6.0", - "@babel/polyfill": "^7.6.0", - "@babel/preset-env": "^7.6.0", - "autoprefixer": "^9.6.1", - "babel-loader": "^8.0.6", - "clean-webpack-plugin": "^2.0.2", - "css-loader": "^2.1.1", - "file-loader": "^3.0.1", - "html-loader": "^0.5.5", - "html-webpack-plugin": "^3.2.0", - "mini-css-extract-plugin": "^0.6.0", - "node-sass": "^4.12.0", - "optimize-css-assets-webpack-plugin": "^5.0.3", - "postcss-loader": "^3.0.0", - "sass-loader": "^7.3.1", - "style-loader": "^0.23.1", - "webpack": "^4.39.3", - "webpack-cli": "^3.3.8" - }, - "engines": { - "node": "~5.0.2", - "npm": "~3.3.12" - } -} +{ + "name": "dgg-website", + "version": "2.13.0", + "description": "Destiny.gg front-end", + "main": "destiny", + "scripts": { + "ini": "node scripts/tasks/ini.js", + "watch": "webpack -w", + "build": "webpack -p --verbose --mode=production && npm run ini" + }, + "repository": { + "type": "git", + "url": "git://github.com/destinygg/website.git" + }, + "keywords": [ + "destiny.gg", + "destinygg", + "dgg" + ], + "browserslist": [ + "> 0.25%", + "not dead" + ], + "author": "Destiny.gg Foundation", + "contributors": [], + "homepage": "http://www.destiny.gg/", + "license": "SEE LICENSE IN ", + "bugs": "https://github.com/destinygg/website/issues", + "directories": { + "lib": "./lib", + "assets": "./assets", + "scripts": "./scripts", + "public": "./public", + "static": "./static" + }, + "dependencies": { + "@fortawesome/fontawesome-free": "^5.10.2", + "bootstrap": "^4.3.1", + "chart.js": "^2.8.0", + "dgg-chat-gui": "git://github.com/destinygg/chat-gui.git#9f07cab1c982801ac1c48517b9797cad32f5c6e8", + "jquery": "^3.4.1", + "jquery-validation": "^1.19.1", + "moment": "^2.24.0", + "popper.js": "^1.15.0", + "roboto-fontface": "^0.10.0", + "throttle-debounce": "^2.1.0", + "webpack-manifest-plugin": "^2.0.4", + "whatwg-fetch": "^3.0.0" + }, + "devDependencies": { + "@babel/core": "^7.6.0", + "@babel/polyfill": "^7.6.0", + "@babel/preset-env": "^7.6.0", + "autoprefixer": "^9.6.1", + "babel-loader": "^8.0.6", + "clean-webpack-plugin": "^2.0.2", + "css-loader": "^2.1.1", + "file-loader": "^3.0.1", + "html-loader": "^0.5.5", + "html-webpack-plugin": "^3.2.0", + "mini-css-extract-plugin": "^0.6.0", + "node-sass": "^4.12.0", + "optimize-css-assets-webpack-plugin": "^5.0.3", + "postcss-loader": "^3.0.0", + "sass-loader": "^7.3.1", + "style-loader": "^0.23.1", + "webpack": "^4.39.3", + "webpack-cli": "^3.3.8" + }, + "engines": { + "node": "~5.0.2", + "npm": "~3.3.12" + } +} diff --git a/public/index.php b/public/index.php index cc11b905e..9b42f8ba7 100644 --- a/public/index.php +++ b/public/index.php @@ -55,4 +55,4 @@ } catch (Exception $e) { Log::error($e->getMessage()); echo "Application failed to start. Check the error logs for more info."; -} \ No newline at end of file +} diff --git a/static/admin.9fc5b6e9bfd006201b92.js b/static/admin.9fc5b6e9bfd006201b92.js new file mode 100644 index 000000000..4869e8a3e --- /dev/null +++ b/static/admin.9fc5b6e9bfd006201b92.js @@ -0,0 +1,8 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{10:function(t,e,n){ +/*! + * Chart.js v2.9.3 + * https://www.chartjs.org + * (c) 2019 Chart.js Contributors + * Released under the MIT License + */ +t.exports=function(t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var e={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},n=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t){var n={};for(var a in e)e.hasOwnProperty(a)&&(n[e[a]]=a);var i=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var r in i)if(i.hasOwnProperty(r)){if(!("channels"in i[r]))throw new Error("missing channels property: "+r);if(!("labels"in i[r]))throw new Error("missing channel labels property: "+r);if(i[r].labels.length!==i[r].channels)throw new Error("channel and label counts mismatch: "+r);var o=i[r].channels,s=i[r].labels;delete i[r].channels,delete i[r].labels,Object.defineProperty(i[r],"channels",{value:o}),Object.defineProperty(i[r],"labels",{value:s})}i.rgb.hsl=function(t){var e,n,a=t[0]/255,i=t[1]/255,r=t[2]/255,o=Math.min(a,i,r),s=Math.max(a,i,r),l=s-o;return s===o?e=0:a===s?e=(i-r)/l:i===s?e=2+(r-a)/l:r===s&&(e=4+(a-i)/l),(e=Math.min(60*e,360))<0&&(e+=360),n=(o+s)/2,[e,100*(s===o?0:n<=.5?l/(s+o):l/(2-s-o)),100*n]},i.rgb.hsv=function(t){var e,n,a,i,r,o=t[0]/255,s=t[1]/255,l=t[2]/255,d=Math.max(o,s,l),u=d-Math.min(o,s,l),c=function(t){return(d-t)/6/u+.5};return 0===u?i=r=0:(r=u/d,e=c(o),n=c(s),a=c(l),o===d?i=a-n:s===d?i=1/3+e-a:l===d&&(i=2/3+n-e),i<0?i+=1:i>1&&(i-=1)),[360*i,100*r,100*d]},i.rgb.hwb=function(t){var e=t[0],n=t[1],a=t[2];return[i.rgb.hsl(t)[0],1/255*Math.min(e,Math.min(n,a))*100,100*(a=1-1/255*Math.max(e,Math.max(n,a)))]},i.rgb.cmyk=function(t){var e,n=t[0]/255,a=t[1]/255,i=t[2]/255;return[100*((1-n-(e=Math.min(1-n,1-a,1-i)))/(1-e)||0),100*((1-a-e)/(1-e)||0),100*((1-i-e)/(1-e)||0),100*e]},i.rgb.keyword=function(t){var a=n[t];if(a)return a;var i,r,o,s=1/0;for(var l in e)if(e.hasOwnProperty(l)){var d=e[l],u=(r=t,o=d,Math.pow(r[0]-o[0],2)+Math.pow(r[1]-o[1],2)+Math.pow(r[2]-o[2],2));u.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(a=a>.04045?Math.pow((a+.055)/1.055,2.4):a/12.92)),100*(.2126*e+.7152*n+.0722*a),100*(.0193*e+.1192*n+.9505*a)]},i.rgb.lab=function(t){var e=i.rgb.xyz(t),n=e[0],a=e[1],r=e[2];return a/=100,r/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(a=a>.008856?Math.pow(a,1/3):7.787*a+16/116)-16,500*(n-a),200*(a-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},i.hsl.rgb=function(t){var e,n,a,i,r,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0===s)return[r=255*l,r,r];e=2*l-(n=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];for(var d=0;d<3;d++)(a=o+1/3*-(d-1))<0&&a++,a>1&&a--,r=6*a<1?e+6*(n-e)*a:2*a<1?n:3*a<2?e+(n-e)*(2/3-a)*6:e,i[d]=255*r;return i},i.hsl.hsv=function(t){var e=t[0],n=t[1]/100,a=t[2]/100,i=n,r=Math.max(a,.01);return n*=(a*=2)<=1?a:2-a,i*=r<=1?r:2-r,[e,100*(0===a?2*i/(r+i):2*n/(a+n)),(a+n)/2*100]},i.hsv.rgb=function(t){var e=t[0]/60,n=t[1]/100,a=t[2]/100,i=Math.floor(e)%6,r=e-Math.floor(e),o=255*a*(1-n),s=255*a*(1-n*r),l=255*a*(1-n*(1-r));switch(a*=255,i){case 0:return[a,l,o];case 1:return[s,a,o];case 2:return[o,a,l];case 3:return[o,s,a];case 4:return[l,o,a];case 5:return[a,o,s]}},i.hsv.hsl=function(t){var e,n,a,i=t[0],r=t[1]/100,o=t[2]/100,s=Math.max(o,.01);return a=(2-r)*o,n=r*s,[i,100*(n=(n/=(e=(2-r)*s)<=1?e:2-e)||0),100*(a/=2)]},i.hwb.rgb=function(t){var e,n,a,i,r,o,s,l=t[0]/360,d=t[1]/100,u=t[2]/100,c=d+u;switch(c>1&&(d/=c,u/=c),a=6*l-(e=Math.floor(6*l)),0!=(1&e)&&(a=1-a),i=d+a*((n=1-u)-d),e){default:case 6:case 0:r=n,o=i,s=d;break;case 1:r=i,o=n,s=d;break;case 2:r=d,o=n,s=i;break;case 3:r=d,o=i,s=n;break;case 4:r=i,o=d,s=n;break;case 5:r=n,o=d,s=i}return[255*r,255*o,255*s]},i.cmyk.rgb=function(t){var e=t[0]/100,n=t[1]/100,a=t[2]/100,i=t[3]/100;return[255*(1-Math.min(1,e*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i)),255*(1-Math.min(1,a*(1-i)+i))]},i.xyz.rgb=function(t){var e,n,a,i=t[0]/100,r=t[1]/100,o=t[2]/100;return n=-.9689*i+1.8758*r+.0415*o,a=.0557*i+-.204*r+1.057*o,e=(e=3.2406*i+-1.5372*r+-.4986*o)>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:12.92*a,[255*(e=Math.min(Math.max(0,e),1)),255*(n=Math.min(Math.max(0,n),1)),255*(a=Math.min(Math.max(0,a),1))]},i.xyz.lab=function(t){var e=t[0],n=t[1],a=t[2];return n/=100,a/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(e-n),200*(n-(a=a>.008856?Math.pow(a,1/3):7.787*a+16/116))]},i.lab.xyz=function(t){var e,n,a,i=t[0];e=t[1]/500+(n=(i+16)/116),a=n-t[2]/200;var r=Math.pow(n,3),o=Math.pow(e,3),s=Math.pow(a,3);return n=r>.008856?r:(n-16/116)/7.787,e=o>.008856?o:(e-16/116)/7.787,a=s>.008856?s:(a-16/116)/7.787,[e*=95.047,n*=100,a*=108.883]},i.lab.lch=function(t){var e,n=t[0],a=t[1],i=t[2];return(e=360*Math.atan2(i,a)/2/Math.PI)<0&&(e+=360),[n,Math.sqrt(a*a+i*i),e]},i.lch.lab=function(t){var e,n=t[0],a=t[1];return e=t[2]/360*2*Math.PI,[n,a*Math.cos(e),a*Math.sin(e)]},i.rgb.ansi16=function(t){var e=t[0],n=t[1],a=t[2],r=1 in arguments?arguments[1]:i.rgb.hsv(t)[2];if(0===(r=Math.round(r/50)))return 30;var o=30+(Math.round(a/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return 2===r&&(o+=60),o},i.hsv.ansi16=function(t){return i.rgb.ansi16(i.hsv.rgb(t),t[2])},i.rgb.ansi256=function(t){var e=t[0],n=t[1],a=t[2];return e===n&&n===a?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(a/255*5)},i.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var n=.5*(1+~~(t>50));return[(1&e)*n*255,(e>>1&1)*n*255,(e>>2&1)*n*255]},i.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var n;return t-=16,[Math.floor(t/36)/5*255,Math.floor((n=t%36)/6)/5*255,n%6/5*255]},i.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},i.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var n=e[0];3===e[0].length&&(n=n.split("").map((function(t){return t+t})).join(""));var a=parseInt(n,16);return[a>>16&255,a>>8&255,255&a]},i.rgb.hcg=function(t){var e,n=t[0]/255,a=t[1]/255,i=t[2]/255,r=Math.max(Math.max(n,a),i),o=Math.min(Math.min(n,a),i),s=r-o;return e=s<=0?0:r===n?(a-i)/s%6:r===a?2+(i-n)/s:4+(n-a)/s+4,e/=6,[360*(e%=1),100*s,100*(s<1?o/(1-s):0)]},i.hsl.hcg=function(t){var e=t[1]/100,n=t[2]/100,a=1,i=0;return(a=n<.5?2*e*n:2*e*(1-n))<1&&(i=(n-.5*a)/(1-a)),[t[0],100*a,100*i]},i.hsv.hcg=function(t){var e=t[1]/100,n=t[2]/100,a=e*n,i=0;return a<1&&(i=(n-a)/(1-a)),[t[0],100*a,100*i]},i.hcg.rgb=function(t){var e=t[0]/360,n=t[1]/100,a=t[2]/100;if(0===n)return[255*a,255*a,255*a];var i,r=[0,0,0],o=e%1*6,s=o%1,l=1-s;switch(Math.floor(o)){case 0:r[0]=1,r[1]=s,r[2]=0;break;case 1:r[0]=l,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=s;break;case 3:r[0]=0,r[1]=l,r[2]=1;break;case 4:r[0]=s,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=l}return i=(1-n)*a,[255*(n*r[0]+i),255*(n*r[1]+i),255*(n*r[2]+i)]},i.hcg.hsv=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e),a=0;return n>0&&(a=e/n),[t[0],100*a,100*n]},i.hcg.hsl=function(t){var e=t[1]/100,n=t[2]/100*(1-e)+.5*e,a=0;return n>0&&n<.5?a=e/(2*n):n>=.5&&n<1&&(a=e/(2*(1-n))),[t[0],100*a,100*n]},i.hcg.hwb=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e);return[t[0],100*(n-e),100*(1-n)]},i.hwb.hcg=function(t){var e=t[1]/100,n=1-t[2]/100,a=n-e,i=0;return a<1&&(i=(n-a)/(1-a)),[t[0],100*a,100*i]},i.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},i.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},i.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},i.gray.hsl=i.gray.hsv=function(t){return[0,0,t[0]]},i.gray.hwb=function(t){return[0,100,t[0]]},i.gray.cmyk=function(t){return[0,0,0,t[0]]},i.gray.lab=function(t){return[t[0],0,0]},i.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n},i.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}}));function a(t){var e=function(){for(var t={},e=Object.keys(n),a=e.length,i=0;i1&&(e=Array.prototype.slice.call(arguments));var n=t(e);if("object"==typeof n)for(var a=n.length,i=0;i1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(a)}))}));var s=o,l={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},d={getRgba:u,getHsla:c,getRgb:function(t){var e=u(t);return e&&e.slice(0,3)},getHsl:function(t){var e=c(t);return e&&e.slice(0,3)},getHwb:h,getAlpha:function(t){var e=u(t);return e?e[3]:(e=c(t))?e[3]:(e=h(t))?e[3]:void 0},hexString:function(t,e){return e=void 0!==e&&3===t.length?e:t[3],"#"+v(t[0])+v(t[1])+v(t[2])+(e>=0&&e<1?v(Math.round(255*e)):"")},rgbString:function(t,e){return e<1||t[3]&&t[3]<1?f(t,e):"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},rgbaString:f,percentString:function(t,e){if(e<1||t[3]&&t[3]<1)return g(t,e);var n=Math.round(t[0]/255*100),a=Math.round(t[1]/255*100),i=Math.round(t[2]/255*100);return"rgb("+n+"%, "+a+"%, "+i+"%)"},percentaString:g,hslString:function(t,e){return e<1||t[3]&&t[3]<1?p(t,e):"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"},hslaString:p,hwbString:function(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+(void 0!==e&&1!==e?", "+e:"")+")"},keyword:function(t){return b[t.slice(0,3)]}};function u(t){if(t){var e=[0,0,0],n=1,a=t.match(/^#([a-fA-F0-9]{3,4})$/i),i="";if(a){i=(a=a[1])[3];for(var r=0;rn?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){var e=this.values.hsl;return e[2]+=e[2]*t,this.setValues("hsl",e),this},darken:function(t){var e=this.values.hsl;return e[2]-=e[2]*t,this.setValues("hsl",e),this},saturate:function(t){var e=this.values.hsl;return e[1]+=e[1]*t,this.setValues("hsl",e),this},desaturate:function(t){var e=this.values.hsl;return e[1]-=e[1]*t,this.setValues("hsl",e),this},whiten:function(t){var e=this.values.hwb;return e[1]+=e[1]*t,this.setValues("hwb",e),this},blacken:function(t){var e=this.values.hwb;return e[2]+=e[2]*t,this.setValues("hwb",e),this},greyscale:function(){var t=this.values.rgb,e=.3*t[0]+.59*t[1]+.11*t[2];return this.setValues("rgb",[e,e,e]),this},clearer:function(t){var e=this.values.alpha;return this.setValues("alpha",e-e*t),this},opaquer:function(t){var e=this.values.alpha;return this.setValues("alpha",e+e*t),this},rotate:function(t){var e=this.values.hsl,n=(e[0]+t)%360;return e[0]=n<0?360+n:n,this.setValues("hsl",e),this},mix:function(t,e){var n=t,a=void 0===e?.5:e,i=2*a-1,r=this.alpha()-n.alpha(),o=((i*r==-1?i:(i+r)/(1+i*r))+1)/2,s=1-o;return this.rgb(o*this.red()+s*n.red(),o*this.green()+s*n.green(),o*this.blue()+s*n.blue()).alpha(this.alpha()*a+n.alpha()*(1-a))},toJSON:function(){return this.rgb()},clone:function(){var t,e,n=new y,a=this.values,i=n.values;for(var r in a)a.hasOwnProperty(r)&&(t=a[r],"[object Array]"===(e={}.toString.call(t))?i[r]=t.slice(0):"[object Number]"===e?i[r]=t:console.error("unexpected color value:",t));return n}},y.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},y.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},y.prototype.getValues=function(t){for(var e=this.values,n={},a=0;a=0;i--)e.call(n,t[i],i);else for(i=0;i=1?t:-(Math.sqrt(1-t*t)-1)},easeOutCirc:function(t){return Math.sqrt(1-(t-=1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,n=0,a=1;return 0===t?0:1===t?1:(n||(n=.3),a<1?(a=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/a),-a*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n))},easeOutElastic:function(t){var e=1.70158,n=0,a=1;return 0===t?0:1===t?1:(n||(n=.3),a<1?(a=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/a),a*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},easeInOutElastic:function(t){var e=1.70158,n=0,a=1;return 0===t?0:2==(t/=.5)?1:(n||(n=.45),a<1?(a=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/a),t<1?a*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*-.5:a*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},easeInBack:function(t){var e=1.70158;return t*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:function(t){return 1-C.easeOutBounce(1-t)},easeOutBounce:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:function(t){return t<.5?.5*C.easeInBounce(2*t):.5*C.easeOutBounce(2*t-1)+.5}},D={effects:C};w.easingEffects=C;var S=Math.PI,A=S/180,P=2*S,T=S/2,I=S/4,F=2*S/3,L={clear:function(t){t.ctx.clearRect(0,0,t.width,t.height)},roundedRect:function(t,e,n,a,i,r){if(r){var o=Math.min(r,i/2,a/2),s=e+o,l=n+o,d=e+a-o,u=n+i-o;t.moveTo(e,l),se.left-1e-6&&t.xe.top-1e-6&&t.y0&&this.requestAnimationFrame()},advance:function(){for(var t,e,n,a,i=this.animations,r=0;r=n?(E.callback(t.onAnimationComplete,[t],e),e.animating=!1,i.splice(r,1)):++r}},J=E.options.resolve,Q=["push","pop","shift","splice","unshift"];function tt(t,e){var n=t._chartjs;if(n){var a=n.listeners,i=a.indexOf(e);-1!==i&&a.splice(i,1),a.length>0||(Q.forEach((function(e){delete t[e]})),delete t._chartjs)}}var et=function(t,e){this.initialize(t,e)};E.extend(et.prototype,{datasetElementType:null,dataElementType:null,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth"],_dataElementOptions:["backgroundColor","borderColor","borderWidth","pointStyle"],initialize:function(t,e){var n=this;n.chart=t,n.index=e,n.linkScales(),n.addElements(),n._type=n.getMeta().type},updateIndex:function(t){this.index=t},linkScales:function(){var t=this.getMeta(),e=this.chart,n=e.scales,a=this.getDataset(),i=e.options.scales;null!==t.xAxisID&&t.xAxisID in n&&!a.xAxisID||(t.xAxisID=a.xAxisID||i.xAxes[0].id),null!==t.yAxisID&&t.yAxisID in n&&!a.yAxisID||(t.yAxisID=a.yAxisID||i.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(t){return this.chart.scales[t]},_getValueScaleId:function(){return this.getMeta().yAxisID},_getIndexScaleId:function(){return this.getMeta().xAxisID},_getValueScale:function(){return this.getScaleForId(this._getValueScaleId())},_getIndexScale:function(){return this.getScaleForId(this._getIndexScaleId())},reset:function(){this._update(!0)},destroy:function(){this._data&&tt(this._data,this)},createMetaDataset:function(){var t=this.datasetElementType;return t&&new t({_chart:this.chart,_datasetIndex:this.index})},createMetaData:function(t){var e=this.dataElementType;return e&&new e({_chart:this.chart,_datasetIndex:this.index,_index:t})},addElements:function(){var t,e,n=this.getMeta(),a=this.getDataset().data||[],i=n.data;for(t=0,e=a.length;tn&&this.insertElements(n,a-n)},insertElements:function(t,e){for(var n=0;ni?(r=i/e.innerRadius,t.arc(o,s,e.innerRadius-i,a+r,n-r,!0)):t.arc(o,s,i,a+Math.PI/2,n-Math.PI/2),t.closePath(),t.clip()}function rt(t,e,n){var a="inner"===e.borderAlign;a?(t.lineWidth=2*e.borderWidth,t.lineJoin="round"):(t.lineWidth=e.borderWidth,t.lineJoin="bevel"),n.fullCircles&&function(t,e,n,a){var i,r=n.endAngle;for(a&&(n.endAngle=n.startAngle+at,it(t,n),n.endAngle=r,n.endAngle===n.startAngle&&n.fullCircles&&(n.endAngle+=at,n.fullCircles--)),t.beginPath(),t.arc(n.x,n.y,n.innerRadius,n.startAngle+at,n.startAngle,!0),i=0;is;)i-=at;for(;i=o&&i<=s,d=r>=n.innerRadius&&r<=n.outerRadius;return l&&d}return!1},getCenterPoint:function(){var t=this._view,e=(t.startAngle+t.endAngle)/2,n=(t.innerRadius+t.outerRadius)/2;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},getArea:function(){var t=this._view;return Math.PI*((t.endAngle-t.startAngle)/(2*Math.PI))*(Math.pow(t.outerRadius,2)-Math.pow(t.innerRadius,2))},tooltipPosition:function(){var t=this._view,e=t.startAngle+(t.endAngle-t.startAngle)/2,n=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},draw:function(){var t,e=this._chart.ctx,n=this._view,a="inner"===n.borderAlign?.33:0,i={x:n.x,y:n.y,innerRadius:n.innerRadius,outerRadius:Math.max(n.outerRadius-a,0),pixelMargin:a,startAngle:n.startAngle,endAngle:n.endAngle,fullCircles:Math.floor(n.circumference/at)};if(e.save(),e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,i.fullCircles){for(i.endAngle=i.startAngle+at,e.beginPath(),e.arc(i.x,i.y,i.outerRadius,i.startAngle,i.endAngle),e.arc(i.x,i.y,i.innerRadius,i.endAngle,i.startAngle,!0),e.closePath(),t=0;tt.x&&(e=vt(e,"left","right")):t.basen?n:a,r:l.right||i<0?0:i>e?e:i,b:l.bottom||r<0?0:r>n?n:r,l:l.left||o<0?0:o>e?e:o}}function xt(t,e,n){var a=null===e,i=null===n,r=!(!t||a&&i)&&mt(t);return r&&(a||e>=r.left&&e<=r.right)&&(i||n>=r.top&&n<=r.bottom)}B._set("global",{elements:{rectangle:{backgroundColor:gt,borderColor:gt,borderSkipped:"bottom",borderWidth:0}}});var yt=X.extend({_type:"rectangle",draw:function(){var t=this._chart.ctx,e=this._view,n=function(t){var e=mt(t),n=e.right-e.left,a=e.bottom-e.top,i=bt(t,n/2,a/2);return{outer:{x:e.left,y:e.top,w:n,h:a},inner:{x:e.left+i.l,y:e.top+i.t,w:n-i.l-i.r,h:a-i.t-i.b}}}(e),a=n.outer,i=n.inner;t.fillStyle=e.backgroundColor,t.fillRect(a.x,a.y,a.w,a.h),a.w===i.w&&a.h===i.h||(t.save(),t.beginPath(),t.rect(a.x,a.y,a.w,a.h),t.clip(),t.fillStyle=e.borderColor,t.rect(i.x,i.y,i.w,i.h),t.fill("evenodd"),t.restore())},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){return xt(this._view,t,e)},inLabelRange:function(t,e){var n=this._view;return pt(n)?xt(n,t,null):xt(n,null,e)},inXRange:function(t){return xt(this._view,t,null)},inYRange:function(t){return xt(this._view,null,t)},getCenterPoint:function(){var t,e,n=this._view;return pt(n)?(t=n.x,e=(n.y+n.base)/2):(t=(n.x+n.base)/2,e=n.y),{x:t,y:e}},getArea:function(){var t=this._view;return pt(t)?t.width*Math.abs(t.y-t.base):t.height*Math.abs(t.x-t.base)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}}),_t={},kt=ot,Mt=dt,wt=ft,Ct=yt;_t.Arc=kt,_t.Line=Mt,_t.Point=wt,_t.Rectangle=Ct;var Dt=E._deprecated,St=E.valueOrDefault;function At(t,e,n){var a,i,r=n.barThickness,o=e.stackCount,s=e.pixels[t],l=E.isNullOrUndef(r)?function(t,e){var n,a,i,r,o=t._length;for(i=1,r=e.length;i0?Math.min(o,Math.abs(a-n)):o,n=a;return o}(e.scale,e.pixels):-1;return E.isNullOrUndef(r)?(a=l*n.categoryPercentage,i=n.barPercentage):(a=r*o,i=1),{chunk:a/o,ratio:i,start:s-a/2}}B._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}}),B._set("global",{datasets:{bar:{categoryPercentage:.8,barPercentage:.9}}});var Pt=nt.extend({dataElementType:_t.Rectangle,_dataElementOptions:["backgroundColor","borderColor","borderSkipped","borderWidth","barPercentage","barThickness","categoryPercentage","maxBarThickness","minBarLength"],initialize:function(){var t,e,n=this;nt.prototype.initialize.apply(n,arguments),(t=n.getMeta()).stack=n.getDataset().stack,t.bar=!0,e=n._getIndexScale().options,Dt("bar chart",e.barPercentage,"scales.[x/y]Axes.barPercentage","dataset.barPercentage"),Dt("bar chart",e.barThickness,"scales.[x/y]Axes.barThickness","dataset.barThickness"),Dt("bar chart",e.categoryPercentage,"scales.[x/y]Axes.categoryPercentage","dataset.categoryPercentage"),Dt("bar chart",n._getValueScale().options.minBarLength,"scales.[x/y]Axes.minBarLength","dataset.minBarLength"),Dt("bar chart",e.maxBarThickness,"scales.[x/y]Axes.maxBarThickness","dataset.maxBarThickness")},update:function(t){var e,n,a=this.getMeta().data;for(this._ruler=this.getRuler(),e=0,n=a.length;e=0&&p.min>=0?p.min:p.max,y=void 0===p.start?p.end:p.max>=0&&p.min>=0?p.max-p.min:p.min-p.max,_=g.length;if(v||void 0===v&&void 0!==b)for(a=0;a<_&&(i=g[a]).index!==t;++a)i.stack===b&&(r=void 0===(d=c._parseValue(f[i.index].data[e])).start?d.end:d.min>=0&&d.max>=0?d.max:d.min,(p.min<0&&r<0||p.max>=0&&r>0)&&(x+=r));return o=c.getPixelForValue(x),l=(s=c.getPixelForValue(x+y))-o,void 0!==m&&Math.abs(l)=0&&!h||y<0&&h?o-m:o+m),{size:l,base:o,head:s,center:s+l/2}},calculateBarIndexPixels:function(t,e,n,a){var i="flex"===a.barThickness?function(t,e,n){var a,i=e.pixels,r=i[t],o=t>0?i[t-1]:null,s=t=Ot?-Rt:b<-Ot?Rt:0)+m,y=Math.cos(b),_=Math.sin(b),k=Math.cos(x),M=Math.sin(x),w=b<=0&&x>=0||x>=Rt,C=b<=Bt&&x>=Bt||x>=Rt+Bt,D=b<=-Bt&&x>=-Bt||x>=Ot+Bt,S=b===-Ot||x>=Ot?-1:Math.min(y,y*p,k,k*p),A=D?-1:Math.min(_,_*p,M,M*p),P=w?1:Math.max(y,y*p,k,k*p),T=C?1:Math.max(_,_*p,M,M*p);d=(P-S)/2,u=(T-A)/2,c=-(P+S)/2,h=-(T+A)/2}for(a=0,i=g.length;a0&&!isNaN(t)?Rt*(Math.abs(t)/e):0},getMaxBorderWidth:function(t){var e,n,a,i,r,o,s,l,d=0,u=this.chart;if(!t)for(e=0,n=u.data.datasets.length;e(d=s>d?s:d)?l:d);return d},setHoverStyle:function(t){var e=t._model,n=t._options,a=E.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=Lt(n.hoverBackgroundColor,a(n.backgroundColor)),e.borderColor=Lt(n.hoverBorderColor,a(n.borderColor)),e.borderWidth=Lt(n.hoverBorderWidth,n.borderWidth)},_getRingWeightOffset:function(t){for(var e=0,n=0;n0&&Et(l[t-1]._model,s)&&(n.controlPointPreviousX=d(n.controlPointPreviousX,s.left,s.right),n.controlPointPreviousY=d(n.controlPointPreviousY,s.top,s.bottom)),t0&&(r=t.getDatasetMeta(r[0]._datasetIndex).data),r},"x-axis":function(t,e){return ae(t,e,{intersect:!1})},point:function(t,e){return te(t,Jt(e,t))},nearest:function(t,e,n){var a=Jt(e,t);n.axis=n.axis||"xy";var i=ne(n.axis);return ee(t,a,n.intersect,i)},x:function(t,e,n){var a=Jt(e,t),i=[],r=!1;return Qt(t,(function(t){t.inXRange(a.x)&&i.push(t),t.inRange(a.x,a.y)&&(r=!0)})),n.intersect&&!r&&(i=[]),i},y:function(t,e,n){var a=Jt(e,t),i=[],r=!1;return Qt(t,(function(t){t.inYRange(a.y)&&i.push(t),t.inRange(a.x,a.y)&&(r=!0)})),n.intersect&&!r&&(i=[]),i}}},re=E.extend;function oe(t,e){return E.where(t,(function(t){return t.pos===e}))}function se(t,e){return t.sort((function(t,n){var a=e?n:t,i=e?t:n;return a.weight===i.weight?a.index-i.index:a.weight-i.weight}))}function le(t,e,n,a){return Math.max(t[n],e[n])+Math.max(t[a],e[a])}function de(t,e,n){var a,i,r=n.box,o=t.maxPadding;if(n.size&&(t[n.pos]-=n.size),n.size=n.horizontal?r.height:r.width,t[n.pos]+=n.size,r.getPadding){var s=r.getPadding();o.top=Math.max(o.top,s.top),o.left=Math.max(o.left,s.left),o.bottom=Math.max(o.bottom,s.bottom),o.right=Math.max(o.right,s.right)}if(a=e.outerWidth-le(o,t,"left","right"),i=e.outerHeight-le(o,t,"top","bottom"),a!==t.w||i!==t.h)return t.w=a,t.h=i,n.horizontal?a!==t.w:i!==t.h}function ue(t,e){var n=e.maxPadding;function a(t){var a={left:0,top:0,right:0,bottom:0};return t.forEach((function(t){a[t]=Math.max(e[t],n[t])})),a}return a(t?["left","right"]:["top","bottom"])}function ce(t,e,n){var a,i,r,o,s,l,d=[];for(a=0,i=t.length;a div {\n\tposition: absolute;\n\twidth: 1000000px;\n\theight: 1000000px;\n\tleft: 0;\n\ttop: 0;\n}\n\n.chartjs-size-monitor-shrink > div {\n\tposition: absolute;\n\twidth: 200%;\n\theight: 200%;\n\tleft: 0;\n\ttop: 0;\n}\n"}))&&fe.default||fe,me="$chartjs",ve="chartjs-size-monitor",be="chartjs-render-monitor",xe="chartjs-render-animation",ye=["animationstart","webkitAnimationStart"],_e={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function ke(t,e){var n=E.getStyle(t,e),a=n&&n.match(/^(\d+)(\.\d+)?px$/);return a?Number(a[1]):void 0}var Me=!!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("e",null,e)}catch(t){}return t}()&&{passive:!0};function we(t,e,n){t.addEventListener(e,n,Me)}function Ce(t,e,n){t.removeEventListener(e,n,Me)}function De(t,e,n,a,i){return{type:t,chart:e,native:i||null,x:void 0!==n?n:null,y:void 0!==a?a:null}}function Se(t){var e=document.createElement("div");return e.className=t||"",e}function Ae(t,e,n){var a,i,r,o,s=t[me]||(t[me]={}),l=s.resizer=function(t){var e=Se(ve),n=Se(ve+"-expand"),a=Se(ve+"-shrink");n.appendChild(Se()),a.appendChild(Se()),e.appendChild(n),e.appendChild(a),e._reset=function(){n.scrollLeft=1e6,n.scrollTop=1e6,a.scrollLeft=1e6,a.scrollTop=1e6};var i=function(){e._reset(),t()};return we(n,"scroll",i.bind(n,"expand")),we(a,"scroll",i.bind(a,"shrink")),e}((a=function(){if(s.resizer){var a=n.options.maintainAspectRatio&&t.parentNode,i=a?a.clientWidth:0;e(De("resize",n)),a&&a.clientWidth0){var r=t[0];r.label?n=r.label:r.xLabel?n=r.xLabel:i>0&&r.index-1?t.split("\n"):t}function We(t){var e=B.global;return{xPadding:t.xPadding,yPadding:t.yPadding,xAlign:t.xAlign,yAlign:t.yAlign,rtl:t.rtl,textDirection:t.textDirection,bodyFontColor:t.bodyFontColor,_bodyFontFamily:Re(t.bodyFontFamily,e.defaultFontFamily),_bodyFontStyle:Re(t.bodyFontStyle,e.defaultFontStyle),_bodyAlign:t.bodyAlign,bodyFontSize:Re(t.bodyFontSize,e.defaultFontSize),bodySpacing:t.bodySpacing,titleFontColor:t.titleFontColor,_titleFontFamily:Re(t.titleFontFamily,e.defaultFontFamily),_titleFontStyle:Re(t.titleFontStyle,e.defaultFontStyle),titleFontSize:Re(t.titleFontSize,e.defaultFontSize),_titleAlign:t.titleAlign,titleSpacing:t.titleSpacing,titleMarginBottom:t.titleMarginBottom,footerFontColor:t.footerFontColor,_footerFontFamily:Re(t.footerFontFamily,e.defaultFontFamily),_footerFontStyle:Re(t.footerFontStyle,e.defaultFontStyle),footerFontSize:Re(t.footerFontSize,e.defaultFontSize),_footerAlign:t.footerAlign,footerSpacing:t.footerSpacing,footerMarginTop:t.footerMarginTop,caretSize:t.caretSize,cornerRadius:t.cornerRadius,backgroundColor:t.backgroundColor,opacity:0,legendColorBackground:t.multiKeyBackground,displayColors:t.displayColors,borderColor:t.borderColor,borderWidth:t.borderWidth}}function Ee(t,e){return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-t.xPadding:t.x+t.xPadding}function Ve(t){return ze([],Ye(t))}var He=X.extend({initialize:function(){this._model=We(this._options),this._lastActive=[]},getTitle:function(){var t=this,e=t._options,n=e.callbacks,a=n.beforeTitle.apply(t,arguments),i=n.title.apply(t,arguments),r=n.afterTitle.apply(t,arguments),o=[];return o=ze(o,Ye(a)),o=ze(o,Ye(i)),o=ze(o,Ye(r))},getBeforeBody:function(){return Ve(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(t,e){var n=this,a=n._options.callbacks,i=[];return E.each(t,(function(t){var r={before:[],lines:[],after:[]};ze(r.before,Ye(a.beforeLabel.call(n,t,e))),ze(r.lines,a.label.call(n,t,e)),ze(r.after,Ye(a.afterLabel.call(n,t,e))),i.push(r)})),i},getAfterBody:function(){return Ve(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var t=this,e=t._options.callbacks,n=e.beforeFooter.apply(t,arguments),a=e.footer.apply(t,arguments),i=e.afterFooter.apply(t,arguments),r=[];return r=ze(r,Ye(n)),r=ze(r,Ye(a)),r=ze(r,Ye(i))},update:function(t){var e,n,a,i,r,o,s,l,d,u,c=this,h=c._options,f=c._model,g=c._model=We(h),p=c._active,m=c._data,v={xAlign:f.xAlign,yAlign:f.yAlign},b={x:f.x,y:f.y},x={width:f.width,height:f.height},y={x:f.caretX,y:f.caretY};if(p.length){g.opacity=1;var _=[],k=[];y=Ne[h.position].call(c,p,c._eventPosition);var M=[];for(e=0,n=p.length;ea.width&&(i=a.width-e.width),i<0&&(i=0)),"top"===u?r+=c:r-="bottom"===u?e.height+c:e.height/2,"center"===u?"left"===d?i+=c:"right"===d&&(i-=c):"left"===d?i-=h:"right"===d&&(i+=h),{x:i,y:r}}(g,x,v=function(t,e){var n,a,i,r,o,s=t._model,l=t._chart,d=t._chart.chartArea,u="center",c="center";s.yl.height-e.height&&(c="bottom");var h=(d.left+d.right)/2,f=(d.top+d.bottom)/2;"center"===c?(n=function(t){return t<=h},a=function(t){return t>h}):(n=function(t){return t<=e.width/2},a=function(t){return t>=l.width-e.width/2}),i=function(t){return t+e.width+s.caretSize+s.caretPadding>l.width},r=function(t){return t-e.width-s.caretSize-s.caretPadding<0},o=function(t){return t<=f?"top":"bottom"},n(s.x)?(u="left",i(s.x)&&(u="center",c=o(s.y))):a(s.x)&&(u="right",r(s.x)&&(u="center",c=o(s.y)));var g=t._options;return{xAlign:g.xAlign?g.xAlign:u,yAlign:g.yAlign?g.yAlign:c}}(this,x),c._chart)}else g.opacity=0;return g.xAlign=v.xAlign,g.yAlign=v.yAlign,g.x=b.x,g.y=b.y,g.width=x.width,g.height=x.height,g.caretX=y.x,g.caretY=y.y,c._model=g,t&&h.custom&&h.custom.call(c,g),c},drawCaret:function(t,e){var n=this._chart.ctx,a=this._view,i=this.getCaretPosition(t,e,a);n.lineTo(i.x1,i.y1),n.lineTo(i.x2,i.y2),n.lineTo(i.x3,i.y3)},getCaretPosition:function(t,e,n){var a,i,r,o,s,l,d=n.caretSize,u=n.cornerRadius,c=n.xAlign,h=n.yAlign,f=t.x,g=t.y,p=e.width,m=e.height;if("center"===h)s=g+m/2,"left"===c?(i=(a=f)-d,r=a,o=s+d,l=s-d):(i=(a=f+p)+d,r=a,o=s-d,l=s+d);else if("left"===c?(a=(i=f+u+d)-d,r=i+d):"right"===c?(a=(i=f+p-u-d)-d,r=i+d):(a=(i=n.caretX)-d,r=i+d),"top"===h)s=(o=g)-d,l=o;else{s=(o=g+m)+d,l=o;var v=r;r=a,a=v}return{x1:a,x2:i,x3:r,y1:o,y2:s,y3:l}},drawTitle:function(t,e,n){var a,i,r,o=e.title,s=o.length;if(s){var l=Be(e.rtl,e.x,e.width);for(t.x=Ee(e,e._titleAlign),n.textAlign=l.textAlign(e._titleAlign),n.textBaseline="middle",a=e.titleFontSize,i=e.titleSpacing,n.fillStyle=e.titleFontColor,n.font=E.fontString(a,e._titleFontStyle,e._titleFontFamily),r=0;r0&&n.stroke()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var n={width:e.width,height:e.height},a={x:e.x,y:e.y},i=Math.abs(e.opacity<.001)?0:e.opacity,r=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;this._options.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(a,e,t,n),a.y+=e.yPadding,E.rtl.overrideTextDirection(t,e.textDirection),this.drawTitle(a,e,t),this.drawBody(a,e,t),this.drawFooter(a,e,t),E.rtl.restoreTextDirection(t,e.textDirection),t.restore())}},handleEvent:function(t){var e,n=this,a=n._options;return n._lastActive=n._lastActive||[],"mouseout"===t.type?n._active=[]:(n._active=n._chart.getElementsAtEventForMode(t,a.mode,a),a.reverse&&n._active.reverse()),(e=!E.arrayEquals(n._active,n._lastActive))&&(n._lastActive=n._active,(a.enabled||a.custom)&&(n._eventPosition={x:t.x,y:t.y},n.update(!0),n.pivot())),e}}),je=Ne,Ue=He;Ue.positioners=je;var qe=E.valueOrDefault;function Ge(){return E.merge({},[].slice.call(arguments),{merger:function(t,e,n,a){if("xAxes"===t||"yAxes"===t){var i,r,o,s=n[t].length;for(e[t]||(e[t]=[]),i=0;i=e[t].length&&e[t].push({}),!e[t][i].type||o.type&&o.type!==e[t][i].type?E.merge(e[t][i],[Oe.getScaleDefaults(r),o]):E.merge(e[t][i],o)}else E._merger(t,e,n,a)}})}function Xe(){return E.merge({},[].slice.call(arguments),{merger:function(t,e,n,a){var i=e[t]||{},r=n[t];"scales"===t?e[t]=Ge(i,r):"scale"===t?e[t]=E.merge(i,[Oe.getScaleDefaults(r.type),r]):E._merger(t,e,n,a)}})}function Ze(t){var e=t.options;E.each(t.scales,(function(e){ge.removeBox(t,e)})),e=Xe(B.global,B[t.config.type],e),t.options=t.config.options=e,t.ensureScalesHaveIDs(),t.buildOrUpdateScales(),t.tooltip._options=e.tooltips,t.tooltip.initialize()}function Ke(t,e,n){var a,i=function(t){return t.id===a};do{a=e+n++}while(E.findIndex(t,i)>=0);return a}function $e(t){return"top"===t||"bottom"===t}function Je(t,e){return function(n,a){return n[t]===a[t]?n[e]-a[e]:n[t]-a[t]}}B._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});var Qe=function(t,e){return this.construct(t,e),this};E.extend(Qe.prototype,{construct:function(t,e){var n=this;e=function(t){var e=(t=t||{}).data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=Xe(B.global,B[t.type],t.options||{}),t}(e);var a=Fe.acquireContext(t,e),i=a&&a.canvas,r=i&&i.height,o=i&&i.width;n.id=E.uid(),n.ctx=a,n.canvas=i,n.config=e,n.width=o,n.height=r,n.aspectRatio=r?o/r:null,n.options=e.options,n._bufferedRender=!1,n._layers=[],n.chart=n,n.controller=n,Qe.instances[n.id]=n,Object.defineProperty(n,"data",{get:function(){return n.config.data},set:function(t){n.config.data=t}}),a&&i?(n.initialize(),n.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return Le.notify(t,"beforeInit"),E.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.initToolTip(),Le.notify(t,"afterInit"),t},clear:function(){return E.canvas.clear(this),this},stop:function(){return $.cancelAnimation(this),this},resize:function(t){var e=this,n=e.options,a=e.canvas,i=n.maintainAspectRatio&&e.aspectRatio||null,r=Math.max(0,Math.floor(E.getMaximumWidth(a))),o=Math.max(0,Math.floor(i?r/i:E.getMaximumHeight(a)));if((e.width!==r||e.height!==o)&&(a.width=e.width=r,a.height=e.height=o,a.style.width=r+"px",a.style.height=o+"px",E.retinaScale(e,n.devicePixelRatio),!t)){var s={width:r,height:o};Le.notify(e,"resize",[s]),n.onResize&&n.onResize(e,s),e.stop(),e.update({duration:n.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},n=t.scale;E.each(e.xAxes,(function(t,n){t.id||(t.id=Ke(e.xAxes,"x-axis-",n))})),E.each(e.yAxes,(function(t,n){t.id||(t.id=Ke(e.yAxes,"y-axis-",n))})),n&&(n.id=n.id||"scale")},buildOrUpdateScales:function(){var t=this,e=t.options,n=t.scales||{},a=[],i=Object.keys(n).reduce((function(t,e){return t[e]=!1,t}),{});e.scales&&(a=a.concat((e.scales.xAxes||[]).map((function(t){return{options:t,dtype:"category",dposition:"bottom"}})),(e.scales.yAxes||[]).map((function(t){return{options:t,dtype:"linear",dposition:"left"}})))),e.scale&&a.push({options:e.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),E.each(a,(function(e){var a=e.options,r=a.id,o=qe(a.type,e.dtype);$e(a.position)!==$e(e.dposition)&&(a.position=e.dposition),i[r]=!0;var s=null;if(r in n&&n[r].type===o)(s=n[r]).options=a,s.ctx=t.ctx,s.chart=t;else{var l=Oe.getScaleConstructor(o);if(!l)return;s=new l({id:r,type:o,options:a,ctx:t.ctx,chart:t}),n[s.id]=s}s.mergeTicksOptions(),e.isDefault&&(t.scale=s)})),E.each(i,(function(t,e){t||delete n[e]})),t.scales=n,Oe.addScalesToLayout(this)},buildOrUpdateControllers:function(){var t,e,n=this,a=[],i=n.data.datasets;for(t=0,e=i.length;t=0;--n)this.drawDataset(e[n],t);Le.notify(this,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var n={meta:t,index:t.index,easingValue:e};!1!==Le.notify(this,"beforeDatasetDraw",[n])&&(t.controller.draw(e),Le.notify(this,"afterDatasetDraw",[n]))},_drawTooltip:function(t){var e=this.tooltip,n={tooltip:e,easingValue:t};!1!==Le.notify(this,"beforeTooltipDraw",[n])&&(e.draw(),Le.notify(this,"afterTooltipDraw",[n]))},getElementAtEvent:function(t){return ie.modes.single(this,t)},getElementsAtEvent:function(t){return ie.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return ie.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,n){var a=ie.modes[e];return"function"==typeof a?a(this,t,n):[]},getDatasetAtEvent:function(t){return ie.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this.data.datasets[t];e._meta||(e._meta={});var n=e._meta[this.id];return n||(n=e._meta[this.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e.order||0,index:t}),n},getVisibleDatasetCount:function(){for(var t=0,e=0,n=this.data.datasets.length;e3?n[2]-n[1]:n[1]-n[0];Math.abs(a)>1&&t!==Math.floor(t)&&(a=t-Math.floor(t));var i=E.log10(Math.abs(a)),r="";if(0!==t)if(Math.max(Math.abs(n[0]),Math.abs(n[n.length-1]))<1e-4){var o=E.log10(Math.abs(t)),s=Math.floor(o)-Math.floor(i);s=Math.max(Math.min(s,20),0),r=t.toExponential(s)}else{var l=-1*Math.floor(i);l=Math.max(Math.min(l,20),0),r=t.toFixed(l)}else r="0";return r},logarithmic:function(t,e,n){var a=t/Math.pow(10,Math.floor(E.log10(t)));return 0===t?"0":1===a||2===a||5===a||0===e||e===n.length-1?t.toExponential():""}}},on=E.isArray,sn=E.isNullOrUndef,ln=E.valueOrDefault,dn=E.valueAtIndexOrDefault;function un(t,e,n){var a,i=t.getTicks().length,r=Math.min(e,i-1),o=t.getPixelForTick(r),s=t._startPixel,l=t._endPixel;if(!(n&&(a=1===i?Math.max(o-s,l-o):0===e?(t.getPixelForTick(1)-o)/2:(o-t.getPixelForTick(r-1))/2,(o+=rl+1e-6)))return o}function cn(t,e,n,a){var i,r,o,s,l,d,u,c,h,f,g,p,m,v=n.length,b=[],x=[],y=[];for(i=0;ie){for(n=0;n=h||u<=1||!s.isHorizontal()?s.labelRotation=c:(e=(t=s._getLabelSizes()).widest.width,n=t.highest.height-t.highest.offset,a=Math.min(s.maxWidth,s.chart.width-e),e+6>(i=l.offset?s.maxWidth/u:a/(u-1))&&(i=a/(u-(l.offset?.5:1)),r=s.maxHeight-hn(l.gridLines)-d.padding-fn(l.scaleLabel),o=Math.sqrt(e*e+n*n),f=E.toDegrees(Math.min(Math.asin(Math.min((t.highest.height+6)/i,1)),Math.asin(Math.min(r/o,1))-Math.asin(n/o))),f=Math.max(c,Math.min(h,f))),s.labelRotation=f)},afterCalculateTickRotation:function(){E.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){E.callback(this.options.beforeFit,[this])},fit:function(){var t=this,e=t.minSize={width:0,height:0},n=t.chart,a=t.options,i=a.ticks,r=a.scaleLabel,o=a.gridLines,s=t._isVisible(),l="bottom"===a.position,d=t.isHorizontal();if(d?e.width=t.maxWidth:s&&(e.width=hn(o)+fn(r)),d?s&&(e.height=hn(o)+fn(r)):e.height=t.maxHeight,i.display&&s){var u=pn(i),c=t._getLabelSizes(),h=c.first,f=c.last,g=c.widest,p=c.highest,m=.4*u.minor.lineHeight,v=i.padding;if(d){var b=0!==t.labelRotation,x=E.toRadians(t.labelRotation),y=Math.cos(x),_=Math.sin(x),k=_*g.width+y*(p.height-(b?p.offset:0))+(b?0:m);e.height=Math.min(t.maxHeight,e.height+k+v);var M,w,C=t.getPixelForTick(0)-t.left,D=t.right-t.getPixelForTick(t.getTicks().length-1);b?(M=l?y*h.width+_*h.offset:_*(h.height-h.offset),w=l?_*(f.height-f.offset):y*f.width+_*f.offset):(M=h.width/2,w=f.width/2),t.paddingLeft=Math.max((M-C)*t.width/(t.width-C),0)+3,t.paddingRight=Math.max((w-D)*t.width/(t.width-D),0)+3}else{var S=i.mirror?0:g.width+v+m;e.width=Math.min(t.maxWidth,e.width+S),t.paddingTop=h.height/2,t.paddingBottom=f.height/2}}t.handleMargins(),d?(t.width=t._length=n.width-t.margins.left-t.margins.right,t.height=e.height):(t.width=e.width,t.height=t._length=n.height-t.margins.top-t.margins.bottom)},handleMargins:function(){var t=this;t.margins&&(t.margins.left=Math.max(t.paddingLeft,t.margins.left),t.margins.top=Math.max(t.paddingTop,t.margins.top),t.margins.right=Math.max(t.paddingRight,t.margins.right),t.margins.bottom=Math.max(t.paddingBottom,t.margins.bottom))},afterFit:function(){E.callback(this.options.afterFit,[this])},isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){if(sn(t))return NaN;if(("number"==typeof t||t instanceof Number)&&!isFinite(t))return NaN;if(t)if(this.isHorizontal()){if(void 0!==t.x)return this.getRightValue(t.x)}else if(void 0!==t.y)return this.getRightValue(t.y);return t},_convertTicksToLabels:function(t){var e,n,a,i=this;for(i.ticks=t.map((function(t){return t.value})),i.beforeTickToLabelConversion(),e=i.convertTicksToLabels(t)||i.ticks,i.afterTickToLabelConversion(),n=0,a=t.length;nn-1?null:this.getPixelForDecimal(t*a+(e?a/2:0))},getPixelForDecimal:function(t){return this._reversePixels&&(t=1-t),this._startPixel+t*this._length},getDecimalForPixel:function(t){var e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var t=this.min,e=this.max;return this.beginAtZero?0:t<0&&e<0?e:t>0&&e>0?t:0},_autoSkip:function(t){var e,n,a,i,r=this.options.ticks,o=this._length,s=r.maxTicksLimit||o/this._tickSize()+1,l=r.major.enabled?function(t){var e,n,a=[];for(e=0,n=t.length;es)return function(t,e,n){var a,i,r=0,o=e[0];for(n=Math.ceil(n),a=0;ad)return r;return Math.max(d,1)}(l,t,0,s),d>0){for(e=0,n=d-1;e1?(c-u)/(d-1):null,vn(t,a,E.isNullOrUndef(i)?0:u-i,u),vn(t,a,c,E.isNullOrUndef(i)?t.length:c+i),mn(t)}return vn(t,a),mn(t)},_tickSize:function(){var t=this.options.ticks,e=E.toRadians(this.labelRotation),n=Math.abs(Math.cos(e)),a=Math.abs(Math.sin(e)),i=this._getLabelSizes(),r=t.autoSkipPadding||0,o=i?i.widest.width+r:0,s=i?i.highest.height+r:0;return this.isHorizontal()?s*n>o*a?o/n:s/a:s*a=0&&(o=t),void 0!==r&&(t=n.indexOf(r))>=0&&(s=t),e.minIndex=o,e.maxIndex=s,e.min=n[o],e.max=n[s]},buildTicks:function(){var t=this._getLabels(),e=this.minIndex,n=this.maxIndex;this.ticks=0===e&&n===t.length-1?t:t.slice(e,n+1)},getLabelForIndex:function(t,e){var n=this.chart;return n.getDatasetMeta(e).controller._getValueScaleId()===this.id?this.getRightValue(n.data.datasets[e].data[t]):this._getLabels()[t]},_configure:function(){var t=this,e=t.options.offset,n=t.ticks;xn.prototype._configure.call(t),t.isHorizontal()||(t._reversePixels=!t._reversePixels),n&&(t._startValue=t.minIndex-(e?.5:0),t._valueRange=Math.max(n.length-(e?0:1),1))},getPixelForValue:function(t,e,n){var a,i,r,o=this;return yn(e)||yn(n)||(t=o.chart.data.datasets[n].data[e]),yn(t)||(a=o.isHorizontal()?t.x:t.y),(void 0!==a||void 0!==t&&isNaN(e))&&(i=o._getLabels(),t=E.valueOrDefault(a,t),e=-1!==(r=i.indexOf(t))?r:e,isNaN(e)&&(e=t)),o.getPixelForDecimal((e-o._startValue)/o._valueRange)},getPixelForTick:function(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t],t+this.minIndex)},getValueForPixel:function(t){var e=Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange);return Math.min(Math.max(e,0),this.ticks.length-1)},getBasePixel:function(){return this.bottom}}),kn={position:"bottom"};_n._defaults=kn;var Mn=E.noop,wn=E.isNullOrUndef,Cn=xn.extend({getRightValue:function(t){return"string"==typeof t?+t:xn.prototype.getRightValue.call(this,t)},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;if(e.beginAtZero){var n=E.sign(t.min),a=E.sign(t.max);n<0&&a<0?t.max=0:n>0&&a>0&&(t.min=0)}var i=void 0!==e.min||void 0!==e.suggestedMin,r=void 0!==e.max||void 0!==e.suggestedMax;void 0!==e.min?t.min=e.min:void 0!==e.suggestedMin&&(null===t.min?t.min=e.suggestedMin:t.min=Math.min(t.min,e.suggestedMin)),void 0!==e.max?t.max=e.max:void 0!==e.suggestedMax&&(null===t.max?t.max=e.suggestedMax:t.max=Math.max(t.max,e.suggestedMax)),i!==r&&t.min>=t.max&&(i?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,e.beginAtZero||t.min--)},getTickLimit:function(){var t,e=this.options.ticks,n=e.stepSize,a=e.maxTicksLimit;return n?t=Math.ceil(this.max/n)-Math.floor(this.min/n)+1:(t=this._computeTickLimit(),a=a||11),a&&(t=Math.min(a,t)),t},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:Mn,buildTicks:function(){var t=this,e=t.options.ticks,n=t.getTickLimit(),a={maxTicks:n=Math.max(2,n),min:e.min,max:e.max,precision:e.precision,stepSize:E.valueOrDefault(e.fixedStepSize,e.stepSize)},i=t.ticks=function(t,e){var n,a,i,r,o=[],s=t.stepSize,l=s||1,d=t.maxTicks-1,u=t.min,c=t.max,h=t.precision,f=e.min,g=e.max,p=E.niceNum((g-f)/d/l)*l;if(p<1e-14&&wn(u)&&wn(c))return[f,g];(r=Math.ceil(g/p)-Math.floor(f/p))>d&&(p=E.niceNum(r*p/d/l)*l),s||wn(h)?n=Math.pow(10,E._decimalPlaces(p)):(n=Math.pow(10,h),p=Math.ceil(p*n)/n),a=Math.floor(f/p)*p,i=Math.ceil(g/p)*p,s&&(!wn(u)&&E.almostWhole(u/p,p/1e3)&&(a=u),!wn(c)&&E.almostWhole(c/p,p/1e3)&&(i=c)),r=(i-a)/p,r=E.almostEquals(r,Math.round(r),p/1e3)?Math.round(r):Math.ceil(r),a=Math.round(a*n)/n,i=Math.round(i*n)/n,o.push(wn(u)?a:u);for(var m=1;me.length-1?null:this.getPixelForValue(e[t])}}),Tn=Dn;Pn._defaults=Tn;var In=E.valueOrDefault,Fn=E.math.log10,Ln={position:"left",ticks:{callback:rn.formatters.logarithmic}};function On(t,e){return E.isFinite(t)&&t>=0?t:e}var Rn=xn.extend({determineDataLimits:function(){var t,e,n,a,i,r,o=this,s=o.options,l=o.chart,d=l.data.datasets,u=o.isHorizontal();function c(t){return u?t.xAxisID===o.id:t.yAxisID===o.id}o.min=Number.POSITIVE_INFINITY,o.max=Number.NEGATIVE_INFINITY,o.minNotZero=Number.POSITIVE_INFINITY;var h=s.stacked;if(void 0===h)for(t=0;t0){var e=E.min(t),n=E.max(t);o.min=Math.min(o.min,e),o.max=Math.max(o.max,n)}}))}else for(t=0;t0?t.minNotZero=t.min:t.max<1?t.minNotZero=Math.pow(10,Math.floor(Fn(t.max))):t.minNotZero=1)},buildTicks:function(){var t=this,e=t.options.ticks,n=!t.isHorizontal(),a={min:On(e.min),max:On(e.max)},i=t.ticks=function(t,e){var n,a,i=[],r=In(t.min,Math.pow(10,Math.floor(Fn(e.min)))),o=Math.floor(Fn(e.max)),s=Math.ceil(e.max/Math.pow(10,o));0===r?(n=Math.floor(Fn(e.minNotZero)),a=Math.floor(e.minNotZero/Math.pow(10,n)),i.push(r),r=a*Math.pow(10,n)):(n=Math.floor(Fn(r)),a=Math.floor(r/Math.pow(10,n)));var l=n<0?Math.pow(10,Math.abs(n)):1;do{i.push(r),10==++a&&(a=1,l=++n>=0?1:l),r=Math.round(a*Math.pow(10,n)*l)/l}while(ne.length-1?null:this.getPixelForValue(e[t])},_getFirstTickValue:function(t){var e=Math.floor(Fn(t));return Math.floor(t/Math.pow(10,e))*Math.pow(10,e)},_configure:function(){var t=this,e=t.min,n=0;xn.prototype._configure.call(t),0===e&&(e=t._getFirstTickValue(t.minNotZero),n=In(t.options.ticks.fontSize,B.global.defaultFontSize)/t._length),t._startValue=Fn(e),t._valueOffset=n,t._valueRange=(Fn(t.max)-Fn(e))/(1-n)},getPixelForValue:function(t){var e=this,n=0;return(t=+e.getRightValue(t))>e.min&&t>0&&(n=(Fn(t)-e._startValue)/e._valueRange+e._valueOffset),e.getPixelForDecimal(n)},getValueForPixel:function(t){var e=this,n=e.getDecimalForPixel(t);return 0===n&&0===e.min?0:Math.pow(10,e._startValue+(n-e._valueOffset)*e._valueRange)}}),Bn=Ln;Rn._defaults=Bn;var Nn=E.valueOrDefault,zn=E.valueAtIndexOrDefault,Yn=E.options.resolve,Wn={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:rn.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(t){return t}}};function En(t){var e=t.ticks;return e.display&&t.display?Nn(e.fontSize,B.global.defaultFontSize)+2*e.backdropPaddingY:0}function Vn(t,e,n,a,i){return t===a||t===i?{start:e-n/2,end:e+n/2}:ti?{start:e-n,end:e}:{start:e,end:e+n}}function Hn(t){return 0===t||180===t?"center":t<180?"left":"right"}function jn(t,e,n,a){var i,r,o=n.y+a/2;if(E.isArray(e))for(i=0,r=e.length;i270||t<90)&&(n.y-=e.h)}function qn(t){return E.isNumber(t)?t:0}var Gn=Cn.extend({setDimensions:function(){var t=this;t.width=t.maxWidth,t.height=t.maxHeight,t.paddingTop=En(t.options)/2,t.xCenter=Math.floor(t.width/2),t.yCenter=Math.floor((t.height-t.paddingTop)/2),t.drawingArea=Math.min(t.height-t.paddingTop,t.width)/2},determineDataLimits:function(){var t=this,e=t.chart,n=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;E.each(e.data.datasets,(function(i,r){if(e.isDatasetVisible(r)){var o=e.getDatasetMeta(r);E.each(i.data,(function(e,i){var r=+t.getRightValue(e);isNaN(r)||o.data[i].hidden||(n=Math.min(r,n),a=Math.max(r,a))}))}})),t.min=n===Number.POSITIVE_INFINITY?0:n,t.max=a===Number.NEGATIVE_INFINITY?0:a,t.handleTickRangeOptions()},_computeTickLimit:function(){return Math.ceil(this.drawingArea/En(this.options))},convertTicksToLabels:function(){var t=this;Cn.prototype.convertTicksToLabels.call(t),t.pointLabels=t.chart.data.labels.map((function(){var e=E.callback(t.options.pointLabels.callback,arguments,t);return e||0===e?e:""}))},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},fit:function(){var t=this.options;t.display&&t.pointLabels.display?function(t){var e,n,a,i=E.options._parseFont(t.options.pointLabels),r={l:0,r:t.width,t:0,b:t.height-t.paddingTop},o={};t.ctx.font=i.string,t._pointLabelSizes=[];var s,l,d,u=t.chart.data.labels.length;for(e=0;er.r&&(r.r=f.end,o.r=c),g.startr.b&&(r.b=g.end,o.b=c)}t.setReductions(t.drawingArea,r,o)}(this):this.setCenterPoint(0,0,0,0)},setReductions:function(t,e,n){var a=this,i=e.l/Math.sin(n.l),r=Math.max(e.r-a.width,0)/Math.sin(n.r),o=-e.t/Math.cos(n.t),s=-Math.max(e.b-(a.height-a.paddingTop),0)/Math.cos(n.b);i=qn(i),r=qn(r),o=qn(o),s=qn(s),a.drawingArea=Math.min(Math.floor(t-(i+r)/2),Math.floor(t-(o+s)/2)),a.setCenterPoint(i,r,o,s)},setCenterPoint:function(t,e,n,a){var i=this,r=i.width-e-i.drawingArea,o=t+i.drawingArea,s=n+i.drawingArea,l=i.height-i.paddingTop-a-i.drawingArea;i.xCenter=Math.floor((o+r)/2+i.left),i.yCenter=Math.floor((s+l)/2+i.top+i.paddingTop)},getIndexAngle:function(t){var e=this.chart,n=(t*(360/e.data.labels.length)+((e.options||{}).startAngle||0))%360;return(n<0?n+360:n)*Math.PI*2/360},getDistanceFromCenterForValue:function(t){var e=this;if(E.isNullOrUndef(t))return NaN;var n=e.drawingArea/(e.max-e.min);return e.options.ticks.reverse?(e.max-t)*n:(t-e.min)*n},getPointPosition:function(t,e){var n=this.getIndexAngle(t)-Math.PI/2;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter}},getPointPositionForValue:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))},getBasePosition:function(t){var e=this.min,n=this.max;return this.getPointPositionForValue(t||0,this.beginAtZero?0:e<0&&n<0?n:e>0&&n>0?e:0)},_drawGrid:function(){var t,e,n,a=this,i=a.ctx,r=a.options,o=r.gridLines,s=r.angleLines,l=Nn(s.lineWidth,o.lineWidth),d=Nn(s.color,o.color);if(r.pointLabels.display&&function(t){var e=t.ctx,n=t.options,a=n.pointLabels,i=En(n),r=t.getDistanceFromCenterForValue(n.ticks.reverse?t.min:t.max),o=E.options._parseFont(a);e.save(),e.font=o.string,e.textBaseline="middle";for(var s=t.chart.data.labels.length-1;s>=0;s--){var l=0===s?i/2:0,d=t.getPointPosition(s,r+l+5),u=zn(a.fontColor,s,B.global.defaultFontColor);e.fillStyle=u;var c=t.getIndexAngle(s),h=E.toDegrees(c);e.textAlign=Hn(h),Un(h,t._pointLabelSizes[s],d),jn(e,t.pointLabels[s],d,o.lineHeight)}e.restore()}(a),o.display&&E.each(a.ticks,(function(t,n){0!==n&&(e=a.getDistanceFromCenterForValue(a.ticksAsNumbers[n]),function(t,e,n,a){var i,r=t.ctx,o=e.circular,s=t.chart.data.labels.length,l=zn(e.color,a-1),d=zn(e.lineWidth,a-1);if((o||s)&&l&&d){if(r.save(),r.strokeStyle=l,r.lineWidth=d,r.setLineDash&&(r.setLineDash(e.borderDash||[]),r.lineDashOffset=e.borderDashOffset||0),r.beginPath(),o)r.arc(t.xCenter,t.yCenter,n,0,2*Math.PI);else{i=t.getPointPosition(0,n),r.moveTo(i.x,i.y);for(var u=1;u=0;t--)e=a.getDistanceFromCenterForValue(r.ticks.reverse?a.min:a.max),n=a.getPointPosition(t,e),i.beginPath(),i.moveTo(a.xCenter,a.yCenter),i.lineTo(n.x,n.y),i.stroke();i.restore()}},_drawLabels:function(){var t=this,e=t.ctx,n=t.options.ticks;if(n.display){var a,i,r=t.getIndexAngle(0),o=E.options._parseFont(n),s=Nn(n.fontColor,B.global.defaultFontColor);e.save(),e.font=o.string,e.translate(t.xCenter,t.yCenter),e.rotate(r),e.textAlign="center",e.textBaseline="middle",E.each(t.ticks,(function(r,l){(0!==l||n.reverse)&&(a=t.getDistanceFromCenterForValue(t.ticksAsNumbers[l]),n.showLabelBackdrop&&(i=e.measureText(r).width,e.fillStyle=n.backdropColor,e.fillRect(-i/2-n.backdropPaddingX,-a-o.size/2-n.backdropPaddingY,i+2*n.backdropPaddingX,o.size+2*n.backdropPaddingY)),e.fillStyle=s,e.fillText(r,0,-a))})),e.restore()}},_drawTitle:E.noop}),Xn=Wn;Gn._defaults=Xn;var Zn=E._deprecated,Kn=E.options.resolve,$n=E.valueOrDefault,Jn=Number.MIN_SAFE_INTEGER||-9007199254740991,Qn=Number.MAX_SAFE_INTEGER||9007199254740991,ta={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ea=Object.keys(ta);function na(t,e){return t-e}function aa(t){return E.valueOrDefault(t.time.min,t.ticks.min)}function ia(t){return E.valueOrDefault(t.time.max,t.ticks.max)}function ra(t,e,n,a){var i=function(t,e,n){for(var a,i,r,o=0,s=t.length-1;o>=0&&o<=s;){if(i=t[(a=o+s>>1)-1]||null,r=t[a],!i)return{lo:null,hi:r};if(r[e]n))return{lo:i,hi:r};s=a-1}}return{lo:r,hi:null}}(t,e,n),r=i.lo?i.hi?i.lo:t[t.length-2]:t[0],o=i.lo?i.hi?i.hi:t[t.length-1]:t[1],s=o[e]-r[e],l=s?(n-r[e])/s:0,d=(o[a]-r[a])*l;return r[a]+d}function oa(t,e){var n=t._adapter,a=t.options.time,i=a.parser,r=i||a.format,o=e;return"function"==typeof i&&(o=i(o)),E.isFinite(o)||(o="string"==typeof r?n.parse(o,r):n.parse(o)),null!==o?+o:(i||"function"!=typeof r||(o=r(e),E.isFinite(o)||(o=n.parse(o))),o)}function sa(t,e){if(E.isNullOrUndef(e))return null;var n=t.options.time,a=oa(t,t.getRightValue(e));return null===a?a:(n.round&&(a=+t._adapter.startOf(a,n.round)),a)}function la(t,e,n,a){var i,r,o,s=ea.length;for(i=ea.indexOf(t);i=0&&(e[r].major=!0);return e}(t,r,o,n):r}var ua=xn.extend({initialize:function(){this.mergeTicksOptions(),xn.prototype.initialize.call(this)},update:function(){var t=this,e=t.options,n=e.time||(e.time={}),a=t._adapter=new an._date(e.adapters.date);return Zn("time scale",n.format,"time.format","time.parser"),Zn("time scale",n.min,"time.min","ticks.min"),Zn("time scale",n.max,"time.max","ticks.max"),E.mergeIf(n.displayFormats,a.formats()),xn.prototype.update.apply(t,arguments)},getRightValue:function(t){return t&&void 0!==t.t&&(t=t.t),xn.prototype.getRightValue.call(this,t)},determineDataLimits:function(){var t,e,n,a,i,r,o,s=this,l=s.chart,d=s._adapter,u=s.options,c=u.time.unit||"day",h=Qn,f=Jn,g=[],p=[],m=[],v=s._getLabels();for(t=0,n=v.length;t1?function(t){var e,n,a,i={},r=[];for(e=0,n=t.length;e1e5*d)throw e+" and "+n+" are too far apart with stepSize of "+d+" "+l;for(i=c;i=i&&n<=r&&u.push(n);return a.min=i,a.max=r,a._unit=l.unit||(s.autoSkip?la(l.minUnit,a.min,a.max,c):function(t,e,n,a,i){var r,o;for(r=ea.length-1;r>=ea.indexOf(n);r--)if(o=ea[r],ta[o].common&&t._adapter.diff(i,a,o)>=e-1)return o;return ea[n?ea.indexOf(n):0]}(a,u.length,l.minUnit,a.min,a.max)),a._majorUnit=s.major.enabled&&"year"!==a._unit?function(t){for(var e=ea.indexOf(t)+1,n=ea.length;ee&&s=0&&t0?s:1}}),ca={position:"bottom",distribution:"linear",bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}};ua._defaults=ca;var ha={category:_n,linear:Pn,logarithmic:Rn,radialLinear:Gn,time:ua},fa={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};an._date.override("function"==typeof t?{_id:"moment",formats:function(){return fa},parse:function(e,n){return"string"==typeof e&&"string"==typeof n?e=t(e,n):e instanceof t||(e=t(e)),e.isValid()?e.valueOf():null},format:function(e,n){return t(e).format(n)},add:function(e,n,a){return t(e).add(n,a).valueOf()},diff:function(e,n,a){return t(e).diff(t(n),a)},startOf:function(e,n,a){return e=t(e),"isoWeek"===n?e.isoWeekday(a).valueOf():e.startOf(n).valueOf()},endOf:function(e,n){return t(e).endOf(n).valueOf()},_create:function(e){return t(e)}}:{}),B._set("global",{plugins:{filler:{propagate:!0}}});var ga={dataset:function(t){var e=t.fill,n=t.chart,a=n.getDatasetMeta(e),i=a&&n.isDatasetVisible(e)&&a.dataset._children||[],r=i.length||0;return r?function(t,e){return e=n)&&a;switch(r){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return r;default:return!1}}function ma(t){return(t.el._scale||{}).getPointPositionForValue?function(t){var e,n,a,i,r,o=t.el._scale,s=o.options,l=o.chart.data.labels.length,d=t.fill,u=[];if(!l)return null;for(e=s.ticks.reverse?o.max:o.min,n=s.ticks.reverse?o.min:o.max,a=o.getPointPositionForValue(0,e),i=0;i0;--r)E.canvas.lineTo(t,n[r],n[r-1],!0);else for(o=n[0].cx,s=n[0].cy,l=Math.sqrt(Math.pow(n[0].x-o,2)+Math.pow(n[0].y-s,2)),r=i-1;r>0;--r)t.arc(o,s,l,n[r].angle,n[r-1].angle,!0)}}function _a(t,e,n,a,i,r){var o,s,l,d,u,c,h,f,g=e.length,p=a.spanGaps,m=[],v=[],b=0,x=0;for(t.beginPath(),o=0,s=g;o=0;--n)(e=l[n].$filler)&&e.visible&&(i=(a=e.el)._view,r=a._children||[],o=e.mapper,s=i.backgroundColor||B.global.defaultColor,o&&s&&r.length&&(E.canvas.clipArea(d,t.chartArea),_a(d,r,o,i,s,a._loop),E.canvas.unclipArea(d)))}},Ma=E.rtl.getRtlAdapter,wa=E.noop,Ca=E.valueOrDefault;function Da(t,e){return t.usePointStyle&&t.boxWidth>e?e:t.boxWidth}B._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(t,e){var n=e.datasetIndex,a=this.chart,i=a.getDatasetMeta(n);i.hidden=null===i.hidden?!a.data.datasets[n].hidden:null,a.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(t){var e=t.data.datasets,n=t.options.legend||{},a=n.labels&&n.labels.usePointStyle;return t._getSortedDatasetMetas().map((function(n){var i=n.controller.getStyle(a?0:void 0);return{text:e[n.index].label,fillStyle:i.backgroundColor,hidden:!t.isDatasetVisible(n.index),lineCap:i.borderCapStyle,lineDash:i.borderDash,lineDashOffset:i.borderDashOffset,lineJoin:i.borderJoinStyle,lineWidth:i.borderWidth,strokeStyle:i.borderColor,pointStyle:i.pointStyle,rotation:i.rotation,datasetIndex:n.index}}),this)}}},legendCallback:function(t){var e,n,a,i=document.createElement("ul"),r=t.data.datasets;for(i.setAttribute("class",t.id+"-legend"),e=0,n=r.length;el.width)&&(c+=o+n.padding,u[u.length-(e>0?0:1)]=0),s[e]={left:0,top:0,width:a,height:o},u[u.length-1]+=a+n.padding})),l.height+=c}else{var h=n.padding,f=t.columnWidths=[],g=t.columnHeights=[],p=n.padding,m=0,v=0;E.each(t.legendItems,(function(t,e){var a=Da(n,o)+o/2+i.measureText(t.text).width;e>0&&v+o+2*h>l.height&&(p+=m+n.padding,f.push(m),g.push(v),m=0,v=0),m=Math.max(m,a),v+=o+h,s[e]={left:0,top:0,width:a,height:o}})),p+=m,f.push(m),g.push(v),l.width+=p}t.width=l.width,t.height=l.height}else t.width=l.width=t.height=l.height=0},afterFit:wa,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var t=this,e=t.options,n=e.labels,a=B.global,i=a.defaultColor,r=a.elements.line,o=t.height,s=t.columnHeights,l=t.width,d=t.lineWidths;if(e.display){var u,c=Ma(e.rtl,t.left,t.minSize.width),h=t.ctx,f=Ca(n.fontColor,a.defaultFontColor),g=E.options._parseFont(n),p=g.size;h.textAlign=c.textAlign("left"),h.textBaseline="middle",h.lineWidth=.5,h.strokeStyle=f,h.fillStyle=f,h.font=g.string;var m=Da(n,p),v=t.legendHitBoxes,b=function(t,a){switch(e.align){case"start":return n.padding;case"end":return t-a;default:return(t-a+n.padding)/2}},x=t.isHorizontal();u=x?{x:t.left+b(l,d[0]),y:t.top+n.padding,line:0}:{x:t.left+n.padding,y:t.top+b(o,s[0]),line:0},E.rtl.overrideTextDirection(t.ctx,e.textDirection);var y=p+n.padding;E.each(t.legendItems,(function(e,a){var f=h.measureText(e.text).width,g=m+p/2+f,_=u.x,k=u.y;c.setWidth(t.minSize.width),x?a>0&&_+g+n.padding>t.left+t.minSize.width&&(k=u.y+=y,u.line++,_=u.x=t.left+b(l,d[u.line])):a>0&&k+y>t.top+t.minSize.height&&(_=u.x=_+t.columnWidths[u.line]+n.padding,u.line++,k=u.y=t.top+b(o,s[u.line]));var M=c.x(_);!function(t,e,a){if(!(isNaN(m)||m<=0)){h.save();var o=Ca(a.lineWidth,r.borderWidth);if(h.fillStyle=Ca(a.fillStyle,i),h.lineCap=Ca(a.lineCap,r.borderCapStyle),h.lineDashOffset=Ca(a.lineDashOffset,r.borderDashOffset),h.lineJoin=Ca(a.lineJoin,r.borderJoinStyle),h.lineWidth=o,h.strokeStyle=Ca(a.strokeStyle,i),h.setLineDash&&h.setLineDash(Ca(a.lineDash,r.borderDash)),n&&n.usePointStyle){var s=m*Math.SQRT2/2,l=c.xPlus(t,m/2),d=e+p/2;E.canvas.drawPoint(h,a.pointStyle,s,l,d,a.rotation)}else h.fillRect(c.leftForLtr(t,m),e,m,p),0!==o&&h.strokeRect(c.leftForLtr(t,m),e,m,p);h.restore()}}(M,k,e),v[a].left=c.leftForLtr(M,v[a].width),v[a].top=k,function(t,e,n,a){var i=p/2,r=c.xPlus(t,m+i),o=e+i;h.fillText(n.text,r,o),n.hidden&&(h.beginPath(),h.lineWidth=2,h.moveTo(r,o),h.lineTo(c.xPlus(r,a),o),h.stroke())}(M,k,e,f),x?u.x+=g+n.padding:u.y+=y})),E.rtl.restoreTextDirection(t.ctx,e.textDirection)}},_getLegendItemAt:function(t,e){var n,a,i,r=this;if(t>=r.left&&t<=r.right&&e>=r.top&&e<=r.bottom)for(i=r.legendHitBoxes,n=0;n=(a=i[n]).left&&t<=a.left+a.width&&e>=a.top&&e<=a.top+a.height)return r.legendItems[n];return null},handleEvent:function(t){var e,n=this,a=n.options,i="mouseup"===t.type?"click":t.type;if("mousemove"===i){if(!a.onHover&&!a.onLeave)return}else{if("click"!==i)return;if(!a.onClick)return}e=n._getLegendItemAt(t.x,t.y),"click"===i?e&&a.onClick&&a.onClick.call(n,t.native,e):(a.onLeave&&e!==n._hoveredItem&&(n._hoveredItem&&a.onLeave.call(n,t.native,n._hoveredItem),n._hoveredItem=e),a.onHover&&e&&a.onHover.call(n,t.native,e))}});function Aa(t,e){var n=new Sa({ctx:t.ctx,options:e,chart:t});ge.configure(t,n,e),ge.addBox(t,n),t.legend=n}var Pa={id:"legend",_element:Sa,beforeInit:function(t){var e=t.options.legend;e&&Aa(t,e)},beforeUpdate:function(t){var e=t.options.legend,n=t.legend;e?(E.mergeIf(e,B.global.legend),n?(ge.configure(t,n,e),n.options=e):Aa(t,e)):n&&(ge.removeBox(t,n),delete t.legend)},afterEvent:function(t,e){var n=t.legend;n&&n.handleEvent(e)}},Ta=E.noop;B._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var Ia=X.extend({initialize:function(t){E.extend(this,t),this.legendHitBoxes=[]},beforeUpdate:Ta,update:function(t,e,n){var a=this;return a.beforeUpdate(),a.maxWidth=t,a.maxHeight=e,a.margins=n,a.beforeSetDimensions(),a.setDimensions(),a.afterSetDimensions(),a.beforeBuildLabels(),a.buildLabels(),a.afterBuildLabels(),a.beforeFit(),a.fit(),a.afterFit(),a.afterUpdate(),a.minSize},afterUpdate:Ta,beforeSetDimensions:Ta,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:Ta,beforeBuildLabels:Ta,buildLabels:Ta,afterBuildLabels:Ta,beforeFit:Ta,fit:function(){var t,e=this,n=e.options,a=e.minSize={},i=e.isHorizontal();n.display?(t=(E.isArray(n.text)?n.text.length:1)*E.options._parseFont(n).lineHeight+2*n.padding,e.width=a.width=i?e.maxWidth:t,e.height=a.height=i?t:e.maxHeight):e.width=a.width=e.height=a.height=0},afterFit:Ta,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this,e=t.ctx,n=t.options;if(n.display){var a,i,r,o=E.options._parseFont(n),s=o.lineHeight,l=s/2+n.padding,d=0,u=t.top,c=t.left,h=t.bottom,f=t.right;e.fillStyle=E.valueOrDefault(n.fontColor,B.global.defaultFontColor),e.font=o.string,t.isHorizontal()?(i=c+(f-c)/2,r=u+l,a=f-c):(i="left"===n.position?c+l:f-l,r=u+(h-u)/2,a=h-u,d=Math.PI*("left"===n.position?-.5:.5)),e.save(),e.translate(i,r),e.rotate(d),e.textAlign="center",e.textBaseline="middle";var g=n.text;if(E.isArray(g))for(var p=0,m=0;m=0;a--){var i=t[a];if(e(i))return i}},E.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},E.almostEquals=function(t,e,n){return Math.abs(t-e)=t},E.max=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.max(t,e)}),Number.NEGATIVE_INFINITY)},E.min=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.min(t,e)}),Number.POSITIVE_INFINITY)},E.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return 0==(t=+t)||isNaN(t)?t:t>0?1:-1},E.toRadians=function(t){return t*(Math.PI/180)},E.toDegrees=function(t){return t*(180/Math.PI)},E._decimalPlaces=function(t){if(E.isFinite(t)){for(var e=1,n=0;Math.round(t*e)/e!==t;)e*=10,n++;return n}},E.getAngleFromPoint=function(t,e){var n=e.x-t.x,a=e.y-t.y,i=Math.sqrt(n*n+a*a),r=Math.atan2(a,n);return r<-.5*Math.PI&&(r+=2*Math.PI),{angle:r,distance:i}},E.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},E.aliasPixel=function(t){return t%2==0?0:.5},E._alignPixel=function(t,e,n){var a=t.currentDevicePixelRatio,i=n/2;return Math.round((e-i)*a)/a+i},E.splineCurve=function(t,e,n,a){var i=t.skip?e:t,r=e,o=n.skip?e:n,s=Math.sqrt(Math.pow(r.x-i.x,2)+Math.pow(r.y-i.y,2)),l=Math.sqrt(Math.pow(o.x-r.x,2)+Math.pow(o.y-r.y,2)),d=s/(s+l),u=l/(s+l),c=a*(d=isNaN(d)?0:d),h=a*(u=isNaN(u)?0:u);return{previous:{x:r.x-c*(o.x-i.x),y:r.y-c*(o.y-i.y)},next:{x:r.x+h*(o.x-i.x),y:r.y+h*(o.y-i.y)}}},E.EPSILON=Number.EPSILON||1e-14,E.splineCurveMonotone=function(t){var e,n,a,i,r,o,s,l,d,u=(t||[]).map((function(t){return{model:t._model,deltaK:0,mK:0}})),c=u.length;for(e=0;e0?u[e-1]:null,(i=e0?u[e-1]:null,i=e=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},E.previousItem=function(t,e,n){return n?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},E.niceNum=function(t,e){var n=Math.floor(E.log10(t)),a=t/Math.pow(10,n);return(e?a<1.5?1:a<3?2:a<7?5:10:a<=1?1:a<=2?2:a<=5?5:10)*Math.pow(10,n)},E.requestAnimFrame="undefined"==typeof window?function(t){t()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)},E.getRelativePosition=function(t,e){var n,a,i=t.originalEvent||t,r=t.target||t.srcElement,o=r.getBoundingClientRect(),s=i.touches;s&&s.length>0?(n=s[0].clientX,a=s[0].clientY):(n=i.clientX,a=i.clientY);var l=parseFloat(E.getStyle(r,"padding-left")),d=parseFloat(E.getStyle(r,"padding-top")),u=parseFloat(E.getStyle(r,"padding-right")),c=parseFloat(E.getStyle(r,"padding-bottom")),h=o.right-o.left-l-u,f=o.bottom-o.top-d-c;return{x:n=Math.round((n-o.left-l)/h*r.width/e.currentDevicePixelRatio),y:a=Math.round((a-o.top-d)/f*r.height/e.currentDevicePixelRatio)}},E.getConstraintWidth=function(t){return n(t,"max-width","clientWidth")},E.getConstraintHeight=function(t){return n(t,"max-height","clientHeight")},E._calculatePadding=function(t,e,n){return(e=E.getStyle(t,e)).indexOf("%")>-1?n*parseInt(e,10)/100:parseInt(e,10)},E._getParentNode=function(t){var e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e},E.getMaximumWidth=function(t){var e=E._getParentNode(t);if(!e)return t.clientWidth;var n=e.clientWidth,a=n-E._calculatePadding(e,"padding-left",n)-E._calculatePadding(e,"padding-right",n),i=E.getConstraintWidth(t);return isNaN(i)?a:Math.min(a,i)},E.getMaximumHeight=function(t){var e=E._getParentNode(t);if(!e)return t.clientHeight;var n=e.clientHeight,a=n-E._calculatePadding(e,"padding-top",n)-E._calculatePadding(e,"padding-bottom",n),i=E.getConstraintHeight(t);return isNaN(i)?a:Math.min(a,i)},E.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},E.retinaScale=function(t,e){var n=t.currentDevicePixelRatio=e||"undefined"!=typeof window&&window.devicePixelRatio||1;if(1!==n){var a=t.canvas,i=t.height,r=t.width;a.height=i*n,a.width=r*n,t.ctx.scale(n,n),a.style.height||a.style.width||(a.style.height=i+"px",a.style.width=r+"px")}},E.fontString=function(t,e,n){return e+" "+t+"px "+n},E.longestText=function(t,e,n,a){var i=(a=a||{}).data=a.data||{},r=a.garbageCollect=a.garbageCollect||[];a.font!==e&&(i=a.data={},r=a.garbageCollect=[],a.font=e),t.font=e;var o,s,l,d,u,c=0,h=n.length;for(o=0;on.length){for(o=0;oa&&(a=r),a},E.numberOfLabelLines=function(t){var e=1;return E.each(t,(function(t){E.isArray(t)&&t.length>e&&(e=t.length)})),e},E.color=k?function(t){return t instanceof CanvasGradient&&(t=B.global.defaultColor),k(t)}:function(t){return console.error("Color.js not found!"),t},E.getHoverColor=function(t){return t instanceof CanvasPattern||t instanceof CanvasGradient?t:E.color(t).saturate(.5).darken(.1).rgbString()}}(),tn._adapters=an,tn.Animation=K,tn.animationService=$,tn.controllers=$t,tn.DatasetController=nt,tn.defaults=B,tn.Element=X,tn.elements=_t,tn.Interaction=ie,tn.layouts=ge,tn.platform=Fe,tn.plugins=Le,tn.Scale=xn,tn.scaleService=Oe,tn.Ticks=rn,tn.Tooltip=Ue,tn.helpers.each(ha,(function(t,e){tn.scaleService.registerScaleType(e,t,t._defaults)})),La)La.hasOwnProperty(Na)&&tn.plugins.register(La[Na]);tn.platform.initialize();var za=tn;return"undefined"!=typeof window&&(window.Chart=tn),tn.Chart=tn,tn.Legend=La.legend._element,tn.Title=La.title._element,tn.pluginService=tn.plugins,tn.PluginBase=tn.Element.extend({}),tn.canvasHelpers=tn.helpers.canvas,tn.layoutService=tn.layouts,tn.LinearScaleBase=Cn,tn.helpers.each(["Bar","Bubble","Doughnut","Line","PolarArea","Radar","Scatter"],(function(t){tn[t]=function(e,n){return new tn(e,tn.helpers.merge(n||{},{type:t.charAt(0).toLowerCase()+t.slice(1)}))}})),za}(function(){try{return n(2)}catch(t){}}())},128:function(t,e,n){"use strict";n.r(e);var a=n(0),i=n.n(a),r=n(4);!function(){var t=n(2),e={prepareGraphData:function(t,n,a,i){var r={};switch(i.toUpperCase()){case"DAYS":r=e.fillGraphDates(t,n,a,i,"YYYY-MM-DD","MM/D","");break;case"MONTHS":r=e.fillGraphDates(t,n,a,i,"YYYY-MM","YY/MM","-01");break;case"YEARS":r=e.fillGraphDates(t,n,a,i,"YYYY","YYYY","-01-01")}return r},fillGraphDates:function(e,n,a,i,r,o,s){for(var l=[],d=[],u=[],c=t({hour:1}).subtract(a,i),h=t({hour:1}),f=c;f.isBefore(h)||f.isSame(h);f.add(1,i))u.push(f.format(r)+s),d.push(f.format(o)),l.push(0);for(var g=0;g'),o=e.data("order");e.on("click","td[data-sort]",(function(){var e=i()(this);return e.hasClass("active")&&(o="ASC"===o?"DESC":"ASC"),t.find('input[name="sort"]').val(e.data("sort")),t.find('input[name="order"]').val(o),t.submit(),!1})),a.prepend(function(t){return"ASC"===t?r.removeClass("fa-caret-down").addClass("fa-caret-up"):r.removeClass("fa-caret-up").addClass("fa-caret-down")}(o)).addClass("active")}))})),i()("#users-table").each((function(){var t=i()("#ban-users-btn"),e=i()("#ban-users-modal"),n=i()("#delete-users-btn"),a=i()("#delete-users-modal"),r=i()(this),o=[],s=function(){var e=(o=r.find("tbody td.selector.active").toArray()).length>0;t.toggleClass("disabled",!e),n.toggleClass("disabled",!e)},l=function(t){t.addClass("active").find("i").attr("class","far fa-dot-circle"),s()},d=function(t){t.removeClass("active").find("i").attr("class","far fa-circle"),s()};r.on("click","tbody td.selector",(function(){var t=i()(this);return t.hasClass("active")?d(t):l(t),!1})).on("click","thead td.selector",(function(t){return r.find(".selector").each((function(){var t=i()(this);t.hasClass("active")?d(t):l(t)})),!1})),s(),e.find("form").on("submit",(function(){e.find("button").addClass("disabled"),i()(this).append(o.map((function(t){return i()(t).data("id")})).map((function(t){return'')})))})),e.on("show.bs.modal",(function(){e.find(".modal-message").html("Do you want to Ban ".concat(o.length," users? This cannot be undone.")),e.find('[name="reason"]').focus()})),e.on("shown.bs.modal",(function(){return e.find('[name="reason"]').focus()})),t.on("click",(function(){return i()(this).parent().toggleClass("show"),e.modal("show"),!1})),a.find("form").on("submit",(function(){a.find("button").addClass("disabled"),i()(this).append(o.map((function(t){return i()(t).data("id")})).map((function(t){return'')})))})),a.on("show.bs.modal",(function(){a.find(".modal-message").html("Do you want to Delete ".concat(o.length," users? This cannot be undone."))})),n.on("click",(function(){return i()(this).parent().toggleClass("show"),a.modal("show"),!1}))})),i()("#flairs-selection").each((function(){var t=parseInt(this.getAttribute("data-user"));i()(this).on("click",'input[type="checkbox"]',(function(e){e.target.setAttribute("disabled","disabled"),i.a.ajax({type:"post",url:"/admin/user/".concat(t,"/toggle/flair"),data:{userId:t,name:e.target.getAttribute("value"),value:e.target.checked?1:0}}).always((function(){e.target.removeAttribute("disabled")}))}))})),i()("#roles-selection").each((function(){var t=parseInt(this.getAttribute("data-user"));i()(this).on("click",'input[type="checkbox"]',(function(e){e.target.setAttribute("disabled","disabled"),i.a.ajax({type:"post",url:"/admin/user/".concat(t,"/toggle/role"),data:{userId:t,name:e.target.getAttribute("value"),value:e.target.checked?1:0}}).always((function(){e.target.removeAttribute("disabled")}))}))})),i()(".color-select").on("change keyup",'input[type="text"]',(function(){i()(this).prev().css({"background-color":this.value,"border-color":this.value})})),i()("#emote-search").each((function(){var t=i()(this),e=i()("#emote-grid").find(".image-grid-item"),n=Object(r.a)(50,!1,(function(){var n=t.val();null!=n&&""!==n.trim()?e.each((function(t,e){i()(e).toggleClass("hidden",!(e.getAttribute("data-prefix").toLowerCase().indexOf(n.toLowerCase())>-1))})):e.removeClass("hidden")}));t.on("keydown",(function(t){return n(t)})),i()(".preview-icon").on("click",(function(){var t=i()(this).data("id"),e=i()("#emotePreviewModal").modal({show:!1});i.a.ajax({method:"get",url:"/admin/emotes/"+t+"/preview",success:function(t){var n=i()(t);e.find(".modal-body").empty().append(n),e.modal({show:!0})}})}))})),i()("#flair-search").each((function(){var t=i()(this),e=i()("#flair-grid").find(".image-grid-item"),n=Object(r.a)(50,!1,(function(){var n=t.val();null!=n&&""!==n.trim()?e.each((function(t,e){i()(e).toggleClass("hidden",!(e.getAttribute("data-name").toLowerCase().indexOf(n.toLowerCase())>-1))})):e.removeClass("hidden")}));t.on("keydown",(function(t){return n(t)}))})),i()("#emoteEditPreviewBtn").on("click",(function(){var t=i()(this).closest("form"),e=i()("#emotePreviewModal").modal({show:!1}),n=t.find("#inputPrefix").val(),a=t.find("#inputStyles").val(),r=t.find("#inputImage").val();i.a.ajax({method:"post",url:"/admin/emotes/preview",data:{prefix:n,styles:a,imageId:r},success:function(t){var n=i()(t);e.find(".modal-body").empty().append(n),e.modal({show:!0})}})})),i()(document).on("dragover",(function(){i()("body").addClass("drag-over")})).on("dragleave drop",(function(){i()("body").removeClass("drag-over")}))}(),function(){var t=i()("#file-input"),e=i()(".image-view.image-view-upload");function n(e,n){var a=new FormData;a.append("files[]",n),e.removeClass("success error").addClass("busy"),function(t,e,n,a){var r=t.data("upload"),o=t.data("cdn"),s=new XMLHttpRequest;s.open("POST",r,!0),s.addEventListener("error",(function(t){return a(t)})),s.addEventListener("abort",(function(){return a("aborted")})),s.addEventListener("load",(function(){try{var e=JSON.parse(s.responseText)[0];if(e.error)return a(e.error);var r=t.find("img")[0]||i()("")[0];r.setAttribute("width",e.width),r.setAttribute("height",e.height),r.setAttribute("src",o+e.name),t.find('input[name="imageId"]').val(e.id),t.prepend(r),n(e)}catch(t){a(t)}})),s.send(e)}(e,a,(function(){e.addClass("success").removeClass("busy")}),(function(){e.addClass("error").removeClass("busy")})),t.value=""}var a=null;e.on("click",(function(e){e.preventDefault(),a=i()(e.currentTarget),t.trigger("click")})).on("dragover",(function(t){t.preventDefault()})).on("drop",(function(t){var e,a,r,o;t.preventDefault(),a=(e=t).originalEvent.dataTransfer,r=i()(e.currentTarget),o=null,a.items?a.items.length>0&&"file"===a.items[0].kind&&(o=a.items[0].getAsFile()):a.files.length>0&&(o=a.files[0]),null!==o&&n(r,o)})),t.on("change",(function(e){e.preventDefault(),n(a,t[0].files[0]),a=null}))}(),i()((function(){i()("#emote-content").each((function(){var t=i()(this).data("id");i()(".delete-item").on("click",(function(){confirm("This cannot be undone. Are you sure?")&&i()("#delete-form").submit()}));var e=!0,n=i()("#inputPrefix"),a=i()("#inputTheme"),r=i()("#emote-form");n.on("change",(function(){e=!0})),r.on("submit",(function(o){e&&(o.preventDefault(),n.removeClass("is-invalid"),i.a.ajax({url:"/admin/emotes/prefix",data:{id:t,theme:a.val(),prefix:n.val()},method:"post",success:function(t){t.exists?(e=!0,n.addClass("is-invalid")):(e=!1,r.submit())},error:function(){e=!0,n.addClass("is-invalid")}}))}))})),i()("#flair-content").each((function(){i()(".delete-item").on("click",(function(){confirm("This cannot be undone. Are you sure?")&&i()("#delete-form").submit()}))})),i()("#theme-content").each((function(){i()(".delete-item").on("click",(function(){confirm("This cannot be undone. Are you sure?")&&i()("#delete-form").submit()}))})),i()("#themeSelect").on("change",(function(){window.location.href="/admin/emotes?theme="+i()(this).val()}))}));var o,s=n(2),l=n.n(s),d=n(10),u=n.n(d);(o=i.a)("#income-graphs").each((function(){var t=l()(),e=o("#income-dates"),n=e.find("span.date");e.on("click",".fa-arrow-left",(function(){t.subtract(1,"months"),n.text(t.format("MMMM YYYY")),e.triggerHandler("date",t)})).on("click",".fa-arrow-right",(function(){t.add(1,"months"),n.text(t.format("MMMM YYYY")),e.triggerHandler("date",t)})),n.text(t.format("MMMM YYYY")),o("#graph4").each((function(){var n=o(this),a=new u.a(n.find("canvas").get(0).getContext("2d"),{type:"bar",data:{labels:[],datasets:[]},options:{maintainAspectRatio:!1,responsive:!0,scales:{xAxes:[{stacked:!0}],yAxes:[{ticks:{beginAtZero:!0},stacked:!0}]}}}),i=function(t){var e=l()(t.format("YYYY-MM-DD")).startOf("month"),n=l()(t.format("YYYY-MM-DD")).endOf("month");o.ajax({url:"/admin/chart/finance/NewTieredSubscribersLastXDays.json?fromDate="+e.format("YYYY-MM-DD")+"&toDate="+n.format("YYYY-MM-DD"),success:function(t){for(var i=[],r=[],o=[],s=[],l=[],d=[],u=e;u.isBefore(n)||u.isSame(n);u.add(1,"days"))d.push(u.format("YYYY-MM-DD")),l.push(u.format("D")),i.push(0),r.push(0),o.push(0),s.push(0);for(var c=0;ct?c():!0!==e&&(i=setTimeout(a?function(){i=void 0}:c,void 0===a?t-d:t)))}return"boolean"!=typeof e&&(a=n,n=e,e=void 0),l.cancel=function(){s(),r=!0},l}function i(t,e,n){return void 0===n?a(t,e,!1):a(t,n,!1!==e)}n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return i}))}},[[128,1,0]]]); \ No newline at end of file diff --git a/static/admin.ff5a37819698288553df.js b/static/admin.ff5a37819698288553df.js deleted file mode 100644 index 9da0b7ece..000000000 --- a/static/admin.ff5a37819698288553df.js +++ /dev/null @@ -1,8 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{10:function(t,e,n){ -/*! - * Chart.js v2.8.0 - * https://www.chartjs.org - * (c) 2019 Chart.js Contributors - * Released under the MIT License - */ -t.exports=function(t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var e={rgb2hsl:n,rgb2hsv:a,rgb2hwb:i,rgb2cmyk:o,rgb2keyword:s,rgb2xyz:l,rgb2lab:d,rgb2lch:function(t){return x(d(t))},hsl2rgb:u,hsl2hsv:function(t){var e=t[0],n=t[1]/100,a=t[2]/100;return 0===a?[0,0,0]:[e,2*(n*=(a*=2)<=1?a:2-a)/(a+n)*100,(a+n)/2*100]},hsl2hwb:function(t){return i(u(t))},hsl2cmyk:function(t){return o(u(t))},hsl2keyword:function(t){return s(u(t))},hsv2rgb:c,hsv2hsl:function(t){var e,n,a=t[0],i=t[1]/100,o=t[2]/100;return e=i*o,[a,100*(e=(e/=(n=(2-i)*o)<=1?n:2-n)||0),100*(n/=2)]},hsv2hwb:function(t){return i(c(t))},hsv2cmyk:function(t){return o(c(t))},hsv2keyword:function(t){return s(c(t))},hwb2rgb:h,hwb2hsl:function(t){return n(h(t))},hwb2hsv:function(t){return a(h(t))},hwb2cmyk:function(t){return o(h(t))},hwb2keyword:function(t){return s(h(t))},cmyk2rgb:f,cmyk2hsl:function(t){return n(f(t))},cmyk2hsv:function(t){return a(f(t))},cmyk2hwb:function(t){return i(f(t))},cmyk2keyword:function(t){return s(f(t))},keyword2rgb:M,keyword2hsl:function(t){return n(M(t))},keyword2hsv:function(t){return a(M(t))},keyword2hwb:function(t){return i(M(t))},keyword2cmyk:function(t){return o(M(t))},keyword2lab:function(t){return d(M(t))},keyword2xyz:function(t){return l(M(t))},xyz2rgb:p,xyz2lab:m,xyz2lch:function(t){return x(m(t))},lab2xyz:v,lab2rgb:y,lab2lch:x,lch2lab:k,lch2xyz:function(t){return v(k(t))},lch2rgb:function(t){return y(k(t))}};function n(t){var e,n,a=t[0]/255,i=t[1]/255,o=t[2]/255,r=Math.min(a,i,o),s=Math.max(a,i,o),l=s-r;return s==r?e=0:a==s?e=(i-o)/l:i==s?e=2+(o-a)/l:o==s&&(e=4+(a-i)/l),(e=Math.min(60*e,360))<0&&(e+=360),n=(r+s)/2,[e,100*(s==r?0:n<=.5?l/(s+r):l/(2-s-r)),100*n]}function a(t){var e,n,a=t[0],i=t[1],o=t[2],r=Math.min(a,i,o),s=Math.max(a,i,o),l=s-r;return n=0==s?0:l/s*1e3/10,s==r?e=0:a==s?e=(i-o)/l:i==s?e=2+(o-a)/l:o==s&&(e=4+(a-i)/l),(e=Math.min(60*e,360))<0&&(e+=360),[e,n,s/255*1e3/10]}function i(t){var e=t[0],a=t[1],i=t[2];return[n(t)[0],1/255*Math.min(e,Math.min(a,i))*100,100*(i=1-1/255*Math.max(e,Math.max(a,i)))]}function o(t){var e,n=t[0]/255,a=t[1]/255,i=t[2]/255;return[100*((1-n-(e=Math.min(1-n,1-a,1-i)))/(1-e)||0),100*((1-a-e)/(1-e)||0),100*((1-i-e)/(1-e)||0),100*e]}function s(t){return C[JSON.stringify(t)]}function l(t){var e=t[0]/255,n=t[1]/255,a=t[2]/255;return[100*(.4124*(e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(a=a>.04045?Math.pow((a+.055)/1.055,2.4):a/12.92)),100*(.2126*e+.7152*n+.0722*a),100*(.0193*e+.1192*n+.9505*a)]}function d(t){var e=l(t),n=e[0],a=e[1],i=e[2];return a/=100,i/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(a=a>.008856?Math.pow(a,1/3):7.787*a+16/116)-16,500*(n-a),200*(a-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]}function u(t){var e,n,a,i,o,r=t[0]/360,s=t[1]/100,l=t[2]/100;if(0==s)return[o=255*l,o,o];e=2*l-(n=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];for(var d=0;d<3;d++)(a=r+1/3*-(d-1))<0&&a++,a>1&&a--,o=6*a<1?e+6*(n-e)*a:2*a<1?n:3*a<2?e+(n-e)*(2/3-a)*6:e,i[d]=255*o;return i}function c(t){var e=t[0]/60,n=t[1]/100,a=t[2]/100,i=Math.floor(e)%6,o=e-Math.floor(e),r=255*a*(1-n),s=255*a*(1-n*o),l=255*a*(1-n*(1-o));switch(a*=255,i){case 0:return[a,l,r];case 1:return[s,a,r];case 2:return[r,a,l];case 3:return[r,s,a];case 4:return[l,r,a];case 5:return[a,r,s]}}function h(t){var e,n,a,i,o=t[0]/360,s=t[1]/100,l=t[2]/100,d=s+l;switch(d>1&&(s/=d,l/=d),a=6*o-(e=Math.floor(6*o)),0!=(1&e)&&(a=1-a),i=s+a*((n=1-l)-s),e){default:case 6:case 0:r=n,g=i,b=s;break;case 1:r=i,g=n,b=s;break;case 2:r=s,g=n,b=i;break;case 3:r=s,g=i,b=n;break;case 4:r=i,g=s,b=n;break;case 5:r=n,g=s,b=i}return[255*r,255*g,255*b]}function f(t){var e=t[0]/100,n=t[1]/100,a=t[2]/100,i=t[3]/100;return[255*(1-Math.min(1,e*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i)),255*(1-Math.min(1,a*(1-i)+i))]}function p(t){var e,n,a,i=t[0]/100,o=t[1]/100,r=t[2]/100;return n=-.9689*i+1.8758*o+.0415*r,a=.0557*i+-.204*o+1.057*r,e=(e=3.2406*i+-1.5372*o+-.4986*r)>.0031308?1.055*Math.pow(e,1/2.4)-.055:e*=12.92,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n*=12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*=12.92,[255*(e=Math.min(Math.max(0,e),1)),255*(n=Math.min(Math.max(0,n),1)),255*(a=Math.min(Math.max(0,a),1))]}function m(t){var e=t[0],n=t[1],a=t[2];return n/=100,a/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(e-n),200*(n-(a=a>.008856?Math.pow(a,1/3):7.787*a+16/116))]}function v(t){var e,n,a,i,o=t[0],r=t[1],s=t[2];return o<=8?i=(n=100*o/903.3)/100*7.787+16/116:(n=100*Math.pow((o+16)/116,3),i=Math.pow(n/100,1/3)),[e=e/95.047<=.008856?e=95.047*(r/500+i-16/116)/7.787:95.047*Math.pow(r/500+i,3),n,a=a/108.883<=.008859?a=108.883*(i-s/200-16/116)/7.787:108.883*Math.pow(i-s/200,3)]}function x(t){var e,n=t[0],a=t[1],i=t[2];return(e=360*Math.atan2(i,a)/2/Math.PI)<0&&(e+=360),[n,Math.sqrt(a*a+i*i),e]}function y(t){return p(v(t))}function k(t){var e,n=t[0],a=t[1];return e=t[2]/360*2*Math.PI,[n,a*Math.cos(e),a*Math.sin(e)]}function M(t){return w[t]}var w={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},C={};for(var _ in w)C[JSON.stringify(w[_])]=_;var D=function(){return new T};for(var S in e){D[S+"Raw"]=function(t){return function(n){return"number"==typeof n&&(n=Array.prototype.slice.call(arguments)),e[t](n)}}(S);var A=/(\w+)2(\w+)/.exec(S),P=A[1],I=A[2];(D[P]=D[P]||{})[I]=D[S]=function(t){return function(n){"number"==typeof n&&(n=Array.prototype.slice.call(arguments));var a=e[t](n);if("string"==typeof a||void 0===a)return a;for(var i=0;i=0&&e<1?E(Math.round(255*e)):"")},rgbString:function(t,e){return e<1||t[3]&&t[3]<1?z(t,e):"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},rgbaString:z,percentString:function(t,e){if(e<1||t[3]&&t[3]<1)return W(t,e);var n=Math.round(t[0]/255*100),a=Math.round(t[1]/255*100),i=Math.round(t[2]/255*100);return"rgb("+n+"%, "+a+"%, "+i+"%)"},percentaString:W,hslString:function(t,e){return e<1||t[3]&&t[3]<1?N(t,e):"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"},hslaString:N,hwbString:function(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+(void 0!==e&&1!==e?", "+e:"")+")"},keyword:function(t){return H[t.slice(0,3)]}};function O(t){if(t){var e=[0,0,0],n=1,a=t.match(/^#([a-fA-F0-9]{3,4})$/i),i="";if(a){i=(a=a[1])[3];for(var o=0;on?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){var e=this.values.hsl;return e[2]+=e[2]*t,this.setValues("hsl",e),this},darken:function(t){var e=this.values.hsl;return e[2]-=e[2]*t,this.setValues("hsl",e),this},saturate:function(t){var e=this.values.hsl;return e[1]+=e[1]*t,this.setValues("hsl",e),this},desaturate:function(t){var e=this.values.hsl;return e[1]-=e[1]*t,this.setValues("hsl",e),this},whiten:function(t){var e=this.values.hwb;return e[1]+=e[1]*t,this.setValues("hwb",e),this},blacken:function(t){var e=this.values.hwb;return e[2]+=e[2]*t,this.setValues("hwb",e),this},greyscale:function(){var t=this.values.rgb,e=.3*t[0]+.59*t[1]+.11*t[2];return this.setValues("rgb",[e,e,e]),this},clearer:function(t){var e=this.values.alpha;return this.setValues("alpha",e-e*t),this},opaquer:function(t){var e=this.values.alpha;return this.setValues("alpha",e+e*t),this},rotate:function(t){var e=this.values.hsl,n=(e[0]+t)%360;return e[0]=n<0?360+n:n,this.setValues("hsl",e),this},mix:function(t,e){var n=t,a=void 0===e?.5:e,i=2*a-1,o=this.alpha()-n.alpha(),r=((i*o==-1?i:(i+o)/(1+i*o))+1)/2,s=1-r;return this.rgb(r*this.red()+s*n.red(),r*this.green()+s*n.green(),r*this.blue()+s*n.blue()).alpha(this.alpha()*a+n.alpha()*(1-a))},toJSON:function(){return this.rgb()},clone:function(){var t,e,n=new U,a=this.values,i=n.values;for(var o in a)a.hasOwnProperty(o)&&(t=a[o],"[object Array]"===(e={}.toString.call(t))?i[o]=t.slice(0):"[object Number]"===e?i[o]=t:console.error("unexpected color value:",t));return n}},U.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},U.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},U.prototype.getValues=function(t){for(var e=this.values,n={},a=0;a=0;i--)e.call(n,t[i],i);else for(i=0;i=1?t:-(Math.sqrt(1-t*t)-1)},easeOutCirc:function(t){return Math.sqrt(1-(t-=1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,n=0,a=1;return 0===t?0:1===t?1:(n||(n=.3),a<1?(a=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/a),-a*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n))},easeOutElastic:function(t){var e=1.70158,n=0,a=1;return 0===t?0:1===t?1:(n||(n=.3),a<1?(a=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/a),a*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},easeInOutElastic:function(t){var e=1.70158,n=0,a=1;return 0===t?0:2==(t/=.5)?1:(n||(n=.45),a<1?(a=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/a),t<1?a*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*-.5:a*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},easeInBack:function(t){var e=1.70158;return t*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:function(t){return 1-K.easeOutBounce(1-t)},easeOutBounce:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:function(t){return t<.5?.5*K.easeInBounce(2*t):.5*K.easeOutBounce(2*t-1)+.5}},$={effects:K};Z.easingEffects=K;var J=Math.PI,Q=J/180,tt=2*J,et=J/2,nt=J/4,at=2*J/3,it={clear:function(t){t.ctx.clearRect(0,0,t.width,t.height)},roundedRect:function(t,e,n,a,i,o){if(o){var r=Math.min(o,i/2,a/2),s=e+r,l=n+r,d=e+a-r,u=n+i-r;t.moveTo(e,l),se.left-1e-6&&t.xe.top-1e-6&&t.y0&&this.requestAnimationFrame()},advance:function(){for(var t,e,n,a,i=this.animations,o=0;o=n?(ut.callback(t.onAnimationComplete,[t],e),e.animating=!1,i.splice(o,1)):++o}},xt=ut.options.resolve,yt=["push","pop","shift","splice","unshift"];function kt(t,e){var n=t._chartjs;if(n){var a=n.listeners,i=a.indexOf(e);-1!==i&&a.splice(i,1),a.length>0||(yt.forEach((function(e){delete t[e]})),delete t._chartjs)}}var Mt=function(t,e){this.initialize(t,e)};ut.extend(Mt.prototype,{datasetElementType:null,dataElementType:null,initialize:function(t,e){this.chart=t,this.index=e,this.linkScales(),this.addElements()},updateIndex:function(t){this.index=t},linkScales:function(){var t=this,e=t.getMeta(),n=t.getDataset();null!==e.xAxisID&&e.xAxisID in t.chart.scales||(e.xAxisID=n.xAxisID||t.chart.options.scales.xAxes[0].id),null!==e.yAxisID&&e.yAxisID in t.chart.scales||(e.yAxisID=n.yAxisID||t.chart.options.scales.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(t){return this.chart.scales[t]},_getValueScaleId:function(){return this.getMeta().yAxisID},_getIndexScaleId:function(){return this.getMeta().xAxisID},_getValueScale:function(){return this.getScaleForId(this._getValueScaleId())},_getIndexScale:function(){return this.getScaleForId(this._getIndexScaleId())},reset:function(){this.update(!0)},destroy:function(){this._data&&kt(this._data,this)},createMetaDataset:function(){var t=this.datasetElementType;return t&&new t({_chart:this.chart,_datasetIndex:this.index})},createMetaData:function(t){var e=this.dataElementType;return e&&new e({_chart:this.chart,_datasetIndex:this.index,_index:t})},addElements:function(){var t,e,n=this.getMeta(),a=this.getDataset().data||[],i=n.data;for(t=0,e=a.length;tn&&this.insertElements(n,a-n)},insertElements:function(t,e){for(var n=0;ns;)i-=2*Math.PI;for(;i=r&&i<=s,d=o>=n.innerRadius&&o<=n.outerRadius;return l&&d}return!1},getCenterPoint:function(){var t=this._view,e=(t.startAngle+t.endAngle)/2,n=(t.innerRadius+t.outerRadius)/2;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},getArea:function(){var t=this._view;return Math.PI*((t.endAngle-t.startAngle)/(2*Math.PI))*(Math.pow(t.outerRadius,2)-Math.pow(t.innerRadius,2))},tooltipPosition:function(){var t=this._view,e=t.startAngle+(t.endAngle-t.startAngle)/2,n=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},draw:function(){var t,e=this._chart.ctx,n=this._view,a=n.startAngle,i=n.endAngle,o="inner"===n.borderAlign?.33:0;e.save(),e.beginPath(),e.arc(n.x,n.y,Math.max(n.outerRadius-o,0),a,i),e.arc(n.x,n.y,n.innerRadius,i,a,!0),e.closePath(),e.fillStyle=n.backgroundColor,e.fill(),n.borderWidth&&("inner"===n.borderAlign?(e.beginPath(),t=o/n.outerRadius,e.arc(n.x,n.y,n.outerRadius,a-t,i+t),n.innerRadius>o?(t=o/n.innerRadius,e.arc(n.x,n.y,n.innerRadius-o,i+t,a-t,!0)):e.arc(n.x,n.y,o,i+Math.PI/2,a-Math.PI/2),e.closePath(),e.clip(),e.beginPath(),e.arc(n.x,n.y,n.outerRadius,a,i),e.arc(n.x,n.y,n.innerRadius,i,a,!0),e.closePath(),e.lineWidth=2*n.borderWidth,e.lineJoin="round"):(e.lineWidth=n.borderWidth,e.lineJoin="bevel"),e.strokeStyle=n.borderColor,e.stroke()),e.restore()}}),_t=ut.valueOrDefault,Dt=st.global.defaultColor;st._set("global",{elements:{line:{tension:.4,backgroundColor:Dt,borderWidth:3,borderColor:Dt,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0}}});var St=pt.extend({draw:function(){var t,e,n,a,i=this._view,o=this._chart.ctx,r=i.spanGaps,s=this._children.slice(),l=st.global,d=l.elements.line,u=-1;for(this._loop&&s.length&&s.push(s[0]),o.save(),o.lineCap=i.borderCapStyle||d.borderCapStyle,o.setLineDash&&o.setLineDash(i.borderDash||d.borderDash),o.lineDashOffset=_t(i.borderDashOffset,d.borderDashOffset),o.lineJoin=i.borderJoinStyle||d.borderJoinStyle,o.lineWidth=_t(i.borderWidth,d.borderWidth),o.strokeStyle=i.borderColor||l.defaultColor,o.beginPath(),u=-1,t=0;tt.x&&(e=Ot(e,"left","right")):t.basen?n:a,r:l.right||i<0?0:i>e?e:i,b:l.bottom||o<0?0:o>n?n:o,l:l.left||r<0?0:r>e?e:r}}function Yt(t,e,n){var a=null===e,i=null===n,o=!(!t||a&&i)&&Rt(t);return o&&(a||e>=o.left&&e<=o.right)&&(i||n>=o.top&&n<=o.bottom)}st._set("global",{elements:{rectangle:{backgroundColor:Ft,borderColor:Ft,borderSkipped:"bottom",borderWidth:0}}});var zt=pt.extend({draw:function(){var t=this._chart.ctx,e=this._view,n=function(t){var e=Rt(t),n=e.right-e.left,a=e.bottom-e.top,i=Bt(t,n/2,a/2);return{outer:{x:e.left,y:e.top,w:n,h:a},inner:{x:e.left+i.l,y:e.top+i.t,w:n-i.l-i.r,h:a-i.t-i.b}}}(e),a=n.outer,i=n.inner;t.fillStyle=e.backgroundColor,t.fillRect(a.x,a.y,a.w,a.h),a.w===i.w&&a.h===i.h||(t.save(),t.beginPath(),t.rect(a.x,a.y,a.w,a.h),t.clip(),t.fillStyle=e.borderColor,t.rect(i.x,i.y,i.w,i.h),t.fill("evenodd"),t.restore())},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){return Yt(this._view,t,e)},inLabelRange:function(t,e){var n=this._view;return Lt(n)?Yt(n,t,null):Yt(n,null,e)},inXRange:function(t){return Yt(this._view,t,null)},inYRange:function(t){return Yt(this._view,null,t)},getCenterPoint:function(){var t,e,n=this._view;return Lt(n)?(t=n.x,e=(n.y+n.base)/2):(t=(n.x+n.base)/2,e=n.y),{x:t,y:e}},getArea:function(){var t=this._view;return Lt(t)?t.width*Math.abs(t.y-t.base):t.height*Math.abs(t.x-t.base)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}}),Wt={},Nt=Ct,Vt=St,Et=Tt,Ht=zt;Wt.Arc=Nt,Wt.Line=Vt,Wt.Point=Et,Wt.Rectangle=Ht;var jt=ut.options.resolve;st._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",categoryPercentage:.8,barPercentage:.9,offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}});var Ut=wt.extend({dataElementType:Wt.Rectangle,initialize:function(){var t,e=this;wt.prototype.initialize.apply(e,arguments),(t=e.getMeta()).stack=e.getDataset().stack,t.bar=!0},update:function(t){var e,n,a=this.getMeta().data;for(this._ruler=this.getRuler(),e=0,n=a.length;e0?Math.min(r,a-n):r,n=a;return r}(n,l):-1,pixels:l,start:r,end:s,stackCount:a,scale:n}},calculateBarValuePixels:function(t,e){var n,a,i,o,r,s,l=this.chart,d=this.getMeta(),u=this._getValueScale(),c=u.isHorizontal(),h=l.data.datasets,f=+u.getRightValue(h[t].data[e]),g=u.options.minBarLength,p=u.options.stacked,m=d.stack,v=0;if(p||void 0===p&&void 0!==m)for(n=0;n=0&&i>0)&&(v+=i));return o=u.getPixelForValue(v),s=(r=u.getPixelForValue(v+f))-o,void 0!==g&&Math.abs(s)=0&&!c||f<0&&c?o-g:o+g),{size:s,base:o,head:r,center:r+s/2}},calculateBarIndexPixels:function(t,e,n){var a=n.scale.options,i="flex"===a.barThickness?function(t,e,n){var a,i=e.pixels,o=i[t],r=t>0?i[t-1]:null,s=t');var n=t.data,a=n.datasets,i=n.labels;if(a.length)for(var o=0;o'),i[o]&&e.push(i[o]),e.push("");return e.push(""),e.join("")},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map((function(n,a){var i=t.getDatasetMeta(0),o=e.datasets[0],r=i.data[a],s=r&&r.custom||{},l=t.options.elements.arc;return{text:n,fillStyle:Zt([s.backgroundColor,o.backgroundColor,l.backgroundColor],void 0,a),strokeStyle:Zt([s.borderColor,o.borderColor,l.borderColor],void 0,a),lineWidth:Zt([s.borderWidth,o.borderWidth,l.borderWidth],void 0,a),hidden:isNaN(o.data[a])||i.data[a].hidden,index:a}})):[]}},onClick:function(t,e){var n,a,i,o=e.index,r=this.chart;for(n=0,a=(r.data.datasets||[]).length;n=Math.PI?-1:m<-Math.PI?1:0))+g,b={x:Math.cos(m),y:Math.sin(m)},x={x:Math.cos(v),y:Math.sin(v)},y=m<=0&&v>=0||m<=2*Math.PI&&2*Math.PI<=v,k=m<=.5*Math.PI&&.5*Math.PI<=v||m<=2.5*Math.PI&&2.5*Math.PI<=v,M=m<=-Math.PI&&-Math.PI<=v||m<=Math.PI&&Math.PI<=v,w=m<=.5*-Math.PI&&.5*-Math.PI<=v||m<=1.5*Math.PI&&1.5*Math.PI<=v,C=f/100,_={x:M?-1:Math.min(b.x*(b.x<0?1:C),x.x*(x.x<0?1:C)),y:w?-1:Math.min(b.y*(b.y<0?1:C),x.y*(x.y<0?1:C))},D={x:y?1:Math.max(b.x*(b.x>0?1:C),x.x*(x.x>0?1:C)),y:k?1:Math.max(b.y*(b.y>0?1:C),x.y*(x.y>0?1:C))},S={width:.5*(D.x-_.x),height:.5*(D.y-_.y)};d=Math.min(s/S.width,l/S.height),u={x:-.5*(D.x+_.x),y:-.5*(D.y+_.y)}}for(e=0,n=h.length;e0&&!isNaN(t)?2*Math.PI*(Math.abs(t)/e):0},getMaxBorderWidth:function(t){var e,n,a,i,o,r,s,l,d=0,u=this.chart;if(!t)for(e=0,n=u.data.datasets.length;e(d=s>d?s:d)?l:d);return d},setHoverStyle:function(t){var e=t._model,n=t._options,a=ut.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=Kt(n.hoverBackgroundColor,a(n.backgroundColor)),e.borderColor=Kt(n.hoverBorderColor,a(n.borderColor)),e.borderWidth=Kt(n.hoverBorderWidth,n.borderWidth)},_resolveElementOptions:function(t,e){var n,a,i,o=this.chart,r=this.getDataset(),s=t.custom||{},l=o.options.elements.arc,d={},u={chart:o,dataIndex:e,dataset:r,datasetIndex:this.index},c=["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"];for(n=0,a=c.length;n0&&ee(l[t-1]._model,s)&&(n.controlPointPreviousX=d(n.controlPointPreviousX,s.left,s.right),n.controlPointPreviousY=d(n.controlPointPreviousY,s.top,s.bottom)),t');var n=t.data,a=n.datasets,i=n.labels;if(a.length)for(var o=0;o'),i[o]&&e.push(i[o]),e.push("");return e.push(""),e.join("")},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map((function(n,a){var i=t.getDatasetMeta(0),o=e.datasets[0],r=i.data[a].custom||{},s=t.options.elements.arc;return{text:n,fillStyle:ie([r.backgroundColor,o.backgroundColor,s.backgroundColor],void 0,a),strokeStyle:ie([r.borderColor,o.borderColor,s.borderColor],void 0,a),lineWidth:ie([r.borderWidth,o.borderWidth,s.borderWidth],void 0,a),hidden:isNaN(o.data[a])||i.data[a].hidden,index:a}})):[]}},onClick:function(t,e){var n,a,i,o=e.index,r=this.chart;for(n=0,a=(r.data.datasets||[]).length;n0&&(o=t.getDatasetMeta(o[0]._datasetIndex).data),o},"x-axis":function(t,e){return me(t,e,{intersect:!1})},point:function(t,e){return fe(t,ce(e,t))},nearest:function(t,e,n){var a=ce(e,t);n.axis=n.axis||"xy";var i=pe(n.axis);return ge(t,a,n.intersect,i)},x:function(t,e,n){var a=ce(e,t),i=[],o=!1;return he(t,(function(t){t.inXRange(a.x)&&i.push(t),t.inRange(a.x,a.y)&&(o=!0)})),n.intersect&&!o&&(i=[]),i},y:function(t,e,n){var a=ce(e,t),i=[],o=!1;return he(t,(function(t){t.inYRange(a.y)&&i.push(t),t.inRange(a.x,a.y)&&(o=!0)})),n.intersect&&!o&&(i=[]),i}}};function be(t,e){return ut.where(t,(function(t){return t.position===e}))}function xe(t,e){t.forEach((function(t,e){return t._tmpIndex_=e,t})),t.sort((function(t,n){var a=e?n:t,i=e?t:n;return a.weight===i.weight?a._tmpIndex_-i._tmpIndex_:a.weight-i.weight})),t.forEach((function(t){delete t._tmpIndex_}))}function ye(t,e){ut.each(t,(function(t){e[t.position]+=t.isHorizontal()?t.height:t.width}))}st._set("global",{layout:{padding:{top:0,right:0,bottom:0,left:0}}});var ke,Me={defaults:{},addBox:function(t,e){t.boxes||(t.boxes=[]),e.fullWidth=e.fullWidth||!1,e.position=e.position||"top",e.weight=e.weight||0,t.boxes.push(e)},removeBox:function(t,e){var n=t.boxes?t.boxes.indexOf(e):-1;-1!==n&&t.boxes.splice(n,1)},configure:function(t,e,n){for(var a,i=["fullWidth","position","weight"],o=i.length,r=0;r div {\n\tposition: absolute;\n\twidth: 1000000px;\n\theight: 1000000px;\n\tleft: 0;\n\ttop: 0;\n}\n\n.chartjs-size-monitor-shrink > div {\n\tposition: absolute;\n\twidth: 200%;\n\theight: 200%;\n\tleft: 0;\n\ttop: 0;\n}\n"}))&&ke.default||ke,Ce="$chartjs",_e="chartjs-size-monitor",De="chartjs-render-monitor",Se="chartjs-render-animation",Ae=["animationstart","webkitAnimationStart"],Pe={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function Ie(t,e){var n=ut.getStyle(t,e),a=n&&n.match(/^(\d+)(\.\d+)?px$/);return a?Number(a[1]):void 0}var Te=!!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("e",null,e)}catch(t){}return t}()&&{passive:!0};function Fe(t,e,n){t.addEventListener(e,n,Te)}function Le(t,e,n){t.removeEventListener(e,n,Te)}function Re(t,e,n,a,i){return{type:t,chart:e,native:i||null,x:void 0!==n?n:null,y:void 0!==a?a:null}}function Oe(t){var e=document.createElement("div");return e.className=t||"",e}function Be(t,e,n){var a,i,o,r,s=t[Ce]||(t[Ce]={}),l=s.resizer=function(t){var e=Oe(_e),n=Oe(_e+"-expand"),a=Oe(_e+"-shrink");n.appendChild(Oe()),a.appendChild(Oe()),e.appendChild(n),e.appendChild(a),e._reset=function(){n.scrollLeft=1e6,n.scrollTop=1e6,a.scrollLeft=1e6,a.scrollTop=1e6};var i=function(){e._reset(),t()};return Fe(n,"scroll",i.bind(n,"expand")),Fe(a,"scroll",i.bind(a,"shrink")),e}((a=function(){if(s.resizer){var a=n.options.maintainAspectRatio&&t.parentNode,i=a?a.clientWidth:0;e(Re("resize",n)),a&&a.clientWidth0){var o=t[0];o.label?n=o.label:o.xLabel?n=o.xLabel:i>0&&o.index-1?t.split("\n"):t}function Ge(t){var e=st.global;return{xPadding:t.xPadding,yPadding:t.yPadding,xAlign:t.xAlign,yAlign:t.yAlign,bodyFontColor:t.bodyFontColor,_bodyFontFamily:He(t.bodyFontFamily,e.defaultFontFamily),_bodyFontStyle:He(t.bodyFontStyle,e.defaultFontStyle),_bodyAlign:t.bodyAlign,bodyFontSize:He(t.bodyFontSize,e.defaultFontSize),bodySpacing:t.bodySpacing,titleFontColor:t.titleFontColor,_titleFontFamily:He(t.titleFontFamily,e.defaultFontFamily),_titleFontStyle:He(t.titleFontStyle,e.defaultFontStyle),titleFontSize:He(t.titleFontSize,e.defaultFontSize),_titleAlign:t.titleAlign,titleSpacing:t.titleSpacing,titleMarginBottom:t.titleMarginBottom,footerFontColor:t.footerFontColor,_footerFontFamily:He(t.footerFontFamily,e.defaultFontFamily),_footerFontStyle:He(t.footerFontStyle,e.defaultFontStyle),footerFontSize:He(t.footerFontSize,e.defaultFontSize),_footerAlign:t.footerAlign,footerSpacing:t.footerSpacing,footerMarginTop:t.footerMarginTop,caretSize:t.caretSize,cornerRadius:t.cornerRadius,backgroundColor:t.backgroundColor,opacity:0,legendColorBackground:t.multiKeyBackground,displayColors:t.displayColors,borderColor:t.borderColor,borderWidth:t.borderWidth}}function Xe(t,e){return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-t.xPadding:t.x+t.xPadding}function Ze(t){return Ue([],qe(t))}var Ke=pt.extend({initialize:function(){this._model=Ge(this._options),this._lastActive=[]},getTitle:function(){var t=this,e=t._options,n=e.callbacks,a=n.beforeTitle.apply(t,arguments),i=n.title.apply(t,arguments),o=n.afterTitle.apply(t,arguments),r=[];return r=Ue(r,qe(a)),r=Ue(r,qe(i)),r=Ue(r,qe(o))},getBeforeBody:function(){return Ze(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(t,e){var n=this,a=n._options.callbacks,i=[];return ut.each(t,(function(t){var o={before:[],lines:[],after:[]};Ue(o.before,qe(a.beforeLabel.call(n,t,e))),Ue(o.lines,a.label.call(n,t,e)),Ue(o.after,qe(a.afterLabel.call(n,t,e))),i.push(o)})),i},getAfterBody:function(){return Ze(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var t=this,e=t._options.callbacks,n=e.beforeFooter.apply(t,arguments),a=e.footer.apply(t,arguments),i=e.afterFooter.apply(t,arguments),o=[];return o=Ue(o,qe(n)),o=Ue(o,qe(a)),o=Ue(o,qe(i))},update:function(t){var e,n,a,i,o,r,s,l,d,u,c=this,h=c._options,f=c._model,g=c._model=Ge(h),p=c._active,m=c._data,v={xAlign:f.xAlign,yAlign:f.yAlign},b={x:f.x,y:f.y},x={width:f.width,height:f.height},y={x:f.caretX,y:f.caretY};if(p.length){g.opacity=1;var k=[],M=[];y=je[h.position].call(c,p,c._eventPosition);var w=[];for(e=0,n=p.length;ea.width&&(i=a.width-e.width),i<0&&(i=0)),"top"===u?o+=c:o-="bottom"===u?e.height+c:e.height/2,"center"===u?"left"===d?i+=c:"right"===d&&(i-=c):"left"===d?i-=h:"right"===d&&(i+=h),{x:i,y:o}}(g,x,v=function(t,e){var n,a,i,o,r,s=t._model,l=t._chart,d=t._chart.chartArea,u="center",c="center";s.yl.height-e.height&&(c="bottom");var h=(d.left+d.right)/2,f=(d.top+d.bottom)/2;"center"===c?(n=function(t){return t<=h},a=function(t){return t>h}):(n=function(t){return t<=e.width/2},a=function(t){return t>=l.width-e.width/2}),i=function(t){return t+e.width+s.caretSize+s.caretPadding>l.width},o=function(t){return t-e.width-s.caretSize-s.caretPadding<0},r=function(t){return t<=f?"top":"bottom"},n(s.x)?(u="left",i(s.x)&&(u="center",c=r(s.y))):a(s.x)&&(u="right",o(s.x)&&(u="center",c=r(s.y)));var g=t._options;return{xAlign:g.xAlign?g.xAlign:u,yAlign:g.yAlign?g.yAlign:c}}(this,x),c._chart)}else g.opacity=0;return g.xAlign=v.xAlign,g.yAlign=v.yAlign,g.x=b.x,g.y=b.y,g.width=x.width,g.height=x.height,g.caretX=y.x,g.caretY=y.y,c._model=g,t&&h.custom&&h.custom.call(c,g),c},drawCaret:function(t,e){var n=this._chart.ctx,a=this._view,i=this.getCaretPosition(t,e,a);n.lineTo(i.x1,i.y1),n.lineTo(i.x2,i.y2),n.lineTo(i.x3,i.y3)},getCaretPosition:function(t,e,n){var a,i,o,r,s,l,d=n.caretSize,u=n.cornerRadius,c=n.xAlign,h=n.yAlign,f=t.x,g=t.y,p=e.width,m=e.height;if("center"===h)s=g+m/2,"left"===c?(i=(a=f)-d,o=a,r=s+d,l=s-d):(i=(a=f+p)+d,o=a,r=s-d,l=s+d);else if("left"===c?(a=(i=f+u+d)-d,o=i+d):"right"===c?(a=(i=f+p-u-d)-d,o=i+d):(a=(i=n.caretX)-d,o=i+d),"top"===h)s=(r=g)-d,l=r;else{s=(r=g+m)+d,l=r;var v=o;o=a,a=v}return{x1:a,x2:i,x3:o,y1:r,y2:s,y3:l}},drawTitle:function(t,e,n){var a=e.title;if(a.length){t.x=Xe(e,e._titleAlign),n.textAlign=e._titleAlign,n.textBaseline="top";var i,o,r=e.titleFontSize,s=e.titleSpacing;for(n.fillStyle=e.titleFontColor,n.font=ut.fontString(r,e._titleFontStyle,e._titleFontFamily),i=0,o=a.length;i0&&n.stroke()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var n={width:e.width,height:e.height},a={x:e.x,y:e.y},i=Math.abs(e.opacity<.001)?0:e.opacity,o=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;this._options.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(a,e,t,n),a.y+=e.yPadding,this.drawTitle(a,e,t),this.drawBody(a,e,t),this.drawFooter(a,e,t),t.restore())}},handleEvent:function(t){var e,n=this,a=n._options;return n._lastActive=n._lastActive||[],"mouseout"===t.type?n._active=[]:n._active=n._chart.getElementsAtEventForMode(t,a.mode,a),(e=!ut.arrayEquals(n._active,n._lastActive))&&(n._lastActive=n._active,(a.enabled||a.custom)&&(n._eventPosition={x:t.x,y:t.y},n.update(!0),n.pivot())),e}}),$e=je,Je=Ke;Je.positioners=$e;var Qe=ut.valueOrDefault;function tn(){return ut.merge({},[].slice.call(arguments),{merger:function(t,e,n,a){if("xAxes"===t||"yAxes"===t){var i,o,r,s=n[t].length;for(e[t]||(e[t]=[]),i=0;i=e[t].length&&e[t].push({}),!e[t][i].type||r.type&&r.type!==e[t][i].type?ut.merge(e[t][i],[Ee.getScaleDefaults(o),r]):ut.merge(e[t][i],r)}else ut._merger(t,e,n,a)}})}function en(){return ut.merge({},[].slice.call(arguments),{merger:function(t,e,n,a){var i=e[t]||{},o=n[t];"scales"===t?e[t]=tn(i,o):"scale"===t?e[t]=ut.merge(i,[Ee.getScaleDefaults(o.type),o]):ut._merger(t,e,n,a)}})}function nn(t){var e=t.options;ut.each(t.scales,(function(e){Me.removeBox(t,e)})),e=en(st.global,st[t.config.type],e),t.options=t.config.options=e,t.ensureScalesHaveIDs(),t.buildOrUpdateScales(),t.tooltip._options=e.tooltips,t.tooltip.initialize()}function an(t){return"top"===t||"bottom"===t}st._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});var on=function(t,e){return this.construct(t,e),this};ut.extend(on.prototype,{construct:function(t,e){var n=this;e=function(t){var e=(t=t||{}).data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=en(st.global,st[t.type],t.options||{}),t}(e);var a=Ne.acquireContext(t,e),i=a&&a.canvas,o=i&&i.height,r=i&&i.width;n.id=ut.uid(),n.ctx=a,n.canvas=i,n.config=e,n.width=r,n.height=o,n.aspectRatio=o?r/o:null,n.options=e.options,n._bufferedRender=!1,n.chart=n,n.controller=n,on.instances[n.id]=n,Object.defineProperty(n,"data",{get:function(){return n.config.data},set:function(t){n.config.data=t}}),a&&i?(n.initialize(),n.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return Ve.notify(t,"beforeInit"),ut.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.ensureScalesHaveIDs(),t.buildOrUpdateScales(),t.initToolTip(),Ve.notify(t,"afterInit"),t},clear:function(){return ut.canvas.clear(this),this},stop:function(){return bt.cancelAnimation(this),this},resize:function(t){var e=this,n=e.options,a=e.canvas,i=n.maintainAspectRatio&&e.aspectRatio||null,o=Math.max(0,Math.floor(ut.getMaximumWidth(a))),r=Math.max(0,Math.floor(i?o/i:ut.getMaximumHeight(a)));if((e.width!==o||e.height!==r)&&(a.width=e.width=o,a.height=e.height=r,a.style.width=o+"px",a.style.height=r+"px",ut.retinaScale(e,n.devicePixelRatio),!t)){var s={width:o,height:r};Ve.notify(e,"resize",[s]),n.onResize&&n.onResize(e,s),e.stop(),e.update({duration:n.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},n=t.scale;ut.each(e.xAxes,(function(t,e){t.id=t.id||"x-axis-"+e})),ut.each(e.yAxes,(function(t,e){t.id=t.id||"y-axis-"+e})),n&&(n.id=n.id||"scale")},buildOrUpdateScales:function(){var t=this,e=t.options,n=t.scales||{},a=[],i=Object.keys(n).reduce((function(t,e){return t[e]=!1,t}),{});e.scales&&(a=a.concat((e.scales.xAxes||[]).map((function(t){return{options:t,dtype:"category",dposition:"bottom"}})),(e.scales.yAxes||[]).map((function(t){return{options:t,dtype:"linear",dposition:"left"}})))),e.scale&&a.push({options:e.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),ut.each(a,(function(e){var a=e.options,o=a.id,r=Qe(a.type,e.dtype);an(a.position)!==an(e.dposition)&&(a.position=e.dposition),i[o]=!0;var s=null;if(o in n&&n[o].type===r)(s=n[o]).options=a,s.ctx=t.ctx,s.chart=t;else{var l=Ee.getScaleConstructor(r);if(!l)return;s=new l({id:o,type:r,options:a,ctx:t.ctx,chart:t}),n[s.id]=s}s.mergeTicksOptions(),e.isDefault&&(t.scale=s)})),ut.each(i,(function(t,e){t||delete n[e]})),t.scales=n,Ee.addScalesToLayout(this)},buildOrUpdateControllers:function(){var t=this,e=[];return ut.each(t.data.datasets,(function(n,a){var i=t.getDatasetMeta(a),o=n.type||t.config.type;if(i.type&&i.type!==o&&(t.destroyDatasetMeta(a),i=t.getDatasetMeta(a)),i.type=o,i.controller)i.controller.updateIndex(a),i.controller.linkScales();else{var r=ue[i.type];if(void 0===r)throw new Error('"'+i.type+'" is not a chart type.');i.controller=new r(t,a),e.push(i.controller)}}),t),e},resetElements:function(){var t=this;ut.each(t.data.datasets,(function(e,n){t.getDatasetMeta(n).controller.reset()}),t)},reset:function(){this.resetElements(),this.tooltip.initialize()},update:function(t){var e=this;if(t&&"object"==typeof t||(t={duration:t,lazy:arguments[1]}),nn(e),Ve._invalidate(e),!1!==Ve.notify(e,"beforeUpdate")){e.tooltip._data=e.data;var n=e.buildOrUpdateControllers();ut.each(e.data.datasets,(function(t,n){e.getDatasetMeta(n).controller.buildOrUpdateElements()}),e),e.updateLayout(),e.options.animation&&e.options.animation.duration&&ut.each(n,(function(t){t.reset()})),e.updateDatasets(),e.tooltip.initialize(),e.lastActive=[],Ve.notify(e,"afterUpdate"),e._bufferedRender?e._bufferedRequest={duration:t.duration,easing:t.easing,lazy:t.lazy}:e.render(t)}},updateLayout:function(){!1!==Ve.notify(this,"beforeLayout")&&(Me.update(this,this.width,this.height),Ve.notify(this,"afterScaleUpdate"),Ve.notify(this,"afterLayout"))},updateDatasets:function(){if(!1!==Ve.notify(this,"beforeDatasetsUpdate")){for(var t=0,e=this.data.datasets.length;t=0;--n)e.isDatasetVisible(n)&&e.drawDataset(n,t);Ve.notify(e,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var n=this.getDatasetMeta(t),a={meta:n,index:t,easingValue:e};!1!==Ve.notify(this,"beforeDatasetDraw",[a])&&(n.controller.draw(e),Ve.notify(this,"afterDatasetDraw",[a]))},_drawTooltip:function(t){var e=this.tooltip,n={tooltip:e,easingValue:t};!1!==Ve.notify(this,"beforeTooltipDraw",[n])&&(e.draw(),Ve.notify(this,"afterTooltipDraw",[n]))},getElementAtEvent:function(t){return ve.modes.single(this,t)},getElementsAtEvent:function(t){return ve.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return ve.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,n){var a=ve.modes[e];return"function"==typeof a?a(this,t,n):[]},getDatasetAtEvent:function(t){return ve.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this.data.datasets[t];e._meta||(e._meta={});var n=e._meta[this.id];return n||(n=e._meta[this.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null}),n},getVisibleDatasetCount:function(){for(var t=0,e=0,n=this.data.datasets.length;e3?n[2]-n[1]:n[1]-n[0];Math.abs(a)>1&&t!==Math.floor(t)&&(a=t-Math.floor(t));var i=ut.log10(Math.abs(a)),o="";if(0!==t)if(Math.max(Math.abs(n[0]),Math.abs(n[n.length-1]))<1e-4){var r=ut.log10(Math.abs(t));o=t.toExponential(Math.floor(r)-Math.floor(i))}else{var s=-1*Math.floor(i);s=Math.max(Math.min(s,20),0),o=t.toFixed(s)}else o="0";return o},logarithmic:function(t,e,n){var a=t/Math.pow(10,Math.floor(ut.log10(t)));return 0===t?"0":1===a||2===a||5===a||0===e||e===n.length-1?t.toExponential():""}}},cn=ut.valueOrDefault,hn=ut.valueAtIndexOrDefault;function fn(t){var e,n,a=[];for(e=0,n=t.length;ed&&ot.maxHeight){o--;break}o++,l=r*s}t.labelRotation=o},afterCalculateTickRotation:function(){ut.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){ut.callback(this.options.beforeFit,[this])},fit:function(){var t=this,e=t.minSize={width:0,height:0},n=fn(t._ticks),a=t.options,i=a.ticks,o=a.scaleLabel,r=a.gridLines,s=t._isVisible(),l=a.position,d=t.isHorizontal(),u=ut.options._parseFont,c=u(i),h=a.gridLines.tickMarkLength;if(e.width=d?t.isFullWidth()?t.maxWidth-t.margins.left-t.margins.right:t.maxWidth:s&&r.drawTicks?h:0,e.height=d?s&&r.drawTicks?h:0:t.maxHeight,o.display&&s){var f=u(o),g=ut.options.toPadding(o.padding),p=f.lineHeight+g.height;d?e.height+=p:e.width+=p}if(i.display&&s){var m=ut.longestText(t.ctx,c.string,n,t.longestTextCache),v=ut.numberOfLabelLines(n),b=.5*c.size,x=t.options.ticks.padding;if(t._maxLabelLines=v,t.longestLabelWidth=m,d){var y=ut.toRadians(t.labelRotation),k=Math.cos(y),M=Math.sin(y)*m+c.lineHeight*v+b;e.height=Math.min(t.maxHeight,e.height+M+x),t.ctx.font=c.string;var w,C,_=gn(t.ctx,n[0],c.string),D=gn(t.ctx,n[n.length-1],c.string),S=t.getPixelForTick(0)-t.left,A=t.right-t.getPixelForTick(n.length-1);0!==t.labelRotation?(w="bottom"===l?k*_:k*b,C="bottom"===l?k*b:k*D):(w=_/2,C=D/2),t.paddingLeft=Math.max(w-S,0)+3,t.paddingRight=Math.max(C-A,0)+3}else i.mirror?m=0:m+=x+b,e.width=Math.min(t.maxWidth,e.width+m),t.paddingTop=c.size/2,t.paddingBottom=c.size/2}t.handleMargins(),t.width=e.width,t.height=e.height},handleMargins:function(){var t=this;t.margins&&(t.paddingLeft=Math.max(t.paddingLeft-t.margins.left,0),t.paddingTop=Math.max(t.paddingTop-t.margins.top,0),t.paddingRight=Math.max(t.paddingRight-t.margins.right,0),t.paddingBottom=Math.max(t.paddingBottom-t.margins.bottom,0))},afterFit:function(){ut.callback(this.options.afterFit,[this])},isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){if(ut.isNullOrUndef(t))return NaN;if(("number"==typeof t||t instanceof Number)&&!isFinite(t))return NaN;if(t)if(this.isHorizontal()){if(void 0!==t.x)return this.getRightValue(t.x)}else if(void 0!==t.y)return this.getRightValue(t.y);return t},getLabelForIndex:ut.noop,getPixelForValue:ut.noop,getValueForPixel:ut.noop,getPixelForTick:function(t){var e=this,n=e.options.offset;if(e.isHorizontal()){var a=(e.width-(e.paddingLeft+e.paddingRight))/Math.max(e._ticks.length-(n?0:1),1),i=a*t+e.paddingLeft;n&&(i+=a/2);var o=e.left+i;return o+=e.isFullWidth()?e.margins.left:0}var r=e.height-(e.paddingTop+e.paddingBottom);return e.top+t*(r/(e._ticks.length-1))},getPixelForDecimal:function(t){var e=this;if(e.isHorizontal()){var n=(e.width-(e.paddingLeft+e.paddingRight))*t+e.paddingLeft,a=e.left+n;return a+=e.isFullWidth()?e.margins.left:0}return e.top+t*e.height},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var t=this.min,e=this.max;return this.beginAtZero?0:t<0&&e<0?e:t>0&&e>0?t:0},_autoSkip:function(t){var e,n,a=this,i=a.isHorizontal(),o=a.options.ticks.minor,r=t.length,s=!1,l=o.maxTicksLimit,d=a._tickSize()*(r-1),u=i?a.width-(a.paddingLeft+a.paddingRight):a.height-(a.paddingTop+a.PaddingBottom),c=[];for(d>u&&(s=1+Math.floor(d/u)),r>l&&(s=Math.max(s,1+Math.floor(r/l))),e=0;e1&&e%s>0&&delete n.label,c.push(n);return c},_tickSize:function(){var t=this,e=t.isHorizontal(),n=t.options.ticks.minor,a=ut.toRadians(t.labelRotation),i=Math.abs(Math.cos(a)),o=Math.abs(Math.sin(a)),r=n.autoSkipPadding||0,s=t.longestLabelWidth+r||0,l=ut.options._parseFont(n),d=t._maxLabelLines*l.lineHeight+r||0;return e?d*i>s*o?s/i:d/o:d*o0&&a>0&&(t.min=0)}var i=void 0!==e.min||void 0!==e.suggestedMin,o=void 0!==e.max||void 0!==e.suggestedMax;void 0!==e.min?t.min=e.min:void 0!==e.suggestedMin&&(null===t.min?t.min=e.suggestedMin:t.min=Math.min(t.min,e.suggestedMin)),void 0!==e.max?t.max=e.max:void 0!==e.suggestedMax&&(null===t.max?t.max=e.suggestedMax:t.max=Math.max(t.max,e.suggestedMax)),i!==o&&t.min>=t.max&&(i?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,e.beginAtZero||t.min--)},getTickLimit:function(){var t,e=this.options.ticks,n=e.stepSize,a=e.maxTicksLimit;return n?t=Math.ceil(this.max/n)-Math.floor(this.min/n)+1:(t=this._computeTickLimit(),a=a||11),a&&(t=Math.min(a,t)),t},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:bn,buildTicks:function(){var t=this,e=t.options.ticks,n=t.getTickLimit(),a={maxTicks:n=Math.max(2,n),min:e.min,max:e.max,precision:e.precision,stepSize:ut.valueOrDefault(e.fixedStepSize,e.stepSize)},i=t.ticks=function(t,e){var n,a,i,o,r=[],s=t.stepSize,l=s||1,d=t.maxTicks-1,u=t.min,c=t.max,h=t.precision,f=e.min,g=e.max,p=ut.niceNum((g-f)/d/l)*l;if(p<1e-14&&xn(u)&&xn(c))return[f,g];(o=Math.ceil(g/p)-Math.floor(f/p))>d&&(p=ut.niceNum(o*p/d/l)*l),s||xn(h)?n=Math.pow(10,ut._decimalPlaces(p)):(n=Math.pow(10,h),p=Math.ceil(p*n)/n),a=Math.floor(f/p)*p,i=Math.ceil(g/p)*p,s&&(!xn(u)&&ut.almostWhole(u/p,p/1e3)&&(a=u),!xn(c)&&ut.almostWhole(c/p,p/1e3)&&(i=c)),o=(i-a)/p,o=ut.almostEquals(o,Math.round(o),p/1e3)?Math.round(o):Math.ceil(o),a=Math.round(a*n)/n,i=Math.round(i*n)/n,r.push(xn(u)?a:u);for(var m=1;mt.max&&(t.max=a))}))}));t.min=isFinite(t.min)&&!isNaN(t.min)?t.min:0,t.max=isFinite(t.max)&&!isNaN(t.max)?t.max:1,this.handleTickRangeOptions()},_computeTickLimit:function(){var t;return this.isHorizontal()?Math.ceil(this.width/40):(t=ut.options._parseFont(this.options.ticks),Math.ceil(this.height/t.lineHeight))},handleDirectionalChanges:function(){this.isHorizontal()||this.ticks.reverse()},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},getPixelForValue:function(t){var e=this,n=e.start,a=+e.getRightValue(t),i=e.end-n;return e.isHorizontal()?e.left+e.width/i*(a-n):e.bottom-e.height/i*(a-n)},getValueForPixel:function(t){var e=this,n=e.isHorizontal(),a=n?e.width:e.height,i=(n?t-e.left:e.bottom-t)/a;return e.start+(e.end-e.start)*i},getPixelForTick:function(t){return this.getPixelForValue(this.ticksAsNumbers[t])}}),wn=kn;Mn._defaults=wn;var Cn=ut.valueOrDefault,_n={position:"left",ticks:{callback:un.formatters.logarithmic}};function Dn(t,e){return ut.isFinite(t)&&t>=0?t:e}var Sn=pn.extend({determineDataLimits:function(){var t=this,e=t.options,n=t.chart,a=n.data.datasets,i=t.isHorizontal();function o(e){return i?e.xAxisID===t.id:e.yAxisID===t.id}t.min=null,t.max=null,t.minNotZero=null;var r=e.stacked;if(void 0===r&&ut.each(a,(function(t,e){if(!r){var a=n.getDatasetMeta(e);n.isDatasetVisible(e)&&o(a)&&void 0!==a.stack&&(r=!0)}})),e.stacked||r){var s={};ut.each(a,(function(a,i){var r=n.getDatasetMeta(i),l=[r.type,void 0===e.stacked&&void 0===r.stack?i:"",r.stack].join(".");n.isDatasetVisible(i)&&o(r)&&(void 0===s[l]&&(s[l]=[]),ut.each(a.data,(function(e,n){var a=s[l],i=+t.getRightValue(e);isNaN(i)||r.data[n].hidden||i<0||(a[n]=a[n]||0,a[n]+=i)})))})),ut.each(s,(function(e){if(e.length>0){var n=ut.min(e),a=ut.max(e);t.min=null===t.min?n:Math.min(t.min,n),t.max=null===t.max?a:Math.max(t.max,a)}}))}else ut.each(a,(function(e,a){var i=n.getDatasetMeta(a);n.isDatasetVisible(a)&&o(i)&&ut.each(e.data,(function(e,n){var a=+t.getRightValue(e);isNaN(a)||i.data[n].hidden||a<0||(null===t.min?t.min=a:at.max&&(t.max=a),0!==a&&(null===t.minNotZero||a0?t.minNotZero=t.min:t.max<1?t.minNotZero=Math.pow(10,Math.floor(ut.log10(t.max))):t.minNotZero=1)},buildTicks:function(){var t=this,e=t.options.ticks,n=!t.isHorizontal(),a={min:Dn(e.min),max:Dn(e.max)},i=t.ticks=function(t,e){var n,a,i=[],o=Cn(t.min,Math.pow(10,Math.floor(ut.log10(e.min)))),r=Math.floor(ut.log10(e.max)),s=Math.ceil(e.max/Math.pow(10,r));0===o?(n=Math.floor(ut.log10(e.minNotZero)),a=Math.floor(e.minNotZero/Math.pow(10,n)),i.push(o),o=a*Math.pow(10,n)):(n=Math.floor(ut.log10(o)),a=Math.floor(o/Math.pow(10,n)));var l=n<0?Math.pow(10,Math.abs(n)):1;do{i.push(o),10==++a&&(a=1,l=++n>=0?1:l),o=Math.round(a*Math.pow(10,n)*l)/l}while(ni?{start:e-n,end:e}:{start:e,end:e+n}}function Bn(t){return 0===t||180===t?"center":t<180?"left":"right"}function Yn(t,e,n,a){var i,o,r=n.y+a/2;if(ut.isArray(e))for(i=0,o=e.length;i270||t<90)&&(n.y-=e.h)}function Wn(t){return ut.isNumber(t)?t:0}var Nn=yn.extend({setDimensions:function(){var t=this;t.width=t.maxWidth,t.height=t.maxHeight,t.paddingTop=Rn(t.options)/2,t.xCenter=Math.floor(t.width/2),t.yCenter=Math.floor((t.height-t.paddingTop)/2),t.drawingArea=Math.min(t.height-t.paddingTop,t.width)/2},determineDataLimits:function(){var t=this,e=t.chart,n=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;ut.each(e.data.datasets,(function(i,o){if(e.isDatasetVisible(o)){var r=e.getDatasetMeta(o);ut.each(i.data,(function(e,i){var o=+t.getRightValue(e);isNaN(o)||r.data[i].hidden||(n=Math.min(o,n),a=Math.max(o,a))}))}})),t.min=n===Number.POSITIVE_INFINITY?0:n,t.max=a===Number.NEGATIVE_INFINITY?0:a,t.handleTickRangeOptions()},_computeTickLimit:function(){return Math.ceil(this.drawingArea/Rn(this.options))},convertTicksToLabels:function(){var t=this;yn.prototype.convertTicksToLabels.call(t),t.pointLabels=t.chart.data.labels.map(t.options.pointLabels.callback,t)},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},fit:function(){var t=this.options;t.display&&t.pointLabels.display?function(t){var e,n,a,i=ut.options._parseFont(t.options.pointLabels),o={l:0,r:t.width,t:0,b:t.height-t.paddingTop},r={};t.ctx.font=i.string,t._pointLabelSizes=[];var s,l,d,u=Ln(t);for(e=0;eo.r&&(o.r=f.end,r.r=c),g.starto.b&&(o.b=g.end,r.b=c)}t.setReductions(t.drawingArea,o,r)}(this):this.setCenterPoint(0,0,0,0)},setReductions:function(t,e,n){var a=this,i=e.l/Math.sin(n.l),o=Math.max(e.r-a.width,0)/Math.sin(n.r),r=-e.t/Math.cos(n.t),s=-Math.max(e.b-(a.height-a.paddingTop),0)/Math.cos(n.b);i=Wn(i),o=Wn(o),r=Wn(r),s=Wn(s),a.drawingArea=Math.min(Math.floor(t-(i+o)/2),Math.floor(t-(r+s)/2)),a.setCenterPoint(i,o,r,s)},setCenterPoint:function(t,e,n,a){var i=this,o=i.width-e-i.drawingArea,r=t+i.drawingArea,s=n+i.drawingArea,l=i.height-i.paddingTop-a-i.drawingArea;i.xCenter=Math.floor((r+o)/2+i.left),i.yCenter=Math.floor((s+l)/2+i.top+i.paddingTop)},getIndexAngle:function(t){return t*(2*Math.PI/Ln(this))+(this.chart.options&&this.chart.options.startAngle?this.chart.options.startAngle:0)*Math.PI*2/360},getDistanceFromCenterForValue:function(t){var e=this;if(null===t)return 0;var n=e.drawingArea/(e.max-e.min);return e.options.ticks.reverse?(e.max-t)*n:(t-e.min)*n},getPointPosition:function(t,e){var n=this.getIndexAngle(t)-Math.PI/2;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter}},getPointPositionForValue:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))},getBasePosition:function(){var t=this.min,e=this.max;return this.getPointPositionForValue(0,this.beginAtZero?0:t<0&&e<0?e:t>0&&e>0?t:0)},draw:function(){var t=this,e=t.options,n=e.gridLines,a=e.ticks;if(e.display){var i=t.ctx,o=this.getIndexAngle(0),r=ut.options._parseFont(a);(e.angleLines.display||e.pointLabels.display)&&function(t){var e=t.ctx,n=t.options,a=n.angleLines,i=n.gridLines,o=n.pointLabels,r=Pn(a.lineWidth,i.lineWidth),s=Pn(a.color,i.color),l=Rn(n);e.save(),e.lineWidth=r,e.strokeStyle=s,e.setLineDash&&(e.setLineDash(Tn([a.borderDash,i.borderDash,[]])),e.lineDashOffset=Tn([a.borderDashOffset,i.borderDashOffset,0]));var d=t.getDistanceFromCenterForValue(n.ticks.reverse?t.min:t.max),u=ut.options._parseFont(o);e.font=u.string,e.textBaseline="middle";for(var c=Ln(t)-1;c>=0;c--){if(a.display&&r&&s){var h=t.getPointPosition(c,d);e.beginPath(),e.moveTo(t.xCenter,t.yCenter),e.lineTo(h.x,h.y),e.stroke()}if(o.display){var f=0===c?l/2:0,g=t.getPointPosition(c,d+f+5),p=In(o.fontColor,c,st.global.defaultFontColor);e.fillStyle=p;var m=t.getIndexAngle(c),v=ut.toDegrees(m);e.textAlign=Bn(v),zn(v,t._pointLabelSizes[c],g),Yn(e,t.pointLabels[c]||"",g,u.lineHeight)}}e.restore()}(t),ut.each(t.ticks,(function(e,s){if(s>0||a.reverse){var l=t.getDistanceFromCenterForValue(t.ticksAsNumbers[s]);if(n.display&&0!==s&&function(t,e,n,a){var i,o=t.ctx,r=e.circular,s=Ln(t),l=In(e.color,a-1),d=In(e.lineWidth,a-1);if((r||s)&&l&&d){if(o.save(),o.strokeStyle=l,o.lineWidth=d,o.setLineDash&&(o.setLineDash(e.borderDash||[]),o.lineDashOffset=e.borderDashOffset||0),o.beginPath(),r)o.arc(t.xCenter,t.yCenter,n,0,2*Math.PI);else{i=t.getPointPosition(0,n),o.moveTo(i.x,i.y);for(var u=1;u=0&&r<=s;){if(i=t[(a=r+s>>1)-1]||null,o=t[a],!i)return{lo:null,hi:o};if(o[e]n))return{lo:i,hi:o};s=a-1}}return{lo:o,hi:null}}(t,e,n),o=i.lo?i.hi?i.lo:t[t.length-2]:t[0],r=i.lo?i.hi?i.hi:t[t.length-1]:t[1],s=r[e]-o[e],l=s?(n-o[e])/s:0,d=(r[a]-o[a])*l;return o[a]+d}function Kn(t,e){var n=t._adapter,a=t.options.time,i=a.parser,o=i||a.format,r=e;return"function"==typeof i&&(r=i(r)),ut.isFinite(r)||(r="string"==typeof o?n.parse(r,o):n.parse(r)),null!==r?+r:(i||"function"!=typeof o||(r=o(e),ut.isFinite(r)||(r=n.parse(r))),r)}function $n(t,e){if(ut.isNullOrUndef(e))return null;var n=t.options.time,a=Kn(t,t.getRightValue(e));return null===a?a:(n.round&&(a=+t._adapter.startOf(a,n.round)),a)}function Jn(t){for(var e=qn.indexOf(t)+1,n=qn.length;e=i&&n<=o&&d.push(n);return a.min=i,a.max=o,a._unit=s.unit||function(t,e,n,a,i){var o,r;for(o=qn.length-1;o>=qn.indexOf(n);o--)if(r=qn[o],Un[r].common&&t._adapter.diff(i,a,r)>=e.length)return r;return qn[n?qn.indexOf(n):0]}(a,d,s.minUnit,a.min,a.max),a._majorUnit=Jn(a._unit),a._table=function(t,e,n,a){if("linear"===a||!t.length)return[{time:e,pos:0},{time:n,pos:1}];var i,o,r,s,l,d=[],u=[e];for(i=0,o=t.length;ie&&s=0&&t0?r:1}}),ea={position:"bottom",distribution:"linear",bounds:"data",adapters:{},time:{parser:!1,format:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}};ta._defaults=ea;var na={category:mn,linear:Mn,logarithmic:Sn,radialLinear:Nn,time:ta},aa={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};dn._date.override("function"==typeof t?{_id:"moment",formats:function(){return aa},parse:function(e,n){return"string"==typeof e&&"string"==typeof n?e=t(e,n):e instanceof t||(e=t(e)),e.isValid()?e.valueOf():null},format:function(e,n){return t(e).format(n)},add:function(e,n,a){return t(e).add(n,a).valueOf()},diff:function(e,n,a){return t.duration(t(e).diff(t(n))).as(a)},startOf:function(e,n,a){return e=t(e),"isoWeek"===n?e.isoWeekday(a).valueOf():e.startOf(n).valueOf()},endOf:function(e,n){return t(e).endOf(n).valueOf()},_create:function(e){return t(e)}}:{}),st._set("global",{plugins:{filler:{propagate:!0}}});var ia={dataset:function(t){var e=t.fill,n=t.chart,a=n.getDatasetMeta(e),i=a&&n.isDatasetVisible(e)&&a.dataset._children||[],o=i.length||0;return o?function(t,e){return e=n)&&a;switch(o){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return o;default:return!1}}function ra(t){var e,n=t.el._model||{},a=t.el._scale||{},i=t.fill,o=null;if(isFinite(i))return null;if("start"===i?o=void 0===n.scaleBottom?a.bottom:n.scaleBottom:"end"===i?o=void 0===n.scaleTop?a.top:n.scaleTop:void 0!==n.scaleZero?o=n.scaleZero:a.getBasePosition?o=a.getBasePosition():a.getBasePixel&&(o=a.getBasePixel()),null!=o){if(void 0!==o.x&&void 0!==o.y)return o;if(ut.isFinite(o))return{x:(e=a.isHorizontal())?o:null,y:e?null:o}}return null}function sa(t,e,n){var a,i=t[e].fill,o=[e];if(!n)return i;for(;!1!==i&&-1===o.indexOf(i);){if(!isFinite(i))return i;if(!(a=t[i]))return!1;if(a.visible)return i;o.push(i),i=a.fill}return!1}function la(t){var e=t.fill,n="dataset";return!1===e?null:(isFinite(e)||(n="boundary"),ia[n](t))}function da(t){return t&&!t.skip}function ua(t,e,n,a,i){var o;if(a&&i){for(t.moveTo(e[0].x,e[0].y),o=1;o0;--o)ut.canvas.lineTo(t,n[o],n[o-1],!0)}}var ca={id:"filler",afterDatasetsUpdate:function(t,e){var n,a,i,o,r=(t.data.datasets||[]).length,s=e.propagate,l=[];for(a=0;ae?e:t.boxWidth}st._set("global",{legend:{display:!0,position:"top",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(t,e){var n=e.datasetIndex,a=this.chart,i=a.getDatasetMeta(n);i.hidden=null===i.hidden?!a.data.datasets[n].hidden:null,a.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(t){var e=t.data;return ut.isArray(e.datasets)?e.datasets.map((function(e,n){return{text:e.label,fillStyle:ut.isArray(e.backgroundColor)?e.backgroundColor[0]:e.backgroundColor,hidden:!t.isDatasetVisible(n),lineCap:e.borderCapStyle,lineDash:e.borderDash,lineDashOffset:e.borderDashOffset,lineJoin:e.borderJoinStyle,lineWidth:e.borderWidth,strokeStyle:e.borderColor,pointStyle:e.pointStyle,datasetIndex:n}}),this):[]}}},legendCallback:function(t){var e=[];e.push('
    ');for(var n=0;n'),t.data.datasets[n].label&&e.push(t.data.datasets[n].label),e.push("");return e.push("
"),e.join("")}});var pa=pt.extend({initialize:function(t){ut.extend(this,t),this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1},beforeUpdate:ha,update:function(t,e,n){var a=this;return a.beforeUpdate(),a.maxWidth=t,a.maxHeight=e,a.margins=n,a.beforeSetDimensions(),a.setDimensions(),a.afterSetDimensions(),a.beforeBuildLabels(),a.buildLabels(),a.afterBuildLabels(),a.beforeFit(),a.fit(),a.afterFit(),a.afterUpdate(),a.minSize},afterUpdate:ha,beforeSetDimensions:ha,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:ha,beforeBuildLabels:ha,buildLabels:function(){var t=this,e=t.options.labels||{},n=ut.callback(e.generateLabels,[t.chart],t)||[];e.filter&&(n=n.filter((function(n){return e.filter(n,t.chart.data)}))),t.options.reverse&&n.reverse(),t.legendItems=n},afterBuildLabels:ha,beforeFit:ha,fit:function(){var t=this,e=t.options,n=e.labels,a=e.display,i=t.ctx,o=ut.options._parseFont(n),r=o.size,s=t.legendHitBoxes=[],l=t.minSize,d=t.isHorizontal();if(d?(l.width=t.maxWidth,l.height=a?10:0):(l.width=a?10:0,l.height=t.maxHeight),a)if(i.font=o.string,d){var u=t.lineWidths=[0],c=0;i.textAlign="left",i.textBaseline="top",ut.each(t.legendItems,(function(t,e){var a=ga(n,r)+r/2+i.measureText(t.text).width;(0===e||u[u.length-1]+a+n.padding>l.width)&&(c+=r+n.padding,u[u.length-(e>0?0:1)]=n.padding),s[e]={left:0,top:0,width:a,height:r},u[u.length-1]+=a+n.padding})),l.height+=c}else{var h=n.padding,f=t.columnWidths=[],g=n.padding,p=0,m=0,v=r+h;ut.each(t.legendItems,(function(t,e){var a=ga(n,r)+r/2+i.measureText(t.text).width;e>0&&m+v>l.height-h&&(g+=p+n.padding,f.push(p),p=0,m=0),p=Math.max(p,a),m+=v,s[e]={left:0,top:0,width:a,height:r}})),g+=p,f.push(p),l.width+=g}t.width=l.width,t.height=l.height},afterFit:ha,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var t=this,e=t.options,n=e.labels,a=st.global,i=a.defaultColor,o=a.elements.line,r=t.width,s=t.lineWidths;if(e.display){var l,d=t.ctx,u=fa(n.fontColor,a.defaultFontColor),c=ut.options._parseFont(n),h=c.size;d.textAlign="left",d.textBaseline="middle",d.lineWidth=.5,d.strokeStyle=u,d.fillStyle=u,d.font=c.string;var f=ga(n,h),g=t.legendHitBoxes,p=t.isHorizontal();l=p?{x:t.left+(r-s[0])/2+n.padding,y:t.top+n.padding,line:0}:{x:t.left+n.padding,y:t.top+n.padding,line:0};var m=h+n.padding;ut.each(t.legendItems,(function(a,u){var c=d.measureText(a.text).width,v=f+h/2+c,b=l.x,x=l.y;p?u>0&&b+v+n.padding>t.left+t.minSize.width&&(x=l.y+=m,l.line++,b=l.x=t.left+(r-s[l.line])/2+n.padding):u>0&&x+m>t.top+t.minSize.height&&(b=l.x=b+t.columnWidths[l.line]+n.padding,x=l.y=t.top+n.padding,l.line++),function(t,n,a){if(!(isNaN(f)||f<=0)){d.save();var r=fa(a.lineWidth,o.borderWidth);if(d.fillStyle=fa(a.fillStyle,i),d.lineCap=fa(a.lineCap,o.borderCapStyle),d.lineDashOffset=fa(a.lineDashOffset,o.borderDashOffset),d.lineJoin=fa(a.lineJoin,o.borderJoinStyle),d.lineWidth=r,d.strokeStyle=fa(a.strokeStyle,i),d.setLineDash&&d.setLineDash(fa(a.lineDash,o.borderDash)),e.labels&&e.labels.usePointStyle){var s=f*Math.SQRT2/2,l=t+f/2,u=n+h/2;ut.canvas.drawPoint(d,a.pointStyle,s,l,u)}else 0!==r&&d.strokeRect(t,n,f,h),d.fillRect(t,n,f,h);d.restore()}}(b,x,a),g[u].left=b,g[u].top=x,function(t,e,n,a){var i=h/2,o=f+i+t,r=e+i;d.fillText(n.text,o,r),n.hidden&&(d.beginPath(),d.lineWidth=2,d.moveTo(o,r),d.lineTo(o+a,r),d.stroke())}(b,x,a,c),p?l.x+=v+n.padding:l.y+=m}))}},_getLegendItemAt:function(t,e){var n,a,i,o=this;if(t>=o.left&&t<=o.right&&e>=o.top&&e<=o.bottom)for(i=o.legendHitBoxes,n=0;n=(a=i[n]).left&&t<=a.left+a.width&&e>=a.top&&e<=a.top+a.height)return o.legendItems[n];return null},handleEvent:function(t){var e,n=this,a=n.options,i="mouseup"===t.type?"click":t.type;if("mousemove"===i){if(!a.onHover&&!a.onLeave)return}else{if("click"!==i)return;if(!a.onClick)return}e=n._getLegendItemAt(t.x,t.y),"click"===i?e&&a.onClick&&a.onClick.call(n,t.native,e):(a.onLeave&&e!==n._hoveredItem&&(n._hoveredItem&&a.onLeave.call(n,t.native,n._hoveredItem),n._hoveredItem=e),a.onHover&&e&&a.onHover.call(n,t.native,e))}});function ma(t,e){var n=new pa({ctx:t.ctx,options:e,chart:t});Me.configure(t,n,e),Me.addBox(t,n),t.legend=n}var va={id:"legend",_element:pa,beforeInit:function(t){var e=t.options.legend;e&&ma(t,e)},beforeUpdate:function(t){var e=t.options.legend,n=t.legend;e?(ut.mergeIf(e,st.global.legend),n?(Me.configure(t,n,e),n.options=e):ma(t,e)):n&&(Me.removeBox(t,n),delete t.legend)},afterEvent:function(t,e){var n=t.legend;n&&n.handleEvent(e)}},ba=ut.noop;st._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var xa=pt.extend({initialize:function(t){ut.extend(this,t),this.legendHitBoxes=[]},beforeUpdate:ba,update:function(t,e,n){var a=this;return a.beforeUpdate(),a.maxWidth=t,a.maxHeight=e,a.margins=n,a.beforeSetDimensions(),a.setDimensions(),a.afterSetDimensions(),a.beforeBuildLabels(),a.buildLabels(),a.afterBuildLabels(),a.beforeFit(),a.fit(),a.afterFit(),a.afterUpdate(),a.minSize},afterUpdate:ba,beforeSetDimensions:ba,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:ba,beforeBuildLabels:ba,buildLabels:ba,afterBuildLabels:ba,beforeFit:ba,fit:function(){var t=this,e=t.options,n=e.display,a=t.minSize,i=ut.isArray(e.text)?e.text.length:1,o=ut.options._parseFont(e),r=n?i*o.lineHeight+2*e.padding:0;t.isHorizontal()?(a.width=t.maxWidth,a.height=r):(a.width=r,a.height=t.maxHeight),t.width=a.width,t.height=a.height},afterFit:ba,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this,e=t.ctx,n=t.options;if(n.display){var a,i,o,r=ut.options._parseFont(n),s=r.lineHeight,l=s/2+n.padding,d=0,u=t.top,c=t.left,h=t.bottom,f=t.right;e.fillStyle=ut.valueOrDefault(n.fontColor,st.global.defaultFontColor),e.font=r.string,t.isHorizontal()?(i=c+(f-c)/2,o=u+l,a=f-c):(i="left"===n.position?c+l:f-l,o=u+(h-u)/2,a=h-u,d=Math.PI*("left"===n.position?-.5:.5)),e.save(),e.translate(i,o),e.rotate(d),e.textAlign="center",e.textBaseline="middle";var g=n.text;if(ut.isArray(g))for(var p=0,m=0;m=0;a--){var i=t[a];if(e(i))return i}},ut.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},ut.almostEquals=function(t,e,n){return Math.abs(t-e)t},ut.max=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.max(t,e)}),Number.NEGATIVE_INFINITY)},ut.min=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.min(t,e)}),Number.POSITIVE_INFINITY)},ut.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return 0==(t=+t)||isNaN(t)?t:t>0?1:-1},ut.log10=Math.log10?function(t){return Math.log10(t)}:function(t){var e=Math.log(t)*Math.LOG10E,n=Math.round(e);return t===Math.pow(10,n)?n:e},ut.toRadians=function(t){return t*(Math.PI/180)},ut.toDegrees=function(t){return t*(180/Math.PI)},ut._decimalPlaces=function(t){if(ut.isFinite(t)){for(var e=1,n=0;Math.round(t*e)/e!==t;)e*=10,n++;return n}},ut.getAngleFromPoint=function(t,e){var n=e.x-t.x,a=e.y-t.y,i=Math.sqrt(n*n+a*a),o=Math.atan2(a,n);return o<-.5*Math.PI&&(o+=2*Math.PI),{angle:o,distance:i}},ut.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},ut.aliasPixel=function(t){return t%2==0?0:.5},ut._alignPixel=function(t,e,n){var a=t.currentDevicePixelRatio,i=n/2;return Math.round((e-i)*a)/a+i},ut.splineCurve=function(t,e,n,a){var i=t.skip?e:t,o=e,r=n.skip?e:n,s=Math.sqrt(Math.pow(o.x-i.x,2)+Math.pow(o.y-i.y,2)),l=Math.sqrt(Math.pow(r.x-o.x,2)+Math.pow(r.y-o.y,2)),d=s/(s+l),u=l/(s+l),c=a*(d=isNaN(d)?0:d),h=a*(u=isNaN(u)?0:u);return{previous:{x:o.x-c*(r.x-i.x),y:o.y-c*(r.y-i.y)},next:{x:o.x+h*(r.x-i.x),y:o.y+h*(r.y-i.y)}}},ut.EPSILON=Number.EPSILON||1e-14,ut.splineCurveMonotone=function(t){var e,n,a,i,o,r,s,l,d,u=(t||[]).map((function(t){return{model:t._model,deltaK:0,mK:0}})),c=u.length;for(e=0;e0?u[e-1]:null,(i=e0?u[e-1]:null,i=e=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},ut.previousItem=function(t,e,n){return n?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},ut.niceNum=function(t,e){var n=Math.floor(ut.log10(t)),a=t/Math.pow(10,n);return(e?a<1.5?1:a<3?2:a<7?5:10:a<=1?1:a<=2?2:a<=5?5:10)*Math.pow(10,n)},ut.requestAnimFrame="undefined"==typeof window?function(t){t()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)},ut.getRelativePosition=function(t,e){var n,a,i=t.originalEvent||t,o=t.target||t.srcElement,r=o.getBoundingClientRect(),s=i.touches;s&&s.length>0?(n=s[0].clientX,a=s[0].clientY):(n=i.clientX,a=i.clientY);var l=parseFloat(ut.getStyle(o,"padding-left")),d=parseFloat(ut.getStyle(o,"padding-top")),u=parseFloat(ut.getStyle(o,"padding-right")),c=parseFloat(ut.getStyle(o,"padding-bottom")),h=r.right-r.left-l-u,f=r.bottom-r.top-d-c;return{x:n=Math.round((n-r.left-l)/h*o.width/e.currentDevicePixelRatio),y:a=Math.round((a-r.top-d)/f*o.height/e.currentDevicePixelRatio)}},ut.getConstraintWidth=function(t){return n(t,"max-width","clientWidth")},ut.getConstraintHeight=function(t){return n(t,"max-height","clientHeight")},ut._calculatePadding=function(t,e,n){return(e=ut.getStyle(t,e)).indexOf("%")>-1?n*parseInt(e,10)/100:parseInt(e,10)},ut._getParentNode=function(t){var e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e},ut.getMaximumWidth=function(t){var e=ut._getParentNode(t);if(!e)return t.clientWidth;var n=e.clientWidth,a=n-ut._calculatePadding(e,"padding-left",n)-ut._calculatePadding(e,"padding-right",n),i=ut.getConstraintWidth(t);return isNaN(i)?a:Math.min(a,i)},ut.getMaximumHeight=function(t){var e=ut._getParentNode(t);if(!e)return t.clientHeight;var n=e.clientHeight,a=n-ut._calculatePadding(e,"padding-top",n)-ut._calculatePadding(e,"padding-bottom",n),i=ut.getConstraintHeight(t);return isNaN(i)?a:Math.min(a,i)},ut.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},ut.retinaScale=function(t,e){var n=t.currentDevicePixelRatio=e||"undefined"!=typeof window&&window.devicePixelRatio||1;if(1!==n){var a=t.canvas,i=t.height,o=t.width;a.height=i*n,a.width=o*n,t.ctx.scale(n,n),a.style.height||a.style.width||(a.style.height=i+"px",a.style.width=o+"px")}},ut.fontString=function(t,e,n){return e+" "+t+"px "+n},ut.longestText=function(t,e,n,a){var i=(a=a||{}).data=a.data||{},o=a.garbageCollect=a.garbageCollect||[];a.font!==e&&(i=a.data={},o=a.garbageCollect=[],a.font=e),t.font=e;var r=0;ut.each(n,(function(e){null!=e&&!0!==ut.isArray(e)?r=ut.measureText(t,i,o,r,e):ut.isArray(e)&&ut.each(e,(function(e){null==e||ut.isArray(e)||(r=ut.measureText(t,i,o,r,e))}))}));var s=o.length/2;if(s>n.length){for(var l=0;la&&(a=o),a},ut.numberOfLabelLines=function(t){var e=1;return ut.each(t,(function(t){ut.isArray(t)&&t.length>e&&(e=t.length)})),e},ut.color=G?function(t){return t instanceof CanvasGradient&&(t=st.global.defaultColor),G(t)}:function(t){return console.error("Color.js not found!"),t},ut.getHoverColor=function(t){return t instanceof CanvasPattern||t instanceof CanvasGradient?t:ut.color(t).saturate(.5).darken(.1).rgbString()}}(),rn._adapters=dn,rn.Animation=vt,rn.animationService=bt,rn.controllers=ue,rn.DatasetController=wt,rn.defaults=st,rn.Element=pt,rn.elements=Wt,rn.Interaction=ve,rn.layouts=Me,rn.platform=Ne,rn.plugins=Ve,rn.Scale=pn,rn.scaleService=Ee,rn.Ticks=un,rn.Tooltip=Je,rn.helpers.each(na,(function(t,e){rn.scaleService.registerScaleType(e,t,t._defaults)})),ka)ka.hasOwnProperty(_a)&&rn.plugins.register(ka[_a]);rn.platform.initialize();var Da=rn;return"undefined"!=typeof window&&(window.Chart=rn),rn.Chart=rn,rn.Legend=ka.legend._element,rn.Title=ka.title._element,rn.pluginService=rn.plugins,rn.PluginBase=rn.Element.extend({}),rn.canvasHelpers=rn.helpers.canvas,rn.layoutService=rn.layouts,rn.LinearScaleBase=yn,rn.helpers.each(["Bar","Bubble","Doughnut","Line","PolarArea","Radar","Scatter"],(function(t){rn[t]=function(e,n){return new rn(e,rn.helpers.merge(n||{},{type:t.charAt(0).toLowerCase()+t.slice(1)}))}})),Da}(function(){try{return n(2)}catch(t){}}())},128:function(t,e,n){"use strict";n.r(e);var a=n(0),i=n.n(a),o=n(4);!function(){var t=n(2),e={prepareGraphData:function(t,n,a,i){var o={};switch(i.toUpperCase()){case"DAYS":o=e.fillGraphDates(t,n,a,i,"YYYY-MM-DD","MM/D","");break;case"MONTHS":o=e.fillGraphDates(t,n,a,i,"YYYY-MM","YY/MM","-01");break;case"YEARS":o=e.fillGraphDates(t,n,a,i,"YYYY","YYYY","-01-01")}return o},fillGraphDates:function(e,n,a,i,o,r,s){for(var l=[],d=[],u=[],c=t({hour:1}).subtract(a,i),h=t({hour:1}),f=c;f.isBefore(h)||f.isSame(h);f.add(1,i))u.push(f.format(o)+s),d.push(f.format(r)),l.push(0);for(var g=0;g'),r=e.data("order");e.on("click","td[data-sort]",(function(){var e=i()(this);return e.hasClass("active")&&(r="ASC"===r?"DESC":"ASC"),t.find('input[name="sort"]').val(e.data("sort")),t.find('input[name="order"]').val(r),t.submit(),!1})),a.prepend(function(t){return"ASC"===t?o.removeClass("fa-caret-down").addClass("fa-caret-up"):o.removeClass("fa-caret-up").addClass("fa-caret-down")}(r)).addClass("active")}))})),i()("#users-table").each((function(){var t=i()("#ban-users-btn"),e=i()("#ban-users-modal"),n=i()("#delete-users-btn"),a=i()("#delete-users-modal"),o=i()(this),r=[],s=function(){var e=(r=o.find("tbody td.selector.active").toArray()).length>0;t.toggleClass("disabled",!e),n.toggleClass("disabled",!e)},l=function(t){t.addClass("active").find("i").attr("class","far fa-dot-circle"),s()},d=function(t){t.removeClass("active").find("i").attr("class","far fa-circle"),s()};o.on("click","tbody td.selector",(function(){var t=i()(this);return t.hasClass("active")?d(t):l(t),!1})).on("click","thead td.selector",(function(t){return o.find(".selector").each((function(){var t=i()(this);t.hasClass("active")?d(t):l(t)})),!1})),s(),e.find("form").on("submit",(function(){e.find("button").addClass("disabled"),i()(this).append(r.map((function(t){return i()(t).data("id")})).map((function(t){return'')})))})),e.on("show.bs.modal",(function(){e.find(".modal-message").html("Do you want to Ban ".concat(r.length," users? This cannot be undone.")),e.find('[name="reason"]').focus()})),e.on("shown.bs.modal",(function(){return e.find('[name="reason"]').focus()})),t.on("click",(function(){return i()(this).parent().toggleClass("show"),e.modal("show"),!1})),a.find("form").on("submit",(function(){a.find("button").addClass("disabled"),i()(this).append(r.map((function(t){return i()(t).data("id")})).map((function(t){return'')})))})),a.on("show.bs.modal",(function(){a.find(".modal-message").html("Do you want to Delete ".concat(r.length," users? This cannot be undone."))})),n.on("click",(function(){return i()(this).parent().toggleClass("show"),a.modal("show"),!1}))})),i()("#flairs-selection").each((function(){var t=parseInt(this.getAttribute("data-user"));i()(this).on("click",'input[type="checkbox"]',(function(e){e.target.setAttribute("disabled","disabled"),i.a.ajax({type:"post",url:"/admin/user/".concat(t,"/toggle/flair"),data:{userId:t,name:e.target.getAttribute("value"),value:e.target.checked?1:0}}).always((function(){e.target.removeAttribute("disabled")}))}))})),i()("#roles-selection").each((function(){var t=parseInt(this.getAttribute("data-user"));i()(this).on("click",'input[type="checkbox"]',(function(e){e.target.setAttribute("disabled","disabled"),i.a.ajax({type:"post",url:"/admin/user/".concat(t,"/toggle/role"),data:{userId:t,name:e.target.getAttribute("value"),value:e.target.checked?1:0}}).always((function(){e.target.removeAttribute("disabled")}))}))})),i()(".color-select").on("change keyup",'input[type="text"]',(function(){i()(this).prev().css({"background-color":this.value,"border-color":this.value})})),i()("#emote-search").each((function(){var t=i()(this),e=i()("#emote-grid").find(".image-grid-item"),n=Object(o.a)(50,!1,(function(){var n=t.val();null!=n&&""!==n.trim()?e.each((function(t,e){i()(e).toggleClass("hidden",!(e.getAttribute("data-prefix").toLowerCase().indexOf(n.toLowerCase())>-1))})):e.removeClass("hidden")}));t.on("keydown",(function(t){return n(t)})),i()(".preview-icon").on("click",(function(){var t=i()(this).data("id"),e=i()("#emotePreviewModal").modal({show:!1});i.a.ajax({method:"get",url:"/admin/emotes/"+t+"/preview",success:function(t){var n=i()(t);e.find(".modal-body").empty().append(n),e.modal({show:!0})}})}))})),i()("#flair-search").each((function(){var t=i()(this),e=i()("#flair-grid").find(".image-grid-item"),n=Object(o.a)(50,!1,(function(){var n=t.val();null!=n&&""!==n.trim()?e.each((function(t,e){i()(e).toggleClass("hidden",!(e.getAttribute("data-name").toLowerCase().indexOf(n.toLowerCase())>-1))})):e.removeClass("hidden")}));t.on("keydown",(function(t){return n(t)}))})),i()("#emoteEditPreviewBtn").on("click",(function(){var t=i()(this).closest("form"),e=i()("#emotePreviewModal").modal({show:!1}),n=t.find("#inputPrefix").val(),a=t.find("#inputStyles").val(),o=t.find("#inputImage").val();i.a.ajax({method:"post",url:"/admin/emotes/preview",data:{prefix:n,styles:a,imageId:o},success:function(t){var n=i()(t);e.find(".modal-body").empty().append(n),e.modal({show:!0})}})})),i()(document).on("dragover",(function(){i()("body").addClass("drag-over")})).on("dragleave drop",(function(){i()("body").removeClass("drag-over")}))}(),function(){var t=i()("#file-input"),e=i()(".image-view.image-view-upload");function n(e,n){var a=new FormData;a.append("files[]",n),e.removeClass("success error").addClass("busy"),function(t,e,n,a){var o=t.data("upload"),r=t.data("cdn"),s=new XMLHttpRequest;s.open("POST",o,!0),s.addEventListener("error",(function(t){return a(t)})),s.addEventListener("abort",(function(){return a("aborted")})),s.addEventListener("load",(function(){try{var e=JSON.parse(s.responseText)[0];if(e.error)return a(e.error);var o=t.find("img")[0]||i()("")[0];o.setAttribute("width",e.width),o.setAttribute("height",e.height),o.setAttribute("src",r+e.name),t.find('input[name="imageId"]').val(e.id),t.prepend(o),n(e)}catch(t){a(t)}})),s.send(e)}(e,a,(function(){e.addClass("success").removeClass("busy")}),(function(){e.addClass("error").removeClass("busy")})),t.value=""}var a=null;e.on("click",(function(e){e.preventDefault(),a=i()(e.currentTarget),t.trigger("click")})).on("dragover",(function(t){t.preventDefault()})).on("drop",(function(t){var e,a,o,r;t.preventDefault(),a=(e=t).originalEvent.dataTransfer,o=i()(e.currentTarget),r=null,a.items?a.items.length>0&&"file"===a.items[0].kind&&(r=a.items[0].getAsFile()):a.files.length>0&&(r=a.files[0]),null!==r&&n(o,r)})),t.on("change",(function(e){e.preventDefault(),n(a,t[0].files[0]),a=null}))}(),i()((function(){i()("#emote-content").each((function(){var t=i()(this).data("id");i()(".delete-item").on("click",(function(){confirm("This cannot be undone. Are you sure?")&&i()("#delete-form").submit()}));var e=!0,n=i()("#inputPrefix"),a=i()("#inputTheme"),o=i()("#emote-form");n.on("change",(function(){e=!0})),o.on("submit",(function(r){e&&(r.preventDefault(),n.removeClass("is-invalid"),i.a.ajax({url:"/admin/emotes/prefix",data:{id:t,theme:a.val(),prefix:n.val()},method:"post",success:function(t){t.exists?(e=!0,n.addClass("is-invalid")):(e=!1,o.submit())},error:function(){e=!0,n.addClass("is-invalid")}}))}))})),i()("#flair-content").each((function(){i()(".delete-item").on("click",(function(){confirm("This cannot be undone. Are you sure?")&&i()("#delete-form").submit()}))})),i()("#theme-content").each((function(){i()(".delete-item").on("click",(function(){confirm("This cannot be undone. Are you sure?")&&i()("#delete-form").submit()}))})),i()("#themeSelect").on("change",(function(){window.location.href="/admin/emotes?theme="+i()(this).val()}))}));var r,s=n(2),l=n.n(s),d=n(10),u=n.n(d);(r=i.a)("#income-graphs").each((function(){var t=l()(),e=r("#income-dates"),n=e.find("span.date");e.on("click",".fa-arrow-left",(function(){t.subtract(1,"months"),n.text(t.format("MMMM YYYY")),e.triggerHandler("date",t)})).on("click",".fa-arrow-right",(function(){t.add(1,"months"),n.text(t.format("MMMM YYYY")),e.triggerHandler("date",t)})),n.text(t.format("MMMM YYYY")),r("#graph4").each((function(){var n=r(this),a=new u.a(n.find("canvas").get(0).getContext("2d"),{type:"bar",data:{labels:[],datasets:[]},options:{maintainAspectRatio:!1,responsive:!0,scales:{xAxes:[{stacked:!0}],yAxes:[{ticks:{beginAtZero:!0},stacked:!0}]}}}),i=function(t){var e=l()(t.format("YYYY-MM-DD")).startOf("month"),n=l()(t.format("YYYY-MM-DD")).endOf("month");r.ajax({url:"/admin/chart/finance/NewTieredSubscribersLastXDays.json?fromDate="+e.format("YYYY-MM-DD")+"&toDate="+n.format("YYYY-MM-DD"),success:function(t){for(var i=[],o=[],r=[],s=[],l=[],d=[],u=e;u.isBefore(n)||u.isSame(n);u.add(1,"days"))d.push(u.format("YYYY-MM-DD")),l.push(u.format("D")),i.push(0),o.push(0),r.push(0),s.push(0);for(var c=0;ct?c():!0!==e&&(i=setTimeout(a?function(){i=void 0}:c,void 0===a?t-d:t)))}return"boolean"!=typeof e&&(a=n,n=e,e=void 0),l.cancel=function(){s(),o=!0},l}function i(t,e,n){return void 0===n?a(t,e,!1):a(t,n,!1!==e)}n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return i}))}},[[128,1,0]]]); \ No newline at end of file diff --git a/static/bigscreen.ed9caa26b60c54b64521.js b/static/bigscreen.3d4fff2acef5a2bb6394.js similarity index 100% rename from static/bigscreen.ed9caa26b60c54b64521.js rename to static/bigscreen.3d4fff2acef5a2bb6394.js diff --git a/static/chat.81ec13ebf502ab19b8fd.js b/static/chat.54838c41c1e57dfefc3f.js similarity index 100% rename from static/chat.81ec13ebf502ab19b8fd.js rename to static/chat.54838c41c1e57dfefc3f.js diff --git a/static/chat.vendor.010a03adb03b4b1c96c6.css b/static/chat.vendor.010a03adb03b4b1c96c6.css new file mode 100644 index 000000000..7a0755b37 --- /dev/null +++ b/static/chat.vendor.010a03adb03b4b1c96c6.css @@ -0,0 +1,3 @@ +@import url(https://fonts.googleapis.com/css?family=Roboto:400,500,600,700); +.icon-command,.msg-command .text:before,.icon-error,.msg-error .text:before,.icon-google,.icon-info,.msg-info .text:before,.icon-status,.msg-status .text:before,.icon-tv,.icon-twitch,.icon-twitter{background-image:url(img/icons.png);background-repeat:no-repeat;display:inline-block}.icon-command,.msg-command .text:before{background-position:-32px -0px;width:16px;height:16px}.icon-error,.msg-error .text:before{background-position:-0px -21px;width:16px;height:16px}.icon-google{background-position:-18px -21px;width:16px;height:16px}.icon-info,.msg-info .text:before{background-position:-50px -0px;width:16px;height:16px}.icon-status,.msg-status .text:before{background-position:-50px -18px;width:16px;height:16px}.icon-tv{background-position:-0px -0px;width:30px;height:19px}.icon-twitch{background-position:-0px -39px;width:16px;height:16px}.icon-twitter{background-position:-18px -39px;width:16px;height:16px}/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace, monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}*,*::before,*::after{box-sizing:inherit}html{box-sizing:border-box}html,body{position:relative;color:#999;background:#080808;font-family:"Roboto",Helvetica,"Trebuchet MS",Verdana,sans-serif;font-size:13px;line-height:1.42857143;text-rendering:optimizeLegibility;font-feature-settings:'kern'}textarea,input,button{font-size:1em;line-height:1.42857143;text-rendering:optimizeLegibility;font-feature-settings:'kern'}html,body{height:100%;margin:0;padding:0}@media only screen and (min-width: 320px){body:not(.pref-fontscale){font-size:13px}}@media only screen and (min-device-pixel-ratio: 2) and (min-width: 320px), only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 320px), only screen and (min-resolution: 192dpi) and (min-width: 320px), only screen and (min-resolution: 2dppx) and (min-width: 320px){body:not(.pref-fontscale){font-size:13px}}@media only screen and (min-width: 700px){body:not(.pref-fontscale){font-size:14px}}@media only screen and (min-device-pixel-ratio: 2) and (min-width: 700px), only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 700px), only screen and (min-resolution: 192dpi) and (min-width: 700px), only screen and (min-resolution: 2dppx) and (min-width: 700px){body:not(.pref-fontscale){font-size:15px}}@media only screen and (min-width: 1300px){body:not(.pref-fontscale){font-size:16px}}@media only screen and (min-device-pixel-ratio: 2) and (min-width: 1300px), only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 1300px), only screen and (min-resolution: 192dpi) and (min-width: 1300px), only screen and (min-resolution: 2dppx) and (min-width: 1300px){body:not(.pref-fontscale){font-size:16px}}body.pref-fontscale[data-fontscale='small']{font-size:14px}body.pref-fontscale[data-fontscale='medium']{font-size:15px}body.pref-fontscale[data-fontscale='large']{font-size:16px}a{color:#4A8ECC;text-decoration:none}a:hover,a:focus{color:#4FB1F4;text-decoration:underline}hr{border:0;margin:1em 0;border-top:1px solid #000;border-bottom:1px solid #222}#chat{min-width:300px;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;position:relative;width:100%;height:100%}#chat-output-frame{-webkit-box-flex:1;flex:1;overflow:hidden;width:100%}.chat-output{width:100%;height:100%}#chat-input-frame{padding:.6em .6em 0 .6em}#chat-input-wrap{position:relative}@-webkit-keyframes whisper-pulse{2%{opacity:1;-webkit-transform:scale(1.3);transform:scale(1.3)}}@keyframes whisper-pulse{2%{opacity:1;-webkit-transform:scale(1.3);transform:scale(1.3)}}#chat-tools-wrap{display:-webkit-box;display:flex;position:relative;-webkit-user-select:none;-ms-user-select:none;user-select:none}#chat-tools-wrap .chat-tools-group{display:-webkit-box;display:flex}#chat-tools-wrap .chat-tools-group:first-child{-webkit-box-flex:1;flex:1}#chat-tools-wrap .chat-tool-btn{width:2.25em;height:2.25em;cursor:pointer;color:#414141;position:relative;text-decoration:none;display:inline-block;border:0.35em solid transparent}#chat-tools-wrap .chat-tool-btn .btn-icon{opacity:0.25;-webkit-transition:opacity 150ms;transition:opacity 150ms;width:100%;height:100%;display:inline-block}#chat-tools-wrap .chat-tool-btn.ping .btn-icon{-webkit-animation:whisper-pulse 1.5s ease-in-out;animation:whisper-pulse 1.5s ease-in-out}#chat-tools-wrap .chat-tool-btn:hover .btn-icon,#chat-tools-wrap .chat-tool-btn.active .btn-icon{opacity:1}#chat-tools-wrap #chat-emoticon-btn .btn-icon{background:transparent url(img/icon-emotes.svg) no-repeat center center;background-size:contain}#chat-tools-wrap #chat-whisper-btn .btn-icon{background:transparent url(img/icon-whispers.svg) no-repeat center center;background-size:contain}#chat-tools-wrap #chat-settings-btn .btn-icon{background:transparent url(img/icon-settings.svg) no-repeat center center;background-size:contain}#chat-tools-wrap #chat-users-btn .btn-icon{background:transparent url(img/icon-users.svg) no-repeat center center;background-size:contain}#chat-input-control{height:4em;position:relative;color:#B9B9B9;background:#111;border:1px solid #222;outline:none;resize:none;margin:0;width:100%;padding:.6em;border-radius:.25em;box-shadow:none;box-sizing:border-box;display:block}#chat-input-control::-webkit-input-placeholder{color:#404040}#chat-input-control:-ms-input-placeholder{color:#404040}#chat-input-control::-ms-input-placeholder{color:#404040}#chat-input-control::placeholder{color:#404040}.chat-lines{font-family:"Roboto",Helvetica,"Trebuchet MS",Verdana,sans-serif;line-height:1.65em;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px;outline:0 !important}#chat-whisper-unread-indicator{left:100%;color:#FFF7F9;font-size:0.75em;position:absolute;vertical-align:text-bottom;margin-left:0.5em;top:6px}.msg-chat{word-wrap:break-word;padding:.2em 1.2em .2em .6em;color:#B9B9B9}.msg-chat .time{font-size:0.8em;color:#414141;padding-right:.3em;display:none}.msg-chat .user{font-weight:500;cursor:pointer;padding-left:.3em;color:#dcdcdc}.msg-chat .chat-user{cursor:pointer;position:relative;z-index:120}.msg-chat .chat-user:hover{text-decoration:underline}.msg-chat .greentext{color:#6CA528}.msg-chat .externallink{border-style:solid;border-color:transparent;border-width:1px 0 1px 0}.msg-chat .externallink{color:#02C2FF;position:relative;z-index:120}.msg-chat .externallink:visited{color:#A66BE5}.msg-chat .externallink:hover,.msg-chat .externallink:focus{color:#08c}.msg-chat .nsfw-link{border-style:dashed;border-color:transparent transparent red transparent;border-width:1px 0 1px 0}.msg-chat .nsfl-link{border-style:dashed;border-color:transparent transparent #FFF000 transparent;border-width:1px 0 1px 0}.msg-user .features{display:-webkit-inline-box;display:inline-flex;vertical-align:text-top;-webkit-box-align:center;align-items:center;margin-left:-.2em}.msg-user .features .flair{margin-left:.2em}.msg-status,.msg-command,.msg-error,.msg-info{white-space:pre-wrap}.msg-status,.msg-command,.msg-error{color:#DEDEDE}.msg-status .text:before,.msg-command .text:before,.msg-info .text:before,.msg-error .text:before{content:'';display:inline-block;vertical-align:text-top;margin-right:.3em}.msg-own{background-color:#151515;color:#DEDEDE}.censored .text{display:none}.censored .ctrl{display:inline-block}.censored .ctrl:after{color:#4A8ECC;cursor:pointer;padding-left:.6em;content:''}.censored .ctrl:hover:after{color:#4FB1F4}.msg-continue .text:before{color:#414141;content:'> '}.msg-continue .features,.msg-continue .user{display:none}.msg-status.msg-continue .text:before,.msg-command.msg-continue .text:before,.msg-info.msg-continue .text:before,.msg-error.msg-continue .text:before,.msg-broadcast.msg-continue .text:before{content:''}.msg-me .text{font-style:italic}.msg-whisper{background-color:#151515}.msg-whisper a.user{background:#4A8ECC;padding:.2em .6em .2em .6em;border-radius:.25em;font-weight:normal;color:white}.msg-whisper a.user:hover{text-decoration:none;color:#4A8ECC;background:white}.msg-tagged{position:relative}.pref-taggedvisibility .msg-tagged{background-color:#232323}.msg-tagged:before{position:absolute;top:0;left:0;bottom:0;min-width:0.45em;display:block;background:#4d4d4d;content:''}.msg-tagged-green:before{background-color:#61BD4F}.msg-tagged-yellow:before{background-color:#F2D600}.msg-tagged-orange:before{background-color:#FFAB4A}.msg-tagged-red:before{background-color:#EB5A46}.msg-tagged-purple:before{background-color:#C377E0}.msg-tagged-blue:before{background-color:#0079BF}.msg-tagged-sky:before{background-color:#00C2E0}.msg-tagged-lime:before{background-color:#51E898}.msg-tagged-pink:before{background-color:#FF80CE}.msg-tagged-black:before{background-color:#4d4d4d}.msg-historical{color:#999}.msg-historical:before{background:none !important}.msg-historical .time{display:inline !important}.chat-output:not(.chat-win-main) .msg-historical{background-color:#151515;color:#DEDEDE}.chat-output:not(.chat-win-main) .msg-historical.msg-own{background:none !important;color:#B9B9B9}.msg-broadcast{text-shadow:1px 1px 3px #000;background-color:#151515;color:#EDEA12 !important;font-size:1.1em;font-weight:400;padding-top:.6em;padding-bottom:.6em}.msg-broadcast time{margin-right:.6em}.msg-highlight{color:#DEDEDE;background-color:#06263E}.msg-highlight time,.msg-highlight .continue{color:#838383}.pref-taggedvisibility .msg-highlight{background-color:#06263E}.focus-user .msg-chat{opacity:0.3}@-webkit-keyframes emote-hit{0%{color:#b91010;font-size:200%}1%{color:#FFF7F9;font-size:190%}2%{color:#b91010;font-size:200%}3%{color:#FFF7F9;font-size:190%}4%{color:#b91010;font-size:200%}100%{color:#FFF7F9;font-size:120%}}@keyframes emote-hit{0%{color:#b91010;font-size:200%}1%{color:#FFF7F9;font-size:190%}2%{color:#b91010;font-size:200%}3%{color:#FFF7F9;font-size:190%}4%{color:#b91010;font-size:200%}100%{color:#FFF7F9;font-size:120%}}@-webkit-keyframes emote-complete{0%{-webkit-transform:translate(-10px, 0);transform:translate(-10px, 0);opacity:0}2%{-webkit-transform:translate(10px, 0);transform:translate(10px, 0);color:white;opacity:1}100%{-webkit-transform:translate(0, 0);transform:translate(0, 0);opacity:1}}@keyframes emote-complete{0%{-webkit-transform:translate(-10px, 0);transform:translate(-10px, 0);opacity:0}2%{-webkit-transform:translate(10px, 0);transform:translate(10px, 0);color:white;opacity:1}100%{-webkit-transform:translate(0, 0);transform:translate(0, 0);opacity:1}}@-webkit-keyframes emote-greyout{0%{-webkit-filter:grayscale(0);filter:grayscale(0)}75%{-webkit-filter:grayscale(0);filter:grayscale(0)}100%{-webkit-filter:grayscale(100%);filter:grayscale(100%)}}@keyframes emote-greyout{0%{-webkit-filter:grayscale(0);filter:grayscale(0)}75%{-webkit-filter:grayscale(0);filter:grayscale(0)}100%{-webkit-filter:grayscale(100%);filter:grayscale(100%)}}.emote{z-index:1;display:inline-block;position:relative;overflow:hidden;text-indent:-999em}.chat-combo{color:#DEDEDE;display:inline-block;position:relative;line-height:2em;padding-left:.6em}.chat-combo i{font-style:normal;display:inline-block;vertical-align:middle}.chat-combo .hit,.chat-combo .combo,.chat-combo .count,.chat-combo .x{text-shadow:-1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000}.chat-combo .combo{display:none;color:#999;font-weight:normal}.chat-combo .hit{color:#FFF7F9;-webkit-animation:emote-hit 600ms 1;animation:emote-hit 600ms 1;font-style:italic;text-transform:uppercase;margin-left:0;letter-spacing:0.05em;display:inline-block}.chat-combo .count{font-size:1.15em;letter-spacing:-0.05em;font-weight:bold}.chat-combo.x5 .count{font-size:150%}.chat-combo.x10 .count{font-size:200%}.chat-combo.x10 .combo{font-weight:bold}.chat-combo.x20 .count{font-size:300%}.chat-combo.x20 .combo{font-weight:bold}.chat-combo.x30 .count{font-size:400%}.chat-combo.x30 .combo{font-weight:bold}.chat-combo.x50 .count{font-size:500%}.chat-combo.x50 .combo{font-weight:bold}.chat-combo.combo-complete.x10,.chat-combo.combo-complete.x20,.chat-combo.combo-complete.x30,.chat-combo.combo-complete.x50{-webkit-animation:emote-greyout 3500ms 1;animation:emote-greyout 3500ms 1;background:transparent url(img/emote-splat.png) no-repeat center center;background-size:100% 100%;-webkit-filter:grayscale(100%);filter:grayscale(100%)}.chat-combo.combo-complete.x10 .combo,.chat-combo.combo-complete.x20 .combo,.chat-combo.combo-complete.x30 .combo,.chat-combo.combo-complete.x50 .combo{color:#FFF7F9;margin-left:.6em}.chat-combo.combo-complete .combo{-webkit-animation:emote-complete 1000ms 1;animation:emote-complete 1000ms 1;display:inline-block}.chat-combo.combo-complete .hit{display:none}.chat-scroll-notify{padding:0.25em 0;color:#838383;background:#222;position:absolute;bottom:-2.5em;left:.6em;right:.6em;text-align:center;cursor:pointer;z-index:130;border-radius:.25em;opacity:0;-webkit-transition:all 250ms;transition:all 250ms;-webkit-transition-timing-function:cubic-bezier(0.6, 0.08, 0.99, 0.54);transition-timing-function:cubic-bezier(0.6, 0.08, 0.99, 0.54)}.chat-scroll-notify:hover{color:#DEDEDE}.chat-unpinned .chat-scroll-notify{-webkit-transition-timing-function:cubic-bezier(0, 0.99, 0.18, 0.99);transition-timing-function:cubic-bezier(0, 0.99, 0.18, 0.99);opacity:1;bottom:0}#chat.chat-autocomplete-in .chat-scroll-notify{display:none !important}#chat.chat-autocomplete-in #chat-input-control{border-radius:0 0 .25em .25em}#chat:not(.pref-autocompletehelper) #chat-auto-complete{display:none !important}#chat-auto-complete{pointer-events:none;-webkit-transition:opacity 750ms;transition:opacity 750ms;-webkit-transition-timing-function:cubic-bezier(0, 0.74, 0.1, 0.99);transition-timing-function:cubic-bezier(0, 0.74, 0.1, 0.99);opacity:0;z-index:131;border-radius:.25em .25em 0 0;position:absolute;font-size:1.1em;line-height:2em;height:2em;top:-2em;left:0;right:0;overflow:hidden;white-space:nowrap}#chat-auto-complete.active{opacity:1;pointer-events:auto}#chat-auto-complete ul{position:absolute;white-space:nowrap;list-style:none;padding:0;margin:0}#chat-auto-complete li{padding:0 .3em;cursor:pointer;text-decoration:none;display:inline-block;color:#838383;background:rgba(3,3,3,0.75)}#chat-auto-complete li:first-child{border-radius:.25em 0 0 0}#chat-auto-complete li:last-child{border-radius:0 .25em 0 0}#chat-auto-complete li:hover{color:#b6b6b6}#chat-auto-complete li.active{color:#DEDEDE}#chat-windows-select{padding-top:0.5em;background:#333;white-space:nowrap;display:-webkit-box;display:flex;z-index:100}#chat-windows-select .tab{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;border-radius:.25em .25em 0 0;color:#838383;-webkit-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;font-size:1em;padding:.3em .9em}#chat-windows-select .tab-close{background:transparent url(img/icon-close.svg) no-repeat center center;background-size:contain;width:1em;height:1em;opacity:0.25;margin-left:.6em;display:none}#chat-windows-select .tab-close:hover{opacity:1}#chat-windows-select .tab:hover,#chat-windows-select .tab.unread{color:#DEDEDE}#chat-windows-select .tab.active{color:#DEDEDE;background:#030303;margin-left:0;margin-right:0;overflow:visible;text-overflow:unset;min-width:auto;display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center}#chat-windows-select .tab.active .tab-close{display:inline-block}#chat-windows-select .win-main{width:3em;flex-shrink:0}#chat-windows-select .win-main .tab-close{display:none !important}#chat-windows-select .win-main span{display:none}#chat-windows-select .win-main .dgg-icon{background:transparent url(img/dgg-icon.svg) no-repeat center center;background-size:contain;display:block;width:100%;height:100%}.chat-menu{display:none;position:absolute;z-index:220;height:auto;bottom:6.3em;max-width:75%;min-width:300px;width:33.3333%;right:0;top:0}.chat-menu .toolbar{position:relative;border-bottom:1px solid #333;top:auto;left:auto}.chat-menu .toolbar h5{padding:.6em;font-size:1.1em;font-weight:normal;color:#999;-webkit-box-align:center;align-items:center;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:-webkit-box;display:flex;margin:0}.chat-menu .toolbar span{-webkit-box-flex:1;flex:1;line-height:1.25em;display:inline-block}.chat-menu .toolbar .chat-menu-close{width:1em;height:1em;opacity:0.5;font-size:1.2em;display:inline-block;background:transparent url(img/icon-close.svg) no-repeat center center;background-size:contain;cursor:pointer}.chat-menu .toolbar .chat-menu-close:hover{opacity:1}.chat-menu .chat-menu-inner{height:100%;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;background-color:#222}.chat-menu .scrollable{-webkit-box-flex:1;flex:1}.chat-menu.active{display:block}.chat-menu.left{left:0;right:auto}.chat-menu.left .chat-menu-inner{border-bottom-right-radius:.25em}.chat-menu.right{right:0;left:auto}.chat-menu.right .chat-menu-inner{border-bottom-left-radius:.25em}#chat-emote-list .content{text-align:center;outline:0}#chat-emote-list .emote-group{display:-webkit-box;display:flex;flex-wrap:wrap;-webkit-box-pack:center;justify-content:center;margin:.9em}#chat-emote-list .emote-group:not(.disabled) .emote:hover{cursor:pointer}#chat-emote-list .emote-item{-webkit-user-select:none;-ms-user-select:none;user-select:none;padding:.6em}#chat-whisper-users .content>ul{margin:0;padding:.6em 0}#chat-whisper-users .conversation{list-style:none;position:relative;cursor:pointer;padding-left:.6em;display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center}#chat-whisper-users .conversation .user{color:#4A8ECC;display:block}#chat-whisper-users .conversation .user:hover{color:#4FB1F4}#chat-whisper-users .conversation .user:hover .badge{color:#DEDEDE}#chat-whisper-users .conversation .badge{font-size:0.8em;padding:0 .6em;display:inline-block;background:#333;border-radius:50%;margin:.2em 0;color:#B9B9B9}#chat-whisper-users .conversation .badge,#chat-whisper-users .conversation .remove{float:right;margin-right:.6em}#chat-whisper-users .conversation .remove{opacity:0.25;background:transparent url(img/icon-close.svg) no-repeat center center;background-size:contain;display:inline-block;text-decoration:none;text-align:center;line-height:1.3em;width:1.3em;height:1.3em}#chat-whisper-users .conversation .remove:hover{opacity:1}#chat-whisper-users .unread-0 .badge{display:none}#chat-whisper-users .unread-0 .user,#chat-whisper-users .unread-0 .user:hover{color:#999}#chat-whisper-users .empty{color:#999;margin:.9em}#chat-user-list .user{margin:0;cursor:pointer;padding:0 .9em;text-decoration:none;visibility:visible;-webkit-box-align:center;align-items:center;display:-webkit-box;display:flex}#chat-user-list .user .whisper-nick{visibility:hidden;margin-right:.2em;display:inline-block;opacity:0.25;background:transparent url(img/icon-share.svg) no-repeat center center;background-size:contain;width:1em;height:1em}#chat-user-list .user .whisper-nick:hover{opacity:1}#chat-user-list .user:hover .whisper-nick{visibility:visible}#chat-user-list .content{padding:.9em 0}#chat-user-list .scrollable{max-height:calc(100% - 3em)}#chat-user-list.search-in .user{display:none}#chat-user-list.search-in .user.found{display:block}#chat-user-list input{padding:.9em .9em;border:none;background:none;border-radius:0}#chat-settings #chat-settings-form{margin:.9em 0}#chat-settings .form-group{margin:.9em .9em;display:block;position:relative}#chat-settings h4{font-size:0.9em;margin-top:1.8em;margin-bottom:.9em;padding-left:.9em;color:#494949;text-transform:uppercase;font-weight:600}#chat-settings label{display:inline-block;font-weight:normal;max-width:100%;margin-bottom:.6em}#chat-settings .checkbox label{margin-bottom:0;font-weight:400;max-width:100%;cursor:pointer;display:-webkit-box;display:flex;justify-items:center;-webkit-box-align:center;align-items:center}#chat-settings .checkbox input{margin:0 .3em 0 0;line-height:normal;box-sizing:border-box;padding:0}#chat-settings select{border-radius:.25em;padding:.3em;width:100%}#chat-login-screen{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center;background:rgba(3,3,3,0.75);position:absolute;text-align:center;top:0;left:0;right:0;bottom:0}#chat-login-screen h2{font-size:2.5em;font-weight:normal;margin:0}#chat-login-screen p{margin:1em 0 1.5em 0}@-webkit-keyframes spin{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spin{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}#chat-loading{opacity:0.2;display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center;position:absolute;top:0;left:0;bottom:0;right:0}#chat-loading .chat-loading-icon{width:4em;height:4em;display:inline-block;-webkit-animation:spin 2s linear infinite;animation:spin 2s linear infinite;background:transparent url(img/icon-settings.svg) no-repeat center center;background-size:contain}.pref-showtime .time{display:inline}.pref-hideflairicons .features{display:none}.pref-autocompletehelper #chat-auto-complete.active{display:block}.nano{position:relative;width:100%;height:100%;overflow:hidden}.nano>.nano-content{overflow-anchor:none;position:absolute;overflow:scroll;overflow-x:hidden;top:0;right:0;bottom:0;left:0}.nano>.nano-content:focus{outline:none}.nano>.nano-content::-webkit-scrollbar{display:none}.has-scrollbar>.nano-content::-webkit-scrollbar{display:block}.nano>.nano-pane{background:transparent;position:absolute;width:.6em;right:0;top:0;bottom:0;visibility:hidden \9;opacity:0.01;-webkit-transition:0.2s;transition:0.2s}.nano>.nano-pane>.nano-slider{opacity:0.5;background:#f5f5f5;position:relative;border-radius:0}.nano:hover>.nano-pane,.nano-pane.active,.nano-pane.flashed{visibility:visible \9;opacity:0.99}.form-control{color:#B9B9B9;background:#030303;border:1px solid #1a1a1a}.form-control:focus{color:#DEDEDE;background:#030303;border:1px solid #292929;box-shadow:none;outline:none}.form-control::-webkit-input-placeholder{color:#404040}.form-control:-ms-input-placeholder{color:#404040}.form-control::-ms-input-placeholder{color:#404040}.form-control[disabled],.form-control[readonly],.form-control::placeholder{color:#404040}.form-control[type='text'],textarea.form-control{width:100%}button.btn{display:inline-block;padding:.6em .9em;margin-bottom:0;font-weight:normal;text-align:center;white-space:nowrap;vertical-align:middle;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:.25em}.btn-primary{color:#DEDEDE;background-color:#4A8ECC;border-color:#4A8ECC}.btn-default{color:#333;background-color:#fff;border-color:#eee}@-webkit-keyframes msg-slide-in{0%{opacity:0}100%{opacity:1}}@keyframes msg-slide-in{0%{opacity:0}100%{opacity:1}}.onstreamchat .chat-lines{font-size:1.5em}.onstreamchat #chat,.onstreamchat .msg-chat,.onstreamchat .msg-chat:before,.onstreamchat .greentext{background:none !important}.onstreamchat .chat-combo{background-image:none !important}.onstreamchat .chat-lines{font-family:'Roboto', Helvetica, 'Trebuchet MS', Verdana, sans-serif;font-weight:500 !important}.onstreamchat #chat-output-frame{margin:0}.onstreamchat time,.onstreamchat .time,.onstreamchat .features,.onstreamchat .msg-ui,.onstreamchat .msg-info,.onstreamchat .msg-chat .text:before{display:none !important}.onstreamchat .continue,.onstreamchat .nano-slider{visibility:hidden !important}.onstreamchat .chat-lines,.onstreamchat .msg-chat,.onstreamchat .greentext,.onstreamchat .combo{color:#DEDEDE}.onstreamchat .msg-chat{margin:0;padding:1px 20px 1px 5px;text-shadow:-1px -1px 0 rgba(0,0,0,0.75),1px -1px 1px rgba(0,0,0,0.75),-1px 1px 0 rgba(0,0,0,0.75),1px 1px 1px rgba(0,0,0,0.75);letter-spacing:0.03em}.onstreamchat .msg-user,.onstreamchat .msg-status{-webkit-animation:msg-slide-in 0.15s cubic-bezier(0.72, 0.03, 0.45, 1);animation:msg-slide-in 0.15s cubic-bezier(0.72, 0.03, 0.45, 1)}.onstreamchat a.externallink,.onstreamchat a.externallink:hover{color:#4FB1F4}body.pref-fontscale[data-fontscale='1'] .onstreamchat{font-size:14px}body.pref-fontscale[data-fontscale='2'] .onstreamchat{font-size:15px}body.pref-fontscale[data-fontscale='3'] .onstreamchat{font-size:16px}body.pref-fontscale[data-fontscale='4'] .onstreamchat{font-size:18px}body.pref-fontscale[data-fontscale='5'] .onstreamchat{font-size:20px}body.pref-fontscale[data-fontscale='6'] .onstreamchat{font-size:22px}body.pref-fontscale[data-fontscale='7'] .onstreamchat{font-size:24px}body.pref-fontscale[data-fontscale='8'] .onstreamchat{font-size:26px}body.pref-fontscale[data-fontscale='9'] .onstreamchat{font-size:32px}body.pref-fontscale[data-fontscale='10'] .onstreamchat{font-size:52px}#chat-vote-frame{display:none;-webkit-transform:translateY(-100%);transform:translateY(-100%);-webkit-transition:-webkit-transform 250ms ease-out;transition:-webkit-transform 250ms ease-out;transition:transform 250ms ease-out;transition:transform 250ms ease-out, -webkit-transform 250ms ease-out}#chat-vote-frame.active{-webkit-transform:translateY(0);transform:translateY(0);display:block}#chat-vote-frame .vote-frame{padding:0.5em 0.75em;background:#2f2f2f;border-radius:4px;margin:4px;color:#DEDEDE}#chat-vote-frame .vote-header{display:-webkit-box;display:flex}#chat-vote-frame .vote-label{color:#666;margin:0.75em 0 0 0;font-size:0.9em;display:block}#chat-vote-frame .vote-question{display:block;margin:0 0 0.5em 0;-webkit-box-flex:1;flex:1}#chat-vote-frame .vote-question strong{margin-left:0.5em;background:#222;padding:0 0.3em;border-radius:4px}#chat-vote-frame .opt{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center}#chat-vote-frame .opt-info{border-radius:4px;margin-right:0.25em;padding:0 0.25em}#chat-vote-frame .opt-bar{background-color:#222;overflow:hidden;padding:4px 4px 0 4px;-webkit-box-flex:1;flex:1}#chat-vote-frame .opt:hover,#chat-vote-frame .opt:active{cursor:pointer}#chat-vote-frame .opt:hover .opt-bar,#chat-vote-frame .opt:active .opt-bar{background-color:#111}#chat-vote-frame .opt:first-child .opt-bar{border-radius:6px 6px 0 0}#chat-vote-frame .opt:last-child .opt-bar{border-radius:0 0 6px 6px;padding:4px}#chat-vote-frame .opt-bar-inner{min-height:1.4em;box-shadow:1px 1px 3px rgba(0,0,0,0.1);-webkit-transition:all 750ms;transition:all 750ms;background-color:#850000;border-radius:4px;font-size:0.85em;color:#DEDEDE;padding:0 0.25em;text-align:end}#chat-vote-frame .opt-marked .opt-info{background-color:#850000;color:#DEDEDE}#chat-vote-frame .vote-completed .opt .opt-info{color:#666}#chat-vote-frame .vote-completed .opt .opt-bar-inner{background-color:#333;color:#666}#chat-vote-frame .vote-completed .opt.opt-winner .opt-info{color:#999}#chat-vote-frame .vote-completed .opt.opt-winner .opt-bar-inner{-webkit-transition:background-color 750ms;transition:background-color 750ms;background-color:#4FB1F4;color:#DEDEDE}#chat-vote-frame .vote-completed .opt.opt-marked .opt-info{background-color:#850000;color:#DEDEDE}#chat-vote-frame .vote-completed .opt-choice{opacity:0.25}#chat-vote-frame .vote-completed .opt-choice.opt-winner{opacity:1}#chat-vote-frame .vote-completed .opt-choice.opt-winner strong{background-color:#4A8ECC}#chat-vote-frame .vote-close{width:1em;height:1em;opacity:0.5;font-size:1.2em;display:inline-block;background:transparent url(img/icon-close.svg) no-repeat center center;background-size:contain;cursor:pointer}#chat-vote-frame .vote-close:hover{opacity:1}#chat.onstreamchat #chat-vote-frame{display:none !important} + diff --git a/static/chat.vendor.32a21117ec538f592a5a.js b/static/chat.vendor.32a21117ec538f592a5a.js new file mode 100644 index 000000000..6b58bb36d --- /dev/null +++ b/static/chat.vendor.32a21117ec538f592a5a.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{11:function(t,e,s){"use strict";s.d(e,"b",(function(){return h})),s.d(e,"c",(function(){return c})),s.d(e,"d",(function(){return u})),s.d(e,"e",(function(){return l})),s.d(e,"f",(function(){return d})),s.d(e,"a",(function(){return m}));var i=s(0),n=s.n(i),o=s(3);const a="(?:"+[...s(122)].join("|")+")",r=document.createElement("div");class u{format(t,e){return r.textContent=e,r.innerHTML}}class h{format(t,e,s=null){let i=s&&s.user&&s.user.hasFeature(o.a.TWITCHSUB)||!s||!s.user?t.emoteRegexTwitch:t.emoteRegexNormal;return null!=i?e.replace(i,'$1
$2
'):e}}class c{format(t,e,s=null){return s.user&&0===e.indexOf(">")&&s.user.hasAnyFeatures(o.a.SUBSCRIBER)&&(e=`${e}`),e}}class l{format(t,e,s=null){return s&&s.mentioned&&s.mentioned.length>0?e.replace(new RegExp(`((?:^|\\s)@?)(${s.mentioned.join("|")})(?=$|\\s|[.?!,])`,"igm"),'$1$2'):e}}class d{constructor(){const t="\\u0024\\u00A2-\\u00A5\\u058F\\u060B\\u09F2\\u09F3\\u09FB\\u0AF1\\u0BF9\\u0E3F\\u17DB\\u20A0-\\u20B9\\uA838\\uFDFC\\uFE69\\uFF04\\uFFE0\\uFFE1\\uFFE5\\uFFE6",e="\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC"+"\\u0030-\\u0039\\u00B2\\u00B3\\u00B9\\u00BC-\\u00BE\\u0660-\\u0669\\u06F0-\\u06F9\\u07C0-\\u07C9\\u0966-\\u096F\\u09E6-\\u09EF\\u09F4-\\u09F9\\u0A66-\\u0A6F\\u0AE6-\\u0AEF\\u0B66-\\u0B6F\\u0B72-\\u0B77\\u0BE6-\\u0BF2\\u0C66-\\u0C6F\\u0C78-\\u0C7E\\u0CE6-\\u0CEF\\u0D66-\\u0D75\\u0E50-\\u0E59\\u0ED0-\\u0ED9\\u0F20-\\u0F33\\u1040-\\u1049\\u1090-\\u1099\\u1369-\\u137C\\u16EE-\\u16F0\\u17E0-\\u17E9\\u17F0-\\u17F9\\u1810-\\u1819\\u1946-\\u194F\\u19D0-\\u19DA\\u1A80-\\u1A89\\u1A90-\\u1A99\\u1B50-\\u1B59\\u1BB0-\\u1BB9\\u1C40-\\u1C49\\u1C50-\\u1C59\\u2070\\u2074-\\u2079\\u2080-\\u2089\\u2150-\\u2182\\u2185-\\u2189\\u2460-\\u249B\\u24EA-\\u24FF\\u2776-\\u2793\\u2CFD\\u3007\\u3021-\\u3029\\u3038-\\u303A\\u3192-\\u3195\\u3220-\\u3229\\u3248-\\u324F\\u3251-\\u325F\\u3280-\\u3289\\u32B1-\\u32BF\\uA620-\\uA629\\uA6E6-\\uA6EF\\uA830-\\uA835\\uA8D0-\\uA8D9\\uA900-\\uA909\\uA9D0-\\uA9D9\\uAA50-\\uAA59\\uABF0-\\uABF9\\uFF10-\\uFF19",s=e+"/\\-+=_&~*%@|#.,:;'?!"+t+"\\u005E\\u0060\\u00A8\\u00AF\\u00B4\\u00B8\\u02C2-\\u02C5\\u02D2-\\u02DF\\u02E5-\\u02EB\\u02ED\\u02EF-\\u02FF\\u0375\\u0384\\u0385\\u1FBD\\u1FBF-\\u1FC1\\u1FCD-\\u1FCF\\u1FDD-\\u1FDF\\u1FED-\\u1FEF\\u1FFD\\u1FFE\\u309B\\u309C\\uA700-\\uA716\\uA720\\uA721\\uA789\\uA78A\\uFBB2-\\uFBC1\\uFF3E\\uFF40\\uFFE3"+"\\u00A6\\u00A9\\u00AE\\u00B0\\u0482\\u060E\\u060F\\u06DE\\u06E9\\u06FD\\u06FE\\u07F6\\u09FA\\u0B70\\u0BF3-\\u0BF8\\u0BFA\\u0C7F\\u0D79\\u0F01-\\u0F03\\u0F13\\u0F15-\\u0F17\\u0F1A-\\u0F1F\\u0F34\\u0F36\\u0F38\\u0FBE-\\u0FC5\\u0FC7-\\u0FCC\\u0FCE\\u0FCF\\u0FD5-\\u0FD8\\u109E\\u109F\\u1390-\\u1399\\u1940\\u19DE-\\u19FF\\u1B61-\\u1B6A\\u1B74-\\u1B7C\\u2100\\u2101\\u2103-\\u2106\\u2108\\u2109\\u2114\\u2116\\u2117\\u211E-\\u2123\\u2125\\u2127\\u2129\\u212E\\u213A\\u213B\\u214A\\u214C\\u214D\\u214F\\u2195-\\u2199\\u219C-\\u219F\\u21A1\\u21A2\\u21A4\\u21A5\\u21A7-\\u21AD\\u21AF-\\u21CD\\u21D0\\u21D1\\u21D3\\u21D5-\\u21F3\\u2300-\\u2307\\u230C-\\u231F\\u2322-\\u2328\\u232B-\\u237B\\u237D-\\u239A\\u23B4-\\u23DB\\u23E2-\\u23F3\\u2400-\\u2426\\u2440-\\u244A\\u249C-\\u24E9\\u2500-\\u25B6\\u25B8-\\u25C0\\u25C2-\\u25F7\\u2600-\\u266E\\u2670-\\u26FF\\u2701-\\u2767\\u2794-\\u27BF\\u2800-\\u28FF\\u2B00-\\u2B2F\\u2B45\\u2B46\\u2B50-\\u2B59\\u2CE5-\\u2CEA\\u2E80-\\u2E99\\u2E9B-\\u2EF3\\u2F00-\\u2FD5\\u2FF0-\\u2FFB\\u3004\\u3012\\u3013\\u3020\\u3036\\u3037\\u303E\\u303F\\u3190\\u3191\\u3196-\\u319F\\u31C0-\\u31E3\\u3200-\\u321E\\u322A-\\u3247\\u3250\\u3260-\\u327F\\u328A-\\u32B0\\u32C0-\\u32FE\\u3300-\\u33FF\\u4DC0-\\u4DFF\\uA490-\\uA4C6\\uA828-\\uA82B\\uA836\\uA837\\uA839\\uAA77-\\uAA79\\uFDFD\\uFFE4\\uFFE8\\uFFED\\uFFEE\\uFFFC\\uFFFD",i="(?:"+("(?:"+("["+e+"](?:["+e+"\\-]*["+e+"])?")+"\\.)+")+a+"|(?:\\b(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\\b))",o="(?:["+s+"]*(?:"+("\\(["+s+"]*(?:\\(["+s+"]*\\)["+s+"]*)*\\)"+"|"+("\\[["+s+"]*(?:\\[["+s+"]*\\]["+s+"]*)*\\]"))+"|["+(e+"/\\-+=_&~*%;"+t)+"])+)+",r="\\b(https?|ftp|wss?)://"+o+"|"+("(?:"+i+"(?::[0-9]+)?/"+("(?:"+o+"|/|\\b|$)")+")|(?:"+i+"(?::[0-9]+)?(?:\\b|$))");this.linkregex=new RegExp(r,"gi"),this._elem=n()("
")}encodeUrl(t){return t.replace(/&/g,"&").replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,(function(t){return"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";"})).replace(/([^\#-~| |!])/g,(function(t){return"&#"+t.charCodeAt(0)+";"})).replace(//g,">")}format(t,e,s=null){if(!e)return;const i=this;let n="";return/\b(?:NSFL)\b/i.test(e)?n="nsfl-link":/\b(?:NSFW|SPOILER)\b/i.test(e)&&(n="nsfw-link"),e.replace(i.linkregex,(function(t,e){e=e?"":"http://";const s=i._elem.html(t).text(),o=s.match(i.linkregex);if(o){t=i.encodeUrl(o[0]);const a=i.encodeUrl(s.substring(o[0].length));return`${t}${a}`}return t}))}}class m{constructor(){try{const t=(window.top||window.parent||window).location;this.url=(t.protocol+"//"+t.host+t.pathname+(t.search?t.search:"")).replace(/\/$/,"")}catch(t){console.error(t)}this.bigscreenregex=new RegExp(/(^|\s)((#twitch|#twitch-vod|#twitch-clip|#youtube)\/(?:[A-z0-9_\-]{3,64}))\b/,"g")}format(t,e){return e.replace(this.bigscreenregex,'$1$2')}}},122:function(t){t.exports=JSON.parse('["NORTHWESTERNMUTUAL","TRAVELERSINSURANCE","AMERICANEXPRESS","KERRYPROPERTIES","SANDVIKCOROMANT","AFAMILYCOMPANY","AMERICANFAMILY","BANANAREPUBLIC","CANCERRESEARCH","COOKINGCHANNEL","KERRYLOGISTICS","WEATHERCHANNEL","INTERNATIONAL","LIFEINSURANCE","SPREADBETTING","TRAVELCHANNEL","WOLTERSKLUWER","CONSTRUCTION","LPLFINANCIAL","SCHOLARSHIPS","VERSICHERUNG","ACCOUNTANTS","BARCLAYCARD","BLACKFRIDAY","BLOCKBUSTER","BRIDGESTONE","CALVINKLEIN","CONTRACTORS","CREDITUNION","ENGINEERING","ENTERPRISES","FOODNETWORK","INVESTMENTS","KERRYHOTELS","LAMBORGHINI","MOTORCYCLES","OLAYANGROUP","PHOTOGRAPHY","PLAYSTATION","PRODUCTIONS","PROGRESSIVE","REDUMBRELLA","RIGHTATHOME","WILLIAMHILL","ACCOUNTANT","APARTMENTS","ASSOCIATES","BASKETBALL","BNPPARIBAS","BOEHRINGER","CAPITALONE","CONSULTING","CREDITCARD","CUISINELLA","EUROVISION","EXTRASPACE","FOUNDATION","HEALTHCARE","IMMOBILIEN","INDUSTRIES","MANAGEMENT","MITSUBISHI","NATIONWIDE","NEWHOLLAND","NEXTDIRECT","ONYOURSIDE","PROPERTIES","PROTECTION","PRUDENTIAL","REALESTATE","REPUBLICAN","RESTAURANT","SCHAEFFLER","SWIFTCOVER","TATAMOTORS","TECHNOLOGY","TELEFONICA","UNIVERSITY","VISTAPRINT","VLAANDEREN","VOLKSWAGEN","ACCENTURE","ALFAROMEO","ALLFINANZ","AMSTERDAM","ANALYTICS","AQUARELLE","BARCELONA","BLOOMBERG","CHRISTMAS","COMMUNITY","DIRECTORY","EDUCATION","EQUIPMENT","FAIRWINDS","FINANCIAL","FIRESTONE","FRESENIUS","FRONTDOOR","FUJIXEROX","FURNITURE","GOLDPOINT","HISAMITSU","HOMEDEPOT","HOMEGOODS","HOMESENSE","HONEYWELL","INSTITUTE","INSURANCE","KUOKGROUP","LADBROKES","LANCASTER","LANDROVER","LIFESTYLE","MARKETING","MARSHALLS","MELBOURNE","MICROSOFT","PANASONIC","PASSAGENS","PRAMERICA","RICHARDLI","SCJOHNSON","SHANGRILA","SOLUTIONS","STATEBANK","STATEFARM","STOCKHOLM","TRAVELERS","VACATIONS","YODOBASHI","ABUDHABI","AIRFORCE","ALLSTATE","ATTORNEY","BARCLAYS","BAREFOOT","BARGAINS","BASEBALL","BOUTIQUE","BRADESCO","BROADWAY","BRUSSELS","BUDAPEST","BUILDERS","BUSINESS","CAPETOWN","CATERING","CATHOLIC","CHRYSLER","CIPRIANI","CITYEATS","CLEANING","CLINIQUE","CLOTHING","COMMBANK","COMPUTER","DELIVERY","DELOITTE","DEMOCRAT","DIAMONDS","DISCOUNT","DISCOVER","DOWNLOAD","ENGINEER","ERICSSON","ESURANCE","ETISALAT","EVERBANK","EXCHANGE","FEEDBACK","FIDELITY","FIRMDALE","FOOTBALL","FRONTIER","GOODYEAR","GRAINGER","GRAPHICS","GUARDIAN","HDFCBANK","HELSINKI","HOLDINGS","HOSPITAL","INFINITI","IPIRANGA","ISTANBUL","JPMORGAN","LIGHTING","LUNDBECK","MARRIOTT","MASERATI","MCKINSEY","MEMORIAL","MERCKMSD","MORTGAGE","MOVISTAR","OBSERVER","PARTNERS","PHARMACY","PICTURES","PLUMBING","PROPERTY","REDSTONE","RELIANCE","SAARLAND","SAMSCLUB","SECURITY","SERVICES","SHOPPING","SHOWTIME","SOFTBANK","SOFTWARE","STCGROUP","SUPPLIES","SYMANTEC","TRAINING","UCONNECT","VANGUARD","VENTURES","VERISIGN","WOODSIDE","YOKOHAMA","ABOGADO","ACADEMY","AGAKHAN","ALIBABA","ANDROID","ATHLETA","AUCTION","AUDIBLE","AUSPOST","AVIANCA","BANAMEX","BAUHAUS","BENTLEY","BESTBUY","BOOKING","BROTHER","BUGATTI","CAPITAL","CARAVAN","CAREERS","CARTIER","CHANNEL","CHARITY","CHINTAI","CITADEL","CLUBMED","COLLEGE","COLOGNE","COMCAST","COMPANY","COMPARE","CONTACT","COOKING","CORSICA","COUNTRY","COUPONS","COURSES","CRICKET","CRUISES","DENTIST","DIGITAL","DOMAINS","EXPOSED","EXPRESS","FARMERS","FASHION","FERRARI","FERRERO","FINANCE","FISHING","FITNESS","FLIGHTS","FLORIST","FLOWERS","FORSALE","FROGANS","FUJITSU","GALLERY","GENTING","GODADDY","GROCERY","GUITARS","HAMBURG","HANGOUT","HITACHI","HOLIDAY","HOSTING","HOTELES","HOTMAIL","HYUNDAI","ISELECT","ISMAILI","JEWELRY","JUNIPER","KITCHEN","KOMATSU","LACAIXA","LANCOME","LANXESS","LASALLE","LATROBE","LECLERC","LIAISON","LIMITED","LINCOLN","MARKETS","METLIFE","MONSTER","NETBANK","NETFLIX","NETWORK","NEUSTAR","OKINAWA","OLDNAVY","ORGANIC","ORIGINS","PHILIPS","PIONEER","POLITIE","REALTOR","RECIPES","RENTALS","REVIEWS","REXROTH","SAMSUNG","SANDVIK","SCHMIDT","SCHWARZ","SCIENCE","SHIKSHA","SHRIRAM","SINGLES","SPIEGEL","STAPLES","STARHUB","STORAGE","SUPPORT","SURGERY","SYSTEMS","TEMASEK","THEATER","THEATRE","TICKETS","TIFFANY","TOSHIBA","TRADING","WALMART","WANGGOU","WATCHES","WEATHER","WEBSITE","WEDDING","WHOSWHO","WINDOWS","WINNERS","XFINITY","YAMAXUN","YOUTUBE","ZUERICH","ABARTH","ABBOTT","ABBVIE","ACTIVE","AFRICA","AGENCY","AIRBUS","AIRTEL","ALIPAY","ALSACE","ALSTOM","ANQUAN","ARAMCO","AUTHOR","BAYERN","BEAUTY","BERLIN","BHARTI","BLANCO","BOSTIK","BOSTON","BROKER","CAMERA","CAREER","CASEIH","CASINO","CENTER","CHANEL","CHROME","CHURCH","CIRCLE","CLAIMS","CLINIC","COFFEE","COMSEC","CONDOS","COUPON","CREDIT","CRUISE","DATING","DATSUN","DEALER","DEGREE","DENTAL","DESIGN","DIRECT","DOCTOR","DUNLOP","DUPONT","DURBAN","EMERCK","ENERGY","ESTATE","EVENTS","EXPERT","FAMILY","FLICKR","FUTBOL","GALLUP","GARDEN","GEORGE","GIVING","GLOBAL","GOOGLE","GRATIS","HEALTH","HERMES","HIPHOP","HOCKEY","HOTELS","HUGHES","IMAMAT","INSURE","INTUIT","JAGUAR","JOBURG","JUEGOS","KAUFEN","KINDER","KINDLE","KOSHER","LANCIA","LATINO","LAWYER","LEFRAK","LIVING","LOCKER","LONDON","LUXURY","MADRID","MAISON","MAKEUP","MARKET","MATTEL","MOBILE","MOBILY","MONASH","MORMON","MOSCOW","MUSEUM","MUTUAL","NAGOYA","NATURA","NISSAN","NISSAY","NORTON","NOWRUZ","OFFICE","OLAYAN","ONLINE","ORACLE","ORANGE","OTSUKA","PFIZER","PHOTOS","PHYSIO","PIAGET","PICTET","QUEBEC","RACING","REALTY","REISEN","REPAIR","REPORT","REVIEW","ROCHER","ROGERS","RYUKYU","SAFETY","SAKURA","SANOFI","SCHOOL","SCHULE","SEARCH","SECURE","SELECT","SHOUJI","SOCCER","SOCIAL","STREAM","STUDIO","SUPPLY","SUZUKI","SWATCH","SYDNEY","TAIPEI","TAOBAO","TARGET","TATTOO","TENNIS","TIENDA","TJMAXX","TKMAXX","TOYOTA","TRAVEL","UNICOM","VIAJES","VIKING","VILLAS","VIRGIN","VISION","VOTING","VOYAGE","VUELOS","WALTER","WARMAN","WEBCAM","XIHUAN","YACHTS","YANDEX","ZAPPOS","ACTOR","ADULT","AETNA","AMFAM","AMICA","APPLE","ARCHI","AUDIO","AUTOS","AZURE","BAIDU","BEATS","BIBLE","BINGO","BLACK","BOATS","BOSCH","BUILD","CANON","CARDS","CHASE","CHEAP","CISCO","CITIC","CLICK","CLOUD","COACH","CODES","CROWN","CYMRU","DABUR","DANCE","DEALS","DELTA","DODGE","DRIVE","DUBAI","EARTH","EDEKA","EMAIL","EPOST","EPSON","FAITH","FEDEX","FINAL","FOREX","FORUM","GALLO","GAMES","GIFTS","GIVES","GLADE","GLASS","GLOBO","GMAIL","GREEN","GRIPE","GROUP","GUCCI","GUIDE","HOMES","HONDA","HORSE","HOUSE","HYATT","IKANO","INTEL","IRISH","IVECO","JETZT","KOELN","KYOTO","LAMER","LEASE","LEGAL","LEXUS","LILLY","LINDE","LIPSY","LIXIL","LOANS","LOCUS","LOTTE","LOTTO","LUPIN","MACYS","MANGO","MEDIA","MIAMI","MONEY","MOPAR","MOVIE","NADEX","NEXUS","NIKON","NINJA","NOKIA","NOWTV","OMEGA","OSAKA","PARIS","PARTS","PARTY","PHONE","PHOTO","PIZZA","PLACE","POKER","PRAXI","PRESS","PRIME","PROMO","QUEST","RADIO","REHAB","REISE","RICOH","ROCKS","RODEO","RUGBY","SALON","SENER","SEVEN","SHARP","SHELL","SHOES","SKYPE","SLING","SMART","SMILE","SOLAR","SPACE","SPORT","STADA","STORE","STUDY","STYLE","SUCKS","SWISS","TATAR","TIRES","TIROL","TMALL","TODAY","TOKYO","TOOLS","TORAY","TOTAL","TOURS","TRADE","TRUST","TUNES","TUSHU","UBANK","VEGAS","VIDEO","VODKA","VOLVO","WALES","WATCH","WEBER","WEIBO","WORKS","WORLD","XEROX","YAHOO","ZIPPO","local","onion","AARP","ABLE","ADAC","AERO","AIGO","AKDN","ALLY","AMEX","ARAB","ARMY","ARPA","ARTE","ASDA","ASIA","AUDI","AUTO","BABY","BAND","BANK","BBVA","BEER","BEST","BIKE","BING","BLOG","BLUE","BOFA","BOND","BOOK","BUZZ","CAFE","CALL","CAMP","CARE","CARS","CASA","CASE","CASH","CBRE","CERN","CHAT","CITI","CITY","CLUB","COOL","COOP","CYOU","DATA","DATE","DCLK","DEAL","DELL","DESI","DIET","DISH","DOCS","DOHA","DUCK","DUNS","DVAG","ERNI","FAGE","FAIL","FANS","FARM","FAST","FIAT","FIDO","FILM","FIRE","FISH","FLIR","FOOD","FORD","FREE","FUND","GAME","GBIZ","GENT","GGEE","GIFT","GMBH","GOLD","GOLF","GOOG","GUGE","GURU","HAIR","HAUS","HDFC","HELP","HERE","HGTV","HOST","HSBC","ICBC","IEEE","IMDB","IMMO","INFO","ITAU","JAVA","JEEP","JOBS","JPRS","KDDI","KIWI","KPMG","KRED","LAND","LEGO","LGBT","LIDL","LIFE","LIKE","LIMO","LINK","LIVE","LOAN","LOFT","LOVE","LTDA","LUXE","MAIF","MEET","MEME","MENU","MINI","MINT","MOBI","MODA","MOTO","NAME","NAVY","NEWS","NEXT","NICO","NIKE","OLLO","OPEN","PAGE","PARS","PCCW","PICS","PING","PINK","PLAY","PLUS","POHL","PORN","POST","PROD","PROF","QPON","RAID","READ","REIT","RENT","REST","RICH","RMIT","ROOM","RSVP","RUHR","SAFE","SALE","SARL","SAVE","SAXO","SCOR","SCOT","SEAT","SEEK","SEXY","SHAW","SHIA","SHOP","SHOW","SILK","SINA","SITE","SKIN","SNCF","SOHU","SONG","SONY","SPOT","STAR","SURF","TALK","TAXI","TEAM","TECH","TEVA","TIAA","TIPS","TOWN","TOYS","TUBE","VANA","VISA","VIVA","VIVO","VOTE","VOTO","WANG","WEIR","WIEN","WIKI","WINE","WORK","XBOX","YOGA","ZARA","ZERO","ZONE","exit","zkey","AAA","ABB","ABC","ACO","ADS","AEG","AFL","AIG","ANZ","AOL","APP","ART","AWS","AXA","BAR","BBC","BBT","BCG","BCN","BET","BID","BIO","BIZ","BMS","BMW","BNL","BOM","BOO","BOT","BOX","BUY","BZH","CAB","CAL","CAM","CAR","CAT","CBA","CBN","CBS","CEB","CEO","CFA","CFD","COM","CRS","CSC","DAD","DAY","DDS","DEV","DHL","DIY","DNP","DOG","DOT","DTV","DVR","EAT","ECO","EDU","ESQ","EUS","FAN","FIT","FLY","FOO","FOX","FRL","FTR","FUN","FYI","GAL","GAP","GDN","GEA","GLE","GMO","GMX","GOO","GOP","GOT","GOV","HBO","HIV","HKT","HOT","HOW","IBM","ICE","ICU","IFM","INC","ING","INK","INT","IST","ITV","JCB","JCP","JIO","JLL","JMP","JNJ","JOT","JOY","KFH","KIA","KIM","KPN","KRD","LAT","LAW","LDS","LLC","LOL","LPL","LTD","MAN","MAP","MBA","MED","MEN","MIL","MIT","MLB","MLS","MMA","MOE","MOI","MOM","MOV","MSD","MTN","MTR","NAB","NBA","NEC","NET","NEW","NFL","NGO","NHK","NOW","NRA","NRW","NTT","NYC","OBI","OFF","ONE","ONG","ONL","OOO","ORG","OTT","OVH","PAY","PET","PHD","PID","PIN","PNC","PRO","PRU","PUB","PWC","QVC","RED","REN","RIL","RIO","RIP","RUN","RWE","SAP","SAS","SBI","SBS","SCA","SCB","SES","SEW","SEX","SFR","SKI","SKY","SOY","SRL","SRT","STC","TAB","TAX","TCI","TDK","TEL","THD","TJX","TOP","TRV","TUI","TVS","UBS","UNO","UOL","UPS","VET","VIG","VIN","VIP","WED","WIN","WME","WOW","WTC","WTF","XIN","XXX","XYZ","YOU","YUN","ZIP","bit","gnu","i2p","AC","AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BM","BN","BO","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","ER","ES","ET","EU","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","ST","SU","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UK","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM","ZW"]')},124:function(t,e){t.exports='
Settings

Messages

Notifications

(Permission unknown)

Whispers

Highlights, Focus & Tags

Autocomplete

Users
Emotes
Twitch subscribers only
Whispers
    '},126:function(t,e){t.exports='
    '},17:function(t,e,s){"use strict";var i=s(6);const n=function(t,e,s){if(!("Notification"in t&&"permission"in t.Notification&&"requestPermission"in t.Notification)){const i="default",n="granted",o="denied",a=[n,i,o],r=function(t){return t&&t.constructor===String},u=function(t){return t&&t.constructor===Function},h=function(t){return t&&t.constructor===Object},c=function(){},l=window.localStorage||{setItem:c,getItem:c},d=function(){let e;return e="webkitNotifications"in t&&"checkPermission"in t.webkitNotifications?a[t.webkitNotifications.checkPermission()]:"mozNotification"in s?n:null===l.getItem("notifications")?i:l.getItem("notifications"),e},m=function(s){let a=u(s)?s:c;"webkitNotifications"in t&&"requestPermission"in t.webkitNotifications?t.webkitNotifications.requestPermission(a):(d()===i&&(confirm("Do you want to allow "+e.domain+" to display Notifications?")?(l.setItem("notifications",n),A.permission=n):(l.setItem("notifications",o),A.permission=o)),a())},A=function(e,i){let o;return r(e)&&h(i)&&d()===n&&("mozNotification"in s?(o=s.mozNotification.createNotification(e,i.body,i.icon),u(i.onclick)&&(o.onclick=i.onclick),u(i.onclose)&&(o.onclose=i.onclose),o.show()):"webkitNotifications"in t&&"createNotification"in t.webkitNotifications&&(o=t.webkitNotifications.createNotification(i.icon,e,i.body),u(i.onclick)&&(o.onclick=i.onclick),u(i.onshow)&&(o.onshow=i.onshow),u(i.onerror)&&(o.onerror=i.onerror),u(i.onclose)&&(o.onclose=i.onclose),o.show())),o};"Notification"in t||(A.requestPermission=m,t.Notification=A),"webkitNotifications"in t&&"checkPermission"in t.webkitNotifications?Object.defineProperty(t.Notification,"permission",{get:function(){return a[t.webkitNotifications.checkPermission()]}}):A.permission=d(),"requestPermission"in t.Notification||(t.Notification.requestPermission=m)}return t.Notification}(window,document,navigator);var o=s(0),a=s.n(o);const r={FULL:"MMMM Do YYYY, h:mm:ss a",TIME:"HH:mm"},u={TAB:9,STRG:17,CTRL:17,CTRLRIGHT:18,CTRLR:18,SHIFT:16,RETURN:13,ENTER:13,BACKSPACE:8,BCKSP:8,ALT:18,ALTR:17,ALTRIGHT:17,SPACE:32,WIN:91,MAC:91,UP:38,DOWN:40,LEFT:37,RIGHT:39,ESC:27,DEL:46,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123};function h(t){return t.which||t.keyCode||-1}function c(t,e){return h(t)===e}var l=s(4),d=s(2),m=s.n(d);var A=class{constructor(){this.listeners=new Map}on(t,e){return this.listeners.has(t)||this.listeners.set(t,[]),this.listeners.get(t).push(e),this}emit(t,...e){const s=this.listeners.get(t);return!(!s||!s.length)&&(s.forEach(t=>t(...e)),!0)}};const g=window.WebSocket||window.MozWebSocket;var E=class extends A{constructor(){super(),this.socket=null,this.url=null,this.retryOnDisconnect=!0,this.retryAttempts=0,this.retryTimer=null}isConnected(){return this.socket&&this.socket.readyState===this.socket.OPEN}connect(t){this.url=t,this.retryAttempts++;try{null!==this.retryTimer&&(clearTimeout(this.retryTimer),this.retryTimer=null),null!==this.socket&&(this.socket.onopen=null,this.socket.onclose=null,this.socket.onerror=null,this.socket.onmessage=null,this.disconnect(),this.socket=null),this.emit("CONNECTING",this.url),this.socket=new g(this.url),this.socket.onopen=t=>this.onOpen(t),this.socket.onclose=t=>this.onClose(t),this.socket.onmessage=t=>this.onMsg(t),this.socket.onerror=t=>this.emit("SOCKETERROR",t)}catch(t){this.emit("SOCKETERROR",t)}}disconnect(){this.socket&&this.socket.readyState!==this.socket.CLOSED&&this.socket.close()}onOpen(t){this.emit("OPEN",t),this.retryAttempts=0,this.retryOnDisconnect=!0}onClose(t){let e=0;this.retryOnDisconnect&&(e=0===this.retryAttempts?Math.floor(2500*Math.random())+501:Math.floor(25001*Math.random())+5e3,this.retryTimer=setTimeout(()=>this.connect(this.url),e)),this.emit("CLOSE",{code:t.code||1006,retryMilli:e})}onMsg(t){this.parseAndDispatch(t)}parseAndDispatch(t){let e=t.data.split(" ",1)[0].toUpperCase(),s=t.data.substring(e.length+1),i=null;try{i=JSON.parse(s)}catch(t){i=s}this.emit("DISPATCH",{data:i,event:e}),this.emit(e,i)}send(t,e){const s="string"==typeof e?e:JSON.stringify(e);this.isConnected()?this.socket.send(`${t} ${s}`):this.emit("ERR","notconnected")}};var p=class{constructor(t={}){"string"==typeof t?(this.nick=t,this.username=t,this.features=[]):(this.nick=t.nick||"",this.username=t.nick||"",this.features=t.features||[])}hasAnyFeatures(...t){for(const e of t)if(-1!==this.features.indexOf("string"!=typeof e?e.toString():e))return!0;return!1}hasFeature(t){return this.hasAnyFeatures(t)}},C=s(11);const f={STATUS:"STATUS",ERROR:"ERROR",INFO:"INFO",COMMAND:"COMMAND",BROADCAST:"BROADCAST",UI:"UI",CHAT:"CHAT",USER:"USER",EMOTE:"EMOTE"},S=new Map;function T(t,e){let s="/me "===e.message.substring(0,4).toLowerCase()?e.message.substring(4):e.message;return S.forEach(i=>s=i.format(t,s,e)),`${s}`}function I(t){return``}S.set("html",new C.d),S.set("url",new C.f),S.set("emote",new C.b),S.set("mentioned",new C.e),S.set("green",new C.c),S.set("embed",new C.a);class O{static element(t,e=[]){return new N(t,e)}static status(t,e=null){return new w(t,e,f.STATUS)}static error(t,e=null){return new w(t,e,f.ERROR)}static info(t,e=null){return new w(t,e,f.INFO)}static broadcast(t,e=null){return new w(t,e,f.BROADCAST)}static command(t,e=null){return new w(t,e,f.COMMAND)}static message(t,e,s=null){return new R(t,e,s)}static emote(t,e,s=1){return new B(t,e,s)}static whisper(t,e,s,i=null,n=null){const o=new R(t,e,i);return o.id=n,o.target=s,o}static historical(t,e,s=null){const i=new R(t,e,s);return i.historical=!0,i}}class N{constructor(t,e=[]){this.type=f.UI,this.message=t,this.classes=e,this.ui=null}into(t,e=null){return t.addMessage(this,e),this}wrap(t,e=[],s={}){return e.push(this.classes),e.unshift(`msg-${this.type.toLowerCase()}`),e.unshift("msg-chat"),s.class=e.join(" "),a()("
    ",s).html(t)[0].outerHTML}html(t=null){return this.wrap(this.message)}afterRender(t=null){}}class w extends N{constructor(t,e=null,s=f.CHAT){super(t),this.user=null,this.type=s,this.continued=!1,this.timestamp=e?m.a.utc(e).local():m()()}html(t=null){const e=[];return this.continued&&e.push("msg-continue"),this.wrap(`${I(this)} ${T(t,this)}`,e,{})}}class R extends w{constructor(t,e,s=null){super(t,s,f.USER),this.user=e,this.id=null,this.isown=!1,this.highlighted=!1,this.historical=!1,this.target=null,this.tag=null,this.title="",this.slashme=!1,this.mentioned=[]}html(t=null){const e=[],s={};this.id&&(s["data-id"]=this.id),this.user&&this.user.username&&(s["data-username"]=this.user.username.toLowerCase()),this.mentioned&&this.mentioned.length>0&&(s["data-mentioned"]=this.mentioned.join(" ").toLowerCase()),this.isown&&e.push("msg-own"),this.slashme&&e.push("msg-me"),this.historical&&e.push("msg-historical"),this.highlighted&&e.push("msg-highlight"),this.continued&&!this.target&&e.push("msg-continue"),this.tag&&e.push(`msg-tagged msg-tagged-${this.tag}`),this.target&&e.push("msg-whisper");let i=": ";this.target?i=" whispered: ":(this.slashme||this.continued)&&(i="");const n=function(t,e){const s=(t.features||[]).filter(t=>e.flairsMap.has(t)).map(t=>e.flairsMap.get(t)).reduce((t,e)=>t+` `,"");return""!==s?`${s}`:""}(this.user,t)+` ${this.user.username}`;return this.wrap(I(this)+` ${n}${i} `+T(t,this),e,s)}}function F(t){if(!t||!t._combo)return;let e="";t.emotecount>=50?e=" x50":t.emotecount>=30?e=" x30":t.emotecount>=20?e=" x20":t.emotecount>=10?e=" x10":t.emotecount>=5&&(e=" x5"),t._combo||console.error("no combo",t._combo),t._combo.attr("class","chat-combo"+e),t._combo_count.text(`${t.emotecount}`),t.ui.append(t._text.detach(),t._combo.detach())}const v=Object(l.b)(63,F);class B extends w{constructor(t,e,s=1){super(t,e,f.EMOTE),this.emotecount=s}html(t=null){return this._text=a()(`${S.get("emote").format(t,this.message,this)}`),this._combo=a()(''),this._combo_count=a()(`${this.emotecount}`),this._combo_x=a()('X'),this._combo_hits=a()('Hits'),this._combo_txt=a()('C-C-C-COMBO'),this.wrap(I(this))}afterRender(t=null){this._combo.append(this._combo_count," ",this._combo_x," ",this._combo_hits," ",this._combo_txt),this.ui.append(this._text,this._combo)}incEmoteCount(){++this.emotecount,v(this)}completeCombo(){F(this),this._combo.attr("class",this._combo.attr("class")+" combo-complete"),this._combo=this._combo_count=this._combo_x=this._combo_hits=this._combo_txt=null}}s(48);const L="ontouchstart"in window||navigator.maxTouchPoints;var b=class{constructor(t,e){if(!a()(e).get(0))return;const s=a()(e);s.find(".chat-scroll-notify").length>0&&(s.on("update",()=>s.toggleClass("chat-unpinned",!this.isPinned())),s.on("mousedown",".chat-scroll-notify",()=>!1),s.on("mouseup",".chat-scroll-notify",()=>(this.updateAndPin(!0),!1))),this.scroller=s.nanoScroller({sliderMinHeight:40,disableResize:!0,alwaysVisible:L})[0].nanoscroller}isPinned(){return!this.scroller.isActive||this.scroller.contentScrollTop>=this.scroller.maxScrollTop-30}updateAndPin(t){this.reset(),t&&this.scroller.scrollBottom(0)}reset(){this.scroller.reset()}destroy(){this.scroller.destroy()}},D=s(3);function M(t){return`
    ${t}
    `}function k(t,e){const s=this.chat.users.get(t.getAttribute("data-username").toLowerCase()),i=this.chat.users.get(e.getAttribute("data-username").toLowerCase());if(!s||!i)return 0;let n,o;if(n=s.hasFeature(D.a.ADMIN)||s.hasFeature(D.a.VIP),o=i.hasFeature(D.a.ADMIN)||i.hasFeature(D.a.VIP),n>o)return-1;if(no)return 1;if(no)return 1;if(no)return-1;if(no)return-1;if(nr?1:0}class U extends A{constructor(t,e,s){super(),this.ui=t,this.btn=e,this.chat=s,this.visible=!1,this.shown=!1,this.ui.find(".scrollable").each((t,e)=>{this.scrollplugin=new b(s,e)}),this.ui.on("click",".close,.chat-menu-close",this.hide.bind(this)),this.btn.on("click",t=>(this.visible&&s.input.focus(),this.toggle(t),!1))}show(){this.visible||(this.visible=!0,this.shown=!0,this.btn.addClass("active"),this.ui.addClass("active"),this.redraw(),this.emit("show"))}hide(){this.visible&&(this.visible=!1,this.btn.removeClass("active"),this.ui.removeClass("active"),this.emit("hide"))}toggle(){const t=this.visible;U.closeMenus(this.chat),t||this.show()}redraw(){this.visible&&this.scrollplugin&&this.scrollplugin.reset()}static closeMenus(t){t.menus.forEach(t=>t.hide())}}class y extends U{constructor(t,e,s){super(t,e,s),this.notificationEl=this.ui.find("#chat-settings-notification-permissions"),this.ui.on("change",'input[type="checkbox"],select',t=>this.onSettingsChange(t)),this.ui.on("keypress blur",'textarea[name="customhighlight"]',t=>this.onCustomHighlightChange(t))}onCustomHighlightChange(t){if(!c(t,u.ENTER))return;let e=a()(t.target).val().toString().split(",").map(t=>t.trim());this.chat.settings.set("customhighlight",[...new Set(e)]),this.chat.applySettings(!1),this.chat.commitSettings()}onSettingsChange(t){const e=function(t){if("checkbox"===t.getAttribute("type")){const e=a()(t).is(":checked");return Boolean(t.hasAttribute("data-opposite")?!e:e)}if("text"===t.getAttribute("type")||"select"===t.nodeName.toLocaleLowerCase())return a()(t).val()}(t.target),s=t.target.getAttribute("name");if(void 0!==e){switch(s){case"profilesettings":!e&&this.chat.authenticated&&Object(i.a)(`${this.config.api.base}/api/chat/me/settings`,{credentials:"include",method:"DELETE"}).catch(console.warn);break;case"notificationwhisper":case"notificationhighlight":e&&this.notificationPermission().then(()=>this.updateNotification())}this.chat.settings.set(s,e),this.chat.applySettings(!1),this.chat.commitSettings()}}show(){this.visible||(this.ui.find("input,select").get().filter(t=>this.chat.settings.has(t.getAttribute("name"))).forEach(t=>(function(t,e){"checkbox"===t.getAttribute("type")?a()(t).prop("checked",Boolean(t.hasAttribute("data-opposite")?!e:e)):"text"!==t.getAttribute("type")&&"select"!==t.nodeName.toLocaleLowerCase()||a()(t).val(e)})(t,this.chat.settings.get(t.getAttribute("name")))),this.ui.find('textarea[name="customhighlight"]').val(this.chat.settings.get("customhighlight")||""),this.updateNotification()),super.show()}updateNotification(){const t="default"===n.permission?"required":n.permission;this.notificationEl.text(`(Permission ${t})`)}notificationPermission(){return new Promise((t,e)=>{switch(n.permission){case"default":n.requestPermission(s=>{switch(s){case"granted":t(s);break;default:e(s)}});break;case"granted":t(n.permission);break;case"denied":default:e(n.permission)}})}}class P extends U{constructor(t,e,s){super(t,e,s),this.searchterm="",this.searchcount=0,this.totalcount=0,this.header=this.ui.find("h5 span"),this.container=this.ui.find(".content:first"),this.searchinput=this.ui.find("#chat-user-list-search .form-control:first"),this.container.on("click",".user",t=>this.chat.userfocus.toggleFocus(t.target.getAttribute("data-username"))),this.container.on("click",".whisper-nick",t=>{U.closeMenus(this.chat);const e=this.chat.input.val().toString().trim(),s=a()(t.target).parent().data("username");return this.chat.input.val(e+(""===e?"":" ")+s+" ").focus(),!1}),this.chat.source.on("JOIN",t=>this.addAndRedraw(t.nick)),this.chat.source.on("QUIT",t=>this.removeAndRedraw(t.nick)),this.chat.source.on("NAMES",t=>this.addAll()),this.searchinput.on("keyup",Object(l.a)(100,!1,()=>{this.searchterm=this.searchinput.val(),this.filter(),this.redraw()}))}show(){super.show(),this.searchinput.focus()}redraw(){if(this.visible){const t=this.searchterm.length>0;t&&this.totalcount!==this.searchcount?this.header.text(`Users (${this.searchcount} out of ${this.totalcount})`):this.header.text(`Users (${this.totalcount})`),this.ui.toggleClass("search-in",t)}super.redraw()}addAll(){this.totalcount=0,this.container.empty(),[...this.chat.users.keys()].forEach(t=>this.addElement(t)),this.sort(),this.filter(),this.redraw()}addAndRedraw(t){this.hasElement(t)||(this.addElement(t,!0),this.filter(),this.redraw())}removeAndRedraw(t){this.hasElement(t)&&(this.removeElement(t),this.redraw())}removeElement(t){this.container.find(`.user[data-username="${t}"]`).remove(),this.totalcount--}addElement(t,e=!1){const s=this.chat.users.get(t.toLowerCase()),i=s.username&&""!==s.username?s.username:"Anonymous",n=0===s.features.length?"nofeature":s.features.join(" "),o=a()(` ${i}`);if(e&&this.totalcount>0){const t=this.container.children(".user").get();let e=0,s=t.length,i=Math.floor((e+s)/2);for(;s>e;)k.apply(this,[o[0],t[i]])<0?s=i:e=i+1,i=Math.floor((e+s)/2);o.insertAfter(t[i])}else this.container.append(o);this.totalcount++}hasElement(t){return this.container.find('.user[data-username="'+t+'"]').length>0}filter(){this.searchcount=0,this.searchterm&&this.searchterm.length>0?this.container.children(".user").get().forEach(t=>{const e=t.getAttribute("data-username").toLowerCase().indexOf(this.searchterm.toLowerCase())>=0;a()(t).toggleClass("found",e),e&&this.searchcount++}):this.container.children(".user").removeClass("found")}sort(){this.container.children(".user").get().sort(k.bind(this)).forEach(t=>t.parentNode.appendChild(t))}}class H extends U{constructor(t,e,s){super(t,e,s),this.temotes=this.ui.find("#twitch-emotes"),this.demotes=this.ui.find("#destiny-emotes"),this.ui.on("click",".emote",t=>{U.closeMenus(s),this.selectEmote(t.currentTarget.innerText)})}show(){this.visible||this.chat.input.focus(),super.show(),this.demotes.empty().append(this.chat.emotes.filter(t=>!t.twitch).map(t=>t.prefix).map(M).join("")),this.temotes.empty().append(this.chat.emotes.filter(t=>t.twitch).map(t=>t.prefix).map(M).join(""))}selectEmote(t){let e=this.chat.input.val().toString().trim();this.chat.input.val(e+(""===e?"":" ")+t+" ").focus()}}class G extends U{constructor(t,e,s){super(t,e,s),this.unread=0,this.empty=a()('No new whispers :('),this.notif=a()(''),this.btn.append(this.notif),this.usersEl=t.find("ul:first"),this.usersEl.on("click",".user",t=>s.openConversation(t.target.getAttribute("data-username"))),this.usersEl.on("click",".remove",t=>this.removeConversation(t.target.getAttribute("data-username")))}removeConversation(t){const e=t.toLowerCase();this.chat.whispers.delete(e),this.chat.removeWindow(e),this.redraw()}updateNotification(){const t=this.unread;this.unread=[...this.chat.whispers.entries()].map(t=>parseInt(t[1].unread)).reduce((t,e)=>t+e,0),tthis.btn.removeClass("ping"),2e3)),this.notif.text(this.unread),this.notif.toggle(this.unread>0);try{const t=window.parent.document.title.replace(/^\([0-9]+\) /,"");window.parent.document.title=this.unread>0?`(${this.unread}) ${t}`:`${t}`}catch(t){console.error(t)}}redraw(){this.updateNotification(),this.visible&&(this.usersEl.empty(),0===this.chat.whispers.size?this.usersEl.append(this.empty):[...this.chat.whispers.entries()].sort((t,e)=>0===t[1].unread?1:0===e[1].unread?-1:t[1]===e[1]?0:void 0).forEach(t=>this.addConversation(t[0],t[1].unread))),super.redraw()}addConversation(t,e){const s=this.chat.users.get(t.toLowerCase())||new p(t);this.usersEl.append(`\n
  • \n ${s.nick}\n ${e}\n \n
  • \n `)}}let x,$=1,V=20;function Y(t){return(t.match(/[\S]/)[0]||"_").toLowerCase()}function K(t){t.selected>=0&&t.results[t.selected]&&(t.results[t.selected].weight=Date.now())}function W(t,e){return t&&e?t.isemote!==e.isemote?t.isemote&&!e.isemote?-1:1:t.weight!==e.weight?t.weight>e.weight?-1:1:(t=t.data.toLowerCase())===(e=e.data.toLowerCase())?0:t>e?1:-1:0}function j(t,e){let s=t.substring(0,e),i=t.substring(e),n=s.lastIndexOf(" ")+1,o=i.indexOf(" "),a=!1;return n>0&&(s=s.substring(n)),o>-1&&(i=i.substring(0,o)),0===s.lastIndexOf("@")&&(n++,s=s.substring(1),a=!0),{word:s+i,pre:s,post:i,startCaret:n,useronly:a,orig:t}}function X(t){t.chat.ui.toggleClass("chat-autocomplete-in",t.results.length>0),t.ui.toggleClass("active",t.results.length>0)}function _(t){if(-1!==t.selected&&t.results.length>0){const e=t.ui.find("li").get(),s=t.container.position().left,i=t.ui.width();a()(e[t.selected+3]).each((e,n)=>{const o=a()(n).position().left+s+a()(n).outerWidth();o>i&&t.container.css("left",s+i-o)}),a()(e[Math.max(0,t.selected-2)]).each((e,i)=>{a()(i).position().left+s<0&&t.container.css("left",a()(i).position().left)}),e.forEach((e,s)=>a()(e).toggleClass("active",s===t.selected))}}var J=class{constructor(){this.ui=a()('
      '),this.ui.on("click","li",t=>this.select(parseInt(t.currentTarget.getAttribute("data-index")))),this.container=a()(this.ui[0].firstElementChild),this.buckets=new Map,this.results=[],this.criteria=null,this.selected=-1,this.input=null}bind(t){this.chat=t,this.input=t.input,this.ui.insertBefore(t.input);let e="",s=!1,i=!1;this.input.on("keydown",t=>{e=this.input.val().toString(),h(t)===u.TAB?(this.results.length>0&&this.select(this.selected>=this.results.length-1?0:this.selected+1),t.preventDefault(),t.stopPropagation()):s!==t.shiftKey&&null!==this.criteria&&(s=!!t.shiftKey,this.search(this.criteria,s))}),this.input.on("keypress",t=>{const e=h(t),s=String.fromCharCode(e)||"";if(e===u.ENTER)K(this),this.reset();else if(s.length>0){K(this);const t=this.input.val().toString(),e=this.input[0].selectionStart+1,n=j(t.substring(0,e)+s+t.substring(e),e);this.search(n),this.results.length>0&&this.results[0].data===n.word&&(this.selected=0,_(this),X(this)),i=!0}}),this.input.on("keyup",t=>{const n=h(t);if(n!==u.TAB&&n!==u.ENTER){const n=this.input.val().toString();if(0===n.trim().length)this.reset();else if(i||n===e)s!==t.shiftKey&&null!==this.criteria&&(s=!!t.shiftKey,this.search(this.criteria,s));else{const t=j(n,this.input[0].selectionStart);this.search(t)}}i=!1,e=""}),this.input.on("mouseup",()=>{if(this.input[0].selectionStart!==this.input[0].selectionEnd)return this.reset();const t=j(this.input.val().toString(),this.input[0].selectionStart);this.search(t)})}search(t,e=!1){if(this.selected=-1,this.results=[],this.criteria=t,t.word.length>=$){const s=this.buckets.get(Y(t.word))||new Map,i=new RegExp("^"+Bt.makeSafeForRegex(t.pre),"i");this.results=[...s.values()].filter(s=>(!s.isemote||!(t.useronly||e))&&i.test(s.data)).sort(W).slice(0,V)}var s;(s=this).results.length>0&&(s.container[0].innerHTML=s.results.map((t,e)=>`
    • ${t.data}
    • `).join("")),X(this),function(t){x&&clearTimeout(x),x=setTimeout(()=>t.reset(),15e3,t)}(this)}reset(){this.criteria=null,this.results=[],this.selected=-1,X(this)}add(t,e=!1,s=1){const i=Y(t),n=this.buckets.get(i)||this.buckets.set(i,new Map).get(i),o=Object.assign(n.get(t)||{},{data:t,weight:s,isemote:e});return n.set(t,o),o}remove(t,e=!1){const s=this.buckets.get(Y(t));if(s&&s.has(t)){const i=s.get(t);(e&&!i.isemote||!e)&&s.delete(t)}}select(t){this.selected=Math.min(t,this.results.length-1);const e=this.results[this.selected];if(!e)return;let s=this.criteria.orig.substr(0,this.criteria.startCaret),i=this.criteria.orig.substr(this.criteria.startCaret+this.criteria.word.length);" "===i[0]&&0!==i.length||(i=" "+i),this.input.focus().val(s+e.data+i);const n=s.length+e.data.length+1;this.input[0].setSelectionRange(n,n),_(this),X(this)}};const Z=window.localStorage||{setItem:()=>{},getItem:()=>{}},z=window.JSON;var q=class{static write(t,e){let s="";try{s=z.stringify(e instanceof Map||e instanceof Set?[...e]:e)}catch(t){console.error(t)}Z.setItem(t,s)}static read(t){let e=null;try{e=z.parse(Z.getItem(t))}catch(t){console.error(t)}return e}static remove(t){try{Z.removeItem(t)}catch(t){console.error(t)}}};var Q=class{constructor(t){this.input=t.input,this.history=q.read("chat.history")||[],this.index=-1,this.lastinput="",this.maxentries=20,this.input.on("keydown",t=>{t.shiftKey||t.metaKey||t.ctrlKey||!c(t,u.UP)&&!c(t,u.DOWN)?this.index=-1:(this.show(c(t,u.UP)?-1:1),t.preventDefault(),t.stopPropagation())})}show(t){if(this.index<0){if(-1!==t)return;if(this.index=this.history.length,this.lastinput=this.input.val().toString(),this.index<=0)return}const e=this.index+t;let s=this.lastinput;e>=this.history.length||e<0?e>=this.history.length&&(this.index=-1):(this.index=e,s=this.history[e]),this.input.val(s)}add(t){this.index=-1,this.history.length>0&&this.history[this.history.length-1]===t||(this.history.push(t),this.history.length>this.maxentries&&this.history.slice(-this.maxentries),q.write("chat.history",this.history))}};var tt=class{constructor(t,e){this.chat=t,this.css=e,this.focused=[],this.chat.output.on("mousedown",t=>this.toggleElement(t.target))}toggleElement(t){const e=a()(t);e.hasClass("chat-user")?(this.chat.settings.get("focusmentioned")||this.toggleFocus(e.closest(".msg-user").data("username"),!0),this.toggleFocus(e.text())):e.hasClass("user")?this.toggleFocus(e.text()):this.focused.length>0&&this.clearFocus()}toggleFocus(t,e=null){t=(t||"").toLowerCase();const s=this.focused.indexOf(t.toLowerCase()),i=-1!==s;return null===e&&(e=!i),e&&!i?this.addCssRule(t):!e&&i&&this.removeCssRule(s),this}addCssRule(t){let e;e=this.chat.settings.get("focusmentioned")?`.msg-user[data-username="${t}"],.msg-user[data-mentioned~="${t}"]{opacity:1 !important;}`:`.msg-user[data-username="${t}"]{opacity:1 !important;}`,this.css.insertRule(e,this.focused.length),this.focused.push(t),this.redraw()}removeCssRule(t){this.css.deleteRule(t),this.focused.splice(t,1),this.redraw()}clearFocus(){this.focused.forEach(t=>this.css.deleteRule(0)),this.focused=[],this.redraw()}redraw(){this.chat.ui.toggleClass("focus-user",this.focused.length>0)}};var et={upgrade:function(t,e,s){if(e<=0){let e=q.read("chatoptions");e&&Object.keys(e).forEach(s=>{switch(s){case"highlightnicks":t.settings.set("highlightnicks",Object.keys(e[s]));break;default:t.settings.set(s,e[s])}}),e=q.read("chatignorelist"),e&&t.settings.set("ignorenicks",Object.keys(e)||[]),e=q.read("chat.ignoring"),e&&t.settings.set("ignorenicks",e),e=q.read("inputhistory"),e&&q.write("chat.history",e),e=t.settings.get("allowNotifications"),null!=e&&(t.settings.set("notificationwhisper",e),t.settings.set("notificationhighlight",e),t.settings.delete("allowNotifications")),e=t.settings.get("notificationtimeout"),t.settings.set("notificationtimeout",-1!==e),e=null,q.remove("chatoptions"),q.remove("inputhistory"),q.remove("chatignorelist"),q.remove("hiddenhints"),q.remove("lasthinttime"),q.remove("unreadMessageCount"),q.remove("chat.shownhints"),q.remove("chat.ignoring")}if(e<=1){let e=!0===t.settings.get("showremoved")?1:0;t.settings.set("showremoved",e)}}};const st=["green","yellow","orange","purple","blue","sky","lime","pink"];var it=class extends A{constructor(t,e="",s=""){super(),this.name=t,this.label=s,this.maxlines=0,this.linecount=0,this.locks=0,this.waspinned=!0,this.scrollplugin=null,this.visible=!1,this.tag=null,this.lastmessage=null,this.ui=a()(`'),this.lines=this.ui.find(".chat-lines")}destroy(){return this.ui.remove(),this.scrollplugin.destroy(),this}into(t){const e=this.name.toLowerCase();return this.maxlines=t.settings.get("maxlines"),this.scrollplugin=new b(t,this.ui),this.tag=t.taggednicks.get(e)||st[Math.floor(Math.random()*st.length)],t.output.append(this.ui),t.addWindow(e,this),this}show(){this.visible||(this.visible=!0,this.emit("show"),this.ui.show())}hide(){this.visible&&(this.visible=!1,this.emit("hide"),this.ui.hide())}addMessage(t,e){e.ui=a()(e.html(t)),e.afterRender(t),this.lastmessage=e,this.lines.append(e.ui),this.linecount++,this.cleanup()}getlines(t){return this.lines.children(t)}removelines(t){const e=this.lines.children(t);this.linecount-=e.length,e.remove()}locked(){return this.locks>0}lock(){this.locks++,1===this.locks&&(this.waspinned=this.scrollplugin.isPinned())}unlock(){this.locks--,0===this.locks&&this.scrollplugin.updateAndPin(this.waspinned)}cleanup(){if(this.scrollplugin.isPinned()||this.waspinned){const t=this.lines.children();if(t.length>=this.maxlines){const e=t.slice(0,t.length-this.maxlines);this.linecount-=e.length,e.remove()}}}updateAndPin(t=!0){this.scrollplugin.updateAndPin(t)}};const nt=/^\/vote /i,ot=/^\/votestop/i,at=/\bor\b/i,rt=/^(how|why|when|what|where)\b/i,ut=/\b([0-9]+(?:m|s)?)$/i,ht=3e4,ct=6e5,lt=5e3;function dt(t){let e;const s=t.match(ut);if(s&&s[0])switch(t=t.replace(ut,""),s[0].replace(/[0-9]+/,"").toLowerCase()){case"s":e=1e3*parseInt(s[0]);break;case"m":e=60*parseInt(s[0])*1e3;break;default:e=ht}else e=ht;const i=function(t){if(-1===t.indexOf("?"))throw"Must contain a ?";const e=t.split("?"),s=e[0]+"?";if(""!==e[1].trim()){const t=e[1].split(at).map(t=>t.trim());if(t.length<2&&s.match(rt))throw"question needs at least 2 available answers";return{question:s,options:t}}return{question:s,options:["Yes","No"]}}(t.trim());return i.time=Math.max(lt,Math.min(e,ct)),i}var mt=class{constructor(t,e){this.chat=t,this.ui=e,this.vote=null,this.voting=!1,this.hidden=!0,this.timerHeartBeat=-1,this.timerEndVote=-1,this.timerHideVote=-1,this.ui.on("click touch",".vote-close",()=>this.hide()),this.ui.on("click touch",".opt",t=>{this.voting&&this.chat.cmdSEND(a()(t.currentTarget).index()+1+"")}),this.throttleVoteCast=Object(l.b)(100,!1,()=>{this.updateBars()})}hide(){this.hidden||(this.hidden=!0,this.chat.mainwindow.lock(),this.ui.removeClass("active"),this.chat.mainwindow.unlock())}show(){this.hidden&&(this.hidden=!1,this.chat.mainwindow.lock(),this.ui.addClass("active"),this.chat.mainwindow.unlock())}isVoteStarted(){return this.voting}canUserStartVote(t){return t.hasAnyFeatures(D.a.ADMIN,D.a.BOT,D.a.PROTECTED,D.a.MODERATOR)}isMsgVoteStopFmt(t){return t.match(ot)}isMsgVoteStartFmt(t){return t.match(nt)}isMsgVoteCastFmt(t){if(1===t.length&&t.match(/[0-9]/i)){const e=parseInt(t);return e>0&&e<=this.vote.question.options.length}return!1}canVote(t){return!this.vote.votes.has(t)}castVote(t,e){return!(!this.voting||this.hidden||!this.canVote(e))&&(this.vote.votes.set(e,t),this.vote.totals[t-1]++,this.throttleVoteCast(t),!0)}startVote(t,e){try{this.voting=!0,clearTimeout(this.timerEndVote),clearTimeout(this.timerHideVote),clearInterval(this.timerHeartBeat);const s=dt(t);this.vote={start:new Date,time:s.time,question:s,totals:s.options.map(()=>0),votes:new Map,user:e};const i=this.buildVoteFrame();return this.ui.vote=i,this.ui.label=i.find(".vote-label"),this.ui.bars=i.find(".opt").toArray().map(t=>{const e=a()(t),s=e.find(".opt-bar-value"),i=e.find(".opt-bar-inner");return{opt:e,barInner:i,barValue:s}}),this.chat.mainwindow.lock(),this.ui.empty().append(i),this.chat.mainwindow.unlock(),this.updateTimers(),this.updateBars(),this.show(),this.timerHeartBeat=setInterval(()=>this.updateTimers(),1e3),this.timerEndVote=setTimeout(()=>this.endVote(),this.vote.time),!0}catch(t){return console.error(t),this.voting=!1,!1}}endVote(){this.voting=!1,clearTimeout(this.timerEndVote),clearTimeout(this.timerHideVote),clearInterval(this.timerHeartBeat);const t=this.vote.totals.reduce((t,e,s,i)=>e>i[t]?s:t,0),e=this.ui.vote.find(".opt-options"),s=this.ui.vote.find(".opt-choices");e.find(`.opt:nth-child(${t+1})`).addClass("opt-winner"),s.find(`.opt-choice:nth-child(${t+1})`).addClass("opt-winner"),this.ui.label.html(`Vote ended! ${this.vote.votes.size} votes cast.`),this.ui.vote.addClass("vote-completed"),this.timerHideVote=setTimeout(()=>this.hide(),7e3),this.vote=null}markVote(t,e){this.ui.vote.find(`.opt-options .opt:nth-child(${t})`).addClass("opt-marked")}updateTimers(){const t=Math.floor(Math.min((this.vote.time-(new Date-this.vote.start))/1e3+1,this.vote.time/1e3));this.ui.label.html(`(Type in chat to participate) Started by ${this.vote.user} ending in ${t} ${t>1?"seconds":"second"}!`)}updateBars(){this.vote&&this.vote.question&&this.vote.question.options.forEach((t,e)=>{const s=this.vote.votes.size>0?this.vote.totals[e]/this.vote.votes.size*100:0;this.ui.bars[e].barInner.css("width",s+"%"),this.ui.bars[e].barValue.text(s>0?Math.round(s)+"%":"")})}buildVoteFrame(){const t=this.vote.question,e=a()("").text(t.question)[0],s=t.options.map((t,e)=>{return`${e+1} ${a()("").text(t)[0].outerHTML}`}).join(" ");return a()('
      '+t.options.reduce((t,e,s)=>(t+='
      ',t+=`
      ${s+1}
      `,t+='
      0
      ',t+="
      "),"")+'
      ')}};const At=/^\/([a-z0-9]+)[\s]?/i,gt=/(\d+(?:\.\d*)?)([a-z]+)?/gi,Et=/[\-\[\]\/{}()*+?.\\^$|]/g,pt=/(?:(?:^|\s)@?)([a-zA-Z0-9_]{3,20})(?=$|\s|[.?!,])/g,Ct=/^[a-zA-Z0-9_]{3,20}$/,ft=new RegExp("\\b(?:NSFL|NSFW)\\b","i"),St=new RegExp("\\b(?:NSFW)\\b","i"),Tt=new RegExp("\\b(?:NSFL)\\b","i"),It=["green","yellow","orange","red","purple","blue","sky","lime","pink","black"],Ot=new Map([["unknown","Unknown error, this usually indicates an internal problem :("],["nopermission","You do not have the required permissions to use that"],["protocolerror","Invalid or badly formatted"],["needlogin","You have to be logged in to use that"],["invalidmsg","The message was invalid"],["throttled","Throttled! You were trying to send messages too fast"],["duplicate","The message is identical to the last one you sent"],["muted","You are muted (mutes are always temporary). Subscribing removes mutes: Check your profile for more information."],["submode","The channel is currently in subscriber only mode"],["needbanreason","Providing a reason for the ban is mandatory"],["banned","You have been banned (subscribing removes non-permanent bans). Check your profile for more information."],["privmsgbanned","Cannot send private messages while banned"],["requiresocket","This chat requires WebSockets"],["toomanyconnections","Only 5 concurrent connections allowed"],["socketerror","Error contacting server"],["privmsgaccounttooyoung","Your account is too recent to send private messages"],["notfound","The user was not found"],["notconnected","You have to be connected to use that"]]),Nt=new Map([["slashhelp","Type in /help for more a list of commands, do advanced things like modify your scroll-back size"],["tabcompletion","Use the tab key to auto-complete names and emotes (for user only completion prepend a @ or press shift)"],["hoveremotes","Hovering your mouse over an emote will show you the emote code"],["highlight","Chat messages containing your username will be highlighted"],["notify","Use /msg to send a private message to someone"],["ignoreuser","Use /ignore to hide messages from pesky chatters"],["mutespermanent","Mutes are never persistent, don't worry it will pass!"],["tagshint",`Use the /tag [ ] to tag users you like. There are preset colors to choose from ${It.join(", ")}`],["bigscreen","Bigscreen! Did you know you can have the chat on the left or right side of the stream by clicking the swap icon in the top left?"]]),wt=new Map([["schemaversion",2],["showtime",!1],["hideflairicons",!1],["profilesettings",!1],["timestampformat","HH:mm"],["maxlines",250],["notificationwhisper",!1],["notificationhighlight",!1],["highlight",!0],["customhighlight",[]],["highlightnicks",[]],["taggednicks",[]],["taggednotes",[]],["showremoved",0],["showhispersinchat",!1],["ignorenicks",[]],["focusmentioned",!1],["notificationtimeout",!0],["ignorementions",!1],["autocompletehelper",!0],["taggedvisibility",!1],["hidensfw",!1],["hidensfl",!1],["fontscale","auto"]]),Rt=new Map([["help",{desc:"Helpful information."}],["emotes",{desc:"A list of the chats emotes in text form."}],["me",{desc:"A normal message, but emotive."}],["message",{desc:"Whisper someone",alias:["msg","whisper","w","tell","t","notify"]}],["ignore",{desc:"No longer see user messages, without to list the nicks ignored"}],["unignore",{desc:"Remove a user from your ignore list"}],["highlight",{desc:"Highlights target nicks messages for easier visibility"}],["unhighlight",{desc:"Unhighlight target nick"}],["maxlines",{desc:"The maximum number of lines the chat will store"}],["mute",{desc:"The users messages will be blocked from everyone.",admin:!0}],["unmute",{desc:"Unmute the user.",admin:!0}],["subonly",{desc:"Subscribers only",admin:!0}],["ban",{desc:"User will no longer be able to connect to the chat.",admin:!0}],["unban",{desc:"Unban a user",admin:!0}],["timestampformat",{desc:"Set the time format of the chat."}],["tag",{desc:"Mark a users messages"}],["untag",{desc:"No longer mark the users messages"}],["exit",{desc:"Exit the conversation you are in."}],["reply",{desc:"Reply to the last private message.",alias:["r"]}],["stalk",{desc:"Return a list of messages from ",alias:["s"]}],["mentions",{desc:"Return a list of messages where is mentioned",alias:["m"]}],["vote",{desc:"Start a vote."}],["votestop",{desc:"Stop a vote you started."}]]),Ft={id:0,userid:0,username:"",targetuserid:"",targetusername:"",ipaddress:"",reason:"",starttimestamp:"",endtimestamp:""};class vt{constructor(t){return this.config=Object.assign({},{url:"",api:{base:""},cdn:{base:""},cacheKey:""},t),this.ui=null,this.css=null,this.output=null,this.input=null,this.loginscrn=null,this.loadingscrn=null,this.showmotd=!0,this.authenticated=!1,this.backlogloading=!1,this.unresolved=[],this.flairs=new Set,this.emotes=new Set,this.flairsMap=new Map,this.emotesMap=new Map,this.emotePrefixes=new Set,this.emoteRegexNormal=null,this.emoteRegexTwitch=null,this.user=new p,this.users=new Map,this.whispers=new Map,this.windows=new Map,this.settings=new Map(wt),this.autocomplete=new J,this.menus=new Map,this.taggednicks=new Map,this.taggednotes=new Map,this.ignoring=new Set,this.mainwindow=null,this.regexhighlightcustom=null,this.regexhighlightnicks=null,this.regexhighlightself=null,this.replyusername=null,this.control=new A(this),this.source=new E,this.source.on("REFRESH",()=>window.location.reload(!1)),this.source.on("PING",t=>this.source.send("PONG",t)),this.source.on("CONNECTING",t=>this.onCONNECTING(t)),this.source.on("OPEN",t=>this.onOPEN(t)),this.source.on("DISPATCH",t=>this.onDISPATCH(t)),this.source.on("CLOSE",t=>this.onCLOSE(t)),this.source.on("NAMES",t=>this.onNAMES(t)),this.source.on("QUIT",t=>this.onQUIT(t)),this.source.on("MSG",t=>this.onMSG(t)),this.source.on("MUTE",t=>this.onMUTE(t)),this.source.on("UNMUTE",t=>this.onUNMUTE(t)),this.source.on("BAN",t=>this.onBAN(t)),this.source.on("UNBAN",t=>this.onUNBAN(t)),this.source.on("ERR",t=>this.onERR(t)),this.source.on("SOCKETERROR",t=>this.onSOCKETERROR(t)),this.source.on("SUBONLY",t=>this.onSUBONLY(t)),this.source.on("BROADCAST",t=>this.onBROADCAST(t)),this.source.on("PRIVMSGSENT",t=>this.onPRIVMSGSENT(t)),this.source.on("PRIVMSG",t=>this.onPRIVMSG(t)),this.control.on("SEND",t=>this.cmdSEND(t)),this.control.on("HINT",t=>this.cmdHINT(t)),this.control.on("EMOTES",t=>this.cmdEMOTES(t)),this.control.on("HELP",t=>this.cmdHELP(t)),this.control.on("IGNORE",t=>this.cmdIGNORE(t)),this.control.on("UNIGNORE",t=>this.cmdUNIGNORE(t)),this.control.on("MUTE",t=>this.cmdMUTE(t)),this.control.on("BAN",t=>this.cmdBAN(t,"BAN")),this.control.on("IPBAN",t=>this.cmdBAN(t,"IPBAN")),this.control.on("UNMUTE",t=>this.cmdUNBAN(t,"UNMUTE")),this.control.on("UNBAN",t=>this.cmdUNBAN(t,"UNBAN")),this.control.on("SUBONLY",t=>this.cmdSUBONLY(t,"SUBONLY")),this.control.on("MAXLINES",t=>this.cmdMAXLINES(t,"MAXLINES")),this.control.on("UNHIGHLIGHT",t=>this.cmdHIGHLIGHT(t,"UNHIGHLIGHT")),this.control.on("HIGHLIGHT",t=>this.cmdHIGHLIGHT(t,"HIGHLIGHT")),this.control.on("TIMESTAMPFORMAT",t=>this.cmdTIMESTAMPFORMAT(t)),this.control.on("BROADCAST",t=>this.cmdBROADCAST(t)),this.control.on("CONNECT",t=>this.cmdCONNECT(t)),this.control.on("TAG",t=>this.cmdTAG(t)),this.control.on("UNTAG",t=>this.cmdUNTAG(t)),this.control.on("BANINFO",t=>this.cmdBANINFO(t)),this.control.on("EXIT",t=>this.cmdEXIT(t)),this.control.on("MESSAGE",t=>this.cmdWHISPER(t)),this.control.on("MSG",t=>this.cmdWHISPER(t)),this.control.on("WHISPER",t=>this.cmdWHISPER(t)),this.control.on("W",t=>this.cmdWHISPER(t)),this.control.on("TELL",t=>this.cmdWHISPER(t)),this.control.on("T",t=>this.cmdWHISPER(t)),this.control.on("NOTIFY",t=>this.cmdWHISPER(t)),this.control.on("R",t=>this.cmdREPLY(t)),this.control.on("REPLY",t=>this.cmdREPLY(t)),this.control.on("MENTIONS",t=>this.cmdMENTIONS(t)),this.control.on("M",t=>this.cmdMENTIONS(t)),this.control.on("STALK",t=>this.cmdSTALK(t)),this.control.on("S",t=>this.cmdSTALK(t)),this.control.on("VOTE",t=>this.cmdVOTE(t)),this.control.on("V",t=>this.cmdVOTE(t)),this.control.on("VOTESTOP",t=>this.cmdVOTESTOP(t)),this.control.on("VS",t=>this.cmdVOTESTOP(t)),this}setUser(t){return t&&""!==t.username?(this.user=this.addUser(t),this.authenticated=!0):(this.user=this.addUser({nick:"User"+Math.floor(9e4*Math.random())+1e4}),this.authenticated=!1),this.authenticated&&this.input.focus().attr("placeholder",`Write something ${this.user.username} ...`),this}setSettings(t){let e=null!==t&&this.authenticated&&t.get("profilesettings")?t:new Map(q.read("chat.settings")||[]);e.size>0&&[...this.settings.keys()].filter(t=>void 0!==e.get(t)&&null!==e.get(t)).forEach(t=>this.settings.set(t,e.get(t)));const s=e.has("schemaversion")?parseInt(e.get("schemaversion")):-1,i=wt.get("schemaversion");return-1!==s&&i>s&&(et.upgrade(this,s,i),this.settings.set("schemaversion",i),this.saveSettings()),this.taggednicks=new Map(this.settings.get("taggednicks")),this.taggednotes=new Map(this.settings.get("taggednotes")),this.ignoring=new Set(this.settings.get("ignorenicks")),this.applySettings(!1)}withGui(t,e=null){this.ui=a()(t),this.ui.prependTo(e||"body"),this.css=(()=>{const t=document.createElement("style");return t.id="chat-styles",t.type="text/css",document.getElementsByTagName("head")[0].appendChild(t),t.sheet})(),this.ishidden="visible"!==(document.visibilityState||"visible"),this.output=this.ui.find("#chat-output-frame"),this.input=this.ui.find("#chat-input-control"),this.loginscrn=this.ui.find("#chat-login-screen"),this.loadingscrn=this.ui.find("#chat-loading"),this.windowselect=this.ui.find("#chat-windows-select"),this.inputhistory=new Q(this),this.userfocus=new tt(this,this.css),this.mainwindow=new it("main").into(this),this.ui.find("#chat-vote-frame:first").each((t,e)=>{this.chatvote=new mt(this,a()(e))}),this.windowToFront("main"),this.menus.set("settings",new y(this.ui.find("#chat-settings"),this.ui.find("#chat-settings-btn"),this)),this.menus.set("emotes",new H(this.ui.find("#chat-emote-list"),this.ui.find("#chat-emoticon-btn"),this)),this.menus.set("users",new P(this.ui.find("#chat-user-list"),this.ui.find("#chat-users-btn"),this)),this.menus.set("whisper-users",new G(this.ui.find("#chat-whisper-users"),this.ui.find("#chat-whisper-btn"),this)),Rt.forEach((t,e)=>{this.autocomplete.add(`/${e}`),(t.alias||[]).forEach(t=>this.autocomplete.add(`/${t}`))}),this.autocomplete.bind(this),this.input.on("keypress",t=>{!c(t,u.ENTER)||t.shiftKey||t.ctrlKey||(t.preventDefault(),t.stopPropagation(),this.control.emit("SEND",this.input.val().toString().trim()),this.input.focus())});let s=!1;this.output.on("mousedown",()=>s=!0),this.output.on("mouseup",()=>{s&&(s=!1,U.closeMenus(this),this.focusIfNothingSelected())}),this.ui.on("click","#chat-tools-wrap",()=>{U.closeMenus(this),this.focusIfNothingSelected()}),document.addEventListener("keydown",t=>{c(t,u.ESC)&&U.closeMenus(this)}),document.addEventListener("visibilitychange",Object(l.a)(100,!1,()=>{this.ishidden="visible"!==(document.visibilityState||"visible"),this.ishidden?U.closeMenus(this):this.focusIfNothingSelected()}),!0);let i=!1;const n=Object(l.a)(100,!1,()=>{i=!1,this.getActiveWindow().unlock(),this.focusIfNothingSelected()});return window.addEventListener("resize",()=>{i||(i=!0,U.closeMenus(this),this.getActiveWindow().lock()),n()},!1),this.windowselect.on("click",".tab-close",t=>(U.closeMenus(this),this.removeWindow(a()(t.currentTarget).parent().data("name").toLowerCase()),this.input.focus(),!1)),this.windowselect.on("click",".tab",t=>(U.closeMenus(this),this.windowToFront(a()(t.currentTarget).data("name").toLowerCase()),this.input.focus(),!1)),this.output.on("click",".censored",t=>{const e=a()(t.currentTarget).closest(".msg-user").data("username");return this.getActiveWindow().getlines(`.censored[data-username="${e}"]`).removeClass("censored"),!1}),this.loginscrn.on("click","#chat-btn-login",()=>{this.loginscrn.hide();try{window.top.showLoginModal()}catch(t){const e=location.protocol+"//"+location.hostname+(location.port?":"+location.port:"");try{return window.self===window.top?window.location.href=e+"/login?follow="+encodeURIComponent(window.location.pathname):window.location.href=e+"/login",!1}catch(t){}window.location.href=e+"/login"}return!1}),this.loginscrn.on("click","#chat-btn-cancel",()=>this.loginscrn.hide()),this.output.on("click mousedown",".msg-whisper a.user",t=>{const e=a()(t.target).closest(".msg-chat");return this.openConversation(e.data("username").toString().toLowerCase()),!1}),this.loadingscrn.fadeOut(250,()=>this.loadingscrn.remove()),this.mainwindow.updateAndPin(),this.input.focus().attr("placeholder","Write something ..."),O.status("Welcome to DGG chat").into(this),Promise.resolve(this)}connect(){this.source.connect(this.config.url)}async loadUserAndSettings(){return Object(i.a)(`${this.config.api.base}/api/chat/me`,{credentials:"include"}).then(t=>t.json()).then(t=>{this.setUser(t),this.setSettings(new Map(t.settings))}).catch(()=>{this.setUser(null),this.setSettings()})}async loadEmotesAndFlairs(){await this.loadEmotes(),await this.loadFlairs()}async loadEmotes(){return vt.loadCss(`${this.config.cdn.base}/emotes/emotes.css?_=${this.config.cacheKey}`),Object(i.a)(`${this.config.cdn.base}/flairs/flairs.json?_=${this.config.cacheKey}`).then(t=>t.json()).then(t=>{this.setFlairs(t)}).catch(()=>{})}async loadFlairs(){return vt.loadCss(`${this.config.cdn.base}/flairs/flairs.css?_=${this.config.cacheKey}`),Object(i.a)(`${this.config.cdn.base}/emotes/emotes.json?_=${this.config.cacheKey}`).then(t=>t.json()).then(t=>{this.setEmotes(t)}).catch(()=>{})}async loadHistory(){return Object(i.a)(`${this.config.api.base}/api/chat/history`).then(t=>t.json()).then(t=>{this.setHistory(t)}).catch(()=>{})}async loadWhispers(){if(this.authenticated)return Object(i.a)(`${this.config.api.base}/api/messages/unread`,{credentials:"include"}).then(t=>t.json()).then(t=>{t.forEach(t=>this.whispers.set(t.username.toLowerCase(),{id:t.messageid,nick:t.username,unread:t.unread,open:!1}))}).then(()=>this.menus.get("whisper-users").redraw()).catch(()=>{})}setEmotes(t){this.emotes=t,this.emotesMap=new Map,t.forEach(t=>this.emotesMap.set(t.prefix,t));const e=t.filter(t=>!t.twitch).map(t=>t.prefix).join("|"),s=t.filter(t=>t.twitch).map(t=>t.prefix).join("|");return this.emoteRegexNormal=new RegExp(`(^|\\s)(${e})(?=$|\\s)`,"gm"),this.emoteRegexTwitch=new RegExp(`(^|\\s)(${e}|${s})(?=$|\\s)`,"gm"),this.emotePrefixes=new Set([...t.map(t=>t.prefix)]),this.emotePrefixes.forEach(t=>this.autocomplete.add(t,!0)),this}setFlairs(t){return this.flairs=t,this.flairsMap=new Map,t.forEach(t=>this.flairsMap.set(t.name,t)),this}setHistory(t){return t&&t.length>0&&(this.backlogloading=!0,t.forEach(t=>this.source.parseAndDispatch({data:t})),this.backlogloading=!1,O.element("
      ").into(this),this.mainwindow.updateAndPin()),this}saveSettings(){this.authenticated&&this.settings.get("profilesettings")?Object(i.a)(`${this.config.api.base}/api/chat/me/settings`,{body:JSON.stringify([...this.settings]),credentials:"include",method:"POST"}).catch(console.warn):q.write("chat.settings",this.settings)}commitSettings(){this.debouncedsave||(this.debouncedsave=Object(l.a)(1e3,!1,()=>this.saveSettings())),this.debouncedsave()}applySettings(t=!0){t&&this.saveSettings(),r.TIME=this.settings.get("timestampformat");const e=Array.from(this.ignoring.values()).map(vt.makeSafeForRegex);this.ignoreregex=e.length>0?new RegExp(`\\b(?:${e.join("|")})\\b`,"i"):null;const s=[...this.settings.get("customhighlight")||[]].filter(t=>""!==t),i=[...this.settings.get("highlightnicks")||[]].filter(t=>""!==t);this.regexhighlightself=this.user.nick?new RegExp(`\\b(?:${this.user.nick})\\b`,"i"):null,this.regexhighlightcustom=s.length>0?new RegExp(`\\b(?:${s.join("|")})\\b`,"i"):null,this.regexhighlightnicks=i.length>0?new RegExp(`\\b(?:${i.join("|")})\\b`,"i"):null,Array.from(this.settings.keys()).filter(t=>"boolean"==typeof this.settings.get(t)).forEach(t=>this.ui.toggleClass(`pref-${t}`,this.settings.get(t))),[...this.windows.values()].forEach(t=>t.maxlines=this.settings.get("maxlines"));const n=this.settings.get("fontscale")||"auto";return a()(document.body).toggleClass("pref-fontscale","auto"!==n),a()(document.body).attr("data-fontscale",n),Promise.resolve(this)}addUser(t){if(!t)return null;const e=t.nick.toLowerCase();let s=this.users.get(e);return s?t.hasOwnProperty("features")&&!vt.isArraysEqual(t.features,s.features)&&(s.features=t.features):(s=new p(t),this.users.set(e,s)),s}addMessage(t,e=null){if(t.type!==f.USER||!this.ignored(t.user.nick,t.message))return null===e&&(e=this.mainwindow),e.lock(),e.lastmessage&&e.lastmessage.type===f.EMOTE&&e.lastmessage.emotecount>1&&e.lastmessage.completeCombo(),t.type===f.USER&&(t.slashme="/me "===t.message.substring(0,4).toLowerCase(),t.isown=t.user.username.toLowerCase()===this.user.username.toLowerCase(),t.continued=e.lastmessage&&!e.lastmessage.target&&e.lastmessage.user&&e.lastmessage.user.username.toLowerCase()===t.user.username.toLowerCase(),t.mentioned=vt.extractNicks(t.message).filter(t=>this.users.has(t.toLowerCase())),t.tag=this.taggednicks.get(t.user.nick.toLowerCase()),t.title=this.taggednotes.get(t.user.nick.toLowerCase())||"",t.highlighted=!t.isown&&(this.regexhighlightself&&this.settings.get("highlight")&&this.regexhighlightself.test(t.message)||this.regexhighlightnicks&&this.regexhighlightnicks.test(t.user.username)||this.regexhighlightcustom&&this.regexhighlightcustom.test(t.user.username+" "+t.message))),e.addMessage(this,t),!this.backlogloading&&t.highlighted&&this.settings.get("notificationhighlight")&&this.ishidden&&vt.showNotification(`${t.user.username} said ...`,t.message,t.timestamp.valueOf(),this.settings.get("notificationtimeout")),e.unlock(),t}resolveMessage(t,e){for(const s of this.unresolved)if(this.user.username.toLowerCase()===t.toLowerCase()&&s.message===e)return this.unresolved.splice(this.unresolved.indexOf(s),1),!0;return!1}removeMessageByNick(t){this.mainwindow.lock(),this.mainwindow.removelines(`.msg-chat[data-username="${t.toLowerCase()}"]`),this.mainwindow.unlock()}windowToFront(t){const e=this.windows.get(t);return null!==e&&e!==this.getActiveWindow()&&(this.windows.forEach(t=>{t.visible&&(t.locked()||t.lock(),t.hide())}),e.show(),e.locked()&&e.unlock(),this.redrawWindowIndicators()),e}getActiveWindow(){return[...this.windows.values()].filter(t=>t.visible)[0]}getWindow(t){return this.windows.get(t)}addWindow(t,e){this.windows.set(t,e),this.redrawWindowIndicators()}removeWindow(t){const e=this.windows.get(t);if(e){const s=e.visible;if(this.windows.delete(t),e.destroy(),s){const t=[...this.windows.keys()];this.windowToFront(this.windows.get(t[t.length-1]).name)}else this.redrawWindowIndicators()}}redrawWindowIndicators(){this.windows.size>1&&(this.windowselect.empty(),this.windows.forEach(t=>{if("main"===t.name)this.windowselect.append(``);else{const e=this.whispers.get(t.name);this.windowselect.append(`0?"unread":""}">\n ${t.label}${e.unread>0?" ("+e.unread+")":""}\n \n `)}})),null!==this.mainwindow&&this.mainwindow.lock(),this.windowselect.toggle(this.windows.size>1),null!==this.mainwindow&&this.mainwindow.unlock()}censor(t){this.mainwindow.lock();const e=this.mainwindow.getlines(`.msg-chat[data-username="${t.toLowerCase()}"]`);switch(parseInt(this.settings.get("showremoved")||1)){case 0:e.remove();break;case 1:e.addClass("censored")}this.mainwindow.unlock()}ignored(t,e=null){let s=this.ignoring.has(t.toLowerCase());return s||null===e?s:this.settings.get("ignorementions")&&this.ignoreregex&&this.ignoreregex.test(e)||this.settings.get("hidensfw")&&this.settings.get("hidensfl")&&ft.test(e)||this.settings.get("hidensfl")&&Tt.test(e)||this.settings.get("hidensfw")&&St.test(e)}ignore(t,e=!0){t=t.toLowerCase();const s=this.ignoring.has(t);e&&!s?this.ignoring.add(t):!e&&s&&this.ignoring.delete(t),this.settings.set("ignorenicks",[...this.ignoring]),this.applySettings()}focusIfNothingSelected(){void 0===this.debounceFocus&&(this.debounceFocus=Object(l.a)(10,!1,t=>t.input.focus())),window.getSelection().isCollapsed&&!this.input.is(":focus")&&this.debounceFocus(this)}onDISPATCH({data:t}){if("object"==typeof t){let e=[];const s=Date.now();t.hasOwnProperty("nick")&&e.push(this.addUser(t)),t.hasOwnProperty("users")&&(e=e.concat(Array.from(t.users).map(t=>this.addUser(t)))),e.forEach(t=>this.autocomplete.add(t.nick,!1,s))}}onCLOSE({retryMilli:t}){t>0?O.error(`Disconnected, retry in ${Math.round(t/1e3)} seconds ...`).into(this):O.error("Disconnected.").into(this)}onCONNECTING(t){this.authenticated?O.status(`Connecting as ${this.user.username} to ${vt.extractHostname(t)} ...`).into(this):O.status(`Connecting to ${vt.extractHostname(t)} ...`).into(this)}onOPEN(){}onNAMES(t){O.status(`Connected. serving ${t.connectioncount||0} connections and ${t.users.length} users.`).into(this),this.showmotd&&(this.cmdHINT([Math.floor(Math.random()*Nt.size)]),this.showmotd=!1)}onQUIT(t){const e=t.nick.toLowerCase();this.users.has(e)&&(this.users.delete(e),this.autocomplete.remove(t.nick,!0))}onMSG(t){const e=vt.removeSlashCmdFromText(t.data),s=this.users.get(t.nick.toLowerCase());if(this.chatvote&&!this.backlogloading)if(this.chatvote.isVoteStarted()){if(this.chatvote.isMsgVoteStopFmt(t.data))return void(this.chatvote.vote.user===s.username&&this.chatvote.endVote());if(this.chatvote.isMsgVoteCastFmt(e))return void(this.chatvote.castVote(e,s.username)&&s.username===this.user.username&&this.chatvote.markVote(e,s.username))}else if(this.chatvote.isMsgVoteStartFmt(t.data)&&this.chatvote.canUserStartVote(s))return void(this.chatvote.startVote(e,s.username)?O.info(`A vote has been started. Type ${this.chatvote.vote.totals.map((t,e)=>e+1).join(" or ")} in chat to participate.`).into(this):this.user.username===s.username&&O.error("Your vote failed to start. See console for logs."));const i=this.mainwindow;null!==i.lastmessage&&this.emotePrefixes.has(e)&&vt.removeSlashCmdFromText(i.lastmessage.message)===e?i.lastmessage.type===f.EMOTE?(this.mainwindow.lock(),i.lastmessage.incEmoteCount(),this.mainwindow.unlock()):(i.lastmessage.ui.remove(),O.emote(e,t.timestamp,2).into(this)):this.resolveMessage(t.nick,t.data)||O.message(t.data,s,t.timestamp).into(this)}onMUTE(t){this.user.username.toLowerCase()===t.data.toLowerCase()?O.command(`You have been muted by ${t.nick}.`,t.timestamp).into(this):O.command(`${t.data} muted by ${t.nick}.`,t.timestamp).into(this),this.censor(t.data)}onUNMUTE(t){this.user.username.toLowerCase()===t.data.toLowerCase()?O.command(`You have been unmuted by ${t.nick}.`,t.timestamp).into(this):O.command(`${t.data} unmuted by ${t.nick}.`,t.timestamp).into(this)}onBAN(t){this.user.username.toLowerCase()===t.data.toLowerCase()?(O.command(`You have been banned by ${t.nick}. Check your profile for more information.`,t.timestamp).into(this),this.cmdBANINFO()):O.command(`${t.data} banned by ${t.nick}.`,t.timestamp).into(this),this.censor(t.data)}onUNBAN(t){this.user.username.toLowerCase()===t.data.toLowerCase()?O.command(`You have been unbanned by ${t.nick}.`,t.timestamp).into(this):O.command(`${t.data} unbanned by ${t.nick}.`,t.timestamp).into(this)}onERR(t){"toomanyconnections"!==t&&"banned"!==t||(this.source.retryOnDisconnect=!1),O.error(Ot.get(t)||t).into(this,this.getActiveWindow())}onSOCKETERROR(t){}onSUBONLY(t){const e="on"===t.data?"enabled":"disabled";O.command(`Subscriber only mode ${e} by ${t.nick}`,t.timestamp).into(this)}onBROADCAST(t){if("reload"===t.data){if(!this.backlogloading){const t=Math.floor(3e4*Math.random())+4e3;setTimeout(()=>window.location.reload(!0),t),O.broadcast(`Restart incoming in ${Math.round(t/1e3)} seconds ...`).into(this)}}else O.broadcast(t.data,t.timestamp).into(this)}onPRIVMSGSENT(){this.mainwindow.visible&&O.info("Your message has been sent.").into(this)}onPRIVMSG(t){const e=t.nick.toLowerCase();if(!this.ignored(e,t.data)){this.whispers.has(e)||this.whispers.set(e,{nick:t.nick,unread:0,open:!1});const s=this.whispers.get(e),n=this.users.get(e)||new p(t.nick),o=t.hasOwnProperty("messageid")?t.messageid:null;this.settings.get("showhispersinchat")&&O.whisper(t.data,n,this.user.username,t.timestamp,o).into(this),this.settings.get("notificationwhisper")&&this.ishidden&&vt.showNotification(`${t.nick} whispered ...`,t.data,t.timestamp,this.settings.get("notificationtimeout"));const a=this.getWindow(e);a&&O.historical(t.data,n,t.timestamp).into(this,a),a===this.getActiveWindow()?Object(i.a)(`${this.config.api.base}/api/messages/msg/${o}/open`,{credentials:"include",method:"POST"}).catch(console.warn):s.unread++,this.replyusername=n.username,this.menus.get("whisper-users").redraw(),this.redrawWindowIndicators()}}cmdSEND(t){if(""!==t){const e=this.getActiveWindow(),s=t.match(At),i=s&&s.length>1,n=i&&"me"===s[1].toLowerCase(),o=vt.removeSlashCmdFromText(t);if(i&&!n){const i=s[1].toUpperCase(),n=i.toUpperCase();if(this.inputhistory.add(t),this.input.val(""),e!==this.mainwindow&&"EXIT"!==n)O.error("No commands in private windows. Try /exit").into(this,e);else if(this.control.listeners.has(n)){const e=(t.substring(i.length+1)||"").match(/([^ ]+)/g);this.control.emit(n,e||[])}else O.error("Unknown command. Try /help").into(this,e)}else if(this.authenticated)if(e!==this.mainwindow)O.message(t,this.user).into(this,e),this.source.send("PRIVMSG",{nick:e.name,data:t}),this.input.val("");else if(this.chatvote.isVoteStarted()&&this.chatvote.isMsgVoteCastFmt(o))this.chatvote.canVote(this.user.username)?(O.info("Your vote has been cast!").into(this),this.source.send("MSG",{data:t}),this.input.val("")):(O.error("You have already voted!").into(this),this.input.val(""));else if(this.source.isConnected()&&this.emotePrefixes.has(o))this.source.send("MSG",{data:t}),this.inputhistory.add(t),this.input.val("");else{const e=O.message(t,this.user).into(this);this.unresolved.unshift(e),this.source.send("MSG",{data:t}),this.inputhistory.add(t),this.input.val("")}else this.loginscrn.show()}}cmdVOTE(t){if(this.chatvote.isVoteStarted())O.error("Vote already started.").into(this);else if(this.chatvote.canUserStartVote(this.user)){const e="/vote "+t.join(" ");this.unresolved.unshift(O.message(e,this.user)),this.source.send("MSG",{data:e})}else O.error("You do not have permission to start a vote.").into(this)}cmdVOTESTOP(){if(this.chatvote.isVoteStarted())if(this.chatvote.canUserStartVote(this.user)&&this.chatvote.vote.user===this.user.nick){const t="/votestop";this.unresolved.unshift(O.message(t,this.user)),this.source.send("MSG",{data:t})}else O.error("You do not have permission to stop this vote.").into(this);else O.error("No vote started.").into(this)}cmdEMOTES(){O.info(`Available emoticons: ${[...this.emotes.map(t=>t.prefix)].join(", ")}`).into(this)}cmdHELP(){let t="Available commands: \r";Rt.forEach((e,s)=>{t+=` /${s} - ${e.desc} \r`}),O.info(t).into(this)}cmdHINT(t){const e=[...Nt],s=t&&t[0]?parseInt(t[0])-1:-1;s>0&&s").into(this):this.ignoring.size<=0?O.info("Your ignore list is empty").into(this):O.info(`Ignoring the following people: ${Array.from(this.ignoring.values()).join(", ")}`).into(this)}cmdUNIGNORE(t){const e=t[0]||null;e&&Ct.test(e)?(this.ignore(e,!1),O.status(`${e} has been removed from your ignore list`).into(this)):O.error("Invalid nick - /ignore ").into(this)}cmdMUTE(t){if(0===t.length)O.info("Usage: /mute [