Robin image optimizer — save money on image compression - Version 1.5.6

Version Description

  • Errors fixes
Download this release

Release Info

Developer webtemyk
Plugin Icon 128x128 Robin image optimizer — save money on image compression
Version 1.5.6
Comparing to
See all releases

Code changes from version 1.5.3 to 1.5.6

Files changed (53) hide show
  1. admin/activation.php +93 -93
  2. admin/ajax/backup.php +103 -103
  3. admin/ajax/bulk-optimization.php +0 -356
  4. admin/ajax/index.php +2 -2
  5. admin/ajax/logs.php +23 -23
  6. admin/ajax/meta-migrations.php +174 -174
  7. admin/ajax/multisite-update-current-blog.php +29 -29
  8. admin/ajax/settings.php +37 -37
  9. admin/assets/css/base-statistic.css +33 -14
  10. admin/assets/css/base-statistic.less +913 -888
  11. admin/assets/css/index.php +2 -2
  12. admin/assets/css/media.css +215 -215
  13. admin/assets/css/settings-premium.css +17 -17
  14. admin/assets/css/statistic.css +410 -410
  15. admin/assets/css/sweetalert-custom.css +155 -155
  16. admin/assets/css/sweetalert-custom.less +185 -185
  17. admin/assets/css/sweetalert2.css +716 -716
  18. admin/assets/img/index.php +2 -2
  19. admin/assets/index.php +2 -2
  20. admin/assets/js/Chart.min.js +10 -10
  21. admin/assets/js/bulk-conversion.js +393 -0
  22. admin/assets/js/bulk-optimization.js +639 -633
  23. admin/assets/js/index.php +2 -2
  24. admin/assets/js/meta-migrations.js +52 -52
  25. admin/assets/js/modals.js +59 -59
  26. admin/assets/js/restore-backup.js +162 -162
  27. admin/assets/js/settings-premium.js +2 -2
  28. admin/assets/js/single-optimization.js +101 -64
  29. admin/assets/js/statistic.js +76 -38
  30. admin/assets/js/sweetalert2.js +1641 -1641
  31. admin/boot.php +347 -347
  32. admin/includes/classes/class-rio-nextgen-landing.php +61 -61
  33. admin/includes/classes/class-rio-optimize-template.php +263 -226
  34. admin/includes/classes/index.php +2 -2
  35. admin/includes/index.php +2 -2
  36. admin/includes/sidebar-widgets.php +83 -83
  37. admin/index.php +2 -2
  38. admin/pages/class-rio-license.php +125 -125
  39. admin/pages/class-rio-log.php +100 -100
  40. admin/pages/class-rio-page.php +83 -83
  41. admin/pages/class-rio-settings.php +625 -620
  42. admin/pages/class-rio-statistic.php +306 -279
  43. admin/pages/index.php +2 -2
  44. assets/js/jquery.lazy.js +0 -872
  45. assets/js/jquery.lazy.min.js +0 -2
  46. assets/js/lazy-load.js +11 -11
  47. assets/js/lozad.min.js +9 -9
  48. includes/class-rio-plugin.php +212 -209
  49. includes/classes/class-rio-attachment.php +1009 -992
  50. includes/classes/class-rio-backup.php +535 -535
  51. includes/classes/class-rio-bulk-optimization.php +664 -461
  52. includes/classes/class-rio-cron.php +190 -148
  53. includes/classes/class-rio-image-statistic.php +78 -411
admin/activation.php CHANGED
@@ -1,93 +1,93 @@
1
- <?php
2
-
3
- /**
4
- * Activator for the Robin image optimizer
5
- *
6
- * @author Webcraftic <wordpress.webraftic@gmail.com>
7
- * @copyright (c) 09.09.2017, Webcraftic
8
- * @see Factory446_Activator
9
- * @version 1.0
10
- */
11
-
12
- // Exit if accessed directly
13
- if ( ! defined( 'ABSPATH' ) ) {
14
- exit;
15
- }
16
-
17
- class WIO_Activation extends Wbcr_Factory446_Activator {
18
-
19
- /**
20
- * Runs activation actions.
21
- *
22
- * @since 1.0.0
23
- * @throws \Exception
24
- */
25
- public function activate() {
26
- WRIO_Plugin::app()->logger->info( 'Parent plugin start installation!' );
27
-
28
- WRIO_Plugin::app()->updatePopulateOption( 'image_optimization_server', 'server_1' );
29
- WRIO_Plugin::app()->updatePopulateOption( 'backup_origin_images', 1 );
30
- WRIO_Plugin::app()->updatePopulateOption( 'save_exif_data', 1 );
31
-
32
- if ( function_exists( 'wrio_is_license_activate' ) && wrio_is_license_activate() ) {
33
- WRIO_Plugin::app()->logger->info( 'Premium plugin start installation!' );
34
- require_once( WRIO_PLUGIN_DIR . '/libs/addons/robin-image-optimizer-premium.php' );
35
- wrio_premium_activate();
36
- WRIO_Plugin::app()->logger->info( 'Premium plugin installation complete!' );
37
- }
38
-
39
- $db_version = RIO_Process_Queue::get_db_version();
40
- $plugin_version_in_db = $this->get_plugin_version_in_db();
41
- $current_plugin_version = $this->plugin->getPluginVersion();
42
-
43
- $create_table_log_message = "Plugin installation: try create plugin tables.\r\n";
44
- $create_table_log_message .= "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t-DB Version: {$db_version}\r\n";
45
- $create_table_log_message .= "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t-Plugin Version in DB: {$plugin_version_in_db}\r\n";
46
- $create_table_log_message .= "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t-Current Plugin Version: {$current_plugin_version}";
47
-
48
- WRIO_Plugin::app()->logger->info( $create_table_log_message );
49
-
50
- RIO_Process_Queue::try_create_plugin_tables();
51
-
52
- WbcrFactoryClearfy237_Helpers::flushPageCache();
53
-
54
- WRIO_Plugin::app()->logger->info( 'Parent plugin installation complete!' );
55
- }
56
-
57
- /**
58
- * Get previous plugin version
59
- *
60
- * @author Alexander Kovalev <alex.kovalevv@gmail.com>
61
- * @since 1.3.8
62
- * @return number
63
- */
64
- public function get_plugin_version_in_db() {
65
- if ( WRIO_Plugin::app()->isNetworkActive() ) {
66
- return get_site_option( WRIO_Plugin::app()->getOptionName( 'plugin_version' ), 0 );
67
- }
68
-
69
- return get_option( WRIO_Plugin::app()->getOptionName( 'plugin_version' ), 0 );
70
- }
71
-
72
- /**
73
- * Runs activation actions.
74
- *
75
- * @since 1.0.0
76
- */
77
- public function deactivate() {
78
- WRIO_Plugin::app()->logger->info( 'Parent plugin start deactivation!' );
79
-
80
- if ( class_exists( 'WRIO_Cron' ) ) {
81
- WRIO_Cron::stop();
82
- }
83
-
84
- if ( function_exists( 'wrio_is_license_activate' ) && wrio_is_license_activate() ) {
85
- WRIO_Plugin::app()->logger->info( 'Premium plugin start deactivation!' );
86
- require_once( WRIO_PLUGIN_DIR . '/libs/addons/robin-image-optimizer-premium.php' );
87
- wrio_premium_deactivate();
88
- WRIO_Plugin::app()->logger->info( 'Premium plugin deactivation complete!' );
89
- }
90
-
91
- WRIO_Plugin::app()->logger->info( 'Parent plugin deactivation complete!' );
92
- }
93
- }
1
+ <?php
2
+
3
+ /**
4
+ * Activator for the Robin image optimizer
5
+ *
6
+ * @author Webcraftic <wordpress.webraftic@gmail.com>
7
+ * @copyright (c) 09.09.2017, Webcraftic
8
+ * @see Factory450_Activator
9
+ * @version 1.0
10
+ */
11
+
12
+ // Exit if accessed directly
13
+ if ( ! defined( 'ABSPATH' ) ) {
14
+ exit;
15
+ }
16
+
17
+ class WIO_Activation extends Wbcr_Factory450_Activator {
18
+
19
+ /**
20
+ * Runs activation actions.
21
+ *
22
+ * @since 1.0.0
23
+ * @throws \Exception
24
+ */
25
+ public function activate() {
26
+ WRIO_Plugin::app()->logger->info( 'Parent plugin start installation!' );
27
+
28
+ WRIO_Plugin::app()->updatePopulateOption( 'image_optimization_server', 'server_1' );
29
+ WRIO_Plugin::app()->updatePopulateOption( 'backup_origin_images', 1 );
30
+ WRIO_Plugin::app()->updatePopulateOption( 'save_exif_data', 1 );
31
+
32
+ if ( function_exists( 'wrio_is_license_activate' ) && wrio_is_license_activate() ) {
33
+ WRIO_Plugin::app()->logger->info( 'Premium plugin start installation!' );
34
+ require_once( WRIO_PLUGIN_DIR . '/libs/addons/robin-image-optimizer-premium.php' );
35
+ wrio_premium_activate();
36
+ WRIO_Plugin::app()->logger->info( 'Premium plugin installation complete!' );
37
+ }
38
+
39
+ $db_version = RIO_Process_Queue::get_db_version();
40
+ $plugin_version_in_db = $this->get_plugin_version_in_db();
41
+ $current_plugin_version = $this->plugin->getPluginVersion();
42
+
43
+ $create_table_log_message = "Plugin installation: try create plugin tables.\r\n";
44
+ $create_table_log_message .= "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t-DB Version: {$db_version}\r\n";
45
+ $create_table_log_message .= "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t-Plugin Version in DB: {$plugin_version_in_db}\r\n";
46
+ $create_table_log_message .= "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t-Current Plugin Version: {$current_plugin_version}";
47
+
48
+ WRIO_Plugin::app()->logger->info( $create_table_log_message );
49
+
50
+ RIO_Process_Queue::try_create_plugin_tables();
51
+
52
+ WBCR\Factory_Templates_102\Helpers::flushPageCache();
53
+
54
+ WRIO_Plugin::app()->logger->info( 'Parent plugin installation complete!' );
55
+ }
56
+
57
+ /**
58
+ * Get previous plugin version
59
+ *
60
+ * @author Alexander Kovalev <alex.kovalevv@gmail.com>
61
+ * @since 1.3.8
62
+ * @return number
63
+ */
64
+ public function get_plugin_version_in_db() {
65
+ if ( WRIO_Plugin::app()->isNetworkActive() ) {
66
+ return get_site_option( WRIO_Plugin::app()->getOptionName( 'plugin_version' ), 0 );
67
+ }
68
+
69
+ return get_option( WRIO_Plugin::app()->getOptionName( 'plugin_version' ), 0 );
70
+ }
71
+
72
+ /**
73
+ * Runs activation actions.
74
+ *
75
+ * @since 1.0.0
76
+ */
77
+ public function deactivate() {
78
+ WRIO_Plugin::app()->logger->info( 'Parent plugin start deactivation!' );
79
+
80
+ if ( class_exists( 'WRIO_Cron' ) ) {
81
+ WRIO_Cron::stop();
82
+ }
83
+
84
+ if ( function_exists( 'wrio_is_license_activate' ) && wrio_is_license_activate() ) {
85
+ WRIO_Plugin::app()->logger->info( 'Premium plugin start deactivation!' );
86
+ require_once( WRIO_PLUGIN_DIR . '/libs/addons/robin-image-optimizer-premium.php' );
87
+ wrio_premium_deactivate();
88
+ WRIO_Plugin::app()->logger->info( 'Premium plugin deactivation complete!' );
89
+ }
90
+
91
+ WRIO_Plugin::app()->logger->info( 'Parent plugin deactivation complete!' );
92
+ }
93
+ }
admin/ajax/backup.php CHANGED
@@ -1,103 +1,103 @@
1
- <?php
2
- /**
3
- * Back-up related filters.
4
- *
5
- * @author Webcraftic <wordpress.webraftic@gmail.com>
6
- * @copyright (c) 2018 Webraftic Ltd
7
- * @version 1.0
8
- */
9
-
10
- // Exit if accessed directly
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- }
14
-
15
- /**
16
- * AJAX обработчик восстановления из резервной копии
17
- */
18
- add_action( 'wp_ajax_wio_restore_backup', function () {
19
- check_admin_referer( 'wio-iph' );
20
-
21
- if ( ! current_user_can( 'manage_options' ) ) {
22
- wp_die( - 1 );
23
- }
24
-
25
- $max_process_per_request = 25;
26
-
27
- //$blog_id = WRIO_Plugin::app()->request->post( 'blog_id', null, true );
28
-
29
- /*if ( $blog_id !== null ) {
30
- switch_to_blog( $blog_id );
31
- }*/
32
-
33
- // Total number of remained images to restore
34
- $remane_count = 0;
35
-
36
- $total = 0;
37
-
38
- $filter_results = apply_filters( 'wbcr/rio/backup/restore_filter', $max_process_per_request );
39
-
40
- if ( isset( $filter_results['remane'] ) ) {
41
- $remane_count += $filter_results['remane'];
42
- }
43
-
44
- if ( isset( $filter_results['total'] ) ) {
45
- $total += $filter_results['total'];
46
- }
47
-
48
- $media_library = WRIO_Media_Library::get_instance();
49
-
50
- $total += $media_library->getOptimizedCount();
51
-
52
- $restored_data = $media_library->restoreAllFromBackup( $max_process_per_request );
53
-
54
- if ( isset( $restored_data['remain'] ) ) {
55
- $remane_count += $restored_data['remain'];
56
- }
57
-
58
- /*if ( $blog_id !== null ) {
59
- restore_current_blog();
60
- }*/
61
-
62
- $restored_data['total'] = $total;
63
-
64
- if ( $total > 0 ) {
65
- $restored_data['percent'] = 100 - ( $remane_count * 100 / $total );
66
- } else {
67
- $restored_data['percent'] = 0;
68
- }
69
-
70
- // если изображения закончились - посылаем команду завершения
71
- if ( $remane_count <= 0 ) {
72
- $restored_data['end'] = true;
73
- }
74
-
75
- wp_send_json( $restored_data );
76
- } );
77
-
78
- /**
79
- * AJAX обработчик очистки папки с бекапами
80
- */
81
- add_action( 'wp_ajax_wio_clear_backup', function () {
82
- check_admin_referer( 'wio-iph' );
83
-
84
- if ( ! current_user_can( 'manage_options' ) ) {
85
- wp_die( - 1 );
86
- }
87
-
88
- $backup = WIO_Backup::get_instance();
89
- $blogs = WRIO_Plugin::app()->request->post( 'blogs', [], true );
90
-
91
- if ( ! empty( $blogs ) ) {
92
- foreach ( $blogs as $blog_id ) {
93
- switch_to_blog( intval( $blog_id ) );
94
- $backup->removeBlogBackupDir();
95
- restore_current_blog();
96
- }
97
- } else {
98
- $backup->removeBackupDir();
99
- }
100
-
101
- wp_send_json( true );
102
- } );
103
-
1
+ <?php
2
+ /**
3
+ * Back-up related filters.
4
+ *
5
+ * @author Webcraftic <wordpress.webraftic@gmail.com>
6
+ * @copyright (c) 2018 Webraftic Ltd
7
+ * @version 1.0
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ }
14
+
15
+ /**
16
+ * AJAX обработчик восстановления из резервной копии
17
+ */
18
+ add_action( 'wp_ajax_wio_restore_backup', function () {
19
+ check_admin_referer( 'wio-iph' );
20
+
21
+ if ( ! current_user_can( 'manage_options' ) ) {
22
+ wp_die( - 1 );
23
+ }
24
+
25
+ $max_process_per_request = 25;
26
+
27
+ //$blog_id = WRIO_Plugin::app()->request->post( 'blog_id', null, true );
28
+
29
+ /*if ( $blog_id !== null ) {
30
+ switch_to_blog( $blog_id );
31
+ }*/
32
+
33
+ // Total number of remained images to restore
34
+ $remane_count = 0;
35
+
36
+ $total = 0;
37
+
38
+ $filter_results = apply_filters( 'wbcr/rio/backup/restore_filter', $max_process_per_request );
39
+
40
+ if ( isset( $filter_results['remane'] ) ) {
41
+ $remane_count += $filter_results['remane'];
42
+ }
43
+
44
+ if ( isset( $filter_results['total'] ) ) {
45
+ $total += $filter_results['total'];
46
+ }
47
+
48
+ $media_library = WRIO_Media_Library::get_instance();
49
+
50
+ $total += $media_library->getOptimizedCount();
51
+
52
+ $restored_data = $media_library->restoreAllFromBackup( $max_process_per_request );
53
+
54
+ if ( isset( $restored_data['remain'] ) ) {
55
+ $remane_count += $restored_data['remain'];
56
+ }
57
+
58
+ /*if ( $blog_id !== null ) {
59
+ restore_current_blog();
60
+ }*/
61
+
62
+ $restored_data['total'] = $total;
63
+
64
+ if ( $total > 0 ) {
65
+ $restored_data['percent'] = 100 - ( $remane_count * 100 / $total );
66
+ } else {
67
+ $restored_data['percent'] = 0;
68
+ }
69
+
70
+ // если изображения закончились - посылаем команду завершения
71
+ if ( $remane_count <= 0 ) {
72
+ $restored_data['end'] = true;
73
+ }
74
+
75
+ wp_send_json( $restored_data );
76
+ } );
77
+
78
+ /**
79
+ * AJAX обработчик очистки папки с бекапами
80
+ */
81
+ add_action( 'wp_ajax_wio_clear_backup', function () {
82
+ check_admin_referer( 'wio-iph' );
83
+
84
+ if ( ! current_user_can( 'manage_options' ) ) {
85
+ wp_die( - 1 );
86
+ }
87
+
88
+ $backup = WIO_Backup::get_instance();
89
+ $blogs = WRIO_Plugin::app()->request->post( 'blogs', [], true );
90
+
91
+ if ( ! empty( $blogs ) ) {
92
+ foreach ( $blogs as $blog_id ) {
93
+ switch_to_blog( intval( $blog_id ) );
94
+ $backup->removeBlogBackupDir();
95
+ restore_current_blog();
96
+ }
97
+ } else {
98
+ $backup->removeBackupDir();
99
+ }
100
+
101
+ wp_send_json( true );
102
+ } );
103
+
admin/ajax/bulk-optimization.php DELETED
@@ -1,356 +0,0 @@
1
- <?php
2
- /**
3
- * @author Webcraftic <wordpress.webraftic@gmail.com>
4
- * @copyright (c) 2018 Webraftic Ltd
5
- * @version 1.0
6
- */
7
-
8
- // Exit if accessed directly
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- /**
14
- * Cron start
15
- */
16
- add_action( 'wp_ajax_wrio-cron-start', function () {
17
- check_ajax_referer( 'bulk_optimization' );
18
-
19
- if ( ! current_user_can( 'manage_options' ) ) {
20
- wp_die( - 1 );
21
- }
22
-
23
- $scope = WRIO_Plugin::app()->request->request( 'scope', null, true );
24
-
25
- if ( empty( $scope ) ) {
26
- wp_die( - 1 );
27
- }
28
-
29
- // where was runned cron
30
- $cron_running_place = WRIO_Plugin::app()->getPopulateOption( 'cron_running', false );
31
-
32
- if ( $scope == $cron_running_place ) {
33
- wp_send_json_success();
34
- }
35
-
36
- WRIO_Plugin::app()->updatePopulateOption( 'cron_running', $scope );
37
- WRIO_Cron::start();
38
-
39
- wp_send_json_success();
40
- } );
41
-
42
- /**
43
- * Cron stop
44
- */
45
- add_action( 'wp_ajax_wrio-cron-stop', function () {
46
- check_ajax_referer( 'bulk_optimization' );
47
-
48
- if ( ! current_user_can( 'manage_options' ) ) {
49
- wp_die( - 1 );
50
- }
51
-
52
- WRIO_Plugin::app()->updatePopulateOption( 'cron_running', false );
53
- WRIO_Cron::stop();
54
-
55
- wp_send_json_success();
56
- } );
57
-
58
- /**
59
- * AJAX обработчик массовой оптимизации изображений со страницы статистики
60
- */
61
- add_action( 'wp_ajax_wrio-bulk-optimization-process', function () {
62
- check_admin_referer( 'bulk_optimization' );
63
-
64
- if ( ! current_user_can( 'manage_options' ) ) {
65
- wp_die( - 1 );
66
- }
67
-
68
- $reset_current_error = (bool) WRIO_Plugin::app()->request->request( 'reset_current_errors' );
69
- $scope = WRIO_Plugin::app()->request->request( 'scope', null, true );
70
-
71
- WRIO_Logger::info( sprintf( 'Start bulk optimization process! Scope: %s', $scope ) );
72
-
73
- if ( empty( $scope ) ) {
74
- wp_die( - 1 );
75
- }
76
-
77
- // Context class name. If plugin expands with add-ons
78
- $class_name = 'WRIO_' . wrio_dashes_to_camel_case( $scope, true );
79
-
80
- if ( ! class_exists( $class_name ) ) {
81
- WRIO_Logger::error( sprintf( 'Bulk optimization error: Context class (%s) not found.', $class_name ) );
82
-
83
- //todo: Temporary bug fix.
84
- if ( 'media-library' === $scope ) {
85
- $class_name = 'WRIO_Media_Library';
86
- } else if ( 'custom-folders' === $scope ) {
87
- $class_name = 'WRIO_Custom_Folders';
88
- } else if ( 'nextgen-gallery' == $scope ) {
89
- $class_name = 'WRIO_Nextgen_Gallery';
90
- }
91
-
92
- if ( ! class_exists( $class_name ) ) {
93
- wp_send_json_error( [ 'error_message' => 'Context class not found.' ] );
94
- }
95
- }
96
-
97
- /**
98
- * Create an instance of the class depending on the context in which scope user
99
- * has runned optimization.
100
- *
101
- * @see WRIO_Media_Library
102
- * @see WRIO_Custom_Folders
103
- * @see WRIO_Nextgen_Gallery
104
- */
105
- $optimizer = new $class_name();
106
-
107
- // в ajax запросе мы не знаем, получен ли он из мультиадминки или из обычной. Поэтому проверяем параметр, полученный из frontend
108
- /*if ( isset( $_POST['multisite'] ) && (bool) $_POST['multisite'] ) {
109
- $multisite = new WIO_Multisite;
110
- $multisite->initHooks();
111
- }*/
112
-
113
- if ( $reset_current_error ) {
114
- $optimizer->resetCurrentErrors(); // сбрасываем текущие ошибки оптимизации
115
- }
116
-
117
- $result = $optimizer->processUnoptimizedImages( 1 );
118
-
119
- if ( is_wp_error( $result ) ) {
120
- $error_massage = $result->get_error_message();
121
-
122
- if ( empty( $error ) ) {
123
- $error_massage = __( "Unknown error. Enable error log on the plugin's settings page, then check the error report on the Error Log page. You can export the error report and send it to the support service of the plugin.", "robin-image-optimizer" );
124
- }
125
-
126
- WRIO_Logger::error( sprintf( 'Bulk optimization error: %s.', $result->get_error_message() ) );
127
-
128
- wp_send_json_error( [ 'error_message' => $error_massage ] );
129
- }
130
-
131
- // если изображения закончились - посылаем команду завершения
132
- if ( $result['remain'] <= 0 ) {
133
- $result['end'] = true;
134
- }
135
-
136
- WRIO_Logger::info( sprintf( 'End bulk optimization process! Scope: %s. Remain: %d', $scope, $result['remain'] ) );
137
-
138
- wp_send_json_success( $result );
139
- } );
140
-
141
- /**
142
- * Переоптимизация аттачмента
143
- */
144
- add_action( 'wp_ajax_wio_reoptimize_image', function () {
145
-
146
- if ( ! current_user_can( 'manage_options' ) ) {
147
- wp_die( - 1 );
148
- }
149
-
150
- $default_level = WRIO_Plugin::app()->getPopulateOption( 'image_optimization_level', 'normal' );
151
-
152
- $attachment_id = (int) WRIO_Plugin::app()->request->post( 'id' );
153
- $level = WRIO_Plugin::app()->request->post( 'level', $default_level, true );
154
-
155
- $backup = WIO_Backup::get_instance();
156
- $media_library = WRIO_Media_Library::get_instance();
157
- $backup_origin_images = WRIO_Plugin::app()->getPopulateOption( 'backup_origin_images', false );
158
-
159
- if ( $backup_origin_images && ! $backup->isBackupWritable() ) {
160
- echo $media_library->getMediaColumnContent( $attachment_id );
161
- die();
162
- }
163
-
164
- $optimized_data = $media_library->optimizeAttachment( $attachment_id, $level );
165
-
166
- if ( $optimized_data && isset( $optimized_data['processing'] ) ) {
167
- echo 'processing';
168
- die();
169
- }
170
-
171
- echo $media_library->getMediaColumnContent( $attachment_id );
172
- die();
173
- } );
174
-
175
- /**
176
- * Восстановление аттачмента из резервной копии
177
- */
178
- add_action( 'wp_ajax_wio_restore_image', function () {
179
-
180
- if ( ! current_user_can( 'manage_options' ) ) {
181
- wp_die( - 1 );
182
- }
183
-
184
- $attachment_id = (int) WRIO_Plugin::app()->request->post( 'id' );
185
-
186
- $media_library = WRIO_Media_Library::get_instance();
187
- $wio_attachment = $media_library->getAttachment( $attachment_id );
188
-
189
- if ( $wio_attachment->isOptimized() ) {
190
- $media_library->restoreAttachment( $attachment_id );
191
- }
192
-
193
- echo $media_library->getMediaColumnContent( $attachment_id );
194
- die();
195
- } );
196
-
197
- /**
198
- * На странице массовой оптмизации есть поле для выбора сервера. Когда пользователь
199
- * выберет какой-то сервер, выполняется этот ajax обработчик. Обработчик пингует выбранный
200
- * пользователем сервер и возвращает статус пинга (если пинг успешен, то сервер переход в
201
- * статус выбранный).
202
- */
203
- add_action( 'wp_ajax_wbcr-rio-check-servers-status', function () {
204
-
205
- check_ajax_referer( 'bulk_optimization' );
206
-
207
- if ( ! current_user_can( 'manage_options' ) ) {
208
- wp_die( - 1 );
209
- }
210
-
211
- $server_name = WRIO_Plugin::app()->request->post( 'server_name' );
212
-
213
- if ( empty( $server_name ) || ! in_array( $server_name, [
214
- 'server_1',
215
- 'server_2',
216
- 'server_5'
217
- ] ) ) {
218
- wp_send_json_error( [ 'error' => __( 'Server name is empty!', 'robin-image-optimizer' ) ] );
219
- }
220
-
221
- // Позволяем выбрать сервер, даже если он недоступен.
222
- WRIO_Plugin::app()->updatePopulateOption( 'image_optimization_server', $server_name );
223
-
224
- // Проверяем доступность сервер
225
- // --------------------------------------------------------------------
226
- $return_data = [ 'server_name' => $server_name ];
227
-
228
- $server_url = wrio_get_server_url( $server_name );
229
- $headers = [];
230
-
231
- $method = 'POST';
232
-
233
- if ( $server_name == 'server_2' ) {
234
- $api_url = "https://dev.robinoptimizer.com/v1/free/license/check";
235
- $method = 'GET';
236
- $host = get_option( 'siteurl' );
237
- $headers['Authorization'] = 'Bearer ' . base64_encode( $host );
238
- } else if ( $server_name == 'server_5' ) {
239
- $api_url = "https://dashboard.robinoptimizer.com/v1/license/check";
240
- $method = 'GET';
241
- $headers['Authorization'] = 'Bearer ' . base64_encode( wrio_get_license_key() );
242
- $headers['PluginId'] = wrio_get_freemius_plugin_id();
243
- } else {
244
- $api_url = $server_url;
245
- }
246
-
247
- $request = wp_remote_request( $api_url, [
248
- 'method' => $method,
249
- 'headers' => $headers
250
- ] );
251
-
252
- if ( is_wp_error( $request ) ) {
253
- $er_msg = $request->get_error_message();
254
-
255
- $return_data['error'] = $er_msg;
256
- wp_send_json_error( $return_data );
257
- }
258
-
259
- $response_code = wp_remote_retrieve_response_code( $request );
260
-
261
- if ( $response_code != 200 ) {
262
- $return_data['error'] = 'Server response ' . $response_code;
263
- wp_send_json_error( $return_data );
264
- }
265
-
266
- wp_send_json_success( $return_data );
267
- } );
268
-
269
- /**
270
- * На странице массовой оптмизации есть поле для выбора сервера. Когда пользователь
271
- * выберет какой-то сервер, выполняется этот ajax обработчик. Обработчик пингует выбранный
272
- * пользователем сервер и возвращает статус пинга (если пинг успешен, то сервер переход в
273
- * статус выбранный).
274
- */
275
- add_action( 'wp_ajax_wbcr-rio-check-user-balance', function () {
276
-
277
- check_ajax_referer( 'bulk_optimization' );
278
-
279
- if ( ! current_user_can( 'manage_options' ) ) {
280
- wp_die( - 1 );
281
- }
282
-
283
- $optimization_server = $server_name = WRIO_Plugin::app()->request->post( 'server_name' );
284
- // $optimization_server = WRIO_Plugin::app()->getPopulateOption( 'image_optimization_server' );
285
- if ( $optimization_server !== 'server_5' && $optimization_server !== 'server_2' ) {
286
- $processor = WIO_OptimizationTools::getImageProcessor();
287
-
288
- $processor->checkLimits( false );
289
-
290
- $usage = (int) WRIO_Plugin::app()->getPopulateOption( $processor->getUsageOptionName(), 0 );
291
- $remaining = $processor->iamokay() - $usage;
292
- wp_send_json_success( [
293
- 'balance' => $remaining,
294
- ] );
295
- }
296
-
297
- if ( $optimization_server == 'server_2') {
298
- $api_url = "https://dev.robinoptimizer.com/v1/free/license/remaining";
299
- $host = get_option( 'siteurl' );
300
- $headers['Authorization'] = 'Bearer ' . base64_encode( $host );
301
- } elseif ( $optimization_server == 'server_5') {
302
- $api_url = 'https://dashboard.robinoptimizer.com/v1/license/remaining';
303
- $headers['Authorization'] = 'Bearer ' . base64_encode( wrio_get_license_key() );
304
- $headers['PluginId'] = wrio_get_freemius_plugin_id();
305
- }
306
-
307
-
308
- $request = wp_remote_request( $api_url, [
309
- 'method' => 'GET',
310
- 'headers' => $headers
311
- ] );
312
-
313
- if ( is_wp_error( $request ) ) {
314
- $error_msg = $request->get_error_message();
315
-
316
- $return_data['error'] = $error_msg;
317
- wp_send_json_error( $return_data );
318
- }
319
-
320
- $response_code = wp_remote_retrieve_response_code( $request );
321
- $response_body = wp_remote_retrieve_body( $request );
322
-
323
- if ( $response_code != 200 ) {
324
- $return_data['error'] = 'Server response ' . $response_code;
325
- if ( $response_code === 401 ) {
326
- $error_data = @json_decode( $response_body );
327
- $return_data['error'] = $error_data->message;
328
- }
329
- wp_send_json_error( $return_data );
330
- }
331
-
332
- if ( empty( $response_body ) ) {
333
- $return_data['error'] = "Server responded an empty request body!";
334
- wp_send_json_error( $return_data );
335
- }
336
-
337
- $data = @json_decode( $response_body );
338
-
339
- if ( ! isset( $data->status ) || $data->status != 'ok' ) {
340
- $return_data['error'] = "Server responded an fail status";
341
- wp_send_json_error( $return_data );
342
- }
343
-
344
- $current_quota = (int) $data->response->quota;
345
- WRIO_Plugin::app()->app()->updateOption( 'current_quota', $current_quota );
346
-
347
- $output = ['balance' => $current_quota];
348
-
349
- if ( $optimization_server == 'server_5') {
350
- $reset_at = (int) $data->response->reset_at;
351
- $reset_at += (int) get_option('gmt_offset', 0);
352
- $output['reset_at'] = date('d-m-Y H:i', $reset_at);
353
- }
354
-
355
- wp_send_json_success( $output );
356
- } );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/ajax/index.php CHANGED
@@ -1,2 +1,2 @@
1
- <?php
2
- // silence is golden
1
+ <?php
2
+ // silence is golden
admin/ajax/logs.php CHANGED
@@ -1,24 +1,24 @@
1
- <?php
2
-
3
- /**
4
- * Used to clean-up logs.
5
- */
6
- add_action( 'wp_ajax_wrio_logs_cleanup', function () {
7
- check_admin_referer( 'wrio_clean_logs', 'nonce' );
8
-
9
- if ( ! current_user_can( 'manage_options' ) ) {
10
- wp_die( - 1 );
11
- }
12
-
13
- if ( ! WRIO_Plugin::app()->logger->clean_up() ) {
14
- wp_send_json_error( [
15
- 'message' => esc_html__( 'Failed to clean-up logs. Please try again later.', 'robin-image-optimizer' ),
16
- 'type' => 'danger',
17
- ] );
18
- }
19
-
20
- wp_send_json( [
21
- 'message' => esc_html__( 'Logs clean-up successfully', 'robin-image-optimizer' ),
22
- 'type' => 'success',
23
- ] );
24
  } );
1
+ <?php
2
+
3
+ /**
4
+ * Used to clean-up logs.
5
+ */
6
+ add_action( 'wp_ajax_wrio_logs_cleanup', function () {
7
+ check_admin_referer( 'wrio_clean_logs', 'nonce' );
8
+
9
+ if ( ! current_user_can( 'manage_options' ) ) {
10
+ wp_die( - 1 );
11
+ }
12
+
13
+ if ( ! WRIO_Plugin::app()->logger->clean_up() ) {
14
+ wp_send_json_error( [
15
+ 'message' => esc_html__( 'Failed to clean-up logs. Please try again later.', 'robin-image-optimizer' ),
16
+ 'type' => 'danger',
17
+ ] );
18
+ }
19
+
20
+ wp_send_json( [
21
+ 'message' => esc_html__( 'Logs clean-up successfully', 'robin-image-optimizer' ),
22
+ 'type' => 'success',
23
+ ] );
24
  } );
admin/ajax/meta-migrations.php CHANGED
@@ -1,174 +1,174 @@
1
- <?php
2
- /**
3
- * Ajax action to migrate old architecture based on post meta into new table.
4
- *
5
- * @author Webcraftic <wordpress.webraftic@gmail.com>
6
- * @author Alexander Teshabaev <sasha.tesh@gmail.com>
7
- * @see RIO_Process_Queue for further information.
8
- *
9
- * @copyright (c) 2018 Webraftic Ltd
10
- * @version 1.0
11
- */
12
-
13
- // Exit if accessed directly
14
- if ( ! defined( 'ABSPATH' ) ) {
15
- exit;
16
- }
17
-
18
- add_action( 'wp_ajax_wrio_meta_migrations', 'wbcr_rio_migrate_postmeta_to_process_queue' );
19
-
20
- /**
21
- * Migrating postmeta to newly created table.
22
- *
23
- * @author Alexander Teshabaev <sasha.tesh@gmail.com>
24
- * @since 1.3.0
25
- * @see RIO_Process_Queue as referce for new table.
26
- */
27
- function wbcr_rio_migrate_postmeta_to_process_queue() {
28
- global $wpdb;
29
-
30
- check_admin_referer( 'wrio-meta-migrations' );
31
-
32
- if ( ! current_user_can( 'manage_options' ) ) {
33
- wp_die( - 1 );
34
- }
35
-
36
- $error = (int) WRIO_Plugin::app()->request->post( 'error', 0 );
37
-
38
- if ( $error ) {
39
- WRIO_Plugin::app()->logger->error( 'Previous migration was not completed due to an error.' );
40
- }
41
-
42
- $limit = (int) WRIO_Plugin::app()->request->post( 'limit', 150 );
43
-
44
- $processed_items = 0;
45
-
46
- WRIO_Plugin::app()->logger->info( 'Start meta migration. Limit ' . $limit );
47
- WRIO_Plugin::app()->logger->memory_usage();
48
-
49
- $attachments = wbcr_rio_get_meta_to_migrate();
50
-
51
- if ( isset( $attachments->posts ) && ( $attachments_total = count( $attachments->posts ) ) > 0 ) {
52
-
53
- if ( $attachments_total < $limit ) {
54
- $limit = $attachments_total;
55
- }
56
-
57
- WRIO_Plugin::app()->logger->info( 'Finded ' . $attachments_total . ' attachments for migration.' );
58
-
59
- if ( function_exists( 'wp_raise_memory_limit' ) ) {
60
- wp_raise_memory_limit( 'image' );
61
- }
62
-
63
- WRIO_Plugin::app()->logger->memory_usage();
64
-
65
- /**
66
- * @var WP_Post $attachment
67
- */
68
- for ( $i = 0; $i < $limit; $i ++ ) {
69
- $attachment = $attachments->posts[ $i ];
70
- $post_meta = get_post_custom( $attachment->ID );
71
-
72
- $extra_data = new RIO_Attachment_Extra_Data();
73
-
74
- $is_backed_up = false;
75
- $original_size = 0;
76
- $final_size = 0;
77
-
78
- if ( isset( $post_meta['wio_backuped'][0] ) && $post_meta['wio_backuped'][0] ) {
79
- $is_backed_up = true;
80
- }
81
-
82
- if ( isset( $post_meta['wio_thumbnails_count'][0] ) ) {
83
- $extra_data->set_thumbnails_count( intval( $post_meta['wio_thumbnails_count'][0] ) );
84
- }
85
-
86
- if ( isset( $post_meta['wio_original_size'][0] ) ) {
87
- $original_size = intval( $post_meta['wio_original_size'][0] );
88
- }
89
-
90
- if ( isset( $post_meta['wio_optimized_size'][0] ) ) {
91
- $final_size = intval( $post_meta['wio_optimized_size'][0] );
92
- }
93
-
94
- if ( isset( $post_meta['wio_original_main_size'][0] ) ) {
95
- $extra_data->set_original_main_size( intval( $post_meta['wio_original_main_size'][0] ) );
96
- }
97
-
98
- if ( isset( $post_meta['wio_error'][0] ) ) {
99
- $extra_data->set_error( 'optimization' );
100
- $extra_data->set_error_msg( $post_meta['wio_error'][0] );
101
- }
102
-
103
- $level = 'normal';
104
-
105
- if ( isset( $post_meta['wio_optimization_level'][0] ) && ! empty( $post_meta['wio_optimization_level'][0] ) ) {
106
- $level = $post_meta['wio_optimization_level'][0];
107
- }
108
-
109
- $data = [
110
- 'server_id' => null,
111
- 'object_id' => $attachment->ID,
112
- 'object_name' => $wpdb->posts,
113
- 'item_type' => 'attachment',
114
- 'result_status' => ! $final_size ? 'error' : 'success',
115
- 'processing_level' => $level,
116
- 'is_backed_up' => $is_backed_up,
117
- 'original_size' => $original_size,
118
- 'final_size' => $final_size,
119
- 'original_mime_type' => $attachment->post_mime_type,
120
- 'final_mime_type' => $attachment->post_mime_type,
121
- 'extra_data' => (string) $extra_data,
122
- 'created_at' => time(),
123
- ];
124
-
125
- $format = [
126
- '%s',
127
- '%d',
128
- '%s',
129
- '%s',
130
- '%s',
131
- '%s',
132
- '%d',
133
- '%d',
134
- '%d',
135
- '%s',
136
- '%s',
137
- '%s',
138
- '%d',
139
- ];
140
-
141
- $rows_inserted = $wpdb->insert( RIO_Process_Queue::table_name(), $data, $format );
142
-
143
- if ( $rows_inserted > 0 ) {
144
- $processed_items ++;
145
-
146
- $attachment_id = absint( $attachment->ID );
147
- $wpdb->query( "DELETE FROM {$wpdb->postmeta} WHERE post_id='{$attachment_id}' AND meta_key LIKE 'wio_%'" );
148
- }
149
- }
150
-
151
- $left_items = $attachments_total - $processed_items;
152
- $message = sprintf( __( 'left to migrate: %s items', 'robin-image-optimizer' ), $left_items );
153
- $need_more_time = true;
154
-
155
- WRIO_Plugin::app()->logger->info( 'Succefull migrated ' . $processed_items . ' items.' );
156
- } else {
157
- WRIO_Plugin::app()->logger->info( 'Succefull migrated all items. Finishing-up...' );
158
-
159
- // Assumed to be 2 after 010105.php migration
160
- RIO_Process_Queue::update_db_version( 2 );
161
-
162
- $need_more_time = false;
163
- $message = __( 'Finishing-up...', 'robin-image-optimizer' );
164
- }
165
-
166
- WRIO_Plugin::app()->logger->memory_usage();
167
-
168
- wp_send_json_success( [
169
- 'need_more_time' => $need_more_time,
170
- 'message' => $message,
171
- ] );
172
- }
173
-
174
-
1
+ <?php
2
+ /**
3
+ * Ajax action to migrate old architecture based on post meta into new table.
4
+ *
5
+ * @author Webcraftic <wordpress.webraftic@gmail.com>
6
+ * @author Alexander Teshabaev <sasha.tesh@gmail.com>
7
+ * @see RIO_Process_Queue for further information.
8
+ *
9
+ * @copyright (c) 2018 Webraftic Ltd
10
+ * @version 1.0
11
+ */
12
+
13
+ // Exit if accessed directly
14
+ if ( ! defined( 'ABSPATH' ) ) {
15
+ exit;
16
+ }
17
+
18
+ add_action( 'wp_ajax_wrio_meta_migrations', 'wbcr_rio_migrate_postmeta_to_process_queue' );
19
+
20
+ /**
21
+ * Migrating postmeta to newly created table.
22
+ *
23
+ * @author Alexander Teshabaev <sasha.tesh@gmail.com>
24
+ * @since 1.3.0
25
+ * @see RIO_Process_Queue as referce for new table.
26
+ */
27
+ function wbcr_rio_migrate_postmeta_to_process_queue() {
28
+ global $wpdb;
29
+
30
+ check_admin_referer( 'wrio-meta-migrations' );
31
+
32
+ if ( ! current_user_can( 'manage_options' ) ) {
33
+ wp_die( - 1 );
34
+ }
35
+
36
+ $error = (int) WRIO_Plugin::app()->request->post( 'error', 0 );
37
+
38
+ if ( $error ) {
39
+ WRIO_Plugin::app()->logger->error( 'Previous migration was not completed due to an error.' );
40
+ }
41
+
42
+ $limit = (int) WRIO_Plugin::app()->request->post( 'limit', 150 );
43
+
44
+ $processed_items = 0;
45
+
46
+ WRIO_Plugin::app()->logger->info( 'Start meta migration. Limit ' . $limit );
47
+ WRIO_Plugin::app()->logger->memory_usage();
48
+
49
+ $attachments = wbcr_rio_get_meta_to_migrate();
50
+
51
+ if ( isset( $attachments->posts ) && ( $attachments_total = count( $attachments->posts ) ) > 0 ) {
52
+
53
+ if ( $attachments_total < $limit ) {
54
+ $limit = $attachments_total;
55
+ }
56
+
57
+ WRIO_Plugin::app()->logger->info( 'Finded ' . $attachments_total . ' attachments for migration.' );
58
+
59
+ if ( function_exists( 'wp_raise_memory_limit' ) ) {
60
+ wp_raise_memory_limit( 'image' );
61
+ }
62
+
63
+ WRIO_Plugin::app()->logger->memory_usage();
64
+
65
+ /**
66
+ * @var WP_Post $attachment
67
+ */
68
+ for ( $i = 0; $i < $limit; $i ++ ) {
69
+ $attachment = $attachments->posts[ $i ];
70
+ $post_meta = get_post_custom( $attachment->ID );
71
+
72
+ $extra_data = new RIO_Attachment_Extra_Data();
73
+
74
+ $is_backed_up = false;
75
+ $original_size = 0;
76
+ $final_size = 0;
77
+
78
+ if ( isset( $post_meta['wio_backuped'][0] ) && $post_meta['wio_backuped'][0] ) {
79
+ $is_backed_up = true;
80
+ }
81
+
82
+ if ( isset( $post_meta['wio_thumbnails_count'][0] ) ) {
83
+ $extra_data->set_thumbnails_count( intval( $post_meta['wio_thumbnails_count'][0] ) );
84
+ }
85
+
86
+ if ( isset( $post_meta['wio_original_size'][0] ) ) {
87
+ $original_size = intval( $post_meta['wio_original_size'][0] );
88
+ }
89
+
90
+ if ( isset( $post_meta['wio_optimized_size'][0] ) ) {
91
+ $final_size = intval( $post_meta['wio_optimized_size'][0] );
92
+ }
93
+
94
+ if ( isset( $post_meta['wio_original_main_size'][0] ) ) {
95
+ $extra_data->set_original_main_size( intval( $post_meta['wio_original_main_size'][0] ) );
96
+ }
97
+
98
+ if ( isset( $post_meta['wio_error'][0] ) ) {
99
+ $extra_data->set_error( 'optimization' );
100
+ $extra_data->set_error_msg( $post_meta['wio_error'][0] );
101
+ }
102
+
103
+ $level = 'normal';
104
+
105
+ if ( isset( $post_meta['wio_optimization_level'][0] ) && ! empty( $post_meta['wio_optimization_level'][0] ) ) {
106
+ $level = $post_meta['wio_optimization_level'][0];
107
+ }
108
+
109
+ $data = [
110
+ 'server_id' => null,
111
+ 'object_id' => $attachment->ID,
112
+ 'object_name' => $wpdb->posts,
113
+ 'item_type' => 'attachment',
114
+ 'result_status' => ! $final_size ? 'error' : 'success',
115
+ 'processing_level' => $level,
116
+ 'is_backed_up' => $is_backed_up,
117
+ 'original_size' => $original_size,
118
+ 'final_size' => $final_size,
119
+ 'original_mime_type' => $attachment->post_mime_type,
120
+ 'final_mime_type' => $attachment->post_mime_type,
121
+ 'extra_data' => (string) $extra_data,
122
+ 'created_at' => time(),
123
+ ];
124
+
125
+ $format = [
126
+ '%s',
127
+ '%d',
128
+ '%s',
129
+ '%s',
130
+ '%s',
131
+ '%s',
132
+ '%d',
133
+ '%d',
134
+ '%d',
135
+ '%s',
136
+ '%s',
137
+ '%s',
138
+ '%d',
139
+ ];
140
+
141
+ $rows_inserted = $wpdb->insert( RIO_Process_Queue::table_name(), $data, $format );
142
+
143
+ if ( $rows_inserted > 0 ) {
144
+ $processed_items ++;
145
+
146
+ $attachment_id = absint( $attachment->ID );
147
+ $wpdb->query( "DELETE FROM {$wpdb->postmeta} WHERE post_id='{$attachment_id}' AND meta_key LIKE 'wio_%'" );
148
+ }
149
+ }
150
+
151
+ $left_items = $attachments_total - $processed_items;
152
+ $message = sprintf( __( 'left to migrate: %s items', 'robin-image-optimizer' ), $left_items );
153
+ $need_more_time = true;
154
+
155
+ WRIO_Plugin::app()->logger->info( 'Succefull migrated ' . $processed_items . ' items.' );
156
+ } else {
157
+ WRIO_Plugin::app()->logger->info( 'Succefull migrated all items. Finishing-up...' );
158
+
159
+ // Assumed to be 2 after 010105.php migration
160
+ RIO_Process_Queue::update_db_version( 2 );
161
+
162
+ $need_more_time = false;
163
+ $message = __( 'Finishing-up...', 'robin-image-optimizer' );
164
+ }
165
+
166
+ WRIO_Plugin::app()->logger->memory_usage();
167
+
168
+ wp_send_json_success( [
169
+ 'need_more_time' => $need_more_time,
170
+ 'message' => $message,
171
+ ] );
172
+ }
173
+
174
+
admin/ajax/multisite-update-current-blog.php CHANGED
@@ -1,29 +1,29 @@
1
- <?php
2
- /**
3
- * Ajax действие, которое выполняется для смены текущего multisite блога
4
- *
5
- * @author Webcraftic <wordpress.webraftic@gmail.com>
6
- * @copyright (c) 2018 Webraftic Ltd
7
- * @version 1.0
8
- */
9
-
10
- // Exit if accessed directly
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- }
14
-
15
- /*add_action( 'wp_ajax_wbcr_rio_update_current_blog', function () {
16
- check_ajax_referer( 'update_blog_id', 'wpnonce' );
17
- $blog_id = (int) WRIO_Plugin::app()->request->post( 'current_blog_id' );
18
- $context = sanitize_text_field( WRIO_Plugin::app()->request->post( 'context' ) );
19
- WRIO_Plugin::app()->updatePopulateOption( 'current_blog', $blog_id );
20
- $image_statistics = WIO_OptimizationTools::getImageStatistics( $context );
21
-
22
- switch_to_blog( $blog_id );
23
- $statistic_data = $image_statistics->load();
24
- restore_current_blog();
25
-
26
- wp_send_json_success( array(
27
- 'statistic' => $statistic_data,
28
- ) );
29
- } );*/
1
+ <?php
2
+ /**
3
+ * Ajax действие, которое выполняется для смены текущего multisite блога
4
+ *
5
+ * @author Webcraftic <wordpress.webraftic@gmail.com>
6
+ * @copyright (c) 2018 Webraftic Ltd
7
+ * @version 1.0
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ }
14
+
15
+ /*add_action( 'wp_ajax_wbcr_rio_update_current_blog', function () {
16
+ check_ajax_referer( 'update_blog_id', 'wpnonce' );
17
+ $blog_id = (int) WRIO_Plugin::app()->request->post( 'current_blog_id' );
18
+ $context = sanitize_text_field( WRIO_Plugin::app()->request->post( 'context' ) );
19
+ WRIO_Plugin::app()->updatePopulateOption( 'current_blog', $blog_id );
20
+ $image_statistics = WIO_OptimizationTools::getImageStatistics( $context );
21
+
22
+ switch_to_blog( $blog_id );
23
+ $statistic_data = $image_statistics->load();
24
+ restore_current_blog();
25
+
26
+ wp_send_json_success( array(
27
+ 'statistic' => $statistic_data,
28
+ ) );
29
+ } );*/
admin/ajax/settings.php CHANGED
@@ -1,37 +1,37 @@
1
- <?php
2
- /**
3
- * Ajax действие, которое выполняется при сохранении настроек
4
- *
5
- * @author Webcraftic <wordpress.webraftic@gmail.com>
6
- * @copyright (c) 2018 Webraftic Ltd
7
- * @version 1.0
8
- */
9
-
10
- // Exit if accessed directly
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- }
14
-
15
- /**
16
- * AJAX обработчик массовой сохранения уровня сжатия
17
- */
18
- add_action( 'wp_ajax_wio_settings_update_level', function () {
19
- check_admin_referer( 'wio-iph' );
20
-
21
- if ( ! current_user_can( 'manage_options' ) ) {
22
- wp_die( - 1 );
23
- }
24
-
25
- $level = sanitize_text_field( $_POST['level'] );
26
-
27
- if ( ! $level ) {
28
- die();
29
- }
30
-
31
- if ( ! in_array( $level, [ 'normal', 'aggresive', 'ultra' ] ) ) {
32
- die();
33
- }
34
-
35
- WRIO_Plugin::app()->updatePopulateOption( 'image_optimization_level', $level );
36
- die();
37
- } );
1
+ <?php
2
+ /**
3
+ * Ajax действие, которое выполняется при сохранении настроек
4
+ *
5
+ * @author Webcraftic <wordpress.webraftic@gmail.com>
6
+ * @copyright (c) 2018 Webraftic Ltd
7
+ * @version 1.0
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ }
14
+
15
+ /**
16
+ * AJAX обработчик массовой сохранения уровня сжатия
17
+ */
18
+ add_action( 'wp_ajax_wio_settings_update_level', function () {
19
+ check_admin_referer( 'wio-iph' );
20
+
21
+ if ( ! current_user_can( 'manage_options' ) ) {
22
+ wp_die( - 1 );
23
+ }
24
+
25
+ $level = sanitize_text_field( $_POST['level'] );
26
+
27
+ if ( ! $level ) {
28
+ die();
29
+ }
30
+
31
+ if ( ! in_array( $level, [ 'normal', 'aggresive', 'ultra' ] ) ) {
32
+ die();
33
+ }
34
+
35
+ WRIO_Plugin::app()->updatePopulateOption( 'image_optimization_level', $level );
36
+ die();
37
+ } );
admin/assets/css/base-statistic.css CHANGED
@@ -29,11 +29,11 @@
29
  }
30
  }*/
31
  }
32
- #WBCR .factory-bootstrap-446 select.form-control {
33
  background: #efefef url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%206l5%205%205-5%202%201-7%207-7-7%202-1z%22%20fill%3D%22%23555%22%2F%3E%3C%2Fsvg%3E) no-repeat right 5px top 55% !important;
34
  }
35
- #WBCR .factory-bootstrap-446 .btn-default.active,
36
- #WBCR .factory-bootstrap-446 .factory-bootstrap-446 .btn-default:active {
37
  text-shadow: none;
38
  color: #fff;
39
  background-color: #33aad5;
@@ -43,7 +43,7 @@
43
  border-bottom: 1px solid #0074a2;
44
  border-left: 1px solid #0074a2;
45
  }
46
- #WBCR .factory-bootstrap-446 .btn-group > .btn:last-of-type {
47
  border-top-right-radius: 3px;
48
  border-bottom-right-radius: 3px;
49
  }
@@ -178,7 +178,7 @@
178
  background: #f3f3f3;
179
  }
180
  #WBCR .wrio-table .wbcr-rio-server-success {
181
- color: #8CC152;
182
  }
183
  #WBCR .wrio-table .wbcr-rio-server-error {
184
  color: #fb5d49;
@@ -365,7 +365,7 @@
365
  padding-top: 0.85em;
366
  }
367
  #WBCR .wio-bars + .wio-number-you-optimized p {
368
- color: #72a53b;
369
  }
370
  #WBCR .wio-bar-negative .wio-progress {
371
  background: #D2D3D6;
@@ -381,15 +381,21 @@
381
  }*/
382
  }
383
  #WBCR .wio-bar-positive .wio-progress {
384
- background: #8CC152;
385
  }
386
  #WBCR .wio-bar-positive .wio-barnb {
387
- color: #72a53b;
388
  }
389
  #WBCR .wio-bar-primary .wio-progress {
390
- background: #8CC152;
391
  }
392
  #WBCR .wio-bar-primary .wio-barnb {
 
 
 
 
 
 
393
  color: #72a53b;
394
  }
395
  #WBCR .wio-right-outside-number .wio-barnb {
@@ -417,6 +423,10 @@
417
  float: left;
418
  margin-right: 20px;
419
  }
 
 
 
 
420
  #WBCR .wio-chart-percent {
421
  position: absolute;
422
  left: 0;
@@ -425,7 +435,7 @@
425
  margin-top: -0.5em;
426
  line-height: 0.8;
427
  text-align: center;
428
- font-size: 54px;
429
  font-weight: bold;
430
  color: #afafaf;
431
  }
@@ -489,8 +499,9 @@
489
  font-size: 14px;
490
  text-align: center;
491
  }
492
- #WBCR .wio-total-percent {
493
- color: #587f2e;
 
494
  }
495
  #WBCR #wio-start-msg-top,
496
  #WBCR #wio-start-msg-right,
@@ -508,10 +519,18 @@
508
  padding-bottom: 0 !important;
509
  }
510
  #WBCR .wio-page-statistic {
511
- padding-left: 40px;
512
  }
513
  #WBCR .wio-page-statistic .wio-chart-percent {
514
- margin-top: -1.1em;
 
 
 
 
 
 
 
 
515
  }
516
  #WBCR .wio-page-total {
517
  padding: 20px 20px;
29
  }
30
  }*/
31
  }
32
+ #WBCR .factory-bootstrap-450 select.form-control {
33
  background: #efefef url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%206l5%205%205-5%202%201-7%207-7-7%202-1z%22%20fill%3D%22%23555%22%2F%3E%3C%2Fsvg%3E) no-repeat right 5px top 55% !important;
34
  }
35
+ #WBCR .factory-bootstrap-450 .btn-default.active,
36
+ #WBCR .factory-bootstrap-450 .factory-bootstrap-450 .btn-default:active {
37
  text-shadow: none;
38
  color: #fff;
39
  background-color: #33aad5;
43
  border-bottom: 1px solid #0074a2;
44
  border-left: 1px solid #0074a2;
45
  }
46
+ #WBCR .factory-bootstrap-450 .btn-group > .btn:last-of-type {
47
  border-top-right-radius: 3px;
48
  border-bottom-right-radius: 3px;
49
  }
178
  background: #f3f3f3;
179
  }
180
  #WBCR .wrio-table .wbcr-rio-server-success {
181
+ color: #bbd2a1;
182
  }
183
  #WBCR .wrio-table .wbcr-rio-server-error {
184
  color: #fb5d49;
365
  padding-top: 0.85em;
366
  }
367
  #WBCR .wio-bars + .wio-number-you-optimized p {
368
+ color: #a2c17f;
369
  }
370
  #WBCR .wio-bar-negative .wio-progress {
371
  background: #D2D3D6;
381
  }*/
382
  }
383
  #WBCR .wio-bar-positive .wio-progress {
384
+ background: #bbd2a1;
385
  }
386
  #WBCR .wio-bar-positive .wio-barnb {
387
+ color: #a2c17f;
388
  }
389
  #WBCR .wio-bar-primary .wio-progress {
390
+ background: #bbd2a1;
391
  }
392
  #WBCR .wio-bar-primary .wio-barnb {
393
+ color: #a2c17f;
394
+ }
395
+ #WBCR .wio-bar-webp .wio-progress {
396
+ background: #8CC152;
397
+ }
398
+ #WBCR .wio-bar-webp .wio-barnb {
399
  color: #72a53b;
400
  }
401
  #WBCR .wio-right-outside-number .wio-barnb {
423
  float: left;
424
  margin-right: 20px;
425
  }
426
+ #WBCR .wio-overview-chart-container-webp {
427
+ float: right;
428
+ margin-left: 20px;
429
+ }
430
  #WBCR .wio-chart-percent {
431
  position: absolute;
432
  left: 0;
435
  margin-top: -0.5em;
436
  line-height: 0.8;
437
  text-align: center;
438
+ font-size: 45px;
439
  font-weight: bold;
440
  color: #afafaf;
441
  }
499
  font-size: 14px;
500
  text-align: center;
501
  }
502
+ #WBCR .wio-total-percent,
503
+ #WBCR .wio-total-percent-webp {
504
+ color: #89b15c;
505
  }
506
  #WBCR #wio-start-msg-top,
507
  #WBCR #wio-start-msg-right,
519
  padding-bottom: 0 !important;
520
  }
521
  #WBCR .wio-page-statistic {
522
+ padding: 20px;
523
  }
524
  #WBCR .wio-page-statistic .wio-chart-percent {
525
+ margin-top: -1.2em;
526
+ }
527
+ #WBCR .wio-page-statistic .wio-optimize-statistic {
528
+ display: flex;
529
+ justify-content: space-between;
530
+ }
531
+ #WBCR .wio-page-statistic .wrio-statistic-buttons-wrap {
532
+ display: flex;
533
+ justify-content: space-between;
534
  }
535
  #WBCR .wio-page-total {
536
  padding: 20px 20px;
admin/assets/css/base-statistic.less CHANGED
@@ -1,888 +1,913 @@
1
- /**
2
- * Styles for the Widget to be displayed in the Clearfy plugin
3
-
4
- * @author Alex Kovalev <alex.kovalevv@gmail.com>
5
- * @copyright Webcraftic 14.06.2019
6
- */
7
-
8
- @positiveColor: #8CC152;
9
- @negativeColor: #D2D3D6;
10
- @neutralColor: #828282;
11
-
12
- @errorColor: #fb5d49;
13
- @waringColor: #ffb635;
14
-
15
- @greyButtonBg: #f3f3f3;
16
- @greyButtonColor: #656565;
17
-
18
- @greenButtonBg: #c9deb2;
19
- @greenButtonColor: #586549;
20
-
21
- @orangeButtonBg: #fdd599;
22
- @orangeButtonColor: #a57b3c;
23
-
24
- #WBCR {
25
- .premium-label(@position: relative, @positionTop:-8px, @positionLeft:-10px, @positionRight:auto) {
26
- display: inline-block;
27
- position: @position;
28
- content: 'PRO';
29
- background: #ff5722;
30
- border-radius: 4px;
31
- color: #fff;
32
- font-size: 10px;
33
- line-height: 1;
34
- font-style: normal;
35
- padding: 4px 6px;
36
- margin-left: 4px;
37
- vertical-align: top;
38
- top: @positionTop;
39
- left: @positionLeft;
40
- right: @positionRight;
41
- z-index: 11;
42
- }
43
-
44
- .factory-bootstrap-000 {
45
- select.form-control {
46
- background: #efefef url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%206l5%205%205-5%202%201-7%207-7-7%202-1z%22%20fill%3D%22%23555%22%2F%3E%3C%2Fsvg%3E) no-repeat right 5px top 55% !important;
47
- }
48
-
49
- .btn-default.active, .factory-bootstrap-000 .btn-default:active {
50
- text-shadow: none;
51
- color: #fff;
52
- background-color: #33aad5;
53
- -webkit-box-shadow: inset 0 1px 1px #0074a2;
54
- box-shadow: inset 0 1px 3px #0074a2;
55
- border-top: 1px solid #0074a2;
56
- border-bottom: 1px solid #0074a2;
57
- border-left: 1px solid #0074a2;
58
- }
59
-
60
- .btn-group > .btn:last-of-type {
61
- border-top-right-radius: 3px;
62
- border-bottom-right-radius: 3px;
63
- }
64
- }
65
-
66
-
67
- .wio-clear {
68
- clear: both;
69
- }
70
-
71
- // Fix for Clearfy
72
- // This code hides tabs custom folders and nextgen gallery
73
- // -----------------------------------------------
74
- #io_folders_statistic-wbcr_clearfy-tab, #io_nextgen_gallery_statistic-wbcr_clearfy-tab {
75
- display: none !important;
76
- }
77
-
78
- // Styling tabs on statistics pages
79
- // -----------------------------------------------
80
- .wrio-statistic-nav {
81
- margin: 0;
82
- //box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
83
- background: #efefef;
84
-
85
- ul {
86
- margin: 0 0 0 10px;
87
-
88
- li {
89
- position: relative;
90
- display: inline-block;
91
- //width: 300px;
92
- margin: 0 5px 0 0;
93
- background: #ffffff;
94
- box-shadow: 0 -2px 0 #eaeaea;
95
-
96
- &:hover {
97
- background: #f7f7f7;
98
- }
99
-
100
- &.active {
101
- //box-shadow: 0 -2px 0 #c9deb2;
102
- background: #f7f7f7;
103
- border-top: 1px solid #d4d4d4;
104
- border-left: 1px solid #d4d4d4;
105
- border-right: 1px solid #d4d4d4;
106
- border-bottom: 1px solid #f7f7f7;
107
- margin-bottom: -1px;
108
-
109
- a {
110
- color: #222;
111
-
112
- .wrio-statistic-tab-percent {
113
- border: 2px dashed #8bc34a;
114
- color: #5e8237;
115
- }
116
- }
117
-
118
- .dashicons, .dashicons-before:before {
119
- color: #ff8b66;
120
- }
121
- }
122
-
123
- .wrio-statistic-tab {
124
- display: block;
125
- padding: 10px 20px 10px 20px;
126
- text-decoration: none;
127
- color: #d4d4d4;
128
- font-size: 22px;
129
- line-height: 2;
130
-
131
- &:active, &:focus {
132
- background: 0;
133
- box-shadow: none;
134
- outline: none;
135
- }
136
-
137
- .dashicons, .dashicons-before:before {
138
- display: inline-block;
139
- width: 30px;
140
- height: 30px;
141
- font-size: 30px;
142
- line-height: 1.5;
143
- margin-right: 15px;
144
- color: #d4d4d4;
145
- }
146
-
147
-
148
- .wrio-statistic-tab-percent {
149
- display: inline-block;
150
- width: 42px;
151
- height: 42px;
152
- border-radius: 100px;
153
- border: 2px dashed #e4e4e4;
154
- padding: 5px;
155
- margin-left: 30px;
156
- font-size: 14px;
157
- font-weight: 600;
158
- text-align: center;
159
- color: #bdbdbd;
160
- }
161
- }
162
-
163
- .wrio-statistic-tab-premium-label:after {
164
- .premium-label(absolute, 10px, auto, 10px);
165
- }
166
- }
167
- }
168
- }
169
-
170
- // Table style. The table is used for optimization log
171
- .wrio-table {
172
- width: 100%;
173
- table-layout: fixed;
174
- box-sizing: border-box;
175
- border-spacing: 3px;
176
- background: #fff;
177
- border-top: 2px dashed #cac9c9;
178
-
179
- th, td {
180
- padding: 16px 10px;
181
- text-align: center;
182
- }
183
-
184
- th {
185
- background: #f3f3f3;
186
- color: #777777;
187
- box-shadow: 0 1px 0 rgb(216, 216, 216);
188
-
189
- &:nth-child(2n+1) {
190
- background: #f9f9f9
191
- }
192
- }
193
-
194
- tr.wrio-error {
195
- background-color: #ffe9e9 !important;
196
- }
197
-
198
- .wrio-table-spinner {
199
- background: url("../img/quick-start-loader.gif") center center no-repeat;
200
- }
201
-
202
- .wrio-table-highlighter {
203
- display: inline-block;
204
- padding: 3px 7px;
205
- background: @greyButtonBg;
206
- }
207
-
208
- .wbcr-rio-server-success {
209
- color: @positiveColor;
210
- }
211
-
212
- .wbcr-rio-server-error {
213
- color: @errorColor;
214
- }
215
-
216
- .wbcr-rio-server-warning {
217
- color: @waringColor;
218
- }
219
-
220
- &.wbcr-rio-folders-table {
221
- td:nth-child(3) {
222
- text-align: left;
223
- }
224
- }
225
- }
226
-
227
- .wrio-servers {
228
- padding: 20px 20px;
229
-
230
- label {
231
- span {
232
- display: block;
233
- font-weight: normal;
234
- font-size: 12px;
235
- color: #b7b2b2;
236
- }
237
- }
238
-
239
- #wrio-change-optimization-server {
240
- position: relative;
241
- display: inline-block;
242
- max-width: 400px;
243
- margin-right: 15px;
244
- margin-bottom: 0;
245
- border: 1px solid #d2d0d0;
246
- background-color: #efefef;
247
- }
248
-
249
- .wrio-servers-info {
250
- margin: 0 0 0;
251
- padding: 20px;
252
- background: #fff;
253
- }
254
-
255
- .wrio-server-status-wrap {
256
- display: inline-block;
257
- margin-top: 8px;
258
-
259
- .wrio-server-status {
260
- background: transparent;
261
- color: #fff;
262
- padding: 3px 5px;
263
- border-radius: 4px;
264
-
265
- &.wrio-down {
266
- background: #ff5722;
267
- }
268
-
269
- &.wrio-stable {
270
- background: #8bc34a;
271
- }
272
-
273
- &.wrio-server-check-proccess {
274
- display: inline-block;
275
- height: 10px;
276
- width: 30px;
277
- background: url("../img/quick-start-loader.gif") center no-repeat;
278
- }
279
- }
280
- }
281
-
282
-
283
- .wrio-premium-user-balance-wrap {
284
- display: inline-block;
285
- margin-top: 8px;
286
- margin-left: 10px;
287
-
288
- .wrio-premium-user-balance {
289
- color: #fff;
290
- padding: 3px 5px;
291
- border-radius: 4px;
292
- background: #ffc107;
293
- }
294
-
295
- .wrio-premium-user-balance-check-proccess {
296
- display: inline-block;
297
- height: 10px;
298
- width: 30px;
299
- background: url("../img/quick-start-loader.gif") center no-repeat;
300
- }
301
- }
302
-
303
- .wrio-premium-user-update-wrap {
304
- display: inline-block;
305
- margin-top: 8px;
306
- margin-left: 10px;
307
-
308
- .wrio-premium-user-update {
309
- color: #fff;
310
- padding: 3px 5px;
311
- border-radius: 4px;
312
- background: #ffc107;
313
- }
314
-
315
- .wrio-premium-user-update-check-proccess {
316
- display: inline-block;
317
- height: 10px;
318
- width: 30px;
319
- background: url("../img/quick-start-loader.gif") center no-repeat;
320
- }
321
- }
322
- }
323
-
324
- .wio-columns {
325
- overflow: hidden;
326
- padding: 15px 0;
327
- counter-reset: cols;
328
-
329
- [class^="col-"] {
330
- float: left;
331
- -webkit-box-sizing: border-box;
332
- -moz-box-sizing: border-box;
333
- box-sizing: border-box;
334
- }
335
-
336
- .col-1-3 {
337
- width: 33.333%;
338
- padding-left: 28px;
339
- }
340
-
341
- .col-2-3 {
342
- width: 66.666%;
343
- padding-left: 28px
344
- }
345
-
346
- .col-1-2 {
347
- width: 50%;
348
- padding: 0 20px;
349
- }
350
-
351
- .col-statistics.col-statistics {
352
- width: 60%;
353
- }
354
-
355
- .col-chart.col-chart {
356
- width: 40%;
357
- position: relative;
358
- padding: 20px;
359
- font-size: 12px;
360
- text-transform: uppercase;
361
- background: #f1f1f1b3;
362
- color: #abacaf;
363
- font-weight: bold;
364
- border-radius: 5px;
365
- margin-top: 10px;
366
- text-align: left;
367
- box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
368
- }
369
- }
370
-
371
- .wio-col {
372
- float: left;
373
- width: 50%;
374
- box-sizing: border-box;
375
- -webkit-flex-basis: 50%;
376
- -ms-flex-preferred-size: 50%;
377
- flex-basis: 50%;
378
- }
379
-
380
- .wio-col {
381
- padding-right: 20px;
382
- }
383
-
384
- .wio-col + .wio-col {
385
- padding-right: 0;
386
- padding-left: 50px;
387
- }
388
-
389
- .wio-col:target {
390
- animation: wiohello 1s 3 linear backwards;
391
- }
392
-
393
- .wio-number-you-optimized {
394
- margin-bottom: 1.35em;
395
- overflow: hidden;
396
-
397
- #wio-total-optimized-attachments-pct {
398
- color: @neutralColor;
399
- }
400
-
401
- .wio-number {
402
- display: table-cell;
403
- padding-right: 15px;
404
- font-size: 48px;
405
- font-weight: bold;
406
- line-height: 1;
407
- vertical-align: middle;
408
- white-space: nowrap;
409
- color: @neutralColor;
410
- }
411
-
412
- .wio-text {
413
- display: table-cell;
414
- vertical-align: middle;
415
- overflow: hidden;
416
- font-size: 12px;
417
- color: @neutralColor;
418
- }
419
-
420
- & > p {
421
- display: table;
422
- }
423
- }
424
-
425
- .wio-bars {
426
- padding-right: 15px;
427
- }
428
-
429
- .wio-bars p {
430
- font-size: 12px;
431
- margin-bottom: 5px;
432
- }
433
-
434
- .wio-bars + .wio-number-you-optimized {
435
- border-bottom: 0;
436
- padding-top: 0.85em;
437
- }
438
-
439
- .wio-bars + .wio-number-you-optimized p {
440
- color: darken(@positiveColor, 10);
441
- }
442
-
443
- .wio-bar-negative {
444
- .wio-progress {
445
- background: @negativeColor;
446
- }
447
-
448
- .wio-barnb {
449
- color: darken(@negativeColor, 20);
450
- }
451
- }
452
-
453
- .wio-progress {
454
- height: 8px;
455
- transition: width .3s;
456
-
457
- /*.wio-bar-negative {
458
- width: 92% !important;
459
- }*/
460
- }
461
-
462
- .wio-bar-positive {
463
- .wio-progress {
464
- background: @positiveColor;
465
- }
466
-
467
- .wio-barnb {
468
- color: darken(@positiveColor, 10);
469
- }
470
- }
471
-
472
- .wio-bar-primary {
473
- .wio-progress {
474
- background: @positiveColor;
475
- }
476
-
477
- .wio-barnb {
478
- color: darken(@positiveColor, 10);
479
- }
480
- }
481
-
482
- .wio-right-outside-number .wio-barnb {
483
- display: block;
484
- margin-right: -5.25em;
485
- text-align: right;
486
- font-weight: bold;
487
- line-height: .8;
488
- }
489
-
490
- /* Doughnut */
491
-
492
- .wio-chart {
493
- position: relative;
494
- top: 1px;
495
- display: inline-block;
496
- vertical-align: middle;
497
- }
498
-
499
- .wio-chart-container {
500
- position: relative;
501
- display: inline-block;
502
- margin-right: 5px;
503
- }
504
-
505
- .wio-chart-container canvas {
506
- display: block;
507
- }
508
-
509
- .wio-overview-chart-container {
510
- float: left;
511
- margin-right: 20px;
512
- }
513
-
514
- .wio-chart-percent {
515
- position: absolute;
516
- left: 0;
517
- right: 0;
518
- top: 50%;
519
- margin-top: -.5em;
520
- line-height: 0.8;
521
- text-align: center;
522
- font-size: 54px;
523
- font-weight: bold;
524
- color: #afafaf;
525
- }
526
-
527
- .wio-chart-percent span {
528
- font-size: 20px;
529
- vertical-align: super;
530
- }
531
-
532
- #wio-overview-chart-legend {
533
- overflow: hidden;
534
- }
535
-
536
- .wio-doughnut-legend li {
537
- display: inline-block;
538
- position: relative;
539
- margin-bottom: 15px;
540
- border-radius: 5px;
541
- padding: 3px 8px 2px 31px;
542
- font-size: 9px;
543
- cursor: default;
544
- -webkit-transition: background-color 200ms ease-in-out;
545
- -moz-transition: background-color 200ms ease-in-out;
546
- -o-transition: background-color 200ms ease-in-out;
547
- transition: background-color 200ms ease-in-out;
548
- }
549
-
550
- .wio-doughnut-legend li span {
551
- display: block;
552
- position: absolute;
553
- left: 0;
554
- top: 0;
555
- width: 25px;
556
- height: 25px;
557
- border-radius: 50%;
558
- }
559
-
560
- .wio-optimize-button {
561
- min-width: 180px;
562
- padding: 12px 30px;
563
- background: @greenButtonBg;
564
- color: @greenButtonColor;
565
- border: 0;
566
- box-shadow: none;
567
- font-size: 14px;
568
- text-transform: uppercase !important;
569
- font-weight: bold;
570
- border-radius: 4px;
571
- outline: none;
572
-
573
- &:active {
574
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5);
575
- }
576
-
577
- &:disabled {
578
- background: lighten(@greenButtonBg, 10%);
579
- color: lighten(@greenButtonColor, 30%);
580
- }
581
-
582
- &.wio-running {
583
- color: @orangeButtonColor;
584
- background: @orangeButtonBg url("../img/Spinner-1s-33px.gif") 10px center no-repeat;
585
- padding-left: 50px;
586
- }
587
- }
588
-
589
- .wio-global-optim-phrase {
590
- width: 180px;
591
- padding-top: 20px;
592
- font-size: 14px;
593
- text-align: center;
594
- }
595
-
596
- .wio-total-percent {
597
- color: darken(@positiveColor, 20);
598
- }
599
-
600
- #wio-start-msg-top, #wio-start-msg-right, #wio-start-msg-complete {
601
- display: none;
602
- }
603
-
604
- .wio-text-left {
605
- text-align: left;
606
- }
607
-
608
- span.wio-num {
609
- display: inline !important;
610
- position: inherit !important;
611
- }
612
-
613
-
614
- // WIDGETS SPACE
615
- // -----------------------------------------------
616
- .wio-image-optimize-board {
617
- padding-bottom: 0 !important;
618
- }
619
-
620
- .wio-page-statistic {
621
- padding-left: 40px;
622
-
623
- .wio-chart-percent {
624
- margin-top: -1.1em;
625
- }
626
- }
627
-
628
- .wio-page-total {
629
- padding: 20px 20px;
630
- background: #efefef;
631
-
632
- .wrio-calculate-process {
633
- display: inline-block !important;
634
- height: 10px;
635
- width: 30px;
636
- background: transparent url("../img/quick-start-loader.gif") center no-repeat !important;
637
- }
638
-
639
- .wrio-total-images {
640
- font-weight: bold;
641
- color: #fff;
642
- padding: 3px 5px;
643
- border-radius: 4px;
644
- background: #ffc107;
645
- }
646
-
647
- span.wrio-total-images-desc {
648
- display: block;
649
- font-weight: normal;
650
- font-size: 12px;
651
- color: #b7b2b2;
652
- }
653
- }
654
-
655
- .wrio-optimization-progress {
656
- //margin-top: 30px;
657
- background: none;
658
- padding: 0;
659
-
660
- h4 {
661
- font-size: 15px;
662
- font-weight: 700;
663
- }
664
-
665
- /*button {
666
- padding: 5px 10px;
667
- border: 0;
668
- font-size: 11px;
669
- text-transform: uppercase !important;
670
- font-weight: bold;
671
- border-radius: 4px;
672
- outline: none;
673
- background: @greyButtonBg;
674
- color: @greyButtonColor;
675
- box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
676
-
677
- &:active {
678
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5);
679
- }
680
-
681
- &.wbcr-rio-loading {
682
- width: 56px;
683
- font-size: 0;
684
- background: @greyButtonBg url("../img/quick-start-loader.gif") center no-repeat;
685
- }
686
-
687
- &.wbcr-rio-selected {
688
- background: #f3efe2;
689
- color: #d8d8d8;
690
-
691
- &:active {
692
- box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
693
- }
694
- }
695
- }*/
696
-
697
- .wbcr-rio-warning-message {
698
- padding: 20px;
699
- background: #efefef;
700
- font-size: 15px;
701
- color: #b7b7b7;
702
- font-style: italic;
703
- }
704
- }
705
-
706
- .wio-widget {
707
- padding: 0 !important;
708
-
709
- .wio-chart-percent {
710
- font-size: 44px;
711
- line-height: 1;
712
- }
713
-
714
- .wio-bars {
715
- width: 60%;
716
- margin-left: 155px;
717
- }
718
-
719
- .col-chart.col-chart {
720
- width: 100%;
721
- }
722
-
723
- .col-controls {
724
- width: 45%;
725
- padding-left: 5px;
726
- padding-top: 110px
727
- }
728
-
729
- .wio-doughnut-legend {
730
- /*padding-top:30px;*/
731
- text-align: left;
732
- }
733
-
734
- .wio-widget-bottom {
735
- display: table;
736
- padding-top: 20px !important;
737
- width: 100%;
738
- text-align: right;
739
- }
740
-
741
- .wio-widget-bottom li {
742
- display: table-cell;
743
- }
744
-
745
- .wio-widget-bottom li:first-child {
746
- text-align: left;
747
- }
748
- }
749
-
750
- // FORMS SPACE
751
- // -----------------------------------------------
752
- .factory-checkbox {
753
- &.wrio-checkbox-premium-label:after {
754
- .premium-label();
755
- }
756
- }
757
-
758
- .factory-checkbox-disabled {
759
- input, button {
760
- pointer-events: none;
761
- cursor: not-allowed;
762
- opacity: .65;
763
- filter: alpha(opacity=65);
764
- -webkit-box-shadow: none;
765
- box-shadow: none;
766
- }
767
- }
768
-
769
- #wrio-webp-options, #wrio-error-log-options {
770
- h3 {
771
- font-size: 14px;
772
- margin: 0 0 10px 0;
773
- font-weight: 600;
774
- color: #565656;
775
- }
776
-
777
- .wrio-webp-options-info {
778
- color: #8a8787;
779
- font-size: 12px;
780
- }
781
-
782
- ul {
783
- padding-left: 0;
784
-
785
- li {
786
- &:after {
787
- content: '';
788
- display: block;
789
- clear: both;;
790
- }
791
-
792
- label {
793
- font-weight: 600;
794
- }
795
-
796
- .wrio-webp-options-radio, .wrio-error-log-options-checkbox {
797
- display: block;
798
- float: left;
799
- margin-top: 2px;
800
- margin-right: 8px;
801
-
802
- &:focus {
803
- outline: none;
804
- box-shadow: none;
805
- }
806
- }
807
-
808
- .wrio-webp-options-info, .wrio-error-log-options-info {
809
- padding-left: 25px;
810
- }
811
- }
812
- }
813
-
814
-
815
- }
816
-
817
- // MEDIA SPACE
818
- // -----------------------------------------------
819
-
820
- @media (max-width: 830px) {
821
- .wio [class^="col-"] {
822
- float: none;
823
- margin-bottom: 1.5em;
824
- }
825
-
826
- .wio .col-1-3,
827
- .wio .col-1-2 {
828
- width: auto;
829
- padding: 0 28px;
830
- clear: both;
831
- padding-top: 1em;
832
- }
833
- }
834
-
835
- @keyframes wiohello {
836
- 0%, 100% {
837
- background: #FFF;
838
- }
839
- 50% {
840
- background: #F4F7F9;
841
- }
842
- }
843
-
844
- @media (max-width: 1520px) and (min-width: 1381px), (max-width: 1086px) {
845
- .wio-columns {
846
- .col-statistics.col-statistics, .col-chart.col-chart {
847
- width: 50%;
848
- }
849
- }
850
-
851
- }
852
-
853
- @media (max-width: 808px) {
854
- .wio-columns {
855
- .col-statistics.col-statistics, .col-chart.col-chart {
856
- width: auto;
857
- float: none;
858
- padding: 0;
859
- }
860
-
861
- .col-chart.col-chart {
862
- margin-top: 3em;
863
- }
864
- }
865
- }
866
- /*@media (max-width: 1380px) and (min-width: 1246px), (max-width: 380px) {
867
- .wio-overview-chart-container {
868
- float: none;
869
- margin-right: 0;
870
- }
871
- }
872
-
873
- @media (max-width: 1380px) and (min-width: 1246px), (max-width: 380px) {
874
- .wio-overview-chart-container {
875
- float: none;
876
- margin-right: 0;
877
- }
878
-
879
- .wio-doughnut-legend {
880
- margin-top: 18px;
881
- }
882
-
883
- .wio-global-optim-phrase {
884
- padding-top: 0;
885
- width: auto;
886
- }
887
- }*/
888
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Styles for the Widget to be displayed in the Clearfy plugin
3
+
4
+ * @author Alex Kovalev <alex.kovalevv@gmail.com>
5
+ * @copyright Webcraftic 14.06.2019
6
+ */
7
+
8
+ @positiveColor: #bbd2a1;
9
+ @webpPositiveColor: #8CC152;
10
+ @negativeColor: #D2D3D6;
11
+ @neutralColor: #828282;
12
+
13
+ @errorColor: #fb5d49;
14
+ @waringColor: #ffb635;
15
+
16
+ @greyButtonBg: #f3f3f3;
17
+ @greyButtonColor: #656565;
18
+
19
+ @greenButtonBg: #c9deb2;
20
+ @greenButtonColor: #586549;
21
+
22
+ @orangeButtonBg: #fdd599;
23
+ @orangeButtonColor: #a57b3c;
24
+
25
+ #WBCR {
26
+ .premium-label(@position: relative, @positionTop:-8px, @positionLeft:-10px, @positionRight:auto) {
27
+ display: inline-block;
28
+ position: @position;
29
+ content: 'PRO';
30
+ background: #ff5722;
31
+ border-radius: 4px;
32
+ color: #fff;
33
+ font-size: 10px;
34
+ line-height: 1;
35
+ font-style: normal;
36
+ padding: 4px 6px;
37
+ margin-left: 4px;
38
+ vertical-align: top;
39
+ top: @positionTop;
40
+ left: @positionLeft;
41
+ right: @positionRight;
42
+ z-index: 11;
43
+ }
44
+
45
+ .factory-bootstrap-000 {
46
+ select.form-control {
47
+ background: #efefef url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%206l5%205%205-5%202%201-7%207-7-7%202-1z%22%20fill%3D%22%23555%22%2F%3E%3C%2Fsvg%3E) no-repeat right 5px top 55% !important;
48
+ }
49
+
50
+ .btn-default.active, .factory-bootstrap-000 .btn-default:active {
51
+ text-shadow: none;
52
+ color: #fff;
53
+ background-color: #33aad5;
54
+ -webkit-box-shadow: inset 0 1px 1px #0074a2;
55
+ box-shadow: inset 0 1px 3px #0074a2;
56
+ border-top: 1px solid #0074a2;
57
+ border-bottom: 1px solid #0074a2;
58
+ border-left: 1px solid #0074a2;
59
+ }
60
+
61
+ .btn-group > .btn:last-of-type {
62
+ border-top-right-radius: 3px;
63
+ border-bottom-right-radius: 3px;
64
+ }
65
+ }
66
+
67
+
68
+ .wio-clear {
69
+ clear: both;
70
+ }
71
+
72
+ // Fix for Clearfy
73
+ // This code hides tabs custom folders and nextgen gallery
74
+ // -----------------------------------------------
75
+ #io_folders_statistic-wbcr_clearfy-tab, #io_nextgen_gallery_statistic-wbcr_clearfy-tab {
76
+ display: none !important;
77
+ }
78
+
79
+ // Styling tabs on statistics pages
80
+ // -----------------------------------------------
81
+ .wrio-statistic-nav {
82
+ margin: 0;
83
+ //box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
84
+ background: #efefef;
85
+
86
+ ul {
87
+ margin: 0 0 0 10px;
88
+
89
+ li {
90
+ position: relative;
91
+ display: inline-block;
92
+ //width: 300px;
93
+ margin: 0 5px 0 0;
94
+ background: #ffffff;
95
+ box-shadow: 0 -2px 0 #eaeaea;
96
+
97
+ &:hover {
98
+ background: #f7f7f7;
99
+ }
100
+
101
+ &.active {
102
+ //box-shadow: 0 -2px 0 #c9deb2;
103
+ background: #f7f7f7;
104
+ border-top: 1px solid #d4d4d4;
105
+ border-left: 1px solid #d4d4d4;
106
+ border-right: 1px solid #d4d4d4;
107
+ border-bottom: 1px solid #f7f7f7;
108
+ margin-bottom: -1px;
109
+
110
+ a {
111
+ color: #222;
112
+
113
+ .wrio-statistic-tab-percent {
114
+ border: 2px dashed #8bc34a;
115
+ color: #5e8237;
116
+ }
117
+ }
118
+
119
+ .dashicons, .dashicons-before:before {
120
+ color: #ff8b66;
121
+ }
122
+ }
123
+
124
+ .wrio-statistic-tab {
125
+ display: block;
126
+ padding: 10px 20px 10px 20px;
127
+ text-decoration: none;
128
+ color: #d4d4d4;
129
+ font-size: 22px;
130
+ line-height: 2;
131
+
132
+ &:active, &:focus {
133
+ background: 0;
134
+ box-shadow: none;
135
+ outline: none;
136
+ }
137
+
138
+ .dashicons, .dashicons-before:before {
139
+ display: inline-block;
140
+ width: 30px;
141
+ height: 30px;
142
+ font-size: 30px;
143
+ line-height: 1.5;
144
+ margin-right: 15px;
145
+ color: #d4d4d4;
146
+ }
147
+
148
+
149
+ .wrio-statistic-tab-percent {
150
+ display: inline-block;
151
+ width: 42px;
152
+ height: 42px;
153
+ border-radius: 100px;
154
+ border: 2px dashed #e4e4e4;
155
+ padding: 5px;
156
+ margin-left: 30px;
157
+ font-size: 14px;
158
+ font-weight: 600;
159
+ text-align: center;
160
+ color: #bdbdbd;
161
+ }
162
+ }
163
+
164
+ .wrio-statistic-tab-premium-label:after {
165
+ .premium-label(absolute, 10px, auto, 10px);
166
+ }
167
+ }
168
+ }
169
+ }
170
+
171
+ // Table style. The table is used for optimization log
172
+ .wrio-table {
173
+ width: 100%;
174
+ table-layout: fixed;
175
+ box-sizing: border-box;
176
+ border-spacing: 3px;
177
+ background: #fff;
178
+ border-top: 2px dashed #cac9c9;
179
+
180
+ th, td {
181
+ padding: 16px 10px;
182
+ text-align: center;
183
+ }
184
+
185
+ th {
186
+ background: #f3f3f3;
187
+ color: #777777;
188
+ box-shadow: 0 1px 0 rgb(216, 216, 216);
189
+
190
+ &:nth-child(2n+1) {
191
+ background: #f9f9f9
192
+ }
193
+ }
194
+
195
+ tr.wrio-error {
196
+ background-color: #ffe9e9 !important;
197
+ }
198
+
199
+ .wrio-table-spinner {
200
+ background: url("../img/quick-start-loader.gif") center center no-repeat;
201
+ }
202
+
203
+ .wrio-table-highlighter {
204
+ display: inline-block;
205
+ padding: 3px 7px;
206
+ background: @greyButtonBg;
207
+ }
208
+
209
+ .wbcr-rio-server-success {
210
+ color: @positiveColor;
211
+ }
212
+
213
+ .wbcr-rio-server-error {
214
+ color: @errorColor;
215
+ }
216
+
217
+ .wbcr-rio-server-warning {
218
+ color: @waringColor;
219
+ }
220
+
221
+ &.wbcr-rio-folders-table {
222
+ td:nth-child(3) {
223
+ text-align: left;
224
+ }
225
+ }
226
+ }
227
+
228
+ .wrio-servers {
229
+ padding: 20px 20px;
230
+
231
+ label {
232
+ span {
233
+ display: block;
234
+ font-weight: normal;
235
+ font-size: 12px;
236
+ color: #b7b2b2;
237
+ }
238
+ }
239
+
240
+ #wrio-change-optimization-server {
241
+ position: relative;
242
+ display: inline-block;
243
+ max-width: 400px;
244
+ margin-right: 15px;
245
+ margin-bottom: 0;
246
+ border: 1px solid #d2d0d0;
247
+ background-color: #efefef;
248
+ }
249
+
250
+ .wrio-servers-info {
251
+ margin: 0 0 0;
252
+ padding: 20px;
253
+ background: #fff;
254
+ }
255
+
256
+ .wrio-server-status-wrap {
257
+ display: inline-block;
258
+ margin-top: 8px;
259
+
260
+ .wrio-server-status {
261
+ background: transparent;
262
+ color: #fff;
263
+ padding: 3px 5px;
264
+ border-radius: 4px;
265
+
266
+ &.wrio-down {
267
+ background: #ff5722;
268
+ }
269
+
270
+ &.wrio-stable {
271
+ background: #8bc34a;
272
+ }
273
+
274
+ &.wrio-server-check-proccess {
275
+ display: inline-block;
276
+ height: 10px;
277
+ width: 30px;
278
+ background: url("../img/quick-start-loader.gif") center no-repeat;
279
+ }
280
+ }
281
+ }
282
+
283
+
284
+ .wrio-premium-user-balance-wrap {
285
+ display: inline-block;
286
+ margin-top: 8px;
287
+ margin-left: 10px;
288
+
289
+ .wrio-premium-user-balance {
290
+ color: #fff;
291
+ padding: 3px 5px;
292
+ border-radius: 4px;
293
+ background: #ffc107;
294
+ }
295
+
296
+ .wrio-premium-user-balance-check-proccess {
297
+ display: inline-block;
298
+ height: 10px;
299
+ width: 30px;
300
+ background: url("../img/quick-start-loader.gif") center no-repeat;
301
+ }
302
+ }
303
+
304
+ .wrio-premium-user-update-wrap {
305
+ display: inline-block;
306
+ margin-top: 8px;
307
+ margin-left: 10px;
308
+
309
+ .wrio-premium-user-update {
310
+ color: #fff;
311
+ padding: 3px 5px;
312
+ border-radius: 4px;
313
+ background: #ffc107;
314
+ }
315
+
316
+ .wrio-premium-user-update-check-proccess {
317
+ display: inline-block;
318
+ height: 10px;
319
+ width: 30px;
320
+ background: url("../img/quick-start-loader.gif") center no-repeat;
321
+ }
322
+ }
323
+ }
324
+
325
+ .wio-columns {
326
+ overflow: hidden;
327
+ padding: 15px 0;
328
+ counter-reset: cols;
329
+
330
+ [class^="col-"] {
331
+ float: left;
332
+ -webkit-box-sizing: border-box;
333
+ -moz-box-sizing: border-box;
334
+ box-sizing: border-box;
335
+ }
336
+
337
+ .col-1-3 {
338
+ width: 33.333%;
339
+ padding-left: 28px;
340
+ }
341
+
342
+ .col-2-3 {
343
+ width: 66.666%;
344
+ padding-left: 28px
345
+ }
346
+
347
+ .col-1-2 {
348
+ width: 50%;
349
+ padding: 0 20px;
350
+ }
351
+
352
+ .col-statistics.col-statistics {
353
+ width: 60%;
354
+ }
355
+
356
+ .col-chart.col-chart {
357
+ width: 40%;
358
+ position: relative;
359
+ padding: 20px;
360
+ font-size: 12px;
361
+ text-transform: uppercase;
362
+ background: #f1f1f1b3;
363
+ color: #abacaf;
364
+ font-weight: bold;
365
+ border-radius: 5px;
366
+ margin-top: 10px;
367
+ text-align: left;
368
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
369
+ }
370
+ }
371
+
372
+ .wio-col {
373
+ float: left;
374
+ width: 50%;
375
+ box-sizing: border-box;
376
+ -webkit-flex-basis: 50%;
377
+ -ms-flex-preferred-size: 50%;
378
+ flex-basis: 50%;
379
+ }
380
+
381
+ .wio-col {
382
+ padding-right: 20px;
383
+ }
384
+
385
+ .wio-col + .wio-col {
386
+ padding-right: 0;
387
+ padding-left: 50px;
388
+ }
389
+
390
+ .wio-col:target {
391
+ animation: wiohello 1s 3 linear backwards;
392
+ }
393
+
394
+ .wio-number-you-optimized {
395
+ margin-bottom: 1.35em;
396
+ overflow: hidden;
397
+
398
+ #wio-total-optimized-attachments-pct {
399
+ color: @neutralColor;
400
+ }
401
+
402
+ .wio-number {
403
+ display: table-cell;
404
+ padding-right: 15px;
405
+ font-size: 48px;
406
+ font-weight: bold;
407
+ line-height: 1;
408
+ vertical-align: middle;
409
+ white-space: nowrap;
410
+ color: @neutralColor;
411
+ }
412
+
413
+ .wio-text {
414
+ display: table-cell;
415
+ vertical-align: middle;
416
+ overflow: hidden;
417
+ font-size: 12px;
418
+ color: @neutralColor;
419
+ }
420
+
421
+ & > p {
422
+ display: table;
423
+ }
424
+ }
425
+
426
+ .wio-bars {
427
+ padding-right: 15px;
428
+ }
429
+
430
+ .wio-bars p {
431
+ font-size: 12px;
432
+ margin-bottom: 5px;
433
+ }
434
+
435
+ .wio-bars + .wio-number-you-optimized {
436
+ border-bottom: 0;
437
+ padding-top: 0.85em;
438
+ }
439
+
440
+ .wio-bars + .wio-number-you-optimized p {
441
+ color: darken(@positiveColor, 10);
442
+ }
443
+
444
+ .wio-bar-negative {
445
+ .wio-progress {
446
+ background: @negativeColor;
447
+ }
448
+
449
+ .wio-barnb {
450
+ color: darken(@negativeColor, 20);
451
+ }
452
+ }
453
+
454
+ .wio-progress {
455
+ height: 8px;
456
+ transition: width .3s;
457
+
458
+ /*.wio-bar-negative {
459
+ width: 92% !important;
460
+ }*/
461
+ }
462
+
463
+ .wio-bar-positive {
464
+ .wio-progress {
465
+ background: @positiveColor;
466
+ }
467
+
468
+ .wio-barnb {
469
+ color: darken(@positiveColor, 10);
470
+ }
471
+ }
472
+
473
+ .wio-bar-primary {
474
+ .wio-progress {
475
+ background: @positiveColor;
476
+ }
477
+
478
+ .wio-barnb {
479
+ color: darken(@positiveColor, 10);
480
+ }
481
+ }
482
+
483
+ .wio-bar-webp {
484
+ .wio-progress {
485
+ background: @webpPositiveColor;
486
+ }
487
+
488
+ .wio-barnb {
489
+ color: darken(@webpPositiveColor, 10);
490
+ }
491
+ }
492
+
493
+ .wio-right-outside-number .wio-barnb {
494
+ display: block;
495
+ margin-right: -5.25em;
496
+ text-align: right;
497
+ font-weight: bold;
498
+ line-height: .8;
499
+ }
500
+
501
+ /* Doughnut */
502
+
503
+ .wio-chart {
504
+ position: relative;
505
+ top: 1px;
506
+ display: inline-block;
507
+ vertical-align: middle;
508
+ }
509
+
510
+ .wio-chart-container {
511
+ position: relative;
512
+ display: inline-block;
513
+ margin-right: 5px;
514
+ }
515
+
516
+ .wio-chart-container canvas {
517
+ display: block;
518
+ }
519
+
520
+ .wio-overview-chart-container {
521
+ float: left;
522
+ margin-right: 20px;
523
+ }
524
+
525
+ .wio-overview-chart-container-webp {
526
+ float: right;
527
+ margin-left: 20px;
528
+ }
529
+
530
+ .wio-chart-percent {
531
+ position: absolute;
532
+ left: 0;
533
+ right: 0;
534
+ top: 50%;
535
+ margin-top: -.5em;
536
+ line-height: 0.8;
537
+ text-align: center;
538
+ font-size: 45px;
539
+ font-weight: bold;
540
+ color: #afafaf;
541
+ }
542
+
543
+ .wio-chart-percent span {
544
+ font-size: 20px;
545
+ vertical-align: super;
546
+ }
547
+
548
+ #wio-overview-chart-legend {
549
+ overflow: hidden;
550
+ }
551
+
552
+ .wio-doughnut-legend li {
553
+ display: inline-block;
554
+ position: relative;
555
+ margin-bottom: 15px;
556
+ border-radius: 5px;
557
+ padding: 3px 8px 2px 31px;
558
+ font-size: 9px;
559
+ cursor: default;
560
+ -webkit-transition: background-color 200ms ease-in-out;
561
+ -moz-transition: background-color 200ms ease-in-out;
562
+ -o-transition: background-color 200ms ease-in-out;
563
+ transition: background-color 200ms ease-in-out;
564
+ }
565
+
566
+ .wio-doughnut-legend li span {
567
+ display: block;
568
+ position: absolute;
569
+ left: 0;
570
+ top: 0;
571
+ width: 25px;
572
+ height: 25px;
573
+ border-radius: 50%;
574
+ }
575
+
576
+ .wio-optimize-button {
577
+ min-width: 180px;
578
+ padding: 12px 30px;
579
+ background: @greenButtonBg;
580
+ color: @greenButtonColor;
581
+ border: 0;
582
+ box-shadow: none;
583
+ font-size: 14px;
584
+ text-transform: uppercase !important;
585
+ font-weight: bold;
586
+ border-radius: 4px;
587
+ outline: none;
588
+
589
+ &:active {
590
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5);
591
+ }
592
+
593
+ &:disabled {
594
+ background: lighten(@greenButtonBg, 10%);
595
+ color: lighten(@greenButtonColor, 30%);
596
+ }
597
+
598
+ &.wio-running {
599
+ color: @orangeButtonColor;
600
+ background: @orangeButtonBg url("../img/Spinner-1s-33px.gif") 10px center no-repeat;
601
+ padding-left: 50px;
602
+ }
603
+ }
604
+
605
+ .wio-global-optim-phrase {
606
+ width: 180px;
607
+ padding-top: 20px;
608
+ font-size: 14px;
609
+ text-align: center;
610
+ }
611
+
612
+ .wio-total-percent, .wio-total-percent-webp {
613
+ color: darken(@positiveColor, 20);
614
+ }
615
+
616
+ #wio-start-msg-top, #wio-start-msg-right, #wio-start-msg-complete {
617
+ display: none;
618
+ }
619
+
620
+ .wio-text-left {
621
+ text-align: left;
622
+ }
623
+
624
+ span.wio-num {
625
+ display: inline !important;
626
+ position: inherit !important;
627
+ }
628
+
629
+
630
+ // WIDGETS SPACE
631
+ // -----------------------------------------------
632
+ .wio-image-optimize-board {
633
+ padding-bottom: 0 !important;
634
+ }
635
+
636
+ .wio-page-statistic {
637
+ padding: 20px;
638
+
639
+ .wio-chart-percent {
640
+ margin-top: -1.2em;
641
+ }
642
+
643
+ .wio-optimize-statistic {
644
+ display: flex;
645
+ justify-content: space-between;
646
+ }
647
+ .wrio-statistic-buttons-wrap {
648
+ display: flex;
649
+ justify-content: space-between;
650
+ }
651
+ }
652
+
653
+ .wio-page-total {
654
+ padding: 20px 20px;
655
+ background: #efefef;
656
+
657
+ .wrio-calculate-process {
658
+ display: inline-block !important;
659
+ height: 10px;
660
+ width: 30px;
661
+ background: transparent url("../img/quick-start-loader.gif") center no-repeat !important;
662
+ }
663
+
664
+ .wrio-total-images {
665
+ font-weight: bold;
666
+ color: #fff;
667
+ padding: 3px 5px;
668
+ border-radius: 4px;
669
+ background: #ffc107;
670
+ }
671
+
672
+ span.wrio-total-images-desc {
673
+ display: block;
674
+ font-weight: normal;
675
+ font-size: 12px;
676
+ color: #b7b2b2;
677
+ }
678
+ }
679
+
680
+ .wrio-optimization-progress {
681
+ //margin-top: 30px;
682
+ background: none;
683
+ padding: 0;
684
+
685
+ h4 {
686
+ font-size: 15px;
687
+ font-weight: 700;
688
+ }
689
+
690
+ /*button {
691
+ padding: 5px 10px;
692
+ border: 0;
693
+ font-size: 11px;
694
+ text-transform: uppercase !important;
695
+ font-weight: bold;
696
+ border-radius: 4px;
697
+ outline: none;
698
+ background: @greyButtonBg;
699
+ color: @greyButtonColor;
700
+ box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
701
+
702
+ &:active {
703
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5);
704
+ }
705
+
706
+ &.wbcr-rio-loading {
707
+ width: 56px;
708
+ font-size: 0;
709
+ background: @greyButtonBg url("../img/quick-start-loader.gif") center no-repeat;
710
+ }
711
+
712
+ &.wbcr-rio-selected {
713
+ background: #f3efe2;
714
+ color: #d8d8d8;
715
+
716
+ &:active {
717
+ box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
718
+ }
719
+ }
720
+ }*/
721
+
722
+ .wbcr-rio-warning-message {
723
+ padding: 20px;
724
+ background: #efefef;
725
+ font-size: 15px;
726
+ color: #b7b7b7;
727
+ font-style: italic;
728
+ }
729
+ }
730
+
731
+ .wio-widget {
732
+ padding: 0 !important;
733
+
734
+ .wio-chart-percent {
735
+ font-size: 44px;
736
+ line-height: 1;
737
+ }
738
+
739
+ .wio-bars {
740
+ width: 60%;
741
+ margin-left: 155px;
742
+ }
743
+
744
+ .col-chart.col-chart {
745
+ width: 100%;
746
+ }
747
+
748
+ .col-controls {
749
+ width: 45%;
750
+ padding-left: 5px;
751
+ padding-top: 110px
752
+ }
753
+
754
+ .wio-doughnut-legend {
755
+ /*padding-top:30px;*/
756
+ text-align: left;
757
+ }
758
+
759
+ .wio-widget-bottom {
760
+ display: table;
761
+ padding-top: 20px !important;
762
+ width: 100%;
763
+ text-align: right;
764
+ }
765
+
766
+ .wio-widget-bottom li {
767
+ display: table-cell;
768
+ }
769
+
770
+ .wio-widget-bottom li:first-child {
771
+ text-align: left;
772
+ }
773
+ }
774
+
775
+ // FORMS SPACE
776
+ // -----------------------------------------------
777
+ .factory-checkbox {
778
+ &.wrio-checkbox-premium-label:after {
779
+ .premium-label();
780
+ }
781
+ }
782
+
783
+ .factory-checkbox-disabled {
784
+ input, button {
785
+ pointer-events: none;
786
+ cursor: not-allowed;
787
+ opacity: .65;
788
+ filter: alpha(opacity=65);
789
+ -webkit-box-shadow: none;
790
+ box-shadow: none;
791
+ }
792
+ }
793
+
794
+ #wrio-webp-options, #wrio-error-log-options {
795
+ h3 {
796
+ font-size: 14px;
797
+ margin: 0 0 10px 0;
798
+ font-weight: 600;
799
+ color: #565656;
800
+ }
801
+
802
+ .wrio-webp-options-info {
803
+ color: #8a8787;
804
+ font-size: 12px;
805
+ }
806
+
807
+ ul {
808
+ padding-left: 0;
809
+
810
+ li {
811
+ &:after {
812
+ content: '';
813
+ display: block;
814
+ clear: both;;
815
+ }
816
+
817
+ label {
818
+ font-weight: 600;
819
+ }
820
+
821
+ .wrio-webp-options-radio, .wrio-error-log-options-checkbox {
822
+ display: block;
823
+ float: left;
824
+ margin-top: 2px;
825
+ margin-right: 8px;
826
+
827
+ &:focus {
828
+ outline: none;
829
+ box-shadow: none;
830
+ }
831
+ }
832
+
833
+ .wrio-webp-options-info, .wrio-error-log-options-info {
834
+ padding-left: 25px;
835
+ }
836
+ }
837
+ }
838
+
839
+
840
+ }
841
+
842
+ // MEDIA SPACE
843
+ // -----------------------------------------------
844
+
845
+ @media (max-width: 830px) {
846
+ .wio [class^="col-"] {
847
+ float: none;
848
+ margin-bottom: 1.5em;
849
+ }
850
+
851
+ .wio .col-1-3,
852
+ .wio .col-1-2 {
853
+ width: auto;
854
+ padding: 0 28px;
855
+ clear: both;
856
+ padding-top: 1em;
857
+ }
858
+ }
859
+
860
+ @keyframes wiohello {
861
+ 0%, 100% {
862
+ background: #FFF;
863
+ }
864
+ 50% {
865
+ background: #F4F7F9;
866
+ }
867
+ }
868
+
869
+ @media (max-width: 1520px) and (min-width: 1381px), (max-width: 1086px) {
870
+ .wio-columns {
871
+ .col-statistics.col-statistics, .col-chart.col-chart {
872
+ width: 50%;
873
+ }
874
+ }
875
+
876
+ }
877
+
878
+ @media (max-width: 808px) {
879
+ .wio-columns {
880
+ .col-statistics.col-statistics, .col-chart.col-chart {
881
+ width: auto;
882
+ float: none;
883
+ padding: 0;
884
+ }
885
+
886
+ .col-chart.col-chart {
887
+ margin-top: 3em;
888
+ }
889
+ }
890
+ }
891
+ /*@media (max-width: 1380px) and (min-width: 1246px), (max-width: 380px) {
892
+ .wio-overview-chart-container {
893
+ float: none;
894
+ margin-right: 0;
895
+ }
896
+ }
897
+
898
+ @media (max-width: 1380px) and (min-width: 1246px), (max-width: 380px) {
899
+ .wio-overview-chart-container {
900
+ float: none;
901
+ margin-right: 0;
902
+ }
903
+
904
+ .wio-doughnut-legend {
905
+ margin-top: 18px;
906
+ }
907
+
908
+ .wio-global-optim-phrase {
909
+ padding-top: 0;
910
+ width: auto;
911
+ }
912
+ }*/
913
+ }
admin/assets/css/index.php CHANGED
@@ -1,2 +1,2 @@
1
- <?php
2
- // silence is golden
1
+ <?php
2
+ // silence is golden
admin/assets/css/media.css CHANGED
@@ -1,215 +1,215 @@
1
- /**
2
- * == Custom column & Metabox
3
- */
4
- .column-wio_optimized_file.column-wio_optimized_file {
5
- width: 300px;
6
- text-align: center;
7
- vertical-align: middle;
8
- }
9
- .column-wio_optimized_file > * {
10
- max-width: 235px;
11
- margin: 0 auto;
12
- }
13
- @media (min-width: 1151px) and (max-width: 1800px) {
14
- .column-wio_optimized_file.column-wio_optimized_file {
15
- width: 235px;
16
- }
17
- }
18
- @media (min-width: 783px) and (max-width: 1150px) {
19
- .column-wio_optimized_file.column-wio_optimized_file {
20
- width: 13em;
21
- }
22
- table.media .column-title .has-media-icon ~ .row-actions.row-actions {
23
- margin-left: 0;
24
- }
25
- }
26
- @media (max-width: 782px) {
27
- table.media .column-wio_optimized_file.column-wio_optimized_file {
28
- text-align: left;
29
- }
30
- table.media .wio-datas-more-action,
31
- table.media .wio-datas-actions-links {
32
- text-align: center;
33
- }
34
- table.media .column-wio_optimized_file > *,
35
- table.media .column-wio_optimized_file .wio-datas-actions-links a {
36
- max-width: 100%;
37
- margin-left: 0;
38
- }
39
- }
40
- @media (min-width: 783px) and (max-width: 1150px), (max-width: 360px) {
41
- table.media .wio-hide-if-small {
42
- position: absolute;
43
- margin: -1px;
44
- padding: 0;
45
- height: 1px;
46
- width: 1px;
47
- overflow: hidden;
48
- clip: rect(0 0 0 0);
49
- border: 0;
50
- word-wrap: normal !important; /* Many screen reader and browser combinations announce broken words as they would appear visually. */
51
- }
52
- }
53
- .compat-field-wio .label {
54
- vertical-align: top;
55
- }
56
- .compat-field-wio ul.wio-datas-list {
57
- margin-top: 7px;
58
- font-size: 11px;
59
- }
60
- ul.wio-datas-list.wio-datas-list {
61
- margin: 0 auto;
62
- color: #555;
63
- font-size: 10px;
64
- }
65
- ul.wio-datas-list .big {
66
- font-size: 12px;
67
- color: #40B1D0;
68
- }
69
- .wio-data-item {
70
- overflow: hidden;
71
- }
72
- li.wio-data-item {
73
- clear: both;
74
- margin-bottom: 2px;
75
- }
76
- ul.wio-datas-list .wio-data-item span.data,
77
- ul.wio-datas-list .wio-data-item strong {
78
- float: left;
79
- width: 50%;
80
- -webkit-box-sizing: border-box;
81
- -moz-box-sizing: border-box;
82
- box-sizing: border-box;
83
- }
84
- ul.wio-datas-list .wio-data-item span.data {
85
- text-align: left;
86
- padding-right: 5px;
87
- }
88
- .compat-field-wio .wio-datas-list .wio-data-item .data {
89
- width: 130px;
90
- text-align: left;
91
- font-weight: bold;
92
- }
93
- ul.wio-datas-list .wio-data-item strong {
94
- text-align: left;
95
- padding-left: 5px;
96
- }
97
- .media-sidebar .wio-datas-list .wio-data-item .data {
98
- width: auto;
99
- float: none;
100
- }
101
- .media-sidebar .wio-datas-list .wio-data-item strong {
102
- display: inline-block;
103
- width: auto;
104
- float: none;
105
- }
106
- .media-sidebar .wio-datas-list .wio-data-item .wio-chart {
107
- float: left;
108
- }
109
- .wio-datas-more-action.wio-datas-more-action {
110
- margin: .4em auto;
111
- background: linear-gradient(to bottom, transparent, transparent 49%, rgba(0,0,0,.075) 50%, rgba(0,0,0,.075) 58%, transparent 58%, transparent);
112
- }
113
- .wio-datas-more-action a {
114
- display: inline-block;
115
- padding: 0 5px;
116
- background: #40B1D0;
117
- color: #FFF;
118
- text-transform: uppercase;
119
- font-size: 9px;
120
- font-weight: bold;
121
- line-height: 1.9;
122
- text-decoration: none;
123
- }
124
- .wio-datas-more-action a.is-open {
125
- background: #555;
126
- }
127
- .wio-datas-more-action a.is-open .dashicons {
128
- transform: rotate(180deg);
129
- }
130
- .wio-datas-more-action a .dashicons {
131
- font-size: 14px;
132
- vertical-align: middle;
133
- line-height: .8;
134
- }
135
- .wio-datas-more-action a .dashicons:before {
136
- vertical-align: middle;
137
- line-height: 20px;
138
- }
139
- .wio-datas-more-action .the-text {
140
- display: inline-block;
141
- vertical-align: middle;
142
- height: auto;
143
- line-height: inherit;
144
- }
145
-
146
- ul.wio-datas-details.wio-datas-details {
147
- margin: .7em auto;
148
- }
149
- .wio-datas-details strong {
150
- color: #40B1D0;
151
- }
152
- .wio-datas-details .original {
153
- color: #555;
154
- }
155
-
156
- .wio-datas-actions-links {
157
- overflow: hidden;
158
- border-top: 2px solid transparent;
159
- padding-top: 5px;
160
- font-size: 8px;
161
- }
162
- .nggform .wio-datas-actions-links {
163
- position: relative;
164
- z-index: 2;
165
- }
166
- .nggform .row-actions {
167
- z-index: 1;
168
- }
169
- .wio-datas-actions-links a {
170
- position: relative;
171
- display: inline-block;
172
- padding-left: 17px;
173
- text-decoration: none;
174
- font-weight: 600;
175
- }
176
- .compat-field-wio .wio-datas-actions-links {
177
- max-width: 300px;
178
- }
179
- .misc-pub-wio .wio-datas-actions-links {
180
- border-top: 2px solid #f2f2f2;
181
- padding-bottom: 5px;
182
- }
183
- /* Library */
184
- .column-wio_optimized_file .wio-datas-actions-links a {
185
- margin: 0 .7em;
186
- padding-left: 15px;
187
- }
188
-
189
- /* Media edition */
190
- .compat-field-wio .wio-datas-actions-links a,
191
- .misc-pub-wio .wio-datas-actions-links a {
192
- font-size: 10px;
193
- float: left;
194
- width: 50%;
195
- }
196
- .media-sidebar .compat-field-wio .wio-datas-actions-links a,
197
- .submitbox .misc-pub-wio .wio-datas-actions-links a {
198
- display: block;
199
- width: auto;
200
- float: none;
201
- }
202
- .wio-datas-actions-links a:only-child {
203
- float: none;
204
- width: auto;
205
- }
206
- .wio-datas-details.is-open + .wio-datas-actions-links {
207
- border-top-color: rgba(0,0,0,.075);
208
- }
209
- .wio-datas-actions-links .dashicons {
210
- position: absolute;
211
- left: 0; top: 4px;
212
- width: 12px;
213
- margin-right: 2px;
214
- font-size: 11px;
215
- }
1
+ /**
2
+ * == Custom column & Metabox
3
+ */
4
+ .column-wio_optimized_file.column-wio_optimized_file {
5
+ width: 300px;
6
+ text-align: center;
7
+ vertical-align: middle;
8
+ }
9
+ .column-wio_optimized_file > * {
10
+ max-width: 235px;
11
+ margin: 0 auto;
12
+ }
13
+ @media (min-width: 1151px) and (max-width: 1800px) {
14
+ .column-wio_optimized_file.column-wio_optimized_file {
15
+ width: 235px;
16
+ }
17
+ }
18
+ @media (min-width: 783px) and (max-width: 1150px) {
19
+ .column-wio_optimized_file.column-wio_optimized_file {
20
+ width: 13em;
21
+ }
22
+ table.media .column-title .has-media-icon ~ .row-actions.row-actions {
23
+ margin-left: 0;
24
+ }
25
+ }
26
+ @media (max-width: 782px) {
27
+ table.media .column-wio_optimized_file.column-wio_optimized_file {
28
+ text-align: left;
29
+ }
30
+ table.media .wio-datas-more-action,
31
+ table.media .wio-datas-actions-links {
32
+ text-align: center;
33
+ }
34
+ table.media .column-wio_optimized_file > *,
35
+ table.media .column-wio_optimized_file .wio-datas-actions-links a {
36
+ max-width: 100%;
37
+ margin-left: 0;
38
+ }
39
+ }
40
+ @media (min-width: 783px) and (max-width: 1150px), (max-width: 360px) {
41
+ table.media .wio-hide-if-small {
42
+ position: absolute;
43
+ margin: -1px;
44
+ padding: 0;
45
+ height: 1px;
46
+ width: 1px;
47
+ overflow: hidden;
48
+ clip: rect(0 0 0 0);
49
+ border: 0;
50
+ word-wrap: normal !important; /* Many screen reader and browser combinations announce broken words as they would appear visually. */
51
+ }
52
+ }
53
+ .compat-field-wio .label {
54
+ vertical-align: top;
55
+ }
56
+ .compat-field-wio ul.wio-datas-list {
57
+ margin-top: 7px;
58
+ font-size: 11px;
59
+ }
60
+ ul.wio-datas-list.wio-datas-list {
61
+ margin: 0 auto;
62
+ color: #555;
63
+ font-size: 10px;
64
+ }
65
+ ul.wio-datas-list .big {
66
+ font-size: 12px;
67
+ color: #40B1D0;
68
+ }
69
+ .wio-data-item {
70
+ overflow: hidden;
71
+ }
72
+ li.wio-data-item {
73
+ clear: both;
74
+ margin-bottom: 2px;
75
+ }
76
+ ul.wio-datas-list .wio-data-item span.data,
77
+ ul.wio-datas-list .wio-data-item strong {
78
+ float: left;
79
+ width: 50%;
80
+ -webkit-box-sizing: border-box;
81
+ -moz-box-sizing: border-box;
82
+ box-sizing: border-box;
83
+ }
84
+ ul.wio-datas-list .wio-data-item span.data {
85
+ text-align: left;
86
+ padding-right: 5px;
87
+ }
88
+ .compat-field-wio .wio-datas-list .wio-data-item .data {
89
+ width: 130px;
90
+ text-align: left;
91
+ font-weight: bold;
92
+ }
93
+ ul.wio-datas-list .wio-data-item strong {
94
+ text-align: left;
95
+ padding-left: 5px;
96
+ }
97
+ .media-sidebar .wio-datas-list .wio-data-item .data {
98
+ width: auto;
99
+ float: none;
100
+ }
101
+ .media-sidebar .wio-datas-list .wio-data-item strong {
102
+ display: inline-block;
103
+ width: auto;
104
+ float: none;
105
+ }
106
+ .media-sidebar .wio-datas-list .wio-data-item .wio-chart {
107
+ float: left;
108
+ }
109
+ .wio-datas-more-action.wio-datas-more-action {
110
+ margin: .4em auto;
111
+ background: linear-gradient(to bottom, transparent, transparent 49%, rgba(0,0,0,.075) 50%, rgba(0,0,0,.075) 58%, transparent 58%, transparent);
112
+ }
113
+ .wio-datas-more-action a {
114
+ display: inline-block;
115
+ padding: 0 5px;
116
+ background: #40B1D0;
117
+ color: #FFF;
118
+ text-transform: uppercase;
119
+ font-size: 9px;
120
+ font-weight: bold;
121
+ line-height: 1.9;
122
+ text-decoration: none;
123
+ }
124
+ .wio-datas-more-action a.is-open {
125
+ background: #555;
126
+ }
127
+ .wio-datas-more-action a.is-open .dashicons {
128
+ transform: rotate(180deg);
129
+ }
130
+ .wio-datas-more-action a .dashicons {
131
+ font-size: 14px;
132
+ vertical-align: middle;
133
+ line-height: .8;
134
+ }
135
+ .wio-datas-more-action a .dashicons:before {
136
+ vertical-align: middle;
137
+ line-height: 20px;
138
+ }
139
+ .wio-datas-more-action .the-text {
140
+ display: inline-block;
141
+ vertical-align: middle;
142
+ height: auto;
143
+ line-height: inherit;
144
+ }
145
+
146
+ ul.wio-datas-details.wio-datas-details {
147
+ margin: .7em auto;
148
+ }
149
+ .wio-datas-details strong {
150
+ color: #40B1D0;
151
+ }
152
+ .wio-datas-details .original {
153
+ color: #555;
154
+ }
155
+
156
+ .wio-datas-actions-links {
157
+ overflow: hidden;
158
+ border-top: 2px solid transparent;
159
+ padding-top: 5px;
160
+ font-size: 8px;
161
+ }
162
+ .nggform .wio-datas-actions-links {
163
+ position: relative;
164
+ z-index: 2;
165
+ }
166
+ .nggform .row-actions {
167
+ z-index: 1;
168
+ }
169
+ .wio-datas-actions-links a {
170
+ position: relative;
171
+ display: inline-block;
172
+ padding-left: 17px;
173
+ text-decoration: none;
174
+ font-weight: 600;
175
+ }
176
+ .compat-field-wio .wio-datas-actions-links {
177
+ max-width: 300px;
178
+ }
179
+ .misc-pub-wio .wio-datas-actions-links {
180
+ border-top: 2px solid #f2f2f2;
181
+ padding-bottom: 5px;
182
+ }
183
+ /* Library */
184
+ .column-wio_optimized_file .wio-datas-actions-links a {
185
+ margin: 0 .7em;
186
+ padding-left: 15px;
187
+ }
188
+
189
+ /* Media edition */
190
+ .compat-field-wio .wio-datas-actions-links a,
191
+ .misc-pub-wio .wio-datas-actions-links a {
192
+ font-size: 10px;
193
+ float: left;
194
+ width: 50%;
195
+ }
196
+ .media-sidebar .compat-field-wio .wio-datas-actions-links a,
197
+ .submitbox .misc-pub-wio .wio-datas-actions-links a {
198
+ display: block;
199
+ width: auto;
200
+ float: none;
201
+ }
202
+ .wio-datas-actions-links a:only-child {
203
+ float: none;
204
+ width: auto;
205
+ }
206
+ .wio-datas-details.is-open + .wio-datas-actions-links {
207
+ border-top-color: rgba(0,0,0,.075);
208
+ }
209
+ .wio-datas-actions-links .dashicons {
210
+ position: absolute;
211
+ left: 0; top: 4px;
212
+ width: 12px;
213
+ margin-right: 2px;
214
+ font-size: 11px;
215
+ }
admin/assets/css/settings-premium.css CHANGED
@@ -1,17 +1,17 @@
1
- button[data-value="googlepage"]:after, button[data-value="background"]:after {
2
- display: inline-block;
3
- position: absolute;
4
- content: 'PRO';
5
- background: #ff5722;
6
- border-radius: 4px;
7
- color: #fff;
8
- font-size: 10px;
9
- line-height: 1;
10
- font-style: normal;
11
- padding: 4px 6px;
12
- margin-left: 4px;
13
- vertical-align: top;
14
- top: -8px;
15
- right: 0;
16
- z-index: 11;
17
- }
1
+ button[data-value="googlepage"]:after, button[data-value="background"]:after {
2
+ display: inline-block;
3
+ position: absolute;
4
+ content: 'PRO';
5
+ background: #ff5722;
6
+ border-radius: 4px;
7
+ color: #fff;
8
+ font-size: 10px;
9
+ line-height: 1;
10
+ font-style: normal;
11
+ padding: 4px 6px;
12
+ margin-left: 4px;
13
+ vertical-align: top;
14
+ top: -8px;
15
+ right: 0;
16
+ z-index: 11;
17
+ }
admin/assets/css/statistic.css CHANGED
@@ -1,410 +1,410 @@
1
-
2
- /**
3
- * == Columns
4
- */
5
- .wio-columns {
6
- overflow: hidden;
7
- padding: 15px 0;
8
- counter-reset: cols;
9
- }
10
-
11
- .wio-columns [class^="col-"] {
12
- float: left;
13
- -webkit-box-sizing: border-box;
14
- -moz-box-sizing: border-box;
15
- box-sizing: border-box;
16
- }
17
-
18
- .wio-columns .col-1-3 {
19
- width: 33.333%;
20
- padding-left: 28px;
21
- }
22
-
23
- .wio .col-2-3 {
24
- width: 66.666%;
25
- padding-left: 28px
26
- }
27
-
28
- .wio .col-1-2 {
29
- width: 50%;
30
- padding: 0 20px;
31
- }
32
-
33
- @media (max-width: 830px) {
34
- .wio [class^="col-"] {
35
- float: none;
36
- margin-bottom: 1.5em;
37
- }
38
-
39
- .wio .col-1-3,
40
- .wio .col-1-2 {
41
- width: auto;
42
- padding: 0 28px;
43
- clear: both;
44
- padding-top: 1em;
45
- }
46
- }
47
-
48
- /* Col, behavior depending on parent */
49
- .wio-col {
50
- float: left;
51
- width: 50%;
52
- box-sizing: border-box;
53
- -webkit-flex-basis: 50%;
54
- -ms-flex-preferred-size: 50%;
55
- flex-basis: 50%;
56
- }
57
-
58
- .wio-col {
59
- padding-right: 20px;
60
- }
61
-
62
- .wio-col + .wio-col {
63
- padding-right: 0;
64
- padding-left: 50px;
65
- }
66
-
67
- .wio-col:target {
68
- animation: wiohello 1s 3 linear backwards;
69
- }
70
-
71
- @keyframes wiohello {
72
- 0%, 100% {
73
- background: #FFF;
74
- }
75
- 50% {
76
- background: #F4F7F9;
77
- }
78
- }
79
-
80
- .wio-columns .col-statistics.col-statistics {
81
- width: 60%;
82
- }
83
-
84
- @media (max-width: 1520px) and (min-width: 1381px), (max-width: 1086px) {
85
- .wio-columns .col-statistics.col-statistics,
86
- .wio-columns .col-chart.col-chart {
87
- width: 50%;
88
- }
89
- }
90
-
91
- @media (max-width: 808px) {
92
- .wio-columns .col-statistics.col-statistics,
93
- .wio-columns .col-chart.col-chart {
94
- width: auto;
95
- float: none;
96
- padding: 0;
97
- }
98
-
99
- .wio-columns .col-chart.col-chart {
100
- margin-top: 3em;
101
- }
102
- }
103
-
104
- /* Number display */
105
- .wio-number-you-optimized {
106
- margin-bottom: 1.35em;
107
- overflow: hidden;
108
- }
109
-
110
- .wio-number-you-optimized .number {
111
- display: table-cell;
112
- padding-right: 15px;
113
- font-size: 48px;
114
- font-weight: bold;
115
- line-height: 1;
116
- vertical-align: middle;
117
- white-space: nowrap;
118
- color: #000;
119
- }
120
-
121
- .wio-number-you-optimized [id="wio-total-optimized-attachments-pct"] {
122
- color: #40B1D0;
123
- }
124
-
125
- .wio-number-you-optimized .text {
126
- display: table-cell;
127
- vertical-align: middle;
128
- overflow: hidden;
129
- font-size: 12px;
130
- color: #626E7B;
131
- }
132
-
133
- .wio-number-you-optimized > p {
134
- display: table;
135
- }
136
-
137
- /* Number and bars */
138
- .wio-bars {
139
- padding-right: 15px;
140
- }
141
-
142
- .wio-bars p {
143
- font-size: 12px;
144
- margin-bottom: 5px;
145
- }
146
-
147
- .wio-bars + .wio-number-you-optimized {
148
- border-bottom: 0;
149
- padding-top: 0.85em;
150
- }
151
-
152
- .wio-bars + .wio-number-you-optimized p {
153
- color: #46b1ce;
154
- }
155
-
156
- .wio-bar-negative .wio-progress {
157
- background: #D2D3D6;
158
- }
159
-
160
- .wio-bar-negative .wio-barnb {
161
- color: #7A8996;
162
- }
163
-
164
- .wio-bar-neutral .wio-progress {
165
- background: #F5A623;
166
- }
167
-
168
- .wio-space-left .wio-bar-negative .wio-progress {
169
- background: #C51162;
170
- }
171
-
172
- .wio-progress {
173
- height: 8px;
174
- }
175
-
176
- .wio-progress {
177
- transition: width .3s;
178
- }
179
-
180
- .wio-bar-positive .wio-progress {
181
- background: #8CC152;
182
- }
183
-
184
- .wio-bar-positive .wio-barnb {
185
- color: #8CC152;
186
- }
187
-
188
- .wio-bar-primary .wio-progress {
189
- background: #8bc34a;
190
- }
191
-
192
- .wio-bar-primary .wio-barnb {
193
- color: #8bc34a;
194
- }
195
-
196
- .right-outside-number .wio-barnb {
197
- display: block;
198
- margin-right: -5.25em;
199
- text-align: right;
200
- font-weight: bold;
201
- line-height: .8;
202
- }
203
-
204
-
205
- /* Doughnut */
206
- .wio-chart {
207
- position: relative;
208
- top: 1px;
209
- display: inline-block;
210
- vertical-align: middle;
211
- }
212
-
213
- .wio-chart-container {
214
- position: relative;
215
- display: inline-block;
216
- margin-right: 5px;
217
- }
218
-
219
- .wio-chart-container canvas {
220
- display: block;
221
- }
222
-
223
- .wio-overview-chart-container {
224
- float: left;
225
- margin-right: 20px;
226
- }
227
-
228
- @media (max-width: 1380px) and (min-width: 1246px), (max-width: 380px) {
229
- .wio-overview-chart-container {
230
- float: none;
231
- margin-right: 0;
232
- }
233
- }
234
-
235
- .wio-chart-percent {
236
- position: absolute;
237
- left: 0;
238
- right: 0;
239
- top: 50%;
240
- margin-top: -.5em;
241
- line-height: 1;
242
- text-align: center;
243
- font-size: 55px;
244
- font-weight: bold;
245
- color: #afafaf;
246
- }
247
-
248
- .wio-chart-percent span {
249
- font-size: 20px;
250
- vertical-align: super;
251
- }
252
-
253
- #wio-overview-chart-legend {
254
- overflow: hidden;
255
- }
256
-
257
- .imagify-doughnut-legend {
258
- margin-top: 38px;
259
- list-style: none;
260
- }
261
-
262
- .wio-doughnut-legend li {
263
- display: inline-block;
264
- padding-left: 30px;
265
- position: relative;
266
- margin-bottom: 15px;
267
- border-radius: 5px;
268
- padding: 3px 8px 2px 31px;
269
- font-size: 13px;
270
- cursor: default;
271
- -webkit-transition: background-color 200ms ease-in-out;
272
- -moz-transition: background-color 200ms ease-in-out;
273
- -o-transition: background-color 200ms ease-in-out;
274
- transition: background-color 200ms ease-in-out;
275
- }
276
-
277
- .wio-doughnut-legend li span {
278
- display: block;
279
- position: absolute;
280
- left: 0;
281
- top: 0;
282
- width: 25px;
283
- height: 25px;
284
- border-radius: 50%;
285
- }
286
-
287
- @media (max-width: 1380px) and (min-width: 1246px), (max-width: 380px) {
288
- .wio-overview-chart-container {
289
- float: none;
290
- margin-right: 0;
291
- }
292
-
293
- .wio-doughnut-legend {
294
- margin-top: 18px;
295
- }
296
-
297
- .wio-global-optim-phrase {
298
- padding-top: 0;
299
- width: auto;
300
- }
301
- }
302
-
303
- .wio-global-optim-phrase {
304
- width: 180px;
305
- padding-top: 20px;
306
- font-size: 14px;
307
- text-align: center;
308
- }
309
-
310
- .wio-clear {
311
- clear: both;
312
- }
313
-
314
- .wio-total-percent {
315
- color: #46b1ce;
316
- }
317
-
318
- .wio-columns .col-chart.col-chart {
319
- width: 40%;
320
- position: relative;
321
- padding: 20px;
322
- font-size: 12px;
323
- text-transform: uppercase;
324
- background: #f1f1f1b3;
325
- color: #abacaf;
326
- font-weight: bold;
327
- border-radius: 5px;
328
- margin-top: 10px;
329
- text-align: left;
330
- box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
331
- }
332
-
333
- .wio-image-optimize-board {
334
- padding-bottom: 0 !important;
335
- }
336
-
337
- .wio-optimize-button {
338
- width: 180px;
339
- padding: 12px 30px;
340
- background: #c9deb2;
341
- color: #586549;
342
- border: 0;
343
- box-shadow: none;
344
- font-size: 16px;
345
- text-transform: uppercase !important;
346
- font-weight: bold;
347
- border-radius: 4px;
348
- outline: none;
349
- }
350
-
351
- .wio-optimize-button:active {
352
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5);
353
- }
354
-
355
- .wio-optimize-button.running {
356
- color: #a57b3c;
357
- background: #fdd599 url("../img/Spinner-1s-33px.gif") 10px center no-repeat;
358
- }
359
-
360
- .wio-widget-bottom {
361
- display: table;
362
- padding-top: 20px !important;
363
- width: 100%;
364
- text-align: right;
365
- }
366
-
367
- .wio-widget-bottom li {
368
- display: table-cell;
369
- }
370
-
371
- .wio-widget-bottom li:first-child {
372
- text-align: left;
373
- }
374
-
375
- .wio-imagify-widget {
376
- padding: 0 !important;
377
- }
378
-
379
- .wio-imagify-widget .wio-bars {
380
- width: 60%;
381
- margin-left: 155px;
382
- }
383
-
384
- .wio-imagify-widget .col-chart.col-chart {
385
- width: 100%;
386
- }
387
-
388
- .wio-imagify-widget .col-controls {
389
- width: 45%;
390
- padding-left: 5px;
391
- padding-top: 110px
392
- }
393
-
394
- .wio-imagify-widget .wio-doughnut-legend {
395
- /*padding-top:30px;*/
396
- text-align: left;
397
- }
398
-
399
- #wio-start-msg-top, #wio-start-msg-right, #wio-start-msg-complete {
400
- display: none;
401
- }
402
-
403
- .wio-text-left {
404
- text-align: left;
405
- }
406
-
407
- span.wio-num {
408
- display: inline !important;
409
- position: inherit !important;
410
- }
1
+
2
+ /**
3
+ * == Columns
4
+ */
5
+ .wio-columns {
6
+ overflow: hidden;
7
+ padding: 15px 0;
8
+ counter-reset: cols;
9
+ }
10
+
11
+ .wio-columns [class^="col-"] {
12
+ float: left;
13
+ -webkit-box-sizing: border-box;
14
+ -moz-box-sizing: border-box;
15
+ box-sizing: border-box;
16
+ }
17
+
18
+ .wio-columns .col-1-3 {
19
+ width: 33.333%;
20
+ padding-left: 28px;
21
+ }
22
+
23
+ .wio .col-2-3 {
24
+ width: 66.666%;
25
+ padding-left: 28px
26
+ }
27
+
28
+ .wio .col-1-2 {
29
+ width: 50%;
30
+ padding: 0 20px;
31
+ }
32
+
33
+ @media (max-width: 830px) {
34
+ .wio [class^="col-"] {
35
+ float: none;
36
+ margin-bottom: 1.5em;
37
+ }
38
+
39
+ .wio .col-1-3,
40
+ .wio .col-1-2 {
41
+ width: auto;
42
+ padding: 0 28px;
43
+ clear: both;
44
+ padding-top: 1em;
45
+ }
46
+ }
47
+
48
+ /* Col, behavior depending on parent */
49
+ .wio-col {
50
+ float: left;
51
+ width: 50%;
52
+ box-sizing: border-box;
53
+ -webkit-flex-basis: 50%;
54
+ -ms-flex-preferred-size: 50%;
55
+ flex-basis: 50%;
56
+ }
57
+
58
+ .wio-col {
59
+ padding-right: 20px;
60
+ }
61
+
62
+ .wio-col + .wio-col {
63
+ padding-right: 0;
64
+ padding-left: 50px;
65
+ }
66
+
67
+ .wio-col:target {
68
+ animation: wiohello 1s 3 linear backwards;
69
+ }
70
+
71
+ @keyframes wiohello {
72
+ 0%, 100% {
73
+ background: #FFF;
74
+ }
75
+ 50% {
76
+ background: #F4F7F9;
77
+ }
78
+ }
79
+
80
+ .wio-columns .col-statistics.col-statistics {
81
+ width: 60%;
82
+ }
83
+
84
+ @media (max-width: 1520px) and (min-width: 1381px), (max-width: 1086px) {
85
+ .wio-columns .col-statistics.col-statistics,
86
+ .wio-columns .col-chart.col-chart {
87
+ width: 50%;
88
+ }
89
+ }
90
+
91
+ @media (max-width: 808px) {
92
+ .wio-columns .col-statistics.col-statistics,
93
+ .wio-columns .col-chart.col-chart {
94
+ width: auto;
95
+ float: none;
96
+ padding: 0;
97
+ }
98
+
99
+ .wio-columns .col-chart.col-chart {
100
+ margin-top: 3em;
101
+ }
102
+ }
103
+
104
+ /* Number display */
105
+ .wio-number-you-optimized {
106
+ margin-bottom: 1.35em;
107
+ overflow: hidden;
108
+ }
109
+
110
+ .wio-number-you-optimized .number {
111
+ display: table-cell;
112
+ padding-right: 15px;
113
+ font-size: 48px;
114
+ font-weight: bold;
115
+ line-height: 1;
116
+ vertical-align: middle;
117
+ white-space: nowrap;
118
+ color: #000;
119
+ }
120
+
121
+ .wio-number-you-optimized [id="wio-total-optimized-attachments-pct"] {
122
+ color: #40B1D0;
123
+ }
124
+
125
+ .wio-number-you-optimized .text {
126
+ display: table-cell;
127
+ vertical-align: middle;
128
+ overflow: hidden;
129
+ font-size: 12px;
130
+ color: #626E7B;
131
+ }
132
+
133
+ .wio-number-you-optimized > p {
134
+ display: table;
135
+ }
136
+
137
+ /* Number and bars */
138
+ .wio-bars {
139
+ padding-right: 15px;
140
+ }
141
+
142
+ .wio-bars p {
143
+ font-size: 12px;
144
+ margin-bottom: 5px;
145
+ }
146
+
147
+ .wio-bars + .wio-number-you-optimized {
148
+ border-bottom: 0;
149
+ padding-top: 0.85em;
150
+ }
151
+
152
+ .wio-bars + .wio-number-you-optimized p {
153
+ color: #46b1ce;
154
+ }
155
+
156
+ .wio-bar-negative .wio-progress {
157
+ background: #D2D3D6;
158
+ }
159
+
160
+ .wio-bar-negative .wio-barnb {
161
+ color: #7A8996;
162
+ }
163
+
164
+ .wio-bar-neutral .wio-progress {
165
+ background: #F5A623;
166
+ }
167
+
168
+ .wio-space-left .wio-bar-negative .wio-progress {
169
+ background: #C51162;
170
+ }
171
+
172
+ .wio-progress {
173
+ height: 8px;
174
+ }
175
+
176
+ .wio-progress {
177
+ transition: width .3s;
178
+ }
179
+
180
+ .wio-bar-positive .wio-progress {
181
+ background: #8CC152;
182
+ }
183
+
184
+ .wio-bar-positive .wio-barnb {
185
+ color: #8CC152;
186
+ }
187
+
188
+ .wio-bar-primary .wio-progress {
189
+ background: #8bc34a;
190
+ }
191
+
192
+ .wio-bar-primary .wio-barnb {
193
+ color: #8bc34a;
194
+ }
195
+
196
+ .right-outside-number .wio-barnb {
197
+ display: block;
198
+ margin-right: -5.25em;
199
+ text-align: right;
200
+ font-weight: bold;
201
+ line-height: .8;
202
+ }
203
+
204
+
205
+ /* Doughnut */
206
+ .wio-chart {
207
+ position: relative;
208
+ top: 1px;
209
+ display: inline-block;
210
+ vertical-align: middle;
211
+ }
212
+
213
+ .wio-chart-container {
214
+ position: relative;
215
+ display: inline-block;
216
+ margin-right: 5px;
217
+ }
218
+
219
+ .wio-chart-container canvas {
220
+ display: block;
221
+ }
222
+
223
+ .wio-overview-chart-container {
224
+ float: left;
225
+ margin-right: 20px;
226
+ }
227
+
228
+ @media (max-width: 1380px) and (min-width: 1246px), (max-width: 380px) {
229
+ .wio-overview-chart-container {
230
+ float: none;
231
+ margin-right: 0;
232
+ }
233
+ }
234
+
235
+ .wio-chart-percent {
236
+ position: absolute;
237
+ left: 0;
238
+ right: 0;
239
+ top: 50%;
240
+ margin-top: -.5em;
241
+ line-height: 1;
242
+ text-align: center;
243
+ font-size: 55px;
244
+ font-weight: bold;
245
+ color: #afafaf;
246
+ }
247
+
248
+ .wio-chart-percent span {
249
+ font-size: 20px;
250
+ vertical-align: super;
251
+ }
252
+
253
+ #wio-overview-chart-legend {
254
+ overflow: hidden;
255
+ }
256
+
257
+ .imagify-doughnut-legend {
258
+ margin-top: 38px;
259
+ list-style: none;
260
+ }
261
+
262
+ .wio-doughnut-legend li {
263
+ display: inline-block;
264
+ padding-left: 30px;
265
+ position: relative;
266
+ margin-bottom: 15px;
267
+ border-radius: 5px;
268
+ padding: 3px 8px 2px 31px;
269
+ font-size: 13px;
270
+ cursor: default;
271
+ -webkit-transition: background-color 200ms ease-in-out;
272
+ -moz-transition: background-color 200ms ease-in-out;
273
+ -o-transition: background-color 200ms ease-in-out;
274
+ transition: background-color 200ms ease-in-out;
275
+ }
276
+
277
+ .wio-doughnut-legend li span {
278
+ display: block;
279
+ position: absolute;
280
+ left: 0;
281
+ top: 0;
282
+ width: 25px;
283
+ height: 25px;
284
+ border-radius: 50%;
285
+ }
286
+
287
+ @media (max-width: 1380px) and (min-width: 1246px), (max-width: 380px) {
288
+ .wio-overview-chart-container {
289
+ float: none;
290
+ margin-right: 0;
291
+ }
292
+
293
+ .wio-doughnut-legend {
294
+ margin-top: 18px;
295
+ }
296
+
297
+ .wio-global-optim-phrase {
298
+ padding-top: 0;
299
+ width: auto;
300
+ }
301
+ }
302
+
303
+ .wio-global-optim-phrase {
304
+ width: 180px;
305
+ padding-top: 20px;
306
+ font-size: 14px;
307
+ text-align: center;
308
+ }
309
+
310
+ .wio-clear {
311
+ clear: both;
312
+ }
313
+
314
+ .wio-total-percent {
315
+ color: #46b1ce;
316
+ }
317
+
318
+ .wio-columns .col-chart.col-chart {
319
+ width: 40%;
320
+ position: relative;
321
+ padding: 20px;
322
+ font-size: 12px;
323
+ text-transform: uppercase;
324
+ background: #f1f1f1b3;
325
+ color: #abacaf;
326
+ font-weight: bold;
327
+ border-radius: 5px;
328
+ margin-top: 10px;
329
+ text-align: left;
330
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
331
+ }
332
+
333
+ .wio-image-optimize-board {
334
+ padding-bottom: 0 !important;
335
+ }
336
+
337
+ .wio-optimize-button {
338
+ width: 180px;
339
+ padding: 12px 30px;
340
+ background: #c9deb2;
341
+ color: #586549;
342
+ border: 0;
343
+ box-shadow: none;
344
+ font-size: 16px;
345
+ text-transform: uppercase !important;
346
+ font-weight: bold;
347
+ border-radius: 4px;
348
+ outline: none;
349
+ }
350
+
351
+ .wio-optimize-button:active {
352
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5);
353
+ }
354
+
355
+ .wio-optimize-button.running {
356
+ color: #a57b3c;
357
+ background: #fdd599 url("../img/Spinner-1s-33px.gif") 10px center no-repeat;
358
+ }
359
+
360
+ .wio-widget-bottom {
361
+ display: table;
362
+ padding-top: 20px !important;
363
+ width: 100%;
364
+ text-align: right;
365
+ }
366
+
367
+ .wio-widget-bottom li {
368
+ display: table-cell;
369
+ }
370
+
371
+ .wio-widget-bottom li:first-child {
372
+ text-align: left;
373
+ }
374
+
375
+ .wio-imagify-widget {
376
+ padding: 0 !important;
377
+ }
378
+
379
+ .wio-imagify-widget .wio-bars {
380
+ width: 60%;
381
+ margin-left: 155px;
382
+ }
383
+
384
+ .wio-imagify-widget .col-chart.col-chart {
385
+ width: 100%;
386
+ }
387
+
388
+ .wio-imagify-widget .col-controls {
389
+ width: 45%;
390
+ padding-left: 5px;
391
+ padding-top: 110px
392
+ }
393
+
394
+ .wio-imagify-widget .wio-doughnut-legend {
395
+ /*padding-top:30px;*/
396
+ text-align: left;
397
+ }
398
+
399
+ #wio-start-msg-top, #wio-start-msg-right, #wio-start-msg-complete {
400
+ display: none;
401
+ }
402
+
403
+ .wio-text-left {
404
+ text-align: left;
405
+ }
406
+
407
+ span.wio-num {
408
+ display: inline !important;
409
+ position: inherit !important;
410
+ }
admin/assets/css/sweetalert-custom.css CHANGED
@@ -1,155 +1,155 @@
1
- /* Sub Layer */
2
- body[class*="_rio"] .swal2-container.swal2-shown {
3
- background: rgba(16, 17, 21, 0.9);
4
- z-index: 100000;
5
- }
6
- .wrio-modal {
7
- padding: 0 !important;
8
- }
9
- .wrio-modal .swal2-close {
10
- color: rgba(0, 0, 0, 0.8);
11
- }
12
- .wrio-modal .swal2-modal {
13
- border-radius: 2px;
14
- }
15
- .wrio-modal .swal2-icon {
16
- margin-bottom: 25px;
17
- }
18
- .wrio-modal .swal2-title {
19
- margin: 0;
20
- padding: 28px 32px;
21
- font-size: 24px;
22
- text-align: left;
23
- color: #fff !important;
24
- background: #3e3e3e !important;
25
- }
26
- .wrio-modal .swal2-content {
27
- font-size: 14px;
28
- padding: 28px 32px;
29
- background: #efefef;
30
- }
31
- .wrio-modal .swal2-buttonswrapper {
32
- margin-top: 0;
33
- padding: 22px;
34
- background: #F4F7F9;
35
- }
36
- .wrio-modal .swal2-buttonswrapper a.button svg {
37
- margin-right: 12px;
38
- vertical-align: -2px;
39
- }
40
- .wrio-modal .swal2-buttonswrapper button.loading {
41
- border-radius: 100% !important;
42
- height: 40px !important;
43
- padding: 0 !important;
44
- box-shadow: none !important;
45
- }
46
- .wrio-modal .swal2-buttonswrapper button.swal2-styled {
47
- height: auto;
48
- padding: 12px 32px;
49
- margin: 10px;
50
- font-size: 14px;
51
- letter-spacing: 1px;
52
- text-transform: uppercase;
53
- border-radius: 3px;
54
- font-weight: bold;
55
- outline: none;
56
- }
57
- .wrio-modal .swal2-buttonswrapper button.swal2-styled.swal2-confirm {
58
- background-color: #fdd599 !important;
59
- text-shadow: none !important;
60
- box-shadow: 0 3px 0 #ceac7a !important;
61
- color: #a57b3c !important;
62
- }
63
- .wrio-modal .swal2-buttonswrapper button.swal2-styled.swal2-cancel {
64
- background-color: #d2d2d2 !important;
65
- color: #656464 !important;
66
- text-shadow: none !important;
67
- box-shadow: 0 3px 0 #a9a9a9;
68
- /*background-color: #c9deb2 !important;
69
- color: #606956 !important;
70
- text-shadow: none !important;
71
- box-shadow: 0 3px 0 #a7b994;*/
72
- }
73
- .wrio-modal .swal2-buttonswrapper button.swal2-styled:focus,
74
- .wrio-modal .swal2-buttonswrapper button.swal2-styled:hover {
75
- outline: none;
76
- text-shadow: none;
77
- color: #FFF;
78
- }
79
- .wrio-modal-warning {
80
- background: #FF5722 !important;
81
- }
82
- .wrio-modal-warning .swal2-title {
83
- text-align: center;
84
- color: #222 !important;
85
- background: #efefef !important;
86
- }
87
- .wrio-modal-warning .swal2-content {
88
- font-size: 16px;
89
- padding: 10px 20px 32px;
90
- background: #efefef;
91
- }
92
- .wrio-modal-warning .swal2-buttonswrapper {
93
- background: #efefef;
94
- }
95
- .wrio-modal-error {
96
- background: #dec2c0 !important;
97
- }
98
- .wrio-modal-error .swal2-title {
99
- text-align: center;
100
- color: #222 !important;
101
- background: #efefef !important;
102
- }
103
- .wrio-modal-error .swal2-content {
104
- font-size: 16px;
105
- padding: 10px 20px 32px;
106
- background: #efefef;
107
- }
108
- .wrio-modal-error .swal2-buttonswrapper {
109
- background: #efefef;
110
- }
111
- .wrio-modal-optimization-way {
112
- background: #1F2332 !important;
113
- }
114
- .wrio-modal-optimization-way .wrio-swal-subtitle {
115
- padding: 0 0 28px;
116
- margin-top: 0px;
117
- font-weight: 500;
118
- font-size: 18px;
119
- text-align: left;
120
- color: #8c8888;
121
- background: #efefef;
122
- }
123
- .wrio-modal-optimization-way .wrio-list-infos {
124
- margin: 0;
125
- padding: 0;
126
- }
127
- .wrio-modal-optimization-way .wrio-list-infos li {
128
- display: flex;
129
- align-items: center;
130
- padding: 5px 5px;
131
- text-align: left;
132
- font-size: 14px;
133
- line-height: 1.5;
134
- color: #8c8888;
135
- }
136
- .wrio-modal-optimization-way .wrio-list-infos li:first-child {
137
- padding-top: 5px;
138
- }
139
- .wrio-modal-optimization-way .wrio-list-infos li:last-child {
140
- padding-bottom: 5px;
141
- }
142
- .wrio-modal-optimization-way .wrio-list-infos li + li {
143
- border-top: 1px solid #E9EFF2;
144
- }
145
- .wrio-modal-optimization-way .wrio-list-infos a:before {
146
- content: '';
147
- display: block;
148
- }
149
- .wrio-modal-optimization-way .wrio-info-icon {
150
- flex-grow: 0;
151
- flex-basis: 50px;
152
- }
153
- .wrio-modal-optimization-way .wrio-info-icon + span {
154
- padding-left: 20px;
155
- }
1
+ /* Sub Layer */
2
+ body[class*="_rio"] .swal2-container.swal2-shown {
3
+ background: rgba(16, 17, 21, 0.9);
4
+ z-index: 100000;
5
+ }
6
+ .wrio-modal {
7
+ padding: 0 !important;
8
+ }
9
+ .wrio-modal .swal2-close {
10
+ color: rgba(0, 0, 0, 0.8);
11
+ }
12
+ .wrio-modal .swal2-modal {
13
+ border-radius: 2px;
14
+ }
15
+ .wrio-modal .swal2-icon {
16
+ margin-bottom: 25px;
17
+ }
18
+ .wrio-modal .swal2-title {
19
+ margin: 0;
20
+ padding: 28px 32px;
21
+ font-size: 24px;
22
+ text-align: left;
23
+ color: #fff !important;
24
+ background: #3e3e3e !important;
25
+ }
26
+ .wrio-modal .swal2-content {
27
+ font-size: 14px;
28
+ padding: 28px 32px;
29
+ background: #efefef;
30
+ }
31
+ .wrio-modal .swal2-buttonswrapper {
32
+ margin-top: 0;
33
+ padding: 22px;
34
+ background: #F4F7F9;
35
+ }
36
+ .wrio-modal .swal2-buttonswrapper a.button svg {
37
+ margin-right: 12px;
38
+ vertical-align: -2px;
39
+ }
40
+ .wrio-modal .swal2-buttonswrapper button.loading {
41
+ border-radius: 100% !important;
42
+ height: 40px !important;
43
+ padding: 0 !important;
44
+ box-shadow: none !important;
45
+ }
46
+ .wrio-modal .swal2-buttonswrapper button.swal2-styled {
47
+ height: auto;
48
+ padding: 12px 32px;
49
+ margin: 10px;
50
+ font-size: 14px;
51
+ letter-spacing: 1px;
52
+ text-transform: uppercase;
53
+ border-radius: 3px;
54
+ font-weight: bold;
55
+ outline: none;
56
+ }
57
+ .wrio-modal .swal2-buttonswrapper button.swal2-styled.swal2-confirm {
58
+ background-color: #fdd599 !important;
59
+ text-shadow: none !important;
60
+ box-shadow: 0 3px 0 #ceac7a !important;
61
+ color: #a57b3c !important;
62
+ }
63
+ .wrio-modal .swal2-buttonswrapper button.swal2-styled.swal2-cancel {
64
+ background-color: #d2d2d2 !important;
65
+ color: #656464 !important;
66
+ text-shadow: none !important;
67
+ box-shadow: 0 3px 0 #a9a9a9;
68
+ /*background-color: #c9deb2 !important;
69
+ color: #606956 !important;
70
+ text-shadow: none !important;
71
+ box-shadow: 0 3px 0 #a7b994;*/
72
+ }
73
+ .wrio-modal .swal2-buttonswrapper button.swal2-styled:focus,
74
+ .wrio-modal .swal2-buttonswrapper button.swal2-styled:hover {
75
+ outline: none;
76
+ text-shadow: none;
77
+ color: #FFF;
78
+ }
79
+ .wrio-modal-warning {
80
+ background: #FF5722 !important;
81
+ }
82
+ .wrio-modal-warning .swal2-title {
83
+ text-align: center;
84
+ color: #222 !important;
85
+ background: #efefef !important;
86
+ }
87
+ .wrio-modal-warning .swal2-content {
88
+ font-size: 16px;
89
+ padding: 10px 20px 32px;
90
+ background: #efefef;
91
+ }
92
+ .wrio-modal-warning .swal2-buttonswrapper {
93
+ background: #efefef;
94
+ }
95
+ .wrio-modal-error {
96
+ background: #dec2c0 !important;
97
+ }
98
+ .wrio-modal-error .swal2-title {
99
+ text-align: center;
100
+ color: #222 !important;
101
+ background: #efefef !important;
102
+ }
103
+ .wrio-modal-error .swal2-content {
104
+ font-size: 16px;
105
+ padding: 10px 20px 32px;
106
+ background: #efefef;
107
+ }
108
+ .wrio-modal-error .swal2-buttonswrapper {
109
+ background: #efefef;
110
+ }
111
+ .wrio-modal-optimization-way {
112
+ background: #1F2332 !important;
113
+ }
114
+ .wrio-modal-optimization-way .wrio-swal-subtitle {
115
+ padding: 0 0 28px;
116
+ margin-top: 0px;
117
+ font-weight: 500;
118
+ font-size: 18px;
119
+ text-align: left;
120
+ color: #8c8888;
121
+ background: #efefef;
122
+ }
123
+ .wrio-modal-optimization-way .wrio-list-infos {
124
+ margin: 0;
125
+ padding: 0;
126
+ }
127
+ .wrio-modal-optimization-way .wrio-list-infos li {
128
+ display: flex;
129
+ align-items: center;
130
+ padding: 5px 5px;
131
+ text-align: left;
132
+ font-size: 14px;
133
+ line-height: 1.5;
134
+ color: #8c8888;
135
+ }
136
+ .wrio-modal-optimization-way .wrio-list-infos li:first-child {
137
+ padding-top: 5px;
138
+ }
139
+ .wrio-modal-optimization-way .wrio-list-infos li:last-child {
140
+ padding-bottom: 5px;
141
+ }
142
+ .wrio-modal-optimization-way .wrio-list-infos li + li {
143
+ border-top: 1px solid #E9EFF2;
144
+ }
145
+ .wrio-modal-optimization-way .wrio-list-infos a:before {
146
+ content: '';
147
+ display: block;
148
+ }
149
+ .wrio-modal-optimization-way .wrio-info-icon {
150
+ flex-grow: 0;
151
+ flex-basis: 50px;
152
+ }
153
+ .wrio-modal-optimization-way .wrio-info-icon + span {
154
+ padding-left: 20px;
155
+ }
admin/assets/css/sweetalert-custom.less CHANGED
@@ -1,185 +1,185 @@
1
- /* Sub Layer */
2
- body[class*="_rio"] .swal2-container.swal2-shown {
3
- background: rgba(16, 17, 21, 0.9);
4
- z-index: 100000;
5
- }
6
-
7
- .wrio-modal {
8
- padding: 0 !important;
9
-
10
- .swal2-close {
11
- color: rgba(0, 0, 0, .8);
12
- }
13
-
14
- .swal2-modal {
15
- border-radius: 2px;
16
- }
17
-
18
- .swal2-icon {
19
- margin-bottom: 25px;
20
- }
21
-
22
- .swal2-title {
23
- margin: 0;
24
- padding: 28px 32px;
25
- font-size: 24px;
26
- text-align: left;
27
- color: #fff !important;
28
- background: #3e3e3e !important;
29
- }
30
-
31
- .swal2-content {
32
- font-size: 14px;
33
- padding: 28px 32px;
34
- background: #efefef;
35
- }
36
-
37
- .swal2-buttonswrapper {
38
- margin-top: 0;
39
- padding: 22px;
40
- background: #F4F7F9;
41
-
42
- a.button svg {
43
- margin-right: 12px;
44
- vertical-align: -2px;
45
- }
46
-
47
- button.loading {
48
- border-radius: 100% !important;
49
- height: 40px !important;
50
- padding: 0 !important;
51
- box-shadow: none !important;
52
- }
53
-
54
- button.swal2-styled {
55
- height: auto;
56
- padding: 12px 32px;
57
- margin: 10px;
58
- font-size: 14px;
59
- letter-spacing: 1px;
60
- text-transform: uppercase;
61
- border-radius: 3px;
62
- font-weight: bold;
63
- outline: none;
64
-
65
- &.swal2-confirm {
66
- background-color: #fdd599 !important;
67
- text-shadow: none !important;
68
- box-shadow: 0 3px 0 #ceac7a !important;
69
- color: #a57b3c !important;
70
- }
71
-
72
- &.swal2-cancel {
73
- background-color: #d2d2d2 !important;
74
- color: #656464 !important;
75
- text-shadow: none !important;
76
- box-shadow: 0 3px 0 #a9a9a9;
77
- /*background-color: #c9deb2 !important;
78
- color: #606956 !important;
79
- text-shadow: none !important;
80
- box-shadow: 0 3px 0 #a7b994;*/
81
- }
82
-
83
- &:focus, &:hover {
84
- outline: none;
85
- text-shadow: none;
86
- color: #FFF;
87
- }
88
- }
89
- }
90
- }
91
-
92
- .wrio-modal-warning {
93
- background: #FF5722 !important;
94
-
95
- .swal2-title {
96
- text-align: center;
97
- color: #222 !important;
98
- background: #efefef !important;
99
- }
100
-
101
- .swal2-content {
102
- font-size: 16px;
103
- padding: 10px 20px 32px;
104
- background: #efefef;
105
- }
106
-
107
- .swal2-buttonswrapper {
108
- background: #efefef;
109
- }
110
- }
111
-
112
- .wrio-modal-error {
113
- background: #dec2c0 !important;
114
-
115
- .swal2-title {
116
- text-align: center;
117
- color: #222 !important;
118
- background: #efefef !important;
119
- }
120
-
121
- .swal2-content {
122
- font-size: 16px;
123
- padding: 10px 20px 32px;
124
- background: #efefef;
125
- }
126
-
127
- .swal2-buttonswrapper {
128
- background: #efefef;
129
- }
130
- }
131
-
132
- .wrio-modal-optimization-way {
133
- background: #1F2332 !important;
134
-
135
- .wrio-swal-subtitle {
136
- padding: 0 0 28px;
137
- margin-top: 0px;
138
- font-weight: 500;
139
- font-size: 18px;
140
- text-align: left;
141
- color: #8c8888;
142
- background: #efefef;
143
- }
144
-
145
- .wrio-list-infos {
146
- margin: 0;
147
- padding: 0;
148
-
149
- li {
150
- display: flex;
151
- align-items: center;
152
- padding: 15px 5px;
153
- text-align: left;
154
- font-size: 14px;
155
- line-height: 1.5;
156
- color: #8c8888;
157
- }
158
-
159
- li:first-child {
160
- padding-top: 5px;
161
- }
162
-
163
- li:last-child {
164
- padding-bottom: 5px;
165
- }
166
-
167
- li + li {
168
- border-top: 1px solid #E9EFF2;
169
- }
170
-
171
- a:before {
172
- content: '';
173
- display: block;
174
- }
175
- }
176
-
177
- .wrio-info-icon {
178
- flex-grow: 0;
179
- flex-basis: 50px;
180
- }
181
-
182
- .wrio-info-icon + span {
183
- padding-left: 20px;
184
- }
185
- }
1
+ /* Sub Layer */
2
+ body[class*="_rio"] .swal2-container.swal2-shown {
3
+ background: rgba(16, 17, 21, 0.9);
4
+ z-index: 100000;
5
+ }
6
+
7
+ .wrio-modal {
8
+ padding: 0 !important;
9
+
10
+ .swal2-close {
11
+ color: rgba(0, 0, 0, .8);
12
+ }
13
+
14
+ .swal2-modal {
15
+ border-radius: 2px;
16
+ }
17
+
18
+ .swal2-icon {
19
+ margin-bottom: 25px;
20
+ }
21
+
22
+ .swal2-title {
23
+ margin: 0;
24
+ padding: 28px 32px;
25
+ font-size: 24px;
26
+ text-align: left;
27
+ color: #fff !important;
28
+ background: #3e3e3e !important;
29
+ }
30
+
31
+ .swal2-content {
32
+ font-size: 14px;
33
+ padding: 28px 32px;
34
+ background: #efefef;
35
+ }
36
+
37
+ .swal2-buttonswrapper {
38
+ margin-top: 0;
39
+ padding: 22px;
40
+ background: #F4F7F9;
41
+
42
+ a.button svg {
43
+ margin-right: 12px;
44
+ vertical-align: -2px;
45
+ }
46
+
47
+ button.loading {
48
+ border-radius: 100% !important;
49
+ height: 40px !important;
50
+ padding: 0 !important;
51
+ box-shadow: none !important;
52
+ }
53
+
54
+ button.swal2-styled {
55
+ height: auto;
56
+ padding: 12px 32px;
57
+ margin: 10px;
58
+ font-size: 14px;
59
+ letter-spacing: 1px;
60
+ text-transform: uppercase;
61
+ border-radius: 3px;
62
+ font-weight: bold;
63
+ outline: none;
64
+
65
+ &.swal2-confirm {
66
+ background-color: #fdd599 !important;
67
+ text-shadow: none !important;
68
+ box-shadow: 0 3px 0 #ceac7a !important;
69
+ color: #a57b3c !important;
70
+ }
71
+
72
+ &.swal2-cancel {
73
+ background-color: #d2d2d2 !important;
74
+ color: #656464 !important;
75
+ text-shadow: none !important;
76
+ box-shadow: 0 3px 0 #a9a9a9;
77
+ /*background-color: #c9deb2 !important;
78
+ color: #606956 !important;
79
+ text-shadow: none !important;
80
+ box-shadow: 0 3px 0 #a7b994;*/
81
+ }
82
+
83
+ &:focus, &:hover {
84
+ outline: none;
85
+ text-shadow: none;
86
+ color: #FFF;
87
+ }
88
+ }
89
+ }
90
+ }
91
+
92
+ .wrio-modal-warning {
93
+ background: #FF5722 !important;
94
+
95
+ .swal2-title {
96
+ text-align: center;
97
+ color: #222 !important;
98
+ background: #efefef !important;
99
+ }
100
+
101
+ .swal2-content {
102
+ font-size: 16px;
103
+ padding: 10px 20px 32px;
104
+ background: #efefef;
105
+ }
106
+
107
+ .swal2-buttonswrapper {
108
+ background: #efefef;
109
+ }
110
+ }
111
+
112
+ .wrio-modal-error {
113
+ background: #dec2c0 !important;
114
+
115
+ .swal2-title {
116
+ text-align: center;
117
+ color: #222 !important;
118
+ background: #efefef !important;
119
+ }
120
+
121
+ .swal2-content {
122
+ font-size: 16px;
123
+ padding: 10px 20px 32px;
124
+ background: #efefef;
125
+ }
126
+
127
+ .swal2-buttonswrapper {
128
+ background: #efefef;
129
+ }
130
+ }
131
+
132
+ .wrio-modal-optimization-way {
133
+ background: #1F2332 !important;
134
+
135
+ .wrio-swal-subtitle {
136
+ padding: 0 0 28px;
137
+ margin-top: 0px;
138
+ font-weight: 500;
139
+ font-size: 18px;
140
+ text-align: left;
141
+ color: #8c8888;
142
+ background: #efefef;
143
+ }
144
+
145
+ .wrio-list-infos {
146
+ margin: 0;
147
+ padding: 0;
148
+
149
+ li {
150
+ display: flex;
151
+ align-items: center;
152
+ padding: 15px 5px;
153
+ text-align: left;
154
+ font-size: 14px;
155
+ line-height: 1.5;
156
+ color: #8c8888;
157
+ }
158
+
159
+ li:first-child {
160
+ padding-top: 5px;
161
+ }
162
+
163
+ li:last-child {
164
+ padding-bottom: 5px;
165
+ }
166
+
167
+ li + li {
168
+ border-top: 1px solid #E9EFF2;
169
+ }
170
+
171
+ a:before {
172
+ content: '';
173
+ display: block;
174
+ }
175
+ }
176
+
177
+ .wrio-info-icon {
178
+ flex-grow: 0;
179
+ flex-basis: 50px;
180
+ }
181
+
182
+ .wrio-info-icon + span {
183
+ padding-left: 20px;
184
+ }
185
+ }
admin/assets/css/sweetalert2.css CHANGED
@@ -1,716 +1,716 @@
1
- body.swal2-shown {
2
- overflow-y: hidden; }
3
-
4
- body.swal2-iosfix {
5
- position: fixed;
6
- left: 0;
7
- right: 0; }
8
-
9
- .swal2-container {
10
- display: -webkit-box;
11
- display: -ms-flexbox;
12
- display: flex;
13
- -webkit-box-align: center;
14
- -ms-flex-align: center;
15
- align-items: center;
16
- position: fixed;
17
- top: 0;
18
- left: 0;
19
- bottom: 0;
20
- right: 0;
21
- padding: 10px;
22
- background-color: transparent;
23
- z-index: 1060; }
24
- .swal2-container.swal2-fade {
25
- -webkit-transition: background-color .1s;
26
- transition: background-color .1s; }
27
- .swal2-container.swal2-shown {
28
- background-color: rgba(0, 0, 0, 0.4); }
29
-
30
- .swal2-modal {
31
- background-color: #fff;
32
- font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
33
- border-radius: 5px;
34
- -webkit-box-sizing: border-box;
35
- box-sizing: border-box;
36
- text-align: center;
37
- margin: auto;
38
- overflow-x: hidden;
39
- overflow-y: auto;
40
- display: none;
41
- position: relative;
42
- max-width: 100%; }
43
- .swal2-modal:focus {
44
- outline: none; }
45
- .swal2-modal.swal2-loading {
46
- overflow-y: hidden; }
47
- .swal2-modal .swal2-title {
48
- color: #595959;
49
- font-size: 30px;
50
- text-align: center;
51
- font-weight: 600;
52
- text-transform: none;
53
- position: relative;
54
- margin: 0 0 .4em;
55
- padding: 0;
56
- display: block;
57
- word-wrap: break-word; }
58
- .swal2-modal .swal2-buttonswrapper {
59
- margin-top: 15px; }
60
- .swal2-modal .swal2-buttonswrapper:not(.swal2-loading) .swal2-styled[disabled] {
61
- opacity: .4;
62
- cursor: no-drop; }
63
- .swal2-modal .swal2-buttonswrapper.swal2-loading .swal2-styled.swal2-confirm {
64
- -webkit-box-sizing: border-box;
65
- box-sizing: border-box;
66
- border: 4px solid transparent;
67
- border-color: transparent;
68
- width: 40px;
69
- height: 40px;
70
- padding: 0;
71
- margin: 7.5px;
72
- vertical-align: top;
73
- background-color: transparent !important;
74
- color: transparent;
75
- cursor: default;
76
- border-radius: 100%;
77
- -webkit-animation: rotate-loading 1.5s linear 0s infinite normal;
78
- animation: rotate-loading 1.5s linear 0s infinite normal;
79
- -webkit-user-select: none;
80
- -moz-user-select: none;
81
- -ms-user-select: none;
82
- user-select: none; }
83
- .swal2-modal .swal2-buttonswrapper.swal2-loading .swal2-styled.swal2-cancel {
84
- margin-left: 30px;
85
- margin-right: 30px; }
86
- .swal2-modal .swal2-buttonswrapper.swal2-loading :not(.swal2-styled).swal2-confirm::after {
87
- display: inline-block;
88
- content: '';
89
- margin-left: 5px 0 15px;
90
- vertical-align: -1px;
91
- height: 15px;
92
- width: 15px;
93
- border: 3px solid #999999;
94
- -webkit-box-shadow: 1px 1px 1px #fff;
95
- box-shadow: 1px 1px 1px #fff;
96
- border-right-color: transparent;
97
- border-radius: 50%;
98
- -webkit-animation: rotate-loading 1.5s linear 0s infinite normal;
99
- animation: rotate-loading 1.5s linear 0s infinite normal; }
100
- .swal2-modal .swal2-styled {
101
- border: 0;
102
- border-radius: 3px;
103
- -webkit-box-shadow: none;
104
- box-shadow: none;
105
- color: #fff;
106
- cursor: pointer;
107
- font-size: 17px;
108
- font-weight: 500;
109
- margin: 15px 5px 0;
110
- padding: 10px 32px; }
111
- .swal2-modal .swal2-image {
112
- margin: 20px auto;
113
- max-width: 100%; }
114
- .swal2-modal .swal2-close {
115
- background: transparent;
116
- border: 0;
117
- margin: 0;
118
- padding: 0;
119
- width: 38px;
120
- height: 40px;
121
- font-size: 36px;
122
- line-height: 40px;
123
- font-family: serif;
124
- position: absolute;
125
- top: 5px;
126
- right: 8px;
127
- cursor: pointer;
128
- color: #cccccc;
129
- -webkit-transition: color .1s ease;
130
- transition: color .1s ease; }
131
- .swal2-modal .swal2-close:hover {
132
- color: #d55; }
133
- .swal2-modal > .swal2-input,
134
- .swal2-modal > .swal2-file,
135
- .swal2-modal > .swal2-textarea,
136
- .swal2-modal > .swal2-select,
137
- .swal2-modal > .swal2-radio,
138
- .swal2-modal > .swal2-checkbox {
139
- display: none; }
140
- .swal2-modal .swal2-content {
141
- font-size: 18px;
142
- text-align: center;
143
- font-weight: 300;
144
- position: relative;
145
- float: none;
146
- margin: 0;
147
- padding: 0;
148
- line-height: normal;
149
- color: #545454;
150
- word-wrap: break-word; }
151
- .swal2-modal .swal2-input,
152
- .swal2-modal .swal2-file,
153
- .swal2-modal .swal2-textarea,
154
- .swal2-modal .swal2-select,
155
- .swal2-modal .swal2-radio,
156
- .swal2-modal .swal2-checkbox {
157
- margin: 20px auto; }
158
- .swal2-modal .swal2-input,
159
- .swal2-modal .swal2-file,
160
- .swal2-modal .swal2-textarea {
161
- width: 100%;
162
- -webkit-box-sizing: border-box;
163
- box-sizing: border-box;
164
- font-size: 18px;
165
- border-radius: 3px;
166
- border: 1px solid #d9d9d9;
167
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06);
168
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06);
169
- -webkit-transition: border-color box-shadow .3s;
170
- transition: border-color box-shadow .3s; }
171
- .swal2-modal .swal2-input.swal2-inputerror,
172
- .swal2-modal .swal2-file.swal2-inputerror,
173
- .swal2-modal .swal2-textarea.swal2-inputerror {
174
- border-color: #f27474 !important;
175
- -webkit-box-shadow: 0 0 2px #f27474 !important;
176
- box-shadow: 0 0 2px #f27474 !important; }
177
- .swal2-modal .swal2-input:focus,
178
- .swal2-modal .swal2-file:focus,
179
- .swal2-modal .swal2-textarea:focus {
180
- outline: none;
181
- border: 1px solid #b4dbed;
182
- -webkit-box-shadow: 0 0 3px #c4e6f5;
183
- box-shadow: 0 0 3px #c4e6f5; }
184
- .swal2-modal .swal2-input:focus::-webkit-input-placeholder,
185
- .swal2-modal .swal2-file:focus::-webkit-input-placeholder,
186
- .swal2-modal .swal2-textarea:focus::-webkit-input-placeholder {
187
- -webkit-transition: opacity .3s .03s ease;
188
- transition: opacity .3s .03s ease;
189
- opacity: .8; }
190
- .swal2-modal .swal2-input:focus:-ms-input-placeholder,
191
- .swal2-modal .swal2-file:focus:-ms-input-placeholder,
192
- .swal2-modal .swal2-textarea:focus:-ms-input-placeholder {
193
- -webkit-transition: opacity .3s .03s ease;
194
- transition: opacity .3s .03s ease;
195
- opacity: .8; }
196
- .swal2-modal .swal2-input:focus::placeholder,
197
- .swal2-modal .swal2-file:focus::placeholder,
198
- .swal2-modal .swal2-textarea:focus::placeholder {
199
- -webkit-transition: opacity .3s .03s ease;
200
- transition: opacity .3s .03s ease;
201
- opacity: .8; }
202
- .swal2-modal .swal2-input::-webkit-input-placeholder,
203
- .swal2-modal .swal2-file::-webkit-input-placeholder,
204
- .swal2-modal .swal2-textarea::-webkit-input-placeholder {
205
- color: #e6e6e6; }
206
- .swal2-modal .swal2-input:-ms-input-placeholder,
207
- .swal2-modal .swal2-file:-ms-input-placeholder,
208
- .swal2-modal .swal2-textarea:-ms-input-placeholder {
209
- color: #e6e6e6; }
210
- .swal2-modal .swal2-input::placeholder,
211
- .swal2-modal .swal2-file::placeholder,
212
- .swal2-modal .swal2-textarea::placeholder {
213
- color: #e6e6e6; }
214
- .swal2-modal .swal2-range input {
215
- float: left;
216
- width: 80%; }
217
- .swal2-modal .swal2-range output {
218
- float: right;
219
- width: 20%;
220
- font-size: 20px;
221
- font-weight: 600;
222
- text-align: center; }
223
- .swal2-modal .swal2-range input,
224
- .swal2-modal .swal2-range output {
225
- height: 43px;
226
- line-height: 43px;
227
- vertical-align: middle;
228
- margin: 20px auto;
229
- padding: 0; }
230
- .swal2-modal .swal2-input {
231
- height: 43px;
232
- padding: 0 12px; }
233
- .swal2-modal .swal2-input[type='number'] {
234
- max-width: 150px; }
235
- .swal2-modal .swal2-file {
236
- font-size: 20px; }
237
- .swal2-modal .swal2-textarea {
238
- height: 108px;
239
- padding: 12px; }
240
- .swal2-modal .swal2-select {
241
- color: #545454;
242
- font-size: inherit;
243
- padding: 5px 10px;
244
- min-width: 40%;
245
- max-width: 100%; }
246
- .swal2-modal .swal2-radio {
247
- border: 0; }
248
- .swal2-modal .swal2-radio label:not(:first-child) {
249
- margin-left: 20px; }
250
- .swal2-modal .swal2-radio input,
251
- .swal2-modal .swal2-radio span {
252
- vertical-align: middle; }
253
- .swal2-modal .swal2-radio input {
254
- margin: 0 3px 0 0; }
255
- .swal2-modal .swal2-checkbox {
256
- color: #545454; }
257
- .swal2-modal .swal2-checkbox input,
258
- .swal2-modal .swal2-checkbox span {
259
- vertical-align: middle; }
260
- .swal2-modal .swal2-validationerror {
261
- background-color: #f0f0f0;
262
- margin: 0 -20px;
263
- overflow: hidden;
264
- padding: 10px;
265
- color: gray;
266
- font-size: 16px;
267
- font-weight: 300;
268
- display: none; }
269
- .swal2-modal .swal2-validationerror::before {
270
- content: '!';
271
- display: inline-block;
272
- width: 24px;
273
- height: 24px;
274
- border-radius: 50%;
275
- background-color: #ea7d7d;
276
- color: #fff;
277
- line-height: 24px;
278
- text-align: center;
279
- margin-right: 10px; }
280
-
281
- @supports (-ms-accelerator: true) {
282
- .swal2-range input {
283
- width: 100% !important; }
284
- .swal2-range output {
285
- display: none; } }
286
-
287
- @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
288
- .swal2-range input {
289
- width: 100% !important; }
290
- .swal2-range output {
291
- display: none; } }
292
-
293
- .swal2-icon {
294
- width: 80px;
295
- height: 80px;
296
- border: 4px solid transparent;
297
- border-radius: 50%;
298
- margin: 20px auto 30px;
299
- padding: 0;
300
- position: relative;
301
- -webkit-box-sizing: content-box;
302
- box-sizing: content-box;
303
- cursor: default;
304
- -webkit-user-select: none;
305
- -moz-user-select: none;
306
- -ms-user-select: none;
307
- user-select: none; }
308
- .swal2-icon.swal2-error {
309
- border-color: #f27474; }
310
- .swal2-icon.swal2-error .swal2-x-mark {
311
- position: relative;
312
- display: block; }
313
- .swal2-icon.swal2-error [class^='swal2-x-mark-line'] {
314
- position: absolute;
315
- height: 5px;
316
- width: 47px;
317
- background-color: #f27474;
318
- display: block;
319
- top: 37px;
320
- border-radius: 2px; }
321
- .swal2-icon.swal2-error [class^='swal2-x-mark-line'][class$='left'] {
322
- -webkit-transform: rotate(45deg);
323
- transform: rotate(45deg);
324
- left: 17px; }
325
- .swal2-icon.swal2-error [class^='swal2-x-mark-line'][class$='right'] {
326
- -webkit-transform: rotate(-45deg);
327
- transform: rotate(-45deg);
328
- right: 16px; }
329
- .swal2-icon.swal2-warning {
330
- font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
331
- color: #f8bb86;
332
- border-color: #facea8;
333
- font-size: 60px;
334
- line-height: 80px;
335
- text-align: center; }
336
- .swal2-icon.swal2-info {
337
- font-family: 'Open Sans', sans-serif;
338
- color: #3fc3ee;
339
- border-color: #9de0f6;
340
- font-size: 60px;
341
- line-height: 80px;
342
- text-align: center; }
343
- .swal2-icon.swal2-question {
344
- font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
345
- color: #87adbd;
346
- border-color: #c9dae1;
347
- font-size: 60px;
348
- line-height: 80px;
349
- text-align: center; }
350
- .swal2-icon.swal2-success {
351
- border-color: #a5dc86; }
352
- .swal2-icon.swal2-success [class^='swal2-success-circular-line'] {
353
- border-radius: 50%;
354
- position: absolute;
355
- width: 60px;
356
- height: 120px;
357
- -webkit-transform: rotate(45deg);
358
- transform: rotate(45deg); }
359
- .swal2-icon.swal2-success [class^='swal2-success-circular-line'][class$='left'] {
360
- border-radius: 120px 0 0 120px;
361
- top: -7px;
362
- left: -33px;
363
- -webkit-transform: rotate(-45deg);
364
- transform: rotate(-45deg);
365
- -webkit-transform-origin: 60px 60px;
366
- transform-origin: 60px 60px; }
367
- .swal2-icon.swal2-success [class^='swal2-success-circular-line'][class$='right'] {
368
- border-radius: 0 120px 120px 0;
369
- top: -11px;
370
- left: 30px;
371
- -webkit-transform: rotate(-45deg);
372
- transform: rotate(-45deg);
373
- -webkit-transform-origin: 0 60px;
374
- transform-origin: 0 60px; }
375
- .swal2-icon.swal2-success .swal2-success-ring {
376
- width: 80px;
377
- height: 80px;
378
- border: 4px solid rgba(165, 220, 134, 0.2);
379
- border-radius: 50%;
380
- -webkit-box-sizing: content-box;
381
- box-sizing: content-box;
382
- position: absolute;
383
- left: -4px;
384
- top: -4px;
385
- z-index: 2; }
386
- .swal2-icon.swal2-success .swal2-success-fix {
387
- width: 7px;
388
- height: 90px;
389
- position: absolute;
390
- left: 28px;
391
- top: 8px;
392
- z-index: 1;
393
- -webkit-transform: rotate(-45deg);
394
- transform: rotate(-45deg); }
395
- .swal2-icon.swal2-success [class^='swal2-success-line'] {
396
- height: 5px;
397
- background-color: #a5dc86;
398
- display: block;
399
- border-radius: 2px;
400
- position: absolute;
401
- z-index: 2; }
402
- .swal2-icon.swal2-success [class^='swal2-success-line'][class$='tip'] {
403
- width: 25px;
404
- left: 14px;
405
- top: 46px;
406
- -webkit-transform: rotate(45deg);
407
- transform: rotate(45deg); }
408
- .swal2-icon.swal2-success [class^='swal2-success-line'][class$='long'] {
409
- width: 47px;
410
- right: 8px;
411
- top: 38px;
412
- -webkit-transform: rotate(-45deg);
413
- transform: rotate(-45deg); }
414
-
415
- .swal2-progresssteps {
416
- font-weight: 600;
417
- margin: 0 0 20px;
418
- padding: 0; }
419
- .swal2-progresssteps li {
420
- display: inline-block;
421
- position: relative; }
422
- .swal2-progresssteps .swal2-progresscircle {
423
- background: #3085d6;
424
- border-radius: 2em;
425
- color: #fff;
426
- height: 2em;
427
- line-height: 2em;
428
- text-align: center;
429
- width: 2em;
430
- z-index: 20; }
431
- .swal2-progresssteps .swal2-progresscircle:first-child {
432
- margin-left: 0; }
433
- .swal2-progresssteps .swal2-progresscircle:last-child {
434
- margin-right: 0; }
435
- .swal2-progresssteps .swal2-progresscircle.swal2-activeprogressstep {
436
- background: #3085d6; }
437
- .swal2-progresssteps .swal2-progresscircle.swal2-activeprogressstep ~ .swal2-progresscircle {
438
- background: #add8e6; }
439
- .swal2-progresssteps .swal2-progresscircle.swal2-activeprogressstep ~ .swal2-progressline {
440
- background: #add8e6; }
441
- .swal2-progresssteps .swal2-progressline {
442
- background: #3085d6;
443
- height: .4em;
444
- margin: 0 -1px;
445
- z-index: 10; }
446
-
447
- [class^='swal2'] {
448
- -webkit-tap-highlight-color: transparent; }
449
-
450
- @-webkit-keyframes showSweetAlert {
451
- 0% {
452
- -webkit-transform: scale(0.7);
453
- transform: scale(0.7); }
454
- 45% {
455
- -webkit-transform: scale(1.05);
456
- transform: scale(1.05); }
457
- 80% {
458
- -webkit-transform: scale(0.95);
459
- transform: scale(0.95); }
460
- 100% {
461
- -webkit-transform: scale(1);
462
- transform: scale(1); } }
463
-
464
- @keyframes showSweetAlert {
465
- 0% {
466
- -webkit-transform: scale(0.7);
467
- transform: scale(0.7); }
468
- 45% {
469
- -webkit-transform: scale(1.05);
470
- transform: scale(1.05); }
471
- 80% {
472
- -webkit-transform: scale(0.95);
473
- transform: scale(0.95); }
474
- 100% {
475
- -webkit-transform: scale(1);
476
- transform: scale(1); } }
477
-
478
- @-webkit-keyframes hideSweetAlert {
479
- 0% {
480
- -webkit-transform: scale(1);
481
- transform: scale(1);
482
- opacity: 1; }
483
- 100% {
484
- -webkit-transform: scale(0.5);
485
- transform: scale(0.5);
486
- opacity: 0; } }
487
-
488
- @keyframes hideSweetAlert {
489
- 0% {
490
- -webkit-transform: scale(1);
491
- transform: scale(1);
492
- opacity: 1; }
493
- 100% {
494
- -webkit-transform: scale(0.5);
495
- transform: scale(0.5);
496
- opacity: 0; } }
497
-
498
- .swal2-show {
499
- -webkit-animation: showSweetAlert 0.3s;
500
- animation: showSweetAlert 0.3s; }
501
- .swal2-show.swal2-noanimation {
502
- -webkit-animation: none;
503
- animation: none; }
504
-
505
- .swal2-hide {
506
- -webkit-animation: hideSweetAlert 0.15s forwards;
507
- animation: hideSweetAlert 0.15s forwards; }
508
- .swal2-hide.swal2-noanimation {
509
- -webkit-animation: none;
510
- animation: none; }
511
-
512
- @-webkit-keyframes animate-success-tip {
513
- 0% {
514
- width: 0;
515
- left: 1px;
516
- top: 19px; }
517
- 54% {
518
- width: 0;
519
- left: 1px;
520
- top: 19px; }
521
- 70% {
522
- width: 50px;
523
- left: -8px;
524
- top: 37px; }
525
- 84% {
526
- width: 17px;
527
- left: 21px;
528
- top: 48px; }
529
- 100% {
530
- width: 25px;
531
- left: 14px;
532
- top: 45px; } }
533
-
534
- @keyframes animate-success-tip {
535
- 0% {
536
- width: 0;
537
- left: 1px;
538
- top: 19px; }
539
- 54% {
540
- width: 0;
541
- left: 1px;
542
- top: 19px; }
543
- 70% {
544
- width: 50px;
545
- left: -8px;
546
- top: 37px; }
547
- 84% {
548
- width: 17px;
549
- left: 21px;
550
- top: 48px; }
551
- 100% {
552
- width: 25px;
553
- left: 14px;
554
- top: 45px; } }
555
-
556
- @-webkit-keyframes animate-success-long {
557
- 0% {
558
- width: 0;
559
- right: 46px;
560
- top: 54px; }
561
- 65% {
562
- width: 0;
563
- right: 46px;
564
- top: 54px; }
565
- 84% {
566
- width: 55px;
567
- right: 0;
568
- top: 35px; }
569
- 100% {
570
- width: 47px;
571
- right: 8px;
572
- top: 38px; } }
573
-
574
- @keyframes animate-success-long {
575
- 0% {
576
- width: 0;
577
- right: 46px;
578
- top: 54px; }
579
- 65% {
580
- width: 0;
581
- right: 46px;
582
- top: 54px; }
583
- 84% {
584
- width: 55px;
585
- right: 0;
586
- top: 35px; }
587
- 100% {
588
- width: 47px;
589
- right: 8px;
590
- top: 38px; } }
591
-
592
- @-webkit-keyframes rotatePlaceholder {
593
- 0% {
594
- -webkit-transform: rotate(-45deg);
595
- transform: rotate(-45deg); }
596
- 5% {
597
- -webkit-transform: rotate(-45deg);
598
- transform: rotate(-45deg); }
599
- 12% {
600
- -webkit-transform: rotate(-405deg);
601
- transform: rotate(-405deg); }
602
- 100% {
603
- -webkit-transform: rotate(-405deg);
604
- transform: rotate(-405deg); } }
605
-
606
- @keyframes rotatePlaceholder {
607
- 0% {
608
- -webkit-transform: rotate(-45deg);
609
- transform: rotate(-45deg); }
610
- 5% {
611
- -webkit-transform: rotate(-45deg);
612
- transform: rotate(-45deg); }
613
- 12% {
614
- -webkit-transform: rotate(-405deg);
615
- transform: rotate(-405deg); }
616
- 100% {
617
- -webkit-transform: rotate(-405deg);
618
- transform: rotate(-405deg); } }
619
-
620
- .swal2-animate-success-line-tip {
621
- -webkit-animation: animate-success-tip 0.75s;
622
- animation: animate-success-tip 0.75s; }
623
-
624
- .swal2-animate-success-line-long {
625
- -webkit-animation: animate-success-long 0.75s;
626
- animation: animate-success-long 0.75s; }
627
-
628
- .swal2-success.swal2-animate-success-icon .swal2-success-circular-line-right {
629
- -webkit-animation: rotatePlaceholder 4.25s ease-in;
630
- animation: rotatePlaceholder 4.25s ease-in; }
631
-
632
- @-webkit-keyframes animate-error-icon {
633
- 0% {
634
- -webkit-transform: rotateX(100deg);
635
- transform: rotateX(100deg);
636
- opacity: 0; }
637
- 100% {
638
- -webkit-transform: rotateX(0deg);
639
- transform: rotateX(0deg);
640
- opacity: 1; } }
641
-
642
- @keyframes animate-error-icon {
643
- 0% {
644
- -webkit-transform: rotateX(100deg);
645
- transform: rotateX(100deg);
646
- opacity: 0; }
647
- 100% {
648
- -webkit-transform: rotateX(0deg);
649
- transform: rotateX(0deg);
650
- opacity: 1; } }
651
-
652
- .swal2-animate-error-icon {
653
- -webkit-animation: animate-error-icon 0.5s;
654
- animation: animate-error-icon 0.5s; }
655
-
656
- @-webkit-keyframes animate-x-mark {
657
- 0% {
658
- -webkit-transform: scale(0.4);
659
- transform: scale(0.4);
660
- margin-top: 26px;
661
- opacity: 0; }
662
- 50% {
663
- -webkit-transform: scale(0.4);
664
- transform: scale(0.4);
665
- margin-top: 26px;
666
- opacity: 0; }
667
- 80% {
668
- -webkit-transform: scale(1.15);
669
- transform: scale(1.15);
670
- margin-top: -6px; }
671
- 100% {
672
- -webkit-transform: scale(1);
673
- transform: scale(1);
674
- margin-top: 0;
675
- opacity: 1; } }
676
-
677
- @keyframes animate-x-mark {
678
- 0% {
679
- -webkit-transform: scale(0.4);
680
- transform: scale(0.4);
681
- margin-top: 26px;
682
- opacity: 0; }
683
- 50% {
684
- -webkit-transform: scale(0.4);
685
- transform: scale(0.4);
686
- margin-top: 26px;
687
- opacity: 0; }
688
- 80% {
689
- -webkit-transform: scale(1.15);
690
- transform: scale(1.15);
691
- margin-top: -6px; }
692
- 100% {
693
- -webkit-transform: scale(1);
694
- transform: scale(1);
695
- margin-top: 0;
696
- opacity: 1; } }
697
-
698
- .swal2-animate-x-mark {
699
- -webkit-animation: animate-x-mark 0.5s;
700
- animation: animate-x-mark 0.5s; }
701
-
702
- @-webkit-keyframes rotate-loading {
703
- 0% {
704
- -webkit-transform: rotate(0deg);
705
- transform: rotate(0deg); }
706
- 100% {
707
- -webkit-transform: rotate(360deg);
708
- transform: rotate(360deg); } }
709
-
710
- @keyframes rotate-loading {
711
- 0% {
712
- -webkit-transform: rotate(0deg);
713
- transform: rotate(0deg); }
714
- 100% {
715
- -webkit-transform: rotate(360deg);
716
- transform: rotate(360deg); } }
1
+ body.swal2-shown {
2
+ overflow-y: hidden; }
3
+
4
+ body.swal2-iosfix {
5
+ position: fixed;
6
+ left: 0;
7
+ right: 0; }
8
+
9
+ .swal2-container {
10
+ display: -webkit-box;
11
+ display: -ms-flexbox;
12
+ display: flex;
13
+ -webkit-box-align: center;
14
+ -ms-flex-align: center;
15
+ align-items: center;
16
+ position: fixed;
17
+ top: 0;
18
+ left: 0;
19
+ bottom: 0;
20
+ right: 0;
21
+ padding: 10px;
22
+ background-color: transparent;
23
+ z-index: 1060; }
24
+ .swal2-container.swal2-fade {
25
+ -webkit-transition: background-color .1s;
26
+ transition: background-color .1s; }
27
+ .swal2-container.swal2-shown {
28
+ background-color: rgba(0, 0, 0, 0.4); }
29
+
30
+ .swal2-modal {
31
+ background-color: #fff;
32
+ font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
33
+ border-radius: 5px;
34
+ -webkit-box-sizing: border-box;
35
+ box-sizing: border-box;
36
+ text-align: center;
37
+ margin: auto;
38
+ overflow-x: hidden;
39
+ overflow-y: auto;
40
+ display: none;
41
+ position: relative;
42
+ max-width: 100%; }
43
+ .swal2-modal:focus {
44
+ outline: none; }
45
+ .swal2-modal.swal2-loading {
46
+ overflow-y: hidden; }
47
+ .swal2-modal .swal2-title {
48
+ color: #595959;
49
+ font-size: 30px;
50
+ text-align: center;
51
+ font-weight: 600;
52
+ text-transform: none;
53
+ position: relative;
54
+ margin: 0 0 .4em;
55
+ padding: 0;
56
+ display: block;
57
+ word-wrap: break-word; }
58
+ .swal2-modal .swal2-buttonswrapper {
59
+ margin-top: 15px; }
60
+ .swal2-modal .swal2-buttonswrapper:not(.swal2-loading) .swal2-styled[disabled] {
61
+ opacity: .4;
62
+ cursor: no-drop; }
63
+ .swal2-modal .swal2-buttonswrapper.swal2-loading .swal2-styled.swal2-confirm {
64
+ -webkit-box-sizing: border-box;
65
+ box-sizing: border-box;
66
+ border: 4px solid transparent;
67
+ border-color: transparent;
68
+ width: 40px;
69
+ height: 40px;
70
+ padding: 0;
71
+ margin: 7.5px;
72
+ vertical-align: top;
73
+ background-color: transparent !important;
74
+ color: transparent;
75
+ cursor: default;
76
+ border-radius: 100%;
77
+ -webkit-animation: rotate-loading 1.5s linear 0s infinite normal;
78
+ animation: rotate-loading 1.5s linear 0s infinite normal;
79
+ -webkit-user-select: none;
80
+ -moz-user-select: none;
81
+ -ms-user-select: none;
82
+ user-select: none; }
83
+ .swal2-modal .swal2-buttonswrapper.swal2-loading .swal2-styled.swal2-cancel {
84
+ margin-left: 30px;
85
+ margin-right: 30px; }
86
+ .swal2-modal .swal2-buttonswrapper.swal2-loading :not(.swal2-styled).swal2-confirm::after {
87
+ display: inline-block;
88
+ content: '';
89
+ margin-left: 5px 0 15px;
90
+ vertical-align: -1px;
91
+ height: 15px;
92
+ width: 15px;
93
+ border: 3px solid #999999;
94
+ -webkit-box-shadow: 1px 1px 1px #fff;
95
+ box-shadow: 1px 1px 1px #fff;
96
+ border-right-color: transparent;
97
+ border-radius: 50%;
98
+ -webkit-animation: rotate-loading 1.5s linear 0s infinite normal;
99
+ animation: rotate-loading 1.5s linear 0s infinite normal; }
100
+ .swal2-modal .swal2-styled {
101
+ border: 0;
102
+ border-radius: 3px;
103
+ -webkit-box-shadow: none;
104
+ box-shadow: none;
105
+ color: #fff;
106
+ cursor: pointer;
107
+ font-size: 17px;
108
+ font-weight: 500;
109
+ margin: 15px 5px 0;
110
+ padding: 10px 32px; }
111
+ .swal2-modal .swal2-image {
112
+ margin: 20px auto;
113
+ max-width: 100%; }
114
+ .swal2-modal .swal2-close {
115
+ background: transparent;
116
+ border: 0;
117
+ margin: 0;
118
+ padding: 0;
119
+ width: 38px;
120
+ height: 40px;
121
+ font-size: 36px;
122
+ line-height: 40px;
123
+ font-family: serif;
124
+ position: absolute;
125
+ top: 5px;
126
+ right: 8px;
127
+ cursor: pointer;
128
+ color: #cccccc;
129
+ -webkit-transition: color .1s ease;
130
+ transition: color .1s ease; }
131
+ .swal2-modal .swal2-close:hover {
132
+ color: #d55; }
133
+ .swal2-modal > .swal2-input,
134
+ .swal2-modal > .swal2-file,
135
+ .swal2-modal > .swal2-textarea,
136
+ .swal2-modal > .swal2-select,
137
+ .swal2-modal > .swal2-radio,
138
+ .swal2-modal > .swal2-checkbox {
139
+ display: none; }
140
+ .swal2-modal .swal2-content {
141
+ font-size: 18px;
142
+ text-align: center;
143
+ font-weight: 300;
144
+ position: relative;
145
+ float: none;
146
+ margin: 0;
147
+ padding: 0;
148
+ line-height: normal;
149
+ color: #545454;
150
+ word-wrap: break-word; }
151
+ .swal2-modal .swal2-input,
152
+ .swal2-modal .swal2-file,
153
+ .swal2-modal .swal2-textarea,
154
+ .swal2-modal .swal2-select,
155
+ .swal2-modal .swal2-radio,
156
+ .swal2-modal .swal2-checkbox {
157
+ margin: 20px auto; }
158
+ .swal2-modal .swal2-input,
159
+ .swal2-modal .swal2-file,
160
+ .swal2-modal .swal2-textarea {
161
+ width: 100%;
162
+ -webkit-box-sizing: border-box;
163
+ box-sizing: border-box;
164
+ font-size: 18px;
165
+ border-radius: 3px;
166
+ border: 1px solid #d9d9d9;
167
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06);
168
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06);
169
+ -webkit-transition: border-color box-shadow .3s;
170
+ transition: border-color box-shadow .3s; }
171
+ .swal2-modal .swal2-input.swal2-inputerror,
172
+ .swal2-modal .swal2-file.swal2-inputerror,
173
+ .swal2-modal .swal2-textarea.swal2-inputerror {
174
+ border-color: #f27474 !important;
175
+ -webkit-box-shadow: 0 0 2px #f27474 !important;
176
+ box-shadow: 0 0 2px #f27474 !important; }
177
+ .swal2-modal .swal2-input:focus,
178
+ .swal2-modal .swal2-file:focus,
179
+ .swal2-modal .swal2-textarea:focus {
180
+ outline: none;
181
+ border: 1px solid #b4dbed;
182
+ -webkit-box-shadow: 0 0 3px #c4e6f5;
183
+ box-shadow: 0 0 3px #c4e6f5; }
184
+ .swal2-modal .swal2-input:focus::-webkit-input-placeholder,
185
+ .swal2-modal .swal2-file:focus::-webkit-input-placeholder,
186
+ .swal2-modal .swal2-textarea:focus::-webkit-input-placeholder {
187
+ -webkit-transition: opacity .3s .03s ease;
188
+ transition: opacity .3s .03s ease;
189
+ opacity: .8; }
190
+ .swal2-modal .swal2-input:focus:-ms-input-placeholder,
191
+ .swal2-modal .swal2-file:focus:-ms-input-placeholder,
192
+ .swal2-modal .swal2-textarea:focus:-ms-input-placeholder {
193
+ -webkit-transition: opacity .3s .03s ease;
194
+ transition: opacity .3s .03s ease;
195
+ opacity: .8; }
196
+ .swal2-modal .swal2-input:focus::placeholder,
197
+ .swal2-modal .swal2-file:focus::placeholder,
198
+ .swal2-modal .swal2-textarea:focus::placeholder {
199
+ -webkit-transition: opacity .3s .03s ease;
200
+ transition: opacity .3s .03s ease;
201
+ opacity: .8; }
202
+ .swal2-modal .swal2-input::-webkit-input-placeholder,
203
+ .swal2-modal .swal2-file::-webkit-input-placeholder,
204
+ .swal2-modal .swal2-textarea::-webkit-input-placeholder {
205
+ color: #e6e6e6; }
206
+ .swal2-modal .swal2-input:-ms-input-placeholder,
207
+ .swal2-modal .swal2-file:-ms-input-placeholder,
208
+ .swal2-modal .swal2-textarea:-ms-input-placeholder {
209
+ color: #e6e6e6; }
210
+ .swal2-modal .swal2-input::placeholder,
211
+ .swal2-modal .swal2-file::placeholder,
212
+ .swal2-modal .swal2-textarea::placeholder {
213
+ color: #e6e6e6; }
214
+ .swal2-modal .swal2-range input {
215
+ float: left;
216
+ width: 80%; }
217
+ .swal2-modal .swal2-range output {
218
+ float: right;
219
+ width: 20%;
220
+ font-size: 20px;
221
+ font-weight: 600;
222
+ text-align: center; }
223
+ .swal2-modal .swal2-range input,
224
+ .swal2-modal .swal2-range output {
225
+ height: 43px;
226
+ line-height: 43px;
227
+ vertical-align: middle;
228
+ margin: 20px auto;
229
+ padding: 0; }
230
+ .swal2-modal .swal2-input {
231
+ height: 43px;
232
+ padding: 0 12px; }
233
+ .swal2-modal .swal2-input[type='number'] {
234
+ max-width: 150px; }
235
+ .swal2-modal .swal2-file {
236
+ font-size: 20px; }
237
+ .swal2-modal .swal2-textarea {
238
+ height: 108px;
239
+ padding: 12px; }
240
+ .swal2-modal .swal2-select {
241
+ color: #545454;
242
+ font-size: inherit;
243
+ padding: 5px 10px;
244
+ min-width: 40%;
245
+ max-width: 100%; }
246
+ .swal2-modal .swal2-radio {
247
+ border: 0; }
248
+ .swal2-modal .swal2-radio label:not(:first-child) {
249
+ margin-left: 20px; }
250
+ .swal2-modal .swal2-radio input,
251
+ .swal2-modal .swal2-radio span {
252
+ vertical-align: middle; }
253
+ .swal2-modal .swal2-radio input {
254
+ margin: 0 3px 0 0; }
255
+ .swal2-modal .swal2-checkbox {
256
+ color: #545454; }
257
+ .swal2-modal .swal2-checkbox input,
258
+ .swal2-modal .swal2-checkbox span {
259
+ vertical-align: middle; }
260
+ .swal2-modal .swal2-validationerror {
261
+ background-color: #f0f0f0;
262
+ margin: 0 -20px;
263
+ overflow: hidden;
264
+ padding: 10px;
265
+ color: gray;
266
+ font-size: 16px;
267
+ font-weight: 300;
268
+ display: none; }
269
+ .swal2-modal .swal2-validationerror::before {
270
+ content: '!';
271
+ display: inline-block;
272
+ width: 24px;
273
+ height: 24px;
274
+ border-radius: 50%;
275
+ background-color: #ea7d7d;
276
+ color: #fff;
277
+ line-height: 24px;
278
+ text-align: center;
279
+ margin-right: 10px; }
280
+
281
+ @supports (-ms-accelerator: true) {
282
+ .swal2-range input {
283
+ width: 100% !important; }
284
+ .swal2-range output {
285
+ display: none; } }
286
+
287
+ @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
288
+ .swal2-range input {
289
+ width: 100% !important; }
290
+ .swal2-range output {
291
+ display: none; } }
292
+
293
+ .swal2-icon {
294
+ width: 80px;
295
+ height: 80px;
296
+ border: 4px solid transparent;
297
+ border-radius: 50%;
298
+ margin: 20px auto 30px;
299
+ padding: 0;
300
+ position: relative;
301
+ -webkit-box-sizing: content-box;
302
+ box-sizing: content-box;
303
+ cursor: default;
304
+ -webkit-user-select: none;
305
+ -moz-user-select: none;
306
+ -ms-user-select: none;
307
+ user-select: none; }
308
+ .swal2-icon.swal2-error {
309
+ border-color: #f27474; }
310
+ .swal2-icon.swal2-error .swal2-x-mark {
311
+ position: relative;
312
+ display: block; }
313
+ .swal2-icon.swal2-error [class^='swal2-x-mark-line'] {
314
+ position: absolute;
315
+ height: 5px;
316
+ width: 47px;
317
+ background-color: #f27474;
318
+ display: block;
319
+ top: 37px;
320
+ border-radius: 2px; }
321
+ .swal2-icon.swal2-error [class^='swal2-x-mark-line'][class$='left'] {
322
+ -webkit-transform: rotate(45deg);
323
+ transform: rotate(45deg);
324
+ left: 17px; }
325
+ .swal2-icon.swal2-error [class^='swal2-x-mark-line'][class$='right'] {
326
+ -webkit-transform: rotate(-45deg);
327
+ transform: rotate(-45deg);
328
+ right: 16px; }
329
+ .swal2-icon.swal2-warning {
330
+ font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
331
+ color: #f8bb86;
332
+ border-color: #facea8;
333
+ font-size: 60px;
334
+ line-height: 80px;
335
+ text-align: center; }
336
+ .swal2-icon.swal2-info {
337
+ font-family: 'Open Sans', sans-serif;
338
+ color: #3fc3ee;
339
+ border-color: #9de0f6;
340
+ font-size: 60px;
341
+ line-height: 80px;
342
+ text-align: center; }
343
+ .swal2-icon.swal2-question {
344
+ font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
345
+ color: #87adbd;
346
+ border-color: #c9dae1;
347
+ font-size: 60px;
348
+ line-height: 80px;
349
+ text-align: center; }
350
+ .swal2-icon.swal2-success {
351
+ border-color: #a5dc86; }
352
+ .swal2-icon.swal2-success [class^='swal2-success-circular-line'] {
353
+ border-radius: 50%;
354
+ position: absolute;
355
+ width: 60px;
356
+ height: 120px;
357
+ -webkit-transform: rotate(45deg);
358
+ transform: rotate(45deg); }
359
+ .swal2-icon.swal2-success [class^='swal2-success-circular-line'][class$='left'] {
360
+ border-radius: 120px 0 0 120px;
361
+ top: -7px;
362
+ left: -33px;
363
+ -webkit-transform: rotate(-45deg);
364
+ transform: rotate(-45deg);
365
+ -webkit-transform-origin: 60px 60px;
366
+ transform-origin: 60px 60px; }
367
+ .swal2-icon.swal2-success [class^='swal2-success-circular-line'][class$='right'] {
368
+ border-radius: 0 120px 120px 0;
369
+ top: -11px;
370
+ left: 30px;
371
+ -webkit-transform: rotate(-45deg);
372
+ transform: rotate(-45deg);
373
+ -webkit-transform-origin: 0 60px;
374
+ transform-origin: 0 60px; }
375
+ .swal2-icon.swal2-success .swal2-success-ring {
376
+ width: 80px;
377
+ height: 80px;
378
+ border: 4px solid rgba(165, 220, 134, 0.2);
379
+ border-radius: 50%;
380
+ -webkit-box-sizing: content-box;
381
+ box-sizing: content-box;
382
+ position: absolute;
383
+ left: -4px;
384
+ top: -4px;
385
+ z-index: 2; }
386
+ .swal2-icon.swal2-success .swal2-success-fix {
387
+ width: 7px;
388
+ height: 90px;
389
+ position: absolute;
390
+ left: 28px;
391
+ top: 8px;
392
+ z-index: 1;
393
+ -webkit-transform: rotate(-45deg);
394
+ transform: rotate(-45deg); }
395
+ .swal2-icon.swal2-success [class^='swal2-success-line'] {
396
+ height: 5px;
397
+ background-color: #a5dc86;
398
+ display: block;
399
+ border-radius: 2px;
400
+ position: absolute;
401
+ z-index: 2; }
402
+ .swal2-icon.swal2-success [class^='swal2-success-line'][class$='tip'] {
403
+ width: 25px;
404
+ left: 14px;
405
+ top: 46px;
406
+ -webkit-transform: rotate(45deg);
407
+ transform: rotate(45deg); }
408
+ .swal2-icon.swal2-success [class^='swal2-success-line'][class$='long'] {
409
+ width: 47px;
410
+ right: 8px;
411
+ top: 38px;
412
+ -webkit-transform: rotate(-45deg);
413
+ transform: rotate(-45deg); }
414
+
415
+ .swal2-progresssteps {
416
+ font-weight: 600;
417
+ margin: 0 0 20px;
418
+ padding: 0; }
419
+ .swal2-progresssteps li {
420
+ display: inline-block;
421
+ position: relative; }
422
+ .swal2-progresssteps .swal2-progresscircle {
423
+ background: #3085d6;
424
+ border-radius: 2em;
425
+ color: #fff;
426
+ height: 2em;
427
+ line-height: 2em;
428
+ text-align: center;
429
+ width: 2em;
430
+ z-index: 20; }
431
+ .swal2-progresssteps .swal2-progresscircle:first-child {
432
+ margin-left: 0; }
433
+ .swal2-progresssteps .swal2-progresscircle:last-child {
434
+ margin-right: 0; }
435
+ .swal2-progresssteps .swal2-progresscircle.swal2-activeprogressstep {
436
+ background: #3085d6; }
437
+ .swal2-progresssteps .swal2-progresscircle.swal2-activeprogressstep ~ .swal2-progresscircle {
438
+ background: #add8e6; }
439
+ .swal2-progresssteps .swal2-progresscircle.swal2-activeprogressstep ~ .swal2-progressline {
440
+ background: #add8e6; }
441
+ .swal2-progresssteps .swal2-progressline {
442
+ background: #3085d6;
443
+ height: .4em;
444
+ margin: 0 -1px;
445
+ z-index: 10; }
446
+
447
+ [class^='swal2'] {
448
+ -webkit-tap-highlight-color: transparent; }
449
+
450
+ @-webkit-keyframes showSweetAlert {
451
+ 0% {
452
+ -webkit-transform: scale(0.7);
453
+ transform: scale(0.7); }
454
+ 45% {
455
+ -webkit-transform: scale(1.05);
456
+ transform: scale(1.05); }
457
+ 80% {
458
+ -webkit-transform: scale(0.95);
459
+ transform: scale(0.95); }
460
+ 100% {
461
+ -webkit-transform: scale(1);
462
+ transform: scale(1); } }
463
+
464
+ @keyframes showSweetAlert {
465
+ 0% {
466
+ -webkit-transform: scale(0.7);
467
+ transform: scale(0.7); }
468
+ 45% {
469
+ -webkit-transform: scale(1.05);
470
+ transform: scale(1.05); }
471
+ 80% {
472
+ -webkit-transform: scale(0.95);
473
+ transform: scale(0.95); }
474
+ 100% {
475
+ -webkit-transform: scale(1);
476
+ transform: scale(1); } }
477
+
478
+ @-webkit-keyframes hideSweetAlert {
479
+ 0% {
480
+ -webkit-transform: scale(1);
481
+ transform: scale(1);
482
+ opacity: 1; }
483
+ 100% {
484
+ -webkit-transform: scale(0.5);
485
+ transform: scale(0.5);
486
+ opacity: 0; } }
487
+
488
+ @keyframes hideSweetAlert {
489
+ 0% {
490
+ -webkit-transform: scale(1);
491
+ transform: scale(1);
492
+ opacity: 1; }
493
+ 100% {
494
+ -webkit-transform: scale(0.5);
495
+ transform: scale(0.5);
496
+ opacity: 0; } }
497
+
498
+ .swal2-show {
499
+ -webkit-animation: showSweetAlert 0.3s;
500
+ animation: showSweetAlert 0.3s; }
501
+ .swal2-show.swal2-noanimation {
502
+ -webkit-animation: none;
503
+ animation: none; }
504
+
505
+ .swal2-hide {
506
+ -webkit-animation: hideSweetAlert 0.15s forwards;
507
+ animation: hideSweetAlert 0.15s forwards; }
508
+ .swal2-hide.swal2-noanimation {
509
+ -webkit-animation: none;
510
+ animation: none; }
511
+
512
+ @-webkit-keyframes animate-success-tip {
513
+ 0% {
514
+ width: 0;
515
+ left: 1px;
516
+ top: 19px; }
517
+ 54% {
518
+ width: 0;
519
+ left: 1px;
520
+ top: 19px; }
521
+ 70% {
522
+ width: 50px;
523
+ left: -8px;
524
+ top: 37px; }
525
+ 84% {
526
+ width: 17px;
527
+ left: 21px;
528
+ top: 48px; }
529
+ 100% {
530
+ width: 25px;
531
+ left: 14px;
532
+ top: 45px; } }
533
+
534
+ @keyframes animate-success-tip {
535
+ 0% {
536
+ width: 0;
537
+ left: 1px;
538
+ top: 19px; }
539
+ 54% {
540
+ width: 0;
541
+ left: 1px;
542
+ top: 19px; }
543
+ 70% {
544
+ width: 50px;
545
+ left: -8px;
546
+ top: 37px; }
547
+ 84% {
548
+ width: 17px;
549
+ left: 21px;
550
+ top: 48px; }
551
+ 100% {
552
+ width: 25px;
553
+ left: 14px;
554
+ top: 45px; } }
555
+
556
+ @-webkit-keyframes animate-success-long {
557
+ 0% {
558
+ width: 0;
559
+ right: 46px;
560
+ top: 54px; }
561
+ 65% {
562
+ width: 0;
563
+ right: 46px;
564
+ top: 54px; }
565
+ 84% {
566
+ width: 55px;
567
+ right: 0;
568
+ top: 35px; }
569
+ 100% {
570
+ width: 47px;
571
+ right: 8px;
572
+ top: 38px; } }
573
+
574
+ @keyframes animate-success-long {
575
+ 0% {
576
+ width: 0;
577
+ right: 46px;
578
+ top: 54px; }
579
+ 65% {
580
+ width: 0;
581
+ right: 46px;
582
+ top: 54px; }
583
+ 84% {
584
+ width: 55px;
585
+ right: 0;
586
+ top: 35px; }
587
+ 100% {
588
+ width: 47px;
589
+ right: 8px;
590
+ top: 38px; } }
591
+
592
+ @-webkit-keyframes rotatePlaceholder {
593
+ 0% {
594
+ -webkit-transform: rotate(-45deg);
595
+ transform: rotate(-45deg); }
596
+ 5% {
597
+ -webkit-transform: rotate(-45deg);
598
+ transform: rotate(-45deg); }
599
+ 12% {
600
+ -webkit-transform: rotate(-405deg);
601
+ transform: rotate(-405deg); }
602
+ 100% {
603
+ -webkit-transform: rotate(-405deg);
604
+ transform: rotate(-405deg); } }
605
+
606
+ @keyframes rotatePlaceholder {
607
+ 0% {
608
+ -webkit-transform: rotate(-45deg);
609
+ transform: rotate(-45deg); }
610
+ 5% {
611
+ -webkit-transform: rotate(-45deg);
612
+ transform: rotate(-45deg); }
613
+ 12% {
614
+ -webkit-transform: rotate(-405deg);
615
+ transform: rotate(-405deg); }
616
+ 100% {
617
+ -webkit-transform: rotate(-405deg);
618
+ transform: rotate(-405deg); } }
619
+
620
+ .swal2-animate-success-line-tip {
621
+ -webkit-animation: animate-success-tip 0.75s;
622
+ animation: animate-success-tip 0.75s; }
623
+
624
+ .swal2-animate-success-line-long {
625
+ -webkit-animation: animate-success-long 0.75s;
626
+ animation: animate-success-long 0.75s; }
627
+
628
+ .swal2-success.swal2-animate-success-icon .swal2-success-circular-line-right {
629
+ -webkit-animation: rotatePlaceholder 4.25s ease-in;
630
+ animation: rotatePlaceholder 4.25s ease-in; }
631
+
632
+ @-webkit-keyframes animate-error-icon {
633
+ 0% {
634
+ -webkit-transform: rotateX(100deg);
635
+ transform: rotateX(100deg);
636
+ opacity: 0; }
637
+ 100% {
638
+ -webkit-transform: rotateX(0deg);
639
+ transform: rotateX(0deg);
640
+ opacity: 1; } }
641
+
642
+ @keyframes animate-error-icon {
643
+ 0% {
644
+ -webkit-transform: rotateX(100deg);
645
+ transform: rotateX(100deg);
646
+ opacity: 0; }
647
+ 100% {
648
+ -webkit-transform: rotateX(0deg);
649
+ transform: rotateX(0deg);
650
+ opacity: 1; } }
651
+
652
+ .swal2-animate-error-icon {
653
+ -webkit-animation: animate-error-icon 0.5s;
654
+ animation: animate-error-icon 0.5s; }
655
+
656
+ @-webkit-keyframes animate-x-mark {
657
+ 0% {
658
+ -webkit-transform: scale(0.4);
659
+ transform: scale(0.4);
660
+ margin-top: 26px;
661
+ opacity: 0; }
662
+ 50% {
663
+ -webkit-transform: scale(0.4);
664
+ transform: scale(0.4);
665
+ margin-top: 26px;
666
+ opacity: 0; }
667
+ 80% {
668
+ -webkit-transform: scale(1.15);
669
+ transform: scale(1.15);
670
+ margin-top: -6px; }
671
+ 100% {
672
+ -webkit-transform: scale(1);
673
+ transform: scale(1);
674
+ margin-top: 0;
675
+ opacity: 1; } }
676
+
677
+ @keyframes animate-x-mark {
678
+ 0% {
679
+ -webkit-transform: scale(0.4);
680
+ transform: scale(0.4);
681
+ margin-top: 26px;
682
+ opacity: 0; }
683
+ 50% {
684
+ -webkit-transform: scale(0.4);
685
+ transform: scale(0.4);
686
+ margin-top: 26px;
687
+ opacity: 0; }
688
+ 80% {
689
+ -webkit-transform: scale(1.15);
690
+ transform: scale(1.15);
691
+ margin-top: -6px; }
692
+ 100% {
693
+ -webkit-transform: scale(1);
694
+ transform: scale(1);
695
+ margin-top: 0;
696
+ opacity: 1; } }
697
+
698
+ .swal2-animate-x-mark {
699
+ -webkit-animation: animate-x-mark 0.5s;
700
+ animation: animate-x-mark 0.5s; }
701
+
702
+ @-webkit-keyframes rotate-loading {
703
+ 0% {
704
+ -webkit-transform: rotate(0deg);
705
+ transform: rotate(0deg); }
706
+ 100% {
707
+ -webkit-transform: rotate(360deg);
708
+ transform: rotate(360deg); } }
709
+
710
+ @keyframes rotate-loading {
711
+ 0% {
712
+ -webkit-transform: rotate(0deg);
713
+ transform: rotate(0deg); }
714
+ 100% {
715
+ -webkit-transform: rotate(360deg);
716
+ transform: rotate(360deg); } }
admin/assets/img/index.php CHANGED
@@ -1,2 +1,2 @@
1
- <?php
2
- // silence is golden
1
+ <?php
2
+ // silence is golden
admin/assets/index.php CHANGED
@@ -1,2 +1,2 @@
1
- <?php
2
- // silence is golden
1
+ <?php
2
+ // silence is golden
admin/assets/js/Chart.min.js CHANGED
@@ -1,10 +1,10 @@
1
- /*!
2
- * Chart.js
3
- * http://chartjs.org/
4
- * Version: 2.7.1
5
- *
6
- * Copyright 2017 Nick Downie
7
- * Released under the MIT license
8
- * https://github.com/chartjs/Chart.js/blob/master/LICENSE.md
9
- */
10
- window.robin=window.robin||{};!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window.robin:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Chart=t()}}(function(){return function t(e,n,i){function a(r,l){if(!n[r]){if(!e[r]){var s="function"==typeof require&&require;if(!l&&s)return s(r,!0);if(o)return o(r,!0);var u=new Error("Cannot find module '"+r+"'");throw u.code="MODULE_NOT_FOUND",u}var d=n[r]={exports:{}};e[r][0].call(d.exports,function(t){var n=e[r][1][t];return a(n||t)},d,d.exports,t,e,n,i)}return n[r].exports}for(var o="function"==typeof require&&require,r=0;r<i.length;r++)a(i[r]);return a}({1:[function(t,e,n){},{}],2:[function(t,e,n){function i(t){if(t){var e=[0,0,0],n=1,i=t.match(/^#([a-fA-F0-9]{3})$/i);if(i){i=i[1];for(a=0;a<e.length;a++)e[a]=parseInt(i[a]+i[a],16)}else if(i=t.match(/^#([a-fA-F0-9]{6})$/i)){i=i[1];for(a=0;a<e.length;a++)e[a]=parseInt(i.slice(2*a,2*a+2),16)}else if(i=t.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(a=0;a<e.length;a++)e[a]=parseInt(i[a+1]);n=parseFloat(i[4])}else if(i=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(a=0;a<e.length;a++)e[a]=Math.round(2.55*parseFloat(i[a+1]));n=parseFloat(i[4])}else if(i=t.match(/(\w+)/)){if("transparent"==i[1])return[0,0,0,0];if(!(e=c[i[1]]))return}for(var a=0;a<e.length;a++)e[a]=u(e[a],0,255);return n=n||0==n?u(n,0,1):1,e[3]=n,e}}function a(t){if(t){var e=t.match(/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(e){var n=parseFloat(e[4]);return[u(parseInt(e[1]),0,360),u(parseFloat(e[2]),0,100),u(parseFloat(e[3]),0,100),u(isNaN(n)?1:n,0,1)]}}}function o(t){if(t){var e=t.match(/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(e){var n=parseFloat(e[4]);return[u(parseInt(e[1]),0,360),u(parseFloat(e[2]),0,100),u(parseFloat(e[3]),0,100),u(isNaN(n)?1:n,0,1)]}}}function r(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"rgba("+t[0]+", "+t[1]+", "+t[2]+", "+e+")"}function l(t,e){return"rgba("+Math.round(t[0]/255*100)+"%, "+Math.round(t[1]/255*100)+"%, "+Math.round(t[2]/255*100)+"%, "+(e||t[3]||1)+")"}function s(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+e+")"}function u(t,e,n){return Math.min(Math.max(e,t),n)}function d(t){var e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}var c=t(6);e.exports={getRgba:i,getHsla:a,getRgb:function(t){var e=i(t);return e&&e.slice(0,3)},getHsl:function(t){var e=a(t);return e&&e.slice(0,3)},getHwb:o,getAlpha:function(t){var e=i(t);return e?e[3]:(e=a(t))?e[3]:(e=o(t))?e[3]:void 0},hexString:function(t){return"#"+d(t[0])+d(t[1])+d(t[2])},rgbString:function(t,e){return e<1||t[3]&&t[3]<1?r(t,e):"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},rgbaString:r,percentString:function(t,e){return e<1||t[3]&&t[3]<1?l(t,e):"rgb("+Math.round(t[0]/255*100)+"%, "+Math.round(t[1]/255*100)+"%, "+Math.round(t[2]/255*100)+"%)"},percentaString:l,hslString:function(t,e){return e<1||t[3]&&t[3]<1?s(t,e):"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"},hslaString:s,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)]}};var h={};for(var f in c)h[c[f]]=f},{6:6}],3:[function(t,e,n){var i=t(5),a=t(2),o=function(t){if(t instanceof o)return t;if(!(this instanceof o))return new o(t);this.valid=!1,this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1};var e;"string"==typeof t?(e=a.getRgba(t))?this.setValues("rgb",e):(e=a.getHsla(t))?this.setValues("hsl",e):(e=a.getHwb(t))&&this.setValues("hwb",e):"object"==typeof t&&(void 0!==(e=t).r||void 0!==e.red?this.setValues("rgb",e):void 0!==e.l||void 0!==e.lightness?this.setValues("hsl",e):void 0!==e.v||void 0!==e.value?this.setValues("hsv",e):void 0!==e.w||void 0!==e.whiteness?this.setValues("hwb",e):void 0===e.c&&void 0===e.cyan||this.setValues("cmyk",e))};o.prototype={isValid:function(){return this.valid},rgb:function(){return this.setSpace("rgb",arguments)},hsl:function(){return this.setSpace("hsl",arguments)},hsv:function(){return this.setSpace("hsv",arguments)},hwb:function(){return this.setSpace("hwb",arguments)},cmyk:function(){return this.setSpace("cmyk",arguments)},rgbArray:function(){return this.values.rgb},hslArray:function(){return this.values.hsl},hsvArray:function(){return this.values.hsv},hwbArray:function(){var t=this.values;return 1!==t.alpha?t.hwb.concat([t.alpha]):t.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var t=this.values;return t.rgb.concat([t.alpha])},hslaArray:function(){var t=this.values;return t.hsl.concat([t.alpha])},alpha:function(t){return void 0===t?this.values.alpha:(this.setValues("alpha",t),this)},red:function(t){return this.setChannel("rgb",0,t)},green:function(t){return this.setChannel("rgb",1,t)},blue:function(t){return this.setChannel("rgb",2,t)},hue:function(t){return t&&(t=(t%=360)<0?360+t:t),this.setChannel("hsl",0,t)},saturation:function(t){return this.setChannel("hsl",1,t)},lightness:function(t){return this.setChannel("hsl",2,t)},saturationv:function(t){return this.setChannel("hsv",1,t)},whiteness:function(t){return this.setChannel("hwb",1,t)},blackness:function(t){return this.setChannel("hwb",2,t)},value:function(t){return this.setChannel("hsv",2,t)},cyan:function(t){return this.setChannel("cmyk",0,t)},magenta:function(t){return this.setChannel("cmyk",1,t)},yellow:function(t){return this.setChannel("cmyk",2,t)},black:function(t){return this.setChannel("cmyk",3,t)},hexString:function(){return a.hexString(this.values.rgb)},rgbString:function(){return a.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return a.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return a.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return a.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return a.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return a.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return a.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){var t=this.values.rgb;return t[0]<<16|t[1]<<8|t[2]},luminosity:function(){for(var t=this.values.rgb,e=[],n=0;n<t.length;n++){var i=t[n]/255;e[n]=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),n=t.luminosity();return e>n?(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=this,i=t,a=void 0===e?.5:e,o=2*a-1,r=n.alpha()-i.alpha(),l=((o*r==-1?o:(o+r)/(1+o*r))+1)/2,s=1-l;return this.rgb(l*n.red()+s*i.red(),l*n.green()+s*i.green(),l*n.blue()+s*i.blue()).alpha(n.alpha()*a+i.alpha()*(1-a))},toJSON:function(){return this.rgb()},clone:function(){var t,e,n=new o,i=this.values,a=n.values;for(var r in i)i.hasOwnProperty(r)&&(t=i[r],"[object Array]"===(e={}.toString.call(t))?a[r]=t.slice(0):"[object Number]"===e?a[r]=t:console.error("unexpected color value:",t));return n}},o.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},o.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},o.prototype.getValues=function(t){for(var e=this.values,n={},i=0;i<t.length;i++)n[t.charAt(i)]=e[t][i];return 1!==e.alpha&&(n.a=e.alpha),n},o.prototype.setValues=function(t,e){var n,a=this.values,o=this.spaces,r=this.maxes,l=1;if(this.valid=!0,"alpha"===t)l=e;else if(e.length)a[t]=e.slice(0,t.length),l=e[t.length];else if(void 0!==e[t.charAt(0)]){for(n=0;n<t.length;n++)a[t][n]=e[t.charAt(n)];l=e.a}else if(void 0!==e[o[t][0]]){var s=o[t];for(n=0;n<t.length;n++)a[t][n]=e[s[n]];l=e.alpha}if(a.alpha=Math.max(0,Math.min(1,void 0===l?a.alpha:l)),"alpha"===t)return!1;var u;for(n=0;n<t.length;n++)u=Math.max(0,Math.min(r[t][n],a[t][n])),a[t][n]=Math.round(u);for(var d in o)d!==t&&(a[d]=i[t][d](a[t]));return!0},o.prototype.setSpace=function(t,e){var n=e[0];return void 0===n?this.getValues(t):("number"==typeof n&&(n=Array.prototype.slice.call(e)),this.setValues(t,n),this)},o.prototype.setChannel=function(t,e,n){var i=this.values[t];return void 0===n?i[e]:n===i[e]?this:(i[e]=n,this.setValues(t,i),this)},"undefined"!=typeof window&&(window.robin.Color=o),e.exports=o},{2:2,5:5}],4:[function(t,e,n){function i(t){var e,n,i,a=t[0]/255,o=t[1]/255,r=t[2]/255,l=Math.min(a,o,r),s=Math.max(a,o,r),u=s-l;return s==l?e=0:a==s?e=(o-r)/u:o==s?e=2+(r-a)/u:r==s&&(e=4+(a-o)/u),(e=Math.min(60*e,360))<0&&(e+=360),i=(l+s)/2,n=s==l?0:i<=.5?u/(s+l):u/(2-s-l),[e,100*n,100*i]}function a(t){var e,n,i,a=t[0],o=t[1],r=t[2],l=Math.min(a,o,r),s=Math.max(a,o,r),u=s-l;return n=0==s?0:u/s*1e3/10,s==l?e=0:a==s?e=(o-r)/u:o==s?e=2+(r-a)/u:r==s&&(e=4+(a-o)/u),(e=Math.min(60*e,360))<0&&(e+=360),i=s/255*1e3/10,[e,n,i]}function o(t){var e=t[0],n=t[1],a=t[2];return[i(t)[0],100*(1/255*Math.min(e,Math.min(n,a))),100*(a=1-1/255*Math.max(e,Math.max(n,a)))]}function l(t){var e,n,i,a,o=t[0]/255,r=t[1]/255,l=t[2]/255;return a=Math.min(1-o,1-r,1-l),e=(1-o-a)/(1-a)||0,n=(1-r-a)/(1-a)||0,i=(1-l-a)/(1-a)||0,[100*e,100*n,100*i,100*a]}function s(t){return C[JSON.stringify(t)]}function u(t){var e=t[0]/255,n=t[1]/255,i=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*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)),100*(.2126*e+.7152*n+.0722*i),100*(.0193*e+.1192*n+.9505*i)]}function d(t){var e,n,i,a=u(t),o=a[0],r=a[1],l=a[2];return o/=95.047,r/=100,l/=108.883,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,l=l>.008856?Math.pow(l,1/3):7.787*l+16/116,e=116*r-16,n=500*(o-r),i=200*(r-l),[e,n,i]}function c(t){var e,n,i,a,o,r=t[0]/360,l=t[1]/100,s=t[2]/100;if(0==l)return o=255*s,[o,o,o];e=2*s-(n=s<.5?s*(1+l):s+l-s*l),a=[0,0,0];for(var u=0;u<3;u++)(i=r+1/3*-(u-1))<0&&i++,i>1&&i--,o=6*i<1?e+6*(n-e)*i:2*i<1?n:3*i<2?e+(n-e)*(2/3-i)*6:e,a[u]=255*o;return a}function h(t){var e=t[0]/60,n=t[1]/100,i=t[2]/100,a=Math.floor(e)%6,o=e-Math.floor(e),r=255*i*(1-n),l=255*i*(1-n*o),s=255*i*(1-n*(1-o)),i=255*i;switch(a){case 0:return[i,s,r];case 1:return[l,i,r];case 2:return[r,i,s];case 3:return[r,l,i];case 4:return[s,r,i];case 5:return[i,r,l]}}function f(t){var e,n,i,a,o=t[0]/360,l=t[1]/100,s=t[2]/100,u=l+s;switch(u>1&&(l/=u,s/=u),e=Math.floor(6*o),n=1-s,i=6*o-e,0!=(1&e)&&(i=1-i),a=l+i*(n-l),e){default:case 6:case 0:r=n,g=a,b=l;break;case 1:r=a,g=n,b=l;break;case 2:r=l,g=n,b=a;break;case 3:r=l,g=a,b=n;break;case 4:r=a,g=l,b=n;break;case 5:r=n,g=l,b=a}return[255*r,255*g,255*b]}function p(t){var e,n,i,a=t[0]/100,o=t[1]/100,r=t[2]/100,l=t[3]/100;return e=1-Math.min(1,a*(1-l)+l),n=1-Math.min(1,o*(1-l)+l),i=1-Math.min(1,r*(1-l)+l),[255*e,255*n,255*i]}function v(t){var e,n,i,a=t[0]/100,o=t[1]/100,r=t[2]/100;return e=3.2406*a+-1.5372*o+-.4986*r,n=-.9689*a+1.8758*o+.0415*r,i=.0557*a+-.204*o+1.057*r,e=e>.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,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*=12.92,e=Math.min(Math.max(0,e),1),n=Math.min(Math.max(0,n),1),i=Math.min(Math.max(0,i),1),[255*e,255*n,255*i]}function m(t){var e,n,i,a=t[0],o=t[1],r=t[2];return a/=95.047,o/=100,r/=108.883,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,e=116*o-16,n=500*(a-o),i=200*(o-r),[e,n,i]}function x(t){var e,n,i,a,o=t[0],r=t[1],l=t[2];return o<=8?a=(n=100*o/903.3)/100*7.787+16/116:(n=100*Math.pow((o+16)/116,3),a=Math.pow(n/100,1/3)),e=e/95.047<=.008856?e=95.047*(r/500+a-16/116)/7.787:95.047*Math.pow(r/500+a,3),i=i/108.883<=.008859?i=108.883*(a-l/200-16/116)/7.787:108.883*Math.pow(a-l/200,3),[e,n,i]}function y(t){var e,n,i,a=t[0],o=t[1],r=t[2];return e=Math.atan2(r,o),(n=360*e/2/Math.PI)<0&&(n+=360),i=Math.sqrt(o*o+r*r),[a,i,n]}function k(t){return v(x(t))}function w(t){var e,n,i,a=t[0],o=t[1];return i=t[2]/360*2*Math.PI,e=o*Math.cos(i),n=o*Math.sin(i),[a,e,n]}function M(t){return S[t]}e.exports={rgb2hsl:i,rgb2hsv:a,rgb2hwb:o,rgb2cmyk:l,rgb2keyword:s,rgb2xyz:u,rgb2lab:d,rgb2lch:function(t){return y(d(t))},hsl2rgb:c,hsl2hsv:function(t){var e,n,i=t[0],a=t[1]/100,o=t[2]/100;return 0===o?[0,0,0]:(o*=2,a*=o<=1?o:2-o,n=(o+a)/2,e=2*a/(o+a),[i,100*e,100*n])},hsl2hwb:function(t){return o(c(t))},hsl2cmyk:function(t){return l(c(t))},hsl2keyword:function(t){return s(c(t))},hsv2rgb:h,hsv2hsl:function(t){var e,n,i=t[0],a=t[1]/100,o=t[2]/100;return n=(2-a)*o,e=a*o,e/=n<=1?n:2-n,e=e||0,n/=2,[i,100*e,100*n]},hsv2hwb:function(t){return o(h(t))},hsv2cmyk:function(t){return l(h(t))},hsv2keyword:function(t){return s(h(t))},hwb2rgb:f,hwb2hsl:function(t){return i(f(t))},hwb2hsv:function(t){return a(f(t))},hwb2cmyk:function(t){return l(f(t))},hwb2keyword:function(t){return s(f(t))},cmyk2rgb:p,cmyk2hsl:function(t){return i(p(t))},cmyk2hsv:function(t){return a(p(t))},cmyk2hwb:function(t){return o(p(t))},cmyk2keyword:function(t){return s(p(t))},keyword2rgb:M,keyword2hsl:function(t){return i(M(t))},keyword2hsv:function(t){return a(M(t))},keyword2hwb:function(t){return o(M(t))},keyword2cmyk:function(t){return l(M(t))},keyword2lab:function(t){return d(M(t))},keyword2xyz:function(t){return u(M(t))},xyz2rgb:v,xyz2lab:m,xyz2lch:function(t){return y(m(t))},lab2xyz:x,lab2rgb:k,lab2lch:y,lch2lab:w,lch2xyz:function(t){return x(w(t))},lch2rgb:function(t){return k(w(t))}};var S={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 S)C[JSON.stringify(S[_])]=_},{}],5:[function(t,e,n){var i=t(4),a=function(){return new u};for(var o in i){a[o+"Raw"]=function(t){return function(e){return"number"==typeof e&&(e=Array.prototype.slice.call(arguments)),i[t](e)}}(o);var r=/(\w+)2(\w+)/.exec(o),l=r[1],s=r[2];(a[l]=a[l]||{})[s]=a[o]=function(t){return function(e){"number"==typeof e&&(e=Array.prototype.slice.call(arguments));var n=i[t](e);if("string"==typeof n||void 0===n)return n;for(var a=0;a<n.length;a++)n[a]=Math.round(n[a]);return n}}(o)}var u=function(){this.convs={}};u.prototype.routeSpace=function(t,e){var n=e[0];return void 0===n?this.getValues(t):("number"==typeof n&&(n=Array.prototype.slice.call(e)),this.setValues(t,n))},u.prototype.setValues=function(t,e){return this.space=t,this.convs={},this.convs[t]=e,this},u.prototype.getValues=function(t){var e=this.convs[t];if(!e){var n=this.space,i=this.convs[n];e=a[n][t](i),this.convs[t]=e}return e},["rgb","hsl","hsv","cmyk","keyword"].forEach(function(t){u.prototype[t]=function(e){return this.routeSpace(t,arguments)}}),e.exports=a},{4:4}],6:[function(t,e,n){"use strict";e.exports={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]}},{}],7:[function(t,e,n){var i=t(29)();i.helpers=t(45),t(27)(i),i.defaults=t(25),i.Element=t(26),i.elements=t(40),i.Interaction=t(28),i.platform=t(48),t(31)(i),t(22)(i),t(23)(i),t(24)(i),t(30)(i),t(33)(i),t(32)(i),t(35)(i),t(54)(i),t(52)(i),t(53)(i),t(55)(i),t(56)(i),t(57)(i),t(15)(i),t(16)(i),t(17)(i),t(18)(i),t(19)(i),t(20)(i),t(21)(i),t(8)(i),t(9)(i),t(10)(i),t(11)(i),t(12)(i),t(13)(i),t(14)(i);var a=[];a.push(t(49)(i),t(50)(i),t(51)(i)),i.plugins.register(a),i.platform.initialize(),e.exports=i,"undefined"!=typeof window&&(window.robin.Chart=i),i.canvasHelpers=i.helpers.canvas},{10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18,19:19,20:20,21:21,22:22,23:23,24:24,25:25,26:26,27:27,28:28,29:29,30:30,31:31,32:32,33:33,35:35,40:40,45:45,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,8:8,9:9}],8:[function(t,e,n){"use strict";e.exports=function(t){t.Bar=function(e,n){return n.type="bar",new t(e,n)}}},{}],9:[function(t,e,n){"use strict";e.exports=function(t){t.Bubble=function(e,n){return n.type="bubble",new t(e,n)}}},{}],10:[function(t,e,n){"use strict";e.exports=function(t){t.Doughnut=function(e,n){return n.type="doughnut",new t(e,n)}}},{}],11:[function(t,e,n){"use strict";e.exports=function(t){t.Line=function(e,n){return n.type="line",new t(e,n)}}},{}],12:[function(t,e,n){"use strict";e.exports=function(t){t.PolarArea=function(e,n){return n.type="polarArea",new t(e,n)}}},{}],13:[function(t,e,n){"use strict";e.exports=function(t){t.Radar=function(e,n){return n.type="radar",new t(e,n)}}},{}],14:[function(t,e,n){"use strict";e.exports=function(t){t.Scatter=function(e,n){return n.type="scatter",new t(e,n)}}},{}],15:[function(t,e,n){"use strict";var i=t(25),a=t(40),o=t(45);i._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",categoryPercentage:.8,barPercentage:.9,offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}}),i._set("horizontalBar",{hover:{mode:"index",axis:"y"},scales:{xAxes:[{type:"linear",position:"bottom"}],yAxes:[{position:"left",type:"category",categoryPercentage:.8,barPercentage:.9,offset:!0,gridLines:{offsetGridLines:!0}}]},elements:{rectangle:{borderSkipped:"left"}},tooltips:{callbacks:{title:function(t,e){var n="";return t.length>0&&(t[0].yLabel?n=t[0].yLabel:e.labels.length>0&&t[0].index<e.labels.length&&(n=e.labels[t[0].index])),n},label:function(t,e){return(e.datasets[t.datasetIndex].label||"")+": "+t.xLabel}},mode:"index",axis:"y"}}),e.exports=function(t){t.controllers.bar=t.DatasetController.extend({dataElementType:a.Rectangle,initialize:function(){var e,n=this;t.DatasetController.prototype.initialize.apply(n,arguments),(e=n.getMeta()).stack=n.getDataset().stack,e.bar=!0},update:function(t){var e,n,i=this,a=i.getMeta().data;for(i._ruler=i.getRuler(),e=0,n=a.length;e<n;++e)i.updateElement(a[e],e,t)},updateElement:function(t,e,n){var i=this,a=i.chart,r=i.getMeta(),l=i.getDataset(),s=t.custom||{},u=a.options.elements.rectangle;t._xScale=i.getScaleForId(r.xAxisID),t._yScale=i.getScaleForId(r.yAxisID),t._datasetIndex=i.index,t._index=e,t._model={datasetLabel:l.label,label:a.data.labels[e],borderSkipped:s.borderSkipped?s.borderSkipped:u.borderSkipped,backgroundColor:s.backgroundColor?s.backgroundColor:o.valueAtIndexOrDefault(l.backgroundColor,e,u.backgroundColor),borderColor:s.borderColor?s.borderColor:o.valueAtIndexOrDefault(l.borderColor,e,u.borderColor),borderWidth:s.borderWidth?s.borderWidth:o.valueAtIndexOrDefault(l.borderWidth,e,u.borderWidth)},i.updateElementGeometry(t,e,n),t.pivot()},updateElementGeometry:function(t,e,n){var i=this,a=t._model,o=i.getValueScale(),r=o.getBasePixel(),l=o.isHorizontal(),s=i._ruler||i.getRuler(),u=i.calculateBarValuePixels(i.index,e),d=i.calculateBarIndexPixels(i.index,e,s);a.horizontal=l,a.base=n?r:u.base,a.x=l?n?r:u.head:d.center,a.y=l?d.center:n?r:u.head,a.height=l?d.size:void 0,a.width=l?void 0:d.size},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())},getStackCount:function(t){var e,n,i=this,a=i.chart,o=i.getIndexScale().options.stacked,r=void 0===t?a.data.datasets.length:t+1,l=[];for(e=0;e<r;++e)(n=a.getDatasetMeta(e)).bar&&a.isDatasetVisible(e)&&(!1===o||!0===o&&-1===l.indexOf(n.stack)||void 0===o&&(void 0===n.stack||-1===l.indexOf(n.stack)))&&l.push(n.stack);return l.length},getStackIndex:function(t){return this.getStackCount(t)-1},getRuler:function(){var t,e,n=this,i=n.getIndexScale(),a=n.getStackCount(),o=n.index,r=[],l=i.isHorizontal(),s=l?i.left:i.top,u=s+(l?i.width:i.height);for(t=0,e=n.getMeta().data.length;t<e;++t)r.push(i.getPixelForValue(null,t,o));return{pixels:r,start:s,end:u,stackCount:a,scale:i}},calculateBarValuePixels:function(t,e){var n,i,a,o,r,l,s=this,u=s.chart,d=s.getMeta(),c=s.getValueScale(),h=u.data.datasets,f=c.getRightValue(h[t].data[e]),g=c.options.stacked,p=d.stack,v=0;if(g||void 0===g&&void 0!==p)for(n=0;n<t;++n)(i=u.getDatasetMeta(n)).bar&&i.stack===p&&i.controller.getValueScaleId()===c.id&&u.isDatasetVisible(n)&&(a=c.getRightValue(h[n].data[e]),(f<0&&a<0||f>=0&&a>0)&&(v+=a));return o=c.getPixelForValue(v),r=c.getPixelForValue(v+f),l=(r-o)/2,{size:l,base:o,head:r,center:r+l/2}},calculateBarIndexPixels:function(t,e,n){var i,a,r,l,s,u,d=this,c=n.scale.options,h=d.getStackIndex(t),f=n.pixels,g=f[e],p=f.length,v=n.start,m=n.end;return 1===p?(i=g>v?g-v:m-g,a=g<m?m-g:g-v):(e>0&&(i=(g-f[e-1])/2,e===p-1&&(a=i)),e<p-1&&(a=(f[e+1]-g)/2,0===e&&(i=a))),r=i*c.categoryPercentage,l=a*c.categoryPercentage,s=(r+l)/n.stackCount,u=s*c.barPercentage,u=Math.min(o.valueOrDefault(c.barThickness,u),o.valueOrDefault(c.maxBarThickness,1/0)),g-=r,g+=s*h,g+=(s-u)/2,{size:u,base:g,head:g+u,center:g+u/2}},draw:function(){var t=this,e=t.chart,n=t.getValueScale(),i=t.getMeta().data,a=t.getDataset(),r=i.length,l=0;for(o.canvas.clipArea(e.ctx,e.chartArea);l<r;++l)isNaN(n.getRightValue(a.data[l]))||i[l].draw();o.canvas.unclipArea(e.ctx)},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t._index,i=t.custom||{},a=t._model;a.backgroundColor=i.hoverBackgroundColor?i.hoverBackgroundColor:o.valueAtIndexOrDefault(e.hoverBackgroundColor,n,o.getHoverColor(a.backgroundColor)),a.borderColor=i.hoverBorderColor?i.hoverBorderColor:o.valueAtIndexOrDefault(e.hoverBorderColor,n,o.getHoverColor(a.borderColor)),a.borderWidth=i.hoverBorderWidth?i.hoverBorderWidth:o.valueAtIndexOrDefault(e.hoverBorderWidth,n,a.borderWidth)},removeHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t._index,i=t.custom||{},a=t._model,r=this.chart.options.elements.rectangle;a.backgroundColor=i.backgroundColor?i.backgroundColor:o.valueAtIndexOrDefault(e.backgroundColor,n,r.backgroundColor),a.borderColor=i.borderColor?i.borderColor:o.valueAtIndexOrDefault(e.borderColor,n,r.borderColor),a.borderWidth=i.borderWidth?i.borderWidth:o.valueAtIndexOrDefault(e.borderWidth,n,r.borderWidth)}}),t.controllers.horizontalBar=t.controllers.bar.extend({getValueScaleId:function(){return this.getMeta().xAxisID},getIndexScaleId:function(){return this.getMeta().yAxisID}})}},{25:25,40:40,45:45}],16:[function(t,e,n){"use strict";var i=t(25),a=t(40),o=t(45);i._set("bubble",{hover:{mode:"single"},scales:{xAxes:[{type:"linear",position:"bottom",id:"x-axis-0"}],yAxes:[{type:"linear",position:"left",id:"y-axis-0"}]},tooltips:{callbacks:{title:function(){return""},label:function(t,e){var n=e.datasets[t.datasetIndex].label||"",i=e.datasets[t.datasetIndex].data[t.index];return n+": ("+t.xLabel+", "+t.yLabel+", "+i.r+")"}}}}),e.exports=function(t){t.controllers.bubble=t.DatasetController.extend({dataElementType:a.Point,update:function(t){var e=this,n=e.getMeta().data;o.each(n,function(n,i){e.updateElement(n,i,t)})},updateElement:function(t,e,n){var i=this,a=i.getMeta(),o=t.custom||{},r=i.getScaleForId(a.xAxisID),l=i.getScaleForId(a.yAxisID),s=i._resolveElementOptions(t,e),u=i.getDataset().data[e],d=i.index,c=n?r.getPixelForDecimal(.5):r.getPixelForValue("object"==typeof u?u:NaN,e,d),h=n?l.getBasePixel():l.getPixelForValue(u,e,d);t._xScale=r,t._yScale=l,t._options=s,t._datasetIndex=d,t._index=e,t._model={backgroundColor:s.backgroundColor,borderColor:s.borderColor,borderWidth:s.borderWidth,hitRadius:s.hitRadius,pointStyle:s.pointStyle,radius:n?0:s.radius,skip:o.skip||isNaN(c)||isNaN(h),x:c,y:h},t.pivot()},setHoverStyle:function(t){var e=t._model,n=t._options;e.backgroundColor=o.valueOrDefault(n.hoverBackgroundColor,o.getHoverColor(n.backgroundColor)),e.borderColor=o.valueOrDefault(n.hoverBorderColor,o.getHoverColor(n.borderColor)),e.borderWidth=o.valueOrDefault(n.hoverBorderWidth,n.borderWidth),e.radius=n.radius+n.hoverRadius},removeHoverStyle:function(t){var e=t._model,n=t._options;e.backgroundColor=n.backgroundColor,e.borderColor=n.borderColor,e.borderWidth=n.borderWidth,e.radius=n.radius},_resolveElementOptions:function(t,e){var n,i,a,r=this,l=r.chart,s=l.data.datasets[r.index],u=t.custom||{},d=l.options.elements.point,c=o.options.resolve,h=s.data[e],f={},g={chart:l,dataIndex:e,dataset:s,datasetIndex:r.index},p=["backgroundColor","borderColor","borderWidth","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth","hoverRadius","hitRadius","pointStyle"];for(n=0,i=p.length;n<i;++n)f[a=p[n]]=c([u[a],s[a],d[a]],g,e);return f.radius=c([u.radius,h?h.r:void 0,s.radius,d.radius],g,e),f}})}},{25:25,40:40,45:45}],17:[function(t,e,n){"use strict";var i=t(25),a=t(40),o=t(45);i._set("doughnut",{animation:{animateRotate:!0,animateScale:!1},hover:{mode:"single"},legendCallback:function(t){var e=[];e.push('<ul class="'+t.id+'-legend">');var n=t.data,i=n.datasets,a=n.labels;if(i.length)for(var o=0;o<i[0].data.length;++o)e.push('<li><span style="background-color:'+i[0].backgroundColor[o]+'"></span>'),a[o]&&e.push(a[o]),e.push("</li>");return e.push("</ul>"),e.join("")},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map(function(n,i){var a=t.getDatasetMeta(0),r=e.datasets[0],l=a.data[i],s=l&&l.custom||{},u=o.valueAtIndexOrDefault,d=t.options.elements.arc;return{text:n,fillStyle:s.backgroundColor?s.backgroundColor:u(r.backgroundColor,i,d.backgroundColor),strokeStyle:s.borderColor?s.borderColor:u(r.borderColor,i,d.borderColor),lineWidth:s.borderWidth?s.borderWidth:u(r.borderWidth,i,d.borderWidth),hidden:isNaN(r.data[i])||a.data[i].hidden,index:i}}):[]}},onClick:function(t,e){var n,i,a,o=e.index,r=this.chart;for(n=0,i=(r.data.datasets||[]).length;n<i;++n)(a=r.getDatasetMeta(n)).data[o]&&(a.data[o].hidden=!a.data[o].hidden);r.update()}},cutoutPercentage:50,rotation:-.5*Math.PI,circumference:2*Math.PI,tooltips:{callbacks:{title:function(){return""},label:function(t,e){var n=e.labels[t.index],i=": "+e.datasets[t.datasetIndex].data[t.index];return o.isArray(n)?(n=n.slice())[0]+=i:n+=i,n}}}}),i._set("pie",o.clone(i.doughnut)),i._set("pie",{cutoutPercentage:0}),e.exports=function(t){t.controllers.doughnut=t.controllers.pie=t.DatasetController.extend({dataElementType:a.Arc,linkScales:o.noop,getRingIndex:function(t){for(var e=0,n=0;n<t;++n)this.chart.isDatasetVisible(n)&&++e;return e},update:function(t){var e=this,n=e.chart,i=n.chartArea,a=n.options,r=a.elements.arc,l=i.right-i.left-r.borderWidth,s=i.bottom-i.top-r.borderWidth,u=Math.min(l,s),d={x:0,y:0},c=e.getMeta(),h=a.cutoutPercentage,f=a.circumference;if(f<2*Math.PI){var g=a.rotation%(2*Math.PI),p=(g+=2*Math.PI*(g>=Math.PI?-1:g<-Math.PI?1:0))+f,v={x:Math.cos(g),y:Math.sin(g)},m={x:Math.cos(p),y:Math.sin(p)},b=g<=0&&p>=0||g<=2*Math.PI&&2*Math.PI<=p,x=g<=.5*Math.PI&&.5*Math.PI<=p||g<=2.5*Math.PI&&2.5*Math.PI<=p,y=g<=-Math.PI&&-Math.PI<=p||g<=Math.PI&&Math.PI<=p,k=g<=.5*-Math.PI&&.5*-Math.PI<=p||g<=1.5*Math.PI&&1.5*Math.PI<=p,w=h/100,M={x:y?-1:Math.min(v.x*(v.x<0?1:w),m.x*(m.x<0?1:w)),y:k?-1:Math.min(v.y*(v.y<0?1:w),m.y*(m.y<0?1:w))},S={x:b?1:Math.max(v.x*(v.x>0?1:w),m.x*(m.x>0?1:w)),y:x?1:Math.max(v.y*(v.y>0?1:w),m.y*(m.y>0?1:w))},C={width:.5*(S.x-M.x),height:.5*(S.y-M.y)};u=Math.min(l/C.width,s/C.height),d={x:-.5*(S.x+M.x),y:-.5*(S.y+M.y)}}n.borderWidth=e.getMaxBorderWidth(c.data),n.outerRadius=Math.max((u-n.borderWidth)/2,0),n.innerRadius=Math.max(h?n.outerRadius/100*h:0,0),n.radiusLength=(n.outerRadius-n.innerRadius)/n.getVisibleDatasetCount(),n.offsetX=d.x*n.outerRadius,n.offsetY=d.y*n.outerRadius,c.total=e.calculateTotal(),e.outerRadius=n.outerRadius-n.radiusLength*e.getRingIndex(e.index),e.innerRadius=Math.max(e.outerRadius-n.radiusLength,0),o.each(c.data,function(n,i){e.updateElement(n,i,t)})},updateElement:function(t,e,n){var i=this,a=i.chart,r=a.chartArea,l=a.options,s=l.animation,u=(r.left+r.right)/2,d=(r.top+r.bottom)/2,c=l.rotation,h=l.rotation,f=i.getDataset(),g=n&&s.animateRotate?0:t.hidden?0:i.calculateCircumference(f.data[e])*(l.circumference/(2*Math.PI)),p=n&&s.animateScale?0:i.innerRadius,v=n&&s.animateScale?0:i.outerRadius,m=o.valueAtIndexOrDefault;o.extend(t,{_datasetIndex:i.index,_index:e,_model:{x:u+a.offsetX,y:d+a.offsetY,startAngle:c,endAngle:h,circumference:g,outerRadius:v,innerRadius:p,label:m(f.label,e,a.data.labels[e])}});var b=t._model;this.removeHoverStyle(t),n&&s.animateRotate||(b.startAngle=0===e?l.rotation:i.getMeta().data[e-1]._model.endAngle,b.endAngle=b.startAngle+b.circumference),t.pivot()},removeHoverStyle:function(e){t.DatasetController.prototype.removeHoverStyle.call(this,e,this.chart.options.elements.arc)},calculateTotal:function(){var t,e=this.getDataset(),n=this.getMeta(),i=0;return o.each(n.data,function(n,a){t=e.data[a],isNaN(t)||n.hidden||(i+=Math.abs(t))}),i},calculateCircumference:function(t){var e=this.getMeta().total;return e>0&&!isNaN(t)?2*Math.PI*(t/e):0},getMaxBorderWidth:function(t){for(var e,n,i=0,a=this.index,o=t.length,r=0;r<o;r++)e=t[r]._model?t[r]._model.borderWidth:0,i=(n=t[r]._chart?t[r]._chart.config.data.datasets[a].hoverBorderWidth:0)>(i=e>i?e:i)?n:i;return i}})}},{25:25,40:40,45:45}],18:[function(t,e,n){"use strict";var i=t(25),a=t(40),o=t(45);i._set("line",{showLines:!0,spanGaps:!1,hover:{mode:"label"},scales:{xAxes:[{type:"category",id:"x-axis-0"}],yAxes:[{type:"linear",id:"y-axis-0"}]}}),e.exports=function(t){function e(t,e){return o.valueOrDefault(t.showLine,e.showLines)}t.controllers.line=t.DatasetController.extend({datasetElementType:a.Line,dataElementType:a.Point,update:function(t){var n,i,a,r=this,l=r.getMeta(),s=l.dataset,u=l.data||[],d=r.chart.options,c=d.elements.line,h=r.getScaleForId(l.yAxisID),f=r.getDataset(),g=e(f,d);for(g&&(a=s.custom||{},void 0!==f.tension&&void 0===f.lineTension&&(f.lineTension=f.tension),s._scale=h,s._datasetIndex=r.index,s._children=u,s._model={spanGaps:f.spanGaps?f.spanGaps:d.spanGaps,tension:a.tension?a.tension:o.valueOrDefault(f.lineTension,c.tension),backgroundColor:a.backgroundColor?a.backgroundColor:f.backgroundColor||c.backgroundColor,borderWidth:a.borderWidth?a.borderWidth:f.borderWidth||c.borderWidth,borderColor:a.borderColor?a.borderColor:f.borderColor||c.borderColor,borderCapStyle:a.borderCapStyle?a.borderCapStyle:f.borderCapStyle||c.borderCapStyle,borderDash:a.borderDash?a.borderDash:f.borderDash||c.borderDash,borderDashOffset:a.borderDashOffset?a.borderDashOffset:f.borderDashOffset||c.borderDashOffset,borderJoinStyle:a.borderJoinStyle?a.borderJoinStyle:f.borderJoinStyle||c.borderJoinStyle,fill:a.fill?a.fill:void 0!==f.fill?f.fill:c.fill,steppedLine:a.steppedLine?a.steppedLine:o.valueOrDefault(f.steppedLine,c.stepped),cubicInterpolationMode:a.cubicInterpolationMode?a.cubicInterpolationMode:o.valueOrDefault(f.cubicInterpolationMode,c.cubicInterpolationMode)},s.pivot()),n=0,i=u.length;n<i;++n)r.updateElement(u[n],n,t);for(g&&0!==s._model.tension&&r.updateBezierControlPoints(),n=0,i=u.length;n<i;++n)u[n].pivot()},getPointBackgroundColor:function(t,e){var n=this.chart.options.elements.point.backgroundColor,i=this.getDataset(),a=t.custom||{};return a.backgroundColor?n=a.backgroundColor:i.pointBackgroundColor?n=o.valueAtIndexOrDefault(i.pointBackgroundColor,e,n):i.backgroundColor&&(n=i.backgroundColor),n},getPointBorderColor:function(t,e){var n=this.chart.options.elements.point.borderColor,i=this.getDataset(),a=t.custom||{};return a.borderColor?n=a.borderColor:i.pointBorderColor?n=o.valueAtIndexOrDefault(i.pointBorderColor,e,n):i.borderColor&&(n=i.borderColor),n},getPointBorderWidth:function(t,e){var n=this.chart.options.elements.point.borderWidth,i=this.getDataset(),a=t.custom||{};return isNaN(a.borderWidth)?!isNaN(i.pointBorderWidth)||o.isArray(i.pointBorderWidth)?n=o.valueAtIndexOrDefault(i.pointBorderWidth,e,n):isNaN(i.borderWidth)||(n=i.borderWidth):n=a.borderWidth,n},updateElement:function(t,e,n){var i,a,r=this,l=r.getMeta(),s=t.custom||{},u=r.getDataset(),d=r.index,c=u.data[e],h=r.getScaleForId(l.yAxisID),f=r.getScaleForId(l.xAxisID),g=r.chart.options.elements.point;void 0!==u.radius&&void 0===u.pointRadius&&(u.pointRadius=u.radius),void 0!==u.hitRadius&&void 0===u.pointHitRadius&&(u.pointHitRadius=u.hitRadius),i=f.getPixelForValue("object"==typeof c?c:NaN,e,d),a=n?h.getBasePixel():r.calculatePointY(c,e,d),t._xScale=f,t._yScale=h,t._datasetIndex=d,t._index=e,t._model={x:i,y:a,skip:s.skip||isNaN(i)||isNaN(a),radius:s.radius||o.valueAtIndexOrDefault(u.pointRadius,e,g.radius),pointStyle:s.pointStyle||o.valueAtIndexOrDefault(u.pointStyle,e,g.pointStyle),backgroundColor:r.getPointBackgroundColor(t,e),borderColor:r.getPointBorderColor(t,e),borderWidth:r.getPointBorderWidth(t,e),tension:l.dataset._model?l.dataset._model.tension:0,steppedLine:!!l.dataset._model&&l.dataset._model.steppedLine,hitRadius:s.hitRadius||o.valueAtIndexOrDefault(u.pointHitRadius,e,g.hitRadius)}},calculatePointY:function(t,e,n){var i,a,o,r=this,l=r.chart,s=r.getMeta(),u=r.getScaleForId(s.yAxisID),d=0,c=0;if(u.options.stacked){for(i=0;i<n;i++)if(a=l.data.datasets[i],"line"===(o=l.getDatasetMeta(i)).type&&o.yAxisID===u.id&&l.isDatasetVisible(i)){var h=Number(u.getRightValue(a.data[e]));h<0?c+=h||0:d+=h||0}var f=Number(u.getRightValue(t));return f<0?u.getPixelForValue(c+f):u.getPixelForValue(d+f)}return u.getPixelForValue(t)},updateBezierControlPoints:function(){function t(t,e,n){return Math.max(Math.min(t,n),e)}var e,n,i,a,r=this,l=r.getMeta(),s=r.chart.chartArea,u=l.data||[];if(l.dataset._model.spanGaps&&(u=u.filter(function(t){return!t._model.skip})),"monotone"===l.dataset._model.cubicInterpolationMode)o.splineCurveMonotone(u);else for(e=0,n=u.length;e<n;++e)i=u[e]._model,a=o.splineCurve(o.previousItem(u,e)._model,i,o.nextItem(u,e)._model,l.dataset._model.tension),i.controlPointPreviousX=a.previous.x,i.controlPointPreviousY=a.previous.y,i.controlPointNextX=a.next.x,i.controlPointNextY=a.next.y;if(r.chart.options.elements.line.capBezierPoints)for(e=0,n=u.length;e<n;++e)(i=u[e]._model).controlPointPreviousX=t(i.controlPointPreviousX,s.left,s.right),i.controlPointPreviousY=t(i.controlPointPreviousY,s.top,s.bottom),i.controlPointNextX=t(i.controlPointNextX,s.left,s.right),i.controlPointNextY=t(i.controlPointNextY,s.top,s.bottom)},draw:function(){var t=this,n=t.chart,i=t.getMeta(),a=i.data||[],r=n.chartArea,l=a.length,s=0;for(o.canvas.clipArea(n.ctx,r),e(t.getDataset(),n.options)&&i.dataset.draw(),o.canvas.unclipArea(n.ctx);s<l;++s)a[s].draw(r)},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t._index,i=t.custom||{},a=t._model;a.radius=i.hoverRadius||o.valueAtIndexOrDefault(e.pointHoverRadius,n,this.chart.options.elements.point.hoverRadius),a.backgroundColor=i.hoverBackgroundColor||o.valueAtIndexOrDefault(e.pointHoverBackgroundColor,n,o.getHoverColor(a.backgroundColor)),a.borderColor=i.hoverBorderColor||o.valueAtIndexOrDefault(e.pointHoverBorderColor,n,o.getHoverColor(a.borderColor)),a.borderWidth=i.hoverBorderWidth||o.valueAtIndexOrDefault(e.pointHoverBorderWidth,n,a.borderWidth)},removeHoverStyle:function(t){var e=this,n=e.chart.data.datasets[t._datasetIndex],i=t._index,a=t.custom||{},r=t._model;void 0!==n.radius&&void 0===n.pointRadius&&(n.pointRadius=n.radius),r.radius=a.radius||o.valueAtIndexOrDefault(n.pointRadius,i,e.chart.options.elements.point.radius),r.backgroundColor=e.getPointBackgroundColor(t,i),r.borderColor=e.getPointBorderColor(t,i),r.borderWidth=e.getPointBorderWidth(t,i)}})}},{25:25,40:40,45:45}],19:[function(t,e,n){"use strict";var i=t(25),a=t(40),o=t(45);i._set("polarArea",{scale:{type:"radialLinear",angleLines:{display:!1},gridLines:{circular:!0},pointLabels:{display:!1},ticks:{beginAtZero:!0}},animation:{animateRotate:!0,animateScale:!0},startAngle:-.5*Math.PI,legendCallback:function(t){var e=[];e.push('<ul class="'+t.id+'-legend">');var n=t.data,i=n.datasets,a=n.labels;if(i.length)for(var o=0;o<i[0].data.length;++o)e.push('<li><span style="background-color:'+i[0].backgroundColor[o]+'"></span>'),a[o]&&e.push(a[o]),e.push("</li>");return e.push("</ul>"),e.join("")},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map(function(n,i){var a=t.getDatasetMeta(0),r=e.datasets[0],l=a.data[i].custom||{},s=o.valueAtIndexOrDefault,u=t.options.elements.arc;return{text:n,fillStyle:l.backgroundColor?l.backgroundColor:s(r.backgroundColor,i,u.backgroundColor),strokeStyle:l.borderColor?l.borderColor:s(r.borderColor,i,u.borderColor),lineWidth:l.borderWidth?l.borderWidth:s(r.borderWidth,i,u.borderWidth),hidden:isNaN(r.data[i])||a.data[i].hidden,index:i}}):[]}},onClick:function(t,e){var n,i,a,o=e.index,r=this.chart;for(n=0,i=(r.data.datasets||[]).length;n<i;++n)(a=r.getDatasetMeta(n)).data[o].hidden=!a.data[o].hidden;r.update()}},tooltips:{callbacks:{title:function(){return""},label:function(t,e){return e.labels[t.index]+": "+t.yLabel}}}}),e.exports=function(t){t.controllers.polarArea=t.DatasetController.extend({dataElementType:a.Arc,linkScales:o.noop,update:function(t){var e=this,n=e.chart,i=n.chartArea,a=e.getMeta(),r=n.options,l=r.elements.arc,s=Math.min(i.right-i.left,i.bottom-i.top);n.outerRadius=Math.max((s-l.borderWidth/2)/2,0),n.innerRadius=Math.max(r.cutoutPercentage?n.outerRadius/100*r.cutoutPercentage:1,0),n.radiusLength=(n.outerRadius-n.innerRadius)/n.getVisibleDatasetCount(),e.outerRadius=n.outerRadius-n.radiusLength*e.index,e.innerRadius=e.outerRadius-n.radiusLength,a.count=e.countVisibleElements(),o.each(a.data,function(n,i){e.updateElement(n,i,t)})},updateElement:function(t,e,n){for(var i=this,a=i.chart,r=i.getDataset(),l=a.options,s=l.animation,u=a.scale,d=a.data.labels,c=i.calculateCircumference(r.data[e]),h=u.xCenter,f=u.yCenter,g=0,p=i.getMeta(),v=0;v<e;++v)isNaN(r.data[v])||p.data[v].hidden||++g;var m=l.startAngle,b=t.hidden?0:u.getDistanceFromCenterForValue(r.data[e]),x=m+c*g,y=x+(t.hidden?0:c),k=s.animateScale?0:u.getDistanceFromCenterForValue(r.data[e]);o.extend(t,{_datasetIndex:i.index,_index:e,_scale:u,_model:{x:h,y:f,innerRadius:0,outerRadius:n?k:b,startAngle:n&&s.animateRotate?m:x,endAngle:n&&s.animateRotate?m:y,label:o.valueAtIndexOrDefault(d,e,d[e])}}),i.removeHoverStyle(t),t.pivot()},removeHoverStyle:function(e){t.DatasetController.prototype.removeHoverStyle.call(this,e,this.chart.options.elements.arc)},countVisibleElements:function(){var t=this.getDataset(),e=this.getMeta(),n=0;return o.each(e.data,function(e,i){isNaN(t.data[i])||e.hidden||n++}),n},calculateCircumference:function(t){var e=this.getMeta().count;return e>0&&!isNaN(t)?2*Math.PI/e:0}})}},{25:25,40:40,45:45}],20:[function(t,e,n){"use strict";var i=t(25),a=t(40),o=t(45);i._set("radar",{scale:{type:"radialLinear"},elements:{line:{tension:0}}}),e.exports=function(t){t.controllers.radar=t.DatasetController.extend({datasetElementType:a.Line,dataElementType:a.Point,linkScales:o.noop,update:function(t){var e=this,n=e.getMeta(),i=n.dataset,a=n.data,r=i.custom||{},l=e.getDataset(),s=e.chart.options.elements.line,u=e.chart.scale;void 0!==l.tension&&void 0===l.lineTension&&(l.lineTension=l.tension),o.extend(n.dataset,{_datasetIndex:e.index,_scale:u,_children:a,_loop:!0,_model:{tension:r.tension?r.tension:o.valueOrDefault(l.lineTension,s.tension),backgroundColor:r.backgroundColor?r.backgroundColor:l.backgroundColor||s.backgroundColor,borderWidth:r.borderWidth?r.borderWidth:l.borderWidth||s.borderWidth,borderColor:r.borderColor?r.borderColor:l.borderColor||s.borderColor,fill:r.fill?r.fill:void 0!==l.fill?l.fill:s.fill,borderCapStyle:r.borderCapStyle?r.borderCapStyle:l.borderCapStyle||s.borderCapStyle,borderDash:r.borderDash?r.borderDash:l.borderDash||s.borderDash,borderDashOffset:r.borderDashOffset?r.borderDashOffset:l.borderDashOffset||s.borderDashOffset,borderJoinStyle:r.borderJoinStyle?r.borderJoinStyle:l.borderJoinStyle||s.borderJoinStyle}}),n.dataset.pivot(),o.each(a,function(n,i){e.updateElement(n,i,t)},e),e.updateBezierControlPoints()},updateElement:function(t,e,n){var i=this,a=t.custom||{},r=i.getDataset(),l=i.chart.scale,s=i.chart.options.elements.point,u=l.getPointPositionForValue(e,r.data[e]);void 0!==r.radius&&void 0===r.pointRadius&&(r.pointRadius=r.radius),void 0!==r.hitRadius&&void 0===r.pointHitRadius&&(r.pointHitRadius=r.hitRadius),o.extend(t,{_datasetIndex:i.index,_index:e,_scale:l,_model:{x:n?l.xCenter:u.x,y:n?l.yCenter:u.y,tension:a.tension?a.tension:o.valueOrDefault(r.lineTension,i.chart.options.elements.line.tension),radius:a.radius?a.radius:o.valueAtIndexOrDefault(r.pointRadius,e,s.radius),backgroundColor:a.backgroundColor?a.backgroundColor:o.valueAtIndexOrDefault(r.pointBackgroundColor,e,s.backgroundColor),borderColor:a.borderColor?a.borderColor:o.valueAtIndexOrDefault(r.pointBorderColor,e,s.borderColor),borderWidth:a.borderWidth?a.borderWidth:o.valueAtIndexOrDefault(r.pointBorderWidth,e,s.borderWidth),pointStyle:a.pointStyle?a.pointStyle:o.valueAtIndexOrDefault(r.pointStyle,e,s.pointStyle),hitRadius:a.hitRadius?a.hitRadius:o.valueAtIndexOrDefault(r.pointHitRadius,e,s.hitRadius)}}),t._model.skip=a.skip?a.skip:isNaN(t._model.x)||isNaN(t._model.y)},updateBezierControlPoints:function(){var t=this.chart.chartArea,e=this.getMeta();o.each(e.data,function(n,i){var a=n._model,r=o.splineCurve(o.previousItem(e.data,i,!0)._model,a,o.nextItem(e.data,i,!0)._model,a.tension);a.controlPointPreviousX=Math.max(Math.min(r.previous.x,t.right),t.left),a.controlPointPreviousY=Math.max(Math.min(r.previous.y,t.bottom),t.top),a.controlPointNextX=Math.max(Math.min(r.next.x,t.right),t.left),a.controlPointNextY=Math.max(Math.min(r.next.y,t.bottom),t.top),n.pivot()})},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t.custom||{},i=t._index,a=t._model;a.radius=n.hoverRadius?n.hoverRadius:o.valueAtIndexOrDefault(e.pointHoverRadius,i,this.chart.options.elements.point.hoverRadius),a.backgroundColor=n.hoverBackgroundColor?n.hoverBackgroundColor:o.valueAtIndexOrDefault(e.pointHoverBackgroundColor,i,o.getHoverColor(a.backgroundColor)),a.borderColor=n.hoverBorderColor?n.hoverBorderColor:o.valueAtIndexOrDefault(e.pointHoverBorderColor,i,o.getHoverColor(a.borderColor)),a.borderWidth=n.hoverBorderWidth?n.hoverBorderWidth:o.valueAtIndexOrDefault(e.pointHoverBorderWidth,i,a.borderWidth)},removeHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t.custom||{},i=t._index,a=t._model,r=this.chart.options.elements.point;a.radius=n.radius?n.radius:o.valueAtIndexOrDefault(e.pointRadius,i,r.radius),a.backgroundColor=n.backgroundColor?n.backgroundColor:o.valueAtIndexOrDefault(e.pointBackgroundColor,i,r.backgroundColor),a.borderColor=n.borderColor?n.borderColor:o.valueAtIndexOrDefault(e.pointBorderColor,i,r.borderColor),a.borderWidth=n.borderWidth?n.borderWidth:o.valueAtIndexOrDefault(e.pointBorderWidth,i,r.borderWidth)}})}},{25:25,40:40,45:45}],21:[function(t,e,n){"use strict";t(25)._set("scatter",{hover:{mode:"single"},scales:{xAxes:[{id:"x-axis-1",type:"linear",position:"bottom"}],yAxes:[{id:"y-axis-1",type:"linear",position:"left"}]},showLines:!1,tooltips:{callbacks:{title:function(){return""},label:function(t){return"("+t.xLabel+", "+t.yLabel+")"}}}}),e.exports=function(t){t.controllers.scatter=t.controllers.line}},{25:25}],22:[function(t,e,n){"use strict";var i=t(25),a=t(26),o=t(45);i._set("global",{animation:{duration:1e3,easing:"easeOutQuart",onProgress:o.noop,onComplete:o.noop}}),e.exports=function(t){t.Animation=a.extend({chart:null,currentStep:0,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),t.animationService={frameDuration:17,animations:[],dropFrames:0,request:null,addAnimation:function(t,e,n,i){var a,o,r=this.animations;for(e.chart=t,i||(t.animating=!0),a=0,o=r.length;a<o;++a)if(r[a].chart===t)return void(r[a]=e);r.push(e),1===r.length&&this.requestAnimationFrame()},cancelAnimation:function(t){var e=o.findIndex(this.animations,function(e){return e.chart===t});-1!==e&&(this.animations.splice(e,1),t.animating=!1)},requestAnimationFrame:function(){var t=this;null===t.request&&(t.request=o.requestAnimFrame.call(window,function(){t.request=null,t.startDigest()}))},startDigest:function(){var t=this,e=Date.now(),n=0;t.dropFrames>1&&(n=Math.floor(t.dropFrames),t.dropFrames=t.dropFrames%1),t.advance(1+n);var i=Date.now();t.dropFrames+=(i-e)/t.frameDuration,t.animations.length>0&&t.requestAnimationFrame()},advance:function(t){for(var e,n,i=this.animations,a=0;a<i.length;)n=(e=i[a]).chart,e.currentStep=(e.currentStep||0)+t,e.currentStep=Math.min(e.currentStep,e.numSteps),o.callback(e.render,[n,e],n),o.callback(e.onAnimationProgress,[e],n),e.currentStep>=e.numSteps?(o.callback(e.onAnimationComplete,[e],n),n.animating=!1,i.splice(a,1)):++a}},Object.defineProperty(t.Animation.prototype,"animationObject",{get:function(){return this}}),Object.defineProperty(t.Animation.prototype,"chartInstance",{get:function(){return this.chart},set:function(t){this.chart=t}})}},{25:25,26:26,45:45}],23:[function(t,e,n){"use strict";var i=t(25),a=t(45),o=t(28),r=t(48);e.exports=function(t){function e(t){var e=(t=t||{}).data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=a.configMerge(i.global,i[t.type],t.options||{}),t}function n(t){var e=t.options;e.scale?t.scale.options=e.scale:e.scales&&e.scales.xAxes.concat(e.scales.yAxes).forEach(function(e){t.scales[e.id].options=e}),t.tooltip._options=e.tooltips}function l(t){return"top"===t||"bottom"===t}var s=t.plugins;t.types={},t.instances={},t.controllers={},a.extend(t.prototype,{construct:function(n,i){var o=this;i=e(i);var l=r.acquireContext(n,i),s=l&&l.canvas,u=s&&s.height,d=s&&s.width;o.id=a.uid(),o.ctx=l,o.canvas=s,o.config=i,o.width=d,o.height=u,o.aspectRatio=u?d/u:null,o.options=i.options,o._bufferedRender=!1,o.chart=o,o.controller=o,t.instances[o.id]=o,Object.defineProperty(o,"data",{get:function(){return o.config.data},set:function(t){o.config.data=t}}),l&&s?(o.initialize(),o.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return s.notify(t,"beforeInit"),a.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.ensureScalesHaveIDs(),t.buildScales(),t.initToolTip(),s.notify(t,"afterInit"),t},clear:function(){return a.canvas.clear(this),this},stop:function(){return t.animationService.cancelAnimation(this),this},resize:function(t){var e=this,n=e.options,i=e.canvas,o=n.maintainAspectRatio&&e.aspectRatio||null,r=Math.max(0,Math.floor(a.getMaximumWidth(i))),l=Math.max(0,Math.floor(o?r/o:a.getMaximumHeight(i)));if((e.width!==r||e.height!==l)&&(i.width=e.width=r,i.height=e.height=l,i.style.width=r+"px",i.style.height=l+"px",a.retinaScale(e,n.devicePixelRatio),!t)){var u={width:r,height:l};s.notify(e,"resize",[u]),e.options.onResize&&e.options.onResize(e,u),e.stop(),e.update(e.options.responsiveAnimationDuration)}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},n=t.scale;a.each(e.xAxes,function(t,e){t.id=t.id||"x-axis-"+e}),a.each(e.yAxes,function(t,e){t.id=t.id||"y-axis-"+e}),n&&(n.id=n.id||"scale")},buildScales:function(){var e=this,n=e.options,i=e.scales={},o=[];n.scales&&(o=o.concat((n.scales.xAxes||[]).map(function(t){return{options:t,dtype:"category",dposition:"bottom"}}),(n.scales.yAxes||[]).map(function(t){return{options:t,dtype:"linear",dposition:"left"}}))),n.scale&&o.push({options:n.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),a.each(o,function(n){var o=n.options,r=a.valueOrDefault(o.type,n.dtype),s=t.scaleService.getScaleConstructor(r);if(s){l(o.position)!==l(n.dposition)&&(o.position=n.dposition);var u=new s({id:o.id,options:o,ctx:e.ctx,chart:e});i[u.id]=u,u.mergeTicksOptions(),n.isDefault&&(e.scale=u)}}),t.scaleService.addScalesToLayout(this)},buildOrUpdateControllers:function(){var e=this,n=[],i=[];return a.each(e.data.datasets,function(a,o){var r=e.getDatasetMeta(o),l=a.type||e.config.type;if(r.type&&r.type!==l&&(e.destroyDatasetMeta(o),r=e.getDatasetMeta(o)),r.type=l,n.push(r.type),r.controller)r.controller.updateIndex(o);else{var s=t.controllers[r.type];if(void 0===s)throw new Error('"'+r.type+'" is not a chart type.');r.controller=new s(e,o),i.push(r.controller)}},e),i},resetElements:function(){var t=this;a.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]}),n(e),!1!==s.notify(e,"beforeUpdate")){e.tooltip._data=e.data;var i=e.buildOrUpdateControllers();a.each(e.data.datasets,function(t,n){e.getDatasetMeta(n).controller.buildOrUpdateElements()},e),e.updateLayout(),a.each(i,function(t){t.reset()}),e.updateDatasets(),e.tooltip.initialize(),e.lastActive=[],s.notify(e,"afterUpdate"),e._bufferedRender?e._bufferedRequest={duration:t.duration,easing:t.easing,lazy:t.lazy}:e.render(t)}},updateLayout:function(){var e=this;!1!==s.notify(e,"beforeLayout")&&(t.layoutService.update(this,this.width,this.height),s.notify(e,"afterScaleUpdate"),s.notify(e,"afterLayout"))},updateDatasets:function(){var t=this;if(!1!==s.notify(t,"beforeDatasetsUpdate")){for(var e=0,n=t.data.datasets.length;e<n;++e)t.updateDataset(e);s.notify(t,"afterDatasetsUpdate")}},updateDataset:function(t){var e=this,n=e.getDatasetMeta(t),i={meta:n,index:t};!1!==s.notify(e,"beforeDatasetUpdate",[i])&&(n.controller.update(),s.notify(e,"afterDatasetUpdate",[i]))},render:function(e){var n=this;e&&"object"==typeof e||(e={duration:e,lazy:arguments[1]});var i=e.duration,o=e.lazy;if(!1!==s.notify(n,"beforeRender")){var r=n.options.animation,l=function(t){s.notify(n,"afterRender"),a.callback(r&&r.onComplete,[t],n)};if(r&&(void 0!==i&&0!==i||void 0===i&&0!==r.duration)){var u=new t.Animation({numSteps:(i||r.duration)/16.66,easing:e.easing||r.easing,render:function(t,e){var n=a.easing.effects[e.easing],i=e.currentStep,o=i/e.numSteps;t.draw(n(o),o,i)},onAnimationProgress:r.onProgress,onAnimationComplete:l});t.animationService.addAnimation(n,u,i,o)}else n.draw(),l(new t.Animation({numSteps:0,chart:n}));return n}},draw:function(t){var e=this;e.clear(),a.isNullOrUndef(t)&&(t=1),e.transition(t),!1!==s.notify(e,"beforeDraw",[t])&&(a.each(e.boxes,function(t){t.draw(e.chartArea)},e),e.scale&&e.scale.draw(),e.drawDatasets(t),e._drawTooltip(t),s.notify(e,"afterDraw",[t]))},transition:function(t){for(var e=this,n=0,i=(e.data.datasets||[]).length;n<i;++n)e.isDatasetVisible(n)&&e.getDatasetMeta(n).controller.transition(t);e.tooltip.transition(t)},drawDatasets:function(t){var e=this;if(!1!==s.notify(e,"beforeDatasetsDraw",[t])){for(var n=(e.data.datasets||[]).length-1;n>=0;--n)e.isDatasetVisible(n)&&e.drawDataset(n,t);s.notify(e,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var n=this,i=n.getDatasetMeta(t),a={meta:i,index:t,easingValue:e};!1!==s.notify(n,"beforeDatasetDraw",[a])&&(i.controller.draw(e),s.notify(n,"afterDatasetDraw",[a]))},_drawTooltip:function(t){var e=this,n=e.tooltip,i={tooltip:n,easingValue:t};!1!==s.notify(e,"beforeTooltipDraw",[i])&&(n.draw(),s.notify(e,"afterTooltipDraw",[i]))},getElementAtEvent:function(t){return o.modes.single(this,t)},getElementsAtEvent:function(t){return o.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return o.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,n){var i=o.modes[e];return"function"==typeof i?i(this,t,n):[]},getDatasetAtEvent:function(t){return o.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this,n=e.data.datasets[t];n._meta||(n._meta={});var i=n._meta[e.id];return i||(i=n._meta[e.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null}),i},getVisibleDatasetCount:function(){for(var t=0,e=0,n=this.data.datasets.length;e<n;++e)this.isDatasetVisible(e)&&t++;return t},isDatasetVisible:function(t){var e=this.getDatasetMeta(t);return"boolean"==typeof e.hidden?!e.hidden:!this.data.datasets[t].hidden},generateLegend:function(){return this.options.legendCallback(this)},destroyDatasetMeta:function(t){var e=this.id,n=this.data.datasets[t],i=n._meta&&n._meta[e];i&&(i.controller.destroy(),delete n._meta[e])},destroy:function(){var e,n,i=this,o=i.canvas;for(i.stop(),e=0,n=i.data.datasets.length;e<n;++e)i.destroyDatasetMeta(e);o&&(i.unbindEvents(),a.canvas.clear(i),r.releaseContext(i.ctx),i.canvas=null,i.ctx=null),s.notify(i,"destroy"),delete t.instances[i.id]},toBase64Image:function(){return this.canvas.toDataURL.apply(this.canvas,arguments)},initToolTip:function(){var e=this;e.tooltip=new t.Tooltip({_chart:e,_chartInstance:e,_data:e.data,_options:e.options.tooltips},e)},bindEvents:function(){var t=this,e=t._listeners={},n=function(){t.eventHandler.apply(t,arguments)};a.each(t.options.events,function(i){r.addEventListener(t,i,n),e[i]=n}),t.options.responsive&&(n=function(){t.resize()},r.addEventListener(t,"resize",n),e.resize=n)},unbindEvents:function(){var t=this,e=t._listeners;e&&(delete t._listeners,a.each(e,function(e,n){r.removeEventListener(t,n,e)}))},updateHoverStyle:function(t,e,n){var i,a,o,r=n?"setHoverStyle":"removeHoverStyle";for(a=0,o=t.length;a<o;++a)(i=t[a])&&this.getDatasetMeta(i._datasetIndex).controller[r](i)},eventHandler:function(t){var e=this,n=e.tooltip;if(!1!==s.notify(e,"beforeEvent",[t])){e._bufferedRender=!0,e._bufferedRequest=null;var i=e.handleEvent(t);i|=n&&n.handleEvent(t),s.notify(e,"afterEvent",[t]);var a=e._bufferedRequest;return a?e.render(a):i&&!e.animating&&(e.stop(),e.render(e.options.hover.animationDuration,!0)),e._bufferedRender=!1,e._bufferedRequest=null,e}},handleEvent:function(t){var e=this,n=e.options||{},i=n.hover,o=!1;return e.lastActive=e.lastActive||[],"mouseout"===t.type?e.active=[]:e.active=e.getElementsAtEventForMode(t,i.mode,i),a.callback(n.onHover||n.hover.onHover,[t.native,e.active],e),"mouseup"!==t.type&&"click"!==t.type||n.onClick&&n.onClick.call(e,t.native,e.active),e.lastActive.length&&e.updateHoverStyle(e.lastActive,i.mode,!1),e.active.length&&i.mode&&e.updateHoverStyle(e.active,i.mode,!0),o=!a.arrayEquals(e.active,e.lastActive),e.lastActive=e.active,o}}),t.Controller=t}},{25:25,28:28,45:45,48:48}],24:[function(t,e,n){"use strict";var i=t(45);e.exports=function(t){function e(t,e){t._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),a.forEach(function(e){var n="onData"+e.charAt(0).toUpperCase()+e.slice(1),a=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:function(){var e=Array.prototype.slice.call(arguments),o=a.apply(this,e);return i.each(t._chartjs.listeners,function(t){"function"==typeof t[n]&&t[n].apply(t,e)}),o}})}))}function n(t,e){var n=t._chartjs;if(n){var i=n.listeners,o=i.indexOf(e);-1!==o&&i.splice(o,1),i.length>0||(a.forEach(function(e){delete t[e]}),delete t._chartjs)}}var a=["push","pop","shift","splice","unshift"];t.DatasetController=function(t,e){this.initialize(t,e)},i.extend(t.DatasetController.prototype,{datasetElementType:null,dataElementType:null,initialize:function(t,e){var n=this;n.chart=t,n.index=e,n.linkScales(),n.addElements()},updateIndex:function(t){this.index=t},linkScales:function(){var t=this,e=t.getMeta(),n=t.getDataset();null===e.xAxisID&&(e.xAxisID=n.xAxisID||t.chart.options.scales.xAxes[0].id),null===e.yAxisID&&(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]},reset:function(){this.update(!0)},destroy:function(){this._data&&n(this._data,this)},createMetaDataset:function(){var t=this,e=t.datasetElementType;return e&&new e({_chart:t.chart,_datasetIndex:t.index})},createMetaData:function(t){var e=this,n=e.dataElementType;return n&&new n({_chart:e.chart,_datasetIndex:e.index,_index:t})},addElements:function(){var t,e,n=this,i=n.getMeta(),a=n.getDataset().data||[],o=i.data;for(t=0,e=a.length;t<e;++t)o[t]=o[t]||n.createMetaData(t);i.dataset=i.dataset||n.createMetaDataset()},addElementAndReset:function(t){var e=this.createMetaData(t);this.getMeta().data.splice(t,0,e),this.updateElement(e,t,!0)},buildOrUpdateElements:function(){var t=this,i=t.getDataset(),a=i.data||(i.data=[]);t._data!==a&&(t._data&&n(t._data,t),e(a,t),t._data=a),t.resyncElements()},update:i.noop,transition:function(t){for(var e=this.getMeta(),n=e.data||[],i=n.length,a=0;a<i;++a)n[a].transition(t);e.dataset&&e.dataset.transition(t)},draw:function(){var t=this.getMeta(),e=t.data||[],n=e.length,i=0;for(t.dataset&&t.dataset.draw();i<n;++i)e[i].draw()},removeHoverStyle:function(t,e){var n=this.chart.data.datasets[t._datasetIndex],a=t._index,o=t.custom||{},r=i.valueAtIndexOrDefault,l=t._model;l.backgroundColor=o.backgroundColor?o.backgroundColor:r(n.backgroundColor,a,e.backgroundColor),l.borderColor=o.borderColor?o.borderColor:r(n.borderColor,a,e.borderColor),l.borderWidth=o.borderWidth?o.borderWidth:r(n.borderWidth,a,e.borderWidth)},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t._index,a=t.custom||{},o=i.valueAtIndexOrDefault,r=i.getHoverColor,l=t._model;l.backgroundColor=a.hoverBackgroundColor?a.hoverBackgroundColor:o(e.hoverBackgroundColor,n,r(l.backgroundColor)),l.borderColor=a.hoverBorderColor?a.hoverBorderColor:o(e.hoverBorderColor,n,r(l.borderColor)),l.borderWidth=a.hoverBorderWidth?a.hoverBorderWidth:o(e.hoverBorderWidth,n,l.borderWidth)},resyncElements:function(){var t=this,e=t.getMeta(),n=t.getDataset().data,i=e.data.length,a=n.length;a<i?e.data.splice(a,i-a):a>i&&t.insertElements(i,a-i)},insertElements:function(t,e){for(var n=0;n<e;++n)this.addElementAndReset(t+n)},onDataPush:function(){this.insertElements(this.getDataset().data.length-1,arguments.length)},onDataPop:function(){this.getMeta().data.pop()},onDataShift:function(){this.getMeta().data.shift()},onDataSplice:function(t,e){this.getMeta().data.splice(t,e),this.insertElements(t,arguments.length-2)},onDataUnshift:function(){this.insertElements(0,arguments.length)}}),t.DatasetController.extend=i.inherits}},{45:45}],25:[function(t,e,n){"use strict";var i=t(45);e.exports={_set:function(t,e){return i.merge(this[t]||(this[t]={}),e)}}},{45:45}],26:[function(t,e,n){"use strict";function i(t,e,n,i){var o,r,l,s,u,d,c,h,f,g=Object.keys(n);for(o=0,r=g.length;o<r;++o)if(l=g[o],d=n[l],e.hasOwnProperty(l)||(e[l]=d),(s=e[l])!==d&&"_"!==l[0]){if(t.hasOwnProperty(l)||(t[l]=s),u=t[l],(c=typeof d)===typeof u)if("string"===c){if((h=a(u)).valid&&(f=a(d)).valid){e[l]=f.mix(h,i).rgbString();continue}}else if("number"===c&&isFinite(u)&&isFinite(d)){e[l]=u+(d-u)*i;continue}e[l]=d}}var a=t(3),o=t(45),r=function(t){o.extend(this,t),this.initialize.apply(this,arguments)};o.extend(r.prototype,{initialize:function(){this.hidden=!1},pivot:function(){var t=this;return t._view||(t._view=o.clone(t._model)),t._start={},t},transition:function(t){var e=this,n=e._model,a=e._start,o=e._view;return n&&1!==t?(o||(o=e._view={}),a||(a=e._start={}),i(a,o,n,t),e):(e._view=n,e._start=null,e)},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return o.isNumber(this._model.x)&&o.isNumber(this._model.y)}}),r.extend=o.inherits,e.exports=r},{3:3,45:45}],27:[function(t,e,n){"use strict";var i=t(3),a=t(25),o=t(45);e.exports=function(t){function e(t,e,n){var i;return"string"==typeof t?(i=parseInt(t,10),-1!==t.indexOf("%")&&(i=i/100*e.parentNode[n])):i=t,i}function n(t){return void 0!==t&&null!==t&&"none"!==t}function r(t,i,a){var o=document.defaultView,r=t.parentNode,l=o.getComputedStyle(t)[i],s=o.getComputedStyle(r)[i],u=n(l),d=n(s),c=Number.POSITIVE_INFINITY;return u||d?Math.min(u?e(l,t,a):c,d?e(s,r,a):c):"none"}o.configMerge=function(){return o.merge(o.clone(arguments[0]),[].slice.call(arguments,1),{merger:function(e,n,i,a){var r=n[e]||{},l=i[e];"scales"===e?n[e]=o.scaleMerge(r,l):"scale"===e?n[e]=o.merge(r,[t.scaleService.getScaleDefaults(l.type),l]):o._merger(e,n,i,a)}})},o.scaleMerge=function(){return o.merge(o.clone(arguments[0]),[].slice.call(arguments,1),{merger:function(e,n,i,a){if("xAxes"===e||"yAxes"===e){var r,l,s,u=i[e].length;for(n[e]||(n[e]=[]),r=0;r<u;++r)s=i[e][r],l=o.valueOrDefault(s.type,"xAxes"===e?"category":"linear"),r>=n[e].length&&n[e].push({}),!n[e][r].type||s.type&&s.type!==n[e][r].type?o.merge(n[e][r],[t.scaleService.getScaleDefaults(l),s]):o.merge(n[e][r],s)}else o._merger(e,n,i,a)}})},o.where=function(t,e){if(o.isArray(t)&&Array.prototype.filter)return t.filter(e);var n=[];return o.each(t,function(t){e(t)&&n.push(t)}),n},o.findIndex=Array.prototype.findIndex?function(t,e,n){return t.findIndex(e,n)}:function(t,e,n){n=void 0===n?t:n;for(var i=0,a=t.length;i<a;++i)if(e.call(n,t[i],i,t))return i;return-1},o.findNextWhere=function(t,e,n){o.isNullOrUndef(n)&&(n=-1);for(var i=n+1;i<t.length;i++){var a=t[i];if(e(a))return a}},o.findPreviousWhere=function(t,e,n){o.isNullOrUndef(n)&&(n=t.length);for(var i=n-1;i>=0;i--){var a=t[i];if(e(a))return a}},o.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},o.almostEquals=function(t,e,n){return Math.abs(t-e)<n},o.almostWhole=function(t,e){var n=Math.round(t);return n-e<t&&n+e>t},o.max=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.max(t,e)},Number.NEGATIVE_INFINITY)},o.min=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.min(t,e)},Number.POSITIVE_INFINITY)},o.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return 0==(t=+t)||isNaN(t)?t:t>0?1:-1},o.log10=Math.log10?function(t){return Math.log10(t)}:function(t){return Math.log(t)/Math.LN10},o.toRadians=function(t){return t*(Math.PI/180)},o.toDegrees=function(t){return t*(180/Math.PI)},o.getAngleFromPoint=function(t,e){var n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),o=Math.atan2(i,n);return o<-.5*Math.PI&&(o+=2*Math.PI),{angle:o,distance:a}},o.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},o.aliasPixel=function(t){return t%2==0?0:.5},o.splineCurve=function(t,e,n,i){var a=t.skip?e:t,o=e,r=n.skip?e:n,l=Math.sqrt(Math.pow(o.x-a.x,2)+Math.pow(o.y-a.y,2)),s=Math.sqrt(Math.pow(r.x-o.x,2)+Math.pow(r.y-o.y,2)),u=l/(l+s),d=s/(l+s),c=i*(u=isNaN(u)?0:u),h=i*(d=isNaN(d)?0:d);return{previous:{x:o.x-c*(r.x-a.x),y:o.y-c*(r.y-a.y)},next:{x:o.x+h*(r.x-a.x),y:o.y+h*(r.y-a.y)}}},o.EPSILON=Number.EPSILON||1e-14,o.splineCurveMonotone=function(t){var e,n,i,a,r=(t||[]).map(function(t){return{model:t._model,deltaK:0,mK:0}}),l=r.length;for(e=0;e<l;++e)if(!(i=r[e]).model.skip){if(n=e>0?r[e-1]:null,(a=e<l-1?r[e+1]:null)&&!a.model.skip){var s=a.model.x-i.model.x;i.deltaK=0!==s?(a.model.y-i.model.y)/s:0}!n||n.model.skip?i.mK=i.deltaK:!a||a.model.skip?i.mK=n.deltaK:this.sign(n.deltaK)!==this.sign(i.deltaK)?i.mK=0:i.mK=(n.deltaK+i.deltaK)/2}var u,d,c,h;for(e=0;e<l-1;++e)i=r[e],a=r[e+1],i.model.skip||a.model.skip||(o.almostEquals(i.deltaK,0,this.EPSILON)?i.mK=a.mK=0:(u=i.mK/i.deltaK,d=a.mK/i.deltaK,(h=Math.pow(u,2)+Math.pow(d,2))<=9||(c=3/Math.sqrt(h),i.mK=u*c*i.deltaK,a.mK=d*c*i.deltaK)));var f;for(e=0;e<l;++e)(i=r[e]).model.skip||(n=e>0?r[e-1]:null,a=e<l-1?r[e+1]:null,n&&!n.model.skip&&(f=(i.model.x-n.model.x)/3,i.model.controlPointPreviousX=i.model.x-f,i.model.controlPointPreviousY=i.model.y-f*i.mK),a&&!a.model.skip&&(f=(a.model.x-i.model.x)/3,i.model.controlPointNextX=i.model.x+f,i.model.controlPointNextY=i.model.y+f*i.mK))},o.nextItem=function(t,e,n){return n?e>=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},o.previousItem=function(t,e,n){return n?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},o.niceNum=function(t,e){var n=Math.floor(o.log10(t)),i=t/Math.pow(10,n);return(e?i<1.5?1:i<3?2:i<7?5:10:i<=1?1:i<=2?2:i<=5?5:10)*Math.pow(10,n)},o.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)},o.getRelativePosition=function(t,e){var n,i,a=t.originalEvent||t,r=t.currentTarget||t.srcElement,l=r.getBoundingClientRect(),s=a.touches;s&&s.length>0?(n=s[0].clientX,i=s[0].clientY):(n=a.clientX,i=a.clientY);var u=parseFloat(o.getStyle(r,"padding-left")),d=parseFloat(o.getStyle(r,"padding-top")),c=parseFloat(o.getStyle(r,"padding-right")),h=parseFloat(o.getStyle(r,"padding-bottom")),f=l.right-l.left-u-c,g=l.bottom-l.top-d-h;return n=Math.round((n-l.left-u)/f*r.width/e.currentDevicePixelRatio),i=Math.round((i-l.top-d)/g*r.height/e.currentDevicePixelRatio),{x:n,y:i}},o.getConstraintWidth=function(t){return r(t,"max-width","clientWidth")},o.getConstraintHeight=function(t){return r(t,"max-height","clientHeight")},o.getMaximumWidth=function(t){var e=t.parentNode;if(!e)return t.clientWidth;var n=parseInt(o.getStyle(e,"padding-left"),10),i=parseInt(o.getStyle(e,"padding-right"),10),a=e.clientWidth-n-i,r=o.getConstraintWidth(t);return isNaN(r)?a:Math.min(a,r)},o.getMaximumHeight=function(t){var e=t.parentNode;if(!e)return t.clientHeight;var n=parseInt(o.getStyle(e,"padding-top"),10),i=parseInt(o.getStyle(e,"padding-bottom"),10),a=e.clientHeight-n-i,r=o.getConstraintHeight(t);return isNaN(r)?a:Math.min(a,r)},o.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},o.retinaScale=function(t,e){var n=t.currentDevicePixelRatio=e||window.devicePixelRatio||1;if(1!==n){var i=t.canvas,a=t.height,o=t.width;i.height=a*n,i.width=o*n,t.ctx.scale(n,n),i.style.height=a+"px",i.style.width=o+"px"}},o.fontString=function(t,e,n){return e+" "+t+"px "+n},o.longestText=function(t,e,n,i){var a=(i=i||{}).data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(a=i.data={},r=i.garbageCollect=[],i.font=e),t.font=e;var l=0;o.each(n,function(e){void 0!==e&&null!==e&&!0!==o.isArray(e)?l=o.measureText(t,a,r,l,e):o.isArray(e)&&o.each(e,function(e){void 0===e||null===e||o.isArray(e)||(l=o.measureText(t,a,r,l,e))})});var s=r.length/2;if(s>n.length){for(var u=0;u<s;u++)delete a[r[u]];r.splice(0,s)}return l},o.measureText=function(t,e,n,i,a){var o=e[a];return o||(o=e[a]=t.measureText(a).width,n.push(a)),o>i&&(i=o),i},o.numberOfLabelLines=function(t){var e=1;return o.each(t,function(t){o.isArray(t)&&t.length>e&&(e=t.length)}),e},o.color=i?function(t){return t instanceof CanvasGradient&&(t=a.global.defaultColor),i(t)}:function(t){return console.error("Color.js not found!"),t},o.getHoverColor=function(t){return t instanceof CanvasPattern?t:o.color(t).saturate(.5).darken(.1).rgbString()}}},{25:25,3:3,45:45}],28:[function(t,e,n){"use strict";function i(t,e){return t.native?{x:t.x,y:t.y}:u.getRelativePosition(t,e)}function a(t,e){var n,i,a,o,r;for(i=0,o=t.data.datasets.length;i<o;++i)if(t.isDatasetVisible(i))for(a=0,r=(n=t.getDatasetMeta(i)).data.length;a<r;++a){var l=n.data[a];l._view.skip||e(l)}}function o(t,e){var n=[];return a(t,function(t){t.inRange(e.x,e.y)&&n.push(t)}),n}function r(t,e,n,i){var o=Number.POSITIVE_INFINITY,r=[];return a(t,function(t){if(!n||t.inRange(e.x,e.y)){var a=t.getCenterPoint(),l=i(e,a);l<o?(r=[t],o=l):l===o&&r.push(t)}}),r}function l(t){var e=-1!==t.indexOf("x"),n=-1!==t.indexOf("y");return function(t,i){var a=e?Math.abs(t.x-i.x):0,o=n?Math.abs(t.y-i.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(o,2))}}function s(t,e,n){var a=i(e,t);n.axis=n.axis||"x";var s=l(n.axis),u=n.intersect?o(t,a):r(t,a,!1,s),d=[];return u.length?(t.data.datasets.forEach(function(e,n){if(t.isDatasetVisible(n)){var i=t.getDatasetMeta(n).data[u[0]._index];i&&!i._view.skip&&d.push(i)}}),d):[]}var u=t(45);e.exports={modes:{single:function(t,e){var n=i(e,t),o=[];return a(t,function(t){if(t.inRange(n.x,n.y))return o.push(t),o}),o.slice(0,1)},label:s,index:s,dataset:function(t,e,n){var a=i(e,t);n.axis=n.axis||"xy";var s=l(n.axis),u=n.intersect?o(t,a):r(t,a,!1,s);return u.length>0&&(u=t.getDatasetMeta(u[0]._datasetIndex).data),u},"x-axis":function(t,e){return s(t,e,{intersect:!1})},point:function(t,e){return o(t,i(e,t))},nearest:function(t,e,n){var a=i(e,t);n.axis=n.axis||"xy";var o=l(n.axis),s=r(t,a,n.intersect,o);return s.length>1&&s.sort(function(t,e){var n=t.getArea()-e.getArea();return 0===n&&(n=t._datasetIndex-e._datasetIndex),n}),s.slice(0,1)},x:function(t,e,n){var o=i(e,t),r=[],l=!1;return a(t,function(t){t.inXRange(o.x)&&r.push(t),t.inRange(o.x,o.y)&&(l=!0)}),n.intersect&&!l&&(r=[]),r},y:function(t,e,n){var o=i(e,t),r=[],l=!1;return a(t,function(t){t.inYRange(o.y)&&r.push(t),t.inRange(o.x,o.y)&&(l=!0)}),n.intersect&&!l&&(r=[]),r}}}},{45:45}],29:[function(t,e,n){"use strict";t(25)._set("global",{responsive:!0,responsiveAnimationDuration:0,maintainAspectRatio:!0,events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,defaultColor:"rgba(0,0,0,0.1)",defaultFontColor:"#666",defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFontStyle:"normal",showLines:!0,elements:{},layout:{padding:{top:0,right:0,bottom:0,left:0}}}),e.exports=function(){var t=function(t,e){return this.construct(t,e),this};return t.Chart=t,t}},{25:25}],30:[function(t,e,n){"use strict";var i=t(45);e.exports=function(t){function e(t,e){return i.where(t,function(t){return t.position===e})}function n(t,e){t.forEach(function(t,e){return t._tmpIndex_=e,t}),t.sort(function(t,n){var i=e?n:t,a=e?t:n;return i.weight===a.weight?i._tmpIndex_-a._tmpIndex_:i.weight-a.weight}),t.forEach(function(t){delete t._tmpIndex_})}t.layoutService={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 i,a=["fullWidth","position","weight"],o=a.length,r=0;r<o;++r)i=a[r],n.hasOwnProperty(i)&&(e[i]=n[i])},update:function(t,a,o){function r(t){var e=i.findNextWhere(_,function(e){return e.box===t});if(e)if(t.isHorizontal()){var n={left:Math.max(T,D),right:Math.max(F,I),top:0,bottom:0};t.update(t.fullWidth?x:S,y/2,n)}else t.update(e.minSize.width,C)}function l(t){t.isHorizontal()?(t.left=t.fullWidth?d:T,t.right=t.fullWidth?a-c:T+S,t.top=V,t.bottom=V+t.height,V=t.bottom):(t.left=N,t.right=N+t.width,t.top=O,t.bottom=O+C,N=t.right)}if(t){var s=t.options.layout||{},u=i.options.toPadding(s.padding),d=u.left,c=u.right,h=u.top,f=u.bottom,g=e(t.boxes,"left"),p=e(t.boxes,"right"),v=e(t.boxes,"top"),m=e(t.boxes,"bottom"),b=e(t.boxes,"chartArea");n(g,!0),n(p,!1),n(v,!0),n(m,!1);var x=a-d-c,y=o-h-f,k=y/2,w=(a-x/2)/(g.length+p.length),M=(o-k)/(v.length+m.length),S=x,C=y,_=[];i.each(g.concat(p,v,m),function(t){var e,n=t.isHorizontal();n?(e=t.update(t.fullWidth?x:S,M),C-=e.height):(e=t.update(w,k),S-=e.width),_.push({horizontal:n,minSize:e,box:t})});var D=0,I=0,P=0,A=0;i.each(v.concat(m),function(t){if(t.getPadding){var e=t.getPadding();D=Math.max(D,e.left),I=Math.max(I,e.right)}}),i.each(g.concat(p),function(t){if(t.getPadding){var e=t.getPadding();P=Math.max(P,e.top),A=Math.max(A,e.bottom)}});var T=d,F=c,O=h,R=f;i.each(g.concat(p),r),i.each(g,function(t){T+=t.width}),i.each(p,function(t){F+=t.width}),i.each(v.concat(m),r),i.each(v,function(t){O+=t.height}),i.each(m,function(t){R+=t.height}),i.each(g.concat(p),function(t){var e=i.findNextWhere(_,function(e){return e.box===t}),n={left:0,right:0,top:O,bottom:R};e&&t.update(e.minSize.width,C,n)}),T=d,F=c,O=h,R=f,i.each(g,function(t){T+=t.width}),i.each(p,function(t){F+=t.width}),i.each(v,function(t){O+=t.height}),i.each(m,function(t){R+=t.height});var L=Math.max(D-T,0);T+=L,F+=Math.max(I-F,0);var z=Math.max(P-O,0);O+=z,R+=Math.max(A-R,0);var B=o-O-R,W=a-T-F;W===S&&B===C||(i.each(g,function(t){t.height=B}),i.each(p,function(t){t.height=B}),i.each(v,function(t){t.fullWidth||(t.width=W)}),i.each(m,function(t){t.fullWidth||(t.width=W)}),C=B,S=W);var N=d+L,V=h+z;i.each(g.concat(v),l),N+=S,V+=C,i.each(p,l),i.each(m,l),t.chartArea={left:T,top:O,right:T+S,bottom:O+C},i.each(b,function(e){e.left=t.chartArea.left,e.top=t.chartArea.top,e.right=t.chartArea.right,e.bottom=t.chartArea.bottom,e.update(S,C)})}}}}},{45:45}],31:[function(t,e,n){"use strict";var i=t(25),a=t(26),o=t(45);i._set("global",{plugins:{}}),e.exports=function(t){t.plugins={_plugins:[],_cacheId:0,register:function(t){var e=this._plugins;[].concat(t).forEach(function(t){-1===e.indexOf(t)&&e.push(t)}),this._cacheId++},unregister:function(t){var e=this._plugins;[].concat(t).forEach(function(t){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}),this._cacheId++},clear:function(){this._plugins=[],this._cacheId++},count:function(){return this._plugins.length},getAll:function(){return this._plugins},notify:function(t,e,n){var i,a,o,r,l,s=this.descriptors(t),u=s.length;for(i=0;i<u;++i)if(a=s[i],o=a.plugin,"function"==typeof(l=o[e])&&((r=[t].concat(n||[])).push(a.options),!1===l.apply(o,r)))return!1;return!0},descriptors:function(t){var e=t._plugins||(t._plugins={});if(e.id===this._cacheId)return e.descriptors;var n=[],a=[],r=t&&t.config||{},l=r.options&&r.options.plugins||{};return this._plugins.concat(r.plugins||[]).forEach(function(t){if(-1===n.indexOf(t)){var e=t.id,r=l[e];!1!==r&&(!0===r&&(r=o.clone(i.global.plugins[e])),n.push(t),a.push({plugin:t,options:r||{}}))}}),e.descriptors=a,e.id=this._cacheId,a}},t.pluginService=t.plugins,t.PluginBase=a.extend({})}},{25:25,26:26,45:45}],32:[function(t,e,n){"use strict";function i(t){var e,n,i=[];for(e=0,n=t.length;e<n;++e)i.push(t[e].label);return i}function a(t,e,n){var i=t.getPixelForTick(e);return n&&(i-=0===e?(t.getPixelForTick(1)-i)/2:(i-t.getPixelForTick(e-1))/2),i}var o=t(25),r=t(26),l=t(45),s=t(34);o._set("scale",{display:!0,position:"left",offset:!1,gridLines:{display:!0,color:"rgba(0, 0, 0, 0.1)",lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickMarkLength:10,zeroLineWidth:1,zeroLineColor:"rgba(0,0,0,0.25)",zeroLineBorderDash:[],zeroLineBorderDashOffset:0,offsetGridLines:!1,borderDash:[],borderDashOffset:0},scaleLabel:{display:!1,labelString:"",lineHeight:1.2,padding:{top:4,bottom:4}},ticks:{beginAtZero:!1,minRotation:0,maxRotation:50,mirror:!1,padding:0,reverse:!1,display:!0,autoSkip:!0,autoSkipPadding:0,labelOffset:0,callback:s.formatters.values,minor:{},major:{}}}),e.exports=function(t){function e(t,e,n){return l.isArray(e)?l.longestText(t,n,e):t.measureText(e).width}function n(t){var e=l.valueOrDefault,n=o.global,i=e(t.fontSize,n.defaultFontSize),a=e(t.fontStyle,n.defaultFontStyle),r=e(t.fontFamily,n.defaultFontFamily);return{size:i,style:a,family:r,font:l.fontString(i,a,r)}}function s(t){return l.options.toLineHeight(l.valueOrDefault(t.lineHeight,1.2),l.valueOrDefault(t.fontSize,o.global.defaultFontSize))}t.Scale=r.extend({getPadding:function(){var t=this;return{left:t.paddingLeft||0,top:t.paddingTop||0,right:t.paddingRight||0,bottom:t.paddingBottom||0}},getTicks:function(){return this._ticks},mergeTicksOptions:function(){var t=this.options.ticks;!1===t.minor&&(t.minor={display:!1}),!1===t.major&&(t.major={display:!1});for(var e in t)"major"!==e&&"minor"!==e&&(void 0===t.minor[e]&&(t.minor[e]=t[e]),void 0===t.major[e]&&(t.major[e]=t[e]))},beforeUpdate:function(){l.callback(this.options.beforeUpdate,[this])},update:function(t,e,n){var i,a,o,r,s,u,d=this;for(d.beforeUpdate(),d.maxWidth=t,d.maxHeight=e,d.margins=l.extend({left:0,right:0,top:0,bottom:0},n),d.longestTextCache=d.longestTextCache||{},d.beforeSetDimensions(),d.setDimensions(),d.afterSetDimensions(),d.beforeDataLimits(),d.determineDataLimits(),d.afterDataLimits(),d.beforeBuildTicks(),s=d.buildTicks()||[],d.afterBuildTicks(),d.beforeTickToLabelConversion(),o=d.convertTicksToLabels(s)||d.ticks,d.afterTickToLabelConversion(),d.ticks=o,i=0,a=o.length;i<a;++i)r=o[i],(u=s[i])?u.label=r:s.push(u={label:r,major:!1});return d._ticks=s,d.beforeCalculateTickRotation(),d.calculateTickRotation(),d.afterCalculateTickRotation(),d.beforeFit(),d.fit(),d.afterFit(),d.afterUpdate(),d.minSize},afterUpdate:function(){l.callback(this.options.afterUpdate,[this])},beforeSetDimensions:function(){l.callback(this.options.beforeSetDimensions,[this])},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},afterSetDimensions:function(){l.callback(this.options.afterSetDimensions,[this])},beforeDataLimits:function(){l.callback(this.options.beforeDataLimits,[this])},determineDataLimits:l.noop,afterDataLimits:function(){l.callback(this.options.afterDataLimits,[this])},beforeBuildTicks:function(){l.callback(this.options.beforeBuildTicks,[this])},buildTicks:l.noop,afterBuildTicks:function(){l.callback(this.options.afterBuildTicks,[this])},beforeTickToLabelConversion:function(){l.callback(this.options.beforeTickToLabelConversion,[this])},convertTicksToLabels:function(){var t=this,e=t.options.ticks;t.ticks=t.ticks.map(e.userCallback||e.callback,this)},afterTickToLabelConversion:function(){l.callback(this.options.afterTickToLabelConversion,[this])},beforeCalculateTickRotation:function(){l.callback(this.options.beforeCalculateTickRotation,[this])},calculateTickRotation:function(){var t=this,e=t.ctx,a=t.options.ticks,o=i(t._ticks),r=n(a);e.font=r.font;var s=a.minRotation||0;if(o.length&&t.options.display&&t.isHorizontal())for(var u,d=l.longestText(e,r.font,o,t.longestTextCache),c=d,h=t.getPixelForTick(1)-t.getPixelForTick(0)-6;c>h&&s<a.maxRotation;){var f=l.toRadians(s);if(u=Math.cos(f),Math.sin(f)*d>t.maxHeight){s--;break}s++,c=u*d}t.labelRotation=s},afterCalculateTickRotation:function(){l.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){l.callback(this.options.beforeFit,[this])},fit:function(){var t=this,a=t.minSize={width:0,height:0},o=i(t._ticks),r=t.options,u=r.ticks,d=r.scaleLabel,c=r.gridLines,h=r.display,f=t.isHorizontal(),g=n(u),p=r.gridLines.tickMarkLength;if(a.width=f?t.isFullWidth()?t.maxWidth-t.margins.left-t.margins.right:t.maxWidth:h&&c.drawTicks?p:0,a.height=f?h&&c.drawTicks?p:0:t.maxHeight,d.display&&h){var v=s(d)+l.options.toPadding(d.padding).height;f?a.height+=v:a.width+=v}if(u.display&&h){var m=l.longestText(t.ctx,g.font,o,t.longestTextCache),b=l.numberOfLabelLines(o),x=.5*g.size,y=t.options.ticks.padding;if(f){t.longestLabelWidth=m;var k=l.toRadians(t.labelRotation),w=Math.cos(k),M=Math.sin(k)*m+g.size*b+x*(b-1)+x;a.height=Math.min(t.maxHeight,a.height+M+y),t.ctx.font=g.font;var S=e(t.ctx,o[0],g.font),C=e(t.ctx,o[o.length-1],g.font);0!==t.labelRotation?(t.paddingLeft="bottom"===r.position?w*S+3:w*x+3,t.paddingRight="bottom"===r.position?w*x+3:w*C+3):(t.paddingLeft=S/2+3,t.paddingRight=C/2+3)}else u.mirror?m=0:m+=y+x,a.width=Math.min(t.maxWidth,a.width+m),t.paddingTop=g.size/2,t.paddingBottom=g.size/2}t.handleMargins(),t.width=a.width,t.height=a.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(){l.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(l.isNullOrUndef(t))return NaN;if("number"==typeof t&&!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:l.noop,getPixelForValue:l.noop,getValueForPixel:l.noop,getPixelForTick:function(t){var e=this,n=e.options.offset;if(e.isHorizontal()){var i=(e.width-(e.paddingLeft+e.paddingRight))/Math.max(e._ticks.length-(n?0:1),1),a=i*t+e.paddingLeft;n&&(a+=i/2);var o=e.left+Math.round(a);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,i=e.left+Math.round(n);return i+=e.isFullWidth()?e.margins.left:0}return e.top+t*e.height},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var t=this,e=t.min,n=t.max;return t.beginAtZero?0:e<0&&n<0?n:e>0&&n>0?e:0},_autoSkip:function(t){var e,n,i,a,o=this,r=o.isHorizontal(),s=o.options.ticks.minor,u=t.length,d=l.toRadians(o.labelRotation),c=Math.cos(d),h=o.longestLabelWidth*c,f=[];for(s.maxTicksLimit&&(a=s.maxTicksLimit),r&&(e=!1,(h+s.autoSkipPadding)*u>o.width-(o.paddingLeft+o.paddingRight)&&(e=1+Math.floor((h+s.autoSkipPadding)*u/(o.width-(o.paddingLeft+o.paddingRight)))),a&&u>a&&(e=Math.max(e,Math.floor(u/a)))),n=0;n<u;n++)i=t[n],(e>1&&n%e>0||n%e==0&&n+e>=u)&&n!==u-1&&delete i.label,f.push(i);return f},draw:function(t){var e=this,i=e.options;if(i.display){var r=e.ctx,u=o.global,d=i.ticks.minor,c=i.ticks.major||d,h=i.gridLines,f=i.scaleLabel,g=0!==e.labelRotation,p=e.isHorizontal(),v=d.autoSkip?e._autoSkip(e.getTicks()):e.getTicks(),m=l.valueOrDefault(d.fontColor,u.defaultFontColor),b=n(d),x=l.valueOrDefault(c.fontColor,u.defaultFontColor),y=n(c),k=h.drawTicks?h.tickMarkLength:0,w=l.valueOrDefault(f.fontColor,u.defaultFontColor),M=n(f),S=l.options.toPadding(f.padding),C=l.toRadians(e.labelRotation),_=[],D="right"===i.position?e.left:e.right-k,I="right"===i.position?e.left+k:e.right,P="bottom"===i.position?e.top:e.bottom-k,A="bottom"===i.position?e.top+k:e.bottom;if(l.each(v,function(n,o){if(!l.isNullOrUndef(n.label)){var r,s,c,f,m=n.label;o===e.zeroLineIndex&&i.offset===h.offsetGridLines?(r=h.zeroLineWidth,s=h.zeroLineColor,c=h.zeroLineBorderDash,f=h.zeroLineBorderDashOffset):(r=l.valueAtIndexOrDefault(h.lineWidth,o),s=l.valueAtIndexOrDefault(h.color,o),c=l.valueOrDefault(h.borderDash,u.borderDash),f=l.valueOrDefault(h.borderDashOffset,u.borderDashOffset));var b,x,y,w,M,S,T,F,O,R,L="middle",z="middle",B=d.padding;if(p){var W=k+B;"bottom"===i.position?(z=g?"middle":"top",L=g?"right":"center",R=e.top+W):(z=g?"middle":"bottom",L=g?"left":"center",R=e.bottom-W);var N=a(e,o,h.offsetGridLines&&v.length>1);N<e.left&&(s="rgba(0,0,0,0)"),N+=l.aliasPixel(r),O=e.getPixelForTick(o)+d.labelOffset,b=y=M=T=N,x=P,w=A,S=t.top,F=t.bottom}else{var V,E="left"===i.position;d.mirror?(L=E?"left":"right",V=B):(L=E?"right":"left",V=k+B),O=E?e.right-V:e.left+V;var H=a(e,o,h.offsetGridLines&&v.length>1);H<e.top&&(s="rgba(0,0,0,0)"),H+=l.aliasPixel(r),R=e.getPixelForTick(o)+d.labelOffset,b=D,y=I,M=t.left,T=t.right,x=w=S=F=H}_.push({tx1:b,ty1:x,tx2:y,ty2:w,x1:M,y1:S,x2:T,y2:F,labelX:O,labelY:R,glWidth:r,glColor:s,glBorderDash:c,glBorderDashOffset:f,rotation:-1*C,label:m,major:n.major,textBaseline:z,textAlign:L})}}),l.each(_,function(t){if(h.display&&(r.save(),r.lineWidth=t.glWidth,r.strokeStyle=t.glColor,r.setLineDash&&(r.setLineDash(t.glBorderDash),r.lineDashOffset=t.glBorderDashOffset),r.beginPath(),h.drawTicks&&(r.moveTo(t.tx1,t.ty1),r.lineTo(t.tx2,t.ty2)),h.drawOnChartArea&&(r.moveTo(t.x1,t.y1),r.lineTo(t.x2,t.y2)),r.stroke(),r.restore()),d.display){r.save(),r.translate(t.labelX,t.labelY),r.rotate(t.rotation),r.font=t.major?y.font:b.font,r.fillStyle=t.major?x:m,r.textBaseline=t.textBaseline,r.textAlign=t.textAlign;var e=t.label;if(l.isArray(e))for(var n=0,i=0;n<e.length;++n)r.fillText(""+e[n],0,i),i+=1.5*b.size;else r.fillText(e,0,0);r.restore()}}),f.display){var T,F,O=0,R=s(f)/2;if(p)T=e.left+(e.right-e.left)/2,F="bottom"===i.position?e.bottom-R-S.bottom:e.top+R+S.top;else{var L="left"===i.position;T=L?e.left+R+S.top:e.right-R-S.top,F=e.top+(e.bottom-e.top)/2,O=L?-.5*Math.PI:.5*Math.PI}r.save(),r.translate(T,F),r.rotate(O),r.textAlign="center",r.textBaseline="middle",r.fillStyle=w,r.font=M.font,r.fillText(f.labelString,0,0),r.restore()}if(h.drawBorder){r.lineWidth=l.valueAtIndexOrDefault(h.lineWidth,0),r.strokeStyle=l.valueAtIndexOrDefault(h.color,0);var z=e.left,B=e.right,W=e.top,N=e.bottom,V=l.aliasPixel(r.lineWidth);p?(W=N="top"===i.position?e.bottom:e.top,W+=V,N+=V):(z=B="left"===i.position?e.right:e.left,z+=V,B+=V),r.beginPath(),r.moveTo(z,W),r.lineTo(B,N),r.stroke()}}}})}},{25:25,26:26,34:34,45:45}],33:[function(t,e,n){"use strict";var i=t(25),a=t(45);e.exports=function(t){t.scaleService={constructors:{},defaults:{},registerScaleType:function(t,e,n){this.constructors[t]=e,this.defaults[t]=a.clone(n)},getScaleConstructor:function(t){return this.constructors.hasOwnProperty(t)?this.constructors[t]:void 0},getScaleDefaults:function(t){return this.defaults.hasOwnProperty(t)?a.merge({},[i.scale,this.defaults[t]]):{}},updateScaleDefaults:function(t,e){var n=this;n.defaults.hasOwnProperty(t)&&(n.defaults[t]=a.extend(n.defaults[t],e))},addScalesToLayout:function(e){a.each(e.scales,function(n){n.fullWidth=n.options.fullWidth,n.position=n.options.position,n.weight=n.options.weight,t.layoutService.addBox(e,n)})}}}},{25:25,45:45}],34:[function(t,e,n){"use strict";var i=t(45);e.exports={generators:{linear:function(t,e){var n,a=[];if(t.stepSize&&t.stepSize>0)n=t.stepSize;else{var o=i.niceNum(e.max-e.min,!1);n=i.niceNum(o/(t.maxTicks-1),!0)}var r=Math.floor(e.min/n)*n,l=Math.ceil(e.max/n)*n;t.min&&t.max&&t.stepSize&&i.almostWhole((t.max-t.min)/t.stepSize,n/1e3)&&(r=t.min,l=t.max);var s=(l-r)/n;s=i.almostEquals(s,Math.round(s),n/1e3)?Math.round(s):Math.ceil(s),a.push(void 0!==t.min?t.min:r);for(var u=1;u<s;++u)a.push(r+u*n);return a.push(void 0!==t.max?t.max:l),a},logarithmic:function(t,e){var n,a,o=[],r=i.valueOrDefault,l=r(t.min,Math.pow(10,Math.floor(i.log10(e.min)))),s=Math.floor(i.log10(e.max)),u=Math.ceil(e.max/Math.pow(10,s));0===l?(n=Math.floor(i.log10(e.minNotZero)),a=Math.floor(e.minNotZero/Math.pow(10,n)),o.push(l),l=a*Math.pow(10,n)):(n=Math.floor(i.log10(l)),a=Math.floor(l/Math.pow(10,n)));do{o.push(l),10===++a&&(a=1,++n),l=a*Math.pow(10,n)}while(n<s||n===s&&a<u);var d=r(t.max,l);return o.push(d),o}},formatters:{values:function(t){return i.isArray(t)?t:""+t},linear:function(t,e,n){var a=n.length>3?n[2]-n[1]:n[1]-n[0];Math.abs(a)>1&&t!==Math.floor(t)&&(a=t-Math.floor(t));var o=i.log10(Math.abs(a)),r="";if(0!==t){var l=-1*Math.floor(o);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(i.log10(t)));return 0===t?"0":1===a||2===a||5===a||0===e||e===n.length-1?t.toExponential():""}}}},{45:45}],35:[function(t,e,n){"use strict";var i=t(25),a=t(26),o=t(45);i._set("global",{tooltips:{enabled:!0,custom:null,mode:"nearest",position:"average",intersect:!0,backgroundColor:"rgba(0,0,0,0.8)",titleFontStyle:"bold",titleSpacing:2,titleMarginBottom:6,titleFontColor:"#fff",titleAlign:"left",bodySpacing:2,bodyFontColor:"#fff",bodyAlign:"left",footerFontStyle:"bold",footerSpacing:2,footerMarginTop:6,footerFontColor:"#fff",footerAlign:"left",yPadding:6,xPadding:6,caretPadding:2,caretSize:5,cornerRadius:6,multiKeyBackground:"#fff",displayColors:!0,borderColor:"rgba(0,0,0,0)",borderWidth:0,callbacks:{beforeTitle:o.noop,title:function(t,e){var n="",i=e.labels,a=i?i.length:0;if(t.length>0){var o=t[0];o.xLabel?n=o.xLabel:a>0&&o.index<a&&(n=i[o.index])}return n},afterTitle:o.noop,beforeBody:o.noop,beforeLabel:o.noop,label:function(t,e){var n=e.datasets[t.datasetIndex].label||"";return n&&(n+=": "),n+=t.yLabel},labelColor:function(t,e){var n=e.getDatasetMeta(t.datasetIndex).data[t.index]._view;return{borderColor:n.borderColor,backgroundColor:n.backgroundColor}},labelTextColor:function(){return this._options.bodyFontColor},afterLabel:o.noop,afterBody:o.noop,beforeFooter:o.noop,footer:o.noop,afterFooter:o.noop}}}),e.exports=function(t){function e(t,e){var n=o.color(t);return n.alpha(e*n.alpha()).rgbaString()}function n(t,e){return e&&(o.isArray(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function r(t){var e=t._xScale,n=t._yScale||t._scale,i=t._index,a=t._datasetIndex;return{xLabel:e?e.getLabelForIndex(i,a):"",yLabel:n?n.getLabelForIndex(i,a):"",index:i,datasetIndex:a,x:t._model.x,y:t._model.y}}function l(t){var e=i.global,n=o.valueOrDefault;return{xPadding:t.xPadding,yPadding:t.yPadding,xAlign:t.xAlign,yAlign:t.yAlign,bodyFontColor:t.bodyFontColor,_bodyFontFamily:n(t.bodyFontFamily,e.defaultFontFamily),_bodyFontStyle:n(t.bodyFontStyle,e.defaultFontStyle),_bodyAlign:t.bodyAlign,bodyFontSize:n(t.bodyFontSize,e.defaultFontSize),bodySpacing:t.bodySpacing,titleFontColor:t.titleFontColor,_titleFontFamily:n(t.titleFontFamily,e.defaultFontFamily),_titleFontStyle:n(t.titleFontStyle,e.defaultFontStyle),titleFontSize:n(t.titleFontSize,e.defaultFontSize),_titleAlign:t.titleAlign,titleSpacing:t.titleSpacing,titleMarginBottom:t.titleMarginBottom,footerFontColor:t.footerFontColor,_footerFontFamily:n(t.footerFontFamily,e.defaultFontFamily),_footerFontStyle:n(t.footerFontStyle,e.defaultFontStyle),footerFontSize:n(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 s(t,e){var n=t._chart.ctx,i=2*e.yPadding,a=0,r=e.body,l=r.reduce(function(t,e){return t+e.before.length+e.lines.length+e.after.length},0);l+=e.beforeBody.length+e.afterBody.length;var s=e.title.length,u=e.footer.length,d=e.titleFontSize,c=e.bodyFontSize,h=e.footerFontSize;i+=s*d,i+=s?(s-1)*e.titleSpacing:0,i+=s?e.titleMarginBottom:0,i+=l*c,i+=l?(l-1)*e.bodySpacing:0,i+=u?e.footerMarginTop:0,i+=u*h,i+=u?(u-1)*e.footerSpacing:0;var f=0,g=function(t){a=Math.max(a,n.measureText(t).width+f)};return n.font=o.fontString(d,e._titleFontStyle,e._titleFontFamily),o.each(e.title,g),n.font=o.fontString(c,e._bodyFontStyle,e._bodyFontFamily),o.each(e.beforeBody.concat(e.afterBody),g),f=e.displayColors?c+2:0,o.each(r,function(t){o.each(t.before,g),o.each(t.lines,g),o.each(t.after,g)}),f=0,n.font=o.fontString(h,e._footerFontStyle,e._footerFontFamily),o.each(e.footer,g),a+=2*e.xPadding,{width:a,height:i}}function u(t,e){var n=t._model,i=t._chart,a=t._chart.chartArea,o="center",r="center";n.y<e.height?r="top":n.y>i.height-e.height&&(r="bottom");var l,s,u,d,c,h=(a.left+a.right)/2,f=(a.top+a.bottom)/2;"center"===r?(l=function(t){return t<=h},s=function(t){return t>h}):(l=function(t){return t<=e.width/2},s=function(t){return t>=i.width-e.width/2}),u=function(t){return t+e.width>i.width},d=function(t){return t-e.width<0},c=function(t){return t<=f?"top":"bottom"},l(n.x)?(o="left",u(n.x)&&(o="center",r=c(n.y))):s(n.x)&&(o="right",d(n.x)&&(o="center",r=c(n.y)));var g=t._options;return{xAlign:g.xAlign?g.xAlign:o,yAlign:g.yAlign?g.yAlign:r}}function d(t,e,n){var i=t.x,a=t.y,o=t.caretSize,r=t.caretPadding,l=t.cornerRadius,s=n.xAlign,u=n.yAlign,d=o+r,c=l+r;return"right"===s?i-=e.width:"center"===s&&(i-=e.width/2),"top"===u?a+=d:a-="bottom"===u?e.height+d:e.height/2,"center"===u?"left"===s?i+=d:"right"===s&&(i-=d):"left"===s?i-=c:"right"===s&&(i+=c),{x:i,y:a}}t.Tooltip=a.extend({initialize:function(){this._model=l(this._options),this._lastActive=[]},getTitle:function(){var t=this,e=t._options.callbacks,i=e.beforeTitle.apply(t,arguments),a=e.title.apply(t,arguments),o=e.afterTitle.apply(t,arguments),r=[];return r=n(r,i),r=n(r,a),r=n(r,o)},getBeforeBody:function(){var t=this._options.callbacks.beforeBody.apply(this,arguments);return o.isArray(t)?t:void 0!==t?[t]:[]},getBody:function(t,e){var i=this,a=i._options.callbacks,r=[];return o.each(t,function(t){var o={before:[],lines:[],after:[]};n(o.before,a.beforeLabel.call(i,t,e)),n(o.lines,a.label.call(i,t,e)),n(o.after,a.afterLabel.call(i,t,e)),r.push(o)}),r},getAfterBody:function(){var t=this._options.callbacks.afterBody.apply(this,arguments);return o.isArray(t)?t:void 0!==t?[t]:[]},getFooter:function(){var t=this,e=t._options.callbacks,i=e.beforeFooter.apply(t,arguments),a=e.footer.apply(t,arguments),o=e.afterFooter.apply(t,arguments),r=[];return r=n(r,i),r=n(r,a),r=n(r,o)},update:function(e){var n,i,a=this,c=a._options,h=a._model,f=a._model=l(c),g=a._active,p=a._data,v={xAlign:h.xAlign,yAlign:h.yAlign},m={x:h.x,y:h.y},b={width:h.width,height:h.height},x={x:h.caretX,y:h.caretY};if(g.length){f.opacity=1;var y=[],k=[];x=t.Tooltip.positioners[c.position].call(a,g,a._eventPosition);var w=[];for(n=0,i=g.length;n<i;++n)w.push(r(g[n]));c.filter&&(w=w.filter(function(t){return c.filter(t,p)})),c.itemSort&&(w=w.sort(function(t,e){return c.itemSort(t,e,p)})),o.each(w,function(t){y.push(c.callbacks.labelColor.call(a,t,a._chart)),k.push(c.callbacks.labelTextColor.call(a,t,a._chart))}),f.title=a.getTitle(w,p),f.beforeBody=a.getBeforeBody(w,p),f.body=a.getBody(w,p),f.afterBody=a.getAfterBody(w,p),f.footer=a.getFooter(w,p),f.x=Math.round(x.x),f.y=Math.round(x.y),f.caretPadding=c.caretPadding,f.labelColors=y,f.labelTextColors=k,f.dataPoints=w,m=d(f,b=s(this,f),v=u(this,b))}else f.opacity=0;return f.xAlign=v.xAlign,f.yAlign=v.yAlign,f.x=m.x,f.y=m.y,f.width=b.width,f.height=b.height,f.caretX=x.x,f.caretY=x.y,a._model=f,e&&c.custom&&c.custom.call(a,f),a},drawCaret:function(t,e){var n=this._chart.ctx,i=this._view,a=this.getCaretPosition(t,e,i);n.lineTo(a.x1,a.y1),n.lineTo(a.x2,a.y2),n.lineTo(a.x3,a.y3)},getCaretPosition:function(t,e,n){var i,a,o,r,l,s,u=n.caretSize,d=n.cornerRadius,c=n.xAlign,h=n.yAlign,f=t.x,g=t.y,p=e.width,v=e.height;if("center"===h)l=g+v/2,"left"===c?(a=(i=f)-u,o=i,r=l+u,s=l-u):(a=(i=f+p)+u,o=i,r=l-u,s=l+u);else if("left"===c?(i=(a=f+d+u)-u,o=a+u):"right"===c?(i=(a=f+p-d-u)-u,o=a+u):(i=(a=f+p/2)-u,o=a+u),"top"===h)l=(r=g)-u,s=r;else{l=(r=g+v)+u,s=r;var m=o;o=i,i=m}return{x1:i,x2:a,x3:o,y1:r,y2:l,y3:s}},drawTitle:function(t,n,i,a){var r=n.title;if(r.length){i.textAlign=n._titleAlign,i.textBaseline="top";var l=n.titleFontSize,s=n.titleSpacing;i.fillStyle=e(n.titleFontColor,a),i.font=o.fontString(l,n._titleFontStyle,n._titleFontFamily);var u,d;for(u=0,d=r.length;u<d;++u)i.fillText(r[u],t.x,t.y),t.y+=l+s,u+1===r.length&&(t.y+=n.titleMarginBottom-s)}},drawBody:function(t,n,i,a){var r=n.bodyFontSize,l=n.bodySpacing,s=n.body;i.textAlign=n._bodyAlign,i.textBaseline="top",i.font=o.fontString(r,n._bodyFontStyle,n._bodyFontFamily);var u=0,d=function(e){i.fillText(e,t.x+u,t.y),t.y+=r+l};i.fillStyle=e(n.bodyFontColor,a),o.each(n.beforeBody,d);var c=n.displayColors;u=c?r+2:0,o.each(s,function(l,s){var u=e(n.labelTextColors[s],a);i.fillStyle=u,o.each(l.before,d),o.each(l.lines,function(o){c&&(i.fillStyle=e(n.legendColorBackground,a),i.fillRect(t.x,t.y,r,r),i.lineWidth=1,i.strokeStyle=e(n.labelColors[s].borderColor,a),i.strokeRect(t.x,t.y,r,r),i.fillStyle=e(n.labelColors[s].backgroundColor,a),i.fillRect(t.x+1,t.y+1,r-2,r-2),i.fillStyle=u),d(o)}),o.each(l.after,d)}),u=0,o.each(n.afterBody,d),t.y-=l},drawFooter:function(t,n,i,a){var r=n.footer;r.length&&(t.y+=n.footerMarginTop,i.textAlign=n._footerAlign,i.textBaseline="top",i.fillStyle=e(n.footerFontColor,a),i.font=o.fontString(n.footerFontSize,n._footerFontStyle,n._footerFontFamily),o.each(r,function(e){i.fillText(e,t.x,t.y),t.y+=n.footerFontSize+n.footerSpacing}))},drawBackground:function(t,n,i,a,o){i.fillStyle=e(n.backgroundColor,o),i.strokeStyle=e(n.borderColor,o),i.lineWidth=n.borderWidth;var r=n.xAlign,l=n.yAlign,s=t.x,u=t.y,d=a.width,c=a.height,h=n.cornerRadius;i.beginPath(),i.moveTo(s+h,u),"top"===l&&this.drawCaret(t,a),i.lineTo(s+d-h,u),i.quadraticCurveTo(s+d,u,s+d,u+h),"center"===l&&"right"===r&&this.drawCaret(t,a),i.lineTo(s+d,u+c-h),i.quadraticCurveTo(s+d,u+c,s+d-h,u+c),"bottom"===l&&this.drawCaret(t,a),i.lineTo(s+h,u+c),i.quadraticCurveTo(s,u+c,s,u+c-h),"center"===l&&"left"===r&&this.drawCaret(t,a),i.lineTo(s,u+h),i.quadraticCurveTo(s,u,s+h,u),i.closePath(),i.fill(),n.borderWidth>0&&i.stroke()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var n={width:e.width,height:e.height},i={x:e.x,y:e.y},a=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&&(this.drawBackground(i,e,t,n,a),i.x+=e.xPadding,i.y+=e.yPadding,this.drawTitle(i,e,t,a),this.drawBody(i,e,t,a),this.drawFooter(i,e,t,a))}},handleEvent:function(t){var e=this,n=e._options,i=!1;if(e._lastActive=e._lastActive||[],"mouseout"===t.type?e._active=[]:e._active=e._chart.getElementsAtEventForMode(t,n.mode,n),!(i=!o.arrayEquals(e._active,e._lastActive)))return!1;if(e._lastActive=e._active,n.enabled||n.custom){e._eventPosition={x:t.x,y:t.y};var a=e._model;e.update(!0),e.pivot(),i|=a.x!==e._model.x||a.y!==e._model.y}return i}}),t.Tooltip.positioners={average:function(t){if(!t.length)return!1;var e,n,i=0,a=0,o=0;for(e=0,n=t.length;e<n;++e){var r=t[e];if(r&&r.hasValue()){var l=r.tooltipPosition();i+=l.x,a+=l.y,++o}}return{x:Math.round(i/o),y:Math.round(a/o)}},nearest:function(t,e){var n,i,a,r=e.x,l=e.y,s=Number.POSITIVE_INFINITY;for(n=0,i=t.length;n<i;++n){var u=t[n];if(u&&u.hasValue()){var d=u.getCenterPoint(),c=o.distanceBetweenPoints(e,d);c<s&&(s=c,a=u)}}if(a){var h=a.tooltipPosition();r=h.x,l=h.y}return{x:r,y:l}}}}},{25:25,26:26,45:45}],36:[function(t,e,n){"use strict";var i=t(25),a=t(26),o=t(45);i._set("global",{elements:{arc:{backgroundColor:i.global.defaultColor,borderColor:"#fff",borderWidth:2}}}),e.exports=a.extend({inLabelRange:function(t){var e=this._view;return!!e&&Math.pow(t-e.x,2)<Math.pow(e.radius+e.hoverRadius,2)},inRange:function(t,e){var n=this._view;if(n){for(var i=o.getAngleFromPoint(n,{x:t,y:e}),a=i.angle,r=i.distance,l=n.startAngle,s=n.endAngle;s<l;)s+=2*Math.PI;for(;a>s;)a-=2*Math.PI;for(;a<l;)a+=2*Math.PI;var u=a>=l&&a<=s,d=r>=n.innerRadius&&r<=n.outerRadius;return u&&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=this._chart.ctx,e=this._view,n=e.startAngle,i=e.endAngle;t.beginPath(),t.arc(e.x,e.y,e.outerRadius,n,i),t.arc(e.x,e.y,e.innerRadius,i,n,!0),t.closePath(),t.strokeStyle=e.borderColor,t.lineWidth=e.borderWidth,t.fillStyle=e.backgroundColor,t.fill(),t.lineJoin="bevel",e.borderWidth&&t.stroke()}})},{25:25,26:26,45:45}],37:[function(t,e,n){"use strict";var i=t(25),a=t(26),o=t(45),r=i.global;i._set("global",{elements:{line:{tension:.4,backgroundColor:r.defaultColor,borderWidth:3,borderColor:r.defaultColor,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0}}}),e.exports=a.extend({draw:function(){var t,e,n,i,a=this,l=a._view,s=a._chart.ctx,u=l.spanGaps,d=a._children.slice(),c=r.elements.line,h=-1;for(a._loop&&d.length&&d.push(d[0]),s.save(),s.lineCap=l.borderCapStyle||c.borderCapStyle,s.setLineDash&&s.setLineDash(l.borderDash||c.borderDash),s.lineDashOffset=l.borderDashOffset||c.borderDashOffset,s.lineJoin=l.borderJoinStyle||c.borderJoinStyle,s.lineWidth=l.borderWidth||c.borderWidth,s.strokeStyle=l.borderColor||r.defaultColor,s.beginPath(),h=-1,t=0;t<d.length;++t)e=d[t],n=o.previousItem(d,t),i=e._view,0===t?i.skip||(s.moveTo(i.x,i.y),h=t):(n=-1===h?n:d[h],i.skip||(h!==t-1&&!u||-1===h?s.moveTo(i.x,i.y):o.canvas.lineTo(s,n._view,e._view),h=t));s.stroke(),s.restore()}})},{25:25,26:26,45:45}],38:[function(t,e,n){"use strict";function i(t){var e=this._view;return!!e&&Math.pow(t-e.x,2)<Math.pow(e.radius+e.hitRadius,2)}var a=t(25),o=t(26),r=t(45),l=a.global.defaultColor;a._set("global",{elements:{point:{radius:3,pointStyle:"circle",backgroundColor:l,borderColor:l,borderWidth:1,hitRadius:1,hoverRadius:4,hoverBorderWidth:1}}}),e.exports=o.extend({inRange:function(t,e){var n=this._view;return!!n&&Math.pow(t-n.x,2)+Math.pow(e-n.y,2)<Math.pow(n.hitRadius+n.radius,2)},inLabelRange:i,inXRange:i,inYRange:function(t){var e=this._view;return!!e&&Math.pow(t-e.y,2)<Math.pow(e.radius+e.hitRadius,2)},getCenterPoint:function(){var t=this._view;return{x:t.x,y:t.y}},getArea:function(){return Math.PI*Math.pow(this._view.radius,2)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y,padding:t.radius+t.borderWidth}},draw:function(t){var e=this._view,n=this._model,i=this._chart.ctx,o=e.pointStyle,s=e.radius,u=e.x,d=e.y,c=r.color,h=0;e.skip||(i.strokeStyle=e.borderColor||l,i.lineWidth=r.valueOrDefault(e.borderWidth,a.global.elements.point.borderWidth),i.fillStyle=e.backgroundColor||l,void 0!==t&&(n.x<t.left||1.01*t.right<n.x||n.y<t.top||1.01*t.bottom<n.y)&&(n.x<t.left?h=(u-n.x)/(t.left-n.x):1.01*t.right<n.x?h=(n.x-u)/(n.x-t.right):n.y<t.top?h=(d-n.y)/(t.top-n.y):1.01*t.bottom<n.y&&(h=(n.y-d)/(n.y-t.bottom)),h=Math.round(100*h)/100,i.strokeStyle=c(i.strokeStyle).alpha(h).rgbString(),i.fillStyle=c(i.fillStyle).alpha(h).rgbString()),r.canvas.drawPoint(i,o,s,u,d))}})},{25:25,26:26,45:45}],39:[function(t,e,n){"use strict";function i(t){return void 0!==t._view.width}function a(t){var e,n,a,o,r=t._view;if(i(t)){var l=r.width/2;e=r.x-l,n=r.x+l,a=Math.min(r.y,r.base),o=Math.max(r.y,r.base)}else{var s=r.height/2;e=Math.min(r.x,r.base),n=Math.max(r.x,r.base),a=r.y-s,o=r.y+s}return{left:e,top:a,right:n,bottom:o}}var o=t(25),r=t(26);o._set("global",{elements:{rectangle:{backgroundColor:o.global.defaultColor,borderColor:o.global.defaultColor,borderSkipped:"bottom",borderWidth:0}}}),e.exports=r.extend({draw:function(){function t(t){return m[(b+t)%4]}var e,n,i,a,o,r,l,s=this._chart.ctx,u=this._view,d=u.borderWidth;if(u.horizontal?(e=u.base,n=u.x,i=u.y-u.height/2,a=u.y+u.height/2,o=n>e?1:-1,r=1,l=u.borderSkipped||"left"):(e=u.x-u.width/2,n=u.x+u.width/2,i=u.y,o=1,r=(a=u.base)>i?1:-1,l=u.borderSkipped||"bottom"),d){var c=Math.min(Math.abs(e-n),Math.abs(i-a)),h=(d=d>c?c:d)/2,f=e+("left"!==l?h*o:0),g=n+("right"!==l?-h*o:0),p=i+("top"!==l?h*r:0),v=a+("bottom"!==l?-h*r:0);f!==g&&(i=p,a=v),p!==v&&(e=f,n=g)}s.beginPath(),s.fillStyle=u.backgroundColor,s.strokeStyle=u.borderColor,s.lineWidth=d;var m=[[e,a],[e,i],[n,i],[n,a]],b=["bottom","left","top","right"].indexOf(l,0);-1===b&&(b=0);var x=t(0);s.moveTo(x[0],x[1]);for(var y=1;y<4;y++)x=t(y),s.lineTo(x[0],x[1]);s.fill(),d&&s.stroke()},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){var n=!1;if(this._view){var i=a(this);n=t>=i.left&&t<=i.right&&e>=i.top&&e<=i.bottom}return n},inLabelRange:function(t,e){var n=this;if(!n._view)return!1;var o=a(n);return i(n)?t>=o.left&&t<=o.right:e>=o.top&&e<=o.bottom},inXRange:function(t){var e=a(this);return t>=e.left&&t<=e.right},inYRange:function(t){var e=a(this);return t>=e.top&&t<=e.bottom},getCenterPoint:function(){var t,e,n=this._view;return i(this)?(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 t.width*Math.abs(t.y-t.base)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}})},{25:25,26:26}],40:[function(t,e,n){"use strict";e.exports={},e.exports.Arc=t(36),e.exports.Line=t(37),e.exports.Point=t(38),e.exports.Rectangle=t(39)},{36:36,37:37,38:38,39:39}],41:[function(t,e,n){"use strict";var i=t(42),n=e.exports={clear:function(t){t.ctx.clearRect(0,0,t.width,t.height)},roundedRect:function(t,e,n,i,a,o){if(o){var r=Math.min(o,i/2),l=Math.min(o,a/2);t.moveTo(e+r,n),t.lineTo(e+i-r,n),t.quadraticCurveTo(e+i,n,e+i,n+l),t.lineTo(e+i,n+a-l),t.quadraticCurveTo(e+i,n+a,e+i-r,n+a),t.lineTo(e+r,n+a),t.quadraticCurveTo(e,n+a,e,n+a-l),t.lineTo(e,n+l),t.quadraticCurveTo(e,n,e+r,n)}else t.rect(e,n,i,a)},drawPoint:function(t,e,n,i,a){var o,r,l,s,u,d;if(!e||"object"!=typeof e||"[object HTMLImageElement]"!==(o=e.toString())&&"[object HTMLCanvasElement]"!==o){if(!(isNaN(n)||n<=0)){switch(e){default:t.beginPath(),t.arc(i,a,n,0,2*Math.PI),t.closePath(),t.fill();break;case"triangle":t.beginPath(),u=(r=3*n/Math.sqrt(3))*Math.sqrt(3)/2,t.moveTo(i-r/2,a+u/3),t.lineTo(i+r/2,a+u/3),t.lineTo(i,a-2*u/3),t.closePath(),t.fill();break;case"rect":d=1/Math.SQRT2*n,t.beginPath(),t.fillRect(i-d,a-d,2*d,2*d),t.strokeRect(i-d,a-d,2*d,2*d);break;case"rectRounded":var c=n/Math.SQRT2,h=i-c,f=a-c,g=Math.SQRT2*n;t.beginPath(),this.roundedRect(t,h,f,g,g,n/2),t.closePath(),t.fill();break;case"rectRot":d=1/Math.SQRT2*n,t.beginPath(),t.moveTo(i-d,a),t.lineTo(i,a+d),t.lineTo(i+d,a),t.lineTo(i,a-d),t.closePath(),t.fill();break;case"cross":t.beginPath(),t.moveTo(i,a+n),t.lineTo(i,a-n),t.moveTo(i-n,a),t.lineTo(i+n,a),t.closePath();break;case"crossRot":t.beginPath(),l=Math.cos(Math.PI/4)*n,s=Math.sin(Math.PI/4)*n,t.moveTo(i-l,a-s),t.lineTo(i+l,a+s),t.moveTo(i-l,a+s),t.lineTo(i+l,a-s),t.closePath();break;case"star":t.beginPath(),t.moveTo(i,a+n),t.lineTo(i,a-n),t.moveTo(i-n,a),t.lineTo(i+n,a),l=Math.cos(Math.PI/4)*n,s=Math.sin(Math.PI/4)*n,t.moveTo(i-l,a-s),t.lineTo(i+l,a+s),t.moveTo(i-l,a+s),t.lineTo(i+l,a-s),t.closePath();break;case"line":t.beginPath(),t.moveTo(i-n,a),t.lineTo(i+n,a),t.closePath();break;case"dash":t.beginPath(),t.moveTo(i,a),t.lineTo(i+n,a),t.closePath()}t.stroke()}}else t.drawImage(e,i-e.width/2,a-e.height/2,e.width,e.height)},clipArea:function(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()},unclipArea:function(t){t.restore()},lineTo:function(t,e,n,i){if(n.steppedLine)return"after"===n.steppedLine&&!i||"after"!==n.steppedLine&&i?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y),void t.lineTo(n.x,n.y);n.tension?t.bezierCurveTo(i?e.controlPointPreviousX:e.controlPointNextX,i?e.controlPointPreviousY:e.controlPointNextY,i?n.controlPointNextX:n.controlPointPreviousX,i?n.controlPointNextY:n.controlPointPreviousY,n.x,n.y):t.lineTo(n.x,n.y)}};i.clear=n.clear,i.drawRoundedRectangle=function(t){t.beginPath(),n.roundedRect.apply(n,arguments),t.closePath()}},{42:42}],42:[function(t,e,n){"use strict";var i={noop:function(){},uid:function(){var t=0;return function(){return t++}}(),isNullOrUndef:function(t){return null===t||void 0===t},isArray:Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},isObject:function(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)},valueOrDefault:function(t,e){return void 0===t?e:t},valueAtIndexOrDefault:function(t,e,n){return i.valueOrDefault(i.isArray(t)?t[e]:t,n)},callback:function(t,e,n){if(t&&"function"==typeof t.call)return t.apply(n,e)},each:function(t,e,n,a){var o,r,l;if(i.isArray(t))if(r=t.length,a)for(o=r-1;o>=0;o--)e.call(n,t[o],o);else for(o=0;o<r;o++)e.call(n,t[o],o);else if(i.isObject(t))for(r=(l=Object.keys(t)).length,o=0;o<r;o++)e.call(n,t[l[o]],l[o])},arrayEquals:function(t,e){var n,a,o,r;if(!t||!e||t.length!==e.length)return!1;for(n=0,a=t.length;n<a;++n)if(o=t[n],r=e[n],o instanceof Array&&r instanceof Array){if(!i.arrayEquals(o,r))return!1}else if(o!==r)return!1;return!0},clone:function(t){if(i.isArray(t))return t.map(i.clone);if(i.isObject(t)){for(var e={},n=Object.keys(t),a=n.length,o=0;o<a;++o)e[n[o]]=i.clone(t[n[o]]);return e}return t},_merger:function(t,e,n,a){var o=e[t],r=n[t];i.isObject(o)&&i.isObject(r)?i.merge(o,r,a):e[t]=i.clone(r)},_mergerIf:function(t,e,n){var a=e[t],o=n[t];i.isObject(a)&&i.isObject(o)?i.mergeIf(a,o):e.hasOwnProperty(t)||(e[t]=i.clone(o))},merge:function(t,e,n){var a,o,r,l,s,u=i.isArray(e)?e:[e],d=u.length;if(!i.isObject(t))return t;for(a=(n=n||{}).merger||i._merger,o=0;o<d;++o)if(e=u[o],i.isObject(e))for(s=0,l=(r=Object.keys(e)).length;s<l;++s)a(r[s],t,e,n);return t},mergeIf:function(t,e){return i.merge(t,e,{merger:i._mergerIf})},extend:function(t){for(var e=1,n=arguments.length;e<n;++e)i.each(arguments[e],function(e,n){t[n]=e});return t},inherits:function(t){var e=this,n=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return e.apply(this,arguments)},a=function(){this.constructor=n};return a.prototype=e.prototype,n.prototype=new a,n.extend=i.inherits,t&&i.extend(n.prototype,t),n.__super__=e.prototype,n}};e.exports=i,i.callCallback=i.callback,i.indexOf=function(t,e,n){return Array.prototype.indexOf.call(t,e,n)},i.getValueOrDefault=i.valueOrDefault,i.getValueAtIndexOrDefault=i.valueAtIndexOrDefault},{}],43:[function(t,e,n){"use strict";var i=t(42),a={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return(t-=1)*t*t+1},easeInOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-((t-=1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return(t-=1)*t*t*t*t+1},easeInOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return 1-Math.cos(t*(Math.PI/2))},easeOutSine:function(t){return Math.sin(t*(Math.PI/2))},easeInOutSine:function(t){return-.5*(Math.cos(Math.PI*t)-1)},easeInExpo:function(t){return 0===t?0:Math.pow(2,10*(t-1))},easeOutExpo:function(t){return 1===t?1:1-Math.pow(2,-10*t)},easeInOutExpo:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))},easeInCirc:function(t){return t>=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,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n))},easeOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},easeInOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:2==(t/=.5)?1:(n||(n=.45),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),t<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*-.5:i*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-a.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*a.easeInBounce(2*t):.5*a.easeOutBounce(2*t-1)+.5}};e.exports={effects:a},i.easingEffects=a},{42:42}],44:[function(t,e,n){"use strict";var i=t(42);e.exports={toLineHeight:function(t,e){var n=(""+t).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);if(!n||"normal"===n[1])return 1.2*e;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100}return e*t},toPadding:function(t){var e,n,a,o;return i.isObject(t)?(e=+t.top||0,n=+t.right||0,a=+t.bottom||0,o=+t.left||0):e=n=a=o=+t||0,{top:e,right:n,bottom:a,left:o,height:e+a,width:o+n}},resolve:function(t,e,n){var a,o,r;for(a=0,o=t.length;a<o;++a)if(void 0!==(r=t[a])&&(void 0!==e&&"function"==typeof r&&(r=r(e)),void 0!==n&&i.isArray(r)&&(r=r[n]),void 0!==r))return r}}},{42:42}],45:[function(t,e,n){"use strict";e.exports=t(42),e.exports.easing=t(43),e.exports.canvas=t(41),e.exports.options=t(44)},{41:41,42:42,43:43,44:44}],46:[function(t,e,n){e.exports={acquireContext:function(t){return t&&t.canvas&&(t=t.canvas),t&&t.getContext("2d")||null}}},{}],47:[function(t,e,n){"use strict";function i(t,e){var n=v.getStyle(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?Number(i[1]):void 0}function a(t,e){var n=t.style,a=t.getAttribute("height"),o=t.getAttribute("width");if(t[m]={initial:{height:a,width:o,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",null===o||""===o){var r=i(t,"width");void 0!==r&&(t.width=r)}if(null===a||""===a)if(""===t.style.height)t.height=t.width/(e.options.aspectRatio||2);else{var l=i(t,"height");void 0!==r&&(t.height=l)}return t}function o(t,e,n){t.addEventListener(e,n,M)}function r(t,e,n){t.removeEventListener(e,n,M)}function l(t,e,n,i,a){return{type:t,chart:e,native:a||null,x:void 0!==n?n:null,y:void 0!==i?i:null}}function s(t,e){var n=w[t.type]||t.type,i=v.getRelativePosition(t,e);return l(n,e,i.x,i.y,t)}function u(t,e){var n=!1,i=[];return function(){i=Array.prototype.slice.call(arguments),e=e||this,n||(n=!0,v.requestAnimFrame.call(window,function(){n=!1,t.apply(e,i)}))}}function d(t){var e=document.createElement("div"),n=b+"size-monitor",i="position:absolute;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1;";e.style.cssText=i,e.className=n,e.innerHTML='<div class="'+n+'-expand" style="'+i+'"><div style="position:absolute;width:1000000px;height:1000000px;left:0;top:0"></div></div><div class="'+n+'-shrink" style="'+i+'"><div style="position:absolute;width:200%;height:200%;left:0; top:0"></div></div>';var a=e.childNodes[0],r=e.childNodes[1];e._reset=function(){a.scrollLeft=1e6,a.scrollTop=1e6,r.scrollLeft=1e6,r.scrollTop=1e6};var l=function(){e._reset(),t()};return o(a,"scroll",l.bind(a,"expand")),o(r,"scroll",l.bind(r,"shrink")),e}function c(t,e){var n=t[m]||(t[m]={}),i=n.renderProxy=function(t){t.animationName===y&&e()};v.each(k,function(e){o(t,e,i)}),n.reflow=!!t.offsetParent,t.classList.add(x)}function h(t){var e=t[m]||{},n=e.renderProxy;n&&(v.each(k,function(e){r(t,e,n)}),delete e.renderProxy),t.classList.remove(x)}function f(t,e,n){var i=t[m]||(t[m]={}),a=i.resizer=d(u(function(){if(i.resizer)return e(l("resize",n))}));c(t,function(){if(i.resizer){var e=t.parentNode;e&&e!==a.parentNode&&e.insertBefore(a,e.firstChild),a._reset()}})}function g(t){var e=t[m]||{},n=e.resizer;delete e.resizer,h(t),n&&n.parentNode&&n.parentNode.removeChild(n)}function p(t,e){var n=t._style||document.createElement("style");t._style||(t._style=n,e="/* Chart.js */\n"+e,n.setAttribute("type","text/css"),document.getElementsByTagName("head")[0].appendChild(n)),n.appendChild(document.createTextNode(e))}var v=t(45),m="$chartjs",b="chartjs-",x=b+"render-monitor",y=b+"render-animation",k=["animationstart","webkitAnimationStart"],w={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},M=!!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};e.exports={_enabled:"undefined"!=typeof window&&"undefined"!=typeof document,initialize:function(){var t="from{opacity:0.99}to{opacity:1}";p(this,"@-webkit-keyframes "+y+"{"+t+"}@keyframes "+y+"{"+t+"}."+x+"{-webkit-animation:"+y+" 0.001s;animation:"+y+" 0.001s;}")},acquireContext:function(t,e){"string"==typeof t?t=document.getElementById(t):t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas);var n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(a(t,e),n):null},releaseContext:function(t){var e=t.canvas;if(e[m]){var n=e[m].initial;["height","width"].forEach(function(t){var i=n[t];v.isNullOrUndef(i)?e.removeAttribute(t):e.setAttribute(t,i)}),v.each(n.style||{},function(t,n){e.style[n]=t}),e.width=e.width,delete e[m]}},addEventListener:function(t,e,n){var i=t.canvas;if("resize"!==e){var a=n[m]||(n[m]={});o(i,e,(a.proxies||(a.proxies={}))[t.id+"_"+e]=function(e){n(s(e,t))})}else f(i,n,t)},removeEventListener:function(t,e,n){var i=t.canvas;if("resize"!==e){var a=((n[m]||{}).proxies||{})[t.id+"_"+e];a&&r(i,e,a)}else g(i)}},v.addEvent=o,v.removeEvent=r},{45:45}],48:[function(t,e,n){"use strict";var i=t(45),a=t(46),o=t(47),r=o._enabled?o:a;e.exports=i.extend({initialize:function(){},acquireContext:function(){},releaseContext:function(){},addEventListener:function(){},removeEventListener:function(){}},r)},{45:45,46:46,47:47}],49:[function(t,e,n){"use strict";var i=t(25),a=t(40),o=t(45);i._set("global",{plugins:{filler:{propagate:!0}}}),e.exports=function(){function t(t,e,n){var i,a=t._model||{},o=a.fill;if(void 0===o&&(o=!!a.backgroundColor),!1===o||null===o)return!1;if(!0===o)return"origin";if(i=parseFloat(o,10),isFinite(i)&&Math.floor(i)===i)return"-"!==o[0]&&"+"!==o[0]||(i=e+i),!(i===e||i<0||i>=n)&&i;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 e(t){var e,n=t.el._model||{},i=t.el._scale||{},a=t.fill,o=null;if(isFinite(a))return null;if("start"===a?o=void 0===n.scaleBottom?i.bottom:n.scaleBottom:"end"===a?o=void 0===n.scaleTop?i.top:n.scaleTop:void 0!==n.scaleZero?o=n.scaleZero:i.getBasePosition?o=i.getBasePosition():i.getBasePixel&&(o=i.getBasePixel()),void 0!==o&&null!==o){if(void 0!==o.x&&void 0!==o.y)return o;if("number"==typeof o&&isFinite(o))return e=i.isHorizontal(),{x:e?o:null,y:e?null:o}}return null}function n(t,e,n){var i,a=t[e].fill,o=[e];if(!n)return a;for(;!1!==a&&-1===o.indexOf(a);){if(!isFinite(a))return a;if(!(i=t[a]))return!1;if(i.visible)return a;o.push(a),a=i.fill}return!1}function r(t){var e=t.fill,n="dataset";return!1===e?null:(isFinite(e)||(n="boundary"),d[n](t))}function l(t){return t&&!t.skip}function s(t,e,n,i,a){var r;if(i&&a){for(t.moveTo(e[0].x,e[0].y),r=1;r<i;++r)o.canvas.lineTo(t,e[r-1],e[r]);for(t.lineTo(n[a-1].x,n[a-1].y),r=a-1;r>0;--r)o.canvas.lineTo(t,n[r],n[r-1],!0)}}function u(t,e,n,i,a,o){var r,u,d,c,h,f,g,p=e.length,v=i.spanGaps,m=[],b=[],x=0,y=0;for(t.beginPath(),r=0,u=p+!!o;r<u;++r)h=n(c=e[d=r%p]._view,d,i),f=l(c),g=l(h),f&&g?(x=m.push(c),y=b.push(h)):x&&y&&(v?(f&&m.push(c),g&&b.push(h)):(s(t,m,b,x,y),x=y=0,m=[],b=[]));s(t,m,b,x,y),t.closePath(),t.fillStyle=a,t.fill()}var d={dataset:function(t){var e=t.fill,n=t.chart,i=n.getDatasetMeta(e),a=i&&n.isDatasetVisible(e)&&i.dataset._children||[],o=a.length||0;return o?function(t,e){return e<o&&a[e]._view||null}:null},boundary:function(t){var e=t.boundary,n=e?e.x:null,i=e?e.y:null;return function(t){return{x:null===n?t.x:n,y:null===i?t.y:i}}}};return{id:"filler",afterDatasetsUpdate:function(i,o){var l,s,u,d,c=(i.data.datasets||[]).length,h=o.propagate,f=[];for(s=0;s<c;++s)d=null,(u=(l=i.getDatasetMeta(s)).dataset)&&u._model&&u instanceof a.Line&&(d={visible:i.isDatasetVisible(s),fill:t(u,s,c),chart:i,el:u}),l.$filler=d,f.push(d);for(s=0;s<c;++s)(d=f[s])&&(d.fill=n(f,s,h),d.boundary=e(d),d.mapper=r(d))},beforeDatasetDraw:function(t,e){var n=e.meta.$filler;if(n){var a=t.ctx,r=n.el,l=r._view,s=r._children||[],d=n.mapper,c=l.backgroundColor||i.global.defaultColor;d&&c&&s.length&&(o.canvas.clipArea(a,t.chartArea),u(a,s,d,l,c,r._loop),o.canvas.unclipArea(a))}}}}},{25:25,40:40,45:45}],50:[function(t,e,n){"use strict";var i=t(25),a=t(26),o=t(45);i._set("global",{legend:{display:!0,position:"top",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(t,e){var n=e.datasetIndex,i=this.chart,a=i.getDatasetMeta(n);a.hidden=null===a.hidden?!i.data.datasets[n].hidden:null,i.update()},onHover:null,labels:{boxWidth:40,padding:10,generateLabels:function(t){var e=t.data;return o.isArray(e.datasets)?e.datasets.map(function(e,n){return{text:e.label,fillStyle:o.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('<ul class="'+t.id+'-legend">');for(var n=0;n<t.data.datasets.length;n++)e.push('<li><span style="background-color:'+t.data.datasets[n].backgroundColor+'"></span>'),t.data.datasets[n].label&&e.push(t.data.datasets[n].label),e.push("</li>");return e.push("</ul>"),e.join("")}}),e.exports=function(t){function e(t,e){return t.usePointStyle?e*Math.SQRT2:t.boxWidth}function n(e,n){var i=new t.Legend({ctx:e.ctx,options:n,chart:e});r.configure(e,i,n),r.addBox(e,i),e.legend=i}var r=t.layoutService,l=o.noop;return t.Legend=a.extend({initialize:function(t){o.extend(this,t),this.legendHitBoxes=[],this.doughnutMode=!1},beforeUpdate:l,update:function(t,e,n){var i=this;return i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:l,beforeSetDimensions:l,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:l,beforeBuildLabels:l,buildLabels:function(){var t=this,e=t.options.labels||{},n=o.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:l,beforeFit:l,fit:function(){var t=this,n=t.options,a=n.labels,r=n.display,l=t.ctx,s=i.global,u=o.valueOrDefault,d=u(a.fontSize,s.defaultFontSize),c=u(a.fontStyle,s.defaultFontStyle),h=u(a.fontFamily,s.defaultFontFamily),f=o.fontString(d,c,h),g=t.legendHitBoxes=[],p=t.minSize,v=t.isHorizontal();if(v?(p.width=t.maxWidth,p.height=r?10:0):(p.width=r?10:0,p.height=t.maxHeight),r)if(l.font=f,v){var m=t.lineWidths=[0],b=t.legendItems.length?d+a.padding:0;l.textAlign="left",l.textBaseline="top",o.each(t.legendItems,function(n,i){var o=e(a,d)+d/2+l.measureText(n.text).width;m[m.length-1]+o+a.padding>=t.width&&(b+=d+a.padding,m[m.length]=t.left),g[i]={left:0,top:0,width:o,height:d},m[m.length-1]+=o+a.padding}),p.height+=b}else{var x=a.padding,y=t.columnWidths=[],k=a.padding,w=0,M=0,S=d+x;o.each(t.legendItems,function(t,n){var i=e(a,d)+d/2+l.measureText(t.text).width;M+S>p.height&&(k+=w+a.padding,y.push(w),w=0,M=0),w=Math.max(w,i),M+=S,g[n]={left:0,top:0,width:i,height:d}}),k+=w,y.push(w),p.width+=k}t.width=p.width,t.height=p.height},afterFit:l,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var t=this,n=t.options,a=n.labels,r=i.global,l=r.elements.line,s=t.width,u=t.lineWidths;if(n.display){var d,c=t.ctx,h=o.valueOrDefault,f=h(a.fontColor,r.defaultFontColor),g=h(a.fontSize,r.defaultFontSize),p=h(a.fontStyle,r.defaultFontStyle),v=h(a.fontFamily,r.defaultFontFamily),m=o.fontString(g,p,v);c.textAlign="left",c.textBaseline="middle",c.lineWidth=.5,c.strokeStyle=f,c.fillStyle=f,c.font=m;var b=e(a,g),x=t.legendHitBoxes,y=function(t,e,i){if(!(isNaN(b)||b<=0)){c.save(),c.fillStyle=h(i.fillStyle,r.defaultColor),c.lineCap=h(i.lineCap,l.borderCapStyle),c.lineDashOffset=h(i.lineDashOffset,l.borderDashOffset),c.lineJoin=h(i.lineJoin,l.borderJoinStyle),c.lineWidth=h(i.lineWidth,l.borderWidth),c.strokeStyle=h(i.strokeStyle,r.defaultColor);var a=0===h(i.lineWidth,l.borderWidth);if(c.setLineDash&&c.setLineDash(h(i.lineDash,l.borderDash)),n.labels&&n.labels.usePointStyle){var s=g*Math.SQRT2/2,u=s/Math.SQRT2,d=t+u,f=e+u;o.canvas.drawPoint(c,i.pointStyle,s,d,f)}else a||c.strokeRect(t,e,b,g),c.fillRect(t,e,b,g);c.restore()}},k=function(t,e,n,i){var a=g/2,o=b+a+t,r=e+a;c.fillText(n.text,o,r),n.hidden&&(c.beginPath(),c.lineWidth=2,c.moveTo(o,r),c.lineTo(o+i,r),c.stroke())},w=t.isHorizontal();d=w?{x:t.left+(s-u[0])/2,y:t.top+a.padding,line:0}:{x:t.left+a.padding,y:t.top+a.padding,line:0};var M=g+a.padding;o.each(t.legendItems,function(e,n){var i=c.measureText(e.text).width,o=b+g/2+i,r=d.x,l=d.y;w?r+o>=s&&(l=d.y+=M,d.line++,r=d.x=t.left+(s-u[d.line])/2):l+M>t.bottom&&(r=d.x=r+t.columnWidths[d.line]+a.padding,l=d.y=t.top+a.padding,d.line++),y(r,l,e),x[n].left=r,x[n].top=l,k(r,l,e,i),w?d.x+=o+a.padding:d.y+=M})}},handleEvent:function(t){var e=this,n=e.options,i="mouseup"===t.type?"click":t.type,a=!1;if("mousemove"===i){if(!n.onHover)return}else{if("click"!==i)return;if(!n.onClick)return}var o=t.x,r=t.y;if(o>=e.left&&o<=e.right&&r>=e.top&&r<=e.bottom)for(var l=e.legendHitBoxes,s=0;s<l.length;++s){var u=l[s];if(o>=u.left&&o<=u.left+u.width&&r>=u.top&&r<=u.top+u.height){if("click"===i){n.onClick.call(e,t.native,e.legendItems[s]),a=!0;break}if("mousemove"===i){n.onHover.call(e,t.native,e.legendItems[s]),a=!0;break}}}return a}}),{id:"legend",beforeInit:function(t){var e=t.options.legend;e&&n(t,e)},beforeUpdate:function(t){var e=t.options.legend,a=t.legend;e?(o.mergeIf(e,i.global.legend),a?(r.configure(t,a,e),a.options=e):n(t,e)):a&&(r.removeBox(t,a),delete t.legend)},afterEvent:function(t,e){var n=t.legend;n&&n.handleEvent(e)}}}},{25:25,26:26,45:45}],51:[function(t,e,n){"use strict";var i=t(25),a=t(26),o=t(45);i._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,lineHeight:1.2,padding:10,position:"top",text:"",weight:2e3}}),e.exports=function(t){function e(e,i){var a=new t.Title({ctx:e.ctx,options:i,chart:e});n.configure(e,a,i),n.addBox(e,a),e.titleBlock=a}var n=t.layoutService,r=o.noop;return t.Title=a.extend({initialize:function(t){var e=this;o.extend(e,t),e.legendHitBoxes=[]},beforeUpdate:r,update:function(t,e,n){var i=this;return i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:r,beforeSetDimensions:r,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:r,beforeBuildLabels:r,buildLabels:r,afterBuildLabels:r,beforeFit:r,fit:function(){var t=this,e=o.valueOrDefault,n=t.options,a=n.display,r=e(n.fontSize,i.global.defaultFontSize),l=t.minSize,s=o.isArray(n.text)?n.text.length:1,u=o.options.toLineHeight(n.lineHeight,r),d=a?s*u+2*n.padding:0;t.isHorizontal()?(l.width=t.maxWidth,l.height=d):(l.width=d,l.height=t.maxHeight),t.width=l.width,t.height=l.height},afterFit:r,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this,e=t.ctx,n=o.valueOrDefault,a=t.options,r=i.global;if(a.display){var l,s,u,d=n(a.fontSize,r.defaultFontSize),c=n(a.fontStyle,r.defaultFontStyle),h=n(a.fontFamily,r.defaultFontFamily),f=o.fontString(d,c,h),g=o.options.toLineHeight(a.lineHeight,d),p=g/2+a.padding,v=0,m=t.top,b=t.left,x=t.bottom,y=t.right;e.fillStyle=n(a.fontColor,r.defaultFontColor),e.font=f,t.isHorizontal()?(s=b+(y-b)/2,u=m+p,l=y-b):(s="left"===a.position?b+p:y-p,u=m+(x-m)/2,l=x-m,v=Math.PI*("left"===a.position?-.5:.5)),e.save(),e.translate(s,u),e.rotate(v),e.textAlign="center",e.textBaseline="middle";var k=a.text;if(o.isArray(k))for(var w=0,M=0;M<k.length;++M)e.fillText(k[M],0,w,l),w+=g;else e.fillText(k,0,0,l);e.restore()}}}),{id:"title",beforeInit:function(t){var n=t.options.title;n&&e(t,n)},beforeUpdate:function(a){var r=a.options.title,l=a.titleBlock;r?(o.mergeIf(r,i.global.title),l?(n.configure(a,l,r),l.options=r):e(a,r)):l&&(t.layoutService.removeBox(a,l),delete a.titleBlock)}}}},{25:25,26:26,45:45}],52:[function(t,e,n){"use strict";e.exports=function(t){var e=t.Scale.extend({getLabels:function(){var t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels},determineDataLimits:function(){var t=this,e=t.getLabels();t.minIndex=0,t.maxIndex=e.length-1;var n;void 0!==t.options.ticks.min&&(n=e.indexOf(t.options.ticks.min),t.minIndex=-1!==n?n:t.minIndex),void 0!==t.options.ticks.max&&(n=e.indexOf(t.options.ticks.max),t.maxIndex=-1!==n?n:t.maxIndex),t.min=e[t.minIndex],t.max=e[t.maxIndex]},buildTicks:function(){var t=this,e=t.getLabels();t.ticks=0===t.minIndex&&t.maxIndex===e.length-1?e:e.slice(t.minIndex,t.maxIndex+1)},getLabelForIndex:function(t,e){var n=this,i=n.chart.data,a=n.isHorizontal();return i.yLabels&&!a?n.getRightValue(i.datasets[e].data[t]):n.ticks[t-n.minIndex]},getPixelForValue:function(t,e){var n,i=this,a=i.options.offset,o=Math.max(i.maxIndex+1-i.minIndex-(a?0:1),1);if(void 0!==t&&null!==t&&(n=i.isHorizontal()?t.x:t.y),void 0!==n||void 0!==t&&isNaN(e)){var r=i.getLabels();t=n||t;var l=r.indexOf(t);e=-1!==l?l:e}if(i.isHorizontal()){var s=i.width/o,u=s*(e-i.minIndex);return a&&(u+=s/2),i.left+Math.round(u)}var d=i.height/o,c=d*(e-i.minIndex);return a&&(c+=d/2),i.top+Math.round(c)},getPixelForTick:function(t){return this.getPixelForValue(this.ticks[t],t+this.minIndex,null)},getValueForPixel:function(t){var e=this,n=e.options.offset,i=Math.max(e._ticks.length-(n?0:1),1),a=e.isHorizontal(),o=(a?e.width:e.height)/i;return t-=a?e.left:e.top,n&&(t-=o/2),(t<=0?0:Math.round(t/o))+e.minIndex},getBasePixel:function(){return this.bottom}});t.scaleService.registerScaleType("category",e,{position:"bottom"})}},{}],53:[function(t,e,n){"use strict";var i=t(25),a=t(45),o=t(34);e.exports=function(t){var e={position:"left",ticks:{callback:o.formatters.linear}},n=t.LinearScaleBase.extend({determineDataLimits:function(){function t(t){return r?t.xAxisID===e.id:t.yAxisID===e.id}var e=this,n=e.options,i=e.chart,o=i.data.datasets,r=e.isHorizontal();e.min=null,e.max=null;var l=n.stacked;if(void 0===l&&a.each(o,function(e,n){if(!l){var a=i.getDatasetMeta(n);i.isDatasetVisible(n)&&t(a)&&void 0!==a.stack&&(l=!0)}}),n.stacked||l){var s={};a.each(o,function(o,r){var l=i.getDatasetMeta(r),u=[l.type,void 0===n.stacked&&void 0===l.stack?r:"",l.stack].join(".");void 0===s[u]&&(s[u]={positiveValues:[],negativeValues:[]});var d=s[u].positiveValues,c=s[u].negativeValues;i.isDatasetVisible(r)&&t(l)&&a.each(o.data,function(t,i){var a=+e.getRightValue(t);isNaN(a)||l.data[i].hidden||(d[i]=d[i]||0,c[i]=c[i]||0,n.relativePoints?d[i]=100:a<0?c[i]+=a:d[i]+=a)})}),a.each(s,function(t){var n=t.positiveValues.concat(t.negativeValues),i=a.min(n),o=a.max(n);e.min=null===e.min?i:Math.min(e.min,i),e.max=null===e.max?o:Math.max(e.max,o)})}else a.each(o,function(n,o){var r=i.getDatasetMeta(o);i.isDatasetVisible(o)&&t(r)&&a.each(n.data,function(t,n){var i=+e.getRightValue(t);isNaN(i)||r.data[n].hidden||(null===e.min?e.min=i:i<e.min&&(e.min=i),null===e.max?e.max=i:i>e.max&&(e.max=i))})});e.min=isFinite(e.min)&&!isNaN(e.min)?e.min:0,e.max=isFinite(e.max)&&!isNaN(e.max)?e.max:1,this.handleTickRangeOptions()},getTickLimit:function(){var t,e=this,n=e.options.ticks;if(e.isHorizontal())t=Math.min(n.maxTicksLimit?n.maxTicksLimit:11,Math.ceil(e.width/50));else{var o=a.valueOrDefault(n.fontSize,i.global.defaultFontSize);t=Math.min(n.maxTicksLimit?n.maxTicksLimit:11,Math.ceil(e.height/(2*o)))}return t},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,n=this,i=n.start,a=+n.getRightValue(t),o=n.end-i;return n.isHorizontal()?(e=n.left+n.width/o*(a-i),Math.round(e)):(e=n.bottom-n.height/o*(a-i),Math.round(e))},getValueForPixel:function(t){var e=this,n=e.isHorizontal(),i=n?e.width:e.height,a=(n?t-e.left:e.bottom-t)/i;return e.start+(e.end-e.start)*a},getPixelForTick:function(t){return this.getPixelForValue(this.ticksAsNumbers[t])}});t.scaleService.registerScaleType("linear",n,e)}},{25:25,34:34,45:45}],54:[function(t,e,n){"use strict";var i=t(45),a=t(34);e.exports=function(t){var e=i.noop;t.LinearScaleBase=t.Scale.extend({getRightValue:function(e){return"string"==typeof e?+e:t.Scale.prototype.getRightValue.call(this,e)},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;if(e.beginAtZero){var n=i.sign(t.min),a=i.sign(t.max);n<0&&a<0?t.max=0:n>0&&a>0&&(t.min=0)}var o=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)),o!==r&&t.min>=t.max&&(o?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,e.beginAtZero||t.min--)},getTickLimit:e,handleDirectionalChanges:e,buildTicks:function(){var t=this,e=t.options.ticks,n=t.getTickLimit(),o={maxTicks:n=Math.max(2,n),min:e.min,max:e.max,stepSize:i.valueOrDefault(e.fixedStepSize,e.stepSize)},r=t.ticks=a.generators.linear(o,t);t.handleDirectionalChanges(),t.max=i.max(r),t.min=i.min(r),e.reverse?(r.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max)},convertTicksToLabels:function(){var e=this;e.ticksAsNumbers=e.ticks.slice(),e.zeroLineIndex=e.ticks.indexOf(0),t.Scale.prototype.convertTicksToLabels.call(e)}})}},{34:34,45:45}],55:[function(t,e,n){"use strict";var i=t(45),a=t(34);e.exports=function(t){var e={position:"left",ticks:{callback:a.formatters.logarithmic}},n=t.Scale.extend({determineDataLimits:function(){function t(t){return s?t.xAxisID===e.id:t.yAxisID===e.id}var e=this,n=e.options,a=n.ticks,o=e.chart,r=o.data.datasets,l=i.valueOrDefault,s=e.isHorizontal();e.min=null,e.max=null,e.minNotZero=null;var u=n.stacked;if(void 0===u&&i.each(r,function(e,n){if(!u){var i=o.getDatasetMeta(n);o.isDatasetVisible(n)&&t(i)&&void 0!==i.stack&&(u=!0)}}),n.stacked||u){var d={};i.each(r,function(a,r){var l=o.getDatasetMeta(r),s=[l.type,void 0===n.stacked&&void 0===l.stack?r:"",l.stack].join(".");o.isDatasetVisible(r)&&t(l)&&(void 0===d[s]&&(d[s]=[]),i.each(a.data,function(t,i){var a=d[s],o=+e.getRightValue(t);isNaN(o)||l.data[i].hidden||(a[i]=a[i]||0,n.relativePoints?a[i]=100:a[i]+=o)}))}),i.each(d,function(t){var n=i.min(t),a=i.max(t);e.min=null===e.min?n:Math.min(e.min,n),e.max=null===e.max?a:Math.max(e.max,a)})}else i.each(r,function(n,a){var r=o.getDatasetMeta(a);o.isDatasetVisible(a)&&t(r)&&i.each(n.data,function(t,n){var i=+e.getRightValue(t);isNaN(i)||r.data[n].hidden||(null===e.min?e.min=i:i<e.min&&(e.min=i),null===e.max?e.max=i:i>e.max&&(e.max=i),0!==i&&(null===e.minNotZero||i<e.minNotZero)&&(e.minNotZero=i))})});e.min=l(a.min,e.min),e.max=l(a.max,e.max),e.min===e.max&&(0!==e.min&&null!==e.min?(e.min=Math.pow(10,Math.floor(i.log10(e.min))-1),e.max=Math.pow(10,Math.floor(i.log10(e.max))+1)):(e.min=1,e.max=10))},buildTicks:function(){var t=this,e=t.options.ticks,n={min:e.min,max:e.max},o=t.ticks=a.generators.logarithmic(n,t);t.isHorizontal()||o.reverse(),t.max=i.max(o),t.min=i.min(o),e.reverse?(o.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max)},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),t.Scale.prototype.convertTicksToLabels.call(this)},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},getPixelForTick:function(t){return this.getPixelForValue(this.tickValues[t])},getPixelForValue:function(t){var e,n,a,o=this,r=o.start,l=+o.getRightValue(t),s=o.options.ticks;return o.isHorizontal()?(a=i.log10(o.end)-i.log10(r),0===l?n=o.left:(e=o.width,n=o.left+e/a*(i.log10(l)-i.log10(r)))):(e=o.height,0!==r||s.reverse?0===o.end&&s.reverse?(a=i.log10(o.start)-i.log10(o.minNotZero),n=l===o.end?o.top:l===o.minNotZero?o.top+.02*e:o.top+.02*e+.98*e/a*(i.log10(l)-i.log10(o.minNotZero))):0===l?n=s.reverse?o.top:o.bottom:(a=i.log10(o.end)-i.log10(r),e=o.height,n=o.bottom-e/a*(i.log10(l)-i.log10(r))):(a=i.log10(o.end)-i.log10(o.minNotZero),n=l===r?o.bottom:l===o.minNotZero?o.bottom-.02*e:o.bottom-.02*e-.98*e/a*(i.log10(l)-i.log10(o.minNotZero)))),n},getValueForPixel:function(t){var e,n,a=this,o=i.log10(a.end)-i.log10(a.start);return a.isHorizontal()?(n=a.width,e=a.start*Math.pow(10,(t-a.left)*o/n)):(n=a.height,e=Math.pow(10,(a.bottom-t)*o/n)/a.start),e}});t.scaleService.registerScaleType("logarithmic",n,e)}},{34:34,45:45}],56:[function(t,e,n){"use strict";var i=t(25),a=t(45),o=t(34);e.exports=function(t){function e(t){var e=t.options;return e.angleLines.display||e.pointLabels.display?t.chart.data.labels.length:0}function n(t){var e=t.options.pointLabels,n=a.valueOrDefault(e.fontSize,v.defaultFontSize),i=a.valueOrDefault(e.fontStyle,v.defaultFontStyle),o=a.valueOrDefault(e.fontFamily,v.defaultFontFamily);return{size:n,style:i,family:o,font:a.fontString(n,i,o)}}function r(t,e,n){return a.isArray(n)?{w:a.longestText(t,t.font,n),h:n.length*e+1.5*(n.length-1)*e}:{w:t.measureText(n).width,h:e}}function l(t,e,n,i,a){return t===i||t===a?{start:e-n/2,end:e+n/2}:t<i||t>a?{start:e-n-5,end:e}:{start:e,end:e+n+5}}function s(t){var i,o,s,u=n(t),d=Math.min(t.height/2,t.width/2),c={r:t.width,l:0,t:t.height,b:0},h={};t.ctx.font=u.font,t._pointLabelSizes=[];var f=e(t);for(i=0;i<f;i++){s=t.getPointPosition(i,d),o=r(t.ctx,u.size,t.pointLabels[i]||""),t._pointLabelSizes[i]=o;var g=t.getIndexAngle(i),p=a.toDegrees(g)%360,v=l(p,s.x,o.w,0,180),m=l(p,s.y,o.h,90,270);v.start<c.l&&(c.l=v.start,h.l=g),v.end>c.r&&(c.r=v.end,h.r=g),m.start<c.t&&(c.t=m.start,h.t=g),m.end>c.b&&(c.b=m.end,h.b=g)}t.setReductions(d,c,h)}function u(t){var e=Math.min(t.height/2,t.width/2);t.drawingArea=Math.round(e),t.setCenterPoint(0,0,0,0)}function d(t){return 0===t||180===t?"center":t<180?"left":"right"}function c(t,e,n,i){if(a.isArray(e))for(var o=n.y,r=1.5*i,l=0;l<e.length;++l)t.fillText(e[l],n.x,o),o+=r;else t.fillText(e,n.x,n.y)}function h(t,e,n){90===t||270===t?n.y-=e.h/2:(t>270||t<90)&&(n.y-=e.h)}function f(t){var i=t.ctx,o=a.valueOrDefault,r=t.options,l=r.angleLines,s=r.pointLabels;i.lineWidth=l.lineWidth,i.strokeStyle=l.color;var u=t.getDistanceFromCenterForValue(r.ticks.reverse?t.min:t.max),f=n(t);i.textBaseline="top";for(var g=e(t)-1;g>=0;g--){if(l.display){var p=t.getPointPosition(g,u);i.beginPath(),i.moveTo(t.xCenter,t.yCenter),i.lineTo(p.x,p.y),i.stroke(),i.closePath()}if(s.display){var m=t.getPointPosition(g,u+5),b=o(s.fontColor,v.defaultFontColor);i.font=f.font,i.fillStyle=b;var x=t.getIndexAngle(g),y=a.toDegrees(x);i.textAlign=d(y),h(y,t._pointLabelSizes[g],m),c(i,t.pointLabels[g]||"",m,f.size)}}}function g(t,n,i,o){var r=t.ctx;if(r.strokeStyle=a.valueAtIndexOrDefault(n.color,o-1),r.lineWidth=a.valueAtIndexOrDefault(n.lineWidth,o-1),t.options.gridLines.circular)r.beginPath(),r.arc(t.xCenter,t.yCenter,i,0,2*Math.PI),r.closePath(),r.stroke();else{var l=e(t);if(0===l)return;r.beginPath();var s=t.getPointPosition(0,i);r.moveTo(s.x,s.y);for(var u=1;u<l;u++)s=t.getPointPosition(u,i),r.lineTo(s.x,s.y);r.closePath(),r.stroke()}}function p(t){return a.isNumber(t)?t:0}var v=i.global,m={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0, 0, 0, 0.1)",lineWidth:1},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:o.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(t){return t}}},b=t.LinearScaleBase.extend({setDimensions:function(){var t=this,e=t.options,n=e.ticks;t.width=t.maxWidth,t.height=t.maxHeight,t.xCenter=Math.round(t.width/2),t.yCenter=Math.round(t.height/2);var i=a.min([t.height,t.width]),o=a.valueOrDefault(n.fontSize,v.defaultFontSize);t.drawingArea=e.display?i/2-(o/2+n.backdropPaddingY):i/2},determineDataLimits:function(){var t=this,e=t.chart,n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;a.each(e.data.datasets,function(o,r){if(e.isDatasetVisible(r)){var l=e.getDatasetMeta(r);a.each(o.data,function(e,a){var o=+t.getRightValue(e);isNaN(o)||l.data[a].hidden||(n=Math.min(o,n),i=Math.max(o,i))})}}),t.min=n===Number.POSITIVE_INFINITY?0:n,t.max=i===Number.NEGATIVE_INFINITY?0:i,t.handleTickRangeOptions()},getTickLimit:function(){var t=this.options.ticks,e=a.valueOrDefault(t.fontSize,v.defaultFontSize);return Math.min(t.maxTicksLimit?t.maxTicksLimit:11,Math.ceil(this.drawingArea/(1.5*e)))},convertTicksToLabels:function(){var e=this;t.LinearScaleBase.prototype.convertTicksToLabels.call(e),e.pointLabels=e.chart.data.labels.map(e.options.pointLabels.callback,e)},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},fit:function(){this.options.pointLabels.display?s(this):u(this)},setReductions:function(t,e,n){var i=this,a=e.l/Math.sin(n.l),o=Math.max(e.r-i.width,0)/Math.sin(n.r),r=-e.t/Math.cos(n.t),l=-Math.max(e.b-i.height,0)/Math.cos(n.b);a=p(a),o=p(o),r=p(r),l=p(l),i.drawingArea=Math.min(Math.round(t-(a+o)/2),Math.round(t-(r+l)/2)),i.setCenterPoint(a,o,r,l)},setCenterPoint:function(t,e,n,i){var a=this,o=a.width-e-a.drawingArea,r=t+a.drawingArea,l=n+a.drawingArea,s=a.height-i-a.drawingArea;a.xCenter=Math.round((r+o)/2+a.left),a.yCenter=Math.round((l+s)/2+a.top)},getIndexAngle:function(t){return t*(2*Math.PI/e(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,i=n.getIndexAngle(t)-Math.PI/2;return{x:Math.round(Math.cos(i)*e)+n.xCenter,y:Math.round(Math.sin(i)*e)+n.yCenter}},getPointPositionForValue:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))},getBasePosition:function(){var t=this,e=t.min,n=t.max;return t.getPointPositionForValue(0,t.beginAtZero?0:e<0&&n<0?n:e>0&&n>0?e:0)},draw:function(){var t=this,e=t.options,n=e.gridLines,i=e.ticks,o=a.valueOrDefault;if(e.display){var r=t.ctx,l=this.getIndexAngle(0),s=o(i.fontSize,v.defaultFontSize),u=o(i.fontStyle,v.defaultFontStyle),d=o(i.fontFamily,v.defaultFontFamily),c=a.fontString(s,u,d);a.each(t.ticks,function(e,a){if(a>0||i.reverse){var u=t.getDistanceFromCenterForValue(t.ticksAsNumbers[a]);if(n.display&&0!==a&&g(t,n,u,a),i.display){var d=o(i.fontColor,v.defaultFontColor);if(r.font=c,r.save(),r.translate(t.xCenter,t.yCenter),r.rotate(l),i.showLabelBackdrop){var h=r.measureText(e).width;r.fillStyle=i.backdropColor,r.fillRect(-h/2-i.backdropPaddingX,-u-s/2-i.backdropPaddingY,h+2*i.backdropPaddingX,s+2*i.backdropPaddingY)}r.textAlign="center",r.textBaseline="middle",r.fillStyle=d,r.fillText(e,0,-u),r.restore()}}}),(e.angleLines.display||e.pointLabels.display)&&f(t)}}});t.scaleService.registerScaleType("radialLinear",b,m)}},{25:25,34:34,45:45}],57:[function(t,e,n){"use strict";function i(t,e){return t-e}function a(t){var e,n,i,a={},o=[];for(e=0,n=t.length;e<n;++e)a[i=t[e]]||(a[i]=!0,o.push(i));return o}function o(t,e,n,i){if("linear"===i||!t.length)return[{time:e,pos:0},{time:n,pos:1}];var a,o,r,l,s,u=[],d=[e];for(a=0,o=t.length;a<o;++a)(l=t[a])>e&&l<n&&d.push(l);for(d.push(n),a=0,o=d.length;a<o;++a)s=d[a+1],r=d[a-1],l=d[a],void 0!==r&&void 0!==s&&Math.round((s+r)/2)===l||u.push({time:l,pos:a/(o-1)});return u}function r(t,e,n){for(var i,a,o,r=0,l=t.length-1;r>=0&&r<=l;){if(i=r+l>>1,a=t[i-1]||null,o=t[i],!a)return{lo:null,hi:o};if(o[e]<n)r=i+1;else{if(!(a[e]>n))return{lo:a,hi:o};l=i-1}}return{lo:o,hi:null}}function l(t,e,n,i){var a=r(t,e,n),o=a.lo?a.hi?a.lo:t[t.length-2]:t[0],l=a.lo?a.hi?a.hi:t[t.length-1]:t[1],s=l[e]-o[e],u=s?(n-o[e])/s:0,d=(l[i]-o[i])*u;return o[i]+d}function s(t,e){var n=e.parser,i=e.parser||e.format;return"function"==typeof n?n(t):"string"==typeof t&&"string"==typeof i?m(t,i):(t instanceof m||(t=m(t)),t.isValid()?t:"function"==typeof i?i(t):t)}function u(t,e){if(x.isNullOrUndef(t))return null;var n=e.options.time,i=s(e.getRightValue(t),n);return i.isValid()?(n.round&&i.startOf(n.round),i.valueOf()):null}function d(t,e,n,i){var a,o,r,l=e-t,s=w[n],u=s.size,d=s.steps;if(!d)return Math.ceil(l/((i||1)*u));for(a=0,o=d.length;a<o&&(r=d[a],!(Math.ceil(l/(u*r))<=i));++a);return r}function c(t,e,n,i){var a,o,r,l=M.length;for(a=M.indexOf(t);a<l-1;++a)if(o=w[M[a]],r=o.steps?o.steps[o.steps.length-1]:k,o.common&&Math.ceil((n-e)/(r*o.size))<=i)return M[a];return M[l-1]}function h(t,e,n,i){var a,o,r=m.duration(m(i).diff(m(n)));for(a=M.length-1;a>=M.indexOf(e);a--)if(o=M[a],w[o].common&&r.as(o)>=t.length)return o;return M[e?M.indexOf(e):0]}function f(t){for(var e=M.indexOf(t)+1,n=M.length;e<n;++e)if(w[M[e]].common)return M[e]}function g(t,e,n,i){var a,o=i.time,r=o.unit||c(o.minUnit,t,e,n),l=f(r),s=x.valueOrDefault(o.stepSize,o.unitStepSize),u="week"===r&&o.isoWeekday,h=i.ticks.major.enabled,g=w[r],p=m(t),v=m(e),b=[];for(s||(s=d(t,e,r,n)),u&&(p=p.isoWeekday(u),v=v.isoWeekday(u)),p=p.startOf(u?"day":r),(v=v.startOf(u?"day":r))<e&&v.add(1,r),a=m(p),h&&l&&!u&&!o.round&&(a.startOf(l),a.add(~~((p-a)/(g.size*s))*s,r));a<v;a.add(s,r))b.push(+a);return b.push(+a),b}function p(t,e,n,i,a){var o,r,s=0,u=0;return a.offset&&e.length&&(a.time.min||(o=e.length>1?e[1]:i,r=e[0],s=(l(t,"time",o,"pos")-l(t,"time",r,"pos"))/2),a.time.max||(o=e[e.length-1],r=e.length>1?e[e.length-2]:n,u=(l(t,"time",o,"pos")-l(t,"time",r,"pos"))/2)),{left:s,right:u}}function v(t,e){var n,i,a,o,r=[];for(n=0,i=t.length;n<i;++n)a=t[n],o=!!e&&a===+m(a).startOf(e),r.push({value:a,major:o});return r}var m=t(1);m="function"==typeof m?m:window.moment;var b=t(25),x=t(45),y=Number.MIN_SAFE_INTEGER||-9007199254740991,k=Number.MAX_SAFE_INTEGER||9007199254740991,w={millisecond:{common:!0,size:1,steps:[1,2,5,10,20,50,100,250,500]},second:{common:!0,size:1e3,steps:[1,2,5,10,30]},minute:{common:!0,size:6e4,steps:[1,2,5,10,30]},hour:{common:!0,size:36e5,steps:[1,2,3,6,12]},day:{common:!0,size:864e5,steps:[1,2,5]},week:{common:!1,size:6048e5,steps:[1,2,3,4]},month:{common:!0,size:2628e6,steps:[1,2,3]},quarter:{common:!1,size:7884e6,steps:[1,2,3,4]},year:{common:!0,size:3154e7}},M=Object.keys(w);e.exports=function(t){var e=t.Scale.extend({initialize:function(){if(!m)throw new Error("Chart.js - Moment.js could not be found! You must include it before Chart.js to use the time scale. Download at https://momentjs.com");this.mergeTicksOptions(),t.Scale.prototype.initialize.call(this)},update:function(){var e=this,n=e.options;return n.time&&n.time.format&&console.warn("options.time.format is deprecated and replaced by options.time.parser."),t.Scale.prototype.update.apply(e,arguments)},getRightValue:function(e){return e&&void 0!==e.t&&(e=e.t),t.Scale.prototype.getRightValue.call(this,e)},determineDataLimits:function(){var t,e,n,o,r,l,s=this,d=s.chart,c=s.options.time,h=k,f=y,g=[],p=[],v=[];for(t=0,n=d.data.labels.length;t<n;++t)v.push(u(d.data.labels[t],s));for(t=0,n=(d.data.datasets||[]).length;t<n;++t)if(d.isDatasetVisible(t))if(r=d.data.datasets[t].data,x.isObject(r[0]))for(p[t]=[],e=0,o=r.length;e<o;++e)l=u(r[e],s),g.push(l),p[t][e]=l;else g.push.apply(g,v),p[t]=v.slice(0);else p[t]=[];v.length&&(v=a(v).sort(i),h=Math.min(h,v[0]),f=Math.max(f,v[v.length-1])),g.length&&(g=a(g).sort(i),h=Math.min(h,g[0]),f=Math.max(f,g[g.length-1])),h=u(c.min,s)||h,f=u(c.max,s)||f,h=h===k?+m().startOf("day"):h,f=f===y?+m().endOf("day")+1:f,s.min=Math.min(h,f),s.max=Math.max(h+1,f),s._horizontal=s.isHorizontal(),s._table=[],s._timestamps={data:g,datasets:p,labels:v}},buildTicks:function(){var t,e,n,i=this,a=i.min,r=i.max,l=i.options,s=l.time,d=[],c=[];switch(l.ticks.source){case"data":d=i._timestamps.data;break;case"labels":d=i._timestamps.labels;break;case"auto":default:d=g(a,r,i.getLabelCapacity(a),l)}for("ticks"===l.bounds&&d.length&&(a=d[0],r=d[d.length-1]),a=u(s.min,i)||a,r=u(s.max,i)||r,t=0,e=d.length;t<e;++t)(n=d[t])>=a&&n<=r&&c.push(n);return i.min=a,i.max=r,i._unit=s.unit||h(c,s.minUnit,i.min,i.max),i._majorUnit=f(i._unit),i._table=o(i._timestamps.data,a,r,l.distribution),i._offsets=p(i._table,c,a,r,l),v(c,i._majorUnit)},getLabelForIndex:function(t,e){var n=this,i=n.chart.data,a=n.options.time,o=i.labels&&t<i.labels.length?i.labels[t]:"",r=i.datasets[e].data[t];return x.isObject(r)&&(o=n.getRightValue(r)),a.tooltipFormat&&(o=s(o,a).format(a.tooltipFormat)),o},tickFormatFunction:function(t,e,n,i){var a=this,o=a.options,r=t.valueOf(),l=o.time.displayFormats,s=l[a._unit],u=a._majorUnit,d=l[u],c=t.clone().startOf(u).valueOf(),h=o.ticks.major,f=h.enabled&&u&&d&&r===c,g=t.format(i||(f?d:s)),p=f?h:o.ticks.minor,v=x.valueOrDefault(p.callback,p.userCallback);return v?v(g,e,n):g},convertTicksToLabels:function(t){var e,n,i=[];for(e=0,n=t.length;e<n;++e)i.push(this.tickFormatFunction(m(t[e].value),e,t));return i},getPixelForOffset:function(t){var e=this,n=e._horizontal?e.width:e.height,i=e._horizontal?e.left:e.top,a=l(e._table,"time",t,"pos");return i+n*(e._offsets.left+a)/(e._offsets.left+1+e._offsets.right)},getPixelForValue:function(t,e,n){var i=this,a=null;if(void 0!==e&&void 0!==n&&(a=i._timestamps.datasets[n][e]),null===a&&(a=u(t,i)),null!==a)return i.getPixelForOffset(a)},getPixelForTick:function(t){var e=this.getTicks();return t>=0&&t<e.length?this.getPixelForOffset(e[t].value):null},getValueForPixel:function(t){var e=this,n=e._horizontal?e.width:e.height,i=e._horizontal?e.left:e.top,a=(n?(t-i)/n:0)*(e._offsets.left+1+e._offsets.left)-e._offsets.right,o=l(e._table,"pos",a,"time");return m(o)},getLabelWidth:function(t){var e=this,n=e.options.ticks,i=e.ctx.measureText(t).width,a=x.toRadians(n.maxRotation),o=Math.cos(a),r=Math.sin(a);return i*o+x.valueOrDefault(n.fontSize,b.global.defaultFontSize)*r},getLabelCapacity:function(t){var e=this,n=e.options.time.displayFormats.millisecond,i=e.tickFormatFunction(m(t),0,[],n),a=e.getLabelWidth(i),o=e.isHorizontal()?e.width:e.height;return Math.floor(o/a)}});t.scaleService.registerScaleType("time",e,{position:"bottom",distribution:"linear",bounds:"data",time:{parser:!1,format:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{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"}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}})}},{1:1,25:25,45:45}]},{},[7])(7)});
1
+ /*!
2
+ * Chart.js
3
+ * http://chartjs.org/
4
+ * Version: 2.7.1
5
+ *
6
+ * Copyright 2017 Nick Downie
7
+ * Released under the MIT license
8
+ * https://github.com/chartjs/Chart.js/blob/master/LICENSE.md
9
+ */
10
+ window.robin=window.robin||{};!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window.robin:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Chart=t()}}(function(){return function t(e,n,i){function a(r,l){if(!n[r]){if(!e[r]){var s="function"==typeof require&&require;if(!l&&s)return s(r,!0);if(o)return o(r,!0);var u=new Error("Cannot find module '"+r+"'");throw u.code="MODULE_NOT_FOUND",u}var d=n[r]={exports:{}};e[r][0].call(d.exports,function(t){var n=e[r][1][t];return a(n||t)},d,d.exports,t,e,n,i)}return n[r].exports}for(var o="function"==typeof require&&require,r=0;r<i.length;r++)a(i[r]);return a}({1:[function(t,e,n){},{}],2:[function(t,e,n){function i(t){if(t){var e=[0,0,0],n=1,i=t.match(/^#([a-fA-F0-9]{3})$/i);if(i){i=i[1];for(a=0;a<e.length;a++)e[a]=parseInt(i[a]+i[a],16)}else if(i=t.match(/^#([a-fA-F0-9]{6})$/i)){i=i[1];for(a=0;a<e.length;a++)e[a]=parseInt(i.slice(2*a,2*a+2),16)}else if(i=t.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(a=0;a<e.length;a++)e[a]=parseInt(i[a+1]);n=parseFloat(i[4])}else if(i=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(a=0;a<e.length;a++)e[a]=Math.round(2.55*parseFloat(i[a+1]));n=parseFloat(i[4])}else if(i=t.match(/(\w+)/)){if("transparent"==i[1])return[0,0,0,0];if(!(e=c[i[1]]))return}for(var a=0;a<e.length;a++)e[a]=u(e[a],0,255);return n=n||0==n?u(n,0,1):1,e[3]=n,e}}function a(t){if(t){var e=t.match(/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(e){var n=parseFloat(e[4]);return[u(parseInt(e[1]),0,360),u(parseFloat(e[2]),0,100),u(parseFloat(e[3]),0,100),u(isNaN(n)?1:n,0,1)]}}}function o(t){if(t){var e=t.match(/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(e){var n=parseFloat(e[4]);return[u(parseInt(e[1]),0,360),u(parseFloat(e[2]),0,100),u(parseFloat(e[3]),0,100),u(isNaN(n)?1:n,0,1)]}}}function r(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"rgba("+t[0]+", "+t[1]+", "+t[2]+", "+e+")"}function l(t,e){return"rgba("+Math.round(t[0]/255*100)+"%, "+Math.round(t[1]/255*100)+"%, "+Math.round(t[2]/255*100)+"%, "+(e||t[3]||1)+")"}function s(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+e+")"}function u(t,e,n){return Math.min(Math.max(e,t),n)}function d(t){var e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}var c=t(6);e.exports={getRgba:i,getHsla:a,getRgb:function(t){var e=i(t);return e&&e.slice(0,3)},getHsl:function(t){var e=a(t);return e&&e.slice(0,3)},getHwb:o,getAlpha:function(t){var e=i(t);return e?e[3]:(e=a(t))?e[3]:(e=o(t))?e[3]:void 0},hexString:function(t){return"#"+d(t[0])+d(t[1])+d(t[2])},rgbString:function(t,e){return e<1||t[3]&&t[3]<1?r(t,e):"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},rgbaString:r,percentString:function(t,e){return e<1||t[3]&&t[3]<1?l(t,e):"rgb("+Math.round(t[0]/255*100)+"%, "+Math.round(t[1]/255*100)+"%, "+Math.round(t[2]/255*100)+"%)"},percentaString:l,hslString:function(t,e){return e<1||t[3]&&t[3]<1?s(t,e):"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"},hslaString:s,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)]}};var h={};for(var f in c)h[c[f]]=f},{6:6}],3:[function(t,e,n){var i=t(5),a=t(2),o=function(t){if(t instanceof o)return t;if(!(this instanceof o))return new o(t);this.valid=!1,this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1};var e;"string"==typeof t?(e=a.getRgba(t))?this.setValues("rgb",e):(e=a.getHsla(t))?this.setValues("hsl",e):(e=a.getHwb(t))&&this.setValues("hwb",e):"object"==typeof t&&(void 0!==(e=t).r||void 0!==e.red?this.setValues("rgb",e):void 0!==e.l||void 0!==e.lightness?this.setValues("hsl",e):void 0!==e.v||void 0!==e.value?this.setValues("hsv",e):void 0!==e.w||void 0!==e.whiteness?this.setValues("hwb",e):void 0===e.c&&void 0===e.cyan||this.setValues("cmyk",e))};o.prototype={isValid:function(){return this.valid},rgb:function(){return this.setSpace("rgb",arguments)},hsl:function(){return this.setSpace("hsl",arguments)},hsv:function(){return this.setSpace("hsv",arguments)},hwb:function(){return this.setSpace("hwb",arguments)},cmyk:function(){return this.setSpace("cmyk",arguments)},rgbArray:function(){return this.values.rgb},hslArray:function(){return this.values.hsl},hsvArray:function(){return this.values.hsv},hwbArray:function(){var t=this.values;return 1!==t.alpha?t.hwb.concat([t.alpha]):t.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var t=this.values;return t.rgb.concat([t.alpha])},hslaArray:function(){var t=this.values;return t.hsl.concat([t.alpha])},alpha:function(t){return void 0===t?this.values.alpha:(this.setValues("alpha",t),this)},red:function(t){return this.setChannel("rgb",0,t)},green:function(t){return this.setChannel("rgb",1,t)},blue:function(t){return this.setChannel("rgb",2,t)},hue:function(t){return t&&(t=(t%=360)<0?360+t:t),this.setChannel("hsl",0,t)},saturation:function(t){return this.setChannel("hsl",1,t)},lightness:function(t){return this.setChannel("hsl",2,t)},saturationv:function(t){return this.setChannel("hsv",1,t)},whiteness:function(t){return this.setChannel("hwb",1,t)},blackness:function(t){return this.setChannel("hwb",2,t)},value:function(t){return this.setChannel("hsv",2,t)},cyan:function(t){return this.setChannel("cmyk",0,t)},magenta:function(t){return this.setChannel("cmyk",1,t)},yellow:function(t){return this.setChannel("cmyk",2,t)},black:function(t){return this.setChannel("cmyk",3,t)},hexString:function(){return a.hexString(this.values.rgb)},rgbString:function(){return a.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return a.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return a.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return a.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return a.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return a.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return a.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){var t=this.values.rgb;return t[0]<<16|t[1]<<8|t[2]},luminosity:function(){for(var t=this.values.rgb,e=[],n=0;n<t.length;n++){var i=t[n]/255;e[n]=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),n=t.luminosity();return e>n?(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=this,i=t,a=void 0===e?.5:e,o=2*a-1,r=n.alpha()-i.alpha(),l=((o*r==-1?o:(o+r)/(1+o*r))+1)/2,s=1-l;return this.rgb(l*n.red()+s*i.red(),l*n.green()+s*i.green(),l*n.blue()+s*i.blue()).alpha(n.alpha()*a+i.alpha()*(1-a))},toJSON:function(){return this.rgb()},clone:function(){var t,e,n=new o,i=this.values,a=n.values;for(var r in i)i.hasOwnProperty(r)&&(t=i[r],"[object Array]"===(e={}.toString.call(t))?a[r]=t.slice(0):"[object Number]"===e?a[r]=t:console.error("unexpected color value:",t));return n}},o.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},o.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},o.prototype.getValues=function(t){for(var e=this.values,n={},i=0;i<t.length;i++)n[t.charAt(i)]=e[t][i];return 1!==e.alpha&&(n.a=e.alpha),n},o.prototype.setValues=function(t,e){var n,a=this.values,o=this.spaces,r=this.maxes,l=1;if(this.valid=!0,"alpha"===t)l=e;else if(e.length)a[t]=e.slice(0,t.length),l=e[t.length];else if(void 0!==e[t.charAt(0)]){for(n=0;n<t.length;n++)a[t][n]=e[t.charAt(n)];l=e.a}else if(void 0!==e[o[t][0]]){var s=o[t];for(n=0;n<t.length;n++)a[t][n]=e[s[n]];l=e.alpha}if(a.alpha=Math.max(0,Math.min(1,void 0===l?a.alpha:l)),"alpha"===t)return!1;var u;for(n=0;n<t.length;n++)u=Math.max(0,Math.min(r[t][n],a[t][n])),a[t][n]=Math.round(u);for(var d in o)d!==t&&(a[d]=i[t][d](a[t]));return!0},o.prototype.setSpace=function(t,e){var n=e[0];return void 0===n?this.getValues(t):("number"==typeof n&&(n=Array.prototype.slice.call(e)),this.setValues(t,n),this)},o.prototype.setChannel=function(t,e,n){var i=this.values[t];return void 0===n?i[e]:n===i[e]?this:(i[e]=n,this.setValues(t,i),this)},"undefined"!=typeof window&&(window.robin.Color=o),e.exports=o},{2:2,5:5}],4:[function(t,e,n){function i(t){var e,n,i,a=t[0]/255,o=t[1]/255,r=t[2]/255,l=Math.min(a,o,r),s=Math.max(a,o,r),u=s-l;return s==l?e=0:a==s?e=(o-r)/u:o==s?e=2+(r-a)/u:r==s&&(e=4+(a-o)/u),(e=Math.min(60*e,360))<0&&(e+=360),i=(l+s)/2,n=s==l?0:i<=.5?u/(s+l):u/(2-s-l),[e,100*n,100*i]}function a(t){var e,n,i,a=t[0],o=t[1],r=t[2],l=Math.min(a,o,r),s=Math.max(a,o,r),u=s-l;return n=0==s?0:u/s*1e3/10,s==l?e=0:a==s?e=(o-r)/u:o==s?e=2+(r-a)/u:r==s&&(e=4+(a-o)/u),(e=Math.min(60*e,360))<0&&(e+=360),i=s/255*1e3/10,[e,n,i]}function o(t){var e=t[0],n=t[1],a=t[2];return[i(t)[0],100*(1/255*Math.min(e,Math.min(n,a))),100*(a=1-1/255*Math.max(e,Math.max(n,a)))]}function l(t){var e,n,i,a,o=t[0]/255,r=t[1]/255,l=t[2]/255;return a=Math.min(1-o,1-r,1-l),e=(1-o-a)/(1-a)||0,n=(1-r-a)/(1-a)||0,i=(1-l-a)/(1-a)||0,[100*e,100*n,100*i,100*a]}function s(t){return C[JSON.stringify(t)]}function u(t){var e=t[0]/255,n=t[1]/255,i=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*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)),100*(.2126*e+.7152*n+.0722*i),100*(.0193*e+.1192*n+.9505*i)]}function d(t){var e,n,i,a=u(t),o=a[0],r=a[1],l=a[2];return o/=95.047,r/=100,l/=108.883,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,l=l>.008856?Math.pow(l,1/3):7.787*l+16/116,e=116*r-16,n=500*(o-r),i=200*(r-l),[e,n,i]}function c(t){var e,n,i,a,o,r=t[0]/360,l=t[1]/100,s=t[2]/100;if(0==l)return o=255*s,[o,o,o];e=2*s-(n=s<.5?s*(1+l):s+l-s*l),a=[0,0,0];for(var u=0;u<3;u++)(i=r+1/3*-(u-1))<0&&i++,i>1&&i--,o=6*i<1?e+6*(n-e)*i:2*i<1?n:3*i<2?e+(n-e)*(2/3-i)*6:e,a[u]=255*o;return a}function h(t){var e=t[0]/60,n=t[1]/100,i=t[2]/100,a=Math.floor(e)%6,o=e-Math.floor(e),r=255*i*(1-n),l=255*i*(1-n*o),s=255*i*(1-n*(1-o)),i=255*i;switch(a){case 0:return[i,s,r];case 1:return[l,i,r];case 2:return[r,i,s];case 3:return[r,l,i];case 4:return[s,r,i];case 5:return[i,r,l]}}function f(t){var e,n,i,a,o=t[0]/360,l=t[1]/100,s=t[2]/100,u=l+s;switch(u>1&&(l/=u,s/=u),e=Math.floor(6*o),n=1-s,i=6*o-e,0!=(1&e)&&(i=1-i),a=l+i*(n-l),e){default:case 6:case 0:r=n,g=a,b=l;break;case 1:r=a,g=n,b=l;break;case 2:r=l,g=n,b=a;break;case 3:r=l,g=a,b=n;break;case 4:r=a,g=l,b=n;break;case 5:r=n,g=l,b=a}return[255*r,255*g,255*b]}function p(t){var e,n,i,a=t[0]/100,o=t[1]/100,r=t[2]/100,l=t[3]/100;return e=1-Math.min(1,a*(1-l)+l),n=1-Math.min(1,o*(1-l)+l),i=1-Math.min(1,r*(1-l)+l),[255*e,255*n,255*i]}function v(t){var e,n,i,a=t[0]/100,o=t[1]/100,r=t[2]/100;return e=3.2406*a+-1.5372*o+-.4986*r,n=-.9689*a+1.8758*o+.0415*r,i=.0557*a+-.204*o+1.057*r,e=e>.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,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*=12.92,e=Math.min(Math.max(0,e),1),n=Math.min(Math.max(0,n),1),i=Math.min(Math.max(0,i),1),[255*e,255*n,255*i]}function m(t){var e,n,i,a=t[0],o=t[1],r=t[2];return a/=95.047,o/=100,r/=108.883,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,e=116*o-16,n=500*(a-o),i=200*(o-r),[e,n,i]}function x(t){var e,n,i,a,o=t[0],r=t[1],l=t[2];return o<=8?a=(n=100*o/903.3)/100*7.787+16/116:(n=100*Math.pow((o+16)/116,3),a=Math.pow(n/100,1/3)),e=e/95.047<=.008856?e=95.047*(r/500+a-16/116)/7.787:95.047*Math.pow(r/500+a,3),i=i/108.883<=.008859?i=108.883*(a-l/200-16/116)/7.787:108.883*Math.pow(a-l/200,3),[e,n,i]}function y(t){var e,n,i,a=t[0],o=t[1],r=t[2];return e=Math.atan2(r,o),(n=360*e/2/Math.PI)<0&&(n+=360),i=Math.sqrt(o*o+r*r),[a,i,n]}function k(t){return v(x(t))}function w(t){var e,n,i,a=t[0],o=t[1];return i=t[2]/360*2*Math.PI,e=o*Math.cos(i),n=o*Math.sin(i),[a,e,n]}function M(t){return S[t]}e.exports={rgb2hsl:i,rgb2hsv:a,rgb2hwb:o,rgb2cmyk:l,rgb2keyword:s,rgb2xyz:u,rgb2lab:d,rgb2lch:function(t){return y(d(t))},hsl2rgb:c,hsl2hsv:function(t){var e,n,i=t[0],a=t[1]/100,o=t[2]/100;return 0===o?[0,0,0]:(o*=2,a*=o<=1?o:2-o,n=(o+a)/2,e=2*a/(o+a),[i,100*e,100*n])},hsl2hwb:function(t){return o(c(t))},hsl2cmyk:function(t){return l(c(t))},hsl2keyword:function(t){return s(c(t))},hsv2rgb:h,hsv2hsl:function(t){var e,n,i=t[0],a=t[1]/100,o=t[2]/100;return n=(2-a)*o,e=a*o,e/=n<=1?n:2-n,e=e||0,n/=2,[i,100*e,100*n]},hsv2hwb:function(t){return o(h(t))},hsv2cmyk:function(t){return l(h(t))},hsv2keyword:function(t){return s(h(t))},hwb2rgb:f,hwb2hsl:function(t){return i(f(t))},hwb2hsv:function(t){return a(f(t))},hwb2cmyk:function(t){return l(f(t))},hwb2keyword:function(t){return s(f(t))},cmyk2rgb:p,cmyk2hsl:function(t){return i(p(t))},cmyk2hsv:function(t){return a(p(t))},cmyk2hwb:function(t){return o(p(t))},cmyk2keyword:function(t){return s(p(t))},keyword2rgb:M,keyword2hsl:function(t){return i(M(t))},keyword2hsv:function(t){return a(M(t))},keyword2hwb:function(t){return o(M(t))},keyword2cmyk:function(t){return l(M(t))},keyword2lab:function(t){return d(M(t))},keyword2xyz:function(t){return u(M(t))},xyz2rgb:v,xyz2lab:m,xyz2lch:function(t){return y(m(t))},lab2xyz:x,lab2rgb:k,lab2lch:y,lch2lab:w,lch2xyz:function(t){return x(w(t))},lch2rgb:function(t){return k(w(t))}};var S={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 S)C[JSON.stringify(S[_])]=_},{}],5:[function(t,e,n){var i=t(4),a=function(){return new u};for(var o in i){a[o+"Raw"]=function(t){return function(e){return"number"==typeof e&&(e=Array.prototype.slice.call(arguments)),i[t](e)}}(o);var r=/(\w+)2(\w+)/.exec(o),l=r[1],s=r[2];(a[l]=a[l]||{})[s]=a[o]=function(t){return function(e){"number"==typeof e&&(e=Array.prototype.slice.call(arguments));var n=i[t](e);if("string"==typeof n||void 0===n)return n;for(var a=0;a<n.length;a++)n[a]=Math.round(n[a]);return n}}(o)}var u=function(){this.convs={}};u.prototype.routeSpace=function(t,e){var n=e[0];return void 0===n?this.getValues(t):("number"==typeof n&&(n=Array.prototype.slice.call(e)),this.setValues(t,n))},u.prototype.setValues=function(t,e){return this.space=t,this.convs={},this.convs[t]=e,this},u.prototype.getValues=function(t){var e=this.convs[t];if(!e){var n=this.space,i=this.convs[n];e=a[n][t](i),this.convs[t]=e}return e},["rgb","hsl","hsv","cmyk","keyword"].forEach(function(t){u.prototype[t]=function(e){return this.routeSpace(t,arguments)}}),e.exports=a},{4:4}],6:[function(t,e,n){"use strict";e.exports={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]}},{}],7:[function(t,e,n){var i=t(29)();i.helpers=t(45),t(27)(i),i.defaults=t(25),i.Element=t(26),i.elements=t(40),i.Interaction=t(28),i.platform=t(48),t(31)(i),t(22)(i),t(23)(i),t(24)(i),t(30)(i),t(33)(i),t(32)(i),t(35)(i),t(54)(i),t(52)(i),t(53)(i),t(55)(i),t(56)(i),t(57)(i),t(15)(i),t(16)(i),t(17)(i),t(18)(i),t(19)(i),t(20)(i),t(21)(i),t(8)(i),t(9)(i),t(10)(i),t(11)(i),t(12)(i),t(13)(i),t(14)(i);var a=[];a.push(t(49)(i),t(50)(i),t(51)(i)),i.plugins.register(a),i.platform.initialize(),e.exports=i,"undefined"!=typeof window&&(window.robin.Chart=i),i.canvasHelpers=i.helpers.canvas},{10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18,19:19,20:20,21:21,22:22,23:23,24:24,25:25,26:26,27:27,28:28,29:29,30:30,31:31,32:32,33:33,35:35,40:40,45:45,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,8:8,9:9}],8:[function(t,e,n){"use strict";e.exports=function(t){t.Bar=function(e,n){return n.type="bar",new t(e,n)}}},{}],9:[function(t,e,n){"use strict";e.exports=function(t){t.Bubble=function(e,n){return n.type="bubble",new t(e,n)}}},{}],10:[function(t,e,n){"use strict";e.exports=function(t){t.Doughnut=function(e,n){return n.type="doughnut",new t(e,n)}}},{}],11:[function(t,e,n){"use strict";e.exports=function(t){t.Line=function(e,n){return n.type="line",new t(e,n)}}},{}],12:[function(t,e,n){"use strict";e.exports=function(t){t.PolarArea=function(e,n){return n.type="polarArea",new t(e,n)}}},{}],13:[function(t,e,n){"use strict";e.exports=function(t){t.Radar=function(e,n){return n.type="radar",new t(e,n)}}},{}],14:[function(t,e,n){"use strict";e.exports=function(t){t.Scatter=function(e,n){return n.type="scatter",new t(e,n)}}},{}],15:[function(t,e,n){"use strict";var i=t(25),a=t(40),o=t(45);i._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",categoryPercentage:.8,barPercentage:.9,offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}}),i._set("horizontalBar",{hover:{mode:"index",axis:"y"},scales:{xAxes:[{type:"linear",position:"bottom"}],yAxes:[{position:"left",type:"category",categoryPercentage:.8,barPercentage:.9,offset:!0,gridLines:{offsetGridLines:!0}}]},elements:{rectangle:{borderSkipped:"left"}},tooltips:{callbacks:{title:function(t,e){var n="";return t.length>0&&(t[0].yLabel?n=t[0].yLabel:e.labels.length>0&&t[0].index<e.labels.length&&(n=e.labels[t[0].index])),n},label:function(t,e){return(e.datasets[t.datasetIndex].label||"")+": "+t.xLabel}},mode:"index",axis:"y"}}),e.exports=function(t){t.controllers.bar=t.DatasetController.extend({dataElementType:a.Rectangle,initialize:function(){var e,n=this;t.DatasetController.prototype.initialize.apply(n,arguments),(e=n.getMeta()).stack=n.getDataset().stack,e.bar=!0},update:function(t){var e,n,i=this,a=i.getMeta().data;for(i._ruler=i.getRuler(),e=0,n=a.length;e<n;++e)i.updateElement(a[e],e,t)},updateElement:function(t,e,n){var i=this,a=i.chart,r=i.getMeta(),l=i.getDataset(),s=t.custom||{},u=a.options.elements.rectangle;t._xScale=i.getScaleForId(r.xAxisID),t._yScale=i.getScaleForId(r.yAxisID),t._datasetIndex=i.index,t._index=e,t._model={datasetLabel:l.label,label:a.data.labels[e],borderSkipped:s.borderSkipped?s.borderSkipped:u.borderSkipped,backgroundColor:s.backgroundColor?s.backgroundColor:o.valueAtIndexOrDefault(l.backgroundColor,e,u.backgroundColor),borderColor:s.borderColor?s.borderColor:o.valueAtIndexOrDefault(l.borderColor,e,u.borderColor),borderWidth:s.borderWidth?s.borderWidth:o.valueAtIndexOrDefault(l.borderWidth,e,u.borderWidth)},i.updateElementGeometry(t,e,n),t.pivot()},updateElementGeometry:function(t,e,n){var i=this,a=t._model,o=i.getValueScale(),r=o.getBasePixel(),l=o.isHorizontal(),s=i._ruler||i.getRuler(),u=i.calculateBarValuePixels(i.index,e),d=i.calculateBarIndexPixels(i.index,e,s);a.horizontal=l,a.base=n?r:u.base,a.x=l?n?r:u.head:d.center,a.y=l?d.center:n?r:u.head,a.height=l?d.size:void 0,a.width=l?void 0:d.size},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())},getStackCount:function(t){var e,n,i=this,a=i.chart,o=i.getIndexScale().options.stacked,r=void 0===t?a.data.datasets.length:t+1,l=[];for(e=0;e<r;++e)(n=a.getDatasetMeta(e)).bar&&a.isDatasetVisible(e)&&(!1===o||!0===o&&-1===l.indexOf(n.stack)||void 0===o&&(void 0===n.stack||-1===l.indexOf(n.stack)))&&l.push(n.stack);return l.length},getStackIndex:function(t){return this.getStackCount(t)-1},getRuler:function(){var t,e,n=this,i=n.getIndexScale(),a=n.getStackCount(),o=n.index,r=[],l=i.isHorizontal(),s=l?i.left:i.top,u=s+(l?i.width:i.height);for(t=0,e=n.getMeta().data.length;t<e;++t)r.push(i.getPixelForValue(null,t,o));return{pixels:r,start:s,end:u,stackCount:a,scale:i}},calculateBarValuePixels:function(t,e){var n,i,a,o,r,l,s=this,u=s.chart,d=s.getMeta(),c=s.getValueScale(),h=u.data.datasets,f=c.getRightValue(h[t].data[e]),g=c.options.stacked,p=d.stack,v=0;if(g||void 0===g&&void 0!==p)for(n=0;n<t;++n)(i=u.getDatasetMeta(n)).bar&&i.stack===p&&i.controller.getValueScaleId()===c.id&&u.isDatasetVisible(n)&&(a=c.getRightValue(h[n].data[e]),(f<0&&a<0||f>=0&&a>0)&&(v+=a));return o=c.getPixelForValue(v),r=c.getPixelForValue(v+f),l=(r-o)/2,{size:l,base:o,head:r,center:r+l/2}},calculateBarIndexPixels:function(t,e,n){var i,a,r,l,s,u,d=this,c=n.scale.options,h=d.getStackIndex(t),f=n.pixels,g=f[e],p=f.length,v=n.start,m=n.end;return 1===p?(i=g>v?g-v:m-g,a=g<m?m-g:g-v):(e>0&&(i=(g-f[e-1])/2,e===p-1&&(a=i)),e<p-1&&(a=(f[e+1]-g)/2,0===e&&(i=a))),r=i*c.categoryPercentage,l=a*c.categoryPercentage,s=(r+l)/n.stackCount,u=s*c.barPercentage,u=Math.min(o.valueOrDefault(c.barThickness,u),o.valueOrDefault(c.maxBarThickness,1/0)),g-=r,g+=s*h,g+=(s-u)/2,{size:u,base:g,head:g+u,center:g+u/2}},draw:function(){var t=this,e=t.chart,n=t.getValueScale(),i=t.getMeta().data,a=t.getDataset(),r=i.length,l=0;for(o.canvas.clipArea(e.ctx,e.chartArea);l<r;++l)isNaN(n.getRightValue(a.data[l]))||i[l].draw();o.canvas.unclipArea(e.ctx)},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t._index,i=t.custom||{},a=t._model;a.backgroundColor=i.hoverBackgroundColor?i.hoverBackgroundColor:o.valueAtIndexOrDefault(e.hoverBackgroundColor,n,o.getHoverColor(a.backgroundColor)),a.borderColor=i.hoverBorderColor?i.hoverBorderColor:o.valueAtIndexOrDefault(e.hoverBorderColor,n,o.getHoverColor(a.borderColor)),a.borderWidth=i.hoverBorderWidth?i.hoverBorderWidth:o.valueAtIndexOrDefault(e.hoverBorderWidth,n,a.borderWidth)},removeHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t._index,i=t.custom||{},a=t._model,r=this.chart.options.elements.rectangle;a.backgroundColor=i.backgroundColor?i.backgroundColor:o.valueAtIndexOrDefault(e.backgroundColor,n,r.backgroundColor),a.borderColor=i.borderColor?i.borderColor:o.valueAtIndexOrDefault(e.borderColor,n,r.borderColor),a.borderWidth=i.borderWidth?i.borderWidth:o.valueAtIndexOrDefault(e.borderWidth,n,r.borderWidth)}}),t.controllers.horizontalBar=t.controllers.bar.extend({getValueScaleId:function(){return this.getMeta().xAxisID},getIndexScaleId:function(){return this.getMeta().yAxisID}})}},{25:25,40:40,45:45}],16:[function(t,e,n){"use strict";var i=t(25),a=t(40),o=t(45);i._set("bubble",{hover:{mode:"single"},scales:{xAxes:[{type:"linear",position:"bottom",id:"x-axis-0"}],yAxes:[{type:"linear",position:"left",id:"y-axis-0"}]},tooltips:{callbacks:{title:function(){return""},label:function(t,e){var n=e.datasets[t.datasetIndex].label||"",i=e.datasets[t.datasetIndex].data[t.index];return n+": ("+t.xLabel+", "+t.yLabel+", "+i.r+")"}}}}),e.exports=function(t){t.controllers.bubble=t.DatasetController.extend({dataElementType:a.Point,update:function(t){var e=this,n=e.getMeta().data;o.each(n,function(n,i){e.updateElement(n,i,t)})},updateElement:function(t,e,n){var i=this,a=i.getMeta(),o=t.custom||{},r=i.getScaleForId(a.xAxisID),l=i.getScaleForId(a.yAxisID),s=i._resolveElementOptions(t,e),u=i.getDataset().data[e],d=i.index,c=n?r.getPixelForDecimal(.5):r.getPixelForValue("object"==typeof u?u:NaN,e,d),h=n?l.getBasePixel():l.getPixelForValue(u,e,d);t._xScale=r,t._yScale=l,t._options=s,t._datasetIndex=d,t._index=e,t._model={backgroundColor:s.backgroundColor,borderColor:s.borderColor,borderWidth:s.borderWidth,hitRadius:s.hitRadius,pointStyle:s.pointStyle,radius:n?0:s.radius,skip:o.skip||isNaN(c)||isNaN(h),x:c,y:h},t.pivot()},setHoverStyle:function(t){var e=t._model,n=t._options;e.backgroundColor=o.valueOrDefault(n.hoverBackgroundColor,o.getHoverColor(n.backgroundColor)),e.borderColor=o.valueOrDefault(n.hoverBorderColor,o.getHoverColor(n.borderColor)),e.borderWidth=o.valueOrDefault(n.hoverBorderWidth,n.borderWidth),e.radius=n.radius+n.hoverRadius},removeHoverStyle:function(t){var e=t._model,n=t._options;e.backgroundColor=n.backgroundColor,e.borderColor=n.borderColor,e.borderWidth=n.borderWidth,e.radius=n.radius},_resolveElementOptions:function(t,e){var n,i,a,r=this,l=r.chart,s=l.data.datasets[r.index],u=t.custom||{},d=l.options.elements.point,c=o.options.resolve,h=s.data[e],f={},g={chart:l,dataIndex:e,dataset:s,datasetIndex:r.index},p=["backgroundColor","borderColor","borderWidth","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth","hoverRadius","hitRadius","pointStyle"];for(n=0,i=p.length;n<i;++n)f[a=p[n]]=c([u[a],s[a],d[a]],g,e);return f.radius=c([u.radius,h?h.r:void 0,s.radius,d.radius],g,e),f}})}},{25:25,40:40,45:45}],17:[function(t,e,n){"use strict";var i=t(25),a=t(40),o=t(45);i._set("doughnut",{animation:{animateRotate:!0,animateScale:!1},hover:{mode:"single"},legendCallback:function(t){var e=[];e.push('<ul class="'+t.id+'-legend">');var n=t.data,i=n.datasets,a=n.labels;if(i.length)for(var o=0;o<i[0].data.length;++o)e.push('<li><span style="background-color:'+i[0].backgroundColor[o]+'"></span>'),a[o]&&e.push(a[o]),e.push("</li>");return e.push("</ul>"),e.join("")},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map(function(n,i){var a=t.getDatasetMeta(0),r=e.datasets[0],l=a.data[i],s=l&&l.custom||{},u=o.valueAtIndexOrDefault,d=t.options.elements.arc;return{text:n,fillStyle:s.backgroundColor?s.backgroundColor:u(r.backgroundColor,i,d.backgroundColor),strokeStyle:s.borderColor?s.borderColor:u(r.borderColor,i,d.borderColor),lineWidth:s.borderWidth?s.borderWidth:u(r.borderWidth,i,d.borderWidth),hidden:isNaN(r.data[i])||a.data[i].hidden,index:i}}):[]}},onClick:function(t,e){var n,i,a,o=e.index,r=this.chart;for(n=0,i=(r.data.datasets||[]).length;n<i;++n)(a=r.getDatasetMeta(n)).data[o]&&(a.data[o].hidden=!a.data[o].hidden);r.update()}},cutoutPercentage:50,rotation:-.5*Math.PI,circumference:2*Math.PI,tooltips:{callbacks:{title:function(){return""},label:function(t,e){var n=e.labels[t.index],i=": "+e.datasets[t.datasetIndex].data[t.index];return o.isArray(n)?(n=n.slice())[0]+=i:n+=i,n}}}}),i._set("pie",o.clone(i.doughnut)),i._set("pie",{cutoutPercentage:0}),e.exports=function(t){t.controllers.doughnut=t.controllers.pie=t.DatasetController.extend({dataElementType:a.Arc,linkScales:o.noop,getRingIndex:function(t){for(var e=0,n=0;n<t;++n)this.chart.isDatasetVisible(n)&&++e;return e},update:function(t){var e=this,n=e.chart,i=n.chartArea,a=n.options,r=a.elements.arc,l=i.right-i.left-r.borderWidth,s=i.bottom-i.top-r.borderWidth,u=Math.min(l,s),d={x:0,y:0},c=e.getMeta(),h=a.cutoutPercentage,f=a.circumference;if(f<2*Math.PI){var g=a.rotation%(2*Math.PI),p=(g+=2*Math.PI*(g>=Math.PI?-1:g<-Math.PI?1:0))+f,v={x:Math.cos(g),y:Math.sin(g)},m={x:Math.cos(p),y:Math.sin(p)},b=g<=0&&p>=0||g<=2*Math.PI&&2*Math.PI<=p,x=g<=.5*Math.PI&&.5*Math.PI<=p||g<=2.5*Math.PI&&2.5*Math.PI<=p,y=g<=-Math.PI&&-Math.PI<=p||g<=Math.PI&&Math.PI<=p,k=g<=.5*-Math.PI&&.5*-Math.PI<=p||g<=1.5*Math.PI&&1.5*Math.PI<=p,w=h/100,M={x:y?-1:Math.min(v.x*(v.x<0?1:w),m.x*(m.x<0?1:w)),y:k?-1:Math.min(v.y*(v.y<0?1:w),m.y*(m.y<0?1:w))},S={x:b?1:Math.max(v.x*(v.x>0?1:w),m.x*(m.x>0?1:w)),y:x?1:Math.max(v.y*(v.y>0?1:w),m.y*(m.y>0?1:w))},C={width:.5*(S.x-M.x),height:.5*(S.y-M.y)};u=Math.min(l/C.width,s/C.height),d={x:-.5*(S.x+M.x),y:-.5*(S.y+M.y)}}n.borderWidth=e.getMaxBorderWidth(c.data),n.outerRadius=Math.max((u-n.borderWidth)/2,0),n.innerRadius=Math.max(h?n.outerRadius/100*h:0,0),n.radiusLength=(n.outerRadius-n.innerRadius)/n.getVisibleDatasetCount(),n.offsetX=d.x*n.outerRadius,n.offsetY=d.y*n.outerRadius,c.total=e.calculateTotal(),e.outerRadius=n.outerRadius-n.radiusLength*e.getRingIndex(e.index),e.innerRadius=Math.max(e.outerRadius-n.radiusLength,0),o.each(c.data,function(n,i){e.updateElement(n,i,t)})},updateElement:function(t,e,n){var i=this,a=i.chart,r=a.chartArea,l=a.options,s=l.animation,u=(r.left+r.right)/2,d=(r.top+r.bottom)/2,c=l.rotation,h=l.rotation,f=i.getDataset(),g=n&&s.animateRotate?0:t.hidden?0:i.calculateCircumference(f.data[e])*(l.circumference/(2*Math.PI)),p=n&&s.animateScale?0:i.innerRadius,v=n&&s.animateScale?0:i.outerRadius,m=o.valueAtIndexOrDefault;o.extend(t,{_datasetIndex:i.index,_index:e,_model:{x:u+a.offsetX,y:d+a.offsetY,startAngle:c,endAngle:h,circumference:g,outerRadius:v,innerRadius:p,label:m(f.label,e,a.data.labels[e])}});var b=t._model;this.removeHoverStyle(t),n&&s.animateRotate||(b.startAngle=0===e?l.rotation:i.getMeta().data[e-1]._model.endAngle,b.endAngle=b.startAngle+b.circumference),t.pivot()},removeHoverStyle:function(e){t.DatasetController.prototype.removeHoverStyle.call(this,e,this.chart.options.elements.arc)},calculateTotal:function(){var t,e=this.getDataset(),n=this.getMeta(),i=0;return o.each(n.data,function(n,a){t=e.data[a],isNaN(t)||n.hidden||(i+=Math.abs(t))}),i},calculateCircumference:function(t){var e=this.getMeta().total;return e>0&&!isNaN(t)?2*Math.PI*(t/e):0},getMaxBorderWidth:function(t){for(var e,n,i=0,a=this.index,o=t.length,r=0;r<o;r++)e=t[r]._model?t[r]._model.borderWidth:0,i=(n=t[r]._chart?t[r]._chart.config.data.datasets[a].hoverBorderWidth:0)>(i=e>i?e:i)?n:i;return i}})}},{25:25,40:40,45:45}],18:[function(t,e,n){"use strict";var i=t(25),a=t(40),o=t(45);i._set("line",{showLines:!0,spanGaps:!1,hover:{mode:"label"},scales:{xAxes:[{type:"category",id:"x-axis-0"}],yAxes:[{type:"linear",id:"y-axis-0"}]}}),e.exports=function(t){function e(t,e){return o.valueOrDefault(t.showLine,e.showLines)}t.controllers.line=t.DatasetController.extend({datasetElementType:a.Line,dataElementType:a.Point,update:function(t){var n,i,a,r=this,l=r.getMeta(),s=l.dataset,u=l.data||[],d=r.chart.options,c=d.elements.line,h=r.getScaleForId(l.yAxisID),f=r.getDataset(),g=e(f,d);for(g&&(a=s.custom||{},void 0!==f.tension&&void 0===f.lineTension&&(f.lineTension=f.tension),s._scale=h,s._datasetIndex=r.index,s._children=u,s._model={spanGaps:f.spanGaps?f.spanGaps:d.spanGaps,tension:a.tension?a.tension:o.valueOrDefault(f.lineTension,c.tension),backgroundColor:a.backgroundColor?a.backgroundColor:f.backgroundColor||c.backgroundColor,borderWidth:a.borderWidth?a.borderWidth:f.borderWidth||c.borderWidth,borderColor:a.borderColor?a.borderColor:f.borderColor||c.borderColor,borderCapStyle:a.borderCapStyle?a.borderCapStyle:f.borderCapStyle||c.borderCapStyle,borderDash:a.borderDash?a.borderDash:f.borderDash||c.borderDash,borderDashOffset:a.borderDashOffset?a.borderDashOffset:f.borderDashOffset||c.borderDashOffset,borderJoinStyle:a.borderJoinStyle?a.borderJoinStyle:f.borderJoinStyle||c.borderJoinStyle,fill:a.fill?a.fill:void 0!==f.fill?f.fill:c.fill,steppedLine:a.steppedLine?a.steppedLine:o.valueOrDefault(f.steppedLine,c.stepped),cubicInterpolationMode:a.cubicInterpolationMode?a.cubicInterpolationMode:o.valueOrDefault(f.cubicInterpolationMode,c.cubicInterpolationMode)},s.pivot()),n=0,i=u.length;n<i;++n)r.updateElement(u[n],n,t);for(g&&0!==s._model.tension&&r.updateBezierControlPoints(),n=0,i=u.length;n<i;++n)u[n].pivot()},getPointBackgroundColor:function(t,e){var n=this.chart.options.elements.point.backgroundColor,i=this.getDataset(),a=t.custom||{};return a.backgroundColor?n=a.backgroundColor:i.pointBackgroundColor?n=o.valueAtIndexOrDefault(i.pointBackgroundColor,e,n):i.backgroundColor&&(n=i.backgroundColor),n},getPointBorderColor:function(t,e){var n=this.chart.options.elements.point.borderColor,i=this.getDataset(),a=t.custom||{};return a.borderColor?n=a.borderColor:i.pointBorderColor?n=o.valueAtIndexOrDefault(i.pointBorderColor,e,n):i.borderColor&&(n=i.borderColor),n},getPointBorderWidth:function(t,e){var n=this.chart.options.elements.point.borderWidth,i=this.getDataset(),a=t.custom||{};return isNaN(a.borderWidth)?!isNaN(i.pointBorderWidth)||o.isArray(i.pointBorderWidth)?n=o.valueAtIndexOrDefault(i.pointBorderWidth,e,n):isNaN(i.borderWidth)||(n=i.borderWidth):n=a.borderWidth,n},updateElement:function(t,e,n){var i,a,r=this,l=r.getMeta(),s=t.custom||{},u=r.getDataset(),d=r.index,c=u.data[e],h=r.getScaleForId(l.yAxisID),f=r.getScaleForId(l.xAxisID),g=r.chart.options.elements.point;void 0!==u.radius&&void 0===u.pointRadius&&(u.pointRadius=u.radius),void 0!==u.hitRadius&&void 0===u.pointHitRadius&&(u.pointHitRadius=u.hitRadius),i=f.getPixelForValue("object"==typeof c?c:NaN,e,d),a=n?h.getBasePixel():r.calculatePointY(c,e,d),t._xScale=f,t._yScale=h,t._datasetIndex=d,t._index=e,t._model={x:i,y:a,skip:s.skip||isNaN(i)||isNaN(a),radius:s.radius||o.valueAtIndexOrDefault(u.pointRadius,e,g.radius),pointStyle:s.pointStyle||o.valueAtIndexOrDefault(u.pointStyle,e,g.pointStyle),backgroundColor:r.getPointBackgroundColor(t,e),borderColor:r.getPointBorderColor(t,e),borderWidth:r.getPointBorderWidth(t,e),tension:l.dataset._model?l.dataset._model.tension:0,steppedLine:!!l.dataset._model&&l.dataset._model.steppedLine,hitRadius:s.hitRadius||o.valueAtIndexOrDefault(u.pointHitRadius,e,g.hitRadius)}},calculatePointY:function(t,e,n){var i,a,o,r=this,l=r.chart,s=r.getMeta(),u=r.getScaleForId(s.yAxisID),d=0,c=0;if(u.options.stacked){for(i=0;i<n;i++)if(a=l.data.datasets[i],"line"===(o=l.getDatasetMeta(i)).type&&o.yAxisID===u.id&&l.isDatasetVisible(i)){var h=Number(u.getRightValue(a.data[e]));h<0?c+=h||0:d+=h||0}var f=Number(u.getRightValue(t));return f<0?u.getPixelForValue(c+f):u.getPixelForValue(d+f)}return u.getPixelForValue(t)},updateBezierControlPoints:function(){function t(t,e,n){return Math.max(Math.min(t,n),e)}var e,n,i,a,r=this,l=r.getMeta(),s=r.chart.chartArea,u=l.data||[];if(l.dataset._model.spanGaps&&(u=u.filter(function(t){return!t._model.skip})),"monotone"===l.dataset._model.cubicInterpolationMode)o.splineCurveMonotone(u);else for(e=0,n=u.length;e<n;++e)i=u[e]._model,a=o.splineCurve(o.previousItem(u,e)._model,i,o.nextItem(u,e)._model,l.dataset._model.tension),i.controlPointPreviousX=a.previous.x,i.controlPointPreviousY=a.previous.y,i.controlPointNextX=a.next.x,i.controlPointNextY=a.next.y;if(r.chart.options.elements.line.capBezierPoints)for(e=0,n=u.length;e<n;++e)(i=u[e]._model).controlPointPreviousX=t(i.controlPointPreviousX,s.left,s.right),i.controlPointPreviousY=t(i.controlPointPreviousY,s.top,s.bottom),i.controlPointNextX=t(i.controlPointNextX,s.left,s.right),i.controlPointNextY=t(i.controlPointNextY,s.top,s.bottom)},draw:function(){var t=this,n=t.chart,i=t.getMeta(),a=i.data||[],r=n.chartArea,l=a.length,s=0;for(o.canvas.clipArea(n.ctx,r),e(t.getDataset(),n.options)&&i.dataset.draw(),o.canvas.unclipArea(n.ctx);s<l;++s)a[s].draw(r)},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t._index,i=t.custom||{},a=t._model;a.radius=i.hoverRadius||o.valueAtIndexOrDefault(e.pointHoverRadius,n,this.chart.options.elements.point.hoverRadius),a.backgroundColor=i.hoverBackgroundColor||o.valueAtIndexOrDefault(e.pointHoverBackgroundColor,n,o.getHoverColor(a.backgroundColor)),a.borderColor=i.hoverBorderColor||o.valueAtIndexOrDefault(e.pointHoverBorderColor,n,o.getHoverColor(a.borderColor)),a.borderWidth=i.hoverBorderWidth||o.valueAtIndexOrDefault(e.pointHoverBorderWidth,n,a.borderWidth)},removeHoverStyle:function(t){var e=this,n=e.chart.data.datasets[t._datasetIndex],i=t._index,a=t.custom||{},r=t._model;void 0!==n.radius&&void 0===n.pointRadius&&(n.pointRadius=n.radius),r.radius=a.radius||o.valueAtIndexOrDefault(n.pointRadius,i,e.chart.options.elements.point.radius),r.backgroundColor=e.getPointBackgroundColor(t,i),r.borderColor=e.getPointBorderColor(t,i),r.borderWidth=e.getPointBorderWidth(t,i)}})}},{25:25,40:40,45:45}],19:[function(t,e,n){"use strict";var i=t(25),a=t(40),o=t(45);i._set("polarArea",{scale:{type:"radialLinear",angleLines:{display:!1},gridLines:{circular:!0},pointLabels:{display:!1},ticks:{beginAtZero:!0}},animation:{animateRotate:!0,animateScale:!0},startAngle:-.5*Math.PI,legendCallback:function(t){var e=[];e.push('<ul class="'+t.id+'-legend">');var n=t.data,i=n.datasets,a=n.labels;if(i.length)for(var o=0;o<i[0].data.length;++o)e.push('<li><span style="background-color:'+i[0].backgroundColor[o]+'"></span>'),a[o]&&e.push(a[o]),e.push("</li>");return e.push("</ul>"),e.join("")},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map(function(n,i){var a=t.getDatasetMeta(0),r=e.datasets[0],l=a.data[i].custom||{},s=o.valueAtIndexOrDefault,u=t.options.elements.arc;return{text:n,fillStyle:l.backgroundColor?l.backgroundColor:s(r.backgroundColor,i,u.backgroundColor),strokeStyle:l.borderColor?l.borderColor:s(r.borderColor,i,u.borderColor),lineWidth:l.borderWidth?l.borderWidth:s(r.borderWidth,i,u.borderWidth),hidden:isNaN(r.data[i])||a.data[i].hidden,index:i}}):[]}},onClick:function(t,e){var n,i,a,o=e.index,r=this.chart;for(n=0,i=(r.data.datasets||[]).length;n<i;++n)(a=r.getDatasetMeta(n)).data[o].hidden=!a.data[o].hidden;r.update()}},tooltips:{callbacks:{title:function(){return""},label:function(t,e){return e.labels[t.index]+": "+t.yLabel}}}}),e.exports=function(t){t.controllers.polarArea=t.DatasetController.extend({dataElementType:a.Arc,linkScales:o.noop,update:function(t){var e=this,n=e.chart,i=n.chartArea,a=e.getMeta(),r=n.options,l=r.elements.arc,s=Math.min(i.right-i.left,i.bottom-i.top);n.outerRadius=Math.max((s-l.borderWidth/2)/2,0),n.innerRadius=Math.max(r.cutoutPercentage?n.outerRadius/100*r.cutoutPercentage:1,0),n.radiusLength=(n.outerRadius-n.innerRadius)/n.getVisibleDatasetCount(),e.outerRadius=n.outerRadius-n.radiusLength*e.index,e.innerRadius=e.outerRadius-n.radiusLength,a.count=e.countVisibleElements(),o.each(a.data,function(n,i){e.updateElement(n,i,t)})},updateElement:function(t,e,n){for(var i=this,a=i.chart,r=i.getDataset(),l=a.options,s=l.animation,u=a.scale,d=a.data.labels,c=i.calculateCircumference(r.data[e]),h=u.xCenter,f=u.yCenter,g=0,p=i.getMeta(),v=0;v<e;++v)isNaN(r.data[v])||p.data[v].hidden||++g;var m=l.startAngle,b=t.hidden?0:u.getDistanceFromCenterForValue(r.data[e]),x=m+c*g,y=x+(t.hidden?0:c),k=s.animateScale?0:u.getDistanceFromCenterForValue(r.data[e]);o.extend(t,{_datasetIndex:i.index,_index:e,_scale:u,_model:{x:h,y:f,innerRadius:0,outerRadius:n?k:b,startAngle:n&&s.animateRotate?m:x,endAngle:n&&s.animateRotate?m:y,label:o.valueAtIndexOrDefault(d,e,d[e])}}),i.removeHoverStyle(t),t.pivot()},removeHoverStyle:function(e){t.DatasetController.prototype.removeHoverStyle.call(this,e,this.chart.options.elements.arc)},countVisibleElements:function(){var t=this.getDataset(),e=this.getMeta(),n=0;return o.each(e.data,function(e,i){isNaN(t.data[i])||e.hidden||n++}),n},calculateCircumference:function(t){var e=this.getMeta().count;return e>0&&!isNaN(t)?2*Math.PI/e:0}})}},{25:25,40:40,45:45}],20:[function(t,e,n){"use strict";var i=t(25),a=t(40),o=t(45);i._set("radar",{scale:{type:"radialLinear"},elements:{line:{tension:0}}}),e.exports=function(t){t.controllers.radar=t.DatasetController.extend({datasetElementType:a.Line,dataElementType:a.Point,linkScales:o.noop,update:function(t){var e=this,n=e.getMeta(),i=n.dataset,a=n.data,r=i.custom||{},l=e.getDataset(),s=e.chart.options.elements.line,u=e.chart.scale;void 0!==l.tension&&void 0===l.lineTension&&(l.lineTension=l.tension),o.extend(n.dataset,{_datasetIndex:e.index,_scale:u,_children:a,_loop:!0,_model:{tension:r.tension?r.tension:o.valueOrDefault(l.lineTension,s.tension),backgroundColor:r.backgroundColor?r.backgroundColor:l.backgroundColor||s.backgroundColor,borderWidth:r.borderWidth?r.borderWidth:l.borderWidth||s.borderWidth,borderColor:r.borderColor?r.borderColor:l.borderColor||s.borderColor,fill:r.fill?r.fill:void 0!==l.fill?l.fill:s.fill,borderCapStyle:r.borderCapStyle?r.borderCapStyle:l.borderCapStyle||s.borderCapStyle,borderDash:r.borderDash?r.borderDash:l.borderDash||s.borderDash,borderDashOffset:r.borderDashOffset?r.borderDashOffset:l.borderDashOffset||s.borderDashOffset,borderJoinStyle:r.borderJoinStyle?r.borderJoinStyle:l.borderJoinStyle||s.borderJoinStyle}}),n.dataset.pivot(),o.each(a,function(n,i){e.updateElement(n,i,t)},e),e.updateBezierControlPoints()},updateElement:function(t,e,n){var i=this,a=t.custom||{},r=i.getDataset(),l=i.chart.scale,s=i.chart.options.elements.point,u=l.getPointPositionForValue(e,r.data[e]);void 0!==r.radius&&void 0===r.pointRadius&&(r.pointRadius=r.radius),void 0!==r.hitRadius&&void 0===r.pointHitRadius&&(r.pointHitRadius=r.hitRadius),o.extend(t,{_datasetIndex:i.index,_index:e,_scale:l,_model:{x:n?l.xCenter:u.x,y:n?l.yCenter:u.y,tension:a.tension?a.tension:o.valueOrDefault(r.lineTension,i.chart.options.elements.line.tension),radius:a.radius?a.radius:o.valueAtIndexOrDefault(r.pointRadius,e,s.radius),backgroundColor:a.backgroundColor?a.backgroundColor:o.valueAtIndexOrDefault(r.pointBackgroundColor,e,s.backgroundColor),borderColor:a.borderColor?a.borderColor:o.valueAtIndexOrDefault(r.pointBorderColor,e,s.borderColor),borderWidth:a.borderWidth?a.borderWidth:o.valueAtIndexOrDefault(r.pointBorderWidth,e,s.borderWidth),pointStyle:a.pointStyle?a.pointStyle:o.valueAtIndexOrDefault(r.pointStyle,e,s.pointStyle),hitRadius:a.hitRadius?a.hitRadius:o.valueAtIndexOrDefault(r.pointHitRadius,e,s.hitRadius)}}),t._model.skip=a.skip?a.skip:isNaN(t._model.x)||isNaN(t._model.y)},updateBezierControlPoints:function(){var t=this.chart.chartArea,e=this.getMeta();o.each(e.data,function(n,i){var a=n._model,r=o.splineCurve(o.previousItem(e.data,i,!0)._model,a,o.nextItem(e.data,i,!0)._model,a.tension);a.controlPointPreviousX=Math.max(Math.min(r.previous.x,t.right),t.left),a.controlPointPreviousY=Math.max(Math.min(r.previous.y,t.bottom),t.top),a.controlPointNextX=Math.max(Math.min(r.next.x,t.right),t.left),a.controlPointNextY=Math.max(Math.min(r.next.y,t.bottom),t.top),n.pivot()})},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t.custom||{},i=t._index,a=t._model;a.radius=n.hoverRadius?n.hoverRadius:o.valueAtIndexOrDefault(e.pointHoverRadius,i,this.chart.options.elements.point.hoverRadius),a.backgroundColor=n.hoverBackgroundColor?n.hoverBackgroundColor:o.valueAtIndexOrDefault(e.pointHoverBackgroundColor,i,o.getHoverColor(a.backgroundColor)),a.borderColor=n.hoverBorderColor?n.hoverBorderColor:o.valueAtIndexOrDefault(e.pointHoverBorderColor,i,o.getHoverColor(a.borderColor)),a.borderWidth=n.hoverBorderWidth?n.hoverBorderWidth:o.valueAtIndexOrDefault(e.pointHoverBorderWidth,i,a.borderWidth)},removeHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t.custom||{},i=t._index,a=t._model,r=this.chart.options.elements.point;a.radius=n.radius?n.radius:o.valueAtIndexOrDefault(e.pointRadius,i,r.radius),a.backgroundColor=n.backgroundColor?n.backgroundColor:o.valueAtIndexOrDefault(e.pointBackgroundColor,i,r.backgroundColor),a.borderColor=n.borderColor?n.borderColor:o.valueAtIndexOrDefault(e.pointBorderColor,i,r.borderColor),a.borderWidth=n.borderWidth?n.borderWidth:o.valueAtIndexOrDefault(e.pointBorderWidth,i,r.borderWidth)}})}},{25:25,40:40,45:45}],21:[function(t,e,n){"use strict";t(25)._set("scatter",{hover:{mode:"single"},scales:{xAxes:[{id:"x-axis-1",type:"linear",position:"bottom"}],yAxes:[{id:"y-axis-1",type:"linear",position:"left"}]},showLines:!1,tooltips:{callbacks:{title:function(){return""},label:function(t){return"("+t.xLabel+", "+t.yLabel+")"}}}}),e.exports=function(t){t.controllers.scatter=t.controllers.line}},{25:25}],22:[function(t,e,n){"use strict";var i=t(25),a=t(26),o=t(45);i._set("global",{animation:{duration:1e3,easing:"easeOutQuart",onProgress:o.noop,onComplete:o.noop}}),e.exports=function(t){t.Animation=a.extend({chart:null,currentStep:0,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),t.animationService={frameDuration:17,animations:[],dropFrames:0,request:null,addAnimation:function(t,e,n,i){var a,o,r=this.animations;for(e.chart=t,i||(t.animating=!0),a=0,o=r.length;a<o;++a)if(r[a].chart===t)return void(r[a]=e);r.push(e),1===r.length&&this.requestAnimationFrame()},cancelAnimation:function(t){var e=o.findIndex(this.animations,function(e){return e.chart===t});-1!==e&&(this.animations.splice(e,1),t.animating=!1)},requestAnimationFrame:function(){var t=this;null===t.request&&(t.request=o.requestAnimFrame.call(window,function(){t.request=null,t.startDigest()}))},startDigest:function(){var t=this,e=Date.now(),n=0;t.dropFrames>1&&(n=Math.floor(t.dropFrames),t.dropFrames=t.dropFrames%1),t.advance(1+n);var i=Date.now();t.dropFrames+=(i-e)/t.frameDuration,t.animations.length>0&&t.requestAnimationFrame()},advance:function(t){for(var e,n,i=this.animations,a=0;a<i.length;)n=(e=i[a]).chart,e.currentStep=(e.currentStep||0)+t,e.currentStep=Math.min(e.currentStep,e.numSteps),o.callback(e.render,[n,e],n),o.callback(e.onAnimationProgress,[e],n),e.currentStep>=e.numSteps?(o.callback(e.onAnimationComplete,[e],n),n.animating=!1,i.splice(a,1)):++a}},Object.defineProperty(t.Animation.prototype,"animationObject",{get:function(){return this}}),Object.defineProperty(t.Animation.prototype,"chartInstance",{get:function(){return this.chart},set:function(t){this.chart=t}})}},{25:25,26:26,45:45}],23:[function(t,e,n){"use strict";var i=t(25),a=t(45),o=t(28),r=t(48);e.exports=function(t){function e(t){var e=(t=t||{}).data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=a.configMerge(i.global,i[t.type],t.options||{}),t}function n(t){var e=t.options;e.scale?t.scale.options=e.scale:e.scales&&e.scales.xAxes.concat(e.scales.yAxes).forEach(function(e){t.scales[e.id].options=e}),t.tooltip._options=e.tooltips}function l(t){return"top"===t||"bottom"===t}var s=t.plugins;t.types={},t.instances={},t.controllers={},a.extend(t.prototype,{construct:function(n,i){var o=this;i=e(i);var l=r.acquireContext(n,i),s=l&&l.canvas,u=s&&s.height,d=s&&s.width;o.id=a.uid(),o.ctx=l,o.canvas=s,o.config=i,o.width=d,o.height=u,o.aspectRatio=u?d/u:null,o.options=i.options,o._bufferedRender=!1,o.chart=o,o.controller=o,t.instances[o.id]=o,Object.defineProperty(o,"data",{get:function(){return o.config.data},set:function(t){o.config.data=t}}),l&&s?(o.initialize(),o.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return s.notify(t,"beforeInit"),a.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.ensureScalesHaveIDs(),t.buildScales(),t.initToolTip(),s.notify(t,"afterInit"),t},clear:function(){return a.canvas.clear(this),this},stop:function(){return t.animationService.cancelAnimation(this),this},resize:function(t){var e=this,n=e.options,i=e.canvas,o=n.maintainAspectRatio&&e.aspectRatio||null,r=Math.max(0,Math.floor(a.getMaximumWidth(i))),l=Math.max(0,Math.floor(o?r/o:a.getMaximumHeight(i)));if((e.width!==r||e.height!==l)&&(i.width=e.width=r,i.height=e.height=l,i.style.width=r+"px",i.style.height=l+"px",a.retinaScale(e,n.devicePixelRatio),!t)){var u={width:r,height:l};s.notify(e,"resize",[u]),e.options.onResize&&e.options.onResize(e,u),e.stop(),e.update(e.options.responsiveAnimationDuration)}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},n=t.scale;a.each(e.xAxes,function(t,e){t.id=t.id||"x-axis-"+e}),a.each(e.yAxes,function(t,e){t.id=t.id||"y-axis-"+e}),n&&(n.id=n.id||"scale")},buildScales:function(){var e=this,n=e.options,i=e.scales={},o=[];n.scales&&(o=o.concat((n.scales.xAxes||[]).map(function(t){return{options:t,dtype:"category",dposition:"bottom"}}),(n.scales.yAxes||[]).map(function(t){return{options:t,dtype:"linear",dposition:"left"}}))),n.scale&&o.push({options:n.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),a.each(o,function(n){var o=n.options,r=a.valueOrDefault(o.type,n.dtype),s=t.scaleService.getScaleConstructor(r);if(s){l(o.position)!==l(n.dposition)&&(o.position=n.dposition);var u=new s({id:o.id,options:o,ctx:e.ctx,chart:e});i[u.id]=u,u.mergeTicksOptions(),n.isDefault&&(e.scale=u)}}),t.scaleService.addScalesToLayout(this)},buildOrUpdateControllers:function(){var e=this,n=[],i=[];return a.each(e.data.datasets,function(a,o){var r=e.getDatasetMeta(o),l=a.type||e.config.type;if(r.type&&r.type!==l&&(e.destroyDatasetMeta(o),r=e.getDatasetMeta(o)),r.type=l,n.push(r.type),r.controller)r.controller.updateIndex(o);else{var s=t.controllers[r.type];if(void 0===s)throw new Error('"'+r.type+'" is not a chart type.');r.controller=new s(e,o),i.push(r.controller)}},e),i},resetElements:function(){var t=this;a.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]}),n(e),!1!==s.notify(e,"beforeUpdate")){e.tooltip._data=e.data;var i=e.buildOrUpdateControllers();a.each(e.data.datasets,function(t,n){e.getDatasetMeta(n).controller.buildOrUpdateElements()},e),e.updateLayout(),a.each(i,function(t){t.reset()}),e.updateDatasets(),e.tooltip.initialize(),e.lastActive=[],s.notify(e,"afterUpdate"),e._bufferedRender?e._bufferedRequest={duration:t.duration,easing:t.easing,lazy:t.lazy}:e.render(t)}},updateLayout:function(){var e=this;!1!==s.notify(e,"beforeLayout")&&(t.layoutService.update(this,this.width,this.height),s.notify(e,"afterScaleUpdate"),s.notify(e,"afterLayout"))},updateDatasets:function(){var t=this;if(!1!==s.notify(t,"beforeDatasetsUpdate")){for(var e=0,n=t.data.datasets.length;e<n;++e)t.updateDataset(e);s.notify(t,"afterDatasetsUpdate")}},updateDataset:function(t){var e=this,n=e.getDatasetMeta(t),i={meta:n,index:t};!1!==s.notify(e,"beforeDatasetUpdate",[i])&&(n.controller.update(),s.notify(e,"afterDatasetUpdate",[i]))},render:function(e){var n=this;e&&"object"==typeof e||(e={duration:e,lazy:arguments[1]});var i=e.duration,o=e.lazy;if(!1!==s.notify(n,"beforeRender")){var r=n.options.animation,l=function(t){s.notify(n,"afterRender"),a.callback(r&&r.onComplete,[t],n)};if(r&&(void 0!==i&&0!==i||void 0===i&&0!==r.duration)){var u=new t.Animation({numSteps:(i||r.duration)/16.66,easing:e.easing||r.easing,render:function(t,e){var n=a.easing.effects[e.easing],i=e.currentStep,o=i/e.numSteps;t.draw(n(o),o,i)},onAnimationProgress:r.onProgress,onAnimationComplete:l});t.animationService.addAnimation(n,u,i,o)}else n.draw(),l(new t.Animation({numSteps:0,chart:n}));return n}},draw:function(t){var e=this;e.clear(),a.isNullOrUndef(t)&&(t=1),e.transition(t),!1!==s.notify(e,"beforeDraw",[t])&&(a.each(e.boxes,function(t){t.draw(e.chartArea)},e),e.scale&&e.scale.draw(),e.drawDatasets(t),e._drawTooltip(t),s.notify(e,"afterDraw",[t]))},transition:function(t){for(var e=this,n=0,i=(e.data.datasets||[]).length;n<i;++n)e.isDatasetVisible(n)&&e.getDatasetMeta(n).controller.transition(t);e.tooltip.transition(t)},drawDatasets:function(t){var e=this;if(!1!==s.notify(e,"beforeDatasetsDraw",[t])){for(var n=(e.data.datasets||[]).length-1;n>=0;--n)e.isDatasetVisible(n)&&e.drawDataset(n,t);s.notify(e,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var n=this,i=n.getDatasetMeta(t),a={meta:i,index:t,easingValue:e};!1!==s.notify(n,"beforeDatasetDraw",[a])&&(i.controller.draw(e),s.notify(n,"afterDatasetDraw",[a]))},_drawTooltip:function(t){var e=this,n=e.tooltip,i={tooltip:n,easingValue:t};!1!==s.notify(e,"beforeTooltipDraw",[i])&&(n.draw(),s.notify(e,"afterTooltipDraw",[i]))},getElementAtEvent:function(t){return o.modes.single(this,t)},getElementsAtEvent:function(t){return o.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return o.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,n){var i=o.modes[e];return"function"==typeof i?i(this,t,n):[]},getDatasetAtEvent:function(t){return o.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this,n=e.data.datasets[t];n._meta||(n._meta={});var i=n._meta[e.id];return i||(i=n._meta[e.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null}),i},getVisibleDatasetCount:function(){for(var t=0,e=0,n=this.data.datasets.length;e<n;++e)this.isDatasetVisible(e)&&t++;return t},isDatasetVisible:function(t){var e=this.getDatasetMeta(t);return"boolean"==typeof e.hidden?!e.hidden:!this.data.datasets[t].hidden},generateLegend:function(){return this.options.legendCallback(this)},destroyDatasetMeta:function(t){var e=this.id,n=this.data.datasets[t],i=n._meta&&n._meta[e];i&&(i.controller.destroy(),delete n._meta[e])},destroy:function(){var e,n,i=this,o=i.canvas;for(i.stop(),e=0,n=i.data.datasets.length;e<n;++e)i.destroyDatasetMeta(e);o&&(i.unbindEvents(),a.canvas.clear(i),r.releaseContext(i.ctx),i.canvas=null,i.ctx=null),s.notify(i,"destroy"),delete t.instances[i.id]},toBase64Image:function(){return this.canvas.toDataURL.apply(this.canvas,arguments)},initToolTip:function(){var e=this;e.tooltip=new t.Tooltip({_chart:e,_chartInstance:e,_data:e.data,_options:e.options.tooltips},e)},bindEvents:function(){var t=this,e=t._listeners={},n=function(){t.eventHandler.apply(t,arguments)};a.each(t.options.events,function(i){r.addEventListener(t,i,n),e[i]=n}),t.options.responsive&&(n=function(){t.resize()},r.addEventListener(t,"resize",n),e.resize=n)},unbindEvents:function(){var t=this,e=t._listeners;e&&(delete t._listeners,a.each(e,function(e,n){r.removeEventListener(t,n,e)}))},updateHoverStyle:function(t,e,n){var i,a,o,r=n?"setHoverStyle":"removeHoverStyle";for(a=0,o=t.length;a<o;++a)(i=t[a])&&this.getDatasetMeta(i._datasetIndex).controller[r](i)},eventHandler:function(t){var e=this,n=e.tooltip;if(!1!==s.notify(e,"beforeEvent",[t])){e._bufferedRender=!0,e._bufferedRequest=null;var i=e.handleEvent(t);i|=n&&n.handleEvent(t),s.notify(e,"afterEvent",[t]);var a=e._bufferedRequest;return a?e.render(a):i&&!e.animating&&(e.stop(),e.render(e.options.hover.animationDuration,!0)),e._bufferedRender=!1,e._bufferedRequest=null,e}},handleEvent:function(t){var e=this,n=e.options||{},i=n.hover,o=!1;return e.lastActive=e.lastActive||[],"mouseout"===t.type?e.active=[]:e.active=e.getElementsAtEventForMode(t,i.mode,i),a.callback(n.onHover||n.hover.onHover,[t.native,e.active],e),"mouseup"!==t.type&&"click"!==t.type||n.onClick&&n.onClick.call(e,t.native,e.active),e.lastActive.length&&e.updateHoverStyle(e.lastActive,i.mode,!1),e.active.length&&i.mode&&e.updateHoverStyle(e.active,i.mode,!0),o=!a.arrayEquals(e.active,e.lastActive),e.lastActive=e.active,o}}),t.Controller=t}},{25:25,28:28,45:45,48:48}],24:[function(t,e,n){"use strict";var i=t(45);e.exports=function(t){function e(t,e){t._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),a.forEach(function(e){var n="onData"+e.charAt(0).toUpperCase()+e.slice(1),a=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:function(){var e=Array.prototype.slice.call(arguments),o=a.apply(this,e);return i.each(t._chartjs.listeners,function(t){"function"==typeof t[n]&&t[n].apply(t,e)}),o}})}))}function n(t,e){var n=t._chartjs;if(n){var i=n.listeners,o=i.indexOf(e);-1!==o&&i.splice(o,1),i.length>0||(a.forEach(function(e){delete t[e]}),delete t._chartjs)}}var a=["push","pop","shift","splice","unshift"];t.DatasetController=function(t,e){this.initialize(t,e)},i.extend(t.DatasetController.prototype,{datasetElementType:null,dataElementType:null,initialize:function(t,e){var n=this;n.chart=t,n.index=e,n.linkScales(),n.addElements()},updateIndex:function(t){this.index=t},linkScales:function(){var t=this,e=t.getMeta(),n=t.getDataset();null===e.xAxisID&&(e.xAxisID=n.xAxisID||t.chart.options.scales.xAxes[0].id),null===e.yAxisID&&(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]},reset:function(){this.update(!0)},destroy:function(){this._data&&n(this._data,this)},createMetaDataset:function(){var t=this,e=t.datasetElementType;return e&&new e({_chart:t.chart,_datasetIndex:t.index})},createMetaData:function(t){var e=this,n=e.dataElementType;return n&&new n({_chart:e.chart,_datasetIndex:e.index,_index:t})},addElements:function(){var t,e,n=this,i=n.getMeta(),a=n.getDataset().data||[],o=i.data;for(t=0,e=a.length;t<e;++t)o[t]=o[t]||n.createMetaData(t);i.dataset=i.dataset||n.createMetaDataset()},addElementAndReset:function(t){var e=this.createMetaData(t);this.getMeta().data.splice(t,0,e),this.updateElement(e,t,!0)},buildOrUpdateElements:function(){var t=this,i=t.getDataset(),a=i.data||(i.data=[]);t._data!==a&&(t._data&&n(t._data,t),e(a,t),t._data=a),t.resyncElements()},update:i.noop,transition:function(t){for(var e=this.getMeta(),n=e.data||[],i=n.length,a=0;a<i;++a)n[a].transition(t);e.dataset&&e.dataset.transition(t)},draw:function(){var t=this.getMeta(),e=t.data||[],n=e.length,i=0;for(t.dataset&&t.dataset.draw();i<n;++i)e[i].draw()},removeHoverStyle:function(t,e){var n=this.chart.data.datasets[t._datasetIndex],a=t._index,o=t.custom||{},r=i.valueAtIndexOrDefault,l=t._model;l.backgroundColor=o.backgroundColor?o.backgroundColor:r(n.backgroundColor,a,e.backgroundColor),l.borderColor=o.borderColor?o.borderColor:r(n.borderColor,a,e.borderColor),l.borderWidth=o.borderWidth?o.borderWidth:r(n.borderWidth,a,e.borderWidth)},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t._index,a=t.custom||{},o=i.valueAtIndexOrDefault,r=i.getHoverColor,l=t._model;l.backgroundColor=a.hoverBackgroundColor?a.hoverBackgroundColor:o(e.hoverBackgroundColor,n,r(l.backgroundColor)),l.borderColor=a.hoverBorderColor?a.hoverBorderColor:o(e.hoverBorderColor,n,r(l.borderColor)),l.borderWidth=a.hoverBorderWidth?a.hoverBorderWidth:o(e.hoverBorderWidth,n,l.borderWidth)},resyncElements:function(){var t=this,e=t.getMeta(),n=t.getDataset().data,i=e.data.length,a=n.length;a<i?e.data.splice(a,i-a):a>i&&t.insertElements(i,a-i)},insertElements:function(t,e){for(var n=0;n<e;++n)this.addElementAndReset(t+n)},onDataPush:function(){this.insertElements(this.getDataset().data.length-1,arguments.length)},onDataPop:function(){this.getMeta().data.pop()},onDataShift:function(){this.getMeta().data.shift()},onDataSplice:function(t,e){this.getMeta().data.splice(t,e),this.insertElements(t,arguments.length-2)},onDataUnshift:function(){this.insertElements(0,arguments.length)}}),t.DatasetController.extend=i.inherits}},{45:45}],25:[function(t,e,n){"use strict";var i=t(45);e.exports={_set:function(t,e){return i.merge(this[t]||(this[t]={}),e)}}},{45:45}],26:[function(t,e,n){"use strict";function i(t,e,n,i){var o,r,l,s,u,d,c,h,f,g=Object.keys(n);for(o=0,r=g.length;o<r;++o)if(l=g[o],d=n[l],e.hasOwnProperty(l)||(e[l]=d),(s=e[l])!==d&&"_"!==l[0]){if(t.hasOwnProperty(l)||(t[l]=s),u=t[l],(c=typeof d)===typeof u)if("string"===c){if((h=a(u)).valid&&(f=a(d)).valid){e[l]=f.mix(h,i).rgbString();continue}}else if("number"===c&&isFinite(u)&&isFinite(d)){e[l]=u+(d-u)*i;continue}e[l]=d}}var a=t(3),o=t(45),r=function(t){o.extend(this,t),this.initialize.apply(this,arguments)};o.extend(r.prototype,{initialize:function(){this.hidden=!1},pivot:function(){var t=this;return t._view||(t._view=o.clone(t._model)),t._start={},t},transition:function(t){var e=this,n=e._model,a=e._start,o=e._view;return n&&1!==t?(o||(o=e._view={}),a||(a=e._start={}),i(a,o,n,t),e):(e._view=n,e._start=null,e)},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return o.isNumber(this._model.x)&&o.isNumber(this._model.y)}}),r.extend=o.inherits,e.exports=r},{3:3,45:45}],27:[function(t,e,n){"use strict";var i=t(3),a=t(25),o=t(45);e.exports=function(t){function e(t,e,n){var i;return"string"==typeof t?(i=parseInt(t,10),-1!==t.indexOf("%")&&(i=i/100*e.parentNode[n])):i=t,i}function n(t){return void 0!==t&&null!==t&&"none"!==t}function r(t,i,a){var o=document.defaultView,r=t.parentNode,l=o.getComputedStyle(t)[i],s=o.getComputedStyle(r)[i],u=n(l),d=n(s),c=Number.POSITIVE_INFINITY;return u||d?Math.min(u?e(l,t,a):c,d?e(s,r,a):c):"none"}o.configMerge=function(){return o.merge(o.clone(arguments[0]),[].slice.call(arguments,1),{merger:function(e,n,i,a){var r=n[e]||{},l=i[e];"scales"===e?n[e]=o.scaleMerge(r,l):"scale"===e?n[e]=o.merge(r,[t.scaleService.getScaleDefaults(l.type),l]):o._merger(e,n,i,a)}})},o.scaleMerge=function(){return o.merge(o.clone(arguments[0]),[].slice.call(arguments,1),{merger:function(e,n,i,a){if("xAxes"===e||"yAxes"===e){var r,l,s,u=i[e].length;for(n[e]||(n[e]=[]),r=0;r<u;++r)s=i[e][r],l=o.valueOrDefault(s.type,"xAxes"===e?"category":"linear"),r>=n[e].length&&n[e].push({}),!n[e][r].type||s.type&&s.type!==n[e][r].type?o.merge(n[e][r],[t.scaleService.getScaleDefaults(l),s]):o.merge(n[e][r],s)}else o._merger(e,n,i,a)}})},o.where=function(t,e){if(o.isArray(t)&&Array.prototype.filter)return t.filter(e);var n=[];return o.each(t,function(t){e(t)&&n.push(t)}),n},o.findIndex=Array.prototype.findIndex?function(t,e,n){return t.findIndex(e,n)}:function(t,e,n){n=void 0===n?t:n;for(var i=0,a=t.length;i<a;++i)if(e.call(n,t[i],i,t))return i;return-1},o.findNextWhere=function(t,e,n){o.isNullOrUndef(n)&&(n=-1);for(var i=n+1;i<t.length;i++){var a=t[i];if(e(a))return a}},o.findPreviousWhere=function(t,e,n){o.isNullOrUndef(n)&&(n=t.length);for(var i=n-1;i>=0;i--){var a=t[i];if(e(a))return a}},o.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},o.almostEquals=function(t,e,n){return Math.abs(t-e)<n},o.almostWhole=function(t,e){var n=Math.round(t);return n-e<t&&n+e>t},o.max=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.max(t,e)},Number.NEGATIVE_INFINITY)},o.min=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.min(t,e)},Number.POSITIVE_INFINITY)},o.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return 0==(t=+t)||isNaN(t)?t:t>0?1:-1},o.log10=Math.log10?function(t){return Math.log10(t)}:function(t){return Math.log(t)/Math.LN10},o.toRadians=function(t){return t*(Math.PI/180)},o.toDegrees=function(t){return t*(180/Math.PI)},o.getAngleFromPoint=function(t,e){var n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),o=Math.atan2(i,n);return o<-.5*Math.PI&&(o+=2*Math.PI),{angle:o,distance:a}},o.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},o.aliasPixel=function(t){return t%2==0?0:.5},o.splineCurve=function(t,e,n,i){var a=t.skip?e:t,o=e,r=n.skip?e:n,l=Math.sqrt(Math.pow(o.x-a.x,2)+Math.pow(o.y-a.y,2)),s=Math.sqrt(Math.pow(r.x-o.x,2)+Math.pow(r.y-o.y,2)),u=l/(l+s),d=s/(l+s),c=i*(u=isNaN(u)?0:u),h=i*(d=isNaN(d)?0:d);return{previous:{x:o.x-c*(r.x-a.x),y:o.y-c*(r.y-a.y)},next:{x:o.x+h*(r.x-a.x),y:o.y+h*(r.y-a.y)}}},o.EPSILON=Number.EPSILON||1e-14,o.splineCurveMonotone=function(t){var e,n,i,a,r=(t||[]).map(function(t){return{model:t._model,deltaK:0,mK:0}}),l=r.length;for(e=0;e<l;++e)if(!(i=r[e]).model.skip){if(n=e>0?r[e-1]:null,(a=e<l-1?r[e+1]:null)&&!a.model.skip){var s=a.model.x-i.model.x;i.deltaK=0!==s?(a.model.y-i.model.y)/s:0}!n||n.model.skip?i.mK=i.deltaK:!a||a.model.skip?i.mK=n.deltaK:this.sign(n.deltaK)!==this.sign(i.deltaK)?i.mK=0:i.mK=(n.deltaK+i.deltaK)/2}var u,d,c,h;for(e=0;e<l-1;++e)i=r[e],a=r[e+1],i.model.skip||a.model.skip||(o.almostEquals(i.deltaK,0,this.EPSILON)?i.mK=a.mK=0:(u=i.mK/i.deltaK,d=a.mK/i.deltaK,(h=Math.pow(u,2)+Math.pow(d,2))<=9||(c=3/Math.sqrt(h),i.mK=u*c*i.deltaK,a.mK=d*c*i.deltaK)));var f;for(e=0;e<l;++e)(i=r[e]).model.skip||(n=e>0?r[e-1]:null,a=e<l-1?r[e+1]:null,n&&!n.model.skip&&(f=(i.model.x-n.model.x)/3,i.model.controlPointPreviousX=i.model.x-f,i.model.controlPointPreviousY=i.model.y-f*i.mK),a&&!a.model.skip&&(f=(a.model.x-i.model.x)/3,i.model.controlPointNextX=i.model.x+f,i.model.controlPointNextY=i.model.y+f*i.mK))},o.nextItem=function(t,e,n){return n?e>=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},o.previousItem=function(t,e,n){return n?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},o.niceNum=function(t,e){var n=Math.floor(o.log10(t)),i=t/Math.pow(10,n);return(e?i<1.5?1:i<3?2:i<7?5:10:i<=1?1:i<=2?2:i<=5?5:10)*Math.pow(10,n)},o.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)},o.getRelativePosition=function(t,e){var n,i,a=t.originalEvent||t,r=t.currentTarget||t.srcElement,l=r.getBoundingClientRect(),s=a.touches;s&&s.length>0?(n=s[0].clientX,i=s[0].clientY):(n=a.clientX,i=a.clientY);var u=parseFloat(o.getStyle(r,"padding-left")),d=parseFloat(o.getStyle(r,"padding-top")),c=parseFloat(o.getStyle(r,"padding-right")),h=parseFloat(o.getStyle(r,"padding-bottom")),f=l.right-l.left-u-c,g=l.bottom-l.top-d-h;return n=Math.round((n-l.left-u)/f*r.width/e.currentDevicePixelRatio),i=Math.round((i-l.top-d)/g*r.height/e.currentDevicePixelRatio),{x:n,y:i}},o.getConstraintWidth=function(t){return r(t,"max-width","clientWidth")},o.getConstraintHeight=function(t){return r(t,"max-height","clientHeight")},o.getMaximumWidth=function(t){var e=t.parentNode;if(!e)return t.clientWidth;var n=parseInt(o.getStyle(e,"padding-left"),10),i=parseInt(o.getStyle(e,"padding-right"),10),a=e.clientWidth-n-i,r=o.getConstraintWidth(t);return isNaN(r)?a:Math.min(a,r)},o.getMaximumHeight=function(t){var e=t.parentNode;if(!e)return t.clientHeight;var n=parseInt(o.getStyle(e,"padding-top"),10),i=parseInt(o.getStyle(e,"padding-bottom"),10),a=e.clientHeight-n-i,r=o.getConstraintHeight(t);return isNaN(r)?a:Math.min(a,r)},o.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},o.retinaScale=function(t,e){var n=t.currentDevicePixelRatio=e||window.devicePixelRatio||1;if(1!==n){var i=t.canvas,a=t.height,o=t.width;i.height=a*n,i.width=o*n,t.ctx.scale(n,n),i.style.height=a+"px",i.style.width=o+"px"}},o.fontString=function(t,e,n){return e+" "+t+"px "+n},o.longestText=function(t,e,n,i){var a=(i=i||{}).data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(a=i.data={},r=i.garbageCollect=[],i.font=e),t.font=e;var l=0;o.each(n,function(e){void 0!==e&&null!==e&&!0!==o.isArray(e)?l=o.measureText(t,a,r,l,e):o.isArray(e)&&o.each(e,function(e){void 0===e||null===e||o.isArray(e)||(l=o.measureText(t,a,r,l,e))})});var s=r.length/2;if(s>n.length){for(var u=0;u<s;u++)delete a[r[u]];r.splice(0,s)}return l},o.measureText=function(t,e,n,i,a){var o=e[a];return o||(o=e[a]=t.measureText(a).width,n.push(a)),o>i&&(i=o),i},o.numberOfLabelLines=function(t){var e=1;return o.each(t,function(t){o.isArray(t)&&t.length>e&&(e=t.length)}),e},o.color=i?function(t){return t instanceof CanvasGradient&&(t=a.global.defaultColor),i(t)}:function(t){return console.error("Color.js not found!"),t},o.getHoverColor=function(t){return t instanceof CanvasPattern?t:o.color(t).saturate(.5).darken(.1).rgbString()}}},{25:25,3:3,45:45}],28:[function(t,e,n){"use strict";function i(t,e){return t.native?{x:t.x,y:t.y}:u.getRelativePosition(t,e)}function a(t,e){var n,i,a,o,r;for(i=0,o=t.data.datasets.length;i<o;++i)if(t.isDatasetVisible(i))for(a=0,r=(n=t.getDatasetMeta(i)).data.length;a<r;++a){var l=n.data[a];l._view.skip||e(l)}}function o(t,e){var n=[];return a(t,function(t){t.inRange(e.x,e.y)&&n.push(t)}),n}function r(t,e,n,i){var o=Number.POSITIVE_INFINITY,r=[];return a(t,function(t){if(!n||t.inRange(e.x,e.y)){var a=t.getCenterPoint(),l=i(e,a);l<o?(r=[t],o=l):l===o&&r.push(t)}}),r}function l(t){var e=-1!==t.indexOf("x"),n=-1!==t.indexOf("y");return function(t,i){var a=e?Math.abs(t.x-i.x):0,o=n?Math.abs(t.y-i.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(o,2))}}function s(t,e,n){var a=i(e,t);n.axis=n.axis||"x";var s=l(n.axis),u=n.intersect?o(t,a):r(t,a,!1,s),d=[];return u.length?(t.data.datasets.forEach(function(e,n){if(t.isDatasetVisible(n)){var i=t.getDatasetMeta(n).data[u[0]._index];i&&!i._view.skip&&d.push(i)}}),d):[]}var u=t(45);e.exports={modes:{single:function(t,e){var n=i(e,t),o=[];return a(t,function(t){if(t.inRange(n.x,n.y))return o.push(t),o}),o.slice(0,1)},label:s,index:s,dataset:function(t,e,n){var a=i(e,t);n.axis=n.axis||"xy";var s=l(n.axis),u=n.intersect?o(t,a):r(t,a,!1,s);return u.length>0&&(u=t.getDatasetMeta(u[0]._datasetIndex).data),u},"x-axis":function(t,e){return s(t,e,{intersect:!1})},point:function(t,e){return o(t,i(e,t))},nearest:function(t,e,n){var a=i(e,t);n.axis=n.axis||"xy";var o=l(n.axis),s=r(t,a,n.intersect,o);return s.length>1&&s.sort(function(t,e){var n=t.getArea()-e.getArea();return 0===n&&(n=t._datasetIndex-e._datasetIndex),n}),s.slice(0,1)},x:function(t,e,n){var o=i(e,t),r=[],l=!1;return a(t,function(t){t.inXRange(o.x)&&r.push(t),t.inRange(o.x,o.y)&&(l=!0)}),n.intersect&&!l&&(r=[]),r},y:function(t,e,n){var o=i(e,t),r=[],l=!1;return a(t,function(t){t.inYRange(o.y)&&r.push(t),t.inRange(o.x,o.y)&&(l=!0)}),n.intersect&&!l&&(r=[]),r}}}},{45:45}],29:[function(t,e,n){"use strict";t(25)._set("global",{responsive:!0,responsiveAnimationDuration:0,maintainAspectRatio:!0,events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,defaultColor:"rgba(0,0,0,0.1)",defaultFontColor:"#666",defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFontStyle:"normal",showLines:!0,elements:{},layout:{padding:{top:0,right:0,bottom:0,left:0}}}),e.exports=function(){var t=function(t,e){return this.construct(t,e),this};return t.Chart=t,t}},{25:25}],30:[function(t,e,n){"use strict";var i=t(45);e.exports=function(t){function e(t,e){return i.where(t,function(t){return t.position===e})}function n(t,e){t.forEach(function(t,e){return t._tmpIndex_=e,t}),t.sort(function(t,n){var i=e?n:t,a=e?t:n;return i.weight===a.weight?i._tmpIndex_-a._tmpIndex_:i.weight-a.weight}),t.forEach(function(t){delete t._tmpIndex_})}t.layoutService={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 i,a=["fullWidth","position","weight"],o=a.length,r=0;r<o;++r)i=a[r],n.hasOwnProperty(i)&&(e[i]=n[i])},update:function(t,a,o){function r(t){var e=i.findNextWhere(_,function(e){return e.box===t});if(e)if(t.isHorizontal()){var n={left:Math.max(T,D),right:Math.max(F,I),top:0,bottom:0};t.update(t.fullWidth?x:S,y/2,n)}else t.update(e.minSize.width,C)}function l(t){t.isHorizontal()?(t.left=t.fullWidth?d:T,t.right=t.fullWidth?a-c:T+S,t.top=V,t.bottom=V+t.height,V=t.bottom):(t.left=N,t.right=N+t.width,t.top=O,t.bottom=O+C,N=t.right)}if(t){var s=t.options.layout||{},u=i.options.toPadding(s.padding),d=u.left,c=u.right,h=u.top,f=u.bottom,g=e(t.boxes,"left"),p=e(t.boxes,"right"),v=e(t.boxes,"top"),m=e(t.boxes,"bottom"),b=e(t.boxes,"chartArea");n(g,!0),n(p,!1),n(v,!0),n(m,!1);var x=a-d-c,y=o-h-f,k=y/2,w=(a-x/2)/(g.length+p.length),M=(o-k)/(v.length+m.length),S=x,C=y,_=[];i.each(g.concat(p,v,m),function(t){var e,n=t.isHorizontal();n?(e=t.update(t.fullWidth?x:S,M),C-=e.height):(e=t.update(w,k),S-=e.width),_.push({horizontal:n,minSize:e,box:t})});var D=0,I=0,P=0,A=0;i.each(v.concat(m),function(t){if(t.getPadding){var e=t.getPadding();D=Math.max(D,e.left),I=Math.max(I,e.right)}}),i.each(g.concat(p),function(t){if(t.getPadding){var e=t.getPadding();P=Math.max(P,e.top),A=Math.max(A,e.bottom)}});var T=d,F=c,O=h,R=f;i.each(g.concat(p),r),i.each(g,function(t){T+=t.width}),i.each(p,function(t){F+=t.width}),i.each(v.concat(m),r),i.each(v,function(t){O+=t.height}),i.each(m,function(t){R+=t.height}),i.each(g.concat(p),function(t){var e=i.findNextWhere(_,function(e){return e.box===t}),n={left:0,right:0,top:O,bottom:R};e&&t.update(e.minSize.width,C,n)}),T=d,F=c,O=h,R=f,i.each(g,function(t){T+=t.width}),i.each(p,function(t){F+=t.width}),i.each(v,function(t){O+=t.height}),i.each(m,function(t){R+=t.height});var L=Math.max(D-T,0);T+=L,F+=Math.max(I-F,0);var z=Math.max(P-O,0);O+=z,R+=Math.max(A-R,0);var B=o-O-R,W=a-T-F;W===S&&B===C||(i.each(g,function(t){t.height=B}),i.each(p,function(t){t.height=B}),i.each(v,function(t){t.fullWidth||(t.width=W)}),i.each(m,function(t){t.fullWidth||(t.width=W)}),C=B,S=W);var N=d+L,V=h+z;i.each(g.concat(v),l),N+=S,V+=C,i.each(p,l),i.each(m,l),t.chartArea={left:T,top:O,right:T+S,bottom:O+C},i.each(b,function(e){e.left=t.chartArea.left,e.top=t.chartArea.top,e.right=t.chartArea.right,e.bottom=t.chartArea.bottom,e.update(S,C)})}}}}},{45:45}],31:[function(t,e,n){"use strict";var i=t(25),a=t(26),o=t(45);i._set("global",{plugins:{}}),e.exports=function(t){t.plugins={_plugins:[],_cacheId:0,register:function(t){var e=this._plugins;[].concat(t).forEach(function(t){-1===e.indexOf(t)&&e.push(t)}),this._cacheId++},unregister:function(t){var e=this._plugins;[].concat(t).forEach(function(t){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}),this._cacheId++},clear:function(){this._plugins=[],this._cacheId++},count:function(){return this._plugins.length},getAll:function(){return this._plugins},notify:function(t,e,n){var i,a,o,r,l,s=this.descriptors(t),u=s.length;for(i=0;i<u;++i)if(a=s[i],o=a.plugin,"function"==typeof(l=o[e])&&((r=[t].concat(n||[])).push(a.options),!1===l.apply(o,r)))return!1;return!0},descriptors:function(t){var e=t._plugins||(t._plugins={});if(e.id===this._cacheId)return e.descriptors;var n=[],a=[],r=t&&t.config||{},l=r.options&&r.options.plugins||{};return this._plugins.concat(r.plugins||[]).forEach(function(t){if(-1===n.indexOf(t)){var e=t.id,r=l[e];!1!==r&&(!0===r&&(r=o.clone(i.global.plugins[e])),n.push(t),a.push({plugin:t,options:r||{}}))}}),e.descriptors=a,e.id=this._cacheId,a}},t.pluginService=t.plugins,t.PluginBase=a.extend({})}},{25:25,26:26,45:45}],32:[function(t,e,n){"use strict";function i(t){var e,n,i=[];for(e=0,n=t.length;e<n;++e)i.push(t[e].label);return i}function a(t,e,n){var i=t.getPixelForTick(e);return n&&(i-=0===e?(t.getPixelForTick(1)-i)/2:(i-t.getPixelForTick(e-1))/2),i}var o=t(25),r=t(26),l=t(45),s=t(34);o._set("scale",{display:!0,position:"left",offset:!1,gridLines:{display:!0,color:"rgba(0, 0, 0, 0.1)",lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickMarkLength:10,zeroLineWidth:1,zeroLineColor:"rgba(0,0,0,0.25)",zeroLineBorderDash:[],zeroLineBorderDashOffset:0,offsetGridLines:!1,borderDash:[],borderDashOffset:0},scaleLabel:{display:!1,labelString:"",lineHeight:1.2,padding:{top:4,bottom:4}},ticks:{beginAtZero:!1,minRotation:0,maxRotation:50,mirror:!1,padding:0,reverse:!1,display:!0,autoSkip:!0,autoSkipPadding:0,labelOffset:0,callback:s.formatters.values,minor:{},major:{}}}),e.exports=function(t){function e(t,e,n){return l.isArray(e)?l.longestText(t,n,e):t.measureText(e).width}function n(t){var e=l.valueOrDefault,n=o.global,i=e(t.fontSize,n.defaultFontSize),a=e(t.fontStyle,n.defaultFontStyle),r=e(t.fontFamily,n.defaultFontFamily);return{size:i,style:a,family:r,font:l.fontString(i,a,r)}}function s(t){return l.options.toLineHeight(l.valueOrDefault(t.lineHeight,1.2),l.valueOrDefault(t.fontSize,o.global.defaultFontSize))}t.Scale=r.extend({getPadding:function(){var t=this;return{left:t.paddingLeft||0,top:t.paddingTop||0,right:t.paddingRight||0,bottom:t.paddingBottom||0}},getTicks:function(){return this._ticks},mergeTicksOptions:function(){var t=this.options.ticks;!1===t.minor&&(t.minor={display:!1}),!1===t.major&&(t.major={display:!1});for(var e in t)"major"!==e&&"minor"!==e&&(void 0===t.minor[e]&&(t.minor[e]=t[e]),void 0===t.major[e]&&(t.major[e]=t[e]))},beforeUpdate:function(){l.callback(this.options.beforeUpdate,[this])},update:function(t,e,n){var i,a,o,r,s,u,d=this;for(d.beforeUpdate(),d.maxWidth=t,d.maxHeight=e,d.margins=l.extend({left:0,right:0,top:0,bottom:0},n),d.longestTextCache=d.longestTextCache||{},d.beforeSetDimensions(),d.setDimensions(),d.afterSetDimensions(),d.beforeDataLimits(),d.determineDataLimits(),d.afterDataLimits(),d.beforeBuildTicks(),s=d.buildTicks()||[],d.afterBuildTicks(),d.beforeTickToLabelConversion(),o=d.convertTicksToLabels(s)||d.ticks,d.afterTickToLabelConversion(),d.ticks=o,i=0,a=o.length;i<a;++i)r=o[i],(u=s[i])?u.label=r:s.push(u={label:r,major:!1});return d._ticks=s,d.beforeCalculateTickRotation(),d.calculateTickRotation(),d.afterCalculateTickRotation(),d.beforeFit(),d.fit(),d.afterFit(),d.afterUpdate(),d.minSize},afterUpdate:function(){l.callback(this.options.afterUpdate,[this])},beforeSetDimensions:function(){l.callback(this.options.beforeSetDimensions,[this])},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},afterSetDimensions:function(){l.callback(this.options.afterSetDimensions,[this])},beforeDataLimits:function(){l.callback(this.options.beforeDataLimits,[this])},determineDataLimits:l.noop,afterDataLimits:function(){l.callback(this.options.afterDataLimits,[this])},beforeBuildTicks:function(){l.callback(this.options.beforeBuildTicks,[this])},buildTicks:l.noop,afterBuildTicks:function(){l.callback(this.options.afterBuildTicks,[this])},beforeTickToLabelConversion:function(){l.callback(this.options.beforeTickToLabelConversion,[this])},convertTicksToLabels:function(){var t=this,e=t.options.ticks;t.ticks=t.ticks.map(e.userCallback||e.callback,this)},afterTickToLabelConversion:function(){l.callback(this.options.afterTickToLabelConversion,[this])},beforeCalculateTickRotation:function(){l.callback(this.options.beforeCalculateTickRotation,[this])},calculateTickRotation:function(){var t=this,e=t.ctx,a=t.options.ticks,o=i(t._ticks),r=n(a);e.font=r.font;var s=a.minRotation||0;if(o.length&&t.options.display&&t.isHorizontal())for(var u,d=l.longestText(e,r.font,o,t.longestTextCache),c=d,h=t.getPixelForTick(1)-t.getPixelForTick(0)-6;c>h&&s<a.maxRotation;){var f=l.toRadians(s);if(u=Math.cos(f),Math.sin(f)*d>t.maxHeight){s--;break}s++,c=u*d}t.labelRotation=s},afterCalculateTickRotation:function(){l.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){l.callback(this.options.beforeFit,[this])},fit:function(){var t=this,a=t.minSize={width:0,height:0},o=i(t._ticks),r=t.options,u=r.ticks,d=r.scaleLabel,c=r.gridLines,h=r.display,f=t.isHorizontal(),g=n(u),p=r.gridLines.tickMarkLength;if(a.width=f?t.isFullWidth()?t.maxWidth-t.margins.left-t.margins.right:t.maxWidth:h&&c.drawTicks?p:0,a.height=f?h&&c.drawTicks?p:0:t.maxHeight,d.display&&h){var v=s(d)+l.options.toPadding(d.padding).height;f?a.height+=v:a.width+=v}if(u.display&&h){var m=l.longestText(t.ctx,g.font,o,t.longestTextCache),b=l.numberOfLabelLines(o),x=.5*g.size,y=t.options.ticks.padding;if(f){t.longestLabelWidth=m;var k=l.toRadians(t.labelRotation),w=Math.cos(k),M=Math.sin(k)*m+g.size*b+x*(b-1)+x;a.height=Math.min(t.maxHeight,a.height+M+y),t.ctx.font=g.font;var S=e(t.ctx,o[0],g.font),C=e(t.ctx,o[o.length-1],g.font);0!==t.labelRotation?(t.paddingLeft="bottom"===r.position?w*S+3:w*x+3,t.paddingRight="bottom"===r.position?w*x+3:w*C+3):(t.paddingLeft=S/2+3,t.paddingRight=C/2+3)}else u.mirror?m=0:m+=y+x,a.width=Math.min(t.maxWidth,a.width+m),t.paddingTop=g.size/2,t.paddingBottom=g.size/2}t.handleMargins(),t.width=a.width,t.height=a.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(){l.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(l.isNullOrUndef(t))return NaN;if("number"==typeof t&&!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:l.noop,getPixelForValue:l.noop,getValueForPixel:l.noop,getPixelForTick:function(t){var e=this,n=e.options.offset;if(e.isHorizontal()){var i=(e.width-(e.paddingLeft+e.paddingRight))/Math.max(e._ticks.length-(n?0:1),1),a=i*t+e.paddingLeft;n&&(a+=i/2);var o=e.left+Math.round(a);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,i=e.left+Math.round(n);return i+=e.isFullWidth()?e.margins.left:0}return e.top+t*e.height},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var t=this,e=t.min,n=t.max;return t.beginAtZero?0:e<0&&n<0?n:e>0&&n>0?e:0},_autoSkip:function(t){var e,n,i,a,o=this,r=o.isHorizontal(),s=o.options.ticks.minor,u=t.length,d=l.toRadians(o.labelRotation),c=Math.cos(d),h=o.longestLabelWidth*c,f=[];for(s.maxTicksLimit&&(a=s.maxTicksLimit),r&&(e=!1,(h+s.autoSkipPadding)*u>o.width-(o.paddingLeft+o.paddingRight)&&(e=1+Math.floor((h+s.autoSkipPadding)*u/(o.width-(o.paddingLeft+o.paddingRight)))),a&&u>a&&(e=Math.max(e,Math.floor(u/a)))),n=0;n<u;n++)i=t[n],(e>1&&n%e>0||n%e==0&&n+e>=u)&&n!==u-1&&delete i.label,f.push(i);return f},draw:function(t){var e=this,i=e.options;if(i.display){var r=e.ctx,u=o.global,d=i.ticks.minor,c=i.ticks.major||d,h=i.gridLines,f=i.scaleLabel,g=0!==e.labelRotation,p=e.isHorizontal(),v=d.autoSkip?e._autoSkip(e.getTicks()):e.getTicks(),m=l.valueOrDefault(d.fontColor,u.defaultFontColor),b=n(d),x=l.valueOrDefault(c.fontColor,u.defaultFontColor),y=n(c),k=h.drawTicks?h.tickMarkLength:0,w=l.valueOrDefault(f.fontColor,u.defaultFontColor),M=n(f),S=l.options.toPadding(f.padding),C=l.toRadians(e.labelRotation),_=[],D="right"===i.position?e.left:e.right-k,I="right"===i.position?e.left+k:e.right,P="bottom"===i.position?e.top:e.bottom-k,A="bottom"===i.position?e.top+k:e.bottom;if(l.each(v,function(n,o){if(!l.isNullOrUndef(n.label)){var r,s,c,f,m=n.label;o===e.zeroLineIndex&&i.offset===h.offsetGridLines?(r=h.zeroLineWidth,s=h.zeroLineColor,c=h.zeroLineBorderDash,f=h.zeroLineBorderDashOffset):(r=l.valueAtIndexOrDefault(h.lineWidth,o),s=l.valueAtIndexOrDefault(h.color,o),c=l.valueOrDefault(h.borderDash,u.borderDash),f=l.valueOrDefault(h.borderDashOffset,u.borderDashOffset));var b,x,y,w,M,S,T,F,O,R,L="middle",z="middle",B=d.padding;if(p){var W=k+B;"bottom"===i.position?(z=g?"middle":"top",L=g?"right":"center",R=e.top+W):(z=g?"middle":"bottom",L=g?"left":"center",R=e.bottom-W);var N=a(e,o,h.offsetGridLines&&v.length>1);N<e.left&&(s="rgba(0,0,0,0)"),N+=l.aliasPixel(r),O=e.getPixelForTick(o)+d.labelOffset,b=y=M=T=N,x=P,w=A,S=t.top,F=t.bottom}else{var V,E="left"===i.position;d.mirror?(L=E?"left":"right",V=B):(L=E?"right":"left",V=k+B),O=E?e.right-V:e.left+V;var H=a(e,o,h.offsetGridLines&&v.length>1);H<e.top&&(s="rgba(0,0,0,0)"),H+=l.aliasPixel(r),R=e.getPixelForTick(o)+d.labelOffset,b=D,y=I,M=t.left,T=t.right,x=w=S=F=H}_.push({tx1:b,ty1:x,tx2:y,ty2:w,x1:M,y1:S,x2:T,y2:F,labelX:O,labelY:R,glWidth:r,glColor:s,glBorderDash:c,glBorderDashOffset:f,rotation:-1*C,label:m,major:n.major,textBaseline:z,textAlign:L})}}),l.each(_,function(t){if(h.display&&(r.save(),r.lineWidth=t.glWidth,r.strokeStyle=t.glColor,r.setLineDash&&(r.setLineDash(t.glBorderDash),r.lineDashOffset=t.glBorderDashOffset),r.beginPath(),h.drawTicks&&(r.moveTo(t.tx1,t.ty1),r.lineTo(t.tx2,t.ty2)),h.drawOnChartArea&&(r.moveTo(t.x1,t.y1),r.lineTo(t.x2,t.y2)),r.stroke(),r.restore()),d.display){r.save(),r.translate(t.labelX,t.labelY),r.rotate(t.rotation),r.font=t.major?y.font:b.font,r.fillStyle=t.major?x:m,r.textBaseline=t.textBaseline,r.textAlign=t.textAlign;var e=t.label;if(l.isArray(e))for(var n=0,i=0;n<e.length;++n)r.fillText(""+e[n],0,i),i+=1.5*b.size;else r.fillText(e,0,0);r.restore()}}),f.display){var T,F,O=0,R=s(f)/2;if(p)T=e.left+(e.right-e.left)/2,F="bottom"===i.position?e.bottom-R-S.bottom:e.top+R+S.top;else{var L="left"===i.position;T=L?e.left+R+S.top:e.right-R-S.top,F=e.top+(e.bottom-e.top)/2,O=L?-.5*Math.PI:.5*Math.PI}r.save(),r.translate(T,F),r.rotate(O),r.textAlign="center",r.textBaseline="middle",r.fillStyle=w,r.font=M.font,r.fillText(f.labelString,0,0),r.restore()}if(h.drawBorder){r.lineWidth=l.valueAtIndexOrDefault(h.lineWidth,0),r.strokeStyle=l.valueAtIndexOrDefault(h.color,0);var z=e.left,B=e.right,W=e.top,N=e.bottom,V=l.aliasPixel(r.lineWidth);p?(W=N="top"===i.position?e.bottom:e.top,W+=V,N+=V):(z=B="left"===i.position?e.right:e.left,z+=V,B+=V),r.beginPath(),r.moveTo(z,W),r.lineTo(B,N),r.stroke()}}}})}},{25:25,26:26,34:34,45:45}],33:[function(t,e,n){"use strict";var i=t(25),a=t(45);e.exports=function(t){t.scaleService={constructors:{},defaults:{},registerScaleType:function(t,e,n){this.constructors[t]=e,this.defaults[t]=a.clone(n)},getScaleConstructor:function(t){return this.constructors.hasOwnProperty(t)?this.constructors[t]:void 0},getScaleDefaults:function(t){return this.defaults.hasOwnProperty(t)?a.merge({},[i.scale,this.defaults[t]]):{}},updateScaleDefaults:function(t,e){var n=this;n.defaults.hasOwnProperty(t)&&(n.defaults[t]=a.extend(n.defaults[t],e))},addScalesToLayout:function(e){a.each(e.scales,function(n){n.fullWidth=n.options.fullWidth,n.position=n.options.position,n.weight=n.options.weight,t.layoutService.addBox(e,n)})}}}},{25:25,45:45}],34:[function(t,e,n){"use strict";var i=t(45);e.exports={generators:{linear:function(t,e){var n,a=[];if(t.stepSize&&t.stepSize>0)n=t.stepSize;else{var o=i.niceNum(e.max-e.min,!1);n=i.niceNum(o/(t.maxTicks-1),!0)}var r=Math.floor(e.min/n)*n,l=Math.ceil(e.max/n)*n;t.min&&t.max&&t.stepSize&&i.almostWhole((t.max-t.min)/t.stepSize,n/1e3)&&(r=t.min,l=t.max);var s=(l-r)/n;s=i.almostEquals(s,Math.round(s),n/1e3)?Math.round(s):Math.ceil(s),a.push(void 0!==t.min?t.min:r);for(var u=1;u<s;++u)a.push(r+u*n);return a.push(void 0!==t.max?t.max:l),a},logarithmic:function(t,e){var n,a,o=[],r=i.valueOrDefault,l=r(t.min,Math.pow(10,Math.floor(i.log10(e.min)))),s=Math.floor(i.log10(e.max)),u=Math.ceil(e.max/Math.pow(10,s));0===l?(n=Math.floor(i.log10(e.minNotZero)),a=Math.floor(e.minNotZero/Math.pow(10,n)),o.push(l),l=a*Math.pow(10,n)):(n=Math.floor(i.log10(l)),a=Math.floor(l/Math.pow(10,n)));do{o.push(l),10===++a&&(a=1,++n),l=a*Math.pow(10,n)}while(n<s||n===s&&a<u);var d=r(t.max,l);return o.push(d),o}},formatters:{values:function(t){return i.isArray(t)?t:""+t},linear:function(t,e,n){var a=n.length>3?n[2]-n[1]:n[1]-n[0];Math.abs(a)>1&&t!==Math.floor(t)&&(a=t-Math.floor(t));var o=i.log10(Math.abs(a)),r="";if(0!==t){var l=-1*Math.floor(o);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(i.log10(t)));return 0===t?"0":1===a||2===a||5===a||0===e||e===n.length-1?t.toExponential():""}}}},{45:45}],35:[function(t,e,n){"use strict";var i=t(25),a=t(26),o=t(45);i._set("global",{tooltips:{enabled:!0,custom:null,mode:"nearest",position:"average",intersect:!0,backgroundColor:"rgba(0,0,0,0.8)",titleFontStyle:"bold",titleSpacing:2,titleMarginBottom:6,titleFontColor:"#fff",titleAlign:"left",bodySpacing:2,bodyFontColor:"#fff",bodyAlign:"left",footerFontStyle:"bold",footerSpacing:2,footerMarginTop:6,footerFontColor:"#fff",footerAlign:"left",yPadding:6,xPadding:6,caretPadding:2,caretSize:5,cornerRadius:6,multiKeyBackground:"#fff",displayColors:!0,borderColor:"rgba(0,0,0,0)",borderWidth:0,callbacks:{beforeTitle:o.noop,title:function(t,e){var n="",i=e.labels,a=i?i.length:0;if(t.length>0){var o=t[0];o.xLabel?n=o.xLabel:a>0&&o.index<a&&(n=i[o.index])}return n},afterTitle:o.noop,beforeBody:o.noop,beforeLabel:o.noop,label:function(t,e){var n=e.datasets[t.datasetIndex].label||"";return n&&(n+=": "),n+=t.yLabel},labelColor:function(t,e){var n=e.getDatasetMeta(t.datasetIndex).data[t.index]._view;return{borderColor:n.borderColor,backgroundColor:n.backgroundColor}},labelTextColor:function(){return this._options.bodyFontColor},afterLabel:o.noop,afterBody:o.noop,beforeFooter:o.noop,footer:o.noop,afterFooter:o.noop}}}),e.exports=function(t){function e(t,e){var n=o.color(t);return n.alpha(e*n.alpha()).rgbaString()}function n(t,e){return e&&(o.isArray(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function r(t){var e=t._xScale,n=t._yScale||t._scale,i=t._index,a=t._datasetIndex;return{xLabel:e?e.getLabelForIndex(i,a):"",yLabel:n?n.getLabelForIndex(i,a):"",index:i,datasetIndex:a,x:t._model.x,y:t._model.y}}function l(t){var e=i.global,n=o.valueOrDefault;return{xPadding:t.xPadding,yPadding:t.yPadding,xAlign:t.xAlign,yAlign:t.yAlign,bodyFontColor:t.bodyFontColor,_bodyFontFamily:n(t.bodyFontFamily,e.defaultFontFamily),_bodyFontStyle:n(t.bodyFontStyle,e.defaultFontStyle),_bodyAlign:t.bodyAlign,bodyFontSize:n(t.bodyFontSize,e.defaultFontSize),bodySpacing:t.bodySpacing,titleFontColor:t.titleFontColor,_titleFontFamily:n(t.titleFontFamily,e.defaultFontFamily),_titleFontStyle:n(t.titleFontStyle,e.defaultFontStyle),titleFontSize:n(t.titleFontSize,e.defaultFontSize),_titleAlign:t.titleAlign,titleSpacing:t.titleSpacing,titleMarginBottom:t.titleMarginBottom,footerFontColor:t.footerFontColor,_footerFontFamily:n(t.footerFontFamily,e.defaultFontFamily),_footerFontStyle:n(t.footerFontStyle,e.defaultFontStyle),footerFontSize:n(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 s(t,e){var n=t._chart.ctx,i=2*e.yPadding,a=0,r=e.body,l=r.reduce(function(t,e){return t+e.before.length+e.lines.length+e.after.length},0);l+=e.beforeBody.length+e.afterBody.length;var s=e.title.length,u=e.footer.length,d=e.titleFontSize,c=e.bodyFontSize,h=e.footerFontSize;i+=s*d,i+=s?(s-1)*e.titleSpacing:0,i+=s?e.titleMarginBottom:0,i+=l*c,i+=l?(l-1)*e.bodySpacing:0,i+=u?e.footerMarginTop:0,i+=u*h,i+=u?(u-1)*e.footerSpacing:0;var f=0,g=function(t){a=Math.max(a,n.measureText(t).width+f)};return n.font=o.fontString(d,e._titleFontStyle,e._titleFontFamily),o.each(e.title,g),n.font=o.fontString(c,e._bodyFontStyle,e._bodyFontFamily),o.each(e.beforeBody.concat(e.afterBody),g),f=e.displayColors?c+2:0,o.each(r,function(t){o.each(t.before,g),o.each(t.lines,g),o.each(t.after,g)}),f=0,n.font=o.fontString(h,e._footerFontStyle,e._footerFontFamily),o.each(e.footer,g),a+=2*e.xPadding,{width:a,height:i}}function u(t,e){var n=t._model,i=t._chart,a=t._chart.chartArea,o="center",r="center";n.y<e.height?r="top":n.y>i.height-e.height&&(r="bottom");var l,s,u,d,c,h=(a.left+a.right)/2,f=(a.top+a.bottom)/2;"center"===r?(l=function(t){return t<=h},s=function(t){return t>h}):(l=function(t){return t<=e.width/2},s=function(t){return t>=i.width-e.width/2}),u=function(t){return t+e.width>i.width},d=function(t){return t-e.width<0},c=function(t){return t<=f?"top":"bottom"},l(n.x)?(o="left",u(n.x)&&(o="center",r=c(n.y))):s(n.x)&&(o="right",d(n.x)&&(o="center",r=c(n.y)));var g=t._options;return{xAlign:g.xAlign?g.xAlign:o,yAlign:g.yAlign?g.yAlign:r}}function d(t,e,n){var i=t.x,a=t.y,o=t.caretSize,r=t.caretPadding,l=t.cornerRadius,s=n.xAlign,u=n.yAlign,d=o+r,c=l+r;return"right"===s?i-=e.width:"center"===s&&(i-=e.width/2),"top"===u?a+=d:a-="bottom"===u?e.height+d:e.height/2,"center"===u?"left"===s?i+=d:"right"===s&&(i-=d):"left"===s?i-=c:"right"===s&&(i+=c),{x:i,y:a}}t.Tooltip=a.extend({initialize:function(){this._model=l(this._options),this._lastActive=[]},getTitle:function(){var t=this,e=t._options.callbacks,i=e.beforeTitle.apply(t,arguments),a=e.title.apply(t,arguments),o=e.afterTitle.apply(t,arguments),r=[];return r=n(r,i),r=n(r,a),r=n(r,o)},getBeforeBody:function(){var t=this._options.callbacks.beforeBody.apply(this,arguments);return o.isArray(t)?t:void 0!==t?[t]:[]},getBody:function(t,e){var i=this,a=i._options.callbacks,r=[];return o.each(t,function(t){var o={before:[],lines:[],after:[]};n(o.before,a.beforeLabel.call(i,t,e)),n(o.lines,a.label.call(i,t,e)),n(o.after,a.afterLabel.call(i,t,e)),r.push(o)}),r},getAfterBody:function(){var t=this._options.callbacks.afterBody.apply(this,arguments);return o.isArray(t)?t:void 0!==t?[t]:[]},getFooter:function(){var t=this,e=t._options.callbacks,i=e.beforeFooter.apply(t,arguments),a=e.footer.apply(t,arguments),o=e.afterFooter.apply(t,arguments),r=[];return r=n(r,i),r=n(r,a),r=n(r,o)},update:function(e){var n,i,a=this,c=a._options,h=a._model,f=a._model=l(c),g=a._active,p=a._data,v={xAlign:h.xAlign,yAlign:h.yAlign},m={x:h.x,y:h.y},b={width:h.width,height:h.height},x={x:h.caretX,y:h.caretY};if(g.length){f.opacity=1;var y=[],k=[];x=t.Tooltip.positioners[c.position].call(a,g,a._eventPosition);var w=[];for(n=0,i=g.length;n<i;++n)w.push(r(g[n]));c.filter&&(w=w.filter(function(t){return c.filter(t,p)})),c.itemSort&&(w=w.sort(function(t,e){return c.itemSort(t,e,p)})),o.each(w,function(t){y.push(c.callbacks.labelColor.call(a,t,a._chart)),k.push(c.callbacks.labelTextColor.call(a,t,a._chart))}),f.title=a.getTitle(w,p),f.beforeBody=a.getBeforeBody(w,p),f.body=a.getBody(w,p),f.afterBody=a.getAfterBody(w,p),f.footer=a.getFooter(w,p),f.x=Math.round(x.x),f.y=Math.round(x.y),f.caretPadding=c.caretPadding,f.labelColors=y,f.labelTextColors=k,f.dataPoints=w,m=d(f,b=s(this,f),v=u(this,b))}else f.opacity=0;return f.xAlign=v.xAlign,f.yAlign=v.yAlign,f.x=m.x,f.y=m.y,f.width=b.width,f.height=b.height,f.caretX=x.x,f.caretY=x.y,a._model=f,e&&c.custom&&c.custom.call(a,f),a},drawCaret:function(t,e){var n=this._chart.ctx,i=this._view,a=this.getCaretPosition(t,e,i);n.lineTo(a.x1,a.y1),n.lineTo(a.x2,a.y2),n.lineTo(a.x3,a.y3)},getCaretPosition:function(t,e,n){var i,a,o,r,l,s,u=n.caretSize,d=n.cornerRadius,c=n.xAlign,h=n.yAlign,f=t.x,g=t.y,p=e.width,v=e.height;if("center"===h)l=g+v/2,"left"===c?(a=(i=f)-u,o=i,r=l+u,s=l-u):(a=(i=f+p)+u,o=i,r=l-u,s=l+u);else if("left"===c?(i=(a=f+d+u)-u,o=a+u):"right"===c?(i=(a=f+p-d-u)-u,o=a+u):(i=(a=f+p/2)-u,o=a+u),"top"===h)l=(r=g)-u,s=r;else{l=(r=g+v)+u,s=r;var m=o;o=i,i=m}return{x1:i,x2:a,x3:o,y1:r,y2:l,y3:s}},drawTitle:function(t,n,i,a){var r=n.title;if(r.length){i.textAlign=n._titleAlign,i.textBaseline="top";var l=n.titleFontSize,s=n.titleSpacing;i.fillStyle=e(n.titleFontColor,a),i.font=o.fontString(l,n._titleFontStyle,n._titleFontFamily);var u,d;for(u=0,d=r.length;u<d;++u)i.fillText(r[u],t.x,t.y),t.y+=l+s,u+1===r.length&&(t.y+=n.titleMarginBottom-s)}},drawBody:function(t,n,i,a){var r=n.bodyFontSize,l=n.bodySpacing,s=n.body;i.textAlign=n._bodyAlign,i.textBaseline="top",i.font=o.fontString(r,n._bodyFontStyle,n._bodyFontFamily);var u=0,d=function(e){i.fillText(e,t.x+u,t.y),t.y+=r+l};i.fillStyle=e(n.bodyFontColor,a),o.each(n.beforeBody,d);var c=n.displayColors;u=c?r+2:0,o.each(s,function(l,s){var u=e(n.labelTextColors[s],a);i.fillStyle=u,o.each(l.before,d),o.each(l.lines,function(o){c&&(i.fillStyle=e(n.legendColorBackground,a),i.fillRect(t.x,t.y,r,r),i.lineWidth=1,i.strokeStyle=e(n.labelColors[s].borderColor,a),i.strokeRect(t.x,t.y,r,r),i.fillStyle=e(n.labelColors[s].backgroundColor,a),i.fillRect(t.x+1,t.y+1,r-2,r-2),i.fillStyle=u),d(o)}),o.each(l.after,d)}),u=0,o.each(n.afterBody,d),t.y-=l},drawFooter:function(t,n,i,a){var r=n.footer;r.length&&(t.y+=n.footerMarginTop,i.textAlign=n._footerAlign,i.textBaseline="top",i.fillStyle=e(n.footerFontColor,a),i.font=o.fontString(n.footerFontSize,n._footerFontStyle,n._footerFontFamily),o.each(r,function(e){i.fillText(e,t.x,t.y),t.y+=n.footerFontSize+n.footerSpacing}))},drawBackground:function(t,n,i,a,o){i.fillStyle=e(n.backgroundColor,o),i.strokeStyle=e(n.borderColor,o),i.lineWidth=n.borderWidth;var r=n.xAlign,l=n.yAlign,s=t.x,u=t.y,d=a.width,c=a.height,h=n.cornerRadius;i.beginPath(),i.moveTo(s+h,u),"top"===l&&this.drawCaret(t,a),i.lineTo(s+d-h,u),i.quadraticCurveTo(s+d,u,s+d,u+h),"center"===l&&"right"===r&&this.drawCaret(t,a),i.lineTo(s+d,u+c-h),i.quadraticCurveTo(s+d,u+c,s+d-h,u+c),"bottom"===l&&this.drawCaret(t,a),i.lineTo(s+h,u+c),i.quadraticCurveTo(s,u+c,s,u+c-h),"center"===l&&"left"===r&&this.drawCaret(t,a),i.lineTo(s,u+h),i.quadraticCurveTo(s,u,s+h,u),i.closePath(),i.fill(),n.borderWidth>0&&i.stroke()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var n={width:e.width,height:e.height},i={x:e.x,y:e.y},a=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&&(this.drawBackground(i,e,t,n,a),i.x+=e.xPadding,i.y+=e.yPadding,this.drawTitle(i,e,t,a),this.drawBody(i,e,t,a),this.drawFooter(i,e,t,a))}},handleEvent:function(t){var e=this,n=e._options,i=!1;if(e._lastActive=e._lastActive||[],"mouseout"===t.type?e._active=[]:e._active=e._chart.getElementsAtEventForMode(t,n.mode,n),!(i=!o.arrayEquals(e._active,e._lastActive)))return!1;if(e._lastActive=e._active,n.enabled||n.custom){e._eventPosition={x:t.x,y:t.y};var a=e._model;e.update(!0),e.pivot(),i|=a.x!==e._model.x||a.y!==e._model.y}return i}}),t.Tooltip.positioners={average:function(t){if(!t.length)return!1;var e,n,i=0,a=0,o=0;for(e=0,n=t.length;e<n;++e){var r=t[e];if(r&&r.hasValue()){var l=r.tooltipPosition();i+=l.x,a+=l.y,++o}}return{x:Math.round(i/o),y:Math.round(a/o)}},nearest:function(t,e){var n,i,a,r=e.x,l=e.y,s=Number.POSITIVE_INFINITY;for(n=0,i=t.length;n<i;++n){var u=t[n];if(u&&u.hasValue()){var d=u.getCenterPoint(),c=o.distanceBetweenPoints(e,d);c<s&&(s=c,a=u)}}if(a){var h=a.tooltipPosition();r=h.x,l=h.y}return{x:r,y:l}}}}},{25:25,26:26,45:45}],36:[function(t,e,n){"use strict";var i=t(25),a=t(26),o=t(45);i._set("global",{elements:{arc:{backgroundColor:i.global.defaultColor,borderColor:"#fff",borderWidth:2}}}),e.exports=a.extend({inLabelRange:function(t){var e=this._view;return!!e&&Math.pow(t-e.x,2)<Math.pow(e.radius+e.hoverRadius,2)},inRange:function(t,e){var n=this._view;if(n){for(var i=o.getAngleFromPoint(n,{x:t,y:e}),a=i.angle,r=i.distance,l=n.startAngle,s=n.endAngle;s<l;)s+=2*Math.PI;for(;a>s;)a-=2*Math.PI;for(;a<l;)a+=2*Math.PI;var u=a>=l&&a<=s,d=r>=n.innerRadius&&r<=n.outerRadius;return u&&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=this._chart.ctx,e=this._view,n=e.startAngle,i=e.endAngle;t.beginPath(),t.arc(e.x,e.y,e.outerRadius,n,i),t.arc(e.x,e.y,e.innerRadius,i,n,!0),t.closePath(),t.strokeStyle=e.borderColor,t.lineWidth=e.borderWidth,t.fillStyle=e.backgroundColor,t.fill(),t.lineJoin="bevel",e.borderWidth&&t.stroke()}})},{25:25,26:26,45:45}],37:[function(t,e,n){"use strict";var i=t(25),a=t(26),o=t(45),r=i.global;i._set("global",{elements:{line:{tension:.4,backgroundColor:r.defaultColor,borderWidth:3,borderColor:r.defaultColor,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0}}}),e.exports=a.extend({draw:function(){var t,e,n,i,a=this,l=a._view,s=a._chart.ctx,u=l.spanGaps,d=a._children.slice(),c=r.elements.line,h=-1;for(a._loop&&d.length&&d.push(d[0]),s.save(),s.lineCap=l.borderCapStyle||c.borderCapStyle,s.setLineDash&&s.setLineDash(l.borderDash||c.borderDash),s.lineDashOffset=l.borderDashOffset||c.borderDashOffset,s.lineJoin=l.borderJoinStyle||c.borderJoinStyle,s.lineWidth=l.borderWidth||c.borderWidth,s.strokeStyle=l.borderColor||r.defaultColor,s.beginPath(),h=-1,t=0;t<d.length;++t)e=d[t],n=o.previousItem(d,t),i=e._view,0===t?i.skip||(s.moveTo(i.x,i.y),h=t):(n=-1===h?n:d[h],i.skip||(h!==t-1&&!u||-1===h?s.moveTo(i.x,i.y):o.canvas.lineTo(s,n._view,e._view),h=t));s.stroke(),s.restore()}})},{25:25,26:26,45:45}],38:[function(t,e,n){"use strict";function i(t){var e=this._view;return!!e&&Math.pow(t-e.x,2)<Math.pow(e.radius+e.hitRadius,2)}var a=t(25),o=t(26),r=t(45),l=a.global.defaultColor;a._set("global",{elements:{point:{radius:3,pointStyle:"circle",backgroundColor:l,borderColor:l,borderWidth:1,hitRadius:1,hoverRadius:4,hoverBorderWidth:1}}}),e.exports=o.extend({inRange:function(t,e){var n=this._view;return!!n&&Math.pow(t-n.x,2)+Math.pow(e-n.y,2)<Math.pow(n.hitRadius+n.radius,2)},inLabelRange:i,inXRange:i,inYRange:function(t){var e=this._view;return!!e&&Math.pow(t-e.y,2)<Math.pow(e.radius+e.hitRadius,2)},getCenterPoint:function(){var t=this._view;return{x:t.x,y:t.y}},getArea:function(){return Math.PI*Math.pow(this._view.radius,2)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y,padding:t.radius+t.borderWidth}},draw:function(t){var e=this._view,n=this._model,i=this._chart.ctx,o=e.pointStyle,s=e.radius,u=e.x,d=e.y,c=r.color,h=0;e.skip||(i.strokeStyle=e.borderColor||l,i.lineWidth=r.valueOrDefault(e.borderWidth,a.global.elements.point.borderWidth),i.fillStyle=e.backgroundColor||l,void 0!==t&&(n.x<t.left||1.01*t.right<n.x||n.y<t.top||1.01*t.bottom<n.y)&&(n.x<t.left?h=(u-n.x)/(t.left-n.x):1.01*t.right<n.x?h=(n.x-u)/(n.x-t.right):n.y<t.top?h=(d-n.y)/(t.top-n.y):1.01*t.bottom<n.y&&(h=(n.y-d)/(n.y-t.bottom)),h=Math.round(100*h)/100,i.strokeStyle=c(i.strokeStyle).alpha(h).rgbString(),i.fillStyle=c(i.fillStyle).alpha(h).rgbString()),r.canvas.drawPoint(i,o,s,u,d))}})},{25:25,26:26,45:45}],39:[function(t,e,n){"use strict";function i(t){return void 0!==t._view.width}function a(t){var e,n,a,o,r=t._view;if(i(t)){var l=r.width/2;e=r.x-l,n=r.x+l,a=Math.min(r.y,r.base),o=Math.max(r.y,r.base)}else{var s=r.height/2;e=Math.min(r.x,r.base),n=Math.max(r.x,r.base),a=r.y-s,o=r.y+s}return{left:e,top:a,right:n,bottom:o}}var o=t(25),r=t(26);o._set("global",{elements:{rectangle:{backgroundColor:o.global.defaultColor,borderColor:o.global.defaultColor,borderSkipped:"bottom",borderWidth:0}}}),e.exports=r.extend({draw:function(){function t(t){return m[(b+t)%4]}var e,n,i,a,o,r,l,s=this._chart.ctx,u=this._view,d=u.borderWidth;if(u.horizontal?(e=u.base,n=u.x,i=u.y-u.height/2,a=u.y+u.height/2,o=n>e?1:-1,r=1,l=u.borderSkipped||"left"):(e=u.x-u.width/2,n=u.x+u.width/2,i=u.y,o=1,r=(a=u.base)>i?1:-1,l=u.borderSkipped||"bottom"),d){var c=Math.min(Math.abs(e-n),Math.abs(i-a)),h=(d=d>c?c:d)/2,f=e+("left"!==l?h*o:0),g=n+("right"!==l?-h*o:0),p=i+("top"!==l?h*r:0),v=a+("bottom"!==l?-h*r:0);f!==g&&(i=p,a=v),p!==v&&(e=f,n=g)}s.beginPath(),s.fillStyle=u.backgroundColor,s.strokeStyle=u.borderColor,s.lineWidth=d;var m=[[e,a],[e,i],[n,i],[n,a]],b=["bottom","left","top","right"].indexOf(l,0);-1===b&&(b=0);var x=t(0);s.moveTo(x[0],x[1]);for(var y=1;y<4;y++)x=t(y),s.lineTo(x[0],x[1]);s.fill(),d&&s.stroke()},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){var n=!1;if(this._view){var i=a(this);n=t>=i.left&&t<=i.right&&e>=i.top&&e<=i.bottom}return n},inLabelRange:function(t,e){var n=this;if(!n._view)return!1;var o=a(n);return i(n)?t>=o.left&&t<=o.right:e>=o.top&&e<=o.bottom},inXRange:function(t){var e=a(this);return t>=e.left&&t<=e.right},inYRange:function(t){var e=a(this);return t>=e.top&&t<=e.bottom},getCenterPoint:function(){var t,e,n=this._view;return i(this)?(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 t.width*Math.abs(t.y-t.base)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}})},{25:25,26:26}],40:[function(t,e,n){"use strict";e.exports={},e.exports.Arc=t(36),e.exports.Line=t(37),e.exports.Point=t(38),e.exports.Rectangle=t(39)},{36:36,37:37,38:38,39:39}],41:[function(t,e,n){"use strict";var i=t(42),n=e.exports={clear:function(t){t.ctx.clearRect(0,0,t.width,t.height)},roundedRect:function(t,e,n,i,a,o){if(o){var r=Math.min(o,i/2),l=Math.min(o,a/2);t.moveTo(e+r,n),t.lineTo(e+i-r,n),t.quadraticCurveTo(e+i,n,e+i,n+l),t.lineTo(e+i,n+a-l),t.quadraticCurveTo(e+i,n+a,e+i-r,n+a),t.lineTo(e+r,n+a),t.quadraticCurveTo(e,n+a,e,n+a-l),t.lineTo(e,n+l),t.quadraticCurveTo(e,n,e+r,n)}else t.rect(e,n,i,a)},drawPoint:function(t,e,n,i,a){var o,r,l,s,u,d;if(!e||"object"!=typeof e||"[object HTMLImageElement]"!==(o=e.toString())&&"[object HTMLCanvasElement]"!==o){if(!(isNaN(n)||n<=0)){switch(e){default:t.beginPath(),t.arc(i,a,n,0,2*Math.PI),t.closePath(),t.fill();break;case"triangle":t.beginPath(),u=(r=3*n/Math.sqrt(3))*Math.sqrt(3)/2,t.moveTo(i-r/2,a+u/3),t.lineTo(i+r/2,a+u/3),t.lineTo(i,a-2*u/3),t.closePath(),t.fill();break;case"rect":d=1/Math.SQRT2*n,t.beginPath(),t.fillRect(i-d,a-d,2*d,2*d),t.strokeRect(i-d,a-d,2*d,2*d);break;case"rectRounded":var c=n/Math.SQRT2,h=i-c,f=a-c,g=Math.SQRT2*n;t.beginPath(),this.roundedRect(t,h,f,g,g,n/2),t.closePath(),t.fill();break;case"rectRot":d=1/Math.SQRT2*n,t.beginPath(),t.moveTo(i-d,a),t.lineTo(i,a+d),t.lineTo(i+d,a),t.lineTo(i,a-d),t.closePath(),t.fill();break;case"cross":t.beginPath(),t.moveTo(i,a+n),t.lineTo(i,a-n),t.moveTo(i-n,a),t.lineTo(i+n,a),t.closePath();break;case"crossRot":t.beginPath(),l=Math.cos(Math.PI/4)*n,s=Math.sin(Math.PI/4)*n,t.moveTo(i-l,a-s),t.lineTo(i+l,a+s),t.moveTo(i-l,a+s),t.lineTo(i+l,a-s),t.closePath();break;case"star":t.beginPath(),t.moveTo(i,a+n),t.lineTo(i,a-n),t.moveTo(i-n,a),t.lineTo(i+n,a),l=Math.cos(Math.PI/4)*n,s=Math.sin(Math.PI/4)*n,t.moveTo(i-l,a-s),t.lineTo(i+l,a+s),t.moveTo(i-l,a+s),t.lineTo(i+l,a-s),t.closePath();break;case"line":t.beginPath(),t.moveTo(i-n,a),t.lineTo(i+n,a),t.closePath();break;case"dash":t.beginPath(),t.moveTo(i,a),t.lineTo(i+n,a),t.closePath()}t.stroke()}}else t.drawImage(e,i-e.width/2,a-e.height/2,e.width,e.height)},clipArea:function(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()},unclipArea:function(t){t.restore()},lineTo:function(t,e,n,i){if(n.steppedLine)return"after"===n.steppedLine&&!i||"after"!==n.steppedLine&&i?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y),void t.lineTo(n.x,n.y);n.tension?t.bezierCurveTo(i?e.controlPointPreviousX:e.controlPointNextX,i?e.controlPointPreviousY:e.controlPointNextY,i?n.controlPointNextX:n.controlPointPreviousX,i?n.controlPointNextY:n.controlPointPreviousY,n.x,n.y):t.lineTo(n.x,n.y)}};i.clear=n.clear,i.drawRoundedRectangle=function(t){t.beginPath(),n.roundedRect.apply(n,arguments),t.closePath()}},{42:42}],42:[function(t,e,n){"use strict";var i={noop:function(){},uid:function(){var t=0;return function(){return t++}}(),isNullOrUndef:function(t){return null===t||void 0===t},isArray:Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},isObject:function(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)},valueOrDefault:function(t,e){return void 0===t?e:t},valueAtIndexOrDefault:function(t,e,n){return i.valueOrDefault(i.isArray(t)?t[e]:t,n)},callback:function(t,e,n){if(t&&"function"==typeof t.call)return t.apply(n,e)},each:function(t,e,n,a){var o,r,l;if(i.isArray(t))if(r=t.length,a)for(o=r-1;o>=0;o--)e.call(n,t[o],o);else for(o=0;o<r;o++)e.call(n,t[o],o);else if(i.isObject(t))for(r=(l=Object.keys(t)).length,o=0;o<r;o++)e.call(n,t[l[o]],l[o])},arrayEquals:function(t,e){var n,a,o,r;if(!t||!e||t.length!==e.length)return!1;for(n=0,a=t.length;n<a;++n)if(o=t[n],r=e[n],o instanceof Array&&r instanceof Array){if(!i.arrayEquals(o,r))return!1}else if(o!==r)return!1;return!0},clone:function(t){if(i.isArray(t))return t.map(i.clone);if(i.isObject(t)){for(var e={},n=Object.keys(t),a=n.length,o=0;o<a;++o)e[n[o]]=i.clone(t[n[o]]);return e}return t},_merger:function(t,e,n,a){var o=e[t],r=n[t];i.isObject(o)&&i.isObject(r)?i.merge(o,r,a):e[t]=i.clone(r)},_mergerIf:function(t,e,n){var a=e[t],o=n[t];i.isObject(a)&&i.isObject(o)?i.mergeIf(a,o):e.hasOwnProperty(t)||(e[t]=i.clone(o))},merge:function(t,e,n){var a,o,r,l,s,u=i.isArray(e)?e:[e],d=u.length;if(!i.isObject(t))return t;for(a=(n=n||{}).merger||i._merger,o=0;o<d;++o)if(e=u[o],i.isObject(e))for(s=0,l=(r=Object.keys(e)).length;s<l;++s)a(r[s],t,e,n);return t},mergeIf:function(t,e){return i.merge(t,e,{merger:i._mergerIf})},extend:function(t){for(var e=1,n=arguments.length;e<n;++e)i.each(arguments[e],function(e,n){t[n]=e});return t},inherits:function(t){var e=this,n=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return e.apply(this,arguments)},a=function(){this.constructor=n};return a.prototype=e.prototype,n.prototype=new a,n.extend=i.inherits,t&&i.extend(n.prototype,t),n.__super__=e.prototype,n}};e.exports=i,i.callCallback=i.callback,i.indexOf=function(t,e,n){return Array.prototype.indexOf.call(t,e,n)},i.getValueOrDefault=i.valueOrDefault,i.getValueAtIndexOrDefault=i.valueAtIndexOrDefault},{}],43:[function(t,e,n){"use strict";var i=t(42),a={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return(t-=1)*t*t+1},easeInOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-((t-=1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return(t-=1)*t*t*t*t+1},easeInOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return 1-Math.cos(t*(Math.PI/2))},easeOutSine:function(t){return Math.sin(t*(Math.PI/2))},easeInOutSine:function(t){return-.5*(Math.cos(Math.PI*t)-1)},easeInExpo:function(t){return 0===t?0:Math.pow(2,10*(t-1))},easeOutExpo:function(t){return 1===t?1:1-Math.pow(2,-10*t)},easeInOutExpo:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))},easeInCirc:function(t){return t>=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,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n))},easeOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},easeInOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:2==(t/=.5)?1:(n||(n=.45),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),t<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*-.5:i*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-a.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*a.easeInBounce(2*t):.5*a.easeOutBounce(2*t-1)+.5}};e.exports={effects:a},i.easingEffects=a},{42:42}],44:[function(t,e,n){"use strict";var i=t(42);e.exports={toLineHeight:function(t,e){var n=(""+t).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);if(!n||"normal"===n[1])return 1.2*e;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100}return e*t},toPadding:function(t){var e,n,a,o;return i.isObject(t)?(e=+t.top||0,n=+t.right||0,a=+t.bottom||0,o=+t.left||0):e=n=a=o=+t||0,{top:e,right:n,bottom:a,left:o,height:e+a,width:o+n}},resolve:function(t,e,n){var a,o,r;for(a=0,o=t.length;a<o;++a)if(void 0!==(r=t[a])&&(void 0!==e&&"function"==typeof r&&(r=r(e)),void 0!==n&&i.isArray(r)&&(r=r[n]),void 0!==r))return r}}},{42:42}],45:[function(t,e,n){"use strict";e.exports=t(42),e.exports.easing=t(43),e.exports.canvas=t(41),e.exports.options=t(44)},{41:41,42:42,43:43,44:44}],46:[function(t,e,n){e.exports={acquireContext:function(t){return t&&t.canvas&&(t=t.canvas),t&&t.getContext("2d")||null}}},{}],47:[function(t,e,n){"use strict";function i(t,e){var n=v.getStyle(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?Number(i[1]):void 0}function a(t,e){var n=t.style,a=t.getAttribute("height"),o=t.getAttribute("width");if(t[m]={initial:{height:a,width:o,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",null===o||""===o){var r=i(t,"width");void 0!==r&&(t.width=r)}if(null===a||""===a)if(""===t.style.height)t.height=t.width/(e.options.aspectRatio||2);else{var l=i(t,"height");void 0!==r&&(t.height=l)}return t}function o(t,e,n){t.addEventListener(e,n,M)}function r(t,e,n){t.removeEventListener(e,n,M)}function l(t,e,n,i,a){return{type:t,chart:e,native:a||null,x:void 0!==n?n:null,y:void 0!==i?i:null}}function s(t,e){var n=w[t.type]||t.type,i=v.getRelativePosition(t,e);return l(n,e,i.x,i.y,t)}function u(t,e){var n=!1,i=[];return function(){i=Array.prototype.slice.call(arguments),e=e||this,n||(n=!0,v.requestAnimFrame.call(window,function(){n=!1,t.apply(e,i)}))}}function d(t){var e=document.createElement("div"),n=b+"size-monitor",i="position:absolute;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1;";e.style.cssText=i,e.className=n,e.innerHTML='<div class="'+n+'-expand" style="'+i+'"><div style="position:absolute;width:1000000px;height:1000000px;left:0;top:0"></div></div><div class="'+n+'-shrink" style="'+i+'"><div style="position:absolute;width:200%;height:200%;left:0; top:0"></div></div>';var a=e.childNodes[0],r=e.childNodes[1];e._reset=function(){a.scrollLeft=1e6,a.scrollTop=1e6,r.scrollLeft=1e6,r.scrollTop=1e6};var l=function(){e._reset(),t()};return o(a,"scroll",l.bind(a,"expand")),o(r,"scroll",l.bind(r,"shrink")),e}function c(t,e){var n=t[m]||(t[m]={}),i=n.renderProxy=function(t){t.animationName===y&&e()};v.each(k,function(e){o(t,e,i)}),n.reflow=!!t.offsetParent,t.classList.add(x)}function h(t){var e=t[m]||{},n=e.renderProxy;n&&(v.each(k,function(e){r(t,e,n)}),delete e.renderProxy),t.classList.remove(x)}function f(t,e,n){var i=t[m]||(t[m]={}),a=i.resizer=d(u(function(){if(i.resizer)return e(l("resize",n))}));c(t,function(){if(i.resizer){var e=t.parentNode;e&&e!==a.parentNode&&e.insertBefore(a,e.firstChild),a._reset()}})}function g(t){var e=t[m]||{},n=e.resizer;delete e.resizer,h(t),n&&n.parentNode&&n.parentNode.removeChild(n)}function p(t,e){var n=t._style||document.createElement("style");t._style||(t._style=n,e="/* Chart.js */\n"+e,n.setAttribute("type","text/css"),document.getElementsByTagName("head")[0].appendChild(n)),n.appendChild(document.createTextNode(e))}var v=t(45),m="$chartjs",b="chartjs-",x=b+"render-monitor",y=b+"render-animation",k=["animationstart","webkitAnimationStart"],w={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},M=!!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};e.exports={_enabled:"undefined"!=typeof window&&"undefined"!=typeof document,initialize:function(){var t="from{opacity:0.99}to{opacity:1}";p(this,"@-webkit-keyframes "+y+"{"+t+"}@keyframes "+y+"{"+t+"}."+x+"{-webkit-animation:"+y+" 0.001s;animation:"+y+" 0.001s;}")},acquireContext:function(t,e){"string"==typeof t?t=document.getElementById(t):t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas);var n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(a(t,e),n):null},releaseContext:function(t){var e=t.canvas;if(e[m]){var n=e[m].initial;["height","width"].forEach(function(t){var i=n[t];v.isNullOrUndef(i)?e.removeAttribute(t):e.setAttribute(t,i)}),v.each(n.style||{},function(t,n){e.style[n]=t}),e.width=e.width,delete e[m]}},addEventListener:function(t,e,n){var i=t.canvas;if("resize"!==e){var a=n[m]||(n[m]={});o(i,e,(a.proxies||(a.proxies={}))[t.id+"_"+e]=function(e){n(s(e,t))})}else f(i,n,t)},removeEventListener:function(t,e,n){var i=t.canvas;if("resize"!==e){var a=((n[m]||{}).proxies||{})[t.id+"_"+e];a&&r(i,e,a)}else g(i)}},v.addEvent=o,v.removeEvent=r},{45:45}],48:[function(t,e,n){"use strict";var i=t(45),a=t(46),o=t(47),r=o._enabled?o:a;e.exports=i.extend({initialize:function(){},acquireContext:function(){},releaseContext:function(){},addEventListener:function(){},removeEventListener:function(){}},r)},{45:45,46:46,47:47}],49:[function(t,e,n){"use strict";var i=t(25),a=t(40),o=t(45);i._set("global",{plugins:{filler:{propagate:!0}}}),e.exports=function(){function t(t,e,n){var i,a=t._model||{},o=a.fill;if(void 0===o&&(o=!!a.backgroundColor),!1===o||null===o)return!1;if(!0===o)return"origin";if(i=parseFloat(o,10),isFinite(i)&&Math.floor(i)===i)return"-"!==o[0]&&"+"!==o[0]||(i=e+i),!(i===e||i<0||i>=n)&&i;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 e(t){var e,n=t.el._model||{},i=t.el._scale||{},a=t.fill,o=null;if(isFinite(a))return null;if("start"===a?o=void 0===n.scaleBottom?i.bottom:n.scaleBottom:"end"===a?o=void 0===n.scaleTop?i.top:n.scaleTop:void 0!==n.scaleZero?o=n.scaleZero:i.getBasePosition?o=i.getBasePosition():i.getBasePixel&&(o=i.getBasePixel()),void 0!==o&&null!==o){if(void 0!==o.x&&void 0!==o.y)return o;if("number"==typeof o&&isFinite(o))return e=i.isHorizontal(),{x:e?o:null,y:e?null:o}}return null}function n(t,e,n){var i,a=t[e].fill,o=[e];if(!n)return a;for(;!1!==a&&-1===o.indexOf(a);){if(!isFinite(a))return a;if(!(i=t[a]))return!1;if(i.visible)return a;o.push(a),a=i.fill}return!1}function r(t){var e=t.fill,n="dataset";return!1===e?null:(isFinite(e)||(n="boundary"),d[n](t))}function l(t){return t&&!t.skip}function s(t,e,n,i,a){var r;if(i&&a){for(t.moveTo(e[0].x,e[0].y),r=1;r<i;++r)o.canvas.lineTo(t,e[r-1],e[r]);for(t.lineTo(n[a-1].x,n[a-1].y),r=a-1;r>0;--r)o.canvas.lineTo(t,n[r],n[r-1],!0)}}function u(t,e,n,i,a,o){var r,u,d,c,h,f,g,p=e.length,v=i.spanGaps,m=[],b=[],x=0,y=0;for(t.beginPath(),r=0,u=p+!!o;r<u;++r)h=n(c=e[d=r%p]._view,d,i),f=l(c),g=l(h),f&&g?(x=m.push(c),y=b.push(h)):x&&y&&(v?(f&&m.push(c),g&&b.push(h)):(s(t,m,b,x,y),x=y=0,m=[],b=[]));s(t,m,b,x,y),t.closePath(),t.fillStyle=a,t.fill()}var d={dataset:function(t){var e=t.fill,n=t.chart,i=n.getDatasetMeta(e),a=i&&n.isDatasetVisible(e)&&i.dataset._children||[],o=a.length||0;return o?function(t,e){return e<o&&a[e]._view||null}:null},boundary:function(t){var e=t.boundary,n=e?e.x:null,i=e?e.y:null;return function(t){return{x:null===n?t.x:n,y:null===i?t.y:i}}}};return{id:"filler",afterDatasetsUpdate:function(i,o){var l,s,u,d,c=(i.data.datasets||[]).length,h=o.propagate,f=[];for(s=0;s<c;++s)d=null,(u=(l=i.getDatasetMeta(s)).dataset)&&u._model&&u instanceof a.Line&&(d={visible:i.isDatasetVisible(s),fill:t(u,s,c),chart:i,el:u}),l.$filler=d,f.push(d);for(s=0;s<c;++s)(d=f[s])&&(d.fill=n(f,s,h),d.boundary=e(d),d.mapper=r(d))},beforeDatasetDraw:function(t,e){var n=e.meta.$filler;if(n){var a=t.ctx,r=n.el,l=r._view,s=r._children||[],d=n.mapper,c=l.backgroundColor||i.global.defaultColor;d&&c&&s.length&&(o.canvas.clipArea(a,t.chartArea),u(a,s,d,l,c,r._loop),o.canvas.unclipArea(a))}}}}},{25:25,40:40,45:45}],50:[function(t,e,n){"use strict";var i=t(25),a=t(26),o=t(45);i._set("global",{legend:{display:!0,position:"top",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(t,e){var n=e.datasetIndex,i=this.chart,a=i.getDatasetMeta(n);a.hidden=null===a.hidden?!i.data.datasets[n].hidden:null,i.update()},onHover:null,labels:{boxWidth:40,padding:10,generateLabels:function(t){var e=t.data;return o.isArray(e.datasets)?e.datasets.map(function(e,n){return{text:e.label,fillStyle:o.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('<ul class="'+t.id+'-legend">');for(var n=0;n<t.data.datasets.length;n++)e.push('<li><span style="background-color:'+t.data.datasets[n].backgroundColor+'"></span>'),t.data.datasets[n].label&&e.push(t.data.datasets[n].label),e.push("</li>");return e.push("</ul>"),e.join("")}}),e.exports=function(t){function e(t,e){return t.usePointStyle?e*Math.SQRT2:t.boxWidth}function n(e,n){var i=new t.Legend({ctx:e.ctx,options:n,chart:e});r.configure(e,i,n),r.addBox(e,i),e.legend=i}var r=t.layoutService,l=o.noop;return t.Legend=a.extend({initialize:function(t){o.extend(this,t),this.legendHitBoxes=[],this.doughnutMode=!1},beforeUpdate:l,update:function(t,e,n){var i=this;return i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:l,beforeSetDimensions:l,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:l,beforeBuildLabels:l,buildLabels:function(){var t=this,e=t.options.labels||{},n=o.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:l,beforeFit:l,fit:function(){var t=this,n=t.options,a=n.labels,r=n.display,l=t.ctx,s=i.global,u=o.valueOrDefault,d=u(a.fontSize,s.defaultFontSize),c=u(a.fontStyle,s.defaultFontStyle),h=u(a.fontFamily,s.defaultFontFamily),f=o.fontString(d,c,h),g=t.legendHitBoxes=[],p=t.minSize,v=t.isHorizontal();if(v?(p.width=t.maxWidth,p.height=r?10:0):(p.width=r?10:0,p.height=t.maxHeight),r)if(l.font=f,v){var m=t.lineWidths=[0],b=t.legendItems.length?d+a.padding:0;l.textAlign="left",l.textBaseline="top",o.each(t.legendItems,function(n,i){var o=e(a,d)+d/2+l.measureText(n.text).width;m[m.length-1]+o+a.padding>=t.width&&(b+=d+a.padding,m[m.length]=t.left),g[i]={left:0,top:0,width:o,height:d},m[m.length-1]+=o+a.padding}),p.height+=b}else{var x=a.padding,y=t.columnWidths=[],k=a.padding,w=0,M=0,S=d+x;o.each(t.legendItems,function(t,n){var i=e(a,d)+d/2+l.measureText(t.text).width;M+S>p.height&&(k+=w+a.padding,y.push(w),w=0,M=0),w=Math.max(w,i),M+=S,g[n]={left:0,top:0,width:i,height:d}}),k+=w,y.push(w),p.width+=k}t.width=p.width,t.height=p.height},afterFit:l,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var t=this,n=t.options,a=n.labels,r=i.global,l=r.elements.line,s=t.width,u=t.lineWidths;if(n.display){var d,c=t.ctx,h=o.valueOrDefault,f=h(a.fontColor,r.defaultFontColor),g=h(a.fontSize,r.defaultFontSize),p=h(a.fontStyle,r.defaultFontStyle),v=h(a.fontFamily,r.defaultFontFamily),m=o.fontString(g,p,v);c.textAlign="left",c.textBaseline="middle",c.lineWidth=.5,c.strokeStyle=f,c.fillStyle=f,c.font=m;var b=e(a,g),x=t.legendHitBoxes,y=function(t,e,i){if(!(isNaN(b)||b<=0)){c.save(),c.fillStyle=h(i.fillStyle,r.defaultColor),c.lineCap=h(i.lineCap,l.borderCapStyle),c.lineDashOffset=h(i.lineDashOffset,l.borderDashOffset),c.lineJoin=h(i.lineJoin,l.borderJoinStyle),c.lineWidth=h(i.lineWidth,l.borderWidth),c.strokeStyle=h(i.strokeStyle,r.defaultColor);var a=0===h(i.lineWidth,l.borderWidth);if(c.setLineDash&&c.setLineDash(h(i.lineDash,l.borderDash)),n.labels&&n.labels.usePointStyle){var s=g*Math.SQRT2/2,u=s/Math.SQRT2,d=t+u,f=e+u;o.canvas.drawPoint(c,i.pointStyle,s,d,f)}else a||c.strokeRect(t,e,b,g),c.fillRect(t,e,b,g);c.restore()}},k=function(t,e,n,i){var a=g/2,o=b+a+t,r=e+a;c.fillText(n.text,o,r),n.hidden&&(c.beginPath(),c.lineWidth=2,c.moveTo(o,r),c.lineTo(o+i,r),c.stroke())},w=t.isHorizontal();d=w?{x:t.left+(s-u[0])/2,y:t.top+a.padding,line:0}:{x:t.left+a.padding,y:t.top+a.padding,line:0};var M=g+a.padding;o.each(t.legendItems,function(e,n){var i=c.measureText(e.text).width,o=b+g/2+i,r=d.x,l=d.y;w?r+o>=s&&(l=d.y+=M,d.line++,r=d.x=t.left+(s-u[d.line])/2):l+M>t.bottom&&(r=d.x=r+t.columnWidths[d.line]+a.padding,l=d.y=t.top+a.padding,d.line++),y(r,l,e),x[n].left=r,x[n].top=l,k(r,l,e,i),w?d.x+=o+a.padding:d.y+=M})}},handleEvent:function(t){var e=this,n=e.options,i="mouseup"===t.type?"click":t.type,a=!1;if("mousemove"===i){if(!n.onHover)return}else{if("click"!==i)return;if(!n.onClick)return}var o=t.x,r=t.y;if(o>=e.left&&o<=e.right&&r>=e.top&&r<=e.bottom)for(var l=e.legendHitBoxes,s=0;s<l.length;++s){var u=l[s];if(o>=u.left&&o<=u.left+u.width&&r>=u.top&&r<=u.top+u.height){if("click"===i){n.onClick.call(e,t.native,e.legendItems[s]),a=!0;break}if("mousemove"===i){n.onHover.call(e,t.native,e.legendItems[s]),a=!0;break}}}return a}}),{id:"legend",beforeInit:function(t){var e=t.options.legend;e&&n(t,e)},beforeUpdate:function(t){var e=t.options.legend,a=t.legend;e?(o.mergeIf(e,i.global.legend),a?(r.configure(t,a,e),a.options=e):n(t,e)):a&&(r.removeBox(t,a),delete t.legend)},afterEvent:function(t,e){var n=t.legend;n&&n.handleEvent(e)}}}},{25:25,26:26,45:45}],51:[function(t,e,n){"use strict";var i=t(25),a=t(26),o=t(45);i._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,lineHeight:1.2,padding:10,position:"top",text:"",weight:2e3}}),e.exports=function(t){function e(e,i){var a=new t.Title({ctx:e.ctx,options:i,chart:e});n.configure(e,a,i),n.addBox(e,a),e.titleBlock=a}var n=t.layoutService,r=o.noop;return t.Title=a.extend({initialize:function(t){var e=this;o.extend(e,t),e.legendHitBoxes=[]},beforeUpdate:r,update:function(t,e,n){var i=this;return i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:r,beforeSetDimensions:r,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:r,beforeBuildLabels:r,buildLabels:r,afterBuildLabels:r,beforeFit:r,fit:function(){var t=this,e=o.valueOrDefault,n=t.options,a=n.display,r=e(n.fontSize,i.global.defaultFontSize),l=t.minSize,s=o.isArray(n.text)?n.text.length:1,u=o.options.toLineHeight(n.lineHeight,r),d=a?s*u+2*n.padding:0;t.isHorizontal()?(l.width=t.maxWidth,l.height=d):(l.width=d,l.height=t.maxHeight),t.width=l.width,t.height=l.height},afterFit:r,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this,e=t.ctx,n=o.valueOrDefault,a=t.options,r=i.global;if(a.display){var l,s,u,d=n(a.fontSize,r.defaultFontSize),c=n(a.fontStyle,r.defaultFontStyle),h=n(a.fontFamily,r.defaultFontFamily),f=o.fontString(d,c,h),g=o.options.toLineHeight(a.lineHeight,d),p=g/2+a.padding,v=0,m=t.top,b=t.left,x=t.bottom,y=t.right;e.fillStyle=n(a.fontColor,r.defaultFontColor),e.font=f,t.isHorizontal()?(s=b+(y-b)/2,u=m+p,l=y-b):(s="left"===a.position?b+p:y-p,u=m+(x-m)/2,l=x-m,v=Math.PI*("left"===a.position?-.5:.5)),e.save(),e.translate(s,u),e.rotate(v),e.textAlign="center",e.textBaseline="middle";var k=a.text;if(o.isArray(k))for(var w=0,M=0;M<k.length;++M)e.fillText(k[M],0,w,l),w+=g;else e.fillText(k,0,0,l);e.restore()}}}),{id:"title",beforeInit:function(t){var n=t.options.title;n&&e(t,n)},beforeUpdate:function(a){var r=a.options.title,l=a.titleBlock;r?(o.mergeIf(r,i.global.title),l?(n.configure(a,l,r),l.options=r):e(a,r)):l&&(t.layoutService.removeBox(a,l),delete a.titleBlock)}}}},{25:25,26:26,45:45}],52:[function(t,e,n){"use strict";e.exports=function(t){var e=t.Scale.extend({getLabels:function(){var t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels},determineDataLimits:function(){var t=this,e=t.getLabels();t.minIndex=0,t.maxIndex=e.length-1;var n;void 0!==t.options.ticks.min&&(n=e.indexOf(t.options.ticks.min),t.minIndex=-1!==n?n:t.minIndex),void 0!==t.options.ticks.max&&(n=e.indexOf(t.options.ticks.max),t.maxIndex=-1!==n?n:t.maxIndex),t.min=e[t.minIndex],t.max=e[t.maxIndex]},buildTicks:function(){var t=this,e=t.getLabels();t.ticks=0===t.minIndex&&t.maxIndex===e.length-1?e:e.slice(t.minIndex,t.maxIndex+1)},getLabelForIndex:function(t,e){var n=this,i=n.chart.data,a=n.isHorizontal();return i.yLabels&&!a?n.getRightValue(i.datasets[e].data[t]):n.ticks[t-n.minIndex]},getPixelForValue:function(t,e){var n,i=this,a=i.options.offset,o=Math.max(i.maxIndex+1-i.minIndex-(a?0:1),1);if(void 0!==t&&null!==t&&(n=i.isHorizontal()?t.x:t.y),void 0!==n||void 0!==t&&isNaN(e)){var r=i.getLabels();t=n||t;var l=r.indexOf(t);e=-1!==l?l:e}if(i.isHorizontal()){var s=i.width/o,u=s*(e-i.minIndex);return a&&(u+=s/2),i.left+Math.round(u)}var d=i.height/o,c=d*(e-i.minIndex);return a&&(c+=d/2),i.top+Math.round(c)},getPixelForTick:function(t){return this.getPixelForValue(this.ticks[t],t+this.minIndex,null)},getValueForPixel:function(t){var e=this,n=e.options.offset,i=Math.max(e._ticks.length-(n?0:1),1),a=e.isHorizontal(),o=(a?e.width:e.height)/i;return t-=a?e.left:e.top,n&&(t-=o/2),(t<=0?0:Math.round(t/o))+e.minIndex},getBasePixel:function(){return this.bottom}});t.scaleService.registerScaleType("category",e,{position:"bottom"})}},{}],53:[function(t,e,n){"use strict";var i=t(25),a=t(45),o=t(34);e.exports=function(t){var e={position:"left",ticks:{callback:o.formatters.linear}},n=t.LinearScaleBase.extend({determineDataLimits:function(){function t(t){return r?t.xAxisID===e.id:t.yAxisID===e.id}var e=this,n=e.options,i=e.chart,o=i.data.datasets,r=e.isHorizontal();e.min=null,e.max=null;var l=n.stacked;if(void 0===l&&a.each(o,function(e,n){if(!l){var a=i.getDatasetMeta(n);i.isDatasetVisible(n)&&t(a)&&void 0!==a.stack&&(l=!0)}}),n.stacked||l){var s={};a.each(o,function(o,r){var l=i.getDatasetMeta(r),u=[l.type,void 0===n.stacked&&void 0===l.stack?r:"",l.stack].join(".");void 0===s[u]&&(s[u]={positiveValues:[],negativeValues:[]});var d=s[u].positiveValues,c=s[u].negativeValues;i.isDatasetVisible(r)&&t(l)&&a.each(o.data,function(t,i){var a=+e.getRightValue(t);isNaN(a)||l.data[i].hidden||(d[i]=d[i]||0,c[i]=c[i]||0,n.relativePoints?d[i]=100:a<0?c[i]+=a:d[i]+=a)})}),a.each(s,function(t){var n=t.positiveValues.concat(t.negativeValues),i=a.min(n),o=a.max(n);e.min=null===e.min?i:Math.min(e.min,i),e.max=null===e.max?o:Math.max(e.max,o)})}else a.each(o,function(n,o){var r=i.getDatasetMeta(o);i.isDatasetVisible(o)&&t(r)&&a.each(n.data,function(t,n){var i=+e.getRightValue(t);isNaN(i)||r.data[n].hidden||(null===e.min?e.min=i:i<e.min&&(e.min=i),null===e.max?e.max=i:i>e.max&&(e.max=i))})});e.min=isFinite(e.min)&&!isNaN(e.min)?e.min:0,e.max=isFinite(e.max)&&!isNaN(e.max)?e.max:1,this.handleTickRangeOptions()},getTickLimit:function(){var t,e=this,n=e.options.ticks;if(e.isHorizontal())t=Math.min(n.maxTicksLimit?n.maxTicksLimit:11,Math.ceil(e.width/50));else{var o=a.valueOrDefault(n.fontSize,i.global.defaultFontSize);t=Math.min(n.maxTicksLimit?n.maxTicksLimit:11,Math.ceil(e.height/(2*o)))}return t},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,n=this,i=n.start,a=+n.getRightValue(t),o=n.end-i;return n.isHorizontal()?(e=n.left+n.width/o*(a-i),Math.round(e)):(e=n.bottom-n.height/o*(a-i),Math.round(e))},getValueForPixel:function(t){var e=this,n=e.isHorizontal(),i=n?e.width:e.height,a=(n?t-e.left:e.bottom-t)/i;return e.start+(e.end-e.start)*a},getPixelForTick:function(t){return this.getPixelForValue(this.ticksAsNumbers[t])}});t.scaleService.registerScaleType("linear",n,e)}},{25:25,34:34,45:45}],54:[function(t,e,n){"use strict";var i=t(45),a=t(34);e.exports=function(t){var e=i.noop;t.LinearScaleBase=t.Scale.extend({getRightValue:function(e){return"string"==typeof e?+e:t.Scale.prototype.getRightValue.call(this,e)},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;if(e.beginAtZero){var n=i.sign(t.min),a=i.sign(t.max);n<0&&a<0?t.max=0:n>0&&a>0&&(t.min=0)}var o=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)),o!==r&&t.min>=t.max&&(o?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,e.beginAtZero||t.min--)},getTickLimit:e,handleDirectionalChanges:e,buildTicks:function(){var t=this,e=t.options.ticks,n=t.getTickLimit(),o={maxTicks:n=Math.max(2,n),min:e.min,max:e.max,stepSize:i.valueOrDefault(e.fixedStepSize,e.stepSize)},r=t.ticks=a.generators.linear(o,t);t.handleDirectionalChanges(),t.max=i.max(r),t.min=i.min(r),e.reverse?(r.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max)},convertTicksToLabels:function(){var e=this;e.ticksAsNumbers=e.ticks.slice(),e.zeroLineIndex=e.ticks.indexOf(0),t.Scale.prototype.convertTicksToLabels.call(e)}})}},{34:34,45:45}],55:[function(t,e,n){"use strict";var i=t(45),a=t(34);e.exports=function(t){var e={position:"left",ticks:{callback:a.formatters.logarithmic}},n=t.Scale.extend({determineDataLimits:function(){function t(t){return s?t.xAxisID===e.id:t.yAxisID===e.id}var e=this,n=e.options,a=n.ticks,o=e.chart,r=o.data.datasets,l=i.valueOrDefault,s=e.isHorizontal();e.min=null,e.max=null,e.minNotZero=null;var u=n.stacked;if(void 0===u&&i.each(r,function(e,n){if(!u){var i=o.getDatasetMeta(n);o.isDatasetVisible(n)&&t(i)&&void 0!==i.stack&&(u=!0)}}),n.stacked||u){var d={};i.each(r,function(a,r){var l=o.getDatasetMeta(r),s=[l.type,void 0===n.stacked&&void 0===l.stack?r:"",l.stack].join(".");o.isDatasetVisible(r)&&t(l)&&(void 0===d[s]&&(d[s]=[]),i.each(a.data,function(t,i){var a=d[s],o=+e.getRightValue(t);isNaN(o)||l.data[i].hidden||(a[i]=a[i]||0,n.relativePoints?a[i]=100:a[i]+=o)}))}),i.each(d,function(t){var n=i.min(t),a=i.max(t);e.min=null===e.min?n:Math.min(e.min,n),e.max=null===e.max?a:Math.max(e.max,a)})}else i.each(r,function(n,a){var r=o.getDatasetMeta(a);o.isDatasetVisible(a)&&t(r)&&i.each(n.data,function(t,n){var i=+e.getRightValue(t);isNaN(i)||r.data[n].hidden||(null===e.min?e.min=i:i<e.min&&(e.min=i),null===e.max?e.max=i:i>e.max&&(e.max=i),0!==i&&(null===e.minNotZero||i<e.minNotZero)&&(e.minNotZero=i))})});e.min=l(a.min,e.min),e.max=l(a.max,e.max),e.min===e.max&&(0!==e.min&&null!==e.min?(e.min=Math.pow(10,Math.floor(i.log10(e.min))-1),e.max=Math.pow(10,Math.floor(i.log10(e.max))+1)):(e.min=1,e.max=10))},buildTicks:function(){var t=this,e=t.options.ticks,n={min:e.min,max:e.max},o=t.ticks=a.generators.logarithmic(n,t);t.isHorizontal()||o.reverse(),t.max=i.max(o),t.min=i.min(o),e.reverse?(o.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max)},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),t.Scale.prototype.convertTicksToLabels.call(this)},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},getPixelForTick:function(t){return this.getPixelForValue(this.tickValues[t])},getPixelForValue:function(t){var e,n,a,o=this,r=o.start,l=+o.getRightValue(t),s=o.options.ticks;return o.isHorizontal()?(a=i.log10(o.end)-i.log10(r),0===l?n=o.left:(e=o.width,n=o.left+e/a*(i.log10(l)-i.log10(r)))):(e=o.height,0!==r||s.reverse?0===o.end&&s.reverse?(a=i.log10(o.start)-i.log10(o.minNotZero),n=l===o.end?o.top:l===o.minNotZero?o.top+.02*e:o.top+.02*e+.98*e/a*(i.log10(l)-i.log10(o.minNotZero))):0===l?n=s.reverse?o.top:o.bottom:(a=i.log10(o.end)-i.log10(r),e=o.height,n=o.bottom-e/a*(i.log10(l)-i.log10(r))):(a=i.log10(o.end)-i.log10(o.minNotZero),n=l===r?o.bottom:l===o.minNotZero?o.bottom-.02*e:o.bottom-.02*e-.98*e/a*(i.log10(l)-i.log10(o.minNotZero)))),n},getValueForPixel:function(t){var e,n,a=this,o=i.log10(a.end)-i.log10(a.start);return a.isHorizontal()?(n=a.width,e=a.start*Math.pow(10,(t-a.left)*o/n)):(n=a.height,e=Math.pow(10,(a.bottom-t)*o/n)/a.start),e}});t.scaleService.registerScaleType("logarithmic",n,e)}},{34:34,45:45}],56:[function(t,e,n){"use strict";var i=t(25),a=t(45),o=t(34);e.exports=function(t){function e(t){var e=t.options;return e.angleLines.display||e.pointLabels.display?t.chart.data.labels.length:0}function n(t){var e=t.options.pointLabels,n=a.valueOrDefault(e.fontSize,v.defaultFontSize),i=a.valueOrDefault(e.fontStyle,v.defaultFontStyle),o=a.valueOrDefault(e.fontFamily,v.defaultFontFamily);return{size:n,style:i,family:o,font:a.fontString(n,i,o)}}function r(t,e,n){return a.isArray(n)?{w:a.longestText(t,t.font,n),h:n.length*e+1.5*(n.length-1)*e}:{w:t.measureText(n).width,h:e}}function l(t,e,n,i,a){return t===i||t===a?{start:e-n/2,end:e+n/2}:t<i||t>a?{start:e-n-5,end:e}:{start:e,end:e+n+5}}function s(t){var i,o,s,u=n(t),d=Math.min(t.height/2,t.width/2),c={r:t.width,l:0,t:t.height,b:0},h={};t.ctx.font=u.font,t._pointLabelSizes=[];var f=e(t);for(i=0;i<f;i++){s=t.getPointPosition(i,d),o=r(t.ctx,u.size,t.pointLabels[i]||""),t._pointLabelSizes[i]=o;var g=t.getIndexAngle(i),p=a.toDegrees(g)%360,v=l(p,s.x,o.w,0,180),m=l(p,s.y,o.h,90,270);v.start<c.l&&(c.l=v.start,h.l=g),v.end>c.r&&(c.r=v.end,h.r=g),m.start<c.t&&(c.t=m.start,h.t=g),m.end>c.b&&(c.b=m.end,h.b=g)}t.setReductions(d,c,h)}function u(t){var e=Math.min(t.height/2,t.width/2);t.drawingArea=Math.round(e),t.setCenterPoint(0,0,0,0)}function d(t){return 0===t||180===t?"center":t<180?"left":"right"}function c(t,e,n,i){if(a.isArray(e))for(var o=n.y,r=1.5*i,l=0;l<e.length;++l)t.fillText(e[l],n.x,o),o+=r;else t.fillText(e,n.x,n.y)}function h(t,e,n){90===t||270===t?n.y-=e.h/2:(t>270||t<90)&&(n.y-=e.h)}function f(t){var i=t.ctx,o=a.valueOrDefault,r=t.options,l=r.angleLines,s=r.pointLabels;i.lineWidth=l.lineWidth,i.strokeStyle=l.color;var u=t.getDistanceFromCenterForValue(r.ticks.reverse?t.min:t.max),f=n(t);i.textBaseline="top";for(var g=e(t)-1;g>=0;g--){if(l.display){var p=t.getPointPosition(g,u);i.beginPath(),i.moveTo(t.xCenter,t.yCenter),i.lineTo(p.x,p.y),i.stroke(),i.closePath()}if(s.display){var m=t.getPointPosition(g,u+5),b=o(s.fontColor,v.defaultFontColor);i.font=f.font,i.fillStyle=b;var x=t.getIndexAngle(g),y=a.toDegrees(x);i.textAlign=d(y),h(y,t._pointLabelSizes[g],m),c(i,t.pointLabels[g]||"",m,f.size)}}}function g(t,n,i,o){var r=t.ctx;if(r.strokeStyle=a.valueAtIndexOrDefault(n.color,o-1),r.lineWidth=a.valueAtIndexOrDefault(n.lineWidth,o-1),t.options.gridLines.circular)r.beginPath(),r.arc(t.xCenter,t.yCenter,i,0,2*Math.PI),r.closePath(),r.stroke();else{var l=e(t);if(0===l)return;r.beginPath();var s=t.getPointPosition(0,i);r.moveTo(s.x,s.y);for(var u=1;u<l;u++)s=t.getPointPosition(u,i),r.lineTo(s.x,s.y);r.closePath(),r.stroke()}}function p(t){return a.isNumber(t)?t:0}var v=i.global,m={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0, 0, 0, 0.1)",lineWidth:1},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:o.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(t){return t}}},b=t.LinearScaleBase.extend({setDimensions:function(){var t=this,e=t.options,n=e.ticks;t.width=t.maxWidth,t.height=t.maxHeight,t.xCenter=Math.round(t.width/2),t.yCenter=Math.round(t.height/2);var i=a.min([t.height,t.width]),o=a.valueOrDefault(n.fontSize,v.defaultFontSize);t.drawingArea=e.display?i/2-(o/2+n.backdropPaddingY):i/2},determineDataLimits:function(){var t=this,e=t.chart,n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;a.each(e.data.datasets,function(o,r){if(e.isDatasetVisible(r)){var l=e.getDatasetMeta(r);a.each(o.data,function(e,a){var o=+t.getRightValue(e);isNaN(o)||l.data[a].hidden||(n=Math.min(o,n),i=Math.max(o,i))})}}),t.min=n===Number.POSITIVE_INFINITY?0:n,t.max=i===Number.NEGATIVE_INFINITY?0:i,t.handleTickRangeOptions()},getTickLimit:function(){var t=this.options.ticks,e=a.valueOrDefault(t.fontSize,v.defaultFontSize);return Math.min(t.maxTicksLimit?t.maxTicksLimit:11,Math.ceil(this.drawingArea/(1.5*e)))},convertTicksToLabels:function(){var e=this;t.LinearScaleBase.prototype.convertTicksToLabels.call(e),e.pointLabels=e.chart.data.labels.map(e.options.pointLabels.callback,e)},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},fit:function(){this.options.pointLabels.display?s(this):u(this)},setReductions:function(t,e,n){var i=this,a=e.l/Math.sin(n.l),o=Math.max(e.r-i.width,0)/Math.sin(n.r),r=-e.t/Math.cos(n.t),l=-Math.max(e.b-i.height,0)/Math.cos(n.b);a=p(a),o=p(o),r=p(r),l=p(l),i.drawingArea=Math.min(Math.round(t-(a+o)/2),Math.round(t-(r+l)/2)),i.setCenterPoint(a,o,r,l)},setCenterPoint:function(t,e,n,i){var a=this,o=a.width-e-a.drawingArea,r=t+a.drawingArea,l=n+a.drawingArea,s=a.height-i-a.drawingArea;a.xCenter=Math.round((r+o)/2+a.left),a.yCenter=Math.round((l+s)/2+a.top)},getIndexAngle:function(t){return t*(2*Math.PI/e(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,i=n.getIndexAngle(t)-Math.PI/2;return{x:Math.round(Math.cos(i)*e)+n.xCenter,y:Math.round(Math.sin(i)*e)+n.yCenter}},getPointPositionForValue:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))},getBasePosition:function(){var t=this,e=t.min,n=t.max;return t.getPointPositionForValue(0,t.beginAtZero?0:e<0&&n<0?n:e>0&&n>0?e:0)},draw:function(){var t=this,e=t.options,n=e.gridLines,i=e.ticks,o=a.valueOrDefault;if(e.display){var r=t.ctx,l=this.getIndexAngle(0),s=o(i.fontSize,v.defaultFontSize),u=o(i.fontStyle,v.defaultFontStyle),d=o(i.fontFamily,v.defaultFontFamily),c=a.fontString(s,u,d);a.each(t.ticks,function(e,a){if(a>0||i.reverse){var u=t.getDistanceFromCenterForValue(t.ticksAsNumbers[a]);if(n.display&&0!==a&&g(t,n,u,a),i.display){var d=o(i.fontColor,v.defaultFontColor);if(r.font=c,r.save(),r.translate(t.xCenter,t.yCenter),r.rotate(l),i.showLabelBackdrop){var h=r.measureText(e).width;r.fillStyle=i.backdropColor,r.fillRect(-h/2-i.backdropPaddingX,-u-s/2-i.backdropPaddingY,h+2*i.backdropPaddingX,s+2*i.backdropPaddingY)}r.textAlign="center",r.textBaseline="middle",r.fillStyle=d,r.fillText(e,0,-u),r.restore()}}}),(e.angleLines.display||e.pointLabels.display)&&f(t)}}});t.scaleService.registerScaleType("radialLinear",b,m)}},{25:25,34:34,45:45}],57:[function(t,e,n){"use strict";function i(t,e){return t-e}function a(t){var e,n,i,a={},o=[];for(e=0,n=t.length;e<n;++e)a[i=t[e]]||(a[i]=!0,o.push(i));return o}function o(t,e,n,i){if("linear"===i||!t.length)return[{time:e,pos:0},{time:n,pos:1}];var a,o,r,l,s,u=[],d=[e];for(a=0,o=t.length;a<o;++a)(l=t[a])>e&&l<n&&d.push(l);for(d.push(n),a=0,o=d.length;a<o;++a)s=d[a+1],r=d[a-1],l=d[a],void 0!==r&&void 0!==s&&Math.round((s+r)/2)===l||u.push({time:l,pos:a/(o-1)});return u}function r(t,e,n){for(var i,a,o,r=0,l=t.length-1;r>=0&&r<=l;){if(i=r+l>>1,a=t[i-1]||null,o=t[i],!a)return{lo:null,hi:o};if(o[e]<n)r=i+1;else{if(!(a[e]>n))return{lo:a,hi:o};l=i-1}}return{lo:o,hi:null}}function l(t,e,n,i){var a=r(t,e,n),o=a.lo?a.hi?a.lo:t[t.length-2]:t[0],l=a.lo?a.hi?a.hi:t[t.length-1]:t[1],s=l[e]-o[e],u=s?(n-o[e])/s:0,d=(l[i]-o[i])*u;return o[i]+d}function s(t,e){var n=e.parser,i=e.parser||e.format;return"function"==typeof n?n(t):"string"==typeof t&&"string"==typeof i?m(t,i):(t instanceof m||(t=m(t)),t.isValid()?t:"function"==typeof i?i(t):t)}function u(t,e){if(x.isNullOrUndef(t))return null;var n=e.options.time,i=s(e.getRightValue(t),n);return i.isValid()?(n.round&&i.startOf(n.round),i.valueOf()):null}function d(t,e,n,i){var a,o,r,l=e-t,s=w[n],u=s.size,d=s.steps;if(!d)return Math.ceil(l/((i||1)*u));for(a=0,o=d.length;a<o&&(r=d[a],!(Math.ceil(l/(u*r))<=i));++a);return r}function c(t,e,n,i){var a,o,r,l=M.length;for(a=M.indexOf(t);a<l-1;++a)if(o=w[M[a]],r=o.steps?o.steps[o.steps.length-1]:k,o.common&&Math.ceil((n-e)/(r*o.size))<=i)return M[a];return M[l-1]}function h(t,e,n,i){var a,o,r=m.duration(m(i).diff(m(n)));for(a=M.length-1;a>=M.indexOf(e);a--)if(o=M[a],w[o].common&&r.as(o)>=t.length)return o;return M[e?M.indexOf(e):0]}function f(t){for(var e=M.indexOf(t)+1,n=M.length;e<n;++e)if(w[M[e]].common)return M[e]}function g(t,e,n,i){var a,o=i.time,r=o.unit||c(o.minUnit,t,e,n),l=f(r),s=x.valueOrDefault(o.stepSize,o.unitStepSize),u="week"===r&&o.isoWeekday,h=i.ticks.major.enabled,g=w[r],p=m(t),v=m(e),b=[];for(s||(s=d(t,e,r,n)),u&&(p=p.isoWeekday(u),v=v.isoWeekday(u)),p=p.startOf(u?"day":r),(v=v.startOf(u?"day":r))<e&&v.add(1,r),a=m(p),h&&l&&!u&&!o.round&&(a.startOf(l),a.add(~~((p-a)/(g.size*s))*s,r));a<v;a.add(s,r))b.push(+a);return b.push(+a),b}function p(t,e,n,i,a){var o,r,s=0,u=0;return a.offset&&e.length&&(a.time.min||(o=e.length>1?e[1]:i,r=e[0],s=(l(t,"time",o,"pos")-l(t,"time",r,"pos"))/2),a.time.max||(o=e[e.length-1],r=e.length>1?e[e.length-2]:n,u=(l(t,"time",o,"pos")-l(t,"time",r,"pos"))/2)),{left:s,right:u}}function v(t,e){var n,i,a,o,r=[];for(n=0,i=t.length;n<i;++n)a=t[n],o=!!e&&a===+m(a).startOf(e),r.push({value:a,major:o});return r}var m=t(1);m="function"==typeof m?m:window.moment;var b=t(25),x=t(45),y=Number.MIN_SAFE_INTEGER||-9007199254740991,k=Number.MAX_SAFE_INTEGER||9007199254740991,w={millisecond:{common:!0,size:1,steps:[1,2,5,10,20,50,100,250,500]},second:{common:!0,size:1e3,steps:[1,2,5,10,30]},minute:{common:!0,size:6e4,steps:[1,2,5,10,30]},hour:{common:!0,size:36e5,steps:[1,2,3,6,12]},day:{common:!0,size:864e5,steps:[1,2,5]},week:{common:!1,size:6048e5,steps:[1,2,3,4]},month:{common:!0,size:2628e6,steps:[1,2,3]},quarter:{common:!1,size:7884e6,steps:[1,2,3,4]},year:{common:!0,size:3154e7}},M=Object.keys(w);e.exports=function(t){var e=t.Scale.extend({initialize:function(){if(!m)throw new Error("Chart.js - Moment.js could not be found! You must include it before Chart.js to use the time scale. Download at https://momentjs.com");this.mergeTicksOptions(),t.Scale.prototype.initialize.call(this)},update:function(){var e=this,n=e.options;return n.time&&n.time.format&&console.warn("options.time.format is deprecated and replaced by options.time.parser."),t.Scale.prototype.update.apply(e,arguments)},getRightValue:function(e){return e&&void 0!==e.t&&(e=e.t),t.Scale.prototype.getRightValue.call(this,e)},determineDataLimits:function(){var t,e,n,o,r,l,s=this,d=s.chart,c=s.options.time,h=k,f=y,g=[],p=[],v=[];for(t=0,n=d.data.labels.length;t<n;++t)v.push(u(d.data.labels[t],s));for(t=0,n=(d.data.datasets||[]).length;t<n;++t)if(d.isDatasetVisible(t))if(r=d.data.datasets[t].data,x.isObject(r[0]))for(p[t]=[],e=0,o=r.length;e<o;++e)l=u(r[e],s),g.push(l),p[t][e]=l;else g.push.apply(g,v),p[t]=v.slice(0);else p[t]=[];v.length&&(v=a(v).sort(i),h=Math.min(h,v[0]),f=Math.max(f,v[v.length-1])),g.length&&(g=a(g).sort(i),h=Math.min(h,g[0]),f=Math.max(f,g[g.length-1])),h=u(c.min,s)||h,f=u(c.max,s)||f,h=h===k?+m().startOf("day"):h,f=f===y?+m().endOf("day")+1:f,s.min=Math.min(h,f),s.max=Math.max(h+1,f),s._horizontal=s.isHorizontal(),s._table=[],s._timestamps={data:g,datasets:p,labels:v}},buildTicks:function(){var t,e,n,i=this,a=i.min,r=i.max,l=i.options,s=l.time,d=[],c=[];switch(l.ticks.source){case"data":d=i._timestamps.data;break;case"labels":d=i._timestamps.labels;break;case"auto":default:d=g(a,r,i.getLabelCapacity(a),l)}for("ticks"===l.bounds&&d.length&&(a=d[0],r=d[d.length-1]),a=u(s.min,i)||a,r=u(s.max,i)||r,t=0,e=d.length;t<e;++t)(n=d[t])>=a&&n<=r&&c.push(n);return i.min=a,i.max=r,i._unit=s.unit||h(c,s.minUnit,i.min,i.max),i._majorUnit=f(i._unit),i._table=o(i._timestamps.data,a,r,l.distribution),i._offsets=p(i._table,c,a,r,l),v(c,i._majorUnit)},getLabelForIndex:function(t,e){var n=this,i=n.chart.data,a=n.options.time,o=i.labels&&t<i.labels.length?i.labels[t]:"",r=i.datasets[e].data[t];return x.isObject(r)&&(o=n.getRightValue(r)),a.tooltipFormat&&(o=s(o,a).format(a.tooltipFormat)),o},tickFormatFunction:function(t,e,n,i){var a=this,o=a.options,r=t.valueOf(),l=o.time.displayFormats,s=l[a._unit],u=a._majorUnit,d=l[u],c=t.clone().startOf(u).valueOf(),h=o.ticks.major,f=h.enabled&&u&&d&&r===c,g=t.format(i||(f?d:s)),p=f?h:o.ticks.minor,v=x.valueOrDefault(p.callback,p.userCallback);return v?v(g,e,n):g},convertTicksToLabels:function(t){var e,n,i=[];for(e=0,n=t.length;e<n;++e)i.push(this.tickFormatFunction(m(t[e].value),e,t));return i},getPixelForOffset:function(t){var e=this,n=e._horizontal?e.width:e.height,i=e._horizontal?e.left:e.top,a=l(e._table,"time",t,"pos");return i+n*(e._offsets.left+a)/(e._offsets.left+1+e._offsets.right)},getPixelForValue:function(t,e,n){var i=this,a=null;if(void 0!==e&&void 0!==n&&(a=i._timestamps.datasets[n][e]),null===a&&(a=u(t,i)),null!==a)return i.getPixelForOffset(a)},getPixelForTick:function(t){var e=this.getTicks();return t>=0&&t<e.length?this.getPixelForOffset(e[t].value):null},getValueForPixel:function(t){var e=this,n=e._horizontal?e.width:e.height,i=e._horizontal?e.left:e.top,a=(n?(t-i)/n:0)*(e._offsets.left+1+e._offsets.left)-e._offsets.right,o=l(e._table,"pos",a,"time");return m(o)},getLabelWidth:function(t){var e=this,n=e.options.ticks,i=e.ctx.measureText(t).width,a=x.toRadians(n.maxRotation),o=Math.cos(a),r=Math.sin(a);return i*o+x.valueOrDefault(n.fontSize,b.global.defaultFontSize)*r},getLabelCapacity:function(t){var e=this,n=e.options.time.displayFormats.millisecond,i=e.tickFormatFunction(m(t),0,[],n),a=e.getLabelWidth(i),o=e.isHorizontal()?e.width:e.height;return Math.floor(o/a)}});t.scaleService.registerScaleType("time",e,{position:"bottom",distribution:"linear",bounds:"data",time:{parser:!1,format:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{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"}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}})}},{1:1,25:25,45:45}]},{},[7])(7)});
admin/assets/js/bulk-conversion.js ADDED
@@ -0,0 +1,393 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(function ($) {
2
+ var bulkConversion = {
3
+ inprogress: false,
4
+ serverDown: false,
5
+ i18n: {},
6
+ settings: {},
7
+ startConvertButton: $('#wrio-start-conversion'),
8
+ startOptButton: $('#wrio-start-optimization'),
9
+
10
+ init: function () {
11
+ this.i18n = wrio_l18n_bulk_page;
12
+ this.settings = wrio_settings_bulk_page;
13
+
14
+ this.registerEvents();
15
+ },
16
+
17
+ registerEvents: function () {
18
+ var self = this;
19
+ this.startConvertButton.on('click', function () {
20
+
21
+ if ($(this).hasClass('wio-running')) {
22
+ self.startOptButton.prop('disabled', false);
23
+ self.stop();
24
+ return;
25
+ }
26
+
27
+ self.showModal();
28
+
29
+ return false;
30
+ });
31
+ },
32
+
33
+ showModal: function () {
34
+ var self = this;
35
+ var infosModal = $('#wrio-tmpl-webp-conversion');
36
+
37
+ if ('server_5' !== $('#wrio-change-optimization-server').val()) {
38
+ $.wrio_modal.showErrorModal(this.i18n.webp_premium_server_disabled);
39
+ console.log('[Error]: ' + this.i18n.webp_premium_server_disabled);
40
+ return;
41
+ }
42
+
43
+ if (!infosModal.length) {
44
+ console.log('[Error]: Html template for modal not found.');
45
+ return;
46
+ }
47
+
48
+ // Swal Information before loading the optimize process.
49
+ swal({
50
+ title: this.i18n.modal_conversion_title,
51
+ html: infosModal.html(),
52
+ type: '',
53
+ customClass: 'wrio-modal wrio-modal-optimization-way',
54
+ showCancelButton: true,
55
+ showCloseButton: true,
56
+ padding: 0,
57
+ width: 740,
58
+ confirmButtonText: this.i18n.modal_conversion_manual_button,
59
+ cancelButtonText: this.i18n.modal_conversion_cron_button,
60
+ reverseButtons: true,
61
+ }).then(function (result) {
62
+
63
+ self.startOptButton.prop('disabled', true);
64
+ self.process();
65
+
66
+ window.onbeforeunload = function () {
67
+ return self.i18n.leave_page_warning;
68
+ }
69
+
70
+ }, function (dismiss) {
71
+ if (dismiss === 'cancel') { // you might also handle 'close' or 'timer' if you used those
72
+ self.startOptButton.prop('disabled', true);
73
+ self.process('cron');
74
+ } else {
75
+ throw dismiss;
76
+ }
77
+ });
78
+
79
+ },
80
+
81
+ /**
82
+ * Start conversion
83
+ * @param {string} type
84
+ */
85
+ process: function (type) {
86
+ var self = this;
87
+ this.inprogress = true;
88
+
89
+ var sendData = {
90
+ 'action': 'wrio-bulk-conversion-process',
91
+ 'scope': this.settings.scope,
92
+ 'multisite': 0,
93
+ '_wpnonce': this.settings.conversion_nonce,
94
+ };
95
+
96
+ this.setButtonStyleRun(type);
97
+
98
+ if ('cron' === type) {
99
+ this.startConvertButton.addClass('wrio-cron-mode');
100
+
101
+ sendData['action'] = 'wrio-webp-cron-start';
102
+
103
+ $.post(ajaxurl, sendData, function (response) {
104
+ if (!response || !response.success) {
105
+ console.log('[Error]: Failed ajax request (Start cron).');
106
+ console.log(sendData);
107
+ console.log(response);
108
+
109
+ if (response.data && response.data.error_message) {
110
+ self.throwError(response.data.error_message);
111
+ }
112
+ } else {
113
+ if (response.data && response.data.stop) {
114
+ self.stop();
115
+ }
116
+ }
117
+ }).fail(function (xhr, status, error) {
118
+ console.log(xhr);
119
+ console.log(status);
120
+ console.log(error);
121
+
122
+ self.throwError(error);
123
+ });
124
+
125
+ return;
126
+ }
127
+
128
+ this.showMessage(this.i18n.conversion_inprogress.replace("%s", parseInt($('#wio-unoptimized-num').text())));
129
+
130
+ // show message: Optimization remined
131
+ /*if( "1" === this.settings.is_network_admin ) {
132
+ sendData['multisite'] = 1;
133
+ }*/
134
+
135
+ sendData['reset_current_errors'] = 1;
136
+
137
+ this.sendRequest(sendData);
138
+ },
139
+
140
+ stop: function () {
141
+ var self = this;
142
+ this.inprogress = false;
143
+
144
+ window.onbeforeunload = null;
145
+ self.setButtonStyleStop();
146
+ self.destroyMessages();
147
+
148
+ if (this.startConvertButton.hasClass('wrio-cron-mode')) {
149
+ this.startConvertButton.removeClass('wrio-cron-mode');
150
+
151
+ $.post(ajaxurl, {
152
+ 'action': 'wrio-webp-cron-stop',
153
+ '_wpnonce': self.settings.conversion_nonce,
154
+ 'scope': self.settings.scope
155
+ }, function (response) {
156
+ if (!response || !response.success) {
157
+ console.log('[Error]: Failed ajax request (Stop cron).');
158
+ console.log(response);
159
+
160
+ if (response.data && response.data.error_message) {
161
+ self.throwError(response.data.error_message);
162
+ }
163
+ } else {
164
+ self.startOptButton.prop('disabled', false);
165
+ }
166
+ }).fail(function (xhr, status, error) {
167
+ console.log(xhr);
168
+ console.log(status);
169
+ console.log(error);
170
+
171
+ self.throwError(error);
172
+ });
173
+ }
174
+
175
+ },
176
+
177
+ complete: function () {
178
+ this.inprogress = false;
179
+ window.onbeforeunload = null;
180
+ this.setButtonStyleComplete();
181
+ },
182
+
183
+ setButtonStyleRun: function (mode) {
184
+
185
+ this.startConvertButton.addClass('wio-running');
186
+
187
+ if ("cron" === mode) {
188
+ this.startConvertButton.text(this.i18n.modal_conversion_cron_button_stop);
189
+ return;
190
+ }
191
+
192
+ this.startConvertButton.text(this.i18n.button_stop);
193
+ },
194
+
195
+ setButtonStyleComplete: function () {
196
+ this.showMessage(this.i18n.conversion_complete);
197
+ this.startConvertButton.text(this.i18n.button_completed);
198
+ this.startConvertButton.removeClass('wio-running');
199
+ this.startConvertButton.prop('disabled', true);
200
+ this.startOptButton.prop('disabled', false);
201
+ },
202
+
203
+ setButtonStyleStop: function () {
204
+ this.startConvertButton.removeClass('wio-running');
205
+ this.startConvertButton.text(this.i18n.webp_button_start);
206
+ },
207
+
208
+ showMessage: function (text) {
209
+ var contanier = $('.wio-page-statistic'),
210
+ message;
211
+
212
+ if (contanier.find('.wrio-statistic-message').length) {
213
+ message = contanier.find('.wrio-statistic-message');
214
+ } else {
215
+ message = $('<div>');
216
+ message.addClass('wrio-statistic-message');
217
+ contanier.append(message);
218
+ }
219
+
220
+ message.html(text);
221
+ },
222
+
223
+ throwError: function (error_message) {
224
+ this.stop();
225
+
226
+ var noticeId = $.wbcr_factory_templates_102.app.showNotice(error_message, 'danger');
227
+
228
+ setTimeout(function () {
229
+ $.wbcr_factory_templates_102.app.hideNotice(noticeId);
230
+ }, 10000);
231
+ },
232
+
233
+ destroyMessages: function () {
234
+ $('.wio-page-statistic').find('.wrio-statistic-message').empty();
235
+ },
236
+
237
+ sendRequest: function (data) {
238
+ var self = this;
239
+
240
+ if (!this.inprogress) {
241
+ return;
242
+ }
243
+
244
+ $.post(ajaxurl, data, function (response) {
245
+ if (!self.inprogress) {
246
+ return;
247
+ }
248
+
249
+ if (!response || !response.success) {
250
+ console.log('[Error]: Failed ajax request (Try to optimize images).');
251
+ console.log(response);
252
+
253
+ if (response.data && response.data.error_message) {
254
+ self.throwError(response.data.error_message);
255
+ }
256
+
257
+ return;
258
+ }
259
+
260
+ data.reset_current_errors = 0;
261
+
262
+ if (!response.data.end) {
263
+ $('#wio-total-unoptimized').text(parseInt(response.data.remain));
264
+ self.showMessage(self.i18n.conversion_inprogress.replace("%s", parseInt(response.data.remain)));
265
+ self.sendRequest(data);
266
+ } else {
267
+ $('#wio-total-unoptimized').text(response.data.remain);
268
+ self.complete();
269
+
270
+ // если мультисайт режим, то не скрываем кнопку запуска оптимизации
271
+ /*if( $('#wbcr-rio-current-blog').length ) {
272
+ $('#wio-start-conversion').toggleClass('wio-running');
273
+ } else {
274
+ $('#wio-start-conversion').hide();
275
+ }*/
276
+ }
277
+
278
+ redraw_statistics(response.data.statistic);
279
+
280
+ if (response.data.last_optimized) {
281
+ self.updateLog(response.data.last_optimized);
282
+ }
283
+ if (response.data.last_converted) {
284
+ self.updateLog(response.data.last_converted);
285
+ }
286
+ }).fail(function (xhr, status, error) {
287
+ console.log(xhr);
288
+ console.log(status);
289
+ console.log(error);
290
+
291
+ self.throwError(error);
292
+ });
293
+ },
294
+
295
+ updateLog: function (new_item_data) {
296
+ var self = this;
297
+
298
+ var limit = 100,
299
+ tableEl = $('.wrio-optimization-progress .wrio-table');
300
+
301
+ if (!tableEl.length || !new_item_data) {
302
+ return;
303
+ }
304
+
305
+ // если таблица была пустая
306
+ if ($('.wrio-table-container-empty').length) {
307
+ $('.wrio-table-container-empty').addClass('wrio-table-container').removeClass('wrio-table-container-empty');
308
+ if (tableEl.find('tbody').length) {
309
+ tableEl.find('tbody').empty();
310
+ }
311
+ }
312
+
313
+ $.each(new_item_data, function (index, value) {
314
+ var trEl = $('<tr>'),
315
+ tdEl = $('<td>'),
316
+ webpSize = value.webp_size ? value.webp_size : '-';
317
+
318
+ if (tableEl.find('.wrio-row-id-' + value.id).length) {
319
+ tableEl.find('.wrio-row-id-' + value.id).remove();
320
+ }
321
+
322
+ trEl.addClass('flash').addClass('wrio-table-item').addClass('wrio-row-id-' + value.id);
323
+
324
+ if ('error' === value.type) {
325
+ trEl.addClass('wrio-error');
326
+ }
327
+
328
+ var preview = $('<img width="40" height="40" src="' + value.thumbnail_url + '" alt="">'),
329
+ previewUrl = $('<a href="' + value.url + '" target="_blank">' + value.file_name + '</a>');
330
+
331
+ tableEl.prepend(trEl);
332
+
333
+ trEl.append(tdEl.clone().append(preview));
334
+ trEl.append(tdEl.clone().append(previewUrl));
335
+
336
+ if ('error' === value.type) {
337
+ var colspan = value.scope !== 'custom-folders' ? '6' : '5';
338
+ trEl.append(tdEl.clone().attr('colspan', colspan).text("Error: " + value.error_msg));
339
+ } else {
340
+ trEl.append(tdEl.clone().text(value.original_size));
341
+ trEl.append(tdEl.clone().text(value.optimized_size));
342
+ trEl.append(tdEl.clone().text(webpSize));
343
+ trEl.append(tdEl.clone().text(value.original_saving));
344
+
345
+ if ("custom-folders" !== self.settings.scope) {
346
+ trEl.append(tdEl.clone().text(value.thumbnails_count));
347
+ }
348
+
349
+ trEl.append(tdEl.clone().text(value.total_saving));
350
+ }
351
+ });
352
+
353
+ if (tableEl.find('tr').length > limit) {
354
+ var diff = tableEl.find('tr').length - limit;
355
+
356
+ for (var i = 0; i < diff; i++) {
357
+ tableEl.find('tr:last').remove();
358
+ }
359
+ }
360
+ }
361
+
362
+ };
363
+
364
+ $(document).ready(function () {
365
+ bulkConversion.init();
366
+ $('[data-toggle="tooltip"]').tooltip();
367
+ });
368
+
369
+ var ajaxUrl = ajaxurl;
370
+ var ai_data;
371
+
372
+ function redraw_statistics(statistic) {
373
+ $('#wio-webp-chart').attr('data-unoptimized', statistic.unconverted)
374
+ .attr('data-optimized', statistic.converted)
375
+ .attr('data-errors', statistic.webp_error);
376
+ $('#wio-overview-chart-percent-webp').html(statistic.webp_percent_line + '<span>%</span>');
377
+ $('.wio-total-percent-webp').text(statistic.webp_percent_line + '%');
378
+
379
+ var credits = $('.wrio-premium-user-balance');
380
+ if (credits.attr('data-server') !== "server_5") {
381
+ credits.text(statistic.credits);
382
+ }
383
+
384
+ window.wio_chart_webp.data.datasets[0].data[0] = statistic.unconverted; // unoptimized
385
+ window.wio_chart_webp.data.datasets[0].data[1] = statistic.converted; // optimized
386
+ window.wio_chart_webp.data.datasets[0].data[2] = statistic.webp_error; // errors
387
+ window.wio_chart_webp.update();
388
+ if ($('#wio-overview-chart-percent-webp').text() == '100%') {
389
+ window.onbeforeunload = null;
390
+ }
391
+ }
392
+
393
+ });
admin/assets/js/bulk-optimization.js CHANGED
@@ -1,633 +1,639 @@
1
- jQuery(function ($) {
2
- var bulkOptimization = {
3
-
4
- inprogress: false,
5
-
6
- serverDown: false,
7
-
8
- i18n: {},
9
-
10
- settings: {},
11
-
12
- init: function () {
13
- if (wrio_l18n_bulk_page === undefined || wrio_settings_bulk_page === undefined) {
14
- console.log('[Error]: Required global variables are not declared.');
15
- return;
16
- }
17
- if ('server_1' === $('#wrio-change-optimization-server').val()) {
18
- $(".wrio-premium-user-balance-wrap").hide();
19
- $(".wrio-premium-user-update-wrap").hide();
20
- }
21
- if ('server_5' === $('#wrio-change-optimization-server').val()) {
22
- if (!this.settings.is_premium) {
23
- $.wrio_modal.showErrorModal(this.i18n.premium_server_disabled);
24
- }
25
- }
26
-
27
- this.i18n = wrio_l18n_bulk_page;
28
- this.settings = wrio_settings_bulk_page;
29
- this.startOptButton = $('#wrio-start-optimization');
30
-
31
- this.registerEvents();
32
- this.checkServerStatus();
33
- this.calculateTotalImages();
34
- this.checkPremiumUserBalance();
35
-
36
- },
37
-
38
- registerEvents: function () {
39
- var self = this,
40
- selectedServer = $("#wrio-change-optimization-server option:selected");
41
-
42
- $('#wrio-change-optimization-server').on('change', function () {
43
- $(this).prop('disabled', true);
44
- $('.wrio-premium-user-balance').attr('data-server', $(this).val());
45
- $(".wrio-premium-user-balance-wrap").show();
46
- $(".wrio-premium-user-update-wrap").show();
47
-
48
- if ('server_1' === $(this).val()) {
49
- $(".wrio-premium-user-balance-wrap").hide();
50
- $(".wrio-premium-user-update-wrap").hide();
51
- }
52
- if ('server_5' === $(this).val()) {
53
- if (!self.settings.is_premium) {
54
- $.wrio_modal.showErrorModal(self.i18n.premium_server_disabled);
55
- selectedServer.prop('selected', true);
56
- $(this).prop('disabled', false);
57
-
58
- return;
59
- }
60
- }
61
-
62
- self.checkPremiumUserBalance();
63
-
64
- selectedServer = $(this).find('option:selected');
65
- self.checkServerStatus();
66
- });
67
-
68
- this.startOptButton.on('click', function () {
69
- self.startOptButton = $(this);
70
-
71
- if ($(this).hasClass('wio-running')) {
72
- self.stop();
73
- return;
74
- }
75
-
76
- if (self.serverDown) {
77
- $.wrio_modal.showErrorModal(self.i18n.server_down_warning);
78
- return;
79
- }
80
-
81
- if ("1" === self.settings.need_migration) {
82
- $.wrio_modal.showErrorModal(self.i18n.need_migrations);
83
- return;
84
- }
85
-
86
- if ("0" === self.settings.images_backup) {
87
- $.wrio_modal.showWarningModal(self.i18n.process_without_backup, function () {
88
- self.showModal();
89
- });
90
- return;
91
- }
92
-
93
- self.showModal();
94
-
95
- return false;
96
- });
97
- },
98
-
99
- checkPremiumUserBalance: function () {
100
- var self = this,
101
- userBalance = $('.wrio-premium-user-balance'),
102
- balanceResetAt = $('.wrio-premium-user-update'),
103
- data = {
104
- 'action': 'wbcr-rio-check-user-balance',
105
- '_wpnonce': self.settings.nonce
106
- };
107
-
108
- data['server_name'] = $('#wrio-change-optimization-server').val();
109
-
110
- userBalance.addClass('wrio-premium-user-balance-check-proccess');
111
- userBalance.text('');
112
-
113
- if ("server_5" === data['server_name']) {
114
- balanceResetAt.addClass('wrio-premium-user-update-check-proccess');
115
- balanceResetAt.text('');
116
- }
117
-
118
- $.post(ajaxurl, data, function (response) {
119
- console.log(response);
120
- userBalance.removeClass('wrio-premium-user-balance-check-proccess');
121
- if ("server_5" === data['server_name']) {
122
- balanceResetAt.removeClass('wrio-premium-user-update-check-proccess');
123
- }
124
-
125
- if (!response || !response.data || !response.success) {
126
- console.log('[Error]: Response error');
127
- response.data && response.data.error && console.log(response.data.error);
128
-
129
- if (!response || !response.data) {
130
- console.log(response);
131
- }
132
-
133
- userBalance.text('error');
134
- if ("server_5" === data['server_name']) {
135
- balanceResetAt.text('error');
136
- }
137
- } else {
138
- userBalance.text(response.data.balance);
139
- if ("server_5" === data['server_name']) {
140
- balanceResetAt.text(response.data.reset_at);
141
- }
142
- }
143
- }).fail(function (xhr, status, error) {
144
- console.log(xhr);
145
- console.log(status);
146
- console.log(error);
147
-
148
- self.throwError(error);
149
- });
150
- },
151
-
152
- checkServerStatus: function () {
153
- var self = this,
154
- serverStatus = $('.wrio-server-status'),
155
- data = {
156
- 'action': 'wbcr-rio-check-servers-status',
157
- '_wpnonce': self.settings.nonce
158
- };
159
-
160
- self.serverDown = false;
161
-
162
- data['server_name'] = $('#wrio-change-optimization-server').val();
163
-
164
- serverStatus.addClass('wrio-server-check-proccess');
165
- serverStatus.text('');
166
- serverStatus.removeClass('wrio-down').removeClass('wrio-stable');
167
-
168
- self.startOptButton.prop('disabled', true);
169
-
170
- $.post(ajaxurl, data, function (response) {
171
- serverStatus.removeClass('wrio-server-check-proccess');
172
- $('#wrio-change-optimization-server').prop('disabled', false);
173
-
174
- if (!response || !response.data || !response.success) {
175
- console.log('[Error]: Response error');
176
- response.data && response.data.error && console.log(response.data.error);
177
-
178
- if (!response || !response.data) {
179
- console.log(response);
180
- }
181
-
182
- $('option[name="' + data['server_name'] + '"]').prop('disabled', true);
183
- serverStatus.addClass('wrio-down');
184
- serverStatus.text(self.i18n.server_status_down);
185
- self.serverDown = true;
186
-
187
- return;
188
- } else {
189
- serverStatus.addClass('wrio-stable');
190
- serverStatus.text(self.i18n.server_status_stable);
191
- }
192
-
193
- self.startOptButton.prop('disabled', false);
194
-
195
- }).fail(function (xhr, status, error) {
196
- console.log(xhr);
197
- console.log(status);
198
- console.log(error);
199
-
200
- self.throwError(error);
201
- });
202
- },
203
-
204
- calculateTotalImages: function () {
205
- var self = this,
206
- total_num = $('#wio-total-num'),
207
- data = {
208
- 'action': 'wbcr-rio-calculate-total-images',
209
- '_wpnonce': self.settings.nonce
210
- };
211
-
212
- total_num.addClass('wrio-calculate-process');
213
- total_num.text('');
214
-
215
- $.post(ajaxurl, data, function (response) {
216
- total_num.removeClass('wrio-calculate-process');
217
-
218
- if (!response || !response.data || !response.success) {
219
- console.log('[Error]: Response error');
220
- response.data && response.data.error && console.log(response.data.error);
221
-
222
- if (!response || !response.data) {
223
- console.log(response);
224
- }
225
-
226
- total_num.text('');
227
-
228
- return;
229
- } else {
230
- if (typeof (response.data.total) !== "undefined") {
231
- total_num.addClass('wrio-total-images');
232
- total_num.text(response.data.total);
233
- }
234
- }
235
- }).fail(function (xhr, status, error) {
236
- console.log(xhr);
237
- console.log(status);
238
- console.log(error);
239
-
240
- self.throwError(error);
241
- });
242
- },
243
-
244
- showModal: function () {
245
- var self = this;
246
- var infosModal = $('#wrio-tmpl-bulk-optimization');
247
-
248
- if (!infosModal.length) {
249
- console.log('[Error]: Html template for modal not found.');
250
- return;
251
- }
252
-
253
- // Swal Information before loading the optimize process.
254
- swal({
255
- title: this.i18n.modal_optimization_title,
256
- html: infosModal.html(),
257
- type: '',
258
- customClass: 'wrio-modal wrio-modal-optimization-way',
259
- showCancelButton: true,
260
- showCloseButton: true,
261
- padding: 0,
262
- width: 740,
263
- confirmButtonText: this.i18n.modal_optimization_manual_button,
264
- cancelButtonText: this.i18n.modal_optimization_cron_button,
265
- reverseButtons: true,
266
- }).then(function (result) {
267
-
268
- self.process();
269
-
270
- window.onbeforeunload = function () {
271
- return self.i18n.leave_page_warning;
272
- }
273
-
274
- }, function (dismiss) {
275
- if (dismiss === 'cancel') { // you might also handle 'close' or 'timer' if you used those
276
- self.process('cron');
277
- } else {
278
- throw dismiss;
279
- }
280
- });
281
-
282
- },
283
-
284
- /**
285
- * Start optimization
286
- * @param {string} type
287
- */
288
- process: function (type) {
289
- var self = this;
290
-
291
- this.inprogress = true;
292
-
293
- var sendData = {
294
- 'action': 'wrio-bulk-optimization-process',
295
- 'scope': this.settings.scope,
296
- 'multisite': 0,
297
- '_wpnonce': this.settings.nonce,
298
- };
299
-
300
- this.setButtonStyleRun(type);
301
-
302
- if ('cron' === type) {
303
- this.startOptButton.addClass('wrio-cron-mode');
304
-
305
- sendData['action'] = 'wrio-cron-start';
306
-
307
- $.post(ajaxurl, sendData, function (response) {
308
- if (!response || !response.success) {
309
- console.log('[Error]: Failed ajax request (Start cron).');
310
- console.log(sendData);
311
- console.log(response);
312
-
313
- if (response.data && response.data.error_message) {
314
- self.throwError(response.data.error_message);
315
- }
316
- } else {
317
- if (response.data && response.data.stop) {
318
- self.stop();
319
- }
320
- }
321
- }).fail(function (xhr, status, error) {
322
- console.log(xhr);
323
- console.log(status);
324
- console.log(error);
325
-
326
- self.throwError(error);
327
- });
328
-
329
- return;
330
- }
331
-
332
- this.showMessage(this.i18n.optimization_inprogress.replace("%s", parseInt($('#wio-unoptimized-num').text())));
333
-
334
- // show message: Optimization remined
335
- /*if( "1" === this.settings.is_network_admin ) {
336
- sendData['multisite'] = 1;
337
- }*/
338
-
339
- sendData['reset_current_errors'] = 1;
340
-
341
- this.sendRequest(sendData);
342
- },
343
-
344
- stop: function () {
345
- var self = this;
346
-
347
- this.inprogress = false;
348
-
349
- window.onbeforeunload = null;
350
- self.setButtonStyleStop();
351
- self.destroyMessages();
352
-
353
- if (this.startOptButton.hasClass('wrio-cron-mode')) {
354
- this.startOptButton.removeClass('wrio-cron-mode');
355
-
356
- $.post(ajaxurl, {
357
- 'action': 'wrio-cron-stop',
358
- '_wpnonce': self.settings.nonce,
359
- 'scope': self.settings.scope
360
- }, function (response) {
361
- if (!response || !response.success) {
362
- console.log('[Error]: Failed ajax request (Stop cron).');
363
- console.log(response);
364
-
365
- if (response.data && response.data.error_message) {
366
- self.throwError(response.data.error_message);
367
- }
368
- }
369
- }).fail(function (xhr, status, error) {
370
- console.log(xhr);
371
- console.log(status);
372
- console.log(error);
373
-
374
- self.throwError(error);
375
- });
376
- }
377
-
378
- },
379
-
380
- complete: function () {
381
- this.inprogress = false;
382
- window.onbeforeunload = null;
383
- this.setButtonStyleComplete();
384
- },
385
-
386
- setButtonStyleRun: function (mode) {
387
-
388
- this.startOptButton.addClass('wio-running');
389
-
390
- if ("cron" === mode) {
391
- this.startOptButton.text(this.i18n.button_stop_cron);
392
- return;
393
- }
394
-
395
- this.startOptButton.text(this.i18n.button_stop);
396
- },
397
-
398
- setButtonStyleComplete: function () {
399
- this.showMessage(this.i18n.optimization_complete);
400
- this.startOptButton.text(this.i18n.button_completed);
401
- this.startOptButton.removeClass('wio-running');
402
- this.startOptButton.prop('disabled', true);
403
- },
404
-
405
- setButtonStyleStop: function () {
406
- this.startOptButton.removeClass('wio-running');
407
- this.startOptButton.text(this.i18n.buttom_start);
408
- },
409
-
410
- showMessage: function (text) {
411
- var contanier = $('.wio-page-statistic'),
412
- message;
413
-
414
- if (contanier.find('.wrio-statistic-message').length) {
415
- message = contanier.find('.wrio-statistic-message');
416
- } else {
417
- message = $('<div>');
418
- message.addClass('wrio-statistic-message');
419
- contanier.append(message);
420
- }
421
-
422
- message.html(text);
423
- },
424
-
425
- throwError: function (error_message) {
426
- this.stop();
427
-
428
- var noticeId = $.wbcr_factory_clearfy_237.app.showNotice(error_message, 'danger');
429
-
430
- setTimeout(function () {
431
- $.wbcr_factory_clearfy_237.app.hideNotice(noticeId);
432
- }, 10000);
433
- },
434
-
435
- destroyMessages: function () {
436
- $('.wio-page-statistic').find('.wrio-statistic-message').remove();
437
- },
438
-
439
- sendRequest: function (data) {
440
- var self = this;
441
-
442
- if (!this.inprogress) {
443
- return;
444
- }
445
-
446
- $.post(ajaxurl, data, function (response) {
447
- if (!self.inprogress) {
448
- return;
449
- }
450
-
451
- if (!response || !response.success) {
452
- console.log('[Error]: Failed ajax request (Try to optimize images).');
453
- console.log(response);
454
-
455
- if (response.data && response.data.error_message) {
456
- self.throwError(response.data.error_message);
457
- }
458
-
459
- return;
460
- }
461
-
462
- data.reset_current_errors = 0;
463
-
464
- if (!response.data.end) {
465
- $('#wio-total-unoptimized').text(parseInt(response.data.remain));
466
- self.showMessage(self.i18n.optimization_inprogress.replace("%s", parseInt(response.data.remain)));
467
- self.sendRequest(data);
468
- } else {
469
- $('#wio-total-unoptimized').text(response.data.remain);
470
- self.complete();
471
-
472
- // если мультисайт режим, то не скрываем кнопку запуска оптимизации
473
- /*if( $('#wbcr-rio-current-blog').length ) {
474
- $('#wio-start-optimization').toggleClass('wio-running');
475
- } else {
476
- $('#wio-start-optimization').hide();
477
- }*/
478
- }
479
-
480
- redraw_statistics(response.data.statistic);
481
-
482
- self.updateLog(response.data.last_optimized);
483
- }).fail(function (xhr, status, error) {
484
- console.log(xhr);
485
- console.log(status);
486
- console.log(error);
487
-
488
- self.throwError(error);
489
- });
490
- },
491
-
492
- updateLog: function (new_item_data) {
493
- var self = this;
494
-
495
- var limit = 100,
496
- tableEl = $('.wrio-optimization-progress .wrio-table');
497
-
498
- if (!tableEl.length || !new_item_data) {
499
- return;
500
- }
501
-
502
- // если таблица была пустая
503
- if ($('.wrio-table-container-empty').length) {
504
- $('.wrio-table-container-empty').addClass('wrio-table-container').removeClass('wrio-table-container-empty');
505
- if (tableEl.find('tbody').length) {
506
- tableEl.find('tbody').empty();
507
- }
508
- }
509
-
510
- $.each(new_item_data, function (index, value) {
511
- var trEl = $('<tr>'),
512
- tdEl = $('<td>'),
513
- webpSize = value.webp_size ? value.webp_size : '-';
514
-
515
- if (tableEl.find('.wrio-row-id-' + value.id).length) {
516
- tableEl.find('.wrio-row-id-' + value.id).remove();
517
- }
518
-
519
- trEl.addClass('flash').addClass('wrio-table-item').addClass('wrio-row-id-' + value.id);
520
-
521
- if ('error' === value.type) {
522
- trEl.addClass('wrio-error');
523
- }
524
-
525
- var preview = $('<img width="40" height="40" src="' + value.thumbnail_url + '" alt="">'),
526
- previewUrl = $('<a href="' + value.url + '" target="_blank">' + value.file_name + '</a>');
527
-
528
- tableEl.prepend(trEl);
529
-
530
- trEl.append(tdEl.clone().append(preview));
531
- trEl.append(tdEl.clone().append(previewUrl));
532
-
533
- if ('error' === value.type) {
534
- var colspan = value.scope !== 'custom-folders' ? '6' : '5';
535
- trEl.append(tdEl.clone().attr('colspan', colspan).text("Error: " + value.error_msg));
536
- } else {
537
- trEl.append(tdEl.clone().text(value.original_size));
538
- trEl.append(tdEl.clone().text(value.optimized_size));
539
- trEl.append(tdEl.clone().text(webpSize));
540
- trEl.append(tdEl.clone().text(value.original_saving));
541
-
542
- if ("custom-folders" !== self.settings.scope) {
543
- trEl.append(tdEl.clone().text(value.thumbnails_count));
544
- }
545
-
546
- trEl.append(tdEl.clone().text(value.total_saving));
547
- }
548
- });
549
-
550
- if (tableEl.find('tr').length > limit) {
551
- var diff = tableEl.find('tr').length - limit;
552
-
553
- for (var i = 0; i < diff; i++) {
554
- tableEl.find('tr:last').remove();
555
- }
556
- }
557
- }
558
-
559
- };
560
-
561
- $(document).ready(function () {
562
- bulkOptimization.init();
563
- $('[data-toggle="tooltip"]').tooltip();
564
- });
565
-
566
- var ajaxUrl = ajaxurl;
567
- var ai_data;
568
-
569
- function redraw_statistics(statistic) {
570
- $('#wio-main-chart').attr('data-unoptimized', statistic.unoptimized)
571
- .attr('data-optimized', statistic.optimized)
572
- .attr('data-errors', statistic.error);
573
- $('#wio-total-optimized-attachments').text(statistic.optimized); // optimized
574
- $('#wio-original-size').text(bytesToSize(statistic.original_size));
575
- $('#wio-optimized-size').text(bytesToSize(statistic.optimized_size));
576
- $('#wio-total-optimized-attachments-pct').text(statistic.save_size_percent + '%');
577
- $('#wio-overview-chart-percent').html(statistic.optimized_percent + '<span>%</span>');
578
- $('.wio-total-percent').text(statistic.optimized_percent + '%');
579
- $('#wio-optimized-bar').css('width', statistic.percent_line + '%');
580
-
581
- $('#wio-unoptimized-num').text(statistic.unoptimized);
582
- $('#wio-optimized-num').text(statistic.optimized);
583
- $('#wio-error-num').text(statistic.error);
584
-
585
- var credits = $('.wrio-premium-user-balance');
586
- if (credits.attr('data-server') !== "server_5") {
587
- credits.text(statistic.credits);
588
- }
589
-
590
- if ($('.wrio-statistic-nav li.active').length) {
591
- $('.wrio-statistic-nav li.active').find('span.wio-statistic-tab-percent').text(statistic.optimized_percent + '%');
592
- }
593
-
594
- window.wio_chart.data.datasets[0].data[0] = statistic.unoptimized; // unoptimized
595
- window.wio_chart.data.datasets[0].data[1] = statistic.optimized; // optimized
596
- window.wio_chart.data.datasets[0].data[2] = statistic.error; // errors
597
- window.wio_chart.update();
598
- if ($('#wio-overview-chart-percent').text() == '100%') {
599
- window.onbeforeunload = null;
600
- }
601
- }
602
-
603
- function bytesToSize(bytes) {
604
- var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
605
- if (bytes == 0) {
606
- return '0 Byte';
607
- }
608
- var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
609
- if (i == 0) {
610
- return bytes + ' ' + sizes[i];
611
- }
612
- return (bytes / Math.pow(1024, i)).toFixed(2) + ' ' + sizes[i];
613
- }
614
-
615
- /*$('#wbcr-rio-current-blog').on('change', function() {
616
- var self = $(this);
617
- $('#wio-start-msg-complete').hide();
618
- $(this).attr('disabled', true);
619
- $('#wio-start-optimization').attr('disabled', true);
620
- var ai_data = {
621
- 'action': 'wbcr_rio_update_current_blog',
622
- 'wpnonce': $(this).data('nonce'),
623
- 'current_blog_id': $(this).find('option:selected').val(),
624
- 'context': $(this).attr('data-context')
625
- };
626
- $.post(ajaxUrl, ai_data, function(response) {
627
- self.removeAttr('disabled');
628
- $('#wio-start-optimization').removeAttr('disabled');
629
- redraw_statistics(response.data.statistic);
630
- });
631
- });*/
632
-
633
- });
 
 
 
 
 
 
1
+ function bytesToSize(bytes) {
2
+ var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
3
+ if (bytes === 0) {
4
+ return '0 Byte';
5
+ }
6
+ var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
7
+ if (i === 0) {
8
+ return bytes + ' ' + sizes[i];
9
+ }
10
+ return (bytes / Math.pow(1024, i)).toFixed(2) + ' ' + sizes[i];
11
+ }
12
+
13
+ jQuery(function ($) {
14
+ var bulkOptimization = {
15
+ inprogress: false,
16
+ serverDown: false,
17
+ i18n: {},
18
+ settings: {},
19
+
20
+ init: function () {
21
+ if (wrio_l18n_bulk_page === undefined || wrio_settings_bulk_page === undefined) {
22
+ console.log('[Error]: Required global variables are not declared.');
23
+ return;
24
+ }
25
+
26
+ this.i18n = wrio_l18n_bulk_page;
27
+ this.settings = wrio_settings_bulk_page;
28
+ this.startOptButton = $('#wrio-start-optimization');
29
+ this.startConvButton = $('#wrio-start-conversion');
30
+
31
+ if ('server_1' === $('#wrio-change-optimization-server').val()) {
32
+ $(".wrio-premium-user-balance-wrap").hide();
33
+ $(".wrio-premium-user-update-wrap").hide();
34
+ }
35
+ if ('server_5' === $('#wrio-change-optimization-server').val()) {
36
+ if (!this.settings.is_premium) {
37
+ $.wrio_modal.showErrorModal(this.i18n.premium_server_disabled);
38
+ }
39
+ }
40
+
41
+ this.registerEvents();
42
+ this.checkServerStatus();
43
+ this.calculateTotalImages();
44
+ this.checkPremiumUserBalance();
45
+
46
+ },
47
+
48
+ registerEvents: function () {
49
+ var self = this,
50
+ selectedServer = $("#wrio-change-optimization-server option:selected");
51
+
52
+ $('#wrio-change-optimization-server').on('change', function () {
53
+ $(this).prop('disabled', true);
54
+ $('.wrio-premium-user-balance').attr('data-server', $(this).val());
55
+ $(".wrio-premium-user-balance-wrap").show();
56
+ $(".wrio-premium-user-update-wrap").show();
57
+
58
+ if ('server_1' === $(this).val()) {
59
+ $(".wrio-premium-user-balance-wrap").hide();
60
+ $(".wrio-premium-user-update-wrap").hide();
61
+ }
62
+ if ('server_5' === $(this).val()) {
63
+ if (!self.settings.is_premium) {
64
+ $.wrio_modal.showErrorModal(self.i18n.premium_server_disabled);
65
+ selectedServer.prop('selected', true);
66
+ $(this).prop('disabled', false);
67
+
68
+ return;
69
+ }
70
+ }
71
+
72
+ self.checkPremiumUserBalance();
73
+
74
+ selectedServer = $(this).find('option:selected');
75
+ self.checkServerStatus();
76
+ });
77
+
78
+ this.startOptButton.on('click', function () {
79
+ self.startOptButton = $(this);
80
+
81
+ if ($(this).hasClass('wio-running')) {
82
+ self.startConvButton.prop('disabled', false);
83
+ self.stop();
84
+ return;
85
+ }
86
+
87
+ if (self.serverDown) {
88
+ $.wrio_modal.showErrorModal(self.i18n.server_down_warning);
89
+ return;
90
+ }
91
+
92
+ if ("1" === self.settings.need_migration) {
93
+ $.wrio_modal.showErrorModal(self.i18n.need_migrations);
94
+ return;
95
+ }
96
+
97
+ if ("0" === self.settings.images_backup) {
98
+ $.wrio_modal.showWarningModal(self.i18n.process_without_backup, function () {
99
+ self.showModal();
100
+ });
101
+ return;
102
+ }
103
+
104
+ self.showModal();
105
+
106
+ return false;
107
+ });
108
+ },
109
+
110
+ checkPremiumUserBalance: function () {
111
+ var self = this,
112
+ userBalance = $('.wrio-premium-user-balance'),
113
+ balanceResetAt = $('.wrio-premium-user-update'),
114
+ data = {
115
+ 'action': 'wbcr-rio-check-user-balance',
116
+ '_wpnonce': self.settings.optimization_nonce
117
+ };
118
+
119
+ data['server_name'] = $('#wrio-change-optimization-server').val();
120
+
121
+ userBalance.addClass('wrio-premium-user-balance-check-proccess');
122
+ userBalance.text('');
123
+
124
+ if ("server_5" === data['server_name']) {
125
+ balanceResetAt.addClass('wrio-premium-user-update-check-proccess');
126
+ balanceResetAt.text('');
127
+ }
128
+
129
+ $.post(ajaxurl, data, function (response) {
130
+ console.log(response);
131
+ userBalance.removeClass('wrio-premium-user-balance-check-proccess');
132
+ if ("server_5" === data['server_name']) {
133
+ balanceResetAt.removeClass('wrio-premium-user-update-check-proccess');
134
+ }
135
+
136
+ if (!response || !response.data || !response.success) {
137
+ console.log('[Error]: Response error');
138
+ response.data && response.data.error && console.log(response.data.error);
139
+
140
+ if (!response || !response.data) {
141
+ console.log(response);
142
+ }
143
+
144
+ userBalance.text('error');
145
+ if ("server_5" === data['server_name']) {
146
+ balanceResetAt.text('error');
147
+ }
148
+ } else {
149
+ userBalance.text(response.data.balance);
150
+ if ("server_5" === data['server_name']) {
151
+ balanceResetAt.text(response.data.reset_at);
152
+ }
153
+ }
154
+ }).fail(function (xhr, status, error) {
155
+ console.log(xhr);
156
+ console.log(status);
157
+ console.log(error);
158
+
159
+ self.throwError(error);
160
+ });
161
+ },
162
+
163
+ checkServerStatus: function () {
164
+ var self = this,
165
+ serverStatus = $('.wrio-server-status'),
166
+ data = {
167
+ 'action': 'wbcr-rio-check-servers-status',
168
+ '_wpnonce': self.settings.optimization_nonce
169
+ };
170
+
171
+ self.serverDown = false;
172
+
173
+ data['server_name'] = $('#wrio-change-optimization-server').val();
174
+
175
+ serverStatus.addClass('wrio-server-check-proccess');
176
+ serverStatus.text('');
177
+ serverStatus.removeClass('wrio-down').removeClass('wrio-stable');
178
+
179
+ self.startOptButton.prop('disabled', true);
180
+ self.startConvButton.prop('disabled', true);
181
+
182
+ $.post(ajaxurl, data, function (response) {
183
+ serverStatus.removeClass('wrio-server-check-proccess');
184
+ $('#wrio-change-optimization-server').prop('disabled', false);
185
+
186
+ if (!response || !response.data || !response.success) {
187
+ console.log('[Error]: Response error');
188
+ response.data && response.data.error && console.log(response.data.error);
189
+
190
+ if (!response || !response.data) {
191
+ console.log(response);
192
+ }
193
+
194
+ $('option[name="' + data['server_name'] + '"]').prop('disabled', true);
195
+ serverStatus.addClass('wrio-down');
196
+ serverStatus.text(self.i18n.server_status_down);
197
+ self.serverDown = true;
198
+
199
+ return;
200
+ } else {
201
+ serverStatus.addClass('wrio-stable');
202
+ serverStatus.text(self.i18n.server_status_stable);
203
+ }
204
+
205
+ self.startOptButton.prop('disabled', false);
206
+ self.startConvButton.prop('disabled', false);
207
+
208
+ }).fail(function (xhr, status, error) {
209
+ console.log(xhr);
210
+ console.log(status);
211
+ console.log(error);
212
+
213
+ self.throwError(error);
214
+ });
215
+ },
216
+
217
+ calculateTotalImages: function () {
218
+ var self = this,
219
+ total_num = $('#wio-total-num'),
220
+ data = {
221
+ 'action': 'wbcr-rio-calculate-total-images',
222
+ '_wpnonce': self.settings.optimization_nonce
223
+ };
224
+
225
+ total_num.addClass('wrio-calculate-process');
226
+ total_num.text('');
227
+
228
+ $.post(ajaxurl, data, function (response) {
229
+ total_num.removeClass('wrio-calculate-process');
230
+
231
+ if (!response || !response.data || !response.success) {
232
+ console.log('[Error]: Response error');
233
+ response.data && response.data.error && console.log(response.data.error);
234
+
235
+ if (!response || !response.data) {
236
+ console.log(response);
237
+ }
238
+
239
+ total_num.text('');
240
+
241
+ return;
242
+ } else {
243
+ if (typeof (response.data.total) !== "undefined") {
244
+ total_num.addClass('wrio-total-images');
245
+ total_num.text(response.data.total);
246
+ }
247
+ }
248
+ }).fail(function (xhr, status, error) {
249
+ console.log(xhr);
250
+ console.log(status);
251
+ console.log(error);
252
+
253
+ self.throwError(error);
254
+ });
255
+ },
256
+
257
+ showModal: function () {
258
+ var self = this;
259
+ var infosModal = $('#wrio-tmpl-bulk-optimization');
260
+
261
+ if (!infosModal.length) {
262
+ console.log('[Error]: Html template for modal not found.');
263
+ return;
264
+ }
265
+
266
+ // Swal Information before loading the optimize process.
267
+ swal({
268
+ title: this.i18n.modal_optimization_title,
269
+ html: infosModal.html(),
270
+ type: '',
271
+ customClass: 'wrio-modal wrio-modal-optimization-way',
272
+ showCancelButton: true,
273
+ showCloseButton: true,
274
+ padding: 0,
275
+ width: 740,
276
+ confirmButtonText: this.i18n.modal_optimization_manual_button,
277
+ cancelButtonText: this.i18n.modal_optimization_cron_button,
278
+ reverseButtons: true,
279
+ }).then(function (result) {
280
+
281
+ self.startConvButton.prop('disabled', true);
282
+ self.process();
283
+
284
+ window.onbeforeunload = function () {
285
+ return self.i18n.leave_page_warning;
286
+ }
287
+
288
+ }, function (dismiss) {
289
+ if (dismiss === 'cancel') { // you might also handle 'close' or 'timer' if you used those
290
+ self.startConvButton.prop('disabled', true);
291
+ self.process('cron');
292
+ } else {
293
+ throw dismiss;
294
+ }
295
+ });
296
+
297
+ },
298
+
299
+ /**
300
+ * Start optimization
301
+ * @param {string} type
302
+ */
303
+ process: function (type) {
304
+ var self = this;
305
+
306
+ this.inprogress = true;
307
+
308
+ var sendData = {
309
+ 'action': 'wrio-bulk-optimization-process',
310
+ 'scope': this.settings.scope,
311
+ 'multisite': 0,
312
+ '_wpnonce': this.settings.optimization_nonce,
313
+ };
314
+
315
+ this.setButtonStyleRun(type);
316
+
317
+ if ('cron' === type) {
318
+ this.startOptButton.addClass('wrio-cron-mode');
319
+
320
+ sendData['action'] = 'wrio-cron-start';
321
+
322
+ $.post(ajaxurl, sendData, function (response) {
323
+ if (!response || !response.success) {
324
+ console.log('[Error]: Failed ajax request (Start cron).');
325
+ console.log(sendData);
326
+ console.log(response);
327
+
328
+ if (response.data && response.data.error_message) {
329
+ self.throwError(response.data.error_message);
330
+ }
331
+ } else {
332
+ if (response.data && response.data.stop) {
333
+ self.stop();
334
+ }
335
+ }
336
+ }).fail(function (xhr, status, error) {
337
+ console.log(xhr);
338
+ console.log(status);
339
+ console.log(error);
340
+
341
+ self.throwError(error);
342
+ });
343
+
344
+ return;
345
+ }
346
+
347
+ this.showMessage(this.i18n.optimization_inprogress.replace("%s", parseInt($('#wio-unoptimized-num').text())));
348
+
349
+ // show message: Optimization remined
350
+ /*if( "1" === this.settings.is_network_admin ) {
351
+ sendData['multisite'] = 1;
352
+ }*/
353
+
354
+ sendData['reset_current_errors'] = 1;
355
+
356
+ this.sendRequest(sendData);
357
+ },
358
+
359
+ stop: function () {
360
+ var self = this;
361
+
362
+ this.inprogress = false;
363
+
364
+ window.onbeforeunload = null;
365
+ self.setButtonStyleStop();
366
+ self.destroyMessages();
367
+
368
+ if (this.startOptButton.hasClass('wrio-cron-mode')) {
369
+ this.startOptButton.removeClass('wrio-cron-mode');
370
+
371
+ $.post(ajaxurl, {
372
+ 'action': 'wrio-cron-stop',
373
+ '_wpnonce': self.settings.optimization_nonce,
374
+ 'scope': self.settings.scope
375
+ }, function (response) {
376
+ if (!response || !response.success) {
377
+ console.log('[Error]: Failed ajax request (Stop cron).');
378
+ console.log(response);
379
+
380
+ if (response.data && response.data.error_message) {
381
+ self.throwError(response.data.error_message);
382
+ }
383
+ } else {
384
+ self.startConvButton.prop('disabled', false);
385
+ }
386
+ }).fail(function (xhr, status, error) {
387
+ console.log(xhr);
388
+ console.log(status);
389
+ console.log(error);
390
+
391
+ self.throwError(error);
392
+ });
393
+ }
394
+
395
+ },
396
+
397
+ complete: function () {
398
+ this.inprogress = false;
399
+ window.onbeforeunload = null;
400
+ this.setButtonStyleComplete();
401
+ },
402
+
403
+ setButtonStyleRun: function (mode) {
404
+
405
+ this.startOptButton.addClass('wio-running');
406
+
407
+ if ("cron" === mode) {
408
+ this.startOptButton.text(this.i18n.modal_optimization_cron_button_stop);
409
+ return;
410
+ }
411
+
412
+ this.startOptButton.text(this.i18n.button_stop);
413
+ },
414
+
415
+ setButtonStyleComplete: function () {
416
+ this.showMessage(this.i18n.optimization_complete);
417
+ this.startOptButton.text(this.i18n.button_completed);
418
+ this.startOptButton.removeClass('wio-running');
419
+ this.startOptButton.prop('disabled', true);
420
+ this.startConvButton.prop('disabled', false);
421
+ },
422
+
423
+ setButtonStyleStop: function () {
424
+ this.startOptButton.removeClass('wio-running');
425
+ this.startOptButton.text(this.i18n.button_start);
426
+ },
427
+
428
+ showMessage: function (text) {
429
+ var contanier = $('.wio-page-statistic'),
430
+ message;
431
+
432
+ if (contanier.find('.wrio-statistic-message').length) {
433
+ message = contanier.find('.wrio-statistic-message');
434
+ } else {
435
+ message = $('<div>');
436
+ message.addClass('wrio-statistic-message');
437
+ contanier.append(message);
438
+ }
439
+
440
+ message.html(text);
441
+ },
442
+
443
+ throwError: function (error_message) {
444
+ this.stop();
445
+
446
+ var noticeId = $.wbcr_factory_templates_102.app.showNotice(error_message, 'danger');
447
+
448
+ setTimeout(function () {
449
+ $.wbcr_factory_templates_102.app.hideNotice(noticeId);
450
+ }, 10000);
451
+ },
452
+
453
+ destroyMessages: function () {
454
+ $('.wio-page-statistic').find('.wrio-statistic-message').empty();
455
+ },
456
+
457
+ sendRequest: function (data) {
458
+ var self = this;
459
+
460
+ if (!this.inprogress) {
461
+ return;
462
+ }
463
+
464
+ $.post(ajaxurl, data, function (response) {
465
+ if (!self.inprogress) {
466
+ return;
467
+ }
468
+
469
+ if (!response || !response.success) {
470
+ console.log('[Error]: Failed ajax request (Try to optimize images).');
471
+ console.log(response);
472
+
473
+ if (response.data && response.data.error_message) {
474
+ self.throwError(response.data.error_message);
475
+ }
476
+
477
+ return;
478
+ }
479
+
480
+ data.reset_current_errors = 0;
481
+
482
+ if (!response.data.end) {
483
+ $('#wio-total-unoptimized').text(parseInt(response.data.remain));
484
+ self.showMessage(self.i18n.optimization_inprogress.replace("%s", parseInt(response.data.remain)));
485
+ self.sendRequest(data);
486
+ } else {
487
+ $('#wio-total-unoptimized').text(response.data.remain);
488
+ self.complete();
489
+
490
+ // если мультисайт режим, то не скрываем кнопку запуска оптимизации
491
+ /*if( $('#wbcr-rio-current-blog').length ) {
492
+ $('#wio-start-optimization').toggleClass('wio-running');
493
+ } else {
494
+ $('#wio-start-optimization').hide();
495
+ }*/
496
+ }
497
+
498
+ redraw_statistics(response.data.statistic);
499
+
500
+ self.updateLog(response.data.last_optimized);
501
+ }).fail(function (xhr, status, error) {
502
+ console.log(xhr);
503
+ console.log(status);
504
+ console.log(error);
505
+
506
+ self.throwError(error);
507
+ });
508
+ },
509
+
510
+ updateLog: function (new_item_data) {
511
+ var self = this;
512
+
513
+ var limit = 100,
514
+ tableEl = $('.wrio-optimization-progress .wrio-table');
515
+
516
+ if (!tableEl.length || !new_item_data) {
517
+ return;
518
+ }
519
+
520
+ // если таблица была пустая
521
+ if ($('.wrio-table-container-empty').length) {
522
+ $('.wrio-table-container-empty').addClass('wrio-table-container').removeClass('wrio-table-container-empty');
523
+ if (tableEl.find('tbody').length) {
524
+ tableEl.find('tbody').empty();
525
+ }
526
+ }
527
+
528
+ $.each(new_item_data, function (index, value) {
529
+ var trEl = $('<tr>'),
530
+ tdEl = $('<td>'),
531
+ webpSize = value.webp_size ? value.webp_size : '-';
532
+
533
+ if (tableEl.find('.wrio-row-id-' + value.id).length) {
534
+ tableEl.find('.wrio-row-id-' + value.id).remove();
535
+ }
536
+
537
+ trEl.addClass('flash').addClass('wrio-table-item').addClass('wrio-row-id-' + value.id);
538
+
539
+ if ('error' === value.type) {
540
+ trEl.addClass('wrio-error');
541
+ }
542
+
543
+ var preview = $('<img width="40" height="40" src="' + value.thumbnail_url + '" alt="">'),
544
+ previewUrl = $('<a href="' + value.url + '" target="_blank">' + value.file_name + '</a>');
545
+
546
+ tableEl.prepend(trEl);
547
+
548
+ trEl.append(tdEl.clone().append(preview));
549
+ trEl.append(tdEl.clone().append(previewUrl));
550
+
551
+ if ('error' === value.type) {
552
+ var colspan = value.scope !== 'custom-folders' ? '6' : '5';
553
+ trEl.append(tdEl.clone().attr('colspan', colspan).text("Error: " + value.error_msg));
554
+ } else {
555
+ trEl.append(tdEl.clone().text(value.original_size));
556
+ trEl.append(tdEl.clone().text(value.optimized_size));
557
+ trEl.append(tdEl.clone().text(webpSize));
558
+ trEl.append(tdEl.clone().text(value.original_saving));
559
+
560
+ if ("custom-folders" !== self.settings.scope) {
561
+ trEl.append(tdEl.clone().text(value.thumbnails_count));
562
+ }
563
+
564
+ trEl.append(tdEl.clone().text(value.total_saving));
565
+ }
566
+ });
567
+
568
+ if (tableEl.find('tr').length > limit) {
569
+ var diff = tableEl.find('tr').length - limit;
570
+
571
+ for (var i = 0; i < diff; i++) {
572
+ tableEl.find('tr:last').remove();
573
+ }
574
+ }
575
+ }
576
+
577
+ };
578
+
579
+ $(document).ready(function () {
580
+ bulkOptimization.init();
581
+ $('[data-toggle="tooltip"]').tooltip();
582
+ });
583
+
584
+ var ajaxUrl = ajaxurl;
585
+ var ai_data;
586
+
587
+ function redraw_statistics(statistic) {
588
+ $('#wio-main-chart').attr('data-unoptimized', statistic.unoptimized)
589
+ .attr('data-optimized', statistic.optimized)
590
+ .attr('data-errors', statistic.error);
591
+ $('#wio-total-optimized-attachments').text(statistic.optimized); // optimized
592
+ $('#wio-original-size').text(bytesToSize(statistic.original_size));
593
+ $('#wio-optimized-size').text(bytesToSize(statistic.optimized_size));
594
+ $('#wio-total-optimized-attachments-pct').text(statistic.save_size_percent + '%');
595
+ $('#wio-overview-chart-percent').html(statistic.optimized_percent + '<span>%</span>');
596
+ $('.wio-total-percent').text(statistic.optimized_percent + '%');
597
+ $('#wio-optimized-bar').css('width', statistic.percent_line + '%');
598
+
599
+ $('#wio-unoptimized-num').text(statistic.unoptimized);
600
+ $('#wio-optimized-num').text(statistic.optimized);
601
+ $('#wio-error-num').text(statistic.error);
602
+
603
+ var credits = $('.wrio-premium-user-balance');
604
+ if (credits.attr('data-server') !== "server_5") {
605
+ credits.text(statistic.credits);
606
+ }
607
+
608
+ if ($('.wrio-statistic-nav li.active').length) {
609
+ $('.wrio-statistic-nav li.active').find('span.wio-statistic-tab-percent').text(statistic.optimized_percent + '%');
610
+ }
611
+
612
+ window.wio_chart.data.datasets[0].data[0] = statistic.unoptimized; // unoptimized
613
+ window.wio_chart.data.datasets[0].data[1] = statistic.optimized; // optimized
614
+ window.wio_chart.data.datasets[0].data[2] = statistic.error; // errors
615
+ window.wio_chart.update();
616
+ if ($('#wio-overview-chart-percent').text() == '100%') {
617
+ window.onbeforeunload = null;
618
+ }
619
+ }
620
+
621
+ /*$('#wbcr-rio-current-blog').on('change', function() {
622
+ var self = $(this);
623
+ $('#wio-start-msg-complete').hide();
624
+ $(this).attr('disabled', true);
625
+ $('#wio-start-optimization').attr('disabled', true);
626
+ var ai_data = {
627
+ 'action': 'wbcr_rio_update_current_blog',
628
+ 'wpnonce': $(this).data('nonce'),
629
+ 'current_blog_id': $(this).find('option:selected').val(),
630
+ 'context': $(this).attr('data-context')
631
+ };
632
+ $.post(ajaxUrl, ai_data, function(response) {
633
+ self.removeAttr('disabled');
634
+ $('#wio-start-optimization').removeAttr('disabled');
635
+ redraw_statistics(response.data.statistic);
636
+ });
637
+ });*/
638
+
639
+ });
admin/assets/js/index.php CHANGED
@@ -1,2 +1,2 @@
1
- <?php
2
- // silence is golden
1
+ <?php
2
+ // silence is golden
admin/assets/js/meta-migrations.js CHANGED
@@ -1,52 +1,52 @@
1
- jQuery(function($) {
2
- $('#wbcr-wio-meta-migration-action').on('click', function() {
3
-
4
- var data = {
5
- 'action': 'wrio_meta_migrations',
6
- '_wpnonce': $(this).data('nonce'),
7
- };
8
-
9
- $(this).addClass('disabled').text('Please wait...');
10
-
11
- send_request($(this), data);
12
- });
13
-
14
- function send_request(button, data) {
15
- $.post(window.ajaxurl, data, function(response) {
16
-
17
- console.log(response);
18
-
19
- if( !response || !response.data ) {
20
- console.log('An unknown server error has occurred.');
21
- console.log(response);
22
- return false;
23
- }
24
-
25
- if( !response.data.need_more_time ) {
26
- if( button.closest('.notice').length ) {
27
- button.closest('.notice').remove();
28
- }
29
- if( button.closest('.alert').length ) {
30
- button.closest('.alert').remove();
31
- }
32
-
33
- return false;
34
- }
35
-
36
- button.text(response.data.message);
37
-
38
- send_request(button, data);
39
- }).fail(function(xhr, status, error) {
40
- console.log(xhr);
41
- console.log(status);
42
- console.log(error);
43
-
44
- data.limit = 5;
45
- data.error = 1;
46
-
47
- setTimeout(function() {
48
- send_request(button, data);
49
- }, 2000);
50
- });
51
- }
52
- });
1
+ jQuery(function($) {
2
+ $('#wbcr-wio-meta-migration-action').on('click', function() {
3
+
4
+ var data = {
5
+ 'action': 'wrio_meta_migrations',
6
+ '_wpnonce': $(this).data('nonce'),
7
+ };
8
+
9
+ $(this).addClass('disabled').text('Please wait...');
10
+
11
+ send_request($(this), data);
12
+ });
13
+
14
+ function send_request(button, data) {
15
+ $.post(window.ajaxurl, data, function(response) {
16
+
17
+ console.log(response);
18
+
19
+ if( !response || !response.data ) {
20
+ console.log('An unknown server error has occurred.');
21
+ console.log(response);
22
+ return false;
23
+ }
24
+
25
+ if( !response.data.need_more_time ) {
26
+ if( button.closest('.notice').length ) {
27
+ button.closest('.notice').remove();
28
+ }
29
+ if( button.closest('.alert').length ) {
30
+ button.closest('.alert').remove();
31
+ }
32
+
33
+ return false;
34
+ }
35
+
36
+ button.text(response.data.message);
37
+
38
+ send_request(button, data);
39
+ }).fail(function(xhr, status, error) {
40
+ console.log(xhr);
41
+ console.log(status);
42
+ console.log(error);
43
+
44
+ data.limit = 5;
45
+ data.error = 1;
46
+
47
+ setTimeout(function() {
48
+ send_request(button, data);
49
+ }, 2000);
50
+ });
51
+ }
52
+ });
admin/assets/js/modals.js CHANGED
@@ -1,59 +1,59 @@
1
- /**
2
- * A set of tools for creating pop-ups. You can create a popup
3
- * using a global method call.
4
- *
5
- * @author Webcraftic <wordpress.webraftic@gmail.com>
6
- * @copyright (c) 05.04.2019, Webcraftic
7
- * @version 1.0
8
- */
9
-
10
-
11
- (function($) {
12
- 'use strict';
13
-
14
- if( !$.wrio_modal ) {
15
- $.wrio_modal = {};
16
- }
17
-
18
- $.wrio_modal = $.wrio_popup || {
19
-
20
- showErrorModal: function(text) {
21
- if( !text ) {
22
- console.log('[Error]: Text required.');
23
- return;
24
- }
25
-
26
- swal({
27
- title: 'Error',
28
- text: text,
29
- type: 'error',
30
- customClass: 'wrio-modal wrio-modal-error',
31
- width: 500,
32
- confirmButtonText: 'OK',
33
- });
34
- },
35
-
36
- showWarningModal: function(text, callback) {
37
- if( !text ) {
38
- console.log('[Error]: Text required.');
39
- return;
40
- }
41
-
42
- swal({
43
- title: 'Warning',
44
- text: text,
45
- type: 'warning',
46
- customClass: 'wrio-modal wrio-modal-warning',
47
- width: 500,
48
- showCancelButton: true,
49
- showCloseButton: true,
50
- confirmButtonText: 'OK',
51
- }).then(function(result) {
52
- if( callback ) {
53
- callback();
54
- }
55
- }).catch(swal.noop);
56
- },
57
- };
58
-
59
- })(jQuery);
1
+ /**
2
+ * A set of tools for creating pop-ups. You can create a popup
3
+ * using a global method call.
4
+ *
5
+ * @author Webcraftic <wordpress.webraftic@gmail.com>
6
+ * @copyright (c) 05.04.2019, Webcraftic
7
+ * @version 1.0
8
+ */
9
+
10
+
11
+ (function($) {
12
+ 'use strict';
13
+
14
+ if( !$.wrio_modal ) {
15
+ $.wrio_modal = {};
16
+ }
17
+
18
+ $.wrio_modal = $.wrio_popup || {
19
+
20
+ showErrorModal: function(text) {
21
+ if( !text ) {
22
+ console.log('[Error]: Text required.');
23
+ return;
24
+ }
25
+
26
+ swal({
27
+ title: 'Error',
28
+ text: text,
29
+ type: 'error',
30
+ customClass: 'wrio-modal wrio-modal-error',
31
+ width: 500,
32
+ confirmButtonText: 'OK',
33
+ });
34
+ },
35
+
36
+ showWarningModal: function(text, callback) {
37
+ if( !text ) {
38
+ console.log('[Error]: Text required.');
39
+ return;
40
+ }
41
+
42
+ swal({
43
+ title: 'Warning',
44
+ text: text,
45
+ type: 'warning',
46
+ customClass: 'wrio-modal wrio-modal-warning',
47
+ width: 500,
48
+ showCancelButton: true,
49
+ showCloseButton: true,
50
+ confirmButtonText: 'OK',
51
+ }).then(function(result) {
52
+ if( callback ) {
53
+ callback();
54
+ }
55
+ }).catch(swal.noop);
56
+ },
57
+ };
58
+
59
+ })(jQuery);
admin/assets/js/restore-backup.js CHANGED
@@ -1,162 +1,162 @@
1
- jQuery(function($){
2
- var ajaxUrl = ajaxurl;
3
-
4
- $('#wio-restore-backup-btn').on('click', function() {
5
- if ( $('#wio-multisite-mode').length ) {
6
- $('#wio-multisite-mode').toggle();
7
- $('#wio-multisite-confirm').attr('data-action', 'restore');
8
- $('#wio-multisite-restore-progress').empty();
9
- return false;
10
- }
11
- result = confirm( $(this).attr('data-confirm') );
12
- if ( ! result ) {
13
- return false;
14
- }
15
- $(this).hide();
16
- $('#wio-restore-backup-progress').show();
17
- var ai_data = {
18
- 'total' : '?',
19
- 'action': 'wio_restore_backup',
20
- '_wpnonce': $('#wio-iph-nonce').val()
21
- };
22
- send_post_data(ai_data);
23
- return false;
24
- });
25
-
26
- $('#wio-clear-backup-btn').on('click', function() {
27
- $('#wio-restore-backup-msg').hide();
28
- if ( $('#wio-multisite-mode').length ) {
29
- $('#wio-multisite-mode').toggle();
30
- $('#wio-multisite-confirm').attr('data-action', 'clear');
31
- $('#wio-multisite-restore-progress').empty();
32
- return false;
33
- }
34
- result = confirm( $(this).attr('data-confirm') );
35
- if ( ! result ) {
36
- return false;
37
- }
38
- var data = {
39
- 'action': 'wio_clear_backup',
40
- '_wpnonce': $('#wio-iph-nonce').val()
41
- };
42
- $.post(ajaxUrl, data, function(response) {
43
- $('#wio-clear-backup-msg').show();
44
- });
45
- });
46
-
47
- $('#wio-multisite-confirm').on('click', function() {
48
- var action = $(this).attr('data-action');
49
- // если запущена очистка резервных копий
50
- if ( action == 'clear' ) {
51
- result = confirm( $('#wio-clear-backup-btn').attr('data-confirm') ); // берём сообщение из основной кнопки
52
- if ( ! result ) {
53
- return false;
54
- }
55
- var blogs = [];
56
- $('.wbcr_io_multisite_blogs:checked').each(function() {
57
- blogs.push( $(this).val() );
58
- });
59
- var data = {
60
- 'action': 'wio_clear_backup',
61
- '_wpnonce': $('#wio-iph-nonce').val(),
62
- 'blogs': blogs
63
- };
64
-
65
- $.post(ajaxUrl, data, function(response) {
66
- $('#wio-clear-backup-msg').show();
67
- $('#wio-multisite-mode').toggle();
68
- });
69
- return false;
70
- }
71
-
72
- // если запущено восстановление из резервных копий
73
- if ( action == 'restore' ) {
74
- result = confirm( $('#wio-restore-backup-btn').attr('data-confirm') ); // берём сообщение из основной кнопки
75
- if ( ! result ) {
76
- return false;
77
- }
78
- $('#wio-multisite-mode').toggle();
79
- $('#wio-multisite-restore-progress').empty();
80
- $('.wbcr_io_multisite_blogs:checked').each(function() {
81
- $('#wio-multisite-restore-progress').append('\
82
- <label>'+$(this).attr('data-name')+'</label>\
83
- <div class="progress">\
84
- <div id="wio-restore-backup-progress-'+$(this).val()+'" class="wio-restore-backup-progressbar progress-bar progress-bar-success" data-id="'+$(this).val()+'" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:0%">\
85
- </div>\
86
- </div>\
87
- ');
88
- });
89
- $('#wio-multisite-restore-progress').show();
90
- if ( ! $('.wio-restore-backup-progressbar').length ) {
91
- $('#wio-restore-backup-msg').show();
92
- return false;
93
- }
94
- var ai_data = {
95
- 'total' : '?',
96
- 'action': 'wio_restore_backup',
97
- '_wpnonce': $('#wio-iph-nonce').val(),
98
- 'blog_id': $('.wio-restore-backup-progressbar:eq(0)').attr('data-id')
99
- };
100
- send_multisite_post_data(ai_data);
101
- return false;
102
- }
103
- });
104
-
105
- $('#wbcr_io_multisite_blog_all').on('change', function() {
106
- if ( $(this).attr('checked') == 'checked' ) {
107
- $('.wbcr_io_multisite_blogs').attr('checked', true);
108
- } else {
109
- $('.wbcr_io_multisite_blogs').removeAttr('checked');
110
- }
111
- });
112
-
113
- $('.wbcr_io_multisite_blogs').on('change', function() {
114
- var all_checked = true;
115
- $('.wbcr_io_multisite_blogs').each(function() {
116
- if ( $(this).attr('checked') != 'checked' ) {
117
- all_checked = false;
118
- }
119
- });
120
- if ( all_checked ) {
121
- $('#wbcr_io_multisite_blog_all').attr('checked', true);
122
- } else {
123
- $('#wbcr_io_multisite_blog_all').removeAttr('checked');
124
- }
125
- });
126
-
127
- function send_post_data(data){
128
- $.post(ajaxUrl, data, function(response) {
129
- if ( ! response.end ) {
130
- data.total = response.total;
131
- send_post_data(data);
132
- $('#wio-restore-backup-progress').find('.progress-bar').css( 'width', response.percent + '%' );
133
- } else {
134
- $('#wio-restore-backup-progress').find('.progress-bar').css( 'width', '100%' );
135
- $('#wio-restore-backup-msg').show();
136
- }
137
- });
138
- }
139
-
140
- function send_multisite_post_data(data){
141
- $.post(ajaxUrl, data, function(response) {
142
- if ( ! response.end ) {
143
- data.total = response.total;
144
- send_multisite_post_data(data);
145
- $('#wio-restore-backup-progress-' + data.blog_id).css( 'width', response.percent + '%' );
146
- } else {
147
- $('#wio-restore-backup-progress-' + data.blog_id).css( 'width', '100%' ).removeClass('wio-restore-backup-progressbar');
148
- if ( $('.wio-restore-backup-progressbar').length ) {
149
- var ai_data = {
150
- 'total' : '?',
151
- 'action': 'wio_restore_backup',
152
- '_wpnonce': $('#wio-iph-nonce').val(),
153
- 'blog_id': $('.wio-restore-backup-progressbar:eq(0)').attr('data-id')
154
- };
155
- send_multisite_post_data(ai_data);
156
- } else {
157
- $('#wio-restore-backup-msg').show();
158
- }
159
- }
160
- });
161
- }
162
- });
1
+ jQuery(function($){
2
+ var ajaxUrl = ajaxurl;
3
+
4
+ $('#wio-restore-backup-btn').on('click', function() {
5
+ if ( $('#wio-multisite-mode').length ) {
6
+ $('#wio-multisite-mode').toggle();
7
+ $('#wio-multisite-confirm').attr('data-action', 'restore');
8
+ $('#wio-multisite-restore-progress').empty();
9
+ return false;
10
+ }
11
+ result = confirm( $(this).attr('data-confirm') );
12
+ if ( ! result ) {
13
+ return false;
14
+ }
15
+ $(this).hide();
16
+ $('#wio-restore-backup-progress').show();
17
+ var ai_data = {
18
+ 'total' : '?',
19
+ 'action': 'wio_restore_backup',
20
+ '_wpnonce': $('#wio-iph-nonce').val()
21
+ };
22
+ send_post_data(ai_data);
23
+ return false;
24
+ });
25
+
26
+ $('#wio-clear-backup-btn').on('click', function() {
27
+ $('#wio-restore-backup-msg').hide();
28
+ if ( $('#wio-multisite-mode').length ) {
29
+ $('#wio-multisite-mode').toggle();
30
+ $('#wio-multisite-confirm').attr('data-action', 'clear');
31
+ $('#wio-multisite-restore-progress').empty();
32
+ return false;
33
+ }
34
+ result = confirm( $(this).attr('data-confirm') );
35
+ if ( ! result ) {
36
+ return false;
37
+ }
38
+ var data = {
39
+ 'action': 'wio_clear_backup',
40
+ '_wpnonce': $('#wio-iph-nonce').val()
41
+ };
42
+ $.post(ajaxUrl, data, function(response) {
43
+ $('#wio-clear-backup-msg').show();
44
+ });
45
+ });
46
+
47
+ $('#wio-multisite-confirm').on('click', function() {
48
+ var action = $(this).attr('data-action');
49
+ // если запущена очистка резервных копий
50
+ if ( action == 'clear' ) {
51
+ result = confirm( $('#wio-clear-backup-btn').attr('data-confirm') ); // берём сообщение из основной кнопки
52
+ if ( ! result ) {
53
+ return false;
54
+ }
55
+ var blogs = [];
56
+ $('.wbcr_io_multisite_blogs:checked').each(function() {
57
+ blogs.push( $(this).val() );
58
+ });
59
+ var data = {
60
+ 'action': 'wio_clear_backup',
61
+ '_wpnonce': $('#wio-iph-nonce').val(),
62
+ 'blogs': blogs
63
+ };
64
+
65
+ $.post(ajaxUrl, data, function(response) {
66
+ $('#wio-clear-backup-msg').show();
67
+ $('#wio-multisite-mode').toggle();
68
+ });
69
+ return false;
70
+ }
71
+
72
+ // если запущено восстановление из резервных копий
73
+ if ( action == 'restore' ) {
74
+ result = confirm( $('#wio-restore-backup-btn').attr('data-confirm') ); // берём сообщение из основной кнопки
75
+ if ( ! result ) {
76
+ return false;
77
+ }
78
+ $('#wio-multisite-mode').toggle();
79
+ $('#wio-multisite-restore-progress').empty();
80
+ $('.wbcr_io_multisite_blogs:checked').each(function() {
81
+ $('#wio-multisite-restore-progress').append('\
82
+ <label>'+$(this).attr('data-name')+'</label>\
83
+ <div class="progress">\
84
+ <div id="wio-restore-backup-progress-'+$(this).val()+'" class="wio-restore-backup-progressbar progress-bar progress-bar-success" data-id="'+$(this).val()+'" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:0%">\
85
+ </div>\
86
+ </div>\
87
+ ');
88
+ });
89
+ $('#wio-multisite-restore-progress').show();
90
+ if ( ! $('.wio-restore-backup-progressbar').length ) {
91
+ $('#wio-restore-backup-msg').show();
92
+ return false;
93
+ }
94
+ var ai_data = {
95
+ 'total' : '?',
96
+ 'action': 'wio_restore_backup',
97
+ '_wpnonce': $('#wio-iph-nonce').val(),
98
+ 'blog_id': $('.wio-restore-backup-progressbar:eq(0)').attr('data-id')
99
+ };
100
+ send_multisite_post_data(ai_data);
101
+ return false;
102
+ }
103
+ });
104
+
105
+ $('#wbcr_io_multisite_blog_all').on('change', function() {
106
+ if ( $(this).attr('checked') == 'checked' ) {
107
+ $('.wbcr_io_multisite_blogs').attr('checked', true);
108
+ } else {
109
+ $('.wbcr_io_multisite_blogs').removeAttr('checked');
110
+ }
111
+ });
112
+
113
+ $('.wbcr_io_multisite_blogs').on('change', function() {
114
+ var all_checked = true;
115
+ $('.wbcr_io_multisite_blogs').each(function() {
116
+ if ( $(this).attr('checked') != 'checked' ) {
117
+ all_checked = false;
118
+ }
119
+ });
120
+ if ( all_checked ) {
121
+ $('#wbcr_io_multisite_blog_all').attr('checked', true);
122
+ } else {
123
+ $('#wbcr_io_multisite_blog_all').removeAttr('checked');
124
+ }
125
+ });
126
+
127
+ function send_post_data(data){
128
+ $.post(ajaxUrl, data, function(response) {
129
+ if ( ! response.end ) {
130
+ data.total = response.total;
131
+ send_post_data(data);
132
+ $('#wio-restore-backup-progress').find('.progress-bar').css( 'width', response.percent + '%' );
133
+ } else {
134
+ $('#wio-restore-backup-progress').find('.progress-bar').css( 'width', '100%' );
135
+ $('#wio-restore-backup-msg').show();
136
+ }
137
+ });
138
+ }
139
+
140
+ function send_multisite_post_data(data){
141
+ $.post(ajaxUrl, data, function(response) {
142
+ if ( ! response.end ) {
143
+ data.total = response.total;
144
+ send_multisite_post_data(data);
145
+ $('#wio-restore-backup-progress-' + data.blog_id).css( 'width', response.percent + '%' );
146
+ } else {
147
+ $('#wio-restore-backup-progress-' + data.blog_id).css( 'width', '100%' ).removeClass('wio-restore-backup-progressbar');
148
+ if ( $('.wio-restore-backup-progressbar').length ) {
149
+ var ai_data = {
150
+ 'total' : '?',
151
+ 'action': 'wio_restore_backup',
152
+ '_wpnonce': $('#wio-iph-nonce').val(),
153
+ 'blog_id': $('.wio-restore-backup-progressbar:eq(0)').attr('data-id')
154
+ };
155
+ send_multisite_post_data(ai_data);
156
+ } else {
157
+ $('#wio-restore-backup-msg').show();
158
+ }
159
+ }
160
+ });
161
+ }
162
+ });
admin/assets/js/settings-premium.js CHANGED
@@ -1,2 +1,2 @@
1
- jQuery('button[data-value="googlepage"]').attr('disabled', 'disabled');
2
- jQuery('button[data-value="background"]').attr('disabled', 'disabled');
1
+ jQuery('button[data-value="googlepage"]').attr('disabled', 'disabled');
2
+ jQuery('button[data-value="background"]').attr('disabled', 'disabled');
admin/assets/js/single-optimization.js CHANGED
@@ -1,64 +1,101 @@
1
- jQuery(function($) {
2
- var ajaxUrl = ajaxurl;
3
-
4
- $(document).on('click', '.wio-reoptimize', function() {
5
- var ai_data = {
6
- 'action' : $(this).attr('data-action'),
7
- 'id' : $(this).attr('data-id'),
8
- 'level' : $(this).attr('data-level')
9
- };
10
- var td = $(this).closest('td');
11
- var msg = $(this).attr( 'data-waiting-label' );
12
- td.html('<p>'+msg+'</p>');
13
- wio_reoptimize( ai_data, td );
14
- return false;
15
- });
16
-
17
- function wio_reoptimize( ai_data, td ) {
18
- $.post(ajaxUrl, ai_data, function(response) {
19
- if ( response === 'processing' ) {
20
- wio_reoptimize( ai_data, td );
21
- return false;
22
- }
23
- td.html(response);
24
- var btn = $('.wio-reoptimize').first();
25
-
26
- if ( btn.closest('.media-frame-content').length ) {
27
- if ( btn.closest('table').find('.wio-datas-list').length ) {
28
- var diminsionName = $('.dimensions').find('strong').clone();
29
- var fileSizeName = $('.file-size').find('strong').clone();
30
- var diminsionSize = btn.closest('table').find('.wio-datas-list').data('dimensions');
31
- var fileSize = btn.closest('table').find('.wio-datas-list').data('size');
32
- $('.dimensions').html(diminsionName.get(0).outerHTML + ' ' + diminsionSize);
33
- $('.file-size').html(fileSizeName.get(0).outerHTML + ' ' + fileSize);
34
- }
35
- }
36
- });
37
- }
38
-
39
- $(document).on('click', '.button-wio-restore', function() {
40
- var ai_data = {
41
- 'action' : $(this).attr('data-action'),
42
- 'id' : $(this).attr('data-id')
43
- };
44
- var td = $(this).closest('td');
45
- var msg = $(this).attr( 'data-waiting-label' );
46
- td.html('<p>'+msg+'</p>');
47
- $.post(ajaxUrl, ai_data, function(response) {
48
- td.html(response);
49
- var btn = $('.wio-reoptimize');
50
- if ( btn.closest('.media-frame-content').length ) {
51
- if ( btn.length ) {
52
- btn = btn.first();
53
- var diminsionName = $('.dimensions').find('strong').clone();
54
- var fileSizeName = $('.file-size').find('strong').clone();
55
- var diminsionSize = btn.data('dimensions');
56
- var fileSize = btn.data('size');
57
- $('.dimensions').html(diminsionName.get(0).outerHTML + ' ' + diminsionSize);
58
- $('.file-size').html(fileSizeName.get(0).outerHTML + ' ' + fileSize);
59
- }
60
- }
61
- });
62
- return false;
63
- });
64
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(function($) {
2
+ var ajaxUrl = ajaxurl;
3
+
4
+ $(document).on('click', '.wio-reoptimize', function() {
5
+ var ai_data = {
6
+ 'action' : $(this).attr('data-action'),
7
+ 'id' : $(this).attr('data-id'),
8
+ 'level' : $(this).attr('data-level'),
9
+ '_wpnonce' : $(this).attr('data-nonce')
10
+ };
11
+ var td = $(this).closest('td');
12
+ var msg = $(this).attr( 'data-waiting-label' );
13
+ td.html('<p>'+msg+'</p>');
14
+ wio_reoptimize( ai_data, td );
15
+ return false;
16
+ });
17
+
18
+ $(document).on('click', '.wio-convert', function() {
19
+ var ai_data = {
20
+ 'action' : $(this).attr('data-action'),
21
+ 'id' : $(this).attr('data-id'),
22
+ '_wpnonce' : $(this).attr('data-nonce')
23
+ };
24
+ var td = $(this).closest('td');
25
+ var msg = $(this).attr( 'data-waiting-label' );
26
+ td.html('<p>'+msg+'</p>');
27
+ wio_convert( ai_data, td );
28
+ return false;
29
+ });
30
+
31
+ function wio_reoptimize( ai_data, td ) {
32
+ $.post(ajaxUrl, ai_data, function(response) {
33
+ if ( response === 'processing' ) {
34
+ wio_reoptimize( ai_data, td );
35
+ return false;
36
+ }
37
+ td.html(response);
38
+ var btn = $('.wio-reoptimize').first();
39
+
40
+ if ( btn.closest('.media-frame-content').length ) {
41
+ if ( btn.closest('table').find('.wio-datas-list').length ) {
42
+ var diminsionName = $('.dimensions').find('strong').clone();
43
+ var fileSizeName = $('.file-size').find('strong').clone();
44
+ var diminsionSize = btn.closest('table').find('.wio-datas-list').data('dimensions');
45
+ var fileSize = btn.closest('table').find('.wio-datas-list').data('size');
46
+ $('.dimensions').html(diminsionName.get(0).outerHTML + ' ' + diminsionSize);
47
+ $('.file-size').html(fileSizeName.get(0).outerHTML + ' ' + fileSize);
48
+ }
49
+ }
50
+ });
51
+ }
52
+
53
+ function wio_convert( ai_data, td ) {
54
+ $.post(ajaxUrl, ai_data, function(response) {
55
+ if ( response === 'processing' ) {
56
+ wio_convert( ai_data, td );
57
+ return false;
58
+ }
59
+ td.html(response);
60
+ var btn = $('.wio-convert').first();
61
+
62
+ if ( btn.closest('.media-frame-content').length ) {
63
+ if ( btn.closest('table').find('.wio-datas-list').length ) {
64
+ var diminsionName = $('.dimensions').find('strong').clone();
65
+ var fileSizeName = $('.file-size').find('strong').clone();
66
+ var diminsionSize = btn.closest('table').find('.wio-datas-list').data('dimensions');
67
+ var fileSize = btn.closest('table').find('.wio-datas-list').data('size');
68
+ $('.dimensions').html(diminsionName.get(0).outerHTML + ' ' + diminsionSize);
69
+ $('.file-size').html(fileSizeName.get(0).outerHTML + ' ' + fileSize);
70
+ }
71
+ }
72
+ });
73
+ }
74
+
75
+ $(document).on('click', '.button-wio-restore', function() {
76
+ var ai_data = {
77
+ 'action' : $(this).attr('data-action'),
78
+ 'id' : $(this).attr('data-id'),
79
+ '_wpnonce' : $(this).attr('data-nonce')
80
+ };
81
+ var td = $(this).closest('td');
82
+ var msg = $(this).attr( 'data-waiting-label' );
83
+ td.html('<p>'+msg+'</p>');
84
+ $.post(ajaxUrl, ai_data, function(response) {
85
+ td.html(response);
86
+ var btn = $('.wio-reoptimize');
87
+ if ( btn.closest('.media-frame-content').length ) {
88
+ if ( btn.length ) {
89
+ btn = btn.first();
90
+ var diminsionName = $('.dimensions').find('strong').clone();
91
+ var fileSizeName = $('.file-size').find('strong').clone();
92
+ var diminsionSize = btn.data('dimensions');
93
+ var fileSize = btn.data('size');
94
+ $('.dimensions').html(diminsionName.get(0).outerHTML + ' ' + diminsionSize);
95
+ $('.file-size').html(fileSizeName.get(0).outerHTML + ' ' + fileSize);
96
+ }
97
+ }
98
+ });
99
+ return false;
100
+ });
101
+ });
admin/assets/js/statistic.js CHANGED
@@ -1,38 +1,76 @@
1
- jQuery(function($) {
2
-
3
- var chat_html_id = 'wio-main-chart';
4
- var ctx = document.getElementById(chat_html_id);
5
-
6
- window.wio_chart = new window.robin.Chart(ctx, {
7
- type: 'doughnut',
8
- data: {
9
- datasets: [
10
- {
11
- data: [
12
- $('#' + chat_html_id).attr('data-unoptimized'),
13
- $('#' + chat_html_id).attr('data-optimized'),
14
- $('#' + chat_html_id).attr('data-errors'),
15
- ],
16
- backgroundColor: [
17
- '#d6d6d6',
18
- '#8bc34a',
19
- '#f1b1b6',
20
- ],
21
- borderWidth: 0,
22
- label: 'Dataset 1'
23
- }
24
- ]
25
- },
26
- options: {
27
- legend: {
28
- display: false
29
- },
30
- events: [],
31
- animation: {
32
- easing: 'easeOutBounce'
33
- },
34
- responsive: false,
35
- cutoutPercentage: 80
36
- }
37
- });
38
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(function ($) {
2
+
3
+ var chart_html_id = 'wio-main-chart';
4
+ var webp_chart_html_id = 'wio-webp-chart';
5
+
6
+ var ctx = document.getElementById(chart_html_id);
7
+ var ctx_webp = document.getElementById(webp_chart_html_id);
8
+
9
+ window.wio_chart = new window.robin.Chart(ctx, {
10
+ type: 'doughnut',
11
+ data: {
12
+ datasets: [
13
+ {
14
+ data: [
15
+ $('#' + chart_html_id).attr('data-unoptimized'),
16
+ $('#' + chart_html_id).attr('data-optimized'),
17
+ $('#' + chart_html_id).attr('data-errors'),
18
+ ],
19
+ backgroundColor: [
20
+ '#d6d6d6',
21
+ '#8bc34a',
22
+ '#f1b1b6',
23
+ ],
24
+ borderWidth: 0,
25
+ label: 'Dataset 1'
26
+ }
27
+ ]
28
+ },
29
+ options: {
30
+ legend: {
31
+ display: false
32
+ },
33
+ events: [],
34
+ animation: {
35
+ easing: 'easeOutBounce'
36
+ },
37
+ responsive: false,
38
+ cutoutPercentage: 80
39
+ }
40
+ });
41
+
42
+ if (ctx_webp) {
43
+ window.wio_chart_webp = new window.robin.Chart(ctx_webp, {
44
+ type: 'doughnut',
45
+ data: {
46
+ datasets: [
47
+ {
48
+ data: [
49
+ $('#' + webp_chart_html_id).attr('data-unoptimized'),
50
+ $('#' + webp_chart_html_id).attr('data-optimized'),
51
+ $('#' + webp_chart_html_id).attr('data-errors'),
52
+ ],
53
+ backgroundColor: [
54
+ '#d6d6d6',
55
+ '#8bc34a',
56
+ '#f1b1b6',
57
+ ],
58
+ borderWidth: 0,
59
+ label: 'Dataset 1'
60
+ }
61
+ ]
62
+ },
63
+ options: {
64
+ legend: {
65
+ display: false
66
+ },
67
+ events: [],
68
+ animation: {
69
+ easing: 'easeOutBounce'
70
+ },
71
+ responsive: false,
72
+ cutoutPercentage: 80
73
+ }
74
+ });
75
+ }
76
+ });
admin/assets/js/sweetalert2.js CHANGED
@@ -1,1641 +1,1641 @@
1
- /*!
2
- * sweetalert2 v6.6.6
3
- * Released under the MIT License.
4
- */
5
- (function (global, factory) {
6
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
7
- typeof define === 'function' && define.amd ? define(factory) :
8
- (global.Sweetalert2 = factory());
9
- }(this, (function () { 'use strict';
10
-
11
- var defaultParams = {
12
- title: '',
13
- titleText: '',
14
- text: '',
15
- html: '',
16
- type: null,
17
- customClass: '',
18
- target: 'body',
19
- animation: true,
20
- allowOutsideClick: true,
21
- allowEscapeKey: true,
22
- allowEnterKey: true,
23
- showConfirmButton: true,
24
- showCancelButton: false,
25
- preConfirm: null,
26
- confirmButtonText: 'OK',
27
- confirmButtonColor: '#3085d6',
28
- confirmButtonClass: null,
29
- cancelButtonText: 'Cancel',
30
- cancelButtonColor: '#aaa',
31
- cancelButtonClass: null,
32
- buttonsStyling: true,
33
- reverseButtons: false,
34
- focusCancel: false,
35
- showCloseButton: false,
36
- showLoaderOnConfirm: false,
37
- imageUrl: null,
38
- imageWidth: null,
39
- imageHeight: null,
40
- imageClass: null,
41
- timer: null,
42
- width: 500,
43
- padding: 20,
44
- background: '#fff',
45
- input: null,
46
- inputPlaceholder: '',
47
- inputValue: '',
48
- inputOptions: {},
49
- inputAutoTrim: true,
50
- inputClass: null,
51
- inputAttributes: {},
52
- inputValidator: null,
53
- progressSteps: [],
54
- currentProgressStep: null,
55
- progressStepsDistance: '40px',
56
- onOpen: null,
57
- onClose: null,
58
- useRejections: true
59
- };
60
-
61
- var swalPrefix = 'swal2-';
62
-
63
- var prefix = function prefix(items) {
64
- var result = {};
65
- for (var i in items) {
66
- result[items[i]] = swalPrefix + items[i];
67
- }
68
- return result;
69
- };
70
-
71
- var swalClasses = prefix(['container', 'shown', 'iosfix', 'modal', 'overlay', 'fade', 'show', 'hide', 'noanimation', 'close', 'title', 'content', 'buttonswrapper', 'confirm', 'cancel', 'icon', 'image', 'input', 'file', 'range', 'select', 'radio', 'checkbox', 'textarea', 'inputerror', 'validationerror', 'progresssteps', 'activeprogressstep', 'progresscircle', 'progressline', 'loading', 'styled']);
72
-
73
- var iconTypes = prefix(['success', 'warning', 'info', 'question', 'error']);
74
-
75
- /*
76
- * Set hover, active and focus-states for buttons (source: http://www.sitepoint.com/javascript-generate-lighter-darker-color)
77
- */
78
- var colorLuminance = function colorLuminance(hex, lum) {
79
- // Validate hex string
80
- hex = String(hex).replace(/[^0-9a-f]/gi, '');
81
- if (hex.length < 6) {
82
- hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
83
- }
84
- lum = lum || 0;
85
-
86
- // Convert to decimal and change luminosity
87
- var rgb = '#';
88
- for (var i = 0; i < 3; i++) {
89
- var c = parseInt(hex.substr(i * 2, 2), 16);
90
- c = Math.round(Math.min(Math.max(0, c + c * lum), 255)).toString(16);
91
- rgb += ('00' + c).substr(c.length);
92
- }
93
-
94
- return rgb;
95
- };
96
-
97
- var uniqueArray = function uniqueArray(arr) {
98
- var result = [];
99
- for (var i in arr) {
100
- if (result.indexOf(arr[i]) === -1) {
101
- result.push(arr[i]);
102
- }
103
- }
104
- return result;
105
- };
106
-
107
- /* global MouseEvent */
108
-
109
- // Remember state in cases where opening and handling a modal will fiddle with it.
110
- var states = {
111
- previousWindowKeyDown: null,
112
- previousActiveElement: null,
113
- previousBodyPadding: null
114
-
115
- /*
116
- * Add modal + overlay to DOM
117
- */
118
- };var init = function init(params) {
119
- if (typeof document === 'undefined') {
120
- console.error('SweetAlert2 requires document to initialize');
121
- return;
122
- }
123
-
124
- var container = document.createElement('div');
125
- container.className = swalClasses.container;
126
- container.innerHTML = sweetHTML;
127
-
128
- var targetElement = document.querySelector(params.target);
129
- if (!targetElement) {
130
- console.warn('SweetAlert2: Can\'t find the target "' + params.target + '"');
131
- targetElement = document.body;
132
- }
133
- targetElement.appendChild(container);
134
-
135
- var modal = getModal();
136
- var input = getChildByClass(modal, swalClasses.input);
137
- var file = getChildByClass(modal, swalClasses.file);
138
- var range = modal.querySelector('.' + swalClasses.range + ' input');
139
- var rangeOutput = modal.querySelector('.' + swalClasses.range + ' output');
140
- var select = getChildByClass(modal, swalClasses.select);
141
- var checkbox = modal.querySelector('.' + swalClasses.checkbox + ' input');
142
- var textarea = getChildByClass(modal, swalClasses.textarea);
143
-
144
- input.oninput = function () {
145
- sweetAlert.resetValidationError();
146
- };
147
-
148
- input.onkeydown = function (event) {
149
- setTimeout(function () {
150
- if (event.keyCode === 13 && params.allowEnterKey) {
151
- event.stopPropagation();
152
- sweetAlert.clickConfirm();
153
- }
154
- }, 0);
155
- };
156
-
157
- file.onchange = function () {
158
- sweetAlert.resetValidationError();
159
- };
160
-
161
- range.oninput = function () {
162
- sweetAlert.resetValidationError();
163
- rangeOutput.value = range.value;
164
- };
165
-
166
- range.onchange = function () {
167
- sweetAlert.resetValidationError();
168
- range.previousSibling.value = range.value;
169
- };
170
-
171
- select.onchange = function () {
172
- sweetAlert.resetValidationError();
173
- };
174
-
175
- checkbox.onchange = function () {
176
- sweetAlert.resetValidationError();
177
- };
178
-
179
- textarea.oninput = function () {
180
- sweetAlert.resetValidationError();
181
- };
182
-
183
- return modal;
184
- };
185
-
186
- /*
187
- * Manipulate DOM
188
- */
189
-
190
- var sweetHTML = ('\n <div role="dialog" aria-labelledby="' + swalClasses.title + '" aria-describedby="' + swalClasses.content + '" class="' + swalClasses.modal + '" tabindex="-1">\n <ul class="' + swalClasses.progresssteps + '"></ul>\n <div class="' + swalClasses.icon + ' ' + iconTypes.error + '">\n <span class="swal2-x-mark"><span class="swal2-x-mark-line-left"></span><span class="swal2-x-mark-line-right"></span></span>\n </div>\n <div class="' + swalClasses.icon + ' ' + iconTypes.question + '">?</div>\n <div class="' + swalClasses.icon + ' ' + iconTypes.warning + '">!</div>\n <div class="' + swalClasses.icon + ' ' + iconTypes.info + '">i</div>\n <div class="' + swalClasses.icon + ' ' + iconTypes.success + '">\n <div class="swal2-success-circular-line-left"></div>\n <span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>\n <div class="swal2-success-ring"></div> <div class="swal2-success-fix"></div>\n <div class="swal2-success-circular-line-right"></div>\n </div>\n <img class="' + swalClasses.image + '" />\n <h2 class="' + swalClasses.title + '" id="' + swalClasses.title + '"></h2>\n <div id="' + swalClasses.content + '" class="' + swalClasses.content + '"></div>\n <input class="' + swalClasses.input + '" />\n <input type="file" class="' + swalClasses.file + '" />\n <div class="' + swalClasses.range + '">\n <output></output>\n <input type="range" />\n </div>\n <select class="' + swalClasses.select + '"></select>\n <div class="' + swalClasses.radio + '"></div>\n <label for="' + swalClasses.checkbox + '" class="' + swalClasses.checkbox + '">\n <input type="checkbox" />\n </label>\n <textarea class="' + swalClasses.textarea + '"></textarea>\n <div class="' + swalClasses.validationerror + '"></div>\n <div class="' + swalClasses.buttonswrapper + '">\n <button type="button" class="' + swalClasses.confirm + '">OK</button>\n <button type="button" class="' + swalClasses.cancel + '">Cancel</button>\n </div>\n <button type="button" class="' + swalClasses.close + '" aria-label="Close this dialog">\xD7</button>\n </div>\n').replace(/(^|\n)\s*/g, '');
191
-
192
- var getContainer = function getContainer() {
193
- return document.body.querySelector('.' + swalClasses.container);
194
- };
195
-
196
- var getModal = function getModal() {
197
- return getContainer() ? getContainer().querySelector('.' + swalClasses.modal) : null;
198
- };
199
-
200
- var getIcons = function getIcons() {
201
- var modal = getModal();
202
- return modal.querySelectorAll('.' + swalClasses.icon);
203
- };
204
-
205
- var elementByClass = function elementByClass(className) {
206
- return getContainer() ? getContainer().querySelector('.' + className) : null;
207
- };
208
-
209
- var getTitle = function getTitle() {
210
- return elementByClass(swalClasses.title);
211
- };
212
-
213
- var getContent = function getContent() {
214
- return elementByClass(swalClasses.content);
215
- };
216
-
217
- var getImage = function getImage() {
218
- return elementByClass(swalClasses.image);
219
- };
220
-
221
- var getButtonsWrapper = function getButtonsWrapper() {
222
- return elementByClass(swalClasses.buttonswrapper);
223
- };
224
-
225
- var getProgressSteps = function getProgressSteps() {
226
- return elementByClass(swalClasses.progresssteps);
227
- };
228
-
229
- var getValidationError = function getValidationError() {
230
- return elementByClass(swalClasses.validationerror);
231
- };
232
-
233
- var getConfirmButton = function getConfirmButton() {
234
- return elementByClass(swalClasses.confirm);
235
- };
236
-
237
- var getCancelButton = function getCancelButton() {
238
- return elementByClass(swalClasses.cancel);
239
- };
240
-
241
- var getCloseButton = function getCloseButton() {
242
- return elementByClass(swalClasses.close);
243
- };
244
-
245
- var getFocusableElements = function getFocusableElements(focusCancel) {
246
- var buttons = [getConfirmButton(), getCancelButton()];
247
- if (focusCancel) {
248
- buttons.reverse();
249
- }
250
- var focusableElements = buttons.concat(Array.prototype.slice.call(getModal().querySelectorAll('button, input:not([type=hidden]), textarea, select, a, *[tabindex]:not([tabindex="-1"])')));
251
- return uniqueArray(focusableElements);
252
- };
253
-
254
- var hasClass = function hasClass(elem, className) {
255
- if (elem.classList) {
256
- return elem.classList.contains(className);
257
- }
258
- return false;
259
- };
260
-
261
- var focusInput = function focusInput(input) {
262
- input.focus();
263
-
264
- // place cursor at end of text in text input
265
- if (input.type !== 'file') {
266
- // http://stackoverflow.com/a/2345915/1331425
267
- var val = input.value;
268
- input.value = '';
269
- input.value = val;
270
- }
271
- };
272
-
273
- var addClass = function addClass(elem, className) {
274
- if (!elem || !className) {
275
- return;
276
- }
277
- var classes = className.split(/\s+/).filter(Boolean);
278
- classes.forEach(function (className) {
279
- elem.classList.add(className);
280
- });
281
- };
282
-
283
- var removeClass = function removeClass(elem, className) {
284
- if (!elem || !className) {
285
- return;
286
- }
287
- var classes = className.split(/\s+/).filter(Boolean);
288
- classes.forEach(function (className) {
289
- elem.classList.remove(className);
290
- });
291
- };
292
-
293
- var getChildByClass = function getChildByClass(elem, className) {
294
- for (var i = 0; i < elem.childNodes.length; i++) {
295
- if (hasClass(elem.childNodes[i], className)) {
296
- return elem.childNodes[i];
297
- }
298
- }
299
- };
300
-
301
- var show = function show(elem, display) {
302
- if (!display) {
303
- display = 'block';
304
- }
305
- elem.style.opacity = '';
306
- elem.style.display = display;
307
- };
308
-
309
- var hide = function hide(elem) {
310
- elem.style.opacity = '';
311
- elem.style.display = 'none';
312
- };
313
-
314
- var empty = function empty(elem) {
315
- while (elem.firstChild) {
316
- elem.removeChild(elem.firstChild);
317
- }
318
- };
319
-
320
- // borrowed from jqeury $(elem).is(':visible') implementation
321
- var isVisible = function isVisible(elem) {
322
- return elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length;
323
- };
324
-
325
- var removeStyleProperty = function removeStyleProperty(elem, property) {
326
- if (elem.style.removeProperty) {
327
- elem.style.removeProperty(property);
328
- } else {
329
- elem.style.removeAttribute(property);
330
- }
331
- };
332
-
333
- var fireClick = function fireClick(node) {
334
- if (!isVisible(node)) {
335
- return false;
336
- }
337
-
338
- // Taken from http://www.nonobtrusive.com/2011/11/29/programatically-fire-crossbrowser-click-event-with-javascript/
339
- // Then fixed for today's Chrome browser.
340
- if (typeof MouseEvent === 'function') {
341
- // Up-to-date approach
342
- var mevt = new MouseEvent('click', {
343
- view: window,
344
- bubbles: false,
345
- cancelable: true
346
- });
347
- node.dispatchEvent(mevt);
348
- } else if (document.createEvent) {
349
- // Fallback
350
- var evt = document.createEvent('MouseEvents');
351
- evt.initEvent('click', false, false);
352
- node.dispatchEvent(evt);
353
- } else if (document.createEventObject) {
354
- node.fireEvent('onclick');
355
- } else if (typeof node.onclick === 'function') {
356
- node.onclick();
357
- }
358
- };
359
-
360
- var animationEndEvent = function () {
361
- var testEl = document.createElement('div');
362
- var transEndEventNames = {
363
- 'WebkitAnimation': 'webkitAnimationEnd',
364
- 'OAnimation': 'oAnimationEnd oanimationend',
365
- 'msAnimation': 'MSAnimationEnd',
366
- 'animation': 'animationend'
367
- };
368
- for (var i in transEndEventNames) {
369
- if (transEndEventNames.hasOwnProperty(i) && testEl.style[i] !== undefined) {
370
- return transEndEventNames[i];
371
- }
372
- }
373
-
374
- return false;
375
- }();
376
-
377
- // Reset previous window keydown handler and focued element
378
- var resetPrevState = function resetPrevState() {
379
- window.onkeydown = states.previousWindowKeyDown;
380
- if (states.previousActiveElement && states.previousActiveElement.focus) {
381
- var x = window.scrollX;
382
- var y = window.scrollY;
383
- states.previousActiveElement.focus();
384
- if (x && y) {
385
- // IE has no scrollX/scrollY support
386
- window.scrollTo(x, y);
387
- }
388
- }
389
- };
390
-
391
- // Measure width of scrollbar
392
- // https://github.com/twbs/bootstrap/blob/master/js/modal.js#L279-L286
393
- var measureScrollbar = function measureScrollbar() {
394
- var supportsTouch = 'ontouchstart' in window || navigator.msMaxTouchPoints;
395
- if (supportsTouch) {
396
- return 0;
397
- }
398
- var scrollDiv = document.createElement('div');
399
- scrollDiv.style.width = '50px';
400
- scrollDiv.style.height = '50px';
401
- scrollDiv.style.overflow = 'scroll';
402
- document.body.appendChild(scrollDiv);
403
- var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
404
- document.body.removeChild(scrollDiv);
405
- return scrollbarWidth;
406
- };
407
-
408
- // JavaScript Debounce Function
409
- // Simplivied version of https://davidwalsh.name/javascript-debounce-function
410
- var debounce = function debounce(func, wait) {
411
- var timeout = void 0;
412
- return function () {
413
- var later = function later() {
414
- timeout = null;
415
- func();
416
- };
417
- clearTimeout(timeout);
418
- timeout = setTimeout(later, wait);
419
- };
420
- };
421
-
422
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
423
- return typeof obj;
424
- } : function (obj) {
425
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
426
- };
427
-
428
-
429
-
430
-
431
-
432
-
433
-
434
-
435
-
436
-
437
-
438
-
439
-
440
-
441
-
442
-
443
-
444
-
445
-
446
-
447
-
448
- var _extends = Object.assign || function (target) {
449
- for (var i = 1; i < arguments.length; i++) {
450
- var source = arguments[i];
451
-
452
- for (var key in source) {
453
- if (Object.prototype.hasOwnProperty.call(source, key)) {
454
- target[key] = source[key];
455
- }
456
- }
457
- }
458
-
459
- return target;
460
- };
461
-
462
- var modalParams = _extends({}, defaultParams);
463
- var queue = [];
464
- var swal2Observer = void 0;
465
-
466
- /*
467
- * Set type, text and actions on modal
468
- */
469
- var setParameters = function setParameters(params) {
470
- var modal = getModal() || init(params);
471
-
472
- for (var param in params) {
473
- if (!defaultParams.hasOwnProperty(param) && param !== 'extraParams') {
474
- console.warn('SweetAlert2: Unknown parameter "' + param + '"');
475
- }
476
- }
477
-
478
- // Set modal width
479
- modal.style.width = typeof params.width === 'number' ? params.width + 'px' : params.width;
480
-
481
- modal.style.padding = params.padding + 'px';
482
- modal.style.background = params.background;
483
- var successIconParts = modal.querySelectorAll('[class^=swal2-success-circular-line], .swal2-success-fix');
484
- for (var i = 0; i < successIconParts.length; i++) {
485
- successIconParts[i].style.background = params.background;
486
- }
487
-
488
- var title = getTitle();
489
- var content = getContent();
490
- var buttonsWrapper = getButtonsWrapper();
491
- var confirmButton = getConfirmButton();
492
- var cancelButton = getCancelButton();
493
- var closeButton = getCloseButton();
494
-
495
- // Title
496
- if (params.titleText) {
497
- title.innerText = params.titleText;
498
- } else {
499
- title.innerHTML = params.title.split('\n').join('<br />');
500
- }
501
-
502
- // Content
503
- if (params.text || params.html) {
504
- if (_typeof(params.html) === 'object') {
505
- content.innerHTML = '';
506
- if (0 in params.html) {
507
- for (var _i = 0; _i in params.html; _i++) {
508
- content.appendChild(params.html[_i].cloneNode(true));
509
- }
510
- } else {
511
- content.appendChild(params.html.cloneNode(true));
512
- }
513
- } else if (params.html) {
514
- content.innerHTML = params.html;
515
- } else if (params.text) {
516
- content.textContent = params.text;
517
- }
518
- show(content);
519
- } else {
520
- hide(content);
521
- }
522
-
523
- // Close button
524
- if (params.showCloseButton) {
525
- show(closeButton);
526
- } else {
527
- hide(closeButton);
528
- }
529
-
530
- // Custom Class
531
- modal.className = swalClasses.modal;
532
- if (params.customClass) {
533
- addClass(modal, params.customClass);
534
- }
535
-
536
- // Progress steps
537
- var progressStepsContainer = getProgressSteps();
538
- var currentProgressStep = parseInt(params.currentProgressStep === null ? sweetAlert.getQueueStep() : params.currentProgressStep, 10);
539
- if (params.progressSteps.length) {
540
- show(progressStepsContainer);
541
- empty(progressStepsContainer);
542
- if (currentProgressStep >= params.progressSteps.length) {
543
- console.warn('SweetAlert2: Invalid currentProgressStep parameter, it should be less than progressSteps.length ' + '(currentProgressStep like JS arrays starts from 0)');
544
- }
545
- params.progressSteps.forEach(function (step, index) {
546
- var circle = document.createElement('li');
547
- addClass(circle, swalClasses.progresscircle);
548
- circle.innerHTML = step;
549
- if (index === currentProgressStep) {
550
- addClass(circle, swalClasses.activeprogressstep);
551
- }
552
- progressStepsContainer.appendChild(circle);
553
- if (index !== params.progressSteps.length - 1) {
554
- var line = document.createElement('li');
555
- addClass(line, swalClasses.progressline);
556
- line.style.width = params.progressStepsDistance;
557
- progressStepsContainer.appendChild(line);
558
- }
559
- });
560
- } else {
561
- hide(progressStepsContainer);
562
- }
563
-
564
- // Icon
565
- var icons = getIcons();
566
- for (var _i2 = 0; _i2 < icons.length; _i2++) {
567
- hide(icons[_i2]);
568
- }
569
- if (params.type) {
570
- var validType = false;
571
- for (var iconType in iconTypes) {
572
- if (params.type === iconType) {
573
- validType = true;
574
- break;
575
- }
576
- }
577
- if (!validType) {
578
- console.error('SweetAlert2: Unknown alert type: ' + params.type);
579
- return false;
580
- }
581
- var icon = modal.querySelector('.' + swalClasses.icon + '.' + iconTypes[params.type]);
582
- show(icon);
583
-
584
- // Animate icon
585
- if (params.animation) {
586
- switch (params.type) {
587
- case 'success':
588
- addClass(icon, 'swal2-animate-success-icon');
589
- addClass(icon.querySelector('.swal2-success-line-tip'), 'swal2-animate-success-line-tip');
590
- addClass(icon.querySelector('.swal2-success-line-long'), 'swal2-animate-success-line-long');
591
- break;
592
- case 'error':
593
- addClass(icon, 'swal2-animate-error-icon');
594
- addClass(icon.querySelector('.swal2-x-mark'), 'swal2-animate-x-mark');
595
- break;
596
- default:
597
- break;
598
- }
599
- }
600
- }
601
-
602
- // Custom image
603
- var image = getImage();
604
- if (params.imageUrl) {
605
- image.setAttribute('src', params.imageUrl);
606
- show(image);
607
-
608
- if (params.imageWidth) {
609
- image.setAttribute('width', params.imageWidth);
610
- } else {
611
- image.removeAttribute('width');
612
- }
613
-
614
- if (params.imageHeight) {
615
- image.setAttribute('height', params.imageHeight);
616
- } else {
617
- image.removeAttribute('height');
618
- }
619
-
620
- image.className = swalClasses.image;
621
- if (params.imageClass) {
622
- addClass(image, params.imageClass);
623
- }
624
- } else {
625
- hide(image);
626
- }
627
-
628
- // Cancel button
629
- if (params.showCancelButton) {
630
- cancelButton.style.display = 'inline-block';
631
- } else {
632
- hide(cancelButton);
633
- }
634
-
635
- // Confirm button
636
- if (params.showConfirmButton) {
637
- removeStyleProperty(confirmButton, 'display');
638
- } else {
639
- hide(confirmButton);
640
- }
641
-
642
- // Buttons wrapper
643
- if (!params.showConfirmButton && !params.showCancelButton) {
644
- hide(buttonsWrapper);
645
- } else {
646
- show(buttonsWrapper);
647
- }
648
-
649
- // Edit text on cancel and confirm buttons
650
- confirmButton.innerHTML = params.confirmButtonText;
651
- cancelButton.innerHTML = params.cancelButtonText;
652
-
653
- // Set buttons to selected background colors
654
- if (params.buttonsStyling) {
655
- confirmButton.style.backgroundColor = params.confirmButtonColor;
656
- cancelButton.style.backgroundColor = params.cancelButtonColor;
657
- }
658
-
659
- // Add buttons custom classes
660
- confirmButton.className = swalClasses.confirm;
661
- addClass(confirmButton, params.confirmButtonClass);
662
- cancelButton.className = swalClasses.cancel;
663
- addClass(cancelButton, params.cancelButtonClass);
664
-
665
- // Buttons styling
666
- if (params.buttonsStyling) {
667
- addClass(confirmButton, swalClasses.styled);
668
- addClass(cancelButton, swalClasses.styled);
669
- } else {
670
- removeClass(confirmButton, swalClasses.styled);
671
- removeClass(cancelButton, swalClasses.styled);
672
-
673
- confirmButton.style.backgroundColor = confirmButton.style.borderLeftColor = confirmButton.style.borderRightColor = '';
674
- cancelButton.style.backgroundColor = cancelButton.style.borderLeftColor = cancelButton.style.borderRightColor = '';
675
- }
676
-
677
- // CSS animation
678
- if (params.animation === true) {
679
- removeClass(modal, swalClasses.noanimation);
680
- } else {
681
- addClass(modal, swalClasses.noanimation);
682
- }
683
- };
684
-
685
- /*
686
- * Animations
687
- */
688
- var openModal = function openModal(animation, onComplete) {
689
- var container = getContainer();
690
- var modal = getModal();
691
-
692
- if (animation) {
693
- addClass(modal, swalClasses.show);
694
- addClass(container, swalClasses.fade);
695
- removeClass(modal, swalClasses.hide);
696
- } else {
697
- removeClass(modal, swalClasses.fade);
698
- }
699
- show(modal);
700
-
701
- // scrolling is 'hidden' until animation is done, after that 'auto'
702
- container.style.overflowY = 'hidden';
703
- if (animationEndEvent && !hasClass(modal, swalClasses.noanimation)) {
704
- modal.addEventListener(animationEndEvent, function swalCloseEventFinished() {
705
- modal.removeEventListener(animationEndEvent, swalCloseEventFinished);
706
- container.style.overflowY = 'auto';
707
- });
708
- } else {
709
- container.style.overflowY = 'auto';
710
- }
711
-
712
- addClass(document.documentElement, swalClasses.shown);
713
- addClass(document.body, swalClasses.shown);
714
- addClass(container, swalClasses.shown);
715
- fixScrollbar();
716
- iOSfix();
717
- states.previousActiveElement = document.activeElement;
718
- if (onComplete !== null && typeof onComplete === 'function') {
719
- setTimeout(function () {
720
- onComplete(modal);
721
- });
722
- }
723
- };
724
-
725
- var fixScrollbar = function fixScrollbar() {
726
- // for queues, do not do this more than once
727
- if (states.previousBodyPadding !== null) {
728
- return;
729
- }
730
- // if the body has overflow
731
- if (document.body.scrollHeight > window.innerHeight) {
732
- // add padding so the content doesn't shift after removal of scrollbar
733
- states.previousBodyPadding = document.body.style.paddingRight;
734
- document.body.style.paddingRight = measureScrollbar() + 'px';
735
- }
736
- };
737
-
738
- var undoScrollbar = function undoScrollbar() {
739
- if (states.previousBodyPadding !== null) {
740
- document.body.style.paddingRight = states.previousBodyPadding;
741
- states.previousBodyPadding = null;
742
- }
743
- };
744
-
745
- // Fix iOS scrolling http://stackoverflow.com/q/39626302/1331425
746
- var iOSfix = function iOSfix() {
747
- var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
748
- if (iOS && !hasClass(document.body, swalClasses.iosfix)) {
749
- var offset = document.body.scrollTop;
750
- document.body.style.top = offset * -1 + 'px';
751
- addClass(document.body, swalClasses.iosfix);
752
- }
753
- };
754
-
755
- var undoIOSfix = function undoIOSfix() {
756
- if (hasClass(document.body, swalClasses.iosfix)) {
757
- var offset = parseInt(document.body.style.top, 10);
758
- removeClass(document.body, swalClasses.iosfix);
759
- document.body.style.top = '';
760
- document.body.scrollTop = offset * -1;
761
- }
762
- };
763
-
764
- // SweetAlert entry point
765
- var sweetAlert = function sweetAlert() {
766
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
767
- args[_key] = arguments[_key];
768
- }
769
-
770
- if (args[0] === undefined) {
771
- console.error('SweetAlert2 expects at least 1 attribute!');
772
- return false;
773
- }
774
-
775
- var params = _extends({}, modalParams);
776
-
777
- switch (_typeof(args[0])) {
778
- case 'string':
779
- params.title = args[0];
780
- params.html = args[1];
781
- params.type = args[2];
782
-
783
- break;
784
-
785
- case 'object':
786
- _extends(params, args[0]);
787
- params.extraParams = args[0].extraParams;
788
-
789
- if (params.input === 'email' && params.inputValidator === null) {
790
- params.inputValidator = function (email) {
791
- return new Promise(function (resolve, reject) {
792
- var emailRegex = /^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/;
793
- if (emailRegex.test(email)) {
794
- resolve();
795
- } else {
796
- reject('Invalid email address');
797
- }
798
- });
799
- };
800
- }
801
-
802
- if (params.input === 'url' && params.inputValidator === null) {
803
- params.inputValidator = function (url) {
804
- return new Promise(function (resolve, reject) {
805
- // taken from https://stackoverflow.com/a/3809435/1331425
806
- var urlRegex = /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)$/;
807
- if (urlRegex.test(url)) {
808
- resolve();
809
- } else {
810
- reject('Invalid URL');
811
- }
812
- });
813
- };
814
- }
815
- break;
816
-
817
- default:
818
- console.error('SweetAlert2: Unexpected type of argument! Expected "string" or "object", got ' + _typeof(args[0]));
819
- return false;
820
- }
821
-
822
- setParameters(params);
823
-
824
- var container = getContainer();
825
- var modal = getModal();
826
-
827
- return new Promise(function (resolve, reject) {
828
- // Close on timer
829
- if (params.timer) {
830
- modal.timeout = setTimeout(function () {
831
- sweetAlert.closeModal(params.onClose);
832
- if (params.useRejections) {
833
- reject('timer');
834
- } else {
835
- resolve({ dismiss: 'timer' });
836
- }
837
- }, params.timer);
838
- }
839
-
840
- // Get input element by specified type or, if type isn't specified, by params.input
841
- var getInput = function getInput(inputType) {
842
- inputType = inputType || params.input;
843
- if (!inputType) {
844
- return null;
845
- }
846
- switch (inputType) {
847
- case 'select':
848
- case 'textarea':
849
- case 'file':
850
- return getChildByClass(modal, swalClasses[inputType]);
851
- case 'checkbox':
852
- return modal.querySelector('.' + swalClasses.checkbox + ' input');
853
- case 'radio':
854
- return modal.querySelector('.' + swalClasses.radio + ' input:checked') || modal.querySelector('.' + swalClasses.radio + ' input:first-child');
855
- case 'range':
856
- return modal.querySelector('.' + swalClasses.range + ' input');
857
- default:
858
- return getChildByClass(modal, swalClasses.input);
859
- }
860
- };
861
-
862
- // Get the value of the modal input
863
- var getInputValue = function getInputValue() {
864
- var input = getInput();
865
- if (!input) {
866
- return null;
867
- }
868
- switch (params.input) {
869
- case 'checkbox':
870
- return input.checked ? 1 : 0;
871
- case 'radio':
872
- return input.checked ? input.value : null;
873
- case 'file':
874
- return input.files.length ? input.files[0] : null;
875
- default:
876
- return params.inputAutoTrim ? input.value.trim() : input.value;
877
- }
878
- };
879
-
880
- // input autofocus
881
- if (params.input) {
882
- setTimeout(function () {
883
- var input = getInput();
884
- if (input) {
885
- focusInput(input);
886
- }
887
- }, 0);
888
- }
889
-
890
- var confirm = function confirm(value) {
891
- if (params.showLoaderOnConfirm) {
892
- sweetAlert.showLoading();
893
- }
894
-
895
- if (params.preConfirm) {
896
- params.preConfirm(value, params.extraParams).then(function (preConfirmValue) {
897
- sweetAlert.closeModal(params.onClose);
898
- resolve(preConfirmValue || value);
899
- }, function (error) {
900
- sweetAlert.hideLoading();
901
- if (error) {
902
- sweetAlert.showValidationError(error);
903
- }
904
- });
905
- } else {
906
- sweetAlert.closeModal(params.onClose);
907
- if (params.useRejections) {
908
- resolve(value);
909
- } else {
910
- resolve({ value: value });
911
- }
912
- }
913
- };
914
-
915
- // Mouse interactions
916
- var onButtonEvent = function onButtonEvent(event) {
917
- var e = event || window.event;
918
- var target = e.target || e.srcElement;
919
- var confirmButton = getConfirmButton();
920
- var cancelButton = getCancelButton();
921
- var targetedConfirm = confirmButton && (confirmButton === target || confirmButton.contains(target));
922
- var targetedCancel = cancelButton && (cancelButton === target || cancelButton.contains(target));
923
-
924
- switch (e.type) {
925
- case 'mouseover':
926
- case 'mouseup':
927
- if (params.buttonsStyling) {
928
- if (targetedConfirm) {
929
- confirmButton.style.backgroundColor = colorLuminance(params.confirmButtonColor, -0.1);
930
- } else if (targetedCancel) {
931
- cancelButton.style.backgroundColor = colorLuminance(params.cancelButtonColor, -0.1);
932
- }
933
- }
934
- break;
935
- case 'mouseout':
936
- if (params.buttonsStyling) {
937
- if (targetedConfirm) {
938
- confirmButton.style.backgroundColor = params.confirmButtonColor;
939
- } else if (targetedCancel) {
940
- cancelButton.style.backgroundColor = params.cancelButtonColor;
941
- }
942
- }
943
- break;
944
- case 'mousedown':
945
- if (params.buttonsStyling) {
946
- if (targetedConfirm) {
947
- confirmButton.style.backgroundColor = colorLuminance(params.confirmButtonColor, -0.2);
948
- } else if (targetedCancel) {
949
- cancelButton.style.backgroundColor = colorLuminance(params.cancelButtonColor, -0.2);
950
- }
951
- }
952
- break;
953
- case 'click':
954
- // Clicked 'confirm'
955
- if (targetedConfirm && sweetAlert.isVisible()) {
956
- sweetAlert.disableButtons();
957
- if (params.input) {
958
- var inputValue = getInputValue();
959
-
960
- if (params.inputValidator) {
961
- sweetAlert.disableInput();
962
- params.inputValidator(inputValue, params.extraParams).then(function () {
963
- sweetAlert.enableButtons();
964
- sweetAlert.enableInput();
965
- confirm(inputValue);
966
- }, function (error) {
967
- sweetAlert.enableButtons();
968
- sweetAlert.enableInput();
969
- if (error) {
970
- sweetAlert.showValidationError(error);
971
- }
972
- });
973
- } else {
974
- confirm(inputValue);
975
- }
976
- } else {
977
- confirm(true);
978
- }
979
-
980
- // Clicked 'cancel'
981
- } else if (targetedCancel && sweetAlert.isVisible()) {
982
- sweetAlert.disableButtons();
983
- sweetAlert.closeModal(params.onClose);
984
- if (params.useRejections) {
985
- reject('cancel');
986
- } else {
987
- resolve({ dismiss: 'cancel' });
988
- }
989
- }
990
- break;
991
- default:
992
- }
993
- };
994
-
995
- var buttons = modal.querySelectorAll('button');
996
- for (var i = 0; i < buttons.length; i++) {
997
- buttons[i].onclick = onButtonEvent;
998
- buttons[i].onmouseover = onButtonEvent;
999
- buttons[i].onmouseout = onButtonEvent;
1000
- buttons[i].onmousedown = onButtonEvent;
1001
- }
1002
-
1003
- // Closing modal by close button
1004
- getCloseButton().onclick = function () {
1005
- sweetAlert.closeModal(params.onClose);
1006
- if (params.useRejections) {
1007
- reject('close');
1008
- } else {
1009
- resolve({ dismiss: 'close' });
1010
- }
1011
- };
1012
-
1013
- // Closing modal by overlay click
1014
- container.onclick = function (e) {
1015
- if (e.target !== container) {
1016
- return;
1017
- }
1018
- if (params.allowOutsideClick) {
1019
- sweetAlert.closeModal(params.onClose);
1020
- if (params.useRejections) {
1021
- reject('overlay');
1022
- } else {
1023
- resolve({ dismiss: 'overlay' });
1024
- }
1025
- }
1026
- };
1027
-
1028
- var buttonsWrapper = getButtonsWrapper();
1029
- var confirmButton = getConfirmButton();
1030
- var cancelButton = getCancelButton();
1031
-
1032
- // Reverse buttons (Confirm on the right side)
1033
- if (params.reverseButtons) {
1034
- confirmButton.parentNode.insertBefore(cancelButton, confirmButton);
1035
- } else {
1036
- confirmButton.parentNode.insertBefore(confirmButton, cancelButton);
1037
- }
1038
-
1039
- // Focus handling
1040
- var setFocus = function setFocus(index, increment) {
1041
- var focusableElements = getFocusableElements(params.focusCancel);
1042
- // search for visible elements and select the next possible match
1043
- for (var _i3 = 0; _i3 < focusableElements.length; _i3++) {
1044
- index = index + increment;
1045
-
1046
- // rollover to first item
1047
- if (index === focusableElements.length) {
1048
- index = 0;
1049
-
1050
- // go to last item
1051
- } else if (index === -1) {
1052
- index = focusableElements.length - 1;
1053
- }
1054
-
1055
- // determine if element is visible
1056
- var el = focusableElements[index];
1057
- if (isVisible(el)) {
1058
- return el.focus();
1059
- }
1060
- }
1061
- };
1062
-
1063
- var handleKeyDown = function handleKeyDown(event) {
1064
- var e = event || window.event;
1065
- var keyCode = e.keyCode || e.which;
1066
-
1067
- if ([9, 13, 32, 27, 37, 38, 39, 40].indexOf(keyCode) === -1) {
1068
- // Don't do work on keys we don't care about.
1069
- return;
1070
- }
1071
-
1072
- var targetElement = e.target || e.srcElement;
1073
-
1074
- var focusableElements = getFocusableElements(params.focusCancel);
1075
- var btnIndex = -1; // Find the button - note, this is a nodelist, not an array.
1076
- for (var _i4 = 0; _i4 < focusableElements.length; _i4++) {
1077
- if (targetElement === focusableElements[_i4]) {
1078
- btnIndex = _i4;
1079
- break;
1080
- }
1081
- }
1082
-
1083
- // TAB
1084
- if (keyCode === 9) {
1085
- if (!e.shiftKey) {
1086
- // Cycle to the next button
1087
- setFocus(btnIndex, 1);
1088
- } else {
1089
- // Cycle to the prev button
1090
- setFocus(btnIndex, -1);
1091
- }
1092
- e.stopPropagation();
1093
- e.preventDefault();
1094
-
1095
- // ARROWS - switch focus between buttons
1096
- } else if (keyCode === 37 || keyCode === 38 || keyCode === 39 || keyCode === 40) {
1097
- // focus Cancel button if Confirm button is currently focused
1098
- if (document.activeElement === confirmButton && isVisible(cancelButton)) {
1099
- cancelButton.focus();
1100
- // and vice versa
1101
- } else if (document.activeElement === cancelButton && isVisible(confirmButton)) {
1102
- confirmButton.focus();
1103
- }
1104
-
1105
- // ENTER/SPACE
1106
- } else if (keyCode === 13 || keyCode === 32) {
1107
- if (btnIndex === -1 && params.allowEnterKey) {
1108
- // ENTER/SPACE clicked outside of a button.
1109
- if (params.focusCancel) {
1110
- fireClick(cancelButton, e);
1111
- } else {
1112
- fireClick(confirmButton, e);
1113
- }
1114
- e.stopPropagation();
1115
- e.preventDefault();
1116
- }
1117
-
1118
- // ESC
1119
- } else if (keyCode === 27 && params.allowEscapeKey === true) {
1120
- sweetAlert.closeModal(params.onClose);
1121
- if (params.useRejections) {
1122
- reject('esc');
1123
- } else {
1124
- resolve({ dismiss: 'esc' });
1125
- }
1126
- }
1127
- };
1128
-
1129
- if (!window.onkeydown || window.onkeydown.toString() !== handleKeyDown.toString()) {
1130
- states.previousWindowKeyDown = window.onkeydown;
1131
- window.onkeydown = handleKeyDown;
1132
- }
1133
-
1134
- // Loading state
1135
- if (params.buttonsStyling) {
1136
- confirmButton.style.borderLeftColor = params.confirmButtonColor;
1137
- confirmButton.style.borderRightColor = params.confirmButtonColor;
1138
- }
1139
-
1140
- /**
1141
- * Show spinner instead of Confirm button and disable Cancel button
1142
- */
1143
- sweetAlert.hideLoading = sweetAlert.disableLoading = function () {
1144
- if (!params.showConfirmButton) {
1145
- hide(confirmButton);
1146
- if (!params.showCancelButton) {
1147
- hide(getButtonsWrapper());
1148
- }
1149
- }
1150
- removeClass(buttonsWrapper, swalClasses.loading);
1151
- removeClass(modal, swalClasses.loading);
1152
- confirmButton.disabled = false;
1153
- cancelButton.disabled = false;
1154
- };
1155
-
1156
- sweetAlert.getTitle = function () {
1157
- return getTitle();
1158
- };
1159
- sweetAlert.getContent = function () {
1160
- return getContent();
1161
- };
1162
- sweetAlert.getInput = function () {
1163
- return getInput();
1164
- };
1165
- sweetAlert.getImage = function () {
1166
- return getImage();
1167
- };
1168
- sweetAlert.getButtonsWrapper = function () {
1169
- return getButtonsWrapper();
1170
- };
1171
- sweetAlert.getConfirmButton = function () {
1172
- return getConfirmButton();
1173
- };
1174
- sweetAlert.getCancelButton = function () {
1175
- return getCancelButton();
1176
- };
1177
-
1178
- sweetAlert.enableButtons = function () {
1179
- confirmButton.disabled = false;
1180
- cancelButton.disabled = false;
1181
- };
1182
-
1183
- sweetAlert.disableButtons = function () {
1184
- confirmButton.disabled = true;
1185
- cancelButton.disabled = true;
1186
- };
1187
-
1188
- sweetAlert.enableConfirmButton = function () {
1189
- confirmButton.disabled = false;
1190
- };
1191
-
1192
- sweetAlert.disableConfirmButton = function () {
1193
- confirmButton.disabled = true;
1194
- };
1195
-
1196
- sweetAlert.enableInput = function () {
1197
- var input = getInput();
1198
- if (!input) {
1199
- return false;
1200
- }
1201
- if (input.type === 'radio') {
1202
- var radiosContainer = input.parentNode.parentNode;
1203
- var radios = radiosContainer.querySelectorAll('input');
1204
- for (var _i5 = 0; _i5 < radios.length; _i5++) {
1205
- radios[_i5].disabled = false;
1206
- }
1207
- } else {
1208
- input.disabled = false;
1209
- }
1210
- };
1211
-
1212
- sweetAlert.disableInput = function () {
1213
- var input = getInput();
1214
- if (!input) {
1215
- return false;
1216
- }
1217
- if (input && input.type === 'radio') {
1218
- var radiosContainer = input.parentNode.parentNode;
1219
- var radios = radiosContainer.querySelectorAll('input');
1220
- for (var _i6 = 0; _i6 < radios.length; _i6++) {
1221
- radios[_i6].disabled = true;
1222
- }
1223
- } else {
1224
- input.disabled = true;
1225
- }
1226
- };
1227
-
1228
- // Set modal min-height to disable scrolling inside the modal
1229
- sweetAlert.recalculateHeight = debounce(function () {
1230
- var modal = getModal();
1231
- if (!modal) {
1232
- return;
1233
- }
1234
- var prevState = modal.style.display;
1235
- modal.style.minHeight = '';
1236
- show(modal);
1237
- modal.style.minHeight = modal.scrollHeight + 1 + 'px';
1238
- modal.style.display = prevState;
1239
- }, 50);
1240
-
1241
- // Show block with validation error
1242
- sweetAlert.showValidationError = function (error) {
1243
- var validationError = getValidationError();
1244
- validationError.innerHTML = error;
1245
- show(validationError);
1246
-
1247
- var input = getInput();
1248
- if (input) {
1249
- focusInput(input);
1250
- addClass(input, swalClasses.inputerror);
1251
- }
1252
- };
1253
-
1254
- // Hide block with validation error
1255
- sweetAlert.resetValidationError = function () {
1256
- var validationError = getValidationError();
1257
- hide(validationError);
1258
- sweetAlert.recalculateHeight();
1259
-
1260
- var input = getInput();
1261
- if (input) {
1262
- removeClass(input, swalClasses.inputerror);
1263
- }
1264
- };
1265
-
1266
- sweetAlert.getProgressSteps = function () {
1267
- return params.progressSteps;
1268
- };
1269
-
1270
- sweetAlert.setProgressSteps = function (progressSteps) {
1271
- params.progressSteps = progressSteps;
1272
- setParameters(params);
1273
- };
1274
-
1275
- sweetAlert.showProgressSteps = function () {
1276
- show(getProgressSteps());
1277
- };
1278
-
1279
- sweetAlert.hideProgressSteps = function () {
1280
- hide(getProgressSteps());
1281
- };
1282
-
1283
- sweetAlert.enableButtons();
1284
- sweetAlert.hideLoading();
1285
- sweetAlert.resetValidationError();
1286
-
1287
- // inputs
1288
- var inputTypes = ['input', 'file', 'range', 'select', 'radio', 'checkbox', 'textarea'];
1289
- var input = void 0;
1290
- for (var _i7 = 0; _i7 < inputTypes.length; _i7++) {
1291
- var inputClass = swalClasses[inputTypes[_i7]];
1292
- var inputContainer = getChildByClass(modal, inputClass);
1293
- input = getInput(inputTypes[_i7]);
1294
-
1295
- // set attributes
1296
- if (input) {
1297
- for (var j in input.attributes) {
1298
- if (input.attributes.hasOwnProperty(j)) {
1299
- var attrName = input.attributes[j].name;
1300
- if (attrName !== 'type' && attrName !== 'value') {
1301
- input.removeAttribute(attrName);
1302
- }
1303
- }
1304
- }
1305
- for (var attr in params.inputAttributes) {
1306
- input.setAttribute(attr, params.inputAttributes[attr]);
1307
- }
1308
- }
1309
-
1310
- // set class
1311
- inputContainer.className = inputClass;
1312
- if (params.inputClass) {
1313
- addClass(inputContainer, params.inputClass);
1314
- }
1315
-
1316
- hide(inputContainer);
1317
- }
1318
-
1319
- var populateInputOptions = void 0;
1320
- switch (params.input) {
1321
- case 'text':
1322
- case 'email':
1323
- case 'password':
1324
- case 'number':
1325
- case 'tel':
1326
- case 'url':
1327
- input = getChildByClass(modal, swalClasses.input);
1328
- input.value = params.inputValue;
1329
- input.placeholder = params.inputPlaceholder;
1330
- input.type = params.input;
1331
- show(input);
1332
- break;
1333
- case 'file':
1334
- input = getChildByClass(modal, swalClasses.file);
1335
- input.placeholder = params.inputPlaceholder;
1336
- input.type = params.input;
1337
- show(input);
1338
- break;
1339
- case 'range':
1340
- var range = getChildByClass(modal, swalClasses.range);
1341
- var rangeInput = range.querySelector('input');
1342
- var rangeOutput = range.querySelector('output');
1343
- rangeInput.value = params.inputValue;
1344
- rangeInput.type = params.input;
1345
- rangeOutput.value = params.inputValue;
1346
- show(range);
1347
- break;
1348
- case 'select':
1349
- var select = getChildByClass(modal, swalClasses.select);
1350
- select.innerHTML = '';
1351
- if (params.inputPlaceholder) {
1352
- var placeholder = document.createElement('option');
1353
- placeholder.innerHTML = params.inputPlaceholder;
1354
- placeholder.value = '';
1355
- placeholder.disabled = true;
1356
- placeholder.selected = true;
1357
- select.appendChild(placeholder);
1358
- }
1359
- populateInputOptions = function populateInputOptions(inputOptions) {
1360
- for (var optionValue in inputOptions) {
1361
- var option = document.createElement('option');
1362
- option.value = optionValue;
1363
- option.innerHTML = inputOptions[optionValue];
1364
- if (params.inputValue === optionValue) {
1365
- option.selected = true;
1366
- }
1367
- select.appendChild(option);
1368
- }
1369
- show(select);
1370
- select.focus();
1371
- };
1372
- break;
1373
- case 'radio':
1374
- var radio = getChildByClass(modal, swalClasses.radio);
1375
- radio.innerHTML = '';
1376
- populateInputOptions = function populateInputOptions(inputOptions) {
1377
- for (var radioValue in inputOptions) {
1378
- var radioInput = document.createElement('input');
1379
- var radioLabel = document.createElement('label');
1380
- var radioLabelSpan = document.createElement('span');
1381
- radioInput.type = 'radio';
1382
- radioInput.name = swalClasses.radio;
1383
- radioInput.value = radioValue;
1384
- if (params.inputValue === radioValue) {
1385
- radioInput.checked = true;
1386
- }
1387
- radioLabelSpan.innerHTML = inputOptions[radioValue];
1388
- radioLabel.appendChild(radioInput);
1389
- radioLabel.appendChild(radioLabelSpan);
1390
- radioLabel.for = radioInput.id;
1391
- radio.appendChild(radioLabel);
1392
- }
1393
- show(radio);
1394
- var radios = radio.querySelectorAll('input');
1395
- if (radios.length) {
1396
- radios[0].focus();
1397
- }
1398
- };
1399
- break;
1400
- case 'checkbox':
1401
- var checkbox = getChildByClass(modal, swalClasses.checkbox);
1402
- var checkboxInput = getInput('checkbox');
1403
- checkboxInput.type = 'checkbox';
1404
- checkboxInput.value = 1;
1405
- checkboxInput.id = swalClasses.checkbox;
1406
- checkboxInput.checked = Boolean(params.inputValue);
1407
- var label = checkbox.getElementsByTagName('span');
1408
- if (label.length) {
1409
- checkbox.removeChild(label[0]);
1410
- }
1411
- label = document.createElement('span');
1412
- label.innerHTML = params.inputPlaceholder;
1413
- checkbox.appendChild(label);
1414
- show(checkbox);
1415
- break;
1416
- case 'textarea':
1417
- var textarea = getChildByClass(modal, swalClasses.textarea);
1418
- textarea.value = params.inputValue;
1419
- textarea.placeholder = params.inputPlaceholder;
1420
- show(textarea);
1421
- break;
1422
- case null:
1423
- break;
1424
- default:
1425
- console.error('SweetAlert2: Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "' + params.input + '"');
1426
- break;
1427
- }
1428
-
1429
- if (params.input === 'select' || params.input === 'radio') {
1430
- if (params.inputOptions instanceof Promise) {
1431
- sweetAlert.showLoading();
1432
- params.inputOptions.then(function (inputOptions) {
1433
- sweetAlert.hideLoading();
1434
- populateInputOptions(inputOptions);
1435
- });
1436
- } else if (_typeof(params.inputOptions) === 'object') {
1437
- populateInputOptions(params.inputOptions);
1438
- } else {
1439
- console.error('SweetAlert2: Unexpected type of inputOptions! Expected object or Promise, got ' + _typeof(params.inputOptions));
1440
- }
1441
- }
1442
-
1443
- openModal(params.animation, params.onOpen);
1444
-
1445
- // Focus the first element (input or button)
1446
- if (params.allowEnterKey) {
1447
- setFocus(-1, 1);
1448
- } else {
1449
- if (document.activeElement) {
1450
- document.activeElement.blur();
1451
- }
1452
- }
1453
-
1454
- // fix scroll
1455
- getContainer().scrollTop = 0;
1456
-
1457
- // Observe changes inside the modal and adjust height
1458
- if (typeof MutationObserver !== 'undefined' && !swal2Observer) {
1459
- swal2Observer = new MutationObserver(sweetAlert.recalculateHeight);
1460
- swal2Observer.observe(modal, { childList: true, characterData: true, subtree: true });
1461
- }
1462
- });
1463
- };
1464
-
1465
- /*
1466
- * Global function to determine if swal2 modal is shown
1467
- */
1468
- sweetAlert.isVisible = function () {
1469
- return !!getModal();
1470
- };
1471
-
1472
- /*
1473
- * Global function for chaining sweetAlert modals
1474
- */
1475
- sweetAlert.queue = function (steps) {
1476
- queue = steps;
1477
- var resetQueue = function resetQueue() {
1478
- queue = [];
1479
- document.body.removeAttribute('data-swal2-queue-step');
1480
- };
1481
- var queueResult = [];
1482
- return new Promise(function (resolve, reject) {
1483
- (function step(i, callback) {
1484
- if (i < queue.length) {
1485
- document.body.setAttribute('data-swal2-queue-step', i);
1486
-
1487
- sweetAlert(queue[i]).then(function (result) {
1488
- queueResult.push(result);
1489
- step(i + 1, callback);
1490
- }, function (dismiss) {
1491
- resetQueue();
1492
- reject(dismiss);
1493
- });
1494
- } else {
1495
- resetQueue();
1496
- resolve(queueResult);
1497
- }
1498
- })(0);
1499
- });
1500
- };
1501
-
1502
- /*
1503
- * Global function for getting the index of current modal in queue
1504
- */
1505
- sweetAlert.getQueueStep = function () {
1506
- return document.body.getAttribute('data-swal2-queue-step');
1507
- };
1508
-
1509
- /*
1510
- * Global function for inserting a modal to the queue
1511
- */
1512
- sweetAlert.insertQueueStep = function (step, index) {
1513
- if (index && index < queue.length) {
1514
- return queue.splice(index, 0, step);
1515
- }
1516
- return queue.push(step);
1517
- };
1518
-
1519
- /*
1520
- * Global function for deleting a modal from the queue
1521
- */
1522
- sweetAlert.deleteQueueStep = function (index) {
1523
- if (typeof queue[index] !== 'undefined') {
1524
- queue.splice(index, 1);
1525
- }
1526
- };
1527
-
1528
- /*
1529
- * Global function to close sweetAlert
1530
- */
1531
- sweetAlert.close = sweetAlert.closeModal = function (onComplete) {
1532
- var container = getContainer();
1533
- var modal = getModal();
1534
- if (!modal) {
1535
- return;
1536
- }
1537
- removeClass(modal, swalClasses.show);
1538
- addClass(modal, swalClasses.hide);
1539
- clearTimeout(modal.timeout);
1540
-
1541
- resetPrevState();
1542
-
1543
- var removeModalAndResetState = function removeModalAndResetState() {
1544
- if (container.parentNode) {
1545
- container.parentNode.removeChild(container);
1546
- }
1547
- removeClass(document.documentElement, swalClasses.shown);
1548
- removeClass(document.body, swalClasses.shown);
1549
- undoScrollbar();
1550
- undoIOSfix();
1551
- };
1552
-
1553
- // If animation is supported, animate
1554
- if (animationEndEvent && !hasClass(modal, swalClasses.noanimation)) {
1555
- modal.addEventListener(animationEndEvent, function swalCloseEventFinished() {
1556
- modal.removeEventListener(animationEndEvent, swalCloseEventFinished);
1557
- if (hasClass(modal, swalClasses.hide)) {
1558
- removeModalAndResetState();
1559
- }
1560
- });
1561
- } else {
1562
- // Otherwise, remove immediately
1563
- removeModalAndResetState();
1564
- }
1565
- if (onComplete !== null && typeof onComplete === 'function') {
1566
- setTimeout(function () {
1567
- onComplete(modal);
1568
- });
1569
- }
1570
- };
1571
-
1572
- /*
1573
- * Global function to click 'Confirm' button
1574
- */
1575
- sweetAlert.clickConfirm = function () {
1576
- return getConfirmButton().click();
1577
- };
1578
-
1579
- /*
1580
- * Global function to click 'Cancel' button
1581
- */
1582
- sweetAlert.clickCancel = function () {
1583
- return getCancelButton().click();
1584
- };
1585
-
1586
- /**
1587
- * Show spinner instead of Confirm button and disable Cancel button
1588
- */
1589
- sweetAlert.showLoading = sweetAlert.enableLoading = function () {
1590
- var modal = getModal();
1591
- if (!modal) {
1592
- sweetAlert('');
1593
- }
1594
- var buttonsWrapper = getButtonsWrapper();
1595
- var confirmButton = getConfirmButton();
1596
- var cancelButton = getCancelButton();
1597
-
1598
- show(buttonsWrapper);
1599
- show(confirmButton, 'inline-block');
1600
- addClass(buttonsWrapper, swalClasses.loading);
1601
- addClass(modal, swalClasses.loading);
1602
- confirmButton.disabled = true;
1603
- cancelButton.disabled = true;
1604
- };
1605
-
1606
- /**
1607
- * Set default params for each popup
1608
- * @param {Object} userParams
1609
- */
1610
- sweetAlert.setDefaults = function (userParams) {
1611
- if (!userParams || (typeof userParams === 'undefined' ? 'undefined' : _typeof(userParams)) !== 'object') {
1612
- return console.error('SweetAlert2: the argument for setDefaults() is required and has to be a object');
1613
- }
1614
-
1615
- for (var param in userParams) {
1616
- if (!defaultParams.hasOwnProperty(param) && param !== 'extraParams') {
1617
- console.warn('SweetAlert2: Unknown parameter "' + param + '"');
1618
- delete userParams[param];
1619
- }
1620
- }
1621
-
1622
- _extends(modalParams, userParams);
1623
- };
1624
-
1625
- /**
1626
- * Reset default params for each popup
1627
- */
1628
- sweetAlert.resetDefaults = function () {
1629
- modalParams = _extends({}, defaultParams);
1630
- };
1631
-
1632
- sweetAlert.noop = function () {};
1633
-
1634
- sweetAlert.version = '6.6.6';
1635
-
1636
- sweetAlert.default = sweetAlert;
1637
-
1638
- return sweetAlert;
1639
-
1640
- })));
1641
- if (window.Sweetalert2) window.sweetAlert = window.swal = window.Sweetalert2;
1
+ /*!
2
+ * sweetalert2 v6.6.6
3
+ * Released under the MIT License.
4
+ */
5
+ (function (global, factory) {
6
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
7
+ typeof define === 'function' && define.amd ? define(factory) :
8
+ (global.Sweetalert2 = factory());
9
+ }(this, (function () { 'use strict';
10
+
11
+ var defaultParams = {
12
+ title: '',
13
+ titleText: '',
14
+ text: '',
15
+ html: '',
16
+ type: null,
17
+ customClass: '',
18
+ target: 'body',
19
+ animation: true,
20
+ allowOutsideClick: true,
21
+ allowEscapeKey: true,
22
+ allowEnterKey: true,
23
+ showConfirmButton: true,
24
+ showCancelButton: false,
25
+ preConfirm: null,
26
+ confirmButtonText: 'OK',
27
+ confirmButtonColor: '#3085d6',
28
+ confirmButtonClass: null,
29
+ cancelButtonText: 'Cancel',
30
+ cancelButtonColor: '#aaa',
31
+ cancelButtonClass: null,
32
+ buttonsStyling: true,
33
+ reverseButtons: false,
34
+ focusCancel: false,
35
+ showCloseButton: false,
36
+ showLoaderOnConfirm: false,
37
+ imageUrl: null,
38
+ imageWidth: null,
39
+ imageHeight: null,
40
+ imageClass: null,
41
+ timer: null,
42
+ width: 500,
43
+ padding: 20,
44
+ background: '#fff',
45
+ input: null,
46
+ inputPlaceholder: '',
47
+ inputValue: '',
48
+ inputOptions: {},
49
+ inputAutoTrim: true,
50
+ inputClass: null,
51
+ inputAttributes: {},
52
+ inputValidator: null,
53
+ progressSteps: [],
54
+ currentProgressStep: null,
55
+ progressStepsDistance: '40px',
56
+ onOpen: null,
57
+ onClose: null,
58
+ useRejections: true
59
+ };
60
+
61
+ var swalPrefix = 'swal2-';
62
+
63
+ var prefix = function prefix(items) {
64
+ var result = {};
65
+ for (var i in items) {
66
+ result[items[i]] = swalPrefix + items[i];
67
+ }
68
+ return result;
69
+ };
70
+
71
+ var swalClasses = prefix(['container', 'shown', 'iosfix', 'modal', 'overlay', 'fade', 'show', 'hide', 'noanimation', 'close', 'title', 'content', 'buttonswrapper', 'confirm', 'cancel', 'icon', 'image', 'input', 'file', 'range', 'select', 'radio', 'checkbox', 'textarea', 'inputerror', 'validationerror', 'progresssteps', 'activeprogressstep', 'progresscircle', 'progressline', 'loading', 'styled']);
72
+
73
+ var iconTypes = prefix(['success', 'warning', 'info', 'question', 'error']);
74
+
75
+ /*
76
+ * Set hover, active and focus-states for buttons (source: http://www.sitepoint.com/javascript-generate-lighter-darker-color)
77
+ */
78
+ var colorLuminance = function colorLuminance(hex, lum) {
79
+ // Validate hex string
80
+ hex = String(hex).replace(/[^0-9a-f]/gi, '');
81
+ if (hex.length < 6) {
82
+ hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
83
+ }
84
+ lum = lum || 0;
85
+
86
+ // Convert to decimal and change luminosity
87
+ var rgb = '#';
88
+ for (var i = 0; i < 3; i++) {
89
+ var c = parseInt(hex.substr(i * 2, 2), 16);
90
+ c = Math.round(Math.min(Math.max(0, c + c * lum), 255)).toString(16);
91
+ rgb += ('00' + c).substr(c.length);
92
+ }
93
+
94
+ return rgb;
95
+ };
96
+
97
+ var uniqueArray = function uniqueArray(arr) {
98
+ var result = [];
99
+ for (var i in arr) {
100
+ if (result.indexOf(arr[i]) === -1) {
101
+ result.push(arr[i]);
102
+ }
103
+ }
104
+ return result;
105
+ };
106
+
107
+ /* global MouseEvent */
108
+
109
+ // Remember state in cases where opening and handling a modal will fiddle with it.
110
+ var states = {
111
+ previousWindowKeyDown: null,
112
+ previousActiveElement: null,
113
+ previousBodyPadding: null
114
+
115
+ /*
116
+ * Add modal + overlay to DOM
117
+ */
118
+ };var init = function init(params) {
119
+ if (typeof document === 'undefined') {
120
+ console.error('SweetAlert2 requires document to initialize');
121
+ return;
122
+ }
123
+
124
+ var container = document.createElement('div');
125
+ container.className = swalClasses.container;
126
+ container.innerHTML = sweetHTML;
127
+
128
+ var targetElement = document.querySelector(params.target);
129
+ if (!targetElement) {
130
+ console.warn('SweetAlert2: Can\'t find the target "' + params.target + '"');
131
+ targetElement = document.body;
132
+ }
133
+ targetElement.appendChild(container);
134
+
135
+ var modal = getModal();
136
+ var input = getChildByClass(modal, swalClasses.input);
137
+ var file = getChildByClass(modal, swalClasses.file);
138
+ var range = modal.querySelector('.' + swalClasses.range + ' input');
139
+ var rangeOutput = modal.querySelector('.' + swalClasses.range + ' output');
140
+ var select = getChildByClass(modal, swalClasses.select);
141
+ var checkbox = modal.querySelector('.' + swalClasses.checkbox + ' input');
142
+ var textarea = getChildByClass(modal, swalClasses.textarea);
143
+
144
+ input.oninput = function () {
145
+ sweetAlert.resetValidationError();
146
+ };
147
+
148
+ input.onkeydown = function (event) {
149
+ setTimeout(function () {
150
+ if (event.keyCode === 13 && params.allowEnterKey) {
151
+ event.stopPropagation();
152
+ sweetAlert.clickConfirm();
153
+ }
154
+ }, 0);
155
+ };
156
+
157
+ file.onchange = function () {
158
+ sweetAlert.resetValidationError();
159
+ };
160
+
161
+ range.oninput = function () {
162
+ sweetAlert.resetValidationError();
163
+ rangeOutput.value = range.value;
164
+ };
165
+
166
+ range.onchange = function () {
167
+ sweetAlert.resetValidationError();
168
+ range.previousSibling.value = range.value;
169
+ };
170
+
171
+ select.onchange = function () {
172
+ sweetAlert.resetValidationError();
173
+ };
174
+
175
+ checkbox.onchange = function () {
176
+ sweetAlert.resetValidationError();
177
+ };
178
+
179
+ textarea.oninput = function () {
180
+ sweetAlert.resetValidationError();
181
+ };
182
+
183
+ return modal;
184
+ };
185
+
186
+ /*
187
+ * Manipulate DOM
188
+ */
189
+
190
+ var sweetHTML = ('\n <div role="dialog" aria-labelledby="' + swalClasses.title + '" aria-describedby="' + swalClasses.content + '" class="' + swalClasses.modal + '" tabindex="-1">\n <ul class="' + swalClasses.progresssteps + '"></ul>\n <div class="' + swalClasses.icon + ' ' + iconTypes.error + '">\n <span class="swal2-x-mark"><span class="swal2-x-mark-line-left"></span><span class="swal2-x-mark-line-right"></span></span>\n </div>\n <div class="' + swalClasses.icon + ' ' + iconTypes.question + '">?</div>\n <div class="' + swalClasses.icon + ' ' + iconTypes.warning + '">!</div>\n <div class="' + swalClasses.icon + ' ' + iconTypes.info + '">i</div>\n <div class="' + swalClasses.icon + ' ' + iconTypes.success + '">\n <div class="swal2-success-circular-line-left"></div>\n <span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>\n <div class="swal2-success-ring"></div> <div class="swal2-success-fix"></div>\n <div class="swal2-success-circular-line-right"></div>\n </div>\n <img class="' + swalClasses.image + '" />\n <h2 class="' + swalClasses.title + '" id="' + swalClasses.title + '"></h2>\n <div id="' + swalClasses.content + '" class="' + swalClasses.content + '"></div>\n <input class="' + swalClasses.input + '" />\n <input type="file" class="' + swalClasses.file + '" />\n <div class="' + swalClasses.range + '">\n <output></output>\n <input type="range" />\n </div>\n <select class="' + swalClasses.select + '"></select>\n <div class="' + swalClasses.radio + '"></div>\n <label for="' + swalClasses.checkbox + '" class="' + swalClasses.checkbox + '">\n <input type="checkbox" />\n </label>\n <textarea class="' + swalClasses.textarea + '"></textarea>\n <div class="' + swalClasses.validationerror + '"></div>\n <div class="' + swalClasses.buttonswrapper + '">\n <button type="button" class="' + swalClasses.confirm + '">OK</button>\n <button type="button" class="' + swalClasses.cancel + '">Cancel</button>\n </div>\n <button type="button" class="' + swalClasses.close + '" aria-label="Close this dialog">\xD7</button>\n </div>\n').replace(/(^|\n)\s*/g, '');
191
+
192
+ var getContainer = function getContainer() {
193
+ return document.body.querySelector('.' + swalClasses.container);
194
+ };
195
+
196
+ var getModal = function getModal() {
197
+ return getContainer() ? getContainer().querySelector('.' + swalClasses.modal) : null;
198
+ };
199
+
200
+ var getIcons = function getIcons() {
201
+ var modal = getModal();
202
+ return modal.querySelectorAll('.' + swalClasses.icon);
203
+ };
204
+
205
+ var elementByClass = function elementByClass(className) {
206
+ return getContainer() ? getContainer().querySelector('.' + className) : null;
207
+ };
208
+
209
+ var getTitle = function getTitle() {
210
+ return elementByClass(swalClasses.title);
211
+ };
212
+
213
+ var getContent = function getContent() {
214
+ return elementByClass(swalClasses.content);
215
+ };
216
+
217
+ var getImage = function getImage() {
218
+ return elementByClass(swalClasses.image);
219
+ };
220
+
221
+ var getButtonsWrapper = function getButtonsWrapper() {
222
+ return elementByClass(swalClasses.buttonswrapper);
223
+ };
224
+
225
+ var getProgressSteps = function getProgressSteps() {
226
+ return elementByClass(swalClasses.progresssteps);
227
+ };
228
+
229
+ var getValidationError = function getValidationError() {
230
+ return elementByClass(swalClasses.validationerror);
231
+ };
232
+
233
+ var getConfirmButton = function getConfirmButton() {
234
+ return elementByClass(swalClasses.confirm);
235
+ };
236
+
237
+ var getCancelButton = function getCancelButton() {
238
+ return elementByClass(swalClasses.cancel);
239
+ };
240
+
241
+ var getCloseButton = function getCloseButton() {
242
+ return elementByClass(swalClasses.close);
243
+ };
244
+
245
+ var getFocusableElements = function getFocusableElements(focusCancel) {
246
+ var buttons = [getConfirmButton(), getCancelButton()];
247
+ if (focusCancel) {
248
+ buttons.reverse();
249
+ }
250
+ var focusableElements = buttons.concat(Array.prototype.slice.call(getModal().querySelectorAll('button, input:not([type=hidden]), textarea, select, a, *[tabindex]:not([tabindex="-1"])')));
251
+ return uniqueArray(focusableElements);
252
+ };
253
+
254
+ var hasClass = function hasClass(elem, className) {
255
+ if (elem.classList) {
256
+ return elem.classList.contains(className);
257
+ }
258
+ return false;
259
+ };
260
+
261
+ var focusInput = function focusInput(input) {
262
+ input.focus();
263
+
264
+ // place cursor at end of text in text input
265
+ if (input.type !== 'file') {
266
+ // http://stackoverflow.com/a/2345915/1331425
267
+ var val = input.value;
268
+ input.value = '';
269
+ input.value = val;
270
+ }
271
+ };
272
+
273
+ var addClass = function addClass(elem, className) {
274
+ if (!elem || !className) {
275
+ return;
276
+ }
277
+ var classes = className.split(/\s+/).filter(Boolean);
278
+ classes.forEach(function (className) {
279
+ elem.classList.add(className);
280
+ });
281
+ };
282
+
283
+ var removeClass = function removeClass(elem, className) {
284
+ if (!elem || !className) {
285
+ return;
286
+ }
287
+ var classes = className.split(/\s+/).filter(Boolean);
288
+ classes.forEach(function (className) {
289
+ elem.classList.remove(className);
290
+ });
291
+ };
292
+
293
+ var getChildByClass = function getChildByClass(elem, className) {
294
+ for (var i = 0; i < elem.childNodes.length; i++) {
295
+ if (hasClass(elem.childNodes[i], className)) {
296
+ return elem.childNodes[i];
297
+ }
298
+ }
299
+ };
300
+
301
+ var show = function show(elem, display) {
302
+ if (!display) {
303
+ display = 'block';
304
+ }
305
+ elem.style.opacity = '';
306
+ elem.style.display = display;
307
+ };
308
+
309
+ var hide = function hide(elem) {
310
+ elem.style.opacity = '';
311
+ elem.style.display = 'none';
312
+ };
313
+
314
+ var empty = function empty(elem) {
315
+ while (elem.firstChild) {
316
+ elem.removeChild(elem.firstChild);
317
+ }
318
+ };
319
+
320
+ // borrowed from jqeury $(elem).is(':visible') implementation
321
+ var isVisible = function isVisible(elem) {
322
+ return elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length;
323
+ };
324
+
325
+ var removeStyleProperty = function removeStyleProperty(elem, property) {
326
+ if (elem.style.removeProperty) {
327
+ elem.style.removeProperty(property);
328
+ } else {
329
+ elem.style.removeAttribute(property);
330
+ }
331
+ };
332
+
333
+ var fireClick = function fireClick(node) {
334
+ if (!isVisible(node)) {
335
+ return false;
336
+ }
337
+
338
+ // Taken from http://www.nonobtrusive.com/2011/11/29/programatically-fire-crossbrowser-click-event-with-javascript/
339
+ // Then fixed for today's Chrome browser.
340
+ if (typeof MouseEvent === 'function') {
341
+ // Up-to-date approach
342
+ var mevt = new MouseEvent('click', {
343
+ view: window,
344
+ bubbles: false,
345
+ cancelable: true
346
+ });
347
+ node.dispatchEvent(mevt);
348
+ } else if (document.createEvent) {
349
+ // Fallback
350
+ var evt = document.createEvent('MouseEvents');
351
+ evt.initEvent('click', false, false);
352
+ node.dispatchEvent(evt);
353
+ } else if (document.createEventObject) {
354
+ node.fireEvent('onclick');
355
+ } else if (typeof node.onclick === 'function') {
356
+ node.onclick();
357
+ }
358
+ };
359
+
360
+ var animationEndEvent = function () {
361
+ var testEl = document.createElement('div');
362
+ var transEndEventNames = {
363
+ 'WebkitAnimation': 'webkitAnimationEnd',
364
+ 'OAnimation': 'oAnimationEnd oanimationend',
365
+ 'msAnimation': 'MSAnimationEnd',
366
+ 'animation': 'animationend'
367
+ };
368
+ for (var i in transEndEventNames) {
369
+ if (transEndEventNames.hasOwnProperty(i) && testEl.style[i] !== undefined) {
370
+ return transEndEventNames[i];
371
+ }
372
+ }
373
+
374
+ return false;
375
+ }();
376
+
377
+ // Reset previous window keydown handler and focued element
378
+ var resetPrevState = function resetPrevState() {
379
+ window.onkeydown = states.previousWindowKeyDown;
380
+ if (states.previousActiveElement && states.previousActiveElement.focus) {
381
+ var x = window.scrollX;
382
+ var y = window.scrollY;
383
+ states.previousActiveElement.focus();
384
+ if (x && y) {
385
+ // IE has no scrollX/scrollY support
386
+ window.scrollTo(x, y);
387
+ }
388
+ }
389
+ };
390
+
391
+ // Measure width of scrollbar
392
+ // https://github.com/twbs/bootstrap/blob/master/js/modal.js#L279-L286
393
+ var measureScrollbar = function measureScrollbar() {
394
+ var supportsTouch = 'ontouchstart' in window || navigator.msMaxTouchPoints;
395
+ if (supportsTouch) {
396
+ return 0;
397
+ }
398
+ var scrollDiv = document.createElement('div');
399
+ scrollDiv.style.width = '50px';
400
+ scrollDiv.style.height = '50px';
401
+ scrollDiv.style.overflow = 'scroll';
402
+ document.body.appendChild(scrollDiv);
403
+ var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
404
+ document.body.removeChild(scrollDiv);
405
+ return scrollbarWidth;
406
+ };
407
+
408
+ // JavaScript Debounce Function
409
+ // Simplivied version of https://davidwalsh.name/javascript-debounce-function
410
+ var debounce = function debounce(func, wait) {
411
+ var timeout = void 0;
412
+ return function () {
413
+ var later = function later() {
414
+ timeout = null;
415
+ func();
416
+ };
417
+ clearTimeout(timeout);
418
+ timeout = setTimeout(later, wait);
419
+ };
420
+ };
421
+
422
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
423
+ return typeof obj;
424
+ } : function (obj) {
425
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
426
+ };
427
+
428
+
429
+
430
+
431
+
432
+
433
+
434
+
435
+
436
+
437
+
438
+
439
+
440
+
441
+
442
+
443
+
444
+
445
+
446
+
447
+
448
+ var _extends = Object.assign || function (target) {
449
+ for (var i = 1; i < arguments.length; i++) {
450
+ var source = arguments[i];
451
+
452
+ for (var key in source) {
453
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
454
+ target[key] = source[key];
455
+ }
456
+ }
457
+ }
458
+
459
+ return target;
460
+ };
461
+
462
+ var modalParams = _extends({}, defaultParams);
463
+ var queue = [];
464
+ var swal2Observer = void 0;
465
+
466
+ /*
467
+ * Set type, text and actions on modal
468
+ */
469
+ var setParameters = function setParameters(params) {
470
+ var modal = getModal() || init(params);
471
+
472
+ for (var param in params) {
473
+ if (!defaultParams.hasOwnProperty(param) && param !== 'extraParams') {
474
+ console.warn('SweetAlert2: Unknown parameter "' + param + '"');
475
+ }
476
+ }
477
+
478
+ // Set modal width
479
+ modal.style.width = typeof params.width === 'number' ? params.width + 'px' : params.width;
480
+
481
+ modal.style.padding = params.padding + 'px';
482
+ modal.style.background = params.background;
483
+ var successIconParts = modal.querySelectorAll('[class^=swal2-success-circular-line], .swal2-success-fix');
484
+ for (var i = 0; i < successIconParts.length; i++) {
485
+ successIconParts[i].style.background = params.background;
486
+ }
487
+
488
+ var title = getTitle();
489
+ var content = getContent();
490
+ var buttonsWrapper = getButtonsWrapper();
491
+ var confirmButton = getConfirmButton();
492
+ var cancelButton = getCancelButton();
493
+ var closeButton = getCloseButton();
494
+
495
+ // Title
496
+ if (params.titleText) {
497
+ title.innerText = params.titleText;
498
+ } else {
499
+ title.innerHTML = params.title.split('\n').join('<br />');
500
+ }
501
+
502
+ // Content
503
+ if (params.text || params.html) {
504
+ if (_typeof(params.html) === 'object') {
505
+ content.innerHTML = '';
506
+ if (0 in params.html) {
507
+ for (var _i = 0; _i in params.html; _i++) {
508
+ content.appendChild(params.html[_i].cloneNode(true));
509
+ }
510
+ } else {
511
+ content.appendChild(params.html.cloneNode(true));
512
+ }
513
+ } else if (params.html) {
514
+ content.innerHTML = params.html;
515
+ } else if (params.text) {
516
+ content.textContent = params.text;
517
+ }
518
+ show(content);
519
+ } else {
520
+ hide(content);
521
+ }
522
+
523
+ // Close button
524
+ if (params.showCloseButton) {
525
+ show(closeButton);
526
+ } else {
527
+ hide(closeButton);
528
+ }
529
+
530
+ // Custom Class
531
+ modal.className = swalClasses.modal;
532
+ if (params.customClass) {
533
+ addClass(modal, params.customClass);
534
+ }
535
+
536
+ // Progress steps
537
+ var progressStepsContainer = getProgressSteps();
538
+ var currentProgressStep = parseInt(params.currentProgressStep === null ? sweetAlert.getQueueStep() : params.currentProgressStep, 10);
539
+ if (params.progressSteps.length) {
540
+ show(progressStepsContainer);
541
+ empty(progressStepsContainer);
542
+ if (currentProgressStep >= params.progressSteps.length) {
543
+ console.warn('SweetAlert2: Invalid currentProgressStep parameter, it should be less than progressSteps.length ' + '(currentProgressStep like JS arrays starts from 0)');
544
+ }
545
+ params.progressSteps.forEach(function (step, index) {
546
+ var circle = document.createElement('li');
547
+ addClass(circle, swalClasses.progresscircle);
548
+ circle.innerHTML = step;
549
+ if (index === currentProgressStep) {
550
+ addClass(circle, swalClasses.activeprogressstep);
551
+ }
552
+ progressStepsContainer.appendChild(circle);
553
+ if (index !== params.progressSteps.length - 1) {
554
+ var line = document.createElement('li');
555
+ addClass(line, swalClasses.progressline);
556
+ line.style.width = params.progressStepsDistance;
557
+ progressStepsContainer.appendChild(line);
558
+ }
559
+ });
560
+ } else {
561
+ hide(progressStepsContainer);
562
+ }
563
+
564
+ // Icon
565
+ var icons = getIcons();
566
+ for (var _i2 = 0; _i2 < icons.length; _i2++) {
567
+ hide(icons[_i2]);
568
+ }
569
+ if (params.type) {
570
+ var validType = false;
571
+ for (var iconType in iconTypes) {
572
+ if (params.type === iconType) {
573
+ validType = true;
574
+ break;
575
+ }
576
+ }
577
+ if (!validType) {
578
+ console.error('SweetAlert2: Unknown alert type: ' + params.type);
579
+ return false;
580
+ }
581
+ var icon = modal.querySelector('.' + swalClasses.icon + '.' + iconTypes[params.type]);
582
+ show(icon);
583
+
584
+ // Animate icon
585
+ if (params.animation) {
586
+ switch (params.type) {
587
+ case 'success':
588
+ addClass(icon, 'swal2-animate-success-icon');
589
+ addClass(icon.querySelector('.swal2-success-line-tip'), 'swal2-animate-success-line-tip');
590
+ addClass(icon.querySelector('.swal2-success-line-long'), 'swal2-animate-success-line-long');
591
+ break;
592
+ case 'error':
593
+ addClass(icon, 'swal2-animate-error-icon');
594
+ addClass(icon.querySelector('.swal2-x-mark'), 'swal2-animate-x-mark');
595
+ break;
596
+ default:
597
+ break;
598
+ }
599
+ }
600
+ }
601
+
602
+ // Custom image
603
+ var image = getImage();
604
+ if (params.imageUrl) {
605
+ image.setAttribute('src', params.imageUrl);
606
+ show(image);
607
+
608
+ if (params.imageWidth) {
609
+ image.setAttribute('width', params.imageWidth);
610
+ } else {
611
+ image.removeAttribute('width');
612
+ }
613
+
614
+ if (params.imageHeight) {
615
+ image.setAttribute('height', params.imageHeight);
616
+ } else {
617
+ image.removeAttribute('height');
618
+ }
619
+
620
+ image.className = swalClasses.image;
621
+ if (params.imageClass) {
622
+ addClass(image, params.imageClass);
623
+ }
624
+ } else {
625
+ hide(image);
626
+ }
627
+
628
+ // Cancel button
629
+ if (params.showCancelButton) {
630
+ cancelButton.style.display = 'inline-block';
631
+ } else {
632
+ hide(cancelButton);
633
+ }
634
+
635
+ // Confirm button
636
+ if (params.showConfirmButton) {
637
+ removeStyleProperty(confirmButton, 'display');
638
+ } else {
639
+ hide(confirmButton);
640
+ }
641
+
642
+ // Buttons wrapper
643
+ if (!params.showConfirmButton && !params.showCancelButton) {
644
+ hide(buttonsWrapper);
645
+ } else {
646
+ show(buttonsWrapper);
647
+ }
648
+
649
+ // Edit text on cancel and confirm buttons
650
+ confirmButton.innerHTML = params.confirmButtonText;
651
+ cancelButton.innerHTML = params.cancelButtonText;
652
+
653
+ // Set buttons to selected background colors
654
+ if (params.buttonsStyling) {
655
+ confirmButton.style.backgroundColor = params.confirmButtonColor;
656
+ cancelButton.style.backgroundColor = params.cancelButtonColor;
657
+ }
658
+
659
+ // Add buttons custom classes
660
+ confirmButton.className = swalClasses.confirm;
661
+ addClass(confirmButton, params.confirmButtonClass);
662
+ cancelButton.className = swalClasses.cancel;
663
+ addClass(cancelButton, params.cancelButtonClass);
664
+
665
+ // Buttons styling
666
+ if (params.buttonsStyling) {
667
+ addClass(confirmButton, swalClasses.styled);
668
+ addClass(cancelButton, swalClasses.styled);
669
+ } else {
670
+ removeClass(confirmButton, swalClasses.styled);
671
+ removeClass(cancelButton, swalClasses.styled);
672
+
673
+ confirmButton.style.backgroundColor = confirmButton.style.borderLeftColor = confirmButton.style.borderRightColor = '';
674
+ cancelButton.style.backgroundColor = cancelButton.style.borderLeftColor = cancelButton.style.borderRightColor = '';
675
+ }
676
+
677
+ // CSS animation
678
+ if (params.animation === true) {
679
+ removeClass(modal, swalClasses.noanimation);
680
+ } else {
681
+ addClass(modal, swalClasses.noanimation);
682
+ }
683
+ };
684
+
685
+ /*
686
+ * Animations
687
+ */
688
+ var openModal = function openModal(animation, onComplete) {
689
+ var container = getContainer();
690
+ var modal = getModal();
691
+
692
+ if (animation) {
693
+ addClass(modal, swalClasses.show);
694
+ addClass(container, swalClasses.fade);
695
+ removeClass(modal, swalClasses.hide);
696
+ } else {
697
+ removeClass(modal, swalClasses.fade);
698
+ }
699
+ show(modal);
700
+
701
+ // scrolling is 'hidden' until animation is done, after that 'auto'
702
+ container.style.overflowY = 'hidden';
703
+ if (animationEndEvent && !hasClass(modal, swalClasses.noanimation)) {
704
+ modal.addEventListener(animationEndEvent, function swalCloseEventFinished() {
705
+ modal.removeEventListener(animationEndEvent, swalCloseEventFinished);
706
+ container.style.overflowY = 'auto';
707
+ });
708
+ } else {
709
+ container.style.overflowY = 'auto';
710
+ }
711
+
712
+ addClass(document.documentElement, swalClasses.shown);
713
+ addClass(document.body, swalClasses.shown);
714
+ addClass(container, swalClasses.shown);
715
+ fixScrollbar();
716
+ iOSfix();
717
+ states.previousActiveElement = document.activeElement;
718
+ if (onComplete !== null && typeof onComplete === 'function') {
719
+ setTimeout(function () {
720
+ onComplete(modal);
721
+ });
722
+ }
723
+ };
724
+
725
+ var fixScrollbar = function fixScrollbar() {
726
+ // for queues, do not do this more than once
727
+ if (states.previousBodyPadding !== null) {
728
+ return;
729
+ }
730
+ // if the body has overflow
731
+ if (document.body.scrollHeight > window.innerHeight) {
732
+ // add padding so the content doesn't shift after removal of scrollbar
733
+ states.previousBodyPadding = document.body.style.paddingRight;
734
+ document.body.style.paddingRight = measureScrollbar() + 'px';
735
+ }
736
+ };
737
+
738
+ var undoScrollbar = function undoScrollbar() {
739
+ if (states.previousBodyPadding !== null) {
740
+ document.body.style.paddingRight = states.previousBodyPadding;
741
+ states.previousBodyPadding = null;
742
+ }
743
+ };
744
+
745
+ // Fix iOS scrolling http://stackoverflow.com/q/39626302/1331425
746
+ var iOSfix = function iOSfix() {
747
+ var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
748
+ if (iOS && !hasClass(document.body, swalClasses.iosfix)) {
749
+ var offset = document.body.scrollTop;
750
+ document.body.style.top = offset * -1 + 'px';
751
+ addClass(document.body, swalClasses.iosfix);
752
+ }
753
+ };
754
+
755
+ var undoIOSfix = function undoIOSfix() {
756
+ if (hasClass(document.body, swalClasses.iosfix)) {
757
+ var offset = parseInt(document.body.style.top, 10);
758
+ removeClass(document.body, swalClasses.iosfix);
759
+ document.body.style.top = '';
760
+ document.body.scrollTop = offset * -1;
761
+ }
762
+ };
763
+
764
+ // SweetAlert entry point
765
+ var sweetAlert = function sweetAlert() {
766
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
767
+ args[_key] = arguments[_key];
768
+ }
769
+
770
+ if (args[0] === undefined) {
771
+ console.error('SweetAlert2 expects at least 1 attribute!');
772
+ return false;
773
+ }
774
+
775
+ var params = _extends({}, modalParams);
776
+
777
+ switch (_typeof(args[0])) {
778
+ case 'string':
779
+ params.title = args[0];
780
+ params.html = args[1];
781
+ params.type = args[2];
782
+
783
+ break;
784
+
785
+ case 'object':
786
+ _extends(params, args[0]);
787
+ params.extraParams = args[0].extraParams;
788
+
789
+ if (params.input === 'email' && params.inputValidator === null) {
790
+ params.inputValidator = function (email) {
791
+ return new Promise(function (resolve, reject) {
792
+ var emailRegex = /^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/;
793
+ if (emailRegex.test(email)) {
794
+ resolve();
795
+ } else {
796
+ reject('Invalid email address');
797
+ }
798
+ });
799
+ };
800
+ }
801
+
802
+ if (params.input === 'url' && params.inputValidator === null) {
803
+ params.inputValidator = function (url) {
804
+ return new Promise(function (resolve, reject) {
805
+ // taken from https://stackoverflow.com/a/3809435/1331425
806
+ var urlRegex = /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)$/;
807
+ if (urlRegex.test(url)) {
808
+ resolve();
809
+ } else {
810
+ reject('Invalid URL');
811
+ }
812
+ });
813
+ };
814
+ }
815
+ break;
816
+
817
+ default:
818
+ console.error('SweetAlert2: Unexpected type of argument! Expected "string" or "object", got ' + _typeof(args[0]));
819
+ return false;
820
+ }
821
+
822
+ setParameters(params);
823
+
824
+ var container = getContainer();
825
+ var modal = getModal();
826
+
827
+ return new Promise(function (resolve, reject) {
828
+ // Close on timer
829
+ if (params.timer) {
830
+ modal.timeout = setTimeout(function () {
831
+ sweetAlert.closeModal(params.onClose);
832
+ if (params.useRejections) {
833
+ reject('timer');
834
+ } else {
835
+ resolve({ dismiss: 'timer' });
836
+ }
837
+ }, params.timer);
838
+ }
839
+
840
+ // Get input element by specified type or, if type isn't specified, by params.input
841
+ var getInput = function getInput(inputType) {
842
+ inputType = inputType || params.input;
843
+ if (!inputType) {
844
+ return null;
845
+ }
846
+ switch (inputType) {
847
+ case 'select':
848
+ case 'textarea':
849
+ case 'file':
850
+ return getChildByClass(modal, swalClasses[inputType]);
851
+ case 'checkbox':
852
+ return modal.querySelector('.' + swalClasses.checkbox + ' input');
853
+ case 'radio':
854
+ return modal.querySelector('.' + swalClasses.radio + ' input:checked') || modal.querySelector('.' + swalClasses.radio + ' input:first-child');
855
+ case 'range':
856
+ return modal.querySelector('.' + swalClasses.range + ' input');
857
+ default:
858
+ return getChildByClass(modal, swalClasses.input);
859
+ }
860
+ };
861
+
862
+ // Get the value of the modal input
863
+ var getInputValue = function getInputValue() {
864
+ var input = getInput();
865
+ if (!input) {
866
+ return null;
867
+ }
868
+ switch (params.input) {
869
+ case 'checkbox':
870
+ return input.checked ? 1 : 0;
871
+ case 'radio':
872
+ return input.checked ? input.value : null;
873
+ case 'file':
874
+ return input.files.length ? input.files[0] : null;
875
+ default:
876
+ return params.inputAutoTrim ? input.value.trim() : input.value;
877
+ }
878
+ };
879
+
880
+ // input autofocus
881
+ if (params.input) {
882
+ setTimeout(function () {
883
+ var input = getInput();
884
+ if (input) {
885
+ focusInput(input);
886
+ }
887
+ }, 0);
888
+ }
889
+
890
+ var confirm = function confirm(value) {
891
+ if (params.showLoaderOnConfirm) {
892
+ sweetAlert.showLoading();
893
+ }
894
+
895
+ if (params.preConfirm) {
896
+ params.preConfirm(value, params.extraParams).then(function (preConfirmValue) {
897
+ sweetAlert.closeModal(params.onClose);
898
+ resolve(preConfirmValue || value);
899
+ }, function (error) {
900
+ sweetAlert.hideLoading();
901
+ if (error) {
902
+ sweetAlert.showValidationError(error);
903
+ }
904
+ });
905
+ } else {
906
+ sweetAlert.closeModal(params.onClose);
907
+ if (params.useRejections) {
908
+ resolve(value);
909
+ } else {
910
+ resolve({ value: value });
911
+ }
912
+ }
913
+ };
914
+
915
+ // Mouse interactions
916
+ var onButtonEvent = function onButtonEvent(event) {
917
+ var e = event || window.event;
918
+ var target = e.target || e.srcElement;
919
+ var confirmButton = getConfirmButton();
920
+ var cancelButton = getCancelButton();
921
+ var targetedConfirm = confirmButton && (confirmButton === target || confirmButton.contains(target));
922
+ var targetedCancel = cancelButton && (cancelButton === target || cancelButton.contains(target));
923
+
924
+ switch (e.type) {
925
+ case 'mouseover':
926
+ case 'mouseup':
927
+ if (params.buttonsStyling) {
928
+ if (targetedConfirm) {
929
+ confirmButton.style.backgroundColor = colorLuminance(params.confirmButtonColor, -0.1);
930
+ } else if (targetedCancel) {
931
+ cancelButton.style.backgroundColor = colorLuminance(params.cancelButtonColor, -0.1);
932
+ }
933
+ }
934
+ break;
935
+ case 'mouseout':
936
+ if (params.buttonsStyling) {
937
+ if (targetedConfirm) {
938
+ confirmButton.style.backgroundColor = params.confirmButtonColor;
939
+ } else if (targetedCancel) {
940
+ cancelButton.style.backgroundColor = params.cancelButtonColor;
941
+ }
942
+ }
943
+ break;
944
+ case 'mousedown':
945
+ if (params.buttonsStyling) {
946
+ if (targetedConfirm) {
947
+ confirmButton.style.backgroundColor = colorLuminance(params.confirmButtonColor, -0.2);
948
+ } else if (targetedCancel) {
949
+ cancelButton.style.backgroundColor = colorLuminance(params.cancelButtonColor, -0.2);
950
+ }
951
+ }
952
+ break;
953
+ case 'click':
954
+ // Clicked 'confirm'
955
+ if (targetedConfirm && sweetAlert.isVisible()) {
956
+ sweetAlert.disableButtons();
957
+ if (params.input) {
958
+ var inputValue = getInputValue();
959
+
960
+ if (params.inputValidator) {
961
+ sweetAlert.disableInput();
962
+ params.inputValidator(inputValue, params.extraParams).then(function () {
963
+ sweetAlert.enableButtons();
964
+ sweetAlert.enableInput();
965
+ confirm(inputValue);
966
+ }, function (error) {
967
+ sweetAlert.enableButtons();
968
+ sweetAlert.enableInput();
969
+ if (error) {
970
+ sweetAlert.showValidationError(error);
971
+ }
972
+ });
973
+ } else {
974
+ confirm(inputValue);
975
+ }
976
+ } else {
977
+ confirm(true);
978
+ }
979
+
980
+ // Clicked 'cancel'
981
+ } else if (targetedCancel && sweetAlert.isVisible()) {
982
+ sweetAlert.disableButtons();
983
+ sweetAlert.closeModal(params.onClose);
984
+ if (params.useRejections) {
985
+ reject('cancel');
986
+ } else {
987
+ resolve({ dismiss: 'cancel' });
988
+ }
989
+ }
990
+ break;
991
+ default:
992
+ }
993
+ };
994
+
995
+ var buttons = modal.querySelectorAll('button');
996
+ for (var i = 0; i < buttons.length; i++) {
997
+ buttons[i].onclick = onButtonEvent;
998
+ buttons[i].onmouseover = onButtonEvent;
999
+ buttons[i].onmouseout = onButtonEvent;
1000
+ buttons[i].onmousedown = onButtonEvent;
1001
+ }
1002
+
1003
+ // Closing modal by close button
1004
+ getCloseButton().onclick = function () {
1005
+ sweetAlert.closeModal(params.onClose);
1006
+ if (params.useRejections) {
1007
+ reject('close');
1008
+ } else {
1009
+ resolve({ dismiss: 'close' });
1010
+ }
1011
+ };
1012
+
1013
+ // Closing modal by overlay click
1014
+ container.onclick = function (e) {
1015
+ if (e.target !== container) {
1016
+ return;
1017
+ }
1018
+ if (params.allowOutsideClick) {
1019
+ sweetAlert.closeModal(params.onClose);
1020
+ if (params.useRejections) {
1021
+ reject('overlay');
1022
+ } else {
1023
+ resolve({ dismiss: 'overlay' });
1024
+ }
1025
+ }
1026
+ };
1027
+
1028
+ var buttonsWrapper = getButtonsWrapper();
1029
+ var confirmButton = getConfirmButton();
1030
+ var cancelButton = getCancelButton();
1031
+
1032
+ // Reverse buttons (Confirm on the right side)
1033
+ if (params.reverseButtons) {
1034
+ confirmButton.parentNode.insertBefore(cancelButton, confirmButton);
1035
+ } else {
1036
+ confirmButton.parentNode.insertBefore(confirmButton, cancelButton);
1037
+ }
1038
+
1039
+ // Focus handling
1040
+ var setFocus = function setFocus(index, increment) {
1041
+ var focusableElements = getFocusableElements(params.focusCancel);
1042
+ // search for visible elements and select the next possible match
1043
+ for (var _i3 = 0; _i3 < focusableElements.length; _i3++) {
1044
+ index = index + increment;
1045
+
1046
+ // rollover to first item
1047
+ if (index === focusableElements.length) {
1048
+ index = 0;
1049
+
1050
+ // go to last item
1051
+ } else if (index === -1) {
1052
+ index = focusableElements.length - 1;
1053
+ }
1054
+
1055
+ // determine if element is visible
1056
+ var el = focusableElements[index];
1057
+ if (isVisible(el)) {
1058
+ return el.focus();
1059
+ }
1060
+ }
1061
+ };
1062
+
1063
+ var handleKeyDown = function handleKeyDown(event) {
1064
+ var e = event || window.event;
1065
+ var keyCode = e.keyCode || e.which;
1066
+
1067
+ if ([9, 13, 32, 27, 37, 38, 39, 40].indexOf(keyCode) === -1) {
1068
+ // Don't do work on keys we don't care about.
1069
+ return;
1070
+ }
1071
+
1072
+ var targetElement = e.target || e.srcElement;
1073
+
1074
+ var focusableElements = getFocusableElements(params.focusCancel);
1075
+ var btnIndex = -1; // Find the button - note, this is a nodelist, not an array.
1076
+ for (var _i4 = 0; _i4 < focusableElements.length; _i4++) {
1077
+ if (targetElement === focusableElements[_i4]) {
1078
+ btnIndex = _i4;
1079
+ break;
1080
+ }
1081
+ }
1082
+
1083
+ // TAB
1084
+ if (keyCode === 9) {
1085
+ if (!e.shiftKey) {
1086
+ // Cycle to the next button
1087
+ setFocus(btnIndex, 1);
1088
+ } else {
1089
+ // Cycle to the prev button
1090
+ setFocus(btnIndex, -1);
1091
+ }
1092
+ e.stopPropagation();
1093
+ e.preventDefault();
1094
+
1095
+ // ARROWS - switch focus between buttons
1096
+ } else if (keyCode === 37 || keyCode === 38 || keyCode === 39 || keyCode === 40) {
1097
+ // focus Cancel button if Confirm button is currently focused
1098
+ if (document.activeElement === confirmButton && isVisible(cancelButton)) {
1099
+ cancelButton.focus();
1100
+ // and vice versa
1101
+ } else if (document.activeElement === cancelButton && isVisible(confirmButton)) {
1102
+ confirmButton.focus();
1103
+ }
1104
+
1105
+ // ENTER/SPACE
1106
+ } else if (keyCode === 13 || keyCode === 32) {
1107
+ if (btnIndex === -1 && params.allowEnterKey) {
1108
+ // ENTER/SPACE clicked outside of a button.
1109
+ if (params.focusCancel) {
1110
+ fireClick(cancelButton, e);
1111
+ } else {
1112
+ fireClick(confirmButton, e);
1113
+ }
1114
+ e.stopPropagation();
1115
+ e.preventDefault();
1116
+ }
1117
+
1118
+ // ESC
1119
+ } else if (keyCode === 27 && params.allowEscapeKey === true) {
1120
+ sweetAlert.closeModal(params.onClose);
1121
+ if (params.useRejections) {
1122
+ reject('esc');
1123
+ } else {
1124
+ resolve({ dismiss: 'esc' });
1125
+ }
1126
+ }
1127
+ };
1128
+
1129
+ if (!window.onkeydown || window.onkeydown.toString() !== handleKeyDown.toString()) {
1130
+ states.previousWindowKeyDown = window.onkeydown;
1131
+ window.onkeydown = handleKeyDown;
1132
+ }
1133
+
1134
+ // Loading state
1135
+ if (params.buttonsStyling) {
1136
+ confirmButton.style.borderLeftColor = params.confirmButtonColor;
1137
+ confirmButton.style.borderRightColor = params.confirmButtonColor;
1138
+ }
1139
+
1140
+ /**
1141
+ * Show spinner instead of Confirm button and disable Cancel button
1142
+ */
1143
+ sweetAlert.hideLoading = sweetAlert.disableLoading = function () {
1144
+ if (!params.showConfirmButton) {
1145
+ hide(confirmButton);
1146
+ if (!params.showCancelButton) {
1147
+ hide(getButtonsWrapper());
1148
+ }
1149
+ }
1150
+ removeClass(buttonsWrapper, swalClasses.loading);
1151
+ removeClass(modal, swalClasses.loading);
1152
+ confirmButton.disabled = false;
1153
+ cancelButton.disabled = false;
1154
+ };
1155
+
1156
+ sweetAlert.getTitle = function () {
1157
+ return getTitle();
1158
+ };
1159
+ sweetAlert.getContent = function () {
1160
+ return getContent();
1161
+ };
1162
+ sweetAlert.getInput = function () {
1163
+ return getInput();
1164
+ };
1165
+ sweetAlert.getImage = function () {
1166
+ return getImage();
1167
+ };
1168
+ sweetAlert.getButtonsWrapper = function () {
1169
+ return getButtonsWrapper();
1170
+ };
1171
+ sweetAlert.getConfirmButton = function () {
1172
+ return getConfirmButton();
1173
+ };
1174
+ sweetAlert.getCancelButton = function () {
1175
+ return getCancelButton();
1176
+ };
1177
+
1178
+ sweetAlert.enableButtons = function () {
1179
+ confirmButton.disabled = false;
1180
+ cancelButton.disabled = false;
1181
+ };
1182
+
1183
+ sweetAlert.disableButtons = function () {
1184
+ confirmButton.disabled = true;
1185
+ cancelButton.disabled = true;
1186
+ };
1187
+
1188
+ sweetAlert.enableConfirmButton = function () {
1189
+ confirmButton.disabled = false;
1190
+ };
1191
+
1192
+ sweetAlert.disableConfirmButton = function () {
1193
+ confirmButton.disabled = true;
1194
+ };
1195
+
1196
+ sweetAlert.enableInput = function () {
1197
+ var input = getInput();
1198
+ if (!input) {
1199
+ return false;
1200
+ }
1201
+ if (input.type === 'radio') {
1202
+ var radiosContainer = input.parentNode.parentNode;
1203
+ var radios = radiosContainer.querySelectorAll('input');
1204
+ for (var _i5 = 0; _i5 < radios.length; _i5++) {
1205
+ radios[_i5].disabled = false;
1206
+ }
1207
+ } else {
1208
+ input.disabled = false;
1209
+ }
1210
+ };
1211
+
1212
+ sweetAlert.disableInput = function () {
1213
+ var input = getInput();
1214
+ if (!input) {
1215
+ return false;
1216
+ }
1217
+ if (input && input.type === 'radio') {
1218
+ var radiosContainer = input.parentNode.parentNode;
1219
+ var radios = radiosContainer.querySelectorAll('input');
1220
+ for (var _i6 = 0; _i6 < radios.length; _i6++) {
1221
+ radios[_i6].disabled = true;
1222
+ }
1223
+ } else {
1224
+ input.disabled = true;
1225
+ }
1226
+ };
1227
+
1228
+ // Set modal min-height to disable scrolling inside the modal
1229
+ sweetAlert.recalculateHeight = debounce(function () {
1230
+ var modal = getModal();
1231
+ if (!modal) {
1232
+ return;
1233
+ }
1234
+ var prevState = modal.style.display;
1235
+ modal.style.minHeight = '';
1236
+ show(modal);
1237
+ modal.style.minHeight = modal.scrollHeight + 1 + 'px';
1238
+ modal.style.display = prevState;
1239
+ }, 50);
1240
+
1241
+ // Show block with validation error
1242
+ sweetAlert.showValidationError = function (error) {
1243
+ var validationError = getValidationError();
1244
+ validationError.innerHTML = error;
1245
+ show(validationError);
1246
+
1247
+ var input = getInput();
1248
+ if (input) {
1249
+ focusInput(input);
1250
+ addClass(input, swalClasses.inputerror);
1251
+ }
1252
+ };
1253
+
1254
+ // Hide block with validation error
1255
+ sweetAlert.resetValidationError = function () {
1256
+ var validationError = getValidationError();
1257
+ hide(validationError);
1258
+ sweetAlert.recalculateHeight();
1259
+
1260
+ var input = getInput();
1261
+ if (input) {
1262
+ removeClass(input, swalClasses.inputerror);
1263
+ }
1264
+ };
1265
+
1266
+ sweetAlert.getProgressSteps = function () {
1267
+ return params.progressSteps;
1268
+ };
1269
+
1270
+ sweetAlert.setProgressSteps = function (progressSteps) {
1271
+ params.progressSteps = progressSteps;
1272
+ setParameters(params);
1273
+ };
1274
+
1275
+ sweetAlert.showProgressSteps = function () {
1276
+ show(getProgressSteps());
1277
+ };
1278
+
1279
+ sweetAlert.hideProgressSteps = function () {
1280
+ hide(getProgressSteps());
1281
+ };
1282
+
1283
+ sweetAlert.enableButtons();
1284
+ sweetAlert.hideLoading();
1285
+ sweetAlert.resetValidationError();
1286
+
1287
+ // inputs
1288
+ var inputTypes = ['input', 'file', 'range', 'select', 'radio', 'checkbox', 'textarea'];
1289
+ var input = void 0;
1290
+ for (var _i7 = 0; _i7 < inputTypes.length; _i7++) {
1291
+ var inputClass = swalClasses[inputTypes[_i7]];
1292
+ var inputContainer = getChildByClass(modal, inputClass);
1293
+ input = getInput(inputTypes[_i7]);
1294
+
1295
+ // set attributes
1296
+ if (input) {
1297
+ for (var j in input.attributes) {
1298
+ if (input.attributes.hasOwnProperty(j)) {
1299
+ var attrName = input.attributes[j].name;
1300
+ if (attrName !== 'type' && attrName !== 'value') {
1301
+ input.removeAttribute(attrName);
1302
+ }
1303
+ }
1304
+ }
1305
+ for (var attr in params.inputAttributes) {
1306
+ input.setAttribute(attr, params.inputAttributes[attr]);
1307
+ }
1308
+ }
1309
+
1310
+ // set class
1311
+ inputContainer.className = inputClass;
1312
+ if (params.inputClass) {
1313
+ addClass(inputContainer, params.inputClass);
1314
+ }
1315
+
1316
+ hide(inputContainer);
1317
+ }
1318
+
1319
+ var populateInputOptions = void 0;
1320
+ switch (params.input) {
1321
+ case 'text':
1322
+ case 'email':
1323
+ case 'password':
1324
+ case 'number':
1325
+ case 'tel':
1326
+ case 'url':
1327
+ input = getChildByClass(modal, swalClasses.input);
1328
+ input.value = params.inputValue;
1329
+ input.placeholder = params.inputPlaceholder;
1330
+ input.type = params.input;
1331
+ show(input);
1332
+ break;
1333
+ case 'file':
1334
+ input = getChildByClass(modal, swalClasses.file);
1335
+ input.placeholder = params.inputPlaceholder;
1336
+ input.type = params.input;
1337
+ show(input);
1338
+ break;
1339
+ case 'range':
1340
+ var range = getChildByClass(modal, swalClasses.range);
1341
+ var rangeInput = range.querySelector('input');
1342
+ var rangeOutput = range.querySelector('output');
1343
+ rangeInput.value = params.inputValue;
1344
+ rangeInput.type = params.input;
1345
+ rangeOutput.value = params.inputValue;
1346
+ show(range);
1347
+ break;
1348
+ case 'select':
1349
+ var select = getChildByClass(modal, swalClasses.select);
1350
+ select.innerHTML = '';
1351
+ if (params.inputPlaceholder) {
1352
+ var placeholder = document.createElement('option');
1353
+ placeholder.innerHTML = params.inputPlaceholder;
1354
+ placeholder.value = '';
1355
+ placeholder.disabled = true;
1356
+ placeholder.selected = true;
1357
+ select.appendChild(placeholder);
1358
+ }
1359
+ populateInputOptions = function populateInputOptions(inputOptions) {
1360
+ for (var optionValue in inputOptions) {
1361
+ var option = document.createElement('option');
1362
+ option.value = optionValue;
1363
+ option.innerHTML = inputOptions[optionValue];
1364
+ if (params.inputValue === optionValue) {
1365
+ option.selected = true;
1366
+ }
1367
+ select.appendChild(option);
1368
+ }
1369
+ show(select);
1370
+ select.focus();
1371
+ };
1372
+ break;
1373
+ case 'radio':
1374
+ var radio = getChildByClass(modal, swalClasses.radio);
1375
+ radio.innerHTML = '';
1376
+ populateInputOptions = function populateInputOptions(inputOptions) {
1377
+ for (var radioValue in inputOptions) {
1378
+ var radioInput = document.createElement('input');
1379
+ var radioLabel = document.createElement('label');
1380
+ var radioLabelSpan = document.createElement('span');
1381
+ radioInput.type = 'radio';
1382
+ radioInput.name = swalClasses.radio;
1383
+ radioInput.value = radioValue;
1384
+ if (params.inputValue === radioValue) {
1385
+ radioInput.checked = true;
1386
+ }
1387
+ radioLabelSpan.innerHTML = inputOptions[radioValue];
1388
+ radioLabel.appendChild(radioInput);
1389
+ radioLabel.appendChild(radioLabelSpan);
1390
+ radioLabel.for = radioInput.id;
1391
+ radio.appendChild(radioLabel);
1392
+ }
1393
+ show(radio);
1394
+ var radios = radio.querySelectorAll('input');
1395
+ if (radios.length) {
1396
+ radios[0].focus();
1397
+ }
1398
+ };
1399
+ break;
1400
+ case 'checkbox':
1401
+ var checkbox = getChildByClass(modal, swalClasses.checkbox);
1402
+ var checkboxInput = getInput('checkbox');
1403
+ checkboxInput.type = 'checkbox';
1404
+ checkboxInput.value = 1;
1405
+ checkboxInput.id = swalClasses.checkbox;
1406
+ checkboxInput.checked = Boolean(params.inputValue);
1407
+ var label = checkbox.getElementsByTagName('span');
1408
+ if (label.length) {
1409
+ checkbox.removeChild(label[0]);
1410
+ }
1411
+ label = document.createElement('span');
1412
+ label.innerHTML = params.inputPlaceholder;
1413
+ checkbox.appendChild(label);
1414
+ show(checkbox);
1415
+ break;
1416
+ case 'textarea':
1417
+ var textarea = getChildByClass(modal, swalClasses.textarea);
1418
+ textarea.value = params.inputValue;
1419
+ textarea.placeholder = params.inputPlaceholder;
1420
+ show(textarea);
1421
+ break;
1422
+ case null:
1423
+ break;
1424
+ default:
1425
+ console.error('SweetAlert2: Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "' + params.input + '"');
1426
+ break;
1427
+ }
1428
+
1429
+ if (params.input === 'select' || params.input === 'radio') {
1430
+ if (params.inputOptions instanceof Promise) {
1431
+ sweetAlert.showLoading();
1432
+ params.inputOptions.then(function (inputOptions) {
1433
+ sweetAlert.hideLoading();
1434
+ populateInputOptions(inputOptions);
1435
+ });
1436
+ } else if (_typeof(params.inputOptions) === 'object') {
1437
+ populateInputOptions(params.inputOptions);
1438
+ } else {
1439
+ console.error('SweetAlert2: Unexpected type of inputOptions! Expected object or Promise, got ' + _typeof(params.inputOptions));
1440
+ }
1441
+ }
1442
+
1443
+ openModal(params.animation, params.onOpen);
1444
+
1445
+ // Focus the first element (input or button)
1446
+ if (params.allowEnterKey) {
1447
+ setFocus(-1, 1);
1448
+ } else {
1449
+ if (document.activeElement) {
1450
+ document.activeElement.blur();
1451
+ }
1452
+ }
1453
+
1454
+ // fix scroll
1455
+ getContainer().scrollTop = 0;
1456
+
1457
+ // Observe changes inside the modal and adjust height
1458
+ if (typeof MutationObserver !== 'undefined' && !swal2Observer) {
1459
+ swal2Observer = new MutationObserver(sweetAlert.recalculateHeight);
1460
+ swal2Observer.observe(modal, { childList: true, characterData: true, subtree: true });
1461
+ }
1462
+ });
1463
+ };
1464
+
1465
+ /*
1466
+ * Global function to determine if swal2 modal is shown
1467
+ */
1468
+ sweetAlert.isVisible = function () {
1469
+ return !!getModal();
1470
+ };
1471
+
1472
+ /*
1473
+ * Global function for chaining sweetAlert modals
1474
+ */
1475
+ sweetAlert.queue = function (steps) {
1476
+ queue = steps;
1477
+ var resetQueue = function resetQueue() {
1478
+ queue = [];
1479
+ document.body.removeAttribute('data-swal2-queue-step');
1480
+ };
1481
+ var queueResult = [];
1482
+ return new Promise(function (resolve, reject) {
1483
+ (function step(i, callback) {
1484
+ if (i < queue.length) {
1485
+ document.body.setAttribute('data-swal2-queue-step', i);
1486
+
1487
+ sweetAlert(queue[i]).then(function (result) {
1488
+ queueResult.push(result);
1489
+ step(i + 1, callback);
1490
+ }, function (dismiss) {
1491
+ resetQueue();
1492
+ reject(dismiss);
1493
+ });
1494
+ } else {
1495
+ resetQueue();
1496
+ resolve(queueResult);
1497
+ }
1498
+ })(0);
1499
+ });
1500
+ };
1501
+
1502
+ /*
1503
+ * Global function for getting the index of current modal in queue
1504
+ */
1505
+ sweetAlert.getQueueStep = function () {
1506
+ return document.body.getAttribute('data-swal2-queue-step');
1507
+ };
1508
+
1509
+ /*
1510
+ * Global function for inserting a modal to the queue
1511
+ */
1512
+ sweetAlert.insertQueueStep = function (step, index) {
1513
+ if (index && index < queue.length) {
1514
+ return queue.splice(index, 0, step);
1515
+ }
1516
+ return queue.push(step);
1517
+ };
1518
+
1519
+ /*
1520
+ * Global function for deleting a modal from the queue
1521
+ */
1522
+ sweetAlert.deleteQueueStep = function (index) {
1523
+ if (typeof queue[index] !== 'undefined') {
1524
+ queue.splice(index, 1);
1525
+ }
1526
+ };
1527
+
1528
+ /*
1529
+ * Global function to close sweetAlert
1530
+ */
1531
+ sweetAlert.close = sweetAlert.closeModal = function (onComplete) {
1532
+ var container = getContainer();
1533
+ var modal = getModal();
1534
+ if (!modal) {
1535
+ return;
1536
+ }
1537
+ removeClass(modal, swalClasses.show);
1538
+ addClass(modal, swalClasses.hide);
1539
+ clearTimeout(modal.timeout);
1540
+
1541
+ resetPrevState();
1542
+
1543
+ var removeModalAndResetState = function removeModalAndResetState() {
1544
+ if (container.parentNode) {
1545
+ container.parentNode.removeChild(container);
1546
+ }
1547
+ removeClass(document.documentElement, swalClasses.shown);
1548
+ removeClass(document.body, swalClasses.shown);
1549
+ undoScrollbar();
1550
+ undoIOSfix();
1551
+ };
1552
+
1553
+ // If animation is supported, animate
1554
+ if (animationEndEvent && !hasClass(modal, swalClasses.noanimation)) {
1555
+ modal.addEventListener(animationEndEvent, function swalCloseEventFinished() {
1556
+ modal.removeEventListener(animationEndEvent, swalCloseEventFinished);
1557
+ if (hasClass(modal, swalClasses.hide)) {
1558
+ removeModalAndResetState();
1559
+ }
1560
+ });
1561
+ } else {
1562
+ // Otherwise, remove immediately
1563
+ removeModalAndResetState();
1564
+ }
1565
+ if (onComplete !== null && typeof onComplete === 'function') {
1566
+ setTimeout(function () {
1567
+ onComplete(modal);
1568
+ });
1569
+ }
1570
+ };
1571
+
1572
+ /*
1573
+ * Global function to click 'Confirm' button
1574
+ */
1575
+ sweetAlert.clickConfirm = function () {
1576
+ return getConfirmButton().click();
1577
+ };
1578
+
1579
+ /*
1580
+ * Global function to click 'Cancel' button
1581
+ */
1582
+ sweetAlert.clickCancel = function () {
1583
+ return getCancelButton().click();
1584
+ };
1585
+
1586
+ /**
1587
+ * Show spinner instead of Confirm button and disable Cancel button
1588
+ */
1589
+ sweetAlert.showLoading = sweetAlert.enableLoading = function () {
1590
+ var modal = getModal();
1591
+ if (!modal) {
1592
+ sweetAlert('');
1593
+ }
1594
+ var buttonsWrapper = getButtonsWrapper();
1595
+ var confirmButton = getConfirmButton();
1596
+ var cancelButton = getCancelButton();
1597
+
1598
+ show(buttonsWrapper);
1599
+ show(confirmButton, 'inline-block');
1600
+ addClass(buttonsWrapper, swalClasses.loading);
1601
+ addClass(modal, swalClasses.loading);
1602
+ confirmButton.disabled = true;
1603
+ cancelButton.disabled = true;
1604
+ };
1605
+
1606
+ /**
1607
+ * Set default params for each popup
1608
+ * @param {Object} userParams
1609
+ */
1610
+ sweetAlert.setDefaults = function (userParams) {
1611
+ if (!userParams || (typeof userParams === 'undefined' ? 'undefined' : _typeof(userParams)) !== 'object') {
1612
+ return console.error('SweetAlert2: the argument for setDefaults() is required and has to be a object');
1613
+ }
1614
+
1615
+ for (var param in userParams) {
1616
+ if (!defaultParams.hasOwnProperty(param) && param !== 'extraParams') {
1617
+ console.warn('SweetAlert2: Unknown parameter "' + param + '"');
1618
+ delete userParams[param];
1619
+ }
1620
+ }
1621
+
1622
+ _extends(modalParams, userParams);
1623
+ };
1624
+
1625
+ /**
1626
+ * Reset default params for each popup
1627
+ */
1628
+ sweetAlert.resetDefaults = function () {
1629
+ modalParams = _extends({}, defaultParams);
1630
+ };
1631
+
1632
+ sweetAlert.noop = function () {};
1633
+
1634
+ sweetAlert.version = '6.6.6';
1635
+
1636
+ sweetAlert.default = sweetAlert;
1637
+
1638
+ return sweetAlert;
1639
+
1640
+ })));
1641
+ if (window.Sweetalert2) window.sweetAlert = window.swal = window.Sweetalert2;
admin/boot.php CHANGED
@@ -1,347 +1,347 @@
1
- <?php
2
- /**
3
- * Admin boot
4
- *
5
- * @author Webcraftic <wordpress.webraftic@gmail.com>
6
- * @copyright Webcraftic 25.05.2017
7
- * @version 1.0
8
- */
9
-
10
- // Exit if accessed directly
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
- }
14
-
15
- /**
16
- * Проверяем таблицу в базе данных
17
- *
18
- * Если таблица не существует или её структура устарела, то обновляем.
19
- * Проверка проводится при каждой инициализации плагина т.к. структура может измениться
20
- * после очередного обновления плагина.
21
- *
22
- * @return bool
23
- */
24
- add_action( 'admin_init', function () {
25
- RIO_Process_Queue::try_create_plugin_tables();
26
- } );
27
-
28
- /**
29
- * Удаляет карточку компонента в плагине Clearfy.
30
- *
31
- * @author Alexander Kovalev <alex.kovalevv@gmail.com>
32
- * @since 1.3.0
33
- */
34
- add_filter( 'wbcr/clearfy/components/items_list', function ( $components ) {
35
- if ( wrio_is_clearfy_license_activate() ) {
36
- return $components;
37
- }
38
- if ( ! empty( $components ) ) {
39
- foreach ( $components as $key => $component ) {
40
- if ( "robin_image_optimizer" == $component['name'] ) {
41
- unset( $components[ $key ] );
42
- }
43
- }
44
- }
45
-
46
- return $components;
47
- } );
48
-
49
- /**
50
- * Добавляет карточку компонента на страницу компонентов
51
- * в плагине Clearfy.
52
- *
53
- * @author Alexander Kovalev <alex.kovalevv@gmail.com>
54
- * @since 1.3.0
55
- */
56
- add_action( 'wbcr/clearfy/components/custom_plugins_card', function () {
57
- if ( ! wrio_is_clearfy_license_activate() ) {
58
- $view = WRIO_Views::get_instance( WRIO_PLUGIN_DIR );
59
- $view->print_template( 'clearfy-component-card' );
60
- }
61
- } );
62
-
63
- /**
64
- * We asset migration scripts to all admin panel pages
65
- *
66
- * @author Alexander Kovalev <alex.kovalevv@gmail.com>
67
- * @since 1.3.0
68
- */
69
- add_action( 'admin_enqueue_scripts', function () {
70
- if ( ! current_user_can( 'update_plugins' ) || ! wbcr_rio_has_meta_to_migrate() ) {
71
- return;
72
- }
73
-
74
- wp_enqueue_script( 'wrio-meta-migrations', WRIO_PLUGIN_URL . '/admin/assets/js/meta-migrations.js', [
75
- 'jquery',
76
- 'wbcr-factory-clearfy-237-global'
77
- ], WRIO_Plugin::app()->getPluginVersion() );
78
- } );
79
-
80
- /**
81
- * Plugin was heavy migrated into new architecture. Specifically, post meta was moved to separate table and
82
- * therefore it is required to migrate all of them to new table.
83
- *
84
- * This action prints a notice, which contains clickable link with JS onclick event, which invokes AJAX request
85
- * to migrate these post metas to new table.
86
- *
87
- * Once all post meta migrated, notice would not be shown anymore.
88
- *
89
- * @param $notices
90
- *
91
- * @return array
92
- * @author Alexander Kovalev <alex.kovalevv@gmail.com>
93
- * @since 1.3.0
94
- *
95
- * @see wbcr_rio_migrate_postmeta_to_process_queue() for further information about AJAX processing function.
96
- * @see wbcr_rio_has_meta_to_migrate() used to check whether to show notice or not.
97
- *
98
- * @see RIO_Process_Queue for further information about new table.
99
- */
100
- add_action( "wbcr/factory/admin_notices", function ( $notices ) {
101
-
102
- if ( ! current_user_can( 'update_plugins' ) || ! wbcr_rio_has_meta_to_migrate() ) {
103
- return $notices;
104
- }
105
-
106
- $notices[] = [
107
- 'id' => WRIO_Plugin::app()->getPrefix() . 'meta_to_migration',
108
- 'type' => 'warning',
109
- 'dismissible' => false,
110
- 'dismiss_expires' => 0,
111
- 'text' => "<p><b>" . WRIO_Plugin::app()->getPluginTitle() . ":</b> " . wrio_get_meta_migration_notice_text() . '</p>'
112
- ];
113
-
114
- return $notices;
115
- } );
116
-
117
- /**
118
- * Plugin was heavy migrated into new architecture. Specifically, post meta was moved to separate table and
119
- * therefore it is required to migrate all of them to new table.
120
- *
121
- * This action prints a notice, which contains clickable link with JS onclick event, which invokes AJAX request
122
- * to migrate these post metas to new table.
123
- *
124
- * Once all post meta migrated, notice would not be shown anymore.
125
- *
126
- * @param Wbcr_Factory446_Plugin $plugin
127
- * @param Wbcr_FactoryPages445_ImpressiveThemplate $obj
128
- *
129
- * @author Alexander Kovalev <alex.kovalevv@gmail.com>
130
- * @since 1.3.0
131
- *
132
- * @see wbcr_rio_migrate_postmeta_to_process_queue() for further information about AJAX processing function.
133
- * @see wbcr_rio_has_meta_to_migrate() used to check whether to show notice or not.
134
- *
135
- * @see RIO_Process_Queue for further information about new table.
136
- */
137
- add_action( 'wbcr/factory/pages/impressive/print_all_notices', function ( $plugin, $obj ) {
138
- if ( ( $plugin->getPluginName() != WRIO_Plugin::app()->getPluginName() ) || ! wbcr_rio_has_meta_to_migrate() ) {
139
- return;
140
- }
141
-
142
- $obj->printWarningNotice( wrio_get_meta_migration_notice_text() );
143
- }, 10, 2 );
144
-
145
- /***
146
- * Flush configuration after saving the settings
147
- *
148
- * @param WRIO_Plugin $plugin
149
- * @param Wbcr_FactoryPages445_ImpressiveThemplate $obj
150
- *
151
- * @return bool
152
- */
153
- /*add_action('wbcr_factory_446_imppage_after_form_save', function ($plugin, $obj) {
154
- $is_rio = WRIO_Plugin::app()->getPluginName() == $plugin->getPluginName();
155
-
156
- if( $is_rio ) {
157
- WRIO_Cron::check();
158
- }
159
- }, 10, 2);*/
160
-
161
- /**
162
- * Виджет отзывов
163
- *
164
- * @param string $page_url
165
- * @param string $plugin_name
166
- *
167
- * @return string
168
- */
169
- function wio_rating_widget_url( $page_url, $plugin_name ) {
170
- if ( $plugin_name == WRIO_Plugin::app()->getPluginName() ) {
171
- return 'https://wordpress.org/support/plugin/robin-image-optimizer/reviews/#new-post';
172
- }
173
-
174
- return $page_url;
175
- }
176
-
177
- add_filter( 'wbcr_factory_pages_445_imppage_rating_widget_url', 'wio_rating_widget_url', 10, 2 );
178
-
179
- /**
180
- * Widget with the offer to buy Clearfy Business
181
- *
182
- * @param array $widgets
183
- * @param string $position
184
- * @param Wbcr_Factory446_Plugin $plugin
185
- */
186
- add_filter( 'wbcr/factory/pages/impressive/widgets', function ( $widgets, $position, $plugin ) {
187
- if ( $plugin->getPluginName() == WRIO_Plugin::app()->getPluginName() ) {
188
- require_once WRIO_PLUGIN_DIR . '/admin/includes/sidebar-widgets.php';
189
-
190
- if ( wrio_is_license_activate() ) {
191
- unset( $widgets['donate_widget'] );
192
-
193
- if ( $position == 'right' ) {
194
- unset( $widgets['adverts_widget'] );
195
- unset( $widgets['business_suggetion'] );
196
- unset( $widgets['rating_widget'] );
197
- unset( $widgets['info_widget'] );
198
- }
199
-
200
- /*if ( $position == 'bottom' ) {
201
- $widgets['support'] = wrio_get_sidebar_support_widget();
202
- }*/
203
-
204
- return $widgets;
205
- } else {
206
- if ( $position == 'right' ) {
207
- unset( $widgets['info_widget'] );
208
- unset( $widgets['rating_widget'] );
209
- //$widgets['support'] = wrio_get_sidebar_support_widget();
210
- }
211
- }
212
-
213
- //if ( $position == 'bottom' ) {
214
- //$widgets['donate_widget'] = wrio_get_sidebar_premium_widget();
215
- //}
216
- }
217
-
218
- return $widgets;
219
- }, 20, 3 );
220
-
221
- /**
222
- * Заменяет заголовок в рекламном виджете
223
- *
224
- * @param array $features
225
- * @param string $plugin_name
226
- * @param string $page_id
227
- */
228
- add_filter( 'wbcr/clearfy/pages/suggetion_title', function ( $features, $plugin_name, $page_id ) {
229
- if ( ! empty( $plugin_name ) && ( $plugin_name == WRIO_Plugin::app()->getPluginName() ) ) {
230
- return __( "ROBIN IMAGE OPTIMIZER PRO", 'robin-image-optimizer' );
231
- }
232
-
233
- return $features;
234
- }, 20, 3 );
235
-
236
- /**
237
- * Заменяем премиум возможности в рекламном виджете
238
- *
239
- * @param array $features
240
- * @param string $plugin_name
241
- * @param string $page_id
242
- */
243
- add_filter( 'wbcr/clearfy/pages/suggetion_features', function ( $features, $plugin_name, $page_id ) {
244
- if ( ! empty( $plugin_name ) && ( $plugin_name == WRIO_Plugin::app()->getPluginName() ) ) {
245
- $upgrade_feature = [];
246
- $upgrade_feature[] = __( 'Automatic convertation in Webp', 'robin-image-optimizer' );
247
- $upgrade_feature[] = __( 'You can optimize custom folders', 'robin-image-optimizer' );
248
- $upgrade_feature[] = __( 'Support Nextgen gallery', 'robin-image-optimizer' );
249
- $upgrade_feature[] = __( 'Multisite support', 'robin-image-optimizer' );
250
- $upgrade_feature[] = __( 'Fast optimization servers', 'robin-image-optimizer' );
251
- $upgrade_feature[] = __( 'No ads', 'robin-image-optimizer' );
252
- $upgrade_feature[] = __( 'Best support', 'robin-image-optimizer' );
253
-
254
- return $upgrade_feature;
255
- }
256
-
257
- return $features;
258
- }, 20, 3 );
259
-
260
- /**
261
- * Заменяем премиум возможности в рекламном виджете
262
- *
263
- * @param array $messages
264
- * @param string $type
265
- * @param string $plugin_name
266
- */
267
- add_filter( 'wbcr/factory/premium/notice_text', function ( $text, $type, $plugin_name ) {
268
- if ( WRIO_Plugin::app()->getPluginName() != $plugin_name ) {
269
- return $text;
270
- }
271
-
272
- $license_page_url = WRIO_Plugin::app()->getPluginPageUrl( 'rio_license' );
273
-
274
- if ( 'need_activate_license' == $type ) {
275
- return sprintf( __( '<a href="%s">License activation</a> required. A license is required to get premium plugin updates, as well as to get additional services.', 'robin-image-optimizer' ), $license_page_url );
276
- } else if ( 'need_renew_license' == $type ) {
277
- return sprintf( __( 'Your <a href="%s">license</a> has expired. You can no longer get premium plugin updates, premium support and your access to Webcraftic services has been suspended.', 'robin-image-optimizer' ), $license_page_url );
278
- }
279
-
280
- return $text;
281
- }, 10, 3 );
282
-
283
- /**
284
- * Отправка уведомлений и скором окончании квоты
285
- * Уведомления создаются только если квота <= 100
286
- *
287
- * @author Alexander Gorenkov <g.a.androidjc2@ya.ru>
288
- * @since 1.4.2
289
- */
290
- add_action( 'wbcr/factory/admin_notices', function ( $notices, $plugin_name ) {
291
- if ( $plugin_name != WRIO_Plugin::app()->getPluginName() ) {
292
- return $notices;
293
- }
294
-
295
- if ( WRIO_Plugin::app()->getPopulateOption( 'image_optimization_server' ) != 'server_5' ) {
296
- return $notices;
297
- }
298
-
299
- $current_quota = WRIO_Plugin::app()->getOption( 'current_quota' );
300
- if ( $current_quota > 100 ) {
301
- return $notices;
302
- }
303
-
304
- $notice_text = __( 'The remainder of the quota is coming to an end. Remained credits: ' . $current_quota, 'robin_image_optimizer' );
305
-
306
- $plugin_title = WRIO_Plugin::app()->getPluginTitle();
307
- $notice_text = '<b>' . $plugin_title . '</b>: ' . $notice_text;
308
- $notices[] = [
309
- 'id' => 'wrio_remained_quota',
310
- 'type' => 'warning',
311
- 'dismissible' => true,
312
- 'where' => [ 'plugins', 'dashboard', 'edit' ],
313
- 'dismiss_expires' => time() + 3600 * 4,
314
- 'text' => $notice_text,
315
- ];
316
-
317
- return $notices;
318
- }, 10, 2 );
319
-
320
- /**
321
- * Отправка уведомлений и скором окончании квоты в Impressive
322
- * Уведомления создаются только если квота <= 100
323
- *
324
- * @param Wbcr_Factory446_Plugin $plugin Экземпляр плагина, который передается в функцию обратного вызова
325
- * @param Wbcr_FactoryPages445_ImpressiveThemplate $obj Экземпляр страницы, который передается в функцию обратного вызова
326
- *
327
- * @author Alexander Gorenkov <g.a.androidjc2@ya.ru>
328
- * @since 1.4.2
329
- */
330
- add_action( 'wbcr/factory/pages/impressive/print_all_notices', function ( $plugin, $obj ) {
331
- if ( $plugin->getPluginName() != WRIO_Plugin::app()->getPluginName() ) {
332
- return false;
333
- }
334
-
335
- if ( WRIO_Plugin::app()->getPopulateOption( 'image_optimization_server' ) != 'server_5' ) {
336
- return false;
337
- }
338
-
339
- $current_quota = WRIO_Plugin::app()->getOption( 'current_quota' );
340
- if ( $current_quota > 100 ) {
341
- return false;
342
- }
343
-
344
- $notice_text = __( 'The remainder of the quota is coming to an end. Remained credits: ' . $current_quota, 'robin_image_optimizer' );
345
-
346
- $obj->printWarningNotice( $notice_text );
347
- }, 10, 2 );
1
+ <?php
2
+ /**
3
+ * Admin boot
4
+ *
5
+ * @author Webcraftic <wordpress.webraftic@gmail.com>
6
+ * @copyright Webcraftic 25.05.2017
7
+ * @version 1.0
8
+ */
9
+
10
+ // Exit if accessed directly
11
+ if ( ! defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ }
14
+
15
+ /**
16
+ * Проверяем таблицу в базе данных
17
+ *
18
+ * Если таблица не существует или её структура устарела, то обновляем.
19
+ * Проверка проводится при каждой инициализации плагина т.к. структура может измениться
20
+ * после очередного обновления плагина.
21
+ *
22
+ * @return bool
23
+ */
24
+ add_action( 'admin_init', function () {
25
+ RIO_Process_Queue::try_create_plugin_tables();
26
+ } );
27
+
28
+ /**
29
+ * Удаляет карточку компонента в плагине Clearfy.
30
+ *
31
+ * @author Alexander Kovalev <alex.kovalevv@gmail.com>
32
+ * @since 1.3.0
33
+ */
34
+ add_filter( 'wbcr/clearfy/components/items_list', function ( $components ) {
35
+ if ( wrio_is_clearfy_license_activate() ) {
36
+ return $components;
37
+ }
38
+ if ( ! empty( $components ) ) {
39
+ foreach ( $components as $key => $component ) {
40
+ if ( "robin_image_optimizer" == $component['name'] ) {
41
+ unset( $components[ $key ] );
42
+ }
43
+ }
44
+ }
45
+
46
+ return $components;
47
+ } );
48
+
49
+ /**
50
+ * Добавляет карточку компонента на страницу компонентов
51
+ * в плагине Clearfy.
52
+ *
53
+ * @author Alexander Kovalev <alex.kovalevv@gmail.com>
54
+ * @since 1.3.0
55
+ */
56
+ add_action( 'wbcr/clearfy/components/custom_plugins_card', function () {
57
+ if ( ! wrio_is_clearfy_license_activate() ) {
58
+ $view = WRIO_Views::get_instance( WRIO_PLUGIN_DIR );
59
+ $view->print_template( 'clearfy-component-card' );
60
+ }
61
+ } );
62
+
63
+ /**
64
+ * We asset migration scripts to all admin panel pages
65
+ *
66
+ * @author Alexander Kovalev <alex.kovalevv@gmail.com>
67
+ * @since 1.3.0
68
+ */
69
+ add_action( 'admin_enqueue_scripts', function () {
70
+ if ( ! current_user_can( 'update_plugins' ) || ! wbcr_rio_has_meta_to_migrate() ) {
71
+ return;
72
+ }
73
+
74
+ wp_enqueue_script( 'wrio-meta-migrations', WRIO_PLUGIN_URL . '/admin/assets/js/meta-migrations.js', [
75
+ 'jquery',
76
+ 'wbcr-factory-clearfy-000-global'
77
+ ], WRIO_Plugin::app()->getPluginVersion() );
78
+ } );
79
+
80
+ /**
81
+ * Plugin was heavy migrated into new architecture. Specifically, post meta was moved to separate table and
82
+ * therefore it is required to migrate all of them to new table.
83
+ *
84
+ * This action prints a notice, which contains clickable link with JS onclick event, which invokes AJAX request
85
+ * to migrate these post metas to new table.
86
+ *
87
+ * Once all post meta migrated, notice would not be shown anymore.
88
+ *
89
+ * @param $notices
90
+ *
91
+ * @return array
92
+ * @author Alexander Kovalev <alex.kovalevv@gmail.com>
93
+ * @since 1.3.0
94
+ *
95
+ * @see wbcr_rio_migrate_postmeta_to_process_queue() for further information about AJAX processing function.
96
+ * @see wbcr_rio_has_meta_to_migrate() used to check whether to show notice or not.
97
+ *
98
+ * @see RIO_Process_Queue for further information about new table.
99
+ */
100
+ add_action( "wbcr/factory/admin_notices", function ( $notices ) {
101
+
102
+ if ( ! current_user_can( 'update_plugins' ) || ! wbcr_rio_has_meta_to_migrate() ) {
103
+ return $notices;
104
+ }
105
+
106
+ $notices[] = [
107
+ 'id' => WRIO_Plugin::app()->getPrefix() . 'meta_to_migration',
108
+ 'type' => 'warning',
109
+ 'dismissible' => false,
110
+ 'dismiss_expires' => 0,
111
+ 'text' => "<p><b>" . WRIO_Plugin::app()->getPluginTitle() . ":</b> " . wrio_get_meta_migration_notice_text() . '</p>'
112
+ ];
113
+
114
+ return $notices;
115
+ } );
116
+
117
+ /**
118
+ * Plugin was heavy migrated into new architecture. Specifically, post meta was moved to separate table and
119
+ * therefore it is required to migrate all of them to new table.
120
+ *
121
+ * This action prints a notice, which contains clickable link with JS onclick event, which invokes AJAX request
122
+ * to migrate these post metas to new table.
123
+ *
124
+ * Once all post meta migrated, notice would not be shown anymore.
125
+ *
126
+ * @param Wbcr_Factory450_Plugin $plugin
127
+ * @param Wbcr_FactoryPages449_ImpressiveThemplate $obj
128
+ *
129
+ * @author Alexander Kovalev <alex.kovalevv@gmail.com>
130
+ * @since 1.3.0
131
+ *
132
+ * @see wbcr_rio_migrate_postmeta_to_process_queue() for further information about AJAX processing function.
133
+ * @see wbcr_rio_has_meta_to_migrate() used to check whether to show notice or not.
134
+ *
135
+ * @see RIO_Process_Queue for further information about new table.
136
+ */
137
+ add_action( 'wbcr/factory/pages/impressive/print_all_notices', function ( $plugin, $obj ) {
138
+ if ( ( $plugin->getPluginName() != WRIO_Plugin::app()->getPluginName() ) || ! wbcr_rio_has_meta_to_migrate() ) {
139
+ return;
140
+ }
141
+
142
+ $obj->printWarningNotice( wrio_get_meta_migration_notice_text() );
143
+ }, 10, 2 );
144
+
145
+ /***
146
+ * Flush configuration after saving the settings
147
+ *
148
+ * @param WRIO_Plugin $plugin
149
+ * @param Wbcr_FactoryPages449_ImpressiveThemplate $obj
150
+ *
151
+ * @return bool
152
+ */
153
+ /*add_action('wbcr_factory_450_imppage_after_form_save', function ($plugin, $obj) {
154
+ $is_rio = WRIO_Plugin::app()->getPluginName() == $plugin->getPluginName();
155
+
156
+ if( $is_rio ) {
157
+ WRIO_Cron::check();
158
+ }
159
+ }, 10, 2);*/
160
+
161
+ /**
162
+ * Виджет отзывов
163
+ *
164
+ * @param string $page_url
165
+ * @param string $plugin_name
166
+ *
167
+ * @return string
168
+ */
169
+ function wio_rating_widget_url( $page_url, $plugin_name ) {
170
+ if ( $plugin_name == WRIO_Plugin::app()->getPluginName() ) {
171
+ return 'https://wordpress.org/support/plugin/robin-image-optimizer/reviews/#new-post';
172
+ }
173
+
174
+ return $page_url;
175
+ }
176
+
177
+ add_filter( 'wbcr_factory_pages_449_imppage_rating_widget_url', 'wio_rating_widget_url', 10, 2 );
178
+
179
+ /**
180
+ * Widget with the offer to buy Clearfy Business
181
+ *
182
+ * @param array $widgets
183
+ * @param string $position
184
+ * @param Wbcr_Factory450_Plugin $plugin
185
+ */
186
+ add_filter( 'wbcr/factory/pages/impressive/widgets', function ( $widgets, $position, $plugin ) {
187
+ if ( $plugin->getPluginName() == WRIO_Plugin::app()->getPluginName() ) {
188
+ require_once WRIO_PLUGIN_DIR . '/admin/includes/sidebar-widgets.php';
189
+
190
+ if ( wrio_is_license_activate() ) {
191
+ unset( $widgets['donate_widget'] );
192
+
193
+ if ( $position == 'right' ) {
194
+ unset( $widgets['adverts_widget'] );
195
+ unset( $widgets['business_suggetion'] );
196
+ unset( $widgets['rating_widget'] );
197
+ unset( $widgets['info_widget'] );
198
+ }
199
+
200
+ /*if ( $position == 'bottom' ) {
201
+ $widgets['support'] = wrio_get_sidebar_support_widget();
202
+ }*/
203
+
204
+ return $widgets;
205
+ } else {
206
+ if ( $position == 'right' ) {
207
+ unset( $widgets['info_widget'] );
208
+ unset( $widgets['rating_widget'] );
209
+ //$widgets['support'] = wrio_get_sidebar_support_widget();
210
+ }
211
+ }
212
+
213
+ //if ( $position == 'bottom' ) {
214
+ //$widgets['donate_widget'] = wrio_get_sidebar_premium_widget();
215
+ //}
216
+ }
217
+
218
+ return $widgets;
219
+ }, 20, 3 );
220
+
221
+ /**
222
+ * Заменяет заголовок в рекламном виджете
223
+ *
224
+ * @param array $features
225
+ * @param string $plugin_name
226
+ * @param string $page_id
227
+ */
228
+ add_filter( 'wbcr/clearfy/pages/suggetion_title', function ( $features, $plugin_name, $page_id ) {
229
+ if ( ! empty( $plugin_name ) && ( $plugin_name == WRIO_Plugin::app()->getPluginName() ) ) {
230
+ return __( "ROBIN IMAGE OPTIMIZER PRO", 'robin-image-optimizer' );
231
+ }
232
+
233
+ return $features;
234
+ }, 20, 3 );
235
+
236
+ /**
237
+ * Заменяем премиум возможности в рекламном виджете
238
+ *
239
+ * @param array $features
240
+ * @param string $plugin_name
241
+ * @param string $page_id
242
+ */
243
+ add_filter( 'wbcr/clearfy/pages/suggetion_features', function ( $features, $plugin_name, $page_id ) {
244
+ if ( ! empty( $plugin_name ) && ( $plugin_name == WRIO_Plugin::app()->getPluginName() ) ) {
245
+ $upgrade_feature = [];
246
+ $upgrade_feature[] = __( 'Automatic convertation in Webp', 'robin-image-optimizer' );
247
+ $upgrade_feature[] = __( 'You can optimize custom folders', 'robin-image-optimizer' );
248
+ $upgrade_feature[] = __( 'Support Nextgen gallery', 'robin-image-optimizer' );
249
+ $upgrade_feature[] = __( 'Multisite support', 'robin-image-optimizer' );
250
+ $upgrade_feature[] = __( 'Fast optimization servers', 'robin-image-optimizer' );
251
+ $upgrade_feature[] = __( 'No ads', 'robin-image-optimizer' );
252
+ $upgrade_feature[] = __( 'Best support', 'robin-image-optimizer' );
253
+
254
+ return $upgrade_feature;
255
+ }
256
+
257
+ return $features;
258
+ }, 20, 3 );
259
+
260
+ /**
261
+ * Заменяем премиум возможности в рекламном виджете
262
+ *
263
+ * @param array $messages
264
+ * @param string $type
265
+ * @param string $plugin_name
266
+ */
267
+ add_filter( 'wbcr/factory/premium/notice_text', function ( $text, $type, $plugin_name ) {
268
+ if ( WRIO_Plugin::app()->getPluginName() != $plugin_name ) {
269
+ return $text;
270
+ }
271
+
272
+ $license_page_url = WRIO_Plugin::app()->getPluginPageUrl( 'rio_license' );
273