WordPress Charts and Graphs Lite - Version 3.4.0

Version Description

  • 2020-02-13
Download this release

Release Info

Developer codeinwp
Plugin Icon WordPress Charts and Graphs Lite
Version 3.4.0
Comparing to
See all releases

Code changes from version 3.3.4 to 3.4.0

Files changed (60) hide show
  1. CHANGELOG.md +14 -0
  2. classes/Visualizer/Gutenberg/Block.php +312 -5
  3. classes/Visualizer/Gutenberg/build/block.css +1 -1
  4. classes/Visualizer/Gutenberg/build/block.js +5 -5
  5. classes/Visualizer/Gutenberg/src/Components/ChartPermissions.js +2 -2
  6. classes/Visualizer/Gutenberg/src/Components/ChartRender.js +24 -4
  7. classes/Visualizer/Gutenberg/src/Components/ChartSelect.js +39 -4
  8. classes/Visualizer/Gutenberg/src/Components/Charts.js +17 -2
  9. classes/Visualizer/Gutenberg/src/Components/DataTable.js +7 -1
  10. classes/Visualizer/Gutenberg/src/Components/Import/ChartImport.js +1 -0
  11. classes/Visualizer/Gutenberg/src/Components/Import/DataImport.js +109 -0
  12. classes/Visualizer/Gutenberg/src/Components/Import/JSONImport.js +601 -0
  13. classes/Visualizer/Gutenberg/src/Components/Import/RemoteImport.js +17 -1
  14. classes/Visualizer/Gutenberg/src/Components/Import/SQLEditor.js +136 -0
  15. classes/Visualizer/Gutenberg/src/Components/Sidebar/CandlesSettings.js +1 -1
  16. classes/Visualizer/Gutenberg/src/Components/Sidebar/ColorAxis.js +1 -1
  17. classes/Visualizer/Gutenberg/src/Components/Sidebar/GaugeSettings.js +1 -1
  18. classes/Visualizer/Gutenberg/src/Components/Sidebar/GeneralSettings.js +1 -1
  19. classes/Visualizer/Gutenberg/src/Components/Sidebar/HorizontalAxisSettings.js +1 -1
  20. classes/Visualizer/Gutenberg/src/Components/Sidebar/LayoutAndChartArea.js +1 -1
  21. classes/Visualizer/Gutenberg/src/Components/Sidebar/PieSettings.js +1 -1
  22. classes/Visualizer/Gutenberg/src/Components/Sidebar/ResidueSettings.js +1 -1
  23. classes/Visualizer/Gutenberg/src/Components/Sidebar/RowCellSettings.js +1 -1
  24. classes/Visualizer/Gutenberg/src/Components/Sidebar/SeriesSettings.js +1 -1
  25. classes/Visualizer/Gutenberg/src/Components/Sidebar/SlicesSettings.js +1 -1
  26. classes/Visualizer/Gutenberg/src/Components/Sidebar/TimelineSettings.js +1 -1
  27. classes/Visualizer/Gutenberg/src/Components/Sidebar/VerticalAxisSettings.js +1 -1
  28. classes/Visualizer/Gutenberg/src/Editor.js +89 -2
  29. classes/Visualizer/Gutenberg/src/style.scss +143 -1
  30. classes/Visualizer/Module.php +60 -2
  31. classes/Visualizer/Module/Admin.php +69 -1
  32. classes/Visualizer/Module/Chart.php +181 -43
  33. classes/Visualizer/Module/Setup.php +73 -10
  34. classes/Visualizer/Module/Sources.php +6 -2
  35. classes/Visualizer/Plugin.php +11 -1
  36. classes/Visualizer/Render/Layout.php +80 -20
  37. classes/Visualizer/Render/Library.php +10 -1
  38. classes/Visualizer/Render/Page/Data.php +110 -103
  39. classes/Visualizer/Render/Page/Types.php +1 -1
  40. classes/Visualizer/Render/Page/Update.php +21 -1
  41. classes/Visualizer/Render/Sidebar.php +2 -0
  42. classes/Visualizer/Render/Sidebar/Google.php +25 -1
  43. classes/Visualizer/Render/Sidebar/Graph.php +3 -0
  44. classes/Visualizer/Render/Sidebar/Linear.php +3 -0
  45. classes/Visualizer/Render/Sidebar/Type/DataTable/DataTable.php +3 -1
  46. classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Bubble.php +122 -0
  47. classes/Visualizer/Source.php +80 -1
  48. classes/Visualizer/Source/Json.php +73 -72
  49. classes/Visualizer/Source/Query.php +70 -31
  50. classes/Visualizer/Source/Query/Params.php +4 -1
  51. css/frame.css +41 -4
  52. css/library.css +18 -0
  53. css/media.css +1 -1
  54. images/chart_types_june2019.png +0 -0
  55. images/chart_types_june2019_g.png +0 -0
  56. images/chart_types_v340.png +0 -0
  57. images/chart_types_v340_g.png +0 -0
  58. index.php +20 -2
  59. js/frame.js +62 -25
  60. js/lib/chartjs.min.js +9 -0
CHANGELOG.md CHANGED
@@ -1,4 +1,18 @@
1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  ### v3.3.4 - 2019-11-15
3
  **Changes:**
4
  * Fix issue with table chart not loading in the block editor
1
 
2
+ ### v3.4.0 - 2020-02-13
3
+ **Changes:**
4
+ * [Feat] Support for authentication for JSON import
5
+ * [Feat] New chart type: Bubble
6
+ * [Feat] Combine one-time import and schedule import into a single control for an online .csv file import
7
+ * [Feat] Add support for annotations and other roles
8
+ * [Feat] For every chart show the last updated date and any error that exists
9
+ * [Feat] Tested up to WP 5.3
10
+ * [Fix] When new data is imported using csv/url, the manual editor still show old data
11
+ * [Fix] Having SCRIPT_DEBUG on causes issues in real time update of charts
12
+ * [Fix] Table chart: Error appears when trying to import from JSON
13
+ * [Fix] PHP Fatal error: Uncaught Error: Cannot unset string offsets
14
+ * [Fix] Long responsive table can overflow on smaller screens
15
+
16
  ### v3.3.4 - 2019-11-15
17
  **Changes:**
18
  * Fix issue with table chart not loading in the block editor
classes/Visualizer/Gutenberg/Block.php CHANGED
@@ -67,13 +67,15 @@ class Visualizer_Gutenberg_Block {
67
  * Enqueue front end and editor JavaScript and CSS
68
  */
69
  public function enqueue_gutenberg_scripts() {
 
 
70
  $blockPath = VISUALIZER_ABSURL . 'classes/Visualizer/Gutenberg/build/block.js';
71
  $handsontableJS = VISUALIZER_ABSURL . 'classes/Visualizer/Gutenberg/build/handsontable.js';
72
  $stylePath = VISUALIZER_ABSURL . 'classes/Visualizer/Gutenberg/build/block.css';
73
  $handsontableCSS = VISUALIZER_ABSURL . 'classes/Visualizer/Gutenberg/build/handsontable.css';
74
 
75
  if ( VISUALIZER_TEST_JS_CUSTOMIZATION ) {
76
- $version = filemtime( VISUALIZER_ABSPATH . 'classes/Visualizer/Gutenberg/build/block.js' );
77
  } else {
78
  $version = $this->version;
79
  }
@@ -91,18 +93,39 @@ class Visualizer_Gutenberg_Block {
91
  }
92
  }
93
 
 
 
94
  $translation_array = array(
95
  'isPro' => $type,
96
  'proTeaser' => Visualizer_Plugin::PRO_TEASER_URL,
97
  'absurl' => VISUALIZER_ABSURL,
98
  'charts' => Visualizer_Module_Admin::_getChartTypesLocalized(),
99
  'adminPage' => menu_page_url( 'visualizer', false ),
 
100
  );
101
  wp_localize_script( 'visualizer-gutenberg-block', 'visualizerLocalize', $translation_array );
102
 
103
  // Enqueue frontend and editor block styles
104
  wp_enqueue_style( 'handsontable', $handsontableCSS );
105
  wp_enqueue_style( 'visualizer-gutenberg-block', $stylePath, array( 'visualizer-datatables' ), $version );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
  }
107
  /**
108
  * Hook server side rendering into render callback
@@ -145,6 +168,72 @@ class Visualizer_Gutenberg_Block {
145
  )
146
  );
147
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  register_rest_route(
149
  'visualizer/v' . VISUALIZER_REST_VERSION,
150
  '/update-chart',
@@ -210,7 +299,8 @@ class Visualizer_Gutenberg_Block {
210
 
211
  $data['visualizer-chart-type'] = get_post_meta( $post_id, Visualizer_Plugin::CF_CHART_TYPE, true );
212
 
213
- $data['visualizer-chart-library'] = get_post_meta( $post_id, Visualizer_Plugin::CF_CHART_LIBRARY, true );
 
214
 
215
  $data['visualizer-source'] = get_post_meta( $post_id, Visualizer_Plugin::CF_SOURCE, true );
216
 
@@ -228,15 +318,91 @@ class Visualizer_Gutenberg_Block {
228
  // handle data filter hooks
229
  $data['visualizer-data'] = apply_filters( Visualizer_Plugin::FILTER_GET_CHART_DATA, unserialize( html_entity_decode( get_the_content( $post_id ) ) ), $post_id, $data['visualizer-chart-type'] );
230
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
231
  $import = get_post_meta( $post_id, Visualizer_Plugin::CF_CHART_URL, true );
232
 
233
  $schedule = get_post_meta( $post_id, Visualizer_Plugin::CF_CHART_SCHEDULE, true );
234
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
235
  if ( ! empty( $import ) && ! empty( $schedule ) ) {
236
  $data['visualizer-chart-url'] = $import;
237
  $data['visualizer-chart-schedule'] = $schedule;
238
  }
239
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
240
  if ( Visualizer_Module::is_pro() ) {
241
  $permissions = get_post_meta( $post_id, Visualizer_PRO::CF_PERMISSIONS, true );
242
 
@@ -248,6 +414,102 @@ class Visualizer_Gutenberg_Block {
248
  return $data;
249
  }
250
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
251
  /**
252
  * Rest Callback Method
253
  */
@@ -277,6 +539,41 @@ class Visualizer_Gutenberg_Block {
277
  apply_filters( 'visualizer_pro_remove_schedule', $data['id'] );
278
  }
279
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
280
  if ( Visualizer_Module::is_pro() ) {
281
  update_post_meta( $data['id'], Visualizer_PRO::CF_PERMISSIONS, $data['visualizer-permissions'] );
282
  }
@@ -450,9 +747,19 @@ class Visualizer_Gutenberg_Block {
450
  */
451
  public function add_rest_query_vars( $args, \WP_REST_Request $request ) {
452
  if ( isset( $request['meta_key'] ) && isset( $request['meta_value'] ) ) {
453
- $args['meta_key'] = $request->get_param( 'meta_key' );
454
- $args['meta_value'] = $request->get_param( 'meta_value' );
455
- $args['meta_compare'] = '!=';
 
 
 
 
 
 
 
 
 
 
456
  }
457
  return $args;
458
  }
67
  * Enqueue front end and editor JavaScript and CSS
68
  */
69
  public function enqueue_gutenberg_scripts() {
70
+ global $wp_version;
71
+
72
  $blockPath = VISUALIZER_ABSURL . 'classes/Visualizer/Gutenberg/build/block.js';
73
  $handsontableJS = VISUALIZER_ABSURL . 'classes/Visualizer/Gutenberg/build/handsontable.js';
74
  $stylePath = VISUALIZER_ABSURL . 'classes/Visualizer/Gutenberg/build/block.css';
75
  $handsontableCSS = VISUALIZER_ABSURL . 'classes/Visualizer/Gutenberg/build/handsontable.css';
76
 
77
  if ( VISUALIZER_TEST_JS_CUSTOMIZATION ) {
78
+ $version = filemtime( VISUALIZER_ABSPATH . '/classes/Visualizer/Gutenberg/build/block.js' );
79
  } else {
80
  $version = $this->version;
81
  }
93
  }
94
  }
95
 
96
+ $table_col_mapping = Visualizer_Source_Query_Params::get_all_db_tables_column_mapping( null, false );
97
+
98
  $translation_array = array(
99
  'isPro' => $type,
100
  'proTeaser' => Visualizer_Plugin::PRO_TEASER_URL,
101
  'absurl' => VISUALIZER_ABSURL,
102
  'charts' => Visualizer_Module_Admin::_getChartTypesLocalized(),
103
  'adminPage' => menu_page_url( 'visualizer', false ),
104
+ 'sqlTable' => $table_col_mapping,
105
  );
106
  wp_localize_script( 'visualizer-gutenberg-block', 'visualizerLocalize', $translation_array );
107
 
108
  // Enqueue frontend and editor block styles
109
  wp_enqueue_style( 'handsontable', $handsontableCSS );
110
  wp_enqueue_style( 'visualizer-gutenberg-block', $stylePath, array( 'visualizer-datatables' ), $version );
111
+
112
+ if ( version_compare( $wp_version, '4.9.0', '>' ) ) {
113
+
114
+ wp_enqueue_code_editor(
115
+ array(
116
+ 'type' => 'sql',
117
+ 'codemirror' => array(
118
+ 'autofocus' => true,
119
+ 'lineWrapping' => true,
120
+ 'dragDrop' => false,
121
+ 'matchBrackets' => true,
122
+ 'autoCloseBrackets' => true,
123
+ 'extraKeys' => array( 'Ctrl-Space' => 'autocomplete' ),
124
+ 'hintOptions' => array( 'tables' => $table_col_mapping ),
125
+ ),
126
+ )
127
+ );
128
+ }
129
  }
130
  /**
131
  * Hook server side rendering into render callback
168
  )
169
  );
170
 
171
+ register_rest_route(
172
+ 'visualizer/v' . VISUALIZER_REST_VERSION,
173
+ '/get-query-data',
174
+ array(
175
+ 'methods' => 'GET',
176
+ 'callback' => array( $this, 'get_query_data' ),
177
+ 'permission_callback' => function () {
178
+ return current_user_can( 'edit_posts' );
179
+ },
180
+ )
181
+ );
182
+
183
+ register_rest_route(
184
+ 'visualizer/v' . VISUALIZER_REST_VERSION,
185
+ '/get-json-root',
186
+ array(
187
+ 'methods' => 'GET',
188
+ 'callback' => array( $this, 'get_json_root_data' ),
189
+ 'args' => array(
190
+ 'url' => array(
191
+ 'sanitize_callback' => 'esc_url_raw',
192
+ ),
193
+ ),
194
+ 'permission_callback' => function () {
195
+ return current_user_can( 'edit_posts' );
196
+ },
197
+ )
198
+ );
199
+
200
+ register_rest_route(
201
+ 'visualizer/v' . VISUALIZER_REST_VERSION,
202
+ '/get-json-data',
203
+ array(
204
+ 'methods' => 'GET',
205
+ 'callback' => array( $this, 'get_json_data' ),
206
+ 'args' => array(
207
+ 'url' => array(
208
+ 'sanitize_callback' => 'esc_url_raw',
209
+ ),
210
+ 'chart' => array(
211
+ 'sanitize_callback' => 'absint',
212
+ ),
213
+ ),
214
+ 'permission_callback' => function () {
215
+ return current_user_can( 'edit_posts' );
216
+ },
217
+ )
218
+ );
219
+
220
+ register_rest_route(
221
+ 'visualizer/v' . VISUALIZER_REST_VERSION,
222
+ '/set-json-data',
223
+ array(
224
+ 'methods' => 'GET',
225
+ 'callback' => array( $this, 'set_json_data' ),
226
+ 'args' => array(
227
+ 'url' => array(
228
+ 'sanitize_callback' => 'esc_url_raw',
229
+ ),
230
+ ),
231
+ 'permission_callback' => function () {
232
+ return current_user_can( 'edit_posts' );
233
+ },
234
+ )
235
+ );
236
+
237
  register_rest_route(
238
  'visualizer/v' . VISUALIZER_REST_VERSION,
239
  '/update-chart',
299
 
300
  $data['visualizer-chart-type'] = get_post_meta( $post_id, Visualizer_Plugin::CF_CHART_TYPE, true );
301
 
302
+ $library = get_post_meta( $post_id, Visualizer_Plugin::CF_CHART_LIBRARY, true );
303
+ $data['visualizer-chart-library'] = $library;
304
 
305
  $data['visualizer-source'] = get_post_meta( $post_id, Visualizer_Plugin::CF_SOURCE, true );
306
 
318
  // handle data filter hooks
319
  $data['visualizer-data'] = apply_filters( Visualizer_Plugin::FILTER_GET_CHART_DATA, unserialize( html_entity_decode( get_the_content( $post_id ) ) ), $post_id, $data['visualizer-chart-type'] );
320
 
321
+ $data['visualizer-data-exploded'] = '';
322
+ // handle annotations for google charts
323
+ if ( 'GoogleCharts' === $library ) {
324
+ // this will contain the data of both axis.
325
+ $settings = $data['visualizer-settings'];
326
+ // this will contain data only of Y axis.
327
+ $series = $data['visualizer-series'];
328
+ $annotations = array();
329
+ if ( isset( $settings['series'] ) ) {
330
+ foreach ( $settings['series'] as $index => $serie ) {
331
+ // skip X axis data.
332
+ if ( $index === 0 ) {
333
+ continue;
334
+ }
335
+ if ( ! empty( $serie['role'] ) ) {
336
+ // this series is some kind of annotation, so let's collect its index.
337
+ // the index will be +1 because the X axis value is index 0, which is being ignored.
338
+ $annotations[ 'role' . ( intval( $index ) + 1 ) ] = $serie['role'];
339
+ }
340
+ }
341
+ }
342
+ if ( ! empty( $annotations ) ) {
343
+ $exploded_data = array();
344
+ $series_names = array();
345
+ foreach ( $series as $index => $serie ) {
346
+ // skip X axis data.
347
+ if ( $index === 0 ) {
348
+ continue;
349
+ }
350
+ if ( array_key_exists( 'role' . $index, $annotations ) ) {
351
+ $series_names[] = (object) array( 'role' => $annotations[ 'role' . $index ], 'type' => $serie['type'] );
352
+ } else {
353
+ $series_names[] = $serie['label'];
354
+ }
355
+ }
356
+ $exploded_data[] = $series_names;
357
+
358
+ foreach ( $data['visualizer-data'] as $datum ) {
359
+ // skip X axis data.
360
+ unset( $datum[0] );
361
+ $exploded_data[] = $datum;
362
+ }
363
+ $data['visualizer-data-exploded'] = array( $exploded_data );
364
+ }
365
+ }
366
+
367
  $import = get_post_meta( $post_id, Visualizer_Plugin::CF_CHART_URL, true );
368
 
369
  $schedule = get_post_meta( $post_id, Visualizer_Plugin::CF_CHART_SCHEDULE, true );
370
 
371
+ $db_schedule = get_post_meta( $post_id, Visualizer_Plugin::CF_DB_SCHEDULE, true );
372
+
373
+ $db_query = get_post_meta( $post_id, Visualizer_Plugin::CF_DB_QUERY, true );
374
+
375
+ $json_url = get_post_meta( $post_id, Visualizer_Plugin::CF_JSON_URL, true );
376
+
377
+ $json_headers = get_post_meta( $post_id, Visualizer_Plugin::CF_JSON_HEADERS, true );
378
+
379
+ $json_schedule = get_post_meta( $post_id, Visualizer_Plugin::CF_JSON_SCHEDULE, true );
380
+
381
+ $json_root = get_post_meta( $post_id, Visualizer_Plugin::CF_JSON_ROOT, true );
382
+
383
+ $json_paging = get_post_meta( $post_id, Visualizer_Plugin::CF_JSON_PAGING, true );
384
+
385
  if ( ! empty( $import ) && ! empty( $schedule ) ) {
386
  $data['visualizer-chart-url'] = $import;
387
  $data['visualizer-chart-schedule'] = $schedule;
388
  }
389
 
390
+ if ( ! empty( $db_schedule ) && ! empty( $db_query ) ) {
391
+ $data['visualizer-db-schedule'] = $db_schedule;
392
+ $data['visualizer-db-query'] = $db_query;
393
+ }
394
+
395
+ if ( ! empty( $json_url ) ) {
396
+ $data['visualizer-json-schedule'] = $json_schedule;
397
+ $data['visualizer-json-url'] = $json_url;
398
+ $data['visualizer-json-headers'] = $json_headers;
399
+ $data['visualizer-json-root'] = $json_root;
400
+
401
+ if ( Visualizer_Module::is_pro() && ! empty( $json_paging ) ) {
402
+ $data['visualizer-json-paging'] = $json_paging;
403
+ }
404
+ }
405
+
406
  if ( Visualizer_Module::is_pro() ) {
407
  $permissions = get_post_meta( $post_id, Visualizer_PRO::CF_PERMISSIONS, true );
408
 
414
  return $data;
415
  }
416
 
417
+ /**
418
+ * Returns the data for the query.
419
+ *
420
+ * @access public
421
+ */
422
+ public function get_query_data( $data ) {
423
+ if ( ! current_user_can( 'edit_posts' ) ) {
424
+ return false;
425
+ }
426
+
427
+ $source = new Visualizer_Source_Query( stripslashes( $data['query'] ) );
428
+ $html = $source->fetch( true );
429
+ $source->fetch( false );
430
+ $name = $source->getSourceName();
431
+ $series = $source->getSeries();
432
+ $data = $source->getRawData();
433
+ $error = '';
434
+ if ( empty( $html ) ) {
435
+ $error = $source->get_error();
436
+ wp_send_json_error( array( 'msg' => $error ) );
437
+ }
438
+ wp_send_json_success( array( 'table' => $html, 'name' => $name, 'series' => $series, 'data' => $data ) );
439
+ }
440
+
441
+ /**
442
+ * Returns the JSON root.
443
+ *
444
+ * @access public
445
+ */
446
+ public function get_json_root_data( $data ) {
447
+ if ( ! current_user_can( 'edit_posts' ) ) {
448
+ return false;
449
+ }
450
+
451
+ $source = new Visualizer_Source_Json( $data );
452
+
453
+ $roots = $source->fetchRoots();
454
+ if ( empty( $roots ) ) {
455
+ wp_send_json_error( array( 'msg' => $source->get_error() ) );
456
+ }
457
+
458
+ wp_send_json_success( array( 'url' => $data['url'], 'roots' => $roots ) );
459
+ }
460
+
461
+ /**
462
+ * Returns the JSON data.
463
+ *
464
+ * @access public
465
+ */
466
+ public function get_json_data( $data ) {
467
+ if ( ! current_user_can( 'edit_posts' ) ) {
468
+ return false;
469
+ }
470
+
471
+ $chart_id = $data['chart'];
472
+
473
+ if ( empty( $chart_id ) ) {
474
+ wp_die();
475
+ }
476
+
477
+ $source = new Visualizer_Source_Json( $data );
478
+ $source->fetch();
479
+ $table = $source->getRawData();
480
+
481
+ if ( empty( $table ) ) {
482
+ wp_send_json_error( array( 'msg' => esc_html__( 'Unable to fetch data from the endpoint. Please try again.', 'visualizer' ) ) );
483
+ }
484
+
485
+ $table = Visualizer_Render_Layout::show( 'editor-table', $table, $chart_id, 'viz-json-table', false, false );
486
+ wp_send_json_success( array( 'table' => $table, 'root' => $data['root'], 'url' => $data['url'], 'paging' => $source->getPaginationElements() ) );
487
+ }
488
+
489
+ /**
490
+ * Set the JSON data.
491
+ *
492
+ * @access public
493
+ */
494
+ public function set_json_data( $data ) {
495
+ if ( ! current_user_can( 'edit_posts' ) ) {
496
+ return false;
497
+ }
498
+
499
+ $source = new Visualizer_Source_Json( $data );
500
+
501
+ $table = $source->fetch();
502
+ if ( empty( $table ) ) {
503
+ wp_send_json_error( array( 'msg' => esc_html__( 'Unable to fetch data from the endpoint. Please try again.', 'visualizer' ) ) );
504
+ }
505
+
506
+ $source->fetchFromEditableTable();
507
+ $name = $source->getSourceName();
508
+ $series = json_encode( $source->getSeries() );
509
+ $data = json_encode( $source->getRawData() );
510
+ wp_send_json_success( array( 'name' => $name, 'series' => $series, 'data' => $data ) );
511
+ }
512
+
513
  /**
514
  * Rest Callback Method
515
  */
539
  apply_filters( 'visualizer_pro_remove_schedule', $data['id'] );
540
  }
541
 
542
+ if ( $source_type === 'Visualizer_Source_Query' ) {
543
+ $db_schedule = intval( $data['visualizer-db-schedule'] );
544
+ $db_query = $data['visualizer-db-query'];
545
+ update_post_meta( $data['id'], Visualizer_Plugin::CF_DB_SCHEDULE, $db_schedule );
546
+ update_post_meta( $data['id'], Visualizer_Plugin::CF_DB_QUERY, stripslashes( $db_query ) );
547
+ } else {
548
+ delete_post_meta( $data['id'], Visualizer_Plugin::CF_DB_SCHEDULE );
549
+ delete_post_meta( $data['id'], Visualizer_Plugin::CF_DB_QUERY );
550
+ }
551
+
552
+ if ( $source_type === 'Visualizer_Source_Json' ) {
553
+ $json_schedule = intval( $data['visualizer-json-schedule'] );
554
+ $json_url = esc_url_raw( $data['visualizer-json-url'] );
555
+ $json_headers = esc_url_raw( $data['visualizer-json-headers'] );
556
+ $json_root = $data['visualizer-json-root'];
557
+ $json_paging = $data['visualizer-json-paging'];
558
+
559
+ update_post_meta( $data['id'], Visualizer_Plugin::CF_JSON_SCHEDULE, $json_schedule );
560
+ update_post_meta( $data['id'], Visualizer_Plugin::CF_JSON_URL, $json_url );
561
+ update_post_meta( $data['id'], Visualizer_Plugin::CF_JSON_HEADERS, $json_headers );
562
+ update_post_meta( $data['id'], Visualizer_Plugin::CF_JSON_ROOT, $json_root );
563
+
564
+ if ( ! empty( $json_paging ) ) {
565
+ update_post_meta( $data['id'], Visualizer_Plugin::CF_JSON_PAGING, $json_paging );
566
+ } else {
567
+ delete_post_meta( $data['id'], Visualizer_Plugin::CF_JSON_PAGING );
568
+ }
569
+ } else {
570
+ delete_post_meta( $data['id'], Visualizer_Plugin::CF_JSON_SCHEDULE );
571
+ delete_post_meta( $data['id'], Visualizer_Plugin::CF_JSON_URL );
572
+ delete_post_meta( $data['id'], Visualizer_Plugin::CF_JSON_HEADERS );
573
+ delete_post_meta( $data['id'], Visualizer_Plugin::CF_JSON_ROOT );
574
+ delete_post_meta( $data['id'], Visualizer_Plugin::CF_JSON_PAGING );
575
+ }
576
+
577
  if ( Visualizer_Module::is_pro() ) {
578
  update_post_meta( $data['id'], Visualizer_PRO::CF_PERMISSIONS, $data['visualizer-permissions'] );
579
  }
747
  */
748
  public function add_rest_query_vars( $args, \WP_REST_Request $request ) {
749
  if ( isset( $request['meta_key'] ) && isset( $request['meta_value'] ) ) {
750
+ $args['meta_query'] = array(
751
+ 'relation' => 'OR',
752
+ array(
753
+ 'key' => $request->get_param( 'meta_key' ),
754
+ 'value' => $request->get_param( 'meta_value' ),
755
+ 'compare' => '!=',
756
+ ),
757
+ array(
758
+ 'key' => $request->get_param( 'meta_key' ),
759
+ 'value' => $request->get_param( 'meta_value' ),
760
+ 'compare' => 'NOT EXISTS',
761
+ ),
762
+ );
763
  }
764
  return $args;
765
  }
classes/Visualizer/Gutenberg/build/block.css CHANGED
@@ -1,2 +1,2 @@
1
- .visualizer-settings{background-color:#f8f9f9;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;position:relative}.visualizer-settings .visualizer-settings__title{margin:0;padding:1.5rem 0;text-align:center;border-bottom:1px solid #e6eaee}.visualizer-settings .visualizer-settings__title .dashicon{vertical-align:top;margin-right:.25em}.visualizer-settings .visualizer-settings__content{padding:2.5em 0}.visualizer-settings .visualizer-settings__content .visualizer-settings__content-description{margin:0 0 1.5em 0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:18px;text-align:center}.visualizer-settings .visualizer-settings__content .visualizer-settings__content-option{display:-webkit-box;display:flex;-webkit-box-align:start;align-items:flex-start;flex-wrap:wrap;margin:0 auto;padding:1.25em 1.5em;max-width:80%;background:#fff;border-width:1px 1px 0;border-style:solid;border-color:#e6eaee;cursor:pointer}.visualizer-settings .visualizer-settings__content .visualizer-settings__content-option.locked{cursor:default}.visualizer-settings .visualizer-settings__content .visualizer-settings__content-option.locked:hover{background:#ffffff}.visualizer-settings .visualizer-settings__content .visualizer-settings__content-option:hover{background:#f5f5f5}.visualizer-settings .visualizer-settings__content .visualizer-settings__content-option:last-of-type{border-bottom-width:1px}.visualizer-settings .visualizer-settings__content .visualizer-settings__content-option .visualizer-settings__content-option-title{max-width:80%;display:block;font-size:1.25em}.visualizer-settings .visualizer-settings__content .visualizer-settings__content-option .visualizer-settings__content-option-icon{align-self:center;margin-left:auto;color:#b9bcc2}.visualizer-settings .visualizer-settings__content .visualizer-settings__content-option .visualizer-settings__content-option-icon .dashicon{height:25px;width:25px}.visualizer-settings .visualizer-settings__charts{text-align:center;padding-bottom:25px}.visualizer-settings .visualizer-settings__charts .visualizer-settings__charts-grid{display:grid;grid-template-columns:50% 50%}.visualizer-settings .visualizer-settings__charts .visualizer-settings__charts-grid .visualizer-settings__charts-single{margin:25px;padding-bottom:50px;background-color:#efefef;position:relative}.visualizer-settings .visualizer-settings__charts .visualizer-settings__charts-grid .visualizer-settings__charts-single .visualizer-settings__charts-title{padding:10px;font-weight:bold;text-align:center}.visualizer-settings .visualizer-settings__charts .visualizer-settings__charts-grid .visualizer-settings__charts-single .visualizer-settings__charts-controls{width:100%;position:absolute;bottom:0;padding:10px;font-weight:bold;text-align:center;cursor:pointer}.visualizer-settings .visualizer-settings__charts .dataTables_wrapper{background:#fff;padding:10px}.visualizer-settings .visualizer-settings__charts .visualizer-no-charts{padding-top:25px}.visualizer-settings .visualizer-settings__chart{text-align:center}.visualizer-settings .visualizer-settings__chart .dataTables_wrapper{background:#fff;padding:10px}.visualizer-settings .visualizer-settings__controls{margin:0;padding:1.5rem 0;text-align:center;border-top:1px solid #e6eaee}.visualizer-advanced-panel.components-panel__body.is-opened>.components-panel__body-title{margin-bottom:0}.visualizer-inner-sections{background:#f8f9f9}.visualizer-inner-sections .components-panel__body-toggle:hover{background:#EEEEEE}.visualizer-inner-sections ul.visualizer-list{list-style:disc;margin-left:15px}.components-panel__body-button .components-panel__body-toggle.components-button .dashicons-admin-tools{margin:-2px 6px -2px 0}.components-panel__body-button .components-panel__body-toggle.components-button .dashicons-admin-users{margin:-2px 6px -2px 0}.components-panel__body-button .components-panel__body-toggle.components-button .components-panel__arrow{width:48px;height:48px;right:0;border-top:1px solid #ddd;-webkit-transform:translateY(-50%) rotate(270deg);transform:translateY(-50%) rotate(270deg)}.components-panel__body-button.visualizer-panel-back .components-panel__body-title{background:#f3f3f3}.components-panel__body-button.visualizer-panel-back .components-panel__body-title:hover{background:#f3f3f3}.components-panel__body-button.visualizer-panel-back .components-panel__body-title .components-panel__body-toggle{margin:10px 0;background:#fff}.components-panel__body-button.visualizer-panel-back .components-panel__body-title .components-panel__body-toggle.components-button{padding-left:60px}.components-panel__body-button.visualizer-panel-back .components-panel__body-title .components-panel__body-toggle.components-button:hover .components-panel__arrow{background:#f3f3f3;border-width:1px 1px 0 1px;border-color:#ddd;border-style:solid}.components-panel__body-button.visualizer-panel-back .components-panel__body-title .components-panel__body-toggle.components-button .components-panel__arrow{left:0;-webkit-transform:translateY(-50%) rotate(90deg);transform:translateY(-50%) rotate(90deg)}.visualizer-chart-editor{max-width:100%;margin:25px 25px 0}.visualizer-chart-editor .htEditor{margin-bottom:20px}.visualizer-chart-editor .htEditor .htRowHeaders{height:auto !important;width:auto !important}.visualizer-chart-editor .htEditor .ht_master .wtHolder{height:auto !important;width:auto !important}.htContextMenu:not(.htGhostTable){z-index:999999}.htDatepickerHolder{z-index:999999 !important}@media (max-width: 768px){.visualizer-settings .visualizer-settings__charts .visualizer-settings__charts-grid{display:grid;grid-template-columns:100%}}
2
 
1
+ .visualizer-settings{background-color:#f8f9f9;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;position:relative}.visualizer-settings .visualizer-settings__title{margin:0;padding:1.5rem 0;text-align:center;border-bottom:1px solid #e6eaee}.visualizer-settings .visualizer-settings__title .dashicon{vertical-align:top;margin-right:.25em}.visualizer-settings .visualizer-settings__content{padding:2.5em 0}.visualizer-settings .visualizer-settings__content .visualizer-settings__content-description{margin:0 0 1.5em 0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:18px;text-align:center}.visualizer-settings .visualizer-settings__content .visualizer-settings__content-option{display:-webkit-box;display:flex;-webkit-box-align:start;align-items:flex-start;flex-wrap:wrap;margin:0 auto;padding:1.25em 1.5em;max-width:80%;background:#fff;border-width:1px 1px 0;border-style:solid;border-color:#e6eaee;cursor:pointer}.visualizer-settings .visualizer-settings__content .visualizer-settings__content-option.locked{cursor:default}.visualizer-settings .visualizer-settings__content .visualizer-settings__content-option.locked:hover{background:#ffffff}.visualizer-settings .visualizer-settings__content .visualizer-settings__content-option:hover{background:#f5f5f5}.visualizer-settings .visualizer-settings__content .visualizer-settings__content-option:last-of-type{border-bottom-width:1px}.visualizer-settings .visualizer-settings__content .visualizer-settings__content-option .visualizer-settings__content-option-title{max-width:80%;display:block;font-size:1.25em}.visualizer-settings .visualizer-settings__content .visualizer-settings__content-option .visualizer-settings__content-option-icon{align-self:center;margin-left:auto;color:#b9bcc2}.visualizer-settings .visualizer-settings__content .visualizer-settings__content-option .visualizer-settings__content-option-icon .dashicon{height:25px;width:25px}.visualizer-settings .visualizer-settings__charts{text-align:center;padding-bottom:25px}.visualizer-settings .visualizer-settings__charts .visualizer-settings__charts-grid{display:grid;grid-template-columns:50% 50%}.visualizer-settings .visualizer-settings__charts .visualizer-settings__charts-grid .visualizer-settings__charts-single{margin:25px;padding-bottom:50px;background-color:#efefef;position:relative}.visualizer-settings .visualizer-settings__charts .visualizer-settings__charts-grid .visualizer-settings__charts-single .visualizer-settings__charts-title{padding:10px;font-weight:bold;text-align:center}.visualizer-settings .visualizer-settings__charts .visualizer-settings__charts-grid .visualizer-settings__charts-single .visualizer-settings__charts-footer{font-size:small}.visualizer-settings .visualizer-settings__charts .visualizer-settings__charts-grid .visualizer-settings__charts-single .visualizer-settings__charts-controls{width:100%;position:absolute;bottom:0;padding:10px;font-weight:bold;text-align:center;cursor:pointer}.visualizer-settings .visualizer-settings__charts .dataTables_wrapper{background:#fff;padding:10px}.visualizer-settings .visualizer-settings__charts .visualizer-no-charts{padding-top:25px}.visualizer-settings .visualizer-settings__chart{text-align:center}.visualizer-settings .visualizer-settings__chart .dataTables_wrapper{background:#fff;padding:10px}.visualizer-settings .visualizer-settings__controls{margin:0;padding:1.5rem 0;text-align:center;border-top:1px solid #e6eaee}.visualizer-advanced-panel.components-panel__body.is-opened>.components-panel__body-title{margin-bottom:0}.visualizer-inner-sections{background:#f8f9f9}.visualizer-inner-sections .components-panel__body-toggle:hover{background:#EEEEEE}.visualizer-inner-sections ul.visualizer-list{list-style:disc;margin-left:15px}.components-panel__body-button .components-panel__body-toggle.components-button .dashicons-admin-tools{margin:-2px 6px -2px 0}.components-panel__body-button .components-panel__body-toggle.components-button .dashicons-admin-users{margin:-2px 6px -2px 0}.components-panel__body-button .components-panel__body-toggle.components-button .components-panel__arrow{width:48px;height:48px;right:0;border-top:1px solid #ddd;-webkit-transform:translateY(-50%) rotate(270deg);transform:translateY(-50%) rotate(270deg)}.components-panel__body-button.visualizer-panel-back .components-panel__body-title{background:#f3f3f3}.components-panel__body-button.visualizer-panel-back .components-panel__body-title:hover{background:#f3f3f3}.components-panel__body-button.visualizer-panel-back .components-panel__body-title .components-panel__body-toggle{margin:10px 0;background:#fff}.components-panel__body-button.visualizer-panel-back .components-panel__body-title .components-panel__body-toggle.components-button{padding-left:60px}.components-panel__body-button.visualizer-panel-back .components-panel__body-title .components-panel__body-toggle.components-button:hover .components-panel__arrow{background:#f3f3f3;border-width:1px 1px 0 1px;border-color:#ddd;border-style:solid}.components-panel__body-button.visualizer-panel-back .components-panel__body-title .components-panel__body-toggle.components-button .components-panel__arrow{left:0;-webkit-transform:translateY(-50%) rotate(90deg);transform:translateY(-50%) rotate(90deg)}.visualizer-chart-editor{max-width:100%;margin:25px 25px 0}.visualizer-chart-editor .htEditor{margin-bottom:20px}.visualizer-chart-editor .htEditor .htRowHeaders{height:auto !important;width:auto !important}.visualizer-chart-editor .htEditor .ht_master .wtHolder{height:auto !important;width:auto !important}.visualizer-json-query-modal .components-modal__content{padding-left:0;padding-right:0}.visualizer-json-query-modal .components-modal__content .components-modal__header{margin:0}.visualizer-json-query-modal .components-icon-button{margin:10px 0}.visualizer-json-query-modal .visualizer-json-query-modal-headers-panel{padding:0 0 1em 2.2em}.visualizer-json-query-modal .visualizer-json-query-modal-headers-panel .components-base-control{display:inline-block}.visualizer-json-query-modal .visualizer-json-query-modal-headers-panel .visualizer-json-query-modal-field-separator{padding:0 10px}.visualizer-json-query-modal .viz-editor-table tbody tr:first-child{background-color:#ececec !important}.visualizer-json-query-modal .viz-editor-table tr th{background-color:#cccccc}.visualizer-json-query-modal .viz-editor-table thead tr th:nth-child(n+1){cursor:move !important}.visualizer-json-query-modal #visualizer-json-query-table{margin-bottom:10px}.visualizer-json-query-modal ul{list-style:disc;margin-left:10px}.visualizer-db-query-modal .CodeMirror-scroll{overflow:hidden !important;height:50%;margin:0;padding:0}.visualizer-db-query-modal .CodeMirror-wrap{height:200px;padding:15px;color:#fff;background:#282923;font-size:15px;margin-bottom:20px}.visualizer-db-query-modal .CodeMirror-wrap .CodeMirror-cursor{border-left:1px solid #fff !important}.visualizer-db-query-modal .CodeMirror-wrap .CodeMirror-placeholder{color:#fff}.visualizer-db-query-modal .CodeMirror-wrap pre{color:#fff !important}.visualizer-db-query-modal .CodeMirror-wrap .cm-keyword{color:#f92472 !important}.visualizer-db-query-modal .CodeMirror-wrap .cm-comment{color:#74705d !important}.visualizer-db-query-modal .CodeMirror-wrap .cm-number{color:#fff !important}.visualizer-db-query-modal .CodeMirror-wrap .cm-string{color:#fff !important}.visualizer-db-query-modal ul{list-style:disc;margin-left:10px}.visualizer-db-query-modal .db-wizard-error{color:#f00}.visualizer-db-query-modal .visualizer-db-query-actions .components-button:first-child{margin-right:10px}.htContextMenu:not(.htGhostTable){z-index:999999}.htDatepickerHolder,.CodeMirror-hints,.DTCR_clonedTable,.DTCR_pointer{z-index:999999 !important}@media (min-width: 768px){.visualizer-json-query-modal{width:668px}.visualizer-db-query-modal .CodeMirror-wrap{min-width:550px}}@media (max-width: 768px){.visualizer-settings .visualizer-settings__charts .visualizer-settings__charts-grid{display:grid;grid-template-columns:100%}}
2
 
classes/Visualizer/Gutenberg/build/block.js CHANGED
@@ -1,4 +1,4 @@
1
- !function(e){function t(t){for(var r,o,s=t[0],l=t[1],u=t[2],d=0,m=[];d<s.length;d++)o=s[d],Object.prototype.hasOwnProperty.call(a,o)&&a[o]&&m.push(a[o][0]),a[o]=0;for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r]);for(c&&c(t);m.length;)m.shift()();return i.push.apply(i,u||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],r=!0,s=1;s<n.length;s++){var l=n[s];0!==a[l]&&(r=!1)}r&&(i.splice(t--,1),e=o(o.s=n[0]))}return e}var r={},a={1:0},i=[];function o(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=e,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="";var s=window.webpackJsonp=window.webpackJsonp||[],l=s.push.bind(s);s.push=t,s=s.slice();for(var u=0;u<s.length;u++)t(s[u]);var c=l;i.push([154,0]),n()}([function(e,t,n){(function(e){e.exports=function(){"use strict";var t,r;function a(){return t.apply(null,arguments)}function i(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function o(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function s(e){return void 0===e}function l(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function u(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function c(e,t){var n,r=[];for(n=0;n<e.length;++n)r.push(t(e[n],n));return r}function d(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function m(e,t){for(var n in t)d(t,n)&&(e[n]=t[n]);return d(t,"toString")&&(e.toString=t.toString),d(t,"valueOf")&&(e.valueOf=t.valueOf),e}function p(e,t,n,r){return Et(e,t,n,r,!0).utc()}function h(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function _(e){if(null==e._isValid){var t=h(e),n=r.call(t.parsedDateParts,(function(e){return null!=e})),a=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(a=a&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return a;e._isValid=a}return e._isValid}function f(e){var t=p(NaN);return null!=e?m(h(t),e):h(t).userInvalidated=!0,t}r=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,r=0;r<n;r++)if(r in t&&e.call(this,t[r],r,t))return!0;return!1};var y=a.momentProperties=[];function g(e,t){var n,r,a;if(s(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),s(t._i)||(e._i=t._i),s(t._f)||(e._f=t._f),s(t._l)||(e._l=t._l),s(t._strict)||(e._strict=t._strict),s(t._tzm)||(e._tzm=t._tzm),s(t._isUTC)||(e._isUTC=t._isUTC),s(t._offset)||(e._offset=t._offset),s(t._pf)||(e._pf=h(t)),s(t._locale)||(e._locale=t._locale),y.length>0)for(n=0;n<y.length;n++)s(a=t[r=y[n]])||(e[r]=a);return e}var b=!1;function v(e){g(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===b&&(b=!0,a.updateOffset(this),b=!1)}function M(e){return e instanceof v||null!=e&&null!=e._isAMomentObject}function w(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function k(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=w(t)),n}function L(e,t,n){var r,a=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),o=0;for(r=0;r<a;r++)(n&&e[r]!==t[r]||!n&&k(e[r])!==k(t[r]))&&o++;return o+i}function Y(e){!1===a.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function D(e,t){var n=!0;return m((function(){if(null!=a.deprecationHandler&&a.deprecationHandler(null,e),n){for(var r,i=[],o=0;o<arguments.length;o++){if(r="","object"==typeof arguments[o]){for(var s in r+="\n["+o+"] ",arguments[0])r+=s+": "+arguments[0][s]+", ";r=r.slice(0,-2)}else r=arguments[o];i.push(r)}Y(e+"\nArguments: "+Array.prototype.slice.call(i).join("")+"\n"+(new Error).stack),n=!1}return t.apply(this,arguments)}),t)}var T,S={};function O(e,t){null!=a.deprecationHandler&&a.deprecationHandler(e,t),S[e]||(Y(t),S[e]=!0)}function x(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function j(e,t){var n,r=m({},e);for(n in t)d(t,n)&&(o(e[n])&&o(t[n])?(r[n]={},m(r[n],e[n]),m(r[n],t[n])):null!=t[n]?r[n]=t[n]:delete r[n]);for(n in e)d(e,n)&&!d(t,n)&&o(e[n])&&(r[n]=m({},r[n]));return r}function E(e){null!=e&&this.set(e)}a.suppressDeprecationWarnings=!1,a.deprecationHandler=null,T=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)d(e,t)&&n.push(t);return n};var C={};function H(e,t){var n=e.toLowerCase();C[n]=C[n+"s"]=C[t]=e}function P(e){return"string"==typeof e?C[e]||C[e.toLowerCase()]:void 0}function A(e){var t,n,r={};for(n in e)d(e,n)&&(t=P(n))&&(r[t]=e[n]);return r}var z={};function F(e,t){z[e]=t}function W(e,t,n){var r=""+Math.abs(e),a=t-r.length;return(e>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+r}var N=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,R=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,I={},B={};function U(e,t,n,r){var a=r;"string"==typeof r&&(a=function(){return this[r]()}),e&&(B[e]=a),t&&(B[t[0]]=function(){return W(a.apply(this,arguments),t[1],t[2])}),n&&(B[n]=function(){return this.localeData().ordinal(a.apply(this,arguments),e)})}function V(e,t){return e.isValid()?(t=J(t,e.localeData()),I[t]=I[t]||function(e){var t,n,r,a=e.match(N);for(t=0,n=a.length;t<n;t++)B[a[t]]?a[t]=B[a[t]]:a[t]=(r=a[t]).match(/\[[\s\S]/)?r.replace(/^\[|\]$/g,""):r.replace(/\\/g,"");return function(t){var r,i="";for(r=0;r<n;r++)i+=x(a[r])?a[r].call(t,e):a[r];return i}}(t),I[t](e)):e.localeData().invalidDate()}function J(e,t){var n=5;function r(e){return t.longDateFormat(e)||e}for(R.lastIndex=0;n>=0&&R.test(e);)e=e.replace(R,r),R.lastIndex=0,n-=1;return e}var G=/\d/,q=/\d\d/,$=/\d{3}/,K=/\d{4}/,Z=/[+-]?\d{6}/,Q=/\d\d?/,X=/\d\d\d\d?/,ee=/\d\d\d\d\d\d?/,te=/\d{1,3}/,ne=/\d{1,4}/,re=/[+-]?\d{1,6}/,ae=/\d+/,ie=/[+-]?\d+/,oe=/Z|[+-]\d\d:?\d\d/gi,se=/Z|[+-]\d\d(?::?\d\d)?/gi,le=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,ue={};function ce(e,t,n){ue[e]=x(t)?t:function(e,r){return e&&n?n:t}}function de(e,t){return d(ue,e)?ue[e](t._strict,t._locale):new RegExp(me(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(e,t,n,r,a){return t||n||r||a}))))}function me(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var pe={};function he(e,t){var n,r=t;for("string"==typeof e&&(e=[e]),l(t)&&(r=function(e,n){n[t]=k(e)}),n=0;n<e.length;n++)pe[e[n]]=r}function _e(e,t){he(e,(function(e,n,r,a){r._w=r._w||{},t(e,r._w,r,a)}))}function fe(e,t,n){null!=t&&d(pe,e)&&pe[e](t,n._a,n,e)}var ye=0,ge=1,be=2,ve=3,Me=4,we=5,ke=6,Le=7,Ye=8;function De(e){return Te(e)?366:365}function Te(e){return e%4==0&&e%100!=0||e%400==0}U("Y",0,0,(function(){var e=this.year();return e<=9999?""+e:"+"+e})),U(0,["YY",2],0,(function(){return this.year()%100})),U(0,["YYYY",4],0,"year"),U(0,["YYYYY",5],0,"year"),U(0,["YYYYYY",6,!0],0,"year"),H("year","y"),F("year",1),ce("Y",ie),ce("YY",Q,q),ce("YYYY",ne,K),ce("YYYYY",re,Z),ce("YYYYYY",re,Z),he(["YYYYY","YYYYYY"],ye),he("YYYY",(function(e,t){t[ye]=2===e.length?a.parseTwoDigitYear(e):k(e)})),he("YY",(function(e,t){t[ye]=a.parseTwoDigitYear(e)})),he("Y",(function(e,t){t[ye]=parseInt(e,10)})),a.parseTwoDigitYear=function(e){return k(e)+(k(e)>68?1900:2e3)};var Se,Oe=xe("FullYear",!0);function xe(e,t){return function(n){return null!=n?(Ee(this,e,n),a.updateOffset(this,t),this):je(this,e)}}function je(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function Ee(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&Te(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),Ce(n,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function Ce(e,t){if(isNaN(e)||isNaN(t))return NaN;var n,r=(t%(n=12)+n)%n;return e+=(t-r)/12,1===r?Te(e)?29:28:31-r%7%2}Se=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},U("M",["MM",2],"Mo",(function(){return this.month()+1})),U("MMM",0,0,(function(e){return this.localeData().monthsShort(this,e)})),U("MMMM",0,0,(function(e){return this.localeData().months(this,e)})),H("month","M"),F("month",8),ce("M",Q),ce("MM",Q,q),ce("MMM",(function(e,t){return t.monthsShortRegex(e)})),ce("MMMM",(function(e,t){return t.monthsRegex(e)})),he(["M","MM"],(function(e,t){t[ge]=k(e)-1})),he(["MMM","MMMM"],(function(e,t,n,r){var a=n._locale.monthsParse(e,r,n._strict);null!=a?t[ge]=a:h(n).invalidMonth=e}));var He=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Pe="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Ae="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function ze(e,t,n){var r,a,i,o=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)i=p([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(i,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(i,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(a=Se.call(this._shortMonthsParse,o))?a:null:-1!==(a=Se.call(this._longMonthsParse,o))?a:null:"MMM"===t?-1!==(a=Se.call(this._shortMonthsParse,o))?a:-1!==(a=Se.call(this._longMonthsParse,o))?a:null:-1!==(a=Se.call(this._longMonthsParse,o))?a:-1!==(a=Se.call(this._shortMonthsParse,o))?a:null}function Fe(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=k(t);else if(!l(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),Ce(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function We(e){return null!=e?(Fe(this,e),a.updateOffset(this,!0),this):je(this,"Month")}var Ne=le,Re=le;function Ie(){function e(e,t){return t.length-e.length}var t,n,r=[],a=[],i=[];for(t=0;t<12;t++)n=p([2e3,t]),r.push(this.monthsShort(n,"")),a.push(this.months(n,"")),i.push(this.months(n,"")),i.push(this.monthsShort(n,""));for(r.sort(e),a.sort(e),i.sort(e),t=0;t<12;t++)r[t]=me(r[t]),a[t]=me(a[t]);for(t=0;t<24;t++)i[t]=me(i[t]);this._monthsRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+r.join("|")+")","i")}function Be(e,t,n,r,a,i,o){var s=new Date(e,t,n,r,a,i,o);return e<100&&e>=0&&isFinite(s.getFullYear())&&s.setFullYear(e),s}function Ue(e){var t=new Date(Date.UTC.apply(null,arguments));return e<100&&e>=0&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function Ve(e,t,n){var r=7+t-n;return-(7+Ue(e,0,r).getUTCDay()-t)%7+r-1}function Je(e,t,n,r,a){var i,o,s=1+7*(t-1)+(7+n-r)%7+Ve(e,r,a);return s<=0?o=De(i=e-1)+s:s>De(e)?(i=e+1,o=s-De(e)):(i=e,o=s),{year:i,dayOfYear:o}}function Ge(e,t,n){var r,a,i=Ve(e.year(),t,n),o=Math.floor((e.dayOfYear()-i-1)/7)+1;return o<1?r=o+qe(a=e.year()-1,t,n):o>qe(e.year(),t,n)?(r=o-qe(e.year(),t,n),a=e.year()+1):(a=e.year(),r=o),{week:r,year:a}}function qe(e,t,n){var r=Ve(e,t,n),a=Ve(e+1,t,n);return(De(e)-r+a)/7}U("w",["ww",2],"wo","week"),U("W",["WW",2],"Wo","isoWeek"),H("week","w"),H("isoWeek","W"),F("week",5),F("isoWeek",5),ce("w",Q),ce("ww",Q,q),ce("W",Q),ce("WW",Q,q),_e(["w","ww","W","WW"],(function(e,t,n,r){t[r.substr(0,1)]=k(e)})),U("d",0,"do","day"),U("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),U("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),U("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),U("e",0,0,"weekday"),U("E",0,0,"isoWeekday"),H("day","d"),H("weekday","e"),H("isoWeekday","E"),F("day",11),F("weekday",11),F("isoWeekday",11),ce("d",Q),ce("e",Q),ce("E",Q),ce("dd",(function(e,t){return t.weekdaysMinRegex(e)})),ce("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),ce("dddd",(function(e,t){return t.weekdaysRegex(e)})),_e(["dd","ddd","dddd"],(function(e,t,n,r){var a=n._locale.weekdaysParse(e,r,n._strict);null!=a?t.d=a:h(n).invalidWeekday=e})),_e(["d","e","E"],(function(e,t,n,r){t[r]=k(e)}));var $e="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ke="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ze="Su_Mo_Tu_We_Th_Fr_Sa".split("_");function Qe(e,t,n){var r,a,i,o=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)i=p([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(i,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(a=Se.call(this._weekdaysParse,o))?a:null:"ddd"===t?-1!==(a=Se.call(this._shortWeekdaysParse,o))?a:null:-1!==(a=Se.call(this._minWeekdaysParse,o))?a:null:"dddd"===t?-1!==(a=Se.call(this._weekdaysParse,o))?a:-1!==(a=Se.call(this._shortWeekdaysParse,o))?a:-1!==(a=Se.call(this._minWeekdaysParse,o))?a:null:"ddd"===t?-1!==(a=Se.call(this._shortWeekdaysParse,o))?a:-1!==(a=Se.call(this._weekdaysParse,o))?a:-1!==(a=Se.call(this._minWeekdaysParse,o))?a:null:-1!==(a=Se.call(this._minWeekdaysParse,o))?a:-1!==(a=Se.call(this._weekdaysParse,o))?a:-1!==(a=Se.call(this._shortWeekdaysParse,o))?a:null}var Xe=le,et=le,tt=le;function nt(){function e(e,t){return t.length-e.length}var t,n,r,a,i,o=[],s=[],l=[],u=[];for(t=0;t<7;t++)n=p([2e3,1]).day(t),r=this.weekdaysMin(n,""),a=this.weekdaysShort(n,""),i=this.weekdays(n,""),o.push(r),s.push(a),l.push(i),u.push(r),u.push(a),u.push(i);for(o.sort(e),s.sort(e),l.sort(e),u.sort(e),t=0;t<7;t++)s[t]=me(s[t]),l[t]=me(l[t]),u[t]=me(u[t]);this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function rt(){return this.hours()%12||12}function at(e,t){U(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function it(e,t){return t._meridiemParse}U("H",["HH",2],0,"hour"),U("h",["hh",2],0,rt),U("k",["kk",2],0,(function(){return this.hours()||24})),U("hmm",0,0,(function(){return""+rt.apply(this)+W(this.minutes(),2)})),U("hmmss",0,0,(function(){return""+rt.apply(this)+W(this.minutes(),2)+W(this.seconds(),2)})),U("Hmm",0,0,(function(){return""+this.hours()+W(this.minutes(),2)})),U("Hmmss",0,0,(function(){return""+this.hours()+W(this.minutes(),2)+W(this.seconds(),2)})),at("a",!0),at("A",!1),H("hour","h"),F("hour",13),ce("a",it),ce("A",it),ce("H",Q),ce("h",Q),ce("k",Q),ce("HH",Q,q),ce("hh",Q,q),ce("kk",Q,q),ce("hmm",X),ce("hmmss",ee),ce("Hmm",X),ce("Hmmss",ee),he(["H","HH"],ve),he(["k","kk"],(function(e,t,n){var r=k(e);t[ve]=24===r?0:r})),he(["a","A"],(function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e})),he(["h","hh"],(function(e,t,n){t[ve]=k(e),h(n).bigHour=!0})),he("hmm",(function(e,t,n){var r=e.length-2;t[ve]=k(e.substr(0,r)),t[Me]=k(e.substr(r)),h(n).bigHour=!0})),he("hmmss",(function(e,t,n){var r=e.length-4,a=e.length-2;t[ve]=k(e.substr(0,r)),t[Me]=k(e.substr(r,2)),t[we]=k(e.substr(a)),h(n).bigHour=!0})),he("Hmm",(function(e,t,n){var r=e.length-2;t[ve]=k(e.substr(0,r)),t[Me]=k(e.substr(r))})),he("Hmmss",(function(e,t,n){var r=e.length-4,a=e.length-2;t[ve]=k(e.substr(0,r)),t[Me]=k(e.substr(r,2)),t[we]=k(e.substr(a))}));var ot,st=xe("Hours",!0),lt={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Pe,monthsShort:Ae,week:{dow:0,doy:6},weekdays:$e,weekdaysMin:Ze,weekdaysShort:Ke,meridiemParse:/[ap]\.?m?\.?/i},ut={},ct={};function dt(e){return e?e.toLowerCase().replace("_","-"):e}function mt(t){var r=null;if(!ut[t]&&void 0!==e&&e&&e.exports)try{r=ot._abbr,n(149)("./"+t),pt(r)}catch(e){}return ut[t]}function pt(e,t){var n;return e&&(n=s(t)?_t(e):ht(e,t))&&(ot=n),ot._abbr}function ht(e,t){if(null!==t){var n=lt;if(t.abbr=e,null!=ut[e])O("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=ut[e]._config;else if(null!=t.parentLocale){if(null==ut[t.parentLocale])return ct[t.parentLocale]||(ct[t.parentLocale]=[]),ct[t.parentLocale].push({name:e,config:t}),null;n=ut[t.parentLocale]._config}return ut[e]=new E(j(n,t)),ct[e]&&ct[e].forEach((function(e){ht(e.name,e.config)})),pt(e),ut[e]}return delete ut[e],null}function _t(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return ot;if(!i(e)){if(t=mt(e))return t;e=[e]}return function(e){for(var t,n,r,a,i=0;i<e.length;){for(t=(a=dt(e[i]).split("-")).length,n=(n=dt(e[i+1]))?n.split("-"):null;t>0;){if(r=mt(a.slice(0,t).join("-")))return r;if(n&&n.length>=t&&L(a,n,!0)>=t-1)break;t--}i++}return null}(e)}function ft(e){var t,n=e._a;return n&&-2===h(e).overflow&&(t=n[ge]<0||n[ge]>11?ge:n[be]<1||n[be]>Ce(n[ye],n[ge])?be:n[ve]<0||n[ve]>24||24===n[ve]&&(0!==n[Me]||0!==n[we]||0!==n[ke])?ve:n[Me]<0||n[Me]>59?Me:n[we]<0||n[we]>59?we:n[ke]<0||n[ke]>999?ke:-1,h(e)._overflowDayOfYear&&(t<ye||t>be)&&(t=be),h(e)._overflowWeeks&&-1===t&&(t=Le),h(e)._overflowWeekday&&-1===t&&(t=Ye),h(e).overflow=t),e}function yt(e,t,n){return null!=e?e:null!=t?t:n}function gt(e){var t,n,r,i,o,s=[];if(!e._d){for(r=function(e){var t=new Date(a.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}(e),e._w&&null==e._a[be]&&null==e._a[ge]&&function(e){var t,n,r,a,i,o,s,l;if(null!=(t=e._w).GG||null!=t.W||null!=t.E)i=1,o=4,n=yt(t.GG,e._a[ye],Ge(Ct(),1,4).year),r=yt(t.W,1),((a=yt(t.E,1))<1||a>7)&&(l=!0);else{i=e._locale._week.dow,o=e._locale._week.doy;var u=Ge(Ct(),i,o);n=yt(t.gg,e._a[ye],u.year),r=yt(t.w,u.week),null!=t.d?((a=t.d)<0||a>6)&&(l=!0):null!=t.e?(a=t.e+i,(t.e<0||t.e>6)&&(l=!0)):a=i}r<1||r>qe(n,i,o)?h(e)._overflowWeeks=!0:null!=l?h(e)._overflowWeekday=!0:(s=Je(n,r,a,i,o),e._a[ye]=s.year,e._dayOfYear=s.dayOfYear)}(e),null!=e._dayOfYear&&(o=yt(e._a[ye],r[ye]),(e._dayOfYear>De(o)||0===e._dayOfYear)&&(h(e)._overflowDayOfYear=!0),n=Ue(o,0,e._dayOfYear),e._a[ge]=n.getUTCMonth(),e._a[be]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=s[t]=r[t];for(;t<7;t++)e._a[t]=s[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ve]&&0===e._a[Me]&&0===e._a[we]&&0===e._a[ke]&&(e._nextDay=!0,e._a[ve]=0),e._d=(e._useUTC?Ue:Be).apply(null,s),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ve]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(h(e).weekdayMismatch=!0)}}var bt=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,vt=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Mt=/Z|[+-]\d\d(?::?\d\d)?/,wt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],kt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Lt=/^\/?Date\((\-?\d+)/i;function Yt(e){var t,n,r,a,i,o,s=e._i,l=bt.exec(s)||vt.exec(s);if(l){for(h(e).iso=!0,t=0,n=wt.length;t<n;t++)if(wt[t][1].exec(l[1])){a=wt[t][0],r=!1!==wt[t][2];break}if(null==a)return void(e._isValid=!1);if(l[3]){for(t=0,n=kt.length;t<n;t++)if(kt[t][1].exec(l[3])){i=(l[2]||" ")+kt[t][0];break}if(null==i)return void(e._isValid=!1)}if(!r&&null!=i)return void(e._isValid=!1);if(l[4]){if(!Mt.exec(l[4]))return void(e._isValid=!1);o="Z"}e._f=a+(i||"")+(o||""),xt(e)}else e._isValid=!1}var Dt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;function Tt(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}var St={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Ot(e){var t,n,r,a,i,o,s,l=Dt.exec(e._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim());if(l){var u=(t=l[4],n=l[3],r=l[2],a=l[5],i=l[6],o=l[7],s=[Tt(t),Ae.indexOf(n),parseInt(r,10),parseInt(a,10),parseInt(i,10)],o&&s.push(parseInt(o,10)),s);if(!function(e,t,n){return!e||Ke.indexOf(e)===new Date(t[0],t[1],t[2]).getDay()||(h(n).weekdayMismatch=!0,n._isValid=!1,!1)}(l[1],u,e))return;e._a=u,e._tzm=function(e,t,n){if(e)return St[e];if(t)return 0;var r=parseInt(n,10),a=r%100;return(r-a)/100*60+a}(l[8],l[9],l[10]),e._d=Ue.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),h(e).rfc2822=!0}else e._isValid=!1}function xt(e){if(e._f!==a.ISO_8601)if(e._f!==a.RFC_2822){e._a=[],h(e).empty=!0;var t,n,r,i,o,s=""+e._i,l=s.length,u=0;for(r=J(e._f,e._locale).match(N)||[],t=0;t<r.length;t++)i=r[t],(n=(s.match(de(i,e))||[])[0])&&((o=s.substr(0,s.indexOf(n))).length>0&&h(e).unusedInput.push(o),s=s.slice(s.indexOf(n)+n.length),u+=n.length),B[i]?(n?h(e).empty=!1:h(e).unusedTokens.push(i),fe(i,n,e)):e._strict&&!n&&h(e).unusedTokens.push(i);h(e).charsLeftOver=l-u,s.length>0&&h(e).unusedInput.push(s),e._a[ve]<=12&&!0===h(e).bigHour&&e._a[ve]>0&&(h(e).bigHour=void 0),h(e).parsedDateParts=e._a.slice(0),h(e).meridiem=e._meridiem,e._a[ve]=function(e,t,n){var r;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((r=e.isPM(n))&&t<12&&(t+=12),r||12!==t||(t=0),t):t}(e._locale,e._a[ve],e._meridiem),gt(e),ft(e)}else Ot(e);else Yt(e)}function jt(e){var t=e._i,n=e._f;return e._locale=e._locale||_t(e._l),null===t||void 0===n&&""===t?f({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),M(t)?new v(ft(t)):(u(t)?e._d=t:i(n)?function(e){var t,n,r,a,i;if(0===e._f.length)return h(e).invalidFormat=!0,void(e._d=new Date(NaN));for(a=0;a<e._f.length;a++)i=0,t=g({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[a],xt(t),_(t)&&(i+=h(t).charsLeftOver,i+=10*h(t).unusedTokens.length,h(t).score=i,(null==r||i<r)&&(r=i,n=t));m(e,n||t)}(e):n?xt(e):function(e){var t=e._i;s(t)?e._d=new Date(a.now()):u(t)?e._d=new Date(t.valueOf()):"string"==typeof t?function(e){var t=Lt.exec(e._i);null===t?(Yt(e),!1===e._isValid&&(delete e._isValid,Ot(e),!1===e._isValid&&(delete e._isValid,a.createFromInputFallback(e)))):e._d=new Date(+t[1])}(e):i(t)?(e._a=c(t.slice(0),(function(e){return parseInt(e,10)})),gt(e)):o(t)?function(e){if(!e._d){var t=A(e._i);e._a=c([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],(function(e){return e&&parseInt(e,10)})),gt(e)}}(e):l(t)?e._d=new Date(t):a.createFromInputFallback(e)}(e),_(e)||(e._d=null),e))}function Et(e,t,n,r,a){var s,l={};return!0!==n&&!1!==n||(r=n,n=void 0),(o(e)&&function(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0}(e)||i(e)&&0===e.length)&&(e=void 0),l._isAMomentObject=!0,l._useUTC=l._isUTC=a,l._l=n,l._i=e,l._f=t,l._strict=r,(s=new v(ft(jt(l))))._nextDay&&(s.add(1,"d"),s._nextDay=void 0),s}function Ct(e,t,n,r){return Et(e,t,n,r,!1)}a.createFromInputFallback=D("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",(function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))})),a.ISO_8601=function(){},a.RFC_2822=function(){};var Ht=D("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=Ct.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:f()})),Pt=D("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=Ct.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:f()}));function At(e,t){var n,r;if(1===t.length&&i(t[0])&&(t=t[0]),!t.length)return Ct();for(n=t[0],r=1;r<t.length;++r)t[r].isValid()&&!t[r][e](n)||(n=t[r]);return n}var zt=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ft(e){var t=A(e),n=t.year||0,r=t.quarter||0,a=t.month||0,i=t.week||0,o=t.day||0,s=t.hour||0,l=t.minute||0,u=t.second||0,c=t.millisecond||0;this._isValid=function(e){for(var t in e)if(-1===Se.call(zt,t)||null!=e[t]&&isNaN(e[t]))return!1;for(var n=!1,r=0;r<zt.length;++r)if(e[zt[r]]){if(n)return!1;parseFloat(e[zt[r]])!==k(e[zt[r]])&&(n=!0)}return!0}(t),this._milliseconds=+c+1e3*u+6e4*l+1e3*s*60*60,this._days=+o+7*i,this._months=+a+3*r+12*n,this._data={},this._locale=_t(),this._bubble()}function Wt(e){return e instanceof Ft}function Nt(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Rt(e,t){U(e,0,0,(function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+W(~~(e/60),2)+t+W(~~e%60,2)}))}Rt("Z",":"),Rt("ZZ",""),ce("Z",se),ce("ZZ",se),he(["Z","ZZ"],(function(e,t,n){n._useUTC=!0,n._tzm=Bt(se,e)}));var It=/([\+\-]|\d\d)/gi;function Bt(e,t){var n=(t||"").match(e);if(null===n)return null;var r=((n[n.length-1]||[])+"").match(It)||["-",0,0],a=60*r[1]+k(r[2]);return 0===a?0:"+"===r[0]?a:-a}function Ut(e,t){var n,r;return t._isUTC?(n=t.clone(),r=(M(e)||u(e)?e.valueOf():Ct(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),a.updateOffset(n,!1),n):Ct(e).local()}function Vt(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Jt(){return!!this.isValid()&&this._isUTC&&0===this._offset}a.updateOffset=function(){};var Gt=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,qt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function $t(e,t){var n,r,a,i,o,s,u=e,c=null;return Wt(e)?u={ms:e._milliseconds,d:e._days,M:e._months}:l(e)?(u={},t?u[t]=e:u.milliseconds=e):(c=Gt.exec(e))?(n="-"===c[1]?-1:1,u={y:0,d:k(c[be])*n,h:k(c[ve])*n,m:k(c[Me])*n,s:k(c[we])*n,ms:k(Nt(1e3*c[ke]))*n}):(c=qt.exec(e))?(n="-"===c[1]?-1:(c[1],1),u={y:Kt(c[2],n),M:Kt(c[3],n),w:Kt(c[4],n),d:Kt(c[5],n),h:Kt(c[6],n),m:Kt(c[7],n),s:Kt(c[8],n)}):null==u?u={}:"object"==typeof u&&("from"in u||"to"in u)&&(i=Ct(u.from),o=Ct(u.to),a=i.isValid()&&o.isValid()?(o=Ut(o,i),i.isBefore(o)?s=Zt(i,o):((s=Zt(o,i)).milliseconds=-s.milliseconds,s.months=-s.months),s):{milliseconds:0,months:0},(u={}).ms=a.milliseconds,u.M=a.months),r=new Ft(u),Wt(e)&&d(e,"_locale")&&(r._locale=e._locale),r}function Kt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Zt(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Qt(e,t){return function(n,r){var a;return null===r||isNaN(+r)||(O(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=n,n=r,r=a),Xt(this,$t(n="string"==typeof n?+n:n,r),e),this}}function Xt(e,t,n,r){var i=t._milliseconds,o=Nt(t._days),s=Nt(t._months);e.isValid()&&(r=null==r||r,s&&Fe(e,je(e,"Month")+s*n),o&&Ee(e,"Date",je(e,"Date")+o*n),i&&e._d.setTime(e._d.valueOf()+i*n),r&&a.updateOffset(e,o||s))}$t.fn=Ft.prototype,$t.invalid=function(){return $t(NaN)};var en=Qt(1,"add"),tn=Qt(-1,"subtract");function nn(e,t){var n=12*(t.year()-e.year())+(t.month()-e.month()),r=e.clone().add(n,"months");return-(n+(t-r<0?(t-r)/(r-e.clone().add(n-1,"months")):(t-r)/(e.clone().add(n+1,"months")-r)))||0}function rn(e){var t;return void 0===e?this._locale._abbr:(null!=(t=_t(e))&&(this._locale=t),this)}a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",a.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var an=D("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(e){return void 0===e?this.localeData():this.locale(e)}));function on(){return this._locale}function sn(e,t){U(0,[e,e.length],0,t)}function ln(e,t,n,r,a){var i;return null==e?Ge(this,r,a).year:(t>(i=qe(e,r,a))&&(t=i),un.call(this,e,t,n,r,a))}function un(e,t,n,r,a){var i=Je(e,t,n,r,a),o=Ue(i.year,0,i.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}U(0,["gg",2],0,(function(){return this.weekYear()%100})),U(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),sn("gggg","weekYear"),sn("ggggg","weekYear"),sn("GGGG","isoWeekYear"),sn("GGGGG","isoWeekYear"),H("weekYear","gg"),H("isoWeekYear","GG"),F("weekYear",1),F("isoWeekYear",1),ce("G",ie),ce("g",ie),ce("GG",Q,q),ce("gg",Q,q),ce("GGGG",ne,K),ce("gggg",ne,K),ce("GGGGG",re,Z),ce("ggggg",re,Z),_e(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,n,r){t[r.substr(0,2)]=k(e)})),_e(["gg","GG"],(function(e,t,n,r){t[r]=a.parseTwoDigitYear(e)})),U("Q",0,"Qo","quarter"),H("quarter","Q"),F("quarter",7),ce("Q",G),he("Q",(function(e,t){t[ge]=3*(k(e)-1)})),U("D",["DD",2],"Do","date"),H("date","D"),F("date",9),ce("D",Q),ce("DD",Q,q),ce("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),he(["D","DD"],be),he("Do",(function(e,t){t[be]=k(e.match(Q)[0])}));var cn=xe("Date",!0);U("DDD",["DDDD",3],"DDDo","dayOfYear"),H("dayOfYear","DDD"),F("dayOfYear",4),ce("DDD",te),ce("DDDD",$),he(["DDD","DDDD"],(function(e,t,n){n._dayOfYear=k(e)})),U("m",["mm",2],0,"minute"),H("minute","m"),F("minute",14),ce("m",Q),ce("mm",Q,q),he(["m","mm"],Me);var dn=xe("Minutes",!1);U("s",["ss",2],0,"second"),H("second","s"),F("second",15),ce("s",Q),ce("ss",Q,q),he(["s","ss"],we);var mn,pn=xe("Seconds",!1);for(U("S",0,0,(function(){return~~(this.millisecond()/100)})),U(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),U(0,["SSS",3],0,"millisecond"),U(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),U(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),U(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),U(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),U(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),U(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),H("millisecond","ms"),F("millisecond",16),ce("S",te,G),ce("SS",te,q),ce("SSS",te,$),mn="SSSS";mn.length<=9;mn+="S")ce(mn,ae);function hn(e,t){t[ke]=k(1e3*("0."+e))}for(mn="S";mn.length<=9;mn+="S")he(mn,hn);var _n=xe("Milliseconds",!1);U("z",0,0,"zoneAbbr"),U("zz",0,0,"zoneName");var fn=v.prototype;function yn(e){return e}fn.add=en,fn.calendar=function(e,t){var n=e||Ct(),r=Ut(n,this).startOf("day"),i=a.calendarFormat(this,r)||"sameElse",o=t&&(x(t[i])?t[i].call(this,n):t[i]);return this.format(o||this.localeData().calendar(i,this,Ct(n)))},fn.clone=function(){return new v(this)},fn.diff=function(e,t,n){var r,a,i;if(!this.isValid())return NaN;if(!(r=Ut(e,this)).isValid())return NaN;switch(a=6e4*(r.utcOffset()-this.utcOffset()),t=P(t)){case"year":i=nn(this,r)/12;break;case"month":i=nn(this,r);break;case"quarter":i=nn(this,r)/3;break;case"second":i=(this-r)/1e3;break;case"minute":i=(this-r)/6e4;break;case"hour":i=(this-r)/36e5;break;case"day":i=(this-r-a)/864e5;break;case"week":i=(this-r-a)/6048e5;break;default:i=this-r}return n?i:w(i)},fn.endOf=function(e){return void 0===(e=P(e))||"millisecond"===e?this:("date"===e&&(e="day"),this.startOf(e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms"))},fn.format=function(e){e||(e=this.isUtc()?a.defaultFormatUtc:a.defaultFormat);var t=V(this,e);return this.localeData().postformat(t)},fn.from=function(e,t){return this.isValid()&&(M(e)&&e.isValid()||Ct(e).isValid())?$t({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},fn.fromNow=function(e){return this.from(Ct(),e)},fn.to=function(e,t){return this.isValid()&&(M(e)&&e.isValid()||Ct(e).isValid())?$t({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},fn.toNow=function(e){return this.to(Ct(),e)},fn.get=function(e){return x(this[e=P(e)])?this[e]():this},fn.invalidAt=function(){return h(this).overflow},fn.isAfter=function(e,t){var n=M(e)?e:Ct(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=P(s(t)?"millisecond":t))?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},fn.isBefore=function(e,t){var n=M(e)?e:Ct(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=P(s(t)?"millisecond":t))?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},fn.isBetween=function(e,t,n,r){return("("===(r=r||"()")[0]?this.isAfter(e,n):!this.isBefore(e,n))&&(")"===r[1]?this.isBefore(t,n):!this.isAfter(t,n))},fn.isSame=function(e,t){var n,r=M(e)?e:Ct(e);return!(!this.isValid()||!r.isValid())&&("millisecond"===(t=P(t||"millisecond"))?this.valueOf()===r.valueOf():(n=r.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},fn.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},fn.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},fn.isValid=function(){return _(this)},fn.lang=an,fn.locale=rn,fn.localeData=on,fn.max=Pt,fn.min=Ht,fn.parsingFlags=function(){return m({},h(this))},fn.set=function(e,t){if("object"==typeof e)for(var n=function(e){var t=[];for(var n in e)t.push({unit:n,priority:z[n]});return t.sort((function(e,t){return e.priority-t.priority})),t}(e=A(e)),r=0;r<n.length;r++)this[n[r].unit](e[n[r].unit]);else if(x(this[e=P(e)]))return this[e](t);return this},fn.startOf=function(e){switch(e=P(e)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===e&&this.weekday(0),"isoWeek"===e&&this.isoWeekday(1),"quarter"===e&&this.month(3*Math.floor(this.month()/3)),this},fn.subtract=tn,fn.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},fn.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},fn.toDate=function(){return new Date(this.valueOf())},fn.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?V(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):x(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this._d.valueOf()).toISOString().replace("Z",V(n,"Z")):V(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},fn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var n="["+e+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",a=t+'[")]';return this.format(n+r+"-MM-DD[T]HH:mm:ss.SSS"+a)},fn.toJSON=function(){return this.isValid()?this.toISOString():null},fn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},fn.unix=function(){return Math.floor(this.valueOf()/1e3)},fn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},fn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},fn.year=Oe,fn.isLeapYear=function(){return Te(this.year())},fn.weekYear=function(e){return ln.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},fn.isoWeekYear=function(e){return ln.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},fn.quarter=fn.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},fn.month=We,fn.daysInMonth=function(){return Ce(this.year(),this.month())},fn.week=fn.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},fn.isoWeek=fn.isoWeeks=function(e){var t=Ge(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},fn.weeksInYear=function(){var e=this.localeData()._week;return qe(this.year(),e.dow,e.doy)},fn.isoWeeksInYear=function(){return qe(this.year(),1,4)},fn.date=cn,fn.day=fn.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=function(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}(e,this.localeData()),this.add(e-t,"d")):t},fn.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},fn.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=function(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},fn.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},fn.hour=fn.hours=st,fn.minute=fn.minutes=dn,fn.second=fn.seconds=pn,fn.millisecond=fn.milliseconds=_n,fn.utcOffset=function(e,t,n){var r,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=Bt(se,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(r=Vt(this)),this._offset=e,this._isUTC=!0,null!=r&&this.add(r,"m"),i!==e&&(!t||this._changeInProgress?Xt(this,$t(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?i:Vt(this)},fn.utc=function(e){return this.utcOffset(0,e)},fn.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Vt(this),"m")),this},fn.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=Bt(oe,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},fn.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Ct(e).utcOffset():0,(this.utcOffset()-e)%60==0)},fn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},fn.isLocal=function(){return!!this.isValid()&&!this._isUTC},fn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},fn.isUtc=Jt,fn.isUTC=Jt,fn.zoneAbbr=function(){return this._isUTC?"UTC":""},fn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},fn.dates=D("dates accessor is deprecated. Use date instead.",cn),fn.months=D("months accessor is deprecated. Use month instead",We),fn.years=D("years accessor is deprecated. Use year instead",Oe),fn.zone=D("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()})),fn.isDSTShifted=D("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!s(this._isDSTShifted))return this._isDSTShifted;var e={};if(g(e,this),(e=jt(e))._a){var t=e._isUTC?p(e._a):Ct(e._a);this._isDSTShifted=this.isValid()&&L(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}));var gn=E.prototype;function bn(e,t,n,r){var a=_t(),i=p().set(r,t);return a[n](i,e)}function vn(e,t,n){if(l(e)&&(t=e,e=void 0),e=e||"",null!=t)return bn(e,t,n,"month");var r,a=[];for(r=0;r<12;r++)a[r]=bn(e,r,n,"month");return a}function Mn(e,t,n,r){"boolean"==typeof e?(l(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,l(t)&&(n=t,t=void 0),t=t||"");var a,i=_t(),o=e?i._week.dow:0;if(null!=n)return bn(t,(n+o)%7,r,"day");var s=[];for(a=0;a<7;a++)s[a]=bn(t,(a+o)%7,r,"day");return s}gn.calendar=function(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return x(r)?r.call(t,n):r},gn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,(function(e){return e.slice(1)})),this._longDateFormat[e])},gn.invalidDate=function(){return this._invalidDate},gn.ordinal=function(e){return this._ordinal.replace("%d",e)},gn.preparse=yn,gn.postformat=yn,gn.relativeTime=function(e,t,n,r){var a=this._relativeTime[n];return x(a)?a(e,t,n,r):a.replace(/%d/i,e)},gn.pastFuture=function(e,t){var n=this._relativeTime[e>0?"future":"past"];return x(n)?n(t):n.replace(/%s/i,t)},gn.set=function(e){var t,n;for(n in e)x(t=e[n])?this[n]=t:this["_"+n]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},gn.months=function(e,t){return e?i(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||He).test(t)?"format":"standalone"][e.month()]:i(this._months)?this._months:this._months.standalone},gn.monthsShort=function(e,t){return e?i(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[He.test(t)?"format":"standalone"][e.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},gn.monthsParse=function(e,t,n){var r,a,i;if(this._monthsParseExact)return ze.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(a=p([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(i="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[r]=new RegExp(i.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[r].test(e))return r;if(n&&"MMM"===t&&this._shortMonthsParse[r].test(e))return r;if(!n&&this._monthsParse[r].test(e))return r}},gn.monthsRegex=function(e){return this._monthsParseExact?(d(this,"_monthsRegex")||Ie.call(this),e?this._monthsStrictRegex:this._monthsRegex):(d(this,"_monthsRegex")||(this._monthsRegex=Re),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},gn.monthsShortRegex=function(e){return this._monthsParseExact?(d(this,"_monthsRegex")||Ie.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(d(this,"_monthsShortRegex")||(this._monthsShortRegex=Ne),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},gn.week=function(e){return Ge(e,this._week.dow,this._week.doy).week},gn.firstDayOfYear=function(){return this._week.doy},gn.firstDayOfWeek=function(){return this._week.dow},gn.weekdays=function(e,t){return e?i(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"][e.day()]:i(this._weekdays)?this._weekdays:this._weekdays.standalone},gn.weekdaysMin=function(e){return e?this._weekdaysMin[e.day()]:this._weekdaysMin},gn.weekdaysShort=function(e){return e?this._weekdaysShort[e.day()]:this._weekdaysShort},gn.weekdaysParse=function(e,t,n){var r,a,i;if(this._weekdaysParseExact)return Qe.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(a=p([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(a,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(a,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(a,"").replace(".",".?")+"$","i")),this._weekdaysParse[r]||(i="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[r]=new RegExp(i.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[r].test(e))return r;if(n&&"ddd"===t&&this._shortWeekdaysParse[r].test(e))return r;if(n&&"dd"===t&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}},gn.weekdaysRegex=function(e){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||nt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(d(this,"_weekdaysRegex")||(this._weekdaysRegex=Xe),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},gn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||nt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(d(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=et),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},gn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||nt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(d(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=tt),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},gn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},gn.meridiem=function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},pt("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===k(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),a.lang=D("moment.lang is deprecated. Use moment.locale instead.",pt),a.langData=D("moment.langData is deprecated. Use moment.localeData instead.",_t);var wn=Math.abs;function kn(e,t,n,r){var a=$t(t,n);return e._milliseconds+=r*a._milliseconds,e._days+=r*a._days,e._months+=r*a._months,e._bubble()}function Ln(e){return e<0?Math.floor(e):Math.ceil(e)}function Yn(e){return 4800*e/146097}function Dn(e){return 146097*e/4800}function Tn(e){return function(){return this.as(e)}}var Sn=Tn("ms"),On=Tn("s"),xn=Tn("m"),jn=Tn("h"),En=Tn("d"),Cn=Tn("w"),Hn=Tn("M"),Pn=Tn("y");function An(e){return function(){return this.isValid()?this._data[e]:NaN}}var zn=An("milliseconds"),Fn=An("seconds"),Wn=An("minutes"),Nn=An("hours"),Rn=An("days"),In=An("months"),Bn=An("years"),Un=Math.round,Vn={ss:44,s:45,m:45,h:22,d:26,M:11};function Jn(e,t,n,r,a){return a.relativeTime(t||1,!!n,e,r)}var Gn=Math.abs;function qn(e){return(e>0)-(e<0)||+e}function $n(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n=Gn(this._milliseconds)/1e3,r=Gn(this._days),a=Gn(this._months);e=w(n/60),t=w(e/60),n%=60,e%=60;var i=w(a/12),o=a%=12,s=r,l=t,u=e,c=n?n.toFixed(3).replace(/\.?0+$/,""):"",d=this.asSeconds();if(!d)return"P0D";var m=d<0?"-":"",p=qn(this._months)!==qn(d)?"-":"",h=qn(this._days)!==qn(d)?"-":"",_=qn(this._milliseconds)!==qn(d)?"-":"";return m+"P"+(i?p+i+"Y":"")+(o?p+o+"M":"")+(s?h+s+"D":"")+(l||u||c?"T":"")+(l?_+l+"H":"")+(u?_+u+"M":"")+(c?_+c+"S":"")}var Kn=Ft.prototype;return Kn.isValid=function(){return this._isValid},Kn.abs=function(){var e=this._data;return this._milliseconds=wn(this._milliseconds),this._days=wn(this._days),this._months=wn(this._months),e.milliseconds=wn(e.milliseconds),e.seconds=wn(e.seconds),e.minutes=wn(e.minutes),e.hours=wn(e.hours),e.months=wn(e.months),e.years=wn(e.years),this},Kn.add=function(e,t){return kn(this,e,t,1)},Kn.subtract=function(e,t){return kn(this,e,t,-1)},Kn.as=function(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if("month"===(e=P(e))||"year"===e)return t=this._days+r/864e5,n=this._months+Yn(t),"month"===e?n:n/12;switch(t=this._days+Math.round(Dn(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return 24*t+r/36e5;case"minute":return 1440*t+r/6e4;case"second":return 86400*t+r/1e3;case"millisecond":return Math.floor(864e5*t)+r;default:throw new Error("Unknown unit "+e)}},Kn.asMilliseconds=Sn,Kn.asSeconds=On,Kn.asMinutes=xn,Kn.asHours=jn,Kn.asDays=En,Kn.asWeeks=Cn,Kn.asMonths=Hn,Kn.asYears=Pn,Kn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*k(this._months/12):NaN},Kn._bubble=function(){var e,t,n,r,a,i=this._milliseconds,o=this._days,s=this._months,l=this._data;return i>=0&&o>=0&&s>=0||i<=0&&o<=0&&s<=0||(i+=864e5*Ln(Dn(s)+o),o=0,s=0),l.milliseconds=i%1e3,e=w(i/1e3),l.seconds=e%60,t=w(e/60),l.minutes=t%60,n=w(t/60),l.hours=n%24,o+=w(n/24),a=w(Yn(o)),s+=a,o-=Ln(Dn(a)),r=w(s/12),s%=12,l.days=o,l.months=s,l.years=r,this},Kn.clone=function(){return $t(this)},Kn.get=function(e){return e=P(e),this.isValid()?this[e+"s"]():NaN},Kn.milliseconds=zn,Kn.seconds=Fn,Kn.minutes=Wn,Kn.hours=Nn,Kn.days=Rn,Kn.weeks=function(){return w(this.days()/7)},Kn.months=In,Kn.years=Bn,Kn.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var t=this.localeData(),n=function(e,t,n){var r=$t(e).abs(),a=Un(r.as("s")),i=Un(r.as("m")),o=Un(r.as("h")),s=Un(r.as("d")),l=Un(r.as("M")),u=Un(r.as("y")),c=a<=Vn.ss&&["s",a]||a<Vn.s&&["ss",a]||i<=1&&["m"]||i<Vn.m&&["mm",i]||o<=1&&["h"]||o<Vn.h&&["hh",o]||s<=1&&["d"]||s<Vn.d&&["dd",s]||l<=1&&["M"]||l<Vn.M&&["MM",l]||u<=1&&["y"]||["yy",u];return c[2]=t,c[3]=+e>0,c[4]=n,Jn.apply(null,c)}(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)},Kn.toISOString=$n,Kn.toString=$n,Kn.toJSON=$n,Kn.locale=rn,Kn.localeData=on,Kn.toIsoString=D("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",$n),Kn.lang=an,U("X",0,0,"unix"),U("x",0,0,"valueOf"),ce("x",ie),ce("X",/[+-]?\d+(\.\d{1,3})?/),he("X",(function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))})),he("x",(function(e,t,n){n._d=new Date(k(e))})),a.version="2.20.1",t=Ct,a.fn=fn,a.min=function(){return At("isBefore",[].slice.call(arguments,0))},a.max=function(){return At("isAfter",[].slice.call(arguments,0))},a.now=function(){return Date.now?Date.now():+new Date},a.utc=p,a.unix=function(e){return Ct(1e3*e)},a.months=function(e,t){return vn(e,t,"months")},a.isDate=u,a.locale=pt,a.invalid=f,a.duration=$t,a.isMoment=M,a.weekdays=function(e,t,n){return Mn(e,t,n,"weekdays")},a.parseZone=function(){return Ct.apply(null,arguments).parseZone()},a.localeData=_t,a.isDuration=Wt,a.monthsShort=function(e,t){return vn(e,t,"monthsShort")},a.weekdaysMin=function(e,t,n){return Mn(e,t,n,"weekdaysMin")},a.defineLocale=ht,a.updateLocale=function(e,t){if(null!=t){var n,r,a=lt;null!=(r=mt(e))&&(a=r._config),t=j(a,t),(n=new E(t)).parentLocale=ut[e],ut[e]=n,pt(e)}else null!=ut[e]&&(null!=ut[e].parentLocale?ut[e]=ut[e].parentLocale:null!=ut[e]&&delete ut[e]);return ut[e]},a.locales=function(){return T(ut)},a.weekdaysShort=function(e,t,n){return Mn(e,t,n,"weekdaysShort")},a.normalizeUnits=P,a.relativeTimeRounding=function(e){return void 0===e?Un:"function"==typeof e&&(Un=e,!0)},a.relativeTimeThreshold=function(e,t){return void 0!==Vn[e]&&(void 0===t?Vn[e]:(Vn[e]=t,"s"===e&&(Vn.ss=t-1),!0))},a.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},a.prototype=fn,a.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"YYYY-[W]WW",MONTH:"YYYY-MM"},a}()}).call(this,n(9)(e))},function(e,t,n){"use strict";e.exports=n(135)},function(e,t){function n(e,t=null,n=null){var r=[];function a(e,t,n,i=0){let o;if(null!==n&&i<n)y(e)&&(o=Object.keys(e)).forEach(r=>{a(e[r],t,n,i+1)});else{if(null!==n&&i==n)return 0==n?void(r=a(e,t,null,i)):void(y(e)&&r.push(a(e,t,n,i+1)));switch(M(e)){case"array":var s=[];if(o=Object.keys(e),null===t||i<t)for(var l=0,u=o.length;l<u;l++){const r=o[l],u=e[r];s[r]=a(u,t,n,i+1)}return s;case"object":var c={};if(o=Object.keys(e),null===t||i<t)for(l=0,u=o.length;l<u;l++){const r=o[l],s=e[r];c[r]=a(s,t,n,i+1)}return c;case"string":return""+e;case"number":return 0+e;case"boolean":return!!e;case"null":return null;case"undefined":return}}}return null===n?a(e,t,n,0):(a(e,t,n,0),r)}function r(e,t,n=null){if("string"===M(t)&&""!==t){var r=[];return function e(t,n,a="",i="",o=null,s=0){if(a===n&&(r[r.length]=i),null!==o&&s>=o)return!1;if(y(t))for(var l=0,u=Object.keys(t),c=u.length;l<c;l++){const r=u[l];e(t[r],n,r,(""===i?i:i+".")+r,o,s+1)}}(e,t,"","",n),0!==(r=r.map(e=>"boolean"===M(e)?e:""===e?e:((e=e.split(".")).pop(),e=e.join(".")))).length&&r}}function a(e,t,n=null){if("string"===M(t)&&""!==t){var r=function e(t,n,r="",a,i=0){if(r===n)return r;var o=!1;if(null!==a&&i>=a)return o;if(y(t))for(var s=0,l=Object.keys(t),u=l.length;s<u;s++){const u=l[s],c=e(t[u],n,u,a,i+1);if(c){o=(r=""===r?r:r+".")+c;break}}return o}(e,t,"",n,0);return"boolean"===M(r)?r:""===r?r:((r=r.split(".")).pop(),r=r.join("."))}}function i(e,t,n=null){if(!u(t=s(t)))return function e(t,n,r,a=0){if(f(t,[n]))return u(t[n]);if(null!==r&&a>=r)return!1;if(y(t))for(var i=0,o=Object.keys(t),s=o.length;i<s;i++){if(e(t[o[i]],n,r,a+1))return!0}return!1}(e,t,n)}function o(e,t,n=null){if(!u(t=s(t)))return function e(t,n,r,a=0){if(f(t,[n]))return l(t[n]);if(null!==r&&a>=r)return!1;if(y(t))for(var i=0,o=Object.keys(t),s=o.length;i<s;i++){if(e(t[o[i]],n,r,a+1))return!0}return!1}(e,t,n,0)}function s(e){const t=c(e);return!(t>1)&&(1===t?Object.keys(e)[0]:0===t&&["string","number"].indexOf(M(e))>-1&&e)}function l(e){return!u(e)}function u(e){return!1===function(e){return y(e)?e:!(["null","undefined"].indexOf(M(e))>-1)&&(!(["",0,!1].indexOf(e)>-1)&&e)}(e)}function c(e){return-1===["array","object"].indexOf(M(e))?0:Object.keys(e).length}function d(e,t,n=null,r=0){if(g(e,t))return!0;if(y(t)&&v(e,t)&&f(e,Object.keys(t))){if(g(_(e,Object.keys(t)),t))return!0}if((null===n||r<n)&&y(e))for(var a=0,i=Object.keys(e),o=i.length;a<o;a++){if(d(e[i[a]],t,n,r+1))return!0}return!1}function m(e,t,n=null){var r=p(e,t,n);if(!1===r)return;return r.map(n=>{if(""===n)return e;n=n.split("."),-1===["array","object"].indexOf(M(t))&&n.splice(-1,1);var r=e;return Array.isArray(n)?(n.forEach(e=>{r=r[e]}),r):r[n]})}function p(e,t,n=null){var r=[];return function e(t,n,a="",i,o){if(y(n)&&v(t,n)&&f(t,Object.keys(n))){g(_(t,Object.keys(n)),n)&&(r[r.length]=a)}if(g(t,n)&&(r[r.length]=a),null!==i&&o>=i)return!1;if(y(t))for(var s=0,l=Object.keys(t),u=l.length;s<u;s++){const r=l[s];e(t[r],n,(""===a?a:a+".")+r,i,o+1)}}(e,t,"",n,0),0!==r.length&&r}function h(e,t,n=null){return function e(t,n,r="",a,i){if(y(n)&&v(t,n)&&f(t,Object.keys(n))){if(g(_(t,Object.keys(n)),n))return r}if(g(t,n))return r;var o=!1;if(null!==a&&i>=a)return o;if(y(t))for(var s=0,l=Object.keys(t),u=l.length;s<u;s++){const u=l[s],c=e(t[u],n,u,a,i+1);if(c){o=(r=""===r?r:r+".")+c;break}}return o}(e,t,"",n,0)}function _(e,t){const n=M(e);if(-1!==["array","object"].indexOf(n)&&0!==t.length){var r;switch(n){case"object":r={},t.forEach(t=>{t in e&&(r[t]=e[t])});break;case"array":r=[],t.forEach(t=>{t in e&&r.push(e[t])})}return r}}function f(e,t){const n=t.length;if(0===n||!y(e))return!1;const r=Object.keys(e);for(var a=!0,i=0;i<n;i++){const e=""+t[i];if(-1===r.indexOf(e)){a=!1;break}}return a}function y(e){return-1!==["array","object"].indexOf(M(e))&&0!==Object.keys(e).length}function g(e,t){const n=b(e,t);if(!1===n)return n;if(-1===["array","object"].indexOf(n))return e===t;const r=Object.keys(e),a=r.length;for(var i=!0,o=0;o<a;o++){const n=r[o],a=g(e[n],t[n]);if(!1===a){i=a;break}}return i}function b(e,t){const n=v(e,t);if(!1===n)return!1;if(["array","object"].indexOf(n)>-1){const n=Object.keys(e),a=Object.keys(t),i=n.length;if(i!==a.length)return!1;if(0===i)return!0;for(var r=0;r<i;r++)if(n[r]!==a[r])return!1}return n}function v(e,t){const n=M(e);return n===M(t)&&n}function M(e){if(null===e)return"null";const t=typeof e;return"object"===t&&Array.isArray(e)?"array":t}var w={getType:function(e){return M(e)},sameType:function(e,t){return v(e,t)},sameStructure:function(e,t){return b(e,t)},identical:function(e,t){return g(e,t)},isIterable:function(e){return y(e)},containsKeys:function(e,t){return f(e,t)},trim:function(e,t){return _(e,t)},locate:function(e,t,n){return h(e,t,n)},deepGet:function(e,t,n){return function(e,t,n=null){var r=h(e,t,n);if(!1!==r){if(""===r)return e;r=r.split("."),-1===["array","object"].indexOf(M(t))&&r.splice(-1,1);var a=e;return Array.isArray(r)?(r.forEach(e=>{a=a[e]}),a):a[r]}}(e,t,n)},locateAll:function(e,t,n){return p(e,t,n)},deepFilter:function(e,t,n){return m(e,t,n)},exists:function(e,t,n){return d(e,t,n)},onlyExisting:function(e,t,n){return function(e,t,n=null){if("array"===M(t)){let r=[];return t.forEach(t=>{d(e,t,n)&&r.push(t)}),r}if("object"===M(t)){let r={};return Object.keys(t).forEach(a=>{let i=t[a];d(e,i,n)&&(r[a]=i)}),r}if(d(e,t,n))return t}(e,t,n)},onlyMissing:function(e,t,n){return function(e,t,n=null){if("array"===M(t)){let r=[];return t.forEach(t=>{d(e,t,n)||r.push(t)}),r}if("object"===M(t)){let r={};return Object.keys(t).forEach(a=>{let i=t[a];d(e,i,n)||(r[a]=i)}),r}if(!d(e,t,n))return t}(e,t,n)},length:function(e){return c(e)},isFalsy:function(e){return u(e)},isTruthy:function(e){return l(e)},foundTruthy:function(e,t,n){return o(e,t,n)},onlyTruthy:function(e,t,n,r){return function(e,t,n,r=null){if("array"===M(t)){let a=[];return t.forEach(t=>{const i=m(e,t);l(i)&&o(i,n,r)&&a.push(t)}),a}if("object"===M(t)){let a={};return Object.keys(t).forEach(i=>{const s=t[i],u=m(e,s);l(u)&&o(u,n,r)&&(a[i]=s)}),a}if(o(e,n,r))return t}(e,t,n,r)},foundFalsy:function(e,t,n){return i(e,t,n)},onlyFalsy:function(e,t,n,r){return function(e,t,n,r=null){if("array"===M(t)){let a=[];return t.forEach(t=>{const o=m(e,t);l(o)&&i(o,n,r)&&a.push(t)}),a}if("object"===M(t)){let a={};return Object.keys(t).forEach(o=>{const s=t[o],u=m(e,s);l(u)&&i(u,n,r)&&(a[o]=s)}),a}if(i(e,n,r))return t}(e,t,n,r)},countMatches:function(e,t,n,r){return function(e,t,n=null,r=null){var a=null===n,i=null===r,o=p(e,t,a&&i?null:a||i?n||r:n<r?n:r);if(!1===o)return 0;if(null===n)return o.length;if("number"===M(n)){let e=0;return o.forEach(t=>{(t=t.split(".")).length===n&&e++}),e}}(e,t,n,r)},matchDepth:function(e,t,n){return function(e,t,n=null){var r=h(e,t,n);return!1!==r&&(""===r?0:(r=r.split(".")).length)}(e,t,n)},maxDepth:function(e,t){return function(e,t=null){let n=0;return function e(t,r,a=0){n<a&&(n=a),null!==r&&a>=r||y(t)&&Object.keys(t).forEach(n=>{e(t[n],r,a+1)})}(e,t),n}(e,t)},locate_Key:function(e,t,n){return a(e,t,n)},deepGet_Key:function(e,t,n){return function(e,t,n=null){if("string"===M(t)&&""!==t){var r=a(e,t,n);if(!1!==r){""===r?r=t:r+="."+t,r=r.split(".");var i=e;return Array.isArray(r)?(r.forEach(e=>{i=i[e]}),i):i[r]}}}(e,t,n)},locateAll_Key:function(e,t,n){return r(e,t,n)},deepFilter_Key:function(e,t,n){return function(e,t,n=null){if("string"!==M(t))return;if(""===t)return;var a=r(e,t,n);if(!1===a)return;return a.map(n=>{if(!1!==n){""===n?n=t:n+="."+t,n=n.split(".");var r=e;return Array.isArray(n)?(n.forEach(e=>{r=r[e]}),r):r[n]}})}(e,t,n)},deepClone:function(e,t,r){return n(e,t,r)},renameKey:function(e,t,n,r){return function(e,t,n,r=null){if("string"===M(t)&&"string"===M(n)&&""!==t&&""!==n){var a=!1;return function e(t,n,r,i,o=0){let s;switch(M(t)){case"array":for(var l=[],u=0,c=(s=Object.keys(t)).length;u<c;u++){let a=s[u],c=t[a];l[a]=e(c,n,r,i,o+1)}return l;case"object":var d={};for(u=0,c=(s=Object.keys(t)).length;u<c;u++){let l=s[u],c=t[l];(null===i||o<i)&&(a||l===n&&(l=r,a=!0)),d[l]=e(c,n,r,i,o+1)}return d;case"string":return""+t;case"number":return 0+t;case"boolean":return!!t;case"null":return null;case"undefined":return}}(e,t,n,r,0)}}(e,t,n,r)},renameKeys:function(e,t,n,r){return function(e,t,n,r=null){if("string"===M(t)&&"string"===M(n)&&""!==t&&""!==n)return function e(t,n,r,a,i=0){let o;switch(M(t)){case"array":for(var s=[],l=0,u=(o=Object.keys(t)).length;l<u;l++){let u=o[l],c=t[u];s[u]=e(c,n,r,a,i+1)}return s;case"object":var c={};for(l=0,u=(o=Object.keys(t)).length;l<u;l++){let s=o[l],u=t[s];(null===a||i<a)&&s===n&&(s=r),c[s]=e(u,n,r,a,i+1)}return c;case"string":return""+t;case"number":return 0+t;case"boolean":return!!t;case"null":return null;case"undefined":return}}(e,t,n,r,0)}(e,t,n,r)},deepRemove_Key:function(e,t,r){return function(e,t,r){if("string"!==M(t))return;if(""===t)return;let i=n(e);var o=a(i,t,r);if(!1===o)return i;""===o?o=t:o+="."+t,o=o.split(".");var s=i;return Array.isArray(o)||delete s[o],o.forEach((e,t)=>{t<o.length-1?s=s[e]:delete s[e]}),i}(e,t,r)},deepRemoveAll_Key:function(e,t,a){return function(e,t,a){if("string"!==M(t))return;if(""===t)return;let i=n(e);var o=r(i,t,a);return o===[]||!1===o?i:(o.forEach(e=>{""===e?e=t:e+="."+t,e=e.split(".");var n=i;Array.isArray(e)||delete n[e];for(var r=0;r<e.length;r++){var a=e[r];if(!(a in n))break;r<e.length-1?n=n[a]:delete n[a]}}),i)}(e,t,a)}};e.exports=w},function(e,t,n){(function(e){!function(t){var n=function(e){return a(!0===e,!1,arguments)};function r(e,t){if("object"!==i(e))return t;for(var n in t)"object"===i(e[n])&&"object"===i(t[n])?e[n]=r(e[n],t[n]):e[n]=t[n];return e}function a(e,t,a){var o=a[0],s=a.length;(e||"object"!==i(o))&&(o={});for(var l=0;l<s;++l){var u=a[l];if("object"===i(u))for(var c in u)if("__proto__"!==c){var d=e?n.clone(u[c]):u[c];o[c]=t?r(o[c],d):d}}return o}function i(e){return{}.toString.call(e).slice(8,-1).toLowerCase()}n.recursive=function(e){return a(!0===e,!0,arguments)},n.clone=function(e){var t,r,a=e,o=i(e);if("array"===o)for(a=[],r=e.length,t=0;t<r;++t)a[t]=n.clone(e[t]);else if("object"===o)for(t in a={},e)a[t]=n.clone(e[t]);return a},t?e.exports=n:window.merge=n}(e&&"object"==typeof e.exports&&e.exports)}).call(this,n(9)(e))},function(e,t,n){"use strict";
2
  /*!
3
  * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
4
  *
@@ -44,7 +44,7 @@
44
  *
45
  * This source code is licensed under the MIT license found in the
46
  * LICENSE file in the root directory of this source tree.
47
- */var r=n(136),a=n(137),i=n(138),o=n(139),s="function"==typeof Symbol&&Symbol.for,l=s?Symbol.for("react.element"):60103,u=s?Symbol.for("react.portal"):60106,c=s?Symbol.for("react.fragment"):60107,d=s?Symbol.for("react.strict_mode"):60108,m=s?Symbol.for("react.profiler"):60114,p=s?Symbol.for("react.provider"):60109,h=s?Symbol.for("react.context"):60110,_=s?Symbol.for("react.async_mode"):60111,f=s?Symbol.for("react.forward_ref"):60112;s&&Symbol.for("react.timeout");var y="function"==typeof Symbol&&Symbol.iterator;function g(e){for(var t=arguments.length-1,n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);a(!1,"Minified React error #"+e+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",n)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}};function v(e,t,n){this.props=e,this.context=t,this.refs=i,this.updater=n||b}function M(){}function w(e,t,n){this.props=e,this.context=t,this.refs=i,this.updater=n||b}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&g("85"),this.updater.enqueueSetState(this,e,t,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},M.prototype=v.prototype;var k=w.prototype=new M;k.constructor=w,r(k,v.prototype),k.isPureReactComponent=!0;var L={current:null},Y=Object.prototype.hasOwnProperty,D={key:!0,ref:!0,__self:!0,__source:!0};function T(e,t,n){var r=void 0,a={},i=null,o=null;if(null!=t)for(r in void 0!==t.ref&&(o=t.ref),void 0!==t.key&&(i=""+t.key),t)Y.call(t,r)&&!D.hasOwnProperty(r)&&(a[r]=t[r]);var s=arguments.length-2;if(1===s)a.children=n;else if(1<s){for(var u=Array(s),c=0;c<s;c++)u[c]=arguments[c+2];a.children=u}if(e&&e.defaultProps)for(r in s=e.defaultProps)void 0===a[r]&&(a[r]=s[r]);return{$$typeof:l,type:e,key:i,ref:o,props:a,_owner:L.current}}function S(e){return"object"==typeof e&&null!==e&&e.$$typeof===l}var O=/\/+/g,x=[];function j(e,t,n,r){if(x.length){var a=x.pop();return a.result=e,a.keyPrefix=t,a.func=n,a.context=r,a.count=0,a}return{result:e,keyPrefix:t,func:n,context:r,count:0}}function E(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>x.length&&x.push(e)}function C(e,t,n,r){var a=typeof e;"undefined"!==a&&"boolean"!==a||(e=null);var i=!1;if(null===e)i=!0;else switch(a){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case l:case u:i=!0}}if(i)return n(r,e,""===t?"."+H(e,0):t),1;if(i=0,t=""===t?".":t+":",Array.isArray(e))for(var o=0;o<e.length;o++){var s=t+H(a=e[o],o);i+=C(a,s,n,r)}else if(null==e?s=null:s="function"==typeof(s=y&&e[y]||e["@@iterator"])?s:null,"function"==typeof s)for(e=s.call(e),o=0;!(a=e.next()).done;)i+=C(a=a.value,s=t+H(a,o++),n,r);else"object"===a&&g("31","[object Object]"===(n=""+e)?"object with keys {"+Object.keys(e).join(", ")+"}":n,"");return i}function H(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,(function(e){return t[e]}))}(e.key):t.toString(36)}function P(e,t){e.func.call(e.context,t,e.count++)}function A(e,t,n){var r=e.result,a=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?z(e,r,n,o.thatReturnsArgument):null!=e&&(S(e)&&(t=a+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(O,"$&/")+"/")+n,e={$$typeof:l,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}),r.push(e))}function z(e,t,n,r,a){var i="";null!=n&&(i=(""+n).replace(O,"$&/")+"/"),t=j(t,i,r,a),null==e||C(e,"",A,t),E(t)}var F={Children:{map:function(e,t,n){if(null==e)return e;var r=[];return z(e,r,null,t,n),r},forEach:function(e,t,n){if(null==e)return e;t=j(null,null,t,n),null==e||C(e,"",P,t),E(t)},count:function(e){return null==e?0:C(e,"",o.thatReturnsNull,null)},toArray:function(e){var t=[];return z(e,t,null,o.thatReturnsArgument),t},only:function(e){return S(e)||g("143"),e}},createRef:function(){return{current:null}},Component:v,PureComponent:w,createContext:function(e,t){return void 0===t&&(t=null),(e={$$typeof:h,_calculateChangedBits:t,_defaultValue:e,_currentValue:e,_currentValue2:e,_changedBits:0,_changedBits2:0,Provider:null,Consumer:null}).Provider={$$typeof:p,_context:e},e.Consumer=e},forwardRef:function(e){return{$$typeof:f,render:e}},Fragment:c,StrictMode:d,unstable_AsyncMode:_,unstable_Profiler:m,createElement:T,cloneElement:function(e,t,n){null==e&&g("267",e);var a=void 0,i=r({},e.props),o=e.key,s=e.ref,u=e._owner;if(null!=t){void 0!==t.ref&&(s=t.ref,u=L.current),void 0!==t.key&&(o=""+t.key);var c=void 0;for(a in e.type&&e.type.defaultProps&&(c=e.type.defaultProps),t)Y.call(t,a)&&!D.hasOwnProperty(a)&&(i[a]=void 0===t[a]&&void 0!==c?c[a]:t[a])}if(1===(a=arguments.length-2))i.children=n;else if(1<a){c=Array(a);for(var d=0;d<a;d++)c[d]=arguments[d+2];i.children=c}return{$$typeof:l,type:e.type,key:o,ref:s,props:i,_owner:u}},createFactory:function(e){var t=T.bind(null,e);return t.type=e,t},isValidElement:S,version:"16.4.1",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:L,assign:r}},W={default:F},N=W&&F||W;e.exports=N.default?N.default:N},function(e,t,n){"use strict";
48
  /*
49
  object-assign
50
  (c) Sindre Sorhus
@@ -55,15 +55,15 @@ object-assign
55
  *
56
  * Copyright (c) 2014-2017, Jon Schlinkert.
57
  * Released under the MIT License.
58
- */e.exports=function(e){return null!=e&&"object"==typeof e&&!1===Array.isArray(e)}},,function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,a,i,o,s,l=1,u={},c=!1,d=e.document,m=Object.getPrototypeOf&&Object.getPrototypeOf(e);m=m&&m.setTimeout?m:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){h(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){h(e.data)},r=function(e){i.port2.postMessage(e)}):d&&"onreadystatechange"in d.createElement("script")?(a=d.documentElement,r=function(e){var t=d.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,a.removeChild(t),t=null},a.appendChild(t)}):r=function(e){setTimeout(h,0,e)}:(o="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&h(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(o+t,"*")}),m.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var a={callback:e,args:t};return u[l]=a,r(l),l++},m.clearImmediate=p}function p(e){delete u[e]}function h(e){if(c)setTimeout(h,0,e);else{var t=u[e];if(t){c=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(n,r)}}(t)}finally{p(e),c=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(8),n(148))},function(e,t){var n,r,a=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var l,u=[],c=!1,d=-1;function m(){c&&l&&(c=!1,l.length?u=l.concat(u):d=-1,u.length&&p())}function p(){if(!c){var e=s(m);c=!0;for(var t=u.length;t;){for(l=u,u=[];++d<t;)l&&l[d].run();d=-1,t=u.length}l=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function _(){}a.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new h(e,t)),1!==u.length||c||s(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=_,a.addListener=_,a.once=_,a.off=_,a.removeListener=_,a.removeAllListeners=_,a.emit=_,a.prependListener=_,a.prependOnceListener=_,a.listeners=function(e){return[]},a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},function(e,t,n){var r={"./af":10,"./af.js":10,"./ar":11,"./ar-dz":12,"./ar-dz.js":12,"./ar-kw":13,"./ar-kw.js":13,"./ar-ly":14,"./ar-ly.js":14,"./ar-ma":15,"./ar-ma.js":15,"./ar-sa":16,"./ar-sa.js":16,"./ar-tn":17,"./ar-tn.js":17,"./ar.js":11,"./az":18,"./az.js":18,"./be":19,"./be.js":19,"./bg":20,"./bg.js":20,"./bm":21,"./bm.js":21,"./bn":22,"./bn.js":22,"./bo":23,"./bo.js":23,"./br":24,"./br.js":24,"./bs":25,"./bs.js":25,"./ca":26,"./ca.js":26,"./cs":27,"./cs.js":27,"./cv":28,"./cv.js":28,"./cy":29,"./cy.js":29,"./da":30,"./da.js":30,"./de":31,"./de-at":32,"./de-at.js":32,"./de-ch":33,"./de-ch.js":33,"./de.js":31,"./dv":34,"./dv.js":34,"./el":35,"./el.js":35,"./en-au":36,"./en-au.js":36,"./en-ca":37,"./en-ca.js":37,"./en-gb":38,"./en-gb.js":38,"./en-ie":39,"./en-ie.js":39,"./en-nz":40,"./en-nz.js":40,"./eo":41,"./eo.js":41,"./es":42,"./es-do":43,"./es-do.js":43,"./es-us":44,"./es-us.js":44,"./es.js":42,"./et":45,"./et.js":45,"./eu":46,"./eu.js":46,"./fa":47,"./fa.js":47,"./fi":48,"./fi.js":48,"./fo":49,"./fo.js":49,"./fr":50,"./fr-ca":51,"./fr-ca.js":51,"./fr-ch":52,"./fr-ch.js":52,"./fr.js":50,"./fy":53,"./fy.js":53,"./gd":54,"./gd.js":54,"./gl":55,"./gl.js":55,"./gom-latn":56,"./gom-latn.js":56,"./gu":57,"./gu.js":57,"./he":58,"./he.js":58,"./hi":59,"./hi.js":59,"./hr":60,"./hr.js":60,"./hu":61,"./hu.js":61,"./hy-am":62,"./hy-am.js":62,"./id":63,"./id.js":63,"./is":64,"./is.js":64,"./it":65,"./it.js":65,"./ja":66,"./ja.js":66,"./jv":67,"./jv.js":67,"./ka":68,"./ka.js":68,"./kk":69,"./kk.js":69,"./km":70,"./km.js":70,"./kn":71,"./kn.js":71,"./ko":72,"./ko.js":72,"./ky":73,"./ky.js":73,"./lb":74,"./lb.js":74,"./lo":75,"./lo.js":75,"./lt":76,"./lt.js":76,"./lv":77,"./lv.js":77,"./me":78,"./me.js":78,"./mi":79,"./mi.js":79,"./mk":80,"./mk.js":80,"./ml":81,"./ml.js":81,"./mr":82,"./mr.js":82,"./ms":83,"./ms-my":84,"./ms-my.js":84,"./ms.js":83,"./mt":85,"./mt.js":85,"./my":86,"./my.js":86,"./nb":87,"./nb.js":87,"./ne":88,"./ne.js":88,"./nl":89,"./nl-be":90,"./nl-be.js":90,"./nl.js":89,"./nn":91,"./nn.js":91,"./pa-in":92,"./pa-in.js":92,"./pl":93,"./pl.js":93,"./pt":94,"./pt-br":95,"./pt-br.js":95,"./pt.js":94,"./ro":96,"./ro.js":96,"./ru":97,"./ru.js":97,"./sd":98,"./sd.js":98,"./se":99,"./se.js":99,"./si":100,"./si.js":100,"./sk":101,"./sk.js":101,"./sl":102,"./sl.js":102,"./sq":103,"./sq.js":103,"./sr":104,"./sr-cyrl":105,"./sr-cyrl.js":105,"./sr.js":104,"./ss":106,"./ss.js":106,"./sv":107,"./sv.js":107,"./sw":108,"./sw.js":108,"./ta":109,"./ta.js":109,"./te":110,"./te.js":110,"./tet":111,"./tet.js":111,"./th":112,"./th.js":112,"./tl-ph":113,"./tl-ph.js":113,"./tlh":114,"./tlh.js":114,"./tr":115,"./tr.js":115,"./tzl":116,"./tzl.js":116,"./tzm":117,"./tzm-latn":118,"./tzm-latn.js":118,"./tzm.js":117,"./uk":119,"./uk.js":119,"./ur":120,"./ur.js":120,"./uz":121,"./uz-latn":122,"./uz-latn.js":122,"./uz.js":121,"./vi":123,"./vi.js":123,"./x-pseudo":124,"./x-pseudo.js":124,"./yo":125,"./yo.js":125,"./zh-cn":126,"./zh-cn.js":126,"./zh-hk":127,"./zh-hk.js":127,"./zh-tw":128,"./zh-tw.js":128};function a(e){var t=i(e);return n(t)}function i(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}a.keys=function(){return Object.keys(r)},a.resolve=i,e.exports=a,a.id=149},function(e,t,n){var r;e.exports=function e(t,n,a){function i(s,l){if(!n[s]){if(!t[s]){if(!l&&"function"==typeof r&&r)return r(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[s]={exports:{}};t[s][0].call(c.exports,(function(e){return i(t[s][1][e]||e)}),c,c.exports,e,t,n,a)}return n[s].exports}for(var o="function"==typeof r&&r,s=0;s<a.length;s++)i(a[s]);return i}({1:[function(e,t,n){!function(e){"use strict";var n,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,i=Math.floor,o="[BigNumber Error] ",s=o+"Number primitive has more than 15 significant digits: ",l=1e14,u=14,c=9007199254740991,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],m=1e7,p=1e9;function h(e){var t=0|e;return 0<e||e===t?t:t-1}function _(e){for(var t,n,r=1,a=e.length,i=e[0]+"";r<a;){for(t=e[r++]+"",n=u-t.length;n--;t="0"+t);i+=t}for(a=i.length;48===i.charCodeAt(--a););return i.slice(0,a+1||1)}function f(e,t){var n,r,a=e.c,i=t.c,o=e.s,s=t.s,l=e.e,u=t.e;if(!o||!s)return null;if(n=a&&!a[0],r=i&&!i[0],n||r)return n?r?0:-s:o;if(o!=s)return o;if(n=o<0,r=l==u,!a||!i)return r?0:!a^n?1:-1;if(!r)return u<l^n?1:-1;for(s=(l=a.length)<(u=i.length)?l:u,o=0;o<s;o++)if(a[o]!=i[o])return a[o]>i[o]^n?1:-1;return l==u?0:u<l^n?1:-1}function y(e,t,n,r){if(e<t||n<e||e!==(e<0?a(e):i(e)))throw Error(o+(r||"Argument")+("number"==typeof e?e<t||n<e?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function g(e){var t=e.c.length-1;return h(e.e/u)==t&&e.c[t]%2!=0}function b(e,t){return(1<e.length?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function v(e,t,n){var r,a;if(t<0){for(a=n+".";++t;a+=n);e=a+e}else if(++t>(r=e.length)){for(a=n,t-=r;--t;a+=n);e+=a}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}(n=function e(t){var n,M,w,k,L,Y,D,T,S,O,x=B.prototype={constructor:B,toString:null,valueOf:null},j=new B(1),E=20,C=4,H=-7,P=21,A=-1e7,z=1e7,F=!1,W=1,N=0,R={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},I="0123456789abcdefghijklmnopqrstuvwxyz";function B(e,t){var n,a,o,l,d,m,p,h,_=this;if(!(_ instanceof B))return new B(e,t);if(null==t){if(e instanceof B)return _.s=e.s,_.e=e.e,void(_.c=(e=e.c)?e.slice():e);if((m="number"==typeof e)&&0*e==0){if(_.s=1/e<0?(e=-e,-1):1,e===~~e){for(l=0,d=e;10<=d;d/=10,l++);return _.e=l,void(_.c=[e])}h=String(e)}else{if(h=String(e),!r.test(h))return w(_,h,m);_.s=45==h.charCodeAt(0)?(h=h.slice(1),-1):1}-1<(l=h.indexOf("."))&&(h=h.replace(".","")),0<(d=h.search(/e/i))?(l<0&&(l=d),l+=+h.slice(d+1),h=h.substring(0,d)):l<0&&(l=h.length)}else{if(y(t,2,I.length,"Base"),h=String(e),10==t)return G(_=new B(e instanceof B?e:h),E+_.e+1,C);if(m="number"==typeof e){if(0*e!=0)return w(_,h,m,t);if(_.s=1/e<0?(h=h.slice(1),-1):1,B.DEBUG&&15<h.replace(/^0\.0*|\./,"").length)throw Error(s+e);m=!1}else _.s=45===h.charCodeAt(0)?(h=h.slice(1),-1):1;for(n=I.slice(0,t),l=d=0,p=h.length;d<p;d++)if(n.indexOf(a=h.charAt(d))<0){if("."==a){if(l<d){l=p;continue}}else if(!o&&(h==h.toUpperCase()&&(h=h.toLowerCase())||h==h.toLowerCase()&&(h=h.toUpperCase()))){o=!0,d=-1,l=0;continue}return w(_,String(e),m,t)}-1<(l=(h=M(h,t,10,_.s)).indexOf("."))?h=h.replace(".",""):l=h.length}for(d=0;48===h.charCodeAt(d);d++);for(p=h.length;48===h.charCodeAt(--p););if(h=h.slice(d,++p)){if(p-=d,m&&B.DEBUG&&15<p&&(c<e||e!==i(e)))throw Error(s+_.s*e);if(z<(l=l-d-1))_.c=_.e=null;else if(l<A)_.c=[_.e=0];else{if(_.e=l,_.c=[],d=(l+1)%u,l<0&&(d+=u),d<p){for(d&&_.c.push(+h.slice(0,d)),p-=u;d<p;)_.c.push(+h.slice(d,d+=u));h=h.slice(d),d=u-h.length}else d-=p;for(;d--;h+="0");_.c.push(+h)}}else _.c=[_.e=0]}function U(e,t,n,r){var a,i,o,s,l;if(null==n?n=C:y(n,0,8),!e.c)return e.toString();if(a=e.c[0],o=e.e,null==t)l=_(e.c),l=1==r||2==r&&(o<=H||P<=o)?b(l,o):v(l,o,"0");else if(i=(e=G(new B(e),t,n)).e,s=(l=_(e.c)).length,1==r||2==r&&(t<=i||i<=H)){for(;s<t;l+="0",s++);l=b(l,i)}else if(t-=o,l=v(l,i,"0"),s<i+1){if(0<--t)for(l+=".";t--;l+="0");}else if(0<(t+=i-s))for(i+1==s&&(l+=".");t--;l+="0");return e.s<0&&a?"-"+l:l}function V(e,t){for(var n,r=1,a=new B(e[0]);r<e.length;r++){if(!(n=new B(e[r])).s){a=n;break}t.call(a,n)&&(a=n)}return a}function J(e,t,n){for(var r=1,a=t.length;!t[--a];t.pop());for(a=t[0];10<=a;a/=10,r++);return(n=r+n*u-1)>z?e.c=e.e=null:e.c=n<A?[e.e=0]:(e.e=n,t),e}function G(e,t,n,r){var o,s,c,m,p,h,_,f=e.c,y=d;if(f){e:{for(o=1,m=f[0];10<=m;m/=10,o++);if((s=t-o)<0)s+=u,c=t,_=(p=f[h=0])/y[o-c-1]%10|0;else if((h=a((s+1)/u))>=f.length){if(!r)break e;for(;f.length<=h;f.push(0));p=_=0,c=(s%=u)-u+(o=1)}else{for(p=m=f[h],o=1;10<=m;m/=10,o++);_=(c=(s%=u)-u+o)<0?0:p/y[o-c-1]%10|0}if(r=r||t<0||null!=f[h+1]||(c<0?p:p%y[o-c-1]),r=n<4?(_||r)&&(0==n||n==(e.s<0?3:2)):5<_||5==_&&(4==n||r||6==n&&(0<s?0<c?p/y[o-c]:0:f[h-1])%10&1||n==(e.s<0?8:7)),t<1||!f[0])return f.length=0,r?(t-=e.e+1,f[0]=y[(u-t%u)%u],e.e=-t||0):f[0]=e.e=0,e;if(0==s?(f.length=h,m=1,h--):(f.length=h+1,m=y[u-s],f[h]=0<c?i(p/y[o-c]%y[c])*m:0),r)for(;;){if(0==h){for(s=1,c=f[0];10<=c;c/=10,s++);for(c=f[0]+=m,m=1;10<=c;c/=10,m++);s!=m&&(e.e++,f[0]==l&&(f[0]=1));break}if(f[h]+=m,f[h]!=l)break;f[h--]=0,m=1}for(s=f.length;0===f[--s];f.pop());}e.e>z?e.c=e.e=null:e.e<A&&(e.c=[e.e=0])}return e}function q(e){var t,n=e.e;return null===n?e.toString():(t=_(e.c),t=n<=H||P<=n?b(t,n):v(t,n,"0"),e.s<0?"-"+t:t)}return B.clone=e,B.ROUND_UP=0,B.ROUND_DOWN=1,B.ROUND_CEIL=2,B.ROUND_FLOOR=3,B.ROUND_HALF_UP=4,B.ROUND_HALF_DOWN=5,B.ROUND_HALF_EVEN=6,B.ROUND_HALF_CEIL=7,B.ROUND_HALF_FLOOR=8,B.EUCLID=9,B.config=B.set=function(e){var t,n;if(null!=e){if("object"!=typeof e)throw Error(o+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(y(n=e[t],0,p,t),E=n),e.hasOwnProperty(t="ROUNDING_MODE")&&(y(n=e[t],0,8,t),C=n),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((n=e[t])&&n.pop?(y(n[0],-p,0,t),y(n[1],0,p,t),H=n[0],P=n[1]):(y(n,-p,p,t),H=-(P=n<0?-n:n))),e.hasOwnProperty(t="RANGE"))if((n=e[t])&&n.pop)y(n[0],-p,-1,t),y(n[1],1,p,t),A=n[0],z=n[1];else{if(y(n,-p,p,t),!n)throw Error(o+t+" cannot be zero: "+n);A=-(z=n<0?-n:n)}if(e.hasOwnProperty(t="CRYPTO")){if((n=e[t])!==!!n)throw Error(o+t+" not true or false: "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw F=!n,Error(o+"crypto unavailable");F=n}else F=n}if(e.hasOwnProperty(t="MODULO_MODE")&&(y(n=e[t],0,9,t),W=n),e.hasOwnProperty(t="POW_PRECISION")&&(y(n=e[t],0,p,t),N=n),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(n=e[t]))throw Error(o+t+" not an object: "+n);R=n}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(n=e[t])||/^.$|[+-.\s]|(.).*\1/.test(n))throw Error(o+t+" invalid: "+n);I=n}}return{DECIMAL_PLACES:E,ROUNDING_MODE:C,EXPONENTIAL_AT:[H,P],RANGE:[A,z],CRYPTO:F,MODULO_MODE:W,POW_PRECISION:N,FORMAT:R,ALPHABET:I}},B.isBigNumber=function(e){return e instanceof B||e&&!0===e._isBigNumber||!1},B.maximum=B.max=function(){return V(arguments,x.lt)},B.minimum=B.min=function(){return V(arguments,x.gt)},B.random=(k=9007199254740992,L=Math.random()*k&2097151?function(){return i(Math.random()*k)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,n,r,s,l,c=0,m=[],h=new B(j);if(null==e?e=E:y(e,0,p),s=a(e/u),F)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(s*=2));c<s;)9e15<=(l=131072*t[c]+(t[c+1]>>>11))?(n=crypto.getRandomValues(new Uint32Array(2)),t[c]=n[0],t[c+1]=n[1]):(m.push(l%1e14),c+=2);c=s/2}else{if(!crypto.randomBytes)throw F=!1,Error(o+"crypto unavailable");for(t=crypto.randomBytes(s*=7);c<s;)9e15<=(l=281474976710656*(31&t[c])+1099511627776*t[c+1]+4294967296*t[c+2]+16777216*t[c+3]+(t[c+4]<<16)+(t[c+5]<<8)+t[c+6])?crypto.randomBytes(7).copy(t,c):(m.push(l%1e14),c+=7);c=s/7}if(!F)for(;c<s;)(l=L())<9e15&&(m[c++]=l%1e14);for(s=m[--c],e%=u,s&&e&&(l=d[u-e],m[c]=i(s/l)*l);0===m[c];m.pop(),c--);if(c<0)m=[r=0];else{for(r=-1;0===m[0];m.splice(0,1),r-=u);for(c=1,l=m[0];10<=l;l/=10,c++);c<u&&(r-=u-c)}return h.e=r,h.c=m,h}),B.sum=function(){for(var e=1,t=arguments,n=new B(t[0]);e<t.length;)n=n.plus(t[e++]);return n},M=function(){var e="0123456789";function t(e,t,n,r){for(var a,i,o=[0],s=0,l=e.length;s<l;){for(i=o.length;i--;o[i]*=t);for(o[0]+=r.indexOf(e.charAt(s++)),a=0;a<o.length;a++)o[a]>n-1&&(null==o[a+1]&&(o[a+1]=0),o[a+1]+=o[a]/n|0,o[a]%=n)}return o.reverse()}return function(r,a,i,o,s){var l,u,c,d,m,p,h,f,y=r.indexOf("."),g=E,b=C;for(0<=y&&(d=N,N=0,r=r.replace(".",""),p=(f=new B(a)).pow(r.length-y),N=d,f.c=t(v(_(p.c),p.e,"0"),10,i,e),f.e=f.c.length),c=d=(h=t(r,a,i,s?(l=I,e):(l=e,I))).length;0==h[--d];h.pop());if(!h[0])return l.charAt(0);if(y<0?--c:(p.c=h,p.e=c,p.s=o,h=(p=n(p,f,g,b,i)).c,m=p.r,c=p.e),y=h[u=c+g+1],d=i/2,m=m||u<0||null!=h[u+1],m=b<4?(null!=y||m)&&(0==b||b==(p.s<0?3:2)):d<y||y==d&&(4==b||m||6==b&&1&h[u-1]||b==(p.s<0?8:7)),u<1||!h[0])r=m?v(l.charAt(1),-g,l.charAt(0)):l.charAt(0);else{if(h.length=u,m)for(--i;++h[--u]>i;)h[u]=0,u||(++c,h=[1].concat(h));for(d=h.length;!h[--d];);for(y=0,r="";y<=d;r+=l.charAt(h[y++]));r=v(r,c,l.charAt(0))}return r}}(),n=function(){function e(e,t,n){var r,a,i,o,s=0,l=e.length,u=t%m,c=t/m|0;for(e=e.slice();l--;)s=((a=u*(i=e[l]%m)+(r=c*i+(o=e[l]/m|0)*u)%m*m+s)/n|0)+(r/m|0)+c*o,e[l]=a%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,r){var a,i;if(n!=r)i=r<n?1:-1;else for(a=i=0;a<n;a++)if(e[a]!=t[a]){i=e[a]>t[a]?1:-1;break}return i}function n(e,t,n,r){for(var a=0;n--;)e[n]-=a,a=e[n]<t[n]?1:0,e[n]=a*r+e[n]-t[n];for(;!e[0]&&1<e.length;e.splice(0,1));}return function(r,a,o,s,c){var d,m,p,_,f,y,g,b,v,M,w,k,L,Y,D,T,S,O=r.s==a.s?1:-1,x=r.c,j=a.c;if(!(x&&x[0]&&j&&j[0]))return new B(r.s&&a.s&&(x?!j||x[0]!=j[0]:j)?x&&0==x[0]||!j?0*O:O/0:NaN);for(v=(b=new B(O)).c=[],O=o+(m=r.e-a.e)+1,c||(c=l,m=h(r.e/u)-h(a.e/u),O=O/u|0),p=0;j[p]==(x[p]||0);p++);if(j[p]>(x[p]||0)&&m--,O<0)v.push(1),_=!0;else{for(Y=x.length,T=j.length,O+=2,1<(f=i(c/(j[p=0]+1)))&&(j=e(j,f,c),x=e(x,f,c),T=j.length,Y=x.length),L=T,w=(M=x.slice(0,T)).length;w<T;M[w++]=0);S=j.slice(),S=[0].concat(S),D=j[0],j[1]>=c/2&&D++;do{if(f=0,(d=t(j,M,T,w))<0){if(k=M[0],T!=w&&(k=k*c+(M[1]||0)),1<(f=i(k/D)))for(c<=f&&(f=c-1),g=(y=e(j,f,c)).length,w=M.length;1==t(y,M,g,w);)f--,n(y,T<g?S:j,g,c),g=y.length,d=1;else 0==f&&(d=f=1),g=(y=j.slice()).length;if(g<w&&(y=[0].concat(y)),n(M,y,w,c),w=M.length,-1==d)for(;t(j,M,T,w)<1;)f++,n(M,T<w?S:j,w,c),w=M.length}else 0===d&&(f++,M=[0]);v[p++]=f,M[0]?M[w++]=x[L]||0:(M=[x[L]],w=1)}while((L++<Y||null!=M[0])&&O--);_=null!=M[0],v[0]||v.splice(0,1)}if(c==l){for(p=1,O=v[0];10<=O;O/=10,p++);G(b,o+(b.e=p+m*u-1)+1,s,_)}else b.e=m,b.r=+_;return b}}(),Y=/^(-?)0([xbo])(?=\w[\w.]*$)/i,D=/^([^.]+)\.$/,T=/^\.([^.]+)$/,S=/^-?(Infinity|NaN)$/,O=/^\s*\+(?=[\w.])|^\s+|\s+$/g,w=function(e,t,n,r){var a,i=n?t:t.replace(O,"");if(S.test(i))e.s=isNaN(i)?null:i<0?-1:1,e.c=e.e=null;else{if(!n&&(i=i.replace(Y,(function(e,t,n){return a="x"==(n=n.toLowerCase())?16:"b"==n?2:8,r&&r!=a?e:t})),r&&(a=r,i=i.replace(D,"$1").replace(T,"0.$1")),t!=i))return new B(i,a);if(B.DEBUG)throw Error(o+"Not a"+(r?" base "+r:"")+" number: "+t);e.c=e.e=e.s=null}},x.absoluteValue=x.abs=function(){var e=new B(this);return e.s<0&&(e.s=1),e},x.comparedTo=function(e,t){return f(this,new B(e,t))},x.decimalPlaces=x.dp=function(e,t){var n,r,a;if(null!=e)return y(e,0,p),null==t?t=C:y(t,0,8),G(new B(this),e+this.e+1,t);if(!(n=this.c))return null;if(r=((a=n.length-1)-h(this.e/u))*u,a=n[a])for(;a%10==0;a/=10,r--);return r<0&&(r=0),r},x.dividedBy=x.div=function(e,t){return n(this,new B(e,t),E,C)},x.dividedToIntegerBy=x.idiv=function(e,t){return n(this,new B(e,t),0,1)},x.exponentiatedBy=x.pow=function(e,t){var n,r,s,l,c,d,m,p,h=this;if((e=new B(e)).c&&!e.isInteger())throw Error(o+"Exponent not an integer: "+q(e));if(null!=t&&(t=new B(t)),c=14<e.e,!h.c||!h.c[0]||1==h.c[0]&&!h.e&&1==h.c.length||!e.c||!e.c[0])return p=new B(Math.pow(+q(h),c?2-g(e):+q(e))),t?p.mod(t):p;if(d=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new B(NaN);(r=!d&&h.isInteger()&&t.isInteger())&&(h=h.mod(t))}else{if(9<e.e&&(0<h.e||h.e<-1||(0==h.e?1<h.c[0]||c&&24e7<=h.c[1]:h.c[0]<8e13||c&&h.c[0]<=9999975e7)))return l=h.s<0&&g(e)?-0:0,-1<h.e&&(l=1/l),new B(d?1/l:l);N&&(l=a(N/u+2))}for(m=c?(n=new B(.5),d&&(e.s=1),g(e)):(s=Math.abs(+q(e)))%2,p=new B(j);;){if(m){if(!(p=p.times(h)).c)break;l?p.c.length>l&&(p.c.length=l):r&&(p=p.mod(t))}if(s){if(0===(s=i(s/2)))break;m=s%2}else if(G(e=e.times(n),e.e+1,1),14<e.e)m=g(e);else{if(0==(s=+q(e)))break;m=s%2}h=h.times(h),l?h.c&&h.c.length>l&&(h.c.length=l):r&&(h=h.mod(t))}return r?p:(d&&(p=j.div(p)),t?p.mod(t):l?G(p,N,C,void 0):p)},x.integerValue=function(e){var t=new B(this);return null==e?e=C:y(e,0,8),G(t,t.e+1,e)},x.isEqualTo=x.eq=function(e,t){return 0===f(this,new B(e,t))},x.isFinite=function(){return!!this.c},x.isGreaterThan=x.gt=function(e,t){return 0<f(this,new B(e,t))},x.isGreaterThanOrEqualTo=x.gte=function(e,t){return 1===(t=f(this,new B(e,t)))||0===t},x.isInteger=function(){return!!this.c&&h(this.e/u)>this.c.length-2},x.isLessThan=x.lt=function(e,t){return f(this,new B(e,t))<0},x.isLessThanOrEqualTo=x.lte=function(e,t){return-1===(t=f(this,new B(e,t)))||0===t},x.isNaN=function(){return!this.s},x.isNegative=function(){return this.s<0},x.isPositive=function(){return 0<this.s},x.isZero=function(){return!!this.c&&0==this.c[0]},x.minus=function(e,t){var n,r,a,i,o=this,s=o.s;if(t=(e=new B(e,t)).s,!s||!t)return new B(NaN);if(s!=t)return e.s=-t,o.plus(e);var c=o.e/u,d=e.e/u,m=o.c,p=e.c;if(!c||!d){if(!m||!p)return m?(e.s=-t,e):new B(p?o:NaN);if(!m[0]||!p[0])return p[0]?(e.s=-t,e):new B(m[0]?o:3==C?-0:0)}if(c=h(c),d=h(d),m=m.slice(),s=c-d){for((a=(i=s<0)?(s=-s,m):(d=c,p)).reverse(),t=s;t--;a.push(0));a.reverse()}else for(r=(i=(s=m.length)<(t=p.length))?s:t,s=t=0;t<r;t++)if(m[t]!=p[t]){i=m[t]<p[t];break}if(i&&(a=m,m=p,p=a,e.s=-e.s),0<(t=(r=p.length)-(n=m.length)))for(;t--;m[n++]=0);for(t=l-1;s<r;){if(m[--r]<p[r]){for(n=r;n&&!m[--n];m[n]=t);--m[n],m[r]+=l}m[r]-=p[r]}for(;0==m[0];m.splice(0,1),--d);return m[0]?J(e,m,d):(e.s=3==C?-1:1,e.c=[e.e=0],e)},x.modulo=x.mod=function(e,t){var r,a,i=this;return e=new B(e,t),!i.c||!e.s||e.c&&!e.c[0]?new B(NaN):!e.c||i.c&&!i.c[0]?new B(i):(9==W?(a=e.s,e.s=1,r=n(i,e,0,3),e.s=a,r.s*=a):r=n(i,e,0,W),(e=i.minus(r.times(e))).c[0]||1!=W||(e.s=i.s),e)},x.multipliedBy=x.times=function(e,t){var n,r,a,i,o,s,c,d,p,_,f,y,g,b,v,M=this,w=M.c,k=(e=new B(e,t)).c;if(!(w&&k&&w[0]&&k[0]))return!M.s||!e.s||w&&!w[0]&&!k||k&&!k[0]&&!w?e.c=e.e=e.s=null:(e.s*=M.s,w&&k?(e.c=[0],e.e=0):e.c=e.e=null),e;for(r=h(M.e/u)+h(e.e/u),e.s*=M.s,(c=w.length)<(_=k.length)&&(g=w,w=k,k=g,a=c,c=_,_=a),a=c+_,g=[];a--;g.push(0));for(b=l,v=m,a=_;0<=--a;){for(n=0,f=k[a]%v,y=k[a]/v|0,i=a+(o=c);a<i;)n=((d=f*(d=w[--o]%v)+(s=y*d+(p=w[o]/v|0)*f)%v*v+g[i]+n)/b|0)+(s/v|0)+y*p,g[i--]=d%b;g[i]=n}return n?++r:g.splice(0,1),J(e,g,r)},x.negated=function(){var e=new B(this);return e.s=-e.s||null,e},x.plus=function(e,t){var n,r=this,a=r.s;if(t=(e=new B(e,t)).s,!a||!t)return new B(NaN);if(a!=t)return e.s=-t,r.minus(e);var i=r.e/u,o=e.e/u,s=r.c,c=e.c;if(!i||!o){if(!s||!c)return new B(a/0);if(!s[0]||!c[0])return c[0]?e:new B(s[0]?r:0*a)}if(i=h(i),o=h(o),s=s.slice(),a=i-o){for((n=0<a?(o=i,c):(a=-a,s)).reverse();a--;n.push(0));n.reverse()}for((a=s.length)-(t=c.length)<0&&(n=c,c=s,s=n,t=a),a=0;t;)a=(s[--t]=s[t]+c[t]+a)/l|0,s[t]=l===s[t]?0:s[t]%l;return a&&(s=[a].concat(s),++o),J(e,s,o)},x.precision=x.sd=function(e,t){var n,r,a;if(null!=e&&e!==!!e)return y(e,1,p),null==t?t=C:y(t,0,8),G(new B(this),e,t);if(!(n=this.c))return null;if(r=(a=n.length-1)*u+1,a=n[a]){for(;a%10==0;a/=10,r--);for(a=n[0];10<=a;a/=10,r++);}return e&&this.e+1>r&&(r=this.e+1),r},x.shiftedBy=function(e){return y(e,-c,c),this.times("1e"+e)},x.squareRoot=x.sqrt=function(){var e,t,r,a,i,o=this,s=o.c,l=o.s,u=o.e,c=E+4,d=new B("0.5");if(1!==l||!s||!s[0])return new B(!l||l<0&&(!s||s[0])?NaN:s?o:1/0);if((r=0==(l=Math.sqrt(+q(o)))||l==1/0?(((t=_(s)).length+u)%2==0&&(t+="0"),l=Math.sqrt(+t),u=h((u+1)/2)-(u<0||u%2),new B(t=l==1/0?"1e"+u:(t=l.toExponential()).slice(0,t.indexOf("e")+1)+u)):new B(l+"")).c[0])for((l=(u=r.e)+c)<3&&(l=0);;)if(i=r,r=d.times(i.plus(n(o,i,c,1))),_(i.c).slice(0,l)===(t=_(r.c)).slice(0,l)){if(r.e<u&&--l,"9999"!=(t=t.slice(l-3,l+1))&&(a||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(G(r,r.e+E+2,1),e=!r.times(r).eq(o));break}if(!a&&(G(i,i.e+E+2,0),i.times(i).eq(o))){r=i;break}c+=4,l+=4,a=1}return G(r,r.e+E+1,C,e)},x.toExponential=function(e,t){return null!=e&&(y(e,0,p),e++),U(this,e,t,1)},x.toFixed=function(e,t){return null!=e&&(y(e,0,p),e=e+this.e+1),U(this,e,t)},x.toFormat=function(e,t,n){var r;if(null==n)null!=e&&t&&"object"==typeof t?(n=t,t=null):e&&"object"==typeof e?(n=e,e=t=null):n=R;else if("object"!=typeof n)throw Error(o+"Argument not an object: "+n);if(r=this.toFixed(e,t),this.c){var a,i=r.split("."),s=+n.groupSize,l=+n.secondaryGroupSize,u=n.groupSeparator||"",c=i[0],d=i[1],m=this.s<0,p=m?c.slice(1):c,h=p.length;if(l&&(a=s,s=l,h-=l=a),0<s&&0<h){for(a=h%s||s,c=p.substr(0,a);a<h;a+=s)c+=u+p.substr(a,s);0<l&&(c+=u+p.slice(a)),m&&(c="-"+c)}r=d?c+(n.decimalSeparator||"")+((l=+n.fractionGroupSize)?d.replace(new RegExp("\\d{"+l+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):d):c}return(n.prefix||"")+r+(n.suffix||"")},x.toFraction=function(e){var t,r,a,i,s,l,c,m,p,h,f,y,g=this,b=g.c;if(null!=e&&(!(c=new B(e)).isInteger()&&(c.c||1!==c.s)||c.lt(j)))throw Error(o+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+q(c));if(!b)return new B(g);for(t=new B(j),p=r=new B(j),a=m=new B(j),y=_(b),s=t.e=y.length-g.e-1,t.c[0]=d[(l=s%u)<0?u+l:l],e=!e||0<c.comparedTo(t)?0<s?t:p:c,l=z,z=1/0,c=new B(y),m.c[0]=0;h=n(c,t,0,1),1!=(i=r.plus(h.times(a))).comparedTo(e);)r=a,a=i,p=m.plus(h.times(i=p)),m=i,t=c.minus(h.times(i=t)),c=i;return i=n(e.minus(r),a,0,1),m=m.plus(i.times(p)),r=r.plus(i.times(a)),m.s=p.s=g.s,f=n(p,a,s*=2,C).minus(g).abs().comparedTo(n(m,r,s,C).minus(g).abs())<1?[p,a]:[m,r],z=l,f},x.toNumber=function(){return+q(this)},x.toPrecision=function(e,t){return null!=e&&y(e,1,p),U(this,e,t,2)},x.toString=function(e){var t,n=this,r=n.s,a=n.e;return null===a?r?(t="Infinity",r<0&&(t="-"+t)):t="NaN":(t=null==e?a<=H||P<=a?b(_(n.c),a):v(_(n.c),a,"0"):10===e?v(_((n=G(new B(n),E+a+1,C)).c),n.e,"0"):(y(e,2,I.length,"Base"),M(v(_(n.c),a,"0"),10,e,r,!0)),r<0&&n.c[0]&&(t="-"+t)),t},x.valueOf=x.toJSON=function(){return q(this)},x._isBigNumber=!0,"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator&&(x[Symbol.toStringTag]="BigNumber",x[Symbol.for("nodejs.util.inspect.custom")]=x.valueOf),null!=t&&B.set(t),B}()).default=n.BigNumber=n,void 0!==t&&t.exports?t.exports=n:(e||(e="undefined"!=typeof self&&self?self:window),e.BigNumber=n)}(this)},{}],2:[function(e,t,n){"use strict";t.exports={languageTag:"en-US",delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},spaceSeparated:!1,ordinal:function(e){var t=e%10;return 1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th"},currency:{symbol:"$",position:"prefix",code:"USD"},currencyFormat:{thousandSeparated:!0,totalLength:4,spaceSeparated:!0},formats:{fourDigits:{totalLength:4,spaceSeparated:!0},fullWithTwoDecimals:{output:"currency",thousandSeparated:!0,mantissa:2},fullWithTwoDecimalsNoCurrency:{thousandSeparated:!0,mantissa:2},fullWithNoDecimals:{output:"currency",thousandSeparated:!0,mantissa:0}}}},{}],3:[function(e,t,n){"use strict";function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(a)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var a=e("./globalState"),i=e("./validating"),o=e("./parsing"),s=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],l={general:{scale:1024,suffixes:s,marker:"bd"},binary:{scale:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],marker:"b"},decimal:{scale:1e3,suffixes:s,marker:"d"}},u={totalLength:0,characteristic:0,forceAverage:!1,average:!1,mantissa:-1,optionalMantissa:!0,thousandSeparated:!1,spaceSeparated:!1,negative:"sign",forceSign:!1};function c(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=2<arguments.length?arguments[2]:void 0;if("string"==typeof t&&(t=o.parseFormat(t)),!i.validateFormat(t))return"ERROR: invalid format";var r=t.prefix||"",s=t.postfix||"",c=function(e,t,n){switch(t.output){case"currency":return function(e,t,n){var r=n.currentCurrency(),a=Object.assign({},u,t),i=void 0,o="",s=!!a.totalLength||!!a.forceAverage||a.average,l=t.currencyPosition||r.position,c=t.currencySymbol||r.symbol;a.spaceSeparated&&(o=" "),"infix"===l&&(i=o+c+o);var d=h({instance:e,providedFormat:t,state:n,decimalSeparator:i});return"prefix"===l&&(d=e._value<0&&"sign"===a.negative?"-".concat(o).concat(c).concat(d.slice(1)):c+o+d),l&&"postfix"!==l||(d=d+(o=s?"":o)+c),d}(e,t=_(t,a.currentCurrencyDefaultFormat()),a);case"percent":return function(e,t,n,r){var a=t.prefixSymbol,i=h({instance:r(100*e._value),providedFormat:t,state:n}),o=Object.assign({},u,t);return a?"%".concat(o.spaceSeparated?" ":"").concat(i):"".concat(i).concat(o.spaceSeparated?" ":"","%")}(e,t=_(t,a.currentPercentageDefaultFormat()),a,n);case"byte":return t=_(t,a.currentByteDefaultFormat()),v=e,w=a,k=n,L=(M=t).base||"binary",Y=l[L],T=(D=d(v._value,Y.suffixes,Y.scale)).value,S=D.suffix,O=h({instance:k(T),providedFormat:M,state:w,defaults:w.currentByteDefaultFormat()}),x=w.currentAbbreviations(),"".concat(O).concat(x.spaced?" ":"").concat(S);case"time":return t=_(t,a.currentTimeDefaultFormat()),f=e,y=Math.floor(f._value/60/60),g=Math.floor((f._value-60*y*60)/60),b=Math.round(f._value-60*y*60-60*g),"".concat(y,":").concat(g<10?"0":"").concat(g,":").concat(b<10?"0":"").concat(b);case"ordinal":return r=e,i=t=_(t,a.currentOrdinalDefaultFormat()),s=(o=a).currentOrdinal(),c=Object.assign({},u,i),m=h({instance:r,providedFormat:i,state:o}),p=s(r._value),"".concat(m).concat(c.spaceSeparated?" ":"").concat(p);case"number":default:return h({instance:e,providedFormat:t,numbro:n})}var r,i,o,s,c,m,p,f,y,g,b,v,M,w,k,L,Y,D,T,S,O,x}(e,t,n);return(c=r+c)+s}function d(e,t,n){var r=t[0],a=Math.abs(e);if(n<=a){for(var i=1;i<t.length;++i){var o=Math.pow(n,i),s=Math.pow(n,i+1);if(o<=a&&a<s){r=t[i],e/=o;break}}r===t[0]&&(e/=Math.pow(n,t.length-1),r=t[t.length-1])}return{value:e,suffix:r}}function m(e){for(var t="",n=0;n<e;n++)t+="0";return t}function p(e,t){return-1!==e.toString().indexOf("e")?function(e,t){var n=e.toString(),a=r(n.split("e"),2),i=a[0],o=a[1],s=r(i.split("."),2),l=s[0],u=s[1],c=void 0===u?"":u;if(0<+o)n=l+c+m(o-c.length);else{var d=".";d=+l<0?"-0".concat(d):"0".concat(d);var p=(m(-o-1)+Math.abs(l)+c).substr(0,t);p.length<t&&(p+=m(t-p.length)),n=d+p}return 0<+o&&0<t&&(n+=".".concat(m(t))),n}(e,t):(Math.round(+"".concat(e,"e+").concat(t))/Math.pow(10,t)).toFixed(t)}function h(e){var t=e.instance,n=e.providedFormat,i=e.state,o=void 0===i?a:i,s=e.decimalSeparator,l=e.defaults,c=void 0===l?o.currentDefaults():l,d=t._value;if(0===d&&o.hasZeroFormat())return o.getZeroFormat();if(!isFinite(d))return d.toString();var m,h,_,f,y,g,b,v,M=Object.assign({},u,c,n),w=M.totalLength,k=w?0:M.characteristic,L=M.optionalCharacteristic,Y=M.forceAverage,D=!!w||!!Y||M.average,T=w?-1:D&&void 0===n.mantissa?0:M.mantissa,S=!w&&(void 0===n.optionalMantissa?-1===T:M.optionalMantissa),O=M.trimMantissa,x=M.thousandSeparated,j=M.spaceSeparated,E=M.negative,C=M.forceSign,H=M.exponential,P="";if(D){var A=function(e){var t=e.value,n=e.forceAverage,r=e.abbreviations,a=e.spaceSeparated,i=void 0!==a&&a,o=e.totalLength,s=void 0===o?0:o,l="",u=Math.abs(t),c=-1;if(u>=Math.pow(10,12)&&!n||"trillion"===n?(l=r.trillion,t/=Math.pow(10,12)):u<Math.pow(10,12)&&u>=Math.pow(10,9)&&!n||"billion"===n?(l=r.billion,t/=Math.pow(10,9)):u<Math.pow(10,9)&&u>=Math.pow(10,6)&&!n||"million"===n?(l=r.million,t/=Math.pow(10,6)):(u<Math.pow(10,6)&&u>=Math.pow(10,3)&&!n||"thousand"===n)&&(l=r.thousand,t/=Math.pow(10,3)),l&&(l=(i?" ":"")+l),s){var d=t.toString().split(".")[0];c=Math.max(s-d.length,0)}return{value:t,abbreviation:l,mantissaPrecision:c}}({value:d,forceAverage:Y,abbreviations:o.currentAbbreviations(),spaceSeparated:j,totalLength:w});d=A.value,P+=A.abbreviation,w&&(T=A.mantissaPrecision)}if(H){var z=(h=(m={value:d,characteristicPrecision:k}).value,f=void 0===(_=m.characteristicPrecision)?0:_,g=(y=r(h.toExponential().split("e"),2))[0],b=y[1],v=+g,f&&1<f&&(v*=Math.pow(10,f-1),b=0<=(b=+b-(f-1))?"+".concat(b):b),{value:v,abbreviation:"e".concat(b)});d=z.value,P=z.abbreviation+P}var F,W,N,R=function(e,t,n,a,i){if(-1===a)return e;var o=p(t,a),s=r(o.toString().split("."),2),l=s[0],u=s[1],c=void 0===u?"":u;if(c.match(/^0+$/)&&(n||i))return l;var d=c.match(/0+$/);return i&&d?"".concat(l,".").concat(c.toString().slice(0,d.index)):o.toString()}(d.toString(),d,S,T,O);return R=function(e,t,n,r,a){var i=r.currentDelimiters(),o=i.thousands;a=a||i.decimal;var s=i.thousandsSize||3,l=e.toString(),u=l.split(".")[0],c=l.split(".")[1];return n&&(t<0&&(u=u.slice(1)),function(e,t){for(var n=[],r=0,a=e;0<a;a--)r===t&&(n.unshift(a),r=0),r++;return n}(u.length,s).forEach((function(e,t){u=u.slice(0,e+t)+o+u.slice(e+t)})),t<0&&(u="-".concat(u))),c?u+a+c:u}(R=function(e,t,n,a){var i=e,o=r(i.toString().split("."),2),s=o[0],l=o[1];if(s.match(/^-?0$/)&&n)return l?"".concat(s.replace("0",""),".").concat(l):s.replace("0","");if(s.length<a)for(var u=a-s.length,c=0;c<u;c++)i="0".concat(i);return i.toString()}(R,0,L,k),d,x,o,s),(D||H)&&(R+=P),(C||d<0)&&(F=R,N=E,R=0===(W=d)?F:0==+F?F.replace("-",""):0<W?"+".concat(F):"sign"===N?F:"(".concat(F.replace("-",""),")")),R}function _(e,t){if(!e)return t;var n=Object.keys(e);return 1===n.length&&"output"===n[0]?t:e}t.exports=function(e){return{format:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return c.apply(void 0,n.concat([e]))},getByteUnit:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=l.general;return d(e._value,t.suffixes,t.scale).suffix}.apply(void 0,n.concat([e]))},getBinaryByteUnit:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=l.binary;return d(e._value,t.suffixes,t.scale).suffix}.apply(void 0,n.concat([e]))},getDecimalByteUnit:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=l.decimal;return d(e._value,t.suffixes,t.scale).suffix}.apply(void 0,n.concat([e]))},formatOrDefault:_}}},{"./globalState":4,"./parsing":8,"./validating":10}],4:[function(e,t,n){"use strict";var r=e("./en-US"),a=e("./validating"),i=e("./parsing"),o={},s=void 0,l={},u=null,c={};function d(e){s=e}function m(){return l[s]}o.languages=function(){return Object.assign({},l)},o.currentLanguage=function(){return s},o.currentCurrency=function(){return m().currency},o.currentAbbreviations=function(){return m().abbreviations},o.currentDelimiters=function(){return m().delimiters},o.currentOrdinal=function(){return m().ordinal},o.currentDefaults=function(){return Object.assign({},m().defaults,c)},o.currentOrdinalDefaultFormat=function(){return Object.assign({},o.currentDefaults(),m().ordinalFormat)},o.currentByteDefaultFormat=function(){return Object.assign({},o.currentDefaults(),m().byteFormat)},o.currentPercentageDefaultFormat=function(){return Object.assign({},o.currentDefaults(),m().percentageFormat)},o.currentCurrencyDefaultFormat=function(){return Object.assign({},o.currentDefaults(),m().currencyFormat)},o.currentTimeDefaultFormat=function(){return Object.assign({},o.currentDefaults(),m().timeFormat)},o.setDefaults=function(e){e=i.parseFormat(e),a.validateFormat(e)&&(c=e)},o.getZeroFormat=function(){return u},o.setZeroFormat=function(e){return u="string"==typeof e?e:null},o.hasZeroFormat=function(){return null!==u},o.languageData=function(e){if(e){if(l[e])return l[e];throw new Error('Unknown tag "'.concat(e,'"'))}return m()},o.registerLanguage=function(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1];if(!a.validateLanguage(e))throw new Error("Invalid language data");l[e.languageTag]=e,t&&d(e.languageTag)},o.setLanguage=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:r.languageTag;if(!l[e]){var n=e.split("-")[0],a=Object.keys(l).find((function(e){return e.split("-")[0]===n}));return l[a]?void d(a):void d(t)}d(e)},o.registerLanguage(r),s=r.languageTag,t.exports=o},{"./en-US":2,"./parsing":8,"./validating":10}],5:[function(e,t,n){"use strict";t.exports=function(t){return{loadLanguagesInNode:function(n){return r=t,void n.forEach((function(t){var n=void 0;try{n=e("../languages/".concat(t))}catch(n){console.error('Unable to load "'.concat(t,'". No matching language file found.'))}n&&r.registerLanguage(n)}));var r}}}},{}],6:[function(e,t,n){"use strict";var r=e("bignumber.js");function a(e,t,n){var a=new r(e._value),i=t;return n.isNumbro(t)&&(i=t._value),i=new r(i),e._value=a.minus(i).toNumber(),e}t.exports=function(e){return{add:function(t,n){return i=n,o=e,s=new r((a=t)._value),l=i,o.isNumbro(i)&&(l=i._value),l=new r(l),a._value=s.plus(l).toNumber(),a;var a,i,o,s,l},subtract:function(t,n){return a(t,n,e)},multiply:function(t,n){return i=n,o=e,s=new r((a=t)._value),l=i,o.isNumbro(i)&&(l=i._value),l=new r(l),a._value=s.times(l).toNumber(),a;var a,i,o,s,l},divide:function(t,n){return i=n,o=e,s=new r((a=t)._value),l=i,o.isNumbro(i)&&(l=i._value),l=new r(l),a._value=s.dividedBy(l).toNumber(),a;var a,i,o,s,l},set:function(t,n){return r=t,i=a=n,e.isNumbro(a)&&(i=a._value),r._value=i,r;var r,a,i},difference:function(t,n){return r=n,a(o=(i=e)(t._value),r,i),Math.abs(o._value);var r,i,o}}}},{"bignumber.js":1}],7:[function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var a=e("./globalState"),i=e("./validating"),o=e("./loading")(p),s=e("./unformatting"),l=e("./formatting")(p),u=e("./manipulating")(p),c=e("./parsing"),d=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._value=t}var t,n;return t=e,(n=[{key:"clone",value:function(){return p(this._value)}},{key:"format",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return l.format(this,e)}},{key:"formatCurrency",value:function(e){return"string"==typeof e&&(e=c.parseFormat(e)),(e=l.formatOrDefault(e,a.currentCurrencyDefaultFormat())).output="currency",l.format(this,e)}},{key:"formatTime",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return e.output="time",l.format(this,e)}},{key:"binaryByteUnits",value:function(){return l.getBinaryByteUnit(this)}},{key:"decimalByteUnits",value:function(){return l.getDecimalByteUnit(this)}},{key:"byteUnits",value:function(){return l.getByteUnit(this)}},{key:"difference",value:function(e){return u.difference(this,e)}},{key:"add",value:function(e){return u.add(this,e)}},{key:"subtract",value:function(e){return u.subtract(this,e)}},{key:"multiply",value:function(e){return u.multiply(this,e)}},{key:"divide",value:function(e){return u.divide(this,e)}},{key:"set",value:function(e){return u.set(this,m(e))}},{key:"value",value:function(){return this._value}},{key:"valueOf",value:function(){return this._value}}])&&r(t.prototype,n),e}();function m(e){var t=e;return p.isNumbro(e)?t=e._value:"string"==typeof e?t=p.unformat(e):isNaN(e)&&(t=NaN),t}function p(e){return new d(m(e))}p.version="2.1.2",p.isNumbro=function(e){return e instanceof d},p.language=a.currentLanguage,p.registerLanguage=a.registerLanguage,p.setLanguage=a.setLanguage,p.languages=a.languages,p.languageData=a.languageData,p.zeroFormat=a.setZeroFormat,p.defaultFormat=a.currentDefaults,p.setDefaults=a.setDefaults,p.defaultCurrencyFormat=a.currentCurrencyDefaultFormat,p.validate=i.validate,p.loadLanguagesInNode=o.loadLanguagesInNode,p.unformat=s.unformat,t.exports=p},{"./formatting":3,"./globalState":4,"./loading":5,"./manipulating":6,"./parsing":8,"./unformatting":9,"./validating":10}],8:[function(e,t,n){"use strict";t.exports={parseFormat:function(e){var t,n,r,a,i,o,s,l,u,c,d,m,p,h,_,f,y,g,b,v,M=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return"string"!=typeof e?e:(n=M,i=M,function(e,t){if(-1===e.indexOf("$")){if(-1===e.indexOf("%"))return-1!==e.indexOf("bd")?(t.output="byte",t.base="general"):-1!==e.indexOf("b")?(t.output="byte",t.base="binary"):-1!==e.indexOf("d")?(t.output="byte",t.base="decimal"):-1===e.indexOf(":")?-1!==e.indexOf("o")&&(t.output="ordinal"):t.output="time";t.output="percent"}else t.output="currency"}(e=(o=(a=e=(r=(t=e).match(/^{([^}]*)}/))?(n.prefix=r[1],t.slice(r[0].length)):t).match(/{([^}]*)}$/))?(i.postfix=o[1],a.slice(0,-o[0].length)):a,M),s=M,(l=e.match(/[1-9]+[0-9]*/))&&(s.totalLength=+l[0]),u=M,(c=e.split(".")[0].match(/0+/))&&(u.characteristic=c[0].length),function(e,t){if(-1!==e.indexOf(".")){var n=e.split(".")[0];t.optionalCharacteristic=-1===n.indexOf("0")}}(e,M),d=M,-1!==e.indexOf("a")&&(d.average=!0),p=M,-1!==(m=e).indexOf("K")?p.forceAverage="thousand":-1!==m.indexOf("M")?p.forceAverage="million":-1!==m.indexOf("B")?p.forceAverage="billion":-1!==m.indexOf("T")&&(p.forceAverage="trillion"),function(e,t){var n=e.split(".")[1];if(n){var r=n.match(/0+/);r&&(t.mantissa=r[0].length)}}(e,M),_=M,(h=e).match(/\[\.]/)?_.optionalMantissa=!0:h.match(/\./)&&(_.optionalMantissa=!1),f=M,-1!==e.indexOf(",")&&(f.thousandSeparated=!0),y=M,-1!==e.indexOf(" ")&&(y.spaceSeparated=!0),b=M,(g=e).match(/^\+?\([^)]*\)$/)&&(b.negative="parenthesis"),g.match(/^\+?-/)&&(b.negative="sign"),v=M,e.match(/^\+/)&&(v.forceSign=!0),M)}}},{}],9:[function(e,t,n){"use strict";var r=[{key:"ZiB",factor:Math.pow(1024,7)},{key:"ZB",factor:Math.pow(1e3,7)},{key:"YiB",factor:Math.pow(1024,8)},{key:"YB",factor:Math.pow(1e3,8)},{key:"TiB",factor:Math.pow(1024,4)},{key:"TB",factor:Math.pow(1e3,4)},{key:"PiB",factor:Math.pow(1024,5)},{key:"PB",factor:Math.pow(1e3,5)},{key:"MiB",factor:Math.pow(1024,2)},{key:"MB",factor:Math.pow(1e3,2)},{key:"KiB",factor:Math.pow(1024,1)},{key:"KB",factor:Math.pow(1e3,1)},{key:"GiB",factor:Math.pow(1024,3)},{key:"GB",factor:Math.pow(1e3,3)},{key:"EiB",factor:Math.pow(1024,6)},{key:"EB",factor:Math.pow(1e3,6)},{key:"B",factor:1}];function a(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}t.exports={unformat:function(t,n){var i,o,s,l=e("./globalState"),u=l.currentDelimiters(),c=l.currentCurrency().symbol,d=l.currentOrdinal(),m=l.getZeroFormat(),p=l.currentAbbreviations(),h=void 0;if("string"==typeof t)h=function(e,t){if(!e.indexOf(":")||":"===t.thousands)return!1;var n=e.split(":");if(3!==n.length)return!1;var r=+n[0],a=+n[1],i=+n[2];return!isNaN(r)&&!isNaN(a)&&!isNaN(i)}(t,u)?(o=+(i=t.split(":"))[0],s=+i[1],+i[2]+60*s+3600*o):function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"",i=3<arguments.length?arguments[3]:void 0,o=4<arguments.length?arguments[4]:void 0,s=5<arguments.length?arguments[5]:void 0,l=6<arguments.length?arguments[6]:void 0;if(""!==e)return e===o?0:function e(t,n){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"",o=3<arguments.length?arguments[3]:void 0,s=4<arguments.length?arguments[4]:void 0,l=5<arguments.length?arguments[5]:void 0,u=6<arguments.length?arguments[6]:void 0;if(!isNaN(+t))return+t;var c="",d=t.replace(/(^[^(]*)\((.*)\)([^)]*$)/,"$1$2$3");if(d!==t)return-1*e(d,n,i,o,s,l,u);for(var m=0;m<r.length;m++){var p=r[m];if((c=t.replace(p.key,""))!==t)return e(c,n,i,o,s,l,u)*p.factor}if((c=t.replace("%",""))!==t)return e(c,n,i,o,s,l,u)/100;var h=parseFloat(t);if(!isNaN(h)){var _=o(h);if(_&&"."!==_&&(c=t.replace(new RegExp("".concat(a(_),"$")),""))!==t)return e(c,n,i,o,s,l,u);var f={};Object.keys(l).forEach((function(e){f[l[e]]=e}));for(var y=Object.keys(f).sort().reverse(),g=y.length,b=0;b<g;b++){var v=y[b],M=f[v];if((c=t.replace(v,""))!==t){var w=void 0;switch(M){case"thousand":w=Math.pow(10,3);break;case"million":w=Math.pow(10,6);break;case"billion":w=Math.pow(10,9);break;case"trillion":w=Math.pow(10,12)}return e(c,n,i,o,s,l,u)*w}}}}(function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"",r=e.replace(n,"");return(r=r.replace(new RegExp("([0-9])".concat(a(t.thousands),"([0-9])"),"g"),"$1$2")).replace(t.decimal,".")}(e,t,n),t,n,i,o,s,l)}(t,u,c,d,m,p,n);else{if("number"!=typeof t)return;h=t}if(void 0!==h)return h}}},{"./globalState":4}],10:[function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=e("./unformatting"),i=/^[a-z]{2,3}(-[a-zA-Z]{4})?(-([A-Z]{2}|[0-9]{3}))?$/,o={output:{type:"string",validValues:["currency","percent","byte","time","ordinal","number"]},base:{type:"string",validValues:["decimal","binary","general"],restriction:function(e,t){return"byte"===t.output},message:"`base` must be provided only when the output is `byte`",mandatory:function(e){return"byte"===e.output}},characteristic:{type:"number",restriction:function(e){return 0<=e},message:"value must be positive"},prefix:"string",postfix:"string",forceAverage:{type:"string",validValues:["trillion","billion","million","thousand"]},average:"boolean",currencyPosition:{type:"string",validValues:["prefix","infix","postfix"]},currencySymbol:"string",totalLength:{type:"number",restrictions:[{restriction:function(e){return 0<=e},message:"value must be positive"},{restriction:function(e,t){return!t.exponential},message:"`totalLength` is incompatible with `exponential`"}]},mantissa:{type:"number",restriction:function(e){return 0<=e},message:"value must be positive"},optionalMantissa:"boolean",trimMantissa:"boolean",optionalCharacteristic:"boolean",thousandSeparated:"boolean",spaceSeparated:"boolean",abbreviations:{type:"object",children:{thousand:"string",million:"string",billion:"string",trillion:"string"}},negative:{type:"string",validValues:["sign","parenthesis"]},forceSign:"boolean",exponential:{type:"boolean"},prefixSymbol:{type:"boolean",restriction:function(e,t){return"percent"===t.output},message:"`prefixSymbol` can be provided only when the output is `percent`"}},s={languageTag:{type:"string",mandatory:!0,restriction:function(e){return e.match(i)},message:"the language tag must follow the BCP 47 specification (see https://tools.ieft.org/html/bcp47)"},delimiters:{type:"object",children:{thousands:"string",decimal:"string",thousandsSize:"number"},mandatory:!0},abbreviations:{type:"object",children:{thousand:{type:"string",mandatory:!0},million:{type:"string",mandatory:!0},billion:{type:"string",mandatory:!0},trillion:{type:"string",mandatory:!0}},mandatory:!0},spaceSeparated:"boolean",ordinal:{type:"function",mandatory:!0},currency:{type:"object",children:{symbol:"string",position:"string",code:"string"},mandatory:!0},defaults:"format",ordinalFormat:"format",byteFormat:"format",percentageFormat:"format",currencyFormat:"format",timeDefaults:"format",formats:{type:"object",children:{fourDigits:{type:"format",mandatory:!0},fullWithTwoDecimals:{type:"format",mandatory:!0},fullWithTwoDecimalsNoCurrency:{type:"format",mandatory:!0},fullWithNoDecimals:{type:"format",mandatory:!0}}}};function l(e){return!!a.unformat(e)}function u(e,t,n){var a=3<arguments.length&&void 0!==arguments[3]&&arguments[3],i=Object.keys(e).map((function(a){if(!t[a])return console.error("".concat(n," Invalid key: ").concat(a)),!1;var i=e[a],s=t[a];if("string"==typeof s&&(s={type:s}),"format"===s.type){if(!u(i,o,"[Validate ".concat(a,"]"),!0))return!1}else if(r(i)!==s.type)return console.error("".concat(n," ").concat(a,' type mismatched: "').concat(s.type,'" expected, "').concat(r(i),'" provided')),!1;if(s.restrictions&&s.restrictions.length)for(var l=s.restrictions.length,c=0;c<l;c++){var d=s.restrictions[c],m=d.restriction,p=d.message;if(!m(i,e))return console.error("".concat(n," ").concat(a," invalid value: ").concat(p)),!1}return s.restriction&&!s.restriction(i,e)?(console.error("".concat(n," ").concat(a," invalid value: ").concat(s.message)),!1):s.validValues&&-1===s.validValues.indexOf(i)?(console.error("".concat(n," ").concat(a," invalid value: must be among ").concat(JSON.stringify(s.validValues),', "').concat(i,'" provided')),!1):!(s.children&&!u(i,s.children,"[Validate ".concat(a,"]")))}));return a||i.push.apply(i,function(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(Object.keys(t).map((function(r){var a=t[r];if("string"==typeof a&&(a={type:a}),a.mandatory){var i=a.mandatory;if("function"==typeof i&&(i=i(e)),i&&void 0===e[r])return console.error("".concat(n,' Missing mandatory key "').concat(r,'"')),!1}return!0})))),i.reduce((function(e,t){return e&&t}),!0)}function c(e){return u(e,o,"[Validate format]")}t.exports={validate:function(e,t){var n=l(e),r=c(t);return n&&r},validateFormat:c,validateInput:l,validateLanguage:function(e){return u(e,s,"[Validate language]")}}},{"./unformatting":9}]},{},[7])(7)},function(e,t,n){
59
  /*!
60
  * Pikaday
61
  *
62
  * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/dbushell/Pikaday
63
  */
64
- !function(t,r){"use strict";var a;try{a=n(0)}catch(e){}e.exports=function(e){var t="function"==typeof e,n=!!window.addEventListener,r=window.document,a=window.setTimeout,i=function(e,t,r,a){n?e.addEventListener(t,r,!!a):e.attachEvent("on"+t,r)},o=function(e,t,r,a){n?e.removeEventListener(t,r,!!a):e.detachEvent("on"+t,r)},s=function(e,t,n){var a;r.createEvent?((a=r.createEvent("HTMLEvents")).initEvent(t,!0,!1),a=f(a,n),e.dispatchEvent(a)):r.createEventObject&&(a=r.createEventObject(),a=f(a,n),e.fireEvent("on"+t,a))},l=function(e,t){return-1!==(" "+e.className+" ").indexOf(" "+t+" ")},u=function(e){return/Array/.test(Object.prototype.toString.call(e))},c=function(e){return/Date/.test(Object.prototype.toString.call(e))&&!isNaN(e.getTime())},d=function(e){var t=e.getDay();return 0===t||6===t},m=function(e){return e%4==0&&e%100!=0||e%400==0},p=function(e,t){return[31,m(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]},h=function(e){c(e)&&e.setHours(0,0,0,0)},_=function(e,t){return e.getTime()===t.getTime()},f=function(e,t,n){var r,a;for(r in t)(a=void 0!==e[r])&&"object"==typeof t[r]&&null!==t[r]&&void 0===t[r].nodeName?c(t[r])?n&&(e[r]=new Date(t[r].getTime())):u(t[r])?n&&(e[r]=t[r].slice(0)):e[r]=f({},t[r],n):!n&&a||(e[r]=t[r]);return e},y=function(e){return e.month<0&&(e.year-=Math.ceil(Math.abs(e.month)/12),e.month+=12),e.month>11&&(e.year+=Math.floor(Math.abs(e.month)/12),e.month-=12),e},g={field:null,bound:void 0,position:"bottom left",reposition:!0,format:"YYYY-MM-DD",defaultDate:null,setDefaultDate:!1,firstDay:0,formatStrict:!1,minDate:null,maxDate:null,yearRange:10,showWeekNumber:!1,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearSuffix:"",showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,numberOfMonths:1,mainCalendar:"left",container:void 0,i18n:{previousMonth:"Previous Month",nextMonth:"Next Month",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},theme:null,onSelect:null,onOpen:null,onClose:null,onDraw:null},b=function(e,t,n){for(t+=e.firstDay;t>=7;)t-=7;return n?e.i18n.weekdaysShort[t]:e.i18n.weekdays[t]},v=function(e){var t=[],n="false";if(e.isEmpty){if(!e.showDaysInNextAndPreviousMonths)return'<td class="is-empty"></td>';t.push("is-outside-current-month")}return e.isDisabled&&t.push("is-disabled"),e.isToday&&t.push("is-today"),e.isSelected&&(t.push("is-selected"),n="true"),e.isInRange&&t.push("is-inrange"),e.isStartRange&&t.push("is-startrange"),e.isEndRange&&t.push("is-endrange"),'<td data-day="'+e.day+'" class="'+t.join(" ")+'" aria-selected="'+n+'"><button class="pika-button pika-day" type="button" data-pika-year="'+e.year+'" data-pika-month="'+e.month+'" data-pika-day="'+e.day+'">'+e.day+"</button></td>"},M=function(e,t){return"<tr>"+(t?e.reverse():e).join("")+"</tr>"},w=function(e,t,n,r,a,i){var o,s,l,c,d,m=e._o,p=n===m.minYear,h=n===m.maxYear,_='<div id="'+i+'" class="pika-title" role="heading" aria-live="assertive">',f=!0,y=!0;for(l=[],o=0;o<12;o++)l.push('<option value="'+(n===a?o-t:12+o-t)+'"'+(o===r?' selected="selected"':"")+(p&&o<m.minMonth||h&&o>m.maxMonth?'disabled="disabled"':"")+">"+m.i18n.months[o]+"</option>");for(c='<div class="pika-label">'+m.i18n.months[r]+'<select class="pika-select pika-select-month" tabindex="-1">'+l.join("")+"</select></div>",u(m.yearRange)?(o=m.yearRange[0],s=m.yearRange[1]+1):(o=n-m.yearRange,s=1+n+m.yearRange),l=[];o<s&&o<=m.maxYear;o++)o>=m.minYear&&l.push('<option value="'+o+'"'+(o===n?' selected="selected"':"")+">"+o+"</option>");return d='<div class="pika-label">'+n+m.yearSuffix+'<select class="pika-select pika-select-year" tabindex="-1">'+l.join("")+"</select></div>",m.showMonthAfterYear?_+=d+c:_+=c+d,p&&(0===r||m.minMonth>=r)&&(f=!1),h&&(11===r||m.maxMonth<=r)&&(y=!1),0===t&&(_+='<button class="pika-prev'+(f?"":" is-disabled")+'" type="button">'+m.i18n.previousMonth+"</button>"),t===e._o.numberOfMonths-1&&(_+='<button class="pika-next'+(y?"":" is-disabled")+'" type="button">'+m.i18n.nextMonth+"</button>"),_+"</div>"},k=function(o){var s=this,u=s.config(o);s._onMouseDown=function(e){if(s._v){var t=(e=e||window.event).target||e.srcElement;if(t)if(l(t,"is-disabled")||(!l(t,"pika-button")||l(t,"is-empty")||l(t.parentNode,"is-disabled")?l(t,"pika-prev")?s.prevMonth():l(t,"pika-next")&&s.nextMonth():(s.setDate(new Date(t.getAttribute("data-pika-year"),t.getAttribute("data-pika-month"),t.getAttribute("data-pika-day"))),u.bound&&a((function(){s.hide(),u.field&&u.field.blur()}),100))),l(t,"pika-select"))s._c=!0;else{if(!e.preventDefault)return e.returnValue=!1,!1;e.preventDefault()}}},s._onChange=function(e){var t=(e=e||window.event).target||e.srcElement;t&&(l(t,"pika-select-month")?s.gotoMonth(t.value):l(t,"pika-select-year")&&s.gotoYear(t.value))},s._onKeyChange=function(e){if(e=e||window.event,s.isVisible())switch(e.keyCode){case 13:case 27:u.field.blur();break;case 37:e.preventDefault(),s.adjustDate("subtract",1);break;case 38:s.adjustDate("subtract",7);break;case 39:s.adjustDate("add",1);break;case 40:s.adjustDate("add",7)}},s._onInputChange=function(n){var r;n.firedBy!==s&&(r=t?(r=e(u.field.value,u.format,u.formatStrict))&&r.isValid()?r.toDate():null:new Date(Date.parse(u.field.value)),c(r)&&s.setDate(r),s._v||s.show())},s._onInputFocus=function(){s.show()},s._onInputClick=function(){s.show()},s._onInputBlur=function(){var e=r.activeElement;do{if(l(e,"pika-single"))return}while(e=e.parentNode);s._c||(s._b=a((function(){s.hide()}),50)),s._c=!1},s._onClick=function(e){var t=(e=e||window.event).target||e.srcElement,r=t;if(t){!n&&l(t,"pika-select")&&(t.onchange||(t.setAttribute("onchange","return;"),i(t,"change",s._onChange)));do{if(l(r,"pika-single")||r===u.trigger)return}while(r=r.parentNode);s._v&&t!==u.trigger&&r!==u.trigger&&s.hide()}},s.el=r.createElement("div"),s.el.className="pika-single"+(u.isRTL?" is-rtl":"")+(u.theme?" "+u.theme:""),i(s.el,"mousedown",s._onMouseDown,!0),i(s.el,"touchend",s._onMouseDown,!0),i(s.el,"change",s._onChange),i(r,"keydown",s._onKeyChange),u.field&&(u.container?u.container.appendChild(s.el):u.bound?r.body.appendChild(s.el):u.field.parentNode.insertBefore(s.el,u.field.nextSibling),i(u.field,"change",s._onInputChange),u.defaultDate||(t&&u.field.value?u.defaultDate=e(u.field.value,u.format).toDate():u.defaultDate=new Date(Date.parse(u.field.value)),u.setDefaultDate=!0));var d=u.defaultDate;c(d)?u.setDefaultDate?s.setDate(d,!0):s.gotoDate(d):s.gotoDate(new Date),u.bound?(this.hide(),s.el.className+=" is-bound",i(u.trigger,"click",s._onInputClick),i(u.trigger,"focus",s._onInputFocus),i(u.trigger,"blur",s._onInputBlur)):this.show()};return k.prototype={config:function(e){this._o||(this._o=f({},g,!0));var t=f(this._o,e,!0);t.isRTL=!!t.isRTL,t.field=t.field&&t.field.nodeName?t.field:null,t.theme="string"==typeof t.theme&&t.theme?t.theme:null,t.bound=!!(void 0!==t.bound?t.field&&t.bound:t.field),t.trigger=t.trigger&&t.trigger.nodeName?t.trigger:t.field,t.disableWeekends=!!t.disableWeekends,t.disableDayFn="function"==typeof t.disableDayFn?t.disableDayFn:null;var n=parseInt(t.numberOfMonths,10)||1;if(t.numberOfMonths=n>4?4:n,c(t.minDate)||(t.minDate=!1),c(t.maxDate)||(t.maxDate=!1),t.minDate&&t.maxDate&&t.maxDate<t.minDate&&(t.maxDate=t.minDate=!1),t.minDate&&this.setMinDate(t.minDate),t.maxDate&&this.setMaxDate(t.maxDate),u(t.yearRange)){var r=(new Date).getFullYear()-10;t.yearRange[0]=parseInt(t.yearRange[0],10)||r,t.yearRange[1]=parseInt(t.yearRange[1],10)||r}else t.yearRange=Math.abs(parseInt(t.yearRange,10))||g.yearRange,t.yearRange>100&&(t.yearRange=100);return t},toString:function(n){return c(this._d)?t?e(this._d).format(n||this._o.format):this._d.toDateString():""},getMoment:function(){return t?e(this._d):null},setMoment:function(n,r){t&&e.isMoment(n)&&this.setDate(n.toDate(),r)},getDate:function(){return c(this._d)?new Date(this._d.getTime()):new Date},setDate:function(e,t){if(!e)return this._d=null,this._o.field&&(this._o.field.value="",s(this._o.field,"change",{firedBy:this})),this.draw();if("string"==typeof e&&(e=new Date(Date.parse(e))),c(e)){var n=this._o.minDate,r=this._o.maxDate;c(n)&&e<n?e=n:c(r)&&e>r&&(e=r),this._d=new Date(e.getTime()),h(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),s(this._o.field,"change",{firedBy:this})),t||"function"!=typeof this._o.onSelect||this._o.onSelect.call(this,this.getDate())}},gotoDate:function(e){var t=!0;if(c(e)){if(this.calendars){var n=new Date(this.calendars[0].year,this.calendars[0].month,1),r=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),a=e.getTime();r.setMonth(r.getMonth()+1),r.setDate(r.getDate()-1),t=a<n.getTime()||r.getTime()<a}t&&(this.calendars=[{month:e.getMonth(),year:e.getFullYear()}],"right"===this._o.mainCalendar&&(this.calendars[0].month+=1-this._o.numberOfMonths)),this.adjustCalendars()}},adjustDate:function(n,r){var a,i=this.getDate(),o=24*parseInt(r)*60*60*1e3;"add"===n?a=new Date(i.valueOf()+o):"subtract"===n&&(a=new Date(i.valueOf()-o)),t&&("add"===n?a=e(i).add(r,"days").toDate():"subtract"===n&&(a=e(i).subtract(r,"days").toDate())),this.setDate(a)},adjustCalendars:function(){this.calendars[0]=y(this.calendars[0]);for(var e=1;e<this._o.numberOfMonths;e++)this.calendars[e]=y({month:this.calendars[0].month+e,year:this.calendars[0].year});this.draw()},gotoToday:function(){this.gotoDate(new Date)},gotoMonth:function(e){isNaN(e)||(this.calendars[0].month=parseInt(e,10),this.adjustCalendars())},nextMonth:function(){this.calendars[0].month++,this.adjustCalendars()},prevMonth:function(){this.calendars[0].month--,this.adjustCalendars()},gotoYear:function(e){isNaN(e)||(this.calendars[0].year=parseInt(e,10),this.adjustCalendars())},setMinDate:function(e){e instanceof Date?(h(e),this._o.minDate=e,this._o.minYear=e.getFullYear(),this._o.minMonth=e.getMonth()):(this._o.minDate=g.minDate,this._o.minYear=g.minYear,this._o.minMonth=g.minMonth,this._o.startRange=g.startRange),this.draw()},setMaxDate:function(e){e instanceof Date?(h(e),this._o.maxDate=e,this._o.maxYear=e.getFullYear(),this._o.maxMonth=e.getMonth()):(this._o.maxDate=g.maxDate,this._o.maxYear=g.maxYear,this._o.maxMonth=g.maxMonth,this._o.endRange=g.endRange),this.draw()},setStartRange:function(e){this._o.startRange=e},setEndRange:function(e){this._o.endRange=e},draw:function(e){if(this._v||e){var t,n=this._o,r=n.minYear,i=n.maxYear,o=n.minMonth,s=n.maxMonth,l="";this._y<=r&&(this._y=r,!isNaN(o)&&this._m<o&&(this._m=o)),this._y>=i&&(this._y=i,!isNaN(s)&&this._m>s&&(this._m=s)),t="pika-title-"+Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,2);for(var u=0;u<n.numberOfMonths;u++)l+='<div class="pika-lendar">'+w(this,u,this.calendars[u].year,this.calendars[u].month,this.calendars[0].year,t)+this.render(this.calendars[u].year,this.calendars[u].month,t)+"</div>";this.el.innerHTML=l,n.bound&&"hidden"!==n.field.type&&a((function(){n.trigger.focus()}),1),"function"==typeof this._o.onDraw&&this._o.onDraw(this),n.bound&&n.field.setAttribute("aria-label","Use the arrow keys to pick a date")}},adjustPosition:function(){var e,t,n,a,i,o,s,l,u,c;if(!this._o.container){if(this.el.style.position="absolute",t=e=this._o.trigger,n=this.el.offsetWidth,a=this.el.offsetHeight,i=window.innerWidth||r.documentElement.clientWidth,o=window.innerHeight||r.documentElement.clientHeight,s=window.pageYOffset||r.body.scrollTop||r.documentElement.scrollTop,"function"==typeof e.getBoundingClientRect)l=(c=e.getBoundingClientRect()).left+window.pageXOffset,u=c.bottom+window.pageYOffset;else for(l=t.offsetLeft,u=t.offsetTop+t.offsetHeight;t=t.offsetParent;)l+=t.offsetLeft,u+=t.offsetTop;(this._o.reposition&&l+n>i||this._o.position.indexOf("right")>-1&&l-n+e.offsetWidth>0)&&(l=l-n+e.offsetWidth),(this._o.reposition&&u+a>o+s||this._o.position.indexOf("top")>-1&&u-a-e.offsetHeight>0)&&(u=u-a-e.offsetHeight),this.el.style.left=l+"px",this.el.style.top=u+"px"}},render:function(e,t,n){var r=this._o,a=new Date,i=p(e,t),o=new Date(e,t,1).getDay(),s=[],l=[];h(a),r.firstDay>0&&(o-=r.firstDay)<0&&(o+=7);for(var u,m,f,y,g=0===t?11:t-1,w=11===t?0:t+1,k=0===t?e-1:e,L=11===t?e+1:e,Y=p(k,g),D=i+o,T=D;T>7;)T-=7;D+=7-T;for(var S=0,O=0;S<D;S++){var x=new Date(e,t,S-o+1),j=!!c(this._d)&&_(x,this._d),E=_(x,a),C=S<o||S>=i+o,H=S-o+1,P=t,A=e,z=r.startRange&&_(r.startRange,x),F=r.endRange&&_(r.endRange,x),W=r.startRange&&r.endRange&&r.startRange<x&&x<r.endRange;C&&(S<o?(H=Y+H,P=g,A=k):(H-=i,P=w,A=L));var N={day:H,month:P,year:A,isSelected:j,isToday:E,isDisabled:r.minDate&&x<r.minDate||r.maxDate&&x>r.maxDate||r.disableWeekends&&d(x)||r.disableDayFn&&r.disableDayFn(x),isEmpty:C,isStartRange:z,isEndRange:F,isInRange:W,showDaysInNextAndPreviousMonths:r.showDaysInNextAndPreviousMonths};l.push(v(N)),7==++O&&(r.showWeekNumber&&l.unshift((u=S-o,m=t,f=e,y=void 0,void 0,y=new Date(f,0,1),'<td class="pika-week">'+Math.ceil(((new Date(f,m,u)-y)/864e5+y.getDay()+1)/7)+"</td>")),s.push(M(l,r.isRTL)),l=[],O=0)}return function(e,t,n){return'<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="'+n+'">'+function(e){var t,n=[];e.showWeekNumber&&n.push("<th></th>");for(t=0;t<7;t++)n.push('<th scope="col"><abbr title="'+b(e,t)+'">'+b(e,t,!0)+"</abbr></th>");return"<thead><tr>"+(e.isRTL?n.reverse():n).join("")+"</tr></thead>"}(e)+(r=t,"<tbody>"+r.join("")+"</tbody>")+"</table>";var r}(r,s,n)},isVisible:function(){return this._v},show:function(){var e,t,n;this.isVisible()||(e=this.el,t="is-hidden",e.className=(n=(" "+e.className+" ").replace(" "+t+" "," ")).trim?n.trim():n.replace(/^\s+|\s+$/g,""),this._v=!0,this.draw(),this._o.bound&&(i(r,"click",this._onClick),this.adjustPosition()),"function"==typeof this._o.onOpen&&this._o.onOpen.call(this))},hide:function(){var e,t,n=this._v;!1!==n&&(this._o.bound&&o(r,"click",this._onClick),this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto",e=this.el,l(e,t="is-hidden")||(e.className=""===e.className?t:e.className+" "+t),this._v=!1,void 0!==n&&"function"==typeof this._o.onClose&&this._o.onClose.call(this))},destroy:function(){this.hide(),o(this.el,"mousedown",this._onMouseDown,!0),o(this.el,"touchend",this._onMouseDown,!0),o(this.el,"change",this._onChange),this._o.field&&(o(this._o.field,"change",this._onInputChange),this._o.bound&&(o(this._o.trigger,"click",this._onInputClick),o(this._o.trigger,"focus",this._onInputFocus),o(this._o.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}},k}(a)}()},,function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r=n(1),a=n.n(r),i=n(129),o=n.n(i),s=function(e,t){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function l(e,t){function n(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var u=function(){return(u=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};function c(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){e.done?a(e.value):new n((function(t){t(e.value)})).then(o,s)}l((r=r.apply(e,t||[])).next())}))}function d(e,t){var n,r,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(a=2&i[0]?r.return:i[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;switch(r=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,r=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===i[0]||2===i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],r=0}finally{n=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}var m={graph_id:null,legend_toggle:!1,graphID:null,options:{colors:null},data:null,rows:null,columns:null,diffdata:null,chartEvents:null,legendToggle:!1,chartActions:null,getChartWrapper:function(e,t){},getChartEditor:null,className:"",style:{},formatters:null,spreadSheetUrl:null,spreadSheetQueryParameters:{headers:1,gid:1},rootProps:{},chartWrapperParams:{},controls:null,render:null,toolbarItems:null,toolbarID:null},p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handleGoogleChartsLoaderScriptLoaded=function(e){var n=t.props,r=n.chartVersion,a=n.chartPackages,i=n.chartLanguage,o=n.mapsApiKey,s=n.onLoad;e.charts.load(r||"current",{packages:a||["corechart","controls"],language:i||"en",mapsApiKey:o}),e.charts.setOnLoadCallback((function(){s(e)}))},t}return l(t,e),t.prototype.shouldComponentUpdate=function(e){return e.chartPackages===this.props.chartPackages},t.prototype.render=function(){var e=this,t=this.props.onError;return Object(r.createElement)(o.a,{url:"https://www.gstatic.com/charts/loader.js",onError:t,onLoad:function(){var t=window;t.google&&e.handleGoogleChartsLoaderScriptLoaded(t.google)}})},t}(r.Component),h=0,_=function(){return"reactgooglegraph-"+(h+=1)},f=["#3366CC","#DC3912","#FF9900","#109618","#990099","#3B3EAC","#0099C6","#DD4477","#66AA00","#B82E2E","#316395","#994499","#22AA99","#AAAA11","#6633CC","#E67300","#8B0707","#329262","#5574A6","#3B3EAC"],y=function(e,t,n){return void 0===n&&(n={}),c(void 0,void 0,void 0,(function(){return d(this,(function(r){return[2,new Promise((function(r,a){var i=n.headers?"headers="+n.headers:"headers=0",o=n.query?"&tq="+encodeURIComponent(n.query):"",s=n.gid?"&gid="+n.gid:"",l=n.sheet?"&sheet="+n.sheet:"",u=n.access_token?"&access_token="+n.access_token:"",c=t+"/gviz/tq?"+(""+i+s+l+o+u);new e.visualization.Query(c).send((function(e){e.isError()?a("Error in query: "+e.getMessage()+" "+e.getDetailedMessage()):r(e.getDataTable())}))}))]}))}))},g=Object(r.createContext)(m),b=g.Provider,v=g.Consumer,M=function(e){var t=e.children,n=e.value;return Object(r.createElement)(b,{value:n},t)},w=function(e){var t=e.render;return Object(r.createElement)(v,null,(function(e){return t(e)}))},k="#CCCCCC",L=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={hiddenColumns:[]},t.listenToLegendToggle=function(){var e=t.props,n=e.google,r=e.googleChartWrapper;n.visualization.events.addListener(r,"select",(function(){var e=r.getChart().getSelection(),n=r.getDataTable();if(0!==e.length&&null===e[0].row&&null!==n){var a=e[0].column,i=t.getColumnID(n,a);t.state.hiddenColumns.includes(i)?t.setState((function(e){return u({},e,{hiddenColumns:e.hiddenColumns.filter((function(e){return e!==i})).slice()})})):t.setState((function(e){return u({},e,{hiddenColumns:e.hiddenColumns.concat([i])})}))}}))},t.applyFormatters=function(e,n){for(var r=t.props.google,a=0,i=n;a<i.length;a++){var o=i[a];switch(o.type){case"ArrowFormat":(s=new r.visualization.ArrowFormat(o.options)).format(e,o.column);break;case"BarFormat":(s=new r.visualization.BarFormat(o.options)).format(e,o.column);break;case"ColorFormat":for(var s=new r.visualization.ColorFormat(o.options),l=0,u=o.ranges;l<u.length;l++){var c=u[l];s.addRange.apply(s,c)}s.format(e,o.column);break;case"DateFormat":(s=new r.visualization.DateFormat(o.options)).format(e,o.column);break;case"NumberFormat":(s=new r.visualization.NumberFormat(o.options)).format(e,o.column);break;case"PatternFormat":(s=new r.visualization.PatternFormat(o.options)).format(e,o.column)}}},t.getColumnID=function(e,t){return e.getColumnId(t)||e.getColumnLabel(t)},t.draw=function(e){var n=e.data,r=e.diffdata,a=e.rows,i=e.columns,o=e.options,s=e.legend_toggle,l=e.legendToggle,u=e.chartType,m=e.formatters,p=e.spreadSheetUrl,h=e.spreadSheetQueryParameters;return c(t,void 0,void 0,(function(){var e,t,c,_,f,g,b,v,M,w,k,L,Y,D;return d(this,(function(d){switch(d.label){case 0:return e=this.props,t=e.google,c=e.googleChartWrapper,f=null,null!==r&&(g=t.visualization.arrayToDataTable(r.old),b=t.visualization.arrayToDataTable(r.new),f=t.visualization[u].prototype.computeDiff(g,b)),null===n?[3,1]:(_=Array.isArray(n)?t.visualization.arrayToDataTable(n):new t.visualization.DataTable(n),[3,5]);case 1:return null===a||null===i?[3,2]:(_=t.visualization.arrayToDataTable([i].concat(a)),[3,5]);case 2:return null===p?[3,4]:[4,y(t,p,h)];case 3:return _=d.sent(),[3,5];case 4:_=t.visualization.arrayToDataTable([]),d.label=5;case 5:for(v=_.getNumberOfColumns(),M=0;M<v;M+=1)w=this.getColumnID(_,M),this.state.hiddenColumns.includes(w)&&(k=_.getColumnLabel(M),L=_.getColumnId(M),Y=_.getColumnType(M),_.removeColumn(M),_.addColumn({label:k,id:L,type:Y}));return D=c.getChart(),"Timeline"===c.getChartType()&&D&&D.clearChart(),c.setChartType(u),c.setOptions(o),c.setDataTable(_),c.draw(),null!==this.props.googleChartDashboard&&this.props.googleChartDashboard.draw(_),null!==f&&(c.setDataTable(f),c.draw()),null!==m&&(this.applyFormatters(_,m),c.setDataTable(_),c.draw()),!0!==l&&!0!==s||this.grayOutHiddenColumns({options:o}),[2]}}))}))},t.grayOutHiddenColumns=function(e){var n=e.options,r=t.props.googleChartWrapper,a=r.getDataTable();if(null!==a){var i=a.getNumberOfColumns();if(!1!==t.state.hiddenColumns.length>0){var o=Array.from({length:i-1}).map((function(e,r){var i=t.getColumnID(a,r+1);return t.state.hiddenColumns.includes(i)?k:void 0!==n.colors&&null!==n.colors?n.colors[r]:f[r]}));r.setOptions(u({},n,{colors:o})),r.draw()}}},t.onResize=function(){t.props.googleChartWrapper.draw()},t}return l(t,e),t.prototype.componentDidMount=function(){this.draw(this.props),window.addEventListener("resize",this.onResize),(this.props.legend_toggle||this.props.legendToggle)&&this.listenToLegendToggle()},t.prototype.componentWillUnmount=function(){var e=this.props,t=e.google,n=e.googleChartWrapper;window.removeEventListener("resize",this.onResize),t.visualization.events.removeAllListeners(n),"Timeline"===n.getChartType()&&n.getChart()&&n.getChart().clearChart()},t.prototype.componentDidUpdate=function(){this.draw(this.props)},t.prototype.render=function(){return null},t}(r.Component),Y=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.componentDidMount=function(){},t.prototype.componentWillUnmount=function(){},t.prototype.shouldComponentUpdate=function(){return!1},t.prototype.render=function(){var e=this.props,t=e.google,n=e.googleChartWrapper,a=e.googleChartDashboard;return Object(r.createElement)(w,{render:function(e){return Object(r.createElement)(L,u({},e,{google:t,googleChartWrapper:n,googleChartDashboard:a}))}})},t}(r.Component),D=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.shouldComponentUpdate=function(){return!1},t.prototype.listenToEvents=function(e){var t=this,n=e.chartEvents,r=e.google,a=e.googleChartWrapper;if(null!==n){r.visualization.events.removeAllListeners(a);for(var i=function(e){var n=e.eventName,i=e.callback;r.visualization.events.addListener(a,n,(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];i({chartWrapper:a,props:t.props,google:r,eventArgs:e})}))},o=0,s=n;o<s.length;o++){i(s[o])}}},t.prototype.render=function(){var e=this,t=this.props,n=t.google,a=t.googleChartWrapper;return Object(r.createElement)(w,{render:function(t){return e.listenToEvents({chartEvents:t.chartEvents||null,google:n,googleChartWrapper:a}),null}})},t}(r.Component),T=0,S=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={googleChartWrapper:null,googleChartDashboard:null,googleChartControls:null,googleChartEditor:null,isReady:!1},t.graphID=null,t.dashboard_ref=Object(r.createRef)(),t.toolbar_ref=Object(r.createRef)(),t.getGraphID=function(){var e,n=t.props,r=n.graphID,a=n.graph_id;return e=null===r&&null===a?null===t.graphID?_():t.graphID:null!==r&&null===a?r:null!==a&&null===r?a:r,t.graphID=e,t.graphID},t.getControlID=function(e,t){return T+=1,void 0===e?"googlechart-control-"+t+"-"+T:e},t.addControls=function(e,n){var r=t.props,a=r.google,i=r.controls,o=null===i?null:i.map((function(e,n){var r=e.controlID,i=e.controlType,o=e.options,s=e.controlWrapperParams,l=t.getControlID(r,n);return{controlProp:e,control:new a.visualization.ControlWrapper(u({containerId:l,controlType:i,options:o},s))}}));if(null===o)return null;n.bind(o.map((function(e){return e.control})),e);for(var s=function(n){for(var r=n.control,i=n.controlProp.controlEvents,o=function(n){var i=n.callback,o=n.eventName;a.visualization.events.removeListener(r,o,i),a.visualization.events.addListener(r,o,(function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];i({chartWrapper:e,controlWrapper:r,props:t.props,google:a,eventArgs:n})}))},s=0,l=void 0===i?[]:i;s<l.length;s++){o(l[s])}},l=0,c=o;l<c.length;l++){s(c[l])}return o},t.renderChart=function(){var e=t.props,n=e.width,a=e.height,i=e.options,o=e.style,s=e.className,l=e.rootProps,c=e.google,d=u({height:a||i&&i.height,width:n||i&&i.width},o);return Object(r.createElement)("div",u({id:t.getGraphID(),style:d,className:s},l),t.state.isReady&&null!==t.state.googleChartWrapper?Object(r.createElement)(r.Fragment,null,Object(r.createElement)(Y,{googleChartWrapper:t.state.googleChartWrapper,google:c,googleChartDashboard:t.state.googleChartDashboard}),Object(r.createElement)(D,{googleChartWrapper:t.state.googleChartWrapper,google:c})):null)},t.renderControl=function(e){return void 0===e&&(e=function(e){e.control,e.controlProp;return!0}),t.state.isReady&&null!==t.state.googleChartControls?Object(r.createElement)(r.Fragment,null,t.state.googleChartControls.filter((function(t){var n=t.controlProp,r=t.control;return e({control:r,controlProp:n})})).map((function(e){var t=e.control;e.controlProp;return Object(r.createElement)("div",{key:t.getContainerId(),id:t.getContainerId()})}))):null},t.renderToolBar=function(){return null===t.props.toolbarItems?null:Object(r.createElement)("div",{ref:t.toolbar_ref})},t}return l(t,e),t.prototype.componentDidMount=function(){var e=this.props,t=e.options,n=e.google,r=e.chartType,a=e.chartWrapperParams,i=e.toolbarItems,o=e.getChartEditor,s=e.getChartWrapper,l=u({chartType:r,options:t,containerId:this.getGraphID()},a),c=new n.visualization.ChartWrapper(l);c.setOptions(t),s(c,n);var d=new n.visualization.Dashboard(this.dashboard_ref),m=this.addControls(c,d);null!==i&&n.visualization.drawToolbar(this.toolbar_ref.current,i);var p=null;null!==o&&o({chartEditor:p=new n.visualization.ChartEditor,chartWrapper:c,google:n}),this.setState({googleChartEditor:p,googleChartControls:m,googleChartDashboard:d,googleChartWrapper:c,isReady:!0})},t.prototype.componentDidUpdate=function(){if(null!==this.state.googleChartWrapper&&null!==this.state.googleChartDashboard&&null!==this.state.googleChartControls)for(var e=this.props.controls,t=0;t<e.length;t+=1){var n=e[t],r=n.controlType,a=n.options,i=n.controlWrapperParams;i&&"state"in i&&this.state.googleChartControls[t].control.setState(i.state),this.state.googleChartControls[t].control.setOptions(a),this.state.googleChartControls[t].control.setControlType(r)}},t.prototype.shouldComponentUpdate=function(e,t){return this.state.isReady!==t.isReady||e.controls!==this.props.controls},t.prototype.render=function(){var e=this.props,t=e.width,n=e.height,a=e.options,i=e.style,o=u({height:n||a&&a.height,width:t||a&&a.width},i);return null!==this.props.render?Object(r.createElement)("div",{ref:this.dashboard_ref,style:o},Object(r.createElement)("div",{ref:this.toolbar_ref,id:"toolbar"}),this.props.render({renderChart:this.renderChart,renderControl:this.renderControl,renderToolbar:this.renderToolBar})):Object(r.createElement)("div",{ref:this.dashboard_ref,style:o},this.renderControl((function(e){return"bottom"!==e.controlProp.controlPosition})),this.renderChart(),this.renderControl((function(e){return"bottom"===e.controlProp.controlPosition})),this.renderToolBar())},t}(r.Component),O=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._isMounted=!1,t.state={loadingStatus:"loading",google:null},t.onLoad=function(e){if(t.isFullyLoaded(e))t.onSuccess(e);else var n=setInterval((function(){var e=window.google;t._isMounted?e&&t.isFullyLoaded(e)&&(clearInterval(n),t.onSuccess(e)):clearInterval(n)}),1e3)},t.onSuccess=function(e){t.setState({loadingStatus:"ready",google:e})},t.onError=function(){t.setState({loadingStatus:"errored"})},t}return l(t,e),t.prototype.render=function(){var e=this.props,t=e.chartLanguage,n=e.chartPackages,a=e.chartVersion,i=e.mapsApiKey,o=e.loader,s=e.errorElement;return Object(r.createElement)(M,{value:this.props},"ready"===this.state.loadingStatus&&null!==this.state.google?Object(r.createElement)(S,u({},this.props,{google:this.state.google})):"errored"===this.state.loadingStatus&&s?s:o,Object(r.createElement)(p,u({},{chartLanguage:t,chartPackages:n,chartVersion:a,mapsApiKey:i},{onLoad:this.onLoad,onError:this.onError})))},t.prototype.componentDidMount=function(){this._isMounted=!0},t.prototype.componentWillUnmount=function(){this._isMounted=!1},t.prototype.isFullyLoaded=function(e){var t=this.props,n=t.controls,r=t.toolbarItems,a=t.getChartEditor;return e&&e.visualization&&e.visualization.ChartWrapper&&e.visualization.Dashboard&&(!n||e.visualization.ChartWrapper)&&(!a||e.visualization.ChartEditor)&&(!r||e.visualization.drawToolbar)},t.defaultProps=m,t}(r.Component),x=n(130),j=n.n(x);function E(e){return(E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function C(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function H(e){return(H=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function P(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function A(e,t){return(A=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var z=wp.element,F=z.Component,W=z.Fragment,N=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==E(t)&&"function"!=typeof t?P(e):t}(this,H(t).apply(this,arguments))).initDataTable=e.initDataTable.bind(P(e)),e.dataRenderer=e.dataRenderer.bind(P(e)),e.table,e.uniqueId=j()(),e}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&A(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){this.initDataTable(this.props.columns,this.props.rows)}},{key:"componentWillUnmount",value:function(){this.table.destroy()}},{key:"componentDidUpdate",value:function(e){this.props!==e&&(this.props.options.responsive_bool!==e.options.responsive_bool&&"true"===e.options.responsive_bool&&document.getElementById("dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId)).classList.remove("collapsed"),this.table.destroy(),document.getElementById("dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId)).innerHTML="",this.initDataTable(this.props.columns,this.props.rows))}},{key:"initDataTable",value:function(e,t){var n=this,r=this.props.options,a=e.map((function(e,t){var r=e.type;switch(e.type){case"number":r="num";break;case"date":case"datetime":case"timeofday":r="date"}return{title:e.label,data:e.label,type:r,render:n.dataRenderer(i,r,t)}})),i=t.map((function(e){var t={};return a.forEach((function(n,r){t[n.data]=e[r]})),t}));this.table=jQuery("#dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId)).DataTable({destroy:!0,data:i,columns:a,paging:"true"===r.paging_bool,pageLength:r.pageLength_int||10,pagingType:r.pagingType,ordering:"false"!==r.ordering_bool,fixedHeader:"true"===r.fixedHeader_bool,scrollCollapse:!(!this.props.chartsScreen&&"true"!==r.scrollCollapse_bool),scrollY:(this.props.chartsScreen?180:"true"===r.scrollCollapse_bool&&Number(r.scrollY_int))||!1,responsive:!(!this.props.chartsScreen&&"true"!==r.responsive_bool),searching:!1,select:!1,lengthChange:!1,bFilter:!1,bInfo:!1})}},{key:"dataRenderer",value:function(e,t,n){var r=this.props.options;if(void 0===r.series[n])return e;if("date"===t||"datetime"===t||"timeofday"===t)return r.series[n].format&&r.series[n].format.from&&r.series[n].format.to?jQuery.fn.dataTable.render.moment(r.series[n].format.from,r.series[n].format.to):jQuery.fn.dataTable.render.moment("MM-DD-YYYY");if("num"===t){var a,i=["","","","",""];return r.series[n].format.thousands&&(i[0]=r.series[n].format.thousands),r.series[n].format.decimal&&(i[1]=r.series[n].format.decimal),r.series[n].format.precision&&(i[2]=r.series[n].format.precision),r.series[n].format.prefix&&(i[3]=r.series[n].format.prefix),r.series[n].format.suffix&&(i[4]=r.series[n].format.suffix),(a=jQuery.fn.dataTable.render).number.apply(a,i)}return e}},{key:"render",value:function(){var e=this.props.options;return wp.element.createElement(W,null,e.customcss&&wp.element.createElement("style",null,e.customcss.oddTableRow&&"#dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId," tr.odd {\n\t\t\t\t\t\t\t\t").concat(e.customcss.oddTableRow.color?"color: ".concat(e.customcss.oddTableRow.color," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.oddTableRow["background-color"]?"background-color: ".concat(e.customcss.oddTableRow["background-color"]," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.oddTableRow.transform?"transform: rotate( ".concat(e.customcss.oddTableRow.transform,"deg ) !important;"):"","\n\t\t\t\t\t\t\t}"),e.customcss.evenTableRow&&"#dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId," tr.even {\n\t\t\t\t\t\t\t\t").concat(e.customcss.evenTableRow.color?"color: ".concat(e.customcss.evenTableRow.color," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.evenTableRow["background-color"]?"background-color: ".concat(e.customcss.evenTableRow["background-color"]," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.evenTableRow.transform?"transform: rotate( ".concat(e.customcss.evenTableRow.transform,"deg ) !important;"):"","\n\t\t\t\t\t\t\t}"),e.customcss.tableCell&&"#dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId," tr td,\n\t\t\t\t\t\t\t#dataTable-instances-").concat(this.props.id,"-").concat(this.uniqueId,"_wrapper tr th {\n\t\t\t\t\t\t\t\t").concat(e.customcss.tableCell.color?"color: ".concat(e.customcss.tableCell.color," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.tableCell["background-color"]?"background-color: ".concat(e.customcss.tableCell["background-color"]," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.tableCell.transform?"transform: rotate( ".concat(e.customcss.tableCell.transform,"deg ) !important;"):"","\n\t\t\t\t\t\t\t}")),wp.element.createElement("table",{id:"dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId)}))}}])&&C(n.prototype,r),a&&C(n,a),t}(F),R=n(4),I=n.n(R),B=n(131),U=n.n(B),V=function(e){return Object.keys(e["visualizer-series"]).map((function(t){void 0!==e["visualizer-series"][t].type&&"date"===e["visualizer-series"][t].type&&Object.keys(e["visualizer-data"]).map((function(n){return e["visualizer-data"][n][t]=new Date(e["visualizer-data"][n][t])}))})),e},J=function(e){var t;if(Array.isArray(e))return 0<e.length;if(I()(e)){for(t in e)return!0;return!1}return"string"==typeof e?0<e.length:null!=e},G=function(e){return U()(e,J)},q=function(e){return e.width="",e.height="",e.backgroundColor={},e.chartArea={},G(e)},$=function(e){try{JSON.parse(e)}catch(e){return!1}return!0};function K(e){return(K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Z(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function Q(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){Z(i,r,a,o,s,"next",e)}function s(e){Z(i,r,a,o,s,"throw",e)}o(void 0)}))}}function X(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ee(e){return(ee=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function te(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ne(e,t){return(ne=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var re=lodash.startCase,ae=wp.i18n.__,ie=wp.apiFetch,oe=wp.element,se=oe.Component,le=oe.Fragment,ue=wp.components,ce=ue.Button,de=ue.Dashicon,me=ue.ExternalLink,pe=ue.Notice,he=ue.Placeholder,_e=ue.Spinner,fe=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==K(t)&&"function"!=typeof t?te(e):t}(this,ee(t).apply(this,arguments))).loadMoreCharts=e.loadMoreCharts.bind(te(e)),e.state={charts:null,isBusy:!1,chartsLoaded:!1},e}var n,r,a,i,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ne(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:(o=Q(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ie({path:"wp/v2/visualizer/?per_page=6&meta_key=visualizer-chart-library&meta_value=ChartJS"});case 2:t=e.sent,this.setState({charts:t});case 4:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"loadMoreCharts",value:(i=Q(regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.state.charts.length,n=this.state.chartsLoaded,this.setState({isBusy:!0}),e.next=5,ie({path:"wp/v2/visualizer/?per_page=6&meta_key=visualizer-chart-library&meta_value=ChartJS&offset=".concat(t)});case 5:6>(r=e.sent).length&&(n=!0),this.setState({charts:this.state.charts.concat(r),isBusy:!1,chartsLoaded:n});case 8:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"render",value:function(){var e=this,t=this.state,n=t.charts,r=t.isBusy,a=t.chartsLoaded;return wp.element.createElement("div",{className:"visualizer-settings__charts"},wp.element.createElement(pe,{status:"warning",isDismissible:!1},ae("ChartJS charts are currently not available for selection here, you must visit the library, get the shortcode, and add the chart here in a shortcode tag."),wp.element.createElement(me,{href:visualizerLocalize.adminPage},ae("Click here to visit Visualizer Charts Library."))),null!==n?1<=n.length?wp.element.createElement(le,null,wp.element.createElement("div",{className:"visualizer-settings__charts-grid"},Object.keys(n).map((function(t){var r,a,i=V(n[t].chart_data);if(r=i["visualizer-settings"].title?i["visualizer-settings"].title:"#".concat(n[t].id),a=0<=["gauge","table","timeline","dataTable"].indexOf(i["visualizer-chart-type"])?"dataTable"===i["visualizer-chart-type"]?i["visualizer-chart-type"]:re(i["visualizer-chart-type"]):"".concat(re(i["visualizer-chart-type"]),"Chart"),!i["visualizer-chart-library"]||"ChartJS"!==i["visualizer-chart-library"])return wp.element.createElement("div",{className:"visualizer-settings__charts-single"},wp.element.createElement("div",{className:"visualizer-settings__charts-title"},r),"dataTable"===a?wp.element.createElement(N,{id:n[t].id,rows:i["visualizer-data"],columns:i["visualizer-series"],chartsScreen:!0,options:q(i["visualizer-settings"])}):wp.element.createElement(O,{chartType:a,rows:i["visualizer-data"],columns:i["visualizer-series"],options:q(i["visualizer-settings"])}),wp.element.createElement("div",{className:"visualizer-settings__charts-controls",title:ae("Insert Chart"),onClick:function(){return e.props.getChart(n[t].id)}},wp.element.createElement(de,{icon:"upload"})))}))),!a&&5<n.length&&wp.element.createElement(ce,{isPrimary:!0,isLarge:!0,onClick:this.loadMoreCharts,isBusy:r},ae("Load More"))):wp.element.createElement("p",{className:"visualizer-no-charts"},ae("No charts found.")):wp.element.createElement(he,null,wp.element.createElement(_e,null)))}}])&&X(n.prototype,r),a&&X(n,a),t}(se);function ye(e){return(ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ge(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function be(e){return(be=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ve(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Me(e,t){return(Me=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var we=wp.i18n.__,ke=wp.element.Component,Le=wp.components,Ye=Le.Button,De=Le.ExternalLink,Te=Le.PanelBody,Se=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==ye(t)&&"function"!=typeof t?ve(e):t}(this,be(t).apply(this,arguments))).uploadInput=React.createRef(),e.fileUploaded=e.fileUploaded.bind(ve(e)),e.uploadImport=e.uploadImport.bind(ve(e)),e.state={uploadLabel:we("Upload")},e}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Me(e,t)}(t,e),n=t,(r=[{key:"fileUploaded",value:function(e){"text/csv"===e.target.files[0].type&&this.setState({uploadLabel:we("Upload")})}},{key:"uploadImport",value:function(){this.props.readUploadedFile(this.uploadInput),this.setState({uploadLabel:we("Uploaded")})}},{key:"render",value:function(){return wp.element.createElement(Te,{title:we("Import data from file"),initialOpen:!1},wp.element.createElement("p",null,we("Select and upload your data CSV file here. The first row of the CSV file should contain the column headings. The second one should contain series type (string, number, boolean, date, datetime, timeofday).")),wp.element.createElement("p",null,we("If you are unsure about how to format your data CSV then please take a look at this sample: "),wp.element.createElement(De,{href:"".concat(visualizerLocalize.absurl,"samples/").concat(this.props.chart["visualizer-chart-type"],".csv")},"".concat(this.props.chart["visualizer-chart-type"],".csv"))),wp.element.createElement("input",{type:"file",accept:"text/csv",ref:this.uploadInput,onChange:this.fileUploaded}),wp.element.createElement(Ye,{isPrimary:!0,onClick:this.uploadImport},this.state.uploadLabel))}}])&&ge(n.prototype,r),a&&ge(n,a),t}(ke);function Oe(e){return(Oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function je(e,t){return!t||"object"!==Oe(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ee(e){return(Ee=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ce(e,t){return(Ce=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var He=wp.i18n.__,Pe=wp.element.Component,Ae=wp.components,ze=Ae.Button,Fe=Ae.ExternalLink,We=Ae.PanelBody,Ne=Ae.SelectControl,Re=Ae.TextControl,Ie=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),je(this,Ee(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ce(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this;return wp.element.createElement(We,{title:He("Import data from URL"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(We,{title:He("One Time Import"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,He("You can use this to import data from a remote CSV file. The first row of the CSV file should contain the column headings. The second one should contain series type (string, number, boolean, date, datetime, timeofday).")),wp.element.createElement("p",null,He("If you are unsure about how to format your data CSV then please take a look at this sample: "),wp.element.createElement(Fe,{href:"".concat(visualizerLocalize.absurl,"samples/").concat(this.props.chart["visualizer-chart-type"],".csv")},"".concat(this.props.chart["visualizer-chart-type"],".csv"))),wp.element.createElement("p",null,He("You can also import data from Google Spreadsheet.")),wp.element.createElement(Re,{placeholder:He("Please enter the URL of your CSV file"),value:this.props.chart["visualizer-chart-url"]?this.props.chart["visualizer-chart-url"]:"",onChange:this.props.editURL}),wp.element.createElement(ze,{isPrimary:!0,isLarge:!0,isBusy:"uploadData"===this.props.isLoading,disabled:"uploadData"===this.props.isLoading,onClick:function(){return e.props.uploadData(!1)}},He("Import Data"))),"business"===visualizerLocalize.isPro?wp.element.createElement(We,{title:He("Schedule Import"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,He("You can choose here to synchronize your chart data with a remote CSV file. ")),wp.element.createElement("p",null,He("You can also synchronize with your Google Spreadsheet file.")),wp.element.createElement("p",null,He("We will update the chart data based on your time interval preference by overwritting the current data with the one from the URL.")),wp.element.createElement(Re,{placeholder:He("Please enter the URL of your CSV file"),value:this.props.chart["visualizer-chart-url"]?this.props.chart["visualizer-chart-url"]:"",onChange:this.props.editURL}),wp.element.createElement(Ne,{label:He("How often do you want to check the url?"),value:this.props.chart["visualizer-chart-schedule"]?this.props.chart["visualizer-chart-schedule"]:1,options:[{label:He("Each hour"),value:"1"},{label:He("Each 12 hours"),value:"12"},{label:He("Each day"),value:"24"},{label:He("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(ze,{isPrimary:!0,isLarge:!0,isBusy:"uploadData"===this.props.isLoading,disabled:"uploadData"===this.props.isLoading,onClick:function(){return e.props.uploadData(!0)}},He("Save Schedule"))):wp.element.createElement(We,{title:He("Schedule Import"),icon:"lock",className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,He("Enable this feature in BUSINESS version!")),wp.element.createElement(ze,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},He("Buy Now"))))}}])&&xe(n.prototype,r),a&&xe(n,a),t}(Pe);function Be(e){return(Be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ue(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function Ve(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Je(e,t){return!t||"object"!==Be(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ge(e){return(Ge=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function qe(e,t){return(qe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var $e=wp.i18n.__,Ke=wp.apiFetch,Ze=wp.element,Qe=Ze.Component,Xe=Ze.Fragment,et=wp.components,tt=et.Button,nt=et.PanelBody,rt=et.Placeholder,at=et.SelectControl,it=et.Spinner,ot=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=Je(this,Ge(t).apply(this,arguments))).state={id:"",charts:[]},e}var n,r,a,i,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&qe(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:(i=regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ke({path:"wp/v2/visualizer/?per_page=100"});case 2:t=(t=e.sent).map((function(e,t){var r=e.chart_data["visualizer-settings"].title?e.chart_data["visualizer-settings"].title:"#".concat(e.id);return 0===t&&(n=e.id),{value:e.id,label:r}})),this.setState({id:n,charts:t});case 5:case"end":return e.stop()}}),e,this)})),o=function(){var e=this,t=arguments;return new Promise((function(n,r){var a=i.apply(e,t);function o(e){Ue(a,n,r,o,s,"next",e)}function s(e){Ue(a,n,r,o,s,"throw",e)}o(void 0)}))},function(){return o.apply(this,arguments)})},{key:"render",value:function(){var e=this;return"community"!==visualizerLocalize.isPro?wp.element.createElement(nt,{title:$e("Import from other chart"),initialOpen:!1},1<=this.state.charts.length?wp.element.createElement(Xe,null,wp.element.createElement(at,{label:$e("You can import here data from your previously created charts."),value:this.state.id,options:this.state.charts,onChange:function(t){return e.setState({id:t})}}),wp.element.createElement(tt,{isPrimary:!0,isBusy:"getChartData"===this.props.isLoading,onClick:function(){return e.props.getChartData(e.state.id)}},$e("Import Chart"))):wp.element.createElement(rt,null,wp.element.createElement(it,null))):wp.element.createElement(nt,{title:$e("Import from other chart"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,$e("Enable this feature in PRO version!")),wp.element.createElement(tt,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},$e("Buy Now")))}}])&&Ve(n.prototype,r),a&&Ve(n,a),t}(Qe),st=n(132);n(152);function lt(e){return(lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ut(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ct(e,t){return!t||"object"!==lt(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function dt(e){return(dt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function mt(e,t){return(mt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var pt=wp.i18n.__,ht=wp.element.Component,_t=wp.components,ft=_t.Button,yt=_t.ButtonGroup,gt=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=ct(this,dt(t).apply(this,arguments))).data=[],e.dates=[],e.types=["string","number","boolean","date","datetime","timeofday"],e}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&mt(e,t)}(t,e),n=t,(r=[{key:"componentWillMount",value:function(){var e=this;this.data[this.data.length]=[],this.data[this.data.length]=[],this.props.chart["visualizer-series"].map((function(t,n){e.data[0][n]=t.label,e.data[1][n]=t.type,"date"===t.type&&e.dates.push(n)})),this.props.chart["visualizer-data"].map((function(t){e.data[e.data.length]=t}))}},{key:"render",value:function(){var e=this;return wp.element.createElement("div",{className:"visualizer-chart-editor"},wp.element.createElement(st.HotTable,{data:this.data,allowInsertRow:!0,contextMenu:!0,rowHeaders:!0,colHeaders:!0,allowInvalid:!1,className:"htEditor",cells:function(t,n,r){var a;return 1===t&&(a={type:"autocomplete",source:e.types,strict:!1}),0<=e.dates.indexOf(n)&&1<t&&(a={type:"date",dateFormat:"YYYY-MM-DD",correctFormat:!0}),a}}),wp.element.createElement(yt,null,wp.element.createElement(ft,{isDefault:!0,isLarge:!0,onClick:this.props.toggleModal},pt("Close")),wp.element.createElement(ft,{isPrimary:!0,isLarge:!0,onClick:function(t){e.props.toggleModal(),e.props.editChartData(e.data,"Visualizer_Source_Csv")}},pt("Save"))))}}])&&ut(n.prototype,r),a&&ut(n,a),t}(ht);function bt(e){return(bt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function vt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Mt(e){return(Mt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function wt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kt(e,t){return(kt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Lt=wp.i18n.__,Yt=wp.element,Dt=Yt.Component,Tt=Yt.Fragment,St=wp.components,Ot=St.Button,xt=St.Modal,jt=St.PanelBody,Et=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==bt(t)&&"function"!=typeof t?wt(e):t}(this,Mt(t).apply(this,arguments))).toggleModal=e.toggleModal.bind(wt(e)),e.state={isOpen:!1},e}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&kt(e,t)}(t,e),n=t,(r=[{key:"toggleModal",value:function(){this.setState({isOpen:!this.state.isOpen})}},{key:"render",value:function(){return"community"!==visualizerLocalize.isPro?wp.element.createElement(Tt,null,wp.element.createElement(jt,{title:Lt("Manual Data"),initialOpen:!1},wp.element.createElement("p",null,Lt("You can manually edit the chart data using a spreadsheet like editor.")),wp.element.createElement(Ot,{isPrimary:!0,isLarge:!0,isBusy:this.state.isOpen,onClick:this.toggleModal},Lt("View Editor"))),this.state.isOpen&&wp.element.createElement(xt,{title:"Chart Editor",onRequestClose:this.toggleModal,shouldCloseOnClickOutside:!1},wp.element.createElement(gt,{chart:this.props.chart,editChartData:this.props.editChartData,toggleModal:this.toggleModal}))):wp.element.createElement(jt,{title:Lt("Manual Data"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,Lt("Enable this feature in PRO version!")),wp.element.createElement(Ot,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},Lt("Buy Now")))}}])&&vt(n.prototype,r),a&&vt(n,a),t}(Dt);function Ct(e){return(Ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ht(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Pt(e,t){return!t||"object"!==Ct(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function At(e){return(At=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function zt(e,t){return(zt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ft=wp.i18n.__,Wt=wp.element.Component,Nt=wp.editor.ColorPalette,Rt=wp.components,It=Rt.BaseControl,Bt=Rt.CheckboxControl,Ut=Rt.PanelBody,Vt=Rt.SelectControl,Jt=Rt.TextControl,Gt=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Pt(this,At(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&zt(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"],r=[{label:Ft("The tooltip will be displayed when the user hovers over an element"),value:"focus"}];return-1>=["timeline"].indexOf(t)&&(r[1]={label:Ft("The tooltip will be displayed when the user selects an element"),value:"selection"}),r[2]={label:Ft("The tooltip will not be displayed"),value:"none"},wp.element.createElement(Ut,{title:Ft("General Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Ut,{title:Ft("Title"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Jt,{label:Ft("Chart Title"),help:Ft("Text to display above the chart."),value:n.title,onChange:function(t){n.title=t,e.props.edit(n)}}),-1>=["table","gauge","geo","pie","timeline","dataTable"].indexOf(t)&&wp.element.createElement(Vt,{label:Ft("Chart Title Position"),help:Ft("Where to place the chart title, compared to the chart area."),value:n.titlePosition?n.titlePosition:"out",options:[{label:Ft("Inside the chart"),value:"in"},{label:Ft("Outside the chart"),value:"out"},{label:Ft("None"),value:"none"}],onChange:function(t){n.titlePosition=t,e.props.edit(n)}}),-1>=["table","gauge","geo","timeline","dataTable"].indexOf(t)&&wp.element.createElement(It,{label:Ft("Chart Title Color")},wp.element.createElement(Nt,{value:n.titleTextStyle.color,onChange:function(t){n.titleTextStyle.color=t,e.props.edit(n)}})),-1>=["table","gauge","geo","pie","timeline","dataTable"].indexOf(t)&&wp.element.createElement(Vt,{label:Ft("Axes Titles Position"),help:Ft("Determines where to place the axis titles, compared to the chart area."),value:n.axisTitlesPosition?n.axisTitlesPosition:"out",options:[{label:Ft("Inside the chart"),value:"in"},{label:Ft("Outside the chart"),value:"out"},{label:Ft("None"),value:"none"}],onChange:function(t){n.axisTitlesPosition=t,e.props.edit(n)}})),-1>=["table","gauge","geo","pie","timeline","dataTable"].indexOf(t)&&wp.element.createElement(Ut,{title:Ft("Font Styles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Vt,{label:Ft("Font Family"),help:Ft("The default font family for all text in the chart."),value:n.fontName?n.fontName:"Arial",options:[{label:Ft("Arial"),value:"Arial"},{label:Ft("Sans Serif"),value:"Sans Serif"},{label:Ft("Serif"),value:"serif"},{label:Ft("Arial"),value:"Arial"},{label:Ft("Wide"),value:"Arial black"},{label:Ft("Narrow"),value:"Arial Narrow"},{label:Ft("Comic Sans MS"),value:"Comic Sans MS"},{label:Ft("Courier New"),value:"Courier New"},{label:Ft("Garamond"),value:"Garamond"},{label:Ft("Georgia"),value:"Georgia"},{label:Ft("Tahoma"),value:"Tahoma"},{label:Ft("Verdana"),value:"Verdana"}],onChange:function(t){n.fontName=t,e.props.edit(n)}}),wp.element.createElement(Vt,{label:Ft("Font Size"),help:Ft("The default font size for all text in the chart."),value:n.fontSize?n.fontSize:"15",options:[{label:"7",value:"7"},{label:"8",value:"8"},{label:"9",value:"9"},{label:"10",value:"10"},{label:"11",value:"11"},{label:"12",value:"12"},{label:"13",value:"13"},{label:"14",value:"14"},{label:"15",value:"15"},{label:"16",value:"16"},{label:"17",value:"17"},{label:"18",value:"18"},{label:"19",value:"19"},{label:"20",value:"20"}],onChange:function(t){n.fontSize=t,e.props.edit(n)}})),-1>=["table","gauge","geo","timeline","dataTable"].indexOf(t)&&wp.element.createElement(Ut,{title:Ft("Legend"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Vt,{label:Ft("Position"),help:Ft("Determines where to place the legend, compared to the chart area."),value:n.legend.position?n.legend.position:"right",options:[{label:Ft("Left of the chart"),value:"left"},{label:Ft("Right of the chart"),value:"right"},{label:Ft("Above the chart"),value:"top"},{label:Ft("Below the chart"),value:"bottom"},{label:Ft("Inside the chart"),value:"in"},{label:Ft("Omit the legend"),value:"none"}],onChange:function(r){if("pie"!==t){var a="left"===r?1:0;Object.keys(n.series).map((function(e){n.series[e].targetAxisIndex=a}))}n.legend.position=r,e.props.edit(n)}}),wp.element.createElement(Vt,{label:Ft("Alignment"),help:Ft("Determines the alignment of the legend."),value:n.legend.alignment?n.legend.alignment:"15",options:[{label:Ft("Aligned to the start of the allocated area"),value:"start"},{label:Ft("Centered in the allocated area"),value:"center"},{label:Ft("Aligned to the end of the allocated area"),value:"end"}],onChange:function(t){n.legend.alignment=t,e.props.edit(n)}}),wp.element.createElement(It,{label:Ft("Font Color")},wp.element.createElement(Nt,{value:n.legend.textStyle.color,onChange:function(t){n.legend.textStyle.color=t,e.props.edit(n)}}))),-1>=["table","gauge","geo","dataTable"].indexOf(t)&&wp.element.createElement(Ut,{title:Ft("Tooltip"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Vt,{label:Ft("Trigger"),help:Ft("Determines the user interaction that causes the tooltip to be displayed."),value:n.tooltip.trigger?n.tooltip.trigger:"focus",options:r,onChange:function(t){n.tooltip.trigger=t,e.props.edit(n)}}),wp.element.createElement(Vt,{label:Ft("Show Color Code"),help:Ft("If set to yes, will show colored squares next to the slice information in the tooltip."),value:n.tooltip.showColorCode?n.tooltip.showColorCode:"0",options:[{label:Ft("Yes"),value:"1"},{label:Ft("No"),value:"0"}],onChange:function(t){n.tooltip.showColorCode=t,e.props.edit(n)}}),0<=["pie"].indexOf(t)&&wp.element.createElement(Vt,{label:Ft("Text"),help:Ft("Determines what information to display when the user hovers over a pie slice."),value:n.tooltip.text?n.tooltip.text:"both",options:[{label:Ft("Display both the absolute value of the slice and the percentage of the whole"),value:"both"},{label:Ft("Display only the absolute value of the slice"),value:"value"},{label:Ft("Display only the percentage of the whole represented by the slice"),value:"percentage"}],onChange:function(t){n.tooltip.text=t,e.props.edit(n)}})),-1>=["table","gauge","geo","pie","timeline","dataTable"].indexOf(t)&&wp.element.createElement(Ut,{title:Ft("Animation"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Bt,{label:Ft("Animate on startup?"),help:Ft("Determines if the chart will animate on the initial draw."),checked:Number(n.animation.startup),onChange:function(t){n.animation.startup=t?"1":"0",e.props.edit(n)}}),wp.element.createElement(Jt,{label:Ft("Duration"),help:Ft("The duration of the animation, in milliseconds."),type:"number",value:n.animation.duration,onChange:function(t){n.animation.duration=t,e.props.edit(n)}}),wp.element.createElement(Vt,{label:Ft("Easing"),help:Ft("The easing function applied to the animation."),value:n.animation.easing?n.animation.easing:"linear",options:[{label:Ft("Constant speed"),value:"linear"},{label:Ft("Start slow and speed up"),value:"in"},{label:Ft("Start fast and slow down"),value:"out"},{label:Ft("Start slow, speed up, then slow down"),value:"inAndOut"}],onChange:function(t){n.animation.easing=t,e.props.edit(n)}})))}}])&&Ht(n.prototype,r),a&&Ht(n,a),t}(Wt);function qt(e){return(qt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Kt(e,t){return!t||"object"!==qt(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Zt(e){return(Zt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Qt(e,t){return(Qt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Xt=wp.i18n.__,en=wp.element,tn=en.Component,nn=en.Fragment,rn=wp.editor.ColorPalette,an=wp.components,on=an.BaseControl,sn=an.ExternalLink,ln=an.PanelBody,un=an.SelectControl,cn=an.TextControl,dn=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Kt(this,Zt(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Qt(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(ln,{title:Xt("Horizontal Axis Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(ln,{title:Xt("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(cn,{label:Xt("Axis Title"),help:Xt("The title of the horizontal axis."),value:n.hAxis.title,onChange:function(t){n.hAxis.title=t,e.props.edit(n)}}),wp.element.createElement(un,{label:Xt("Text Position"),help:Xt("Position of the horizontal axis text, relative to the chart area."),value:n.hAxis.textPosition?n.hAxis.textPosition:"out",options:[{label:Xt("Inside the chart"),value:"in"},{label:Xt("Outside the chart"),value:"out"},{label:Xt("None"),value:"none"}],onChange:function(t){n.hAxis.textPosition=t,e.props.edit(n)}}),wp.element.createElement(un,{label:Xt("Direction"),help:Xt("The direction in which the values along the horizontal axis grow."),value:n.hAxis.direction?n.hAxis.direction:"1",options:[{label:Xt("Identical Direction"),value:"1"},{label:Xt("Reverse Direction"),value:"-1"}],onChange:function(t){n.hAxis.direction=t,e.props.edit(n)}}),wp.element.createElement(on,{label:Xt("Base Line Color")},wp.element.createElement(rn,{value:n.hAxis.baselineColor,onChange:function(t){n.hAxis.baselineColor=t,e.props.edit(n)}})),wp.element.createElement(on,{label:Xt("Axis Text Color")},wp.element.createElement(rn,{value:n.hAxis.textStyle.color||n.hAxis.textStyle,onChange:function(t){n.hAxis.textStyle={},n.hAxis.textStyle.color=t,e.props.edit(n)}})),-1>=["column"].indexOf(t)&&wp.element.createElement(nn,null,wp.element.createElement(cn,{label:Xt("Number Format"),help:Xt("Enter custom format pattern to apply to horizontal axis labels."),value:n.hAxis.format,onChange:function(t){n.hAxis.format=t,e.props.edit(n)}}),wp.element.createElement("p",null,Xt("For number axis labels, this is a subset of the formatting "),wp.element.createElement(sn,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},Xt("ICU pattern set.")),Xt(" For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #%% percentage format then your values will be multiplied by 100.")),wp.element.createElement("p",null,Xt("For date axis labels, this is a subset of the date formatting "),wp.element.createElement(sn,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},Xt("ICU date and time format."))))),-1>=["column"].indexOf(t)&&wp.element.createElement(nn,null,wp.element.createElement(ln,{title:Xt("Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(cn,{label:Xt("Count"),help:Xt("The number of horizontal gridlines inside the chart area. Minimum value is 2. Specify -1 to automatically compute the number of gridlines."),value:n.hAxis.gridlines?n.hAxis.gridlines.count:"",onChange:function(t){n.hAxis.gridlines||(n.hAxis.gridlines={}),n.hAxis.gridlines.count=t,e.props.edit(n)}}),wp.element.createElement(on,{label:Xt("Color")},wp.element.createElement(rn,{value:n.hAxis.gridlines?n.hAxis.gridlines.color:"",onChange:function(t){n.hAxis.gridlines||(n.hAxis.gridlines={}),n.hAxis.gridlines.color=t,e.props.edit(n)}}))),wp.element.createElement(ln,{title:Xt("Minor Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(cn,{label:Xt("Count"),help:Xt("The number of horizontal minor gridlines between two regular gridlines."),value:n.hAxis.minorGridlines.count,onChange:function(t){n.hAxis.minorGridlines.count=t,e.props.edit(n)}}),wp.element.createElement(on,{label:Xt("Color")},wp.element.createElement(rn,{value:n.hAxis.minorGridlines.color,onChange:function(t){n.hAxis.minorGridlines.color=t,e.props.edit(n)}}))),wp.element.createElement(ln,{title:Xt("View Window"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(cn,{label:Xt("Maximun Value"),help:Xt("The maximum vertical data value to render."),value:n.hAxis.viewWindow.max,onChange:function(t){n.hAxis.viewWindow.max=t,e.props.edit(n)}}),wp.element.createElement(cn,{label:Xt("Minimum Value"),help:Xt("The minimum vertical data value to render."),value:n.hAxis.viewWindow.min,onChange:function(t){n.hAxis.viewWindow.min=t,e.props.edit(n)}}))))}}])&&$t(n.prototype,r),a&&$t(n,a),t}(tn);function mn(e){return(mn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function hn(e,t){return!t||"object"!==mn(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function _n(e){return(_n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function fn(e,t){return(fn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var yn=wp.i18n.__,gn=wp.element,bn=gn.Component,vn=gn.Fragment,Mn=wp.editor.ColorPalette,wn=wp.components,kn=wn.BaseControl,Ln=wn.ExternalLink,Yn=wn.PanelBody,Dn=wn.SelectControl,Tn=wn.TextControl,Sn=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),hn(this,_n(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&fn(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(Yn,{title:yn("Vertical Axis Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Yn,{title:yn("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Tn,{label:yn("Axis Title"),help:yn("The title of the Vertical axis."),value:n.vAxis.title,onChange:function(t){n.vAxis.title=t,e.props.edit(n)}}),wp.element.createElement(Dn,{label:yn("Text Position"),help:yn("Position of the Vertical axis text, relative to the chart area."),value:n.vAxis.textPosition?n.vAxis.textPosition:"out",options:[{label:yn("Inside the chart"),value:"in"},{label:yn("Outside the chart"),value:"out"},{label:yn("None"),value:"none"}],onChange:function(t){n.vAxis.textPosition=t,e.props.edit(n)}}),wp.element.createElement(Dn,{label:yn("Direction"),help:yn("The direction in which the values along the Vertical axis grow."),value:n.vAxis.direction?n.vAxis.direction:"1",options:[{label:yn("Identical Direction"),value:"1"},{label:yn("Reverse Direction"),value:"-1"}],onChange:function(t){n.vAxis.direction=t,e.props.edit(n)}}),wp.element.createElement(kn,{label:yn("Base Line Color")},wp.element.createElement(Mn,{value:n.vAxis.baselineColor,onChange:function(t){n.vAxis.baselineColor=t,e.props.edit(n)}})),wp.element.createElement(kn,{label:yn("Axis Text Color")},wp.element.createElement(Mn,{value:n.vAxis.textStyle.color||n.vAxis.textStyle,onChange:function(t){n.vAxis.textStyle={},n.vAxis.textStyle.color=t,e.props.edit(n)}})),-1>=["column"].indexOf(t)&&wp.element.createElement(vn,null,wp.element.createElement(Tn,{label:yn("Number Format"),help:yn("Enter custom format pattern to apply to Vertical axis labels."),value:n.vAxis.format,onChange:function(t){n.vAxis.format=t,e.props.edit(n)}}),wp.element.createElement("p",null,yn("For number axis labels, this is a subset of the formatting "),wp.element.createElement(Ln,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},yn("ICU pattern set.")),yn(" For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #%% percentage format then your values will be multiplied by 100.")),wp.element.createElement("p",null,yn("For date axis labels, this is a subset of the date formatting "),wp.element.createElement(Ln,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},yn("ICU date and time format."))))),-1>=["bar"].indexOf(t)&&wp.element.createElement(vn,null,wp.element.createElement(Yn,{title:yn("Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Tn,{label:yn("Count"),help:yn("The number of Vertical gridlines inside the chart area. Minimum value is 2. Specify -1 to automatically compute the number of gridlines."),value:n.vAxis.gridlines?n.vAxis.gridlines.count:"",onChange:function(t){n.vAxis.gridlines||(n.vAxis.gridlines={}),n.vAxis.gridlines.count=t,e.props.edit(n)}}),wp.element.createElement(kn,{label:yn("Color")},wp.element.createElement(Mn,{value:n.vAxis.gridlines?n.vAxis.gridlines.color:"",onChange:function(t){n.vAxis.gridlines||(n.vAxis.gridlines={}),n.vAxis.gridlines.color=t,e.props.edit(n)}}))),wp.element.createElement(Yn,{title:yn("Minor Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Tn,{label:yn("Count"),help:yn("The number of Vertical minor gridlines between two regular gridlines."),value:n.vAxis.minorGridlines.count,onChange:function(t){n.vAxis.minorGridlines.count=t,e.props.edit(n)}}),wp.element.createElement(kn,{label:yn("Color")},wp.element.createElement(Mn,{value:n.vAxis.minorGridlines.color,onChange:function(t){n.vAxis.minorGridlines.color=t,e.props.edit(n)}}))),wp.element.createElement(Yn,{title:yn("View Window"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Tn,{label:yn("Maximun Value"),help:yn("The maximum vertical data value to render."),value:n.vAxis.viewWindow.max,onChange:function(t){n.vAxis.viewWindow.max=t,e.props.edit(n)}}),wp.element.createElement(Tn,{label:yn("Minimum Value"),help:yn("The minimum vertical data value to render."),value:n.vAxis.viewWindow.min,onChange:function(t){n.vAxis.viewWindow.min=t,e.props.edit(n)}}))))}}])&&pn(n.prototype,r),a&&pn(n,a),t}(bn);function On(e){return(On="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function jn(e,t){return!t||"object"!==On(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function En(e){return(En=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Cn(e,t){return(Cn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Hn=wp.i18n.__,Pn=wp.element,An=Pn.Component,zn=Pn.Fragment,Fn=wp.editor.ColorPalette,Wn=wp.components,Nn=Wn.BaseControl,Rn=Wn.ExternalLink,In=Wn.PanelBody,Bn=Wn.SelectControl,Un=Wn.TextControl,Vn=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),jn(this,En(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Cn(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(In,{title:Hn("Pie Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(zn,null,wp.element.createElement(Un,{label:Hn("Number Format"),help:Hn("Enter custom format pattern to apply to chart labels."),value:t.format,onChange:function(n){t.format=n,e.props.edit(t)}}),wp.element.createElement("p",null,Hn("For number axis labels, this is a subset of the formatting "),wp.element.createElement(Rn,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},Hn("ICU pattern set.")),Hn(" For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #%% percentage format then your values will be multiplied by 100.")),wp.element.createElement("p",null,Hn("For date axis labels, this is a subset of the date formatting "),wp.element.createElement(Rn,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},Hn("ICU date and time format.")))),wp.element.createElement(Bn,{label:Hn("Is 3D"),help:Hn("If set to yes, displays a three-dimensional chart."),value:t.is3D?t.is3D:"0",options:[{label:Hn("Yes"),value:"1"},{label:Hn("No"),value:"0"}],onChange:function(n){t.is3D=n,e.props.edit(t)}}),wp.element.createElement(Bn,{label:Hn("Reverse Categories"),help:Hn("If set to yes, will draw slices counterclockwise."),value:t.reverseCategories?t.reverseCategories:"0",options:[{label:Hn("Yes"),value:"1"},{label:Hn("No"),value:"0"}],onChange:function(n){t.reverseCategories=n,e.props.edit(t)}}),wp.element.createElement(Bn,{label:Hn("Slice Text"),help:Hn("The content of the text displayed on the slice."),value:t.pieSliceText?t.pieSliceText:"percentage",options:[{label:Hn("The percentage of the slice size out of the total"),value:"percentage"},{label:Hn("The quantitative value of the slice"),value:"value"},{label:Hn("The name of the slice"),value:"label"},{label:Hn("The quantitative value and percentage of the slice"),value:"value-and-percentage"},{label:Hn("No text is displayed"),value:"none"}],onChange:function(n){t.pieSliceText=n,e.props.edit(t)}}),wp.element.createElement(Un,{label:Hn("Pie Hole"),help:Hn("If between 0 and 1, displays a donut chart. The hole with have a radius equal to number times the radius of the chart. Only applicable when the chart is two-dimensional."),placeholder:Hn("0.5"),value:t.pieHole,onChange:function(n){t.pieHole=n,e.props.edit(t)}}),wp.element.createElement(Un,{label:Hn("Start Angle"),help:Hn("The angle, in degrees, to rotate the chart by. The default of 0 will orient the leftmost edge of the first slice directly up."),value:t.pieStartAngle,onChange:function(n){t.pieStartAngle=n,e.props.edit(t)}}),wp.element.createElement(Nn,{label:Hn("Slice Border Color")},wp.element.createElement(Fn,{value:t.pieSliceBorderColor,onChange:function(n){t.pieSliceBorderColor=n,e.props.edit(t)}})))}}])&&xn(n.prototype,r),a&&xn(n,a),t}(An);function Jn(e){return(Jn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Gn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function qn(e,t){return!t||"object"!==Jn(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function $n(e){return($n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Kn(e,t){return(Kn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Zn=wp.i18n.__,Qn=wp.element.Component,Xn=wp.editor.ColorPalette,er=wp.components,tr=er.BaseControl,nr=er.PanelBody,rr=er.TextControl,ar=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),qn(this,$n(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Kn(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(nr,{title:Zn("Residue Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(rr,{label:Zn("Visibility Threshold"),help:Zn("The slice relative part, below which a slice will not show individually. All slices that have not passed this threshold will be combined to a single slice, whose size is the sum of all their sizes. Default is not to show individually any slice which is smaller than half a degree."),placeholder:Zn("0.001388889"),value:t.sliceVisibilityThreshold,onChange:function(n){t.sliceVisibilityThreshold=n,e.props.edit(t)}}),wp.element.createElement(rr,{label:Zn("Residue Slice Label"),help:Zn("A label for the combination slice that holds all slices below slice visibility threshold."),value:t.pieResidueSliceLabel,onChange:function(n){t.pieResidueSliceLabel=n,e.props.edit(t)}}),wp.element.createElement(tr,{label:Zn("Residue Slice Color")},wp.element.createElement(Xn,{value:t.pieResidueSliceColor,onChange:function(n){t.pieResidueSliceColor=n,e.props.edit(t)}})))}}])&&Gn(n.prototype,r),a&&Gn(n,a),t}(Qn);function ir(e){return(ir="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function or(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function sr(e,t){return!t||"object"!==ir(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function lr(e){return(lr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ur(e,t){return(ur=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var cr=wp.i18n.__,dr=wp.element,mr=dr.Component,pr=dr.Fragment,hr=wp.components,_r=hr.PanelBody,fr=hr.SelectControl,yr=hr.TextControl,gr=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),sr(this,lr(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ur(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(_r,{title:cr("Lines Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(yr,{label:cr("Line Width"),help:cr("Data line width in pixels. Use zero to hide all lines."),value:n.lineWidth,onChange:function(t){n.lineWidth=t,e.props.edit(n)}}),wp.element.createElement(yr,{label:cr("Point Size"),help:cr("Diameter of displayed points in pixels. Use zero to hide all the points."),value:n.pointSize,onChange:function(t){n.pointSize=t,e.props.edit(n)}}),-1>=["area"].indexOf(t)&&wp.element.createElement(fr,{label:cr("Curve Type"),help:cr("Determines whether the series has to be presented in the legend or not."),value:n.curveType?n.curveType:"none",options:[{label:cr("Straight line without curve"),value:"none"},{label:cr("The angles of the line will be smoothed"),value:"function"}],onChange:function(t){n.curveType=t,e.props.edit(n)}}),-1>=["scatter"].indexOf(t)&&wp.element.createElement(fr,{label:cr("Focus Target"),help:cr("The type of the entity that receives focus on mouse hover. Also affects which entity is selected by mouse click."),value:n.focusTarget?n.focusTarget:"datum",options:[{label:cr("Focus on a single data point."),value:"datum"},{label:cr("Focus on a grouping of all data points along the major axis."),value:"category"}],onChange:function(t){n.focusTarget=t,e.props.edit(n)}}),wp.element.createElement(fr,{label:cr("Selection Mode"),help:cr("Determines how many data points an user can select on a chart."),value:n.selectionMode?n.selectionMode:"single",options:[{label:cr("Single data point"),value:"single"},{label:cr("Multiple data points"),value:"multiple"}],onChange:function(t){n.selectionMode=t,e.props.edit(n)}}),wp.element.createElement(fr,{label:cr("Aggregation Target"),help:cr("Determines how multiple data selections are rolled up into tooltips. To make it working you need to set multiple selection mode and tooltip trigger to display it when an user selects an element."),value:n.aggregationTarget?n.aggregationTarget:"auto",options:[{label:cr("Group selected data by x-value"),value:"category"},{label:cr("Group selected data by series"),value:"series"},{label:cr("Group selected data by x-value if all selections have the same x-value, and by series otherwise"),value:"auto"},{label:cr("Show only one tooltip per selection"),value:"none"}],onChange:function(t){n.aggregationTarget=t,e.props.edit(n)}}),wp.element.createElement(yr,{label:cr("Point Opacity"),help:cr("The transparency of data points, with 1.0 being completely opaque and 0.0 fully transparent."),value:n.dataOpacity,onChange:function(t){n.dataOpacity=t,e.props.edit(n)}}),-1>=["scatter","line"].indexOf(t)&&wp.element.createElement(pr,null,wp.element.createElement(yr,{label:cr("Area Opacity"),help:cr("The default opacity of the colored area under an area chart series, where 0.0 is fully transparent and 1.0 is fully opaque. To specify opacity for an individual series, set the area opacity value in the series property."),value:n.areaOpacity,onChange:function(t){n.areaOpacity=t,e.props.edit(n)}}),wp.element.createElement(fr,{label:cr("Is Stacked"),help:cr("If set to yes, series elements are stacked."),value:n.isStacked?n.isStacked:"0",options:[{label:cr("Yes"),value:"1"},{label:cr("No"),value:"0"}],onChange:function(t){n.isStacked=t,e.props.edit(n)}})),-1>=["scatter","area"].indexOf(t)&&wp.element.createElement(fr,{label:cr("Interpolate Nulls"),help:cr("Whether to guess the value of missing points. If yes, it will guess the value of any missing data based on neighboring points. If no, it will leave a break in the line at the unknown point."),value:n.interpolateNulls?n.interpolateNulls:"0",options:[{label:cr("Yes"),value:"1"},{label:cr("No"),value:"0"}],onChange:function(t){n.interpolateNulls=t,e.props.edit(n)}}))}}])&&or(n.prototype,r),a&&or(n,a),t}(mr);function br(e){return(br="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function vr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Mr(e,t){return!t||"object"!==br(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function wr(e){return(wr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function kr(e,t){return(kr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Lr=wp.i18n.__,Yr=wp.element.Component,Dr=wp.components,Tr=Dr.PanelBody,Sr=Dr.SelectControl,Or=Dr.TextControl,xr=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Mr(this,wr(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&kr(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Tr,{title:Lr("Bars Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Sr,{label:Lr("Focus Target"),help:Lr("The type of the entity that receives focus on mouse hover. Also affects which entity is selected by mouse click."),value:t.focusTarget?t.focusTarget:"datum",options:[{label:Lr("Focus on a single data point."),value:"datum"},{label:Lr("Focus on a grouping of all data points along the major axis."),value:"category"}],onChange:function(n){t.focusTarget=n,e.props.edit(t)}}),wp.element.createElement(Sr,{label:Lr("Is Stacked"),help:Lr("If set to yes, series elements are stacked."),value:t.isStacked?t.isStacked:"0",options:[{label:Lr("Yes"),value:"1"},{label:Lr("No"),value:"0"}],onChange:function(n){t.isStacked=n,e.props.edit(t)}}),wp.element.createElement(Or,{label:Lr("Bars Opacity"),help:Lr("Bars transparency, with 1.0 being completely opaque and 0.0 fully transparent."),value:t.dataOpacity,onChange:function(n){t.dataOpacity=n,e.props.edit(t)}}))}}])&&vr(n.prototype,r),a&&vr(n,a),t}(Yr);function jr(e){return(jr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Er(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Cr(e,t){return!t||"object"!==jr(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Hr(e){return(Hr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Pr(e,t){return(Pr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ar=wp.i18n.__,zr=wp.element.Component,Fr=wp.editor.ColorPalette,Wr=wp.components,Nr=Wr.BaseControl,Rr=Wr.PanelBody,Ir=Wr.SelectControl,Br=Wr.TextControl,Ur=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Cr(this,Hr(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Pr(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Rr,{title:Ar("Candles Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Rr,{title:Ar("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Ir,{label:Ar("Focus Target"),help:Ar("The type of the entity that receives focus on mouse hover. Also affects which entity is selected by mouse click."),value:t.focusTarget?t.focusTarget:"datum",options:[{label:Ar("Focus on a single data point."),value:"datum"},{label:Ar("Focus on a grouping of all data points along the major axis."),value:"category"}],onChange:function(n){t.focusTarget=n,e.props.edit(t)}}),wp.element.createElement(Ir,{label:Ar("Selection Mode"),help:Ar("Determines how many data points an user can select on a chart."),value:t.selectionMode?t.selectionMode:"single",options:[{label:Ar("Single data point"),value:"single"},{label:Ar("Multiple data points"),value:"multiple"}],onChange:function(n){t.selectionMode=n,e.props.edit(t)}}),wp.element.createElement(Ir,{label:Ar("Aggregation Target"),help:Ar("Determines how multiple data selections are rolled up into tooltips. To make it working you need to set multiple selection mode and tooltip trigger to display it when an user selects an element."),value:t.aggregationTarget?t.aggregationTarget:"auto",options:[{label:Ar("Group selected data by x-value"),value:"category"},{label:Ar("Group selected data by series"),value:"series"},{label:Ar("Group selected data by x-value if all selections have the same x-value, and by series otherwise"),value:"auto"},{label:Ar("Show only one tooltip per selection"),value:"none"}],onChange:function(n){t.aggregationTarget=n,e.props.edit(t)}})),wp.element.createElement(Rr,{title:Ar("Failing Candles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Br,{label:Ar("Stroke Width"),help:Ar("The stroke width of falling candles."),value:t.candlestick.fallingColor.strokeWidth,onChange:function(n){t.candlestick.fallingColor.strokeWidth=n,e.props.edit(t)}}),wp.element.createElement(Nr,{label:Ar("Stroke Color")},wp.element.createElement(Fr,{value:t.candlestick.fallingColor.stroke,onChange:function(n){t.candlestick.fallingColor.stroke=n,e.props.edit(t)}})),wp.element.createElement(Nr,{label:Ar("Fill Color")},wp.element.createElement(Fr,{value:t.candlestick.fallingColor.fill,onChange:function(n){t.candlestick.fallingColor.fill=n,e.props.edit(t)}}))),wp.element.createElement(Rr,{title:Ar("Rising Candles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Br,{label:Ar("Stroke Width"),help:Ar("The stroke width of rising candles."),value:t.candlestick.risingColor.strokeWidth,onChange:function(n){t.candlestick.risingColor.strokeWidth=n,e.props.edit(t)}}),wp.element.createElement(Nr,{label:Ar("Stroke Color")},wp.element.createElement(Fr,{value:t.candlestick.risingColor.stroke,onChange:function(n){t.candlestick.risingColor.stroke=n,e.props.edit(t)}})),wp.element.createElement(Nr,{label:Ar("Fill Color")},wp.element.createElement(Fr,{value:t.candlestick.risingColor.fill,onChange:function(n){t.candlestick.risingColor.fill=n,e.props.edit(t)}}))))}}])&&Er(n.prototype,r),a&&Er(n,a),t}(zr);function Vr(e){return(Vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Jr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Gr(e,t){return!t||"object"!==Vr(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function qr(e){return(qr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function $r(e,t){return($r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Kr=wp.i18n.__,Zr=wp.element.Component,Qr=wp.components,Xr=Qr.ExternalLink,ea=Qr.PanelBody,ta=Qr.SelectControl,na=Qr.TextControl,ra=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Gr(this,qr(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&$r(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(ea,{title:Kr("Map Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(ea,{title:Kr("API"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(na,{label:Kr("API Key"),help:Kr("Add the Google Maps API key."),value:t.map_api_key,onChange:function(n){t.map_api_key=n,e.props.edit(t)}}),wp.element.createElement(Xr,{href:"https://developers.google.com/maps/documentation/javascript/get-api-key"},Kr("Get API Keys"))),wp.element.createElement(ea,{title:Kr("Region"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,Kr("A map of the entire world using 'world'.")),wp.element.createElement("li",null,Kr("A continent or a sub-continent, specified by its 3-digit code, e.g., '011' for Western Africa. "),wp.element.createElement(Xr,{href:"https://google-developers.appspot.com/chart/interactive/docs/gallery/geochart#Continent_Hierarchy"},Kr("More info here."))),wp.element.createElement("li",null,Kr("A country, specified by its ISO 3166-1 alpha-2 code, e.g., 'AU' for Australia. "),wp.element.createElement(Xr,{href:"http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2"},Kr("More info here."))),wp.element.createElement("li",null,Kr("A state in the United States, specified by its ISO 3166-2:US code, e.g., 'US-AL' for Alabama. Note that the resolution option must be set to either 'provinces' or 'metros'. "),wp.element.createElement(Xr,{href:"http://en.wikipedia.org/wiki/ISO_3166-2:US"},Kr("More info here.")))),wp.element.createElement(na,{label:Kr("Reigion"),help:Kr("Configure the region area to display on the map. (Surrounding areas will be displayed as well.)"),value:t.region,onChange:function(n){t.region=n,e.props.edit(t)}})),wp.element.createElement(ea,{title:Kr("Resolution"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,Kr("'countries' - Supported for all regions, except for US state regions.")),wp.element.createElement("li",null,Kr("'provinces' - Supported only for country regions and US state regions. Not supported for all countries; please test a country to see whether this option is supported.")),wp.element.createElement("li",null,Kr("'metros' - Supported for the US country region and US state regions only."))),wp.element.createElement(ta,{label:Kr("Resolution"),help:Kr("The resolution of the map borders."),value:t.resolution?t.resolution:"countries",options:[{label:Kr("Countries"),value:"countries"},{label:Kr("Provinces"),value:"provinces"},{label:Kr("Metros"),value:"metros"}],onChange:function(n){t.resolution=n,e.props.edit(t)}})),wp.element.createElement(ea,{title:Kr("Display Mode"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,Kr("'auto' - Choose based on the format of the data.")),wp.element.createElement("li",null,Kr("'regions' - This is a region map.")),wp.element.createElement("li",null,Kr("'markers' - This is a marker map."))),wp.element.createElement(ta,{label:Kr("Display Mode"),help:Kr("Determines which type of map this is."),value:t.displayMode?t.displayMode:"auto",options:[{label:Kr("Auto"),value:"auto"},{label:Kr("Regions"),value:"regions"},{label:Kr("Markers"),value:"markers"}],onChange:function(n){t.displayMode=n,e.props.edit(t)}})),wp.element.createElement(ea,{title:Kr("Tooltip"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ta,{label:Kr("Trigger"),help:Kr("Determines the user interaction that causes the tooltip to be displayed."),value:t.tooltip.trigger?t.tooltip.trigger:"focus",options:[{label:Kr("The tooltip will be displayed when the user hovers over an element"),value:"focus"},{label:Kr("The tooltip will not be displayed"),value:"none"}],onChange:function(n){t.tooltip.trigger=n,e.props.edit(t)}})))}}])&&Jr(n.prototype,r),a&&Jr(n,a),t}(Zr);function aa(e){return(aa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ia(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function oa(e,t){return!t||"object"!==aa(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function sa(e){return(sa=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function la(e,t){return(la=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ua=wp.i18n.__,ca=wp.element.Component,da=wp.editor.ColorPalette,ma=wp.components,pa=ma.BaseControl,ha=ma.PanelBody,_a=ma.TextControl,fa=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),oa(this,sa(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&la(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(ha,{title:ua("Color Axis"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(_a,{label:ua("Minimum Values"),help:ua("Determines the minimum values of color axis."),value:t.colorAxis.minValue,onChange:function(n){t.colorAxis.minValue=n,e.props.edit(t)}}),wp.element.createElement(_a,{label:ua("Maximum Values"),help:ua("Determines the maximum values of color axis."),value:t.colorAxis.maxValue,onChange:function(n){t.colorAxis.maxValue=n,e.props.edit(t)}}),wp.element.createElement(pa,{label:ua("Minimum Value")},wp.element.createElement(da,{value:t.colorAxis.colors[0],onChange:function(n){t.colorAxis.colors[0]=n,e.props.edit(t)}})),wp.element.createElement(pa,{label:ua("Intermediate Value")},wp.element.createElement(da,{value:t.colorAxis.colors[1],onChange:function(n){t.colorAxis.colors[1]=n,e.props.edit(t)}})),wp.element.createElement(pa,{label:ua("Maximum Value")},wp.element.createElement(da,{value:t.colorAxis.colors[2],onChange:function(n){t.colorAxis.colors[2]=n,e.props.edit(t)}})),wp.element.createElement(pa,{label:ua("Dateless Region")},wp.element.createElement(da,{value:t.datalessRegionColor,onChange:function(n){t.datalessRegionColor=n,e.props.edit(t)}})))}}])&&ia(n.prototype,r),a&&ia(n,a),t}(ca);function ya(e){return(ya="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ga(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ba(e,t){return!t||"object"!==ya(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function va(e){return(va=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ma(e,t){return(Ma=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var wa=wp.i18n.__,ka=wp.element,La=ka.Component,Ya=ka.Fragment,Da=wp.components,Ta=Da.ExternalLink,Sa=Da.PanelBody,Oa=Da.TextControl,xa=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ba(this,va(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ma(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Sa,{title:wa("Size Axis"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Oa,{label:wa("Minimum Values"),help:wa("Determines the minimum values of size axis."),value:t.sizeAxis.minValue,onChange:function(n){t.sizeAxis.minValue=n,e.props.edit(t)}}),wp.element.createElement(Oa,{label:wa("Maximum Values"),help:wa("Determines the maximum values of size axis."),value:t.sizeAxis.maxValue,onChange:function(n){t.sizeAxis.maxValue=n,e.props.edit(t)}}),wp.element.createElement(Oa,{label:wa("Minimum Marker Radius"),help:wa("Determines the radius of the smallest possible bubbles, in pixels."),value:t.sizeAxis.minSize,onChange:function(n){t.sizeAxis.minSize=n,e.props.edit(t)}}),wp.element.createElement(Oa,{label:wa("Maximum Marker Radius"),help:wa("Determines the radius of the largest possible bubbles, in pixels."),value:t.sizeAxis.maxSize,onChange:function(n){t.sizeAxis.maxSize=n,e.props.edit(t)}}),wp.element.createElement(Oa,{label:wa("Marker Opacity"),help:wa("The opacity of the markers, where 0.0 is fully transparent and 1.0 is fully opaque."),value:t.markerOpacity,onChange:function(n){t.markerOpacity=n,e.props.edit(t)}}),wp.element.createElement(Ya,null,wp.element.createElement(Oa,{label:wa("Number Format"),help:wa("Enter custom format pattern to apply to this series value."),value:t.series[0].format,onChange:function(n){t.series[0].format=n,e.props.edit(t)}}),wp.element.createElement("p",null,wa("For number axis labels, this is a subset of the formatting "),wp.element.createElement(Ta,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},wa("ICU pattern set.")),wa(" For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #%% percentage format then your values will be multiplied by 100."))))}}])&&ga(n.prototype,r),a&&ga(n,a),t}(La);function ja(e){return(ja="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ea(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ca(e,t){return!t||"object"!==ja(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ha(e){return(Ha=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Pa(e,t){return(Pa=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Aa=wp.i18n.__,za=wp.element.Component,Fa=wp.components,Wa=Fa.PanelBody,Na=Fa.SelectControl,Ra=Fa.TextControl,Ia=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Ca(this,Ha(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Pa(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Wa,{title:Aa("Magnifying Glass"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Na,{label:Aa("Enabled"),help:Aa("If yes, when the user lingers over a cluttered marker, a magnifiying glass will be opened."),value:t.magnifyingGlass.enable?t.magnifyingGlass.enable:"1",options:[{label:Aa("Yes"),value:"1"},{label:Aa("No"),value:"0"}],onChange:function(n){t.magnifyingGlass.enable=n,e.props.edit(t)}}),wp.element.createElement(Ra,{label:Aa("Zoom Factor"),help:Aa("The zoom factor of the magnifying glass. Can be any number greater than 0."),value:t.magnifyingGlass.zoomFactor,onChange:function(n){t.magnifyingGlass.zoomFactor=n,e.props.edit(t)}}))}}])&&Ea(n.prototype,r),a&&Ea(n,a),t}(za);function Ba(e){return(Ba="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ua(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Va(e,t){return!t||"object"!==Ba(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ja(e){return(Ja=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ga(e,t){return(Ga=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var qa=wp.i18n.__,$a=wp.element,Ka=$a.Component,Za=$a.Fragment,Qa=wp.editor.ColorPalette,Xa=wp.components,ei=Xa.BaseControl,ti=Xa.ExternalLink,ni=Xa.PanelBody,ri=Xa.TextControl,ai=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Va(this,Ja(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ga(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(ni,{title:qa("Gauge Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(ni,{title:qa("Tick Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ri,{label:qa("Minimum Values"),help:qa("Determines the minimum values of gauge."),value:t.min,onChange:function(n){t.min=n,e.props.edit(t)}}),wp.element.createElement(ri,{label:qa("Maximum Values"),help:qa("Determines the maximum values of gauge."),value:t.max,onChange:function(n){t.max=n,e.props.edit(t)}}),wp.element.createElement(ri,{label:qa("Minor Ticks"),help:qa("The number of minor tick section in each major tick section."),value:t.minorTicks,onChange:function(n){t.minorTicks=n,e.props.edit(t)}}),wp.element.createElement(Za,null,wp.element.createElement(ri,{label:qa("Number Format"),help:qa("Enter custom format pattern to apply to this series value."),value:t.series[0].format,onChange:function(n){t.series[0].format=n,e.props.edit(t)}}),wp.element.createElement("p",null,qa("For number axis labels, this is a subset of the formatting "),wp.element.createElement(ti,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},qa("ICU pattern set.")),qa(" For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #%% percentage format then your values will be multiplied by 100.")))),wp.element.createElement(ni,{title:qa("Green Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ri,{label:qa("Minimum Range"),help:qa("The lowest values for a range marked by a green color."),value:t.greenFrom,onChange:function(n){t.greenFrom=n,e.props.edit(t)}}),wp.element.createElement(ri,{label:qa("Maximum Range"),help:qa("The highest values for a range marked by a green color."),value:t.greenTo,onChange:function(n){t.greenTo=n,e.props.edit(t)}}),wp.element.createElement(ei,{label:qa("Green Color")},wp.element.createElement(Qa,{value:t.greenColor,onChange:function(n){t.greenColor=n,e.props.edit(t)}}))),wp.element.createElement(ni,{title:qa("Yellow Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ri,{label:qa("Minimum Range"),help:qa("The lowest values for a range marked by a yellow color."),value:t.yellowFrom,onChange:function(n){t.yellowFrom=n,e.props.edit(t)}}),wp.element.createElement(ri,{label:qa("Maximum Range"),help:qa("The highest values for a range marked by a yellow color."),value:t.yellowTo,onChange:function(n){t.yellowTo=n,e.props.edit(t)}}),wp.element.createElement(ei,{label:qa("Yellow Color")},wp.element.createElement(Qa,{value:t.yellowColor,onChange:function(n){t.yellowColor=n,e.props.edit(t)}}))),wp.element.createElement(ni,{title:qa("Red Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ri,{label:qa("Minimum Range"),help:qa("The lowest values for a range marked by a red color."),value:t.redFrom,onChange:function(n){t.redFrom=n,e.props.edit(t)}}),wp.element.createElement(ri,{label:qa("Maximum Range"),help:qa("The highest values for a range marked by a red color."),value:t.redTo,onChange:function(n){t.redTo=n,e.props.edit(t)}}),wp.element.createElement(ei,{label:qa("Red Color")},wp.element.createElement(Qa,{value:t.redColor,onChange:function(n){t.redColor=n,e.props.edit(t)}}))))}}])&&Ua(n.prototype,r),a&&Ua(n,a),t}(Ka);function ii(e){return(ii="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function oi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function si(e){return(si=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function li(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ui(e,t){return(ui=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ci=wp.i18n.__,di=wp.element.Component,mi=wp.editor.ColorPalette,pi=wp.components,hi=pi.BaseControl,_i=pi.CheckboxControl,fi=pi.PanelBody,yi=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==ii(t)&&"function"!=typeof t?li(e):t}(this,si(t).apply(this,arguments))).mapValues=e.mapValues.bind(li(e)),e}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ui(e,t)}(t,e),n=t,(r=[{key:"mapValues",value:function(e,t){return void 0===e.timeline?e[t]:e.timeline[t]}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return this.mapValues(t,"showRowLabels"),wp.element.createElement(fi,{title:ci("Timeline Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(_i,{label:ci("Show Row Label"),help:ci("If checked, shows the category/row label."),checked:Number(this.mapValues(t,"showRowLabels")),onChange:function(n){void 0===t.timeline&&(t.timeline={}),t.timeline.showRowLabels=!Number(e.mapValues(t,"showRowLabels")),e.props.edit(t)}}),wp.element.createElement(_i,{label:ci("Group by Row Label"),help:ci("If checked, groups the bars on the basis of the category/row label."),checked:Number(this.mapValues(t,"groupByRowLabel")),onChange:function(n){void 0===t.timeline&&(t.timeline={}),t.timeline.groupByRowLabel=!Number(e.mapValues(t,"groupByRowLabel")),e.props.edit(t)}}),wp.element.createElement(_i,{label:ci("Color by Row Label"),help:ci("If checked, colors every bar on the row the same."),checked:Number(this.mapValues(t,"colorByRowLabel")),onChange:function(n){void 0===t.timeline&&(t.timeline={}),t.timeline.colorByRowLabel=!Number(e.mapValues(t,"colorByRowLabel")),e.props.edit(t)}}),wp.element.createElement(hi,{label:ci("Single Color")},wp.element.createElement(mi,{value:this.mapValues(t,"singleColor"),onChange:function(n){void 0===t.timeline&&(t.timeline={}),t.timeline.singleColor=n,e.props.edit(t)}})))}}])&&oi(n.prototype,r),a&&oi(n,a),t}(di);function gi(e){return(gi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function vi(e,t){return!t||"object"!==gi(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Mi(e){return(Mi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function wi(e,t){return(wi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ki=wp.i18n.__,Li=wp.element,Yi=Li.Component,Di=Li.Fragment,Ti=wp.components,Si=Ti.CheckboxControl,Oi=Ti.PanelBody,xi=Ti.SelectControl,ji=Ti.TextControl,Ei=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),vi(this,Mi(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&wi(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=this.props.chart["visualizer-chart-type"];return wp.element.createElement(Oi,{title:ki("Table Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},"dataTable"===n?wp.element.createElement(Di,null,wp.element.createElement(Si,{label:ki("Enable Pagination"),help:ki("To enable paging through the data."),checked:"true"===t.paging_bool,onChange:function(n){t.paging_bool="true",n||(t.paging_bool="false"),e.props.edit(t)}}),wp.element.createElement(ji,{label:ki("Number of rows per page"),help:ki("The number of rows in each page, when paging is enabled."),type:"number",value:t.pageLength_int,placeholder:10,onChange:function(n){t.pageLength_int=n,e.props.edit(t)}}),wp.element.createElement(xi,{label:ki("Pagination type"),help:ki("Determines what type of pagination options to show."),value:t.pagingType,options:[{label:ki("Page number buttons only"),value:"numbers"},{label:ki("'Previous' and 'Next' buttons only"),value:"simple"},{label:ki("'Previous' and 'Next' buttons, plus page numbers"),value:"simple_numbers"},{label:ki("'First', 'Previous', 'Next' and 'Last' buttons"),value:"full"},{label:ki("'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers"),value:"full_numbers"},{label:ki("'First' and 'Last' buttons, plus page numbers"),value:"first_last_numbers"}],onChange:function(n){t.pagingType=n,e.props.edit(t)}}),wp.element.createElement(Si,{label:ki("Scroll Collapse"),help:ki("Allow the table to reduce in height when a limited number of rows are shown."),checked:"true"===t.scrollCollapse_bool,onChange:function(n){t.scrollCollapse_bool="true",n||(t.scrollCollapse_bool="false"),e.props.edit(t)}}),"true"===t.scrollCollapse_bool&&wp.element.createElement(ji,{label:ki("Vertical Height"),help:ki("Vertical scrolling will constrain the table to the given height."),type:"number",value:t.scrollY_int,placeholder:300,onChange:function(n){t.scrollY_int=n,e.props.edit(t)}}),wp.element.createElement(Si,{label:ki("Disable Sort"),help:ki("To disable sorting on columns."),checked:"false"===t.ordering_bool,onChange:function(n){t.ordering_bool="true",n&&(t.ordering_bool="false"),e.props.edit(t)}}),wp.element.createElement(Si,{label:ki("Freeze Header/Footer"),help:ki("Freeze the header and footer."),checked:"true"===t.fixedHeader_bool,onChange:function(n){t.fixedHeader_bool="true",n||(t.fixedHeader_bool="false"),e.props.edit(t)}}),wp.element.createElement(Si,{label:ki("Responsive"),help:ki("Enable the table to be responsive."),checked:"true"===t.responsive_bool,onChange:function(n){t.responsive_bool="true",n||(t.responsive_bool="false"),e.props.edit(t)}})):wp.element.createElement(Di,null,wp.element.createElement(xi,{label:ki("Enable Pagination"),help:ki("To enable paging through the data."),value:t.page?t.page:"disable",options:[{label:ki("Enable"),value:"enable"},{label:ki("Disable"),value:"disable"}],onChange:function(n){t.page=n,e.props.edit(t)}}),wp.element.createElement(ji,{label:ki("Number of rows per page"),help:ki("The number of rows in each page, when paging is enabled."),type:"number",value:t.pageSize,onChange:function(n){t.pageSize=n,e.props.edit(t)}}),wp.element.createElement(xi,{label:ki("Disable Sort"),help:ki("To disable sorting on columns."),value:t.sort?t.sort:"enable",options:[{label:ki("Enable"),value:"enable"},{label:ki("Disable"),value:"disable"}],onChange:function(n){t.sort=n,e.props.edit(t)}}),wp.element.createElement(ji,{label:ki("Freeze Columns"),help:ki("The number of columns from the left that will be frozen."),type:"number",value:t.frozenColumns,onChange:function(n){t.frozenColumns=n,e.props.edit(t)}}),wp.element.createElement(Si,{label:ki("Allow HTML"),help:ki("If enabled, formatted values of cells that include HTML tags will be rendered as HTML."),checked:Number(t.allowHtml),onChange:function(n){t.allowHtml=!Number(t.allowHtml),e.props.edit(t)}}),wp.element.createElement(Si,{label:ki("Right to Left table"),help:ki("Adds basic support for right-to-left languages."),checked:Number(t.rtlTable),onChange:function(n){t.rtlTable=!Number(t.rtlTable),e.props.edit(t)}})))}}])&&bi(n.prototype,r),a&&bi(n,a),t}(Yi);function Ci(e){return(Ci="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Hi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Pi(e,t){return!t||"object"!==Ci(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ai(e){return(Ai=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function zi(e,t){return(zi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Fi=wp.i18n.__,Wi=wp.element,Ni=Wi.Component,Ri=Wi.Fragment,Ii=wp.editor.ColorPalette,Bi=wp.components,Ui=Bi.BaseControl,Vi=Bi.PanelBody,Ji=Bi.TextControl,Gi=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Pi(this,Ai(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&zi(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=this.props.chart["visualizer-chart-type"];return wp.element.createElement(Vi,{title:Fi("Row/Cell Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},"dataTable"===n?wp.element.createElement(Ri,null,wp.element.createElement(Vi,{title:Fi("Odd Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Ui,{label:Fi("Background Color")},wp.element.createElement(Ii,{value:t.customcss.oddTableRow["background-color"],onChange:function(n){t.customcss.oddTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(Ui,{label:Fi("Color")},wp.element.createElement(Ii,{value:t.customcss.oddTableRow.color,onChange:function(n){t.customcss.oddTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(Ji,{label:Fi("Text Orientation"),help:Fi("In degrees."),type:"number",value:t.customcss.oddTableRow.transform,onChange:function(n){t.customcss.oddTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(Vi,{title:Fi("Even Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Ui,{label:Fi("Background Color")},wp.element.createElement(Ii,{value:t.customcss.evenTableRow["background-color"],onChange:function(n){t.customcss.evenTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(Ui,{label:Fi("Color")},wp.element.createElement(Ii,{value:t.customcss.evenTableRow.color,onChange:function(n){t.customcss.evenTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(Ji,{label:Fi("Text Orientation"),help:Fi("In degrees."),type:"number",value:t.customcss.evenTableRow.transform,onChange:function(n){t.customcss.evenTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(Vi,{title:Fi("Table Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Ui,{label:Fi("Background Color")},wp.element.createElement(Ii,{value:t.customcss.tableCell["background-color"],onChange:function(n){t.customcss.tableCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(Ui,{label:Fi("Color")},wp.element.createElement(Ii,{value:t.customcss.tableCell.color,onChange:function(n){t.customcss.tableCell.color=n,e.props.edit(t)}})),wp.element.createElement(Ji,{label:Fi("Text Orientation"),help:Fi("In degrees."),type:"number",value:t.customcss.tableCell.transform,onChange:function(n){t.customcss.tableCell.transform=n,e.props.edit(t)}}))):wp.element.createElement(Ri,null,wp.element.createElement(Vi,{title:Fi("Header Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Ui,{label:Fi("Background Color")},wp.element.createElement(Ii,{value:t.customcss.headerRow["background-color"],onChange:function(n){t.customcss.headerRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(Ui,{label:Fi("Color")},wp.element.createElement(Ii,{value:t.customcss.headerRow.color,onChange:function(n){t.customcss.headerRow.color=n,e.props.edit(t)}})),wp.element.createElement(Ji,{label:Fi("Text Orientation"),help:Fi("In degrees."),type:"number",value:t.customcss.headerRow.transform,onChange:function(n){t.customcss.headerRow.transform=n,e.props.edit(t)}})),wp.element.createElement(Vi,{title:Fi("Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Ui,{label:Fi("Background Color")},wp.element.createElement(Ii,{value:t.customcss.tableRow["background-color"],onChange:function(n){t.customcss.tableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(Ui,{label:Fi("Color")},wp.element.createElement(Ii,{value:t.customcss.tableRow.color,onChange:function(n){t.customcss.tableRow.color=n,e.props.edit(t)}})),wp.element.createElement(Ji,{label:Fi("Text Orientation"),help:Fi("In degrees."),type:"number",value:t.customcss.tableRow.transform,onChange:function(n){t.customcss.tableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(Vi,{title:Fi("Odd Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Ui,{label:Fi("Background Color")},wp.element.createElement(Ii,{value:t.customcss.oddTableRow["background-color"],onChange:function(n){t.customcss.oddTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(Ui,{label:Fi("Color")},wp.element.createElement(Ii,{value:t.customcss.oddTableRow.color,onChange:function(n){t.customcss.oddTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(Ji,{label:Fi("Text Orientation"),help:Fi("In degrees."),type:"number",value:t.customcss.oddTableRow.transform,onChange:function(n){t.customcss.oddTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(Vi,{title:Fi("Selected Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Ui,{label:Fi("Background Color")},wp.element.createElement(Ii,{value:t.customcss.selectedTableRow["background-color"],onChange:function(n){t.customcss.selectedTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(Ui,{label:Fi("Color")},wp.element.createElement(Ii,{value:t.customcss.selectedTableRow.color,onChange:function(n){t.customcss.selectedTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(Ji,{label:Fi("Text Orientation"),help:Fi("In degrees."),type:"number",value:t.customcss.selectedTableRow.transform,onChange:function(n){t.customcss.selectedTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(Vi,{title:Fi("Hover Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Ui,{label:Fi("Background Color")},wp.element.createElement(Ii,{value:t.customcss.hoverTableRow["background-color"],onChange:function(n){t.customcss.hoverTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(Ui,{label:Fi("Color")},wp.element.createElement(Ii,{value:t.customcss.hoverTableRow.color,onChange:function(n){t.customcss.hoverTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(Ji,{label:Fi("Text Orientation"),help:Fi("In degrees."),type:"number",value:t.customcss.hoverTableRow.transform,onChange:function(n){t.customcss.hoverTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(Vi,{title:Fi("Header Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Ui,{label:Fi("Background Color")},wp.element.createElement(Ii,{value:t.customcss.headerCell["background-color"],onChange:function(n){t.customcss.headerCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(Ui,{label:Fi("Color")},wp.element.createElement(Ii,{value:t.customcss.headerCell.color,onChange:function(n){t.customcss.headerCell.color=n,e.props.edit(t)}})),wp.element.createElement(Ji,{label:Fi("Text Orientation"),help:Fi("In degrees."),type:"number",value:t.customcss.headerCell.transform,onChange:function(n){t.customcss.headerCell.transform=n,e.props.edit(t)}})),wp.element.createElement(Vi,{title:Fi("Table Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Ui,{label:Fi("Background Color")},wp.element.createElement(Ii,{value:t.customcss.tableCell["background-color"],onChange:function(n){t.customcss.tableCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(Ui,{label:Fi("Color")},wp.element.createElement(Ii,{value:t.customcss.tableCell.color,onChange:function(n){t.customcss.tableCell.color=n,e.props.edit(t)}})),wp.element.createElement(Ji,{label:Fi("Text Orientation"),help:Fi("In degrees."),type:"number",value:t.customcss.tableCell.transform,onChange:function(n){t.customcss.tableCell.transform=n,e.props.edit(t)}}))))}}])&&Hi(n.prototype,r),a&&Hi(n,a),t}(Ni);function qi(e){return(qi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ki(e,t){return!t||"object"!==qi(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Zi(e){return(Zi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Qi(e,t){return(Qi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Xi=wp.i18n.__,eo=wp.element.Component,to=wp.components,no=to.PanelBody,ro=to.SelectControl,ao=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Ki(this,Zi(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Qi(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(no,{title:Xi("Combo Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(ro,{label:Xi("Chart Type"),help:Xi("Select the default chart type."),value:t.seriesType?t.seriesType:"area",options:[{label:Xi("Area"),value:"area"},{label:Xi("Bar"),value:"bars"},{label:Xi("Candlesticks"),value:"candlesticks"},{label:Xi("Line"),value:"line"},{label:Xi("Stepped Area"),value:"steppedArea"}],onChange:function(n){t.seriesType=n,e.props.edit(t)}}))}}])&&$i(n.prototype,r),a&&$i(n,a),t}(eo);function io(e){return(io="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function oo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function so(e,t){return!t||"object"!==io(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function lo(e){return(lo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function uo(e,t){return(uo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var co=wp.i18n.__,mo=wp.element,po=mo.Component,ho=mo.Fragment,_o=wp.editor.ColorPalette,fo=wp.components,yo=fo.BaseControl,go=fo.ExternalLink,bo=fo.PanelBody,vo=fo.SelectControl,Mo=fo.TextControl,wo=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),so(this,lo(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&uo(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];Object.keys(e.series).map((function(t){void 0!==e.series[t]&&(e.series[t].temp=1)})),this.props.edit(e)}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"],r=this.props.chart["visualizer-series"];return wp.element.createElement(bo,{title:co("Series Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(n.series).map((function(a,i){return a++,wp.element.createElement(bo,{title:r[a].label,className:"visualizer-inner-sections",initialOpen:!1},-1>=["table","pie"].indexOf(t)&&wp.element.createElement(vo,{label:co("Visible In Legend"),help:co("Determines whether the series has to be presented in the legend or not."),value:n.series[i].visibleInLegend?n.series[i].visibleInLegend:"1",options:[{label:co("Yes"),value:"1"},{label:co("No"),value:"0"}],onChange:function(t){n.series[i].visibleInLegend=t,e.props.edit(n)}}),-1>=["table","candlestick","combo","column","bar"].indexOf(t)&&wp.element.createElement(ho,null,wp.element.createElement(Mo,{label:co("Line Width"),help:co("Overrides the global line width value for this series."),value:n.series[i].lineWidth,onChange:function(t){n.series[i].lineWidth=t,e.props.edit(n)}}),wp.element.createElement(Mo,{label:co("Point Size"),help:co("Overrides the global point size value for this series."),value:n.series[i].pointSize,onChange:function(t){n.series[i].pointSize=t,e.props.edit(n)}})),-1>=["candlestick"].indexOf(t)&&"number"===r[a].type?wp.element.createElement(ho,null,wp.element.createElement(Mo,{label:co("Format"),help:co("Enter custom format pattern to apply to this series value."),value:n.series[i].format,onChange:function(t){n.series[i].format=t,e.props.edit(n)}}),wp.element.createElement("p",null,co("For number axis labels, this is a subset of the formatting "),wp.element.createElement(go,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},co("ICU pattern set.")),co(" For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #%% percentage format then your values will be multiplied by 100."))):"date"===r[a].type&&wp.element.createElement(ho,null,wp.element.createElement(Mo,{label:co("Date Format"),help:co("Enter custom format pattern to apply to this series value."),placeholder:"dd LLLL yyyy",value:n.series[i].format,onChange:function(t){n.series[i].format=t,e.props.edit(n)}}),wp.element.createElement("p",null,co("This is a subset of the date formatting "),wp.element.createElement(go,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},co("ICU date and time format.")))),0<=["scatter","line"].indexOf(t)&&wp.element.createElement(vo,{label:co("Curve Type"),help:co("Determines whether the series has to be presented in the legend or not."),value:n.series[i].curveType?n.series[i].curveType:"none",options:[{label:co("Straight line without curve"),value:"none"},{label:co("The angles of the line will be smoothed"),value:"function"}],onChange:function(t){n.series[i].curveType=t,e.props.edit(n)}}),0<=["area"].indexOf(t)&&wp.element.createElement(Mo,{label:co("Area Opacity"),help:co("The opacity of the colored area, where 0.0 is fully transparent and 1.0 is fully opaque."),value:n.series[i].areaOpacity,onChange:function(t){n.series[i].areaOpacity=t,e.props.edit(n)}}),0<=["combo"].indexOf(t)&&wp.element.createElement(vo,{label:co("Chart Type"),help:co("Select the type of chart to show for this series."),value:n.series[i].type?n.series[i].type:"area",options:[{label:co("Area"),value:"area"},{label:co("Bar"),value:"bars"},{label:co("Candlesticks"),value:"candlesticks"},{label:co("Line"),value:"line"},{label:co("Stepped Area"),value:"steppedArea"}],onChange:function(t){n.series[i].type=t,e.props.edit(n)}}),-1>=["table"].indexOf(t)&&wp.element.createElement(yo,{label:co("Color")},wp.element.createElement(_o,{value:n.series[i].color,onChange:function(t){n.series[i].color=t,e.props.edit(n)}})))})))}}])&&oo(n.prototype,r),a&&oo(n,a),t}(po);function ko(e){return(ko="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Lo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Yo(e,t){return!t||"object"!==ko(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Do(e){return(Do=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function To(e,t){return(To=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var So=wp.i18n.__,Oo=wp.element.Component,xo=wp.editor.ColorPalette,jo=wp.components,Eo=jo.BaseControl,Co=jo.PanelBody,Ho=jo.TextControl,Po=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Yo(this,Do(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&To(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];Object.keys(e.slices).map((function(t){void 0!==e.slices[t]&&(e.slices[t].temp=1)})),this.props.edit(e)}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=this.props.chart["visualizer-data"];return wp.element.createElement(Co,{title:So("Slices Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(t.slices).map((function(r){return wp.element.createElement(Co,{title:n[r][0],className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Ho,{label:So("Slice Offset"),help:So("How far to separate the slice from the rest of the pie, from 0.0 (not at all) to 1.0 (the pie's radius)."),value:t.slices[r].offset,onChange:function(n){t.slices[r].offset=n,e.props.edit(t)}}),wp.element.createElement(Eo,{label:So("Format")},wp.element.createElement(xo,{value:t.slices[r].color,onChange:function(n){t.slices[r].color=n,e.props.edit(t)}})))})))}}])&&Lo(n.prototype,r),a&&Lo(n,a),t}(Oo);function Ao(e){return(Ao="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function zo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Fo(e,t){return!t||"object"!==Ao(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Wo(e){return(Wo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function No(e,t){return(No=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ro=wp.i18n.__,Io=wp.element,Bo=Io.Component,Uo=Io.Fragment,Vo=wp.components,Jo=Vo.ExternalLink,Go=Vo.PanelBody,qo=Vo.TextControl,$o=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Fo(this,Wo(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&No(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];Object.keys(e.series).map((function(t){void 0!==e.series[t]&&(e.series[t].temp=1)})),this.props.edit(e)}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=this.props.chart["visualizer-series"];return wp.element.createElement(Go,{title:Ro("Column Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(t.series).map((function(r){return wp.element.createElement(Go,{title:n[r].label,className:"visualizer-inner-sections",initialOpen:!1},("date"===n[r].type||"datetime"===n[r].type||"timeofday"===n[r].type)&&wp.element.createElement(Uo,null,wp.element.createElement(qo,{label:Ro("Display Date Format"),help:Ro("Enter custom format pattern to apply to this series value."),value:t.series[r].format?t.series[r].format.to:"",onChange:function(n){t.series[r].format||(t.series[r].format={}),t.series[r].format.to=n,e.props.edit(t)}}),wp.element.createElement(qo,{label:Ro("Source Date Format"),help:Ro("What format is the source date in?"),value:t.series[r].format?t.series[r].format.from:"",onChange:function(n){t.series[r].format||(t.series[r].format={}),t.series[r].format.from=n,e.props.edit(t)}}),wp.element.createElement("p",null,Ro("You can find more info on "),wp.element.createElement(Jo,{href:"https://momentjs.com/docs/#/displaying/"},Ro("date and time formats here.")))),"number"===n[r].type&&wp.element.createElement(Uo,null,wp.element.createElement(qo,{label:Ro("Thousands Separator"),value:t.series[r].format?t.series[r].format.thousands:"",onChange:function(n){t.series[r].format||(t.series[r].format={}),t.series[r].format.thousands=n,e.props.edit(t)}}),wp.element.createElement(qo,{label:Ro("Decimal Separator"),value:t.series[r].format?t.series[r].format.decimal:"",onChange:function(n){t.series[r].format||(t.series[r].format={}),t.series[r].format.decimal=n,e.props.edit(t)}}),wp.element.createElement(qo,{label:Ro("Precision"),help:Ro("Round values to how many decimal places?"),value:t.series[r].format?t.series[r].format.precision:"",type:"number",onChange:function(n){100<n||(t.series[r].format||(t.series[r].format={}),t.series[r].format.precision=n,e.props.edit(t))}}),wp.element.createElement(qo,{label:Ro("Prefix"),value:t.series[r].format?t.series[r].format.prefix:"",onChange:function(n){t.series[r].format||(t.series[r].format={}),t.series[r].format.prefix=n,e.props.edit(t)}}),wp.element.createElement(qo,{label:Ro("Suffix"),value:t.series[r].format?t.series[r].format.suffix:"",onChange:function(n){t.series[r].format||(t.series[r].format={}),t.series[r].format.suffix=n,e.props.edit(t)}})))})))}}])&&zo(n.prototype,r),a&&zo(n,a),t}(Bo);function Ko(e){return(Ko="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Zo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Qo(e,t){return!t||"object"!==Ko(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Xo(e){return(Xo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function es(e,t){return(es=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ts=wp.i18n.__,ns=wp.element,rs=ns.Component,as=ns.Fragment,is=wp.editor.ColorPalette,os=wp.components,ss=os.BaseControl,ls=os.CheckboxControl,us=os.PanelBody,cs=os.SelectControl,ds=os.TextControl,ms=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Qo(this,Xo(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&es(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(us,{title:ts("Layout And Chart Area"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(us,{title:ts("Layout"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ds,{label:ts("Width of Chart"),help:ts("Determines the total width of the chart."),value:n.width,onChange:function(t){n.width=t,e.props.edit(n)}}),wp.element.createElement(ds,{label:ts("Height of Chart"),help:ts("Determines the total height of the chart."),value:n.height,onChange:function(t){n.height=t,e.props.edit(n)}}),0<=["geo"].indexOf(t)&&wp.element.createElement(cs,{label:ts("Keep Aspect Ratio"),help:ts("If yes, the map will be drawn at the largest size that can fit inside the chart area at its natural aspect ratio. If only one of the width and height options is specified, the other one will be calculated according to the aspect ratio. If no, the map will be stretched to the exact size of the chart as specified by the width and height options."),value:n.keepAspectRatio?n.isStacked:"1",options:[{label:ts("Yes"),value:"1"},{label:ts("No"),value:"0"}],onChange:function(t){n.keepAspectRatio=t,e.props.edit(n)}}),-1>=["gauge"].indexOf(t)&&wp.element.createElement(as,null,wp.element.createElement(ds,{label:ts("Stroke Width"),help:ts("The chart border width in pixels."),value:n.backgroundColor.strokeWidth,onChange:function(t){n.backgroundColor.strokeWidth=t,e.props.edit(n)}}),wp.element.createElement(ss,{label:ts("Stroke Color")},wp.element.createElement(is,{value:n.backgroundColor.stroke,onChange:function(t){n.backgroundColor.stroke=t,e.props.edit(n)}})),wp.element.createElement(ss,{label:ts("Background Color")},wp.element.createElement(is,{value:n.backgroundColor.fill,onChange:function(t){n.backgroundColor.fill=t,e.props.edit(n)}})),wp.element.createElement(ls,{label:ts("Transparent Background?"),checked:"transparent"===n.backgroundColor.fill,onChange:function(t){n.backgroundColor.fill="transparent"===n.backgroundColor.fill?"":"transparent",e.props.edit(n)}}))),-1>=["geo","gauge"].indexOf(t)&&wp.element.createElement(us,{title:ts("Chart Area"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ds,{label:ts("Left Margin"),help:ts("Determines how far to draw the chart from the left border."),value:n.chartArea.left,onChange:function(t){n.chartArea.left=t,e.props.edit(n)}}),wp.element.createElement(ds,{label:ts("Top Margin"),help:ts("Determines how far to draw the chart from the top border."),value:n.chartArea.top,onChange:function(t){n.chartArea.top=t,e.props.edit(n)}}),wp.element.createElement(ds,{label:ts("Width Of Chart Area"),help:ts("Determines the width of the chart area."),value:n.chartArea.width,onChange:function(t){n.chartArea.width=t,e.props.edit(n)}}),wp.element.createElement(ds,{label:ts("Height Of Chart Area"),help:ts("Determines the hight of the chart area."),value:n.chartArea.height,onChange:function(t){n.chartArea.height=t,e.props.edit(n)}})))}}])&&Zo(n.prototype,r),a&&Zo(n,a),t}(rs);function ps(e){return(ps="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function hs(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _s(e,t){return!t||"object"!==ps(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function fs(e){return(fs=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ys(e,t){return(ys=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var gs=wp.i18n.__,bs=wp.element,vs=bs.Component,Ms=bs.Fragment,ws=wp.components,ks=ws.CheckboxControl,Ls=ws.PanelBody,Ys=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),_s(this,fs(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ys(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];void 0===e.actions&&(e.actions=[]),this.props.edit(e)}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Ls,{title:gs("Frontend Actions"),initialOpen:!1,className:"visualizer-advanced-panel"},void 0!==t.actions&&wp.element.createElement(Ms,null,wp.element.createElement(ks,{label:gs("Print"),help:gs("To enable printing the data."),checked:0<=t.actions.indexOf("print"),onChange:function(n){if(0<=t.actions.indexOf("print")){var r=t.actions.indexOf("print");-1!==r&&t.actions.splice(r,1)}else t.actions.push("print");e.props.edit(t)}}),wp.element.createElement(ks,{label:gs("CSV"),help:gs("To enable downloading the data as a CSV."),checked:0<=t.actions.indexOf("csv;application/csv"),onChange:function(n){if(0<=t.actions.indexOf("csv;application/csv")){var r=t.actions.indexOf("csv;application/csv");-1!==r&&t.actions.splice(r,1)}else t.actions.push("csv;application/csv");e.props.edit(t)}}),wp.element.createElement(ks,{label:gs("Excel"),help:gs("To enable downloading the data as an Excel spreadsheet."),checked:0<=t.actions.indexOf("xls;application/vnd.ms-excel"),onChange:function(n){if(0<=t.actions.indexOf("xls;application/vnd.ms-excel")){var r=t.actions.indexOf("xls;application/vnd.ms-excel");-1!==r&&t.actions.splice(r,1)}else t.actions.push("xls;application/vnd.ms-excel");e.props.edit(t)}}),wp.element.createElement(ks,{label:gs("Copy"),help:gs("To enable copying the data to the clipboard."),checked:0<=t.actions.indexOf("copy"),onChange:function(n){if(0<=t.actions.indexOf("copy")){var r=t.actions.indexOf("copy");-1!==r&&t.actions.splice(r,1)}else t.actions.push("copy");e.props.edit(t)}})))}}])&&hs(n.prototype,r),a&&hs(n,a),t}(vs);function Ds(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ts(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ds(e,t,n[t])}))}return e}var Ss={dark_vscode_tribute:{default:"#D4D4D4",background:"#1E1E1E",background_warning:"#1E1E1E",string:"#CE8453",number:"#B5CE9F",colon:"#49B8F7",keys:"#9CDCFE",keys_whiteSpace:"#AF74A5",primitive:"#6392C6"},light_mitsuketa_tribute:{default:"#D4D4D4",background:"#FCFDFD",background_warning:"#FEECEB",string:"#FA7921",number:"#70CE35",colon:"#49B8F7",keys:"#59A5D8",keys_whiteSpace:"#835FB6",primitive:"#386FA4"}},Os=n(2);const xs={getCaller:(e=1)=>{var t=(new Error).stack.replace(/^Error\s+/,"");return t=(t=t.split("\n")[e]).replace(/^\s+at Object./,"").replace(/^\s+at /,"").replace(/ \(.+\)$/,"")},throwError:(e="unknown function",t="unknown parameter",n="to be defined")=>{throw["@",e,"(): Expected parameter '",t,"' ",n].join("")},isUndefined:(e="<unknown parameter>",t)=>{[null,void 0].indexOf(t)>-1&&xs.throwError(xs.getCaller(2),e)},isFalsy:(e="<unknown parameter>",t)=>{t||xs.throwError(xs.getCaller(2),e)},isNoneOf:(e="<unknown parameter>",t,n=[])=>{-1===n.indexOf(t)&&xs.throwError(xs.getCaller(2),e,"to be any of"+JSON.stringify(n))},isAnyOf:(e="<unknown parameter>",t,n=[])=>{n.indexOf(t)>-1&&xs.throwError(xs.getCaller(2),e,"not to be any of"+JSON.stringify(n))},isNotType:(e="<unknown parameter>",t,n="")=>{Object(Os.getType)(t)!==n.toLowerCase()&&xs.throwError(xs.getCaller(2),e,"to be type "+n.toLowerCase())},isAnyTypeOf:(e="<unknown parameter>",t,n=[])=>{n.forEach(n=>{Object(Os.getType)(t)===n&&xs.throwError(xs.getCaller(2),e,"not to be type of "+n.toLowerCase())})},missingKey:(e="<unknown parameter>",t,n="")=>{xs.isUndefined(e,t),-1===Object.keys(t).indexOf(n)&&xs.throwError(xs.getCaller(2),e,"to contain '"+n+"' key")},missingAnyKeys:(e="<unknown parameter>",t,n=[""])=>{xs.isUndefined(e,t);const r=Object.keys(t);n.forEach(t=>{-1===r.indexOf(t)&&xs.throwError(xs.getCaller(2),e,"to contain '"+t+"' key")})},containsUndefined:(e="<unknown parameter>",t)=>{[void 0,null].forEach(n=>{const r=Object(Os.locate)(t,n);r&&xs.throwError(xs.getCaller(2),e,"not to contain '"+JSON.stringify(n)+"' at "+r)})},isInvalidPath:(e="<unknown parameter>",t)=>{xs.isUndefined(e,t),xs.isNotType(e,t,"string"),xs.isAnyOf(e,t,["","/"]),".$[]#".split().forEach(n=>{t.indexOf(n)>-1&&xs.throwError(xs.getCaller(2),e,"not to contain invalid character '"+n+"'")}),t.match(/\/{2,}/g)&&xs.throwError(xs.getCaller(2),e,"not to contain consecutive forward slash characters")},isInvalidWriteData:(e="<unknown parameter>",t)=>{xs.isUndefined(e,t),xs.containsUndefined(e,t)}};var js=xs;const Es=(e,t)=>t?Object.keys(t).reduce((e,n)=>e.replace(new RegExp(`\\{${n}\\}`,"gi"),(e=>Array.isArray(e)?e.join(", "):"string"==typeof e?e:""+e)(t[n])),e):e;var Cs={format:"{reason} at line {line}",symbols:{colon:"colon",comma:"comma",semicolon:"semicolon",slash:"slash",backslash:"backslash",brackets:{round:"round brackets",square:"square brackets",curly:"curly brackets",angle:"angle brackets"},period:"period",quotes:{single:"single quote",double:"double quote",grave:"grave accent"},space:"space",ampersand:"ampersand",asterisk:"asterisk",at:"at sign",equals:"equals sign",hash:"hash",percent:"percent",plus:"plus",minus:"minus",dash:"dash",hyphen:"hyphen",tilde:"tilde",underscore:"underscore",bar:"vertical bar"},types:{key:"key",value:"value",number:"number",string:"string",primitive:"primitive",boolean:"boolean",character:"character",integer:"integer",array:"array",float:"float"},invalidToken:{tokenSequence:{prohibited:"'{firstToken}' token cannot be followed by '{secondToken}' token(s)",permitted:"'{firstToken}' token can only be followed by '{secondToken}' token(s)"},termSequence:{prohibited:"A {firstTerm} cannot be followed by a {secondTerm}",permitted:"A {firstTerm} can only be followed by a {secondTerm}"},double:"'{token}' token cannot be followed by another '{token}' token",useInstead:"'{badToken}' token is not accepted. Use '{goodToken}' instead",unexpected:"Unexpected '{token}' token found"},brace:{curly:{missingOpen:"Missing '{' open curly brace",missingClose:"Open '{' curly brace is missing closing '}' curly brace",cannotWrap:"'{token}' token cannot be wrapped in '{}' curly braces"},square:{missingOpen:"Missing '[' open square brace",missingClose:"Open '[' square brace is missing closing ']' square brace",cannotWrap:"'{token}' token cannot be wrapped in '[]' square braces"}},string:{missingOpen:"Missing/invalid opening string '{quote}' token",missingClose:"Missing/invalid closing string '{quote}' token",mustBeWrappedByQuotes:"Strings must be wrapped by quotes",nonAlphanumeric:"Non-alphanumeric token '{token}' is not allowed outside string notation",unexpectedKey:"Unexpected key found at string position"},key:{numberAndLetterMissingQuotes:"Key beginning with number and containing letters must be wrapped by quotes",spaceMissingQuotes:"Key containing space must be wrapped by quotes",unexpectedString:"Unexpected string found at key position"},noTrailingOrLeadingComma:"Trailing or leading commas in arrays and objects are not permitted"};
65
  /** @license react-json-editor-ajrm v2.5.9
66
  *
67
  * This source code is licensed under the MIT license found in the
68
  * LICENSE file in the root directory of this source tree.
69
- */class Hs extends r.Component{constructor(e){super(e),this.updateInternalProps=this.updateInternalProps.bind(this),this.createMarkup=this.createMarkup.bind(this),this.onClick=this.onClick.bind(this),this.onBlur=this.onBlur.bind(this),this.update=this.update.bind(this),this.getCursorPosition=this.getCursorPosition.bind(this),this.setCursorPosition=this.setCursorPosition.bind(this),this.scheduledUpdate=this.scheduledUpdate.bind(this),this.setUpdateTime=this.setUpdateTime.bind(this),this.renderLabels=this.renderLabels.bind(this),this.newSpan=this.newSpan.bind(this),this.renderErrorMessage=this.renderErrorMessage.bind(this),this.onScroll=this.onScroll.bind(this),this.showPlaceholder=this.showPlaceholder.bind(this),this.tokenize=this.tokenize.bind(this),this.onKeyPress=this.onKeyPress.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onPaste=this.onPaste.bind(this),this.stopEvent=this.stopEvent.bind(this),this.refContent=null,this.refLabels=null,this.updateInternalProps(),this.renderCount=1,this.state={prevPlaceholder:"",markupText:"",plainText:"",json:"",jsObject:void 0,lines:!1,error:!1},this.props.locale||console.warn("[react-json-editor-ajrm - Deprecation Warning] You did not provide a 'locale' prop for your JSON input - This will be required in a future version. English has been set as a default.")}updateInternalProps(){let e={},t={},n=Ss.dark_vscode_tribute;"theme"in this.props&&"string"==typeof this.props.theme&&this.props.theme in Ss&&(n=Ss[this.props.theme]),e=n,"colors"in this.props&&(e={default:"default"in this.props.colors?this.props.colors.default:e.default,string:"string"in this.props.colors?this.props.colors.string:e.string,number:"number"in this.props.colors?this.props.colors.number:e.number,colon:"colon"in this.props.colors?this.props.colors.colon:e.colon,keys:"keys"in this.props.colors?this.props.colors.keys:e.keys,keys_whiteSpace:"keys_whiteSpace"in this.props.colors?this.props.colors.keys_whiteSpace:e.keys_whiteSpace,primitive:"primitive"in this.props.colors?this.props.colors.primitive:e.primitive,error:"error"in this.props.colors?this.props.colors.error:e.error,background:"background"in this.props.colors?this.props.colors.background:e.background,background_warning:"background_warning"in this.props.colors?this.props.colors.background_warning:e.background_warning}),this.colors=e,t="style"in this.props?{outerBox:"outerBox"in this.props.style?this.props.style.outerBox:{},container:"container"in this.props.style?this.props.style.container:{},warningBox:"warningBox"in this.props.style?this.props.style.warningBox:{},errorMessage:"errorMessage"in this.props.style?this.props.style.errorMessage:{},body:"body"in this.props.style?this.props.style.body:{},labelColumn:"labelColumn"in this.props.style?this.props.style.labelColumn:{},labels:"labels"in this.props.style?this.props.style.labels:{},contentBox:"contentBox"in this.props.style?this.props.style.contentBox:{}}:{outerBox:{},container:{},warningBox:{},errorMessage:{},body:{},labelColumn:{},labels:{},contentBox:{}},this.style=t,this.confirmGood=!("confirmGood"in this.props)||this.props.confirmGood;const r=this.props.height||"610px",a=this.props.width||"479px";this.totalHeight=r,this.totalWidth=a,"onKeyPressUpdate"in this.props&&!this.props.onKeyPressUpdate?this.timer&&(clearInterval(this.timer),this.timer=!1):this.timer||(this.timer=setInterval(this.scheduledUpdate,100)),this.updateTime=!1,this.waitAfterKeyPress="waitAfterKeyPress"in this.props?this.props.waitAfterKeyPress:1e3,this.resetConfiguration="reset"in this.props&&this.props.reset}render(){const e=this.props.id,t=this.state.markupText,n=this.state.error,r=this.colors,i=this.style,o=this.confirmGood,s=this.totalHeight,l=this.totalWidth,u=!!n&&"token"in n;return this.renderCount++,a.a.createElement("div",{name:"outer-box",id:e&&e+"-outer-box",style:Ts({display:"block",overflow:"none",height:s,width:l,margin:0,boxSizing:"border-box",position:"relative"},i.outerBox)},o?a.a.createElement("div",{style:{opacity:u?0:1,height:"30px",width:"30px",position:"absolute",top:0,right:0,transform:"translate(-25%,25%)",pointerEvents:"none",transitionDuration:"0.2s",transitionTimingFunction:"cubic-bezier(0, 1, 0.5, 1)"}},a.a.createElement("svg",{height:"30px",width:"30px",viewBox:"0 0 100 100"},a.a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",fill:"green",opacity:"0.85",d:"M39.363,79L16,55.49l11.347-11.419L39.694,56.49L72.983,23L84,34.085L39.363,79z"}))):void 0,a.a.createElement("div",{name:"container",id:e&&e+"-container",style:Ts({display:"block",height:s,width:l,margin:0,boxSizing:"border-box",overflow:"hidden",fontFamily:"Roboto, sans-serif"},i.container),onClick:this.onClick},a.a.createElement("div",{name:"warning-box",id:e&&e+"-warning-box",style:Ts({display:"block",overflow:"hidden",height:u?"60px":"0px",width:"100%",margin:0,backgroundColor:r.background_warning,transitionDuration:"0.2s",transitionTimingFunction:"cubic-bezier(0, 1, 0.5, 1)"},i.warningBox),onClick:this.onClick},a.a.createElement("span",{style:{display:"inline-block",height:"60px",width:"60px",margin:0,boxSizing:"border-box",overflow:"hidden",verticalAlign:"top",pointerEvents:"none"},onClick:this.onClick},a.a.createElement("div",{style:{position:"relative",top:0,left:0,height:"60px",width:"60px",margin:0,pointerEvents:"none"},onClick:this.onClick},a.a.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"},onClick:this.onClick},a.a.createElement("svg",{height:"25px",width:"25px",viewBox:"0 0 100 100"},a.a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",fill:"red",d:"M73.9,5.75c0.467-0.467,1.067-0.7,1.8-0.7c0.7,0,1.283,0.233,1.75,0.7l16.8,16.8 c0.467,0.5,0.7,1.084,0.7,1.75c0,0.733-0.233,1.334-0.7,1.801L70.35,50l23.9,23.95c0.5,0.467,0.75,1.066,0.75,1.8 c0,0.667-0.25,1.25-0.75,1.75l-16.8,16.75c-0.534,0.467-1.117,0.7-1.75,0.7s-1.233-0.233-1.8-0.7L50,70.351L26.1,94.25 c-0.567,0.467-1.167,0.7-1.8,0.7c-0.667,0-1.283-0.233-1.85-0.7L5.75,77.5C5.25,77,5,76.417,5,75.75c0-0.733,0.25-1.333,0.75-1.8 L29.65,50L5.75,26.101C5.25,25.667,5,25.066,5,24.3c0-0.666,0.25-1.25,0.75-1.75l16.8-16.8c0.467-0.467,1.05-0.7,1.75-0.7 c0.733,0,1.333,0.233,1.8,0.7L50,29.65L73.9,5.75z"}))))),a.a.createElement("span",{style:{display:"inline-block",height:"60px",width:"calc(100% - 60px)",margin:0,overflow:"hidden",verticalAlign:"top",position:"absolute",pointerEvents:"none"},onClick:this.onClick},this.renderErrorMessage())),a.a.createElement("div",{name:"body",id:e&&e+"-body",style:Ts({display:"flex",overflow:"none",height:u?"calc(100% - 60px)":"100%",width:"",margin:0,resize:"none",fontFamily:"Roboto Mono, Monaco, monospace",fontSize:"11px",backgroundColor:r.background,transitionDuration:"0.2s",transitionTimingFunction:"cubic-bezier(0, 1, 0.5, 1)"},i.body),onClick:this.onClick},a.a.createElement("span",{name:"labels",id:e&&e+"-labels",ref:e=>this.refLabels=e,style:Ts({display:"inline-block",boxSizing:"border-box",verticalAlign:"top",height:"100%",width:"44px",margin:0,padding:"5px 0px 5px 10px",overflow:"hidden",color:"#D4D4D4"},i.labelColumn),onClick:this.onClick},this.renderLabels()),a.a.createElement("span",{id:e,ref:e=>this.refContent=e,contentEditable:!0,style:Ts({display:"inline-block",boxSizing:"border-box",verticalAlign:"top",height:"100%",width:"",flex:1,margin:0,padding:"5px",overflowX:"hidden",overflowY:"auto",wordWrap:"break-word",whiteSpace:"pre-line",color:"#D4D4D4",outline:"none"},i.contentBox),dangerouslySetInnerHTML:this.createMarkup(t),onKeyPress:this.onKeyPress,onKeyDown:this.onKeyDown,onClick:this.onClick,onBlur:this.onBlur,onScroll:this.onScroll,onPaste:this.onPaste,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}))))}renderErrorMessage(){const e=this.props.locale||Cs,t=this.state.error,n=this.style;if(t)return a.a.createElement("p",{style:Ts({color:"red",fontSize:"12px",position:"absolute",width:"calc(100% - 60px)",height:"60px",boxSizing:"border-box",margin:0,padding:0,paddingRight:"10px",overflowWrap:"break-word",display:"flex",flexDirection:"column",justifyContent:"center"},n.errorMessage)},Es(e.format,t))}renderLabels(){const e=this.colors,t=this.style,n=this.state.error?this.state.error.line:-1,r=this.state.lines?this.state.lines:1;let i=new Array(r);for(var o=0;o<r-1;o++)i[o]=o+1;return i.map(r=>{const i=r!==n?e.default:"red";return a.a.createElement("div",{key:r,style:Ts({},t.labels,{color:i})},r)})}createMarkup(e){return void 0===e?{__html:""}:{__html:""+e}}newSpan(e,t,n){let r=this.colors,a=t.type,i=t.string,o="";switch(a){case"string":case"number":case"primitive":case"error":o=r[t.type];break;case"key":o=" "===i?r.keys_whiteSpace:r.keys;break;case"symbol":o=":"===i?r.colon:r.default;break;default:o=r.default}return i.length!==i.replace(/</g,"").replace(/>/g,"").length&&(i="<xmp style=display:inline;>"+i+"</xmp>"),'<span type="'+a+'" value="'+i+'" depth="'+n+'" style="color:'+o+'">'+i+"</span>"}getCursorPosition(e){let t,n=window.getSelection(),r=-1,a=0;if(n.focusNode&&(e=>{for(;null!==e;){if(e===this.refContent)return!0;e=e.parentNode}return!1})(n.focusNode))for(t=n.focusNode,r=n.focusOffset;t&&t!==this.refContent;)if(t.previousSibling)t=t.previousSibling,e&&"BR"===t.nodeName&&a++,r+=t.textContent.length;else if(null===(t=t.parentNode))break;return r+a}setCursorPosition(e){if([!1,null,void 0].indexOf(e)>-1)return;const t=(e,n,r)=>{if(r||((r=document.createRange()).selectNode(e),r.setStart(e,0)),0===n.count)r.setEnd(e,n.count);else if(e&&n.count>0)if(e.nodeType===Node.TEXT_NODE)e.textContent.length<n.count?n.count-=e.textContent.length:(r.setEnd(e,n.count),n.count=0);else for(var a=0;a<e.childNodes.length&&(r=t(e.childNodes[a],n,r),0!==n.count);a++);return r};e>0?(e=>{if(e<0)return;let n=window.getSelection(),r=t(this.refContent,{count:e});r&&(r.collapse(!1),n.removeAllRanges(),n.addRange(r))})(e):this.refContent.focus()}update(e=0,t=!0){const n=this.refContent,r=this.tokenize(n);"onChange"in this.props&&this.props.onChange({plainText:r.indented,markupText:r.markup,json:r.json,jsObject:r.jsObject,lines:r.lines,error:r.error});let a=this.getCursorPosition(r.error)+e;this.setState({plainText:r.indented,markupText:r.markup,json:r.json,jsObject:r.jsObject,lines:r.lines,error:r.error}),this.updateTime=!1,t&&this.setCursorPosition(a)}scheduledUpdate(){if("onKeyPressUpdate"in this.props&&!1===this.props.onKeyPressUpdate)return;const{updateTime:e}=this;!1!==e&&(e>(new Date).getTime()||this.update())}setUpdateTime(){"onKeyPressUpdate"in this.props&&!1===this.props.onKeyPressUpdate||(this.updateTime=(new Date).getTime()+this.waitAfterKeyPress)}stopEvent(e){e&&(e.preventDefault(),e.stopPropagation())}onKeyPress(e){const t=e.ctrlKey||e.metaKey;this.props.viewOnly&&!t&&this.stopEvent(e),t||this.setUpdateTime()}onKeyDown(e){const t=!!this.props.viewOnly,n=e.ctrlKey||e.metaKey;switch(e.key){case"Tab":if(this.stopEvent(e),t)break;document.execCommand("insertText",!1," "),this.setUpdateTime();break;case"Backspace":case"Delete":t&&this.stopEvent(e),this.setUpdateTime();break;case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"ArrowDown":this.setUpdateTime();break;case"a":case"c":t&&!n&&this.stopEvent(e);break;default:t&&this.stopEvent(e)}}onPaste(e){if(this.props.viewOnly)this.stopEvent(e);else{e.preventDefault();var t=e.clipboardData.getData("text/plain");document.execCommand("insertHTML",!1,t)}this.update()}onClick(){"viewOnly"in this.props&&this.props.viewOnly}onBlur(){"viewOnly"in this.props&&this.props.viewOnly||this.update(0,!1)}onScroll(e){this.refLabels.scrollTop=e.target.scrollTop}componentDidUpdate(){this.updateInternalProps(),this.showPlaceholder()}componentDidMount(){this.showPlaceholder()}componentWillUnmount(){this.timer&&clearInterval(this.timer)}showPlaceholder(){if(!("placeholder"in this.props))return;const{placeholder:e}=this.props;if([void 0,null].indexOf(e)>-1)return;const{prevPlaceholder:t,jsObject:n}=this.state,{resetConfiguration:r}=this,a=Object(Os.getType)(e);-1===["object","array"].indexOf(a)&&js.throwError("showPlaceholder","placeholder","either an object or an array");let i=!Object(Os.identical)(e,t);if(i||r&&void 0!==n&&(i=!Object(Os.identical)(e,n)),!i)return;const o=this.tokenize(e);this.setState({prevPlaceholder:e,plainText:o.indentation,markupText:o.markup,lines:o.lines,error:o.error})}tokenize(e){if("object"!=typeof e)return console.error("tokenize() expects object type properties only. Got '"+typeof e+"' type instead.");const t=this.props.locale||Cs,n=this.newSpan;if("nodeType"in e){const w=e.cloneNode(!0);if(!w.hasChildNodes())return"";const k=w.childNodes;let L={tokens_unknown:[],tokens_proto:[],tokens_split:[],tokens_fallback:[],tokens_normalize:[],tokens_merge:[],tokens_plainText:"",indented:"",json:"",jsObject:void 0,markup:""};for(var r=0;r<k.length;r++){let e=k[r],t={};switch(e.nodeName){case"SPAN":t={string:e.textContent,type:e.attributes.type.textContent},L.tokens_unknown.push(t);break;case"DIV":L.tokens_unknown.push({string:e.textContent,type:"unknown"});break;case"BR":""===e.textContent&&L.tokens_unknown.push({string:"\n",type:"unknown"});break;case"#text":L.tokens_unknown.push({string:e.wholeText,type:"unknown"});break;case"FONT":L.tokens_unknown.push({string:e.textContent,type:"unknown"});break;default:console.error("Unrecognized node:",{child:e})}}function a(e,t=""){let n={active:!1,string:"",number:"",symbol:"",space:"",delimiter:"",quarks:[]};function r(e,r){switch(r){case"symbol":case"delimiter":n.active&&n.quarks.push({string:n[n.active],type:t+"-"+n.active}),n[n.active]="",n.active=r,n[n.active]=e;break;default:r!==n.active||[n.string,e].indexOf("\n")>-1?(n.active&&n.quarks.push({string:n[n.active],type:t+"-"+n.active}),n[n.active]="",n.active=r,n[n.active]=e):n[r]+=e}}for(var a=0;a<e.length;a++){const t=e.charAt(a);switch(t){case'"':case"'":r(t,"delimiter");break;case" ":case" ":r(t,"space");break;case"{":case"}":case"[":case"]":case":":case",":r(t,"symbol");break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":"string"===n.active?r(t,"string"):r(t,"number");break;case"-":if(a<e.length-1&&"0123456789".indexOf(e.charAt(a+1))>-1){r(t,"number");break}case".":if(a<e.length-1&&a>0&&"0123456789".indexOf(e.charAt(a+1))>-1&&"0123456789".indexOf(e.charAt(a-1))>-1){r(t,"number");break}default:r(t,"string")}}return n.active&&(n.quarks.push({string:n[n.active],type:t+"-"+n.active}),n[n.active]="",n.active=!1),n.quarks}for(r=0;r<L.tokens_unknown.length;r++){let e=L.tokens_unknown[r];L.tokens_proto=L.tokens_proto.concat(a(e.string,"proto"))}function i(e,t){let n="",r="",a=!1;switch(t){case"primitive":if(-1===["true","false","null","undefined"].indexOf(e))return!1;break;case"string":if(e.length<2)return!1;if(n=e.charAt(0),r=e.charAt(e.length-1),-1===(a="'\"".indexOf(n)))return!1;if(n!==r)return!1;for(var i=0;i<e.length;i++)if(i>0&&i<e.length-1&&e.charAt(i)==="'\""[a]&&"\\"!==e.charAt(i-1))return!1;break;case"key":if(0===e.length)return!1;if(n=e.charAt(0),r=e.charAt(e.length-1),(a="'\"".indexOf(n))>-1){if(1===e.length)return!1;if(n!==r)return!1;for(i=0;i<e.length;i++)if(i>0&&i<e.length-1&&e.charAt(i)==="'\""[a]&&"\\"!==e.charAt(i-1))return!1}else{const t="'\"`.,:;{}[]&<>=~*%\\|/-+!?@^  ";for(i=0;i<t.length;i++){const n=t.charAt(i);if(e.indexOf(n)>-1)return!1}}break;case"number":for(i=0;i<e.length;i++)if(-1==="0123456789".indexOf(e.charAt(i)))if(0===i){if("-"!==e.charAt(0))return!1}else if("."!==e.charAt(i))return!1;break;case"symbol":if(e.length>1)return!1;if(-1==="{[:]},".indexOf(e))return!1;break;case"colon":if(e.length>1)return!1;if(":"!==e)return!1;break;default:return!0}return!0}for(r=0;r<L.tokens_proto.length;r++){let e=L.tokens_proto[r];-1===e.type.indexOf("proto")?i(e.string,e.type)?L.tokens_split.push(e):L.tokens_split=L.tokens_split.concat(a(e.string,"split")):L.tokens_split.push(e)}for(r=0;r<L.tokens_split.length;r++){let e=L.tokens_split[r],t=e.type,n=e.string,a=n.length,i=[];t.indexOf("-")>-1&&("string"!==(t=t.slice(t.indexOf("-")+1))&&i.push("string"),i.push("key"),i.push("error"));let o={string:n,length:a,type:t,fallback:i};L.tokens_fallback.push(o)}function o(){const e=L.tokens_normalize.length-1;if(e<1)return!1;for(var t=e;t>=0;t--){const e=L.tokens_normalize[t];switch(e.type){case"space":case"linebreak":break;default:return e}}return!1}let Y={brackets:[],stringOpen:!1,isValue:!1};for(r=0;r<L.tokens_fallback.length;r++){let e=L.tokens_fallback[r];const t=e.type,n=e.string;let a={type:t,string:n};switch(t){case"symbol":case"colon":if(Y.stringOpen){Y.isValue?a.type="string":a.type="key";break}switch(n){case"[":case"{":Y.brackets.push(n),Y.isValue="["===Y.brackets[Y.brackets.length-1];break;case"]":case"}":Y.brackets.pop(),Y.isValue="["===Y.brackets[Y.brackets.length-1];break;case",":if("colon"===o().type)break;Y.isValue="["===Y.brackets[Y.brackets.length-1];break;case":":a.type="colon",Y.isValue=!0}break;case"delimiter":if(Y.isValue?a.type="string":a.type="key",!Y.stringOpen){Y.stringOpen=n;break}if(r>0){const e=L.tokens_fallback[r-1],t=e.string,n=e.type,a=t.charAt(t.length-1);if("string"===n&&"\\"===a)break}if(Y.stringOpen===n){Y.stringOpen=!1;break}break;case"primitive":case"string":if(["false","true","null","undefined"].indexOf(n)>-1){const e=L.tokens_normalize.length-1;if(e>=0){if("string"!==L.tokens_normalize[e].type){a.type="primitive";break}a.type="string";break}a.type="primitive";break}if("\n"===n&&!Y.stringOpen){a.type="linebreak";break}Y.isValue?a.type="string":a.type="key";break;case"space":case"number":Y.stringOpen&&(Y.isValue?a.type="string":a.type="key")}L.tokens_normalize.push(a)}for(r=0;r<L.tokens_normalize.length;r++){const e=L.tokens_normalize[r];let t={string:e.string,type:e.type,tokens:[r]};if(-1===["symbol","colon"].indexOf(e.type)&&r+1<L.tokens_normalize.length){let n=0;for(var s=r+1;s<L.tokens_normalize.length;s++){const r=L.tokens_normalize[s];if(e.type!==r.type)break;t.string+=r.string,t.tokens.push(s),n++}r+=n}L.tokens_merge.push(t)}const D="'\"",T="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$";var l=!1,u=L.tokens_merge.length>0?1:0;function c(e,t,n=0){l={token:e,line:u,reason:t},L.tokens_merge[e+n].type="error"}function d(e,t){if(void 0===e&&console.error("tokenID argument must be an integer."),void 0===t&&console.error("options argument must be an array."),e===L.tokens_merge.length-1)return!1;for(var n=e+1;n<L.tokens_merge.length;n++){const e=L.tokens_merge[n];switch(e.type){case"space":case"linebreak":break;case"symbol":case"colon":return t.indexOf(e.string)>-1&&n;default:return!1}}return!1}function m(e,t){if(void 0===e&&console.error("tokenID argument must be an integer."),void 0===t&&console.error("options argument must be an array."),0===e)return!1;for(var n=e-1;n>=0;n--){const e=L.tokens_merge[n];switch(e.type){case"space":case"linebreak":break;case"symbol":case"colon":return t.indexOf(e.string)>-1;default:return!1}}return!1}function p(e){if(void 0===e&&console.error("tokenID argument must be an integer."),0===e)return!1;for(var t=e-1;t>=0;t--){const e=L.tokens_merge[t];switch(e.type){case"space":case"linebreak":break;default:return e.type}}return!1}Y={brackets:[],stringOpen:!1,isValue:!1};let S=[];for(r=0;r<L.tokens_merge.length&&!l;r++){let e=L.tokens_merge[r],n=e.string,a=e.type,i=!1;switch(a){case"space":break;case"linebreak":u++;break;case"symbol":switch(n){case"{":case"[":if(i=m(r,["}","]"])){c(r,Es(t.invalidToken.tokenSequence.prohibited,{firstToken:L.tokens_merge[i].string,secondToken:n}));break}if("["===n&&r>0&&!m(r,[":","[",","])){c(r,Es(t.invalidToken.tokenSequence.permitted,{firstToken:"[",secondToken:[":","[",","]}));break}if("{"===n&&m(r,["{"])){c(r,Es(t.invalidToken.double,{token:"{"}));break}Y.brackets.push(n),Y.isValue="["===Y.brackets[Y.brackets.length-1],S.push({i:r,line:u,string:n});break;case"}":case"]":if("}"===n&&"{"!==Y.brackets[Y.brackets.length-1]){c(r,Es(t.brace.curly.missingOpen));break}if("}"===n&&m(r,[","])){c(r,Es(t.invalidToken.tokenSequence.prohibited,{firstToken:",",secondToken:"}"}));break}if("]"===n&&"["!==Y.brackets[Y.brackets.length-1]){c(r,Es(t.brace.square.missingOpen));break}if("]"===n&&m(r,[":"])){c(r,Es(t.invalidToken.tokenSequence.prohibited,{firstToken:":",secondToken:"]"}));break}Y.brackets.pop(),Y.isValue="["===Y.brackets[Y.brackets.length-1],S.push({i:r,line:u,string:n});break;case",":if(i=m(r,["{"])){if(d(r,["}"])){c(r,Es(t.brace.curly.cannotWrap,{token:","}));break}c(r,Es(t.invalidToken.tokenSequence.prohibited,{firstToken:"{",secondToken:","}));break}if(d(r,["}",",","]"])){c(r,Es(t.noTrailingOrLeadingComma));break}switch(i=p(r)){case"key":case"colon":c(r,Es(t.invalidToken.termSequence.prohibited,{firstTerm:"key"===i?t.types.key:t.symbols.colon,secondTerm:t.symbols.comma}));break;case"symbol":if(m(r,["{"])){c(r,Es(t.invalidToken.tokenSequence.prohibited,{firstToken:"{",secondToken:","}));break}}Y.isValue="["===Y.brackets[Y.brackets.length-1]}L.json+=n;break;case"colon":if((i=m(r,["["]))&&d(r,["]"])){c(r,Es(t.brace.square.cannotWrap,{token:":"}));break}if(i){c(r,Es(t.invalidToken.tokenSequence.prohibited,{firstToken:"[",secondToken:":"}));break}if("key"!==p(r)){c(r,Es(t.invalidToken.termSequence.permitted,{firstTerm:t.symbols.colon,secondTerm:t.types.key}));break}if(d(r,["}","]"])){c(r,Es(t.invalidToken.termSequence.permitted,{firstTerm:t.symbols.colon,secondTerm:t.types.value}));break}Y.isValue=!0,L.json+=n;break;case"key":case"string":let e=n.charAt(0),o=n.charAt(n.length-1);D.indexOf(e);if(-1===D.indexOf(e)&&-1!==D.indexOf(o)){c(r,Es(t.string.missingOpen,{quote:e}));break}if(-1===D.indexOf(o)&&-1!==D.indexOf(e)){c(r,Es(t.string.missingClose,{quote:e}));break}if(D.indexOf(e)>-1&&e!==o){c(r,Es(t.string.missingClose,{quote:e}));break}if("string"===a&&-1===D.indexOf(e)&&-1===D.indexOf(o)){c(r,Es(t.string.mustBeWrappedByQuotes));break}if("key"===a&&d(r,["}","]"])&&c(r,Es(t.invalidToken.termSequence.permitted,{firstTerm:t.types.key,secondTerm:t.symbols.colon})),-1===D.indexOf(e)&&-1===D.indexOf(o))for(var h=0;h<n.length&&!l;h++){const e=n.charAt(h);if(-1===T.indexOf(e)){c(r,Es(t.string.nonAlphanumeric,{token:e}));break}}if("'"===e?n='"'+n.slice(1,-1)+'"':'"'!==e&&(n='"'+n+'"'),"key"===a&&"key"===p(r)){if(r>0&&!isNaN(L.tokens_merge[r-1])){L.tokens_merge[r-1]+=L.tokens_merge[r],c(r,Es(t.key.numberAndLetterMissingQuotes));break}c(r,Es(t.key.spaceMissingQuotes));break}if("key"===a&&!m(r,["{",","])){c(r,Es(t.invalidToken.tokenSequence.permitted,{firstToken:a,secondToken:["{",","]}));break}if("string"===a&&!m(r,["[",":",","])){c(r,Es(t.invalidToken.tokenSequence.permitted,{firstToken:a,secondToken:["[",":",","]}));break}if("key"===a&&Y.isValue){c(r,Es(t.string.unexpectedKey));break}if("string"===a&&!Y.isValue){c(r,Es(t.key.unexpectedString));break}L.json+=n;break;case"number":case"primitive":if(m(r,["{"]))L.tokens_merge[r].type="key",a=L.tokens_merge[r].type,n='"'+n+'"';else if("key"===p(r))L.tokens_merge[r].type="key",a=L.tokens_merge[r].type;else if(!m(r,["[",":",","])){c(r,Es(t.invalidToken.tokenSequence.permitted,{firstToken:a,secondToken:["[",":",","]}));break}"key"!==a&&(Y.isValue||(L.tokens_merge[r].type="key",a=L.tokens_merge[r].type,n='"'+n+'"')),"primitive"===a&&"undefined"===n&&c(r,Es(t.invalidToken.useInstead,{badToken:"undefined",goodToken:"null"})),L.json+=n}}let O="";for(r=0;r<L.json.length;r++){let e=L.json.charAt(r),t="";r+1<L.json.length&&(t=L.json.charAt(r+1),"\\"===e&&"'"===t)?(O+=t,r++):O+=e}if(L.json=O,!l){const e=Math.ceil(S.length/2);let n=0,r=!1;function _(e){S.splice(e+1,1),S.splice(e,1),r||(r=!0)}for(;S.length>0;){r=!1;for(var f=0;f<S.length-1;f++){const e=S[f].string+S[f+1].string;["[]","{}"].indexOf(e)>-1&&_(f)}if(n++,!r)break;if(n>=e)break}if(S.length>0){const e=S[0].string,n=S[0].i,r="["===e?"]":"}";u=S[0].line,c(n,Es(t.brace["]"===r?"square":"curly"].missingClose))}}if(!l&&-1===[void 0,""].indexOf(L.json))try{L.jsObject=JSON.parse(L.json)}catch(e){const n=e.message,r=n.indexOf("position");if(-1===r)throw new Error("Error parsing failed");const a=n.substring(r+9,n.length),i=parseInt(a);let o=0,s=0,d=!1,m=1,p=!1;for(;o<i&&!p&&("linebreak"===(d=L.tokens_merge[s]).type&&m++,-1===["space","linebreak"].indexOf(d.type)&&(o+=d.string.length),!(o>=i));)s++,L.tokens_merge[s+1]||(p=!0);u=m;let h=0;for(let e=0;e<d.string.length;e++){const n=d.string.charAt(e);"\\"===n?h=h>0?h+1:1:(h%2==0&&0!==h||-1==="'\"bfnrt".indexOf(n)&&c(s,Es(t.invalidToken.unexpected,{token:"\\"})),h=0)}l||c(s,Es(t.invalidToken.unexpected,{token:d.string}))}let x=1,j=0;function y(){for(var e=[],t=0;t<2*j;t++)e.push("&nbsp;");return e.join("")}function g(e=!1){return x++,j>0||e?"<br>":""}function b(e=!1){return g(e)+y()}if(!l)for(r=0;r<L.tokens_merge.length;r++){const e=L.tokens_merge[r],t=e.string;switch(e.type){case"space":case"linebreak":break;case"string":case"number":case"primitive":case"error":L.markup+=(m(r,[",","["])?b():"")+n(r,e,j);break;case"key":L.markup+=b()+n(r,e,j);break;case"colon":L.markup+=n(r,e,j)+"&nbsp;";break;case"symbol":switch(t){case"[":case"{":L.markup+=(m(r,[":"])?"":b())+n(r,e,j),j++;break;case"]":case"}":j--;const t=r===L.tokens_merge.length-1,a=r>0?["[","{"].indexOf(L.tokens_merge[r-1].string)>-1?"":b(t):"";L.markup+=a+n(r,e,j);break;case",":L.markup+=n(r,e,j)}}}if(l){let e=1;function v(e){let t=0;for(var n=0;n<e.length;n++)["\n","\r"].indexOf(e[n])>-1&&t++;return t}x=1;for(r=0;r<L.tokens_merge.length;r++){const t=L.tokens_merge[r],a=t.type,i=t.string;"linebreak"===a&&x++,L.markup+=n(r,t,j),e+=v(i)}e++,++x<e&&(x=e)}for(r=0;r<L.tokens_merge.length;r++){let e=L.tokens_merge[r];L.indented+=e.string,-1===["space","linebreak"].indexOf(e.type)&&(L.tokens_plainText+=e.string)}if(l){"modifyErrorText"in this.props&&((M=this.props.modifyErrorText)&&"[object Function]"==={}.toString.call(M)&&(l.reason=this.props.modifyErrorText(l.reason)))}return{tokens:L.tokens_merge,noSpaces:L.tokens_plainText,indented:L.indented,json:L.json,jsObject:L.jsObject,markup:L.markup,lines:x,error:l}}var M;if(!("nodeType"in e)){let t={inputText:JSON.stringify(e),position:0,currentChar:"",tokenPrimary:"",tokenSecondary:"",brackets:[],isValue:!1,stringOpen:!1,stringStart:0,tokens:[]};function w(){return"\\"===t.currentChar&&(t.inputText=(e=t.inputText,n=t.position,e.slice(0,n)+e.slice(n+1)),!0);var e,n}function k(){if(-1==="'\"".indexOf(t.currentChar))return!1;if(!t.stringOpen)return Y(),t.stringStart=t.position,t.stringOpen=t.currentChar,!0;if(t.stringOpen===t.currentChar){return Y(),D(t.inputText.substring(t.stringStart,t.position+1)),t.stringOpen=!1,!0}return!1}function L(){if(-1===":,{}[]".indexOf(t.currentChar))return!1;if(t.stringOpen)return!1;switch(Y(),D(t.currentChar),t.currentChar){case":":return t.isValue=!0,!0;case"{":case"[":t.brackets.push(t.currentChar);break;case"}":case"]":t.brackets.pop()}return":"!==t.currentChar&&(t.isValue="["===t.brackets[t.brackets.length-1]),!0}function Y(){return 0!==t.tokenSecondary.length&&(t.tokens.push(t.tokenSecondary),t.tokenSecondary="",!0)}function D(e){return 0!==e.length&&(t.tokens.push(e),!0)}for(r=0;r<t.inputText.length;r++){t.position=r,t.currentChar=t.inputText.charAt(t.position);const e=L(),n=k(),a=w();e||n||a||t.stringOpen||(t.tokenSecondary+=t.currentChar)}let a={brackets:[],isValue:!1,tokens:[]};a.tokens=t.tokens.map(e=>{let t="",n="",r="";switch(e){case",":t="symbol",n=e,r=e,a.isValue="["===a.brackets[a.brackets.length-1];break;case":":t="symbol",n=e,r=e,a.isValue=!0;break;case"{":case"[":t="symbol",n=e,r=e,a.brackets.push(e),a.isValue="["===a.brackets[a.brackets.length-1];break;case"}":case"]":t="symbol",n=e,r=e,a.brackets.pop(),a.isValue="["===a.brackets[a.brackets.length-1];break;case"undefined":t="primitive",n=e,r=void 0;break;case"null":t="primitive",n=e,r=null;break;case"false":t="primitive",n=e,r=!1;break;case"true":t="primitive",n=e,r=!0;break;default:const o=e.charAt(0);if("'\"".indexOf(o)>-1){if("key"===(t=a.isValue?"string":"key")&&(n=function(e){if(0===e.length)return e;if(['""',"''"].indexOf(e)>-1)return"''";let t=!1;for(var n=0;n<2;n++)if([e.charAt(0),e.charAt(e.length-1)].indexOf(['"',"'"][n])>-1){t=!0;break}t&&e.length>=2&&(e=e.slice(1,-1));const r=e.replace(/\w/g,""),a=(e.replace(/\W+/g,""),((e,t)=>{let n=!1;for(var r=0;r<t.length&&(0!==r||!isNaN(t.charAt(r)));r++)if(isNaN(t.charAt(r))){n=!0;break}return!(e.length>0||n)})(r,e));if((e=>{for(var t=0;t<e.length;t++)if(["'",'"'].indexOf(e.charAt(t))>-1)return!0;return!1})(r)){let t="";const n=e.split("");for(var i=0;i<n.length;i++){let e=n[i];["'",'"'].indexOf(e)>-1&&(e="\\"+e),t+=e}e=t}return a?e:"'"+e+"'"}(e)),"string"===t){n="";const t=e.slice(1,-1).split("");for(var i=0;i<t.length;i++){let e=t[i];"'\"".indexOf(e)>-1&&(e="\\"+e),n+=e}n="'"+n+"'"}r=n;break}if(!isNaN(e)){t="number",n=e,r=Number(e);break}if(e.length>0&&!a.isValue){t="key",(n=e).indexOf(" ")>-1&&(n="'"+n+"'"),r=n;break}}return{type:t,string:n,value:r,depth:a.brackets.length}});let i="";for(r=0;r<a.tokens.length;r++){i+=a.tokens[r].string}function T(e){for(var t=[],n=0;n<2*e;n++)t.push(" ");return(e>0?"\n":"")+t.join("")}let o="";for(r=0;r<a.tokens.length;r++){let e=a.tokens[r];switch(e.string){case"[":case"{":const t=r<a.tokens.length-1-1?a.tokens[r+1]:"";-1==="}]".indexOf(t.string)?o+=e.string+T(e.depth):o+=e.string;break;case"]":case"}":const n=r>0?a.tokens[r-1]:"";-1==="[{".indexOf(n.string)?o+=T(e.depth)+e.string:o+=e.string;break;case":":o+=e.string+" ";break;case",":o+=e.string+T(e.depth);break;default:o+=e.string}}let s=1;function S(e){var t=[];e>0&&s++;for(var n=0;n<2*e;n++)t.push("&nbsp;");return(e>0?"<br>":"")+t.join("")}let l="";const u=a.tokens.length-1;for(r=0;r<a.tokens.length;r++){let e=a.tokens[r],t=n(r,e,e.depth);switch(e.string){case"{":case"[":const n=r<a.tokens.length-1-1?a.tokens[r+1]:"";-1==="}]".indexOf(n.string)?l+=t+S(e.depth):l+=t;break;case"}":case"]":const i=r>0?a.tokens[r-1]:"";-1==="[{".indexOf(i.string)?l+=S(e.depth)+(u===r?"<br>":"")+t:l+=t;break;case":":l+=t+" ";break;case",":l+=t+S(e.depth);break;default:l+=t}}return s+=2,{tokens:a.tokens,noSpaces:i,indented:o,json:JSON.stringify(e),jsObject:e,markup:l,lines:s}}}}var Ps=Hs,As=n(133),zs=n.n(As);function Fs(e){return(Fs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ws(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ns(e){return(Ns=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Rs(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Is(e,t){return(Is=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Bs=wp.i18n.__,Us=wp.element.Component,Vs=wp.components,Js=Vs.ExternalLink,Gs=Vs.PanelBody,qs=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==Fs(t)&&"function"!=typeof t?Rs(e):t}(this,Ns(t).apply(this,arguments))).isValidJSON=e.isValidJSON.bind(Rs(e)),e}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Is(e,t)}(t,e),n=t,(r=[{key:"isValidJSON",value:function(e){try{JSON.parse(e)}catch(e){return!1}return!0}},{key:"render",value:function(){var e,t=this,n=this.props.chart["visualizer-settings"];return e=0<=["gauge","table","timeline"].indexOf(this.props.chart["visualizer-chart-type"])?this.props.chart["visualizer-chart-type"]:"".concat(this.props.chart["visualizer-chart-type"],"chart"),wp.element.createElement(Gs,{title:Bs("Manual Configuration"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement("p",null,Bs("Configure the graph by providing configuration variables right from the Google Visualization API.")),wp.element.createElement("p",null,wp.element.createElement(Js,{href:"https://developers.google.com/chart/interactive/docs/gallery/".concat(e,"#configuration-options")},Bs("Google Visualization API"))),wp.element.createElement(Ps,{locale:zs.a,theme:"light_mitsuketa_tribute",placeholder:$(n.manual)?JSON.parse(n.manual):{},width:"100%",height:"250px",style:{errorMessage:{height:"100%",fontSize:"10px"},container:{border:"1px solid #ddd",boxShadow:"inset 0 1px 2px rgba(0,0,0,.07)"},labelColumn:{background:"#F5F5F5",width:"auto",padding:"5px 10px 5px 10px"}},onChange:function(e){!1===e.error&&(n.manual=e.json,t.props.edit(n))}}))}}])&&Ws(n.prototype,r),a&&Ws(n,a),t}(Us);function $s(e){return($s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ks(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Zs(e,t){return!t||"object"!==$s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Qs(e){return(Qs=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Xs(e,t){return(Xs=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var el=wp.element,tl=el.Component,nl=el.Fragment,rl=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Zs(this,Qs(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Xs(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this.props.chart["visualizer-chart-type"];return wp.element.createElement(nl,null,wp.element.createElement(Gt,{chart:this.props.chart,edit:this.props.edit}),-1>=["table","gauge","geo","pie","timeline","dataTable"].indexOf(e)&&wp.element.createElement(dn,{chart:this.props.chart,edit:this.props.edit}),-1>=["table","gauge","geo","pie","timeline","dataTable"].indexOf(e)&&wp.element.createElement(Sn,{chart:this.props.chart,edit:this.props.edit}),0<=["pie"].indexOf(e)&&wp.element.createElement(nl,null,wp.element.createElement(Vn,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(ar,{chart:this.props.chart,edit:this.props.edit})),0<=["area","scatter","line"].indexOf(e)&&wp.element.createElement(gr,{chart:this.props.chart,edit:this.props.edit}),0<=["bar","column"].indexOf(e)&&wp.element.createElement(xr,{chart:this.props.chart,edit:this.props.edit}),0<=["candlestick"].indexOf(e)&&wp.element.createElement(Ur,{chart:this.props.chart,edit:this.props.edit}),0<=["geo"].indexOf(e)&&wp.element.createElement(nl,null,wp.element.createElement(ra,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(fa,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(xa,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(Ia,{chart:this.props.chart,edit:this.props.edit})),0<=["gauge"].indexOf(e)&&wp.element.createElement(ai,{chart:this.props.chart,edit:this.props.edit}),0<=["timeline"].indexOf(e)&&wp.element.createElement(yi,{chart:this.props.chart,edit:this.props.edit}),0<=["table","dataTable"].indexOf(e)&&wp.element.createElement(nl,null,wp.element.createElement(Ei,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(Gi,{chart:this.props.chart,edit:this.props.edit})),0<=["combo"].indexOf(e)&&wp.element.createElement(ao,{chart:this.props.chart,edit:this.props.edit}),-1>=["timeline","gauge","geo","pie","dataTable"].indexOf(e)&&wp.element.createElement(wo,{chart:this.props.chart,edit:this.props.edit}),0<=["pie"].indexOf(e)&&wp.element.createElement(Po,{chart:this.props.chart,edit:this.props.edit}),0<=["dataTable"].indexOf(e)&&wp.element.createElement($o,{chart:this.props.chart,edit:this.props.edit}),-1>=["dataTable"].indexOf(e)&&wp.element.createElement(ms,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(Ys,{chart:this.props.chart,edit:this.props.edit}),-1>=["dataTable"].indexOf(e)&&wp.element.createElement(qs,{chart:this.props.chart,edit:this.props.edit}))}}])&&Ks(n.prototype,r),a&&Ks(n,a),t}(tl);function al(e){return(al="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function il(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function ol(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){il(i,r,a,o,s,"next",e)}function s(e){il(i,r,a,o,s,"throw",e)}o(void 0)}))}}function sl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ll(e){return(ll=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ul(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cl(e,t){return(cl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var dl=wp.i18n.__,ml=wp.apiFetch,pl=wp.element,hl=pl.Component,_l=pl.Fragment,fl=wp.components,yl=fl.Button,gl=fl.PanelBody,bl=fl.SelectControl,vl=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==al(t)&&"function"!=typeof t?ul(e):t}(this,ll(t).apply(this,arguments))).getPermissionData=e.getPermissionData.bind(ul(e)),e.state={users:[],roles:[]},e}var n,r,a,i,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&cl(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:(o=ol(regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("business"!==visualizerLocalize.isPro){e.next=14;break}if(void 0===(t=this.props.chart["visualizer-permissions"]).permissions){e.next=14;break}if(void 0===t.permissions.read||void 0===t.permissions.edit){e.next=14;break}if("users"!==t.permissions.read&&"users"!==t.permissions.edit){e.next=9;break}return e.next=7,ml({path:"/visualizer/v1/get-permission-data?type=users"});case 7:n=e.sent,this.setState({users:n});case 9:if("roles"!==t.permissions.read&&"roles"!==t.permissions.edit){e.next=14;break}return e.next=12,ml({path:"/visualizer/v1/get-permission-data?type=roles"});case 12:r=e.sent,this.setState({roles:r});case 14:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"getPermissionData",value:(i=ol(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("business"!==visualizerLocalize.isPro){e.next=11;break}if("users"!==t||0!==this.state.users.length){e.next=6;break}return e.next=4,ml({path:"/visualizer/v1/get-permission-data?type=".concat(t)});case 4:n=e.sent,this.setState({users:n});case 6:if("roles"!==t||0!==this.state.roles.length){e.next=11;break}return e.next=9,ml({path:"/visualizer/v1/get-permission-data?type=".concat(t)});case 9:r=e.sent,this.setState({roles:r});case 11:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"render",value:function(){var e,t=this;return"business"===visualizerLocalize.isPro&&(e=this.props.chart["visualizer-permissions"]),wp.element.createElement(_l,null,"business"===visualizerLocalize.isPro?wp.element.createElement(gl,{title:dl("Who can see this chart?"),initialOpen:!1},wp.element.createElement(bl,{label:dl("Select who can view the chart on the front-end."),value:e.permissions.read,options:[{value:"all",label:"All Users"},{value:"users",label:"Select Users"},{value:"roles",label:"Select Roles"}],onChange:function(n){e.permissions.read=n,t.props.edit(e),"users"!==n&&"roles"!==n||t.getPermissionData(n)}}),("users"===e.permissions.read||"roles"===e.permissions.read)&&wp.element.createElement(bl,{multiple:!0,value:e.permissions["read-specific"],options:"users"===e.permissions.read&&this.state.users||"roles"===e.permissions.read&&this.state.roles,onChange:function(n){e.permissions["read-specific"]=n,t.props.edit(e)}})):wp.element.createElement(gl,{title:dl("Who can see this chart?"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,dl("Enable this feature in BUSINESS version!")),wp.element.createElement(yl,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},dl("Buy Now"))),"business"===visualizerLocalize.isPro?wp.element.createElement(gl,{title:dl("Who can edit this chart?"),initialOpen:!1},wp.element.createElement(bl,{label:dl("Select who can edit the chart on the front-end."),value:e.permissions.edit,options:[{value:"all",label:"All Users"},{value:"users",label:"Select Users"},{value:"roles",label:"Select Roles"}],onChange:function(n){e.permissions.edit=n,t.props.edit(e),"users"!==n&&"roles"!==n||t.getPermissionData(n)}}),("users"===e.permissions.edit||"roles"===e.permissions.edit)&&wp.element.createElement(bl,{multiple:!0,value:e.permissions["edit-specific"],options:"users"===e.permissions.edit&&this.state.users||"roles"===e.permissions.edit&&this.state.roles,onChange:function(n){e.permissions["edit-specific"]=n,t.props.edit(e)}})):wp.element.createElement(gl,{title:dl("Who can edit this chart?"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,dl("Enable this feature in BUSINESS version!")),wp.element.createElement(yl,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},dl("Buy Now"))))}}])&&sl(n.prototype,r),a&&sl(n,a),t}(hl),Ml=n(134),wl=n.n(Ml),kl=wp.components,Ll=kl.Button,Yl=kl.Dashicon,Dl=kl.G,Tl=kl.Path,Sl=kl.SVG;var Ol=function(e){var t=e.label,n=e.icon,r=e.className,a=e.isBack,i=e.onClick,o=wl()("components-panel__body","components-panel__body-button",r,{"visualizer-panel-back":a});return wp.element.createElement("div",{className:o},wp.element.createElement("h2",{className:"components-panel__body-title"},wp.element.createElement(Ll,{className:"components-panel__body-toggle",onClick:i},wp.element.createElement(Sl,{className:"components-panel__arrow",width:"24px",height:"24px",viewBox:"-12 -12 48 48",xmlns:"http://www.w3.org/2000/svg"},wp.element.createElement(Dl,null,wp.element.createElement(Tl,{fill:"none",d:"M0,0h24v24H0V0z"})),wp.element.createElement(Dl,null,wp.element.createElement(Tl,{d:"M7.41,8.59L12,13.17l4.59-4.58L18,10l-6,6l-6-6L7.41,8.59z"}))),n&&wp.element.createElement(Yl,{icon:n,className:"components-panel__icon"}),t)))},xl=n(3),jl=n.n(xl);function El(e){return(El="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Cl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Hl(e,t){return!t||"object"!==El(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Pl(e){return(Pl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Al(e,t){return(Al=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var zl=lodash.startCase,Fl=wp.i18n.__,Wl=wp.element,Nl=Wl.Component,Rl=Wl.Fragment,Il=wp.editor.InspectorControls,Bl=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=Hl(this,Pl(t).apply(this,arguments))).state={route:"home"},e}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Al(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e,t=this,n=V(JSON.parse(JSON.stringify(this.props.chart)));return e=0<=["gauge","table","timeline","dataTable"].indexOf(this.props.chart["visualizer-chart-type"])?"dataTable"===n["visualizer-chart-type"]?n["visualizer-chart-type"]:zl(this.props.chart["visualizer-chart-type"]):"".concat(zl(this.props.chart["visualizer-chart-type"]),"Chart"),wp.element.createElement(Rl,null,"home"===this.state.route&&wp.element.createElement(Il,null,wp.element.createElement(Se,{chart:this.props.chart,readUploadedFile:this.props.readUploadedFile}),wp.element.createElement(Ie,{chart:this.props.chart,editURL:this.props.editURL,isLoading:this.props.isLoading,uploadData:this.props.uploadData,editSchedule:this.props.editSchedule}),wp.element.createElement(ot,{getChartData:this.props.getChartData,isLoading:this.props.isLoading}),wp.element.createElement(Et,{chart:this.props.chart,editChartData:this.props.editChartData}),wp.element.createElement(Ol,{label:Fl("Advanced Options"),icon:"admin-tools",onClick:function(){return t.setState({route:"showAdvanced"})}}),wp.element.createElement(Ol,{label:Fl("Chart Permissions"),icon:"admin-users",onClick:function(){return t.setState({route:"showPermissions"})}})),("showAdvanced"===this.state.route||"showPermissions"===this.state.route)&&wp.element.createElement(Il,null,wp.element.createElement(Ol,{label:Fl("Chart Settings"),onClick:function(){return t.setState({route:"home"})},isBack:!0}),"showAdvanced"===this.state.route&&wp.element.createElement(rl,{chart:this.props.chart,edit:this.props.editSettings}),"showPermissions"===this.state.route&&wp.element.createElement(vl,{chart:this.props.chart,edit:this.props.editPermissions})),wp.element.createElement("div",{className:"visualizer-settings__chart"},null!==this.props.chart&&"dataTable"===e?wp.element.createElement(N,{id:this.props.id,rows:n["visualizer-data"],columns:n["visualizer-series"],options:n["visualizer-settings"]}):wp.element.createElement(O,{chartType:e,rows:n["visualizer-data"],columns:n["visualizer-series"],options:$(this.props.chart["visualizer-settings"].manual)?jl()(G(this.props.chart["visualizer-settings"]),JSON.parse(this.props.chart["visualizer-settings"].manual)):G(this.props.chart["visualizer-settings"]),height:"500px"})))}}])&&Cl(n.prototype,r),a&&Cl(n,a),t}(Nl);function Ul(e){return(Ul="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Vl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Jl(e,t){return!t||"object"!==Ul(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Gl(e){return(Gl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ql(e,t){return(ql=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var $l=lodash.startCase,Kl=wp.i18n.__,Zl=wp.element,Ql=Zl.Component,Xl=Zl.Fragment,eu=wp.components,tu=eu.Button,nu=eu.Dashicon,ru=eu.Toolbar,au=eu.Tooltip,iu=wp.editor.BlockControls,ou=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Jl(this,Gl(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ql(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e,t=V(JSON.parse(JSON.stringify(this.props.chart)));return e=0<=["gauge","table","timeline","dataTable"].indexOf(this.props.chart["visualizer-chart-type"])?"dataTable"===t["visualizer-chart-type"]?t["visualizer-chart-type"]:$l(this.props.chart["visualizer-chart-type"]):"".concat($l(this.props.chart["visualizer-chart-type"]),"Chart"),wp.element.createElement("div",{className:this.props.className},null!==this.props.chart&&wp.element.createElement(Xl,null,wp.element.createElement(iu,{key:"toolbar-controls"},wp.element.createElement(ru,{className:"components-toolbar"},wp.element.createElement(au,{text:Kl("Edit Chart")},wp.element.createElement(tu,{className:"components-icon-button components-toolbar__control edit-pie-chart",onClick:this.props.editChart},wp.element.createElement(nu,{icon:"edit"}))))),"dataTable"===e?wp.element.createElement(N,{id:this.props.id,rows:t["visualizer-data"],columns:t["visualizer-series"],options:t["visualizer-settings"]}):wp.element.createElement(O,{chartType:e,rows:t["visualizer-data"],columns:t["visualizer-series"],options:$(this.props.chart["visualizer-settings"].manual)?jl()(G(this.props.chart["visualizer-settings"]),JSON.parse(this.props.chart["visualizer-settings"].manual)):G(this.props.chart["visualizer-settings"]),height:"500px"})))}}])&&Vl(n.prototype,r),a&&Vl(n,a),t}(Ql);function su(e){return(su="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function lu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function uu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lu(n,!0).forEach((function(t){cu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lu(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function cu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function du(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function mu(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){du(i,r,a,o,s,"next",e)}function s(e){du(i,r,a,o,s,"throw",e)}o(void 0)}))}}function pu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function hu(e){return(hu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fu(e,t){return(fu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var yu=wp.i18n.__,gu=wp,bu=gu.apiFetch,vu=gu.apiRequest,Mu=wp.element,wu=Mu.Component,ku=Mu.Fragment,Lu=wp.components,Yu=Lu.Button,Du=Lu.ButtonGroup,Tu=Lu.Dashicon,Su=Lu.Placeholder,Ou=Lu.Spinner,xu=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==su(t)&&"function"!=typeof t?_u(e):t}(this,hu(t).apply(this,arguments))).getChart=e.getChart.bind(_u(e)),e.editChart=e.editChart.bind(_u(e)),e.editSettings=e.editSettings.bind(_u(e)),e.editPermissions=e.editPermissions.bind(_u(e)),e.readUploadedFile=e.readUploadedFile.bind(_u(e)),e.editURL=e.editURL.bind(_u(e)),e.editSchedule=e.editSchedule.bind(_u(e)),e.uploadData=e.uploadData.bind(_u(e)),e.getChartData=e.getChartData.bind(_u(e)),e.editChartData=e.editChartData.bind(_u(e)),e.updateChart=e.updateChart.bind(_u(e)),e.state={route:e.props.attributes.route?e.props.attributes.route:"home",chart:null,isModified:!1,isLoading:!1,isScheduled:!1},e}var n,r,a,i,o,s;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&fu(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:(s=mu(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.props.attributes.id){e.next=5;break}return e.next=3,bu({path:"wp/v2/visualizer/".concat(this.props.attributes.id)});case 3:t=e.sent,this.setState({chart:t.chart_data});case 5:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"getChart",value:(o=mu(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setState({isLoading:"getChart"});case 2:return e.next=4,bu({path:"wp/v2/visualizer/".concat(t)});case 4:n=e.sent,this.setState({route:"chartSelect",chart:n.chart_data,isLoading:!1}),this.props.setAttributes({id:t,route:"chartSelect"});case 7:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"editChart",value:function(){this.setState({route:"chartSelect"}),this.props.setAttributes({route:"chartSelect"})}},{key:"editSettings",value:function(e){var t=uu({},this.state.chart);t["visualizer-settings"]=e,this.setState({chart:t,isModified:!0})}},{key:"editPermissions",value:function(e){var t=uu({},this.state.chart);t["visualizer-permissions"]=e,this.setState({chart:t,isModified:!0})}},{key:"readUploadedFile",value:function(e){var t=this,n=e.current.files[0],r=new FileReader;r.onload=function(){var e=function(e,t){t=t||",";for(var n=new RegExp("(\\"+t+"|\\r?\\n|\\r|^)(?:'([^']*(?:''[^']*)*)'|([^'\\"+t+"\\r\\n]*))","gi"),r=[[]],a=null;a=n.exec(e);){var i=a[1];i.length&&i!==t&&r.push([]);var o=void 0;o=a[2]?a[2].replace(new RegExp("''","g"),"'"):a[3],r[r.length-1].push(o)}return r}(r.result);t.editChartData(e,"Visualizer_Source_Csv")},r.readAsText(n)}},{key:"editURL",value:function(e){var t=uu({},this.state.chart);t["visualizer-chart-url"]=e,this.setState({chart:t})}},{key:"editSchedule",value:function(e){var t=uu({},this.state.chart);t["visualizer-chart-schedule"]=e,this.setState({chart:t})}},{key:"uploadData",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.setState({isLoading:"uploadData",isScheduled:t}),vu({path:"/visualizer/v1/upload-data?url=".concat(this.state.chart["visualizer-chart-url"]),method:"POST"}).then((function(t){if(2<=Object.keys(t).length){var n=uu({},e.state.chart);n["visualizer-source"]="Visualizer_Source_Csv_Remote",n["visualizer-default-data"]=0,n["visualizer-series"]=t.series,n["visualizer-data"]=t.data;var r=n["visualizer-series"],a=n["visualizer-settings"],i=r,o="series";return"pie"===n["visualizer-chart-type"]&&(i=n["visualizer-data"],o="slices"),i.map((function(e,t){if("pie"===n["visualizer-chart-type"]||0!==t){var r="pie"!==n["visualizer-chart-type"]?t-1:t;void 0===a[o][r]&&(a[o][r]={},a[o][r].temp=1)}})),a[o]=a[o].filter((function(e,t){return t<("pie"!==n["visualizer-chart-type"]?i.length-1:i.length)})),n["visualizer-settings"]=a,e.setState({chart:n,isModified:!0,isLoading:!1}),t}e.setState({isLoading:!1})}),(function(t){return e.setState({isLoading:!1}),t}))}},{key:"getChartData",value:(i=mu(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setState({isLoading:"getChartData"});case 2:return e.next=4,bu({path:"wp/v2/visualizer/".concat(t)});case 4:n=e.sent,(r=uu({},this.state.chart))["visualizer-source"]="Visualizer_Source_Csv",r["visualizer-default-data"]=0,r["visualizer-series"]=n.chart_data["visualizer-series"],r["visualizer-data"]=n.chart_data["visualizer-data"],this.setState({isLoading:!1,chart:r});case 11:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"editChartData",value:function(e,t){var n=uu({},this.state.chart),r=[],a=uu({},n["visualizer-settings"]);e[0].map((function(t,n){r[n]={label:t,type:e[1][n]}})),e.splice(0,2);var i=r,o="series";"pie"===n["visualizer-chart-type"]&&(i=e,o="slices"),i.map((function(e,t){if("pie"===n["visualizer-chart-type"]||0!==t){var r="pie"!==n["visualizer-chart-type"]?t-1:t;void 0===a[o][r]&&(a[o][r]={},a[o][r].temp=1)}})),a[o]=a[o].filter((function(e,t){return t<("pie"!==n["visualizer-chart-type"]?i.length-1:i.length)})),n["visualizer-source"]=t,n["visualizer-default-data"]=0,n["visualizer-data"]=e,n["visualizer-series"]=r,n["visualizer-settings"]=a,n["visualizer-chart-url"]="",this.setState({chart:n,isModified:!0,isScheduled:!1})}},{key:"updateChart",value:function(){var e=this;this.setState({isLoading:"updateChart"});var t=this.state.chart;!1===this.state.isScheduled&&(t["visualizer-chart-schedule"]="");var n="series";"pie"===t["visualizer-chart-type"]&&(n="slices"),Object.keys(t["visualizer-settings"][n]).map((function(e){void 0!==t["visualizer-settings"][n][e]&&void 0!==t["visualizer-settings"][n][e].temp&&delete t["visualizer-settings"][n][e].temp})),vu({path:"/visualizer/v1/update-chart?id=".concat(this.props.attributes.id),method:"POST",data:t}).then((function(t){return e.setState({isLoading:!1,isModified:!1}),t}),(function(e){return e}))}},{key:"render",value:function(){var e=this;return"renderChart"===this.state.route&&null!==this.state.chart?wp.element.createElement(ou,{id:this.props.attributes.id,chart:this.state.chart,className:this.props.className,editChart:this.editChart}):wp.element.createElement("div",{className:"visualizer-settings"},wp.element.createElement("div",{className:"visualizer-settings__title"},wp.element.createElement(Tu,{icon:"chart-pie"}),yu("Visualizer")),"home"===this.state.route&&wp.element.createElement("div",{className:"visualizer-settings__content"},wp.element.createElement("div",{className:"visualizer-settings__content-description"},yu("Make a new chart or display an existing one?")),wp.element.createElement("a",{href:visualizerLocalize.adminPage,target:"_blank",className:"visualizer-settings__content-option"},wp.element.createElement("span",{className:"visualizer-settings__content-option-title"},yu("Create a new chart")),wp.element.createElement("div",{className:"visualizer-settings__content-option-icon"},wp.element.createElement(Tu,{icon:"arrow-right-alt2"}))),wp.element.createElement("div",{className:"visualizer-settings__content-option",onClick:function(){e.setState({route:"showCharts"}),e.props.setAttributes({route:"showCharts"})}},wp.element.createElement("span",{className:"visualizer-settings__content-option-title"},yu("Display an existing chart")),wp.element.createElement("div",{className:"visualizer-settings__content-option-icon"},wp.element.createElement(Tu,{icon:"arrow-right-alt2"})))),("getChart"===this.state.isLoading||"chartSelect"===this.state.route&&null===this.state.chart||"renderChart"===this.state.route&&null===this.state.chart)&&wp.element.createElement(Su,null,wp.element.createElement(Ou,null)),"showCharts"===this.state.route&&!1===this.state.isLoading&&wp.element.createElement(fe,{getChart:this.getChart}),"chartSelect"===this.state.route&&null!==this.state.chart&&wp.element.createElement(Bl,{id:this.props.attributes.id,chart:this.state.chart,editSettings:this.editSettings,editPermissions:this.editPermissions,url:this.state.url,readUploadedFile:this.readUploadedFile,editURL:this.editURL,editSchedule:this.editSchedule,uploadData:this.uploadData,getChartData:this.getChartData,editChartData:this.editChartData,isLoading:this.state.isLoading}),wp.element.createElement("div",{className:"visualizer-settings__controls"},("showCharts"===this.state.route||"chartSelect"===this.state.route)&&wp.element.createElement(Du,null,wp.element.createElement(Yu,{isDefault:!0,isLarge:!0,onClick:function(){var t;"showCharts"===e.state.route?t="home":"chartSelect"===e.state.route&&(t="showCharts"),e.setState({route:t}),e.props.setAttributes({route:t})}},yu("Back")),"chartSelect"===this.state.route&&wp.element.createElement(ku,null,!1===this.state.isModified?wp.element.createElement(Yu,{isDefault:!0,isLarge:!0,onClick:function(){e.setState({route:"renderChart"}),e.props.setAttributes({route:"renderChart"})}},yu("Done")):wp.element.createElement(Yu,{isPrimary:!0,isLarge:!0,isBusy:"updateChart"===this.state.isLoading,disabled:"updateChart"===this.state.isLoading,onClick:this.updateChart},yu("Save"))))))}}])&&pu(n.prototype,r),a&&pu(n,a),t}(wu),ju=(n(153),wp.i18n.__),Eu=wp.blocks.registerBlockType;t.default=Eu("visualizer/chart",{title:ju("Visualizer Chart"),description:ju("A simple, easy to use and quite powerful tool to create, manage and embed interactive charts into your WordPress posts and pages."),category:"common",icon:"chart-pie",keywords:[ju("Visualizer"),ju("Chart"),ju("Google Charts")],attributes:{id:{type:"number"},route:{type:"string"}},supports:{customClassName:!1},edit:xu,save:function(){return null}})}]);
1
+ !function(e){function t(t){for(var r,o,s=t[0],l=t[1],u=t[2],d=0,m=[];d<s.length;d++)o=s[d],Object.prototype.hasOwnProperty.call(a,o)&&a[o]&&m.push(a[o][0]),a[o]=0;for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r]);for(c&&c(t);m.length;)m.shift()();return i.push.apply(i,u||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],r=!0,s=1;s<n.length;s++){var l=n[s];0!==a[l]&&(r=!1)}r&&(i.splice(t--,1),e=o(o.s=n[0]))}return e}var r={},a={1:0},i=[];function o(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=e,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="";var s=window.webpackJsonp=window.webpackJsonp||[],l=s.push.bind(s);s.push=t,s=s.slice();for(var u=0;u<s.length;u++)t(s[u]);var c=l;i.push([154,0]),n()}([function(e,t,n){(function(e){e.exports=function(){"use strict";var t,r;function a(){return t.apply(null,arguments)}function i(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function o(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function s(e){return void 0===e}function l(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function u(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function c(e,t){var n,r=[];for(n=0;n<e.length;++n)r.push(t(e[n],n));return r}function d(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function m(e,t){for(var n in t)d(t,n)&&(e[n]=t[n]);return d(t,"toString")&&(e.toString=t.toString),d(t,"valueOf")&&(e.valueOf=t.valueOf),e}function p(e,t,n,r){return Et(e,t,n,r,!0).utc()}function h(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function _(e){if(null==e._isValid){var t=h(e),n=r.call(t.parsedDateParts,(function(e){return null!=e})),a=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(a=a&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return a;e._isValid=a}return e._isValid}function f(e){var t=p(NaN);return null!=e?m(h(t),e):h(t).userInvalidated=!0,t}r=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,r=0;r<n;r++)if(r in t&&e.call(this,t[r],r,t))return!0;return!1};var y=a.momentProperties=[];function g(e,t){var n,r,a;if(s(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),s(t._i)||(e._i=t._i),s(t._f)||(e._f=t._f),s(t._l)||(e._l=t._l),s(t._strict)||(e._strict=t._strict),s(t._tzm)||(e._tzm=t._tzm),s(t._isUTC)||(e._isUTC=t._isUTC),s(t._offset)||(e._offset=t._offset),s(t._pf)||(e._pf=h(t)),s(t._locale)||(e._locale=t._locale),y.length>0)for(n=0;n<y.length;n++)s(a=t[r=y[n]])||(e[r]=a);return e}var b=!1;function v(e){g(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===b&&(b=!0,a.updateOffset(this),b=!1)}function M(e){return e instanceof v||null!=e&&null!=e._isAMomentObject}function w(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function k(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=w(t)),n}function L(e,t,n){var r,a=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),o=0;for(r=0;r<a;r++)(n&&e[r]!==t[r]||!n&&k(e[r])!==k(t[r]))&&o++;return o+i}function Y(e){!1===a.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function D(e,t){var n=!0;return m((function(){if(null!=a.deprecationHandler&&a.deprecationHandler(null,e),n){for(var r,i=[],o=0;o<arguments.length;o++){if(r="","object"==typeof arguments[o]){for(var s in r+="\n["+o+"] ",arguments[0])r+=s+": "+arguments[0][s]+", ";r=r.slice(0,-2)}else r=arguments[o];i.push(r)}Y(e+"\nArguments: "+Array.prototype.slice.call(i).join("")+"\n"+(new Error).stack),n=!1}return t.apply(this,arguments)}),t)}var T,S={};function O(e,t){null!=a.deprecationHandler&&a.deprecationHandler(e,t),S[e]||(Y(t),S[e]=!0)}function j(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function x(e,t){var n,r=m({},e);for(n in t)d(t,n)&&(o(e[n])&&o(t[n])?(r[n]={},m(r[n],e[n]),m(r[n],t[n])):null!=t[n]?r[n]=t[n]:delete r[n]);for(n in e)d(e,n)&&!d(t,n)&&o(e[n])&&(r[n]=m({},r[n]));return r}function E(e){null!=e&&this.set(e)}a.suppressDeprecationWarnings=!1,a.deprecationHandler=null,T=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)d(e,t)&&n.push(t);return n};var C={};function H(e,t){var n=e.toLowerCase();C[n]=C[n+"s"]=C[t]=e}function P(e){return"string"==typeof e?C[e]||C[e.toLowerCase()]:void 0}function z(e){var t,n,r={};for(n in e)d(e,n)&&(t=P(n))&&(r[t]=e[n]);return r}var A={};function N(e,t){A[e]=t}function F(e,t,n){var r=""+Math.abs(e),a=t-r.length;return(e>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+r}var R=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,W=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,I={},B={};function J(e,t,n,r){var a=r;"string"==typeof r&&(a=function(){return this[r]()}),e&&(B[e]=a),t&&(B[t[0]]=function(){return F(a.apply(this,arguments),t[1],t[2])}),n&&(B[n]=function(){return this.localeData().ordinal(a.apply(this,arguments),e)})}function U(e,t){return e.isValid()?(t=q(t,e.localeData()),I[t]=I[t]||function(e){var t,n,r,a=e.match(R);for(t=0,n=a.length;t<n;t++)B[a[t]]?a[t]=B[a[t]]:a[t]=(r=a[t]).match(/\[[\s\S]/)?r.replace(/^\[|\]$/g,""):r.replace(/\\/g,"");return function(t){var r,i="";for(r=0;r<n;r++)i+=j(a[r])?a[r].call(t,e):a[r];return i}}(t),I[t](e)):e.localeData().invalidDate()}function q(e,t){var n=5;function r(e){return t.longDateFormat(e)||e}for(W.lastIndex=0;n>=0&&W.test(e);)e=e.replace(W,r),W.lastIndex=0,n-=1;return e}var V=/\d/,G=/\d\d/,$=/\d{3}/,K=/\d{4}/,Z=/[+-]?\d{6}/,Q=/\d\d?/,X=/\d\d\d\d?/,ee=/\d\d\d\d\d\d?/,te=/\d{1,3}/,ne=/\d{1,4}/,re=/[+-]?\d{1,6}/,ae=/\d+/,ie=/[+-]?\d+/,oe=/Z|[+-]\d\d:?\d\d/gi,se=/Z|[+-]\d\d(?::?\d\d)?/gi,le=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,ue={};function ce(e,t,n){ue[e]=j(t)?t:function(e,r){return e&&n?n:t}}function de(e,t){return d(ue,e)?ue[e](t._strict,t._locale):new RegExp(me(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(e,t,n,r,a){return t||n||r||a}))))}function me(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var pe={};function he(e,t){var n,r=t;for("string"==typeof e&&(e=[e]),l(t)&&(r=function(e,n){n[t]=k(e)}),n=0;n<e.length;n++)pe[e[n]]=r}function _e(e,t){he(e,(function(e,n,r,a){r._w=r._w||{},t(e,r._w,r,a)}))}function fe(e,t,n){null!=t&&d(pe,e)&&pe[e](t,n._a,n,e)}var ye=0,ge=1,be=2,ve=3,Me=4,we=5,ke=6,Le=7,Ye=8;function De(e){return Te(e)?366:365}function Te(e){return e%4==0&&e%100!=0||e%400==0}J("Y",0,0,(function(){var e=this.year();return e<=9999?""+e:"+"+e})),J(0,["YY",2],0,(function(){return this.year()%100})),J(0,["YYYY",4],0,"year"),J(0,["YYYYY",5],0,"year"),J(0,["YYYYYY",6,!0],0,"year"),H("year","y"),N("year",1),ce("Y",ie),ce("YY",Q,G),ce("YYYY",ne,K),ce("YYYYY",re,Z),ce("YYYYYY",re,Z),he(["YYYYY","YYYYYY"],ye),he("YYYY",(function(e,t){t[ye]=2===e.length?a.parseTwoDigitYear(e):k(e)})),he("YY",(function(e,t){t[ye]=a.parseTwoDigitYear(e)})),he("Y",(function(e,t){t[ye]=parseInt(e,10)})),a.parseTwoDigitYear=function(e){return k(e)+(k(e)>68?1900:2e3)};var Se,Oe=je("FullYear",!0);function je(e,t){return function(n){return null!=n?(Ee(this,e,n),a.updateOffset(this,t),this):xe(this,e)}}function xe(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function Ee(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&Te(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),Ce(n,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function Ce(e,t){if(isNaN(e)||isNaN(t))return NaN;var n,r=(t%(n=12)+n)%n;return e+=(t-r)/12,1===r?Te(e)?29:28:31-r%7%2}Se=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},J("M",["MM",2],"Mo",(function(){return this.month()+1})),J("MMM",0,0,(function(e){return this.localeData().monthsShort(this,e)})),J("MMMM",0,0,(function(e){return this.localeData().months(this,e)})),H("month","M"),N("month",8),ce("M",Q),ce("MM",Q,G),ce("MMM",(function(e,t){return t.monthsShortRegex(e)})),ce("MMMM",(function(e,t){return t.monthsRegex(e)})),he(["M","MM"],(function(e,t){t[ge]=k(e)-1})),he(["MMM","MMMM"],(function(e,t,n,r){var a=n._locale.monthsParse(e,r,n._strict);null!=a?t[ge]=a:h(n).invalidMonth=e}));var He=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Pe="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ze="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function Ae(e,t,n){var r,a,i,o=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)i=p([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(i,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(i,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(a=Se.call(this._shortMonthsParse,o))?a:null:-1!==(a=Se.call(this._longMonthsParse,o))?a:null:"MMM"===t?-1!==(a=Se.call(this._shortMonthsParse,o))?a:-1!==(a=Se.call(this._longMonthsParse,o))?a:null:-1!==(a=Se.call(this._longMonthsParse,o))?a:-1!==(a=Se.call(this._shortMonthsParse,o))?a:null}function Ne(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=k(t);else if(!l(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),Ce(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function Fe(e){return null!=e?(Ne(this,e),a.updateOffset(this,!0),this):xe(this,"Month")}var Re=le,We=le;function Ie(){function e(e,t){return t.length-e.length}var t,n,r=[],a=[],i=[];for(t=0;t<12;t++)n=p([2e3,t]),r.push(this.monthsShort(n,"")),a.push(this.months(n,"")),i.push(this.months(n,"")),i.push(this.monthsShort(n,""));for(r.sort(e),a.sort(e),i.sort(e),t=0;t<12;t++)r[t]=me(r[t]),a[t]=me(a[t]);for(t=0;t<24;t++)i[t]=me(i[t]);this._monthsRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+r.join("|")+")","i")}function Be(e,t,n,r,a,i,o){var s=new Date(e,t,n,r,a,i,o);return e<100&&e>=0&&isFinite(s.getFullYear())&&s.setFullYear(e),s}function Je(e){var t=new Date(Date.UTC.apply(null,arguments));return e<100&&e>=0&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function Ue(e,t,n){var r=7+t-n;return-(7+Je(e,0,r).getUTCDay()-t)%7+r-1}function qe(e,t,n,r,a){var i,o,s=1+7*(t-1)+(7+n-r)%7+Ue(e,r,a);return s<=0?o=De(i=e-1)+s:s>De(e)?(i=e+1,o=s-De(e)):(i=e,o=s),{year:i,dayOfYear:o}}function Ve(e,t,n){var r,a,i=Ue(e.year(),t,n),o=Math.floor((e.dayOfYear()-i-1)/7)+1;return o<1?r=o+Ge(a=e.year()-1,t,n):o>Ge(e.year(),t,n)?(r=o-Ge(e.year(),t,n),a=e.year()+1):(a=e.year(),r=o),{week:r,year:a}}function Ge(e,t,n){var r=Ue(e,t,n),a=Ue(e+1,t,n);return(De(e)-r+a)/7}J("w",["ww",2],"wo","week"),J("W",["WW",2],"Wo","isoWeek"),H("week","w"),H("isoWeek","W"),N("week",5),N("isoWeek",5),ce("w",Q),ce("ww",Q,G),ce("W",Q),ce("WW",Q,G),_e(["w","ww","W","WW"],(function(e,t,n,r){t[r.substr(0,1)]=k(e)})),J("d",0,"do","day"),J("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),J("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),J("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),J("e",0,0,"weekday"),J("E",0,0,"isoWeekday"),H("day","d"),H("weekday","e"),H("isoWeekday","E"),N("day",11),N("weekday",11),N("isoWeekday",11),ce("d",Q),ce("e",Q),ce("E",Q),ce("dd",(function(e,t){return t.weekdaysMinRegex(e)})),ce("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),ce("dddd",(function(e,t){return t.weekdaysRegex(e)})),_e(["dd","ddd","dddd"],(function(e,t,n,r){var a=n._locale.weekdaysParse(e,r,n._strict);null!=a?t.d=a:h(n).invalidWeekday=e})),_e(["d","e","E"],(function(e,t,n,r){t[r]=k(e)}));var $e="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ke="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ze="Su_Mo_Tu_We_Th_Fr_Sa".split("_");function Qe(e,t,n){var r,a,i,o=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)i=p([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(i,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(a=Se.call(this._weekdaysParse,o))?a:null:"ddd"===t?-1!==(a=Se.call(this._shortWeekdaysParse,o))?a:null:-1!==(a=Se.call(this._minWeekdaysParse,o))?a:null:"dddd"===t?-1!==(a=Se.call(this._weekdaysParse,o))?a:-1!==(a=Se.call(this._shortWeekdaysParse,o))?a:-1!==(a=Se.call(this._minWeekdaysParse,o))?a:null:"ddd"===t?-1!==(a=Se.call(this._shortWeekdaysParse,o))?a:-1!==(a=Se.call(this._weekdaysParse,o))?a:-1!==(a=Se.call(this._minWeekdaysParse,o))?a:null:-1!==(a=Se.call(this._minWeekdaysParse,o))?a:-1!==(a=Se.call(this._weekdaysParse,o))?a:-1!==(a=Se.call(this._shortWeekdaysParse,o))?a:null}var Xe=le,et=le,tt=le;function nt(){function e(e,t){return t.length-e.length}var t,n,r,a,i,o=[],s=[],l=[],u=[];for(t=0;t<7;t++)n=p([2e3,1]).day(t),r=this.weekdaysMin(n,""),a=this.weekdaysShort(n,""),i=this.weekdays(n,""),o.push(r),s.push(a),l.push(i),u.push(r),u.push(a),u.push(i);for(o.sort(e),s.sort(e),l.sort(e),u.sort(e),t=0;t<7;t++)s[t]=me(s[t]),l[t]=me(l[t]),u[t]=me(u[t]);this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function rt(){return this.hours()%12||12}function at(e,t){J(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function it(e,t){return t._meridiemParse}J("H",["HH",2],0,"hour"),J("h",["hh",2],0,rt),J("k",["kk",2],0,(function(){return this.hours()||24})),J("hmm",0,0,(function(){return""+rt.apply(this)+F(this.minutes(),2)})),J("hmmss",0,0,(function(){return""+rt.apply(this)+F(this.minutes(),2)+F(this.seconds(),2)})),J("Hmm",0,0,(function(){return""+this.hours()+F(this.minutes(),2)})),J("Hmmss",0,0,(function(){return""+this.hours()+F(this.minutes(),2)+F(this.seconds(),2)})),at("a",!0),at("A",!1),H("hour","h"),N("hour",13),ce("a",it),ce("A",it),ce("H",Q),ce("h",Q),ce("k",Q),ce("HH",Q,G),ce("hh",Q,G),ce("kk",Q,G),ce("hmm",X),ce("hmmss",ee),ce("Hmm",X),ce("Hmmss",ee),he(["H","HH"],ve),he(["k","kk"],(function(e,t,n){var r=k(e);t[ve]=24===r?0:r})),he(["a","A"],(function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e})),he(["h","hh"],(function(e,t,n){t[ve]=k(e),h(n).bigHour=!0})),he("hmm",(function(e,t,n){var r=e.length-2;t[ve]=k(e.substr(0,r)),t[Me]=k(e.substr(r)),h(n).bigHour=!0})),he("hmmss",(function(e,t,n){var r=e.length-4,a=e.length-2;t[ve]=k(e.substr(0,r)),t[Me]=k(e.substr(r,2)),t[we]=k(e.substr(a)),h(n).bigHour=!0})),he("Hmm",(function(e,t,n){var r=e.length-2;t[ve]=k(e.substr(0,r)),t[Me]=k(e.substr(r))})),he("Hmmss",(function(e,t,n){var r=e.length-4,a=e.length-2;t[ve]=k(e.substr(0,r)),t[Me]=k(e.substr(r,2)),t[we]=k(e.substr(a))}));var ot,st=je("Hours",!0),lt={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Pe,monthsShort:ze,week:{dow:0,doy:6},weekdays:$e,weekdaysMin:Ze,weekdaysShort:Ke,meridiemParse:/[ap]\.?m?\.?/i},ut={},ct={};function dt(e){return e?e.toLowerCase().replace("_","-"):e}function mt(t){var r=null;if(!ut[t]&&void 0!==e&&e&&e.exports)try{r=ot._abbr,n(149)("./"+t),pt(r)}catch(e){}return ut[t]}function pt(e,t){var n;return e&&(n=s(t)?_t(e):ht(e,t))&&(ot=n),ot._abbr}function ht(e,t){if(null!==t){var n=lt;if(t.abbr=e,null!=ut[e])O("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=ut[e]._config;else if(null!=t.parentLocale){if(null==ut[t.parentLocale])return ct[t.parentLocale]||(ct[t.parentLocale]=[]),ct[t.parentLocale].push({name:e,config:t}),null;n=ut[t.parentLocale]._config}return ut[e]=new E(x(n,t)),ct[e]&&ct[e].forEach((function(e){ht(e.name,e.config)})),pt(e),ut[e]}return delete ut[e],null}function _t(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return ot;if(!i(e)){if(t=mt(e))return t;e=[e]}return function(e){for(var t,n,r,a,i=0;i<e.length;){for(t=(a=dt(e[i]).split("-")).length,n=(n=dt(e[i+1]))?n.split("-"):null;t>0;){if(r=mt(a.slice(0,t).join("-")))return r;if(n&&n.length>=t&&L(a,n,!0)>=t-1)break;t--}i++}return null}(e)}function ft(e){var t,n=e._a;return n&&-2===h(e).overflow&&(t=n[ge]<0||n[ge]>11?ge:n[be]<1||n[be]>Ce(n[ye],n[ge])?be:n[ve]<0||n[ve]>24||24===n[ve]&&(0!==n[Me]||0!==n[we]||0!==n[ke])?ve:n[Me]<0||n[Me]>59?Me:n[we]<0||n[we]>59?we:n[ke]<0||n[ke]>999?ke:-1,h(e)._overflowDayOfYear&&(t<ye||t>be)&&(t=be),h(e)._overflowWeeks&&-1===t&&(t=Le),h(e)._overflowWeekday&&-1===t&&(t=Ye),h(e).overflow=t),e}function yt(e,t,n){return null!=e?e:null!=t?t:n}function gt(e){var t,n,r,i,o,s=[];if(!e._d){for(r=function(e){var t=new Date(a.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}(e),e._w&&null==e._a[be]&&null==e._a[ge]&&function(e){var t,n,r,a,i,o,s,l;if(null!=(t=e._w).GG||null!=t.W||null!=t.E)i=1,o=4,n=yt(t.GG,e._a[ye],Ve(Ct(),1,4).year),r=yt(t.W,1),((a=yt(t.E,1))<1||a>7)&&(l=!0);else{i=e._locale._week.dow,o=e._locale._week.doy;var u=Ve(Ct(),i,o);n=yt(t.gg,e._a[ye],u.year),r=yt(t.w,u.week),null!=t.d?((a=t.d)<0||a>6)&&(l=!0):null!=t.e?(a=t.e+i,(t.e<0||t.e>6)&&(l=!0)):a=i}r<1||r>Ge(n,i,o)?h(e)._overflowWeeks=!0:null!=l?h(e)._overflowWeekday=!0:(s=qe(n,r,a,i,o),e._a[ye]=s.year,e._dayOfYear=s.dayOfYear)}(e),null!=e._dayOfYear&&(o=yt(e._a[ye],r[ye]),(e._dayOfYear>De(o)||0===e._dayOfYear)&&(h(e)._overflowDayOfYear=!0),n=Je(o,0,e._dayOfYear),e._a[ge]=n.getUTCMonth(),e._a[be]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=s[t]=r[t];for(;t<7;t++)e._a[t]=s[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ve]&&0===e._a[Me]&&0===e._a[we]&&0===e._a[ke]&&(e._nextDay=!0,e._a[ve]=0),e._d=(e._useUTC?Je:Be).apply(null,s),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ve]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(h(e).weekdayMismatch=!0)}}var bt=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,vt=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Mt=/Z|[+-]\d\d(?::?\d\d)?/,wt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],kt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Lt=/^\/?Date\((\-?\d+)/i;function Yt(e){var t,n,r,a,i,o,s=e._i,l=bt.exec(s)||vt.exec(s);if(l){for(h(e).iso=!0,t=0,n=wt.length;t<n;t++)if(wt[t][1].exec(l[1])){a=wt[t][0],r=!1!==wt[t][2];break}if(null==a)return void(e._isValid=!1);if(l[3]){for(t=0,n=kt.length;t<n;t++)if(kt[t][1].exec(l[3])){i=(l[2]||" ")+kt[t][0];break}if(null==i)return void(e._isValid=!1)}if(!r&&null!=i)return void(e._isValid=!1);if(l[4]){if(!Mt.exec(l[4]))return void(e._isValid=!1);o="Z"}e._f=a+(i||"")+(o||""),jt(e)}else e._isValid=!1}var Dt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/;function Tt(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}var St={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Ot(e){var t,n,r,a,i,o,s,l=Dt.exec(e._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim());if(l){var u=(t=l[4],n=l[3],r=l[2],a=l[5],i=l[6],o=l[7],s=[Tt(t),ze.indexOf(n),parseInt(r,10),parseInt(a,10),parseInt(i,10)],o&&s.push(parseInt(o,10)),s);if(!function(e,t,n){return!e||Ke.indexOf(e)===new Date(t[0],t[1],t[2]).getDay()||(h(n).weekdayMismatch=!0,n._isValid=!1,!1)}(l[1],u,e))return;e._a=u,e._tzm=function(e,t,n){if(e)return St[e];if(t)return 0;var r=parseInt(n,10),a=r%100;return(r-a)/100*60+a}(l[8],l[9],l[10]),e._d=Je.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),h(e).rfc2822=!0}else e._isValid=!1}function jt(e){if(e._f!==a.ISO_8601)if(e._f!==a.RFC_2822){e._a=[],h(e).empty=!0;var t,n,r,i,o,s=""+e._i,l=s.length,u=0;for(r=q(e._f,e._locale).match(R)||[],t=0;t<r.length;t++)i=r[t],(n=(s.match(de(i,e))||[])[0])&&((o=s.substr(0,s.indexOf(n))).length>0&&h(e).unusedInput.push(o),s=s.slice(s.indexOf(n)+n.length),u+=n.length),B[i]?(n?h(e).empty=!1:h(e).unusedTokens.push(i),fe(i,n,e)):e._strict&&!n&&h(e).unusedTokens.push(i);h(e).charsLeftOver=l-u,s.length>0&&h(e).unusedInput.push(s),e._a[ve]<=12&&!0===h(e).bigHour&&e._a[ve]>0&&(h(e).bigHour=void 0),h(e).parsedDateParts=e._a.slice(0),h(e).meridiem=e._meridiem,e._a[ve]=function(e,t,n){var r;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((r=e.isPM(n))&&t<12&&(t+=12),r||12!==t||(t=0),t):t}(e._locale,e._a[ve],e._meridiem),gt(e),ft(e)}else Ot(e);else Yt(e)}function xt(e){var t=e._i,n=e._f;return e._locale=e._locale||_t(e._l),null===t||void 0===n&&""===t?f({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),M(t)?new v(ft(t)):(u(t)?e._d=t:i(n)?function(e){var t,n,r,a,i;if(0===e._f.length)return h(e).invalidFormat=!0,void(e._d=new Date(NaN));for(a=0;a<e._f.length;a++)i=0,t=g({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[a],jt(t),_(t)&&(i+=h(t).charsLeftOver,i+=10*h(t).unusedTokens.length,h(t).score=i,(null==r||i<r)&&(r=i,n=t));m(e,n||t)}(e):n?jt(e):function(e){var t=e._i;s(t)?e._d=new Date(a.now()):u(t)?e._d=new Date(t.valueOf()):"string"==typeof t?function(e){var t=Lt.exec(e._i);null===t?(Yt(e),!1===e._isValid&&(delete e._isValid,Ot(e),!1===e._isValid&&(delete e._isValid,a.createFromInputFallback(e)))):e._d=new Date(+t[1])}(e):i(t)?(e._a=c(t.slice(0),(function(e){return parseInt(e,10)})),gt(e)):o(t)?function(e){if(!e._d){var t=z(e._i);e._a=c([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],(function(e){return e&&parseInt(e,10)})),gt(e)}}(e):l(t)?e._d=new Date(t):a.createFromInputFallback(e)}(e),_(e)||(e._d=null),e))}function Et(e,t,n,r,a){var s,l={};return!0!==n&&!1!==n||(r=n,n=void 0),(o(e)&&function(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0}(e)||i(e)&&0===e.length)&&(e=void 0),l._isAMomentObject=!0,l._useUTC=l._isUTC=a,l._l=n,l._i=e,l._f=t,l._strict=r,(s=new v(ft(xt(l))))._nextDay&&(s.add(1,"d"),s._nextDay=void 0),s}function Ct(e,t,n,r){return Et(e,t,n,r,!1)}a.createFromInputFallback=D("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",(function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))})),a.ISO_8601=function(){},a.RFC_2822=function(){};var Ht=D("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=Ct.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:f()})),Pt=D("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=Ct.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:f()}));function zt(e,t){var n,r;if(1===t.length&&i(t[0])&&(t=t[0]),!t.length)return Ct();for(n=t[0],r=1;r<t.length;++r)t[r].isValid()&&!t[r][e](n)||(n=t[r]);return n}var At=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Nt(e){var t=z(e),n=t.year||0,r=t.quarter||0,a=t.month||0,i=t.week||0,o=t.day||0,s=t.hour||0,l=t.minute||0,u=t.second||0,c=t.millisecond||0;this._isValid=function(e){for(var t in e)if(-1===Se.call(At,t)||null!=e[t]&&isNaN(e[t]))return!1;for(var n=!1,r=0;r<At.length;++r)if(e[At[r]]){if(n)return!1;parseFloat(e[At[r]])!==k(e[At[r]])&&(n=!0)}return!0}(t),this._milliseconds=+c+1e3*u+6e4*l+1e3*s*60*60,this._days=+o+7*i,this._months=+a+3*r+12*n,this._data={},this._locale=_t(),this._bubble()}function Ft(e){return e instanceof Nt}function Rt(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Wt(e,t){J(e,0,0,(function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+F(~~(e/60),2)+t+F(~~e%60,2)}))}Wt("Z",":"),Wt("ZZ",""),ce("Z",se),ce("ZZ",se),he(["Z","ZZ"],(function(e,t,n){n._useUTC=!0,n._tzm=Bt(se,e)}));var It=/([\+\-]|\d\d)/gi;function Bt(e,t){var n=(t||"").match(e);if(null===n)return null;var r=((n[n.length-1]||[])+"").match(It)||["-",0,0],a=60*r[1]+k(r[2]);return 0===a?0:"+"===r[0]?a:-a}function Jt(e,t){var n,r;return t._isUTC?(n=t.clone(),r=(M(e)||u(e)?e.valueOf():Ct(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),a.updateOffset(n,!1),n):Ct(e).local()}function Ut(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function qt(){return!!this.isValid()&&this._isUTC&&0===this._offset}a.updateOffset=function(){};var Vt=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Gt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function $t(e,t){var n,r,a,i,o,s,u=e,c=null;return Ft(e)?u={ms:e._milliseconds,d:e._days,M:e._months}:l(e)?(u={},t?u[t]=e:u.milliseconds=e):(c=Vt.exec(e))?(n="-"===c[1]?-1:1,u={y:0,d:k(c[be])*n,h:k(c[ve])*n,m:k(c[Me])*n,s:k(c[we])*n,ms:k(Rt(1e3*c[ke]))*n}):(c=Gt.exec(e))?(n="-"===c[1]?-1:(c[1],1),u={y:Kt(c[2],n),M:Kt(c[3],n),w:Kt(c[4],n),d:Kt(c[5],n),h:Kt(c[6],n),m:Kt(c[7],n),s:Kt(c[8],n)}):null==u?u={}:"object"==typeof u&&("from"in u||"to"in u)&&(i=Ct(u.from),o=Ct(u.to),a=i.isValid()&&o.isValid()?(o=Jt(o,i),i.isBefore(o)?s=Zt(i,o):((s=Zt(o,i)).milliseconds=-s.milliseconds,s.months=-s.months),s):{milliseconds:0,months:0},(u={}).ms=a.milliseconds,u.M=a.months),r=new Nt(u),Ft(e)&&d(e,"_locale")&&(r._locale=e._locale),r}function Kt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Zt(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Qt(e,t){return function(n,r){var a;return null===r||isNaN(+r)||(O(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=n,n=r,r=a),Xt(this,$t(n="string"==typeof n?+n:n,r),e),this}}function Xt(e,t,n,r){var i=t._milliseconds,o=Rt(t._days),s=Rt(t._months);e.isValid()&&(r=null==r||r,s&&Ne(e,xe(e,"Month")+s*n),o&&Ee(e,"Date",xe(e,"Date")+o*n),i&&e._d.setTime(e._d.valueOf()+i*n),r&&a.updateOffset(e,o||s))}$t.fn=Nt.prototype,$t.invalid=function(){return $t(NaN)};var en=Qt(1,"add"),tn=Qt(-1,"subtract");function nn(e,t){var n=12*(t.year()-e.year())+(t.month()-e.month()),r=e.clone().add(n,"months");return-(n+(t-r<0?(t-r)/(r-e.clone().add(n-1,"months")):(t-r)/(e.clone().add(n+1,"months")-r)))||0}function rn(e){var t;return void 0===e?this._locale._abbr:(null!=(t=_t(e))&&(this._locale=t),this)}a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",a.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var an=D("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(e){return void 0===e?this.localeData():this.locale(e)}));function on(){return this._locale}function sn(e,t){J(0,[e,e.length],0,t)}function ln(e,t,n,r,a){var i;return null==e?Ve(this,r,a).year:(t>(i=Ge(e,r,a))&&(t=i),un.call(this,e,t,n,r,a))}function un(e,t,n,r,a){var i=qe(e,t,n,r,a),o=Je(i.year,0,i.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}J(0,["gg",2],0,(function(){return this.weekYear()%100})),J(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),sn("gggg","weekYear"),sn("ggggg","weekYear"),sn("GGGG","isoWeekYear"),sn("GGGGG","isoWeekYear"),H("weekYear","gg"),H("isoWeekYear","GG"),N("weekYear",1),N("isoWeekYear",1),ce("G",ie),ce("g",ie),ce("GG",Q,G),ce("gg",Q,G),ce("GGGG",ne,K),ce("gggg",ne,K),ce("GGGGG",re,Z),ce("ggggg",re,Z),_e(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,n,r){t[r.substr(0,2)]=k(e)})),_e(["gg","GG"],(function(e,t,n,r){t[r]=a.parseTwoDigitYear(e)})),J("Q",0,"Qo","quarter"),H("quarter","Q"),N("quarter",7),ce("Q",V),he("Q",(function(e,t){t[ge]=3*(k(e)-1)})),J("D",["DD",2],"Do","date"),H("date","D"),N("date",9),ce("D",Q),ce("DD",Q,G),ce("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),he(["D","DD"],be),he("Do",(function(e,t){t[be]=k(e.match(Q)[0])}));var cn=je("Date",!0);J("DDD",["DDDD",3],"DDDo","dayOfYear"),H("dayOfYear","DDD"),N("dayOfYear",4),ce("DDD",te),ce("DDDD",$),he(["DDD","DDDD"],(function(e,t,n){n._dayOfYear=k(e)})),J("m",["mm",2],0,"minute"),H("minute","m"),N("minute",14),ce("m",Q),ce("mm",Q,G),he(["m","mm"],Me);var dn=je("Minutes",!1);J("s",["ss",2],0,"second"),H("second","s"),N("second",15),ce("s",Q),ce("ss",Q,G),he(["s","ss"],we);var mn,pn=je("Seconds",!1);for(J("S",0,0,(function(){return~~(this.millisecond()/100)})),J(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),J(0,["SSS",3],0,"millisecond"),J(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),J(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),J(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),J(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),J(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),J(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),H("millisecond","ms"),N("millisecond",16),ce("S",te,V),ce("SS",te,G),ce("SSS",te,$),mn="SSSS";mn.length<=9;mn+="S")ce(mn,ae);function hn(e,t){t[ke]=k(1e3*("0."+e))}for(mn="S";mn.length<=9;mn+="S")he(mn,hn);var _n=je("Milliseconds",!1);J("z",0,0,"zoneAbbr"),J("zz",0,0,"zoneName");var fn=v.prototype;function yn(e){return e}fn.add=en,fn.calendar=function(e,t){var n=e||Ct(),r=Jt(n,this).startOf("day"),i=a.calendarFormat(this,r)||"sameElse",o=t&&(j(t[i])?t[i].call(this,n):t[i]);return this.format(o||this.localeData().calendar(i,this,Ct(n)))},fn.clone=function(){return new v(this)},fn.diff=function(e,t,n){var r,a,i;if(!this.isValid())return NaN;if(!(r=Jt(e,this)).isValid())return NaN;switch(a=6e4*(r.utcOffset()-this.utcOffset()),t=P(t)){case"year":i=nn(this,r)/12;break;case"month":i=nn(this,r);break;case"quarter":i=nn(this,r)/3;break;case"second":i=(this-r)/1e3;break;case"minute":i=(this-r)/6e4;break;case"hour":i=(this-r)/36e5;break;case"day":i=(this-r-a)/864e5;break;case"week":i=(this-r-a)/6048e5;break;default:i=this-r}return n?i:w(i)},fn.endOf=function(e){return void 0===(e=P(e))||"millisecond"===e?this:("date"===e&&(e="day"),this.startOf(e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms"))},fn.format=function(e){e||(e=this.isUtc()?a.defaultFormatUtc:a.defaultFormat);var t=U(this,e);return this.localeData().postformat(t)},fn.from=function(e,t){return this.isValid()&&(M(e)&&e.isValid()||Ct(e).isValid())?$t({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},fn.fromNow=function(e){return this.from(Ct(),e)},fn.to=function(e,t){return this.isValid()&&(M(e)&&e.isValid()||Ct(e).isValid())?$t({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},fn.toNow=function(e){return this.to(Ct(),e)},fn.get=function(e){return j(this[e=P(e)])?this[e]():this},fn.invalidAt=function(){return h(this).overflow},fn.isAfter=function(e,t){var n=M(e)?e:Ct(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=P(s(t)?"millisecond":t))?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},fn.isBefore=function(e,t){var n=M(e)?e:Ct(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=P(s(t)?"millisecond":t))?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},fn.isBetween=function(e,t,n,r){return("("===(r=r||"()")[0]?this.isAfter(e,n):!this.isBefore(e,n))&&(")"===r[1]?this.isBefore(t,n):!this.isAfter(t,n))},fn.isSame=function(e,t){var n,r=M(e)?e:Ct(e);return!(!this.isValid()||!r.isValid())&&("millisecond"===(t=P(t||"millisecond"))?this.valueOf()===r.valueOf():(n=r.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},fn.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},fn.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},fn.isValid=function(){return _(this)},fn.lang=an,fn.locale=rn,fn.localeData=on,fn.max=Pt,fn.min=Ht,fn.parsingFlags=function(){return m({},h(this))},fn.set=function(e,t){if("object"==typeof e)for(var n=function(e){var t=[];for(var n in e)t.push({unit:n,priority:A[n]});return t.sort((function(e,t){return e.priority-t.priority})),t}(e=z(e)),r=0;r<n.length;r++)this[n[r].unit](e[n[r].unit]);else if(j(this[e=P(e)]))return this[e](t);return this},fn.startOf=function(e){switch(e=P(e)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===e&&this.weekday(0),"isoWeek"===e&&this.isoWeekday(1),"quarter"===e&&this.month(3*Math.floor(this.month()/3)),this},fn.subtract=tn,fn.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},fn.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},fn.toDate=function(){return new Date(this.valueOf())},fn.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?U(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):j(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this._d.valueOf()).toISOString().replace("Z",U(n,"Z")):U(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},fn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var n="["+e+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",a=t+'[")]';return this.format(n+r+"-MM-DD[T]HH:mm:ss.SSS"+a)},fn.toJSON=function(){return this.isValid()?this.toISOString():null},fn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},fn.unix=function(){return Math.floor(this.valueOf()/1e3)},fn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},fn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},fn.year=Oe,fn.isLeapYear=function(){return Te(this.year())},fn.weekYear=function(e){return ln.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},fn.isoWeekYear=function(e){return ln.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},fn.quarter=fn.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},fn.month=Fe,fn.daysInMonth=function(){return Ce(this.year(),this.month())},fn.week=fn.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},fn.isoWeek=fn.isoWeeks=function(e){var t=Ve(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},fn.weeksInYear=function(){var e=this.localeData()._week;return Ge(this.year(),e.dow,e.doy)},fn.isoWeeksInYear=function(){return Ge(this.year(),1,4)},fn.date=cn,fn.day=fn.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=function(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}(e,this.localeData()),this.add(e-t,"d")):t},fn.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},fn.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=function(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},fn.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},fn.hour=fn.hours=st,fn.minute=fn.minutes=dn,fn.second=fn.seconds=pn,fn.millisecond=fn.milliseconds=_n,fn.utcOffset=function(e,t,n){var r,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=Bt(se,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(r=Ut(this)),this._offset=e,this._isUTC=!0,null!=r&&this.add(r,"m"),i!==e&&(!t||this._changeInProgress?Xt(this,$t(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?i:Ut(this)},fn.utc=function(e){return this.utcOffset(0,e)},fn.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Ut(this),"m")),this},fn.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=Bt(oe,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},fn.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Ct(e).utcOffset():0,(this.utcOffset()-e)%60==0)},fn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},fn.isLocal=function(){return!!this.isValid()&&!this._isUTC},fn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},fn.isUtc=qt,fn.isUTC=qt,fn.zoneAbbr=function(){return this._isUTC?"UTC":""},fn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},fn.dates=D("dates accessor is deprecated. Use date instead.",cn),fn.months=D("months accessor is deprecated. Use month instead",Fe),fn.years=D("years accessor is deprecated. Use year instead",Oe),fn.zone=D("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()})),fn.isDSTShifted=D("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!s(this._isDSTShifted))return this._isDSTShifted;var e={};if(g(e,this),(e=xt(e))._a){var t=e._isUTC?p(e._a):Ct(e._a);this._isDSTShifted=this.isValid()&&L(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}));var gn=E.prototype;function bn(e,t,n,r){var a=_t(),i=p().set(r,t);return a[n](i,e)}function vn(e,t,n){if(l(e)&&(t=e,e=void 0),e=e||"",null!=t)return bn(e,t,n,"month");var r,a=[];for(r=0;r<12;r++)a[r]=bn(e,r,n,"month");return a}function Mn(e,t,n,r){"boolean"==typeof e?(l(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,l(t)&&(n=t,t=void 0),t=t||"");var a,i=_t(),o=e?i._week.dow:0;if(null!=n)return bn(t,(n+o)%7,r,"day");var s=[];for(a=0;a<7;a++)s[a]=bn(t,(a+o)%7,r,"day");return s}gn.calendar=function(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return j(r)?r.call(t,n):r},gn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,(function(e){return e.slice(1)})),this._longDateFormat[e])},gn.invalidDate=function(){return this._invalidDate},gn.ordinal=function(e){return this._ordinal.replace("%d",e)},gn.preparse=yn,gn.postformat=yn,gn.relativeTime=function(e,t,n,r){var a=this._relativeTime[n];return j(a)?a(e,t,n,r):a.replace(/%d/i,e)},gn.pastFuture=function(e,t){var n=this._relativeTime[e>0?"future":"past"];return j(n)?n(t):n.replace(/%s/i,t)},gn.set=function(e){var t,n;for(n in e)j(t=e[n])?this[n]=t:this["_"+n]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},gn.months=function(e,t){return e?i(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||He).test(t)?"format":"standalone"][e.month()]:i(this._months)?this._months:this._months.standalone},gn.monthsShort=function(e,t){return e?i(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[He.test(t)?"format":"standalone"][e.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},gn.monthsParse=function(e,t,n){var r,a,i;if(this._monthsParseExact)return Ae.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(a=p([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(i="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[r]=new RegExp(i.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[r].test(e))return r;if(n&&"MMM"===t&&this._shortMonthsParse[r].test(e))return r;if(!n&&this._monthsParse[r].test(e))return r}},gn.monthsRegex=function(e){return this._monthsParseExact?(d(this,"_monthsRegex")||Ie.call(this),e?this._monthsStrictRegex:this._monthsRegex):(d(this,"_monthsRegex")||(this._monthsRegex=We),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},gn.monthsShortRegex=function(e){return this._monthsParseExact?(d(this,"_monthsRegex")||Ie.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(d(this,"_monthsShortRegex")||(this._monthsShortRegex=Re),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},gn.week=function(e){return Ve(e,this._week.dow,this._week.doy).week},gn.firstDayOfYear=function(){return this._week.doy},gn.firstDayOfWeek=function(){return this._week.dow},gn.weekdays=function(e,t){return e?i(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"][e.day()]:i(this._weekdays)?this._weekdays:this._weekdays.standalone},gn.weekdaysMin=function(e){return e?this._weekdaysMin[e.day()]:this._weekdaysMin},gn.weekdaysShort=function(e){return e?this._weekdaysShort[e.day()]:this._weekdaysShort},gn.weekdaysParse=function(e,t,n){var r,a,i;if(this._weekdaysParseExact)return Qe.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(a=p([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(a,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(a,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(a,"").replace(".",".?")+"$","i")),this._weekdaysParse[r]||(i="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[r]=new RegExp(i.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[r].test(e))return r;if(n&&"ddd"===t&&this._shortWeekdaysParse[r].test(e))return r;if(n&&"dd"===t&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}},gn.weekdaysRegex=function(e){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||nt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(d(this,"_weekdaysRegex")||(this._weekdaysRegex=Xe),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},gn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||nt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(d(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=et),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},gn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||nt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(d(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=tt),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},gn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},gn.meridiem=function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},pt("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===k(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),a.lang=D("moment.lang is deprecated. Use moment.locale instead.",pt),a.langData=D("moment.langData is deprecated. Use moment.localeData instead.",_t);var wn=Math.abs;function kn(e,t,n,r){var a=$t(t,n);return e._milliseconds+=r*a._milliseconds,e._days+=r*a._days,e._months+=r*a._months,e._bubble()}function Ln(e){return e<0?Math.floor(e):Math.ceil(e)}function Yn(e){return 4800*e/146097}function Dn(e){return 146097*e/4800}function Tn(e){return function(){return this.as(e)}}var Sn=Tn("ms"),On=Tn("s"),jn=Tn("m"),xn=Tn("h"),En=Tn("d"),Cn=Tn("w"),Hn=Tn("M"),Pn=Tn("y");function zn(e){return function(){return this.isValid()?this._data[e]:NaN}}var An=zn("milliseconds"),Nn=zn("seconds"),Fn=zn("minutes"),Rn=zn("hours"),Wn=zn("days"),In=zn("months"),Bn=zn("years"),Jn=Math.round,Un={ss:44,s:45,m:45,h:22,d:26,M:11};function qn(e,t,n,r,a){return a.relativeTime(t||1,!!n,e,r)}var Vn=Math.abs;function Gn(e){return(e>0)-(e<0)||+e}function $n(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n=Vn(this._milliseconds)/1e3,r=Vn(this._days),a=Vn(this._months);e=w(n/60),t=w(e/60),n%=60,e%=60;var i=w(a/12),o=a%=12,s=r,l=t,u=e,c=n?n.toFixed(3).replace(/\.?0+$/,""):"",d=this.asSeconds();if(!d)return"P0D";var m=d<0?"-":"",p=Gn(this._months)!==Gn(d)?"-":"",h=Gn(this._days)!==Gn(d)?"-":"",_=Gn(this._milliseconds)!==Gn(d)?"-":"";return m+"P"+(i?p+i+"Y":"")+(o?p+o+"M":"")+(s?h+s+"D":"")+(l||u||c?"T":"")+(l?_+l+"H":"")+(u?_+u+"M":"")+(c?_+c+"S":"")}var Kn=Nt.prototype;return Kn.isValid=function(){return this._isValid},Kn.abs=function(){var e=this._data;return this._milliseconds=wn(this._milliseconds),this._days=wn(this._days),this._months=wn(this._months),e.milliseconds=wn(e.milliseconds),e.seconds=wn(e.seconds),e.minutes=wn(e.minutes),e.hours=wn(e.hours),e.months=wn(e.months),e.years=wn(e.years),this},Kn.add=function(e,t){return kn(this,e,t,1)},Kn.subtract=function(e,t){return kn(this,e,t,-1)},Kn.as=function(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if("month"===(e=P(e))||"year"===e)return t=this._days+r/864e5,n=this._months+Yn(t),"month"===e?n:n/12;switch(t=this._days+Math.round(Dn(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return 24*t+r/36e5;case"minute":return 1440*t+r/6e4;case"second":return 86400*t+r/1e3;case"millisecond":return Math.floor(864e5*t)+r;default:throw new Error("Unknown unit "+e)}},Kn.asMilliseconds=Sn,Kn.asSeconds=On,Kn.asMinutes=jn,Kn.asHours=xn,Kn.asDays=En,Kn.asWeeks=Cn,Kn.asMonths=Hn,Kn.asYears=Pn,Kn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*k(this._months/12):NaN},Kn._bubble=function(){var e,t,n,r,a,i=this._milliseconds,o=this._days,s=this._months,l=this._data;return i>=0&&o>=0&&s>=0||i<=0&&o<=0&&s<=0||(i+=864e5*Ln(Dn(s)+o),o=0,s=0),l.milliseconds=i%1e3,e=w(i/1e3),l.seconds=e%60,t=w(e/60),l.minutes=t%60,n=w(t/60),l.hours=n%24,o+=w(n/24),a=w(Yn(o)),s+=a,o-=Ln(Dn(a)),r=w(s/12),s%=12,l.days=o,l.months=s,l.years=r,this},Kn.clone=function(){return $t(this)},Kn.get=function(e){return e=P(e),this.isValid()?this[e+"s"]():NaN},Kn.milliseconds=An,Kn.seconds=Nn,Kn.minutes=Fn,Kn.hours=Rn,Kn.days=Wn,Kn.weeks=function(){return w(this.days()/7)},Kn.months=In,Kn.years=Bn,Kn.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var t=this.localeData(),n=function(e,t,n){var r=$t(e).abs(),a=Jn(r.as("s")),i=Jn(r.as("m")),o=Jn(r.as("h")),s=Jn(r.as("d")),l=Jn(r.as("M")),u=Jn(r.as("y")),c=a<=Un.ss&&["s",a]||a<Un.s&&["ss",a]||i<=1&&["m"]||i<Un.m&&["mm",i]||o<=1&&["h"]||o<Un.h&&["hh",o]||s<=1&&["d"]||s<Un.d&&["dd",s]||l<=1&&["M"]||l<Un.M&&["MM",l]||u<=1&&["y"]||["yy",u];return c[2]=t,c[3]=+e>0,c[4]=n,qn.apply(null,c)}(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)},Kn.toISOString=$n,Kn.toString=$n,Kn.toJSON=$n,Kn.locale=rn,Kn.localeData=on,Kn.toIsoString=D("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",$n),Kn.lang=an,J("X",0,0,"unix"),J("x",0,0,"valueOf"),ce("x",ie),ce("X",/[+-]?\d+(\.\d{1,3})?/),he("X",(function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))})),he("x",(function(e,t,n){n._d=new Date(k(e))})),a.version="2.20.1",t=Ct,a.fn=fn,a.min=function(){return zt("isBefore",[].slice.call(arguments,0))},a.max=function(){return zt("isAfter",[].slice.call(arguments,0))},a.now=function(){return Date.now?Date.now():+new Date},a.utc=p,a.unix=function(e){return Ct(1e3*e)},a.months=function(e,t){return vn(e,t,"months")},a.isDate=u,a.locale=pt,a.invalid=f,a.duration=$t,a.isMoment=M,a.weekdays=function(e,t,n){return Mn(e,t,n,"weekdays")},a.parseZone=function(){return Ct.apply(null,arguments).parseZone()},a.localeData=_t,a.isDuration=Ft,a.monthsShort=function(e,t){return vn(e,t,"monthsShort")},a.weekdaysMin=function(e,t,n){return Mn(e,t,n,"weekdaysMin")},a.defineLocale=ht,a.updateLocale=function(e,t){if(null!=t){var n,r,a=lt;null!=(r=mt(e))&&(a=r._config),t=x(a,t),(n=new E(t)).parentLocale=ut[e],ut[e]=n,pt(e)}else null!=ut[e]&&(null!=ut[e].parentLocale?ut[e]=ut[e].parentLocale:null!=ut[e]&&delete ut[e]);return ut[e]},a.locales=function(){return T(ut)},a.weekdaysShort=function(e,t,n){return Mn(e,t,n,"weekdaysShort")},a.normalizeUnits=P,a.relativeTimeRounding=function(e){return void 0===e?Jn:"function"==typeof e&&(Jn=e,!0)},a.relativeTimeThreshold=function(e,t){return void 0!==Un[e]&&(void 0===t?Un[e]:(Un[e]=t,"s"===e&&(Un.ss=t-1),!0))},a.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},a.prototype=fn,a.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"YYYY-[W]WW",MONTH:"YYYY-MM"},a}()}).call(this,n(9)(e))},function(e,t,n){"use strict";e.exports=n(135)},function(e,t){function n(e,t=null,n=null){var r=[];function a(e,t,n,i=0){let o;if(null!==n&&i<n)y(e)&&(o=Object.keys(e)).forEach(r=>{a(e[r],t,n,i+1)});else{if(null!==n&&i==n)return 0==n?void(r=a(e,t,null,i)):void(y(e)&&r.push(a(e,t,n,i+1)));switch(M(e)){case"array":var s=[];if(o=Object.keys(e),null===t||i<t)for(var l=0,u=o.length;l<u;l++){const r=o[l],u=e[r];s[r]=a(u,t,n,i+1)}return s;case"object":var c={};if(o=Object.keys(e),null===t||i<t)for(l=0,u=o.length;l<u;l++){const r=o[l],s=e[r];c[r]=a(s,t,n,i+1)}return c;case"string":return""+e;case"number":return 0+e;case"boolean":return!!e;case"null":return null;case"undefined":return}}}return null===n?a(e,t,n,0):(a(e,t,n,0),r)}function r(e,t,n=null){if("string"===M(t)&&""!==t){var r=[];return function e(t,n,a="",i="",o=null,s=0){if(a===n&&(r[r.length]=i),null!==o&&s>=o)return!1;if(y(t))for(var l=0,u=Object.keys(t),c=u.length;l<c;l++){const r=u[l];e(t[r],n,r,(""===i?i:i+".")+r,o,s+1)}}(e,t,"","",n),0!==(r=r.map(e=>"boolean"===M(e)?e:""===e?e:((e=e.split(".")).pop(),e=e.join(".")))).length&&r}}function a(e,t,n=null){if("string"===M(t)&&""!==t){var r=function e(t,n,r="",a,i=0){if(r===n)return r;var o=!1;if(null!==a&&i>=a)return o;if(y(t))for(var s=0,l=Object.keys(t),u=l.length;s<u;s++){const u=l[s],c=e(t[u],n,u,a,i+1);if(c){o=(r=""===r?r:r+".")+c;break}}return o}(e,t,"",n,0);return"boolean"===M(r)?r:""===r?r:((r=r.split(".")).pop(),r=r.join("."))}}function i(e,t,n=null){if(!u(t=s(t)))return function e(t,n,r,a=0){if(f(t,[n]))return u(t[n]);if(null!==r&&a>=r)return!1;if(y(t))for(var i=0,o=Object.keys(t),s=o.length;i<s;i++){if(e(t[o[i]],n,r,a+1))return!0}return!1}(e,t,n)}function o(e,t,n=null){if(!u(t=s(t)))return function e(t,n,r,a=0){if(f(t,[n]))return l(t[n]);if(null!==r&&a>=r)return!1;if(y(t))for(var i=0,o=Object.keys(t),s=o.length;i<s;i++){if(e(t[o[i]],n,r,a+1))return!0}return!1}(e,t,n,0)}function s(e){const t=c(e);return!(t>1)&&(1===t?Object.keys(e)[0]:0===t&&["string","number"].indexOf(M(e))>-1&&e)}function l(e){return!u(e)}function u(e){return!1===function(e){return y(e)?e:!(["null","undefined"].indexOf(M(e))>-1)&&(!(["",0,!1].indexOf(e)>-1)&&e)}(e)}function c(e){return-1===["array","object"].indexOf(M(e))?0:Object.keys(e).length}function d(e,t,n=null,r=0){if(g(e,t))return!0;if(y(t)&&v(e,t)&&f(e,Object.keys(t))){if(g(_(e,Object.keys(t)),t))return!0}if((null===n||r<n)&&y(e))for(var a=0,i=Object.keys(e),o=i.length;a<o;a++){if(d(e[i[a]],t,n,r+1))return!0}return!1}function m(e,t,n=null){var r=p(e,t,n);if(!1===r)return;return r.map(n=>{if(""===n)return e;n=n.split("."),-1===["array","object"].indexOf(M(t))&&n.splice(-1,1);var r=e;return Array.isArray(n)?(n.forEach(e=>{r=r[e]}),r):r[n]})}function p(e,t,n=null){var r=[];return function e(t,n,a="",i,o){if(y(n)&&v(t,n)&&f(t,Object.keys(n))){g(_(t,Object.keys(n)),n)&&(r[r.length]=a)}if(g(t,n)&&(r[r.length]=a),null!==i&&o>=i)return!1;if(y(t))for(var s=0,l=Object.keys(t),u=l.length;s<u;s++){const r=l[s];e(t[r],n,(""===a?a:a+".")+r,i,o+1)}}(e,t,"",n,0),0!==r.length&&r}function h(e,t,n=null){return function e(t,n,r="",a,i){if(y(n)&&v(t,n)&&f(t,Object.keys(n))){if(g(_(t,Object.keys(n)),n))return r}if(g(t,n))return r;var o=!1;if(null!==a&&i>=a)return o;if(y(t))for(var s=0,l=Object.keys(t),u=l.length;s<u;s++){const u=l[s],c=e(t[u],n,u,a,i+1);if(c){o=(r=""===r?r:r+".")+c;break}}return o}(e,t,"",n,0)}function _(e,t){const n=M(e);if(-1!==["array","object"].indexOf(n)&&0!==t.length){var r;switch(n){case"object":r={},t.forEach(t=>{t in e&&(r[t]=e[t])});break;case"array":r=[],t.forEach(t=>{t in e&&r.push(e[t])})}return r}}function f(e,t){const n=t.length;if(0===n||!y(e))return!1;const r=Object.keys(e);for(var a=!0,i=0;i<n;i++){const e=""+t[i];if(-1===r.indexOf(e)){a=!1;break}}return a}function y(e){return-1!==["array","object"].indexOf(M(e))&&0!==Object.keys(e).length}function g(e,t){const n=b(e,t);if(!1===n)return n;if(-1===["array","object"].indexOf(n))return e===t;const r=Object.keys(e),a=r.length;for(var i=!0,o=0;o<a;o++){const n=r[o],a=g(e[n],t[n]);if(!1===a){i=a;break}}return i}function b(e,t){const n=v(e,t);if(!1===n)return!1;if(["array","object"].indexOf(n)>-1){const n=Object.keys(e),a=Object.keys(t),i=n.length;if(i!==a.length)return!1;if(0===i)return!0;for(var r=0;r<i;r++)if(n[r]!==a[r])return!1}return n}function v(e,t){const n=M(e);return n===M(t)&&n}function M(e){if(null===e)return"null";const t=typeof e;return"object"===t&&Array.isArray(e)?"array":t}var w={getType:function(e){return M(e)},sameType:function(e,t){return v(e,t)},sameStructure:function(e,t){return b(e,t)},identical:function(e,t){return g(e,t)},isIterable:function(e){return y(e)},containsKeys:function(e,t){return f(e,t)},trim:function(e,t){return _(e,t)},locate:function(e,t,n){return h(e,t,n)},deepGet:function(e,t,n){return function(e,t,n=null){var r=h(e,t,n);if(!1!==r){if(""===r)return e;r=r.split("."),-1===["array","object"].indexOf(M(t))&&r.splice(-1,1);var a=e;return Array.isArray(r)?(r.forEach(e=>{a=a[e]}),a):a[r]}}(e,t,n)},locateAll:function(e,t,n){return p(e,t,n)},deepFilter:function(e,t,n){return m(e,t,n)},exists:function(e,t,n){return d(e,t,n)},onlyExisting:function(e,t,n){return function(e,t,n=null){if("array"===M(t)){let r=[];return t.forEach(t=>{d(e,t,n)&&r.push(t)}),r}if("object"===M(t)){let r={};return Object.keys(t).forEach(a=>{let i=t[a];d(e,i,n)&&(r[a]=i)}),r}if(d(e,t,n))return t}(e,t,n)},onlyMissing:function(e,t,n){return function(e,t,n=null){if("array"===M(t)){let r=[];return t.forEach(t=>{d(e,t,n)||r.push(t)}),r}if("object"===M(t)){let r={};return Object.keys(t).forEach(a=>{let i=t[a];d(e,i,n)||(r[a]=i)}),r}if(!d(e,t,n))return t}(e,t,n)},length:function(e){return c(e)},isFalsy:function(e){return u(e)},isTruthy:function(e){return l(e)},foundTruthy:function(e,t,n){return o(e,t,n)},onlyTruthy:function(e,t,n,r){return function(e,t,n,r=null){if("array"===M(t)){let a=[];return t.forEach(t=>{const i=m(e,t);l(i)&&o(i,n,r)&&a.push(t)}),a}if("object"===M(t)){let a={};return Object.keys(t).forEach(i=>{const s=t[i],u=m(e,s);l(u)&&o(u,n,r)&&(a[i]=s)}),a}if(o(e,n,r))return t}(e,t,n,r)},foundFalsy:function(e,t,n){return i(e,t,n)},onlyFalsy:function(e,t,n,r){return function(e,t,n,r=null){if("array"===M(t)){let a=[];return t.forEach(t=>{const o=m(e,t);l(o)&&i(o,n,r)&&a.push(t)}),a}if("object"===M(t)){let a={};return Object.keys(t).forEach(o=>{const s=t[o],u=m(e,s);l(u)&&i(u,n,r)&&(a[o]=s)}),a}if(i(e,n,r))return t}(e,t,n,r)},countMatches:function(e,t,n,r){return function(e,t,n=null,r=null){var a=null===n,i=null===r,o=p(e,t,a&&i?null:a||i?n||r:n<r?n:r);if(!1===o)return 0;if(null===n)return o.length;if("number"===M(n)){let e=0;return o.forEach(t=>{(t=t.split(".")).length===n&&e++}),e}}(e,t,n,r)},matchDepth:function(e,t,n){return function(e,t,n=null){var r=h(e,t,n);return!1!==r&&(""===r?0:(r=r.split(".")).length)}(e,t,n)},maxDepth:function(e,t){return function(e,t=null){let n=0;return function e(t,r,a=0){n<a&&(n=a),null!==r&&a>=r||y(t)&&Object.keys(t).forEach(n=>{e(t[n],r,a+1)})}(e,t),n}(e,t)},locate_Key:function(e,t,n){return a(e,t,n)},deepGet_Key:function(e,t,n){return function(e,t,n=null){if("string"===M(t)&&""!==t){var r=a(e,t,n);if(!1!==r){""===r?r=t:r+="."+t,r=r.split(".");var i=e;return Array.isArray(r)?(r.forEach(e=>{i=i[e]}),i):i[r]}}}(e,t,n)},locateAll_Key:function(e,t,n){return r(e,t,n)},deepFilter_Key:function(e,t,n){return function(e,t,n=null){if("string"!==M(t))return;if(""===t)return;var a=r(e,t,n);if(!1===a)return;return a.map(n=>{if(!1!==n){""===n?n=t:n+="."+t,n=n.split(".");var r=e;return Array.isArray(n)?(n.forEach(e=>{r=r[e]}),r):r[n]}})}(e,t,n)},deepClone:function(e,t,r){return n(e,t,r)},renameKey:function(e,t,n,r){return function(e,t,n,r=null){if("string"===M(t)&&"string"===M(n)&&""!==t&&""!==n){var a=!1;return function e(t,n,r,i,o=0){let s;switch(M(t)){case"array":for(var l=[],u=0,c=(s=Object.keys(t)).length;u<c;u++){let a=s[u],c=t[a];l[a]=e(c,n,r,i,o+1)}return l;case"object":var d={};for(u=0,c=(s=Object.keys(t)).length;u<c;u++){let l=s[u],c=t[l];(null===i||o<i)&&(a||l===n&&(l=r,a=!0)),d[l]=e(c,n,r,i,o+1)}return d;case"string":return""+t;case"number":return 0+t;case"boolean":return!!t;case"null":return null;case"undefined":return}}(e,t,n,r,0)}}(e,t,n,r)},renameKeys:function(e,t,n,r){return function(e,t,n,r=null){if("string"===M(t)&&"string"===M(n)&&""!==t&&""!==n)return function e(t,n,r,a,i=0){let o;switch(M(t)){case"array":for(var s=[],l=0,u=(o=Object.keys(t)).length;l<u;l++){let u=o[l],c=t[u];s[u]=e(c,n,r,a,i+1)}return s;case"object":var c={};for(l=0,u=(o=Object.keys(t)).length;l<u;l++){let s=o[l],u=t[s];(null===a||i<a)&&s===n&&(s=r),c[s]=e(u,n,r,a,i+1)}return c;case"string":return""+t;case"number":return 0+t;case"boolean":return!!t;case"null":return null;case"undefined":return}}(e,t,n,r,0)}(e,t,n,r)},deepRemove_Key:function(e,t,r){return function(e,t,r){if("string"!==M(t))return;if(""===t)return;let i=n(e);var o=a(i,t,r);if(!1===o)return i;""===o?o=t:o+="."+t,o=o.split(".");var s=i;return Array.isArray(o)||delete s[o],o.forEach((e,t)=>{t<o.length-1?s=s[e]:delete s[e]}),i}(e,t,r)},deepRemoveAll_Key:function(e,t,a){return function(e,t,a){if("string"!==M(t))return;if(""===t)return;let i=n(e);var o=r(i,t,a);return o===[]||!1===o?i:(o.forEach(e=>{""===e?e=t:e+="."+t,e=e.split(".");var n=i;Array.isArray(e)||delete n[e];for(var r=0;r<e.length;r++){var a=e[r];if(!(a in n))break;r<e.length-1?n=n[a]:delete n[a]}}),i)}(e,t,a)}};e.exports=w},function(e,t,n){(function(e){!function(t){var n=function(e){return a(!0===e,!1,arguments)};function r(e,t){if("object"!==i(e))return t;for(var n in t)"object"===i(e[n])&&"object"===i(t[n])?e[n]=r(e[n],t[n]):e[n]=t[n];return e}function a(e,t,a){var o=a[0],s=a.length;(e||"object"!==i(o))&&(o={});for(var l=0;l<s;++l){var u=a[l];if("object"===i(u))for(var c in u)if("__proto__"!==c){var d=e?n.clone(u[c]):u[c];o[c]=t?r(o[c],d):d}}return o}function i(e){return{}.toString.call(e).slice(8,-1).toLowerCase()}n.recursive=function(e){return a(!0===e,!0,arguments)},n.clone=function(e){var t,r,a=e,o=i(e);if("array"===o)for(a=[],r=e.length,t=0;t<r;++t)a[t]=n.clone(e[t]);else if("object"===o)for(t in a={},e)a[t]=n.clone(e[t]);return a},t?e.exports=n:window.merge=n}(e&&"object"==typeof e.exports&&e.exports)}).call(this,n(9)(e))},function(e,t,n){"use strict";
2
  /*!
3
  * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
4
  *
44
  *
45
  * This source code is licensed under the MIT license found in the
46
  * LICENSE file in the root directory of this source tree.
47
+ */var r=n(136),a=n(137),i=n(138),o=n(139),s="function"==typeof Symbol&&Symbol.for,l=s?Symbol.for("react.element"):60103,u=s?Symbol.for("react.portal"):60106,c=s?Symbol.for("react.fragment"):60107,d=s?Symbol.for("react.strict_mode"):60108,m=s?Symbol.for("react.profiler"):60114,p=s?Symbol.for("react.provider"):60109,h=s?Symbol.for("react.context"):60110,_=s?Symbol.for("react.async_mode"):60111,f=s?Symbol.for("react.forward_ref"):60112;s&&Symbol.for("react.timeout");var y="function"==typeof Symbol&&Symbol.iterator;function g(e){for(var t=arguments.length-1,n="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);a(!1,"Minified React error #"+e+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",n)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}};function v(e,t,n){this.props=e,this.context=t,this.refs=i,this.updater=n||b}function M(){}function w(e,t,n){this.props=e,this.context=t,this.refs=i,this.updater=n||b}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&g("85"),this.updater.enqueueSetState(this,e,t,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},M.prototype=v.prototype;var k=w.prototype=new M;k.constructor=w,r(k,v.prototype),k.isPureReactComponent=!0;var L={current:null},Y=Object.prototype.hasOwnProperty,D={key:!0,ref:!0,__self:!0,__source:!0};function T(e,t,n){var r=void 0,a={},i=null,o=null;if(null!=t)for(r in void 0!==t.ref&&(o=t.ref),void 0!==t.key&&(i=""+t.key),t)Y.call(t,r)&&!D.hasOwnProperty(r)&&(a[r]=t[r]);var s=arguments.length-2;if(1===s)a.children=n;else if(1<s){for(var u=Array(s),c=0;c<s;c++)u[c]=arguments[c+2];a.children=u}if(e&&e.defaultProps)for(r in s=e.defaultProps)void 0===a[r]&&(a[r]=s[r]);return{$$typeof:l,type:e,key:i,ref:o,props:a,_owner:L.current}}function S(e){return"object"==typeof e&&null!==e&&e.$$typeof===l}var O=/\/+/g,j=[];function x(e,t,n,r){if(j.length){var a=j.pop();return a.result=e,a.keyPrefix=t,a.func=n,a.context=r,a.count=0,a}return{result:e,keyPrefix:t,func:n,context:r,count:0}}function E(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>j.length&&j.push(e)}function C(e,t,n,r){var a=typeof e;"undefined"!==a&&"boolean"!==a||(e=null);var i=!1;if(null===e)i=!0;else switch(a){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case l:case u:i=!0}}if(i)return n(r,e,""===t?"."+H(e,0):t),1;if(i=0,t=""===t?".":t+":",Array.isArray(e))for(var o=0;o<e.length;o++){var s=t+H(a=e[o],o);i+=C(a,s,n,r)}else if(null==e?s=null:s="function"==typeof(s=y&&e[y]||e["@@iterator"])?s:null,"function"==typeof s)for(e=s.call(e),o=0;!(a=e.next()).done;)i+=C(a=a.value,s=t+H(a,o++),n,r);else"object"===a&&g("31","[object Object]"===(n=""+e)?"object with keys {"+Object.keys(e).join(", ")+"}":n,"");return i}function H(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,(function(e){return t[e]}))}(e.key):t.toString(36)}function P(e,t){e.func.call(e.context,t,e.count++)}function z(e,t,n){var r=e.result,a=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?A(e,r,n,o.thatReturnsArgument):null!=e&&(S(e)&&(t=a+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(O,"$&/")+"/")+n,e={$$typeof:l,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}),r.push(e))}function A(e,t,n,r,a){var i="";null!=n&&(i=(""+n).replace(O,"$&/")+"/"),t=x(t,i,r,a),null==e||C(e,"",z,t),E(t)}var N={Children:{map:function(e,t,n){if(null==e)return e;var r=[];return A(e,r,null,t,n),r},forEach:function(e,t,n){if(null==e)return e;t=x(null,null,t,n),null==e||C(e,"",P,t),E(t)},count:function(e){return null==e?0:C(e,"",o.thatReturnsNull,null)},toArray:function(e){var t=[];return A(e,t,null,o.thatReturnsArgument),t},only:function(e){return S(e)||g("143"),e}},createRef:function(){return{current:null}},Component:v,PureComponent:w,createContext:function(e,t){return void 0===t&&(t=null),(e={$$typeof:h,_calculateChangedBits:t,_defaultValue:e,_currentValue:e,_currentValue2:e,_changedBits:0,_changedBits2:0,Provider:null,Consumer:null}).Provider={$$typeof:p,_context:e},e.Consumer=e},forwardRef:function(e){return{$$typeof:f,render:e}},Fragment:c,StrictMode:d,unstable_AsyncMode:_,unstable_Profiler:m,createElement:T,cloneElement:function(e,t,n){null==e&&g("267",e);var a=void 0,i=r({},e.props),o=e.key,s=e.ref,u=e._owner;if(null!=t){void 0!==t.ref&&(s=t.ref,u=L.current),void 0!==t.key&&(o=""+t.key);var c=void 0;for(a in e.type&&e.type.defaultProps&&(c=e.type.defaultProps),t)Y.call(t,a)&&!D.hasOwnProperty(a)&&(i[a]=void 0===t[a]&&void 0!==c?c[a]:t[a])}if(1===(a=arguments.length-2))i.children=n;else if(1<a){c=Array(a);for(var d=0;d<a;d++)c[d]=arguments[d+2];i.children=c}return{$$typeof:l,type:e.type,key:o,ref:s,props:i,_owner:u}},createFactory:function(e){var t=T.bind(null,e);return t.type=e,t},isValidElement:S,version:"16.4.1",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:L,assign:r}},F={default:N},R=F&&N||F;e.exports=R.default?R.default:R},function(e,t,n){"use strict";
48
  /*
49
  object-assign
50
  (c) Sindre Sorhus
55
  *
56
  * Copyright (c) 2014-2017, Jon Schlinkert.
57
  * Released under the MIT License.
58
+ */e.exports=function(e){return null!=e&&"object"==typeof e&&!1===Array.isArray(e)}},,function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,a,i,o,s,l=1,u={},c=!1,d=e.document,m=Object.getPrototypeOf&&Object.getPrototypeOf(e);m=m&&m.setTimeout?m:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){h(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){h(e.data)},r=function(e){i.port2.postMessage(e)}):d&&"onreadystatechange"in d.createElement("script")?(a=d.documentElement,r=function(e){var t=d.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,a.removeChild(t),t=null},a.appendChild(t)}):r=function(e){setTimeout(h,0,e)}:(o="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&h(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(o+t,"*")}),m.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var a={callback:e,args:t};return u[l]=a,r(l),l++},m.clearImmediate=p}function p(e){delete u[e]}function h(e){if(c)setTimeout(h,0,e);else{var t=u[e];if(t){c=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(n,r)}}(t)}finally{p(e),c=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(8),n(148))},function(e,t){var n,r,a=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var l,u=[],c=!1,d=-1;function m(){c&&l&&(c=!1,l.length?u=l.concat(u):d=-1,u.length&&p())}function p(){if(!c){var e=s(m);c=!0;for(var t=u.length;t;){for(l=u,u=[];++d<t;)l&&l[d].run();d=-1,t=u.length}l=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function _(){}a.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new h(e,t)),1!==u.length||c||s(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=_,a.addListener=_,a.once=_,a.off=_,a.removeListener=_,a.removeAllListeners=_,a.emit=_,a.prependListener=_,a.prependOnceListener=_,a.listeners=function(e){return[]},a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},function(e,t,n){var r={"./af":10,"./af.js":10,"./ar":11,"./ar-dz":12,"./ar-dz.js":12,"./ar-kw":13,"./ar-kw.js":13,"./ar-ly":14,"./ar-ly.js":14,"./ar-ma":15,"./ar-ma.js":15,"./ar-sa":16,"./ar-sa.js":16,"./ar-tn":17,"./ar-tn.js":17,"./ar.js":11,"./az":18,"./az.js":18,"./be":19,"./be.js":19,"./bg":20,"./bg.js":20,"./bm":21,"./bm.js":21,"./bn":22,"./bn.js":22,"./bo":23,"./bo.js":23,"./br":24,"./br.js":24,"./bs":25,"./bs.js":25,"./ca":26,"./ca.js":26,"./cs":27,"./cs.js":27,"./cv":28,"./cv.js":28,"./cy":29,"./cy.js":29,"./da":30,"./da.js":30,"./de":31,"./de-at":32,"./de-at.js":32,"./de-ch":33,"./de-ch.js":33,"./de.js":31,"./dv":34,"./dv.js":34,"./el":35,"./el.js":35,"./en-au":36,"./en-au.js":36,"./en-ca":37,"./en-ca.js":37,"./en-gb":38,"./en-gb.js":38,"./en-ie":39,"./en-ie.js":39,"./en-nz":40,"./en-nz.js":40,"./eo":41,"./eo.js":41,"./es":42,"./es-do":43,"./es-do.js":43,"./es-us":44,"./es-us.js":44,"./es.js":42,"./et":45,"./et.js":45,"./eu":46,"./eu.js":46,"./fa":47,"./fa.js":47,"./fi":48,"./fi.js":48,"./fo":49,"./fo.js":49,"./fr":50,"./fr-ca":51,"./fr-ca.js":51,"./fr-ch":52,"./fr-ch.js":52,"./fr.js":50,"./fy":53,"./fy.js":53,"./gd":54,"./gd.js":54,"./gl":55,"./gl.js":55,"./gom-latn":56,"./gom-latn.js":56,"./gu":57,"./gu.js":57,"./he":58,"./he.js":58,"./hi":59,"./hi.js":59,"./hr":60,"./hr.js":60,"./hu":61,"./hu.js":61,"./hy-am":62,"./hy-am.js":62,"./id":63,"./id.js":63,"./is":64,"./is.js":64,"./it":65,"./it.js":65,"./ja":66,"./ja.js":66,"./jv":67,"./jv.js":67,"./ka":68,"./ka.js":68,"./kk":69,"./kk.js":69,"./km":70,"./km.js":70,"./kn":71,"./kn.js":71,"./ko":72,"./ko.js":72,"./ky":73,"./ky.js":73,"./lb":74,"./lb.js":74,"./lo":75,"./lo.js":75,"./lt":76,"./lt.js":76,"./lv":77,"./lv.js":77,"./me":78,"./me.js":78,"./mi":79,"./mi.js":79,"./mk":80,"./mk.js":80,"./ml":81,"./ml.js":81,"./mr":82,"./mr.js":82,"./ms":83,"./ms-my":84,"./ms-my.js":84,"./ms.js":83,"./mt":85,"./mt.js":85,"./my":86,"./my.js":86,"./nb":87,"./nb.js":87,"./ne":88,"./ne.js":88,"./nl":89,"./nl-be":90,"./nl-be.js":90,"./nl.js":89,"./nn":91,"./nn.js":91,"./pa-in":92,"./pa-in.js":92,"./pl":93,"./pl.js":93,"./pt":94,"./pt-br":95,"./pt-br.js":95,"./pt.js":94,"./ro":96,"./ro.js":96,"./ru":97,"./ru.js":97,"./sd":98,"./sd.js":98,"./se":99,"./se.js":99,"./si":100,"./si.js":100,"./sk":101,"./sk.js":101,"./sl":102,"./sl.js":102,"./sq":103,"./sq.js":103,"./sr":104,"./sr-cyrl":105,"./sr-cyrl.js":105,"./sr.js":104,"./ss":106,"./ss.js":106,"./sv":107,"./sv.js":107,"./sw":108,"./sw.js":108,"./ta":109,"./ta.js":109,"./te":110,"./te.js":110,"./tet":111,"./tet.js":111,"./th":112,"./th.js":112,"./tl-ph":113,"./tl-ph.js":113,"./tlh":114,"./tlh.js":114,"./tr":115,"./tr.js":115,"./tzl":116,"./tzl.js":116,"./tzm":117,"./tzm-latn":118,"./tzm-latn.js":118,"./tzm.js":117,"./uk":119,"./uk.js":119,"./ur":120,"./ur.js":120,"./uz":121,"./uz-latn":122,"./uz-latn.js":122,"./uz.js":121,"./vi":123,"./vi.js":123,"./x-pseudo":124,"./x-pseudo.js":124,"./yo":125,"./yo.js":125,"./zh-cn":126,"./zh-cn.js":126,"./zh-hk":127,"./zh-hk.js":127,"./zh-tw":128,"./zh-tw.js":128};function a(e){var t=i(e);return n(t)}function i(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}a.keys=function(){return Object.keys(r)},a.resolve=i,e.exports=a,a.id=149},function(e,t,n){var r;e.exports=function e(t,n,a){function i(s,l){if(!n[s]){if(!t[s]){if(!l&&"function"==typeof r&&r)return r(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[s]={exports:{}};t[s][0].call(c.exports,(function(e){return i(t[s][1][e]||e)}),c,c.exports,e,t,n,a)}return n[s].exports}for(var o="function"==typeof r&&r,s=0;s<a.length;s++)i(a[s]);return i}({1:[function(e,t,n){!function(e){"use strict";var n,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,i=Math.floor,o="[BigNumber Error] ",s=o+"Number primitive has more than 15 significant digits: ",l=1e14,u=14,c=9007199254740991,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],m=1e7,p=1e9;function h(e){var t=0|e;return 0<e||e===t?t:t-1}function _(e){for(var t,n,r=1,a=e.length,i=e[0]+"";r<a;){for(t=e[r++]+"",n=u-t.length;n--;t="0"+t);i+=t}for(a=i.length;48===i.charCodeAt(--a););return i.slice(0,a+1||1)}function f(e,t){var n,r,a=e.c,i=t.c,o=e.s,s=t.s,l=e.e,u=t.e;if(!o||!s)return null;if(n=a&&!a[0],r=i&&!i[0],n||r)return n?r?0:-s:o;if(o!=s)return o;if(n=o<0,r=l==u,!a||!i)return r?0:!a^n?1:-1;if(!r)return u<l^n?1:-1;for(s=(l=a.length)<(u=i.length)?l:u,o=0;o<s;o++)if(a[o]!=i[o])return a[o]>i[o]^n?1:-1;return l==u?0:u<l^n?1:-1}function y(e,t,n,r){if(e<t||n<e||e!==(e<0?a(e):i(e)))throw Error(o+(r||"Argument")+("number"==typeof e?e<t||n<e?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function g(e){var t=e.c.length-1;return h(e.e/u)==t&&e.c[t]%2!=0}function b(e,t){return(1<e.length?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function v(e,t,n){var r,a;if(t<0){for(a=n+".";++t;a+=n);e=a+e}else if(++t>(r=e.length)){for(a=n,t-=r;--t;a+=n);e+=a}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}(n=function e(t){var n,M,w,k,L,Y,D,T,S,O,j=B.prototype={constructor:B,toString:null,valueOf:null},x=new B(1),E=20,C=4,H=-7,P=21,z=-1e7,A=1e7,N=!1,F=1,R=0,W={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},I="0123456789abcdefghijklmnopqrstuvwxyz";function B(e,t){var n,a,o,l,d,m,p,h,_=this;if(!(_ instanceof B))return new B(e,t);if(null==t){if(e instanceof B)return _.s=e.s,_.e=e.e,void(_.c=(e=e.c)?e.slice():e);if((m="number"==typeof e)&&0*e==0){if(_.s=1/e<0?(e=-e,-1):1,e===~~e){for(l=0,d=e;10<=d;d/=10,l++);return _.e=l,void(_.c=[e])}h=String(e)}else{if(h=String(e),!r.test(h))return w(_,h,m);_.s=45==h.charCodeAt(0)?(h=h.slice(1),-1):1}-1<(l=h.indexOf("."))&&(h=h.replace(".","")),0<(d=h.search(/e/i))?(l<0&&(l=d),l+=+h.slice(d+1),h=h.substring(0,d)):l<0&&(l=h.length)}else{if(y(t,2,I.length,"Base"),h=String(e),10==t)return V(_=new B(e instanceof B?e:h),E+_.e+1,C);if(m="number"==typeof e){if(0*e!=0)return w(_,h,m,t);if(_.s=1/e<0?(h=h.slice(1),-1):1,B.DEBUG&&15<h.replace(/^0\.0*|\./,"").length)throw Error(s+e);m=!1}else _.s=45===h.charCodeAt(0)?(h=h.slice(1),-1):1;for(n=I.slice(0,t),l=d=0,p=h.length;d<p;d++)if(n.indexOf(a=h.charAt(d))<0){if("."==a){if(l<d){l=p;continue}}else if(!o&&(h==h.toUpperCase()&&(h=h.toLowerCase())||h==h.toLowerCase()&&(h=h.toUpperCase()))){o=!0,d=-1,l=0;continue}return w(_,String(e),m,t)}-1<(l=(h=M(h,t,10,_.s)).indexOf("."))?h=h.replace(".",""):l=h.length}for(d=0;48===h.charCodeAt(d);d++);for(p=h.length;48===h.charCodeAt(--p););if(h=h.slice(d,++p)){if(p-=d,m&&B.DEBUG&&15<p&&(c<e||e!==i(e)))throw Error(s+_.s*e);if(A<(l=l-d-1))_.c=_.e=null;else if(l<z)_.c=[_.e=0];else{if(_.e=l,_.c=[],d=(l+1)%u,l<0&&(d+=u),d<p){for(d&&_.c.push(+h.slice(0,d)),p-=u;d<p;)_.c.push(+h.slice(d,d+=u));h=h.slice(d),d=u-h.length}else d-=p;for(;d--;h+="0");_.c.push(+h)}}else _.c=[_.e=0]}function J(e,t,n,r){var a,i,o,s,l;if(null==n?n=C:y(n,0,8),!e.c)return e.toString();if(a=e.c[0],o=e.e,null==t)l=_(e.c),l=1==r||2==r&&(o<=H||P<=o)?b(l,o):v(l,o,"0");else if(i=(e=V(new B(e),t,n)).e,s=(l=_(e.c)).length,1==r||2==r&&(t<=i||i<=H)){for(;s<t;l+="0",s++);l=b(l,i)}else if(t-=o,l=v(l,i,"0"),s<i+1){if(0<--t)for(l+=".";t--;l+="0");}else if(0<(t+=i-s))for(i+1==s&&(l+=".");t--;l+="0");return e.s<0&&a?"-"+l:l}function U(e,t){for(var n,r=1,a=new B(e[0]);r<e.length;r++){if(!(n=new B(e[r])).s){a=n;break}t.call(a,n)&&(a=n)}return a}function q(e,t,n){for(var r=1,a=t.length;!t[--a];t.pop());for(a=t[0];10<=a;a/=10,r++);return(n=r+n*u-1)>A?e.c=e.e=null:e.c=n<z?[e.e=0]:(e.e=n,t),e}function V(e,t,n,r){var o,s,c,m,p,h,_,f=e.c,y=d;if(f){e:{for(o=1,m=f[0];10<=m;m/=10,o++);if((s=t-o)<0)s+=u,c=t,_=(p=f[h=0])/y[o-c-1]%10|0;else if((h=a((s+1)/u))>=f.length){if(!r)break e;for(;f.length<=h;f.push(0));p=_=0,c=(s%=u)-u+(o=1)}else{for(p=m=f[h],o=1;10<=m;m/=10,o++);_=(c=(s%=u)-u+o)<0?0:p/y[o-c-1]%10|0}if(r=r||t<0||null!=f[h+1]||(c<0?p:p%y[o-c-1]),r=n<4?(_||r)&&(0==n||n==(e.s<0?3:2)):5<_||5==_&&(4==n||r||6==n&&(0<s?0<c?p/y[o-c]:0:f[h-1])%10&1||n==(e.s<0?8:7)),t<1||!f[0])return f.length=0,r?(t-=e.e+1,f[0]=y[(u-t%u)%u],e.e=-t||0):f[0]=e.e=0,e;if(0==s?(f.length=h,m=1,h--):(f.length=h+1,m=y[u-s],f[h]=0<c?i(p/y[o-c]%y[c])*m:0),r)for(;;){if(0==h){for(s=1,c=f[0];10<=c;c/=10,s++);for(c=f[0]+=m,m=1;10<=c;c/=10,m++);s!=m&&(e.e++,f[0]==l&&(f[0]=1));break}if(f[h]+=m,f[h]!=l)break;f[h--]=0,m=1}for(s=f.length;0===f[--s];f.pop());}e.e>A?e.c=e.e=null:e.e<z&&(e.c=[e.e=0])}return e}function G(e){var t,n=e.e;return null===n?e.toString():(t=_(e.c),t=n<=H||P<=n?b(t,n):v(t,n,"0"),e.s<0?"-"+t:t)}return B.clone=e,B.ROUND_UP=0,B.ROUND_DOWN=1,B.ROUND_CEIL=2,B.ROUND_FLOOR=3,B.ROUND_HALF_UP=4,B.ROUND_HALF_DOWN=5,B.ROUND_HALF_EVEN=6,B.ROUND_HALF_CEIL=7,B.ROUND_HALF_FLOOR=8,B.EUCLID=9,B.config=B.set=function(e){var t,n;if(null!=e){if("object"!=typeof e)throw Error(o+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(y(n=e[t],0,p,t),E=n),e.hasOwnProperty(t="ROUNDING_MODE")&&(y(n=e[t],0,8,t),C=n),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((n=e[t])&&n.pop?(y(n[0],-p,0,t),y(n[1],0,p,t),H=n[0],P=n[1]):(y(n,-p,p,t),H=-(P=n<0?-n:n))),e.hasOwnProperty(t="RANGE"))if((n=e[t])&&n.pop)y(n[0],-p,-1,t),y(n[1],1,p,t),z=n[0],A=n[1];else{if(y(n,-p,p,t),!n)throw Error(o+t+" cannot be zero: "+n);z=-(A=n<0?-n:n)}if(e.hasOwnProperty(t="CRYPTO")){if((n=e[t])!==!!n)throw Error(o+t+" not true or false: "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw N=!n,Error(o+"crypto unavailable");N=n}else N=n}if(e.hasOwnProperty(t="MODULO_MODE")&&(y(n=e[t],0,9,t),F=n),e.hasOwnProperty(t="POW_PRECISION")&&(y(n=e[t],0,p,t),R=n),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(n=e[t]))throw Error(o+t+" not an object: "+n);W=n}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(n=e[t])||/^.$|[+-.\s]|(.).*\1/.test(n))throw Error(o+t+" invalid: "+n);I=n}}return{DECIMAL_PLACES:E,ROUNDING_MODE:C,EXPONENTIAL_AT:[H,P],RANGE:[z,A],CRYPTO:N,MODULO_MODE:F,POW_PRECISION:R,FORMAT:W,ALPHABET:I}},B.isBigNumber=function(e){return e instanceof B||e&&!0===e._isBigNumber||!1},B.maximum=B.max=function(){return U(arguments,j.lt)},B.minimum=B.min=function(){return U(arguments,j.gt)},B.random=(k=9007199254740992,L=Math.random()*k&2097151?function(){return i(Math.random()*k)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,n,r,s,l,c=0,m=[],h=new B(x);if(null==e?e=E:y(e,0,p),s=a(e/u),N)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(s*=2));c<s;)9e15<=(l=131072*t[c]+(t[c+1]>>>11))?(n=crypto.getRandomValues(new Uint32Array(2)),t[c]=n[0],t[c+1]=n[1]):(m.push(l%1e14),c+=2);c=s/2}else{if(!crypto.randomBytes)throw N=!1,Error(o+"crypto unavailable");for(t=crypto.randomBytes(s*=7);c<s;)9e15<=(l=281474976710656*(31&t[c])+1099511627776*t[c+1]+4294967296*t[c+2]+16777216*t[c+3]+(t[c+4]<<16)+(t[c+5]<<8)+t[c+6])?crypto.randomBytes(7).copy(t,c):(m.push(l%1e14),c+=7);c=s/7}if(!N)for(;c<s;)(l=L())<9e15&&(m[c++]=l%1e14);for(s=m[--c],e%=u,s&&e&&(l=d[u-e],m[c]=i(s/l)*l);0===m[c];m.pop(),c--);if(c<0)m=[r=0];else{for(r=-1;0===m[0];m.splice(0,1),r-=u);for(c=1,l=m[0];10<=l;l/=10,c++);c<u&&(r-=u-c)}return h.e=r,h.c=m,h}),B.sum=function(){for(var e=1,t=arguments,n=new B(t[0]);e<t.length;)n=n.plus(t[e++]);return n},M=function(){var e="0123456789";function t(e,t,n,r){for(var a,i,o=[0],s=0,l=e.length;s<l;){for(i=o.length;i--;o[i]*=t);for(o[0]+=r.indexOf(e.charAt(s++)),a=0;a<o.length;a++)o[a]>n-1&&(null==o[a+1]&&(o[a+1]=0),o[a+1]+=o[a]/n|0,o[a]%=n)}return o.reverse()}return function(r,a,i,o,s){var l,u,c,d,m,p,h,f,y=r.indexOf("."),g=E,b=C;for(0<=y&&(d=R,R=0,r=r.replace(".",""),p=(f=new B(a)).pow(r.length-y),R=d,f.c=t(v(_(p.c),p.e,"0"),10,i,e),f.e=f.c.length),c=d=(h=t(r,a,i,s?(l=I,e):(l=e,I))).length;0==h[--d];h.pop());if(!h[0])return l.charAt(0);if(y<0?--c:(p.c=h,p.e=c,p.s=o,h=(p=n(p,f,g,b,i)).c,m=p.r,c=p.e),y=h[u=c+g+1],d=i/2,m=m||u<0||null!=h[u+1],m=b<4?(null!=y||m)&&(0==b||b==(p.s<0?3:2)):d<y||y==d&&(4==b||m||6==b&&1&h[u-1]||b==(p.s<0?8:7)),u<1||!h[0])r=m?v(l.charAt(1),-g,l.charAt(0)):l.charAt(0);else{if(h.length=u,m)for(--i;++h[--u]>i;)h[u]=0,u||(++c,h=[1].concat(h));for(d=h.length;!h[--d];);for(y=0,r="";y<=d;r+=l.charAt(h[y++]));r=v(r,c,l.charAt(0))}return r}}(),n=function(){function e(e,t,n){var r,a,i,o,s=0,l=e.length,u=t%m,c=t/m|0;for(e=e.slice();l--;)s=((a=u*(i=e[l]%m)+(r=c*i+(o=e[l]/m|0)*u)%m*m+s)/n|0)+(r/m|0)+c*o,e[l]=a%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,r){var a,i;if(n!=r)i=r<n?1:-1;else for(a=i=0;a<n;a++)if(e[a]!=t[a]){i=e[a]>t[a]?1:-1;break}return i}function n(e,t,n,r){for(var a=0;n--;)e[n]-=a,a=e[n]<t[n]?1:0,e[n]=a*r+e[n]-t[n];for(;!e[0]&&1<e.length;e.splice(0,1));}return function(r,a,o,s,c){var d,m,p,_,f,y,g,b,v,M,w,k,L,Y,D,T,S,O=r.s==a.s?1:-1,j=r.c,x=a.c;if(!(j&&j[0]&&x&&x[0]))return new B(r.s&&a.s&&(j?!x||j[0]!=x[0]:x)?j&&0==j[0]||!x?0*O:O/0:NaN);for(v=(b=new B(O)).c=[],O=o+(m=r.e-a.e)+1,c||(c=l,m=h(r.e/u)-h(a.e/u),O=O/u|0),p=0;x[p]==(j[p]||0);p++);if(x[p]>(j[p]||0)&&m--,O<0)v.push(1),_=!0;else{for(Y=j.length,T=x.length,O+=2,1<(f=i(c/(x[p=0]+1)))&&(x=e(x,f,c),j=e(j,f,c),T=x.length,Y=j.length),L=T,w=(M=j.slice(0,T)).length;w<T;M[w++]=0);S=x.slice(),S=[0].concat(S),D=x[0],x[1]>=c/2&&D++;do{if(f=0,(d=t(x,M,T,w))<0){if(k=M[0],T!=w&&(k=k*c+(M[1]||0)),1<(f=i(k/D)))for(c<=f&&(f=c-1),g=(y=e(x,f,c)).length,w=M.length;1==t(y,M,g,w);)f--,n(y,T<g?S:x,g,c),g=y.length,d=1;else 0==f&&(d=f=1),g=(y=x.slice()).length;if(g<w&&(y=[0].concat(y)),n(M,y,w,c),w=M.length,-1==d)for(;t(x,M,T,w)<1;)f++,n(M,T<w?S:x,w,c),w=M.length}else 0===d&&(f++,M=[0]);v[p++]=f,M[0]?M[w++]=j[L]||0:(M=[j[L]],w=1)}while((L++<Y||null!=M[0])&&O--);_=null!=M[0],v[0]||v.splice(0,1)}if(c==l){for(p=1,O=v[0];10<=O;O/=10,p++);V(b,o+(b.e=p+m*u-1)+1,s,_)}else b.e=m,b.r=+_;return b}}(),Y=/^(-?)0([xbo])(?=\w[\w.]*$)/i,D=/^([^.]+)\.$/,T=/^\.([^.]+)$/,S=/^-?(Infinity|NaN)$/,O=/^\s*\+(?=[\w.])|^\s+|\s+$/g,w=function(e,t,n,r){var a,i=n?t:t.replace(O,"");if(S.test(i))e.s=isNaN(i)?null:i<0?-1:1,e.c=e.e=null;else{if(!n&&(i=i.replace(Y,(function(e,t,n){return a="x"==(n=n.toLowerCase())?16:"b"==n?2:8,r&&r!=a?e:t})),r&&(a=r,i=i.replace(D,"$1").replace(T,"0.$1")),t!=i))return new B(i,a);if(B.DEBUG)throw Error(o+"Not a"+(r?" base "+r:"")+" number: "+t);e.c=e.e=e.s=null}},j.absoluteValue=j.abs=function(){var e=new B(this);return e.s<0&&(e.s=1),e},j.comparedTo=function(e,t){return f(this,new B(e,t))},j.decimalPlaces=j.dp=function(e,t){var n,r,a;if(null!=e)return y(e,0,p),null==t?t=C:y(t,0,8),V(new B(this),e+this.e+1,t);if(!(n=this.c))return null;if(r=((a=n.length-1)-h(this.e/u))*u,a=n[a])for(;a%10==0;a/=10,r--);return r<0&&(r=0),r},j.dividedBy=j.div=function(e,t){return n(this,new B(e,t),E,C)},j.dividedToIntegerBy=j.idiv=function(e,t){return n(this,new B(e,t),0,1)},j.exponentiatedBy=j.pow=function(e,t){var n,r,s,l,c,d,m,p,h=this;if((e=new B(e)).c&&!e.isInteger())throw Error(o+"Exponent not an integer: "+G(e));if(null!=t&&(t=new B(t)),c=14<e.e,!h.c||!h.c[0]||1==h.c[0]&&!h.e&&1==h.c.length||!e.c||!e.c[0])return p=new B(Math.pow(+G(h),c?2-g(e):+G(e))),t?p.mod(t):p;if(d=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new B(NaN);(r=!d&&h.isInteger()&&t.isInteger())&&(h=h.mod(t))}else{if(9<e.e&&(0<h.e||h.e<-1||(0==h.e?1<h.c[0]||c&&24e7<=h.c[1]:h.c[0]<8e13||c&&h.c[0]<=9999975e7)))return l=h.s<0&&g(e)?-0:0,-1<h.e&&(l=1/l),new B(d?1/l:l);R&&(l=a(R/u+2))}for(m=c?(n=new B(.5),d&&(e.s=1),g(e)):(s=Math.abs(+G(e)))%2,p=new B(x);;){if(m){if(!(p=p.times(h)).c)break;l?p.c.length>l&&(p.c.length=l):r&&(p=p.mod(t))}if(s){if(0===(s=i(s/2)))break;m=s%2}else if(V(e=e.times(n),e.e+1,1),14<e.e)m=g(e);else{if(0==(s=+G(e)))break;m=s%2}h=h.times(h),l?h.c&&h.c.length>l&&(h.c.length=l):r&&(h=h.mod(t))}return r?p:(d&&(p=x.div(p)),t?p.mod(t):l?V(p,R,C,void 0):p)},j.integerValue=function(e){var t=new B(this);return null==e?e=C:y(e,0,8),V(t,t.e+1,e)},j.isEqualTo=j.eq=function(e,t){return 0===f(this,new B(e,t))},j.isFinite=function(){return!!this.c},j.isGreaterThan=j.gt=function(e,t){return 0<f(this,new B(e,t))},j.isGreaterThanOrEqualTo=j.gte=function(e,t){return 1===(t=f(this,new B(e,t)))||0===t},j.isInteger=function(){return!!this.c&&h(this.e/u)>this.c.length-2},j.isLessThan=j.lt=function(e,t){return f(this,new B(e,t))<0},j.isLessThanOrEqualTo=j.lte=function(e,t){return-1===(t=f(this,new B(e,t)))||0===t},j.isNaN=function(){return!this.s},j.isNegative=function(){return this.s<0},j.isPositive=function(){return 0<this.s},j.isZero=function(){return!!this.c&&0==this.c[0]},j.minus=function(e,t){var n,r,a,i,o=this,s=o.s;if(t=(e=new B(e,t)).s,!s||!t)return new B(NaN);if(s!=t)return e.s=-t,o.plus(e);var c=o.e/u,d=e.e/u,m=o.c,p=e.c;if(!c||!d){if(!m||!p)return m?(e.s=-t,e):new B(p?o:NaN);if(!m[0]||!p[0])return p[0]?(e.s=-t,e):new B(m[0]?o:3==C?-0:0)}if(c=h(c),d=h(d),m=m.slice(),s=c-d){for((a=(i=s<0)?(s=-s,m):(d=c,p)).reverse(),t=s;t--;a.push(0));a.reverse()}else for(r=(i=(s=m.length)<(t=p.length))?s:t,s=t=0;t<r;t++)if(m[t]!=p[t]){i=m[t]<p[t];break}if(i&&(a=m,m=p,p=a,e.s=-e.s),0<(t=(r=p.length)-(n=m.length)))for(;t--;m[n++]=0);for(t=l-1;s<r;){if(m[--r]<p[r]){for(n=r;n&&!m[--n];m[n]=t);--m[n],m[r]+=l}m[r]-=p[r]}for(;0==m[0];m.splice(0,1),--d);return m[0]?q(e,m,d):(e.s=3==C?-1:1,e.c=[e.e=0],e)},j.modulo=j.mod=function(e,t){var r,a,i=this;return e=new B(e,t),!i.c||!e.s||e.c&&!e.c[0]?new B(NaN):!e.c||i.c&&!i.c[0]?new B(i):(9==F?(a=e.s,e.s=1,r=n(i,e,0,3),e.s=a,r.s*=a):r=n(i,e,0,F),(e=i.minus(r.times(e))).c[0]||1!=F||(e.s=i.s),e)},j.multipliedBy=j.times=function(e,t){var n,r,a,i,o,s,c,d,p,_,f,y,g,b,v,M=this,w=M.c,k=(e=new B(e,t)).c;if(!(w&&k&&w[0]&&k[0]))return!M.s||!e.s||w&&!w[0]&&!k||k&&!k[0]&&!w?e.c=e.e=e.s=null:(e.s*=M.s,w&&k?(e.c=[0],e.e=0):e.c=e.e=null),e;for(r=h(M.e/u)+h(e.e/u),e.s*=M.s,(c=w.length)<(_=k.length)&&(g=w,w=k,k=g,a=c,c=_,_=a),a=c+_,g=[];a--;g.push(0));for(b=l,v=m,a=_;0<=--a;){for(n=0,f=k[a]%v,y=k[a]/v|0,i=a+(o=c);a<i;)n=((d=f*(d=w[--o]%v)+(s=y*d+(p=w[o]/v|0)*f)%v*v+g[i]+n)/b|0)+(s/v|0)+y*p,g[i--]=d%b;g[i]=n}return n?++r:g.splice(0,1),q(e,g,r)},j.negated=function(){var e=new B(this);return e.s=-e.s||null,e},j.plus=function(e,t){var n,r=this,a=r.s;if(t=(e=new B(e,t)).s,!a||!t)return new B(NaN);if(a!=t)return e.s=-t,r.minus(e);var i=r.e/u,o=e.e/u,s=r.c,c=e.c;if(!i||!o){if(!s||!c)return new B(a/0);if(!s[0]||!c[0])return c[0]?e:new B(s[0]?r:0*a)}if(i=h(i),o=h(o),s=s.slice(),a=i-o){for((n=0<a?(o=i,c):(a=-a,s)).reverse();a--;n.push(0));n.reverse()}for((a=s.length)-(t=c.length)<0&&(n=c,c=s,s=n,t=a),a=0;t;)a=(s[--t]=s[t]+c[t]+a)/l|0,s[t]=l===s[t]?0:s[t]%l;return a&&(s=[a].concat(s),++o),q(e,s,o)},j.precision=j.sd=function(e,t){var n,r,a;if(null!=e&&e!==!!e)return y(e,1,p),null==t?t=C:y(t,0,8),V(new B(this),e,t);if(!(n=this.c))return null;if(r=(a=n.length-1)*u+1,a=n[a]){for(;a%10==0;a/=10,r--);for(a=n[0];10<=a;a/=10,r++);}return e&&this.e+1>r&&(r=this.e+1),r},j.shiftedBy=function(e){return y(e,-c,c),this.times("1e"+e)},j.squareRoot=j.sqrt=function(){var e,t,r,a,i,o=this,s=o.c,l=o.s,u=o.e,c=E+4,d=new B("0.5");if(1!==l||!s||!s[0])return new B(!l||l<0&&(!s||s[0])?NaN:s?o:1/0);if((r=0==(l=Math.sqrt(+G(o)))||l==1/0?(((t=_(s)).length+u)%2==0&&(t+="0"),l=Math.sqrt(+t),u=h((u+1)/2)-(u<0||u%2),new B(t=l==1/0?"1e"+u:(t=l.toExponential()).slice(0,t.indexOf("e")+1)+u)):new B(l+"")).c[0])for((l=(u=r.e)+c)<3&&(l=0);;)if(i=r,r=d.times(i.plus(n(o,i,c,1))),_(i.c).slice(0,l)===(t=_(r.c)).slice(0,l)){if(r.e<u&&--l,"9999"!=(t=t.slice(l-3,l+1))&&(a||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(V(r,r.e+E+2,1),e=!r.times(r).eq(o));break}if(!a&&(V(i,i.e+E+2,0),i.times(i).eq(o))){r=i;break}c+=4,l+=4,a=1}return V(r,r.e+E+1,C,e)},j.toExponential=function(e,t){return null!=e&&(y(e,0,p),e++),J(this,e,t,1)},j.toFixed=function(e,t){return null!=e&&(y(e,0,p),e=e+this.e+1),J(this,e,t)},j.toFormat=function(e,t,n){var r;if(null==n)null!=e&&t&&"object"==typeof t?(n=t,t=null):e&&"object"==typeof e?(n=e,e=t=null):n=W;else if("object"!=typeof n)throw Error(o+"Argument not an object: "+n);if(r=this.toFixed(e,t),this.c){var a,i=r.split("."),s=+n.groupSize,l=+n.secondaryGroupSize,u=n.groupSeparator||"",c=i[0],d=i[1],m=this.s<0,p=m?c.slice(1):c,h=p.length;if(l&&(a=s,s=l,h-=l=a),0<s&&0<h){for(a=h%s||s,c=p.substr(0,a);a<h;a+=s)c+=u+p.substr(a,s);0<l&&(c+=u+p.slice(a)),m&&(c="-"+c)}r=d?c+(n.decimalSeparator||"")+((l=+n.fractionGroupSize)?d.replace(new RegExp("\\d{"+l+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):d):c}return(n.prefix||"")+r+(n.suffix||"")},j.toFraction=function(e){var t,r,a,i,s,l,c,m,p,h,f,y,g=this,b=g.c;if(null!=e&&(!(c=new B(e)).isInteger()&&(c.c||1!==c.s)||c.lt(x)))throw Error(o+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+G(c));if(!b)return new B(g);for(t=new B(x),p=r=new B(x),a=m=new B(x),y=_(b),s=t.e=y.length-g.e-1,t.c[0]=d[(l=s%u)<0?u+l:l],e=!e||0<c.comparedTo(t)?0<s?t:p:c,l=A,A=1/0,c=new B(y),m.c[0]=0;h=n(c,t,0,1),1!=(i=r.plus(h.times(a))).comparedTo(e);)r=a,a=i,p=m.plus(h.times(i=p)),m=i,t=c.minus(h.times(i=t)),c=i;return i=n(e.minus(r),a,0,1),m=m.plus(i.times(p)),r=r.plus(i.times(a)),m.s=p.s=g.s,f=n(p,a,s*=2,C).minus(g).abs().comparedTo(n(m,r,s,C).minus(g).abs())<1?[p,a]:[m,r],A=l,f},j.toNumber=function(){return+G(this)},j.toPrecision=function(e,t){return null!=e&&y(e,1,p),J(this,e,t,2)},j.toString=function(e){var t,n=this,r=n.s,a=n.e;return null===a?r?(t="Infinity",r<0&&(t="-"+t)):t="NaN":(t=null==e?a<=H||P<=a?b(_(n.c),a):v(_(n.c),a,"0"):10===e?v(_((n=V(new B(n),E+a+1,C)).c),n.e,"0"):(y(e,2,I.length,"Base"),M(v(_(n.c),a,"0"),10,e,r,!0)),r<0&&n.c[0]&&(t="-"+t)),t},j.valueOf=j.toJSON=function(){return G(this)},j._isBigNumber=!0,"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator&&(j[Symbol.toStringTag]="BigNumber",j[Symbol.for("nodejs.util.inspect.custom")]=j.valueOf),null!=t&&B.set(t),B}()).default=n.BigNumber=n,void 0!==t&&t.exports?t.exports=n:(e||(e="undefined"!=typeof self&&self?self:window),e.BigNumber=n)}(this)},{}],2:[function(e,t,n){"use strict";t.exports={languageTag:"en-US",delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},spaceSeparated:!1,ordinal:function(e){var t=e%10;return 1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th"},currency:{symbol:"$",position:"prefix",code:"USD"},currencyFormat:{thousandSeparated:!0,totalLength:4,spaceSeparated:!0},formats:{fourDigits:{totalLength:4,spaceSeparated:!0},fullWithTwoDecimals:{output:"currency",thousandSeparated:!0,mantissa:2},fullWithTwoDecimalsNoCurrency:{thousandSeparated:!0,mantissa:2},fullWithNoDecimals:{output:"currency",thousandSeparated:!0,mantissa:0}}}},{}],3:[function(e,t,n){"use strict";function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,a=!1,i=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){a=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(a)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var a=e("./globalState"),i=e("./validating"),o=e("./parsing"),s=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],l={general:{scale:1024,suffixes:s,marker:"bd"},binary:{scale:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],marker:"b"},decimal:{scale:1e3,suffixes:s,marker:"d"}},u={totalLength:0,characteristic:0,forceAverage:!1,average:!1,mantissa:-1,optionalMantissa:!0,thousandSeparated:!1,spaceSeparated:!1,negative:"sign",forceSign:!1};function c(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=2<arguments.length?arguments[2]:void 0;if("string"==typeof t&&(t=o.parseFormat(t)),!i.validateFormat(t))return"ERROR: invalid format";var r=t.prefix||"",s=t.postfix||"",c=function(e,t,n){switch(t.output){case"currency":return function(e,t,n){var r=n.currentCurrency(),a=Object.assign({},u,t),i=void 0,o="",s=!!a.totalLength||!!a.forceAverage||a.average,l=t.currencyPosition||r.position,c=t.currencySymbol||r.symbol;a.spaceSeparated&&(o=" "),"infix"===l&&(i=o+c+o);var d=h({instance:e,providedFormat:t,state:n,decimalSeparator:i});return"prefix"===l&&(d=e._value<0&&"sign"===a.negative?"-".concat(o).concat(c).concat(d.slice(1)):c+o+d),l&&"postfix"!==l||(d=d+(o=s?"":o)+c),d}(e,t=_(t,a.currentCurrencyDefaultFormat()),a);case"percent":return function(e,t,n,r){var a=t.prefixSymbol,i=h({instance:r(100*e._value),providedFormat:t,state:n}),o=Object.assign({},u,t);return a?"%".concat(o.spaceSeparated?" ":"").concat(i):"".concat(i).concat(o.spaceSeparated?" ":"","%")}(e,t=_(t,a.currentPercentageDefaultFormat()),a,n);case"byte":return t=_(t,a.currentByteDefaultFormat()),v=e,w=a,k=n,L=(M=t).base||"binary",Y=l[L],T=(D=d(v._value,Y.suffixes,Y.scale)).value,S=D.suffix,O=h({instance:k(T),providedFormat:M,state:w,defaults:w.currentByteDefaultFormat()}),j=w.currentAbbreviations(),"".concat(O).concat(j.spaced?" ":"").concat(S);case"time":return t=_(t,a.currentTimeDefaultFormat()),f=e,y=Math.floor(f._value/60/60),g=Math.floor((f._value-60*y*60)/60),b=Math.round(f._value-60*y*60-60*g),"".concat(y,":").concat(g<10?"0":"").concat(g,":").concat(b<10?"0":"").concat(b);case"ordinal":return r=e,i=t=_(t,a.currentOrdinalDefaultFormat()),s=(o=a).currentOrdinal(),c=Object.assign({},u,i),m=h({instance:r,providedFormat:i,state:o}),p=s(r._value),"".concat(m).concat(c.spaceSeparated?" ":"").concat(p);case"number":default:return h({instance:e,providedFormat:t,numbro:n})}var r,i,o,s,c,m,p,f,y,g,b,v,M,w,k,L,Y,D,T,S,O,j}(e,t,n);return(c=r+c)+s}function d(e,t,n){var r=t[0],a=Math.abs(e);if(n<=a){for(var i=1;i<t.length;++i){var o=Math.pow(n,i),s=Math.pow(n,i+1);if(o<=a&&a<s){r=t[i],e/=o;break}}r===t[0]&&(e/=Math.pow(n,t.length-1),r=t[t.length-1])}return{value:e,suffix:r}}function m(e){for(var t="",n=0;n<e;n++)t+="0";return t}function p(e,t){return-1!==e.toString().indexOf("e")?function(e,t){var n=e.toString(),a=r(n.split("e"),2),i=a[0],o=a[1],s=r(i.split("."),2),l=s[0],u=s[1],c=void 0===u?"":u;if(0<+o)n=l+c+m(o-c.length);else{var d=".";d=+l<0?"-0".concat(d):"0".concat(d);var p=(m(-o-1)+Math.abs(l)+c).substr(0,t);p.length<t&&(p+=m(t-p.length)),n=d+p}return 0<+o&&0<t&&(n+=".".concat(m(t))),n}(e,t):(Math.round(+"".concat(e,"e+").concat(t))/Math.pow(10,t)).toFixed(t)}function h(e){var t=e.instance,n=e.providedFormat,i=e.state,o=void 0===i?a:i,s=e.decimalSeparator,l=e.defaults,c=void 0===l?o.currentDefaults():l,d=t._value;if(0===d&&o.hasZeroFormat())return o.getZeroFormat();if(!isFinite(d))return d.toString();var m,h,_,f,y,g,b,v,M=Object.assign({},u,c,n),w=M.totalLength,k=w?0:M.characteristic,L=M.optionalCharacteristic,Y=M.forceAverage,D=!!w||!!Y||M.average,T=w?-1:D&&void 0===n.mantissa?0:M.mantissa,S=!w&&(void 0===n.optionalMantissa?-1===T:M.optionalMantissa),O=M.trimMantissa,j=M.thousandSeparated,x=M.spaceSeparated,E=M.negative,C=M.forceSign,H=M.exponential,P="";if(D){var z=function(e){var t=e.value,n=e.forceAverage,r=e.abbreviations,a=e.spaceSeparated,i=void 0!==a&&a,o=e.totalLength,s=void 0===o?0:o,l="",u=Math.abs(t),c=-1;if(u>=Math.pow(10,12)&&!n||"trillion"===n?(l=r.trillion,t/=Math.pow(10,12)):u<Math.pow(10,12)&&u>=Math.pow(10,9)&&!n||"billion"===n?(l=r.billion,t/=Math.pow(10,9)):u<Math.pow(10,9)&&u>=Math.pow(10,6)&&!n||"million"===n?(l=r.million,t/=Math.pow(10,6)):(u<Math.pow(10,6)&&u>=Math.pow(10,3)&&!n||"thousand"===n)&&(l=r.thousand,t/=Math.pow(10,3)),l&&(l=(i?" ":"")+l),s){var d=t.toString().split(".")[0];c=Math.max(s-d.length,0)}return{value:t,abbreviation:l,mantissaPrecision:c}}({value:d,forceAverage:Y,abbreviations:o.currentAbbreviations(),spaceSeparated:x,totalLength:w});d=z.value,P+=z.abbreviation,w&&(T=z.mantissaPrecision)}if(H){var A=(h=(m={value:d,characteristicPrecision:k}).value,f=void 0===(_=m.characteristicPrecision)?0:_,g=(y=r(h.toExponential().split("e"),2))[0],b=y[1],v=+g,f&&1<f&&(v*=Math.pow(10,f-1),b=0<=(b=+b-(f-1))?"+".concat(b):b),{value:v,abbreviation:"e".concat(b)});d=A.value,P=A.abbreviation+P}var N,F,R,W=function(e,t,n,a,i){if(-1===a)return e;var o=p(t,a),s=r(o.toString().split("."),2),l=s[0],u=s[1],c=void 0===u?"":u;if(c.match(/^0+$/)&&(n||i))return l;var d=c.match(/0+$/);return i&&d?"".concat(l,".").concat(c.toString().slice(0,d.index)):o.toString()}(d.toString(),d,S,T,O);return W=function(e,t,n,r,a){var i=r.currentDelimiters(),o=i.thousands;a=a||i.decimal;var s=i.thousandsSize||3,l=e.toString(),u=l.split(".")[0],c=l.split(".")[1];return n&&(t<0&&(u=u.slice(1)),function(e,t){for(var n=[],r=0,a=e;0<a;a--)r===t&&(n.unshift(a),r=0),r++;return n}(u.length,s).forEach((function(e,t){u=u.slice(0,e+t)+o+u.slice(e+t)})),t<0&&(u="-".concat(u))),c?u+a+c:u}(W=function(e,t,n,a){var i=e,o=r(i.toString().split("."),2),s=o[0],l=o[1];if(s.match(/^-?0$/)&&n)return l?"".concat(s.replace("0",""),".").concat(l):s.replace("0","");if(s.length<a)for(var u=a-s.length,c=0;c<u;c++)i="0".concat(i);return i.toString()}(W,0,L,k),d,j,o,s),(D||H)&&(W+=P),(C||d<0)&&(N=W,R=E,W=0===(F=d)?N:0==+N?N.replace("-",""):0<F?"+".concat(N):"sign"===R?N:"(".concat(N.replace("-",""),")")),W}function _(e,t){if(!e)return t;var n=Object.keys(e);return 1===n.length&&"output"===n[0]?t:e}t.exports=function(e){return{format:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return c.apply(void 0,n.concat([e]))},getByteUnit:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=l.general;return d(e._value,t.suffixes,t.scale).suffix}.apply(void 0,n.concat([e]))},getBinaryByteUnit:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=l.binary;return d(e._value,t.suffixes,t.scale).suffix}.apply(void 0,n.concat([e]))},getDecimalByteUnit:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(e){var t=l.decimal;return d(e._value,t.suffixes,t.scale).suffix}.apply(void 0,n.concat([e]))},formatOrDefault:_}}},{"./globalState":4,"./parsing":8,"./validating":10}],4:[function(e,t,n){"use strict";var r=e("./en-US"),a=e("./validating"),i=e("./parsing"),o={},s=void 0,l={},u=null,c={};function d(e){s=e}function m(){return l[s]}o.languages=function(){return Object.assign({},l)},o.currentLanguage=function(){return s},o.currentCurrency=function(){return m().currency},o.currentAbbreviations=function(){return m().abbreviations},o.currentDelimiters=function(){return m().delimiters},o.currentOrdinal=function(){return m().ordinal},o.currentDefaults=function(){return Object.assign({},m().defaults,c)},o.currentOrdinalDefaultFormat=function(){return Object.assign({},o.currentDefaults(),m().ordinalFormat)},o.currentByteDefaultFormat=function(){return Object.assign({},o.currentDefaults(),m().byteFormat)},o.currentPercentageDefaultFormat=function(){return Object.assign({},o.currentDefaults(),m().percentageFormat)},o.currentCurrencyDefaultFormat=function(){return Object.assign({},o.currentDefaults(),m().currencyFormat)},o.currentTimeDefaultFormat=function(){return Object.assign({},o.currentDefaults(),m().timeFormat)},o.setDefaults=function(e){e=i.parseFormat(e),a.validateFormat(e)&&(c=e)},o.getZeroFormat=function(){return u},o.setZeroFormat=function(e){return u="string"==typeof e?e:null},o.hasZeroFormat=function(){return null!==u},o.languageData=function(e){if(e){if(l[e])return l[e];throw new Error('Unknown tag "'.concat(e,'"'))}return m()},o.registerLanguage=function(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1];if(!a.validateLanguage(e))throw new Error("Invalid language data");l[e.languageTag]=e,t&&d(e.languageTag)},o.setLanguage=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:r.languageTag;if(!l[e]){var n=e.split("-")[0],a=Object.keys(l).find((function(e){return e.split("-")[0]===n}));return l[a]?void d(a):void d(t)}d(e)},o.registerLanguage(r),s=r.languageTag,t.exports=o},{"./en-US":2,"./parsing":8,"./validating":10}],5:[function(e,t,n){"use strict";t.exports=function(t){return{loadLanguagesInNode:function(n){return r=t,void n.forEach((function(t){var n=void 0;try{n=e("../languages/".concat(t))}catch(n){console.error('Unable to load "'.concat(t,'". No matching language file found.'))}n&&r.registerLanguage(n)}));var r}}}},{}],6:[function(e,t,n){"use strict";var r=e("bignumber.js");function a(e,t,n){var a=new r(e._value),i=t;return n.isNumbro(t)&&(i=t._value),i=new r(i),e._value=a.minus(i).toNumber(),e}t.exports=function(e){return{add:function(t,n){return i=n,o=e,s=new r((a=t)._value),l=i,o.isNumbro(i)&&(l=i._value),l=new r(l),a._value=s.plus(l).toNumber(),a;var a,i,o,s,l},subtract:function(t,n){return a(t,n,e)},multiply:function(t,n){return i=n,o=e,s=new r((a=t)._value),l=i,o.isNumbro(i)&&(l=i._value),l=new r(l),a._value=s.times(l).toNumber(),a;var a,i,o,s,l},divide:function(t,n){return i=n,o=e,s=new r((a=t)._value),l=i,o.isNumbro(i)&&(l=i._value),l=new r(l),a._value=s.dividedBy(l).toNumber(),a;var a,i,o,s,l},set:function(t,n){return r=t,i=a=n,e.isNumbro(a)&&(i=a._value),r._value=i,r;var r,a,i},difference:function(t,n){return r=n,a(o=(i=e)(t._value),r,i),Math.abs(o._value);var r,i,o}}}},{"bignumber.js":1}],7:[function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var a=e("./globalState"),i=e("./validating"),o=e("./loading")(p),s=e("./unformatting"),l=e("./formatting")(p),u=e("./manipulating")(p),c=e("./parsing"),d=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._value=t}var t,n;return t=e,(n=[{key:"clone",value:function(){return p(this._value)}},{key:"format",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return l.format(this,e)}},{key:"formatCurrency",value:function(e){return"string"==typeof e&&(e=c.parseFormat(e)),(e=l.formatOrDefault(e,a.currentCurrencyDefaultFormat())).output="currency",l.format(this,e)}},{key:"formatTime",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return e.output="time",l.format(this,e)}},{key:"binaryByteUnits",value:function(){return l.getBinaryByteUnit(this)}},{key:"decimalByteUnits",value:function(){return l.getDecimalByteUnit(this)}},{key:"byteUnits",value:function(){return l.getByteUnit(this)}},{key:"difference",value:function(e){return u.difference(this,e)}},{key:"add",value:function(e){return u.add(this,e)}},{key:"subtract",value:function(e){return u.subtract(this,e)}},{key:"multiply",value:function(e){return u.multiply(this,e)}},{key:"divide",value:function(e){return u.divide(this,e)}},{key:"set",value:function(e){return u.set(this,m(e))}},{key:"value",value:function(){return this._value}},{key:"valueOf",value:function(){return this._value}}])&&r(t.prototype,n),e}();function m(e){var t=e;return p.isNumbro(e)?t=e._value:"string"==typeof e?t=p.unformat(e):isNaN(e)&&(t=NaN),t}function p(e){return new d(m(e))}p.version="2.1.2",p.isNumbro=function(e){return e instanceof d},p.language=a.currentLanguage,p.registerLanguage=a.registerLanguage,p.setLanguage=a.setLanguage,p.languages=a.languages,p.languageData=a.languageData,p.zeroFormat=a.setZeroFormat,p.defaultFormat=a.currentDefaults,p.setDefaults=a.setDefaults,p.defaultCurrencyFormat=a.currentCurrencyDefaultFormat,p.validate=i.validate,p.loadLanguagesInNode=o.loadLanguagesInNode,p.unformat=s.unformat,t.exports=p},{"./formatting":3,"./globalState":4,"./loading":5,"./manipulating":6,"./parsing":8,"./unformatting":9,"./validating":10}],8:[function(e,t,n){"use strict";t.exports={parseFormat:function(e){var t,n,r,a,i,o,s,l,u,c,d,m,p,h,_,f,y,g,b,v,M=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return"string"!=typeof e?e:(n=M,i=M,function(e,t){if(-1===e.indexOf("$")){if(-1===e.indexOf("%"))return-1!==e.indexOf("bd")?(t.output="byte",t.base="general"):-1!==e.indexOf("b")?(t.output="byte",t.base="binary"):-1!==e.indexOf("d")?(t.output="byte",t.base="decimal"):-1===e.indexOf(":")?-1!==e.indexOf("o")&&(t.output="ordinal"):t.output="time";t.output="percent"}else t.output="currency"}(e=(o=(a=e=(r=(t=e).match(/^{([^}]*)}/))?(n.prefix=r[1],t.slice(r[0].length)):t).match(/{([^}]*)}$/))?(i.postfix=o[1],a.slice(0,-o[0].length)):a,M),s=M,(l=e.match(/[1-9]+[0-9]*/))&&(s.totalLength=+l[0]),u=M,(c=e.split(".")[0].match(/0+/))&&(u.characteristic=c[0].length),function(e,t){if(-1!==e.indexOf(".")){var n=e.split(".")[0];t.optionalCharacteristic=-1===n.indexOf("0")}}(e,M),d=M,-1!==e.indexOf("a")&&(d.average=!0),p=M,-1!==(m=e).indexOf("K")?p.forceAverage="thousand":-1!==m.indexOf("M")?p.forceAverage="million":-1!==m.indexOf("B")?p.forceAverage="billion":-1!==m.indexOf("T")&&(p.forceAverage="trillion"),function(e,t){var n=e.split(".")[1];if(n){var r=n.match(/0+/);r&&(t.mantissa=r[0].length)}}(e,M),_=M,(h=e).match(/\[\.]/)?_.optionalMantissa=!0:h.match(/\./)&&(_.optionalMantissa=!1),f=M,-1!==e.indexOf(",")&&(f.thousandSeparated=!0),y=M,-1!==e.indexOf(" ")&&(y.spaceSeparated=!0),b=M,(g=e).match(/^\+?\([^)]*\)$/)&&(b.negative="parenthesis"),g.match(/^\+?-/)&&(b.negative="sign"),v=M,e.match(/^\+/)&&(v.forceSign=!0),M)}}},{}],9:[function(e,t,n){"use strict";var r=[{key:"ZiB",factor:Math.pow(1024,7)},{key:"ZB",factor:Math.pow(1e3,7)},{key:"YiB",factor:Math.pow(1024,8)},{key:"YB",factor:Math.pow(1e3,8)},{key:"TiB",factor:Math.pow(1024,4)},{key:"TB",factor:Math.pow(1e3,4)},{key:"PiB",factor:Math.pow(1024,5)},{key:"PB",factor:Math.pow(1e3,5)},{key:"MiB",factor:Math.pow(1024,2)},{key:"MB",factor:Math.pow(1e3,2)},{key:"KiB",factor:Math.pow(1024,1)},{key:"KB",factor:Math.pow(1e3,1)},{key:"GiB",factor:Math.pow(1024,3)},{key:"GB",factor:Math.pow(1e3,3)},{key:"EiB",factor:Math.pow(1024,6)},{key:"EB",factor:Math.pow(1e3,6)},{key:"B",factor:1}];function a(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}t.exports={unformat:function(t,n){var i,o,s,l=e("./globalState"),u=l.currentDelimiters(),c=l.currentCurrency().symbol,d=l.currentOrdinal(),m=l.getZeroFormat(),p=l.currentAbbreviations(),h=void 0;if("string"==typeof t)h=function(e,t){if(!e.indexOf(":")||":"===t.thousands)return!1;var n=e.split(":");if(3!==n.length)return!1;var r=+n[0],a=+n[1],i=+n[2];return!isNaN(r)&&!isNaN(a)&&!isNaN(i)}(t,u)?(o=+(i=t.split(":"))[0],s=+i[1],+i[2]+60*s+3600*o):function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"",i=3<arguments.length?arguments[3]:void 0,o=4<arguments.length?arguments[4]:void 0,s=5<arguments.length?arguments[5]:void 0,l=6<arguments.length?arguments[6]:void 0;if(""!==e)return e===o?0:function e(t,n){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"",o=3<arguments.length?arguments[3]:void 0,s=4<arguments.length?arguments[4]:void 0,l=5<arguments.length?arguments[5]:void 0,u=6<arguments.length?arguments[6]:void 0;if(!isNaN(+t))return+t;var c="",d=t.replace(/(^[^(]*)\((.*)\)([^)]*$)/,"$1$2$3");if(d!==t)return-1*e(d,n,i,o,s,l,u);for(var m=0;m<r.length;m++){var p=r[m];if((c=t.replace(p.key,""))!==t)return e(c,n,i,o,s,l,u)*p.factor}if((c=t.replace("%",""))!==t)return e(c,n,i,o,s,l,u)/100;var h=parseFloat(t);if(!isNaN(h)){var _=o(h);if(_&&"."!==_&&(c=t.replace(new RegExp("".concat(a(_),"$")),""))!==t)return e(c,n,i,o,s,l,u);var f={};Object.keys(l).forEach((function(e){f[l[e]]=e}));for(var y=Object.keys(f).sort().reverse(),g=y.length,b=0;b<g;b++){var v=y[b],M=f[v];if((c=t.replace(v,""))!==t){var w=void 0;switch(M){case"thousand":w=Math.pow(10,3);break;case"million":w=Math.pow(10,6);break;case"billion":w=Math.pow(10,9);break;case"trillion":w=Math.pow(10,12)}return e(c,n,i,o,s,l,u)*w}}}}(function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"",r=e.replace(n,"");return(r=r.replace(new RegExp("([0-9])".concat(a(t.thousands),"([0-9])"),"g"),"$1$2")).replace(t.decimal,".")}(e,t,n),t,n,i,o,s,l)}(t,u,c,d,m,p,n);else{if("number"!=typeof t)return;h=t}if(void 0!==h)return h}}},{"./globalState":4}],10:[function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=e("./unformatting"),i=/^[a-z]{2,3}(-[a-zA-Z]{4})?(-([A-Z]{2}|[0-9]{3}))?$/,o={output:{type:"string",validValues:["currency","percent","byte","time","ordinal","number"]},base:{type:"string",validValues:["decimal","binary","general"],restriction:function(e,t){return"byte"===t.output},message:"`base` must be provided only when the output is `byte`",mandatory:function(e){return"byte"===e.output}},characteristic:{type:"number",restriction:function(e){return 0<=e},message:"value must be positive"},prefix:"string",postfix:"string",forceAverage:{type:"string",validValues:["trillion","billion","million","thousand"]},average:"boolean",currencyPosition:{type:"string",validValues:["prefix","infix","postfix"]},currencySymbol:"string",totalLength:{type:"number",restrictions:[{restriction:function(e){return 0<=e},message:"value must be positive"},{restriction:function(e,t){return!t.exponential},message:"`totalLength` is incompatible with `exponential`"}]},mantissa:{type:"number",restriction:function(e){return 0<=e},message:"value must be positive"},optionalMantissa:"boolean",trimMantissa:"boolean",optionalCharacteristic:"boolean",thousandSeparated:"boolean",spaceSeparated:"boolean",abbreviations:{type:"object",children:{thousand:"string",million:"string",billion:"string",trillion:"string"}},negative:{type:"string",validValues:["sign","parenthesis"]},forceSign:"boolean",exponential:{type:"boolean"},prefixSymbol:{type:"boolean",restriction:function(e,t){return"percent"===t.output},message:"`prefixSymbol` can be provided only when the output is `percent`"}},s={languageTag:{type:"string",mandatory:!0,restriction:function(e){return e.match(i)},message:"the language tag must follow the BCP 47 specification (see https://tools.ieft.org/html/bcp47)"},delimiters:{type:"object",children:{thousands:"string",decimal:"string",thousandsSize:"number"},mandatory:!0},abbreviations:{type:"object",children:{thousand:{type:"string",mandatory:!0},million:{type:"string",mandatory:!0},billion:{type:"string",mandatory:!0},trillion:{type:"string",mandatory:!0}},mandatory:!0},spaceSeparated:"boolean",ordinal:{type:"function",mandatory:!0},currency:{type:"object",children:{symbol:"string",position:"string",code:"string"},mandatory:!0},defaults:"format",ordinalFormat:"format",byteFormat:"format",percentageFormat:"format",currencyFormat:"format",timeDefaults:"format",formats:{type:"object",children:{fourDigits:{type:"format",mandatory:!0},fullWithTwoDecimals:{type:"format",mandatory:!0},fullWithTwoDecimalsNoCurrency:{type:"format",mandatory:!0},fullWithNoDecimals:{type:"format",mandatory:!0}}}};function l(e){return!!a.unformat(e)}function u(e,t,n){var a=3<arguments.length&&void 0!==arguments[3]&&arguments[3],i=Object.keys(e).map((function(a){if(!t[a])return console.error("".concat(n," Invalid key: ").concat(a)),!1;var i=e[a],s=t[a];if("string"==typeof s&&(s={type:s}),"format"===s.type){if(!u(i,o,"[Validate ".concat(a,"]"),!0))return!1}else if(r(i)!==s.type)return console.error("".concat(n," ").concat(a,' type mismatched: "').concat(s.type,'" expected, "').concat(r(i),'" provided')),!1;if(s.restrictions&&s.restrictions.length)for(var l=s.restrictions.length,c=0;c<l;c++){var d=s.restrictions[c],m=d.restriction,p=d.message;if(!m(i,e))return console.error("".concat(n," ").concat(a," invalid value: ").concat(p)),!1}return s.restriction&&!s.restriction(i,e)?(console.error("".concat(n," ").concat(a," invalid value: ").concat(s.message)),!1):s.validValues&&-1===s.validValues.indexOf(i)?(console.error("".concat(n," ").concat(a," invalid value: must be among ").concat(JSON.stringify(s.validValues),', "').concat(i,'" provided')),!1):!(s.children&&!u(i,s.children,"[Validate ".concat(a,"]")))}));return a||i.push.apply(i,function(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(Object.keys(t).map((function(r){var a=t[r];if("string"==typeof a&&(a={type:a}),a.mandatory){var i=a.mandatory;if("function"==typeof i&&(i=i(e)),i&&void 0===e[r])return console.error("".concat(n,' Missing mandatory key "').concat(r,'"')),!1}return!0})))),i.reduce((function(e,t){return e&&t}),!0)}function c(e){return u(e,o,"[Validate format]")}t.exports={validate:function(e,t){var n=l(e),r=c(t);return n&&r},validateFormat:c,validateInput:l,validateLanguage:function(e){return u(e,s,"[Validate language]")}}},{"./unformatting":9}]},{},[7])(7)},function(e,t,n){
59
  /*!
60
  * Pikaday
61
  *
62
  * Copyright © 2014 David Bushell | BSD & MIT license | https://github.com/dbushell/Pikaday
63
  */
64
+ !function(t,r){"use strict";var a;try{a=n(0)}catch(e){}e.exports=function(e){var t="function"==typeof e,n=!!window.addEventListener,r=window.document,a=window.setTimeout,i=function(e,t,r,a){n?e.addEventListener(t,r,!!a):e.attachEvent("on"+t,r)},o=function(e,t,r,a){n?e.removeEventListener(t,r,!!a):e.detachEvent("on"+t,r)},s=function(e,t,n){var a;r.createEvent?((a=r.createEvent("HTMLEvents")).initEvent(t,!0,!1),a=f(a,n),e.dispatchEvent(a)):r.createEventObject&&(a=r.createEventObject(),a=f(a,n),e.fireEvent("on"+t,a))},l=function(e,t){return-1!==(" "+e.className+" ").indexOf(" "+t+" ")},u=function(e){return/Array/.test(Object.prototype.toString.call(e))},c=function(e){return/Date/.test(Object.prototype.toString.call(e))&&!isNaN(e.getTime())},d=function(e){var t=e.getDay();return 0===t||6===t},m=function(e){return e%4==0&&e%100!=0||e%400==0},p=function(e,t){return[31,m(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]},h=function(e){c(e)&&e.setHours(0,0,0,0)},_=function(e,t){return e.getTime()===t.getTime()},f=function(e,t,n){var r,a;for(r in t)(a=void 0!==e[r])&&"object"==typeof t[r]&&null!==t[r]&&void 0===t[r].nodeName?c(t[r])?n&&(e[r]=new Date(t[r].getTime())):u(t[r])?n&&(e[r]=t[r].slice(0)):e[r]=f({},t[r],n):!n&&a||(e[r]=t[r]);return e},y=function(e){return e.month<0&&(e.year-=Math.ceil(Math.abs(e.month)/12),e.month+=12),e.month>11&&(e.year+=Math.floor(Math.abs(e.month)/12),e.month-=12),e},g={field:null,bound:void 0,position:"bottom left",reposition:!0,format:"YYYY-MM-DD",defaultDate:null,setDefaultDate:!1,firstDay:0,formatStrict:!1,minDate:null,maxDate:null,yearRange:10,showWeekNumber:!1,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearSuffix:"",showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,numberOfMonths:1,mainCalendar:"left",container:void 0,i18n:{previousMonth:"Previous Month",nextMonth:"Next Month",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},theme:null,onSelect:null,onOpen:null,onClose:null,onDraw:null},b=function(e,t,n){for(t+=e.firstDay;t>=7;)t-=7;return n?e.i18n.weekdaysShort[t]:e.i18n.weekdays[t]},v=function(e){var t=[],n="false";if(e.isEmpty){if(!e.showDaysInNextAndPreviousMonths)return'<td class="is-empty"></td>';t.push("is-outside-current-month")}return e.isDisabled&&t.push("is-disabled"),e.isToday&&t.push("is-today"),e.isSelected&&(t.push("is-selected"),n="true"),e.isInRange&&t.push("is-inrange"),e.isStartRange&&t.push("is-startrange"),e.isEndRange&&t.push("is-endrange"),'<td data-day="'+e.day+'" class="'+t.join(" ")+'" aria-selected="'+n+'"><button class="pika-button pika-day" type="button" data-pika-year="'+e.year+'" data-pika-month="'+e.month+'" data-pika-day="'+e.day+'">'+e.day+"</button></td>"},M=function(e,t){return"<tr>"+(t?e.reverse():e).join("")+"</tr>"},w=function(e,t,n,r,a,i){var o,s,l,c,d,m=e._o,p=n===m.minYear,h=n===m.maxYear,_='<div id="'+i+'" class="pika-title" role="heading" aria-live="assertive">',f=!0,y=!0;for(l=[],o=0;o<12;o++)l.push('<option value="'+(n===a?o-t:12+o-t)+'"'+(o===r?' selected="selected"':"")+(p&&o<m.minMonth||h&&o>m.maxMonth?'disabled="disabled"':"")+">"+m.i18n.months[o]+"</option>");for(c='<div class="pika-label">'+m.i18n.months[r]+'<select class="pika-select pika-select-month" tabindex="-1">'+l.join("")+"</select></div>",u(m.yearRange)?(o=m.yearRange[0],s=m.yearRange[1]+1):(o=n-m.yearRange,s=1+n+m.yearRange),l=[];o<s&&o<=m.maxYear;o++)o>=m.minYear&&l.push('<option value="'+o+'"'+(o===n?' selected="selected"':"")+">"+o+"</option>");return d='<div class="pika-label">'+n+m.yearSuffix+'<select class="pika-select pika-select-year" tabindex="-1">'+l.join("")+"</select></div>",m.showMonthAfterYear?_+=d+c:_+=c+d,p&&(0===r||m.minMonth>=r)&&(f=!1),h&&(11===r||m.maxMonth<=r)&&(y=!1),0===t&&(_+='<button class="pika-prev'+(f?"":" is-disabled")+'" type="button">'+m.i18n.previousMonth+"</button>"),t===e._o.numberOfMonths-1&&(_+='<button class="pika-next'+(y?"":" is-disabled")+'" type="button">'+m.i18n.nextMonth+"</button>"),_+"</div>"},k=function(o){var s=this,u=s.config(o);s._onMouseDown=function(e){if(s._v){var t=(e=e||window.event).target||e.srcElement;if(t)if(l(t,"is-disabled")||(!l(t,"pika-button")||l(t,"is-empty")||l(t.parentNode,"is-disabled")?l(t,"pika-prev")?s.prevMonth():l(t,"pika-next")&&s.nextMonth():(s.setDate(new Date(t.getAttribute("data-pika-year"),t.getAttribute("data-pika-month"),t.getAttribute("data-pika-day"))),u.bound&&a((function(){s.hide(),u.field&&u.field.blur()}),100))),l(t,"pika-select"))s._c=!0;else{if(!e.preventDefault)return e.returnValue=!1,!1;e.preventDefault()}}},s._onChange=function(e){var t=(e=e||window.event).target||e.srcElement;t&&(l(t,"pika-select-month")?s.gotoMonth(t.value):l(t,"pika-select-year")&&s.gotoYear(t.value))},s._onKeyChange=function(e){if(e=e||window.event,s.isVisible())switch(e.keyCode){case 13:case 27:u.field.blur();break;case 37:e.preventDefault(),s.adjustDate("subtract",1);break;case 38:s.adjustDate("subtract",7);break;case 39:s.adjustDate("add",1);break;case 40:s.adjustDate("add",7)}},s._onInputChange=function(n){var r;n.firedBy!==s&&(r=t?(r=e(u.field.value,u.format,u.formatStrict))&&r.isValid()?r.toDate():null:new Date(Date.parse(u.field.value)),c(r)&&s.setDate(r),s._v||s.show())},s._onInputFocus=function(){s.show()},s._onInputClick=function(){s.show()},s._onInputBlur=function(){var e=r.activeElement;do{if(l(e,"pika-single"))return}while(e=e.parentNode);s._c||(s._b=a((function(){s.hide()}),50)),s._c=!1},s._onClick=function(e){var t=(e=e||window.event).target||e.srcElement,r=t;if(t){!n&&l(t,"pika-select")&&(t.onchange||(t.setAttribute("onchange","return;"),i(t,"change",s._onChange)));do{if(l(r,"pika-single")||r===u.trigger)return}while(r=r.parentNode);s._v&&t!==u.trigger&&r!==u.trigger&&s.hide()}},s.el=r.createElement("div"),s.el.className="pika-single"+(u.isRTL?" is-rtl":"")+(u.theme?" "+u.theme:""),i(s.el,"mousedown",s._onMouseDown,!0),i(s.el,"touchend",s._onMouseDown,!0),i(s.el,"change",s._onChange),i(r,"keydown",s._onKeyChange),u.field&&(u.container?u.container.appendChild(s.el):u.bound?r.body.appendChild(s.el):u.field.parentNode.insertBefore(s.el,u.field.nextSibling),i(u.field,"change",s._onInputChange),u.defaultDate||(t&&u.field.value?u.defaultDate=e(u.field.value,u.format).toDate():u.defaultDate=new Date(Date.parse(u.field.value)),u.setDefaultDate=!0));var d=u.defaultDate;c(d)?u.setDefaultDate?s.setDate(d,!0):s.gotoDate(d):s.gotoDate(new Date),u.bound?(this.hide(),s.el.className+=" is-bound",i(u.trigger,"click",s._onInputClick),i(u.trigger,"focus",s._onInputFocus),i(u.trigger,"blur",s._onInputBlur)):this.show()};return k.prototype={config:function(e){this._o||(this._o=f({},g,!0));var t=f(this._o,e,!0);t.isRTL=!!t.isRTL,t.field=t.field&&t.field.nodeName?t.field:null,t.theme="string"==typeof t.theme&&t.theme?t.theme:null,t.bound=!!(void 0!==t.bound?t.field&&t.bound:t.field),t.trigger=t.trigger&&t.trigger.nodeName?t.trigger:t.field,t.disableWeekends=!!t.disableWeekends,t.disableDayFn="function"==typeof t.disableDayFn?t.disableDayFn:null;var n=parseInt(t.numberOfMonths,10)||1;if(t.numberOfMonths=n>4?4:n,c(t.minDate)||(t.minDate=!1),c(t.maxDate)||(t.maxDate=!1),t.minDate&&t.maxDate&&t.maxDate<t.minDate&&(t.maxDate=t.minDate=!1),t.minDate&&this.setMinDate(t.minDate),t.maxDate&&this.setMaxDate(t.maxDate),u(t.yearRange)){var r=(new Date).getFullYear()-10;t.yearRange[0]=parseInt(t.yearRange[0],10)||r,t.yearRange[1]=parseInt(t.yearRange[1],10)||r}else t.yearRange=Math.abs(parseInt(t.yearRange,10))||g.yearRange,t.yearRange>100&&(t.yearRange=100);return t},toString:function(n){return c(this._d)?t?e(this._d).format(n||this._o.format):this._d.toDateString():""},getMoment:function(){return t?e(this._d):null},setMoment:function(n,r){t&&e.isMoment(n)&&this.setDate(n.toDate(),r)},getDate:function(){return c(this._d)?new Date(this._d.getTime()):new Date},setDate:function(e,t){if(!e)return this._d=null,this._o.field&&(this._o.field.value="",s(this._o.field,"change",{firedBy:this})),this.draw();if("string"==typeof e&&(e=new Date(Date.parse(e))),c(e)){var n=this._o.minDate,r=this._o.maxDate;c(n)&&e<n?e=n:c(r)&&e>r&&(e=r),this._d=new Date(e.getTime()),h(this._d),this.gotoDate(this._d),this._o.field&&(this._o.field.value=this.toString(),s(this._o.field,"change",{firedBy:this})),t||"function"!=typeof this._o.onSelect||this._o.onSelect.call(this,this.getDate())}},gotoDate:function(e){var t=!0;if(c(e)){if(this.calendars){var n=new Date(this.calendars[0].year,this.calendars[0].month,1),r=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),a=e.getTime();r.setMonth(r.getMonth()+1),r.setDate(r.getDate()-1),t=a<n.getTime()||r.getTime()<a}t&&(this.calendars=[{month:e.getMonth(),year:e.getFullYear()}],"right"===this._o.mainCalendar&&(this.calendars[0].month+=1-this._o.numberOfMonths)),this.adjustCalendars()}},adjustDate:function(n,r){var a,i=this.getDate(),o=24*parseInt(r)*60*60*1e3;"add"===n?a=new Date(i.valueOf()+o):"subtract"===n&&(a=new Date(i.valueOf()-o)),t&&("add"===n?a=e(i).add(r,"days").toDate():"subtract"===n&&(a=e(i).subtract(r,"days").toDate())),this.setDate(a)},adjustCalendars:function(){this.calendars[0]=y(this.calendars[0]);for(var e=1;e<this._o.numberOfMonths;e++)this.calendars[e]=y({month:this.calendars[0].month+e,year:this.calendars[0].year});this.draw()},gotoToday:function(){this.gotoDate(new Date)},gotoMonth:function(e){isNaN(e)||(this.calendars[0].month=parseInt(e,10),this.adjustCalendars())},nextMonth:function(){this.calendars[0].month++,this.adjustCalendars()},prevMonth:function(){this.calendars[0].month--,this.adjustCalendars()},gotoYear:function(e){isNaN(e)||(this.calendars[0].year=parseInt(e,10),this.adjustCalendars())},setMinDate:function(e){e instanceof Date?(h(e),this._o.minDate=e,this._o.minYear=e.getFullYear(),this._o.minMonth=e.getMonth()):(this._o.minDate=g.minDate,this._o.minYear=g.minYear,this._o.minMonth=g.minMonth,this._o.startRange=g.startRange),this.draw()},setMaxDate:function(e){e instanceof Date?(h(e),this._o.maxDate=e,this._o.maxYear=e.getFullYear(),this._o.maxMonth=e.getMonth()):(this._o.maxDate=g.maxDate,this._o.maxYear=g.maxYear,this._o.maxMonth=g.maxMonth,this._o.endRange=g.endRange),this.draw()},setStartRange:function(e){this._o.startRange=e},setEndRange:function(e){this._o.endRange=e},draw:function(e){if(this._v||e){var t,n=this._o,r=n.minYear,i=n.maxYear,o=n.minMonth,s=n.maxMonth,l="";this._y<=r&&(this._y=r,!isNaN(o)&&this._m<o&&(this._m=o)),this._y>=i&&(this._y=i,!isNaN(s)&&this._m>s&&(this._m=s)),t="pika-title-"+Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,2);for(var u=0;u<n.numberOfMonths;u++)l+='<div class="pika-lendar">'+w(this,u,this.calendars[u].year,this.calendars[u].month,this.calendars[0].year,t)+this.render(this.calendars[u].year,this.calendars[u].month,t)+"</div>";this.el.innerHTML=l,n.bound&&"hidden"!==n.field.type&&a((function(){n.trigger.focus()}),1),"function"==typeof this._o.onDraw&&this._o.onDraw(this),n.bound&&n.field.setAttribute("aria-label","Use the arrow keys to pick a date")}},adjustPosition:function(){var e,t,n,a,i,o,s,l,u,c;if(!this._o.container){if(this.el.style.position="absolute",t=e=this._o.trigger,n=this.el.offsetWidth,a=this.el.offsetHeight,i=window.innerWidth||r.documentElement.clientWidth,o=window.innerHeight||r.documentElement.clientHeight,s=window.pageYOffset||r.body.scrollTop||r.documentElement.scrollTop,"function"==typeof e.getBoundingClientRect)l=(c=e.getBoundingClientRect()).left+window.pageXOffset,u=c.bottom+window.pageYOffset;else for(l=t.offsetLeft,u=t.offsetTop+t.offsetHeight;t=t.offsetParent;)l+=t.offsetLeft,u+=t.offsetTop;(this._o.reposition&&l+n>i||this._o.position.indexOf("right")>-1&&l-n+e.offsetWidth>0)&&(l=l-n+e.offsetWidth),(this._o.reposition&&u+a>o+s||this._o.position.indexOf("top")>-1&&u-a-e.offsetHeight>0)&&(u=u-a-e.offsetHeight),this.el.style.left=l+"px",this.el.style.top=u+"px"}},render:function(e,t,n){var r=this._o,a=new Date,i=p(e,t),o=new Date(e,t,1).getDay(),s=[],l=[];h(a),r.firstDay>0&&(o-=r.firstDay)<0&&(o+=7);for(var u,m,f,y,g=0===t?11:t-1,w=11===t?0:t+1,k=0===t?e-1:e,L=11===t?e+1:e,Y=p(k,g),D=i+o,T=D;T>7;)T-=7;D+=7-T;for(var S=0,O=0;S<D;S++){var j=new Date(e,t,S-o+1),x=!!c(this._d)&&_(j,this._d),E=_(j,a),C=S<o||S>=i+o,H=S-o+1,P=t,z=e,A=r.startRange&&_(r.startRange,j),N=r.endRange&&_(r.endRange,j),F=r.startRange&&r.endRange&&r.startRange<j&&j<r.endRange;C&&(S<o?(H=Y+H,P=g,z=k):(H-=i,P=w,z=L));var R={day:H,month:P,year:z,isSelected:x,isToday:E,isDisabled:r.minDate&&j<r.minDate||r.maxDate&&j>r.maxDate||r.disableWeekends&&d(j)||r.disableDayFn&&r.disableDayFn(j),isEmpty:C,isStartRange:A,isEndRange:N,isInRange:F,showDaysInNextAndPreviousMonths:r.showDaysInNextAndPreviousMonths};l.push(v(R)),7==++O&&(r.showWeekNumber&&l.unshift((u=S-o,m=t,f=e,y=void 0,void 0,y=new Date(f,0,1),'<td class="pika-week">'+Math.ceil(((new Date(f,m,u)-y)/864e5+y.getDay()+1)/7)+"</td>")),s.push(M(l,r.isRTL)),l=[],O=0)}return function(e,t,n){return'<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="'+n+'">'+function(e){var t,n=[];e.showWeekNumber&&n.push("<th></th>");for(t=0;t<7;t++)n.push('<th scope="col"><abbr title="'+b(e,t)+'">'+b(e,t,!0)+"</abbr></th>");return"<thead><tr>"+(e.isRTL?n.reverse():n).join("")+"</tr></thead>"}(e)+(r=t,"<tbody>"+r.join("")+"</tbody>")+"</table>";var r}(r,s,n)},isVisible:function(){return this._v},show:function(){var e,t,n;this.isVisible()||(e=this.el,t="is-hidden",e.className=(n=(" "+e.className+" ").replace(" "+t+" "," ")).trim?n.trim():n.replace(/^\s+|\s+$/g,""),this._v=!0,this.draw(),this._o.bound&&(i(r,"click",this._onClick),this.adjustPosition()),"function"==typeof this._o.onOpen&&this._o.onOpen.call(this))},hide:function(){var e,t,n=this._v;!1!==n&&(this._o.bound&&o(r,"click",this._onClick),this.el.style.position="static",this.el.style.left="auto",this.el.style.top="auto",e=this.el,l(e,t="is-hidden")||(e.className=""===e.className?t:e.className+" "+t),this._v=!1,void 0!==n&&"function"==typeof this._o.onClose&&this._o.onClose.call(this))},destroy:function(){this.hide(),o(this.el,"mousedown",this._onMouseDown,!0),o(this.el,"touchend",this._onMouseDown,!0),o(this.el,"change",this._onChange),this._o.field&&(o(this._o.field,"change",this._onInputChange),this._o.bound&&(o(this._o.trigger,"click",this._onInputClick),o(this._o.trigger,"focus",this._onInputFocus),o(this._o.trigger,"blur",this._onInputBlur))),this.el.parentNode&&this.el.parentNode.removeChild(this.el)}},k}(a)}()},,function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r=n(1),a=n.n(r),i=n(129),o=n.n(i),s=function(e,t){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function l(e,t){function n(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var u=function(){return(u=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};function c(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){e.done?a(e.value):new n((function(t){t(e.value)})).then(o,s)}l((r=r.apply(e,t||[])).next())}))}function d(e,t){var n,r,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(a=2&i[0]?r.return:i[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;switch(r=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,r=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===i[0]||2===i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],r=0}finally{n=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}var m={graph_id:null,legend_toggle:!1,graphID:null,options:{colors:null},data:null,rows:null,columns:null,diffdata:null,chartEvents:null,legendToggle:!1,chartActions:null,getChartWrapper:function(e,t){},getChartEditor:null,className:"",style:{},formatters:null,spreadSheetUrl:null,spreadSheetQueryParameters:{headers:1,gid:1},rootProps:{},chartWrapperParams:{},controls:null,render:null,toolbarItems:null,toolbarID:null},p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handleGoogleChartsLoaderScriptLoaded=function(e){var n=t.props,r=n.chartVersion,a=n.chartPackages,i=n.chartLanguage,o=n.mapsApiKey,s=n.onLoad;e.charts.load(r||"current",{packages:a||["corechart","controls"],language:i||"en",mapsApiKey:o}),e.charts.setOnLoadCallback((function(){s(e)}))},t}return l(t,e),t.prototype.shouldComponentUpdate=function(e){return e.chartPackages===this.props.chartPackages},t.prototype.render=function(){var e=this,t=this.props.onError;return Object(r.createElement)(o.a,{url:"https://www.gstatic.com/charts/loader.js",onError:t,onLoad:function(){var t=window;t.google&&e.handleGoogleChartsLoaderScriptLoaded(t.google)}})},t}(r.Component),h=0,_=function(){return"reactgooglegraph-"+(h+=1)},f=["#3366CC","#DC3912","#FF9900","#109618","#990099","#3B3EAC","#0099C6","#DD4477","#66AA00","#B82E2E","#316395","#994499","#22AA99","#AAAA11","#6633CC","#E67300","#8B0707","#329262","#5574A6","#3B3EAC"],y=function(e,t,n){return void 0===n&&(n={}),c(void 0,void 0,void 0,(function(){return d(this,(function(r){return[2,new Promise((function(r,a){var i=n.headers?"headers="+n.headers:"headers=0",o=n.query?"&tq="+encodeURIComponent(n.query):"",s=n.gid?"&gid="+n.gid:"",l=n.sheet?"&sheet="+n.sheet:"",u=n.access_token?"&access_token="+n.access_token:"",c=t+"/gviz/tq?"+(""+i+s+l+o+u);new e.visualization.Query(c).send((function(e){e.isError()?a("Error in query: "+e.getMessage()+" "+e.getDetailedMessage()):r(e.getDataTable())}))}))]}))}))},g=Object(r.createContext)(m),b=g.Provider,v=g.Consumer,M=function(e){var t=e.children,n=e.value;return Object(r.createElement)(b,{value:n},t)},w=function(e){var t=e.render;return Object(r.createElement)(v,null,(function(e){return t(e)}))},k="#CCCCCC",L=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={hiddenColumns:[]},t.listenToLegendToggle=function(){var e=t.props,n=e.google,r=e.googleChartWrapper;n.visualization.events.addListener(r,"select",(function(){var e=r.getChart().getSelection(),n=r.getDataTable();if(0!==e.length&&null===e[0].row&&null!==n){var a=e[0].column,i=t.getColumnID(n,a);t.state.hiddenColumns.includes(i)?t.setState((function(e){return u({},e,{hiddenColumns:e.hiddenColumns.filter((function(e){return e!==i})).slice()})})):t.setState((function(e){return u({},e,{hiddenColumns:e.hiddenColumns.concat([i])})}))}}))},t.applyFormatters=function(e,n){for(var r=t.props.google,a=0,i=n;a<i.length;a++){var o=i[a];switch(o.type){case"ArrowFormat":(s=new r.visualization.ArrowFormat(o.options)).format(e,o.column);break;case"BarFormat":(s=new r.visualization.BarFormat(o.options)).format(e,o.column);break;case"ColorFormat":for(var s=new r.visualization.ColorFormat(o.options),l=0,u=o.ranges;l<u.length;l++){var c=u[l];s.addRange.apply(s,c)}s.format(e,o.column);break;case"DateFormat":(s=new r.visualization.DateFormat(o.options)).format(e,o.column);break;case"NumberFormat":(s=new r.visualization.NumberFormat(o.options)).format(e,o.column);break;case"PatternFormat":(s=new r.visualization.PatternFormat(o.options)).format(e,o.column)}}},t.getColumnID=function(e,t){return e.getColumnId(t)||e.getColumnLabel(t)},t.draw=function(e){var n=e.data,r=e.diffdata,a=e.rows,i=e.columns,o=e.options,s=e.legend_toggle,l=e.legendToggle,u=e.chartType,m=e.formatters,p=e.spreadSheetUrl,h=e.spreadSheetQueryParameters;return c(t,void 0,void 0,(function(){var e,t,c,_,f,g,b,v,M,w,k,L,Y,D;return d(this,(function(d){switch(d.label){case 0:return e=this.props,t=e.google,c=e.googleChartWrapper,f=null,null!==r&&(g=t.visualization.arrayToDataTable(r.old),b=t.visualization.arrayToDataTable(r.new),f=t.visualization[u].prototype.computeDiff(g,b)),null===n?[3,1]:(_=Array.isArray(n)?t.visualization.arrayToDataTable(n):new t.visualization.DataTable(n),[3,5]);case 1:return null===a||null===i?[3,2]:(_=t.visualization.arrayToDataTable([i].concat(a)),[3,5]);case 2:return null===p?[3,4]:[4,y(t,p,h)];case 3:return _=d.sent(),[3,5];case 4:_=t.visualization.arrayToDataTable([]),d.label=5;case 5:for(v=_.getNumberOfColumns(),M=0;M<v;M+=1)w=this.getColumnID(_,M),this.state.hiddenColumns.includes(w)&&(k=_.getColumnLabel(M),L=_.getColumnId(M),Y=_.getColumnType(M),_.removeColumn(M),_.addColumn({label:k,id:L,type:Y}));return D=c.getChart(),"Timeline"===c.getChartType()&&D&&D.clearChart(),c.setChartType(u),c.setOptions(o),c.setDataTable(_),c.draw(),null!==this.props.googleChartDashboard&&this.props.googleChartDashboard.draw(_),null!==f&&(c.setDataTable(f),c.draw()),null!==m&&(this.applyFormatters(_,m),c.setDataTable(_),c.draw()),!0!==l&&!0!==s||this.grayOutHiddenColumns({options:o}),[2]}}))}))},t.grayOutHiddenColumns=function(e){var n=e.options,r=t.props.googleChartWrapper,a=r.getDataTable();if(null!==a){var i=a.getNumberOfColumns();if(!1!==t.state.hiddenColumns.length>0){var o=Array.from({length:i-1}).map((function(e,r){var i=t.getColumnID(a,r+1);return t.state.hiddenColumns.includes(i)?k:void 0!==n.colors&&null!==n.colors?n.colors[r]:f[r]}));r.setOptions(u({},n,{colors:o})),r.draw()}}},t.onResize=function(){t.props.googleChartWrapper.draw()},t}return l(t,e),t.prototype.componentDidMount=function(){this.draw(this.props),window.addEventListener("resize",this.onResize),(this.props.legend_toggle||this.props.legendToggle)&&this.listenToLegendToggle()},t.prototype.componentWillUnmount=function(){var e=this.props,t=e.google,n=e.googleChartWrapper;window.removeEventListener("resize",this.onResize),t.visualization.events.removeAllListeners(n),"Timeline"===n.getChartType()&&n.getChart()&&n.getChart().clearChart()},t.prototype.componentDidUpdate=function(){this.draw(this.props)},t.prototype.render=function(){return null},t}(r.Component),Y=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.componentDidMount=function(){},t.prototype.componentWillUnmount=function(){},t.prototype.shouldComponentUpdate=function(){return!1},t.prototype.render=function(){var e=this.props,t=e.google,n=e.googleChartWrapper,a=e.googleChartDashboard;return Object(r.createElement)(w,{render:function(e){return Object(r.createElement)(L,u({},e,{google:t,googleChartWrapper:n,googleChartDashboard:a}))}})},t}(r.Component),D=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return l(t,e),t.prototype.shouldComponentUpdate=function(){return!1},t.prototype.listenToEvents=function(e){var t=this,n=e.chartEvents,r=e.google,a=e.googleChartWrapper;if(null!==n){r.visualization.events.removeAllListeners(a);for(var i=function(e){var n=e.eventName,i=e.callback;r.visualization.events.addListener(a,n,(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];i({chartWrapper:a,props:t.props,google:r,eventArgs:e})}))},o=0,s=n;o<s.length;o++){i(s[o])}}},t.prototype.render=function(){var e=this,t=this.props,n=t.google,a=t.googleChartWrapper;return Object(r.createElement)(w,{render:function(t){return e.listenToEvents({chartEvents:t.chartEvents||null,google:n,googleChartWrapper:a}),null}})},t}(r.Component),T=0,S=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={googleChartWrapper:null,googleChartDashboard:null,googleChartControls:null,googleChartEditor:null,isReady:!1},t.graphID=null,t.dashboard_ref=Object(r.createRef)(),t.toolbar_ref=Object(r.createRef)(),t.getGraphID=function(){var e,n=t.props,r=n.graphID,a=n.graph_id;return e=null===r&&null===a?null===t.graphID?_():t.graphID:null!==r&&null===a?r:null!==a&&null===r?a:r,t.graphID=e,t.graphID},t.getControlID=function(e,t){return T+=1,void 0===e?"googlechart-control-"+t+"-"+T:e},t.addControls=function(e,n){var r=t.props,a=r.google,i=r.controls,o=null===i?null:i.map((function(e,n){var r=e.controlID,i=e.controlType,o=e.options,s=e.controlWrapperParams,l=t.getControlID(r,n);return{controlProp:e,control:new a.visualization.ControlWrapper(u({containerId:l,controlType:i,options:o},s))}}));if(null===o)return null;n.bind(o.map((function(e){return e.control})),e);for(var s=function(n){for(var r=n.control,i=n.controlProp.controlEvents,o=function(n){var i=n.callback,o=n.eventName;a.visualization.events.removeListener(r,o,i),a.visualization.events.addListener(r,o,(function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];i({chartWrapper:e,controlWrapper:r,props:t.props,google:a,eventArgs:n})}))},s=0,l=void 0===i?[]:i;s<l.length;s++){o(l[s])}},l=0,c=o;l<c.length;l++){s(c[l])}return o},t.renderChart=function(){var e=t.props,n=e.width,a=e.height,i=e.options,o=e.style,s=e.className,l=e.rootProps,c=e.google,d=u({height:a||i&&i.height,width:n||i&&i.width},o);return Object(r.createElement)("div",u({id:t.getGraphID(),style:d,className:s},l),t.state.isReady&&null!==t.state.googleChartWrapper?Object(r.createElement)(r.Fragment,null,Object(r.createElement)(Y,{googleChartWrapper:t.state.googleChartWrapper,google:c,googleChartDashboard:t.state.googleChartDashboard}),Object(r.createElement)(D,{googleChartWrapper:t.state.googleChartWrapper,google:c})):null)},t.renderControl=function(e){return void 0===e&&(e=function(e){e.control,e.controlProp;return!0}),t.state.isReady&&null!==t.state.googleChartControls?Object(r.createElement)(r.Fragment,null,t.state.googleChartControls.filter((function(t){var n=t.controlProp,r=t.control;return e({control:r,controlProp:n})})).map((function(e){var t=e.control;e.controlProp;return Object(r.createElement)("div",{key:t.getContainerId(),id:t.getContainerId()})}))):null},t.renderToolBar=function(){return null===t.props.toolbarItems?null:Object(r.createElement)("div",{ref:t.toolbar_ref})},t}return l(t,e),t.prototype.componentDidMount=function(){var e=this.props,t=e.options,n=e.google,r=e.chartType,a=e.chartWrapperParams,i=e.toolbarItems,o=e.getChartEditor,s=e.getChartWrapper,l=u({chartType:r,options:t,containerId:this.getGraphID()},a),c=new n.visualization.ChartWrapper(l);c.setOptions(t),s(c,n);var d=new n.visualization.Dashboard(this.dashboard_ref),m=this.addControls(c,d);null!==i&&n.visualization.drawToolbar(this.toolbar_ref.current,i);var p=null;null!==o&&o({chartEditor:p=new n.visualization.ChartEditor,chartWrapper:c,google:n}),this.setState({googleChartEditor:p,googleChartControls:m,googleChartDashboard:d,googleChartWrapper:c,isReady:!0})},t.prototype.componentDidUpdate=function(){if(null!==this.state.googleChartWrapper&&null!==this.state.googleChartDashboard&&null!==this.state.googleChartControls)for(var e=this.props.controls,t=0;t<e.length;t+=1){var n=e[t],r=n.controlType,a=n.options,i=n.controlWrapperParams;i&&"state"in i&&this.state.googleChartControls[t].control.setState(i.state),this.state.googleChartControls[t].control.setOptions(a),this.state.googleChartControls[t].control.setControlType(r)}},t.prototype.shouldComponentUpdate=function(e,t){return this.state.isReady!==t.isReady||e.controls!==this.props.controls},t.prototype.render=function(){var e=this.props,t=e.width,n=e.height,a=e.options,i=e.style,o=u({height:n||a&&a.height,width:t||a&&a.width},i);return null!==this.props.render?Object(r.createElement)("div",{ref:this.dashboard_ref,style:o},Object(r.createElement)("div",{ref:this.toolbar_ref,id:"toolbar"}),this.props.render({renderChart:this.renderChart,renderControl:this.renderControl,renderToolbar:this.renderToolBar})):Object(r.createElement)("div",{ref:this.dashboard_ref,style:o},this.renderControl((function(e){return"bottom"!==e.controlProp.controlPosition})),this.renderChart(),this.renderControl((function(e){return"bottom"===e.controlProp.controlPosition})),this.renderToolBar())},t}(r.Component),O=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._isMounted=!1,t.state={loadingStatus:"loading",google:null},t.onLoad=function(e){if(t.isFullyLoaded(e))t.onSuccess(e);else var n=setInterval((function(){var e=window.google;t._isMounted?e&&t.isFullyLoaded(e)&&(clearInterval(n),t.onSuccess(e)):clearInterval(n)}),1e3)},t.onSuccess=function(e){t.setState({loadingStatus:"ready",google:e})},t.onError=function(){t.setState({loadingStatus:"errored"})},t}return l(t,e),t.prototype.render=function(){var e=this.props,t=e.chartLanguage,n=e.chartPackages,a=e.chartVersion,i=e.mapsApiKey,o=e.loader,s=e.errorElement;return Object(r.createElement)(M,{value:this.props},"ready"===this.state.loadingStatus&&null!==this.state.google?Object(r.createElement)(S,u({},this.props,{google:this.state.google})):"errored"===this.state.loadingStatus&&s?s:o,Object(r.createElement)(p,u({},{chartLanguage:t,chartPackages:n,chartVersion:a,mapsApiKey:i},{onLoad:this.onLoad,onError:this.onError})))},t.prototype.componentDidMount=function(){this._isMounted=!0},t.prototype.componentWillUnmount=function(){this._isMounted=!1},t.prototype.isFullyLoaded=function(e){var t=this.props,n=t.controls,r=t.toolbarItems,a=t.getChartEditor;return e&&e.visualization&&e.visualization.ChartWrapper&&e.visualization.Dashboard&&(!n||e.visualization.ChartWrapper)&&(!a||e.visualization.ChartEditor)&&(!r||e.visualization.drawToolbar)},t.defaultProps=m,t}(r.Component),j=n(130),x=n.n(j);function E(e){return(E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function C(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function H(e){return(H=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function P(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function z(e,t){return(z=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var A=wp.element,N=A.Component,F=A.Fragment,R=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==E(t)&&"function"!=typeof t?P(e):t}(this,H(t).apply(this,arguments))).initDataTable=e.initDataTable.bind(P(e)),e.dataRenderer=e.dataRenderer.bind(P(e)),e.table,e.uniqueId=x()(),e}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&z(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){this.initDataTable(this.props.columns,this.props.rows)}},{key:"componentWillUnmount",value:function(){this.table.destroy()}},{key:"componentDidUpdate",value:function(e){this.props!==e&&(this.props.options.responsive_bool!==e.options.responsive_bool&&"true"===e.options.responsive_bool&&document.getElementById("dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId)).classList.remove("collapsed"),this.table.destroy(),document.getElementById("dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId)).innerHTML="",this.initDataTable(this.props.columns,this.props.rows))}},{key:"initDataTable",value:function(e,t){var n=this,r=this.props.options,a=e.map((function(e,t){var r=e.type;switch(e.type){case"number":r="num";break;case"date":case"datetime":case"timeofday":r="date"}return{title:e.label,data:e.label,type:r,render:n.dataRenderer(i,r,t)}})),i=t.map((function(e){var t={};return a.forEach((function(n,r){var a=e[r];void 0===a&&(a=e[n.data]),t[n.data]=a})),t}));this.table=jQuery("#dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId)).DataTable({destroy:!0,data:i,columns:a,paging:"true"===r.paging_bool,pageLength:r.pageLength_int||10,pagingType:r.pagingType,ordering:"false"!==r.ordering_bool,fixedHeader:"true"===r.fixedHeader_bool,scrollCollapse:!(!this.props.chartsScreen&&"true"!==r.scrollCollapse_bool),scrollY:(this.props.chartsScreen?180:"true"===r.scrollCollapse_bool&&Number(r.scrollY_int))||!1,responsive:!(!this.props.chartsScreen&&"true"!==r.responsive_bool),searching:!1,select:!1,lengthChange:!1,bFilter:!1,bInfo:!1})}},{key:"dataRenderer",value:function(e,t,n){var r=this.props.options;if(void 0===r.series[n])return e;if("date"===t||"datetime"===t||"timeofday"===t)return r.series[n].format&&r.series[n].format.from&&r.series[n].format.to?jQuery.fn.dataTable.render.moment(r.series[n].format.from,r.series[n].format.to):jQuery.fn.dataTable.render.moment("MM-DD-YYYY");if("num"===t){var a,i=["","","","",""];return r.series[n].format.thousands&&(i[0]=r.series[n].format.thousands),r.series[n].format.decimal&&(i[1]=r.series[n].format.decimal),r.series[n].format.precision&&(i[2]=r.series[n].format.precision),r.series[n].format.prefix&&(i[3]=r.series[n].format.prefix),r.series[n].format.suffix&&(i[4]=r.series[n].format.suffix),(a=jQuery.fn.dataTable.render).number.apply(a,i)}return e}},{key:"render",value:function(){var e=this.props.options;return wp.element.createElement(F,null,e.customcss&&wp.element.createElement("style",null,e.customcss.oddTableRow&&"#dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId," tr.odd {\n\t\t\t\t\t\t\t\t").concat(e.customcss.oddTableRow.color?"color: ".concat(e.customcss.oddTableRow.color," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.oddTableRow["background-color"]?"background-color: ".concat(e.customcss.oddTableRow["background-color"]," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.oddTableRow.transform?"transform: rotate( ".concat(e.customcss.oddTableRow.transform,"deg ) !important;"):"","\n\t\t\t\t\t\t\t}"),e.customcss.evenTableRow&&"#dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId," tr.even {\n\t\t\t\t\t\t\t\t").concat(e.customcss.evenTableRow.color?"color: ".concat(e.customcss.evenTableRow.color," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.evenTableRow["background-color"]?"background-color: ".concat(e.customcss.evenTableRow["background-color"]," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.evenTableRow.transform?"transform: rotate( ".concat(e.customcss.evenTableRow.transform,"deg ) !important;"):"","\n\t\t\t\t\t\t\t}"),e.customcss.tableCell&&"#dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId," tr td,\n\t\t\t\t\t\t\t#dataTable-instances-").concat(this.props.id,"-").concat(this.uniqueId,"_wrapper tr th {\n\t\t\t\t\t\t\t\t").concat(e.customcss.tableCell.color?"color: ".concat(e.customcss.tableCell.color," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.tableCell["background-color"]?"background-color: ".concat(e.customcss.tableCell["background-color"]," !important;"):"","\n\t\t\t\t\t\t\t\t").concat(e.customcss.tableCell.transform?"transform: rotate( ".concat(e.customcss.tableCell.transform,"deg ) !important;"):"","\n\t\t\t\t\t\t\t}")),wp.element.createElement("table",{id:"dataTable-instances-".concat(this.props.id,"-").concat(this.uniqueId)}))}}])&&C(n.prototype,r),a&&C(n,a),t}(N),W=n(4),I=n.n(W),B=n(131),J=n.n(B),U=function(e){return Object.keys(e["visualizer-series"]).map((function(t){void 0!==e["visualizer-series"][t].type&&"date"===e["visualizer-series"][t].type&&Object.keys(e["visualizer-data"]).map((function(n){return e["visualizer-data"][n][t]=new Date(e["visualizer-data"][n][t])}))})),e},q=function(e){var t;if(Array.isArray(e))return 0<e.length;if(I()(e)){for(t in e)return!0;return!1}return"string"==typeof e?0<e.length:null!=e},V=function(e){return J()(e,q)},G=function(e){return e.width="",e.height="",e.backgroundColor={},e.chartArea={},V(e)},$=function(e){try{JSON.parse(e)}catch(e){return!1}return!0};function K(e){return(K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Z(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function Q(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){Z(i,r,a,o,s,"next",e)}function s(e){Z(i,r,a,o,s,"throw",e)}o(void 0)}))}}function X(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ee(e){return(ee=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function te(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ne(e,t){return(ne=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var re=lodash.startCase,ae=wp.i18n.__,ie=wp.apiFetch,oe=wp.element,se=oe.Component,le=oe.Fragment,ue=wp.components,ce=ue.Button,de=ue.Dashicon,me=ue.ExternalLink,pe=ue.Notice,he=ue.Placeholder,_e=ue.Spinner,fe=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==K(t)&&"function"!=typeof t?te(e):t}(this,ee(t).apply(this,arguments))).loadMoreCharts=e.loadMoreCharts.bind(te(e)),e.state={charts:null,isBusy:!1,chartsLoaded:!1},e}var n,r,a,i,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ne(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:(o=Q(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ie({path:"wp/v2/visualizer/?per_page=6&meta_key=visualizer-chart-library&meta_value=ChartJS"});case 2:t=e.sent,this.setState({charts:t});case 4:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"loadMoreCharts",value:(i=Q(regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.state.charts.length,n=this.state.chartsLoaded,this.setState({isBusy:!0}),e.next=5,ie({path:"wp/v2/visualizer/?per_page=6&meta_key=visualizer-chart-library&meta_value=ChartJS&offset=".concat(t)});case 5:6>(r=e.sent).length&&(n=!0),this.setState({charts:this.state.charts.concat(r),isBusy:!1,chartsLoaded:n});case 8:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"render",value:function(){var e=this,t=this.state,n=t.charts,r=t.isBusy,a=t.chartsLoaded;return wp.element.createElement("div",{className:"visualizer-settings__charts"},wp.element.createElement(pe,{status:"warning",isDismissible:!1},ae("ChartJS charts are currently not available for selection here, you must visit the library, get the shortcode, and add the chart here in a shortcode tag."),wp.element.createElement(me,{href:visualizerLocalize.adminPage},ae("Click here to visit Visualizer Charts Library."))),null!==n?1<=n.length?wp.element.createElement(le,null,wp.element.createElement("div",{className:"visualizer-settings__charts-grid"},Object.keys(n).map((function(t){var r,a,i,o=U(n[t].chart_data);if(r=o["visualizer-settings"].title?o["visualizer-settings"].title:"#".concat(n[t].id),a=0<=["gauge","table","timeline","dataTable"].indexOf(o["visualizer-chart-type"])?"dataTable"===o["visualizer-chart-type"]?o["visualizer-chart-type"]:re(o["visualizer-chart-type"]):"".concat(re(o["visualizer-chart-type"]),"Chart"),!o["visualizer-chart-library"]||"ChartJS"!==o["visualizer-chart-library"])return o["visualizer-data-exploded"]&&(i=ae("Annotations in this chart may not display here but they will display in the front end.")),wp.element.createElement("div",{className:"visualizer-settings__charts-single"},wp.element.createElement("div",{className:"visualizer-settings__charts-title"},r),"dataTable"===a?wp.element.createElement(R,{id:n[t].id,rows:o["visualizer-data"],columns:o["visualizer-series"],chartsScreen:!0,options:G(o["visualizer-settings"])}):(o["visualizer-data-exploded"],wp.element.createElement(O,{chartType:a,rows:o["visualizer-data"],columns:o["visualizer-series"],options:G(o["visualizer-settings"])})),wp.element.createElement("div",{className:"visualizer-settings__charts-footer"},wp.element.createElement("sub",null,i)),wp.element.createElement("div",{className:"visualizer-settings__charts-controls",title:ae("Insert Chart"),onClick:function(){return e.props.getChart(n[t].id)}},wp.element.createElement(de,{icon:"upload"})))}))),!a&&5<n.length&&wp.element.createElement(ce,{isPrimary:!0,isLarge:!0,onClick:this.loadMoreCharts,isBusy:r},ae("Load More"))):wp.element.createElement("p",{className:"visualizer-no-charts"},ae("No charts found.")):wp.element.createElement(he,null,wp.element.createElement(_e,null)))}}])&&X(n.prototype,r),a&&X(n,a),t}(se);function ye(e){return(ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ge(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function be(e){return(be=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ve(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Me(e,t){return(Me=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var we=wp.i18n.__,ke=wp.element.Component,Le=wp.components,Ye=Le.Button,De=Le.ExternalLink,Te=Le.PanelBody,Se=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==ye(t)&&"function"!=typeof t?ve(e):t}(this,be(t).apply(this,arguments))).uploadInput=React.createRef(),e.fileUploaded=e.fileUploaded.bind(ve(e)),e.uploadImport=e.uploadImport.bind(ve(e)),e.state={uploadLabel:we("Upload")},e}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Me(e,t)}(t,e),n=t,(r=[{key:"fileUploaded",value:function(e){"text/csv"===e.target.files[0].type&&this.setState({uploadLabel:we("Upload")})}},{key:"uploadImport",value:function(){this.props.readUploadedFile(this.uploadInput),this.setState({uploadLabel:we("Uploaded")})}},{key:"render",value:function(){return wp.element.createElement(Te,{title:we("Import data from file"),initialOpen:!1},wp.element.createElement("p",null,we("Select and upload your data CSV file here. The first row of the CSV file should contain the column headings. The second one should contain series type (string, number, boolean, date, datetime, timeofday).")),wp.element.createElement("p",null,we("If you are unsure about how to format your data CSV then please take a look at this sample: "),wp.element.createElement(De,{href:"".concat(visualizerLocalize.absurl,"samples/").concat(this.props.chart["visualizer-chart-type"],".csv")},"".concat(this.props.chart["visualizer-chart-type"],".csv"))),wp.element.createElement("input",{type:"file",accept:"text/csv",ref:this.uploadInput,onChange:this.fileUploaded}),wp.element.createElement(Ye,{isPrimary:!0,onClick:this.uploadImport},this.state.uploadLabel))}}])&&ge(n.prototype,r),a&&ge(n,a),t}(ke);function Oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function je(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Oe(n,!0).forEach((function(t){xe(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Oe(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ee(e){return(Ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ce(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function He(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){Ce(i,r,a,o,s,"next",e)}function s(e){Ce(i,r,a,o,s,"throw",e)}o(void 0)}))}}function Pe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ze(e){return(ze=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ae(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ne(e,t){return(Ne=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Fe=wp.i18n.__,Re=wp,We=(Re.apiFetch,Re.apiRequest),Ie=wp.element.Component,Be=wp.components,Je=Be.Button,Ue=Be.ExternalLink,qe=Be.IconButton,Ve=Be.Modal,Ge=Be.PanelBody,$e=Be.SelectControl,Ke=Be.TextControl,Ze=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==Ee(t)&&"function"!=typeof t?Ae(e):t}(this,ze(t).apply(this,arguments))).openModal=e.openModal.bind(Ae(e)),e.initTable=e.initTable.bind(Ae(e)),e.onToggle=e.onToggle.bind(Ae(e)),e.toggleHeaders=e.toggleHeaders.bind(Ae(e)),e.getJSONRoot=e.getJSONRoot.bind(Ae(e)),e.getJSONData=e.getJSONData.bind(Ae(e)),e.getTableData=e.getTableData.bind(Ae(e)),e.state={isOpen:!1,isLoading:!1,isFirstStepOpen:!0,isSecondStepOpen:!1,isThirdStepOpen:!1,isFourthStepOpen:!1,isHeaderPanelOpen:!1,endpointRoots:[],endpointPaging:[],table:null,requestHeaders:{method:"GET",username:"",password:"",auth:""}},e}var n,r,a,i,o,s,l,u;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ne(e,t)}(t,e),n=t,(r=[{key:"openModal",value:(u=He(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setState({isOpen:!0});case 2:t=document.querySelector("#visualizer-json-query-table"),this.state.isFourthStepOpen&&null!==this.state.table&&(t.innerHTML=this.state.table,this.initTable());case 4:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"initTable",value:function(){jQuery("#visualizer-json-query-table table").DataTable({paging:!1,searching:!1,ordering:!1,select:!1,scrollX:"600px",scrollY:"400px",info:!1,colReorder:{fixedColumnsLeft:1},dom:"Bt",buttons:[{extend:"colvis",columns:":gt(0)",collectionLayout:"four-column"}]})}},{key:"onToggle",value:(l=He(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===this.state.table&&this.state.endpointRoots&&0<this.state.endpointRoots.length&&("isFirstStepOpen"===t||"isSecondStepOpen"===t)&&this.setState({isFirstStepOpen:"isFirstStepOpen"===t,isSecondStepOpen:"isSecondStepOpen"===t,isThirdStepOpen:!1,isFourthStepOpen:!1}),null===this.state.table){e.next=5;break}return e.next=4,this.setState({isFirstStepOpen:"isFirstStepOpen"===t,isSecondStepOpen:"isSecondStepOpen"===t,isThirdStepOpen:"isThirdStepOpen"===t,isFourthStepOpen:"isFourthStepOpen"===t});case 4:"isFourthStepOpen"===t&&(n=document.querySelector("#visualizer-json-query-table"),this.state.isFourthStepOpen&&(n.innerHTML=this.state.table,this.initTable()));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"toggleHeaders",value:function(){this.setState({isHeaderPanelOpen:!this.state.isHeaderPanelOpen})}},{key:"getJSONRoot",value:(s=He(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({isLoading:!0,endpointRoots:[],endpointPaging:[],table:null}),e.next=3,We({path:"/visualizer/v1/get-json-root?url=".concat(this.props.chart["visualizer-json-url"]),data:{method:this.props.chart["visualizer-json-headers"]?this.props.chart["visualizer-json-headers"].method:this.state.requestHeaders.method,username:this.props.chart["visualizer-json-headers"]&&"object"===Ee(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.username:this.state.requestHeaders.username,password:this.props.chart["visualizer-json-headers"]&&"object"===Ee(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.password:this.state.requestHeaders.password,auth:this.props.chart["visualizer-json-headers"]&&"object"!==Ee(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth:this.state.requestHeaders.auth},method:"GET"});case 3:(t=e.sent).success?(n=Object.keys(t.data.roots).map((function(e){return{label:t.data.roots[e].replace(/>/g," ➤ "),value:t.data.roots[e]}})),this.setState({isLoading:!1,isFirstStepOpen:!1,isSecondStepOpen:!0,endpointRoots:n})):(this.setState({isLoading:!1}),alert(t.data.msg));case 5:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"getJSONData",value:(o=He(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({isLoading:!0}),e.next=3,We({path:"/visualizer/v1/get-json-data?url=".concat(this.props.chart["visualizer-json-url"],"&chart=").concat(this.props.id),data:{root:this.props.chart["visualizer-json-root"]||this.state.endpointRoots[0].value,method:this.props.chart["visualizer-json-headers"]?this.props.chart["visualizer-json-headers"].method:this.state.requestHeaders.method,username:this.props.chart["visualizer-json-headers"]&&"object"===Ee(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.username:this.state.requestHeaders.username,password:this.props.chart["visualizer-json-headers"]&&"object"===Ee(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.password:this.state.requestHeaders.password,auth:this.props.chart["visualizer-json-headers"]&&"object"!==Ee(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth:this.state.requestHeaders.auth},method:"GET"});case 3:(t=e.sent).success?(n=[{label:Fe("Don't use pagination"),value:0}],t.data.paging&&"root>next"===t.data.paging[0]&&n.push({label:Fe("Get first 5 pages using root ➤ next"),value:"root>next"}),this.setState({isLoading:!1,isSecondStepOpen:!1,isFourthStepOpen:!0,endpointPaging:n,table:t.data.table}),document.querySelector("#visualizer-json-query-table").innerHTML=t.data.table,this.initTable()):(this.setState({isLoading:!1}),alert(t.data.msg));case 5:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"getTableData",value:(i=He(regeneratorRuntime.mark((function e(){var t,n,r,a,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({isLoading:!0}),t=document.querySelectorAll("#visualizer-json-query-table input"),n=document.querySelectorAll("#visualizer-json-query-table select"),r=[],a={},t.forEach((function(e){return r.push(e.value)})),n.forEach((function(e){return a[e.name]=e.value})),e.next=9,We({path:"/visualizer/v1/set-json-data",data:je({url:this.props.chart["visualizer-json-url"],method:this.props.chart["visualizer-json-headers"]?this.props.chart["visualizer-json-headers"].method:this.state.requestHeaders.method,username:this.props.chart["visualizer-json-headers"]&&"object"===Ee(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.username:this.state.requestHeaders.username,password:this.props.chart["visualizer-json-headers"]&&"object"===Ee(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.password:this.state.requestHeaders.password,auth:this.props.chart["visualizer-json-headers"]&&"object"!==Ee(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth:this.state.requestHeaders.auth,root:this.props.chart["visualizer-json-root"]||this.state.endpointRoots[0].value,paging:this.props.chart["visualizer-json-paging"]||0,header:r},a),method:"GET"});case 9:(i=e.sent).success?(this.props.JSONImportData(i.data.name,JSON.parse(i.data.series),JSON.parse(i.data.data)),this.setState({isOpen:!1,isLoading:!1})):(alert(i.data.msg),this.setState({isLoading:!1}));case 11:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"render",value:function(){var e=this;return wp.element.createElement(Ge,{title:Fe("Import from JSON"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,Fe("You can choose here to import or synchronize your chart data with a remote JSON source.")),wp.element.createElement("p",null,wp.element.createElement(Ue,{href:"https://docs.themeisle.com/article/1052-how-to-generate-charts-from-json-data-rest-endpoints"},Fe("For more info check this tutorial."))),wp.element.createElement($e,{label:Fe("How often do you want to check the url?"),value:this.props.chart["visualizer-json-schedule"]?this.props.chart["visualizer-json-schedule"]:1,options:[{label:Fe("One-time"),value:"-1"},{label:Fe("Live"),value:"0"},{label:Fe("Each hour"),value:"1"},{label:Fe("Each 12 hours"),value:"12"},{label:Fe("Each day"),value:"24"},{label:Fe("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(Je,{isPrimary:!0,isLarge:!0,onClick:this.openModal},Fe("Modify Parameters")),this.state.isOpen&&wp.element.createElement(Ve,{title:Fe("Import from JSON"),className:"visualizer-json-query-modal",shouldCloseOnClickOutside:!1,onRequestClose:function(){e.setState({isOpen:!1,isTableRendered:!1})}},wp.element.createElement(Ge,{title:Fe("Step 1: Specify the JSON endpoint/URL"),opened:this.state.isFirstStepOpen,onToggle:function(){return e.onToggle("isFirstStepOpen")}},wp.element.createElement("p",null,Fe("If you want to add authentication, add headers to the endpoint or change the request in any way, please refer to our document here:")),wp.element.createElement("p",null,wp.element.createElement(Ue,{href:"https://docs.themeisle.com/article/1043-visualizer-how-to-extend-rest-endpoints-with-json-response"},Fe("How to extend REST endpoints with JSON response"))),wp.element.createElement(Ke,{placeholder:Fe("Please enter the URL of your JSON file"),value:this.props.chart["visualizer-json-url"]?this.props.chart["visualizer-json-url"]:"",onChange:this.props.editJSONURL}),wp.element.createElement(qe,{icon:"arrow-right-alt2",label:Fe("Add Headers"),onClick:this.toggleHeaders},Fe("Add Headers")),this.state.isHeaderPanelOpen&&wp.element.createElement("div",{className:"visualizer-json-query-modal-headers-panel"},wp.element.createElement($e,{label:Fe("Request Type"),value:this.props.chart["visualizer-json-headers"]?this.props.chart["visualizer-json-headers"].method:this.state.requestHeaders.method,options:[{value:"GET",label:Fe("GET")},{value:"POST",label:Fe("POST")}],onChange:function(t){var n=je({},e.state.requestHeaders),r=e.state.requestHeaders;n.method=t,r=je({},r,{method:t}),e.setState({requestHeaders:r}),e.props.editJSONHeaders(n)}}),wp.element.createElement("p",null,Fe("Credentials")),wp.element.createElement(Ke,{label:Fe("Username"),placeholder:Fe("Username/Access Key"),value:this.props.chart["visualizer-json-headers"]&&"object"===Ee(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.username:this.state.requestHeaders.username,onChange:function(t){var n=je({},e.state.requestHeaders),r=e.state.requestHeaders;n.auth={username:t,password:e.props.chart["visualizer-json-headers"]&&"object"===Ee(e.props.chart["visualizer-json-headers"].auth)?e.props.chart["visualizer-json-headers"].auth.password:e.state.requestHeaders.password},r=je({},r,{username:t,password:n.password}),e.setState({requestHeaders:r}),e.props.editJSONHeaders(n)}}),wp.element.createElement("span",{className:"visualizer-json-query-modal-field-separator"},Fe("&")),wp.element.createElement(Ke,{label:Fe("Password"),placeholder:Fe("Password/Secret Key"),type:"password",value:this.props.chart["visualizer-json-headers"]&&"object"===Ee(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.password:this.state.requestHeaders.password,onChange:function(t){var n=je({},e.state.requestHeaders),r=e.state.requestHeaders;n.auth={username:e.props.chart["visualizer-json-headers"]&&"object"===Ee(e.props.chart["visualizer-json-headers"].auth)?e.props.chart["visualizer-json-headers"].auth.username:e.state.requestHeaders.username,password:t},r=je({},r,{username:n.username,password:t}),e.setState({requestHeaders:r}),e.props.editJSONHeaders(n)}}),wp.element.createElement("p",null,Fe("OR")),wp.element.createElement(Ke,{label:Fe("Authorization"),placeholder:Fe("e.g. SharedKey <AccountName>:<Signature>"),value:this.props.chart["visualizer-json-headers"]&&"object"!==Ee(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth:this.state.requestHeaders.auth,onChange:function(t){var n=je({},e.state.requestHeaders),r=e.state.requestHeaders;n.auth=t,r=je({},r,{auth:t}),e.setState({requestHeaders:r}),e.props.editJSONHeaders(n)}})),wp.element.createElement(Je,{isPrimary:!0,isLarge:!0,isBusy:this.state.isLoading,disabled:this.state.isLoading,onClick:this.getJSONRoot},Fe("Fetch Endpoint"))),wp.element.createElement(Ge,{title:Fe("Step 2: Choose the JSON root"),initialOpen:!1,opened:this.state.isSecondStepOpen,onToggle:function(){return e.onToggle("isSecondStepOpen")}},wp.element.createElement("p",null,Fe("If you see Invalid Data, you may have selected the wrong root to fetch data from. Please select an alternative.")),wp.element.createElement($e,{value:this.props.chart["visualizer-json-root"],options:this.state.endpointRoots,onChange:this.props.editJSONRoot}),wp.element.createElement(Je,{isPrimary:!0,isLarge:!0,isBusy:this.state.isLoading,disabled:this.state.isLoading,onClick:this.getJSONData},Fe("Parse Endpoint"))),wp.element.createElement(Ge,{title:Fe("Step 3: Specify miscellaneous parameters"),initialOpen:!1,opened:this.state.isThirdStepOpen,onToggle:function(){return e.onToggle("isThirdStepOpen")}},"community"!==visualizerLocalize.isPro?wp.element.createElement($e,{value:this.props.chart["visualizer-json-paging"]||0,options:this.state.endpointPaging,onChange:this.props.editJSONPaging}):wp.element.createElement("p",null,Fe("Enable this feature in PRO version!"))),wp.element.createElement(Ge,{title:Fe("Step 4: Select the data to display in the chart"),initialOpen:!1,opened:this.state.isFourthStepOpen,onToggle:function(){return e.onToggle("isFourthStepOpen")}},wp.element.createElement("ul",null,wp.element.createElement("li",null,Fe("Select whether to include the data in the chart. Each column selected will form one series.")),wp.element.createElement("li",null,Fe("If a column is selected to be included, specify its data type.")),wp.element.createElement("li",null,Fe("You can use drag/drop to reorder the columns but this column position is not saved. So when you reload the table, you may have to reorder again.")),wp.element.createElement("li",null,Fe("You can select any number of columns but the chart type selected will determine how many will display in the chart."))),wp.element.createElement("div",{id:"visualizer-json-query-table"}),wp.element.createElement(Je,{isPrimary:!0,isLarge:!0,isBusy:this.state.isLoading,disabled:this.state.isLoading,onClick:this.getTableData},Fe("Save & Show Chart")))))}}])&&Pe(n.prototype,r),a&&Pe(n,a),t}(Ie);function Qe(e){return(Qe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Xe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function et(e,t){return!t||"object"!==Qe(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function tt(e){return(tt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function nt(e,t){return(nt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var rt=wp.i18n.__,at=wp.element.Component,it=wp.components,ot=it.Button,st=it.ExternalLink,lt=it.PanelBody,ut=it.SelectControl,ct=it.TextControl,dt=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),et(this,tt(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&nt(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this;return wp.element.createElement(lt,{title:rt("Import data from URL"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(lt,{title:rt("One Time Import"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,rt("You can use this to import data from a remote CSV file. The first row of the CSV file should contain the column headings. The second one should contain series type (string, number, boolean, date, datetime, timeofday).")),wp.element.createElement("p",null,rt("If you are unsure about how to format your data CSV then please take a look at this sample: "),wp.element.createElement(st,{href:"".concat(visualizerLocalize.absurl,"samples/").concat(this.props.chart["visualizer-chart-type"],".csv")},"".concat(this.props.chart["visualizer-chart-type"],".csv"))),wp.element.createElement("p",null,rt("You can also import data from Google Spreadsheet.")),wp.element.createElement(ct,{placeholder:rt("Please enter the URL of your CSV file"),value:this.props.chart["visualizer-chart-url"]?this.props.chart["visualizer-chart-url"]:"",onChange:this.props.editURL}),wp.element.createElement(ot,{isPrimary:!0,isLarge:!0,isBusy:"uploadData"===this.props.isLoading,disabled:"uploadData"===this.props.isLoading,onClick:function(){return e.props.uploadData(!1)}},rt("Import Data"))),"business"===visualizerLocalize.isPro?wp.element.createElement(lt,{title:rt("Schedule Import"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,rt("You can choose here to synchronize your chart data with a remote CSV file. ")),wp.element.createElement("p",null,rt("You can also synchronize with your Google Spreadsheet file.")),wp.element.createElement("p",null,rt("We will update the chart data based on your time interval preference by overwritting the current data with the one from the URL.")),wp.element.createElement(ct,{placeholder:rt("Please enter the URL of your CSV file"),value:this.props.chart["visualizer-chart-url"]?this.props.chart["visualizer-chart-url"]:"",onChange:this.props.editURL}),wp.element.createElement(ut,{label:rt("How often do you want to check the url?"),value:this.props.chart["visualizer-chart-schedule"]?this.props.chart["visualizer-chart-schedule"]:1,options:[{label:rt("Each hour"),value:"1"},{label:rt("Each 12 hours"),value:"12"},{label:rt("Each day"),value:"24"},{label:rt("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(ot,{isPrimary:!0,isLarge:!0,isBusy:"uploadData"===this.props.isLoading,disabled:"uploadData"===this.props.isLoading,onClick:function(){return e.props.uploadData(!0)}},rt("Save Schedule"))):wp.element.createElement(lt,{title:rt("Schedule Import"),icon:"lock",className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,rt("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(ot,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},rt("Buy Now"))),wp.element.createElement(Ze,{id:this.props.id,chart:this.props.chart,editSchedule:this.props.editJSONSchedule,editJSONURL:this.props.editJSONURL,editJSONHeaders:this.props.editJSONHeaders,editJSONRoot:this.props.editJSONRoot,editJSONPaging:this.props.editJSONPaging,JSONImportData:this.props.JSONImportData}))}}])&&Xe(n.prototype,r),a&&Xe(n,a),t}(at);function mt(e){return(mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pt(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function ht(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _t(e,t){return!t||"object"!==mt(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ft(e){return(ft=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function yt(e,t){return(yt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var gt=wp.i18n.__,bt=wp.apiFetch,vt=wp.element,Mt=vt.Component,wt=vt.Fragment,kt=wp.components,Lt=kt.Button,Yt=kt.PanelBody,Dt=kt.Placeholder,Tt=kt.SelectControl,St=kt.Spinner,Ot=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=_t(this,ft(t).apply(this,arguments))).state={id:"",charts:[]},e}var n,r,a,i,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&yt(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:(i=regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,bt({path:"wp/v2/visualizer/?per_page=100"});case 2:t=(t=e.sent).map((function(e,t){var r=e.chart_data["visualizer-settings"].title?e.chart_data["visualizer-settings"].title:"#".concat(e.id);return 0===t&&(n=e.id),{value:e.id,label:r}})),this.setState({id:n,charts:t});case 5:case"end":return e.stop()}}),e,this)})),o=function(){var e=this,t=arguments;return new Promise((function(n,r){var a=i.apply(e,t);function o(e){pt(a,n,r,o,s,"next",e)}function s(e){pt(a,n,r,o,s,"throw",e)}o(void 0)}))},function(){return o.apply(this,arguments)})},{key:"render",value:function(){var e=this;return"community"!==visualizerLocalize.isPro?wp.element.createElement(Yt,{title:gt("Import from other chart"),initialOpen:!1},1<=this.state.charts.length?wp.element.createElement(wt,null,wp.element.createElement(Tt,{label:gt("You can import here data from your previously created charts."),value:this.state.id,options:this.state.charts,onChange:function(t){return e.setState({id:t})}}),wp.element.createElement(Lt,{isPrimary:!0,isLarge:!0,isBusy:"getChartData"===this.props.isLoading,onClick:function(){return e.props.getChartData(e.state.id)}},gt("Import Chart"))):wp.element.createElement(Dt,null,wp.element.createElement(St,null))):wp.element.createElement(Yt,{title:gt("Import from other chart"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,gt("Enable this feature in PRO version!")),wp.element.createElement(Lt,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},gt("Buy Now")))}}])&&ht(n.prototype,r),a&&ht(n,a),t}(Mt);function jt(e){return(jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xt(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function Et(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ct(e){return(Ct=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ht(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Pt(e,t){return(Pt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var zt=wp.i18n.__,At=wp.apiRequest,Nt=wp.components,Ft=Nt.Button,Rt=Nt.ExternalLink,Wt=wp.element,It=Wt.Component,Bt=Wt.Fragment,Jt=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==jt(t)&&"function"!=typeof t?Ht(e):t}(this,Ct(t).apply(this,arguments))).onSave=e.onSave.bind(Ht(e)),e.state={isLoading:!1,success:!1,query:"",name:"",series:{},data:[]},e}var n,r,a,i,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Pt(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){var e=wp.CodeMirror||CodeMirror,t=document.querySelector(".visualizer-db-query"),n=e.fromTextArea(t,{autofocus:!0,mode:"text/x-mysql",lineWrapping:!0,dragDrop:!1,matchBrackets:!0,autoCloseBrackets:!0,extraKeys:{"Ctrl-Space":"autocomplete"},hintOptions:{tables:visualizerLocalize.sqlTable}});n.on("inputRead",(function(){n.save()}))}},{key:"onSave",value:(i=regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=document.querySelector(".visualizer-db-query").value,(n=document.querySelector("#visualizer-db-query-table")).innerHTML="",e.next=5,this.setState({isLoading:!0});case 5:return e.next=7,At({path:"/visualizer/v1/get-query-data",data:{query:t},method:"GET"});case 7:return r=e.sent,e.next=10,this.setState({isLoading:!1,success:r.success,query:t,name:r.data.name||"",series:r.data.series||{},data:r.data.data||[]});case 10:n.innerHTML=r.data.table||r.data.msg,this.state.success&&jQuery("#results").DataTable({paging:!1});case 12:case"end":return e.stop()}}),e,this)})),o=function(){var e=this,t=arguments;return new Promise((function(n,r){var a=i.apply(e,t);function o(e){xt(a,n,r,o,s,"next",e)}function s(e){xt(a,n,r,o,s,"throw",e)}o(void 0)}))},function(){return o.apply(this,arguments)})},{key:"render",value:function(){var e=this;return wp.element.createElement(Bt,null,wp.element.createElement("textarea",{className:"visualizer-db-query",placeholder:zt("Your query goes here…")},this.props.chart["visualizer-db-query"]),wp.element.createElement("div",{className:"visualizer-db-query-actions"},wp.element.createElement(Ft,{isLarge:!0,isDefault:!0,isBusy:this.state.isLoading,onClick:this.onSave},zt("Show Results")),wp.element.createElement(Ft,{isLarge:!0,isPrimary:!0,disabled:!this.state.success,onClick:function(){return e.props.save(e.state.query,e.state.name,e.state.series,e.state.data)}},zt("Save"))),wp.element.createElement("ul",null,wp.element.createElement("li",null,wp.element.createElement(Rt,{href:"https://docs.themeisle.com/article/970-visualizer-sample-queries-to-generate-charts"},zt("Examples of queries and links to resources that you can use with this feature."))),wp.element.createElement("li",null,zt("Use Control+Space for autocompleting keywords or table names."))),wp.element.createElement("div",{id:"visualizer-db-query-table",className:!this.state.success&&"db-wizard-error"}))}}])&&Et(n.prototype,r),a&&Et(n,a),t}(It);function Ut(e){return(Ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function qt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Vt(e){return(Vt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Gt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $t(e,t){return($t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Kt=wp.i18n.__,Zt=wp.element.Component,Qt=wp.components,Xt=Qt.Button,en=Qt.Modal,tn=Qt.PanelBody,nn=Qt.SelectControl,rn=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==Ut(t)&&"function"!=typeof t?Gt(e):t}(this,Vt(t).apply(this,arguments))).save=e.save.bind(Gt(e)),e.state={isOpen:!1},e}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&$t(e,t)}(t,e),n=t,(r=[{key:"save",value:function(e,t,n,r){this.props.databaseImportData(e,t,n,r),this.setState({isOpen:!1})}},{key:"render",value:function(){var e=this;return"business"!==visualizerLocalize.isPro?wp.element.createElement(tn,{title:Kt("Import data from database"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,Kt("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(Xt,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},Kt("Buy Now"))):wp.element.createElement(tn,{title:Kt("Import data from database"),initialOpen:!1},wp.element.createElement("p",null,Kt("You can import data from the database here.")),wp.element.createElement("p",null,Kt("How often do you want to refresh the data from the database.")),wp.element.createElement(nn,{label:Kt("How often do you want to check the url?"),value:this.props.chart["visualizer-db-schedule"]?this.props.chart["visualizer-db-schedule"]:0,options:[{label:Kt("Live"),value:"0"},{label:Kt("Each hour"),value:"1"},{label:Kt("Each 12 hours"),value:"12"},{label:Kt("Each day"),value:"24"},{label:Kt("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(Xt,{isPrimary:!0,isLarge:!0,onClick:function(){return e.setState({isOpen:!0})}},Kt("Create Query")),this.state.isOpen&&wp.element.createElement(en,{title:Kt("Import from database"),onRequestClose:function(){return e.setState({isOpen:!1})},className:"visualizer-db-query-modal",shouldCloseOnClickOutside:!1},wp.element.createElement(Jt,{chart:this.props.chart,changeQuery:this.props.changeQuery,save:this.save})))}}])&&qt(n.prototype,r),a&&qt(n,a),t}(Zt),an=n(132);n(152);function on(e){return(on="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function sn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ln(e,t){return!t||"object"!==on(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function un(e){return(un=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function cn(e,t){return(cn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var dn=wp.i18n.__,mn=wp.element.Component,pn=wp.components,hn=pn.Button,_n=pn.ButtonGroup,fn=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=ln(this,un(t).apply(this,arguments))).data=[],e.dates=[],e.types=["string","number","boolean","date","datetime","timeofday"],e}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&cn(e,t)}(t,e),n=t,(r=[{key:"componentWillMount",value:function(){var e=this;this.data[this.data.length]=[],this.data[this.data.length]=[],this.props.chart["visualizer-series"].map((function(t,n){e.data[0][n]=t.label,e.data[1][n]=t.type,"date"===t.type&&e.dates.push(n)})),this.props.chart["visualizer-data"].map((function(t){e.data[e.data.length]=t}))}},{key:"render",value:function(){var e=this;return wp.element.createElement("div",{className:"visualizer-chart-editor"},wp.element.createElement(an.HotTable,{data:this.data,allowInsertRow:!0,contextMenu:!0,rowHeaders:!0,colHeaders:!0,allowInvalid:!1,className:"htEditor",cells:function(t,n,r){var a;return 1===t&&(a={type:"autocomplete",source:e.types,strict:!1}),0<=e.dates.indexOf(n)&&1<t&&(a={type:"date",dateFormat:"YYYY-MM-DD",correctFormat:!0}),a}}),wp.element.createElement(_n,null,wp.element.createElement(hn,{isDefault:!0,isLarge:!0,onClick:this.props.toggleModal},dn("Close")),wp.element.createElement(hn,{isPrimary:!0,isLarge:!0,onClick:function(t){e.props.toggleModal(),e.props.editChartData(e.data,"Visualizer_Source_Csv")}},dn("Save"))))}}])&&sn(n.prototype,r),a&&sn(n,a),t}(mn);function yn(e){return(yn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function gn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function bn(e){return(bn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function vn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Mn(e,t){return(Mn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var wn=wp.i18n.__,kn=wp.element,Ln=kn.Component,Yn=kn.Fragment,Dn=wp.components,Tn=Dn.Button,Sn=Dn.Modal,On=Dn.PanelBody,jn=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==yn(t)&&"function"!=typeof t?vn(e):t}(this,bn(t).apply(this,arguments))).toggleModal=e.toggleModal.bind(vn(e)),e.state={isOpen:!1},e}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Mn(e,t)}(t,e),n=t,(r=[{key:"toggleModal",value:function(){this.setState({isOpen:!this.state.isOpen})}},{key:"render",value:function(){return"community"!==visualizerLocalize.isPro?wp.element.createElement(Yn,null,wp.element.createElement(On,{title:wn("Manual Data"),initialOpen:!1},wp.element.createElement("p",null,wn("You can manually edit the chart data using a spreadsheet like editor.")),wp.element.createElement(Tn,{isPrimary:!0,isLarge:!0,isBusy:this.state.isOpen,onClick:this.toggleModal},wn("View Editor"))),this.state.isOpen&&wp.element.createElement(Sn,{title:"Chart Editor",onRequestClose:this.toggleModal,shouldCloseOnClickOutside:!1},wp.element.createElement(fn,{chart:this.props.chart,editChartData:this.props.editChartData,toggleModal:this.toggleModal}))):wp.element.createElement(On,{title:wn("Manual Data"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,wn("Enable this feature in PRO version!")),wp.element.createElement(Tn,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},wn("Buy Now")))}}])&&gn(n.prototype,r),a&&gn(n,a),t}(Ln);function xn(e){return(xn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function En(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Cn(e,t){return!t||"object"!==xn(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Hn(e){return(Hn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Pn(e,t){return(Pn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var zn=wp.i18n.__,An=wp.element.Component,Nn=(wp.blockEditor||wp.editor).ColorPalette,Fn=wp.components,Rn=Fn.BaseControl,Wn=Fn.CheckboxControl,In=Fn.PanelBody,Bn=Fn.SelectControl,Jn=Fn.TextControl,Un=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Cn(this,Hn(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Pn(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"],r=[{label:zn("The tooltip will be displayed when the user hovers over an element"),value:"focus"}];return-1>=["timeline"].indexOf(t)&&(r[1]={label:zn("The tooltip will be displayed when the user selects an element"),value:"selection"}),r[2]={label:zn("The tooltip will not be displayed"),value:"none"},wp.element.createElement(In,{title:zn("General Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(In,{title:zn("Title"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Jn,{label:zn("Chart Title"),help:zn("Text to display above the chart."),value:n.title,onChange:function(t){n.title=t,e.props.edit(n)}}),-1>=["table","gauge","geo","pie","timeline","dataTable"].indexOf(t)&&wp.element.createElement(Bn,{label:zn("Chart Title Position"),help:zn("Where to place the chart title, compared to the chart area."),value:n.titlePosition?n.titlePosition:"out",options:[{label:zn("Inside the chart"),value:"in"},{label:zn("Outside the chart"),value:"out"},{label:zn("None"),value:"none"}],onChange:function(t){n.titlePosition=t,e.props.edit(n)}}),-1>=["table","gauge","geo","timeline","dataTable"].indexOf(t)&&wp.element.createElement(Rn,{label:zn("Chart Title Color")},wp.element.createElement(Nn,{value:n.titleTextStyle.color,onChange:function(t){n.titleTextStyle.color=t,e.props.edit(n)}})),-1>=["table","gauge","geo","pie","timeline","dataTable"].indexOf(t)&&wp.element.createElement(Bn,{label:zn("Axes Titles Position"),help:zn("Determines where to place the axis titles, compared to the chart area."),value:n.axisTitlesPosition?n.axisTitlesPosition:"out",options:[{label:zn("Inside the chart"),value:"in"},{label:zn("Outside the chart"),value:"out"},{label:zn("None"),value:"none"}],onChange:function(t){n.axisTitlesPosition=t,e.props.edit(n)}})),-1>=["table","gauge","geo","pie","timeline","dataTable"].indexOf(t)&&wp.element.createElement(In,{title:zn("Font Styles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Bn,{label:zn("Font Family"),help:zn("The default font family for all text in the chart."),value:n.fontName?n.fontName:"Arial",options:[{label:zn("Arial"),value:"Arial"},{label:zn("Sans Serif"),value:"Sans Serif"},{label:zn("Serif"),value:"serif"},{label:zn("Arial"),value:"Arial"},{label:zn("Wide"),value:"Arial black"},{label:zn("Narrow"),value:"Arial Narrow"},{label:zn("Comic Sans MS"),value:"Comic Sans MS"},{label:zn("Courier New"),value:"Courier New"},{label:zn("Garamond"),value:"Garamond"},{label:zn("Georgia"),value:"Georgia"},{label:zn("Tahoma"),value:"Tahoma"},{label:zn("Verdana"),value:"Verdana"}],onChange:function(t){n.fontName=t,e.props.edit(n)}}),wp.element.createElement(Bn,{label:zn("Font Size"),help:zn("The default font size for all text in the chart."),value:n.fontSize?n.fontSize:"15",options:[{label:"7",value:"7"},{label:"8",value:"8"},{label:"9",value:"9"},{label:"10",value:"10"},{label:"11",value:"11"},{label:"12",value:"12"},{label:"13",value:"13"},{label:"14",value:"14"},{label:"15",value:"15"},{label:"16",value:"16"},{label:"17",value:"17"},{label:"18",value:"18"},{label:"19",value:"19"},{label:"20",value:"20"}],onChange:function(t){n.fontSize=t,e.props.edit(n)}})),-1>=["table","gauge","geo","timeline","dataTable"].indexOf(t)&&wp.element.createElement(In,{title:zn("Legend"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Bn,{label:zn("Position"),help:zn("Determines where to place the legend, compared to the chart area."),value:n.legend.position?n.legend.position:"right",options:[{label:zn("Left of the chart"),value:"left"},{label:zn("Right of the chart"),value:"right"},{label:zn("Above the chart"),value:"top"},{label:zn("Below the chart"),value:"bottom"},{label:zn("Inside the chart"),value:"in"},{label:zn("Omit the legend"),value:"none"}],onChange:function(r){if("pie"!==t){var a="left"===r?1:0;Object.keys(n.series).map((function(e){n.series[e].targetAxisIndex=a}))}n.legend.position=r,e.props.edit(n)}}),wp.element.createElement(Bn,{label:zn("Alignment"),help:zn("Determines the alignment of the legend."),value:n.legend.alignment?n.legend.alignment:"15",options:[{label:zn("Aligned to the start of the allocated area"),value:"start"},{label:zn("Centered in the allocated area"),value:"center"},{label:zn("Aligned to the end of the allocated area"),value:"end"}],onChange:function(t){n.legend.alignment=t,e.props.edit(n)}}),wp.element.createElement(Rn,{label:zn("Font Color")},wp.element.createElement(Nn,{value:n.legend.textStyle.color,onChange:function(t){n.legend.textStyle.color=t,e.props.edit(n)}}))),-1>=["table","gauge","geo","dataTable"].indexOf(t)&&wp.element.createElement(In,{title:zn("Tooltip"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Bn,{label:zn("Trigger"),help:zn("Determines the user interaction that causes the tooltip to be displayed."),value:n.tooltip.trigger?n.tooltip.trigger:"focus",options:r,onChange:function(t){n.tooltip.trigger=t,e.props.edit(n)}}),wp.element.createElement(Bn,{label:zn("Show Color Code"),help:zn("If set to yes, will show colored squares next to the slice information in the tooltip."),value:n.tooltip.showColorCode?n.tooltip.showColorCode:"0",options:[{label:zn("Yes"),value:"1"},{label:zn("No"),value:"0"}],onChange:function(t){n.tooltip.showColorCode=t,e.props.edit(n)}}),0<=["pie"].indexOf(t)&&wp.element.createElement(Bn,{label:zn("Text"),help:zn("Determines what information to display when the user hovers over a pie slice."),value:n.tooltip.text?n.tooltip.text:"both",options:[{label:zn("Display both the absolute value of the slice and the percentage of the whole"),value:"both"},{label:zn("Display only the absolute value of the slice"),value:"value"},{label:zn("Display only the percentage of the whole represented by the slice"),value:"percentage"}],onChange:function(t){n.tooltip.text=t,e.props.edit(n)}})),-1>=["table","gauge","geo","pie","timeline","dataTable"].indexOf(t)&&wp.element.createElement(In,{title:zn("Animation"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Wn,{label:zn("Animate on startup?"),help:zn("Determines if the chart will animate on the initial draw."),checked:Number(n.animation.startup),onChange:function(t){n.animation.startup=t?"1":"0",e.props.edit(n)}}),wp.element.createElement(Jn,{label:zn("Duration"),help:zn("The duration of the animation, in milliseconds."),type:"number",value:n.animation.duration,onChange:function(t){n.animation.duration=t,e.props.edit(n)}}),wp.element.createElement(Bn,{label:zn("Easing"),help:zn("The easing function applied to the animation."),value:n.animation.easing?n.animation.easing:"linear",options:[{label:zn("Constant speed"),value:"linear"},{label:zn("Start slow and speed up"),value:"in"},{label:zn("Start fast and slow down"),value:"out"},{label:zn("Start slow, speed up, then slow down"),value:"inAndOut"}],onChange:function(t){n.animation.easing=t,e.props.edit(n)}})))}}])&&En(n.prototype,r),a&&En(n,a),t}(An);function qn(e){return(qn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Vn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Gn(e,t){return!t||"object"!==qn(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function $n(e){return($n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Kn(e,t){return(Kn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Zn=wp.i18n.__,Qn=wp.element,Xn=Qn.Component,er=Qn.Fragment,tr=(wp.blockEditor||wp.editor).ColorPalette,nr=wp.components,rr=nr.BaseControl,ar=nr.ExternalLink,ir=nr.PanelBody,or=nr.SelectControl,sr=nr.TextControl,lr=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Gn(this,$n(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Kn(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(ir,{title:Zn("Horizontal Axis Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(ir,{title:Zn("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(sr,{label:Zn("Axis Title"),help:Zn("The title of the horizontal axis."),value:n.hAxis.title,onChange:function(t){n.hAxis.title=t,e.props.edit(n)}}),wp.element.createElement(or,{label:Zn("Text Position"),help:Zn("Position of the horizontal axis text, relative to the chart area."),value:n.hAxis.textPosition?n.hAxis.textPosition:"out",options:[{label:Zn("Inside the chart"),value:"in"},{label:Zn("Outside the chart"),value:"out"},{label:Zn("None"),value:"none"}],onChange:function(t){n.hAxis.textPosition=t,e.props.edit(n)}}),wp.element.createElement(or,{label:Zn("Direction"),help:Zn("The direction in which the values along the horizontal axis grow."),value:n.hAxis.direction?n.hAxis.direction:"1",options:[{label:Zn("Identical Direction"),value:"1"},{label:Zn("Reverse Direction"),value:"-1"}],onChange:function(t){n.hAxis.direction=t,e.props.edit(n)}}),wp.element.createElement(rr,{label:Zn("Base Line Color")},wp.element.createElement(tr,{value:n.hAxis.baselineColor,onChange:function(t){n.hAxis.baselineColor=t,e.props.edit(n)}})),wp.element.createElement(rr,{label:Zn("Axis Text Color")},wp.element.createElement(tr,{value:n.hAxis.textStyle.color||n.hAxis.textStyle,onChange:function(t){n.hAxis.textStyle={},n.hAxis.textStyle.color=t,e.props.edit(n)}})),-1>=["column"].indexOf(t)&&wp.element.createElement(er,null,wp.element.createElement(sr,{label:Zn("Number Format"),help:Zn("Enter custom format pattern to apply to horizontal axis labels."),value:n.hAxis.format,onChange:function(t){n.hAxis.format=t,e.props.edit(n)}}),wp.element.createElement("p",null,Zn("For number axis labels, this is a subset of the formatting "),wp.element.createElement(ar,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},Zn("ICU pattern set.")),Zn(" For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #%% percentage format then your values will be multiplied by 100.")),wp.element.createElement("p",null,Zn("For date axis labels, this is a subset of the date formatting "),wp.element.createElement(ar,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},Zn("ICU date and time format."))))),-1>=["column"].indexOf(t)&&wp.element.createElement(er,null,wp.element.createElement(ir,{title:Zn("Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(sr,{label:Zn("Count"),help:Zn("The number of horizontal gridlines inside the chart area. Minimum value is 2. Specify -1 to automatically compute the number of gridlines."),value:n.hAxis.gridlines?n.hAxis.gridlines.count:"",onChange:function(t){n.hAxis.gridlines||(n.hAxis.gridlines={}),n.hAxis.gridlines.count=t,e.props.edit(n)}}),wp.element.createElement(rr,{label:Zn("Color")},wp.element.createElement(tr,{value:n.hAxis.gridlines?n.hAxis.gridlines.color:"",onChange:function(t){n.hAxis.gridlines||(n.hAxis.gridlines={}),n.hAxis.gridlines.color=t,e.props.edit(n)}}))),wp.element.createElement(ir,{title:Zn("Minor Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(sr,{label:Zn("Count"),help:Zn("The number of horizontal minor gridlines between two regular gridlines."),value:n.hAxis.minorGridlines.count,onChange:function(t){n.hAxis.minorGridlines.count=t,e.props.edit(n)}}),wp.element.createElement(rr,{label:Zn("Color")},wp.element.createElement(tr,{value:n.hAxis.minorGridlines.color,onChange:function(t){n.hAxis.minorGridlines.color=t,e.props.edit(n)}}))),wp.element.createElement(ir,{title:Zn("View Window"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(sr,{label:Zn("Maximun Value"),help:Zn("The maximum vertical data value to render."),value:n.hAxis.viewWindow.max,onChange:function(t){n.hAxis.viewWindow.max=t,e.props.edit(n)}}),wp.element.createElement(sr,{label:Zn("Minimum Value"),help:Zn("The minimum vertical data value to render."),value:n.hAxis.viewWindow.min,onChange:function(t){n.hAxis.viewWindow.min=t,e.props.edit(n)}}))))}}])&&Vn(n.prototype,r),a&&Vn(n,a),t}(Xn);function ur(e){return(ur="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function cr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function dr(e,t){return!t||"object"!==ur(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function mr(e){return(mr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function pr(e,t){return(pr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var hr=wp.i18n.__,_r=wp.element,fr=_r.Component,yr=_r.Fragment,gr=(wp.blockEditor||wp.editor).ColorPalette,br=wp.components,vr=br.BaseControl,Mr=br.ExternalLink,wr=br.PanelBody,kr=br.SelectControl,Lr=br.TextControl,Yr=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),dr(this,mr(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&pr(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(wr,{title:hr("Vertical Axis Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(wr,{title:hr("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Lr,{label:hr("Axis Title"),help:hr("The title of the Vertical axis."),value:n.vAxis.title,onChange:function(t){n.vAxis.title=t,e.props.edit(n)}}),wp.element.createElement(kr,{label:hr("Text Position"),help:hr("Position of the Vertical axis text, relative to the chart area."),value:n.vAxis.textPosition?n.vAxis.textPosition:"out",options:[{label:hr("Inside the chart"),value:"in"},{label:hr("Outside the chart"),value:"out"},{label:hr("None"),value:"none"}],onChange:function(t){n.vAxis.textPosition=t,e.props.edit(n)}}),wp.element.createElement(kr,{label:hr("Direction"),help:hr("The direction in which the values along the Vertical axis grow."),value:n.vAxis.direction?n.vAxis.direction:"1",options:[{label:hr("Identical Direction"),value:"1"},{label:hr("Reverse Direction"),value:"-1"}],onChange:function(t){n.vAxis.direction=t,e.props.edit(n)}}),wp.element.createElement(vr,{label:hr("Base Line Color")},wp.element.createElement(gr,{value:n.vAxis.baselineColor,onChange:function(t){n.vAxis.baselineColor=t,e.props.edit(n)}})),wp.element.createElement(vr,{label:hr("Axis Text Color")},wp.element.createElement(gr,{value:n.vAxis.textStyle.color||n.vAxis.textStyle,onChange:function(t){n.vAxis.textStyle={},n.vAxis.textStyle.color=t,e.props.edit(n)}})),-1>=["column"].indexOf(t)&&wp.element.createElement(yr,null,wp.element.createElement(Lr,{label:hr("Number Format"),help:hr("Enter custom format pattern to apply to Vertical axis labels."),value:n.vAxis.format,onChange:function(t){n.vAxis.format=t,e.props.edit(n)}}),wp.element.createElement("p",null,hr("For number axis labels, this is a subset of the formatting "),wp.element.createElement(Mr,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},hr("ICU pattern set.")),hr(" For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #%% percentage format then your values will be multiplied by 100.")),wp.element.createElement("p",null,hr("For date axis labels, this is a subset of the date formatting "),wp.element.createElement(Mr,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},hr("ICU date and time format."))))),-1>=["bar"].indexOf(t)&&wp.element.createElement(yr,null,wp.element.createElement(wr,{title:hr("Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Lr,{label:hr("Count"),help:hr("The number of Vertical gridlines inside the chart area. Minimum value is 2. Specify -1 to automatically compute the number of gridlines."),value:n.vAxis.gridlines?n.vAxis.gridlines.count:"",onChange:function(t){n.vAxis.gridlines||(n.vAxis.gridlines={}),n.vAxis.gridlines.count=t,e.props.edit(n)}}),wp.element.createElement(vr,{label:hr("Color")},wp.element.createElement(gr,{value:n.vAxis.gridlines?n.vAxis.gridlines.color:"",onChange:function(t){n.vAxis.gridlines||(n.vAxis.gridlines={}),n.vAxis.gridlines.color=t,e.props.edit(n)}}))),wp.element.createElement(wr,{title:hr("Minor Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Lr,{label:hr("Count"),help:hr("The number of Vertical minor gridlines between two regular gridlines."),value:n.vAxis.minorGridlines.count,onChange:function(t){n.vAxis.minorGridlines.count=t,e.props.edit(n)}}),wp.element.createElement(vr,{label:hr("Color")},wp.element.createElement(gr,{value:n.vAxis.minorGridlines.color,onChange:function(t){n.vAxis.minorGridlines.color=t,e.props.edit(n)}}))),wp.element.createElement(wr,{title:hr("View Window"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Lr,{label:hr("Maximun Value"),help:hr("The maximum vertical data value to render."),value:n.vAxis.viewWindow.max,onChange:function(t){n.vAxis.viewWindow.max=t,e.props.edit(n)}}),wp.element.createElement(Lr,{label:hr("Minimum Value"),help:hr("The minimum vertical data value to render."),value:n.vAxis.viewWindow.min,onChange:function(t){n.vAxis.viewWindow.min=t,e.props.edit(n)}}))))}}])&&cr(n.prototype,r),a&&cr(n,a),t}(fr);function Dr(e){return(Dr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Tr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Sr(e,t){return!t||"object"!==Dr(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Or(e){return(Or=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function jr(e,t){return(jr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var xr=wp.i18n.__,Er=wp.element,Cr=Er.Component,Hr=Er.Fragment,Pr=(wp.blockEditor||wp.editor).ColorPalette,zr=wp.components,Ar=zr.BaseControl,Nr=zr.ExternalLink,Fr=zr.PanelBody,Rr=zr.SelectControl,Wr=zr.TextControl,Ir=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Sr(this,Or(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&jr(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Fr,{title:xr("Pie Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Hr,null,wp.element.createElement(Wr,{label:xr("Number Format"),help:xr("Enter custom format pattern to apply to chart labels."),value:t.format,onChange:function(n){t.format=n,e.props.edit(t)}}),wp.element.createElement("p",null,xr("For number axis labels, this is a subset of the formatting "),wp.element.createElement(Nr,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},xr("ICU pattern set.")),xr(" For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #%% percentage format then your values will be multiplied by 100.")),wp.element.createElement("p",null,xr("For date axis labels, this is a subset of the date formatting "),wp.element.createElement(Nr,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},xr("ICU date and time format.")))),wp.element.createElement(Rr,{label:xr("Is 3D"),help:xr("If set to yes, displays a three-dimensional chart."),value:t.is3D?t.is3D:"0",options:[{label:xr("Yes"),value:"1"},{label:xr("No"),value:"0"}],onChange:function(n){t.is3D=n,e.props.edit(t)}}),wp.element.createElement(Rr,{label:xr("Reverse Categories"),help:xr("If set to yes, will draw slices counterclockwise."),value:t.reverseCategories?t.reverseCategories:"0",options:[{label:xr("Yes"),value:"1"},{label:xr("No"),value:"0"}],onChange:function(n){t.reverseCategories=n,e.props.edit(t)}}),wp.element.createElement(Rr,{label:xr("Slice Text"),help:xr("The content of the text displayed on the slice."),value:t.pieSliceText?t.pieSliceText:"percentage",options:[{label:xr("The percentage of the slice size out of the total"),value:"percentage"},{label:xr("The quantitative value of the slice"),value:"value"},{label:xr("The name of the slice"),value:"label"},{label:xr("The quantitative value and percentage of the slice"),value:"value-and-percentage"},{label:xr("No text is displayed"),value:"none"}],onChange:function(n){t.pieSliceText=n,e.props.edit(t)}}),wp.element.createElement(Wr,{label:xr("Pie Hole"),help:xr("If between 0 and 1, displays a donut chart. The hole with have a radius equal to number times the radius of the chart. Only applicable when the chart is two-dimensional."),placeholder:xr("0.5"),value:t.pieHole,onChange:function(n){t.pieHole=n,e.props.edit(t)}}),wp.element.createElement(Wr,{label:xr("Start Angle"),help:xr("The angle, in degrees, to rotate the chart by. The default of 0 will orient the leftmost edge of the first slice directly up."),value:t.pieStartAngle,onChange:function(n){t.pieStartAngle=n,e.props.edit(t)}}),wp.element.createElement(Ar,{label:xr("Slice Border Color")},wp.element.createElement(Pr,{value:t.pieSliceBorderColor,onChange:function(n){t.pieSliceBorderColor=n,e.props.edit(t)}})))}}])&&Tr(n.prototype,r),a&&Tr(n,a),t}(Cr);function Br(e){return(Br="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Jr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ur(e,t){return!t||"object"!==Br(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function qr(e){return(qr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Vr(e,t){return(Vr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Gr=wp.i18n.__,$r=wp.element.Component,Kr=(wp.blockEditor||wp.editor).ColorPalette,Zr=wp.components,Qr=Zr.BaseControl,Xr=Zr.PanelBody,ea=Zr.TextControl,ta=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Ur(this,qr(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Vr(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Xr,{title:Gr("Residue Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(ea,{label:Gr("Visibility Threshold"),help:Gr("The slice relative part, below which a slice will not show individually. All slices that have not passed this threshold will be combined to a single slice, whose size is the sum of all their sizes. Default is not to show individually any slice which is smaller than half a degree."),placeholder:Gr("0.001388889"),value:t.sliceVisibilityThreshold,onChange:function(n){t.sliceVisibilityThreshold=n,e.props.edit(t)}}),wp.element.createElement(ea,{label:Gr("Residue Slice Label"),help:Gr("A label for the combination slice that holds all slices below slice visibility threshold."),value:t.pieResidueSliceLabel,onChange:function(n){t.pieResidueSliceLabel=n,e.props.edit(t)}}),wp.element.createElement(Qr,{label:Gr("Residue Slice Color")},wp.element.createElement(Kr,{value:t.pieResidueSliceColor,onChange:function(n){t.pieResidueSliceColor=n,e.props.edit(t)}})))}}])&&Jr(n.prototype,r),a&&Jr(n,a),t}($r);function na(e){return(na="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ra(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function aa(e,t){return!t||"object"!==na(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ia(e){return(ia=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function oa(e,t){return(oa=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var sa=wp.i18n.__,la=wp.element,ua=la.Component,ca=la.Fragment,da=wp.components,ma=da.PanelBody,pa=da.SelectControl,ha=da.TextControl,_a=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),aa(this,ia(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&oa(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(ma,{title:sa("Lines Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(ha,{label:sa("Line Width"),help:sa("Data line width in pixels. Use zero to hide all lines."),value:n.lineWidth,onChange:function(t){n.lineWidth=t,e.props.edit(n)}}),wp.element.createElement(ha,{label:sa("Point Size"),help:sa("Diameter of displayed points in pixels. Use zero to hide all the points."),value:n.pointSize,onChange:function(t){n.pointSize=t,e.props.edit(n)}}),-1>=["area"].indexOf(t)&&wp.element.createElement(pa,{label:sa("Curve Type"),help:sa("Determines whether the series has to be presented in the legend or not."),value:n.curveType?n.curveType:"none",options:[{label:sa("Straight line without curve"),value:"none"},{label:sa("The angles of the line will be smoothed"),value:"function"}],onChange:function(t){n.curveType=t,e.props.edit(n)}}),-1>=["scatter"].indexOf(t)&&wp.element.createElement(pa,{label:sa("Focus Target"),help:sa("The type of the entity that receives focus on mouse hover. Also affects which entity is selected by mouse click."),value:n.focusTarget?n.focusTarget:"datum",options:[{label:sa("Focus on a single data point."),value:"datum"},{label:sa("Focus on a grouping of all data points along the major axis."),value:"category"}],onChange:function(t){n.focusTarget=t,e.props.edit(n)}}),wp.element.createElement(pa,{label:sa("Selection Mode"),help:sa("Determines how many data points an user can select on a chart."),value:n.selectionMode?n.selectionMode:"single",options:[{label:sa("Single data point"),value:"single"},{label:sa("Multiple data points"),value:"multiple"}],onChange:function(t){n.selectionMode=t,e.props.edit(n)}}),wp.element.createElement(pa,{label:sa("Aggregation Target"),help:sa("Determines how multiple data selections are rolled up into tooltips. To make it working you need to set multiple selection mode and tooltip trigger to display it when an user selects an element."),value:n.aggregationTarget?n.aggregationTarget:"auto",options:[{label:sa("Group selected data by x-value"),value:"category"},{label:sa("Group selected data by series"),value:"series"},{label:sa("Group selected data by x-value if all selections have the same x-value, and by series otherwise"),value:"auto"},{label:sa("Show only one tooltip per selection"),value:"none"}],onChange:function(t){n.aggregationTarget=t,e.props.edit(n)}}),wp.element.createElement(ha,{label:sa("Point Opacity"),help:sa("The transparency of data points, with 1.0 being completely opaque and 0.0 fully transparent."),value:n.dataOpacity,onChange:function(t){n.dataOpacity=t,e.props.edit(n)}}),-1>=["scatter","line"].indexOf(t)&&wp.element.createElement(ca,null,wp.element.createElement(ha,{label:sa("Area Opacity"),help:sa("The default opacity of the colored area under an area chart series, where 0.0 is fully transparent and 1.0 is fully opaque. To specify opacity for an individual series, set the area opacity value in the series property."),value:n.areaOpacity,onChange:function(t){n.areaOpacity=t,e.props.edit(n)}}),wp.element.createElement(pa,{label:sa("Is Stacked"),help:sa("If set to yes, series elements are stacked."),value:n.isStacked?n.isStacked:"0",options:[{label:sa("Yes"),value:"1"},{label:sa("No"),value:"0"}],onChange:function(t){n.isStacked=t,e.props.edit(n)}})),-1>=["scatter","area"].indexOf(t)&&wp.element.createElement(pa,{label:sa("Interpolate Nulls"),help:sa("Whether to guess the value of missing points. If yes, it will guess the value of any missing data based on neighboring points. If no, it will leave a break in the line at the unknown point."),value:n.interpolateNulls?n.interpolateNulls:"0",options:[{label:sa("Yes"),value:"1"},{label:sa("No"),value:"0"}],onChange:function(t){n.interpolateNulls=t,e.props.edit(n)}}))}}])&&ra(n.prototype,r),a&&ra(n,a),t}(ua);function fa(e){return(fa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ya(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ga(e,t){return!t||"object"!==fa(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ba(e){return(ba=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function va(e,t){return(va=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ma=wp.i18n.__,wa=wp.element.Component,ka=wp.components,La=ka.PanelBody,Ya=ka.SelectControl,Da=ka.TextControl,Ta=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ga(this,ba(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&va(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(La,{title:Ma("Bars Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Ya,{label:Ma("Focus Target"),help:Ma("The type of the entity that receives focus on mouse hover. Also affects which entity is selected by mouse click."),value:t.focusTarget?t.focusTarget:"datum",options:[{label:Ma("Focus on a single data point."),value:"datum"},{label:Ma("Focus on a grouping of all data points along the major axis."),value:"category"}],onChange:function(n){t.focusTarget=n,e.props.edit(t)}}),wp.element.createElement(Ya,{label:Ma("Is Stacked"),help:Ma("If set to yes, series elements are stacked."),value:t.isStacked?t.isStacked:"0",options:[{label:Ma("Yes"),value:"1"},{label:Ma("No"),value:"0"}],onChange:function(n){t.isStacked=n,e.props.edit(t)}}),wp.element.createElement(Da,{label:Ma("Bars Opacity"),help:Ma("Bars transparency, with 1.0 being completely opaque and 0.0 fully transparent."),value:t.dataOpacity,onChange:function(n){t.dataOpacity=n,e.props.edit(t)}}))}}])&&ya(n.prototype,r),a&&ya(n,a),t}(wa);function Sa(e){return(Sa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Oa(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ja(e,t){return!t||"object"!==Sa(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function xa(e){return(xa=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ea(e,t){return(Ea=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ca=wp.i18n.__,Ha=wp.element.Component,Pa=(wp.blockEditor||wp.editor).ColorPalette,za=wp.components,Aa=za.BaseControl,Na=za.PanelBody,Fa=za.SelectControl,Ra=za.TextControl,Wa=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ja(this,xa(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ea(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Na,{title:Ca("Candles Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Na,{title:Ca("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Fa,{label:Ca("Focus Target"),help:Ca("The type of the entity that receives focus on mouse hover. Also affects which entity is selected by mouse click."),value:t.focusTarget?t.focusTarget:"datum",options:[{label:Ca("Focus on a single data point."),value:"datum"},{label:Ca("Focus on a grouping of all data points along the major axis."),value:"category"}],onChange:function(n){t.focusTarget=n,e.props.edit(t)}}),wp.element.createElement(Fa,{label:Ca("Selection Mode"),help:Ca("Determines how many data points an user can select on a chart."),value:t.selectionMode?t.selectionMode:"single",options:[{label:Ca("Single data point"),value:"single"},{label:Ca("Multiple data points"),value:"multiple"}],onChange:function(n){t.selectionMode=n,e.props.edit(t)}}),wp.element.createElement(Fa,{label:Ca("Aggregation Target"),help:Ca("Determines how multiple data selections are rolled up into tooltips. To make it working you need to set multiple selection mode and tooltip trigger to display it when an user selects an element."),value:t.aggregationTarget?t.aggregationTarget:"auto",options:[{label:Ca("Group selected data by x-value"),value:"category"},{label:Ca("Group selected data by series"),value:"series"},{label:Ca("Group selected data by x-value if all selections have the same x-value, and by series otherwise"),value:"auto"},{label:Ca("Show only one tooltip per selection"),value:"none"}],onChange:function(n){t.aggregationTarget=n,e.props.edit(t)}})),wp.element.createElement(Na,{title:Ca("Failing Candles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Ra,{label:Ca("Stroke Width"),help:Ca("The stroke width of falling candles."),value:t.candlestick.fallingColor.strokeWidth,onChange:function(n){t.candlestick.fallingColor.strokeWidth=n,e.props.edit(t)}}),wp.element.createElement(Aa,{label:Ca("Stroke Color")},wp.element.createElement(Pa,{value:t.candlestick.fallingColor.stroke,onChange:function(n){t.candlestick.fallingColor.stroke=n,e.props.edit(t)}})),wp.element.createElement(Aa,{label:Ca("Fill Color")},wp.element.createElement(Pa,{value:t.candlestick.fallingColor.fill,onChange:function(n){t.candlestick.fallingColor.fill=n,e.props.edit(t)}}))),wp.element.createElement(Na,{title:Ca("Rising Candles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Ra,{label:Ca("Stroke Width"),help:Ca("The stroke width of rising candles."),value:t.candlestick.risingColor.strokeWidth,onChange:function(n){t.candlestick.risingColor.strokeWidth=n,e.props.edit(t)}}),wp.element.createElement(Aa,{label:Ca("Stroke Color")},wp.element.createElement(Pa,{value:t.candlestick.risingColor.stroke,onChange:function(n){t.candlestick.risingColor.stroke=n,e.props.edit(t)}})),wp.element.createElement(Aa,{label:Ca("Fill Color")},wp.element.createElement(Pa,{value:t.candlestick.risingColor.fill,onChange:function(n){t.candlestick.risingColor.fill=n,e.props.edit(t)}}))))}}])&&Oa(n.prototype,r),a&&Oa(n,a),t}(Ha);function Ia(e){return(Ia="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ba(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ja(e,t){return!t||"object"!==Ia(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ua(e){return(Ua=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function qa(e,t){return(qa=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Va=wp.i18n.__,Ga=wp.element.Component,$a=wp.components,Ka=$a.ExternalLink,Za=$a.PanelBody,Qa=$a.SelectControl,Xa=$a.TextControl,ei=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Ja(this,Ua(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&qa(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Za,{title:Va("Map Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Za,{title:Va("API"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Xa,{label:Va("API Key"),help:Va("Add the Google Maps API key."),value:t.map_api_key,onChange:function(n){t.map_api_key=n,e.props.edit(t)}}),wp.element.createElement(Ka,{href:"https://developers.google.com/maps/documentation/javascript/get-api-key"},Va("Get API Keys"))),wp.element.createElement(Za,{title:Va("Region"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,Va("A map of the entire world using 'world'.")),wp.element.createElement("li",null,Va("A continent or a sub-continent, specified by its 3-digit code, e.g., '011' for Western Africa. "),wp.element.createElement(Ka,{href:"https://google-developers.appspot.com/chart/interactive/docs/gallery/geochart#Continent_Hierarchy"},Va("More info here."))),wp.element.createElement("li",null,Va("A country, specified by its ISO 3166-1 alpha-2 code, e.g., 'AU' for Australia. "),wp.element.createElement(Ka,{href:"http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2"},Va("More info here."))),wp.element.createElement("li",null,Va("A state in the United States, specified by its ISO 3166-2:US code, e.g., 'US-AL' for Alabama. Note that the resolution option must be set to either 'provinces' or 'metros'. "),wp.element.createElement(Ka,{href:"http://en.wikipedia.org/wiki/ISO_3166-2:US"},Va("More info here.")))),wp.element.createElement(Xa,{label:Va("Reigion"),help:Va("Configure the region area to display on the map. (Surrounding areas will be displayed as well.)"),value:t.region,onChange:function(n){t.region=n,e.props.edit(t)}})),wp.element.createElement(Za,{title:Va("Resolution"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,Va("'countries' - Supported for all regions, except for US state regions.")),wp.element.createElement("li",null,Va("'provinces' - Supported only for country regions and US state regions. Not supported for all countries; please test a country to see whether this option is supported.")),wp.element.createElement("li",null,Va("'metros' - Supported for the US country region and US state regions only."))),wp.element.createElement(Qa,{label:Va("Resolution"),help:Va("The resolution of the map borders."),value:t.resolution?t.resolution:"countries",options:[{label:Va("Countries"),value:"countries"},{label:Va("Provinces"),value:"provinces"},{label:Va("Metros"),value:"metros"}],onChange:function(n){t.resolution=n,e.props.edit(t)}})),wp.element.createElement(Za,{title:Va("Display Mode"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,Va("'auto' - Choose based on the format of the data.")),wp.element.createElement("li",null,Va("'regions' - This is a region map.")),wp.element.createElement("li",null,Va("'markers' - This is a marker map."))),wp.element.createElement(Qa,{label:Va("Display Mode"),help:Va("Determines which type of map this is."),value:t.displayMode?t.displayMode:"auto",options:[{label:Va("Auto"),value:"auto"},{label:Va("Regions"),value:"regions"},{label:Va("Markers"),value:"markers"}],onChange:function(n){t.displayMode=n,e.props.edit(t)}})),wp.element.createElement(Za,{title:Va("Tooltip"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Qa,{label:Va("Trigger"),help:Va("Determines the user interaction that causes the tooltip to be displayed."),value:t.tooltip.trigger?t.tooltip.trigger:"focus",options:[{label:Va("The tooltip will be displayed when the user hovers over an element"),value:"focus"},{label:Va("The tooltip will not be displayed"),value:"none"}],onChange:function(n){t.tooltip.trigger=n,e.props.edit(t)}})))}}])&&Ba(n.prototype,r),a&&Ba(n,a),t}(Ga);function ti(e){return(ti="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ni(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ri(e,t){return!t||"object"!==ti(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ai(e){return(ai=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ii(e,t){return(ii=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var oi=wp.i18n.__,si=wp.element.Component,li=(wp.blockEditor||wp.editor).ColorPalette,ui=wp.components,ci=ui.BaseControl,di=ui.PanelBody,mi=ui.TextControl,pi=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ri(this,ai(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ii(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(di,{title:oi("Color Axis"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(mi,{label:oi("Minimum Values"),help:oi("Determines the minimum values of color axis."),value:t.colorAxis.minValue,onChange:function(n){t.colorAxis.minValue=n,e.props.edit(t)}}),wp.element.createElement(mi,{label:oi("Maximum Values"),help:oi("Determines the maximum values of color axis."),value:t.colorAxis.maxValue,onChange:function(n){t.colorAxis.maxValue=n,e.props.edit(t)}}),wp.element.createElement(ci,{label:oi("Minimum Value")},wp.element.createElement(li,{value:t.colorAxis.colors[0],onChange:function(n){t.colorAxis.colors[0]=n,e.props.edit(t)}})),wp.element.createElement(ci,{label:oi("Intermediate Value")},wp.element.createElement(li,{value:t.colorAxis.colors[1],onChange:function(n){t.colorAxis.colors[1]=n,e.props.edit(t)}})),wp.element.createElement(ci,{label:oi("Maximum Value")},wp.element.createElement(li,{value:t.colorAxis.colors[2],onChange:function(n){t.colorAxis.colors[2]=n,e.props.edit(t)}})),wp.element.createElement(ci,{label:oi("Dateless Region")},wp.element.createElement(li,{value:t.datalessRegionColor,onChange:function(n){t.datalessRegionColor=n,e.props.edit(t)}})))}}])&&ni(n.prototype,r),a&&ni(n,a),t}(si);function hi(e){return(hi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function fi(e,t){return!t||"object"!==hi(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function yi(e){return(yi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function gi(e,t){return(gi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var bi=wp.i18n.__,vi=wp.element,Mi=vi.Component,wi=vi.Fragment,ki=wp.components,Li=ki.ExternalLink,Yi=ki.PanelBody,Di=ki.TextControl,Ti=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),fi(this,yi(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&gi(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Yi,{title:bi("Size Axis"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Di,{label:bi("Minimum Values"),help:bi("Determines the minimum values of size axis."),value:t.sizeAxis.minValue,onChange:function(n){t.sizeAxis.minValue=n,e.props.edit(t)}}),wp.element.createElement(Di,{label:bi("Maximum Values"),help:bi("Determines the maximum values of size axis."),value:t.sizeAxis.maxValue,onChange:function(n){t.sizeAxis.maxValue=n,e.props.edit(t)}}),wp.element.createElement(Di,{label:bi("Minimum Marker Radius"),help:bi("Determines the radius of the smallest possible bubbles, in pixels."),value:t.sizeAxis.minSize,onChange:function(n){t.sizeAxis.minSize=n,e.props.edit(t)}}),wp.element.createElement(Di,{label:bi("Maximum Marker Radius"),help:bi("Determines the radius of the largest possible bubbles, in pixels."),value:t.sizeAxis.maxSize,onChange:function(n){t.sizeAxis.maxSize=n,e.props.edit(t)}}),wp.element.createElement(Di,{label:bi("Marker Opacity"),help:bi("The opacity of the markers, where 0.0 is fully transparent and 1.0 is fully opaque."),value:t.markerOpacity,onChange:function(n){t.markerOpacity=n,e.props.edit(t)}}),wp.element.createElement(wi,null,wp.element.createElement(Di,{label:bi("Number Format"),help:bi("Enter custom format pattern to apply to this series value."),value:t.series[0].format,onChange:function(n){t.series[0].format=n,e.props.edit(t)}}),wp.element.createElement("p",null,bi("For number axis labels, this is a subset of the formatting "),wp.element.createElement(Li,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},bi("ICU pattern set.")),bi(" For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #%% percentage format then your values will be multiplied by 100."))))}}])&&_i(n.prototype,r),a&&_i(n,a),t}(Mi);function Si(e){return(Si="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Oi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ji(e,t){return!t||"object"!==Si(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function xi(e){return(xi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ei(e,t){return(Ei=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ci=wp.i18n.__,Hi=wp.element.Component,Pi=wp.components,zi=Pi.PanelBody,Ai=Pi.SelectControl,Ni=Pi.TextControl,Fi=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ji(this,xi(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ei(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(zi,{title:Ci("Magnifying Glass"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Ai,{label:Ci("Enabled"),help:Ci("If yes, when the user lingers over a cluttered marker, a magnifiying glass will be opened."),value:t.magnifyingGlass.enable?t.magnifyingGlass.enable:"1",options:[{label:Ci("Yes"),value:"1"},{label:Ci("No"),value:"0"}],onChange:function(n){t.magnifyingGlass.enable=n,e.props.edit(t)}}),wp.element.createElement(Ni,{label:Ci("Zoom Factor"),help:Ci("The zoom factor of the magnifying glass. Can be any number greater than 0."),value:t.magnifyingGlass.zoomFactor,onChange:function(n){t.magnifyingGlass.zoomFactor=n,e.props.edit(t)}}))}}])&&Oi(n.prototype,r),a&&Oi(n,a),t}(Hi);function Ri(e){return(Ri="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Wi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ii(e,t){return!t||"object"!==Ri(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Bi(e){return(Bi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ji(e,t){return(Ji=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ui=wp.i18n.__,qi=wp.element,Vi=qi.Component,Gi=qi.Fragment,$i=(wp.blockEditor||wp.editor).ColorPalette,Ki=wp.components,Zi=Ki.BaseControl,Qi=Ki.ExternalLink,Xi=Ki.PanelBody,eo=Ki.TextControl,to=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Ii(this,Bi(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ji(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Xi,{title:Ui("Gauge Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Xi,{title:Ui("Tick Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(eo,{label:Ui("Minimum Values"),help:Ui("Determines the minimum values of gauge."),value:t.min,onChange:function(n){t.min=n,e.props.edit(t)}}),wp.element.createElement(eo,{label:Ui("Maximum Values"),help:Ui("Determines the maximum values of gauge."),value:t.max,onChange:function(n){t.max=n,e.props.edit(t)}}),wp.element.createElement(eo,{label:Ui("Minor Ticks"),help:Ui("The number of minor tick section in each major tick section."),value:t.minorTicks,onChange:function(n){t.minorTicks=n,e.props.edit(t)}}),wp.element.createElement(Gi,null,wp.element.createElement(eo,{label:Ui("Number Format"),help:Ui("Enter custom format pattern to apply to this series value."),value:t.series[0].format,onChange:function(n){t.series[0].format=n,e.props.edit(t)}}),wp.element.createElement("p",null,Ui("For number axis labels, this is a subset of the formatting "),wp.element.createElement(Qi,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},Ui("ICU pattern set.")),Ui(" For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #%% percentage format then your values will be multiplied by 100.")))),wp.element.createElement(Xi,{title:Ui("Green Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(eo,{label:Ui("Minimum Range"),help:Ui("The lowest values for a range marked by a green color."),value:t.greenFrom,onChange:function(n){t.greenFrom=n,e.props.edit(t)}}),wp.element.createElement(eo,{label:Ui("Maximum Range"),help:Ui("The highest values for a range marked by a green color."),value:t.greenTo,onChange:function(n){t.greenTo=n,e.props.edit(t)}}),wp.element.createElement(Zi,{label:Ui("Green Color")},wp.element.createElement($i,{value:t.greenColor,onChange:function(n){t.greenColor=n,e.props.edit(t)}}))),wp.element.createElement(Xi,{title:Ui("Yellow Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(eo,{label:Ui("Minimum Range"),help:Ui("The lowest values for a range marked by a yellow color."),value:t.yellowFrom,onChange:function(n){t.yellowFrom=n,e.props.edit(t)}}),wp.element.createElement(eo,{label:Ui("Maximum Range"),help:Ui("The highest values for a range marked by a yellow color."),value:t.yellowTo,onChange:function(n){t.yellowTo=n,e.props.edit(t)}}),wp.element.createElement(Zi,{label:Ui("Yellow Color")},wp.element.createElement($i,{value:t.yellowColor,onChange:function(n){t.yellowColor=n,e.props.edit(t)}}))),wp.element.createElement(Xi,{title:Ui("Red Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(eo,{label:Ui("Minimum Range"),help:Ui("The lowest values for a range marked by a red color."),value:t.redFrom,onChange:function(n){t.redFrom=n,e.props.edit(t)}}),wp.element.createElement(eo,{label:Ui("Maximum Range"),help:Ui("The highest values for a range marked by a red color."),value:t.redTo,onChange:function(n){t.redTo=n,e.props.edit(t)}}),wp.element.createElement(Zi,{label:Ui("Red Color")},wp.element.createElement($i,{value:t.redColor,onChange:function(n){t.redColor=n,e.props.edit(t)}}))))}}])&&Wi(n.prototype,r),a&&Wi(n,a),t}(Vi);function no(e){return(no="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ro(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ao(e){return(ao=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function io(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oo(e,t){return(oo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var so=wp.i18n.__,lo=wp.element.Component,uo=(wp.blockEditor||wp.editor).ColorPalette,co=wp.components,mo=co.BaseControl,po=co.CheckboxControl,ho=co.PanelBody,_o=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==no(t)&&"function"!=typeof t?io(e):t}(this,ao(t).apply(this,arguments))).mapValues=e.mapValues.bind(io(e)),e}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&oo(e,t)}(t,e),n=t,(r=[{key:"mapValues",value:function(e,t){return void 0===e.timeline?e[t]:e.timeline[t]}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return this.mapValues(t,"showRowLabels"),wp.element.createElement(ho,{title:so("Timeline Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(po,{label:so("Show Row Label"),help:so("If checked, shows the category/row label."),checked:Number(this.mapValues(t,"showRowLabels")),onChange:function(n){void 0===t.timeline&&(t.timeline={}),t.timeline.showRowLabels=!Number(e.mapValues(t,"showRowLabels")),e.props.edit(t)}}),wp.element.createElement(po,{label:so("Group by Row Label"),help:so("If checked, groups the bars on the basis of the category/row label."),checked:Number(this.mapValues(t,"groupByRowLabel")),onChange:function(n){void 0===t.timeline&&(t.timeline={}),t.timeline.groupByRowLabel=!Number(e.mapValues(t,"groupByRowLabel")),e.props.edit(t)}}),wp.element.createElement(po,{label:so("Color by Row Label"),help:so("If checked, colors every bar on the row the same."),checked:Number(this.mapValues(t,"colorByRowLabel")),onChange:function(n){void 0===t.timeline&&(t.timeline={}),t.timeline.colorByRowLabel=!Number(e.mapValues(t,"colorByRowLabel")),e.props.edit(t)}}),wp.element.createElement(mo,{label:so("Single Color")},wp.element.createElement(uo,{value:this.mapValues(t,"singleColor"),onChange:function(n){void 0===t.timeline&&(t.timeline={}),t.timeline.singleColor=n,e.props.edit(t)}})))}}])&&ro(n.prototype,r),a&&ro(n,a),t}(lo);function fo(e){return(fo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function yo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function go(e,t){return!t||"object"!==fo(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function bo(e){return(bo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function vo(e,t){return(vo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Mo=wp.i18n.__,wo=wp.element,ko=wo.Component,Lo=wo.Fragment,Yo=wp.components,Do=Yo.CheckboxControl,To=Yo.PanelBody,So=Yo.SelectControl,Oo=Yo.TextControl,jo=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),go(this,bo(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&vo(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=this.props.chart["visualizer-chart-type"];return wp.element.createElement(To,{title:Mo("Table Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},"dataTable"===n?wp.element.createElement(Lo,null,wp.element.createElement(Do,{label:Mo("Enable Pagination"),help:Mo("To enable paging through the data."),checked:"true"===t.paging_bool,onChange:function(n){t.paging_bool="true",n||(t.paging_bool="false"),e.props.edit(t)}}),wp.element.createElement(Oo,{label:Mo("Number of rows per page"),help:Mo("The number of rows in each page, when paging is enabled."),type:"number",value:t.pageLength_int,placeholder:10,onChange:function(n){t.pageLength_int=n,e.props.edit(t)}}),wp.element.createElement(So,{label:Mo("Pagination type"),help:Mo("Determines what type of pagination options to show."),value:t.pagingType,options:[{label:Mo("Page number buttons only"),value:"numbers"},{label:Mo("'Previous' and 'Next' buttons only"),value:"simple"},{label:Mo("'Previous' and 'Next' buttons, plus page numbers"),value:"simple_numbers"},{label:Mo("'First', 'Previous', 'Next' and 'Last' buttons"),value:"full"},{label:Mo("'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers"),value:"full_numbers"},{label:Mo("'First' and 'Last' buttons, plus page numbers"),value:"first_last_numbers"}],onChange:function(n){t.pagingType=n,e.props.edit(t)}}),wp.element.createElement(Do,{label:Mo("Scroll Collapse"),help:Mo("Allow the table to reduce in height when a limited number of rows are shown."),checked:"true"===t.scrollCollapse_bool,onChange:function(n){t.scrollCollapse_bool="true",n||(t.scrollCollapse_bool="false"),e.props.edit(t)}}),"true"===t.scrollCollapse_bool&&wp.element.createElement(Oo,{label:Mo("Vertical Height"),help:Mo("Vertical scrolling will constrain the table to the given height."),type:"number",value:t.scrollY_int,placeholder:300,onChange:function(n){t.scrollY_int=n,e.props.edit(t)}}),wp.element.createElement(Do,{label:Mo("Disable Sort"),help:Mo("To disable sorting on columns."),checked:"false"===t.ordering_bool,onChange:function(n){t.ordering_bool="true",n&&(t.ordering_bool="false"),e.props.edit(t)}}),wp.element.createElement(Do,{label:Mo("Freeze Header/Footer"),help:Mo("Freeze the header and footer."),checked:"true"===t.fixedHeader_bool,onChange:function(n){t.fixedHeader_bool="true",n||(t.fixedHeader_bool="false"),e.props.edit(t)}}),wp.element.createElement(Do,{label:Mo("Responsive"),help:Mo("Enable the table to be responsive."),checked:"true"===t.responsive_bool,onChange:function(n){t.responsive_bool="true",n||(t.responsive_bool="false"),e.props.edit(t)}})):wp.element.createElement(Lo,null,wp.element.createElement(So,{label:Mo("Enable Pagination"),help:Mo("To enable paging through the data."),value:t.page?t.page:"disable",options:[{label:Mo("Enable"),value:"enable"},{label:Mo("Disable"),value:"disable"}],onChange:function(n){t.page=n,e.props.edit(t)}}),wp.element.createElement(Oo,{label:Mo("Number of rows per page"),help:Mo("The number of rows in each page, when paging is enabled."),type:"number",value:t.pageSize,onChange:function(n){t.pageSize=n,e.props.edit(t)}}),wp.element.createElement(So,{label:Mo("Disable Sort"),help:Mo("To disable sorting on columns."),value:t.sort?t.sort:"enable",options:[{label:Mo("Enable"),value:"enable"},{label:Mo("Disable"),value:"disable"}],onChange:function(n){t.sort=n,e.props.edit(t)}}),wp.element.createElement(Oo,{label:Mo("Freeze Columns"),help:Mo("The number of columns from the left that will be frozen."),type:"number",value:t.frozenColumns,onChange:function(n){t.frozenColumns=n,e.props.edit(t)}}),wp.element.createElement(Do,{label:Mo("Allow HTML"),help:Mo("If enabled, formatted values of cells that include HTML tags will be rendered as HTML."),checked:Number(t.allowHtml),onChange:function(n){t.allowHtml=!Number(t.allowHtml),e.props.edit(t)}}),wp.element.createElement(Do,{label:Mo("Right to Left table"),help:Mo("Adds basic support for right-to-left languages."),checked:Number(t.rtlTable),onChange:function(n){t.rtlTable=!Number(t.rtlTable),e.props.edit(t)}})))}}])&&yo(n.prototype,r),a&&yo(n,a),t}(ko);function xo(e){return(xo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Eo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Co(e,t){return!t||"object"!==xo(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ho(e){return(Ho=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Po(e,t){return(Po=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var zo=wp.i18n.__,Ao=wp.element,No=Ao.Component,Fo=Ao.Fragment,Ro=(wp.blockEditor||wp.editor).ColorPalette,Wo=wp.components,Io=Wo.BaseControl,Bo=Wo.PanelBody,Jo=Wo.TextControl,Uo=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Co(this,Ho(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Po(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=this.props.chart["visualizer-chart-type"];return wp.element.createElement(Bo,{title:zo("Row/Cell Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},"dataTable"===n?wp.element.createElement(Fo,null,wp.element.createElement(Bo,{title:zo("Odd Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Io,{label:zo("Background Color")},wp.element.createElement(Ro,{value:t.customcss.oddTableRow["background-color"],onChange:function(n){t.customcss.oddTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(Io,{label:zo("Color")},wp.element.createElement(Ro,{value:t.customcss.oddTableRow.color,onChange:function(n){t.customcss.oddTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(Jo,{label:zo("Text Orientation"),help:zo("In degrees."),type:"number",value:t.customcss.oddTableRow.transform,onChange:function(n){t.customcss.oddTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(Bo,{title:zo("Even Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Io,{label:zo("Background Color")},wp.element.createElement(Ro,{value:t.customcss.evenTableRow["background-color"],onChange:function(n){t.customcss.evenTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(Io,{label:zo("Color")},wp.element.createElement(Ro,{value:t.customcss.evenTableRow.color,onChange:function(n){t.customcss.evenTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(Jo,{label:zo("Text Orientation"),help:zo("In degrees."),type:"number",value:t.customcss.evenTableRow.transform,onChange:function(n){t.customcss.evenTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(Bo,{title:zo("Table Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Io,{label:zo("Background Color")},wp.element.createElement(Ro,{value:t.customcss.tableCell["background-color"],onChange:function(n){t.customcss.tableCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(Io,{label:zo("Color")},wp.element.createElement(Ro,{value:t.customcss.tableCell.color,onChange:function(n){t.customcss.tableCell.color=n,e.props.edit(t)}})),wp.element.createElement(Jo,{label:zo("Text Orientation"),help:zo("In degrees."),type:"number",value:t.customcss.tableCell.transform,onChange:function(n){t.customcss.tableCell.transform=n,e.props.edit(t)}}))):wp.element.createElement(Fo,null,wp.element.createElement(Bo,{title:zo("Header Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Io,{label:zo("Background Color")},wp.element.createElement(Ro,{value:t.customcss.headerRow["background-color"],onChange:function(n){t.customcss.headerRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(Io,{label:zo("Color")},wp.element.createElement(Ro,{value:t.customcss.headerRow.color,onChange:function(n){t.customcss.headerRow.color=n,e.props.edit(t)}})),wp.element.createElement(Jo,{label:zo("Text Orientation"),help:zo("In degrees."),type:"number",value:t.customcss.headerRow.transform,onChange:function(n){t.customcss.headerRow.transform=n,e.props.edit(t)}})),wp.element.createElement(Bo,{title:zo("Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Io,{label:zo("Background Color")},wp.element.createElement(Ro,{value:t.customcss.tableRow["background-color"],onChange:function(n){t.customcss.tableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(Io,{label:zo("Color")},wp.element.createElement(Ro,{value:t.customcss.tableRow.color,onChange:function(n){t.customcss.tableRow.color=n,e.props.edit(t)}})),wp.element.createElement(Jo,{label:zo("Text Orientation"),help:zo("In degrees."),type:"number",value:t.customcss.tableRow.transform,onChange:function(n){t.customcss.tableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(Bo,{title:zo("Odd Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Io,{label:zo("Background Color")},wp.element.createElement(Ro,{value:t.customcss.oddTableRow["background-color"],onChange:function(n){t.customcss.oddTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(Io,{label:zo("Color")},wp.element.createElement(Ro,{value:t.customcss.oddTableRow.color,onChange:function(n){t.customcss.oddTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(Jo,{label:zo("Text Orientation"),help:zo("In degrees."),type:"number",value:t.customcss.oddTableRow.transform,onChange:function(n){t.customcss.oddTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(Bo,{title:zo("Selected Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Io,{label:zo("Background Color")},wp.element.createElement(Ro,{value:t.customcss.selectedTableRow["background-color"],onChange:function(n){t.customcss.selectedTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(Io,{label:zo("Color")},wp.element.createElement(Ro,{value:t.customcss.selectedTableRow.color,onChange:function(n){t.customcss.selectedTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(Jo,{label:zo("Text Orientation"),help:zo("In degrees."),type:"number",value:t.customcss.selectedTableRow.transform,onChange:function(n){t.customcss.selectedTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(Bo,{title:zo("Hover Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Io,{label:zo("Background Color")},wp.element.createElement(Ro,{value:t.customcss.hoverTableRow["background-color"],onChange:function(n){t.customcss.hoverTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(Io,{label:zo("Color")},wp.element.createElement(Ro,{value:t.customcss.hoverTableRow.color,onChange:function(n){t.customcss.hoverTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(Jo,{label:zo("Text Orientation"),help:zo("In degrees."),type:"number",value:t.customcss.hoverTableRow.transform,onChange:function(n){t.customcss.hoverTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(Bo,{title:zo("Header Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Io,{label:zo("Background Color")},wp.element.createElement(Ro,{value:t.customcss.headerCell["background-color"],onChange:function(n){t.customcss.headerCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(Io,{label:zo("Color")},wp.element.createElement(Ro,{value:t.customcss.headerCell.color,onChange:function(n){t.customcss.headerCell.color=n,e.props.edit(t)}})),wp.element.createElement(Jo,{label:zo("Text Orientation"),help:zo("In degrees."),type:"number",value:t.customcss.headerCell.transform,onChange:function(n){t.customcss.headerCell.transform=n,e.props.edit(t)}})),wp.element.createElement(Bo,{title:zo("Table Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Io,{label:zo("Background Color")},wp.element.createElement(Ro,{value:t.customcss.tableCell["background-color"],onChange:function(n){t.customcss.tableCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(Io,{label:zo("Color")},wp.element.createElement(Ro,{value:t.customcss.tableCell.color,onChange:function(n){t.customcss.tableCell.color=n,e.props.edit(t)}})),wp.element.createElement(Jo,{label:zo("Text Orientation"),help:zo("In degrees."),type:"number",value:t.customcss.tableCell.transform,onChange:function(n){t.customcss.tableCell.transform=n,e.props.edit(t)}}))))}}])&&Eo(n.prototype,r),a&&Eo(n,a),t}(No);function qo(e){return(qo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Vo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Go(e,t){return!t||"object"!==qo(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function $o(e){return($o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ko(e,t){return(Ko=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Zo=wp.i18n.__,Qo=wp.element.Component,Xo=wp.components,es=Xo.PanelBody,ts=Xo.SelectControl,ns=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Go(this,$o(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ko(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(es,{title:Zo("Combo Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(ts,{label:Zo("Chart Type"),help:Zo("Select the default chart type."),value:t.seriesType?t.seriesType:"area",options:[{label:Zo("Area"),value:"area"},{label:Zo("Bar"),value:"bars"},{label:Zo("Candlesticks"),value:"candlesticks"},{label:Zo("Line"),value:"line"},{label:Zo("Stepped Area"),value:"steppedArea"}],onChange:function(n){t.seriesType=n,e.props.edit(t)}}))}}])&&Vo(n.prototype,r),a&&Vo(n,a),t}(Qo);function rs(e){return(rs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function as(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function is(e,t){return!t||"object"!==rs(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function os(e){return(os=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ss(e,t){return(ss=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ls=wp.i18n.__,us=wp.element,cs=us.Component,ds=us.Fragment,ms=(wp.blockEditor||wp.editor).ColorPalette,ps=wp.components,hs=ps.BaseControl,_s=ps.ExternalLink,fs=ps.PanelBody,ys=ps.SelectControl,gs=ps.TextControl,bs=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),is(this,os(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ss(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];Object.keys(e.series).map((function(t){void 0!==e.series[t]&&(e.series[t].temp=1)})),this.props.edit(e)}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"],r=this.props.chart["visualizer-series"];return wp.element.createElement(fs,{title:ls("Series Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(n.series).map((function(a,i){return a++,wp.element.createElement(fs,{title:r[a].label,className:"visualizer-inner-sections",initialOpen:!1},-1>=["table","pie"].indexOf(t)&&wp.element.createElement(ys,{label:ls("Visible In Legend"),help:ls("Determines whether the series has to be presented in the legend or not."),value:n.series[i].visibleInLegend?n.series[i].visibleInLegend:"1",options:[{label:ls("Yes"),value:"1"},{label:ls("No"),value:"0"}],onChange:function(t){n.series[i].visibleInLegend=t,e.props.edit(n)}}),-1>=["table","candlestick","combo","column","bar"].indexOf(t)&&wp.element.createElement(ds,null,wp.element.createElement(gs,{label:ls("Line Width"),help:ls("Overrides the global line width value for this series."),value:n.series[i].lineWidth,onChange:function(t){n.series[i].lineWidth=t,e.props.edit(n)}}),wp.element.createElement(gs,{label:ls("Point Size"),help:ls("Overrides the global point size value for this series."),value:n.series[i].pointSize,onChange:function(t){n.series[i].pointSize=t,e.props.edit(n)}})),-1>=["candlestick"].indexOf(t)&&"number"===r[a].type?wp.element.createElement(ds,null,wp.element.createElement(gs,{label:ls("Format"),help:ls("Enter custom format pattern to apply to this series value."),value:n.series[i].format,onChange:function(t){n.series[i].format=t,e.props.edit(n)}}),wp.element.createElement("p",null,ls("For number axis labels, this is a subset of the formatting "),wp.element.createElement(_s,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},ls("ICU pattern set.")),ls(" For instance, $#,###.## will display values $1,234.56 for value 1234.56. Pay attention that if you use #%% percentage format then your values will be multiplied by 100."))):"date"===r[a].type&&wp.element.createElement(ds,null,wp.element.createElement(gs,{label:ls("Date Format"),help:ls("Enter custom format pattern to apply to this series value."),placeholder:"dd LLLL yyyy",value:n.series[i].format,onChange:function(t){n.series[i].format=t,e.props.edit(n)}}),wp.element.createElement("p",null,ls("This is a subset of the date formatting "),wp.element.createElement(_s,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},ls("ICU date and time format.")))),0<=["scatter","line"].indexOf(t)&&wp.element.createElement(ys,{label:ls("Curve Type"),help:ls("Determines whether the series has to be presented in the legend or not."),value:n.series[i].curveType?n.series[i].curveType:"none",options:[{label:ls("Straight line without curve"),value:"none"},{label:ls("The angles of the line will be smoothed"),value:"function"}],onChange:function(t){n.series[i].curveType=t,e.props.edit(n)}}),0<=["area"].indexOf(t)&&wp.element.createElement(gs,{label:ls("Area Opacity"),help:ls("The opacity of the colored area, where 0.0 is fully transparent and 1.0 is fully opaque."),value:n.series[i].areaOpacity,onChange:function(t){n.series[i].areaOpacity=t,e.props.edit(n)}}),0<=["combo"].indexOf(t)&&wp.element.createElement(ys,{label:ls("Chart Type"),help:ls("Select the type of chart to show for this series."),value:n.series[i].type?n.series[i].type:"area",options:[{label:ls("Area"),value:"area"},{label:ls("Bar"),value:"bars"},{label:ls("Candlesticks"),value:"candlesticks"},{label:ls("Line"),value:"line"},{label:ls("Stepped Area"),value:"steppedArea"}],onChange:function(t){n.series[i].type=t,e.props.edit(n)}}),-1>=["table"].indexOf(t)&&wp.element.createElement(hs,{label:ls("Color")},wp.element.createElement(ms,{value:n.series[i].color,onChange:function(t){n.series[i].color=t,e.props.edit(n)}})))})))}}])&&as(n.prototype,r),a&&as(n,a),t}(cs);function vs(e){return(vs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ms(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ws(e,t){return!t||"object"!==vs(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ks(e){return(ks=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ls(e,t){return(Ls=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ys=wp.i18n.__,Ds=wp.element.Component,Ts=(wp.blockEditor||wp.editor).ColorPalette,Ss=wp.components,Os=Ss.BaseControl,js=Ss.PanelBody,xs=Ss.TextControl,Es=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ws(this,ks(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ls(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];Object.keys(e.slices).map((function(t){void 0!==e.slices[t]&&(e.slices[t].temp=1)})),this.props.edit(e)}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=this.props.chart["visualizer-data"];return wp.element.createElement(js,{title:Ys("Slices Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(t.slices).map((function(r){return wp.element.createElement(js,{title:n[r][0],className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(xs,{label:Ys("Slice Offset"),help:Ys("How far to separate the slice from the rest of the pie, from 0.0 (not at all) to 1.0 (the pie's radius)."),value:t.slices[r].offset,onChange:function(n){t.slices[r].offset=n,e.props.edit(t)}}),wp.element.createElement(Os,{label:Ys("Format")},wp.element.createElement(Ts,{value:t.slices[r].color,onChange:function(n){t.slices[r].color=n,e.props.edit(t)}})))})))}}])&&Ms(n.prototype,r),a&&Ms(n,a),t}(Ds);function Cs(e){return(Cs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Hs(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ps(e,t){return!t||"object"!==Cs(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function zs(e){return(zs=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function As(e,t){return(As=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ns=wp.i18n.__,Fs=wp.element,Rs=Fs.Component,Ws=Fs.Fragment,Is=wp.components,Bs=Is.ExternalLink,Js=Is.PanelBody,Us=Is.TextControl,qs=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Ps(this,zs(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&As(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];Object.keys(e.series).map((function(t){void 0!==e.series[t]&&(e.series[t].temp=1)})),this.props.edit(e)}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"],n=this.props.chart["visualizer-series"];return wp.element.createElement(Js,{title:Ns("Column Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(t.series).map((function(r){return wp.element.createElement(Js,{title:n[r].label,className:"visualizer-inner-sections",initialOpen:!1},("date"===n[r].type||"datetime"===n[r].type||"timeofday"===n[r].type)&&wp.element.createElement(Ws,null,wp.element.createElement(Us,{label:Ns("Display Date Format"),help:Ns("Enter custom format pattern to apply to this series value."),value:t.series[r].format?t.series[r].format.to:"",onChange:function(n){t.series[r].format||(t.series[r].format={}),t.series[r].format.to=n,e.props.edit(t)}}),wp.element.createElement(Us,{label:Ns("Source Date Format"),help:Ns("What format is the source date in?"),value:t.series[r].format?t.series[r].format.from:"",onChange:function(n){t.series[r].format||(t.series[r].format={}),t.series[r].format.from=n,e.props.edit(t)}}),wp.element.createElement("p",null,Ns("You can find more info on "),wp.element.createElement(Bs,{href:"https://momentjs.com/docs/#/displaying/"},Ns("date and time formats here.")))),"number"===n[r].type&&wp.element.createElement(Ws,null,wp.element.createElement(Us,{label:Ns("Thousands Separator"),value:t.series[r].format?t.series[r].format.thousands:"",onChange:function(n){t.series[r].format||(t.series[r].format={}),t.series[r].format.thousands=n,e.props.edit(t)}}),wp.element.createElement(Us,{label:Ns("Decimal Separator"),value:t.series[r].format?t.series[r].format.decimal:"",onChange:function(n){t.series[r].format||(t.series[r].format={}),t.series[r].format.decimal=n,e.props.edit(t)}}),wp.element.createElement(Us,{label:Ns("Precision"),help:Ns("Round values to how many decimal places?"),value:t.series[r].format?t.series[r].format.precision:"",type:"number",onChange:function(n){100<n||(t.series[r].format||(t.series[r].format={}),t.series[r].format.precision=n,e.props.edit(t))}}),wp.element.createElement(Us,{label:Ns("Prefix"),value:t.series[r].format?t.series[r].format.prefix:"",onChange:function(n){t.series[r].format||(t.series[r].format={}),t.series[r].format.prefix=n,e.props.edit(t)}}),wp.element.createElement(Us,{label:Ns("Suffix"),value:t.series[r].format?t.series[r].format.suffix:"",onChange:function(n){t.series[r].format||(t.series[r].format={}),t.series[r].format.suffix=n,e.props.edit(t)}})))})))}}])&&Hs(n.prototype,r),a&&Hs(n,a),t}(Rs);function Vs(e){return(Vs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Gs(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function $s(e,t){return!t||"object"!==Vs(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ks(e){return(Ks=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Zs(e,t){return(Zs=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Qs=wp.i18n.__,Xs=wp.element,el=Xs.Component,tl=Xs.Fragment,nl=(wp.blockEditor||wp.editor).ColorPalette,rl=wp.components,al=rl.BaseControl,il=rl.CheckboxControl,ol=rl.PanelBody,sl=rl.SelectControl,ll=rl.TextControl,ul=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),$s(this,Ks(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Zs(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(ol,{title:Qs("Layout And Chart Area"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(ol,{title:Qs("Layout"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ll,{label:Qs("Width of Chart"),help:Qs("Determines the total width of the chart."),value:n.width,onChange:function(t){n.width=t,e.props.edit(n)}}),wp.element.createElement(ll,{label:Qs("Height of Chart"),help:Qs("Determines the total height of the chart."),value:n.height,onChange:function(t){n.height=t,e.props.edit(n)}}),0<=["geo"].indexOf(t)&&wp.element.createElement(sl,{label:Qs("Keep Aspect Ratio"),help:Qs("If yes, the map will be drawn at the largest size that can fit inside the chart area at its natural aspect ratio. If only one of the width and height options is specified, the other one will be calculated according to the aspect ratio. If no, the map will be stretched to the exact size of the chart as specified by the width and height options."),value:n.keepAspectRatio?n.isStacked:"1",options:[{label:Qs("Yes"),value:"1"},{label:Qs("No"),value:"0"}],onChange:function(t){n.keepAspectRatio=t,e.props.edit(n)}}),-1>=["gauge"].indexOf(t)&&wp.element.createElement(tl,null,wp.element.createElement(ll,{label:Qs("Stroke Width"),help:Qs("The chart border width in pixels."),value:n.backgroundColor.strokeWidth,onChange:function(t){n.backgroundColor.strokeWidth=t,e.props.edit(n)}}),wp.element.createElement(al,{label:Qs("Stroke Color")},wp.element.createElement(nl,{value:n.backgroundColor.stroke,onChange:function(t){n.backgroundColor.stroke=t,e.props.edit(n)}})),wp.element.createElement(al,{label:Qs("Background Color")},wp.element.createElement(nl,{value:n.backgroundColor.fill,onChange:function(t){n.backgroundColor.fill=t,e.props.edit(n)}})),wp.element.createElement(il,{label:Qs("Transparent Background?"),checked:"transparent"===n.backgroundColor.fill,onChange:function(t){n.backgroundColor.fill="transparent"===n.backgroundColor.fill?"":"transparent",e.props.edit(n)}}))),-1>=["geo","gauge"].indexOf(t)&&wp.element.createElement(ol,{title:Qs("Chart Area"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ll,{label:Qs("Left Margin"),help:Qs("Determines how far to draw the chart from the left border."),value:n.chartArea.left,onChange:function(t){n.chartArea.left=t,e.props.edit(n)}}),wp.element.createElement(ll,{label:Qs("Top Margin"),help:Qs("Determines how far to draw the chart from the top border."),value:n.chartArea.top,onChange:function(t){n.chartArea.top=t,e.props.edit(n)}}),wp.element.createElement(ll,{label:Qs("Width Of Chart Area"),help:Qs("Determines the width of the chart area."),value:n.chartArea.width,onChange:function(t){n.chartArea.width=t,e.props.edit(n)}}),wp.element.createElement(ll,{label:Qs("Height Of Chart Area"),help:Qs("Determines the hight of the chart area."),value:n.chartArea.height,onChange:function(t){n.chartArea.height=t,e.props.edit(n)}})))}}])&&Gs(n.prototype,r),a&&Gs(n,a),t}(el);function cl(e){return(cl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function dl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ml(e,t){return!t||"object"!==cl(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function pl(e){return(pl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function hl(e,t){return(hl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var _l=wp.i18n.__,fl=wp.element,yl=fl.Component,gl=fl.Fragment,bl=wp.components,vl=bl.CheckboxControl,Ml=bl.PanelBody,wl=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ml(this,pl(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&hl(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];void 0===e.actions&&(e.actions=[]),this.props.edit(e)}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Ml,{title:_l("Frontend Actions"),initialOpen:!1,className:"visualizer-advanced-panel"},void 0!==t.actions&&wp.element.createElement(gl,null,wp.element.createElement(vl,{label:_l("Print"),help:_l("To enable printing the data."),checked:0<=t.actions.indexOf("print"),onChange:function(n){if(0<=t.actions.indexOf("print")){var r=t.actions.indexOf("print");-1!==r&&t.actions.splice(r,1)}else t.actions.push("print");e.props.edit(t)}}),wp.element.createElement(vl,{label:_l("CSV"),help:_l("To enable downloading the data as a CSV."),checked:0<=t.actions.indexOf("csv;application/csv"),onChange:function(n){if(0<=t.actions.indexOf("csv;application/csv")){var r=t.actions.indexOf("csv;application/csv");-1!==r&&t.actions.splice(r,1)}else t.actions.push("csv;application/csv");e.props.edit(t)}}),wp.element.createElement(vl,{label:_l("Excel"),help:_l("To enable downloading the data as an Excel spreadsheet."),checked:0<=t.actions.indexOf("xls;application/vnd.ms-excel"),onChange:function(n){if(0<=t.actions.indexOf("xls;application/vnd.ms-excel")){var r=t.actions.indexOf("xls;application/vnd.ms-excel");-1!==r&&t.actions.splice(r,1)}else t.actions.push("xls;application/vnd.ms-excel");e.props.edit(t)}}),wp.element.createElement(vl,{label:_l("Copy"),help:_l("To enable copying the data to the clipboard."),checked:0<=t.actions.indexOf("copy"),onChange:function(n){if(0<=t.actions.indexOf("copy")){var r=t.actions.indexOf("copy");-1!==r&&t.actions.splice(r,1)}else t.actions.push("copy");e.props.edit(t)}})))}}])&&dl(n.prototype,r),a&&dl(n,a),t}(yl);function kl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ll(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){kl(e,t,n[t])}))}return e}var Yl={dark_vscode_tribute:{default:"#D4D4D4",background:"#1E1E1E",background_warning:"#1E1E1E",string:"#CE8453",number:"#B5CE9F",colon:"#49B8F7",keys:"#9CDCFE",keys_whiteSpace:"#AF74A5",primitive:"#6392C6"},light_mitsuketa_tribute:{default:"#D4D4D4",background:"#FCFDFD",background_warning:"#FEECEB",string:"#FA7921",number:"#70CE35",colon:"#49B8F7",keys:"#59A5D8",keys_whiteSpace:"#835FB6",primitive:"#386FA4"}},Dl=n(2);const Tl={getCaller:(e=1)=>{var t=(new Error).stack.replace(/^Error\s+/,"");return t=(t=t.split("\n")[e]).replace(/^\s+at Object./,"").replace(/^\s+at /,"").replace(/ \(.+\)$/,"")},throwError:(e="unknown function",t="unknown parameter",n="to be defined")=>{throw["@",e,"(): Expected parameter '",t,"' ",n].join("")},isUndefined:(e="<unknown parameter>",t)=>{[null,void 0].indexOf(t)>-1&&Tl.throwError(Tl.getCaller(2),e)},isFalsy:(e="<unknown parameter>",t)=>{t||Tl.throwError(Tl.getCaller(2),e)},isNoneOf:(e="<unknown parameter>",t,n=[])=>{-1===n.indexOf(t)&&Tl.throwError(Tl.getCaller(2),e,"to be any of"+JSON.stringify(n))},isAnyOf:(e="<unknown parameter>",t,n=[])=>{n.indexOf(t)>-1&&Tl.throwError(Tl.getCaller(2),e,"not to be any of"+JSON.stringify(n))},isNotType:(e="<unknown parameter>",t,n="")=>{Object(Dl.getType)(t)!==n.toLowerCase()&&Tl.throwError(Tl.getCaller(2),e,"to be type "+n.toLowerCase())},isAnyTypeOf:(e="<unknown parameter>",t,n=[])=>{n.forEach(n=>{Object(Dl.getType)(t)===n&&Tl.throwError(Tl.getCaller(2),e,"not to be type of "+n.toLowerCase())})},missingKey:(e="<unknown parameter>",t,n="")=>{Tl.isUndefined(e,t),-1===Object.keys(t).indexOf(n)&&Tl.throwError(Tl.getCaller(2),e,"to contain '"+n+"' key")},missingAnyKeys:(e="<unknown parameter>",t,n=[""])=>{Tl.isUndefined(e,t);const r=Object.keys(t);n.forEach(t=>{-1===r.indexOf(t)&&Tl.throwError(Tl.getCaller(2),e,"to contain '"+t+"' key")})},containsUndefined:(e="<unknown parameter>",t)=>{[void 0,null].forEach(n=>{const r=Object(Dl.locate)(t,n);r&&Tl.throwError(Tl.getCaller(2),e,"not to contain '"+JSON.stringify(n)+"' at "+r)})},isInvalidPath:(e="<unknown parameter>",t)=>{Tl.isUndefined(e,t),Tl.isNotType(e,t,"string"),Tl.isAnyOf(e,t,["","/"]),".$[]#".split().forEach(n=>{t.indexOf(n)>-1&&Tl.throwError(Tl.getCaller(2),e,"not to contain invalid character '"+n+"'")}),t.match(/\/{2,}/g)&&Tl.throwError(Tl.getCaller(2),e,"not to contain consecutive forward slash characters")},isInvalidWriteData:(e="<unknown parameter>",t)=>{Tl.isUndefined(e,t),Tl.containsUndefined(e,t)}};var Sl=Tl;const Ol=(e,t)=>t?Object.keys(t).reduce((e,n)=>e.replace(new RegExp(`\\{${n}\\}`,"gi"),(e=>Array.isArray(e)?e.join(", "):"string"==typeof e?e:""+e)(t[n])),e):e;var jl={format:"{reason} at line {line}",symbols:{colon:"colon",comma:"comma",semicolon:"semicolon",slash:"slash",backslash:"backslash",brackets:{round:"round brackets",square:"square brackets",curly:"curly brackets",angle:"angle brackets"},period:"period",quotes:{single:"single quote",double:"double quote",grave:"grave accent"},space:"space",ampersand:"ampersand",asterisk:"asterisk",at:"at sign",equals:"equals sign",hash:"hash",percent:"percent",plus:"plus",minus:"minus",dash:"dash",hyphen:"hyphen",tilde:"tilde",underscore:"underscore",bar:"vertical bar"},types:{key:"key",value:"value",number:"number",string:"string",primitive:"primitive",boolean:"boolean",character:"character",integer:"integer",array:"array",float:"float"},invalidToken:{tokenSequence:{prohibited:"'{firstToken}' token cannot be followed by '{secondToken}' token(s)",permitted:"'{firstToken}' token can only be followed by '{secondToken}' token(s)"},termSequence:{prohibited:"A {firstTerm} cannot be followed by a {secondTerm}",permitted:"A {firstTerm} can only be followed by a {secondTerm}"},double:"'{token}' token cannot be followed by another '{token}' token",useInstead:"'{badToken}' token is not accepted. Use '{goodToken}' instead",unexpected:"Unexpected '{token}' token found"},brace:{curly:{missingOpen:"Missing '{' open curly brace",missingClose:"Open '{' curly brace is missing closing '}' curly brace",cannotWrap:"'{token}' token cannot be wrapped in '{}' curly braces"},square:{missingOpen:"Missing '[' open square brace",missingClose:"Open '[' square brace is missing closing ']' square brace",cannotWrap:"'{token}' token cannot be wrapped in '[]' square braces"}},string:{missingOpen:"Missing/invalid opening string '{quote}' token",missingClose:"Missing/invalid closing string '{quote}' token",mustBeWrappedByQuotes:"Strings must be wrapped by quotes",nonAlphanumeric:"Non-alphanumeric token '{token}' is not allowed outside string notation",unexpectedKey:"Unexpected key found at string position"},key:{numberAndLetterMissingQuotes:"Key beginning with number and containing letters must be wrapped by quotes",spaceMissingQuotes:"Key containing space must be wrapped by quotes",unexpectedString:"Unexpected string found at key position"},noTrailingOrLeadingComma:"Trailing or leading commas in arrays and objects are not permitted"};
65
  /** @license react-json-editor-ajrm v2.5.9
66
  *
67
  * This source code is licensed under the MIT license found in the
68
  * LICENSE file in the root directory of this source tree.
69
+ */class xl extends r.Component{constructor(e){super(e),this.updateInternalProps=this.updateInternalProps.bind(this),this.createMarkup=this.createMarkup.bind(this),this.onClick=this.onClick.bind(this),this.onBlur=this.onBlur.bind(this),this.update=this.update.bind(this),this.getCursorPosition=this.getCursorPosition.bind(this),this.setCursorPosition=this.setCursorPosition.bind(this),this.scheduledUpdate=this.scheduledUpdate.bind(this),this.setUpdateTime=this.setUpdateTime.bind(this),this.renderLabels=this.renderLabels.bind(this),this.newSpan=this.newSpan.bind(this),this.renderErrorMessage=this.renderErrorMessage.bind(this),this.onScroll=this.onScroll.bind(this),this.showPlaceholder=this.showPlaceholder.bind(this),this.tokenize=this.tokenize.bind(this),this.onKeyPress=this.onKeyPress.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onPaste=this.onPaste.bind(this),this.stopEvent=this.stopEvent.bind(this),this.refContent=null,this.refLabels=null,this.updateInternalProps(),this.renderCount=1,this.state={prevPlaceholder:"",markupText:"",plainText:"",json:"",jsObject:void 0,lines:!1,error:!1},this.props.locale||console.warn("[react-json-editor-ajrm - Deprecation Warning] You did not provide a 'locale' prop for your JSON input - This will be required in a future version. English has been set as a default.")}updateInternalProps(){let e={},t={},n=Yl.dark_vscode_tribute;"theme"in this.props&&"string"==typeof this.props.theme&&this.props.theme in Yl&&(n=Yl[this.props.theme]),e=n,"colors"in this.props&&(e={default:"default"in this.props.colors?this.props.colors.default:e.default,string:"string"in this.props.colors?this.props.colors.string:e.string,number:"number"in this.props.colors?this.props.colors.number:e.number,colon:"colon"in this.props.colors?this.props.colors.colon:e.colon,keys:"keys"in this.props.colors?this.props.colors.keys:e.keys,keys_whiteSpace:"keys_whiteSpace"in this.props.colors?this.props.colors.keys_whiteSpace:e.keys_whiteSpace,primitive:"primitive"in this.props.colors?this.props.colors.primitive:e.primitive,error:"error"in this.props.colors?this.props.colors.error:e.error,background:"background"in this.props.colors?this.props.colors.background:e.background,background_warning:"background_warning"in this.props.colors?this.props.colors.background_warning:e.background_warning}),this.colors=e,t="style"in this.props?{outerBox:"outerBox"in this.props.style?this.props.style.outerBox:{},container:"container"in this.props.style?this.props.style.container:{},warningBox:"warningBox"in this.props.style?this.props.style.warningBox:{},errorMessage:"errorMessage"in this.props.style?this.props.style.errorMessage:{},body:"body"in this.props.style?this.props.style.body:{},labelColumn:"labelColumn"in this.props.style?this.props.style.labelColumn:{},labels:"labels"in this.props.style?this.props.style.labels:{},contentBox:"contentBox"in this.props.style?this.props.style.contentBox:{}}:{outerBox:{},container:{},warningBox:{},errorMessage:{},body:{},labelColumn:{},labels:{},contentBox:{}},this.style=t,this.confirmGood=!("confirmGood"in this.props)||this.props.confirmGood;const r=this.props.height||"610px",a=this.props.width||"479px";this.totalHeight=r,this.totalWidth=a,"onKeyPressUpdate"in this.props&&!this.props.onKeyPressUpdate?this.timer&&(clearInterval(this.timer),this.timer=!1):this.timer||(this.timer=setInterval(this.scheduledUpdate,100)),this.updateTime=!1,this.waitAfterKeyPress="waitAfterKeyPress"in this.props?this.props.waitAfterKeyPress:1e3,this.resetConfiguration="reset"in this.props&&this.props.reset}render(){const e=this.props.id,t=this.state.markupText,n=this.state.error,r=this.colors,i=this.style,o=this.confirmGood,s=this.totalHeight,l=this.totalWidth,u=!!n&&"token"in n;return this.renderCount++,a.a.createElement("div",{name:"outer-box",id:e&&e+"-outer-box",style:Ll({display:"block",overflow:"none",height:s,width:l,margin:0,boxSizing:"border-box",position:"relative"},i.outerBox)},o?a.a.createElement("div",{style:{opacity:u?0:1,height:"30px",width:"30px",position:"absolute",top:0,right:0,transform:"translate(-25%,25%)",pointerEvents:"none",transitionDuration:"0.2s",transitionTimingFunction:"cubic-bezier(0, 1, 0.5, 1)"}},a.a.createElement("svg",{height:"30px",width:"30px",viewBox:"0 0 100 100"},a.a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",fill:"green",opacity:"0.85",d:"M39.363,79L16,55.49l11.347-11.419L39.694,56.49L72.983,23L84,34.085L39.363,79z"}))):void 0,a.a.createElement("div",{name:"container",id:e&&e+"-container",style:Ll({display:"block",height:s,width:l,margin:0,boxSizing:"border-box",overflow:"hidden",fontFamily:"Roboto, sans-serif"},i.container),onClick:this.onClick},a.a.createElement("div",{name:"warning-box",id:e&&e+"-warning-box",style:Ll({display:"block",overflow:"hidden",height:u?"60px":"0px",width:"100%",margin:0,backgroundColor:r.background_warning,transitionDuration:"0.2s",transitionTimingFunction:"cubic-bezier(0, 1, 0.5, 1)"},i.warningBox),onClick:this.onClick},a.a.createElement("span",{style:{display:"inline-block",height:"60px",width:"60px",margin:0,boxSizing:"border-box",overflow:"hidden",verticalAlign:"top",pointerEvents:"none"},onClick:this.onClick},a.a.createElement("div",{style:{position:"relative",top:0,left:0,height:"60px",width:"60px",margin:0,pointerEvents:"none"},onClick:this.onClick},a.a.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"},onClick:this.onClick},a.a.createElement("svg",{height:"25px",width:"25px",viewBox:"0 0 100 100"},a.a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",fill:"red",d:"M73.9,5.75c0.467-0.467,1.067-0.7,1.8-0.7c0.7,0,1.283,0.233,1.75,0.7l16.8,16.8 c0.467,0.5,0.7,1.084,0.7,1.75c0,0.733-0.233,1.334-0.7,1.801L70.35,50l23.9,23.95c0.5,0.467,0.75,1.066,0.75,1.8 c0,0.667-0.25,1.25-0.75,1.75l-16.8,16.75c-0.534,0.467-1.117,0.7-1.75,0.7s-1.233-0.233-1.8-0.7L50,70.351L26.1,94.25 c-0.567,0.467-1.167,0.7-1.8,0.7c-0.667,0-1.283-0.233-1.85-0.7L5.75,77.5C5.25,77,5,76.417,5,75.75c0-0.733,0.25-1.333,0.75-1.8 L29.65,50L5.75,26.101C5.25,25.667,5,25.066,5,24.3c0-0.666,0.25-1.25,0.75-1.75l16.8-16.8c0.467-0.467,1.05-0.7,1.75-0.7 c0.733,0,1.333,0.233,1.8,0.7L50,29.65L73.9,5.75z"}))))),a.a.createElement("span",{style:{display:"inline-block",height:"60px",width:"calc(100% - 60px)",margin:0,overflow:"hidden",verticalAlign:"top",position:"absolute",pointerEvents:"none"},onClick:this.onClick},this.renderErrorMessage())),a.a.createElement("div",{name:"body",id:e&&e+"-body",style:Ll({display:"flex",overflow:"none",height:u?"calc(100% - 60px)":"100%",width:"",margin:0,resize:"none",fontFamily:"Roboto Mono, Monaco, monospace",fontSize:"11px",backgroundColor:r.background,transitionDuration:"0.2s",transitionTimingFunction:"cubic-bezier(0, 1, 0.5, 1)"},i.body),onClick:this.onClick},a.a.createElement("span",{name:"labels",id:e&&e+"-labels",ref:e=>this.refLabels=e,style:Ll({display:"inline-block",boxSizing:"border-box",verticalAlign:"top",height:"100%",width:"44px",margin:0,padding:"5px 0px 5px 10px",overflow:"hidden",color:"#D4D4D4"},i.labelColumn),onClick:this.onClick},this.renderLabels()),a.a.createElement("span",{id:e,ref:e=>this.refContent=e,contentEditable:!0,style:Ll({display:"inline-block",boxSizing:"border-box",verticalAlign:"top",height:"100%",width:"",flex:1,margin:0,padding:"5px",overflowX:"hidden",overflowY:"auto",wordWrap:"break-word",whiteSpace:"pre-line",color:"#D4D4D4",outline:"none"},i.contentBox),dangerouslySetInnerHTML:this.createMarkup(t),onKeyPress:this.onKeyPress,onKeyDown:this.onKeyDown,onClick:this.onClick,onBlur:this.onBlur,onScroll:this.onScroll,onPaste:this.onPaste,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}))))}renderErrorMessage(){const e=this.props.locale||jl,t=this.state.error,n=this.style;if(t)return a.a.createElement("p",{style:Ll({color:"red",fontSize:"12px",position:"absolute",width:"calc(100% - 60px)",height:"60px",boxSizing:"border-box",margin:0,padding:0,paddingRight:"10px",overflowWrap:"break-word",display:"flex",flexDirection:"column",justifyContent:"center"},n.errorMessage)},Ol(e.format,t))}renderLabels(){const e=this.colors,t=this.style,n=this.state.error?this.state.error.line:-1,r=this.state.lines?this.state.lines:1;let i=new Array(r);for(var o=0;o<r-1;o++)i[o]=o+1;return i.map(r=>{const i=r!==n?e.default:"red";return a.a.createElement("div",{key:r,style:Ll({},t.labels,{color:i})},r)})}createMarkup(e){return void 0===e?{__html:""}:{__html:""+e}}newSpan(e,t,n){let r=this.colors,a=t.type,i=t.string,o="";switch(a){case"string":case"number":case"primitive":case"error":o=r[t.type];break;case"key":o=" "===i?r.keys_whiteSpace:r.keys;break;case"symbol":o=":"===i?r.colon:r.default;break;default:o=r.default}return i.length!==i.replace(/</g,"").replace(/>/g,"").length&&(i="<xmp style=display:inline;>"+i+"</xmp>"),'<span type="'+a+'" value="'+i+'" depth="'+n+'" style="color:'+o+'">'+i+"</span>"}getCursorPosition(e){let t,n=window.getSelection(),r=-1,a=0;if(n.focusNode&&(e=>{for(;null!==e;){if(e===this.refContent)return!0;e=e.parentNode}return!1})(n.focusNode))for(t=n.focusNode,r=n.focusOffset;t&&t!==this.refContent;)if(t.previousSibling)t=t.previousSibling,e&&"BR"===t.nodeName&&a++,r+=t.textContent.length;else if(null===(t=t.parentNode))break;return r+a}setCursorPosition(e){if([!1,null,void 0].indexOf(e)>-1)return;const t=(e,n,r)=>{if(r||((r=document.createRange()).selectNode(e),r.setStart(e,0)),0===n.count)r.setEnd(e,n.count);else if(e&&n.count>0)if(e.nodeType===Node.TEXT_NODE)e.textContent.length<n.count?n.count-=e.textContent.length:(r.setEnd(e,n.count),n.count=0);else for(var a=0;a<e.childNodes.length&&(r=t(e.childNodes[a],n,r),0!==n.count);a++);return r};e>0?(e=>{if(e<0)return;let n=window.getSelection(),r=t(this.refContent,{count:e});r&&(r.collapse(!1),n.removeAllRanges(),n.addRange(r))})(e):this.refContent.focus()}update(e=0,t=!0){const n=this.refContent,r=this.tokenize(n);"onChange"in this.props&&this.props.onChange({plainText:r.indented,markupText:r.markup,json:r.json,jsObject:r.jsObject,lines:r.lines,error:r.error});let a=this.getCursorPosition(r.error)+e;this.setState({plainText:r.indented,markupText:r.markup,json:r.json,jsObject:r.jsObject,lines:r.lines,error:r.error}),this.updateTime=!1,t&&this.setCursorPosition(a)}scheduledUpdate(){if("onKeyPressUpdate"in this.props&&!1===this.props.onKeyPressUpdate)return;const{updateTime:e}=this;!1!==e&&(e>(new Date).getTime()||this.update())}setUpdateTime(){"onKeyPressUpdate"in this.props&&!1===this.props.onKeyPressUpdate||(this.updateTime=(new Date).getTime()+this.waitAfterKeyPress)}stopEvent(e){e&&(e.preventDefault(),e.stopPropagation())}onKeyPress(e){const t=e.ctrlKey||e.metaKey;this.props.viewOnly&&!t&&this.stopEvent(e),t||this.setUpdateTime()}onKeyDown(e){const t=!!this.props.viewOnly,n=e.ctrlKey||e.metaKey;switch(e.key){case"Tab":if(this.stopEvent(e),t)break;document.execCommand("insertText",!1," "),this.setUpdateTime();break;case"Backspace":case"Delete":t&&this.stopEvent(e),this.setUpdateTime();break;case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"ArrowDown":this.setUpdateTime();break;case"a":case"c":t&&!n&&this.stopEvent(e);break;default:t&&this.stopEvent(e)}}onPaste(e){if(this.props.viewOnly)this.stopEvent(e);else{e.preventDefault();var t=e.clipboardData.getData("text/plain");document.execCommand("insertHTML",!1,t)}this.update()}onClick(){"viewOnly"in this.props&&this.props.viewOnly}onBlur(){"viewOnly"in this.props&&this.props.viewOnly||this.update(0,!1)}onScroll(e){this.refLabels.scrollTop=e.target.scrollTop}componentDidUpdate(){this.updateInternalProps(),this.showPlaceholder()}componentDidMount(){this.showPlaceholder()}componentWillUnmount(){this.timer&&clearInterval(this.timer)}showPlaceholder(){if(!("placeholder"in this.props))return;const{placeholder:e}=this.props;if([void 0,null].indexOf(e)>-1)return;const{prevPlaceholder:t,jsObject:n}=this.state,{resetConfiguration:r}=this,a=Object(Dl.getType)(e);-1===["object","array"].indexOf(a)&&Sl.throwError("showPlaceholder","placeholder","either an object or an array");let i=!Object(Dl.identical)(e,t);if(i||r&&void 0!==n&&(i=!Object(Dl.identical)(e,n)),!i)return;const o=this.tokenize(e);this.setState({prevPlaceholder:e,plainText:o.indentation,markupText:o.markup,lines:o.lines,error:o.error})}tokenize(e){if("object"!=typeof e)return console.error("tokenize() expects object type properties only. Got '"+typeof e+"' type instead.");const t=this.props.locale||jl,n=this.newSpan;if("nodeType"in e){const w=e.cloneNode(!0);if(!w.hasChildNodes())return"";const k=w.childNodes;let L={tokens_unknown:[],tokens_proto:[],tokens_split:[],tokens_fallback:[],tokens_normalize:[],tokens_merge:[],tokens_plainText:"",indented:"",json:"",jsObject:void 0,markup:""};for(var r=0;r<k.length;r++){let e=k[r],t={};switch(e.nodeName){case"SPAN":t={string:e.textContent,type:e.attributes.type.textContent},L.tokens_unknown.push(t);break;case"DIV":L.tokens_unknown.push({string:e.textContent,type:"unknown"});break;case"BR":""===e.textContent&&L.tokens_unknown.push({string:"\n",type:"unknown"});break;case"#text":L.tokens_unknown.push({string:e.wholeText,type:"unknown"});break;case"FONT":L.tokens_unknown.push({string:e.textContent,type:"unknown"});break;default:console.error("Unrecognized node:",{child:e})}}function a(e,t=""){let n={active:!1,string:"",number:"",symbol:"",space:"",delimiter:"",quarks:[]};function r(e,r){switch(r){case"symbol":case"delimiter":n.active&&n.quarks.push({string:n[n.active],type:t+"-"+n.active}),n[n.active]="",n.active=r,n[n.active]=e;break;default:r!==n.active||[n.string,e].indexOf("\n")>-1?(n.active&&n.quarks.push({string:n[n.active],type:t+"-"+n.active}),n[n.active]="",n.active=r,n[n.active]=e):n[r]+=e}}for(var a=0;a<e.length;a++){const t=e.charAt(a);switch(t){case'"':case"'":r(t,"delimiter");break;case" ":case" ":r(t,"space");break;case"{":case"}":case"[":case"]":case":":case",":r(t,"symbol");break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":"string"===n.active?r(t,"string"):r(t,"number");break;case"-":if(a<e.length-1&&"0123456789".indexOf(e.charAt(a+1))>-1){r(t,"number");break}case".":if(a<e.length-1&&a>0&&"0123456789".indexOf(e.charAt(a+1))>-1&&"0123456789".indexOf(e.charAt(a-1))>-1){r(t,"number");break}default:r(t,"string")}}return n.active&&(n.quarks.push({string:n[n.active],type:t+"-"+n.active}),n[n.active]="",n.active=!1),n.quarks}for(r=0;r<L.tokens_unknown.length;r++){let e=L.tokens_unknown[r];L.tokens_proto=L.tokens_proto.concat(a(e.string,"proto"))}function i(e,t){let n="",r="",a=!1;switch(t){case"primitive":if(-1===["true","false","null","undefined"].indexOf(e))return!1;break;case"string":if(e.length<2)return!1;if(n=e.charAt(0),r=e.charAt(e.length-1),-1===(a="'\"".indexOf(n)))return!1;if(n!==r)return!1;for(var i=0;i<e.length;i++)if(i>0&&i<e.length-1&&e.charAt(i)==="'\""[a]&&"\\"!==e.charAt(i-1))return!1;break;case"key":if(0===e.length)return!1;if(n=e.charAt(0),r=e.charAt(e.length-1),(a="'\"".indexOf(n))>-1){if(1===e.length)return!1;if(n!==r)return!1;for(i=0;i<e.length;i++)if(i>0&&i<e.length-1&&e.charAt(i)==="'\""[a]&&"\\"!==e.charAt(i-1))return!1}else{const t="'\"`.,:;{}[]&<>=~*%\\|/-+!?@^  ";for(i=0;i<t.length;i++){const n=t.charAt(i);if(e.indexOf(n)>-1)return!1}}break;case"number":for(i=0;i<e.length;i++)if(-1==="0123456789".indexOf(e.charAt(i)))if(0===i){if("-"!==e.charAt(0))return!1}else if("."!==e.charAt(i))return!1;break;case"symbol":if(e.length>1)return!1;if(-1==="{[:]},".indexOf(e))return!1;break;case"colon":if(e.length>1)return!1;if(":"!==e)return!1;break;default:return!0}return!0}for(r=0;r<L.tokens_proto.length;r++){let e=L.tokens_proto[r];-1===e.type.indexOf("proto")?i(e.string,e.type)?L.tokens_split.push(e):L.tokens_split=L.tokens_split.concat(a(e.string,"split")):L.tokens_split.push(e)}for(r=0;r<L.tokens_split.length;r++){let e=L.tokens_split[r],t=e.type,n=e.string,a=n.length,i=[];t.indexOf("-")>-1&&("string"!==(t=t.slice(t.indexOf("-")+1))&&i.push("string"),i.push("key"),i.push("error"));let o={string:n,length:a,type:t,fallback:i};L.tokens_fallback.push(o)}function o(){const e=L.tokens_normalize.length-1;if(e<1)return!1;for(var t=e;t>=0;t--){const e=L.tokens_normalize[t];switch(e.type){case"space":case"linebreak":break;default:return e}}return!1}let Y={brackets:[],stringOpen:!1,isValue:!1};for(r=0;r<L.tokens_fallback.length;r++){let e=L.tokens_fallback[r];const t=e.type,n=e.string;let a={type:t,string:n};switch(t){case"symbol":case"colon":if(Y.stringOpen){Y.isValue?a.type="string":a.type="key";break}switch(n){case"[":case"{":Y.brackets.push(n),Y.isValue="["===Y.brackets[Y.brackets.length-1];break;case"]":case"}":Y.brackets.pop(),Y.isValue="["===Y.brackets[Y.brackets.length-1];break;case",":if("colon"===o().type)break;Y.isValue="["===Y.brackets[Y.brackets.length-1];break;case":":a.type="colon",Y.isValue=!0}break;case"delimiter":if(Y.isValue?a.type="string":a.type="key",!Y.stringOpen){Y.stringOpen=n;break}if(r>0){const e=L.tokens_fallback[r-1],t=e.string,n=e.type,a=t.charAt(t.length-1);if("string"===n&&"\\"===a)break}if(Y.stringOpen===n){Y.stringOpen=!1;break}break;case"primitive":case"string":if(["false","true","null","undefined"].indexOf(n)>-1){const e=L.tokens_normalize.length-1;if(e>=0){if("string"!==L.tokens_normalize[e].type){a.type="primitive";break}a.type="string";break}a.type="primitive";break}if("\n"===n&&!Y.stringOpen){a.type="linebreak";break}Y.isValue?a.type="string":a.type="key";break;case"space":case"number":Y.stringOpen&&(Y.isValue?a.type="string":a.type="key")}L.tokens_normalize.push(a)}for(r=0;r<L.tokens_normalize.length;r++){const e=L.tokens_normalize[r];let t={string:e.string,type:e.type,tokens:[r]};if(-1===["symbol","colon"].indexOf(e.type)&&r+1<L.tokens_normalize.length){let n=0;for(var s=r+1;s<L.tokens_normalize.length;s++){const r=L.tokens_normalize[s];if(e.type!==r.type)break;t.string+=r.string,t.tokens.push(s),n++}r+=n}L.tokens_merge.push(t)}const D="'\"",T="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$";var l=!1,u=L.tokens_merge.length>0?1:0;function c(e,t,n=0){l={token:e,line:u,reason:t},L.tokens_merge[e+n].type="error"}function d(e,t){if(void 0===e&&console.error("tokenID argument must be an integer."),void 0===t&&console.error("options argument must be an array."),e===L.tokens_merge.length-1)return!1;for(var n=e+1;n<L.tokens_merge.length;n++){const e=L.tokens_merge[n];switch(e.type){case"space":case"linebreak":break;case"symbol":case"colon":return t.indexOf(e.string)>-1&&n;default:return!1}}return!1}function m(e,t){if(void 0===e&&console.error("tokenID argument must be an integer."),void 0===t&&console.error("options argument must be an array."),0===e)return!1;for(var n=e-1;n>=0;n--){const e=L.tokens_merge[n];switch(e.type){case"space":case"linebreak":break;case"symbol":case"colon":return t.indexOf(e.string)>-1;default:return!1}}return!1}function p(e){if(void 0===e&&console.error("tokenID argument must be an integer."),0===e)return!1;for(var t=e-1;t>=0;t--){const e=L.tokens_merge[t];switch(e.type){case"space":case"linebreak":break;default:return e.type}}return!1}Y={brackets:[],stringOpen:!1,isValue:!1};let S=[];for(r=0;r<L.tokens_merge.length&&!l;r++){let e=L.tokens_merge[r],n=e.string,a=e.type,i=!1;switch(a){case"space":break;case"linebreak":u++;break;case"symbol":switch(n){case"{":case"[":if(i=m(r,["}","]"])){c(r,Ol(t.invalidToken.tokenSequence.prohibited,{firstToken:L.tokens_merge[i].string,secondToken:n}));break}if("["===n&&r>0&&!m(r,[":","[",","])){c(r,Ol(t.invalidToken.tokenSequence.permitted,{firstToken:"[",secondToken:[":","[",","]}));break}if("{"===n&&m(r,["{"])){c(r,Ol(t.invalidToken.double,{token:"{"}));break}Y.brackets.push(n),Y.isValue="["===Y.brackets[Y.brackets.length-1],S.push({i:r,line:u,string:n});break;case"}":case"]":if("}"===n&&"{"!==Y.brackets[Y.brackets.length-1]){c(r,Ol(t.brace.curly.missingOpen));break}if("}"===n&&m(r,[","])){c(r,Ol(t.invalidToken.tokenSequence.prohibited,{firstToken:",",secondToken:"}"}));break}if("]"===n&&"["!==Y.brackets[Y.brackets.length-1]){c(r,Ol(t.brace.square.missingOpen));break}if("]"===n&&m(r,[":"])){c(r,Ol(t.invalidToken.tokenSequence.prohibited,{firstToken:":",secondToken:"]"}));break}Y.brackets.pop(),Y.isValue="["===Y.brackets[Y.brackets.length-1],S.push({i:r,line:u,string:n});break;case",":if(i=m(r,["{"])){if(d(r,["}"])){c(r,Ol(t.brace.curly.cannotWrap,{token:","}));break}c(r,Ol(t.invalidToken.tokenSequence.prohibited,{firstToken:"{",secondToken:","}));break}if(d(r,["}",",","]"])){c(r,Ol(t.noTrailingOrLeadingComma));break}switch(i=p(r)){case"key":case"colon":c(r,Ol(t.invalidToken.termSequence.prohibited,{firstTerm:"key"===i?t.types.key:t.symbols.colon,secondTerm:t.symbols.comma}));break;case"symbol":if(m(r,["{"])){c(r,Ol(t.invalidToken.tokenSequence.prohibited,{firstToken:"{",secondToken:","}));break}}Y.isValue="["===Y.brackets[Y.brackets.length-1]}L.json+=n;break;case"colon":if((i=m(r,["["]))&&d(r,["]"])){c(r,Ol(t.brace.square.cannotWrap,{token:":"}));break}if(i){c(r,Ol(t.invalidToken.tokenSequence.prohibited,{firstToken:"[",secondToken:":"}));break}if("key"!==p(r)){c(r,Ol(t.invalidToken.termSequence.permitted,{firstTerm:t.symbols.colon,secondTerm:t.types.key}));break}if(d(r,["}","]"])){c(r,Ol(t.invalidToken.termSequence.permitted,{firstTerm:t.symbols.colon,secondTerm:t.types.value}));break}Y.isValue=!0,L.json+=n;break;case"key":case"string":let e=n.charAt(0),o=n.charAt(n.length-1);D.indexOf(e);if(-1===D.indexOf(e)&&-1!==D.indexOf(o)){c(r,Ol(t.string.missingOpen,{quote:e}));break}if(-1===D.indexOf(o)&&-1!==D.indexOf(e)){c(r,Ol(t.string.missingClose,{quote:e}));break}if(D.indexOf(e)>-1&&e!==o){c(r,Ol(t.string.missingClose,{quote:e}));break}if("string"===a&&-1===D.indexOf(e)&&-1===D.indexOf(o)){c(r,Ol(t.string.mustBeWrappedByQuotes));break}if("key"===a&&d(r,["}","]"])&&c(r,Ol(t.invalidToken.termSequence.permitted,{firstTerm:t.types.key,secondTerm:t.symbols.colon})),-1===D.indexOf(e)&&-1===D.indexOf(o))for(var h=0;h<n.length&&!l;h++){const e=n.charAt(h);if(-1===T.indexOf(e)){c(r,Ol(t.string.nonAlphanumeric,{token:e}));break}}if("'"===e?n='"'+n.slice(1,-1)+'"':'"'!==e&&(n='"'+n+'"'),"key"===a&&"key"===p(r)){if(r>0&&!isNaN(L.tokens_merge[r-1])){L.tokens_merge[r-1]+=L.tokens_merge[r],c(r,Ol(t.key.numberAndLetterMissingQuotes));break}c(r,Ol(t.key.spaceMissingQuotes));break}if("key"===a&&!m(r,["{",","])){c(r,Ol(t.invalidToken.tokenSequence.permitted,{firstToken:a,secondToken:["{",","]}));break}if("string"===a&&!m(r,["[",":",","])){c(r,Ol(t.invalidToken.tokenSequence.permitted,{firstToken:a,secondToken:["[",":",","]}));break}if("key"===a&&Y.isValue){c(r,Ol(t.string.unexpectedKey));break}if("string"===a&&!Y.isValue){c(r,Ol(t.key.unexpectedString));break}L.json+=n;break;case"number":case"primitive":if(m(r,["{"]))L.tokens_merge[r].type="key",a=L.tokens_merge[r].type,n='"'+n+'"';else if("key"===p(r))L.tokens_merge[r].type="key",a=L.tokens_merge[r].type;else if(!m(r,["[",":",","])){c(r,Ol(t.invalidToken.tokenSequence.permitted,{firstToken:a,secondToken:["[",":",","]}));break}"key"!==a&&(Y.isValue||(L.tokens_merge[r].type="key",a=L.tokens_merge[r].type,n='"'+n+'"')),"primitive"===a&&"undefined"===n&&c(r,Ol(t.invalidToken.useInstead,{badToken:"undefined",goodToken:"null"})),L.json+=n}}let O="";for(r=0;r<L.json.length;r++){let e=L.json.charAt(r),t="";r+1<L.json.length&&(t=L.json.charAt(r+1),"\\"===e&&"'"===t)?(O+=t,r++):O+=e}if(L.json=O,!l){const e=Math.ceil(S.length/2);let n=0,r=!1;function _(e){S.splice(e+1,1),S.splice(e,1),r||(r=!0)}for(;S.length>0;){r=!1;for(var f=0;f<S.length-1;f++){const e=S[f].string+S[f+1].string;["[]","{}"].indexOf(e)>-1&&_(f)}if(n++,!r)break;if(n>=e)break}if(S.length>0){const e=S[0].string,n=S[0].i,r="["===e?"]":"}";u=S[0].line,c(n,Ol(t.brace["]"===r?"square":"curly"].missingClose))}}if(!l&&-1===[void 0,""].indexOf(L.json))try{L.jsObject=JSON.parse(L.json)}catch(e){const n=e.message,r=n.indexOf("position");if(-1===r)throw new Error("Error parsing failed");const a=n.substring(r+9,n.length),i=parseInt(a);let o=0,s=0,d=!1,m=1,p=!1;for(;o<i&&!p&&("linebreak"===(d=L.tokens_merge[s]).type&&m++,-1===["space","linebreak"].indexOf(d.type)&&(o+=d.string.length),!(o>=i));)s++,L.tokens_merge[s+1]||(p=!0);u=m;let h=0;for(let e=0;e<d.string.length;e++){const n=d.string.charAt(e);"\\"===n?h=h>0?h+1:1:(h%2==0&&0!==h||-1==="'\"bfnrt".indexOf(n)&&c(s,Ol(t.invalidToken.unexpected,{token:"\\"})),h=0)}l||c(s,Ol(t.invalidToken.unexpected,{token:d.string}))}let j=1,x=0;function y(){for(var e=[],t=0;t<2*x;t++)e.push("&nbsp;");return e.join("")}function g(e=!1){return j++,x>0||e?"<br>":""}function b(e=!1){return g(e)+y()}if(!l)for(r=0;r<L.tokens_merge.length;r++){const e=L.tokens_merge[r],t=e.string;switch(e.type){case"space":case"linebreak":break;case"string":case"number":case"primitive":case"error":L.markup+=(m(r,[",","["])?b():"")+n(r,e,x);break;case"key":L.markup+=b()+n(r,e,x);break;case"colon":L.markup+=n(r,e,x)+"&nbsp;";break;case"symbol":switch(t){case"[":case"{":L.markup+=(m(r,[":"])?"":b())+n(r,e,x),x++;break;case"]":case"}":x--;const t=r===L.tokens_merge.length-1,a=r>0?["[","{"].indexOf(L.tokens_merge[r-1].string)>-1?"":b(t):"";L.markup+=a+n(r,e,x);break;case",":L.markup+=n(r,e,x)}}}if(l){let e=1;function v(e){let t=0;for(var n=0;n<e.length;n++)["\n","\r"].indexOf(e[n])>-1&&t++;return t}j=1;for(r=0;r<L.tokens_merge.length;r++){const t=L.tokens_merge[r],a=t.type,i=t.string;"linebreak"===a&&j++,L.markup+=n(r,t,x),e+=v(i)}e++,++j<e&&(j=e)}for(r=0;r<L.tokens_merge.length;r++){let e=L.tokens_merge[r];L.indented+=e.string,-1===["space","linebreak"].indexOf(e.type)&&(L.tokens_plainText+=e.string)}if(l){"modifyErrorText"in this.props&&((M=this.props.modifyErrorText)&&"[object Function]"==={}.toString.call(M)&&(l.reason=this.props.modifyErrorText(l.reason)))}return{tokens:L.tokens_merge,noSpaces:L.tokens_plainText,indented:L.indented,json:L.json,jsObject:L.jsObject,markup:L.markup,lines:j,error:l}}var M;if(!("nodeType"in e)){let t={inputText:JSON.stringify(e),position:0,currentChar:"",tokenPrimary:"",tokenSecondary:"",brackets:[],isValue:!1,stringOpen:!1,stringStart:0,tokens:[]};function w(){return"\\"===t.currentChar&&(t.inputText=(e=t.inputText,n=t.position,e.slice(0,n)+e.slice(n+1)),!0);var e,n}function k(){if(-1==="'\"".indexOf(t.currentChar))return!1;if(!t.stringOpen)return Y(),t.stringStart=t.position,t.stringOpen=t.currentChar,!0;if(t.stringOpen===t.currentChar){return Y(),D(t.inputText.substring(t.stringStart,t.position+1)),t.stringOpen=!1,!0}return!1}function L(){if(-1===":,{}[]".indexOf(t.currentChar))return!1;if(t.stringOpen)return!1;switch(Y(),D(t.currentChar),t.currentChar){case":":return t.isValue=!0,!0;case"{":case"[":t.brackets.push(t.currentChar);break;case"}":case"]":t.brackets.pop()}return":"!==t.currentChar&&(t.isValue="["===t.brackets[t.brackets.length-1]),!0}function Y(){return 0!==t.tokenSecondary.length&&(t.tokens.push(t.tokenSecondary),t.tokenSecondary="",!0)}function D(e){return 0!==e.length&&(t.tokens.push(e),!0)}for(r=0;r<t.inputText.length;r++){t.position=r,t.currentChar=t.inputText.charAt(t.position);const e=L(),n=k(),a=w();e||n||a||t.stringOpen||(t.tokenSecondary+=t.currentChar)}let a={brackets:[],isValue:!1,tokens:[]};a.tokens=t.tokens.map(e=>{let t="",n="",r="";switch(e){case",":t="symbol",n=e,r=e,a.isValue="["===a.brackets[a.brackets.length-1];break;case":":t="symbol",n=e,r=e,a.isValue=!0;break;case"{":case"[":t="symbol",n=e,r=e,a.brackets.push(e),a.isValue="["===a.brackets[a.brackets.length-1];break;case"}":case"]":t="symbol",n=e,r=e,a.brackets.pop(),a.isValue="["===a.brackets[a.brackets.length-1];break;case"undefined":t="primitive",n=e,r=void 0;break;case"null":t="primitive",n=e,r=null;break;case"false":t="primitive",n=e,r=!1;break;case"true":t="primitive",n=e,r=!0;break;default:const o=e.charAt(0);if("'\"".indexOf(o)>-1){if("key"===(t=a.isValue?"string":"key")&&(n=function(e){if(0===e.length)return e;if(['""',"''"].indexOf(e)>-1)return"''";let t=!1;for(var n=0;n<2;n++)if([e.charAt(0),e.charAt(e.length-1)].indexOf(['"',"'"][n])>-1){t=!0;break}t&&e.length>=2&&(e=e.slice(1,-1));const r=e.replace(/\w/g,""),a=(e.replace(/\W+/g,""),((e,t)=>{let n=!1;for(var r=0;r<t.length&&(0!==r||!isNaN(t.charAt(r)));r++)if(isNaN(t.charAt(r))){n=!0;break}return!(e.length>0||n)})(r,e));if((e=>{for(var t=0;t<e.length;t++)if(["'",'"'].indexOf(e.charAt(t))>-1)return!0;return!1})(r)){let t="";const n=e.split("");for(var i=0;i<n.length;i++){let e=n[i];["'",'"'].indexOf(e)>-1&&(e="\\"+e),t+=e}e=t}return a?e:"'"+e+"'"}(e)),"string"===t){n="";const t=e.slice(1,-1).split("");for(var i=0;i<t.length;i++){let e=t[i];"'\"".indexOf(e)>-1&&(e="\\"+e),n+=e}n="'"+n+"'"}r=n;break}if(!isNaN(e)){t="number",n=e,r=Number(e);break}if(e.length>0&&!a.isValue){t="key",(n=e).indexOf(" ")>-1&&(n="'"+n+"'"),r=n;break}}return{type:t,string:n,value:r,depth:a.brackets.length}});let i="";for(r=0;r<a.tokens.length;r++){i+=a.tokens[r].string}function T(e){for(var t=[],n=0;n<2*e;n++)t.push(" ");return(e>0?"\n":"")+t.join("")}let o="";for(r=0;r<a.tokens.length;r++){let e=a.tokens[r];switch(e.string){case"[":case"{":const t=r<a.tokens.length-1-1?a.tokens[r+1]:"";-1==="}]".indexOf(t.string)?o+=e.string+T(e.depth):o+=e.string;break;case"]":case"}":const n=r>0?a.tokens[r-1]:"";-1==="[{".indexOf(n.string)?o+=T(e.depth)+e.string:o+=e.string;break;case":":o+=e.string+" ";break;case",":o+=e.string+T(e.depth);break;default:o+=e.string}}let s=1;function S(e){var t=[];e>0&&s++;for(var n=0;n<2*e;n++)t.push("&nbsp;");return(e>0?"<br>":"")+t.join("")}let l="";const u=a.tokens.length-1;for(r=0;r<a.tokens.length;r++){let e=a.tokens[r],t=n(r,e,e.depth);switch(e.string){case"{":case"[":const n=r<a.tokens.length-1-1?a.tokens[r+1]:"";-1==="}]".indexOf(n.string)?l+=t+S(e.depth):l+=t;break;case"}":case"]":const i=r>0?a.tokens[r-1]:"";-1==="[{".indexOf(i.string)?l+=S(e.depth)+(u===r?"<br>":"")+t:l+=t;break;case":":l+=t+" ";break;case",":l+=t+S(e.depth);break;default:l+=t}}return s+=2,{tokens:a.tokens,noSpaces:i,indented:o,json:JSON.stringify(e),jsObject:e,markup:l,lines:s}}}}var El=xl,Cl=n(133),Hl=n.n(Cl);function Pl(e){return(Pl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function zl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Al(e){return(Al=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Nl(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Fl(e,t){return(Fl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Rl=wp.i18n.__,Wl=wp.element.Component,Il=wp.components,Bl=Il.ExternalLink,Jl=Il.PanelBody,Ul=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==Pl(t)&&"function"!=typeof t?Nl(e):t}(this,Al(t).apply(this,arguments))).isValidJSON=e.isValidJSON.bind(Nl(e)),e}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Fl(e,t)}(t,e),n=t,(r=[{key:"isValidJSON",value:function(e){try{JSON.parse(e)}catch(e){return!1}return!0}},{key:"render",value:function(){var e,t=this,n=this.props.chart["visualizer-settings"];return e=0<=["gauge","table","timeline"].indexOf(this.props.chart["visualizer-chart-type"])?this.props.chart["visualizer-chart-type"]:"".concat(this.props.chart["visualizer-chart-type"],"chart"),wp.element.createElement(Jl,{title:Rl("Manual Configuration"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement("p",null,Rl("Configure the graph by providing configuration variables right from the Google Visualization API.")),wp.element.createElement("p",null,wp.element.createElement(Bl,{href:"https://developers.google.com/chart/interactive/docs/gallery/".concat(e,"#configuration-options")},Rl("Google Visualization API"))),wp.element.createElement(El,{locale:Hl.a,theme:"light_mitsuketa_tribute",placeholder:$(n.manual)?JSON.parse(n.manual):{},width:"100%",height:"250px",style:{errorMessage:{height:"100%",fontSize:"10px"},container:{border:"1px solid #ddd",boxShadow:"inset 0 1px 2px rgba(0,0,0,.07)"},labelColumn:{background:"#F5F5F5",width:"auto",padding:"5px 10px 5px 10px"}},onChange:function(e){!1===e.error&&(n.manual=e.json,t.props.edit(n))}}))}}])&&zl(n.prototype,r),a&&zl(n,a),t}(Wl);function ql(e){return(ql="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Vl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Gl(e,t){return!t||"object"!==ql(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function $l(e){return($l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Kl(e,t){return(Kl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Zl=wp.element,Ql=Zl.Component,Xl=Zl.Fragment,eu=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Gl(this,$l(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Kl(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this.props.chart["visualizer-chart-type"];return wp.element.createElement(Xl,null,wp.element.createElement(Un,{chart:this.props.chart,edit:this.props.edit}),-1>=["table","gauge","geo","pie","timeline","dataTable"].indexOf(e)&&wp.element.createElement(lr,{chart:this.props.chart,edit:this.props.edit}),-1>=["table","gauge","geo","pie","timeline","dataTable"].indexOf(e)&&wp.element.createElement(Yr,{chart:this.props.chart,edit:this.props.edit}),0<=["pie"].indexOf(e)&&wp.element.createElement(Xl,null,wp.element.createElement(Ir,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(ta,{chart:this.props.chart,edit:this.props.edit})),0<=["area","scatter","line"].indexOf(e)&&wp.element.createElement(_a,{chart:this.props.chart,edit:this.props.edit}),0<=["bar","column"].indexOf(e)&&wp.element.createElement(Ta,{chart:this.props.chart,edit:this.props.edit}),0<=["candlestick"].indexOf(e)&&wp.element.createElement(Wa,{chart:this.props.chart,edit:this.props.edit}),0<=["geo"].indexOf(e)&&wp.element.createElement(Xl,null,wp.element.createElement(ei,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(pi,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(Ti,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(Fi,{chart:this.props.chart,edit:this.props.edit})),0<=["gauge"].indexOf(e)&&wp.element.createElement(to,{chart:this.props.chart,edit:this.props.edit}),0<=["timeline"].indexOf(e)&&wp.element.createElement(_o,{chart:this.props.chart,edit:this.props.edit}),0<=["table","dataTable"].indexOf(e)&&wp.element.createElement(Xl,null,wp.element.createElement(jo,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(Uo,{chart:this.props.chart,edit:this.props.edit})),0<=["combo"].indexOf(e)&&wp.element.createElement(ns,{chart:this.props.chart,edit:this.props.edit}),-1>=["timeline","gauge","geo","pie","dataTable"].indexOf(e)&&wp.element.createElement(bs,{chart:this.props.chart,edit:this.props.edit}),0<=["pie"].indexOf(e)&&wp.element.createElement(Es,{chart:this.props.chart,edit:this.props.edit}),0<=["dataTable"].indexOf(e)&&wp.element.createElement(qs,{chart:this.props.chart,edit:this.props.edit}),-1>=["dataTable"].indexOf(e)&&wp.element.createElement(ul,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(wl,{chart:this.props.chart,edit:this.props.edit}),-1>=["dataTable"].indexOf(e)&&wp.element.createElement(Ul,{chart:this.props.chart,edit:this.props.edit}))}}])&&Vl(n.prototype,r),a&&Vl(n,a),t}(Ql);function tu(e){return(tu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function nu(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function ru(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){nu(i,r,a,o,s,"next",e)}function s(e){nu(i,r,a,o,s,"throw",e)}o(void 0)}))}}function au(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function iu(e){return(iu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ou(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function su(e,t){return(su=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var lu=wp.i18n.__,uu=wp.apiFetch,cu=wp.element,du=cu.Component,mu=cu.Fragment,pu=wp.components,hu=pu.Button,_u=pu.PanelBody,fu=pu.SelectControl,yu=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==tu(t)&&"function"!=typeof t?ou(e):t}(this,iu(t).apply(this,arguments))).getPermissionData=e.getPermissionData.bind(ou(e)),e.state={users:[],roles:[]},e}var n,r,a,i,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&su(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:(o=ru(regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("business"!==visualizerLocalize.isPro){e.next=14;break}if(void 0===(t=this.props.chart["visualizer-permissions"]).permissions){e.next=14;break}if(void 0===t.permissions.read||void 0===t.permissions.edit){e.next=14;break}if("users"!==t.permissions.read&&"users"!==t.permissions.edit){e.next=9;break}return e.next=7,uu({path:"/visualizer/v1/get-permission-data?type=users"});case 7:n=e.sent,this.setState({users:n});case 9:if("roles"!==t.permissions.read&&"roles"!==t.permissions.edit){e.next=14;break}return e.next=12,uu({path:"/visualizer/v1/get-permission-data?type=roles"});case 12:r=e.sent,this.setState({roles:r});case 14:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"getPermissionData",value:(i=ru(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("business"!==visualizerLocalize.isPro){e.next=11;break}if("users"!==t||0!==this.state.users.length){e.next=6;break}return e.next=4,uu({path:"/visualizer/v1/get-permission-data?type=".concat(t)});case 4:n=e.sent,this.setState({users:n});case 6:if("roles"!==t||0!==this.state.roles.length){e.next=11;break}return e.next=9,uu({path:"/visualizer/v1/get-permission-data?type=".concat(t)});case 9:r=e.sent,this.setState({roles:r});case 11:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"render",value:function(){var e,t=this;return"business"===visualizerLocalize.isPro&&(e=this.props.chart["visualizer-permissions"]),wp.element.createElement(mu,null,"business"===visualizerLocalize.isPro?wp.element.createElement(_u,{title:lu("Who can see this chart?"),initialOpen:!1},wp.element.createElement(fu,{label:lu("Select who can view the chart on the front-end."),value:e.permissions.read,options:[{value:"all",label:"All Users"},{value:"users",label:"Select Users"},{value:"roles",label:"Select Roles"}],onChange:function(n){e.permissions.read=n,t.props.edit(e),"users"!==n&&"roles"!==n||t.getPermissionData(n)}}),("users"===e.permissions.read||"roles"===e.permissions.read)&&wp.element.createElement(fu,{multiple:!0,value:e.permissions["read-specific"],options:"users"===e.permissions.read&&this.state.users||"roles"===e.permissions.read&&this.state.roles,onChange:function(n){e.permissions["read-specific"]=n,t.props.edit(e)}})):wp.element.createElement(_u,{title:lu("Who can see this chart?"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,lu("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(hu,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},lu("Buy Now"))),"business"===visualizerLocalize.isPro?wp.element.createElement(_u,{title:lu("Who can edit this chart?"),initialOpen:!1},wp.element.createElement(fu,{label:lu("Select who can edit the chart on the front-end."),value:e.permissions.edit,options:[{value:"all",label:"All Users"},{value:"users",label:"Select Users"},{value:"roles",label:"Select Roles"}],onChange:function(n){e.permissions.edit=n,t.props.edit(e),"users"!==n&&"roles"!==n||t.getPermissionData(n)}}),("users"===e.permissions.edit||"roles"===e.permissions.edit)&&wp.element.createElement(fu,{multiple:!0,value:e.permissions["edit-specific"],options:"users"===e.permissions.edit&&this.state.users||"roles"===e.permissions.edit&&this.state.roles,onChange:function(n){e.permissions["edit-specific"]=n,t.props.edit(e)}})):wp.element.createElement(_u,{title:lu("Who can edit this chart?"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,lu("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(hu,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},lu("Buy Now"))))}}])&&au(n.prototype,r),a&&au(n,a),t}(du),gu=n(134),bu=n.n(gu),vu=wp.components,Mu=vu.Button,wu=vu.Dashicon,ku=vu.G,Lu=vu.Path,Yu=vu.SVG;var Du=function(e){var t=e.label,n=e.icon,r=e.className,a=e.isBack,i=e.onClick,o=bu()("components-panel__body","components-panel__body-button",r,{"visualizer-panel-back":a});return wp.element.createElement("div",{className:o},wp.element.createElement("h2",{className:"components-panel__body-title"},wp.element.createElement(Mu,{className:"components-panel__body-toggle",onClick:i},wp.element.createElement(Yu,{className:"components-panel__arrow",width:"24px",height:"24px",viewBox:"-12 -12 48 48",xmlns:"http://www.w3.org/2000/svg"},wp.element.createElement(ku,null,wp.element.createElement(Lu,{fill:"none",d:"M0,0h24v24H0V0z"})),wp.element.createElement(ku,null,wp.element.createElement(Lu,{d:"M7.41,8.59L12,13.17l4.59-4.58L18,10l-6,6l-6-6L7.41,8.59z"}))),n&&wp.element.createElement(wu,{icon:n,className:"components-panel__icon"}),t)))},Tu=n(3),Su=n.n(Tu);function Ou(e){return(Ou="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ju(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function xu(e,t){return!t||"object"!==Ou(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Eu(e){return(Eu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Cu(e,t){return(Cu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Hu=lodash.startCase,Pu=wp.i18n.__,zu=wp.element,Au=zu.Component,Nu=zu.Fragment,Fu=(wp.blockEditor||wp.editor).InspectorControls,Ru=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=xu(this,Eu(t).apply(this,arguments))).state={route:"home"},e}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Cu(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e,t,n=this,r=U(JSON.parse(JSON.stringify(this.props.chart)));return e=0<=["gauge","table","timeline","dataTable"].indexOf(this.props.chart["visualizer-chart-type"])?"dataTable"===r["visualizer-chart-type"]?r["visualizer-chart-type"]:Hu(this.props.chart["visualizer-chart-type"]):"".concat(Hu(this.props.chart["visualizer-chart-type"]),"Chart"),r["visualizer-data-exploded"]&&(t=Pu("Annotations in this chart may not display here but they will display in the front end.")),wp.element.createElement(Nu,null,"home"===this.state.route&&wp.element.createElement(Fu,null,wp.element.createElement(Se,{chart:this.props.chart,readUploadedFile:this.props.readUploadedFile}),wp.element.createElement(dt,{id:this.props.id,chart:this.props.chart,editURL:this.props.editURL,isLoading:this.props.isLoading,uploadData:this.props.uploadData,editSchedule:this.props.editSchedule,editJSONSchedule:this.props.editJSONSchedule,editJSONURL:this.props.editJSONURL,editJSONHeaders:this.props.editJSONHeaders,editJSONRoot:this.props.editJSONRoot,editJSONPaging:this.props.editJSONPaging,JSONImportData:this.props.JSONImportData}),wp.element.createElement(Ot,{getChartData:this.props.getChartData,isLoading:this.props.isLoading}),wp.element.createElement(rn,{chart:this.props.chart,editSchedule:this.props.editDatabaseSchedule,databaseImportData:this.props.databaseImportData}),wp.element.createElement(jn,{chart:this.props.chart,editChartData:this.props.editChartData}),wp.element.createElement(Du,{label:Pu("Advanced Options"),icon:"admin-tools",onClick:function(){return n.setState({route:"showAdvanced"})}}),wp.element.createElement(Du,{label:Pu("Chart Permissions"),icon:"admin-users",onClick:function(){return n.setState({route:"showPermissions"})}})),("showAdvanced"===this.state.route||"showPermissions"===this.state.route)&&wp.element.createElement(Fu,null,wp.element.createElement(Du,{label:Pu("Chart Settings"),onClick:function(){return n.setState({route:"home"})},isBack:!0}),"showAdvanced"===this.state.route&&wp.element.createElement(eu,{chart:this.props.chart,edit:this.props.editSettings}),"showPermissions"===this.state.route&&wp.element.createElement(yu,{chart:this.props.chart,edit:this.props.editPermissions})),wp.element.createElement("div",{className:"visualizer-settings__chart"},null!==this.props.chart&&"dataTable"===e?wp.element.createElement(R,{id:this.props.id,rows:r["visualizer-data"],columns:r["visualizer-series"],options:r["visualizer-settings"]}):(r["visualizer-data-exploded"],wp.element.createElement(O,{chartType:e,rows:r["visualizer-data"],columns:r["visualizer-series"],options:$(this.props.chart["visualizer-settings"].manual)?Su()(V(this.props.chart["visualizer-settings"]),JSON.parse(this.props.chart["visualizer-settings"].manual)):V(this.props.chart["visualizer-settings"]),height:"500px"})),wp.element.createElement("div",{className:"visualizer-settings__charts-footer"},wp.element.createElement("sub",null,t))))}}])&&ju(n.prototype,r),a&&ju(n,a),t}(Au);function Wu(e){return(Wu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Iu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Bu(e,t){return!t||"object"!==Wu(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ju(e){return(Ju=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Uu(e,t){return(Uu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var qu=lodash.startCase,Vu=wp.i18n.__,Gu=wp.element,$u=Gu.Component,Ku=Gu.Fragment,Zu=wp.components,Qu=Zu.Button,Xu=Zu.Dashicon,ec=Zu.Toolbar,tc=Zu.Tooltip,nc=(wp.blockEditor||wp.editor).BlockControls,rc=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Bu(this,Ju(t).apply(this,arguments))}var n,r,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Uu(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e,t,n=U(JSON.parse(JSON.stringify(this.props.chart)));return e=0<=["gauge","table","timeline","dataTable"].indexOf(this.props.chart["visualizer-chart-type"])?"dataTable"===n["visualizer-chart-type"]?n["visualizer-chart-type"]:qu(this.props.chart["visualizer-chart-type"]):"".concat(qu(this.props.chart["visualizer-chart-type"]),"Chart"),n["visualizer-data-exploded"]&&(t=Vu("Annotations in this chart may not display here but they will display in the front end.")),wp.element.createElement("div",{className:this.props.className},null!==this.props.chart&&wp.element.createElement(Ku,null,wp.element.createElement(nc,{key:"toolbar-controls"},wp.element.createElement(ec,{className:"components-toolbar"},wp.element.createElement(tc,{text:Vu("Edit Chart")},wp.element.createElement(Qu,{className:"components-icon-button components-toolbar__control edit-pie-chart",onClick:this.props.editChart},wp.element.createElement(Xu,{icon:"edit"}))))),"dataTable"===e?wp.element.createElement(R,{id:this.props.id,rows:n["visualizer-data"],columns:n["visualizer-series"],options:n["visualizer-settings"]}):(n["visualizer-data-exploded"],wp.element.createElement(O,{chartType:e,rows:n["visualizer-data"],columns:n["visualizer-series"],options:$(this.props.chart["visualizer-settings"].manual)?Su()(V(this.props.chart["visualizer-settings"]),JSON.parse(this.props.chart["visualizer-settings"].manual)):V(this.props.chart["visualizer-settings"]),height:"500px"})),wp.element.createElement("div",{className:"visualizer-settings__charts-footer"},wp.element.createElement("sub",null,t))))}}])&&Iu(n.prototype,r),a&&Iu(n,a),t}($u);function ac(e){return(ac="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ic(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ic(n,!0).forEach((function(t){sc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ic(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function sc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lc(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function uc(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){lc(i,r,a,o,s,"next",e)}function s(e){lc(i,r,a,o,s,"throw",e)}o(void 0)}))}}function cc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function dc(e){return(dc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function mc(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pc(e,t){return(pc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var hc=wp.i18n.__,_c=wp,fc=_c.apiFetch,yc=_c.apiRequest,gc=wp.element,bc=gc.Component,vc=gc.Fragment,Mc=wp.components,wc=Mc.Button,kc=Mc.ButtonGroup,Lc=Mc.Dashicon,Yc=Mc.Placeholder,Dc=Mc.Spinner,Tc=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==ac(t)&&"function"!=typeof t?mc(e):t}(this,dc(t).apply(this,arguments))).getChart=e.getChart.bind(mc(e)),e.editChart=e.editChart.bind(mc(e)),e.editSettings=e.editSettings.bind(mc(e)),e.editPermissions=e.editPermissions.bind(mc(e)),e.readUploadedFile=e.readUploadedFile.bind(mc(e)),e.editURL=e.editURL.bind(mc(e)),e.editSchedule=e.editSchedule.bind(mc(e)),e.editJSONSchedule=e.editJSONSchedule.bind(mc(e)),e.editJSONURL=e.editJSONURL.bind(mc(e)),e.editJSONHeaders=e.editJSONHeaders.bind(mc(e)),e.editJSONRoot=e.editJSONRoot.bind(mc(e)),e.editJSONPaging=e.editJSONPaging.bind(mc(e)),e.JSONImportData=e.JSONImportData.bind(mc(e)),e.editDatabaseSchedule=e.editDatabaseSchedule.bind(mc(e)),e.databaseImportData=e.databaseImportData.bind(mc(e)),e.uploadData=e.uploadData.bind(mc(e)),e.getChartData=e.getChartData.bind(mc(e)),e.editChartData=e.editChartData.bind(mc(e)),e.updateChart=e.updateChart.bind(mc(e)),e.state={route:e.props.attributes.route?e.props.attributes.route:"home",chart:null,isModified:!1,isLoading:!1,isScheduled:!1},e}var n,r,a,i,o,s;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&pc(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:(s=uc(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.props.attributes.id){e.next=5;break}return e.next=3,fc({path:"wp/v2/visualizer/".concat(this.props.attributes.id)});case 3:t=e.sent,this.setState({chart:t.chart_data});case 5:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"getChart",value:(o=uc(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setState({isLoading:"getChart"});case 2:return e.next=4,fc({path:"wp/v2/visualizer/".concat(t)});case 4:n=e.sent,this.setState({route:"chartSelect",chart:n.chart_data,isLoading:!1}),this.props.setAttributes({id:t,route:"chartSelect"});case 7:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"editChart",value:function(){this.setState({route:"chartSelect"}),this.props.setAttributes({route:"chartSelect"})}},{key:"editSettings",value:function(e){var t=oc({},this.state.chart);t["visualizer-settings"]=e,this.setState({chart:t,isModified:!0})}},{key:"editPermissions",value:function(e){var t=oc({},this.state.chart);t["visualizer-permissions"]=e,this.setState({chart:t,isModified:!0})}},{key:"readUploadedFile",value:function(e){var t=this,n=e.current.files[0],r=new FileReader;r.onload=function(){var e=function(e,t){t=t||",";for(var n=new RegExp("(\\"+t+"|\\r?\\n|\\r|^)(?:'([^']*(?:''[^']*)*)'|([^'\\"+t+"\\r\\n]*))","gi"),r=[[]],a=null;a=n.exec(e);){var i=a[1];i.length&&i!==t&&r.push([]);var o=void 0;o=a[2]?a[2].replace(new RegExp("''","g"),"'"):a[3],r[r.length-1].push(o)}return r}(r.result);t.editChartData(e,"Visualizer_Source_Csv")},r.readAsText(n)}},{key:"editURL",value:function(e){var t=oc({},this.state.chart);t["visualizer-chart-url"]=e,this.setState({chart:t})}},{key:"editSchedule",value:function(e){var t=oc({},this.state.chart);t["visualizer-chart-schedule"]=e,this.setState({chart:t,isModified:!0})}},{key:"editJSONSchedule",value:function(e){var t=oc({},this.state.chart);t["visualizer-json-schedule"]=e,this.setState({chart:t,isModified:!0})}},{key:"editJSONURL",value:function(e){var t=oc({},this.state.chart);t["visualizer-json-url"]=e,this.setState({chart:t})}},{key:"editJSONHeaders",value:function(e){var t=oc({},this.state.chart);delete e.username,delete e.password,t["visualizer-json-headers"]=e,this.setState({chart:t})}},{key:"editJSONRoot",value:function(e){var t=oc({},this.state.chart);t["visualizer-json-root"]=e,this.setState({chart:t})}},{key:"editJSONPaging",value:function(e){var t=oc({},this.state.chart);t["visualizer-json-paging"]=e,this.setState({chart:t})}},{key:"JSONImportData",value:function(e,t,n){var r=oc({},this.state.chart);r["visualizer-source"]=e,r["visualizer-default-data"]=0,r["visualizer-series"]=t,r["visualizer-data"]=n,this.setState({chart:r,isModified:!0})}},{key:"editDatabaseSchedule",value:function(e){var t=oc({},this.state.chart);t["visualizer-db-schedule"]=e,this.setState({chart:t,isModified:!0})}},{key:"databaseImportData",value:function(e,t,n,r){var a=oc({},this.state.chart);a["visualizer-source"]=t,a["visualizer-default-data"]=0,a["visualizer-series"]=n,a["visualizer-data"]=r,a["visualizer-db-query"]=e,this.setState({chart:a,isModified:!0})}},{key:"uploadData",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.setState({isLoading:"uploadData",isScheduled:t}),yc({path:"/visualizer/v1/upload-data?url=".concat(this.state.chart["visualizer-chart-url"]),method:"POST"}).then((function(t){if(2<=Object.keys(t).length){var n=oc({},e.state.chart);n["visualizer-source"]="Visualizer_Source_Csv_Remote",n["visualizer-default-data"]=0,n["visualizer-series"]=t.series,n["visualizer-data"]=t.data;var r=n["visualizer-series"],a=n["visualizer-settings"],i=r,o="series";return"pie"===n["visualizer-chart-type"]&&(i=n["visualizer-data"],o="slices"),i.map((function(e,t){if("pie"===n["visualizer-chart-type"]||0!==t){var r="pie"!==n["visualizer-chart-type"]?t-1:t;void 0===a[o][r]&&(a[o][r]={},a[o][r].temp=1)}})),a[o]=a[o].filter((function(e,t){return t<("pie"!==n["visualizer-chart-type"]?i.length-1:i.length)})),n["visualizer-settings"]=a,e.setState({chart:n,isModified:!0,isLoading:!1}),t}e.setState({isLoading:!1})}),(function(t){return e.setState({isLoading:!1}),t}))}},{key:"getChartData",value:(i=uc(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setState({isLoading:"getChartData"});case 2:return e.next=4,fc({path:"wp/v2/visualizer/".concat(t)});case 4:n=e.sent,(r=oc({},this.state.chart))["visualizer-source"]="Visualizer_Source_Csv",r["visualizer-default-data"]=0,r["visualizer-series"]=n.chart_data["visualizer-series"],r["visualizer-data"]=n.chart_data["visualizer-data"],this.setState({isLoading:!1,chart:r});case 11:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"editChartData",value:function(e,t){var n=oc({},this.state.chart),r=[],a=oc({},n["visualizer-settings"]);e[0].map((function(t,n){r[n]={label:t,type:e[1][n]}})),e.splice(0,2);var i=r,o="series";"pie"===n["visualizer-chart-type"]&&(i=e,o="slices"),i.map((function(e,t){if("pie"===n["visualizer-chart-type"]||0!==t){var r="pie"!==n["visualizer-chart-type"]?t-1:t;void 0===a[o][r]&&(a[o][r]={},a[o][r].temp=1)}})),a[o]=a[o].filter((function(e,t){return t<("pie"!==n["visualizer-chart-type"]?i.length-1:i.length)})),n["visualizer-source"]=t,n["visualizer-default-data"]=0,n["visualizer-data"]=e,n["visualizer-series"]=r,n["visualizer-settings"]=a,n["visualizer-chart-url"]="",this.setState({chart:n,isModified:!0,isScheduled:!1})}},{key:"updateChart",value:function(){var e=this;this.setState({isLoading:"updateChart"});var t=this.state.chart;!1===this.state.isScheduled&&(t["visualizer-chart-schedule"]="");var n="series";"pie"===t["visualizer-chart-type"]&&(n="slices"),Object.keys(t["visualizer-settings"][n]).map((function(e){void 0!==t["visualizer-settings"][n][e]&&void 0!==t["visualizer-settings"][n][e].temp&&delete t["visualizer-settings"][n][e].temp})),yc({path:"/visualizer/v1/update-chart?id=".concat(this.props.attributes.id),method:"POST",data:t}).then((function(t){return e.setState({isLoading:!1,isModified:!1}),t}),(function(e){return e}))}},{key:"render",value:function(){var e=this;return"renderChart"===this.state.route&&null!==this.state.chart?wp.element.createElement(rc,{id:this.props.attributes.id,chart:this.state.chart,className:this.props.className,editChart:this.editChart}):wp.element.createElement("div",{className:"visualizer-settings"},wp.element.createElement("div",{className:"visualizer-settings__title"},wp.element.createElement(Lc,{icon:"chart-pie"}),hc("Visualizer")),"home"===this.state.route&&wp.element.createElement("div",{className:"visualizer-settings__content"},wp.element.createElement("div",{className:"visualizer-settings__content-description"},hc("Make a new chart or display an existing one?")),wp.element.createElement("a",{href:visualizerLocalize.adminPage,target:"_blank",className:"visualizer-settings__content-option"},wp.element.createElement("span",{className:"visualizer-settings__content-option-title"},hc("Create a new chart")),wp.element.createElement("div",{className:"visualizer-settings__content-option-icon"},wp.element.createElement(Lc,{icon:"arrow-right-alt2"}))),wp.element.createElement("div",{className:"visualizer-settings__content-option",onClick:function(){e.setState({route:"showCharts"}),e.props.setAttributes({route:"showCharts"})}},wp.element.createElement("span",{className:"visualizer-settings__content-option-title"},hc("Display an existing chart")),wp.element.createElement("div",{className:"visualizer-settings__content-option-icon"},wp.element.createElement(Lc,{icon:"arrow-right-alt2"})))),("getChart"===this.state.isLoading||"chartSelect"===this.state.route&&null===this.state.chart||"renderChart"===this.state.route&&null===this.state.chart)&&wp.element.createElement(Yc,null,wp.element.createElement(Dc,null)),"showCharts"===this.state.route&&!1===this.state.isLoading&&wp.element.createElement(fe,{getChart:this.getChart}),"chartSelect"===this.state.route&&null!==this.state.chart&&wp.element.createElement(Ru,{id:this.props.attributes.id,chart:this.state.chart,editSettings:this.editSettings,editPermissions:this.editPermissions,url:this.state.url,readUploadedFile:this.readUploadedFile,editURL:this.editURL,editSchedule:this.editSchedule,editJSONURL:this.editJSONURL,editJSONHeaders:this.editJSONHeaders,editJSONSchedule:this.editJSONSchedule,editJSONRoot:this.editJSONRoot,editJSONPaging:this.editJSONPaging,JSONImportData:this.JSONImportData,editDatabaseSchedule:this.editDatabaseSchedule,databaseImportData:this.databaseImportData,uploadData:this.uploadData,getChartData:this.getChartData,editChartData:this.editChartData,isLoading:this.state.isLoading}),wp.element.createElement("div",{className:"visualizer-settings__controls"},("showCharts"===this.state.route||"chartSelect"===this.state.route)&&wp.element.createElement(kc,null,wp.element.createElement(wc,{isDefault:!0,isLarge:!0,onClick:function(){var t;"showCharts"===e.state.route?t="home":"chartSelect"===e.state.route&&(t="showCharts"),e.setState({route:t}),e.props.setAttributes({route:t})}},hc("Back")),"chartSelect"===this.state.route&&wp.element.createElement(vc,null,!1===this.state.isModified?wp.element.createElement(wc,{isDefault:!0,isLarge:!0,onClick:function(){e.setState({route:"renderChart"}),e.props.setAttributes({route:"renderChart"})}},hc("Done")):wp.element.createElement(wc,{isPrimary:!0,isLarge:!0,isBusy:"updateChart"===this.state.isLoading,disabled:"updateChart"===this.state.isLoading,onClick:this.updateChart},hc("Save"))))))}}])&&cc(n.prototype,r),a&&cc(n,a),t}(bc),Sc=(n(153),wp.i18n.__),Oc=wp.blocks.registerBlockType;t.default=Oc("visualizer/chart",{title:Sc("Visualizer Chart"),description:Sc("A simple, easy to use and quite powerful tool to create, manage and embed interactive charts into your WordPress posts and pages."),category:"common",icon:"chart-pie",keywords:[Sc("Visualizer"),Sc("Chart"),Sc("Google Charts")],attributes:{id:{type:"number"},route:{type:"string"}},supports:{customClassName:!1},edit:Tc,save:function(){return null}})}]);
classes/Visualizer/Gutenberg/src/Components/ChartPermissions.js CHANGED
@@ -115,7 +115,7 @@ class ChartPermissions extends Component {
115
  initialOpen={ false }
116
  >
117
 
118
- <p>{ __( 'Enable this feature in BUSINESS version!' ) }</p>
119
 
120
  <Button
121
  isPrimary
@@ -170,7 +170,7 @@ class ChartPermissions extends Component {
170
  initialOpen={ false }
171
  >
172
 
173
- <p>{ __( 'Enable this feature in BUSINESS version!' ) }</p>
174
 
175
  <Button
176
  isPrimary
115
  initialOpen={ false }
116
  >
117
 
118
+ <p>{ __( 'Upgrade your license to at least the DEVELOPER version to activate this feature!' ) }</p>
119
 
120
  <Button
121
  isPrimary
170
  initialOpen={ false }
171
  >
172
 
173
+ <p>{ __( 'Upgrade your license to at least the DEVELOPER version to activate this feature!' ) }</p>
174
 
175
  <Button
176
  isPrimary
classes/Visualizer/Gutenberg/src/Components/ChartRender.js CHANGED
@@ -28,7 +28,7 @@ const {
28
  Tooltip
29
  } = wp.components;
30
 
31
- const { BlockControls } = wp.editor;
32
 
33
  class ChartRender extends Component {
34
  constructor() {
@@ -36,7 +36,7 @@ class ChartRender extends Component {
36
  }
37
 
38
  render() {
39
- let chart;
40
 
41
  let data = formatDate( JSON.parse( JSON.stringify( this.props.chart ) ) );
42
 
@@ -50,6 +50,10 @@ class ChartRender extends Component {
50
  chart = `${ startCase( this.props.chart['visualizer-chart-type']) }Chart`;
51
  }
52
 
 
 
 
 
53
  return (
54
  <div className={ this.props.className }>
55
 
@@ -78,7 +82,7 @@ class ChartRender extends Component {
78
  columns={ data['visualizer-series'] }
79
  options={ data['visualizer-settings'] }
80
  />
81
- ) : (
82
  <Chart
83
  chartType={ chart }
84
  rows={ data['visualizer-data'] }
@@ -90,7 +94,23 @@ class ChartRender extends Component {
90
  }
91
  height="500px"
92
  />
93
- ) }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
 
95
  </Fragment>
96
  }
28
  Tooltip
29
  } = wp.components;
30
 
31
+ const { BlockControls } = wp.blockEditor || wp.editor;
32
 
33
  class ChartRender extends Component {
34
  constructor() {
36
  }
37
 
38
  render() {
39
+ let chart, footer;
40
 
41
  let data = formatDate( JSON.parse( JSON.stringify( this.props.chart ) ) );
42
 
50
  chart = `${ startCase( this.props.chart['visualizer-chart-type']) }Chart`;
51
  }
52
 
53
+ if ( data['visualizer-data-exploded']) {
54
+ footer = __( 'Annotations in this chart may not display here but they will display in the front end.' );
55
+ }
56
+
57
  return (
58
  <div className={ this.props.className }>
59
 
82
  columns={ data['visualizer-series'] }
83
  options={ data['visualizer-settings'] }
84
  />
85
+ ) : ( '' !== data['visualizer-data-exploded'] ? (
86
  <Chart
87
  chartType={ chart }
88
  rows={ data['visualizer-data'] }
94
  }
95
  height="500px"
96
  />
97
+ ) : (
98
+ <Chart
99
+ chartType={ chart }
100
+ rows={ data['visualizer-data'] }
101
+ columns={ data['visualizer-series'] }
102
+ options={
103
+ isValidJSON( this.props.chart['visualizer-settings'].manual ) ?
104
+ merge( compact( this.props.chart['visualizer-settings']), JSON.parse( this.props.chart['visualizer-settings'].manual ) ) :
105
+ compact( this.props.chart['visualizer-settings'])
106
+ }
107
+ height="500px"
108
+ />
109
+ ) ) }
110
+
111
+ <div className="visualizer-settings__charts-footer"><sub>
112
+ { footer }
113
+ </sub></div>
114
 
115
  </Fragment>
116
  }
classes/Visualizer/Gutenberg/src/Components/ChartSelect.js CHANGED
@@ -11,6 +11,8 @@ import RemoteImport from './Import/RemoteImport.js';
11
 
12
  import ChartImport from './Import/ChartImport.js';
13
 
 
 
14
  import ManualData from './Import/ManualData.js';
15
 
16
  import Sidebar from './Sidebar.js';
@@ -35,7 +37,7 @@ const {
35
  Fragment
36
  } = wp.element;
37
 
38
- const { InspectorControls } = wp.editor;
39
 
40
  class ChartSelect extends Component {
41
  constructor() {
@@ -55,7 +57,7 @@ class ChartSelect extends Component {
55
 
56
  render() {
57
 
58
- let chart;
59
 
60
  let data = formatDate( JSON.parse( JSON.stringify( this.props.chart ) ) );
61
 
@@ -69,6 +71,10 @@ class ChartSelect extends Component {
69
  chart = `${ startCase( this.props.chart['visualizer-chart-type']) }Chart`;
70
  }
71
 
 
 
 
 
72
  return (
73
  <Fragment>
74
  { 'home' === this.state.route &&
@@ -80,15 +86,28 @@ class ChartSelect extends Component {
80
  />
81
 
82
  <RemoteImport
 
83
  chart={ this.props.chart }
84
  editURL={ this.props.editURL }
85
  isLoading={ this.props.isLoading }
86
  uploadData={ this.props.uploadData }
87
  editSchedule={ this.props.editSchedule }
 
 
 
 
 
 
88
  />
89
 
90
  <ChartImport getChartData={ this.props.getChartData } isLoading={ this.props.isLoading } />
91
 
 
 
 
 
 
 
92
  <ManualData chart={ this.props.chart } editChartData={ this.props.editChartData } />
93
 
94
  <PanelButton
@@ -134,7 +153,19 @@ class ChartSelect extends Component {
134
  columns={ data['visualizer-series'] }
135
  options={ data['visualizer-settings'] }
136
  />
137
- ) : (
 
 
 
 
 
 
 
 
 
 
 
 
138
  <Chart
139
  chartType={ chart }
140
  rows={ data['visualizer-data'] }
@@ -147,7 +178,11 @@ class ChartSelect extends Component {
147
  height="500px"
148
  />
149
  )
150
- }
 
 
 
 
151
 
152
  </div>
153
  </Fragment>
11
 
12
  import ChartImport from './Import/ChartImport.js';
13
 
14
+ import DataImport from './Import/DataImport.js';
15
+
16
  import ManualData from './Import/ManualData.js';
17
 
18
  import Sidebar from './Sidebar.js';
37
  Fragment
38
  } = wp.element;
39
 
40
+ const { InspectorControls } = wp.blockEditor || wp.editor;
41
 
42
  class ChartSelect extends Component {
43
  constructor() {
57
 
58
  render() {
59
 
60
+ let chart, footer;
61
 
62
  let data = formatDate( JSON.parse( JSON.stringify( this.props.chart ) ) );
63
 
71
  chart = `${ startCase( this.props.chart['visualizer-chart-type']) }Chart`;
72
  }
73
 
74
+ if ( data['visualizer-data-exploded']) {
75
+ footer = __( 'Annotations in this chart may not display here but they will display in the front end.' );
76
+ }
77
+
78
  return (
79
  <Fragment>
80
  { 'home' === this.state.route &&
86
  />
87
 
88
  <RemoteImport
89
+ id={ this.props.id }
90
  chart={ this.props.chart }
91
  editURL={ this.props.editURL }
92
  isLoading={ this.props.isLoading }
93
  uploadData={ this.props.uploadData }
94
  editSchedule={ this.props.editSchedule }
95
+ editJSONSchedule={ this.props.editJSONSchedule }
96
+ editJSONURL={ this.props.editJSONURL }
97
+ editJSONHeaders={ this.props.editJSONHeaders }
98
+ editJSONRoot={ this.props.editJSONRoot }
99
+ editJSONPaging={ this.props.editJSONPaging }
100
+ JSONImportData={ this.props.JSONImportData }
101
  />
102
 
103
  <ChartImport getChartData={ this.props.getChartData } isLoading={ this.props.isLoading } />
104
 
105
+ <DataImport
106
+ chart={ this.props.chart }
107
+ editSchedule={ this.props.editDatabaseSchedule }
108
+ databaseImportData={ this.props.databaseImportData }
109
+ />
110
+
111
  <ManualData chart={ this.props.chart } editChartData={ this.props.editChartData } />
112
 
113
  <PanelButton
153
  columns={ data['visualizer-series'] }
154
  options={ data['visualizer-settings'] }
155
  />
156
+ ) : ( '' !== data['visualizer-data-exploded'] ? (
157
+ <Chart
158
+ chartType={ chart }
159
+ rows={ data['visualizer-data'] }
160
+ columns={ data['visualizer-series'] }
161
+ options={
162
+ isValidJSON( this.props.chart['visualizer-settings'].manual ) ?
163
+ merge( compact( this.props.chart['visualizer-settings']), JSON.parse( this.props.chart['visualizer-settings'].manual ) ) :
164
+ compact( this.props.chart['visualizer-settings'])
165
+ }
166
+ height="500px"
167
+ />
168
+ ) : (
169
  <Chart
170
  chartType={ chart }
171
  rows={ data['visualizer-data'] }
178
  height="500px"
179
  />
180
  )
181
+ ) }
182
+
183
+ <div className="visualizer-settings__charts-footer"><sub>
184
+ { footer }
185
+ </sub></div>
186
 
187
  </div>
188
  </Fragment>
classes/Visualizer/Gutenberg/src/Components/Charts.js CHANGED
@@ -96,7 +96,7 @@ class Charts extends Component {
96
  { ( Object.keys( charts ) ).map( i => {
97
  const data = formatDate( charts[i]['chart_data']);
98
 
99
- let title, chart;
100
 
101
  if ( data['visualizer-settings'].title ) {
102
  title = data['visualizer-settings'].title;
@@ -120,6 +120,10 @@ class Charts extends Component {
120
  }
121
  }
122
 
 
 
 
 
123
  return (
124
  <div className="visualizer-settings__charts-single">
125
 
@@ -135,6 +139,13 @@ class Charts extends Component {
135
  chartsScreen={ true }
136
  options={ filterCharts( data['visualizer-settings']) }
137
  />
 
 
 
 
 
 
 
138
  ) : (
139
  <Chart
140
  chartType={ chart }
@@ -142,7 +153,11 @@ class Charts extends Component {
142
  columns={ data['visualizer-series'] }
143
  options={ filterCharts( data['visualizer-settings']) }
144
  />
145
- ) }
 
 
 
 
146
 
147
  <div
148
  className="visualizer-settings__charts-controls"
96
  { ( Object.keys( charts ) ).map( i => {
97
  const data = formatDate( charts[i]['chart_data']);
98
 
99
+ let title, chart, footer;
100
 
101
  if ( data['visualizer-settings'].title ) {
102
  title = data['visualizer-settings'].title;
120
  }
121
  }
122
 
123
+ if ( data['visualizer-data-exploded']) {
124
+ footer = __( 'Annotations in this chart may not display here but they will display in the front end.' );
125
+ }
126
+
127
  return (
128
  <div className="visualizer-settings__charts-single">
129
 
139
  chartsScreen={ true }
140
  options={ filterCharts( data['visualizer-settings']) }
141
  />
142
+ ) : ( '' !== data['visualizer-data-exploded'] ? (
143
+ <Chart
144
+ chartType={ chart }
145
+ rows={ data['visualizer-data'] }
146
+ columns={ data['visualizer-series'] }
147
+ options={ filterCharts( data['visualizer-settings']) }
148
+ />
149
  ) : (
150
  <Chart
151
  chartType={ chart }
153
  columns={ data['visualizer-series'] }
154
  options={ filterCharts( data['visualizer-settings']) }
155
  />
156
+ ) ) }
157
+
158
+ <div className="visualizer-settings__charts-footer"><sub>
159
+ { footer }
160
+ </sub></div>
161
 
162
  <div
163
  className="visualizer-settings__charts-controls"
classes/Visualizer/Gutenberg/src/Components/DataTable.js CHANGED
@@ -73,7 +73,13 @@ class DataTables extends Component {
73
  const row = {};
74
 
75
  columns.forEach( ( j, n ) => {
76
- row[j.data] = i[n];
 
 
 
 
 
 
77
  });
78
 
79
  return row;
73
  const row = {};
74
 
75
  columns.forEach( ( j, n ) => {
76
+ var datum = i[n];
77
+
78
+ // datum could be undefined for dynamic data (e.g. through json).
79
+ if ( 'undefined' === typeof datum ) {
80
+ datum = i[j.data];
81
+ }
82
+ row[j.data] = datum;
83
  });
84
 
85
  return row;
classes/Visualizer/Gutenberg/src/Components/Import/ChartImport.js CHANGED
@@ -71,6 +71,7 @@ class ChartImport extends Component {
71
 
72
  <Button
73
  isPrimary
 
74
  isBusy={ 'getChartData' === this.props.isLoading }
75
  onClick={ () => this.props.getChartData( this.state.id ) }
76
  >
71
 
72
  <Button
73
  isPrimary
74
+ isLarge
75
  isBusy={ 'getChartData' === this.props.isLoading }
76
  onClick={ () => this.props.getChartData( this.state.id ) }
77
  >
classes/Visualizer/Gutenberg/src/Components/Import/DataImport.js ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ const { __ } = wp.i18n;
5
+
6
+ const { Component } = wp.element;
7
+
8
+ const {
9
+ Button,
10
+ Modal,
11
+ PanelBody,
12
+ SelectControl
13
+ } = wp.components;
14
+
15
+ /**
16
+ * Internal dependencies
17
+ */
18
+ import SQLEditor from './SQLEditor.js';
19
+
20
+ class DataImport extends Component {
21
+ constructor() {
22
+ super( ...arguments );
23
+ this.save = this.save.bind( this );
24
+
25
+ this.state = {
26
+ isOpen: false
27
+ };
28
+ }
29
+
30
+ save( query, name, series, data ) {
31
+ this.props.databaseImportData( query, name, series, data );
32
+ this.setState({ isOpen: false });
33
+ }
34
+
35
+ render() {
36
+ if ( ( 'business' !== visualizerLocalize.isPro ) ) {
37
+ return (
38
+ <PanelBody
39
+ title={ __( 'Import data from database' ) }
40
+ icon="lock"
41
+ initialOpen={ false }
42
+ >
43
+
44
+ <p>{ __( 'Upgrade your license to at least the DEVELOPER version to activate this feature!' ) }</p>
45
+
46
+ <Button
47
+ isPrimary
48
+ href={ visualizerLocalize.proTeaser }
49
+ target="_blank"
50
+ >
51
+ { __( 'Buy Now' ) }
52
+ </Button>
53
+
54
+ </PanelBody>
55
+ );
56
+ }
57
+
58
+ return (
59
+ <PanelBody
60
+ title={ __( 'Import data from database' ) }
61
+ initialOpen={ false }
62
+ >
63
+
64
+ <p>{ __( 'You can import data from the database here.' ) }</p>
65
+
66
+ <p>{ __( 'How often do you want to refresh the data from the database.' ) }</p>
67
+
68
+ <SelectControl
69
+ label={ __( 'How often do you want to check the url?' ) }
70
+ value={ this.props.chart['visualizer-db-schedule'] ? this.props.chart['visualizer-db-schedule'] : 0 }
71
+ options={ [
72
+ { label: __( 'Live' ), value: '0' },
73
+ { label: __( 'Each hour' ), value: '1' },
74
+ { label: __( 'Each 12 hours' ), value: '12' },
75
+ { label: __( 'Each day' ), value: '24' },
76
+ { label: __( 'Each 3 days' ), value: '72' }
77
+ ] }
78
+ onChange={ this.props.editSchedule }
79
+ />
80
+
81
+ <Button
82
+ isPrimary
83
+ isLarge
84
+ onClick={ () => this.setState({ isOpen: true }) }
85
+ >
86
+ { __( 'Create Query' ) }
87
+ </Button>
88
+
89
+ { this.state.isOpen && (
90
+ <Modal
91
+ title={ __( 'Import from database' ) }
92
+ onRequestClose={ () => this.setState({ isOpen: false }) }
93
+ className="visualizer-db-query-modal"
94
+ shouldCloseOnClickOutside={ false }
95
+ >
96
+ <SQLEditor
97
+ chart={ this.props.chart }
98
+ changeQuery={ this.props.changeQuery }
99
+ save={ this.save }
100
+ />
101
+ </Modal>
102
+ )}
103
+
104
+ </PanelBody>
105
+ );
106
+ }
107
+ }
108
+
109
+ export default DataImport;
classes/Visualizer/Gutenberg/src/Components/Import/JSONImport.js ADDED
@@ -0,0 +1,601 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ const { __ } = wp.i18n;
5
+
6
+ const {
7
+ apiFetch,
8
+ apiRequest
9
+ } = wp;
10
+
11
+ const { Component } = wp.element;
12
+
13
+ const {
14
+ Button,
15
+ ExternalLink,
16
+ IconButton,
17
+ Modal,
18
+ PanelBody,
19
+ SelectControl,
20
+ TextControl
21
+ } = wp.components;
22
+
23
+ class JSONImport extends Component {
24
+ constructor() {
25
+ super( ...arguments );
26
+
27
+ this.openModal = this.openModal.bind( this );
28
+ this.initTable = this.initTable.bind( this );
29
+ this.onToggle = this.onToggle.bind( this );
30
+ this.toggleHeaders = this.toggleHeaders.bind( this );
31
+ this.getJSONRoot = this.getJSONRoot.bind( this );
32
+ this.getJSONData = this.getJSONData.bind( this );
33
+ this.getTableData = this.getTableData.bind( this );
34
+
35
+ this.state = {
36
+ isOpen: false,
37
+ isLoading: false,
38
+ isFirstStepOpen: true,
39
+ isSecondStepOpen: false,
40
+ isThirdStepOpen: false,
41
+ isFourthStepOpen: false,
42
+ isHeaderPanelOpen: false,
43
+ endpointRoots: [],
44
+ endpointPaging: [],
45
+ table: null,
46
+ requestHeaders: {
47
+ method: 'GET',
48
+ username: '',
49
+ password: '',
50
+ auth: ''
51
+ }
52
+ };
53
+ }
54
+
55
+ async openModal() {
56
+ await this.setState({ isOpen: true });
57
+
58
+ const table = document.querySelector( '#visualizer-json-query-table' );
59
+
60
+ if ( this.state.isFourthStepOpen && null !== this.state.table ) {
61
+ table.innerHTML = this.state.table;
62
+ this.initTable();
63
+ }
64
+ }
65
+
66
+ initTable() {
67
+ jQuery( '#visualizer-json-query-table table' ).DataTable({
68
+ paging: false,
69
+ searching: false,
70
+ ordering: false,
71
+ select: false,
72
+ scrollX: '600px',
73
+ scrollY: '400px',
74
+ info: false,
75
+ colReorder: {
76
+ fixedColumnsLeft: 1
77
+ },
78
+ dom: 'Bt',
79
+ buttons: [
80
+ {
81
+ extend: 'colvis',
82
+ columns: ':gt(0)',
83
+ collectionLayout: 'four-column'
84
+ }
85
+ ]
86
+ });
87
+ }
88
+
89
+ async onToggle( value ) {
90
+ if ( null === this.state.table && ( this.state.endpointRoots && 0 < this.state.endpointRoots.length ) && ( 'isFirstStepOpen' === value || 'isSecondStepOpen' === value ) ) {
91
+ this.setState({
92
+ isFirstStepOpen: ( 'isFirstStepOpen' === value ? true : false ),
93
+ isSecondStepOpen: ( 'isSecondStepOpen' === value ? true : false ),
94
+ isThirdStepOpen: false,
95
+ isFourthStepOpen: false
96
+ });
97
+ }
98
+
99
+ if ( null !== this.state.table ) {
100
+ await this.setState({
101
+ isFirstStepOpen: ( 'isFirstStepOpen' === value ? true : false ),
102
+ isSecondStepOpen: ( 'isSecondStepOpen' === value ? true : false ),
103
+ isThirdStepOpen: ( 'isThirdStepOpen' === value ? true : false ),
104
+ isFourthStepOpen: ( 'isFourthStepOpen' === value ? true : false )
105
+ });
106
+
107
+ if ( 'isFourthStepOpen' === value ) {
108
+ const table = document.querySelector( '#visualizer-json-query-table' );
109
+
110
+ if ( this.state.isFourthStepOpen ) {
111
+ table.innerHTML = this.state.table;
112
+ this.initTable();
113
+ }
114
+ }
115
+ }
116
+ }
117
+
118
+ toggleHeaders() {
119
+ this.setState({ isHeaderPanelOpen: ! this.state.isHeaderPanelOpen });
120
+ }
121
+
122
+ async getJSONRoot() {
123
+ this.setState({
124
+ isLoading: true,
125
+ endpointRoots: [],
126
+ endpointPaging: [],
127
+ table: null
128
+ });
129
+
130
+ let response = await apiRequest({
131
+ path: `/visualizer/v1/get-json-root?url=${ this.props.chart['visualizer-json-url'] }`,
132
+ data: {
133
+ method: this.props.chart['visualizer-json-headers'] ? this.props.chart['visualizer-json-headers'].method : this.state.requestHeaders.method,
134
+ username: this.props.chart['visualizer-json-headers'] ?
135
+ (
136
+ 'object' === typeof this.props.chart['visualizer-json-headers'].auth ?
137
+ this.props.chart['visualizer-json-headers'].auth.username :
138
+ this.state.requestHeaders.username
139
+ ) :
140
+ this.state.requestHeaders.username,
141
+ password: this.props.chart['visualizer-json-headers'] ?
142
+ (
143
+ 'object' === typeof this.props.chart['visualizer-json-headers'].auth ?
144
+ this.props.chart['visualizer-json-headers'].auth.password :
145
+ this.state.requestHeaders.password
146
+ ) :
147
+ this.state.requestHeaders.password,
148
+ auth: this.props.chart['visualizer-json-headers'] ?
149
+ (
150
+ 'object' !== typeof this.props.chart['visualizer-json-headers'].auth ?
151
+ this.props.chart['visualizer-json-headers'].auth :
152
+ this.state.requestHeaders.auth
153
+ ) :
154
+ this.state.requestHeaders.auth
155
+ },
156
+ method: 'GET'
157
+ });
158
+
159
+ if ( response.success ) {
160
+ const roots = Object.keys( response.data.roots ).map( i => {
161
+ return {
162
+ label: response.data.roots[i].replace( />/g, ' ➤ ' ),
163
+ value: response.data.roots[i]
164
+ };
165
+ });
166
+
167
+ this.setState({
168
+ isLoading: false,
169
+ isFirstStepOpen: false,
170
+ isSecondStepOpen: true,
171
+ endpointRoots: roots
172
+ });
173
+ } else {
174
+ this.setState({ isLoading: false });
175
+ alert( response.data.msg );
176
+ }
177
+ }
178
+
179
+ async getJSONData() {
180
+ this.setState({ isLoading: true });
181
+
182
+ let response = await apiRequest({
183
+ path: `/visualizer/v1/get-json-data?url=${ this.props.chart['visualizer-json-url'] }&chart=${ this.props.id }`,
184
+ data: {
185
+ root: this.props.chart['visualizer-json-root'] || this.state.endpointRoots[0].value,
186
+ method: this.props.chart['visualizer-json-headers'] ? this.props.chart['visualizer-json-headers'].method : this.state.requestHeaders.method,
187
+ username: this.props.chart['visualizer-json-headers'] ?
188
+ (
189
+ 'object' === typeof this.props.chart['visualizer-json-headers'].auth ?
190
+ this.props.chart['visualizer-json-headers'].auth.username :
191
+ this.state.requestHeaders.username
192
+ ) :
193
+ this.state.requestHeaders.username,
194
+ password: this.props.chart['visualizer-json-headers'] ?
195
+ (
196
+ 'object' === typeof this.props.chart['visualizer-json-headers'].auth ?
197
+ this.props.chart['visualizer-json-headers'].auth.password :
198
+ this.state.requestHeaders.password
199
+ ) :
200
+ this.state.requestHeaders.password,
201
+ auth: this.props.chart['visualizer-json-headers'] ?
202
+ (
203
+ 'object' !== typeof this.props.chart['visualizer-json-headers'].auth ?
204
+ this.props.chart['visualizer-json-headers'].auth :
205
+ this.state.requestHeaders.auth
206
+ ) :
207
+ this.state.requestHeaders.auth
208
+ },
209
+ method: 'GET'
210
+ });
211
+
212
+ if ( response.success ) {
213
+ const paging = [
214
+ {
215
+ label: __( 'Don\'t use pagination' ),
216
+ value: 0
217
+ }
218
+ ];
219
+
220
+ if ( response.data.paging && 'root>next' === response.data.paging[0]) {
221
+ paging.push(
222
+ {
223
+ label: __( 'Get first 5 pages using root ➤ next' ),
224
+ value: 'root>next'
225
+ }
226
+ );
227
+ }
228
+
229
+ this.setState({
230
+ isLoading: false,
231
+ isSecondStepOpen: false,
232
+ isFourthStepOpen: true,
233
+ endpointPaging: paging,
234
+ table: response.data.table
235
+ });
236
+
237
+ const table = document.querySelector( '#visualizer-json-query-table' );
238
+ table.innerHTML = response.data.table;
239
+
240
+ this.initTable();
241
+ } else {
242
+ this.setState({ isLoading: false });
243
+ alert( response.data.msg );
244
+ }
245
+ }
246
+
247
+ async getTableData() {
248
+ this.setState({ isLoading: true });
249
+
250
+ const columns = document.querySelectorAll( '#visualizer-json-query-table input' );
251
+ const select = document.querySelectorAll( '#visualizer-json-query-table select' );
252
+ const header = [];
253
+ const type = {};
254
+
255
+ columns.forEach( column => header.push( column.value ) );
256
+ select.forEach( el => type[el.name] = el.value );
257
+
258
+ let response = await apiRequest({
259
+ path: '/visualizer/v1/set-json-data',
260
+ data: {
261
+ url: this.props.chart['visualizer-json-url'],
262
+ method: this.props.chart['visualizer-json-headers'] ? this.props.chart['visualizer-json-headers'].method : this.state.requestHeaders.method,
263
+ username: this.props.chart['visualizer-json-headers'] ?
264
+ (
265
+ 'object' === typeof this.props.chart['visualizer-json-headers'].auth ?
266
+ this.props.chart['visualizer-json-headers'].auth.username :
267
+ this.state.requestHeaders.username
268
+ ) :
269
+ this.state.requestHeaders.username,
270
+ password: this.props.chart['visualizer-json-headers'] ?
271
+ (
272
+ 'object' === typeof this.props.chart['visualizer-json-headers'].auth ?
273
+ this.props.chart['visualizer-json-headers'].auth.password :
274
+ this.state.requestHeaders.password
275
+ ) :
276
+ this.state.requestHeaders.password,
277
+ auth: this.props.chart['visualizer-json-headers'] ?
278
+ (
279
+ 'object' !== typeof this.props.chart['visualizer-json-headers'].auth ?
280
+ this.props.chart['visualizer-json-headers'].auth :
281
+ this.state.requestHeaders.auth
282
+ ) :
283
+ this.state.requestHeaders.auth,
284
+ root: this.props.chart['visualizer-json-root'] || this.state.endpointRoots[0].value,
285
+ paging: this.props.chart['visualizer-json-paging'] || 0,
286
+ header,
287
+ ...type
288
+ },
289
+ method: 'GET'
290
+ });
291
+
292
+ if ( response.success ) {
293
+ this.props.JSONImportData( response.data.name, JSON.parse( response.data.series ), JSON.parse( response.data.data ) );
294
+
295
+ this.setState({
296
+ isOpen: false,
297
+ isLoading: false
298
+ });
299
+ } else {
300
+ alert( response.data.msg );
301
+
302
+ this.setState({ isLoading: false });
303
+ }
304
+ }
305
+
306
+ render() {
307
+ return (
308
+ <PanelBody
309
+ title={ __( 'Import from JSON' ) }
310
+ className="visualizer-inner-sections"
311
+ initialOpen={ false }
312
+ >
313
+ <p>{ __( 'You can choose here to import or synchronize your chart data with a remote JSON source.' ) }</p>
314
+
315
+ <p>
316
+ <ExternalLink href="https://docs.themeisle.com/article/1052-how-to-generate-charts-from-json-data-rest-endpoints">
317
+ { __( 'For more info check this tutorial.' ) }
318
+ </ExternalLink>
319
+ </p>
320
+
321
+ <SelectControl
322
+ label={ __( 'How often do you want to check the url?' ) }
323
+ value={ this.props.chart['visualizer-json-schedule'] ? this.props.chart['visualizer-json-schedule'] : 1 }
324
+ options={ [
325
+ { label: __( 'One-time' ), value: '-1' },
326
+ { label: __( 'Live' ), value: '0' },
327
+ { label: __( 'Each hour' ), value: '1' },
328
+ { label: __( 'Each 12 hours' ), value: '12' },
329
+ { label: __( 'Each day' ), value: '24' },
330
+ { label: __( 'Each 3 days' ), value: '72' }
331
+ ] }
332
+ onChange={ this.props.editSchedule }
333
+ />
334
+
335
+ <Button
336
+ isPrimary
337
+ isLarge
338
+ onClick={ this.openModal }
339
+ >
340
+ { __( 'Modify Parameters' ) }
341
+ </Button>
342
+
343
+ { this.state.isOpen && (
344
+ <Modal
345
+ title={ __( 'Import from JSON' ) }
346
+ className="visualizer-json-query-modal"
347
+ shouldCloseOnClickOutside={ false }
348
+ onRequestClose={ () => {
349
+ this.setState({
350
+ isOpen: false,
351
+ isTableRendered: false
352
+ });
353
+ } }
354
+ >
355
+ <PanelBody
356
+ title={ __( 'Step 1: Specify the JSON endpoint/URL' ) }
357
+ opened={ this.state.isFirstStepOpen }
358
+ onToggle={ () => this.onToggle( 'isFirstStepOpen' ) }
359
+ >
360
+ <p>{ __( 'If you want to add authentication, add headers to the endpoint or change the request in any way, please refer to our document here:' ) }</p>
361
+
362
+ <p>
363
+ <ExternalLink href="https://docs.themeisle.com/article/1043-visualizer-how-to-extend-rest-endpoints-with-json-response">
364
+ { __( 'How to extend REST endpoints with JSON response' ) }
365
+ </ExternalLink>
366
+ </p>
367
+
368
+ <TextControl
369
+ placeholder={ __( 'Please enter the URL of your JSON file' ) }
370
+ value={ this.props.chart['visualizer-json-url'] ? this.props.chart['visualizer-json-url'] : '' }
371
+ onChange={ this.props.editJSONURL }
372
+ />
373
+
374
+ <IconButton
375
+ icon="arrow-right-alt2"
376
+ label={ __( 'Add Headers' ) }
377
+ onClick={ this.toggleHeaders }
378
+ >
379
+ { __( 'Add Headers' ) }
380
+ </IconButton>
381
+
382
+ { this.state.isHeaderPanelOpen && (
383
+ <div className="visualizer-json-query-modal-headers-panel">
384
+ <SelectControl
385
+ label={ __( 'Request Type' ) }
386
+ value={ this.props.chart['visualizer-json-headers'] ? this.props.chart['visualizer-json-headers'].method : this.state.requestHeaders.method }
387
+ options={ [
388
+ {
389
+ value: 'GET',
390
+ label: __( 'GET' )
391
+ },
392
+ {
393
+ value: 'POST',
394
+ label: __( 'POST' )
395
+ }
396
+ ] }
397
+ onChange={ e => {
398
+ let headers = { ...this.state.requestHeaders };
399
+ let headersState = this.state.requestHeaders;
400
+ headers.method = e;
401
+ headersState = {
402
+ ...headersState,
403
+ method: e
404
+ };
405
+ this.setState({ requestHeaders: headersState });
406
+ this.props.editJSONHeaders( headers );
407
+ } }
408
+ />
409
+
410
+ <p>{ __( 'Credentials' ) }</p>
411
+
412
+ <TextControl
413
+ label={ __( 'Username' ) }
414
+ placeholder={ __( 'Username/Access Key' ) }
415
+ value={
416
+ this.props.chart['visualizer-json-headers'] ?
417
+ (
418
+ 'object' === typeof this.props.chart['visualizer-json-headers'].auth ?
419
+ this.props.chart['visualizer-json-headers'].auth.username :
420
+ this.state.requestHeaders.username
421
+ ) :
422
+ this.state.requestHeaders.username
423
+ }
424
+ onChange={ e => {
425
+ let headers = { ...this.state.requestHeaders };
426
+ let headersState = this.state.requestHeaders;
427
+ headers.auth = {
428
+ username: e,
429
+ password: this.props.chart['visualizer-json-headers'] ?
430
+ (
431
+ 'object' === typeof this.props.chart['visualizer-json-headers'].auth ?
432
+ this.props.chart['visualizer-json-headers'].auth.password :
433
+ this.state.requestHeaders.password
434
+ ) :
435
+ this.state.requestHeaders.password
436
+ };
437
+ headersState = {
438
+ ...headersState,
439
+ username: e,
440
+ password: headers.password
441
+ };
442
+ this.setState({ requestHeaders: headersState });
443
+ this.props.editJSONHeaders( headers );
444
+ } }
445
+ />
446
+
447
+ <span className="visualizer-json-query-modal-field-separator" >{ __( '&' ) }</span>
448
+
449
+ <TextControl
450
+ label={ __( 'Password' ) }
451
+ placeholder={ __( 'Password/Secret Key' ) }
452
+ type="password"
453
+ value={
454
+ this.props.chart['visualizer-json-headers'] ?
455
+ (
456
+ 'object' === typeof this.props.chart['visualizer-json-headers'].auth ?
457
+ this.props.chart['visualizer-json-headers'].auth.password :
458
+ this.state.requestHeaders.password
459
+ ) :
460
+ this.state.requestHeaders.password
461
+ }
462
+ onChange={ e => {
463
+ let headers = { ...this.state.requestHeaders };
464
+ let headersState = this.state.requestHeaders;
465
+ headers.auth = {
466
+ username: this.props.chart['visualizer-json-headers'] ?
467
+ (
468
+ 'object' === typeof this.props.chart['visualizer-json-headers'].auth ?
469
+ this.props.chart['visualizer-json-headers'].auth.username :
470
+ this.state.requestHeaders.username
471
+ ) :
472
+ this.state.requestHeaders.username,
473
+ password: e
474
+ };
475
+ headersState = {
476
+ ...headersState,
477
+ username: headers.username,
478
+ password: e
479
+ };
480
+ this.setState({ requestHeaders: headersState });
481
+ this.props.editJSONHeaders( headers );
482
+ } }
483
+ />
484
+
485
+ <p>{ __( 'OR' ) }</p>
486
+
487
+ <TextControl
488
+ label={ __( 'Authorization' ) }
489
+ placeholder={ __( 'e.g. SharedKey <AccountName>:<Signature>' ) }
490
+ value={
491
+ this.props.chart['visualizer-json-headers'] ?
492
+ (
493
+ 'object' !== typeof this.props.chart['visualizer-json-headers'].auth ?
494
+ this.props.chart['visualizer-json-headers'].auth :
495
+ this.state.requestHeaders.auth
496
+ ) :
497
+ this.state.requestHeaders.auth
498
+ }
499
+ onChange={ e => {
500
+ let headers = { ...this.state.requestHeaders };
501
+ let headersState = this.state.requestHeaders;
502
+ headers.auth = e;
503
+ headersState = {
504
+ ...headersState,
505
+ auth: e
506
+ };
507
+ this.setState({ requestHeaders: headersState });
508
+ this.props.editJSONHeaders( headers );
509
+ } }
510
+ />
511
+ </div>
512
+ ) }
513
+
514
+ <Button
515
+ isPrimary
516
+ isLarge
517
+ isBusy={ this.state.isLoading }
518
+ disabled={ this.state.isLoading }
519
+ onClick={ this.getJSONRoot }
520
+ >
521
+ { __( 'Fetch Endpoint' ) }
522
+ </Button>
523
+ </PanelBody>
524
+
525
+ <PanelBody
526
+ title={ __( 'Step 2: Choose the JSON root' ) }
527
+ initialOpen={ false }
528
+ opened={ this.state.isSecondStepOpen }
529
+ onToggle={ () => this.onToggle( 'isSecondStepOpen' ) }
530
+ >
531
+
532
+ <p>{ __( 'If you see Invalid Data, you may have selected the wrong root to fetch data from. Please select an alternative.' ) }</p>
533
+
534
+ <SelectControl
535
+ value={ this.props.chart['visualizer-json-root'] }
536
+ options={ this.state.endpointRoots }
537
+ onChange={ this.props.editJSONRoot }
538
+ />
539
+
540
+ <Button
541
+ isPrimary
542
+ isLarge
543
+ isBusy={ this.state.isLoading }
544
+ disabled={ this.state.isLoading }
545
+ onClick={ this.getJSONData }
546
+ >
547
+ { __( 'Parse Endpoint' ) }
548
+ </Button>
549
+ </PanelBody>
550
+
551
+ <PanelBody
552
+ title={ __( 'Step 3: Specify miscellaneous parameters' ) }
553
+ initialOpen={ false }
554
+ opened={ this.state.isThirdStepOpen }
555
+ onToggle={ () => this.onToggle( 'isThirdStepOpen' ) }
556
+ >
557
+ { ( 'community' !== visualizerLocalize.isPro ) ? (
558
+ <SelectControl
559
+ value={ this.props.chart['visualizer-json-paging'] || 0 }
560
+ options={ this.state.endpointPaging }
561
+ onChange={ this.props.editJSONPaging }
562
+ />
563
+ ) : (
564
+ <p>{ __( 'Enable this feature in PRO version!' ) }</p>
565
+ ) }
566
+ </PanelBody>
567
+
568
+ <PanelBody
569
+ title={ __( 'Step 4: Select the data to display in the chart' ) }
570
+ initialOpen={ false }
571
+ opened={ this.state.isFourthStepOpen }
572
+ onToggle={ () => this.onToggle( 'isFourthStepOpen' ) }
573
+ >
574
+ <ul>
575
+ <li>{ __( 'Select whether to include the data in the chart. Each column selected will form one series.' ) }</li>
576
+ <li>{ __( 'If a column is selected to be included, specify its data type.' ) }</li>
577
+ <li>{ __( 'You can use drag/drop to reorder the columns but this column position is not saved. So when you reload the table, you may have to reorder again.' ) }</li>
578
+ <li>{ __( 'You can select any number of columns but the chart type selected will determine how many will display in the chart.' ) }</li>
579
+ </ul>
580
+
581
+ <div id="visualizer-json-query-table"></div>
582
+
583
+ <Button
584
+ isPrimary
585
+ isLarge
586
+ isBusy={ this.state.isLoading }
587
+ disabled={ this.state.isLoading }
588
+ onClick={ this.getTableData }
589
+ >
590
+ { __( 'Save & Show Chart' ) }
591
+ </Button>
592
+ </PanelBody>
593
+ </Modal>
594
+ )}
595
+
596
+ </PanelBody>
597
+ );
598
+ }
599
+ }
600
+
601
+ export default JSONImport;
classes/Visualizer/Gutenberg/src/Components/Import/RemoteImport.js CHANGED
@@ -13,6 +13,11 @@ const {
13
  TextControl
14
  } = wp.components;
15
 
 
 
 
 
 
16
  class RemoteImport extends Component {
17
  constructor() {
18
  super( ...arguments );
@@ -106,7 +111,7 @@ class RemoteImport extends Component {
106
  initialOpen={ false }
107
  >
108
 
109
- <p>{ __( 'Enable this feature in BUSINESS version!' ) }</p>
110
 
111
  <Button
112
  isPrimary
@@ -119,6 +124,17 @@ class RemoteImport extends Component {
119
  </PanelBody>
120
  }
121
 
 
 
 
 
 
 
 
 
 
 
 
122
  </PanelBody>
123
  );
124
  }
13
  TextControl
14
  } = wp.components;
15
 
16
+ /**
17
+ * Internal dependencies
18
+ */
19
+ import JSONImport from './JSONImport.js';
20
+
21
  class RemoteImport extends Component {
22
  constructor() {
23
  super( ...arguments );
111
  initialOpen={ false }
112
  >
113
 
114
+ <p>{ __( 'Upgrade your license to at least the DEVELOPER version to activate this feature!' ) }</p>
115
 
116
  <Button
117
  isPrimary
124
  </PanelBody>
125
  }
126
 
127
+ <JSONImport
128
+ id={ this.props.id }
129
+ chart={ this.props.chart }
130
+ editSchedule={ this.props.editJSONSchedule }
131
+ editJSONURL={ this.props.editJSONURL }
132
+ editJSONHeaders={ this.props.editJSONHeaders }
133
+ editJSONRoot={ this.props.editJSONRoot }
134
+ editJSONPaging={ this.props.editJSONPaging }
135
+ JSONImportData={ this.props.JSONImportData }
136
+ />
137
+
138
  </PanelBody>
139
  );
140
  }
classes/Visualizer/Gutenberg/src/Components/Import/SQLEditor.js ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ const { __ } = wp.i18n;
5
+
6
+ const { apiRequest } = wp;
7
+
8
+ const {
9
+ Button,
10
+ ExternalLink
11
+ } = wp.components;
12
+
13
+ const {
14
+ Component,
15
+ Fragment
16
+ } = wp.element;
17
+
18
+
19
+ class SQLEditor extends Component {
20
+ constructor() {
21
+ super( ...arguments );
22
+
23
+ this.onSave = this.onSave.bind( this );
24
+
25
+ this.state = {
26
+ isLoading: false,
27
+ success: false,
28
+ query: '',
29
+ name: '',
30
+ series: {},
31
+ data: []
32
+ };
33
+ }
34
+
35
+ componentDidMount() {
36
+ const editor = wp.CodeMirror || CodeMirror;
37
+ const textarea = document.querySelector( '.visualizer-db-query' );
38
+ const cm = editor.fromTextArea( textarea, {
39
+ autofocus: true,
40
+ mode: 'text/x-mysql',
41
+ lineWrapping: true,
42
+ dragDrop: false,
43
+ matchBrackets: true,
44
+ autoCloseBrackets: true,
45
+ extraKeys: { 'Ctrl-Space': 'autocomplete' },
46
+ hintOptions: { tables: visualizerLocalize.sqlTable }
47
+ });
48
+
49
+ cm.on( 'inputRead', () => {
50
+ cm.save();
51
+ });
52
+ }
53
+
54
+ async onSave() {
55
+ const textarea = document.querySelector( '.visualizer-db-query' ).value;
56
+ const result = document.querySelector( '#visualizer-db-query-table' );
57
+ result.innerHTML = '';
58
+
59
+ await this.setState({ isLoading: true });
60
+
61
+ let response = await apiRequest({
62
+ path: '/visualizer/v1/get-query-data',
63
+ data: {
64
+ query: textarea
65
+ },
66
+ method: 'GET'
67
+ });
68
+
69
+ await this.setState({
70
+ isLoading: false,
71
+ success: response.success,
72
+ query: textarea,
73
+ name: response.data.name || '',
74
+ series: response.data.series || {},
75
+ data: response.data.data || []
76
+ });
77
+
78
+ result.innerHTML = response.data.table || response.data.msg;
79
+
80
+ if ( this.state.success ) {
81
+ jQuery( '#results' ).DataTable({
82
+ paging: false
83
+ });
84
+ }
85
+ }
86
+
87
+ render() {
88
+ return (
89
+ <Fragment>
90
+ <textarea
91
+ className="visualizer-db-query"
92
+ placeholder={ __( 'Your query goes here…' ) }
93
+ >
94
+ { this.props.chart['visualizer-db-query'] }
95
+ </textarea>
96
+
97
+ <div className="visualizer-db-query-actions">
98
+ <Button
99
+ isLarge
100
+ isDefault
101
+ isBusy={ this.state.isLoading }
102
+ onClick={ this.onSave }
103
+ >
104
+ { __( 'Show Results' ) }
105
+ </Button>
106
+
107
+ <Button
108
+ isLarge
109
+ isPrimary
110
+ disabled={ ! this.state.success }
111
+ onClick={ () => this.props.save( this.state.query, this.state.name, this.state.series, this.state.data ) }
112
+ >
113
+ { __( 'Save' ) }
114
+ </Button>
115
+ </div>
116
+
117
+ <ul>
118
+ <li>
119
+ <ExternalLink href="https://docs.themeisle.com/article/970-visualizer-sample-queries-to-generate-charts">
120
+ { __( 'Examples of queries and links to resources that you can use with this feature.' ) }
121
+ </ExternalLink>
122
+ </li>
123
+ <li>{ __( 'Use Control+Space for autocompleting keywords or table names.' ) }</li>
124
+ </ul>
125
+
126
+ <div
127
+ id="visualizer-db-query-table"
128
+ className={ ! this.state.success && 'db-wizard-error' }
129
+ >
130
+ </div>
131
+ </Fragment>
132
+ );
133
+ }
134
+ }
135
+
136
+ export default SQLEditor;
classes/Visualizer/Gutenberg/src/Components/Sidebar/CandlesSettings.js CHANGED
@@ -5,7 +5,7 @@ const { __ } = wp.i18n;
5
 
6
  const { Component } = wp.element;
7
 
8
- const { ColorPalette } = wp.editor;
9
 
10
  const {
11
  BaseControl,
5
 
6
  const { Component } = wp.element;
7
 
8
+ const { ColorPalette } = wp.blockEditor || wp.editor;
9
 
10
  const {
11
  BaseControl,
classes/Visualizer/Gutenberg/src/Components/Sidebar/ColorAxis.js CHANGED
@@ -5,7 +5,7 @@ const { __ } = wp.i18n;
5
 
6
  const { Component } = wp.element;
7
 
8
- const { ColorPalette } = wp.editor;
9
 
10
  const {
11
  BaseControl,
5
 
6
  const { Component } = wp.element;
7
 
8
+ const { ColorPalette } = wp.blockEditor || wp.editor;
9
 
10
  const {
11
  BaseControl,
classes/Visualizer/Gutenberg/src/Components/Sidebar/GaugeSettings.js CHANGED
@@ -8,7 +8,7 @@ const {
8
  Fragment
9
  } = wp.element;
10
 
11
- const { ColorPalette } = wp.editor;
12
 
13
  const {
14
  BaseControl,
8
  Fragment
9
  } = wp.element;
10
 
11
+ const { ColorPalette } = wp.blockEditor || wp.editor;
12
 
13
  const {
14
  BaseControl,
classes/Visualizer/Gutenberg/src/Components/Sidebar/GeneralSettings.js CHANGED
@@ -5,7 +5,7 @@ const { __ } = wp.i18n;
5
 
6
  const { Component } = wp.element;
7
 
8
- const { ColorPalette } = wp.editor;
9
 
10
  const {
11
  BaseControl,
5
 
6
  const { Component } = wp.element;
7
 
8
+ const { ColorPalette } = wp.blockEditor || wp.editor;
9
 
10
  const {
11
  BaseControl,
classes/Visualizer/Gutenberg/src/Components/Sidebar/HorizontalAxisSettings.js CHANGED
@@ -8,7 +8,7 @@ const {
8
  Fragment
9
  } = wp.element;
10
 
11
- const { ColorPalette } = wp.editor;
12
 
13
  const {
14
  BaseControl,
8
  Fragment
9
  } = wp.element;
10
 
11
+ const { ColorPalette } = wp.blockEditor || wp.editor;
12
 
13
  const {
14
  BaseControl,
classes/Visualizer/Gutenberg/src/Components/Sidebar/LayoutAndChartArea.js CHANGED
@@ -8,7 +8,7 @@ const {
8
  Fragment
9
  } = wp.element;
10
 
11
- const { ColorPalette } = wp.editor;
12
 
13
  const {
14
  BaseControl,
8
  Fragment
9
  } = wp.element;
10
 
11
+ const { ColorPalette } = wp.blockEditor || wp.editor;
12
 
13
  const {
14
  BaseControl,
classes/Visualizer/Gutenberg/src/Components/Sidebar/PieSettings.js CHANGED
@@ -8,7 +8,7 @@ const {
8
  Fragment
9
  } = wp.element;
10
 
11
- const { ColorPalette } = wp.editor;
12
 
13
  const {
14
  BaseControl,
8
  Fragment
9
  } = wp.element;
10
 
11
+ const { ColorPalette } = wp.blockEditor || wp.editor;
12
 
13
  const {
14
  BaseControl,
classes/Visualizer/Gutenberg/src/Components/Sidebar/ResidueSettings.js CHANGED
@@ -5,7 +5,7 @@ const { __ } = wp.i18n;
5
 
6
  const { Component } = wp.element;
7
 
8
- const { ColorPalette } = wp.editor;
9
 
10
  const {
11
  BaseControl,
5
 
6
  const { Component } = wp.element;
7
 
8
+ const { ColorPalette } = wp.blockEditor || wp.editor;
9
 
10
  const {
11
  BaseControl,
classes/Visualizer/Gutenberg/src/Components/Sidebar/RowCellSettings.js CHANGED
@@ -8,7 +8,7 @@ const {
8
  Fragment
9
  } = wp.element;
10
 
11
- const { ColorPalette } = wp.editor;
12
 
13
  const {
14
  BaseControl,
8
  Fragment
9
  } = wp.element;
10
 
11
+ const { ColorPalette } = wp.blockEditor || wp.editor;
12
 
13
  const {
14
  BaseControl,
classes/Visualizer/Gutenberg/src/Components/Sidebar/SeriesSettings.js CHANGED
@@ -8,7 +8,7 @@ const {
8
  Fragment
9
  } = wp.element;
10
 
11
- const { ColorPalette } = wp.editor;
12
 
13
  const {
14
  BaseControl,
8
  Fragment
9
  } = wp.element;
10
 
11
+ const { ColorPalette } = wp.blockEditor || wp.editor;
12
 
13
  const {
14
  BaseControl,
classes/Visualizer/Gutenberg/src/Components/Sidebar/SlicesSettings.js CHANGED
@@ -5,7 +5,7 @@ const { __ } = wp.i18n;
5
 
6
  const { Component } = wp.element;
7
 
8
- const { ColorPalette } = wp.editor;
9
 
10
  const {
11
  BaseControl,
5
 
6
  const { Component } = wp.element;
7
 
8
+ const { ColorPalette } = wp.blockEditor || wp.editor;
9
 
10
  const {
11
  BaseControl,
classes/Visualizer/Gutenberg/src/Components/Sidebar/TimelineSettings.js CHANGED
@@ -5,7 +5,7 @@ const { __ } = wp.i18n;
5
 
6
  const { Component } = wp.element;
7
 
8
- const { ColorPalette } = wp.editor;
9
 
10
  const {
11
  BaseControl,
5
 
6
  const { Component } = wp.element;
7
 
8
+ const { ColorPalette } = wp.blockEditor || wp.editor;
9
 
10
  const {
11
  BaseControl,
classes/Visualizer/Gutenberg/src/Components/Sidebar/VerticalAxisSettings.js CHANGED
@@ -8,7 +8,7 @@ const {
8
  Fragment
9
  } = wp.element;
10
 
11
- const { ColorPalette } = wp.editor;
12
 
13
  const {
14
  BaseControl,
8
  Fragment
9
  } = wp.element;
10
 
11
+ const { ColorPalette } = wp.blockEditor || wp.editor;
12
 
13
  const {
14
  BaseControl,
classes/Visualizer/Gutenberg/src/Editor.js CHANGED
@@ -43,6 +43,14 @@ class Editor extends Component {
43
  this.readUploadedFile = this.readUploadedFile.bind( this );
44
  this.editURL = this.editURL.bind( this );
45
  this.editSchedule = this.editSchedule.bind( this );
 
 
 
 
 
 
 
 
46
  this.uploadData = this.uploadData.bind( this );
47
  this.getChartData = this.getChartData.bind( this );
48
  this.editChartData = this.editChartData.bind( this );
@@ -139,9 +147,81 @@ class Editor extends Component {
139
  editSchedule( schedule ) {
140
  let chart = { ...this.state.chart };
141
  chart['visualizer-chart-schedule'] = schedule;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
  this.setState({ chart });
143
  }
144
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145
  uploadData( scheduled = false ) {
146
  this.setState({
147
  isLoading: 'uploadData',
@@ -235,7 +315,6 @@ class Editor extends Component {
235
  let chart = { ...this.state.chart };
236
  let series = [];
237
  let settings = { ...chart['visualizer-settings'] };
238
-
239
  chartData[0].map( ( i, index ) => {
240
  series[index] = {
241
  label: i,
@@ -310,7 +389,7 @@ class Editor extends Component {
310
  }
311
  );
312
 
313
- apiRequest({ path: `/visualizer/v1/update-chart?id=${this.props.attributes.id}`, method: 'POST', data: data }).then(
314
  ( data ) => {
315
 
316
  this.setState({
@@ -411,6 +490,14 @@ class Editor extends Component {
411
  readUploadedFile={ this.readUploadedFile }
412
  editURL={ this.editURL }
413
  editSchedule={ this.editSchedule }
 
 
 
 
 
 
 
 
414
  uploadData={ this.uploadData }
415
  getChartData={ this.getChartData }
416
  editChartData={ this.editChartData }
43
  this.readUploadedFile = this.readUploadedFile.bind( this );
44
  this.editURL = this.editURL.bind( this );
45
  this.editSchedule = this.editSchedule.bind( this );
46
+ this.editJSONSchedule = this.editJSONSchedule.bind( this );
47
+ this.editJSONURL = this.editJSONURL.bind( this );
48
+ this.editJSONHeaders = this.editJSONHeaders.bind( this );
49
+ this.editJSONRoot = this.editJSONRoot.bind( this );
50
+ this.editJSONPaging = this.editJSONPaging.bind( this );
51
+ this.JSONImportData = this.JSONImportData.bind( this );
52
+ this.editDatabaseSchedule = this.editDatabaseSchedule.bind( this );
53
+ this.databaseImportData = this.databaseImportData.bind( this );
54
  this.uploadData = this.uploadData.bind( this );
55
  this.getChartData = this.getChartData.bind( this );
56
  this.editChartData = this.editChartData.bind( this );
147
  editSchedule( schedule ) {
148
  let chart = { ...this.state.chart };
149
  chart['visualizer-chart-schedule'] = schedule;
150
+ this.setState({
151
+ chart,
152
+ isModified: true
153
+ });
154
+ }
155
+
156
+ editJSONSchedule( schedule ) {
157
+ let chart = { ...this.state.chart };
158
+ chart['visualizer-json-schedule'] = schedule;
159
+ this.setState({
160
+ chart,
161
+ isModified: true
162
+ });
163
+ }
164
+
165
+ editJSONURL( url ) {
166
+ let chart = { ...this.state.chart };
167
+ chart['visualizer-json-url'] = url;
168
+ this.setState({ chart });
169
+ }
170
+
171
+ editJSONHeaders( headers ) {
172
+ let chart = { ...this.state.chart };
173
+ delete headers.username;
174
+ delete headers.password;
175
+ chart['visualizer-json-headers'] = headers;
176
+ this.setState({ chart });
177
+ }
178
+
179
+ editJSONRoot( root ) {
180
+ let chart = { ...this.state.chart };
181
+ chart['visualizer-json-root'] = root;
182
+ this.setState({ chart });
183
+ }
184
+
185
+ editJSONPaging( root ) {
186
+ let chart = { ...this.state.chart };
187
+ chart['visualizer-json-paging'] = root;
188
  this.setState({ chart });
189
  }
190
 
191
+ JSONImportData( name, series, data ) {
192
+ let chart = { ...this.state.chart };
193
+ chart['visualizer-source'] = name;
194
+ chart['visualizer-default-data'] = 0;
195
+ chart['visualizer-series'] = series;
196
+ chart['visualizer-data'] = data;
197
+ this.setState({
198
+ chart,
199
+ isModified: true
200
+ });
201
+ }
202
+
203
+ editDatabaseSchedule( schedule ) {
204
+ let chart = { ...this.state.chart };
205
+ chart['visualizer-db-schedule'] = schedule;
206
+ this.setState({
207
+ chart,
208
+ isModified: true
209
+ });
210
+ }
211
+
212
+ databaseImportData( query, name, series, data ) {
213
+ let chart = { ...this.state.chart };
214
+ chart['visualizer-source'] = name;
215
+ chart['visualizer-default-data'] = 0;
216
+ chart['visualizer-series'] = series;
217
+ chart['visualizer-data'] = data;
218
+ chart['visualizer-db-query'] = query;
219
+ this.setState({
220
+ chart,
221
+ isModified: true
222
+ });
223
+ }
224
+
225
  uploadData( scheduled = false ) {
226
  this.setState({
227
  isLoading: 'uploadData',
315
  let chart = { ...this.state.chart };
316
  let series = [];
317
  let settings = { ...chart['visualizer-settings'] };
 
318
  chartData[0].map( ( i, index ) => {
319
  series[index] = {
320
  label: i,
389
  }
390
  );
391
 
392
+ apiRequest({ path: `/visualizer/v1/update-chart?id=${ this.props.attributes.id }`, method: 'POST', data: data }).then(
393
  ( data ) => {
394
 
395
  this.setState({
490
  readUploadedFile={ this.readUploadedFile }
491
  editURL={ this.editURL }
492
  editSchedule={ this.editSchedule }
493
+ editJSONURL={ this.editJSONURL }
494
+ editJSONHeaders={ this.editJSONHeaders }
495
+ editJSONSchedule={ this.editJSONSchedule }
496
+ editJSONRoot={ this.editJSONRoot }
497
+ editJSONPaging={ this.editJSONPaging }
498
+ JSONImportData={ this.JSONImportData }
499
+ editDatabaseSchedule={ this.editDatabaseSchedule }
500
+ databaseImportData={ this.databaseImportData }
501
  uploadData={ this.uploadData }
502
  getChartData={ this.getChartData }
503
  editChartData={ this.editChartData }
classes/Visualizer/Gutenberg/src/style.scss CHANGED
@@ -95,6 +95,10 @@
95
  font-weight: bold;
96
  text-align: center;
97
  }
 
 
 
 
98
 
99
  .visualizer-settings__charts-controls {
100
  width: 100%;
@@ -236,16 +240,154 @@
236
  }
237
  }
238
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
239
  .htContextMenu {
240
  &:not( .htGhostTable ) {
241
  z-index: 999999;
242
  }
243
  }
244
 
245
- .htDatepickerHolder {
 
 
 
246
  z-index: 999999 !important;
247
  }
248
 
 
 
 
 
 
 
 
 
 
 
249
  @media ( max-width: 768px ) {
250
  .visualizer-settings {
251
 
95
  font-weight: bold;
96
  text-align: center;
97
  }
98
+
99
+ .visualizer-settings__charts-footer {
100
+ font-size: small;
101
+ }
102
 
103
  .visualizer-settings__charts-controls {
104
  width: 100%;
240
  }
241
  }
242
 
243
+ .visualizer-json-query-modal {
244
+ .components-modal__content {
245
+ padding-left: 0;
246
+ padding-right: 0;
247
+
248
+ .components-modal__header {
249
+ margin: 0;
250
+ }
251
+ }
252
+
253
+ .components-icon-button {
254
+ margin: 10px 0;
255
+ }
256
+
257
+ .visualizer-json-query-modal-headers-panel {
258
+ padding: 0 0 1em 2.2em;
259
+
260
+ .components-base-control {
261
+ display: inline-block;
262
+ }
263
+
264
+ .visualizer-json-query-modal-field-separator {
265
+ padding: 0 10px;
266
+ }
267
+ }
268
+
269
+ .viz-editor-table {
270
+ tbody {
271
+ tr {
272
+ &:first-child {
273
+ background-color: #ececec !important;
274
+ }
275
+ }
276
+ }
277
+
278
+ tr {
279
+ th {
280
+ background-color: #cccccc;
281
+ }
282
+ }
283
+
284
+ thead {
285
+ tr {
286
+ th {
287
+ &:nth-child(n+1) {
288
+ cursor: move !important;
289
+ }
290
+ }
291
+ }
292
+ }
293
+ }
294
+
295
+ #visualizer-json-query-table {
296
+ margin-bottom: 10px;
297
+ }
298
+
299
+ ul {
300
+ list-style: disc;
301
+ margin-left: 10px;
302
+ }
303
+ }
304
+
305
+ .visualizer-db-query-modal {
306
+ .CodeMirror-scroll {
307
+ overflow: hidden !important;
308
+ height: 50%;
309
+ margin: 0;
310
+ padding: 0;
311
+ }
312
+
313
+ .CodeMirror-wrap {
314
+ height: 200px;
315
+ padding: 15px;
316
+ color: #fff;
317
+ background: #282923;
318
+ font-size: 15px;
319
+ margin-bottom: 20px;
320
+
321
+ .CodeMirror-cursor {
322
+ border-left: 1px solid #fff !important;
323
+ }
324
+
325
+ .CodeMirror-placeholder {
326
+ color: #fff;
327
+ }
328
+
329
+ pre {
330
+ color: #fff !important;
331
+ }
332
+
333
+ .cm-keyword {
334
+ color: #f92472 !important;
335
+ }
336
+
337
+ .cm-comment {
338
+ color: #74705d !important;
339
+ }
340
+
341
+ .cm-number {
342
+ color: #fff !important;
343
+ }
344
+
345
+ .cm-string {
346
+ color: #fff !important;
347
+ }
348
+ }
349
+
350
+ ul {
351
+ list-style: disc;
352
+ margin-left: 10px;
353
+ }
354
+
355
+ .db-wizard-error {
356
+ color: #f00;
357
+ }
358
+
359
+ .visualizer-db-query-actions {
360
+ .components-button {
361
+ &:first-child {
362
+ margin-right: 10px;
363
+ }
364
+ }
365
+ }
366
+ }
367
+
368
  .htContextMenu {
369
  &:not( .htGhostTable ) {
370
  z-index: 999999;
371
  }
372
  }
373
 
374
+ .htDatepickerHolder,
375
+ .CodeMirror-hints,
376
+ .DTCR_clonedTable,
377
+ .DTCR_pointer {
378
  z-index: 999999 !important;
379
  }
380
 
381
+ @media ( min-width: 768px ) {
382
+ .visualizer-json-query-modal {
383
+ width: 668px;
384
+ }
385
+
386
+ .visualizer-db-query-modal .CodeMirror-wrap {
387
+ min-width: 550px;
388
+ }
389
+ }
390
+
391
  @media ( max-width: 768px ) {
392
  .visualizer-settings {
393
 
classes/Visualizer/Module.php CHANGED
@@ -67,9 +67,24 @@ class Visualizer_Module {
67
  $this->_addFilter( Visualizer_Plugin::FILTER_UNDO_REVISIONS, 'undoRevisions', 10, 2 );
68
  $this->_addFilter( Visualizer_Plugin::FILTER_HANDLE_REVISIONS, 'handleExistingRevisions', 10, 2 );
69
  $this->_addFilter( Visualizer_Plugin::FILTER_GET_CHART_DATA_AS, 'getDataAs', 10, 3 );
 
70
 
71
  }
72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  /**
74
  * Registers an action hook.
75
  *
@@ -222,7 +237,10 @@ class Visualizer_Module {
222
 
223
  switch ( $type ) {
224
  case 'csv':
225
- $final = $this->_getCSV( $rows, $filename );
 
 
 
226
  break;
227
  case 'xls':
228
  $final = $this->_getExcel( $rows, $filename );
@@ -241,8 +259,9 @@ class Visualizer_Module {
241
  * @access private
242
  * @param array $rows The array of data.
243
  * @param string $filename The name of the file to use.
 
244
  */
245
- private function _getCSV( $rows, $filename ) {
246
  $filename .= '.csv';
247
 
248
  $bom = chr( 0xEF ) . chr( 0xBB ) . chr( 0xBF );
@@ -259,6 +278,18 @@ class Visualizer_Module {
259
  if ( strlen( $csv ) > 0 ) {
260
  $csv .= PHP_EOL;
261
  }
 
 
 
 
 
 
 
 
 
 
 
 
262
  $csv .= implode( ',', $array );
263
  }
264
  fclose( $fp );
@@ -640,4 +671,31 @@ class Visualizer_Module {
640
  return version_compare( VISUALIZER_PRO_VERSION, $version, '<' );
641
  }
642
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
643
  }
67
  $this->_addFilter( Visualizer_Plugin::FILTER_UNDO_REVISIONS, 'undoRevisions', 10, 2 );
68
  $this->_addFilter( Visualizer_Plugin::FILTER_HANDLE_REVISIONS, 'handleExistingRevisions', 10, 2 );
69
  $this->_addFilter( Visualizer_Plugin::FILTER_GET_CHART_DATA_AS, 'getDataAs', 10, 3 );
70
+ register_shutdown_function( array($this, 'onShutdown') );
71
 
72
  }
73
 
74
+ /**
75
+ * Register a shutdown hook to catch fatal errors.
76
+ *
77
+ * @since ?
78
+ *
79
+ * @access public
80
+ */
81
+ public function onShutdown() {
82
+ $error = error_get_last();
83
+ if ( $error['type'] === E_ERROR && false !== strpos( $error['file'], 'Visualizer/' ) ) {
84
+ do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'Critical error %s', print_r( $error, true ) ), 'error', __FILE__, __LINE__ );
85
+ }
86
+ }
87
+
88
  /**
89
  * Registers an action hook.
90
  *
237
 
238
  switch ( $type ) {
239
  case 'csv':
240
+ $final = $this->_getCSV( $rows, $filename, false );
241
+ break;
242
+ case 'csv-display':
243
+ $final = $this->_getCSV( $rows, $filename, true );
244
  break;
245
  case 'xls':
246
  $final = $this->_getExcel( $rows, $filename );
259
  * @access private
260
  * @param array $rows The array of data.
261
  * @param string $filename The name of the file to use.
262
+ * @param bool $enclose Enclose strings that have commas in them in double quotes.
263
  */
264
+ private function _getCSV( $rows, $filename, $enclose ) {
265
  $filename .= '.csv';
266
 
267
  $bom = chr( 0xEF ) . chr( 0xBB ) . chr( 0xBF );
278
  if ( strlen( $csv ) > 0 ) {
279
  $csv .= PHP_EOL;
280
  }
281
+ // if enclosure is required, check every item of this line
282
+ // if a comma exists in the item, add enclosure.
283
+ if ( $enclose ) {
284
+ $temp_array = array();
285
+ foreach ( $array as $item ) {
286
+ if ( strpos( $item, ',' ) !== false ) {
287
+ $item = VISUALIZER_CSV_ENCLOSURE . $item . VISUALIZER_CSV_ENCLOSURE;
288
+ }
289
+ $temp_array[] = $item;
290
+ }
291
+ $array = $temp_array;
292
+ }
293
  $csv .= implode( ',', $array );
294
  }
295
  fclose( $fp );
671
  return version_compare( VISUALIZER_PRO_VERSION, $version, '<' );
672
  }
673
 
674
+ /**
675
+ * Should we show some specific feature on the basis of the version?
676
+ *
677
+ * @since 3.4.0
678
+ */
679
+ public static function can_show_feature( $feature ) {
680
+ switch ( $feature ) {
681
+ case 'simple-editor':
682
+ // if user has pro but an older version, then don't load the simple editor functionality
683
+ // as the select box will not behave as expected because the pro editor's functionality will supercede.
684
+ return ! Visualizer_Module::is_pro() || ! Visualizer_Module::is_pro_older_than( '1.9.2' );
685
+ }
686
+ return false;
687
+ }
688
+
689
+ /**
690
+ * Gets the features for the provided license type.
691
+ */
692
+ public static final function get_features_for_license( $plan ) {
693
+ switch ( $plan ) {
694
+ case 1:
695
+ return array( 'import-wp', 'db-query' );
696
+ case 2:
697
+ return array( 'schedule-chart', 'chart-permissions' );
698
+ }
699
+ }
700
+
701
  }
classes/Visualizer/Module/Admin.php CHANGED
@@ -68,9 +68,68 @@ class Visualizer_Module_Admin extends Visualizer_Module {
68
  $this->_addAction( '_wp_put_post_revision', 'addRevision', null, 10, 1 );
69
  $this->_addAction( 'wp_restore_post_revision', 'restoreRevision', null, 10, 2 );
70
 
 
 
71
  $this->_addAction( 'admin_init', 'init' );
72
  }
73
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  /**
75
  * No limits on revisions.
76
  */
@@ -333,6 +392,12 @@ class Visualizer_Module_Admin extends Visualizer_Module {
333
  'enabled' => true,
334
  'supports' => array( 'Google Charts', 'ChartJS' ),
335
  ),
 
 
 
 
 
 
336
  'scatter' => array(
337
  'name' => esc_html__( 'Scatter', 'visualizer' ),
338
  'enabled' => true,
@@ -726,7 +791,10 @@ class Visualizer_Module_Admin extends Visualizer_Module {
726
  $settings = apply_filters( $atts['settings'], $settings, $chart->ID, $type );
727
  }
728
 
729
- unset( $settings['height'], $settings['width'], $settings['chartArea'] );
 
 
 
730
  $series = apply_filters( Visualizer_Plugin::FILTER_GET_CHART_SERIES, get_post_meta( $chart->ID, Visualizer_Plugin::CF_SERIES, true ), $chart->ID, $type );
731
  $data = apply_filters( Visualizer_Plugin::FILTER_GET_CHART_DATA, unserialize( html_entity_decode( $chart->post_content ) ), $chart->ID, $type );
732
 
68
  $this->_addAction( '_wp_put_post_revision', 'addRevision', null, 10, 1 );
69
  $this->_addAction( 'wp_restore_post_revision', 'restoreRevision', null, 10, 2 );
70
 
71
+ $this->_addAction( 'visualizer_chart_schedules_spl', 'addSplChartSchedules', null, 10, 3 );
72
+
73
  $this->_addAction( 'admin_init', 'init' );
74
  }
75
 
76
+
77
+ /**
78
+ * Add disabled `optgroup` schedules to the drop downs.
79
+ *
80
+ * @since ?
81
+ *
82
+ * @access public
83
+ *
84
+ * @param string $feature The feature for which to add schedules.
85
+ * @param int $chart_id The chart ID.
86
+ * @param int $plan The plan number.
87
+ */
88
+ public function addSplChartSchedules( $feature, $chart_id, $plan ) {
89
+ if ( apply_filters( 'visualizer_is_business', false ) ) {
90
+ return;
91
+ }
92
+
93
+ $license = __( 'PRO', 'visualizer' );
94
+ if ( Visualizer_Module::is_pro() ) {
95
+ switch ( $plan ) {
96
+ case 1:
97
+ $license = __( 'Developer', 'visualizer' );
98
+ break;
99
+ }
100
+ }
101
+
102
+ $hours = array(
103
+ '0' => __( 'Live', 'visualizer' ),
104
+ '1' => __( 'Each hour', 'visualizer' ),
105
+ '12' => __( 'Each 12 hours', 'visualizer' ),
106
+ '24' => __( 'Each day', 'visualizer' ),
107
+ '72' => __( 'Each 3 days', 'visualizer' ),
108
+ );
109
+
110
+ switch ( $feature ) {
111
+ case 'json':
112
+ case 'csv':
113
+ // no more schedules if pro is already active.
114
+ if ( Visualizer_Module::is_pro() ) {
115
+ return;
116
+ }
117
+ break;
118
+ case 'wp':
119
+ // fall-through.
120
+ case 'db':
121
+ break;
122
+ default:
123
+ return;
124
+ }
125
+
126
+ echo '<optgroup disabled label="' . sprintf( __( 'More in the %s version', 'visualizer' ), $license ) . '">';
127
+ foreach ( $hours as $hour => $desc ) {
128
+ echo '<option disabled>' . $desc . '</option>';
129
+ }
130
+ echo '</optgroup>';
131
+ }
132
+
133
  /**
134
  * No limits on revisions.
135
  */
392
  'enabled' => true,
393
  'supports' => array( 'Google Charts', 'ChartJS' ),
394
  ),
395
+ 'bubble' => array(
396
+ 'name' => esc_html__( 'Bubble', 'visualizer' ),
397
+ 'enabled' => true,
398
+ // chartjs' bubble is ugly looking (and it won't work off the default bubble.csv) so it is being excluded for the time being.
399
+ 'supports' => array( 'Google Charts' ),
400
+ ),
401
  'scatter' => array(
402
  'name' => esc_html__( 'Scatter', 'visualizer' ),
403
  'enabled' => true,
791
  $settings = apply_filters( $atts['settings'], $settings, $chart->ID, $type );
792
  }
793
 
794
+ if ( $settings ) {
795
+ unset( $settings['height'], $settings['width'], $settings['chartArea'] );
796
+ }
797
+
798
  $series = apply_filters( Visualizer_Plugin::FILTER_GET_CHART_SERIES, get_post_meta( $chart->ID, Visualizer_Plugin::CF_SERIES, true ), $chart->ID, $type );
799
  $data = apply_filters( Visualizer_Plugin::FILTER_GET_CHART_DATA, unserialize( html_entity_decode( $chart->post_content ) ), $chart->ID, $type );
800
 
classes/Visualizer/Module/Chart.php CHANGED
@@ -69,6 +69,34 @@ class Visualizer_Module_Chart extends Visualizer_Module {
69
 
70
  $this->_addAjaxAction( Visualizer_Plugin::ACTION_SAVE_FILTER_QUERY, 'saveFilter' );
71
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  }
73
 
74
  /**
@@ -156,8 +184,9 @@ class Visualizer_Module_Chart extends Visualizer_Module {
156
  }
157
 
158
  $source = new Visualizer_Source_Json( $params );
 
 
159
 
160
- $data = $source->parse();
161
  if ( empty( $data ) ) {
162
  wp_send_json_error( array( 'msg' => esc_html__( 'Unable to fetch data from the endpoint. Please try again.', 'visualizer' ) ) );
163
  }
@@ -186,7 +215,7 @@ class Visualizer_Module_Chart extends Visualizer_Module {
186
  $chart = get_post( $chart_id );
187
 
188
  $source = new Visualizer_Source_Json( $params );
189
- $source->fetch();
190
 
191
  $content = $source->getData();
192
  $chart->post_content = $content;
@@ -196,11 +225,45 @@ class Visualizer_Module_Chart extends Visualizer_Module {
196
  update_post_meta( $chart->ID, Visualizer_Plugin::CF_DEFAULT_DATA, 0 );
197
  update_post_meta( $chart->ID, Visualizer_Plugin::CF_JSON_URL, $params['url'] );
198
  update_post_meta( $chart->ID, Visualizer_Plugin::CF_JSON_ROOT, $params['root'] );
 
 
 
 
 
 
 
 
 
 
 
199
  delete_post_meta( $chart->ID, Visualizer_Plugin::CF_JSON_PAGING );
200
  if ( ! empty( $params['paging'] ) ) {
201
  add_post_meta( $chart->ID, Visualizer_Plugin::CF_JSON_PAGING, $params['paging'] );
202
  }
203
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204
  $render = new Visualizer_Render_Page_Update();
205
  $render->id = $chart->ID;
206
  $render->data = json_encode( $source->getRawData() );
@@ -537,7 +600,7 @@ class Visualizer_Module_Chart extends Visualizer_Module {
537
  /**
538
  * Load code editor assets.
539
  */
540
- private function loadCodeEditorAssets() {
541
  global $wp_version;
542
 
543
  $wp_scripts = wp_scripts();
@@ -553,7 +616,7 @@ class Visualizer_Module_Chart extends Visualizer_Module {
553
  return;
554
  }
555
 
556
- $table_col_mapping = Visualizer_Source_Query_Params::get_all_db_tables_column_mapping();
557
 
558
  if ( version_compare( $wp_version, '4.9.0', '<' ) ) {
559
  // code mirror assets.
@@ -652,7 +715,7 @@ class Visualizer_Module_Chart extends Visualizer_Module {
652
  wp_enqueue_script( 'visualizer-chosen' );
653
  wp_enqueue_script( 'visualizer-render' );
654
 
655
- if ( ! Visualizer_Module::is_pro() ) {
656
  wp_enqueue_script( 'visualizer-editor-simple' );
657
  wp_localize_script(
658
  'visualizer-editor-simple',
@@ -669,16 +732,17 @@ class Visualizer_Module_Chart extends Visualizer_Module {
669
  );
670
  }
671
 
672
- $table_col_mapping = $this->loadCodeEditorAssets();
673
 
674
  wp_localize_script(
675
  'visualizer-render',
676
  'visualizer',
677
  array(
678
  'l10n' => array(
679
- 'invalid_source' => esc_html__( 'You have entered invalid URL. Please, insert proper URL.', 'visualizer' ),
680
  'loading' => esc_html__( 'Loading...', 'visualizer' ),
681
  'json_error' => esc_html__( 'An error occured in fetching data.', 'visualizer' ),
 
682
  ),
683
  'charts' => array(
684
  'canvas' => $data,
@@ -730,11 +794,11 @@ class Visualizer_Module_Chart extends Visualizer_Module {
730
  $render->button = esc_attr__( 'Insert Chart', 'visualizer' );
731
  }
732
 
733
- do_action( 'visualizer_enqueue_scripts_and_styles', $data );
734
 
735
  if ( Visualizer_Module::is_pro() && Visualizer_Module::is_pro_older_than( '1.9.0' ) ) {
736
  global $Visualizer_Pro;
737
- $Visualizer_Pro->_enqueueScriptsAndStyles( $data );
738
  }
739
 
740
  $this->_addAction( 'admin_head', 'renderFlattrScript' );
@@ -807,28 +871,37 @@ class Visualizer_Module_Chart extends Visualizer_Module {
807
  *
808
  * @since 3.2.0
809
  */
810
- private function handleCSVasString( $data ) {
811
  $source = null;
812
 
813
- // @issue https://github.com/Codeinwp/visualizer/issues/412
814
- if ( has_filter( 'visualizer_pro_handle_chart_data' ) ) {
815
- $source = apply_filters( 'visualizer_pro_handle_chart_data', $data, '' );
816
- } else {
817
- // data coming in from the text editor.
818
- $tmpfile = tempnam( get_temp_dir(), Visualizer_Plugin::NAME );
819
- $handle = fopen( $tmpfile, 'w' );
820
- $values = preg_split( '/[\n\r]+/', stripslashes( trim( $data ) ) );
821
- if ( $values ) {
822
- foreach ( $values as $row ) {
823
- if ( empty( $row ) ) {
824
- continue;
 
 
 
 
 
 
 
825
  }
826
- $columns = explode( ',', $row );
827
- fputcsv( $handle, $columns );
828
  }
829
- }
830
- $source = new Visualizer_Source_Csv( $tmpfile );
831
- fclose( $handle );
 
 
 
 
832
  }
833
  return $source;
834
  }
@@ -879,7 +952,7 @@ class Visualizer_Module_Chart extends Visualizer_Module {
879
  for ( $j = 0; $j < count( $columns[0] ); $j++ ) {
880
  $row = array();
881
  for ( $i = 0; $i < count( $headers ); $i++ ) {
882
- $row[] = $columns[ $i ][ $j ];
883
  }
884
  $csv[] = $row;
885
  }
@@ -934,6 +1007,8 @@ class Visualizer_Module_Chart extends Visualizer_Module {
934
  exit;
935
  }
936
 
 
 
937
  if ( ! isset( $_POST['vz-import-time'] ) ) {
938
  apply_filters( 'visualizer_pro_remove_schedule', $chart_id );
939
  }
@@ -947,12 +1022,20 @@ class Visualizer_Module_Chart extends Visualizer_Module {
947
  // delete "import from db" specific parameters.
948
  delete_post_meta( $chart_id, Visualizer_Plugin::CF_DB_QUERY );
949
  delete_post_meta( $chart_id, Visualizer_Plugin::CF_DB_SCHEDULE );
 
950
  }
951
 
952
  // delete json related data.
953
  delete_post_meta( $chart_id, Visualizer_Plugin::CF_JSON_URL );
954
  delete_post_meta( $chart_id, Visualizer_Plugin::CF_JSON_ROOT );
955
  delete_post_meta( $chart_id, Visualizer_Plugin::CF_JSON_PAGING );
 
 
 
 
 
 
 
956
 
957
  $source = null;
958
  $render = new Visualizer_Render_Page_Update();
@@ -965,12 +1048,19 @@ class Visualizer_Module_Chart extends Visualizer_Module {
965
  } elseif ( isset( $_FILES['local_data'] ) && $_FILES['local_data']['error'] == 0 ) {
966
  $source = new Visualizer_Source_Csv( $_FILES['local_data']['tmp_name'] );
967
  } elseif ( isset( $_POST['chart_data'] ) && strlen( $_POST['chart_data'] ) > 0 ) {
968
- $source = $this->handleCSVasString( $_POST['chart_data'] );
 
969
  } elseif ( isset( $_POST['table_data'] ) && 'yes' === $_POST['table_data'] ) {
970
  $source = $this->handleTabularData();
 
971
  } else {
 
972
  $render->message = esc_html__( 'CSV file with chart data was not uploaded. Please try again.', 'visualizer' );
 
973
  }
 
 
 
974
  if ( $source ) {
975
  if ( $source->fetch() ) {
976
  $content = $source->getData();
@@ -981,6 +1071,7 @@ class Visualizer_Module_Chart extends Visualizer_Module {
981
  // if we populate the data even if it is empty, the chart will show "Table has no columns".
982
  if ( array_key_exists( 'source', $json ) && ! empty( $json['source'] ) && ( ! array_key_exists( 'data', $json ) || empty( $json['data'] ) ) ) {
983
  do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'Not populating chart data as source exists (%s) but data is empty!', $json['source'] ), 'warn', __FILE__, __LINE__ );
 
984
  $populate = false;
985
  }
986
  }
@@ -992,6 +1083,8 @@ class Visualizer_Module_Chart extends Visualizer_Module {
992
  update_post_meta( $chart->ID, Visualizer_Plugin::CF_SOURCE, $source->getSourceName() );
993
  update_post_meta( $chart->ID, Visualizer_Plugin::CF_DEFAULT_DATA, 0 );
994
 
 
 
995
  Visualizer_Module_Utility::set_defaults( $chart, null );
996
 
997
  $settings = get_post_meta( $chart->ID, Visualizer_Plugin::CF_SETTINGS, true );
@@ -1001,11 +1094,16 @@ class Visualizer_Module_Chart extends Visualizer_Module {
1001
  $render->series = json_encode( $source->getSeries() );
1002
  $render->settings = json_encode( $settings );
1003
  } else {
1004
- $render->message = $source->get_error();
1005
- if ( empty( $render->message ) ) {
1006
- $render->message = esc_html__( 'CSV file is broken or invalid. Please try again.', 'visualizer' );
1007
  }
 
 
 
1008
  }
 
 
1009
  }
1010
  $render->render();
1011
  if ( ! $can_die ) {
@@ -1114,7 +1212,10 @@ class Visualizer_Module_Chart extends Visualizer_Module {
1114
  $render = new Visualizer_Render_Page_Data();
1115
  $render->chart = $this->_chart;
1116
  $render->type = $data['type'];
1117
- unset( $data['settings']['width'], $data['settings']['height'], $data['settings']['chartArea'] );
 
 
 
1118
  wp_enqueue_style( 'visualizer-frame' );
1119
  wp_enqueue_script( 'visualizer-render' );
1120
  wp_localize_script(
@@ -1122,7 +1223,7 @@ class Visualizer_Module_Chart extends Visualizer_Module {
1122
  'visualizer',
1123
  array(
1124
  'l10n' => array(
1125
- 'invalid_source' => esc_html__( 'You have entered invalid URL. Please, insert proper URL.', 'visualizer' ),
1126
  'loading' => esc_html__( 'Loading...', 'visualizer' ),
1127
  ),
1128
  'charts' => array(
@@ -1131,11 +1232,11 @@ class Visualizer_Module_Chart extends Visualizer_Module {
1131
  )
1132
  );
1133
 
1134
- do_action( 'visualizer_enqueue_scripts_and_styles', $data );
1135
 
1136
  if ( Visualizer_Module::is_pro() && Visualizer_Module::is_pro_older_than( '1.9.0' ) ) {
1137
  global $Visualizer_Pro;
1138
- $Visualizer_Pro->_enqueueScriptsAndStyles( $data );
1139
  }
1140
 
1141
  // Added by Ash/Upwork
@@ -1152,11 +1253,12 @@ class Visualizer_Module_Chart extends Visualizer_Module {
1152
  check_ajax_referer( Visualizer_Plugin::ACTION_FETCH_DB_DATA . Visualizer_Plugin::VERSION, 'security' );
1153
 
1154
  $params = wp_parse_args( $_POST['params'] );
1155
- $source = new Visualizer_Source_Query( stripslashes( $params['query'] ) );
 
 
1156
  $html = $source->fetch( true );
1157
- $error = '';
1158
- if ( empty( $html ) ) {
1159
- $error = $source->get_error();
1160
  wp_send_json_error( array( 'msg' => $error ) );
1161
  }
1162
  wp_send_json_success( array( 'table' => $html ) );
@@ -1181,19 +1283,40 @@ class Visualizer_Module_Chart extends Visualizer_Module {
1181
  )
1182
  );
1183
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1184
  $render = new Visualizer_Render_Page_Update();
1185
  if ( $chart_id ) {
1186
  $params = wp_parse_args( $_POST['params'] );
1187
- $source = new Visualizer_Source_Query( stripslashes( $params['query'] ) );
1188
  $source->fetch( false );
1189
  $error = $source->get_error();
1190
  if ( empty( $error ) ) {
1191
- $hours = $_POST['refresh'];
1192
  update_post_meta( $chart_id, Visualizer_Plugin::CF_DB_QUERY, stripslashes( $params['query'] ) );
1193
  update_post_meta( $chart_id, Visualizer_Plugin::CF_SOURCE, $source->getSourceName() );
1194
  update_post_meta( $chart_id, Visualizer_Plugin::CF_SERIES, $source->getSeries() );
1195
  update_post_meta( $chart_id, Visualizer_Plugin::CF_DB_SCHEDULE, $hours );
1196
  update_post_meta( $chart_id, Visualizer_Plugin::CF_DEFAULT_DATA, 0 );
 
 
 
 
 
 
1197
 
1198
  $schedules = get_option( Visualizer_Plugin::CF_DB_SCHEDULE, array() );
1199
  $schedules[ $chart_id ] = time() + $hours * HOUR_IN_SECONDS;
@@ -1207,6 +1330,7 @@ class Visualizer_Module_Chart extends Visualizer_Module {
1207
  );
1208
  $render->data = json_encode( $source->getRawData() );
1209
  $render->series = json_encode( $source->getSeries() );
 
1210
  } else {
1211
  $render->message = $error;
1212
  }
@@ -1237,7 +1361,21 @@ class Visualizer_Module_Chart extends Visualizer_Module {
1237
  )
1238
  );
1239
 
1240
- $hours = $_POST['refresh'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1241
 
1242
  do_action( 'visualizer_save_filter', $chart_id, $hours );
1243
 
69
 
70
  $this->_addAjaxAction( Visualizer_Plugin::ACTION_SAVE_FILTER_QUERY, 'saveFilter' );
71
 
72
+ $this->_addFilter( 'visualizer_get_sidebar', 'getSidebar', 10, 2 );
73
+
74
+ }
75
+
76
+ /**
77
+ * Generates the HTML of the sidebar for the chart.
78
+ *
79
+ * @since ?
80
+ *
81
+ * @access public
82
+ */
83
+ public function getSidebar( $sidebar, $chart_id ) {
84
+ $chart = get_post( $chart_id );
85
+ $data = $this->_getChartArray( $chart );
86
+ $sidebar = '';
87
+ $sidebar_class = $this->load_chart_class_name( $chart_id );
88
+ if ( class_exists( $sidebar_class, true ) ) {
89
+ $sidebar = new $sidebar_class( $data['settings'] );
90
+ $sidebar->__series = $data['series'];
91
+ $sidebar->__data = $data['data'];
92
+ } else {
93
+ $sidebar = apply_filters( 'visualizer_pro_chart_type_sidebar', '', $data );
94
+ if ( $sidebar !== '' ) {
95
+ $sidebar->__series = $data['series'];
96
+ $sidebar->__data = $data['data'];
97
+ }
98
+ }
99
+ return str_replace( "'", '"', $sidebar->__toString() );
100
  }
101
 
102
  /**
184
  }
185
 
186
  $source = new Visualizer_Source_Json( $params );
187
+ $source->fetch();
188
+ $data = $source->getRawData();
189
 
 
190
  if ( empty( $data ) ) {
191
  wp_send_json_error( array( 'msg' => esc_html__( 'Unable to fetch data from the endpoint. Please try again.', 'visualizer' ) ) );
192
  }
215
  $chart = get_post( $chart_id );
216
 
217
  $source = new Visualizer_Source_Json( $params );
218
+ $source->fetchFromEditableTable();
219
 
220
  $content = $source->getData();
221
  $chart->post_content = $content;
225
  update_post_meta( $chart->ID, Visualizer_Plugin::CF_DEFAULT_DATA, 0 );
226
  update_post_meta( $chart->ID, Visualizer_Plugin::CF_JSON_URL, $params['url'] );
227
  update_post_meta( $chart->ID, Visualizer_Plugin::CF_JSON_ROOT, $params['root'] );
228
+
229
+ delete_post_meta( $chart->ID, Visualizer_Plugin::CF_JSON_HEADERS );
230
+ $headers = array( 'method' => $params['method'] );
231
+ if ( ! empty( $params['auth'] ) ) {
232
+ $headers['auth'] = $params['auth'];
233
+ } elseif ( ! empty( $params['username'] ) && ! empty( $params['password'] ) ) {
234
+ $headers['auth'] = array( 'username' => $params['username'], 'password' => $params['password'] );
235
+ }
236
+
237
+ add_post_meta( $chart->ID, Visualizer_Plugin::CF_JSON_HEADERS, $headers );
238
+
239
  delete_post_meta( $chart->ID, Visualizer_Plugin::CF_JSON_PAGING );
240
  if ( ! empty( $params['paging'] ) ) {
241
  add_post_meta( $chart->ID, Visualizer_Plugin::CF_JSON_PAGING, $params['paging'] );
242
  }
243
 
244
+ $time = filter_input(
245
+ INPUT_POST,
246
+ 'time',
247
+ FILTER_VALIDATE_INT,
248
+ array(
249
+ 'options' => array(
250
+ 'min_range' => -1,
251
+ ),
252
+ )
253
+ );
254
+
255
+ delete_post_meta( $chart_id, Visualizer_Plugin::CF_JSON_SCHEDULE );
256
+
257
+ if ( -1 < $time ) {
258
+ add_post_meta( $chart_id, Visualizer_Plugin::CF_JSON_SCHEDULE, $time );
259
+ }
260
+
261
+ // delete other source specific parameters.
262
+ delete_post_meta( $chart_id, Visualizer_Plugin::CF_DB_QUERY );
263
+ delete_post_meta( $chart_id, Visualizer_Plugin::CF_DB_SCHEDULE );
264
+ delete_post_meta( $chart_id, Visualizer_Plugin::CF_CHART_URL );
265
+ delete_post_meta( $chart_id, Visualizer_Plugin::CF_CHART_SCHEDULE );
266
+
267
  $render = new Visualizer_Render_Page_Update();
268
  $render->id = $chart->ID;
269
  $render->data = json_encode( $source->getRawData() );
600
  /**
601
  * Load code editor assets.
602
  */
603
+ private function loadCodeEditorAssets( $chart_id ) {
604
  global $wp_version;
605
 
606
  $wp_scripts = wp_scripts();
616
  return;
617
  }
618
 
619
+ $table_col_mapping = Visualizer_Source_Query_Params::get_all_db_tables_column_mapping( $chart_id );
620
 
621
  if ( version_compare( $wp_version, '4.9.0', '<' ) ) {
622
  // code mirror assets.
715
  wp_enqueue_script( 'visualizer-chosen' );
716
  wp_enqueue_script( 'visualizer-render' );
717
 
718
+ if ( Visualizer_Module::can_show_feature( 'simple-editor' ) ) {
719
  wp_enqueue_script( 'visualizer-editor-simple' );
720
  wp_localize_script(
721
  'visualizer-editor-simple',
732
  );
733
  }
734
 
735
+ $table_col_mapping = $this->loadCodeEditorAssets( $this->_chart->ID );
736
 
737
  wp_localize_script(
738
  'visualizer-render',
739
  'visualizer',
740
  array(
741
  'l10n' => array(
742
+ 'invalid_source' => esc_html__( 'You have entered an invalid URL. Please provide a valid URL.', 'visualizer' ),
743
  'loading' => esc_html__( 'Loading...', 'visualizer' ),
744
  'json_error' => esc_html__( 'An error occured in fetching data.', 'visualizer' ),
745
+ 'select_columns' => esc_html__( 'Please select a few columns to include in the chart.', 'visualizer' ),
746
  ),
747
  'charts' => array(
748
  'canvas' => $data,
794
  $render->button = esc_attr__( 'Insert Chart', 'visualizer' );
795
  }
796
 
797
+ do_action( 'visualizer_enqueue_scripts_and_styles', $data, $this->_chart->ID );
798
 
799
  if ( Visualizer_Module::is_pro() && Visualizer_Module::is_pro_older_than( '1.9.0' ) ) {
800
  global $Visualizer_Pro;
801
+ $Visualizer_Pro->_enqueueScriptsAndStyles( $data, $this->_chart->ID );
802
  }
803
 
804
  $this->_addAction( 'admin_head', 'renderFlattrScript' );
871
  *
872
  * @since 3.2.0
873
  */
874
+ private function handleCSVasString( $data, $editor_type ) {
875
  $source = null;
876
 
877
+ switch ( $editor_type ) {
878
+ case 'text':
879
+ // data coming in from the text editor.
880
+ $tmpfile = tempnam( get_temp_dir(), Visualizer_Plugin::NAME );
881
+ $handle = fopen( $tmpfile, 'w' );
882
+ $values = preg_split( '/[\n\r]+/', stripslashes( trim( $data ) ) );
883
+ if ( $values ) {
884
+ foreach ( $values as $row ) {
885
+ if ( empty( $row ) ) {
886
+ continue;
887
+ }
888
+ // don't use fpucsv here because we need to just dump the data
889
+ // minus the empty rows
890
+ // and if any row contains ' or ", fputcsv will mess it up
891
+ // because fputcsv needs to tokenize
892
+ // and let's standardize the CSV enclosure
893
+ $row = str_replace( "'", VISUALIZER_CSV_ENCLOSURE, $row );
894
+ fwrite( $handle, $row );
895
+ fwrite( $handle, PHP_EOL );
896
  }
 
 
897
  }
898
+ $source = new Visualizer_Source_Csv( $tmpfile );
899
+ fclose( $handle );
900
+ break;
901
+ case 'excel':
902
+ // data coming in from the excel editor.
903
+ $source = apply_filters( 'visualizer_pro_handle_chart_data', $data, '' );
904
+ break;
905
  }
906
  return $source;
907
  }
952
  for ( $j = 0; $j < count( $columns[0] ); $j++ ) {
953
  $row = array();
954
  for ( $i = 0; $i < count( $headers ); $i++ ) {
955
+ $row[] = sanitize_text_field( $columns[ $i ][ $j ] );
956
  }
957
  $csv[] = $row;
958
  }
1007
  exit;
1008
  }
1009
 
1010
+ do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'Uploading data for chart %d with POST = %s and GET = %s', $chart_id, print_r( $_POST, true ), print_r( $_GET, true ) ), 'debug', __FILE__, __LINE__ );
1011
+
1012
  if ( ! isset( $_POST['vz-import-time'] ) ) {
1013
  apply_filters( 'visualizer_pro_remove_schedule', $chart_id );
1014
  }
1022
  // delete "import from db" specific parameters.
1023
  delete_post_meta( $chart_id, Visualizer_Plugin::CF_DB_QUERY );
1024
  delete_post_meta( $chart_id, Visualizer_Plugin::CF_DB_SCHEDULE );
1025
+ delete_post_meta( $chart_id, Visualizer_Plugin::CF_REMOTE_DB_PARAMS );
1026
  }
1027
 
1028
  // delete json related data.
1029
  delete_post_meta( $chart_id, Visualizer_Plugin::CF_JSON_URL );
1030
  delete_post_meta( $chart_id, Visualizer_Plugin::CF_JSON_ROOT );
1031
  delete_post_meta( $chart_id, Visualizer_Plugin::CF_JSON_PAGING );
1032
+ delete_post_meta( $chart_id, Visualizer_Plugin::CF_JSON_HEADERS );
1033
+
1034
+ // delete last error
1035
+ delete_post_meta( $chart_id, Visualizer_Plugin::CF_ERROR );
1036
+
1037
+ // delete editor related data.
1038
+ delete_post_meta( $chart_id, Visualizer_Plugin::CF_EDITOR );
1039
 
1040
  $source = null;
1041
  $render = new Visualizer_Render_Page_Update();
1048
  } elseif ( isset( $_FILES['local_data'] ) && $_FILES['local_data']['error'] == 0 ) {
1049
  $source = new Visualizer_Source_Csv( $_FILES['local_data']['tmp_name'] );
1050
  } elseif ( isset( $_POST['chart_data'] ) && strlen( $_POST['chart_data'] ) > 0 ) {
1051
+ $source = $this->handleCSVasString( $_POST['chart_data'], $_POST['editor-type'] );
1052
+ update_post_meta( $chart_id, Visualizer_Plugin::CF_EDITOR, $_POST['editor-type'] );
1053
  } elseif ( isset( $_POST['table_data'] ) && 'yes' === $_POST['table_data'] ) {
1054
  $source = $this->handleTabularData();
1055
+ update_post_meta( $chart_id, Visualizer_Plugin::CF_EDITOR, $_POST['editor-type'] );
1056
  } else {
1057
+ do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'CSV file with chart data was not uploaded for chart %d.', $chart_id ), 'error', __FILE__, __LINE__ );
1058
  $render->message = esc_html__( 'CSV file with chart data was not uploaded. Please try again.', 'visualizer' );
1059
+ update_post_meta( $chart_id, Visualizer_Plugin::CF_ERROR, esc_html__( 'CSV file with chart data was not uploaded. Please try again.', 'visualizer' ) );
1060
  }
1061
+
1062
+ do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'Uploaded data for chart %d with source %s', $chart_id, print_r( $source, true ) ), 'debug', __FILE__, __LINE__ );
1063
+
1064
  if ( $source ) {
1065
  if ( $source->fetch() ) {
1066
  $content = $source->getData();
1071
  // if we populate the data even if it is empty, the chart will show "Table has no columns".
1072
  if ( array_key_exists( 'source', $json ) && ! empty( $json['source'] ) && ( ! array_key_exists( 'data', $json ) || empty( $json['data'] ) ) ) {
1073
  do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'Not populating chart data as source exists (%s) but data is empty!', $json['source'] ), 'warn', __FILE__, __LINE__ );
1074
+ update_post_meta( $chart_id, Visualizer_Plugin::CF_ERROR, sprintf( 'Not populating chart data as source exists (%s) but data is empty!', $json['source'] ) );
1075
  $populate = false;
1076
  }
1077
  }
1083
  update_post_meta( $chart->ID, Visualizer_Plugin::CF_SOURCE, $source->getSourceName() );
1084
  update_post_meta( $chart->ID, Visualizer_Plugin::CF_DEFAULT_DATA, 0 );
1085
 
1086
+ do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'Updated post for chart %d', $chart_id ), 'debug', __FILE__, __LINE__ );
1087
+
1088
  Visualizer_Module_Utility::set_defaults( $chart, null );
1089
 
1090
  $settings = get_post_meta( $chart->ID, Visualizer_Plugin::CF_SETTINGS, true );
1094
  $render->series = json_encode( $source->getSeries() );
1095
  $render->settings = json_encode( $settings );
1096
  } else {
1097
+ $error = $source->get_error();
1098
+ if ( empty( $error ) ) {
1099
+ $error = esc_html__( 'CSV file is broken or invalid. Please try again.', 'visualizer' );
1100
  }
1101
+ $render->message = $error;
1102
+ do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( '%s for chart %d.', $error, $chart_id ), 'error', __FILE__, __LINE__ );
1103
+ update_post_meta( $chart_id, Visualizer_Plugin::CF_ERROR, $error );
1104
  }
1105
+ } else {
1106
+ do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'Unknown internal error for chart %d.', $chart_id ), 'error', __FILE__, __LINE__ );
1107
  }
1108
  $render->render();
1109
  if ( ! $can_die ) {
1212
  $render = new Visualizer_Render_Page_Data();
1213
  $render->chart = $this->_chart;
1214
  $render->type = $data['type'];
1215
+
1216
+ if ( $data && $data['settings'] ) {
1217
+ unset( $data['settings']['width'], $data['settings']['height'], $data['settings']['chartArea'] );
1218
+ }
1219
  wp_enqueue_style( 'visualizer-frame' );
1220
  wp_enqueue_script( 'visualizer-render' );
1221
  wp_localize_script(
1223
  'visualizer',
1224
  array(
1225
  'l10n' => array(
1226
+ 'invalid_source' => esc_html__( 'You have entered an invalid URL. Please provide a valid URL.', 'visualizer' ),
1227
  'loading' => esc_html__( 'Loading...', 'visualizer' ),
1228
  ),
1229
  'charts' => array(
1232
  )
1233
  );
1234
 
1235
+ do_action( 'visualizer_enqueue_scripts_and_styles', $data, $this->_chart->ID );
1236
 
1237
  if ( Visualizer_Module::is_pro() && Visualizer_Module::is_pro_older_than( '1.9.0' ) ) {
1238
  global $Visualizer_Pro;
1239
+ $Visualizer_Pro->_enqueueScriptsAndStyles( $data, $this->_chart->ID );
1240
  }
1241
 
1242
  // Added by Ash/Upwork
1253
  check_ajax_referer( Visualizer_Plugin::ACTION_FETCH_DB_DATA . Visualizer_Plugin::VERSION, 'security' );
1254
 
1255
  $params = wp_parse_args( $_POST['params'] );
1256
+ $chart_id = filter_var( $params['chart_id'], FILTER_VALIDATE_INT );
1257
+
1258
+ $source = new Visualizer_Source_Query( stripslashes( $params['query'] ), $chart_id, $params );
1259
  $html = $source->fetch( true );
1260
+ $error = $source->get_error();
1261
+ if ( ! empty( $error ) ) {
 
1262
  wp_send_json_error( array( 'msg' => $error ) );
1263
  }
1264
  wp_send_json_success( array( 'table' => $html ) );
1283
  )
1284
  );
1285
 
1286
+ $hours = filter_input(
1287
+ INPUT_POST,
1288
+ 'refresh',
1289
+ FILTER_VALIDATE_INT,
1290
+ array(
1291
+ 'options' => array(
1292
+ 'min_range' => -1,
1293
+ 'max_range' => apply_filters( 'visualizer_is_business', false ) ? PHP_INT_MAX : -1,
1294
+ ),
1295
+ )
1296
+ );
1297
+
1298
+ if ( ! is_int( $hours ) ) {
1299
+ $hours = -1;
1300
+ }
1301
+
1302
  $render = new Visualizer_Render_Page_Update();
1303
  if ( $chart_id ) {
1304
  $params = wp_parse_args( $_POST['params'] );
1305
+ $source = new Visualizer_Source_Query( stripslashes( $params['query'] ), $chart_id, $params );
1306
  $source->fetch( false );
1307
  $error = $source->get_error();
1308
  if ( empty( $error ) ) {
 
1309
  update_post_meta( $chart_id, Visualizer_Plugin::CF_DB_QUERY, stripslashes( $params['query'] ) );
1310
  update_post_meta( $chart_id, Visualizer_Plugin::CF_SOURCE, $source->getSourceName() );
1311
  update_post_meta( $chart_id, Visualizer_Plugin::CF_SERIES, $source->getSeries() );
1312
  update_post_meta( $chart_id, Visualizer_Plugin::CF_DB_SCHEDULE, $hours );
1313
  update_post_meta( $chart_id, Visualizer_Plugin::CF_DEFAULT_DATA, 0 );
1314
+ if ( isset( $params['db_type'] ) && $params['db_type'] !== Visualizer_Plugin::WP_DB_NAME ) {
1315
+ $remote_db_params = $params;
1316
+ unset( $remote_db_params['query'] );
1317
+ unset( $remote_db_params['chart_id'] );
1318
+ update_post_meta( $chart_id, Visualizer_Plugin::CF_REMOTE_DB_PARAMS, $remote_db_params );
1319
+ }
1320
 
1321
  $schedules = get_option( Visualizer_Plugin::CF_DB_SCHEDULE, array() );
1322
  $schedules[ $chart_id ] = time() + $hours * HOUR_IN_SECONDS;
1330
  );
1331
  $render->data = json_encode( $source->getRawData() );
1332
  $render->series = json_encode( $source->getSeries() );
1333
+ $render->id = $chart_id;
1334
  } else {
1335
  $render->message = $error;
1336
  }
1361
  )
1362
  );
1363
 
1364
+ $hours = filter_input(
1365
+ INPUT_POST,
1366
+ 'refresh',
1367
+ FILTER_VALIDATE_INT,
1368
+ array(
1369
+ 'options' => array(
1370
+ 'min_range' => -1,
1371
+ 'max_range' => apply_filters( 'visualizer_is_business', false ) ? PHP_INT_MAX : -1,
1372
+ ),
1373
+ )
1374
+ );
1375
+
1376
+ if ( ! $hours ) {
1377
+ $hours = -1;
1378
+ }
1379
 
1380
  do_action( 'visualizer_save_filter', $chart_id, $hours );
1381
 
classes/Visualizer/Module/Setup.php CHANGED
@@ -51,8 +51,10 @@ class Visualizer_Module_Setup extends Visualizer_Module {
51
  $this->_addAction( 'init', 'setupCustomPostTypes' );
52
  $this->_addAction( 'plugins_loaded', 'loadTextDomain' );
53
  $this->_addFilter( 'visualizer_logger_data', 'getLoggerData' );
54
- $this->_addFilter( 'visualizer_get_chart_counts', 'getChartCountsByTypeAndMeta' );
55
 
 
 
56
  }
57
  /**
58
  * Fetches the SDK logger data.
@@ -62,34 +64,80 @@ class Visualizer_Module_Setup extends Visualizer_Module {
62
  * @access public
63
  */
64
  public function getLoggerData( $data ) {
65
- return $this->getChartCountsByTypeAndMeta();
66
  }
67
 
68
  /**
69
- * Fetches the types of charts created and their counts.
70
  *
 
71
  * @param array $meta_keys An array of name vs. meta keys - to return how many charts have these keys.
72
- * @access private
 
73
  */
74
- public function getChartCountsByTypeAndMeta( $meta_keys = array() ) {
75
- $charts = array();
76
- $charts['chart_types'] = array();
77
- // the initial query arguments to fetch charts
78
  $query_args = array(
79
  'post_type' => Visualizer_Plugin::CPT_VISUALIZER,
80
  'posts_per_page' => 300,
 
81
  'fields' => 'ids',
82
  'no_rows_found' => false,
83
  'update_post_meta_cache' => false,
84
  'update_post_term_cache' => false,
 
85
 
 
 
 
 
 
 
86
  );
87
 
 
 
 
 
 
88
  $query = new WP_Query( $query_args );
89
  while ( $query->have_posts() ) {
90
  $chart_id = $query->next_post();
91
  $type = get_post_meta( $chart_id, Visualizer_Plugin::CF_CHART_TYPE, true );
92
- $charts['chart_types'][ $type ] = isset( $charts['chart_types'][ $type ] ) ? $charts['chart_types'][ $type ] + 1 : 1;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  if ( ! empty( $meta_keys ) ) {
94
  foreach ( $meta_keys as $name => $key ) {
95
  $data = get_post_meta( $chart_id, $key, true );
@@ -101,6 +149,7 @@ class Visualizer_Module_Setup extends Visualizer_Module {
101
  }
102
  }
103
  }
 
104
  return $charts;
105
  }
106
 
@@ -209,7 +258,7 @@ class Visualizer_Module_Setup extends Visualizer_Module {
209
  }
210
 
211
  $params = get_post_meta( $chart_id, Visualizer_Plugin::CF_DB_QUERY, true );
212
- $source = new Visualizer_Source_Query( $params );
213
  $source->fetch( false );
214
  $load_series = true;
215
  break;
@@ -230,6 +279,17 @@ class Visualizer_Module_Setup extends Visualizer_Module {
230
  $source = new Visualizer_Source_Json( array( 'url' => $url, 'root' => $root, 'paging' => $paging ) );
231
  $source->refresh( $series );
232
  break;
 
 
 
 
 
 
 
 
 
 
 
233
  default:
234
  return $chart;
235
  }
@@ -249,6 +309,9 @@ class Visualizer_Module_Setup extends Visualizer_Module {
249
  );
250
 
251
  $chart = get_post( $chart_id );
 
 
 
252
  }
253
 
254
  return $chart;
51
  $this->_addAction( 'init', 'setupCustomPostTypes' );
52
  $this->_addAction( 'plugins_loaded', 'loadTextDomain' );
53
  $this->_addFilter( 'visualizer_logger_data', 'getLoggerData' );
54
+ $this->_addFilter( 'visualizer_get_chart_counts', 'getUsage', 10, 2 );
55
 
56
+ // only for testing
57
+ // $this->_addAction( 'admin_init', 'getUsage' );
58
  }
59
  /**
60
  * Fetches the SDK logger data.
64
  * @access public
65
  */
66
  public function getLoggerData( $data ) {
67
+ return $this->getUsage( $data );
68
  }
69
 
70
  /**
71
+ * Fetches the usage of charts.
72
  *
73
+ * @param array $data The default data that needs to be sent.
74
  * @param array $meta_keys An array of name vs. meta keys - to return how many charts have these keys.
75
+ *
76
+ * @access public
77
  */
78
+ public function getUsage( $data, $meta_keys = array() ) {
79
+ $charts = array( 'types' => array(), 'sources' => array(), 'library' => array(), 'permissions' => 0, 'manual_config' => 0, 'scheduled' => 0 );
 
 
80
  $query_args = array(
81
  'post_type' => Visualizer_Plugin::CPT_VISUALIZER,
82
  'posts_per_page' => 300,
83
+ 'post_status' => 'publish',
84
  'fields' => 'ids',
85
  'no_rows_found' => false,
86
  'update_post_meta_cache' => false,
87
  'update_post_term_cache' => false,
88
+ );
89
 
90
+ // default permissions.
91
+ $default_perms = array(
92
+ 'read' => 'all',
93
+ 'read-specific' => null,
94
+ 'edit' => 'roles',
95
+ 'edit-specific' => array( 'administrator' ),
96
  );
97
 
98
+ // collect all schedules chart ids.
99
+ $scheduled = array_merge(
100
+ array_keys( get_option( Visualizer_Plugin::CF_CHART_SCHEDULE, array() ) ),
101
+ array_keys( get_option( Visualizer_Plugin::CF_DB_SCHEDULE, array() ) )
102
+ );
103
  $query = new WP_Query( $query_args );
104
  while ( $query->have_posts() ) {
105
  $chart_id = $query->next_post();
106
  $type = get_post_meta( $chart_id, Visualizer_Plugin::CF_CHART_TYPE, true );
107
+ $charts['types'][ $type ] = isset( $charts['types'][ $type ] ) ? $charts['types'][ $type ] + 1 : 1;
108
+ $source = get_post_meta( $chart_id, Visualizer_Plugin::CF_SOURCE, true );
109
+ $charts['sources'][ $source ] = isset( $charts['sources'][ $source ] ) ? $charts['sources'][ $source ] + 1 : 1;
110
+ $lib = get_post_meta( $chart_id, Visualizer_Plugin::CF_CHART_LIBRARY, true );
111
+ $charts['library'][ $lib ] = isset( $charts['library'][ $lib ] ) ? $charts['library'][ $lib ] + 1 : 1;
112
+ $settings = get_post_meta( $chart_id, Visualizer_Plugin::CF_SETTINGS, true );
113
+ if ( array_key_exists( 'manual', $settings ) && ! empty( $settings['manual'] ) ) {
114
+ $charts['manual_config'] = $charts['manual_config'] + 1;
115
+ }
116
+
117
+ // phpcs:ignore WordPress.PHP.StrictInArray.FoundNonStrictFalse
118
+ if ( in_array( $chart_id, $scheduled, false ) ) {
119
+ $charts['scheduled'] = $charts['scheduled'] + 1;
120
+ }
121
+
122
+ if ( Visualizer_Module::is_pro() ) {
123
+ $permissions = get_post_meta( $chart_id, Visualizer_PRO::CF_PERMISSIONS, true );
124
+ if ( empty( $permissions ) ) {
125
+ continue;
126
+ }
127
+ $permissions = $permissions['permissions'];
128
+ $customized = false;
129
+ foreach ( $default_perms as $key => $val ) {
130
+ if ( ! is_array( $val ) && ! is_null( $val ) && isset( $permissions[ $key ] ) && $permissions[ $key ] !== $val ) {
131
+ $customized = true;
132
+ } elseif ( is_array( $val ) && ! is_null( $val ) && isset( $permissions[ $key ] ) && count( $permissions[ $key ] ) !== count( $val ) ) {
133
+ $customized = true;
134
+ }
135
+ }
136
+ if ( $customized ) {
137
+ $charts['permissions'] = $charts['permissions'] + 1;
138
+ }
139
+ }
140
+
141
  if ( ! empty( $meta_keys ) ) {
142
  foreach ( $meta_keys as $name => $key ) {
143
  $data = get_post_meta( $chart_id, $key, true );
149
  }
150
  }
151
  }
152
+
153
  return $charts;
154
  }
155
 
258
  }
259
 
260
  $params = get_post_meta( $chart_id, Visualizer_Plugin::CF_DB_QUERY, true );
261
+ $source = new Visualizer_Source_Query( $params, $chart_id );
262
  $source->fetch( false );
263
  $load_series = true;
264
  break;
279
  $source = new Visualizer_Source_Json( array( 'url' => $url, 'root' => $root, 'paging' => $paging ) );
280
  $source->refresh( $series );
281
  break;
282
+ case 'Visualizer_Source_Csv_Remote':
283
+ // check if its a live-data chart or a cached-data chart.
284
+ if ( ! $force ) {
285
+ $hours = get_post_meta( $chart_id, Visualizer_Plugin::CF_CHART_SCHEDULE, true );
286
+ if ( ! empty( $hours ) ) {
287
+ // cached, bail!
288
+ return $chart;
289
+ }
290
+ }
291
+ do_action( 'visualizer_schedule_import' );
292
+ return get_post( $chart_id );
293
  default:
294
  return $chart;
295
  }
309
  );
310
 
311
  $chart = get_post( $chart_id );
312
+ delete_post_meta( $chart_id, Visualizer_Plugin::CF_ERROR );
313
+ } else {
314
+ update_post_meta( $chart_id, Visualizer_Plugin::CF_ERROR, sprintf( 'Error while updating chart: %s', $error ) );
315
  }
316
 
317
  return $chart;
classes/Visualizer/Module/Sources.php CHANGED
@@ -130,10 +130,14 @@ class Visualizer_Module_Sources extends Visualizer_Module {
130
  * @return string The new html code.
131
  */
132
  public function addProUpsell( $old, $feature = null ) {
133
- $biz_features = array( 'schedule-chart', 'chart-permissions', 'db-query' );
 
134
  $return = '';
135
  $feature = strval( $feature );
136
- if ( empty( $feature ) || ( in_array( $feature, $biz_features, true ) && ! apply_filters( 'visualizer_is_business', false ) ) ) {
 
 
 
137
  $msg = sprintf( __( 'Upgrade to %s to activate this feature!', 'visualizer' ), 'PRO' );
138
  if ( Visualizer_Module::is_pro() && in_array( $feature, $biz_features, true ) ) {
139
  $msg = sprintf( __( 'Upgrade your license to at least the %s version to activate this feature!', 'visualizer' ), 'DEVELOPER' );
130
  * @return string The new html code.
131
  */
132
  public function addProUpsell( $old, $feature = null ) {
133
+ $pro_features = Visualizer_Module::get_features_for_license( 1 );
134
+ $biz_features = Visualizer_Module::get_features_for_license( 2 );
135
  $return = '';
136
  $feature = strval( $feature );
137
+ if ( empty( $feature ) ||
138
+ ( in_array( $feature, $biz_features, true ) && ! apply_filters( 'visualizer_is_business', false ) ) ||
139
+ ( in_array( $feature, $pro_features, true ) && ! Visualizer_Module::is_pro() )
140
+ ) {
141
  $msg = sprintf( __( 'Upgrade to %s to activate this feature!', 'visualizer' ), 'PRO' );
142
  if ( Visualizer_Module::is_pro() && in_array( $feature, $biz_features, true ) ) {
143
  $msg = sprintf( __( 'Upgrade your license to at least the %s version to activate this feature!', 'visualizer' ), 'DEVELOPER' );
classes/Visualizer/Plugin.php CHANGED
@@ -28,7 +28,7 @@
28
  class Visualizer_Plugin {
29
 
30
  const NAME = 'visualizer';
31
- const VERSION = '3.3.4';
32
 
33
  // custom post types
34
  const CPT_VISUALIZER = 'visualizer';
@@ -40,6 +40,8 @@ class Visualizer_Plugin {
40
  const CF_DEFAULT_DATA = 'visualizer-default-data';
41
  const CF_SETTINGS = 'visualizer-settings';
42
  const CF_CHART_LIBRARY = 'visualizer-chart-library';
 
 
43
 
44
  const CF_SOURCE_FILTER = 'visualizer-source-filter';
45
  const CF_FILTER_CONFIG = 'visualizer-filter-config';
@@ -72,6 +74,8 @@ class Visualizer_Plugin {
72
  const CF_JSON_ROOT = 'visualizer-json-root';
73
  const CF_JSON_SCHEDULE = 'visualizer-json-schedule';
74
  const CF_JSON_PAGING = 'visualizer-json-paging';
 
 
75
 
76
  const ACTION_SAVE_FILTER_QUERY = 'visualizer-save-filter-query';
77
 
@@ -92,6 +96,12 @@ class Visualizer_Plugin {
92
  // Added by Ash/Upwork
93
  const PRO_TEASER_URL = 'https://themeisle.com/plugins/visualizer-charts-and-graphs/upgrade/#pricing';
94
  const PRO_TEASER_TITLE = 'Check PRO version ';
 
 
 
 
 
 
95
  // Added by Ash/Upwork
96
  /**
97
  * Singletone instance of the plugin.
28
  class Visualizer_Plugin {
29
 
30
  const NAME = 'visualizer';
31
+ const VERSION = '3.4.0';
32
 
33
  // custom post types
34
  const CPT_VISUALIZER = 'visualizer';
40
  const CF_DEFAULT_DATA = 'visualizer-default-data';
41
  const CF_SETTINGS = 'visualizer-settings';
42
  const CF_CHART_LIBRARY = 'visualizer-chart-library';
43
+ const CF_ERROR = 'visualizer-error';
44
+ const CF_REMOTE_DB_PARAMS = 'visualizer-remote-db-params';
45
 
46
  const CF_SOURCE_FILTER = 'visualizer-source-filter';
47
  const CF_FILTER_CONFIG = 'visualizer-filter-config';
74
  const CF_JSON_ROOT = 'visualizer-json-root';
75
  const CF_JSON_SCHEDULE = 'visualizer-json-schedule';
76
  const CF_JSON_PAGING = 'visualizer-json-paging';
77
+ const CF_JSON_HEADERS = 'visualizer-json-headers';
78
+ const CF_EDITOR = 'visualizer-editor';
79
 
80
  const ACTION_SAVE_FILTER_QUERY = 'visualizer-save-filter-query';
81
 
96
  // Added by Ash/Upwork
97
  const PRO_TEASER_URL = 'https://themeisle.com/plugins/visualizer-charts-and-graphs/upgrade/#pricing';
98
  const PRO_TEASER_TITLE = 'Check PRO version ';
99
+
100
+ /**
101
+ * Name of the option for WordPress DB.
102
+ */
103
+ const WP_DB_NAME = 'WordPress DB';
104
+
105
  // Added by Ash/Upwork
106
  /**
107
  * Singletone instance of the plugin.
classes/Visualizer/Render/Layout.php CHANGED
@@ -60,6 +60,8 @@ class Visualizer_Render_Layout extends Visualizer_Render {
60
  <div class="visualizer-db-query-form">
61
  <div>
62
  <form id='db-query-form'>
 
 
63
  <textarea name='query' class='visualizer-db-query' placeholder="<?php _e( 'Your query goes here', 'visualizer' ); ?>"><?php echo $query; ?></textarea>
64
  </form>
65
  <div class='db-wizard-error'></div>
@@ -72,6 +74,7 @@ class Visualizer_Render_Layout extends Visualizer_Render {
72
  <ul>
73
  <li><?php echo sprintf( __( 'For examples of queries and links to resources that you can use with this feature, please click %1$shere%2$s', 'visualizer' ), '<a href="' . VISUALIZER_DB_QUERY_DOC_URL . '" target="_blank">', '</a>' ); ?></li>
74
  <li><?php echo sprintf( __( 'Use %1$sControl+Space%2$s for autocompleting keywords or table names.', 'visualizer' ), '<span class="visualizer-emboss">', '</span>' ); ?></li>
 
75
  </ul>
76
  </div>
77
  <div class='db-wizard-results'></div>
@@ -137,7 +140,11 @@ class Visualizer_Render_Layout extends Visualizer_Render {
137
  $url = get_post_meta( $id, Visualizer_Plugin::CF_JSON_URL, true );
138
  $root = get_post_meta( $id, Visualizer_Plugin::CF_JSON_ROOT, true );
139
  $paging = get_post_meta( $id, Visualizer_Plugin::CF_JSON_PAGING, true );
140
-
 
 
 
 
141
  ?>
142
  <div id="visualizer-json-screen" style="display: none">
143
  <div class="visualizer-json-form">
@@ -146,7 +153,7 @@ class Visualizer_Render_Layout extends Visualizer_Render {
146
  <form id="json-endpoint-form">
147
  <div class="json-wizard-hints">
148
  <ul class="info">
149
- <li><?php echo sprintf( __( 'If you want to add authentication, add headers to the endpoint or change the request in any way, please refer to our document %1$shere%2$s.', 'visualizer' ), '<a href="https://docs.themeisle.com/article/1043-visualizer-how-to-extend-rest-endpoints-with-json-response" target="_blank">', '</a>' ); ?></li>
150
  </ul>
151
  </div>
152
 
@@ -156,15 +163,67 @@ class Visualizer_Render_Layout extends Visualizer_Render {
156
  name="url"
157
  value="<?php echo esc_url( $url ); ?>"
158
  placeholder="<?php esc_html_e( 'Please enter the URL', 'visualizer' ); ?>"
159
- class="visualizer-input">
160
  <button class="button button-secondary button-small" id="visualizer-json-fetch"><?php esc_html_e( 'Fetch Endpoint', 'visualizer' ); ?></button>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
  </form>
162
  </div>
163
  <h3 class="viz-step step2 <?php echo empty( $url ) ? 'ui-state-disabled' : ''; ?> json-root-form"><?php _e( 'STEP 2: Choose the JSON root', 'visualizer' ); ?></h3>
164
  <div>
165
  <form id="json-root-form">
166
  <input type="hidden" name="chart" value="<?php echo $id; ?>">
167
- <select name="root" id="vz-import-json-root">
168
  <?php
169
  if ( ! empty( $root ) ) {
170
  ?>
@@ -173,7 +232,6 @@ class Visualizer_Render_Layout extends Visualizer_Render {
173
  }
174
  ?>
175
  </select>
176
- <input type="hidden" name="url" value="<?php echo $url; ?>">
177
  <button class="button button-secondary button-small" id="visualizer-json-parse"><?php esc_html_e( 'Parse Endpoint', 'visualizer' ); ?></button>
178
  </form>
179
  </div>
@@ -182,12 +240,12 @@ class Visualizer_Render_Layout extends Visualizer_Render {
182
  <form id="json-conclude-form-helper">
183
  <div class="<?php echo apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature' ); ?>">
184
  <div class="json-pagination">
185
- <select name="paging" id="vz-import-json-paging" class="json-form-element" data-template='<?php echo sprintf( 'Get first %d pages using %s', apply_filters( 'visualizer_json_fetch_pages', 5, $url ), '?' ); ?>'>
186
- <option value="0" class="static"><?php _e( 'Don\'t use pagination', 'visualizer' ); ?></option>
187
  <?php
188
  if ( ! empty( $paging ) ) {
189
  ?>
190
- <option value="<?php echo esc_attr( $paging ); ?>"><?php echo sprintf( 'Get first %d pages using %s', apply_filters( 'visualizer_json_fetch_pages', 5, $url ), str_replace( Visualizer_Source_Json::TAG_SEPARATOR, Visualizer_Source_Json::TAG_SEPARATOR_VIEW, $paging ) ); ?></option>
191
  <?php
192
  }
193
  ?>
@@ -210,20 +268,18 @@ class Visualizer_Render_Layout extends Visualizer_Render {
210
  <h3 class="viz-step step4 ui-state-disabled"><?php _e( 'STEP 4: Select the data to display in the chart', 'visualizer' ); ?></h3>
211
  <div>
212
  <form id="json-conclude-form" action="<?php echo $action; ?>" method="post" target="thehole">
213
- <input type="hidden" name="url">
214
- <input type="hidden" name="root">
215
- <input type="hidden" name="chart" value="<?php echo $id; ?>">
216
-
217
  <div class="json-wizard-hints html-table-editor-hints">
218
  <ul class="info">
 
219
  <li><?php _e( 'Select whether to include the data in the chart. Each column selected will form one series.', 'visualizer' ); ?></li>
220
  <li><?php _e( 'If a column is selected to be included, specify its data type.', 'visualizer' ); ?></li>
221
  <li><?php _e( 'You can use drag/drop to reorder the columns but this column position is not saved. So when you reload the table, you may have to reorder again.', 'visualizer' ); ?></li>
222
  <li><?php _e( 'You can select any number of columns but the chart type selected will determine how many will display in the chart.', 'visualizer' ); ?></li>
 
223
  </ul>
224
  </div>
225
  <div class="json-table"></div>
226
- <button class="button button-primary" id="visualizer-json-conclude"><?php esc_html_e( 'Save &amp; Show Chart', 'visualizer' ); ?></button>
227
  </form>
228
  </div>
229
  </div>
@@ -262,7 +318,7 @@ class Visualizer_Render_Layout extends Visualizer_Render {
262
  <?php Visualizer_Render_Layout::show( 'editor-table', null, $chart_id, 'viz-html-table', true, true ); ?>
263
  </div>
264
  <input type="hidden" name="table_data" value="yes">
265
- <button class="button button-primary" id="visualizer-save-html-table"><?php esc_html_e( 'Save &amp; Show Chart', 'visualizer' ); ?></button>
266
  </form>
267
  </div>
268
 
@@ -280,7 +336,7 @@ class Visualizer_Render_Layout extends Visualizer_Render {
280
  */
281
  public static function _renderTextEditor( $args ) {
282
  $chart_id = $args[1];
283
- $csv = apply_filters( Visualizer_Plugin::FILTER_GET_CHART_DATA_AS, array(), $chart_id, 'csv' );
284
  $data = '';
285
  if ( ! empty( $csv ) && isset( $csv['string'] ) ) {
286
  $data = str_replace( PHP_EOL, "\n", $csv['string'] );
@@ -288,7 +344,6 @@ class Visualizer_Render_Layout extends Visualizer_Render {
288
  ?>
289
  <div class="viz-simple-editor-type viz-text-editor">
290
  <textarea id="edited_text"><?php echo $data; ?></textarea>
291
- <button id="viz-text-editor-button" class="button button-primary"><?php _e( 'Save &amp; Show Chart', 'visualizer' ); ?></button>
292
  </div>
293
  <?php
294
  }
@@ -313,7 +368,7 @@ class Visualizer_Render_Layout extends Visualizer_Render {
313
  }
314
  $chart = get_post( $chart_id );
315
  $type = get_post_meta( $chart_id, Visualizer_Plugin::CF_CHART_TYPE, true );
316
- $data = apply_filters( Visualizer_Plugin::FILTER_GET_CHART_DATA, unserialize( html_entity_decode( $chart->post_content ) ), $type );
317
  } else {
318
  $headers = array_keys( $data[0] );
319
  }
@@ -357,7 +412,7 @@ class Visualizer_Render_Layout extends Visualizer_Render {
357
  echo '<select name="type[]">';
358
  } else {
359
  echo '<input name="header[]" type="hidden" value="' . $header . '">';
360
- echo '<select name="type[' . $header . ']">';
361
  }
362
  echo '<option value="" title="' . __( 'Exclude from chart', 'visualizer' ) . '">' . __( 'Exclude', 'visualizer' ) . '</option>';
363
  echo '<option value="0" disabled title="' . __( 'Include in chart and select data type', 'visualizer' ) . '">--' . __( 'OR', 'visualizer' ) . '--</option>';
@@ -376,15 +431,20 @@ class Visualizer_Render_Layout extends Visualizer_Render {
376
  if ( array_key_exists( 'data', $data ) ) {
377
  $data = $data['data'];
378
  }
 
379
  foreach ( $data as $row ) {
380
  echo '<tr>';
381
  echo '<th>' . __( 'Value', 'visualizer' ) . '</th>';
382
  $index = 0;
 
 
 
 
383
  foreach ( array_values( $row ) as $value ) {
384
  if ( $editable_data ) {
385
- echo '<td><input type="text" name="data' . $index++ . '[]" value="' . esc_attr( $value ) . '"></td>';
386
  } else {
387
- echo '<td>' . $value . '</td>';
388
  }
389
  }
390
 
60
  <div class="visualizer-db-query-form">
61
  <div>
62
  <form id='db-query-form'>
63
+ <input type="hidden" name="chart_id" value="<?php echo $args[2]; ?>">
64
+ <?php do_action( 'visualizer_db_query_add_layout', $args ); ?>
65
  <textarea name='query' class='visualizer-db-query' placeholder="<?php _e( 'Your query goes here', 'visualizer' ); ?>"><?php echo $query; ?></textarea>
66
  </form>
67
  <div class='db-wizard-error'></div>
74
  <ul>
75
  <li><?php echo sprintf( __( 'For examples of queries and links to resources that you can use with this feature, please click %1$shere%2$s', 'visualizer' ), '<a href="' . VISUALIZER_DB_QUERY_DOC_URL . '" target="_blank">', '</a>' ); ?></li>
76
  <li><?php echo sprintf( __( 'Use %1$sControl+Space%2$s for autocompleting keywords or table names.', 'visualizer' ), '<span class="visualizer-emboss">', '</span>' ); ?></li>
77
+ <?php do_action( 'visualizer_db_query_add_hints', $args ); ?>
78
  </ul>
79
  </div>
80
  <div class='db-wizard-results'></div>
140
  $url = get_post_meta( $id, Visualizer_Plugin::CF_JSON_URL, true );
141
  $root = get_post_meta( $id, Visualizer_Plugin::CF_JSON_ROOT, true );
142
  $paging = get_post_meta( $id, Visualizer_Plugin::CF_JSON_PAGING, true );
143
+ $headers = get_post_meta( $id, Visualizer_Plugin::CF_JSON_HEADERS, true );
144
+ if ( empty( $headers['method'] ) ) {
145
+ $headers['method'] = 'get';
146
+ }
147
+ $methods = apply_filters( 'visualizer_json_request_methods', array( 'GET', 'POST' ) );
148
  ?>
149
  <div id="visualizer-json-screen" style="display: none">
150
  <div class="visualizer-json-form">
153
  <form id="json-endpoint-form">
154
  <div class="json-wizard-hints">
155
  <ul class="info">
156
+ <li><?php echo sprintf( __( 'If you want to add authentication or headers to the endpoint or change the request in any way, please refer to our document %1$shere%2$s.', 'visualizer' ), '<a href="https://docs.themeisle.com/article/1043-visualizer-how-to-extend-rest-endpoints-with-json-response" target="_blank">', '</a>' ); ?></li>
157
  </ul>
158
  </div>
159
 
163
  name="url"
164
  value="<?php echo esc_url( $url ); ?>"
165
  placeholder="<?php esc_html_e( 'Please enter the URL', 'visualizer' ); ?>"
166
+ class="visualizer-input json-form-element">
167
  <button class="button button-secondary button-small" id="visualizer-json-fetch"><?php esc_html_e( 'Fetch Endpoint', 'visualizer' ); ?></button>
168
+
169
+ <div class="visualizer-json-subform">
170
+ <h3 class="viz-substep"><?php _e( 'Headers', 'visualizer' ); ?></h3>
171
+ <div class="json-wizard-headers">
172
+ <div class="json-wizard-header">
173
+ <div><?php _e( 'Request Type', 'visualizer' ); ?></div>
174
+ <div>
175
+ <select name="method" class="json-form-element">
176
+ <?php foreach ( $methods as $method ) { ?>
177
+ <option value="<?php echo $method; ?>" <?php selected( $headers['method'], $method ); ?>><?php echo $method; ?></option>
178
+ <?php } ?>
179
+ </select>
180
+ </div>
181
+ </div>
182
+ <div class="json-wizard-header">
183
+ <div><?php _e( 'Credentials', 'visualizer' ); ?></div>
184
+ <div>
185
+ <input
186
+ type="text"
187
+ id="vz-import-json-username"
188
+ name="username"
189
+ value="<?php echo ( array_key_exists( 'auth', $headers ) && array_key_exists( 'username', $headers['auth'] ) ? $headers['auth']['username'] : '' ); ?>"
190
+ placeholder="<?php esc_html_e( 'Username/Access Key', 'visualizer' ); ?>"
191
+ class="json-form-element">
192
+ &
193
+ <input
194
+ type="password"
195
+ id="vz-import-json-password"
196
+ name="password"
197
+ value="<?php echo ( array_key_exists( 'auth', $headers ) && array_key_exists( 'password', $headers['auth'] ) ? $headers['auth']['password'] : '' ); ?>"
198
+ placeholder="<?php esc_html_e( 'Password/Secret Key', 'visualizer' ); ?>"
199
+ class="json-form-element">
200
+ </div>
201
+ </div>
202
+ <div class="json-wizard-header">
203
+ <div></div>
204
+ <div><?php esc_html_e( 'OR', 'visualizer' ); ?></div>
205
+ </div>
206
+ <div class="json-wizard-header">
207
+ <div><?php esc_html_e( 'Authorization', 'visualizer' ); ?></div>
208
+ <div>
209
+ <input
210
+ type="text"
211
+ id="vz-import-json-auth"
212
+ name="auth"
213
+ value="<?php echo ( ! empty( $headers ) && array_key_exists( 'auth', $headers ) ? $headers['auth']['auth'] : '' ); ?>"
214
+ placeholder="<?php esc_html_e( 'e.g. SharedKey <AccountName>:<Signature>', 'visualizer' ); ?>"
215
+ class="visualizer-input json-form-element">
216
+ </div>
217
+ </div>
218
+ </div>
219
+ </div>
220
  </form>
221
  </div>
222
  <h3 class="viz-step step2 <?php echo empty( $url ) ? 'ui-state-disabled' : ''; ?> json-root-form"><?php _e( 'STEP 2: Choose the JSON root', 'visualizer' ); ?></h3>
223
  <div>
224
  <form id="json-root-form">
225
  <input type="hidden" name="chart" value="<?php echo $id; ?>">
226
+ <select name="root" id="vz-import-json-root" class="json-form-element">
227
  <?php
228
  if ( ! empty( $root ) ) {
229
  ?>
232
  }
233
  ?>
234
  </select>
 
235
  <button class="button button-secondary button-small" id="visualizer-json-parse"><?php esc_html_e( 'Parse Endpoint', 'visualizer' ); ?></button>
236
  </form>
237
  </div>
240
  <form id="json-conclude-form-helper">
241
  <div class="<?php echo apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature' ); ?>">
242
  <div class="json-pagination">
243
+ <select name="paging" id="vz-import-json-paging" class="json-form-element" data-template='<?php echo sprintf( 'Get results from the first %d pages using %s', apply_filters( 'visualizer_json_fetch_pages', 5, $url ), '?' ); ?>'>
244
+ <option value="0" class="static"><?php _e( 'Get results from the first page only', 'visualizer' ); ?></option>
245
  <?php
246
  if ( ! empty( $paging ) ) {
247
  ?>
248
+ <option value="<?php echo esc_attr( $paging ); ?>"><?php echo sprintf( 'Get results from the first %d pages using %s', apply_filters( 'visualizer_json_fetch_pages', 5, $url ), str_replace( Visualizer_Source_Json::TAG_SEPARATOR, Visualizer_Source_Json::TAG_SEPARATOR_VIEW, $paging ) ); ?></option>
249
  <?php
250
  }
251
  ?>
268
  <h3 class="viz-step step4 ui-state-disabled"><?php _e( 'STEP 4: Select the data to display in the chart', 'visualizer' ); ?></h3>
269
  <div>
270
  <form id="json-conclude-form" action="<?php echo $action; ?>" method="post" target="thehole">
 
 
 
 
271
  <div class="json-wizard-hints html-table-editor-hints">
272
  <ul class="info">
273
+ <li><?php _e( 'If you see Invalid Data in the table, you may have selected the wrong root to fetch data from. Please select an alternative from the JSON root dropdown.', 'visualizer' ); ?></li>
274
  <li><?php _e( 'Select whether to include the data in the chart. Each column selected will form one series.', 'visualizer' ); ?></li>
275
  <li><?php _e( 'If a column is selected to be included, specify its data type.', 'visualizer' ); ?></li>
276
  <li><?php _e( 'You can use drag/drop to reorder the columns but this column position is not saved. So when you reload the table, you may have to reorder again.', 'visualizer' ); ?></li>
277
  <li><?php _e( 'You can select any number of columns but the chart type selected will determine how many will display in the chart.', 'visualizer' ); ?></li>
278
+ <li><?php _e( 'Once you have made your selection, click \'Show Chart\' on the right to view the chart.', 'visualizer' ); ?></li>
279
  </ul>
280
  </div>
281
  <div class="json-table"></div>
282
+ <button class="button button-primary" style="display: none" id="visualizer-json-conclude"></button>
283
  </form>
284
  </div>
285
  </div>
318
  <?php Visualizer_Render_Layout::show( 'editor-table', null, $chart_id, 'viz-html-table', true, true ); ?>
319
  </div>
320
  <input type="hidden" name="table_data" value="yes">
321
+ <input type="hidden" name="editor-type" value="table">
322
  </form>
323
  </div>
324
 
336
  */
337
  public static function _renderTextEditor( $args ) {
338
  $chart_id = $args[1];
339
+ $csv = apply_filters( Visualizer_Plugin::FILTER_GET_CHART_DATA_AS, array(), $chart_id, 'csv-display' );
340
  $data = '';
341
  if ( ! empty( $csv ) && isset( $csv['string'] ) ) {
342
  $data = str_replace( PHP_EOL, "\n", $csv['string'] );
344
  ?>
345
  <div class="viz-simple-editor-type viz-text-editor">
346
  <textarea id="edited_text"><?php echo $data; ?></textarea>
 
347
  </div>
348
  <?php
349
  }
368
  }
369
  $chart = get_post( $chart_id );
370
  $type = get_post_meta( $chart_id, Visualizer_Plugin::CF_CHART_TYPE, true );
371
+ $data = apply_filters( Visualizer_Plugin::FILTER_GET_CHART_DATA, unserialize( str_replace( "'", "\'", html_entity_decode( $chart->post_content ) ) ), $type );
372
  } else {
373
  $headers = array_keys( $data[0] );
374
  }
412
  echo '<select name="type[]">';
413
  } else {
414
  echo '<input name="header[]" type="hidden" value="' . $header . '">';
415
+ echo '<select name="type[' . $header . ']" class="viz-select-data-type">';
416
  }
417
  echo '<option value="" title="' . __( 'Exclude from chart', 'visualizer' ) . '">' . __( 'Exclude', 'visualizer' ) . '</option>';
418
  echo '<option value="0" disabled title="' . __( 'Include in chart and select data type', 'visualizer' ) . '">--' . __( 'OR', 'visualizer' ) . '--</option>';
431
  if ( array_key_exists( 'data', $data ) ) {
432
  $data = $data['data'];
433
  }
434
+
435
  foreach ( $data as $row ) {
436
  echo '<tr>';
437
  echo '<th>' . __( 'Value', 'visualizer' ) . '</th>';
438
  $index = 0;
439
+ if ( empty( $row ) ) {
440
+ echo '<td></td>';
441
+ continue;
442
+ }
443
  foreach ( array_values( $row ) as $value ) {
444
  if ( $editable_data ) {
445
+ echo '<td><input type="text" name="data' . $index++ . '[]" value="' . esc_attr( stripslashes( $value ) ) . '"></td>';
446
  } else {
447
+ echo '<td>' . ( is_array( $value ) ? __( 'Invalid Data', 'visualizer' ) : $value ) . '</td>';
448
  }
449
  }
450
 
classes/Visualizer/Render/Library.php CHANGED
@@ -118,12 +118,13 @@ class Visualizer_Render_Library extends Visualizer_Render {
118
  echo ' | </li>';
119
  }
120
  echo '</ul>';
 
121
  echo '<form action="" method="get"><p id="visualizer-search" class="search-box">
122
  <input type="search" placeholder="' . __( 'Enter title', 'visualizer' ) . '" name="s" value="' . $filterBy . '">
123
  <input type="hidden" name="page" value="visualizer">
124
  <button type="submit" id="search-submit" title="' . __( 'Search', 'visualizer' ) . '"><i class="dashicons dashicons-search"></i></button>
125
- <button type="button" class="add-new-chart" title="' . __( 'Add New', 'visualizer' ) . '"><i class="dashicons dashicons-plus-alt"></i></button>
126
  </p> </form>';
 
127
  echo '</div>';
128
  echo '<div id="visualizer-content-wrapper">';
129
  if ( ! empty( $this->charts ) ) {
@@ -220,6 +221,13 @@ class Visualizer_Render_Library extends Visualizer_Render {
220
  ),
221
  admin_url( 'admin-ajax.php' )
222
  );
 
 
 
 
 
 
 
223
  echo '<div class="visualizer-chart"><div class="visualizer-chart-title">', esc_html( $title ), '</div>';
224
  echo '<div id="', $placeholder_id, '" class="visualizer-chart-canvas">';
225
  echo '<img src="', VISUALIZER_ABSURL, 'images/ajax-loader.gif" class="loader">';
@@ -232,6 +240,7 @@ class Visualizer_Render_Library extends Visualizer_Render {
232
  echo '<span class="visualizer-chart-shortcode" title="', esc_attr__( 'Click to select', 'visualizer' ), '">';
233
  echo '&nbsp;[visualizer id=&quot;', $chart_id, '&quot;]&nbsp;';
234
  echo '</span>';
 
235
  echo '</div>';
236
  echo '</div>';
237
  }
118
  echo ' | </li>';
119
  }
120
  echo '</ul>';
121
+
122
  echo '<form action="" method="get"><p id="visualizer-search" class="search-box">
123
  <input type="search" placeholder="' . __( 'Enter title', 'visualizer' ) . '" name="s" value="' . $filterBy . '">
124
  <input type="hidden" name="page" value="visualizer">
125
  <button type="submit" id="search-submit" title="' . __( 'Search', 'visualizer' ) . '"><i class="dashicons dashicons-search"></i></button>
 
126
  </p> </form>';
127
+
128
  echo '</div>';
129
  echo '<div id="visualizer-content-wrapper">';
130
  if ( ! empty( $this->charts ) ) {
221
  ),
222
  admin_url( 'admin-ajax.php' )
223
  );
224
+
225
+ $chart_status = array( 'date' => get_the_modified_date( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $chart_id ), 'error' => get_post_meta( $chart_id, Visualizer_Plugin::CF_ERROR, true ), 'icon' => 'dashicons-yes-alt', 'title' => '' );
226
+ if ( ! empty( $chart_status['error'] ) ) {
227
+ $chart_status['icon'] = 'error dashicons-dismiss';
228
+ $chart_status['title'] = __( 'Click to view the error', 'visualizer' );
229
+ }
230
+
231
  echo '<div class="visualizer-chart"><div class="visualizer-chart-title">', esc_html( $title ), '</div>';
232
  echo '<div id="', $placeholder_id, '" class="visualizer-chart-canvas">';
233
  echo '<img src="', VISUALIZER_ABSURL, 'images/ajax-loader.gif" class="loader">';
240
  echo '<span class="visualizer-chart-shortcode" title="', esc_attr__( 'Click to select', 'visualizer' ), '">';
241
  echo '&nbsp;[visualizer id=&quot;', $chart_id, '&quot;]&nbsp;';
242
  echo '</span>';
243
+ echo '<hr><div class="visualizer-chart-status"><span class="visualizer-date" title="' . __( 'Last Updated', 'visualizer' ) . '">' . $chart_status['date'] . '</span><span class="visualizer-error"><i class="dashicons ' . $chart_status['icon'] . '" data-viz-error="' . esc_attr( str_replace( '"', "'", $chart_status['error'] ) ) . '" title="' . esc_attr( $chart_status['title'] ) . '"></i></span></div>';
244
  echo '</div>';
245
  echo '</div>';
246
  }
classes/Visualizer/Render/Page/Data.php CHANGED
@@ -38,6 +38,10 @@ class Visualizer_Render_Page_Data extends Visualizer_Render_Page {
38
  */
39
  protected function _renderContent() {
40
  // Added by Ash/Upwork
 
 
 
 
41
  if ( Visualizer_Module::is_pro() ) {
42
  do_action( 'visualizer_add_editor_etc', $this->chart->ID );
43
 
@@ -48,8 +52,6 @@ class Visualizer_Render_Page_Data extends Visualizer_Render_Page {
48
  $Visualizer_Pro->_addFilterWizard( $this->chart->ID );
49
  }
50
  }
51
- } else {
52
- Visualizer_Render_Layout::show( 'simple-editor-screen', $this->chart->ID );
53
  }
54
 
55
  $this->add_additional_content();
@@ -86,6 +88,11 @@ class Visualizer_Render_Page_Data extends Visualizer_Render_Page {
86
  if ( ! empty( $filter_config ) ) {
87
  $source_of_chart .= '_wp';
88
  }
 
 
 
 
 
89
  $type = get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_CHART_TYPE, true );
90
  $lib = get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_CHART_LIBRARY, true );
91
  ?>
@@ -98,11 +105,12 @@ class Visualizer_Render_Page_Data extends Visualizer_Render_Page {
98
  </div>
99
  <ul class="viz-group-content">
100
  <ul class="viz-group-wrapper">
 
101
  <li class="viz-group visualizer_source_csv">
102
  <h2 class="viz-group-title viz-sub-group visualizer-src-tab"><?php _e( 'Import data from file', 'visualizer' ); ?></h2>
103
  <div class="viz-group-content">
104
  <p class="viz-group-description"><?php esc_html_e( 'Select and upload your data CSV file here. The first row of the CSV file should contain the column headings. The second one should contain series type (string, number, boolean, date, datetime, timeofday).', 'visualizer' ); ?></p>
105
- <p class="viz-group-description"><b><?php echo sprintf( __( 'If you are unsure about how to format your data CSV then please take a look at this sample: %1$s %2$s%3$s. If you are using non-English characters, please make sure you save the file in UTF-8 encoding.', 'visualizer' ), '<a href="' . VISUALIZER_ABSURL . 'samples/' . $this->type . '.csv" target="_blank">', $this->type, '.csv</a>' ); ?></b></p>
106
  <form id="vz-csv-file-form" action="<?php echo $upload_link; ?>" method="post"
107
  target="thehole" enctype="multipart/form-data">
108
  <input type="hidden" id="remote-data" name="remote_data">
@@ -114,77 +122,54 @@ class Visualizer_Render_Page_Data extends Visualizer_Render_Page {
114
  </form>
115
  </div>
116
  </li>
 
117
  <li class="viz-group visualizer-import-url visualizer_source_csv_remote visualizer_source_json">
118
  <h2 class="viz-group-title viz-sub-group visualizer-src-tab"><?php _e( 'Import data from URL', 'visualizer' ); ?></h2>
119
  <ul class="viz-group-content">
 
120
  <li class="viz-subsection">
121
- <span class="viz-section-title"><?php _e( 'One time import', 'visualizer' ); ?></span>
122
-
123
  <div class="viz-section-items section-items">
124
- <p class="viz-group-description"><?php _e( 'You can use this to import data from a remote CSV file. The first row of the CSV file should contain the column headings. The second one should contain series type (string, number, boolean, date, datetime, timeofday).', 'visualizer' ); ?> </p>
125
- <p class="viz-group-description"><b><?php echo sprintf( __( 'If you are unsure about how to format your data CSV then please take a look at this sample: %1$s %2$s%3$s. If you have using non-English characters, please make sure you save the file in UTF-8 encoding.', 'visualizer' ), '<a href="' . VISUALIZER_ABSURL . 'samples/' . $this->type . '.csv" target="_blank">', $this->type, '.csv</a>' ); ?></b></p>
126
- <p class="viz-group-description"> <?php _e( 'You can also import data from Google Spreadsheet, for more info check <a href="https://docs.themeisle.com/article/607-how-can-i-populate-data-from-google-spreadsheet" target="_blank" >this</a> tutorial', 'visualizer' ); ?></p>
127
  <form id="vz-one-time-import" action="<?php echo $upload_link; ?>" method="post"
128
  target="thehole" enctype="multipart/form-data">
129
  <div class="remote-file-section">
130
- <input type="url" id="remote-data" name="remote_data"
131
- placeholder="<?php esc_html_e( 'Please enter the URL of CSV file', 'visualizer' ); ?>"
132
- class="visualizer-input">
133
-
134
- </div>
135
- <input type="button" id="view-remote-file" class="button button-primary"
136
- value="<?php _e( 'Import', 'visualizer' ); ?>">
137
- </form>
138
- </div>
139
- </li>
140
- <li class="viz-subsection <?php echo apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature', 'schedule-chart' ); ?>">
141
- <span class="viz-section-title visualizer-import-url-schedule"><?php _e( 'Schedule Import', 'visualizer' ); ?>
142
- <span
143
- class="dashicons dashicons-lock"></span></span>
144
- <div class="viz-section-items section-items">
145
- <p class="viz-group-description"><?php _e( 'You can choose here to synchronize your chart data with a remote CSV file.', 'visualizer' ); ?> </p>
146
- <p class="viz-group-description"> <?php _e( 'You can also synchronize with your Google Spreadsheet file, for more info check <a href="https://docs.themeisle.com/article/607-how-can-i-populate-data-from-google-spreadsheet" target="_blank" >this</a> tutorial', 'visualizer' ); ?></p>
147
- <p class="viz-group-description"> <?php _e( 'We will update the chart data based on your time interval preference by overwriting the current data with the one from the URL.', 'visualizer' ); ?></p>
148
- <form id="vz-schedule-import" action="<?php echo $upload_link; ?>" method="post"
149
- target="thehole" enctype="multipart/form-data">
150
- <div class="remote-file-section">
151
- <input type="url" id="vz-schedule-url" name="remote_data"
152
- value="<?php echo esc_url( get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_CHART_URL, true ) ); ?>"
153
- placeholder="<?php esc_html_e( 'Please enter the URL of CSV file', 'visualizer' ); ?>"
154
- class="visualizer-input visualizer-remote-url">
155
- <p class="viz-group-description"><?php _e( 'How often do you want to check the url', 'visualizer' ); ?></p>
156
- <select name="vz-import-time" id="vz-import-time"
157
- class="visualizer-select">
158
- <?php
159
- $hours = get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_CHART_SCHEDULE, true );
160
- $schedules = apply_filters(
161
- 'visualizer_chart_schedules', array(
162
- '1' => __( 'Each hour', 'visualizer' ),
163
- '12' => __( 'Each 12 hours', 'visualizer' ),
164
- '24' => __( 'Each day', 'visualizer' ),
165
- '72' => __( 'Each 3 days', 'visualizer' ),
166
- ),
167
- 'csv',
168
- $this->chart->ID
169
- );
170
- foreach ( $schedules as $num => $name ) {
171
- // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
172
- $extra = $num == $hours ? 'selected' : '';
173
- ?>
174
- <option value="<?php echo $num; ?>" <?php echo $extra; ?>><?php echo $name; ?></option>
175
- <?php
176
- }
177
- ?>
178
- </select>
179
  </div>
180
- <input type="button" id="vz-save-schedule" class="button button-primary"
181
- value="<?php _e( 'Save schedule', 'visualizer' ); ?>">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
182
 
183
- <?php echo apply_filters( 'visualizer_pro_upsell', '', 'schedule-chart' ); ?>
 
 
 
 
 
 
 
184
  </form>
185
  </div>
186
  </li>
187
-
188
  <li class="viz-subsection">
189
  <span class="viz-section-title visualizer_source_json"><?php _e( 'Import from JSON', 'visualizer' ); ?>
190
  <span class="dashicons dashicons-lock"></span></span>
@@ -197,7 +182,7 @@ class Visualizer_Render_Page_Data extends Visualizer_Render_Page {
197
  if ( Visualizer_Module::is_pro() ) {
198
  ?>
199
  <p class="viz-group-description"><?php _e( 'How often do you want to check the URL', 'visualizer' ); ?></p>
200
- <select name="vz-json-time" id="vz-json-time" class="visualizer-select" data-chart="<?php echo $this->chart->ID; ?>">
201
  <?php
202
  $hours = get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_JSON_SCHEDULE, true );
203
  $schedules = apply_filters(
@@ -214,6 +199,7 @@ class Visualizer_Render_Page_Data extends Visualizer_Render_Page {
214
  <option value="<?php echo $num; ?>" <?php echo $extra; ?>><?php echo $name; ?></option>
215
  <?php
216
  }
 
217
  ?>
218
  </select>
219
  <?php
@@ -238,6 +224,8 @@ class Visualizer_Render_Page_Data extends Visualizer_Render_Page {
238
  </li>
239
  </ul>
240
  </li>
 
 
241
  <li class="viz-group viz-import-from-other <?php echo apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature' ); ?>">
242
  <h2 class="viz-group-title viz-sub-group"
243
  data-current="chart"><?php _e( 'Import from other chart', 'visualizer' ); ?><span
@@ -303,7 +291,8 @@ class Visualizer_Render_Page_Data extends Visualizer_Render_Page {
303
  ), admin_url( 'admin-ajax.php' )
304
  );
305
  ?>
306
- <li class="viz-group visualizer_source_query_wp <?php echo apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature', 'schedule-chart' ); ?> ">
 
307
  <h2 class="viz-group-title viz-sub-group"><?php _e( 'Import from WordPress', 'visualizer' ); ?><span
308
  class="dashicons dashicons-lock"></span></h2>
309
  <div class="viz-group-content edit-data-content">
@@ -316,13 +305,11 @@ class Visualizer_Render_Page_Data extends Visualizer_Render_Page {
316
  $bttn_label = 'visualizer_source_query_wp' === $source_of_chart ? __( 'Modify Filter', 'visualizer' ) : __( 'Create Filter', 'visualizer' );
317
  $hours = get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_DB_SCHEDULE, true );
318
  $schedules = apply_filters(
319
- 'visualizer_schedules', array(
320
- '0' => __( 'Live', 'visualizer' ),
321
- '1' => __( 'Each hour', 'visualizer' ),
322
- '12' => __( 'Each 12 hours', 'visualizer' ),
323
- '24' => __( 'Each day', 'visualizer' ),
324
- '72' => __( 'Each 3 days', 'visualizer' ),
325
- )
326
  );
327
  foreach ( $schedules as $num => $name ) {
328
  // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
@@ -331,6 +318,7 @@ class Visualizer_Render_Page_Data extends Visualizer_Render_Page {
331
  <option value="<?php echo $num; ?>" <?php echo $extra; ?>><?php echo $name; ?></option>
332
  <?php
333
  }
 
334
  ?>
335
  </select>
336
 
@@ -338,7 +326,7 @@ class Visualizer_Render_Page_Data extends Visualizer_Render_Page {
338
  <input type="button" id="db-filter-save-button" class="button button-primary" value="<?php _e( 'Save Schedule', 'visualizer' ); ?>">
339
  <?php echo apply_filters( 'visualizer_pro_upsell', '', 'db-query' ); ?>
340
  </form>
341
- <?php echo apply_filters( 'visualizer_pro_upsell', '', 'schedule-chart' ); ?>
342
  </div>
343
  </div>
344
  </li>
@@ -352,6 +340,7 @@ class Visualizer_Render_Page_Data extends Visualizer_Render_Page {
352
  ), admin_url( 'admin-ajax.php' )
353
  );
354
  ?>
 
355
  <li class="viz-group visualizer_source_query <?php echo apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature', 'db-query' ); ?>">
356
  <h2 class="viz-group-title viz-sub-group"><?php _e( 'Import from database', 'visualizer' ); ?><span
357
  class="dashicons dashicons-lock"></span></h2>
@@ -365,13 +354,11 @@ class Visualizer_Render_Page_Data extends Visualizer_Render_Page {
365
  $bttn_label = 'visualizer_source_query' === $source_of_chart ? __( 'Modify Query', 'visualizer' ) : __( 'Create Query', 'visualizer' );
366
  $hours = get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_DB_SCHEDULE, true );
367
  $schedules = apply_filters(
368
- 'visualizer_schedules', array(
369
- '0' => __( 'Live', 'visualizer' ),
370
- '1' => __( 'Each hour', 'visualizer' ),
371
- '12' => __( 'Each 12 hours', 'visualizer' ),
372
- '24' => __( 'Each day', 'visualizer' ),
373
- '72' => __( 'Each 3 days', 'visualizer' ),
374
- )
375
  );
376
  foreach ( $schedules as $num => $name ) {
377
  // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
@@ -380,6 +367,7 @@ class Visualizer_Render_Page_Data extends Visualizer_Render_Page {
380
  <option value="<?php echo $num; ?>" <?php echo $extra; ?>><?php echo $name; ?></option>
381
  <?php
382
  }
 
383
  ?>
384
  </select>
385
  <input type="hidden" name="params" id="viz-db-wizard-params">
@@ -392,31 +380,50 @@ class Visualizer_Render_Page_Data extends Visualizer_Render_Page {
392
  </div>
393
  </li>
394
 
395
- <?php
396
- // we will auto-open the manual data feature only when source is empty.
397
- ?>
398
- <li class="viz-group <?php echo empty( $source_of_chart ) ? 'open' : ''; ?> ">
399
- <h2 class="viz-group-title viz-sub-group visualizer-editor-tab"
400
- data-current="chart"><?php _e( 'Manual Data', 'visualizer' ); ?><span
401
- class="dashicons dashicons-lock"></span></h2>
402
- <form id="editor-form" action="<?php echo $upload_link; ?>" method="post" target="thehole">
403
- <input type="hidden" id="chart-data" name="chart_data">
404
- <input type="hidden" id="chart-data-src" name="chart_data_src">
405
- </form>
406
-
407
  <div class="viz-group-content edit-data-content">
408
- <div>
409
- <p class="viz-group-description"><?php echo sprintf( __( 'You can manually edit the chart data using the %s editor.', 'visualizer' ), Visualizer_Module::is_pro() ? 'spreadsheet like' : 'simple' ); ?></p>
410
- <?php if ( ! Visualizer_Module::is_pro() ) { ?>
411
- <p class="viz-group-description simple-editor-type"><input type="checkbox" id="simple-editor-type" value="textarea"><label for="simple-editor-type"><?php _e( 'Use text area editor instead', 'visualizer' ); ?></label></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
412
  <?php } ?>
413
- <input type="button" id="editor-chart-button" class="button button-primary "
414
- value="<?php _e( 'View Editor', 'visualizer' ); ?>" data-current="chart"
415
- data-t-editor="<?php _e( 'Show Chart', 'visualizer' ); ?>"
416
- data-t-chart="<?php _e( 'View Editor', 'visualizer' ); ?>">
417
-
418
- <p class="viz-group-description viz-info-msg"><?php echo sprintf( __( 'Please make sure you click \'Show Chart\' before you save the chart.', 'visualizer' ) ); ?></p>
419
- </div>
420
  </div>
421
  </li>
422
  </ul>
@@ -616,7 +623,7 @@ class Visualizer_Render_Page_Data extends Visualizer_Render_Page {
616
  }
617
  echo '<input type="submit" id="settings-button" class="button button-primary button-large push-right" value="', $this->button, '">';
618
  if ( isset( $this->cancel_button ) ) {
619
- echo '<input type="submit" id="cancel-button" class="button button-secondary button-large push-left" value="', $this->cancel_button, '">';
620
  }
621
  }
622
 
@@ -631,7 +638,7 @@ class Visualizer_Render_Page_Data extends Visualizer_Render_Page {
631
  if ( 'visualizer_source_query' === $source ) {
632
  $query = get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_DB_QUERY, true );
633
  }
634
- Visualizer_Render_Layout::show( 'db-query', $query );
635
  Visualizer_Render_Layout::show( 'json-screen', $this->chart->ID );
636
  }
637
 
38
  */
39
  protected function _renderContent() {
40
  // Added by Ash/Upwork
41
+ if ( Visualizer_Module::can_show_feature( 'simple-editor' ) ) {
42
+ Visualizer_Render_Layout::show( 'simple-editor-screen', $this->chart->ID );
43
+ }
44
+
45
  if ( Visualizer_Module::is_pro() ) {
46
  do_action( 'visualizer_add_editor_etc', $this->chart->ID );
47
 
52
  $Visualizer_Pro->_addFilterWizard( $this->chart->ID );
53
  }
54
  }
 
 
55
  }
56
 
57
  $this->add_additional_content();
88
  if ( ! empty( $filter_config ) ) {
89
  $source_of_chart .= '_wp';
90
  }
91
+ $editor_type = get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_EDITOR, true );
92
+ if ( $editor_type ) {
93
+ $source_of_chart = 'visualizer_source_manual';
94
+ }
95
+
96
  $type = get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_CHART_TYPE, true );
97
  $lib = get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_CHART_LIBRARY, true );
98
  ?>
105
  </div>
106
  <ul class="viz-group-content">
107
  <ul class="viz-group-wrapper">
108
+ <!-- import from file -->
109
  <li class="viz-group visualizer_source_csv">
110
  <h2 class="viz-group-title viz-sub-group visualizer-src-tab"><?php _e( 'Import data from file', 'visualizer' ); ?></h2>
111
  <div class="viz-group-content">
112
  <p class="viz-group-description"><?php esc_html_e( 'Select and upload your data CSV file here. The first row of the CSV file should contain the column headings. The second one should contain series type (string, number, boolean, date, datetime, timeofday).', 'visualizer' ); ?></p>
113
+ <p class="viz-group-description viz-info-msg"><b><?php echo sprintf( __( 'If you are unsure about how to format your data CSV then please take a look at this sample: %1$s %2$s%3$s. If you are using non-English characters, please make sure you save the file in UTF-8 encoding.', 'visualizer' ), '<a href="' . VISUALIZER_ABSURL . 'samples/' . $this->type . '.csv" target="_blank">', $this->type, '.csv</a>' ); ?></b></p>
114
  <form id="vz-csv-file-form" action="<?php echo $upload_link; ?>" method="post"
115
  target="thehole" enctype="multipart/form-data">
116
  <input type="hidden" id="remote-data" name="remote_data">
122
  </form>
123
  </div>
124
  </li>
125
+ <!-- import from url -->
126
  <li class="viz-group visualizer-import-url visualizer_source_csv_remote visualizer_source_json">
127
  <h2 class="viz-group-title viz-sub-group visualizer-src-tab"><?php _e( 'Import data from URL', 'visualizer' ); ?></h2>
128
  <ul class="viz-group-content">
129
+ <!-- import from csv url -->
130
  <li class="viz-subsection">
131
+ <span class="viz-section-title"><?php _e( 'Import from CSV', 'visualizer' ); ?></span>
 
132
  <div class="viz-section-items section-items">
133
+ <p class="viz-group-description"><?php echo sprintf( __( 'You can use this to import data from a remote CSV file or %1$sGoogle Spreadsheet%2$s.', 'visualizer' ), '<a href="https://docs.themeisle.com/article/607-how-can-i-populate-data-from-google-spreadsheet" target="_blank" >', '</a>' ); ?> </p>
134
+ <p class="viz-group-description viz-info-msg"><b><?php echo sprintf( __( 'If you are unsure about how to format your data CSV then please take a look at this sample: %1$s %2$s%3$s. If you are using non-English characters, please make sure you save the file in UTF-8 encoding.', 'visualizer' ), '<a href="' . VISUALIZER_ABSURL . 'samples/' . $this->type . '.csv" target="_blank">', $this->type, '.csv</a>' ); ?></b></p>
 
135
  <form id="vz-one-time-import" action="<?php echo $upload_link; ?>" method="post"
136
  target="thehole" enctype="multipart/form-data">
137
  <div class="remote-file-section">
138
+ <input type="url" id="vz-schedule-url" name="remote_data" value="<?php echo esc_attr( get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_CHART_URL, true ) ); ?>" placeholder="<?php esc_html_e( 'Please enter the URL of CSV file', 'visualizer' ); ?>" class="visualizer-input visualizer-remote-url">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  </div>
140
+ <select name="vz-import-time" id="vz-import-time" class="visualizer-select">
141
+ <?php
142
+ $hours = get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_CHART_SCHEDULE, true );
143
+ $schedules = apply_filters(
144
+ 'visualizer_chart_schedules', array(
145
+ '-1' => __( 'One-time', 'visualizer' ),
146
+ ),
147
+ 'csv',
148
+ $this->chart->ID
149
+ );
150
+ foreach ( $schedules as $num => $name ) {
151
+ // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
152
+ $extra = $num == $hours ? 'selected' : '';
153
+ ?>
154
+ <option value="<?php echo $num; ?>" <?php echo $extra; ?>><?php echo $name; ?></option>
155
+ <?php
156
+ }
157
+ do_action( 'visualizer_chart_schedules_spl', 'csv', $this->chart->ID, 1 );
158
+ ?>
159
+ </select>
160
 
161
+ <input type="button" id="view-remote-file" class="button <?php echo Visualizer_Module::is_pro() ? 'button-secondary' : 'button-primary'; ?>" value="<?php _e( 'Import', 'visualizer' ); ?>">
162
+ <?php
163
+ if ( Visualizer_Module::is_pro() ) {
164
+ ?>
165
+ <input type="button" id="vz-save-schedule" class="button button-primary" value="<?php _e( 'Save schedule', 'visualizer' ); ?>">
166
+ <?php
167
+ }
168
+ ?>
169
  </form>
170
  </div>
171
  </li>
172
+ <!-- import from json url -->
173
  <li class="viz-subsection">
174
  <span class="viz-section-title visualizer_source_json"><?php _e( 'Import from JSON', 'visualizer' ); ?>
175
  <span class="dashicons dashicons-lock"></span></span>
182
  if ( Visualizer_Module::is_pro() ) {
183
  ?>
184
  <p class="viz-group-description"><?php _e( 'How often do you want to check the URL', 'visualizer' ); ?></p>
185
+ <select name="time" id="vz-json-time" class="visualizer-select json-form-element" data-chart="<?php echo $this->chart->ID; ?>">
186
  <?php
187
  $hours = get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_JSON_SCHEDULE, true );
188
  $schedules = apply_filters(
199
  <option value="<?php echo $num; ?>" <?php echo $extra; ?>><?php echo $name; ?></option>
200
  <?php
201
  }
202
+ do_action( 'visualizer_chart_schedules_spl', 'json', $this->chart->ID, 1 );
203
  ?>
204
  </select>
205
  <?php
224
  </li>
225
  </ul>
226
  </li>
227
+ <!-- import from chart -->
228
+ <li class="viz-group viz-import-from-other <?php echo apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature' ); ?>">
229
  <li class="viz-group viz-import-from-other <?php echo apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature' ); ?>">
230
  <h2 class="viz-group-title viz-sub-group"
231
  data-current="chart"><?php _e( 'Import from other chart', 'visualizer' ); ?><span
291
  ), admin_url( 'admin-ajax.php' )
292
  );
293
  ?>
294
+ <!-- import from WordPress -->
295
+ <li class="viz-group visualizer_source_query_wp <?php echo apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature', 'import-wp' ); ?> ">
296
  <h2 class="viz-group-title viz-sub-group"><?php _e( 'Import from WordPress', 'visualizer' ); ?><span
297
  class="dashicons dashicons-lock"></span></h2>
298
  <div class="viz-group-content edit-data-content">
305
  $bttn_label = 'visualizer_source_query_wp' === $source_of_chart ? __( 'Modify Filter', 'visualizer' ) : __( 'Create Filter', 'visualizer' );
306
  $hours = get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_DB_SCHEDULE, true );
307
  $schedules = apply_filters(
308
+ 'visualizer_chart_schedules', array(
309
+ '-1' => __( 'One-time', 'visualizer' ),
310
+ ),
311
+ 'wp',
312
+ $this->chart->ID
 
 
313
  );
314
  foreach ( $schedules as $num => $name ) {
315
  // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
318
  <option value="<?php echo $num; ?>" <?php echo $extra; ?>><?php echo $name; ?></option>
319
  <?php
320
  }
321
+ do_action( 'visualizer_chart_schedules_spl', 'wp', $this->chart->ID, 1 );
322
  ?>
323
  </select>
324
 
326
  <input type="button" id="db-filter-save-button" class="button button-primary" value="<?php _e( 'Save Schedule', 'visualizer' ); ?>">
327
  <?php echo apply_filters( 'visualizer_pro_upsell', '', 'db-query' ); ?>
328
  </form>
329
+ <?php echo apply_filters( 'visualizer_pro_upsell', '', 'import-wp' ); ?>
330
  </div>
331
  </div>
332
  </li>
340
  ), admin_url( 'admin-ajax.php' )
341
  );
342
  ?>
343
+ <!-- import from db -->
344
  <li class="viz-group visualizer_source_query <?php echo apply_filters( 'visualizer_pro_upsell_class', 'only-pro-feature', 'db-query' ); ?>">
345
  <h2 class="viz-group-title viz-sub-group"><?php _e( 'Import from database', 'visualizer' ); ?><span
346
  class="dashicons dashicons-lock"></span></h2>
354
  $bttn_label = 'visualizer_source_query' === $source_of_chart ? __( 'Modify Query', 'visualizer' ) : __( 'Create Query', 'visualizer' );
355
  $hours = get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_DB_SCHEDULE, true );
356
  $schedules = apply_filters(
357
+ 'visualizer_chart_schedules', array(
358
+ '-1' => __( 'One-time', 'visualizer' ),
359
+ ),
360
+ 'db',
361
+ $this->chart->ID
 
 
362
  );
363
  foreach ( $schedules as $num => $name ) {
364
  // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
367
  <option value="<?php echo $num; ?>" <?php echo $extra; ?>><?php echo $name; ?></option>
368
  <?php
369
  }
370
+ do_action( 'visualizer_chart_schedules_spl', 'db', $this->chart->ID, 1 );
371
  ?>
372
  </select>
373
  <input type="hidden" name="params" id="viz-db-wizard-params">
380
  </div>
381
  </li>
382
 
383
+ <!-- manual -->
384
+ <li class="viz-group visualizer_source_manual">
385
+ <h2 class="viz-group-title viz-sub-group visualizer-editor-tab" data-current="chart"><?php _e( 'Manual Data', 'visualizer' ); ?>
386
+ <span class="dashicons dashicons-lock"></span>
387
+ </h2>
 
 
 
 
 
 
 
388
  <div class="viz-group-content edit-data-content">
389
+ <form id="editor-form" action="<?php echo $upload_link; ?>" method="post" target="thehole">
390
+ <input type="hidden" id="chart-data" name="chart_data">
391
+ <input type="hidden" id="chart-data-src" name="chart_data_src">
392
+
393
+ <?php if ( Visualizer_Module::can_show_feature( 'simple-editor' ) ) { ?>
394
+ <div>
395
+ <p class="viz-group-description viz-editor-selection">
396
+ <?php _e( 'Use the', 'visualizer' ); ?>
397
+ <select name="editor-type" id="viz-editor-type">
398
+ <?php
399
+ if ( empty( $editor_type ) ) {
400
+ $editor_type = Visualizer_Module::is_pro() ? 'excel' : 'text';
401
+ }
402
+ foreach ( apply_filters( 'visualizer_editors', array( 'text' => __( 'Text', 'visualizer' ), 'table' => __( 'Simple', 'visualizer' ) ) ) as $e_type => $e_label ) {
403
+ ?>
404
+ <option value="<?php echo $e_type; ?>" <?php selected( $editor_type, $e_type ); ?> ><?php echo $e_label; ?></option>
405
+ <?php } ?>
406
+ </select>
407
+ <?php _e( 'editor to manually edit the chart data.', 'visualizer' ); ?>
408
+ </p>
409
+ <input type="button" id="editor-undo" class="button button-secondary" style="display: none" value="<?php _e( 'Undo Changes', 'visualizer' ); ?>">
410
+ <input type="button" id="editor-button" class="button button-primary "
411
+ value="<?php _e( 'Edit Data', 'visualizer' ); ?>" data-current="chart"
412
+ data-t-editor="<?php _e( 'Show Chart', 'visualizer' ); ?>"
413
+ data-t-chart="<?php _e( 'Edit Data', 'visualizer' ); ?>"
414
+ >
415
+ <p class="viz-group-description viz-info-msg"><?php echo sprintf( __( 'Please make sure you click \'Show Chart\' before you save the chart.', 'visualizer' ) ); ?></p>
416
+ </div>
417
+ <?php } else { ?>
418
+ <input type="button" id="editor-undo" class="button button-secondary" style="display: none" value="<?php _e( 'Undo Changes', 'visualizer' ); ?>">
419
+ <input type="button" id="editor-chart-button" class="button button-primary "
420
+ value="<?php _e( 'View Editor', 'visualizer' ); ?>" data-current="chart"
421
+ data-t-editor="<?php _e( 'Show Chart', 'visualizer' ); ?>"
422
+ data-t-chart="<?php _e( 'View Editor', 'visualizer' ); ?>"
423
+ >
424
+ <p class="viz-group-description viz-info-msg"><?php echo sprintf( __( 'Please make sure you click \'Show Chart\' before you save the chart.', 'visualizer' ) ); ?></p>
425
  <?php } ?>
426
+ </form>
 
 
 
 
 
 
427
  </div>
428
  </li>
429
  </ul>
623
  }
624
  echo '<input type="submit" id="settings-button" class="button button-primary button-large push-right" value="', $this->button, '">';
625
  if ( isset( $this->cancel_button ) ) {
626
+ echo '<input type="submit" id="cancel-button" class="button button-secondary button-large push-right" value="', $this->cancel_button, '">';
627
  }
628
  }
629
 
638
  if ( 'visualizer_source_query' === $source ) {
639
  $query = get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_DB_QUERY, true );
640
  }
641
+ Visualizer_Render_Layout::show( 'db-query', $query, $this->chart->ID );
642
  Visualizer_Render_Layout::show( 'json-screen', $this->chart->ID );
643
  }
644
 
classes/Visualizer/Render/Page/Types.php CHANGED
@@ -129,7 +129,7 @@ class Visualizer_Render_Page_Types extends Visualizer_Render_Page {
129
  }
130
  ?>
131
  <input type="submit" class="button button-primary button-large push-right" value="<?php esc_attr_e( 'Next', 'visualizer' ); ?>">
132
- <input type="button" class="button button-secondary button-large push-left viz-abort" value="<?php esc_attr_e( 'Cancel', 'visualizer' ); ?>">
133
  <?php
134
  }
135
  }
129
  }
130
  ?>
131
  <input type="submit" class="button button-primary button-large push-right" value="<?php esc_attr_e( 'Next', 'visualizer' ); ?>">
132
+ <input type="button" class="button button-secondary button-large push-right viz-abort" value="<?php esc_attr_e( 'Cancel', 'visualizer' ); ?>">
133
  <?php
134
  }
135
  }
classes/Visualizer/Render/Page/Update.php CHANGED
@@ -51,7 +51,10 @@ class Visualizer_Render_Page_Update extends Visualizer_Render_Page {
51
  if ( $this->settings ) {
52
  echo 'win.visualizer.charts.canvas.settings = ', $this->settings, ';';
53
  }
54
- echo 'win.visualizer.update();';
 
 
 
55
  echo '}';
56
 
57
  do_action( 'visualizer_add_update_hook', $this->series, $this->data );
@@ -70,4 +73,21 @@ class Visualizer_Render_Page_Update extends Visualizer_Render_Page {
70
  echo '</html>';
71
  }
72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  }
51
  if ( $this->settings ) {
52
  echo 'win.visualizer.charts.canvas.settings = ', $this->settings, ';';
53
  }
54
+ echo 'win.updateChartPreview();';
55
+
56
+ echo $this->updateEditorAndSettings();
57
+
58
  echo '}';
59
 
60
  do_action( 'visualizer_add_update_hook', $this->series, $this->data );
73
  echo '</html>';
74
  }
75
 
76
+
77
+ /**
78
+ * Update the hidden content in the LHS and the advanced settings
79
+ */
80
+ private function updateEditorAndSettings() {
81
+ $editor = '';
82
+ if ( Visualizer_Module::can_show_feature( 'simple-editor' ) ) {
83
+ ob_start();
84
+ Visualizer_Render_Layout::show( 'simple-editor-screen', $this->id );
85
+ $editor = ob_get_clean();
86
+ }
87
+
88
+ $sidebar = apply_filters( 'visualizer_get_sidebar', '', $this->id );
89
+
90
+ return 'win.updateHTML(' . json_encode( array( 'html' => $editor ) ) . ', ' . json_encode( array( 'html' => $sidebar ) ) . ');';
91
+ }
92
+
93
  }
classes/Visualizer/Render/Sidebar.php CHANGED
@@ -360,6 +360,8 @@ abstract class Visualizer_Render_Sidebar extends Visualizer_Render {
360
 
361
  $this->_renderAnimationSettings();
362
 
 
 
363
  self::_renderGroupEnd();
364
  }
365
 
360
 
361
  $this->_renderAnimationSettings();
362
 
363
+ do_action( 'visualizer_chart_settings', get_class( $this ), $this->_data, 'general', array( 'generic' => true ) );
364
+
365
  self::_renderGroupEnd();
366
  }
367
 
classes/Visualizer/Render/Sidebar/Google.php CHANGED
@@ -83,5 +83,29 @@ abstract class Visualizer_Render_Sidebar_Google extends Visualizer_Render_Sideba
83
  return 'visualizer-render-google-lib';
84
  }
85
 
86
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  }
83
  return 'visualizer-render-google-lib';
84
  }
85
 
86
+ /**
87
+ * Renders the role field.
88
+ *
89
+ * @since 3.4.0
90
+ *
91
+ * @access protected
92
+ */
93
+ protected function _renderRoleField( $index ) {
94
+ self::_renderSelectItem(
95
+ esc_html__( 'Special Role', 'visualizer' ),
96
+ 'series[' . $index . '][role]',
97
+ isset( $this->series[ $index ]['role'] ) ? $this->series[ $index ]['role'] : '',
98
+ array(
99
+ '' => esc_html__( 'Default (Data)', 'visualizer' ),
100
+ 'annotation' => esc_html__( 'Annotation', 'visualizer' ),
101
+ 'annotationText' => esc_html__( 'Annotation Text', 'visualizer' ),
102
+ 'certainty' => esc_html__( 'Certainty', 'visualizer' ),
103
+ 'emphasis' => esc_html__( 'Emphasis', 'visualizer' ),
104
+ 'scope' => esc_html__( 'Scope', 'visualizer' ),
105
+ 'style' => esc_html__( 'Style', 'visualizer' ),
106
+ 'tooltip' => esc_html__( 'Tooltip', 'visualizer' ),
107
+ ),
108
+ sprintf( esc_html__( 'Determines whether the series has to be used for a special role as mentioned in %1$shere%2$s. You can view a few examples %3$shere%4$s.', 'visualizer' ), '<a href="https://developers.google.com/chart/interactive/docs/roles#what-roles-are-available" target="_blank">', '</a>', '<a href="https://docs.themeisle.com/article/1160-roles-for-series-visualizer" target="_blank">', '</a>' )
109
+ );
110
+ }
111
  }
classes/Visualizer/Render/Sidebar/Graph.php CHANGED
@@ -422,6 +422,9 @@ abstract class Visualizer_Render_Sidebar_Graph extends Visualizer_Render_Sidebar
422
  isset( $this->series[ $index ]['color'] ) ? $this->series[ $index ]['color'] : null,
423
  null
424
  );
 
 
 
425
  }
426
 
427
  /**
422
  isset( $this->series[ $index ]['color'] ) ? $this->series[ $index ]['color'] : null,
423
  null
424
  );
425
+
426
+ $this->_renderRoleField( $index );
427
+
428
  }
429
 
430
  /**
classes/Visualizer/Render/Sidebar/Linear.php CHANGED
@@ -289,6 +289,9 @@ abstract class Visualizer_Render_Sidebar_Linear extends Visualizer_Render_Sideba
289
  isset( $this->series[ $index ]['color'] ) ? $this->series[ $index ]['color'] : null,
290
  null
291
  );
 
 
 
292
  }
293
 
294
  }
289
  isset( $this->series[ $index ]['color'] ) ? $this->series[ $index ]['color'] : null,
290
  null
291
  );
292
+
293
+ $this->_renderRoleField( $index );
294
+
295
  }
296
 
297
  }
classes/Visualizer/Render/Sidebar/Type/DataTable/DataTable.php CHANGED
@@ -176,7 +176,9 @@ class Visualizer_Render_Sidebar_Type_DataTable_DataTable extends Visualizer_Rend
176
  'pageLength_int',
177
  $this->pageLength_int,
178
  esc_html__( 'The number of rows in each page, when paging is enabled.', 'visualizer' ),
179
- '10'
 
 
180
  );
181
 
182
  echo '<div class="viz-section-delimiter section-delimiter"></div>';
176
  'pageLength_int',
177
  $this->pageLength_int,
178
  esc_html__( 'The number of rows in each page, when paging is enabled.', 'visualizer' ),
179
+ 10,
180
+ 'number',
181
+ array( 'min' => 1 )
182
  );
183
 
184
  echo '<div class="viz-section-delimiter section-delimiter"></div>';
classes/Visualizer/Render/Sidebar/Type/GoogleCharts/Bubble.php ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // +----------------------------------------------------------------------+
4
+ // | Copyright 2013 Madpixels (email : visualizer@madpixels.net) |
5
+ // +----------------------------------------------------------------------+
6
+ // | This program is free software; you can redistribute it and/or modify |
7
+ // | it under the terms of the GNU General Public License, version 2, as |
8
+ // | published by the Free Software Foundation. |
9
+ // | |
10
+ // | This program is distributed in the hope that it will be useful, |
11
+ // | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12
+ // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13
+ // | GNU General Public License for more details. |
14
+ // | |
15
+ // | You should have received a copy of the GNU General Public License |
16
+ // | along with this program; if not, write to the Free Software |
17
+ // | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, |
18
+ // | MA 02110-1301 USA |
19
+ // +----------------------------------------------------------------------+
20
+ // | Author: Eugene Manuilov <eugene@manuilov.org> |
21
+ // +----------------------------------------------------------------------+
22
+ /**
23
+ * Class for area chart sidebar settings.
24
+ *
25
+ * @category Visualizer
26
+ * @package Render
27
+ * @subpackage Sidebar
28
+ *
29
+ * @since 1.0.0
30
+ */
31
+ class Visualizer_Render_Sidebar_Type_GoogleCharts_Bubble extends Visualizer_Render_Sidebar_Linear {
32
+
33
+ /**
34
+ * Constructor.
35
+ *
36
+ * @since 1.0.0
37
+ *
38
+ * @access public
39
+ * @param array $data The data what has to be associated with this render.
40
+ */
41
+ public function __construct( $data = array() ) {
42
+ parent::__construct( $data );
43
+ $this->_includeCurveTypes = false;
44
+ }
45
+
46
+ /**
47
+ * Renders template.
48
+ *
49
+ * @since 1.0.0
50
+ *
51
+ * @access protected
52
+ */
53
+ protected function _toHTML() {
54
+ $this->_renderGeneralSettings();
55
+ $this->_renderAxesSettings();
56
+ $this->_renderBubbleSettings();
57
+ $this->_renderViewSettings();
58
+ $this->_renderAdvancedSettings();
59
+ }
60
+
61
+ /**
62
+ * Renders bubble settings items.
63
+ *
64
+ * @since 3.4.0
65
+ *
66
+ * @access protected
67
+ */
68
+ protected function _renderBubbleSettings() {
69
+ self::_renderGroupStart( esc_html__( 'Bubble Settings', 'visualizer' ) );
70
+ self::_renderSectionStart();
71
+ self::_renderTextItem(
72
+ esc_html__( 'Opacity', 'visualizer' ),
73
+ 'bubble[opacity]',
74
+ isset( $this->bubble['opacity'] ) ? $this->bubble['opacity'] : 0.8,
75
+ esc_html__( 'The default opacity of the bubbles, where 0.0 is fully transparent and 1.0 is fully opaque.', 'visualizer' ),
76
+ 0.8,
77
+ 'number',
78
+ array( 'min' => 0.0, 'max' => 1.0, 'step' => 0.1 )
79
+ );
80
+
81
+ self::_renderColorPickerItem(
82
+ esc_html__( 'Stroke Color', 'visualizer' ),
83
+ 'bubble[stroke]',
84
+ isset( $this->bubble[ $index ]['stroke'] ) ? $this->bubble[ $index ]['stroke'] : null,
85
+ null
86
+ );
87
+
88
+ self::_renderCheckboxItem(
89
+ esc_html__( 'Sort Bubbles by Size', 'visualizer' ),
90
+ 'sortBubblesBySize',
91
+ $this->sortBubblesBySize ? 1 : 0,
92
+ 1,
93
+ esc_html__( 'If true, sorts the bubbles by size so the smaller bubbles appear above the larger bubbles. If false, bubbles are sorted according to their order in the DataTable.', 'visualizer' )
94
+ );
95
+
96
+ self::_renderTextItem(
97
+ esc_html__( 'Size (max)', 'visualizer' ),
98
+ 'sizeAxis[maxValue]',
99
+ isset( $this->sizeAxis['maxValue'] ) ? $this->sizeAxis['maxValue'] : '',
100
+ esc_html__( 'The size value (as appears in the chart data) to be mapped to sizeAxis.maxSize. Larger values will be cropped to this value.', 'visualizer' ),
101
+ '',
102
+ 'number',
103
+ array( 'step' => 1 )
104
+ );
105
+
106
+ self::_renderTextItem(
107
+ esc_html__( 'Size (min)', 'visualizer' ),
108
+ 'sizeAxis[minValue]',
109
+ isset( $this->sizeAxis['minValue'] ) ? $this->sizeAxis['minValue'] : '',
110
+ esc_html__( 'The size value (as appears in the chart data) to be mapped to sizeAxis.minSize. Smaller values will be cropped to this value.', 'visualizer' ),
111
+ '',
112
+ 'number',
113
+ array( 'step' => 1 )
114
+ );
115
+
116
+ self::_renderSectionEnd();
117
+ self::_renderGroupEnd();
118
+
119
+ }
120
+
121
+
122
+ }
classes/Visualizer/Source.php CHANGED
@@ -215,7 +215,8 @@ abstract class Visualizer_Source {
215
  $data[ $i ] = ( is_numeric( $data[ $i ] ) ) ? floatval( $data[ $i ] ) : ( is_numeric( str_replace( ',', '', $data[ $i ] ) ) ? floatval( str_replace( ',', '', $data[ $i ] ) ) : null );
216
  break;
217
  case 'boolean':
218
- $data[ $i ] = ! empty( $data[ $i ] ) ? filter_var( $data[ $i ], FILTER_VALIDATE_BOOLEAN ) : null;
 
219
  break;
220
  case 'timeofday':
221
  $date = new DateTime( '1984-03-16T' . $data[ $i ] );
@@ -386,5 +387,83 @@ abstract class Visualizer_Source {
386
  return $this->_error;
387
  }
388
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
389
 
390
  }
215
  $data[ $i ] = ( is_numeric( $data[ $i ] ) ) ? floatval( $data[ $i ] ) : ( is_numeric( str_replace( ',', '', $data[ $i ] ) ) ? floatval( str_replace( ',', '', $data[ $i ] ) ) : null );
216
  break;
217
  case 'boolean':
218
+ $datum = trim( strval( $data[ $i ] ) );
219
+ $data[ $i ] = in_array( $datum, array( 'true', 'yes', '1' ), true ) ? 'true' : 'false';
220
  break;
221
  case 'timeofday':
222
  $date = new DateTime( '1984-03-16T' . $data[ $i ] );
387
  return $this->_error;
388
  }
389
 
390
+ /**
391
+ * Fetches information from the editable table and parses it to build series and data arrays.
392
+ *
393
+ * @since ?
394
+ *
395
+ * @access public
396
+ * @return boolean TRUE on success, otherwise FALSE.
397
+ */
398
+ public function fetchFromEditableTable() {
399
+ if ( empty( $this->_args ) ) {
400
+ return false;
401
+ }
402
+
403
+ $this->_fetchSeriesFromEditableTable();
404
+ $this->_fetchDataFromEditableTable();
405
+ return true;
406
+ }
407
+
408
+ /**
409
+ * Fetches series information from the editable table. This is fetched only through the UI and not while refreshing the chart data.
410
+ *
411
+ * @since 1.0.0
412
+ *
413
+ * @access private
414
+ */
415
+ private function _fetchSeriesFromEditableTable() {
416
+ $params = $this->_args;
417
+ $headers = array_filter( $params['header'] );
418
+ $types = array_filter( $params['type'] );
419
+ $header_row = $type_row = array();
420
+ if ( $headers ) {
421
+ foreach ( $headers as $header ) {
422
+ if ( ! empty( $types[ $header ] ) ) {
423
+ $this->_series[] = array(
424
+ 'label' => $header,
425
+ 'type' => $types[ $header ],
426
+ );
427
+ }
428
+ }
429
+ }
430
+
431
+ do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'Series found for %s = %s', print_r( $this->_args, true ), print_r( $this->_series, true ) ), 'debug', __FILE__, __LINE__ );
432
+
433
+ return true;
434
+ }
435
+
436
+
437
+ /**
438
+ * Fetches data information from the editable table.
439
+ *
440
+ * @since 1.0.0
441
+ *
442
+ * @access private
443
+ */
444
+ private function _fetchDataFromEditableTable() {
445
+ $params = $this->_args;
446
+ $headers = wp_list_pluck( $this->_series, 'label' );
447
+ $this->fetch();
448
+
449
+ $data = $this->_data;
450
+ $this->_data = array();
451
+
452
+ foreach ( $data as $line ) {
453
+ $data_row = array();
454
+ foreach ( $line as $header => $value ) {
455
+ // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
456
+ if ( in_array( $header, $headers ) ) {
457
+ $data_row[] = $value;
458
+ }
459
+ }
460
+ $this->_data[] = $this->_normalizeData( $data_row );
461
+ }
462
+
463
+ do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'Data found for %s = %s', print_r( $this->_args, true ), print_r( $this->_data, true ) ), 'debug', __FILE__, __LINE__ );
464
+
465
+ return true;
466
+ }
467
+
468
 
469
  }
classes/Visualizer/Source/Json.php CHANGED
@@ -59,6 +59,16 @@ class Visualizer_Source_Json extends Visualizer_Source {
59
  */
60
  protected $_paging;
61
 
 
 
 
 
 
 
 
 
 
 
62
  /**
63
  * The array that contains the definition of the data.
64
  *
@@ -91,7 +101,14 @@ class Visualizer_Source_Json extends Visualizer_Source {
91
  if ( isset( $this->_args['paging'] ) ) {
92
  $this->_paging = trim( $this->_args['paging'] );
93
  }
94
-
 
 
 
 
 
 
 
95
  do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'Constructor called for params = %s', print_r( $params, true ) ), 'debug', __FILE__, __LINE__ );
96
  }
97
 
@@ -108,7 +125,7 @@ class Visualizer_Source_Json extends Visualizer_Source {
108
  return $roots;
109
  }
110
  $roots = $this->getRootElements( 'root', '', array(), $this->getJSON() );
111
- if ( empty( $roots ) ) {
112
  $this->_error = esc_html__( 'This does not appear to be a valid JSON feed. Please try again.', 'visualizer' );
113
  return false;
114
  }
@@ -154,7 +171,13 @@ class Visualizer_Source_Json extends Visualizer_Source {
154
  $paging = array();
155
  foreach ( $leaf as $key => $value ) {
156
  // the paging element's value will most probably contain the url of the feed.
157
- if ( is_string( $value ) && 0 === stripos( $value, $this->_url ) ) {
 
 
 
 
 
 
158
  $paging[] = $key;
159
  }
160
  }
@@ -172,7 +195,7 @@ class Visualizer_Source_Json extends Visualizer_Source {
172
  *
173
  * @access public
174
  */
175
- public function parse() {
176
  $url = $this->_url;
177
  $data = array();
178
  $page = 1;
@@ -180,12 +203,14 @@ class Visualizer_Source_Json extends Visualizer_Source {
180
  while ( ! is_null( $url ) && $page++ < apply_filters( 'visualizer_json_fetch_pages', 5, $this->_url ) ) {
181
  $array = $this->getJSON( $url );
182
  if ( is_null( $array ) ) {
183
- return $data;
184
  }
185
 
186
  $root = explode( self::TAG_SEPARATOR, $this->_root );
187
- // get rid of the first element as that is the faux root element indicator
188
- array_shift( $root );
 
 
189
  $leaf = $array;
190
  foreach ( $root as $tag ) {
191
  if ( array_key_exists( $tag, $leaf ) ) {
@@ -204,6 +229,11 @@ class Visualizer_Source_Json extends Visualizer_Source {
204
  }
205
  }
206
 
 
 
 
 
 
207
  // now that we have got the final array we need to operate on, we will use this as the collection of series.
208
  // lets check if the series is a flat-series e.g. https://api.exchangeratesapi.io/latest
209
  // in this, all values of `$leaf` would be a string, not an array.
@@ -238,9 +268,11 @@ class Visualizer_Source_Json extends Visualizer_Source {
238
  $url = $this->getNextPage( $array );
239
  }
240
 
241
- do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'Parsed data endpoint %s with rooot %s is %s = ', $this->_url, $this->_root, print_r( $data, true ) ), 'debug', __FILE__, __LINE__ );
 
 
242
 
243
- return $data;
244
  }
245
 
246
  /**
@@ -266,6 +298,7 @@ class Visualizer_Source_Json extends Visualizer_Source {
266
 
267
  $rows = array();
268
  foreach ( $data as $datum ) {
 
269
  foreach ( $datum as $key => $value ) {
270
  if ( in_array( $key, $keys, true ) ) {
271
  $row[ $key ] = $value;
@@ -318,9 +351,10 @@ class Visualizer_Source_Json extends Visualizer_Source {
318
  */
319
  private function getRootElements( $parent, $now, $root, $array ) {
320
  if ( is_null( $array ) ) {
321
- return array();
322
  }
323
 
 
324
  foreach ( $array as $key => $value ) {
325
  if ( is_array( $value ) && ! empty( $value ) ) {
326
  if ( ! is_numeric( $key ) ) {
@@ -332,8 +366,8 @@ class Visualizer_Source_Json extends Visualizer_Source {
332
  $root = $this->getRootElements( $now, $key, $root, $value );
333
  }
334
  }
335
- $roots = array_filter( array_unique( $root ) );
336
- do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'Roots found for %s = ', $this->_url, print_r( $roots, true ) ), 'debug', __FILE__, __LINE__ );
337
  return $roots;
338
  }
339
 
@@ -348,10 +382,10 @@ class Visualizer_Source_Json extends Visualizer_Source {
348
  if ( is_null( $url ) ) {
349
  $url = $this->_url;
350
  }
351
- // allow hooks to use any other args such as method=POST.
352
- $response = wp_remote_request( $url, apply_filters( 'visualizer_json_args', array( 'method' => 'GET' ), $url ) );
353
- if ( is_wp_error( $response ) ) {
354
- do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'Error while fetching JSON endpoint %s = ', $url, print_r( $response, true ) ), 'error', __FILE__, __LINE__ );
355
  return null;
356
  }
357
 
@@ -362,48 +396,44 @@ class Visualizer_Source_Json extends Visualizer_Source {
362
  return $array;
363
  }
364
 
365
-
366
  /**
367
- * Fetches series information. This is fetched only through the UI and not while refreshing the chart data.
368
  *
369
- * @since 1.0.0
370
  *
371
  * @access private
372
  */
373
- private function _fetchSeries() {
374
- $params = $this->_args;
375
- $headers = array_filter( $params['header'] );
376
- $types = array_filter( $params['type'] );
377
- $header_row = $type_row = array();
378
- if ( $headers ) {
379
- foreach ( $headers as $header ) {
380
- if ( ! empty( $types[ $header ] ) ) {
381
- $this->_series[] = array(
382
- 'label' => $header,
383
- 'type' => $types[ $header ],
384
- );
385
- }
386
  }
387
  }
388
 
389
- do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'Series found for %s = ', $this->_url, print_r( $this->_series, true ) ), 'debug', __FILE__, __LINE__ );
 
390
 
391
- return true;
392
  }
393
 
394
  /**
395
- * Fetches data information.
396
  *
397
- * @since 1.0.0
398
  *
399
- * @access private
400
  */
401
- private function _fetchData() {
402
- $params = $this->_args;
 
403
 
404
  $headers = wp_list_pluck( $this->_series, 'label' );
405
- $data = $this->parse();
406
- foreach ( $data as $line ) {
407
  $data_row = array();
408
  foreach ( $line as $header => $value ) {
409
  // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
@@ -411,38 +441,9 @@ class Visualizer_Source_Json extends Visualizer_Source {
411
  $data_row[] = $value;
412
  }
413
  }
414
- $this->_data[] = $this->_normalizeData( $data_row );
415
  }
416
-
417
- do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'Data found for %s = ', $this->_url, print_r( $this->_data, true ) ), 'debug', __FILE__, __LINE__ );
418
-
419
- return true;
420
- }
421
-
422
- /**
423
- * Fetches information from source, parses it and builds series and data arrays.
424
- *
425
- * @since 1.0.0
426
- *
427
- * @access public
428
- * @return boolean TRUE on success, otherwise FALSE.
429
- */
430
- public function fetch() {
431
- $this->_fetchSeries();
432
- $this->_fetchData();
433
- return true;
434
- }
435
-
436
- /**
437
- * Refresh the data for the provided series.
438
- *
439
- * @since ?
440
- *
441
- * @access public
442
- */
443
- public function refresh( $series ) {
444
- $this->_series = $series;
445
- $this->_fetchData();
446
  return true;
447
  }
448
 
59
  */
60
  protected $_paging;
61
 
62
+ /**
63
+ * The headers.
64
+ *
65
+ * @since ?
66
+ *
67
+ * @access protected
68
+ * @var array
69
+ */
70
+ protected $_headers;
71
+
72
  /**
73
  * The array that contains the definition of the data.
74
  *
101
  if ( isset( $this->_args['paging'] ) ) {
102
  $this->_paging = trim( $this->_args['paging'] );
103
  }
104
+ if ( isset( $this->_args['auth'] ) && ! empty( $this->_args['auth'] ) ) {
105
+ $this->_headers = array( 'auth' => $this->_args['auth'] );
106
+ } elseif ( isset( $this->_args['username'] ) && isset( $this->_args['password'] ) ) {
107
+ $this->_headers = array( 'username' => $this->_args['username'], 'password' => $this->_args['password'] );
108
+ }
109
+ if ( isset( $this->_args['method'] ) ) {
110
+ $this->_headers['method'] = $this->_args['method'];
111
+ }
112
  do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'Constructor called for params = %s', print_r( $params, true ) ), 'debug', __FILE__, __LINE__ );
113
  }
114
 
125
  return $roots;
126
  }
127
  $roots = $this->getRootElements( 'root', '', array(), $this->getJSON() );
128
+ if ( is_null( $roots ) ) {
129
  $this->_error = esc_html__( 'This does not appear to be a valid JSON feed. Please try again.', 'visualizer' );
130
  return false;
131
  }
171
  $paging = array();
172
  foreach ( $leaf as $key => $value ) {
173
  // the paging element's value will most probably contain the url of the feed.
174
+ if ( ! is_string( $value ) ) {
175
+ continue;
176
+ }
177
+
178
+ // strip the url off the request parameters e.g. format=json as sometimes the pagination urls may not contain them.
179
+ $url = wp_parse_url( $value );
180
+ if ( 0 === stripos( $value, $this->_url ) || false !== stripos( $this->_url, $url['path'] ) ) {
181
  $paging[] = $key;
182
  }
183
  }
195
  *
196
  * @access public
197
  */
198
+ public function fetch() {
199
  $url = $this->_url;
200
  $data = array();
201
  $page = 1;
203
  while ( ! is_null( $url ) && $page++ < apply_filters( 'visualizer_json_fetch_pages', 5, $this->_url ) ) {
204
  $array = $this->getJSON( $url );
205
  if ( is_null( $array ) ) {
206
+ break;
207
  }
208
 
209
  $root = explode( self::TAG_SEPARATOR, $this->_root );
210
+ if ( count( $root ) > 1 ) {
211
+ // get rid of the first element as that is the faux root element indicator
212
+ array_shift( $root );
213
+ }
214
  $leaf = $array;
215
  foreach ( $root as $tag ) {
216
  if ( array_key_exists( $tag, $leaf ) ) {
229
  }
230
  }
231
 
232
+ // JSONs that do not have a root element may fall into this condition e.g. /wp-json/wp/v2/posts
233
+ if ( empty( $leaf ) ) {
234
+ $leaf = $array;
235
+ }
236
+
237
  // now that we have got the final array we need to operate on, we will use this as the collection of series.
238
  // lets check if the series is a flat-series e.g. https://api.exchangeratesapi.io/latest
239
  // in this, all values of `$leaf` would be a string, not an array.
268
  $url = $this->getNextPage( $array );
269
  }
270
 
271
+ $this->_data = $data;
272
+
273
+ do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'Parsed data endpoint %s with root %s is %s', $this->_url, $this->_root, print_r( $data, true ) ), 'debug', __FILE__, __LINE__ );
274
 
275
+ return true;
276
  }
277
 
278
  /**
298
 
299
  $rows = array();
300
  foreach ( $data as $datum ) {
301
+ $row = array();
302
  foreach ( $datum as $key => $value ) {
303
  if ( in_array( $key, $keys, true ) ) {
304
  $row[ $key ] = $value;
351
  */
352
  private function getRootElements( $parent, $now, $root, $array ) {
353
  if ( is_null( $array ) ) {
354
+ return null;
355
  }
356
 
357
+ $root[] = $parent;
358
  foreach ( $array as $key => $value ) {
359
  if ( is_array( $value ) && ! empty( $value ) ) {
360
  if ( ! is_numeric( $key ) ) {
366
  $root = $this->getRootElements( $now, $key, $root, $value );
367
  }
368
  }
369
+ $roots = array_unique( $root );
370
+ do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'Roots found for %s = %s', $this->_url, print_r( $roots, true ) ), 'debug', __FILE__, __LINE__ );
371
  return $roots;
372
  }
373
 
382
  if ( is_null( $url ) ) {
383
  $url = $this->_url;
384
  }
385
+
386
+ $response = $this->connect( $url );
387
+ if ( is_wp_error( $response ) || ! in_array( intval( $response['response']['code'] ), array( 200, 201 ), true ) ) {
388
+ do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'Error while fetching JSON endpoint %s = %s', $url, print_r( $response, true ) ), 'error', __FILE__, __LINE__ );
389
  return null;
390
  }
391
 
396
  return $array;
397
  }
398
 
 
399
  /**
400
+ * Sets the authentication/authorization headers and connects to the endpoint.
401
  *
402
+ * @since ?
403
  *
404
  * @access private
405
  */
406
+ private function connect( $url ) {
407
+ $args = array( 'method' => 'GET' );
408
+ if ( ! empty( $this->_headers ) ) {
409
+ $args = array( 'method' => strtoupper( $this->_headers['method'] ) );
410
+ if ( array_key_exists( 'auth', $this->_headers ) ) {
411
+ $args['headers'] = array( 'Authorization' => $this->_headers['auth'] );
412
+ } elseif ( array_key_exists( 'username', $this->_headers ) && array_key_exists( 'password', $this->_headers ) && ! empty( $this->_headers['username'] ) && ! empty( $this->_headers['password'] ) ) {
413
+ $args['headers'] = array( 'Authorization' => 'Basic ' . base64_encode( $this->_headers['username'] . ':' . $this->_headers['password'] ) );
 
 
 
 
 
414
  }
415
  }
416
 
417
+ $args = apply_filters( 'visualizer_json_args', $args, $url );
418
+ do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'Connecting to %s with args = %s ', $url, print_r( $args, true ) ), 'debug', __FILE__, __LINE__ );
419
 
420
+ return wp_remote_request( $url, $args );
421
  }
422
 
423
  /**
424
+ * Refresh the data for the provided series.
425
  *
426
+ * @since ?
427
  *
428
+ * @access public
429
  */
430
+ public function refresh( $series ) {
431
+ $this->_series = $series;
432
+ $this->fetch();
433
 
434
  $headers = wp_list_pluck( $this->_series, 'label' );
435
+ $data = array();
436
+ foreach ( $this->_data as $line ) {
437
  $data_row = array();
438
  foreach ( $line as $header => $value ) {
439
  // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
441
  $data_row[] = $value;
442
  }
443
  }
444
+ $data[] = $this->_normalizeData( $data_row );
445
  }
446
+ $this->_data = $data;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
447
  return true;
448
  }
449
 
classes/Visualizer/Source/Query.php CHANGED
@@ -35,14 +35,34 @@ class Visualizer_Source_Query extends Visualizer_Source {
35
  */
36
  protected $_query;
37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  /**
39
  * Constructor.
40
  *
41
  * @access public
42
  * @param string $query The query.
 
 
43
  */
44
- public function __construct( $query = null ) {
45
  $this->_query = $query;
 
 
46
  }
47
 
48
  /**
@@ -67,48 +87,67 @@ class Visualizer_Source_Query extends Visualizer_Source {
67
 
68
  // impose a limit if no limit clause is provided.
69
  if ( strpos( strtolower( $this->_query ), ' limit ' ) === false ) {
70
- $this->_query .= ' LIMIT ' . apply_filters( 'visualizer_sql_query_limit', 1000 );
71
  }
72
 
73
- global $wpdb;
74
- $wpdb->hide_errors();
75
- // @codingStandardsIgnoreStart
76
- $rows = $wpdb->get_results( $this->_query, $results_as_numeric_array ? ARRAY_N : ARRAY_A );
77
- do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'Firing query %s to get results %s with error %s', $this->_query, print_r( $rows, true ), print_r( $wpdb->last_error, true ) ), 'debug', __FILE__, __LINE__ );
78
- // @codingStandardsIgnoreEnd
79
- $wpdb->show_errors();
80
-
81
- if ( $raw_results ) {
82
- return $rows;
 
 
 
 
 
 
83
  }
84
 
85
- if ( $rows ) {
86
- $results = array();
87
- $headers = array();
 
 
 
 
 
 
 
 
 
 
88
  if ( $rows ) {
89
- $row_num = 0;
90
- foreach ( $rows as $row ) {
91
- $result = array();
92
- $col_num = 0;
93
- foreach ( $row as $k => $v ) {
94
- $result[] = $v;
95
- if ( 0 === $row_num ) {
96
- $headers[] = array( 'type' => $this->get_col_type( $col_num++ ), 'label' => $k );
 
 
 
 
97
  }
 
 
98
  }
99
- $results[] = $result;
100
- $row_num++;
101
  }
102
- }
103
 
104
- if ( $as_html ) {
105
- return $this->html( $headers, $results );
106
  }
107
- return $this->object( $headers, $results );
108
  }
109
 
110
- $this->_error = $wpdb->last_error;
111
- return null;
 
 
112
  }
113
 
114
  /**
35
  */
36
  protected $_query;
37
 
38
+ /**
39
+ * The chart id.
40
+ *
41
+ * @access protected
42
+ * @var int
43
+ */
44
+ protected $_chart_id;
45
+
46
+ /**
47
+ * Any additional parameters (e.g. for connecting to a remote db).
48
+ *
49
+ * @access protected
50
+ * @var array
51
+ */
52
+ protected $_params;
53
+
54
  /**
55
  * Constructor.
56
  *
57
  * @access public
58
  * @param string $query The query.
59
+ * @param int $chart_id The chart id.
60
+ * @param array $params Any additional parameters (e.g. for connecting to a remote db).
61
  */
62
+ public function __construct( $query = null, $chart_id = null, $params = null ) {
63
  $this->_query = $query;
64
+ $this->_chart_id = $chart_id;
65
+ $this->_params = $params;
66
  }
67
 
68
  /**
87
 
88
  // impose a limit if no limit clause is provided.
89
  if ( strpos( strtolower( $this->_query ), ' limit ' ) === false ) {
90
+ $this->_query .= ' LIMIT ' . apply_filters( 'visualizer_sql_query_limit', 1000, $this->_chart_id );
91
  }
92
 
93
+ $results = array();
94
+ $headers = array();
95
+
96
+ // short circuit results for remote dbs.
97
+ if ( false !== ( $remote_results = apply_filters( 'visualizer_db_query_execute', false, $this->_query, $as_html, $results_as_numeric_array, $raw_results, $this->_chart_id, $this->_params ) ) ) {
98
+ $error = $remote_results['error'];
99
+ if ( empty( $error ) ) {
100
+ $results = $remote_results['results'];
101
+ $headers = $remote_results['headers'];
102
+ }
103
+
104
+ $this->_error = $error;
105
+
106
+ if ( $raw_results ) {
107
+ return $results;
108
+ }
109
  }
110
 
111
+ if ( ! ( $results && $headers ) ) {
112
+ global $wpdb;
113
+ $wpdb->hide_errors();
114
+ // @codingStandardsIgnoreStart
115
+ $rows = $wpdb->get_results( $this->_query, $results_as_numeric_array ? ARRAY_N : ARRAY_A );
116
+ do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'Firing query %s to get results %s with error %s', $this->_query, print_r( $rows, true ), print_r( $wpdb->last_error, true ) ), 'debug', __FILE__, __LINE__ );
117
+ // @codingStandardsIgnoreEnd
118
+ $wpdb->show_errors();
119
+
120
+ if ( $raw_results ) {
121
+ return $rows;
122
+ }
123
+
124
  if ( $rows ) {
125
+ $results = array();
126
+ $headers = array();
127
+ if ( $rows ) {
128
+ $row_num = 0;
129
+ foreach ( $rows as $row ) {
130
+ $result = array();
131
+ $col_num = 0;
132
+ foreach ( $row as $k => $v ) {
133
+ $result[] = $v;
134
+ if ( 0 === $row_num ) {
135
+ $headers[] = array( 'type' => $this->get_col_type( $col_num++ ), 'label' => $k );
136
+ }
137
  }
138
+ $results[] = $result;
139
+ $row_num++;
140
  }
 
 
141
  }
 
142
 
143
+ $this->_error = $wpdb->last_error;
 
144
  }
 
145
  }
146
 
147
+ if ( $as_html ) {
148
+ return $this->html( $headers, $results );
149
+ }
150
+ return $this->object( $headers, $results );
151
  }
152
 
153
  /**
classes/Visualizer/Source/Query/Params.php CHANGED
@@ -337,7 +337,7 @@ class Visualizer_Source_Query_Params extends Visualizer_Source_Query {
337
  * @access public
338
  * @return array
339
  */
340
- public static function get_all_db_tables_column_mapping() {
341
  $mapping = array();
342
  $tables = self::get_db_tables();
343
  foreach ( $tables as $table ) {
@@ -345,6 +345,9 @@ class Visualizer_Source_Query_Params extends Visualizer_Source_Query {
345
  $names = wp_list_pluck( $cols, 'name' );
346
  $mapping[ $table ] = $names;
347
  }
 
 
 
348
  return $mapping;
349
  }
350
 
337
  * @access public
338
  * @return array
339
  */
340
+ public static function get_all_db_tables_column_mapping( $chart_id, $use_filter = true ) {
341
  $mapping = array();
342
  $tables = self::get_db_tables();
343
  foreach ( $tables as $table ) {
345
  $names = wp_list_pluck( $cols, 'name' );
346
  $mapping[ $table ] = $names;
347
  }
348
+ if ( $use_filter ) {
349
+ return apply_filters( 'visualizer_db_tables_column_mapping', $mapping, $chart_id );
350
+ }
351
  return $mapping;
352
  }
353
 
css/frame.css CHANGED
@@ -378,6 +378,7 @@ div.viz-group-content .viz-group-description {
378
 
379
  #toolbar .push-right {
380
  float: right;
 
381
  }
382
 
383
  #toolbar .push-left {
@@ -456,14 +457,14 @@ div.viz-group-content .viz-group-description {
456
  padding: 15px;
457
  border: 1px solid #e0e0e0;
458
  background-color: white;
459
- background-image: url(../images/chart_types_june2019_g.png);
460
  background-repeat: no-repeat;
461
  background-position: center center;
462
  }
463
 
464
  .type-label-selected,
465
  .type-box > .type-label:hover {
466
- background-image: url(../images/chart_types_june2019.png);
467
  }
468
 
469
  .type-box-area .type-label {
@@ -498,6 +499,10 @@ div.viz-group-content .viz-group-description {
498
  background-position: -300px -225px;
499
  }
500
 
 
 
 
 
501
  .type-box-column .type-label {
502
  background-position: -600px -225px;
503
  }
@@ -1386,11 +1391,14 @@ span.viz-section-error {
1386
  min-width: 10px !important;
1387
  }
1388
 
1389
- #json-conclude-form .json-table,
 
 
 
1390
  #vz-import-json-url,
1391
  #vz-import-json-root,
1392
  #vz-import-json-paging {
1393
- width: 85%;
1394
  }
1395
 
1396
  #json-conclude-form .json-table,
@@ -1422,6 +1430,35 @@ span.viz-section-error {
1422
  color: #ffffff;
1423
  }
1424
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1425
  /******************************************************************************/
1426
  /******************************** html table editor **************************/
1427
  /******************************************************************************/
378
 
379
  #toolbar .push-right {
380
  float: right;
381
+ margin-right: 10px;
382
  }
383
 
384
  #toolbar .push-left {
457
  padding: 15px;
458
  border: 1px solid #e0e0e0;
459
  background-color: white;
460
+ background-image: url(../images/chart_types_v340_g.png);
461
  background-repeat: no-repeat;
462
  background-position: center center;
463
  }
464
 
465
  .type-label-selected,
466
  .type-box > .type-label:hover {
467
+ background-image: url(../images/chart_types_v340.png);
468
  }
469
 
470
  .type-box-area .type-label {
499
  background-position: -300px -225px;
500
  }
501
 
502
+ .type-box-bubble .type-label {
503
+ background-position: -600px -906px;
504
+ }
505
+
506
  .type-box-column .type-label {
507
  background-position: -600px -225px;
508
  }
1391
  min-width: 10px !important;
1392
  }
1393
 
1394
+ #json-conclude-form .json-table {
1395
+ width: 85%;
1396
+ }
1397
+
1398
  #vz-import-json-url,
1399
  #vz-import-json-root,
1400
  #vz-import-json-paging {
1401
+ width: 75%;
1402
  }
1403
 
1404
  #json-conclude-form .json-table,
1430
  color: #ffffff;
1431
  }
1432
 
1433
+ .viz-substep {
1434
+ outline: 0 !important;
1435
+ border: 0 !important;
1436
+ background: none !important;
1437
+ text-transform: uppercase;
1438
+ }
1439
+
1440
+ .viz-substep.ui-state-active {
1441
+ }
1442
+
1443
+ .viz-substep ~ .ui-accordion-content {
1444
+ outline: 0 !important;
1445
+ border: 0 !important;
1446
+ font-size: smaller;
1447
+ }
1448
+
1449
+ .viz-substep ~ div {
1450
+ display: table;
1451
+ }
1452
+
1453
+ .viz-substep ~ div > div {
1454
+ display: table-row;
1455
+ }
1456
+
1457
+ .viz-substep ~ div > div div {
1458
+ display: table-cell;
1459
+ padding: 5px;
1460
+ }
1461
+
1462
  /******************************************************************************/
1463
  /******************************** html table editor **************************/
1464
  /******************************************************************************/
css/library.css CHANGED
@@ -311,3 +311,21 @@ div#visualizer-types ul, div#visualizer-types form p {
311
  vertical-align: middle;
312
  margin: 0;
313
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
311
  vertical-align: middle;
312
  margin: 0;
313
  }
314
+
315
+ .visualizer-chart-status {
316
+ padding: 3px 0;
317
+ color: #aaa;
318
+ text-shadow: 0 1px 0 #fff;
319
+ }
320
+
321
+ .visualizer-chart-status span.visualizer-error {
322
+ float: right;
323
+ }
324
+
325
+ .visualizer-error i {
326
+ color: green;
327
+ }
328
+ .visualizer-error i.error {
329
+ color: red;
330
+ cursor: pointer;
331
+ }
css/media.css CHANGED
@@ -1,5 +1,5 @@
1
  /*
2
- Version: 3.3.4
3
  */
4
  #visualizer-library-view {
5
  padding: 30px 10px 10px 30px;
1
  /*
2
+ Version: 3.4.0
3
  */
4
  #visualizer-library-view {
5
  padding: 30px 10px 10px 30px;
images/chart_types_june2019.png DELETED
Binary file
images/chart_types_june2019_g.png DELETED
Binary file
images/chart_types_v340.png ADDED
Binary file
images/chart_types_v340_g.png ADDED
Binary file
index.php CHANGED
@@ -1,10 +1,10 @@
1
  <?php
2
 
3
  /*
4
- Plugin Name: Visualizer: Tables and Charts Manager for WordPress
5
  Plugin URI: https://themeisle.com/plugins/visualizer-charts-and-graphs-lite/
6
  Description: A simple, easy to use and quite powerful tool to create, manage and embed interactive charts into your WordPress posts and pages. The plugin uses Google Visualization API to render charts, which supports cross-browser compatibility (adopting VML for older IE versions) and cross-platform portability to iOS and new Android releases.
7
- Version: 3.3.4
8
  Author: Themeisle
9
  Author URI: http://themeisle.com
10
  License: GPL v2.0 or later
@@ -70,6 +70,7 @@ function visualizer_launch() {
70
  define( 'VISUALIZER_ABSPATH', dirname( __FILE__ ) );
71
  define( 'VISUALIZER_REST_VERSION', 1 );
72
  // if the below is true, then the js/customization.js in the plugin folder will be used instead of the one in the uploads folder (if it exists).
 
73
  define( 'VISUALIZER_TEST_JS_CUSTOMIZATION', false );
74
 
75
  if ( ! defined( 'VISUALIZER_CSV_DELIMITER' ) ) {
@@ -91,6 +92,9 @@ function visualizer_launch() {
91
  define( 'VISUALIZER_DB_QUERY_DOC_URL', 'https://docs.themeisle.com/article/970-visualizer-sample-queries-to-generate-charts' );
92
  define( 'VISUALIZER_MAIN_DOC', 'https://docs.themeisle.com/category/657-visualizer' );
93
 
 
 
 
94
  // instantiate the plugin
95
  $plugin = Visualizer_Plugin::instance();
96
 
@@ -153,3 +157,17 @@ function visualizer_register_parrot( $plugins ) {
153
  spl_autoload_register( 'visualizer_autoloader' );
154
  // launch the plugin
155
  visualizer_launch();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
 
3
  /*
4
+ Plugin Name: Visualizer: Tables and Charts for WordPress
5
  Plugin URI: https://themeisle.com/plugins/visualizer-charts-and-graphs-lite/
6
  Description: A simple, easy to use and quite powerful tool to create, manage and embed interactive charts into your WordPress posts and pages. The plugin uses Google Visualization API to render charts, which supports cross-browser compatibility (adopting VML for older IE versions) and cross-platform portability to iOS and new Android releases.
7
+ Version: 3.4.0
8
  Author: Themeisle
9
  Author URI: http://themeisle.com
10
  License: GPL v2.0 or later
70
  define( 'VISUALIZER_ABSPATH', dirname( __FILE__ ) );
71
  define( 'VISUALIZER_REST_VERSION', 1 );
72
  // if the below is true, then the js/customization.js in the plugin folder will be used instead of the one in the uploads folder (if it exists).
73
+ // this is also used in Block.php
74
  define( 'VISUALIZER_TEST_JS_CUSTOMIZATION', false );
75
 
76
  if ( ! defined( 'VISUALIZER_CSV_DELIMITER' ) ) {
92
  define( 'VISUALIZER_DB_QUERY_DOC_URL', 'https://docs.themeisle.com/article/970-visualizer-sample-queries-to-generate-charts' );
93
  define( 'VISUALIZER_MAIN_DOC', 'https://docs.themeisle.com/category/657-visualizer' );
94
 
95
+ // to redirect all themeisle_log_event to error log.
96
+ define( 'VISUALIZER_LOCAL_DEBUG', false );
97
+
98
  // instantiate the plugin
99
  $plugin = Visualizer_Plugin::instance();
100
 
157
  spl_autoload_register( 'visualizer_autoloader' );
158
  // launch the plugin
159
  visualizer_launch();
160
+
161
+
162
+ if ( VISUALIZER_LOCAL_DEBUG ) {
163
+ add_action( 'themeisle_log_event', 'visualizer_themeisle_log_event', 10, 5 );
164
+
165
+ /**
166
+ * Redirect themeisle_log_event to error log.
167
+ */
168
+ function visualizer_themeisle_log_event( $name, $msg, $type, $file, $line ) {
169
+ if ( $name === Visualizer_Plugin::NAME ) {
170
+ error_log( sprintf( '%s (%s:%d): %s', $type, $file, $line, $msg ) );
171
+ }
172
+ }
173
+ }
js/frame.js CHANGED
@@ -69,7 +69,7 @@
69
  });
70
 
71
  // collapse other open sections of this group
72
- $('.viz-group-title').click(function () {
73
  var parent = $(this).parent();
74
 
75
  if (parent.hasClass('open')) {
@@ -89,17 +89,17 @@
89
  });
90
 
91
  // collapse other open subsections of this section
92
- $('.viz-section-title').click(function () {
93
  var grandparent = $(this).parent().parent();
94
  grandparent.find('.viz-section-title.open ~ .viz-section-items').hide();
95
  grandparent.find('.viz-section-title.open').removeClass('open');
96
  });
97
 
98
  $('#view-remote-file').click(function () {
99
- var url = $(this).parent().find('#remote-data').val();
100
 
101
  if (url !== '') {
102
- if (/^([a-z]([a-z]|\d|\+|-|\.)*):(\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?((\[(|(v[\da-f]{1,}\.(([a-z]|\d|-|\.|_|~)|[!\$&'\(\)\*\+,;=]|:)+))\])|((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=])*)(:\d*)?)(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*|(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)){0})(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(url)) {
103
  if (url.substr(url.length - 8) === '/pubhtml') {
104
  url = url.substring(0, url.length - 8) + '/export?format=csv';
105
  }
@@ -124,11 +124,11 @@
124
  $('#canvas').unlock();
125
  });
126
 
127
- $('.viz-section-title').click(function () {
128
  $(this).toggleClass('open').parent().find('.viz-section-items').toggle();
129
  });
130
 
131
- $('.more-info').click(function () {
132
  $(this).parent().find('.viz-section-description:first').toggle();
133
  return false;
134
  });
@@ -278,6 +278,18 @@
278
  $('body').on('visualizer:db:query:update', function(event, data){
279
  cm.save();
280
  });
 
 
 
 
 
 
 
 
 
 
 
 
281
  }
282
 
283
  function init_filter_import() {
@@ -370,11 +382,18 @@
370
  heightStyle: 'content',
371
  active: 0
372
  });
 
 
 
 
 
373
 
374
  // toggle between chart and create/modify parameters
375
  $( '#json-chart-button' ).on( 'click', function(){
376
- $('#content').css('width', 'calc(100% - 300px)');
 
377
  if( $(this).attr( 'data-current' ) === 'chart'){
 
378
  $(this).val( $(this).attr( 'data-t-filter' ) );
379
  $(this).html( $(this).attr( 'data-t-filter' ) );
380
  $(this).attr( 'data-current', 'filter' );
@@ -382,17 +401,23 @@
382
  $( '#visualizer-json-screen' ).css("z-index", "9999").show();
383
  $( '#canvas' ).hide();
384
  }else{
385
- var filter_button = $(this);
386
- $( '#visualizer-json-screen' ).css("z-index", "-1").hide();
387
- $('#canvas').lock();
388
- filter_button.val( filter_button.attr( 'data-t-chart' ) );
389
- filter_button.html( filter_button.attr( 'data-t-chart' ) );
390
- filter_button.attr( 'data-current', 'chart' );
391
- $( '#canvas' ).css("z-index", "1").show();
392
- $('#canvas').unlock();
393
  }
394
  } );
395
 
 
 
 
 
 
 
 
 
 
 
 
 
396
  // fetch the roots for the provided endpoint
397
  $( '#visualizer-json-fetch' ).on( 'click', function(e){
398
  e.preventDefault();
@@ -410,7 +435,6 @@
410
  },
411
  success : function(data){
412
  if(data.success){
413
- $('#json-root-form [name="url"]').val(data.data.url);
414
  $('#vz-import-json-root').empty();
415
  $.each(data.data.roots, function(i, name){
416
  $('#vz-import-json-root').append('<option value="' + name + '">' + name.replace(regex, visualizer.json_tag_separator_view) + '</option>');
@@ -439,7 +463,7 @@
439
  data : {
440
  'action' : visualizer.ajax['actions']['json_get_data'],
441
  'security' : visualizer.ajax['nonces']['json_get_data'],
442
- 'params' : $('#json-root-form').serialize()
443
  },
444
  success : function(data){
445
  if(data.success){
@@ -453,8 +477,6 @@
453
  });
454
  $('.json-pagination').show();
455
  }
456
- $('#json-conclude-form [name="url"]').val(data.data.url);
457
- $('#json-conclude-form [name="root"]').val(data.data.root);
458
  $('#json-conclude-form .json-table').html(data.data.table);
459
 
460
  var $table = create_editor_table( '#json-conclude-form' );
@@ -474,12 +496,24 @@
474
 
475
  // when the data is set and the chart is updated, toggle the screen so that the chart is shown
476
  $('#json-conclude-form').on( 'submit', function(e){
477
- // populate the form elements that are in the misc tab.
478
- $('#json-conclude-form-helper .json-form-element').each(function(x, y){
 
 
 
 
 
 
 
 
 
 
 
 
479
  $('#json-conclude-form').append('<input type="hidden" name="' + y.name + '" value="' + y.value + '">');
480
  });
481
- $( '#json-chart-button' ).trigger('click');
482
- $('#canvas').lock();
483
  });
484
 
485
  // update the schedule
@@ -508,14 +542,14 @@
508
 
509
  function init_editor_table() {
510
  $('body').on('visualizer:db:editor:table:init', function(event, data){
511
- var $table = create_editor_table('.viz-table-editor');
512
  $('body').on('visualizer:db:editor:table:redraw', function(event, data){
513
  $table.draw();
514
  });
515
  });
516
  }
517
 
518
- function create_editor_table(element) {
519
  var settings = {
520
  paging: false,
521
  searching: false,
@@ -542,6 +576,9 @@
542
  ]
543
  } );
544
  }
 
 
 
545
 
546
  var $table = $(element + ' .viz-editor-table').DataTable(settings);
547
  return $table;
69
  });
70
 
71
  // collapse other open sections of this group
72
+ $(document).on('click', '.viz-group-title', function () {
73
  var parent = $(this).parent();
74
 
75
  if (parent.hasClass('open')) {
89
  });
90
 
91
  // collapse other open subsections of this section
92
+ $(document).on('click', '.viz-section-title', function () {
93
  var grandparent = $(this).parent().parent();
94
  grandparent.find('.viz-section-title.open ~ .viz-section-items').hide();
95
  grandparent.find('.viz-section-title.open').removeClass('open');
96
  });
97
 
98
  $('#view-remote-file').click(function () {
99
+ var url = $(this).parent().find('#vz-schedule-url').val();
100
 
101
  if (url !== '') {
102
+ if (url.indexOf('localhost') !== -1 || /^([a-z]([a-z]|\d|\+|-|\.)*):(\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?((\[(|(v[\da-f]{1,}\.(([a-z]|\d|-|\.|_|~)|[!\$&'\(\)\*\+,;=]|:)+))\])|((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=])*)(:\d*)?)(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*|(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)){0})(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(url)) {
103
  if (url.substr(url.length - 8) === '/pubhtml') {
104
  url = url.substring(0, url.length - 8) + '/export?format=csv';
105
  }
124
  $('#canvas').unlock();
125
  });
126
 
127
+ $(document).on('click', '.viz-section-title', function () {
128
  $(this).toggleClass('open').parent().find('.viz-section-items').toggle();
129
  });
130
 
131
+ $(document).on('click', '.more-info', function () {
132
  $(this).parent().find('.viz-section-description:first').toggle();
133
  return false;
134
  });
278
  $('body').on('visualizer:db:query:update', function(event, data){
279
  cm.save();
280
  });
281
+
282
+ // clear the editor.
283
+ $('body').on('visualizer:db:query:setvalue', function(event, data){
284
+ cm.setValue(data.value);
285
+ cm.clearHistory();
286
+ cm.refresh();
287
+ });
288
+
289
+ // set an option at runtime?
290
+ $('body').on('visualizer:db:query:changeoption', function(event, data){
291
+ cm.setOption(data.name, data.value);
292
+ });
293
  }
294
 
295
  function init_filter_import() {
382
  heightStyle: 'content',
383
  active: 0
384
  });
385
+ $('.visualizer-json-subform').accordion({
386
+ heightStyle: 'content',
387
+ active: false,
388
+ collapsible: true
389
+ });
390
 
391
  // toggle between chart and create/modify parameters
392
  $( '#json-chart-button' ).on( 'click', function(){
393
+ var $bttn = $(this);
394
+ $('#content').css('width', 'calc(100% - 100px)');
395
  if( $(this).attr( 'data-current' ) === 'chart'){
396
+ // toggle from chart to LHS form
397
  $(this).val( $(this).attr( 'data-t-filter' ) );
398
  $(this).html( $(this).attr( 'data-t-filter' ) );
399
  $(this).attr( 'data-current', 'filter' );
401
  $( '#visualizer-json-screen' ).css("z-index", "9999").show();
402
  $( '#canvas' ).hide();
403
  }else{
404
+ // toggle from LHS form to chart
405
+ $( '#json-conclude-form' ).trigger('submit');
 
 
 
 
 
 
406
  }
407
  } );
408
 
409
+ $('body').on('visualizer:json:form:submit', function() {
410
+ var filter_button = $( '#json-chart-button' );
411
+ $( '#visualizer-json-screen' ).css("z-index", "-1").hide();
412
+ $('#canvas').lock();
413
+ filter_button.val( filter_button.attr( 'data-t-chart' ) );
414
+ filter_button.html( filter_button.attr( 'data-t-chart' ) );
415
+ filter_button.attr( 'data-current', 'chart' );
416
+ end_ajax( $( '#visualizer-json-screen' ) );
417
+ $( '#canvas' ).css("z-index", "1").show();
418
+ });
419
+
420
+
421
  // fetch the roots for the provided endpoint
422
  $( '#visualizer-json-fetch' ).on( 'click', function(e){
423
  e.preventDefault();
435
  },
436
  success : function(data){
437
  if(data.success){
 
438
  $('#vz-import-json-root').empty();
439
  $.each(data.data.roots, function(i, name){
440
  $('#vz-import-json-root').append('<option value="' + name + '">' + name.replace(regex, visualizer.json_tag_separator_view) + '</option>');
463
  data : {
464
  'action' : visualizer.ajax['actions']['json_get_data'],
465
  'security' : visualizer.ajax['nonces']['json_get_data'],
466
+ 'params' : $('#json-root-form, #json-endpoint-form').serialize()
467
  },
468
  success : function(data){
469
  if(data.success){
477
  });
478
  $('.json-pagination').show();
479
  }
 
 
480
  $('#json-conclude-form .json-table').html(data.data.table);
481
 
482
  var $table = create_editor_table( '#json-conclude-form' );
496
 
497
  // when the data is set and the chart is updated, toggle the screen so that the chart is shown
498
  $('#json-conclude-form').on( 'submit', function(e){
499
+ // at least one column has to be selected as non-excluded.
500
+ var count_selected = 0;
501
+ $('select.viz-select-data-type').each(function(i, element){
502
+ if($(element).prop('selectedIndex') > 0){
503
+ count_selected++;
504
+ }
505
+ });
506
+ if(count_selected === 0){
507
+ alert(visualizer.l10n.select_columns);
508
+ return false;
509
+ }
510
+
511
+ // populate the form elements that are in the other tabs.
512
+ $('#json-conclude-form-helper .json-form-element, #json-endpoint-form .json-form-element, #json-root-form .json-form-element, #vz-import-json .json-form-element').each(function(x, y){
513
  $('#json-conclude-form').append('<input type="hidden" name="' + y.name + '" value="' + y.value + '">');
514
  });
515
+
516
+ $('body').trigger('visualizer:json:form:submit');
517
  });
518
 
519
  // update the schedule
542
 
543
  function init_editor_table() {
544
  $('body').on('visualizer:db:editor:table:init', function(event, data){
545
+ var $table = create_editor_table('.viz-table-editor', data.config);
546
  $('body').on('visualizer:db:editor:table:redraw', function(event, data){
547
  $table.draw();
548
  });
549
  });
550
  }
551
 
552
+ function create_editor_table(element, config) {
553
  var settings = {
554
  paging: false,
555
  searching: false,
576
  ]
577
  } );
578
  }
579
+ if(config){
580
+ $.extend( settings, config );
581
+ }
582
 
583
  var $table = $(element + ' .viz-editor-table').DataTable(settings);
584
  return $table;
js/lib/chartjs.min.js CHANGED
@@ -4,4 +4,13 @@
4
  * (c) 2019 Chart.js Contributors
5
  * Released under the MIT License
6
  */
 
 
 
 
 
 
 
 
 
7
  !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(function(){try{return require("moment")}catch(t){}}()):"function"==typeof define&&define.amd?define(["require"],function(t){return e(function(){try{return t("moment")}catch(t){}}())}):t.Chart=e(t.moment)}(this,function(t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var e={rgb2hsl:i,rgb2hsv:n,rgb2hwb:a,rgb2cmyk:o,rgb2keyword:s,rgb2xyz:l,rgb2lab:d,rgb2lch:function(t){return x(d(t))},hsl2rgb:u,hsl2hsv:function(t){var e=t[0],i=t[1]/100,n=t[2]/100;if(0===n)return[0,0,0];return[e,100*(2*(i*=(n*=2)<=1?n:2-n)/(n+i)),100*((n+i)/2)]},hsl2hwb:function(t){return a(u(t))},hsl2cmyk:function(t){return o(u(t))},hsl2keyword:function(t){return s(u(t))},hsv2rgb:h,hsv2hsl:function(t){var e,i,n=t[0],a=t[1]/100,o=t[2]/100;return e=a*o,[n,100*(e=(e/=(i=(2-a)*o)<=1?i:2-i)||0),100*(i/=2)]},hsv2hwb:function(t){return a(h(t))},hsv2cmyk:function(t){return o(h(t))},hsv2keyword:function(t){return s(h(t))},hwb2rgb:c,hwb2hsl:function(t){return i(c(t))},hwb2hsv:function(t){return n(c(t))},hwb2cmyk:function(t){return o(c(t))},hwb2keyword:function(t){return s(c(t))},cmyk2rgb:f,cmyk2hsl:function(t){return i(f(t))},cmyk2hsv:function(t){return n(f(t))},cmyk2hwb:function(t){return a(f(t))},cmyk2keyword:function(t){return s(f(t))},keyword2rgb:w,keyword2hsl:function(t){return i(w(t))},keyword2hsv:function(t){return n(w(t))},keyword2hwb:function(t){return a(w(t))},keyword2cmyk:function(t){return o(w(t))},keyword2lab:function(t){return d(w(t))},keyword2xyz:function(t){return l(w(t))},xyz2rgb:p,xyz2lab:m,xyz2lch:function(t){return x(m(t))},lab2xyz:v,lab2rgb:y,lab2lch:x,lch2lab:k,lch2xyz:function(t){return v(k(t))},lch2rgb:function(t){return y(k(t))}};function i(t){var e,i,n=t[0]/255,a=t[1]/255,o=t[2]/255,r=Math.min(n,a,o),s=Math.max(n,a,o),l=s-r;return s==r?e=0:n==s?e=(a-o)/l:a==s?e=2+(o-n)/l:o==s&&(e=4+(n-a)/l),(e=Math.min(60*e,360))<0&&(e+=360),i=(r+s)/2,[e,100*(s==r?0:i<=.5?l/(s+r):l/(2-s-r)),100*i]}function n(t){var e,i,n=t[0],a=t[1],o=t[2],r=Math.min(n,a,o),s=Math.max(n,a,o),l=s-r;return i=0==s?0:l/s*1e3/10,s==r?e=0:n==s?e=(a-o)/l:a==s?e=2+(o-n)/l:o==s&&(e=4+(n-a)/l),(e=Math.min(60*e,360))<0&&(e+=360),[e,i,s/255*1e3/10]}function a(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 o(t){var e,i=t[0]/255,n=t[1]/255,a=t[2]/255;return[100*((1-i-(e=Math.min(1-i,1-n,1-a)))/(1-e)||0),100*((1-n-e)/(1-e)||0),100*((1-a-e)/(1-e)||0),100*e]}function s(t){return _[JSON.stringify(t)]}function l(t){var e=t[0]/255,i=t[1]/255,n=t[2]/255;return[100*(.4124*(e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)+.1805*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*e+.7152*i+.0722*n),100*(.0193*e+.1192*i+.9505*n)]}function d(t){var e=l(t),i=e[0],n=e[1],a=e[2];return n/=100,a/=108.883,i=(i/=95.047)>.008856?Math.pow(i,1/3):7.787*i+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(i-n),200*(n-(a=a>.008856?Math.pow(a,1/3):7.787*a+16/116))]}function u(t){var e,i,n,a,o,r=t[0]/360,s=t[1]/100,l=t[2]/100;if(0==s)return[o=255*l,o,o];e=2*l-(i=l<.5?l*(1+s):l+s-l*s),a=[0,0,0];for(var d=0;d<3;d++)(n=r+1/3*-(d-1))<0&&n++,n>1&&n--,o=6*n<1?e+6*(i-e)*n:2*n<1?i:3*n<2?e+(i-e)*(2/3-n)*6:e,a[d]=255*o;return a}function h(t){var e=t[0]/60,i=t[1]/100,n=t[2]/100,a=Math.floor(e)%6,o=e-Math.floor(e),r=255*n*(1-i),s=255*n*(1-i*o),l=255*n*(1-i*(1-o));n*=255;switch(a){case 0:return[n,l,r];case 1:return[s,n,r];case 2:return[r,n,l];case 3:return[r,s,n];case 4:return[l,r,n];case 5:return[n,r,s]}}function c(t){var e,i,n,a,o=t[0]/360,s=t[1]/100,l=t[2]/100,d=s+l;switch(d>1&&(s/=d,l/=d),n=6*o-(e=Math.floor(6*o)),0!=(1&e)&&(n=1-n),a=s+n*((i=1-l)-s),e){default:case 6:case 0:r=i,g=a,b=s;break;case 1:r=a,g=i,b=s;break;case 2:r=s,g=i,b=a;break;case 3:r=s,g=a,b=i;break;case 4:r=a,g=s,b=i;break;case 5:r=i,g=s,b=a}return[255*r,255*g,255*b]}function f(t){var e=t[0]/100,i=t[1]/100,n=t[2]/100,a=t[3]/100;return[255*(1-Math.min(1,e*(1-a)+a)),255*(1-Math.min(1,i*(1-a)+a)),255*(1-Math.min(1,n*(1-a)+a))]}function p(t){var e,i,n,a=t[0]/100,o=t[1]/100,r=t[2]/100;return i=-.9689*a+1.8758*o+.0415*r,n=.0557*a+-.204*o+1.057*r,e=(e=3.2406*a+-1.5372*o+-.4986*r)>.0031308?1.055*Math.pow(e,1/2.4)-.055:e*=12.92,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*=12.92,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n*=12.92,[255*(e=Math.min(Math.max(0,e),1)),255*(i=Math.min(Math.max(0,i),1)),255*(n=Math.min(Math.max(0,n),1))]}function m(t){var e=t[0],i=t[1],n=t[2];return i/=100,n/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116)-16,500*(e-i),200*(i-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]}function v(t){var e,i,n,a,o=t[0],r=t[1],s=t[2];return o<=8?a=(i=100*o/903.3)/100*7.787+16/116:(i=100*Math.pow((o+16)/116,3),a=Math.pow(i/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,n=n/108.883<=.008859?n=108.883*(a-s/200-16/116)/7.787:108.883*Math.pow(a-s/200,3)]}function x(t){var e,i=t[0],n=t[1],a=t[2];return(e=360*Math.atan2(a,n)/2/Math.PI)<0&&(e+=360),[i,Math.sqrt(n*n+a*a),e]}function y(t){return p(v(t))}function k(t){var e,i=t[0],n=t[1];return e=t[2]/360*2*Math.PI,[i,n*Math.cos(e),n*Math.sin(e)]}function w(t){return M[t]}var M={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]},_={};for(var C in M)_[JSON.stringify(M[C])]=C;var S=function(){return new T};for(var P in e){S[P+"Raw"]=function(t){return function(i){return"number"==typeof i&&(i=Array.prototype.slice.call(arguments)),e[t](i)}}(P);var I=/(\w+)2(\w+)/.exec(P),A=I[1],D=I[2];(S[A]=S[A]||{})[D]=S[P]=function(t){return function(i){"number"==typeof i&&(i=Array.prototype.slice.call(arguments));var n=e[t](i);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}}(P)}var T=function(){this.convs={}};T.prototype.routeSpace=function(t,e){var i=e[0];return void 0===i?this.getValues(t):("number"==typeof i&&(i=Array.prototype.slice.call(e)),this.setValues(t,i))},T.prototype.setValues=function(t,e){return this.space=t,this.convs={},this.convs[t]=e,this},T.prototype.getValues=function(t){var e=this.convs[t];if(!e){var i=this.space,n=this.convs[i];e=S[i][t](n),this.convs[t]=e}return e},["rgb","hsl","hsv","cmyk","keyword"].forEach(function(t){T.prototype[t]=function(e){return this.routeSpace(t,arguments)}});var F=S,L={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},R={getRgba:O,getHsla:z,getRgb:function(t){var e=O(t);return e&&e.slice(0,3)},getHsl:function(t){var e=z(t);return e&&e.slice(0,3)},getHwb:B,getAlpha:function(t){var e=O(t);if(e)return e[3];if(e=z(t))return e[3];if(e=B(t))return e[3]},hexString:function(t,e){var e=void 0!==e&&3===t.length?e:t[3];return"#"+H(t[0])+H(t[1])+H(t[2])+(e>=0&&e<1?H(Math.round(255*e)):"")},rgbString:function(t,e){if(e<1||t[3]&&t[3]<1)return N(t,e);return"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},rgbaString:N,percentString:function(t,e){if(e<1||t[3]&&t[3]<1)return W(t,e);var i=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),a=Math.round(t[2]/255*100);return"rgb("+i+"%, "+n+"%, "+a+"%)"},percentaString:W,hslString:function(t,e){if(e<1||t[3]&&t[3]<1)return V(t,e);return"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"},hslaString:V,hwbString:function(t,e){void 0===e&&(e=void 0!==t[3]?t[3]:1);return"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+(void 0!==e&&1!==e?", "+e:"")+")"},keyword:function(t){return j[t.slice(0,3)]}};function O(t){if(t){var e=[0,0,0],i=1,n=t.match(/^#([a-fA-F0-9]{3,4})$/i),a="";if(n){a=(n=n[1])[3];for(var o=0;o<e.length;o++)e[o]=parseInt(n[o]+n[o],16);a&&(i=Math.round(parseInt(a+a,16)/255*100)/100)}else if(n=t.match(/^#([a-fA-F0-9]{6}([a-fA-F0-9]{2})?)$/i)){a=n[2],n=n[1];for(o=0;o<e.length;o++)e[o]=parseInt(n.slice(2*o,2*o+2),16);a&&(i=Math.round(parseInt(a,16)/255*100)/100)}else if(n=t.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(o=0;o<e.length;o++)e[o]=parseInt(n[o+1]);i=parseFloat(n[4])}else if(n=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(o=0;o<e.length;o++)e[o]=Math.round(2.55*parseFloat(n[o+1]));i=parseFloat(n[4])}else if(n=t.match(/(\w+)/)){if("transparent"==n[1])return[0,0,0,0];if(!(e=L[n[1]]))return}for(o=0;o<e.length;o++)e[o]=E(e[o],0,255);return i=i||0==i?E(i,0,1):1,e[3]=i,e}}function z(t){if(t){var e=t.match(/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(e){var i=parseFloat(e[4]);return[E(parseInt(e[1]),0,360),E(parseFloat(e[2]),0,100),E(parseFloat(e[3]),0,100),E(isNaN(i)?1:i,0,1)]}}}function B(t){if(t){var e=t.match(/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(e){var i=parseFloat(e[4]);return[E(parseInt(e[1]),0,360),E(parseFloat(e[2]),0,100),E(parseFloat(e[3]),0,100),E(isNaN(i)?1:i,0,1)]}}}function N(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"rgba("+t[0]+", "+t[1]+", "+t[2]+", "+e+")"}function W(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 V(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+e+")"}function E(t,e,i){return Math.min(Math.max(e,t),i)}function H(t){var e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}var j={};for(var q in L)j[L[q]]=q;var Y=function(t){return t instanceof Y?t:this instanceof Y?(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},void("string"==typeof t?(e=R.getRgba(t))?this.setValues("rgb",e):(e=R.getHsla(t))?this.setValues("hsl",e):(e=R.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)))):new Y(t);var e};Y.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 R.hexString(this.values.rgb)},rgbString:function(){return R.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return R.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return R.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return R.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return R.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return R.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return R.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=[],i=0;i<t.length;i++){var n=t[i]/255;e[i]=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),i=t.luminosity();return e>i?(e+.05)/(i+.05):(i+.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,i=(e[0]+t)%360;return e[0]=i<0?360+i:i,this.setValues("hsl",e),this},mix:function(t,e){var i=t,n=void 0===e?.5:e,a=2*n-1,o=this.alpha()-i.alpha(),r=((a*o==-1?a:(a+o)/(1+a*o))+1)/2,s=1-r;return this.rgb(r*this.red()+s*i.red(),r*this.green()+s*i.green(),r*this.blue()+s*i.blue()).alpha(this.alpha()*n+i.alpha()*(1-n))},toJSON:function(){return this.rgb()},clone:function(){var t,e,i=new Y,n=this.values,a=i.values;for(var o in n)n.hasOwnProperty(o)&&(t=n[o],"[object Array]"===(e={}.toString.call(t))?a[o]=t.slice(0):"[object Number]"===e?a[o]=t:console.error("unexpected color value:",t));return i}},Y.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},Y.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},Y.prototype.getValues=function(t){for(var e=this.values,i={},n=0;n<t.length;n++)i[t.charAt(n)]=e[t][n];return 1!==e.alpha&&(i.a=e.alpha),i},Y.prototype.setValues=function(t,e){var i,n,a=this.values,o=this.spaces,r=this.maxes,s=1;if(this.valid=!0,"alpha"===t)s=e;else if(e.length)a[t]=e.slice(0,t.length),s=e[t.length];else if(void 0!==e[t.charAt(0)]){for(i=0;i<t.length;i++)a[t][i]=e[t.charAt(i)];s=e.a}else if(void 0!==e[o[t][0]]){var l=o[t];for(i=0;i<t.length;i++)a[t][i]=e[l[i]];s=e.alpha}if(a.alpha=Math.max(0,Math.min(1,void 0===s?a.alpha:s)),"alpha"===t)return!1;for(i=0;i<t.length;i++)n=Math.max(0,Math.min(r[t][i],a[t][i])),a[t][i]=Math.round(n);for(var d in o)d!==t&&(a[d]=F[t][d](a[t]));return!0},Y.prototype.setSpace=function(t,e){var i=e[0];return void 0===i?this.getValues(t):("number"==typeof i&&(i=Array.prototype.slice.call(e)),this.setValues(t,i),this)},Y.prototype.setChannel=function(t,e,i){var n=this.values[t];return void 0===i?n[e]:i===n[e]?this:(n[e]=i,this.setValues(t,n),this)},"undefined"!=typeof window&&(window.Chart=window.Chart||{},window.Chart.Color=Y,void 0===window.Color&&(window.Color=Y));var U,X=Y,K={noop:function(){},uid:(U=0,function(){return U++}),isNullOrUndef:function(t){return null==t},isArray:function(t){if(Array.isArray&&Array.isArray(t))return!0;var e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)},isObject:function(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)},isFinite:function(t){return("number"==typeof t||t instanceof Number)&&isFinite(t)},valueOrDefault:function(t,e){return void 0===t?e:t},valueAtIndexOrDefault:function(t,e,i){return K.valueOrDefault(K.isArray(t)?t[e]:t,i)},callback:function(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)},each:function(t,e,i,n){var a,o,r;if(K.isArray(t))if(o=t.length,n)for(a=o-1;a>=0;a--)e.call(i,t[a],a);else for(a=0;a<o;a++)e.call(i,t[a],a);else if(K.isObject(t))for(o=(r=Object.keys(t)).length,a=0;a<o;a++)e.call(i,t[r[a]],r[a])},arrayEquals:function(t,e){var i,n,a,o;if(!t||!e||t.length!==e.length)return!1;for(i=0,n=t.length;i<n;++i)if(a=t[i],o=e[i],a instanceof Array&&o instanceof Array){if(!K.arrayEquals(a,o))return!1}else if(a!==o)return!1;return!0},clone:function(t){if(K.isArray(t))return t.map(K.clone);if(K.isObject(t)){for(var e={},i=Object.keys(t),n=i.length,a=0;a<n;++a)e[i[a]]=K.clone(t[i[a]]);return e}return t},_merger:function(t,e,i,n){var a=e[t],o=i[t];K.isObject(a)&&K.isObject(o)?K.merge(a,o,n):e[t]=K.clone(o)},_mergerIf:function(t,e,i){var n=e[t],a=i[t];K.isObject(n)&&K.isObject(a)?K.mergeIf(n,a):e.hasOwnProperty(t)||(e[t]=K.clone(a))},merge:function(t,e,i){var n,a,o,r,s,l=K.isArray(e)?e:[e],d=l.length;if(!K.isObject(t))return t;for(n=(i=i||{}).merger||K._merger,a=0;a<d;++a)if(e=l[a],K.isObject(e))for(s=0,r=(o=Object.keys(e)).length;s<r;++s)n(o[s],t,e,i);return t},mergeIf:function(t,e){return K.merge(t,e,{merger:K._mergerIf})},extend:function(t){for(var e=function(e,i){t[i]=e},i=1,n=arguments.length;i<n;++i)K.each(arguments[i],e);return t},inherits:function(t){var e=this,i=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return e.apply(this,arguments)},n=function(){this.constructor=i};return n.prototype=e.prototype,i.prototype=new n,i.extend=K.inherits,t&&K.extend(i.prototype,t),i.__super__=e.prototype,i}},G=K;K.callCallback=K.callback,K.indexOf=function(t,e,i){return Array.prototype.indexOf.call(t,e,i)},K.getValueOrDefault=K.valueOrDefault,K.getValueAtIndexOrDefault=K.valueAtIndexOrDefault;var Z={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,i=0,n=1;return 0===t?0:1===t?1:(i||(i=.3),n<1?(n=1,e=i/4):e=i/(2*Math.PI)*Math.asin(1/n),-n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i))},easeOutElastic:function(t){var e=1.70158,i=0,n=1;return 0===t?0:1===t?1:(i||(i=.3),n<1?(n=1,e=i/4):e=i/(2*Math.PI)*Math.asin(1/n),n*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/i)+1)},easeInOutElastic:function(t){var e=1.70158,i=0,n=1;return 0===t?0:2==(t/=.5)?1:(i||(i=.45),n<1?(n=1,e=i/4):e=i/(2*Math.PI)*Math.asin(1/n),t<1?n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*-.5:n*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*.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-Z.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*Z.easeInBounce(2*t):.5*Z.easeOutBounce(2*t-1)+.5}},$={effects:Z};G.easingEffects=Z;var J=Math.PI,Q=J/180,tt=2*J,et=J/2,it=J/4,nt=2*J/3,at={clear:function(t){t.ctx.clearRect(0,0,t.width,t.height)},roundedRect:function(t,e,i,n,a,o){if(o){var r=Math.min(o,a/2,n/2),s=e+r,l=i+r,d=e+n-r,u=i+a-r;t.moveTo(e,l),s<d&&l<u?(t.arc(s,l,r,-J,-et),t.arc(d,l,r,-et,0),t.arc(d,u,r,0,et),t.arc(s,u,r,et,J)):s<d?(t.moveTo(s,i),t.arc(d,l,r,-et,et),t.arc(s,l,r,et,J+et)):l<u?(t.arc(s,l,r,-J,0),t.arc(s,u,r,0,J)):t.arc(s,l,r,-J,J),t.closePath(),t.moveTo(e,i)}else t.rect(e,i,n,a)},drawPoint:function(t,e,i,n,a,o){var r,s,l,d,u,h=(o||0)*Q;if(!e||"object"!=typeof e||"[object HTMLImageElement]"!==(r=e.toString())&&"[object HTMLCanvasElement]"!==r){if(!(isNaN(i)||i<=0)){switch(t.beginPath(),e){default:t.arc(n,a,i,0,tt),t.closePath();break;case"triangle":t.moveTo(n+Math.sin(h)*i,a-Math.cos(h)*i),h+=nt,t.lineTo(n+Math.sin(h)*i,a-Math.cos(h)*i),h+=nt,t.lineTo(n+Math.sin(h)*i,a-Math.cos(h)*i),t.closePath();break;case"rectRounded":d=i-(u=.516*i),s=Math.cos(h+it)*d,l=Math.sin(h+it)*d,t.arc(n-s,a-l,u,h-J,h-et),t.arc(n+l,a-s,u,h-et,h),t.arc(n+s,a+l,u,h,h+et),t.arc(n-l,a+s,u,h+et,h+J),t.closePath();break;case"rect":if(!o){d=Math.SQRT1_2*i,t.rect(n-d,a-d,2*d,2*d);break}h+=it;case"rectRot":s=Math.cos(h)*i,l=Math.sin(h)*i,t.moveTo(n-s,a-l),t.lineTo(n+l,a-s),t.lineTo(n+s,a+l),t.lineTo(n-l,a+s),t.closePath();break;case"crossRot":h+=it;case"cross":s=Math.cos(h)*i,l=Math.sin(h)*i,t.moveTo(n-s,a-l),t.lineTo(n+s,a+l),t.moveTo(n+l,a-s),t.lineTo(n-l,a+s);break;case"star":s=Math.cos(h)*i,l=Math.sin(h)*i,t.moveTo(n-s,a-l),t.lineTo(n+s,a+l),t.moveTo(n+l,a-s),t.lineTo(n-l,a+s),h+=it,s=Math.cos(h)*i,l=Math.sin(h)*i,t.moveTo(n-s,a-l),t.lineTo(n+s,a+l),t.moveTo(n+l,a-s),t.lineTo(n-l,a+s);break;case"line":s=Math.cos(h)*i,l=Math.sin(h)*i,t.moveTo(n-s,a-l),t.lineTo(n+s,a+l);break;case"dash":t.moveTo(n,a),t.lineTo(n+Math.cos(h)*i,a+Math.sin(h)*i)}t.fill(),t.stroke()}}else t.drawImage(e,n-e.width/2,a-e.height/2,e.width,e.height)},_isPointInArea:function(t,e){return t.x>e.left-1e-6&&t.x<e.right+1e-6&&t.y>e.top-1e-6&&t.y<e.bottom+1e-6},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,i,n){var a=i.steppedLine;if(a){if("middle"===a){var o=(e.x+i.x)/2;t.lineTo(o,n?i.y:e.y),t.lineTo(o,n?e.y:i.y)}else"after"===a&&!n||"after"!==a&&n?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}else i.tension?t.bezierCurveTo(n?e.controlPointPreviousX:e.controlPointNextX,n?e.controlPointPreviousY:e.controlPointNextY,n?i.controlPointNextX:i.controlPointPreviousX,n?i.controlPointNextY:i.controlPointPreviousY,i.x,i.y):t.lineTo(i.x,i.y)}},ot=at;G.clear=at.clear,G.drawRoundedRectangle=function(t){t.beginPath(),at.roundedRect.apply(at,arguments)};var rt={_set:function(t,e){return G.merge(this[t]||(this[t]={}),e)}};rt._set("global",{defaultColor:"rgba(0,0,0,0.1)",defaultFontColor:"#666",defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFontStyle:"normal",defaultLineHeight:1.2,showLines:!0});var st=rt,lt=G.valueOrDefault;var dt={toLineHeight:function(t,e){var i=(""+t).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t},toPadding:function(t){var e,i,n,a;return G.isObject(t)?(e=+t.top||0,i=+t.right||0,n=+t.bottom||0,a=+t.left||0):e=i=n=a=+t||0,{top:e,right:i,bottom:n,left:a,height:e+n,width:a+i}},_parseFont:function(t){var e=st.global,i=lt(t.fontSize,e.defaultFontSize),n={family:lt(t.fontFamily,e.defaultFontFamily),lineHeight:G.options.toLineHeight(lt(t.lineHeight,e.defaultLineHeight),i),size:i,style:lt(t.fontStyle,e.defaultFontStyle),weight:null,string:""};return n.string=function(t){return!t||G.isNullOrUndef(t.size)||G.isNullOrUndef(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(n),n},resolve:function(t,e,i){var n,a,o;for(n=0,a=t.length;n<a;++n)if(void 0!==(o=t[n])&&(void 0!==e&&"function"==typeof o&&(o=o(e)),void 0!==i&&G.isArray(o)&&(o=o[i]),void 0!==o))return o}},ut=G,ht=$,ct=ot,ft=dt;ut.easing=ht,ut.canvas=ct,ut.options=ft;var gt=function(t){ut.extend(this,t),this.initialize.apply(this,arguments)};ut.extend(gt.prototype,{initialize:function(){this.hidden=!1},pivot:function(){var t=this;return t._view||(t._view=ut.clone(t._model)),t._start={},t},transition:function(t){var e=this,i=e._model,n=e._start,a=e._view;return i&&1!==t?(a||(a=e._view={}),n||(n=e._start={}),function(t,e,i,n){var a,o,r,s,l,d,u,h,c,f=Object.keys(i);for(a=0,o=f.length;a<o;++a)if(d=i[r=f[a]],e.hasOwnProperty(r)||(e[r]=d),(s=e[r])!==d&&"_"!==r[0]){if(t.hasOwnProperty(r)||(t[r]=s),(u=typeof d)==typeof(l=t[r]))if("string"===u){if((h=X(l)).valid&&(c=X(d)).valid){e[r]=c.mix(h,n).rgbString();continue}}else if(ut.isFinite(l)&&ut.isFinite(d)){e[r]=l+(d-l)*n;continue}e[r]=d}}(n,a,i,t),e):(e._view=i,e._start=null,e)},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return ut.isNumber(this._model.x)&&ut.isNumber(this._model.y)}}),gt.extend=ut.inherits;var pt=gt,mt=pt.extend({chart:null,currentStep:0,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),vt=mt;Object.defineProperty(mt.prototype,"animationObject",{get:function(){return this}}),Object.defineProperty(mt.prototype,"chartInstance",{get:function(){return this.chart},set:function(t){this.chart=t}}),st._set("global",{animation:{duration:1e3,easing:"easeOutQuart",onProgress:ut.noop,onComplete:ut.noop}});var bt={animations:[],request:null,addAnimation:function(t,e,i,n){var a,o,r=this.animations;for(e.chart=t,e.startTime=Date.now(),e.duration=i,n||(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=ut.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=ut.requestAnimFrame.call(window,function(){t.request=null,t.startDigest()}))},startDigest:function(){this.advance(),this.animations.length>0&&this.requestAnimationFrame()},advance:function(){for(var t,e,i,n,a=this.animations,o=0;o<a.length;)e=(t=a[o]).chart,i=t.numSteps,n=Math.floor((Date.now()-t.startTime)/t.duration*i)+1,t.currentStep=Math.min(n,i),ut.callback(t.render,[e,t],e),ut.callback(t.onAnimationProgress,[t],e),t.currentStep>=i?(ut.callback(t.onAnimationComplete,[t],e),e.animating=!1,a.splice(o,1)):++o}},xt=ut.options.resolve,yt=["push","pop","shift","splice","unshift"];function kt(t,e){var i=t._chartjs;if(i){var n=i.listeners,a=n.indexOf(e);-1!==a&&n.splice(a,1),n.length>0||(yt.forEach(function(e){delete t[e]}),delete t._chartjs)}}var wt=function(t,e){this.initialize(t,e)};ut.extend(wt.prototype,{datasetElementType:null,dataElementType:null,initialize:function(t,e){this.chart=t,this.index=e,this.linkScales(),this.addElements()},updateIndex:function(t){this.index=t},linkScales:function(){var t=this,e=t.getMeta(),i=t.getDataset();null!==e.xAxisID&&e.xAxisID in t.chart.scales||(e.xAxisID=i.xAxisID||t.chart.options.scales.xAxes[0].id),null!==e.yAxisID&&e.yAxisID in t.chart.scales||(e.yAxisID=i.yAxisID||t.chart.options.scales.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(t){return this.chart.scales[t]},_getValueScaleId:function(){return this.getMeta().yAxisID},_getIndexScaleId:function(){return this.getMeta().xAxisID},_getValueScale:function(){return this.getScaleForId(this._getValueScaleId())},_getIndexScale:function(){return this.getScaleForId(this._getIndexScaleId())},reset:function(){this.update(!0)},destroy:function(){this._data&&kt(this._data,this)},createMetaDataset:function(){var t=this.datasetElementType;return t&&new t({_chart:this.chart,_datasetIndex:this.index})},createMetaData:function(t){var e=this.dataElementType;return e&&new e({_chart:this.chart,_datasetIndex:this.index,_index:t})},addElements:function(){var t,e,i=this.getMeta(),n=this.getDataset().data||[],a=i.data;for(t=0,e=n.length;t<e;++t)a[t]=a[t]||this.createMetaData(t);i.dataset=i.dataset||this.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,e,i=this,n=i.getDataset(),a=n.data||(n.data=[]);i._data!==a&&(i._data&&kt(i._data,i),a&&Object.isExtensible(a)&&(e=i,(t=a)._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),yt.forEach(function(e){var i="onData"+e.charAt(0).toUpperCase()+e.slice(1),n=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:function(){var e=Array.prototype.slice.call(arguments),a=n.apply(this,e);return ut.each(t._chartjs.listeners,function(t){"function"==typeof t[i]&&t[i].apply(t,e)}),a}})}))),i._data=a),i.resyncElements()},update:ut.noop,transition:function(t){for(var e=this.getMeta(),i=e.data||[],n=i.length,a=0;a<n;++a)i[a].transition(t);e.dataset&&e.dataset.transition(t)},draw:function(){var t=this.getMeta(),e=t.data||[],i=e.length,n=0;for(t.dataset&&t.dataset.draw();n<i;++n)e[n].draw()},removeHoverStyle:function(t){ut.merge(t._model,t.$previousStyle||{}),delete t.$previousStyle},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],i=t._index,n=t.custom||{},a=t._model,o=ut.getHoverColor;t.$previousStyle={backgroundColor:a.backgroundColor,borderColor:a.borderColor,borderWidth:a.borderWidth},a.backgroundColor=xt([n.hoverBackgroundColor,e.hoverBackgroundColor,o(a.backgroundColor)],void 0,i),a.borderColor=xt([n.hoverBorderColor,e.hoverBorderColor,o(a.borderColor)],void 0,i),a.borderWidth=xt([n.hoverBorderWidth,e.hoverBorderWidth,a.borderWidth],void 0,i)},resyncElements:function(){var t=this.getMeta(),e=this.getDataset().data,i=t.data.length,n=e.length;n<i?t.data.splice(n,i-n):n>i&&this.insertElements(i,n-i)},insertElements:function(t,e){for(var i=0;i<e;++i)this.addElementAndReset(t+i)},onDataPush:function(){var t=arguments.length;this.insertElements(this.getDataset().data.length-t,t)},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)}}),wt.extend=ut.inherits;var Mt=wt;st._set("global",{elements:{arc:{backgroundColor:st.global.defaultColor,borderColor:"#fff",borderWidth:2,borderAlign:"center"}}});var _t=pt.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 i=this._view;if(i){for(var n=ut.getAngleFromPoint(i,{x:t,y:e}),a=n.angle,o=n.distance,r=i.startAngle,s=i.endAngle;s<r;)s+=2*Math.PI;for(;a>s;)a-=2*Math.PI;for(;a<r;)a+=2*Math.PI;var l=a>=r&&a<=s,d=o>=i.innerRadius&&o<=i.outerRadius;return l&&d}return!1},getCenterPoint:function(){var t=this._view,e=(t.startAngle+t.endAngle)/2,i=(t.innerRadius+t.outerRadius)/2;return{x:t.x+Math.cos(e)*i,y:t.y+Math.sin(e)*i}},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,i=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*i,y:t.y+Math.sin(e)*i}},draw:function(){var t,e=this._chart.ctx,i=this._view,n=i.startAngle,a=i.endAngle,o="inner"===i.borderAlign?.33:0;e.save(),e.beginPath(),e.arc(i.x,i.y,Math.max(i.outerRadius-o,0),n,a),e.arc(i.x,i.y,i.innerRadius,a,n,!0),e.closePath(),e.fillStyle=i.backgroundColor,e.fill(),i.borderWidth&&("inner"===i.borderAlign?(e.beginPath(),t=o/i.outerRadius,e.arc(i.x,i.y,i.outerRadius,n-t,a+t),i.innerRadius>o?(t=o/i.innerRadius,e.arc(i.x,i.y,i.innerRadius-o,a+t,n-t,!0)):e.arc(i.x,i.y,o,a+Math.PI/2,n-Math.PI/2),e.closePath(),e.clip(),e.beginPath(),e.arc(i.x,i.y,i.outerRadius,n,a),e.arc(i.x,i.y,i.innerRadius,a,n,!0),e.closePath(),e.lineWidth=2*i.borderWidth,e.lineJoin="round"):(e.lineWidth=i.borderWidth,e.lineJoin="bevel"),e.strokeStyle=i.borderColor,e.stroke()),e.restore()}}),Ct=ut.valueOrDefault,St=st.global.defaultColor;st._set("global",{elements:{line:{tension:.4,backgroundColor:St,borderWidth:3,borderColor:St,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0}}});var Pt=pt.extend({draw:function(){var t,e,i,n,a=this._view,o=this._chart.ctx,r=a.spanGaps,s=this._children.slice(),l=st.global,d=l.elements.line,u=-1;for(this._loop&&s.length&&s.push(s[0]),o.save(),o.lineCap=a.borderCapStyle||d.borderCapStyle,o.setLineDash&&o.setLineDash(a.borderDash||d.borderDash),o.lineDashOffset=Ct(a.borderDashOffset,d.borderDashOffset),o.lineJoin=a.borderJoinStyle||d.borderJoinStyle,o.lineWidth=Ct(a.borderWidth,d.borderWidth),o.strokeStyle=a.borderColor||l.defaultColor,o.beginPath(),u=-1,t=0;t<s.length;++t)e=s[t],i=ut.previousItem(s,t),n=e._view,0===t?n.skip||(o.moveTo(n.x,n.y),u=t):(i=-1===u?i:s[u],n.skip||(u!==t-1&&!r||-1===u?o.moveTo(n.x,n.y):ut.canvas.lineTo(o,i._view,e._view),u=t));o.stroke(),o.restore()}}),It=ut.valueOrDefault,At=st.global.defaultColor;function Dt(t){var e=this._view;return!!e&&Math.abs(t-e.x)<e.radius+e.hitRadius}st._set("global",{elements:{point:{radius:3,pointStyle:"circle",backgroundColor:At,borderColor:At,borderWidth:1,hitRadius:1,hoverRadius:4,hoverBorderWidth:1}}});var Tt=pt.extend({inRange:function(t,e){var i=this._view;return!!i&&Math.pow(t-i.x,2)+Math.pow(e-i.y,2)<Math.pow(i.hitRadius+i.radius,2)},inLabelRange:Dt,inXRange:Dt,inYRange:function(t){var e=this._view;return!!e&&Math.abs(t-e.y)<e.radius+e.hitRadius},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,i=this._chart.ctx,n=e.pointStyle,a=e.rotation,o=e.radius,r=e.x,s=e.y,l=st.global,d=l.defaultColor;e.skip||(void 0===t||ut.canvas._isPointInArea(e,t))&&(i.strokeStyle=e.borderColor||d,i.lineWidth=It(e.borderWidth,l.elements.point.borderWidth),i.fillStyle=e.backgroundColor||d,ut.canvas.drawPoint(i,n,o,r,s,a))}}),Ft=st.global.defaultColor;function Lt(t){return t&&void 0!==t.width}function Rt(t){var e,i,n,a,o;return Lt(t)?(o=t.width/2,e=t.x-o,i=t.x+o,n=Math.min(t.y,t.base),a=Math.max(t.y,t.base)):(o=t.height/2,e=Math.min(t.x,t.base),i=Math.max(t.x,t.base),n=t.y-o,a=t.y+o),{left:e,top:n,right:i,bottom:a}}function Ot(t,e,i){return t===e?i:t===i?e:t}function zt(t,e,i){var n,a,o,r,s=t.borderWidth,l=function(t){var e=t.borderSkipped,i={};return e?(t.horizontal?t.base>t.x&&(e=Ot(e,"left","right")):t.base<t.y&&(e=Ot(e,"bottom","top")),i[e]=!0,i):i}(t);return ut.isObject(s)?(n=+s.top||0,a=+s.right||0,o=+s.bottom||0,r=+s.left||0):n=a=o=r=+s||0,{t:l.top||n<0?0:n>i?i:n,r:l.right||a<0?0:a>e?e:a,b:l.bottom||o<0?0:o>i?i:o,l:l.left||r<0?0:r>e?e:r}}function Bt(t,e,i){var n=null===e,a=null===i,o=!(!t||n&&a)&&Rt(t);return o&&(n||e>=o.left&&e<=o.right)&&(a||i>=o.top&&i<=o.bottom)}st._set("global",{elements:{rectangle:{backgroundColor:Ft,borderColor:Ft,borderSkipped:"bottom",borderWidth:0}}});var Nt=pt.extend({draw:function(){var t=this._chart.ctx,e=this._view,i=function(t){var e=Rt(t),i=e.right-e.left,n=e.bottom-e.top,a=zt(t,i/2,n/2);return{outer:{x:e.left,y:e.top,w:i,h:n},inner:{x:e.left+a.l,y:e.top+a.t,w:i-a.l-a.r,h:n-a.t-a.b}}}(e),n=i.outer,a=i.inner;t.fillStyle=e.backgroundColor,t.fillRect(n.x,n.y,n.w,n.h),n.w===a.w&&n.h===a.h||(t.save(),t.beginPath(),t.rect(n.x,n.y,n.w,n.h),t.clip(),t.fillStyle=e.borderColor,t.rect(a.x,a.y,a.w,a.h),t.fill("evenodd"),t.restore())},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){return Bt(this._view,t,e)},inLabelRange:function(t,e){var i=this._view;return Lt(i)?Bt(i,t,null):Bt(i,null,e)},inXRange:function(t){return Bt(this._view,t,null)},inYRange:function(t){return Bt(this._view,null,t)},getCenterPoint:function(){var t,e,i=this._view;return Lt(i)?(t=i.x,e=(i.y+i.base)/2):(t=(i.x+i.base)/2,e=i.y),{x:t,y:e}},getArea:function(){var t=this._view;return Lt(t)?t.width*Math.abs(t.y-t.base):t.height*Math.abs(t.x-t.base)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}}),Wt={},Vt=_t,Et=Pt,Ht=Tt,jt=Nt;Wt.Arc=Vt,Wt.Line=Et,Wt.Point=Ht,Wt.Rectangle=jt;var qt=ut.options.resolve;st._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",categoryPercentage:.8,barPercentage:.9,offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}});var Yt=Mt.extend({dataElementType:Wt.Rectangle,initialize:function(){var t;Mt.prototype.initialize.apply(this,arguments),(t=this.getMeta()).stack=this.getDataset().stack,t.bar=!0},update:function(t){var e,i,n=this.getMeta().data;for(this._ruler=this.getRuler(),e=0,i=n.length;e<i;++e)this.updateElement(n[e],e,t)},updateElement:function(t,e,i){var n=this,a=n.getMeta(),o=n.getDataset(),r=n._resolveElementOptions(t,e);t._xScale=n.getScaleForId(a.xAxisID),t._yScale=n.getScaleForId(a.yAxisID),t._datasetIndex=n.index,t._index=e,t._model={backgroundColor:r.backgroundColor,borderColor:r.borderColor,borderSkipped:r.borderSkipped,borderWidth:r.borderWidth,datasetLabel:o.label,label:n.chart.data.labels[e]},n._updateElementGeometry(t,e,i),t.pivot()},_updateElementGeometry:function(t,e,i){var n=this,a=t._model,o=n._getValueScale(),r=o.getBasePixel(),s=o.isHorizontal(),l=n._ruler||n.getRuler(),d=n.calculateBarValuePixels(n.index,e),u=n.calculateBarIndexPixels(n.index,e,l);a.horizontal=s,a.base=i?r:d.base,a.x=s?i?r:d.head:u.center,a.y=s?u.center:i?r:d.head,a.height=s?u.size:void 0,a.width=s?void 0:u.size},_getStacks:function(t){var e,i,n=this.chart,a=this._getIndexScale().options.stacked,o=void 0===t?n.data.datasets.length:t+1,r=[];for(e=0;e<o;++e)(i=n.getDatasetMeta(e)).bar&&n.isDatasetVisible(e)&&(!1===a||!0===a&&-1===r.indexOf(i.stack)||void 0===a&&(void 0===i.stack||-1===r.indexOf(i.stack)))&&r.push(i.stack);return r},getStackCount:function(){return this._getStacks().length},getStackIndex:function(t,e){var i=this._getStacks(t),n=void 0!==e?i.indexOf(e):-1;return-1===n?i.length-1:n},getRuler:function(){var t,e,i=this._getIndexScale(),n=this.getStackCount(),a=this.index,o=i.isHorizontal(),r=o?i.left:i.top,s=r+(o?i.width:i.height),l=[];for(t=0,e=this.getMeta().data.length;t<e;++t)l.push(i.getPixelForValue(null,t,a));return{min:ut.isNullOrUndef(i.options.barThickness)?function(t,e){var i,n,a,o,r=t.isHorizontal()?t.width:t.height,s=t.getTicks();for(a=1,o=e.length;a<o;++a)r=Math.min(r,Math.abs(e[a]-e[a-1]));for(a=0,o=s.length;a<o;++a)n=t.getPixelForTick(a),r=a>0?Math.min(r,n-i):r,i=n;return r}(i,l):-1,pixels:l,start:r,end:s,stackCount:n,scale:i}},calculateBarValuePixels:function(t,e){var i,n,a,o,r,s,l=this.chart,d=this.getMeta(),u=this._getValueScale(),h=u.isHorizontal(),c=l.data.datasets,f=+u.getRightValue(c[t].data[e]),g=u.options.minBarLength,p=u.options.stacked,m=d.stack,v=0;if(p||void 0===p&&void 0!==m)for(i=0;i<t;++i)(n=l.getDatasetMeta(i)).bar&&n.stack===m&&n.controller._getValueScaleId()===u.id&&l.isDatasetVisible(i)&&(a=+u.getRightValue(c[i].data[e]),(f<0&&a<0||f>=0&&a>0)&&(v+=a));return o=u.getPixelForValue(v),s=(r=u.getPixelForValue(v+f))-o,void 0!==g&&Math.abs(s)<g&&(s=g,r=f>=0&&!h||f<0&&h?o-g:o+g),{size:s,base:o,head:r,center:r+s/2}},calculateBarIndexPixels:function(t,e,i){var n=i.scale.options,a="flex"===n.barThickness?function(t,e,i){var n,a=e.pixels,o=a[t],r=t>0?a[t-1]:null,s=t<a.length-1?a[t+1]:null,l=i.categoryPercentage;return null===r&&(r=o-(null===s?e.end-e.start:s-o)),null===s&&(s=o+o-r),n=o-(o-Math.min(r,s))/2*l,{chunk:Math.abs(s-r)/2*l/e.stackCount,ratio:i.barPercentage,start:n}}(e,i,n):function(t,e,i){var n,a,o=i.barThickness,r=e.stackCount,s=e.pixels[t];return ut.isNullOrUndef(o)?(n=e.min*i.categoryPercentage,a=i.barPercentage):(n=o*r,a=1),{chunk:n/r,ratio:a,start:s-n/2}}(e,i,n),o=this.getStackIndex(t,this.getMeta().stack),r=a.start+a.chunk*o+a.chunk/2,s=Math.min(ut.valueOrDefault(n.maxBarThickness,1/0),a.chunk*a.ratio);return{base:r-s/2,head:r+s/2,center:r,size:s}},draw:function(){var t=this.chart,e=this._getValueScale(),i=this.getMeta().data,n=this.getDataset(),a=i.length,o=0;for(ut.canvas.clipArea(t.ctx,t.chartArea);o<a;++o)isNaN(e.getRightValue(n.data[o]))||i[o].draw();ut.canvas.unclipArea(t.ctx)},_resolveElementOptions:function(t,e){var i,n,a,o=this.chart,r=o.data.datasets[this.index],s=t.custom||{},l=o.options.elements.rectangle,d={},u={chart:o,dataIndex:e,dataset:r,datasetIndex:this.index},h=["backgroundColor","borderColor","borderSkipped","borderWidth"];for(i=0,n=h.length;i<n;++i)d[a=h[i]]=qt([s[a],r[a],l[a]],u,e);return d}}),Ut=ut.valueOrDefault,Xt=ut.options.resolve;st._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 i=e.datasets[t.datasetIndex].label||"",n=e.datasets[t.datasetIndex].data[t.index];return i+": ("+t.xLabel+", "+t.yLabel+", "+n.r+")"}}}});var Kt=Mt.extend({dataElementType:Wt.Point,update:function(t){var e=this,i=e.getMeta().data;ut.each(i,function(i,n){e.updateElement(i,n,t)})},updateElement:function(t,e,i){var n=this,a=n.getMeta(),o=t.custom||{},r=n.getScaleForId(a.xAxisID),s=n.getScaleForId(a.yAxisID),l=n._resolveElementOptions(t,e),d=n.getDataset().data[e],u=n.index,h=i?r.getPixelForDecimal(.5):r.getPixelForValue("object"==typeof d?d:NaN,e,u),c=i?s.getBasePixel():s.getPixelForValue(d,e,u);t._xScale=r,t._yScale=s,t._options=l,t._datasetIndex=u,t._index=e,t._model={backgroundColor:l.backgroundColor,borderColor:l.borderColor,borderWidth:l.borderWidth,hitRadius:l.hitRadius,pointStyle:l.pointStyle,rotation:l.rotation,radius:i?0:l.radius,skip:o.skip||isNaN(h)||isNaN(c),x:h,y:c},t.pivot()},setHoverStyle:function(t){var e=t._model,i=t._options,n=ut.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=Ut(i.hoverBackgroundColor,n(i.backgroundColor)),e.borderColor=Ut(i.hoverBorderColor,n(i.borderColor)),e.borderWidth=Ut(i.hoverBorderWidth,i.borderWidth),e.radius=i.radius+i.hoverRadius},_resolveElementOptions:function(t,e){var i,n,a,o=this.chart,r=o.data.datasets[this.index],s=t.custom||{},l=o.options.elements.point,d=r.data[e],u={},h={chart:o,dataIndex:e,dataset:r,datasetIndex:this.index},c=["backgroundColor","borderColor","borderWidth","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth","hoverRadius","hitRadius","pointStyle","rotation"];for(i=0,n=c.length;i<n;++i)u[a=c[i]]=Xt([s[a],r[a],l[a]],h,e);return u.radius=Xt([s.radius,d?d.r:void 0,r.radius,l.radius],h,e),u}}),Gt=ut.options.resolve,Zt=ut.valueOrDefault;st._set("doughnut",{animation:{animateRotate:!0,animateScale:!1},hover:{mode:"single"},legendCallback:function(t){var e=[];e.push('<ul class="'+t.id+'-legend">');var i=t.data,n=i.datasets,a=i.labels;if(n.length)for(var o=0;o<n[0].data.length;++o)e.push('<li><span style="background-color:'+n[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(i,n){var a=t.getDatasetMeta(0),o=e.datasets[0],r=a.data[n],s=r&&r.custom||{},l=t.options.elements.arc;return{text:i,fillStyle:Gt([s.backgroundColor,o.backgroundColor,l.backgroundColor],void 0,n),strokeStyle:Gt([s.borderColor,o.borderColor,l.borderColor],void 0,n),lineWidth:Gt([s.borderWidth,o.borderWidth,l.borderWidth],void 0,n),hidden:isNaN(o.data[n])||a.data[n].hidden,index:n}}):[]}},onClick:function(t,e){var i,n,a,o=e.index,r=this.chart;for(i=0,n=(r.data.datasets||[]).length;i<n;++i)(a=r.getDatasetMeta(i)).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 i=e.labels[t.index],n=": "+e.datasets[t.datasetIndex].data[t.index];return ut.isArray(i)?(i=i.slice())[0]+=n:i+=n,i}}}});var $t=Mt.extend({dataElementType:Wt.Arc,linkScales:ut.noop,getRingIndex:function(t){for(var e=0,i=0;i<t;++i)this.chart.isDatasetVisible(i)&&++e;return e},update:function(t){var e,i,n=this,a=n.chart,o=a.chartArea,r=a.options,s=o.right-o.left,l=o.bottom-o.top,d=Math.min(s,l),u={x:0,y:0},h=n.getMeta(),c=h.data,f=r.cutoutPercentage,g=r.circumference,p=n._getRingWeight(n.index);if(g<2*Math.PI){var m=r.rotation%(2*Math.PI),v=(m+=2*Math.PI*(m>=Math.PI?-1:m<-Math.PI?1:0))+g,b={x:Math.cos(m),y:Math.sin(m)},x={x:Math.cos(v),y:Math.sin(v)},y=m<=0&&v>=0||m<=2*Math.PI&&2*Math.PI<=v,k=m<=.5*Math.PI&&.5*Math.PI<=v||m<=2.5*Math.PI&&2.5*Math.PI<=v,w=m<=-Math.PI&&-Math.PI<=v||m<=Math.PI&&Math.PI<=v,M=m<=.5*-Math.PI&&.5*-Math.PI<=v||m<=1.5*Math.PI&&1.5*Math.PI<=v,_=f/100,C={x:w?-1:Math.min(b.x*(b.x<0?1:_),x.x*(x.x<0?1:_)),y:M?-1:Math.min(b.y*(b.y<0?1:_),x.y*(x.y<0?1:_))},S={x:y?1:Math.max(b.x*(b.x>0?1:_),x.x*(x.x>0?1:_)),y:k?1:Math.max(b.y*(b.y>0?1:_),x.y*(x.y>0?1:_))},P={width:.5*(S.x-C.x),height:.5*(S.y-C.y)};d=Math.min(s/P.width,l/P.height),u={x:-.5*(S.x+C.x),y:-.5*(S.y+C.y)}}for(e=0,i=c.length;e<i;++e)c[e]._options=n._resolveElementOptions(c[e],e);for(a.borderWidth=n.getMaxBorderWidth(),a.outerRadius=Math.max((d-a.borderWidth)/2,0),a.innerRadius=Math.max(f?a.outerRadius/100*f:0,0),a.radiusLength=(a.outerRadius-a.innerRadius)/(n._getVisibleDatasetWeightTotal()||1),a.offsetX=u.x*a.outerRadius,a.offsetY=u.y*a.outerRadius,h.total=n.calculateTotal(),n.outerRadius=a.outerRadius-a.radiusLength*n._getRingWeightOffset(n.index),n.innerRadius=Math.max(n.outerRadius-a.radiusLength*p,0),e=0,i=c.length;e<i;++e)n.updateElement(c[e],e,t)},updateElement:function(t,e,i){var n=this,a=n.chart,o=a.chartArea,r=a.options,s=r.animation,l=(o.left+o.right)/2,d=(o.top+o.bottom)/2,u=r.rotation,h=r.rotation,c=n.getDataset(),f=i&&s.animateRotate?0:t.hidden?0:n.calculateCircumference(c.data[e])*(r.circumference/(2*Math.PI)),g=i&&s.animateScale?0:n.innerRadius,p=i&&s.animateScale?0:n.outerRadius,m=t._options||{};ut.extend(t,{_datasetIndex:n.index,_index:e,_model:{backgroundColor:m.backgroundColor,borderColor:m.borderColor,borderWidth:m.borderWidth,borderAlign:m.borderAlign,x:l+a.offsetX,y:d+a.offsetY,startAngle:u,endAngle:h,circumference:f,outerRadius:p,innerRadius:g,label:ut.valueAtIndexOrDefault(c.label,e,a.data.labels[e])}});var v=t._model;i&&s.animateRotate||(v.startAngle=0===e?r.rotation:n.getMeta().data[e-1]._model.endAngle,v.endAngle=v.startAngle+v.circumference),t.pivot()},calculateTotal:function(){var t,e=this.getDataset(),i=this.getMeta(),n=0;return ut.each(i.data,function(i,a){t=e.data[a],isNaN(t)||i.hidden||(n+=Math.abs(t))}),n},calculateCircumference:function(t){var e=this.getMeta().total;return e>0&&!isNaN(t)?2*Math.PI*(Math.abs(t)/e):0},getMaxBorderWidth:function(t){var e,i,n,a,o,r,s,l,d=0,u=this.chart;if(!t)for(e=0,i=u.data.datasets.length;e<i;++e)if(u.isDatasetVisible(e)){t=(n=u.getDatasetMeta(e)).data,e!==this.index&&(o=n.controller);break}if(!t)return 0;for(e=0,i=t.length;e<i;++e)a=t[e],"inner"!==(r=o?o._resolveElementOptions(a,e):a._options).borderAlign&&(s=r.borderWidth,d=(l=r.hoverBorderWidth)>(d=s>d?s:d)?l:d);return d},setHoverStyle:function(t){var e=t._model,i=t._options,n=ut.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=Zt(i.hoverBackgroundColor,n(i.backgroundColor)),e.borderColor=Zt(i.hoverBorderColor,n(i.borderColor)),e.borderWidth=Zt(i.hoverBorderWidth,i.borderWidth)},_resolveElementOptions:function(t,e){var i,n,a,o=this.chart,r=this.getDataset(),s=t.custom||{},l=o.options.elements.arc,d={},u={chart:o,dataIndex:e,dataset:r,datasetIndex:this.index},h=["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"];for(i=0,n=h.length;i<n;++i)d[a=h[i]]=Gt([s[a],r[a],l[a]],u,e);return d},_getRingWeightOffset:function(t){for(var e=0,i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e},_getRingWeight:function(t){return Math.max(Zt(this.chart.data.datasets[t].weight,1),0)},_getVisibleDatasetWeightTotal:function(){return this._getRingWeightOffset(this.chart.data.datasets.length)}});st._set("horizontalBar",{hover:{mode:"index",axis:"y"},scales:{xAxes:[{type:"linear",position:"bottom"}],yAxes:[{type:"category",position:"left",categoryPercentage:.8,barPercentage:.9,offset:!0,gridLines:{offsetGridLines:!0}}]},elements:{rectangle:{borderSkipped:"left"}},tooltips:{mode:"index",axis:"y"}});var Jt=Yt.extend({_getValueScaleId:function(){return this.getMeta().xAxisID},_getIndexScaleId:function(){return this.getMeta().yAxisID}}),Qt=ut.valueOrDefault,te=ut.options.resolve,ee=ut.canvas._isPointInArea;function ie(t,e){return Qt(t.showLine,e.showLines)}st._set("line",{showLines:!0,spanGaps:!1,hover:{mode:"label"},scales:{xAxes:[{type:"category",id:"x-axis-0"}],yAxes:[{type:"linear",id:"y-axis-0"}]}});var ne=Mt.extend({datasetElementType:Wt.Line,dataElementType:Wt.Point,update:function(t){var e,i,n=this,a=n.getMeta(),o=a.dataset,r=a.data||[],s=n.getScaleForId(a.yAxisID),l=n.getDataset(),d=ie(l,n.chart.options);for(d&&(void 0!==l.tension&&void 0===l.lineTension&&(l.lineTension=l.tension),o._scale=s,o._datasetIndex=n.index,o._children=r,o._model=n._resolveLineOptions(o),o.pivot()),e=0,i=r.length;e<i;++e)n.updateElement(r[e],e,t);for(d&&0!==o._model.tension&&n.updateBezierControlPoints(),e=0,i=r.length;e<i;++e)r[e].pivot()},updateElement:function(t,e,i){var n,a,o=this,r=o.getMeta(),s=t.custom||{},l=o.getDataset(),d=o.index,u=l.data[e],h=o.getScaleForId(r.yAxisID),c=o.getScaleForId(r.xAxisID),f=r.dataset._model,g=o._resolvePointOptions(t,e);n=c.getPixelForValue("object"==typeof u?u:NaN,e,d),a=i?h.getBasePixel():o.calculatePointY(u,e,d),t._xScale=c,t._yScale=h,t._options=g,t._datasetIndex=d,t._index=e,t._model={x:n,y:a,skip:s.skip||isNaN(n)||isNaN(a),radius:g.radius,pointStyle:g.pointStyle,rotation:g.rotation,backgroundColor:g.backgroundColor,borderColor:g.borderColor,borderWidth:g.borderWidth,tension:Qt(s.tension,f?f.tension:0),steppedLine:!!f&&f.steppedLine,hitRadius:g.hitRadius}},_resolvePointOptions:function(t,e){var i,n,a,o=this.chart,r=o.data.datasets[this.index],s=t.custom||{},l=o.options.elements.point,d={},u={chart:o,dataIndex:e,dataset:r,datasetIndex:this.index},h={backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},c=Object.keys(h);for(i=0,n=c.length;i<n;++i)d[a=c[i]]=te([s[a],r[h[a]],r[a],l[a]],u,e);return d},_resolveLineOptions:function(t){var e,i,n,a=this.chart,o=a.data.datasets[this.index],r=t.custom||{},s=a.options,l=s.elements.line,d={},u=["backgroundColor","borderWidth","borderColor","borderCapStyle","borderDash","borderDashOffset","borderJoinStyle","fill","cubicInterpolationMode"];for(e=0,i=u.length;e<i;++e)d[n=u[e]]=te([r[n],o[n],l[n]]);return d.spanGaps=Qt(o.spanGaps,s.spanGaps),d.tension=Qt(o.lineTension,l.tension),d.steppedLine=te([r.steppedLine,o.steppedLine,l.stepped]),d},calculatePointY:function(t,e,i){var n,a,o,r=this.chart,s=this.getMeta(),l=this.getScaleForId(s.yAxisID),d=0,u=0;if(l.options.stacked){for(n=0;n<i;n++)if(a=r.data.datasets[n],"line"===(o=r.getDatasetMeta(n)).type&&o.yAxisID===l.id&&r.isDatasetVisible(n)){var h=Number(l.getRightValue(a.data[e]));h<0?u+=h||0:d+=h||0}var c=Number(l.getRightValue(t));return c<0?l.getPixelForValue(u+c):l.getPixelForValue(d+c)}return l.getPixelForValue(t)},updateBezierControlPoints:function(){var t,e,i,n,a=this.chart,o=this.getMeta(),r=o.dataset._model,s=a.chartArea,l=o.data||[];function d(t,e,i){return Math.max(Math.min(t,i),e)}if(r.spanGaps&&(l=l.filter(function(t){return!t._model.skip})),"monotone"===r.cubicInterpolationMode)ut.splineCurveMonotone(l);else for(t=0,e=l.length;t<e;++t)i=l[t]._model,n=ut.splineCurve(ut.previousItem(l,t)._model,i,ut.nextItem(l,t)._model,r.tension),i.controlPointPreviousX=n.previous.x,i.controlPointPreviousY=n.previous.y,i.controlPointNextX=n.next.x,i.controlPointNextY=n.next.y;if(a.options.elements.line.capBezierPoints)for(t=0,e=l.length;t<e;++t)i=l[t]._model,ee(i,s)&&(t>0&&ee(l[t-1]._model,s)&&(i.controlPointPreviousX=d(i.controlPointPreviousX,s.left,s.right),i.controlPointPreviousY=d(i.controlPointPreviousY,s.top,s.bottom)),t<l.length-1&&ee(l[t+1]._model,s)&&(i.controlPointNextX=d(i.controlPointNextX,s.left,s.right),i.controlPointNextY=d(i.controlPointNextY,s.top,s.bottom)))},draw:function(){var t,e=this.chart,i=this.getMeta(),n=i.data||[],a=e.chartArea,o=n.length,r=0;for(ie(this.getDataset(),e.options)&&(t=(i.dataset._model.borderWidth||0)/2,ut.canvas.clipArea(e.ctx,{left:a.left,right:a.right,top:a.top-t,bottom:a.bottom+t}),i.dataset.draw(),ut.canvas.unclipArea(e.ctx));r<o;++r)n[r].draw(a)},setHoverStyle:function(t){var e=t._model,i=t._options,n=ut.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=Qt(i.hoverBackgroundColor,n(i.backgroundColor)),e.borderColor=Qt(i.hoverBorderColor,n(i.borderColor)),e.borderWidth=Qt(i.hoverBorderWidth,i.borderWidth),e.radius=Qt(i.hoverRadius,i.radius)}}),ae=ut.options.resolve;st._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 i=t.data,n=i.datasets,a=i.labels;if(n.length)for(var o=0;o<n[0].data.length;++o)e.push('<li><span style="background-color:'+n[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(i,n){var a=t.getDatasetMeta(0),o=e.datasets[0],r=a.data[n].custom||{},s=t.options.elements.arc;return{text:i,fillStyle:ae([r.backgroundColor,o.backgroundColor,s.backgroundColor],void 0,n),strokeStyle:ae([r.borderColor,o.borderColor,s.borderColor],void 0,n),lineWidth:ae([r.borderWidth,o.borderWidth,s.borderWidth],void 0,n),hidden:isNaN(o.data[n])||a.data[n].hidden,index:n}}):[]}},onClick:function(t,e){var i,n,a,o=e.index,r=this.chart;for(i=0,n=(r.data.datasets||[]).length;i<n;++i)(a=r.getDatasetMeta(i)).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}}}});var oe=Mt.extend({dataElementType:Wt.Arc,linkScales:ut.noop,update:function(t){var e,i,n,a=this,o=a.getDataset(),r=a.getMeta(),s=a.chart.options.startAngle||0,l=a._starts=[],d=a._angles=[],u=r.data;for(a._updateRadius(),r.count=a.countVisibleElements(),e=0,i=o.data.length;e<i;e++)l[e]=s,n=a._computeAngle(e),d[e]=n,s+=n;for(e=0,i=u.length;e<i;++e)u[e]._options=a._resolveElementOptions(u[e],e),a.updateElement(u[e],e,t)},_updateRadius:function(){var t=this,e=t.chart,i=e.chartArea,n=e.options,a=Math.min(i.right-i.left,i.bottom-i.top);e.outerRadius=Math.max(a/2,0),e.innerRadius=Math.max(n.cutoutPercentage?e.outerRadius/100*n.cutoutPercentage:1,0),e.radiusLength=(e.outerRadius-e.innerRadius)/e.getVisibleDatasetCount(),t.outerRadius=e.outerRadius-e.radiusLength*t.index,t.innerRadius=t.outerRadius-e.radiusLength},updateElement:function(t,e,i){var n=this,a=n.chart,o=n.getDataset(),r=a.options,s=r.animation,l=a.scale,d=a.data.labels,u=l.xCenter,h=l.yCenter,c=r.startAngle,f=t.hidden?0:l.getDistanceFromCenterForValue(o.data[e]),g=n._starts[e],p=g+(t.hidden?0:n._angles[e]),m=s.animateScale?0:l.getDistanceFromCenterForValue(o.data[e]),v=t._options||{};ut.extend(t,{_datasetIndex:n.index,_index:e,_scale:l,_model:{backgroundColor:v.backgroundColor,borderColor:v.borderColor,borderWidth:v.borderWidth,borderAlign:v.borderAlign,x:u,y:h,innerRadius:0,outerRadius:i?m:f,startAngle:i&&s.animateRotate?c:g,endAngle:i&&s.animateRotate?c:p,label:ut.valueAtIndexOrDefault(d,e,d[e])}}),t.pivot()},countVisibleElements:function(){var t=this.getDataset(),e=this.getMeta(),i=0;return ut.each(e.data,function(e,n){isNaN(t.data[n])||e.hidden||i++}),i},setHoverStyle:function(t){var e=t._model,i=t._options,n=ut.getHoverColor,a=ut.valueOrDefault;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=a(i.hoverBackgroundColor,n(i.backgroundColor)),e.borderColor=a(i.hoverBorderColor,n(i.borderColor)),e.borderWidth=a(i.hoverBorderWidth,i.borderWidth)},_resolveElementOptions:function(t,e){var i,n,a,o=this.chart,r=this.getDataset(),s=t.custom||{},l=o.options.elements.arc,d={},u={chart:o,dataIndex:e,dataset:r,datasetIndex:this.index},h=["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"];for(i=0,n=h.length;i<n;++i)d[a=h[i]]=ae([s[a],r[a],l[a]],u,e);return d},_computeAngle:function(t){var e=this,i=this.getMeta().count,n=e.getDataset(),a=e.getMeta();if(isNaN(n.data[t])||a.data[t].hidden)return 0;var o={chart:e.chart,dataIndex:t,dataset:n,datasetIndex:e.index};return ae([e.chart.options.elements.arc.angle,2*Math.PI/i],o,t)}});st._set("pie",ut.clone(st.doughnut)),st._set("pie",{cutoutPercentage:0});var re=$t,se=ut.valueOrDefault,le=ut.options.resolve;st._set("radar",{scale:{type:"radialLinear"},elements:{line:{tension:0}}});var de=Mt.extend({datasetElementType:Wt.Line,dataElementType:Wt.Point,linkScales:ut.noop,update:function(t){var e,i,n=this,a=n.getMeta(),o=a.dataset,r=a.data||[],s=n.chart.scale,l=n.getDataset();for(void 0!==l.tension&&void 0===l.lineTension&&(l.lineTension=l.tension),o._scale=s,o._datasetIndex=n.index,o._children=r,o._loop=!0,o._model=n._resolveLineOptions(o),o.pivot(),e=0,i=r.length;e<i;++e)n.updateElement(r[e],e,t);for(n.updateBezierControlPoints(),e=0,i=r.length;e<i;++e)r[e].pivot()},updateElement:function(t,e,i){var n=this,a=t.custom||{},o=n.getDataset(),r=n.chart.scale,s=r.getPointPositionForValue(e,o.data[e]),l=n._resolvePointOptions(t,e),d=n.getMeta().dataset._model,u=i?r.xCenter:s.x,h=i?r.yCenter:s.y;t._scale=r,t._options=l,t._datasetIndex=n.index,t._index=e,t._model={x:u,y:h,skip:a.skip||isNaN(u)||isNaN(h),radius:l.radius,pointStyle:l.pointStyle,rotation:l.rotation,backgroundColor:l.backgroundColor,borderColor:l.borderColor,borderWidth:l.borderWidth,tension:se(a.tension,d?d.tension:0),hitRadius:l.hitRadius}},_resolvePointOptions:function(t,e){var i,n,a,o=this.chart,r=o.data.datasets[this.index],s=t.custom||{},l=o.options.elements.point,d={},u={chart:o,dataIndex:e,dataset:r,datasetIndex:this.index},h={backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},c=Object.keys(h);for(i=0,n=c.length;i<n;++i)d[a=c[i]]=le([s[a],r[h[a]],r[a],l[a]],u,e);return d},_resolveLineOptions:function(t){var e,i,n,a=this.chart,o=a.data.datasets[this.index],r=t.custom||{},s=a.options.elements.line,l={},d=["backgroundColor","borderWidth","borderColor","borderCapStyle","borderDash","borderDashOffset","borderJoinStyle","fill"];for(e=0,i=d.length;e<i;++e)l[n=d[e]]=le([r[n],o[n],s[n]]);return l.tension=se(o.lineTension,s.tension),l},updateBezierControlPoints:function(){var t,e,i,n,a=this.getMeta(),o=this.chart.chartArea,r=a.data||[];function s(t,e,i){return Math.max(Math.min(t,i),e)}for(t=0,e=r.length;t<e;++t)i=r[t]._model,n=ut.splineCurve(ut.previousItem(r,t,!0)._model,i,ut.nextItem(r,t,!0)._model,i.tension),i.controlPointPreviousX=s(n.previous.x,o.left,o.right),i.controlPointPreviousY=s(n.previous.y,o.top,o.bottom),i.controlPointNextX=s(n.next.x,o.left,o.right),i.controlPointNextY=s(n.next.y,o.top,o.bottom)},setHoverStyle:function(t){var e=t._model,i=t._options,n=ut.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=se(i.hoverBackgroundColor,n(i.backgroundColor)),e.borderColor=se(i.hoverBorderColor,n(i.borderColor)),e.borderWidth=se(i.hoverBorderWidth,i.borderWidth),e.radius=se(i.hoverRadius,i.radius)}});st._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+")"}}}});var ue={bar:Yt,bubble:Kt,doughnut:$t,horizontalBar:Jt,line:ne,polarArea:oe,pie:re,radar:de,scatter:ne};function he(t,e){return t.native?{x:t.x,y:t.y}:ut.getRelativePosition(t,e)}function ce(t,e){var i,n,a,o,r;for(n=0,o=t.data.datasets.length;n<o;++n)if(t.isDatasetVisible(n))for(a=0,r=(i=t.getDatasetMeta(n)).data.length;a<r;++a){var s=i.data[a];s._view.skip||e(s)}}function fe(t,e){var i=[];return ce(t,function(t){t.inRange(e.x,e.y)&&i.push(t)}),i}function ge(t,e,i,n){var a=Number.POSITIVE_INFINITY,o=[];return ce(t,function(t){if(!i||t.inRange(e.x,e.y)){var r=t.getCenterPoint(),s=n(e,r);s<a?(o=[t],a=s):s===a&&o.push(t)}}),o}function pe(t){var e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,n){var a=e?Math.abs(t.x-n.x):0,o=i?Math.abs(t.y-n.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(o,2))}}function me(t,e,i){var n=he(e,t);i.axis=i.axis||"x";var a=pe(i.axis),o=i.intersect?fe(t,n):ge(t,n,!1,a),r=[];return o.length?(t.data.datasets.forEach(function(e,i){if(t.isDatasetVisible(i)){var n=t.getDatasetMeta(i).data[o[0]._index];n&&!n._view.skip&&r.push(n)}}),r):[]}var ve={modes:{single:function(t,e){var i=he(e,t),n=[];return ce(t,function(t){if(t.inRange(i.x,i.y))return n.push(t),n}),n.slice(0,1)},label:me,index:me,dataset:function(t,e,i){var n=he(e,t);i.axis=i.axis||"xy";var a=pe(i.axis),o=i.intersect?fe(t,n):ge(t,n,!1,a);return o.length>0&&(o=t.getDatasetMeta(o[0]._datasetIndex).data),o},"x-axis":function(t,e){return me(t,e,{intersect:!1})},point:function(t,e){return fe(t,he(e,t))},nearest:function(t,e,i){var n=he(e,t);i.axis=i.axis||"xy";var a=pe(i.axis);return ge(t,n,i.intersect,a)},x:function(t,e,i){var n=he(e,t),a=[],o=!1;return ce(t,function(t){t.inXRange(n.x)&&a.push(t),t.inRange(n.x,n.y)&&(o=!0)}),i.intersect&&!o&&(a=[]),a},y:function(t,e,i){var n=he(e,t),a=[],o=!1;return ce(t,function(t){t.inYRange(n.y)&&a.push(t),t.inRange(n.x,n.y)&&(o=!0)}),i.intersect&&!o&&(a=[]),a}}};function be(t,e){return ut.where(t,function(t){return t.position===e})}function xe(t,e){t.forEach(function(t,e){return t._tmpIndex_=e,t}),t.sort(function(t,i){var n=e?i:t,a=e?t:i;return n.weight===a.weight?n._tmpIndex_-a._tmpIndex_:n.weight-a.weight}),t.forEach(function(t){delete t._tmpIndex_})}function ye(t,e){ut.each(t,function(t){e[t.position]+=t.isHorizontal()?t.height:t.width})}st._set("global",{layout:{padding:{top:0,right:0,bottom:0,left:0}}});var ke={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 i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure:function(t,e,i){for(var n,a=["fullWidth","position","weight"],o=a.length,r=0;r<o;++r)n=a[r],i.hasOwnProperty(n)&&(e[n]=i[n])},update:function(t,e,i){if(t){var n=t.options.layout||{},a=ut.options.toPadding(n.padding),o=a.left,r=a.right,s=a.top,l=a.bottom,d=be(t.boxes,"left"),u=be(t.boxes,"right"),h=be(t.boxes,"top"),c=be(t.boxes,"bottom"),f=be(t.boxes,"chartArea");xe(d,!0),xe(u,!1),xe(h,!0),xe(c,!1);var g,p=d.concat(u),m=h.concat(c),v=p.concat(m),b=e-o-r,x=i-s-l,y=(e-b/2)/p.length,k=b,w=x,M={top:s,left:o,bottom:l,right:r},_=[];ut.each(v,function(t){var e,i=t.isHorizontal();i?(e=t.update(t.fullWidth?b:k,x/2),w-=e.height):(e=t.update(y,w),k-=e.width),_.push({horizontal:i,width:e.width,box:t})}),g=function(t){var e=0,i=0,n=0,a=0;return ut.each(t,function(t){if(t.getPadding){var o=t.getPadding();e=Math.max(e,o.top),i=Math.max(i,o.left),n=Math.max(n,o.bottom),a=Math.max(a,o.right)}}),{top:e,left:i,bottom:n,right:a}}(v),ut.each(p,T),ye(p,M),ut.each(m,T),ye(m,M),ut.each(p,function(t){var e=ut.findNextWhere(_,function(e){return e.box===t}),i={left:0,right:0,top:M.top,bottom:M.bottom};e&&t.update(e.width,w,i)}),ye(v,M={top:s,left:o,bottom:l,right:r});var C=Math.max(g.left-M.left,0);M.left+=C,M.right+=Math.max(g.right-M.right,0);var S=Math.max(g.top-M.top,0);M.top+=S,M.bottom+=Math.max(g.bottom-M.bottom,0);var P=i-M.top-M.bottom,I=e-M.left-M.right;I===k&&P===w||(ut.each(p,function(t){t.height=P}),ut.each(m,function(t){t.fullWidth||(t.width=I)}),w=P,k=I);var A=o+C,D=s+S;ut.each(d.concat(h),F),A+=k,D+=w,ut.each(u,F),ut.each(c,F),t.chartArea={left:M.left,top:M.top,right:M.left+k,bottom:M.top+w},ut.each(f,function(e){e.left=t.chartArea.left,e.top=t.chartArea.top,e.right=t.chartArea.right,e.bottom=t.chartArea.bottom,e.update(k,w)})}function T(t){var e=ut.findNextWhere(_,function(e){return e.box===t});if(e)if(e.horizontal){var i={left:Math.max(M.left,g.left),right:Math.max(M.right,g.right),top:0,bottom:0};t.update(t.fullWidth?b:k,x/2,i)}else t.update(e.width,w)}function F(t){t.isHorizontal()?(t.left=t.fullWidth?o:M.left,t.right=t.fullWidth?e-r:M.left+k,t.top=D,t.bottom=D+t.height,D=t.bottom):(t.left=A,t.right=A+t.width,t.top=M.top,t.bottom=M.top+w,A=t.right)}}};var we,Me=(we=Object.freeze({default:"/*\n * DOM element rendering detection\n * https://davidwalsh.name/detect-node-insertion\n */\n@keyframes chartjs-render-animation {\n\tfrom { opacity: 0.99; }\n\tto { opacity: 1; }\n}\n\n.chartjs-render-monitor {\n\tanimation: chartjs-render-animation 0.001s;\n}\n\n/*\n * DOM element resizing detection\n * https://github.com/marcj/css-element-queries\n */\n.chartjs-size-monitor,\n.chartjs-size-monitor-expand,\n.chartjs-size-monitor-shrink {\n\tposition: absolute;\n\tdirection: ltr;\n\tleft: 0;\n\ttop: 0;\n\tright: 0;\n\tbottom: 0;\n\toverflow: hidden;\n\tpointer-events: none;\n\tvisibility: hidden;\n\tz-index: -1;\n}\n\n.chartjs-size-monitor-expand > div {\n\tposition: absolute;\n\twidth: 1000000px;\n\theight: 1000000px;\n\tleft: 0;\n\ttop: 0;\n}\n\n.chartjs-size-monitor-shrink > div {\n\tposition: absolute;\n\twidth: 200%;\n\theight: 200%;\n\tleft: 0;\n\ttop: 0;\n}\n"}))&&we.default||we,_e="$chartjs",Ce="chartjs-size-monitor",Se="chartjs-render-monitor",Pe="chartjs-render-animation",Ie=["animationstart","webkitAnimationStart"],Ae={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function De(t,e){var i=ut.getStyle(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?Number(n[1]):void 0}var Te=!!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("e",null,e)}catch(t){}return t}()&&{passive:!0};function Fe(t,e,i){t.addEventListener(e,i,Te)}function Le(t,e,i){t.removeEventListener(e,i,Te)}function Re(t,e,i,n,a){return{type:t,chart:e,native:a||null,x:void 0!==i?i:null,y:void 0!==n?n:null}}function Oe(t){var e=document.createElement("div");return e.className=t||"",e}function ze(t,e,i){var n,a,o,r,s=t[_e]||(t[_e]={}),l=s.resizer=function(t){var e=Oe(Ce),i=Oe(Ce+"-expand"),n=Oe(Ce+"-shrink");i.appendChild(Oe()),n.appendChild(Oe()),e.appendChild(i),e.appendChild(n),e._reset=function(){i.scrollLeft=1e6,i.scrollTop=1e6,n.scrollLeft=1e6,n.scrollTop=1e6};var a=function(){e._reset(),t()};return Fe(i,"scroll",a.bind(i,"expand")),Fe(n,"scroll",a.bind(n,"shrink")),e}((n=function(){if(s.resizer){var n=i.options.maintainAspectRatio&&t.parentNode,a=n?n.clientWidth:0;e(Re("resize",i)),n&&n.clientWidth<a&&i.canvas&&e(Re("resize",i))}},o=!1,r=[],function(){r=Array.prototype.slice.call(arguments),a=a||this,o||(o=!0,ut.requestAnimFrame.call(window,function(){o=!1,n.apply(a,r)}))}));!function(t,e){var i=t[_e]||(t[_e]={}),n=i.renderProxy=function(t){t.animationName===Pe&&e()};ut.each(Ie,function(e){Fe(t,e,n)}),i.reflow=!!t.offsetParent,t.classList.add(Se)}(t,function(){if(s.resizer){var e=t.parentNode;e&&e!==l.parentNode&&e.insertBefore(l,e.firstChild),l._reset()}})}function Be(t){var e=t[_e]||{},i=e.resizer;delete e.resizer,function(t){var e=t[_e]||{},i=e.renderProxy;i&&(ut.each(Ie,function(e){Le(t,e,i)}),delete e.renderProxy),t.classList.remove(Se)}(t),i&&i.parentNode&&i.parentNode.removeChild(i)}var Ne={disableCSSInjection:!1,_enabled:"undefined"!=typeof window&&"undefined"!=typeof document,_ensureLoaded:function(){var t,e,i;this._loaded||(this._loaded=!0,this.disableCSSInjection||(e=Me,i=(t=this)._style||document.createElement("style"),t._style||(t._style=i,e="/* Chart.js */\n"+e,i.setAttribute("type","text/css"),document.getElementsByTagName("head")[0].appendChild(i)),i.appendChild(document.createTextNode(e))))},acquireContext:function(t,e){"string"==typeof t?t=document.getElementById(t):t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas);var i=t&&t.getContext&&t.getContext("2d");return this._ensureLoaded(),i&&i.canvas===t?(function(t,e){var i=t.style,n=t.getAttribute("height"),a=t.getAttribute("width");if(t[_e]={initial:{height:n,width:a,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",null===a||""===a){var o=De(t,"width");void 0!==o&&(t.width=o)}if(null===n||""===n)if(""===t.style.height)t.height=t.width/(e.options.aspectRatio||2);else{var r=De(t,"height");void 0!==o&&(t.height=r)}}(t,e),i):null},releaseContext:function(t){var e=t.canvas;if(e[_e]){var i=e[_e].initial;["height","width"].forEach(function(t){var n=i[t];ut.isNullOrUndef(n)?e.removeAttribute(t):e.setAttribute(t,n)}),ut.each(i.style||{},function(t,i){e.style[i]=t}),e.width=e.width,delete e[_e]}},addEventListener:function(t,e,i){var n=t.canvas;if("resize"!==e){var a=i[_e]||(i[_e]={});Fe(n,e,(a.proxies||(a.proxies={}))[t.id+"_"+e]=function(e){i(function(t,e){var i=Ae[t.type]||t.type,n=ut.getRelativePosition(t,e);return Re(i,e,n.x,n.y,t)}(e,t))})}else ze(n,i,t)},removeEventListener:function(t,e,i){var n=t.canvas;if("resize"!==e){var a=((i[_e]||{}).proxies||{})[t.id+"_"+e];a&&Le(n,e,a)}else Be(n)}};ut.addEvent=Fe,ut.removeEvent=Le;var We=Ne._enabled?Ne:{acquireContext:function(t){return t&&t.canvas&&(t=t.canvas),t&&t.getContext("2d")||null}},Ve=ut.extend({initialize:function(){},acquireContext:function(){},releaseContext:function(){},addEventListener:function(){},removeEventListener:function(){}},We);st._set("global",{plugins:{}});var Ee={_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 i=e.indexOf(t);-1!==i&&e.splice(i,1)}),this._cacheId++},clear:function(){this._plugins=[],this._cacheId++},count:function(){return this._plugins.length},getAll:function(){return this._plugins},notify:function(t,e,i){var n,a,o,r,s,l=this.descriptors(t),d=l.length;for(n=0;n<d;++n)if("function"==typeof(s=(o=(a=l[n]).plugin)[e])&&((r=[t].concat(i||[])).push(a.options),!1===s.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 i=[],n=[],a=t&&t.config||{},o=a.options&&a.options.plugins||{};return this._plugins.concat(a.plugins||[]).forEach(function(t){if(-1===i.indexOf(t)){var e=t.id,a=o[e];!1!==a&&(!0===a&&(a=ut.clone(st.global.plugins[e])),i.push(t),n.push({plugin:t,options:a||{}}))}}),e.descriptors=n,e.id=this._cacheId,n},_invalidate:function(t){delete t.$plugins}},He={constructors:{},defaults:{},registerScaleType:function(t,e,i){this.constructors[t]=e,this.defaults[t]=ut.clone(i)},getScaleConstructor:function(t){return this.constructors.hasOwnProperty(t)?this.constructors[t]:void 0},getScaleDefaults:function(t){return this.defaults.hasOwnProperty(t)?ut.merge({},[st.scale,this.defaults[t]]):{}},updateScaleDefaults:function(t,e){this.defaults.hasOwnProperty(t)&&(this.defaults[t]=ut.extend(this.defaults[t],e))},addScalesToLayout:function(t){ut.each(t.scales,function(e){e.fullWidth=e.options.fullWidth,e.position=e.options.position,e.weight=e.options.weight,ke.addBox(t,e)})}},je=ut.valueOrDefault;st._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:ut.noop,title:function(t,e){var i="",n=e.labels,a=n?n.length:0;if(t.length>0){var o=t[0];o.label?i=o.label:o.xLabel?i=o.xLabel:a>0&&o.index<a&&(i=n[o.index])}return i},afterTitle:ut.noop,beforeBody:ut.noop,beforeLabel:ut.noop,label:function(t,e){var i=e.datasets[t.datasetIndex].label||"";return i&&(i+=": "),ut.isNullOrUndef(t.value)?i+=t.yLabel:i+=t.value,i},labelColor:function(t,e){var i=e.getDatasetMeta(t.datasetIndex).data[t.index]._view;return{borderColor:i.borderColor,backgroundColor:i.backgroundColor}},labelTextColor:function(){return this._options.bodyFontColor},afterLabel:ut.noop,afterBody:ut.noop,beforeFooter:ut.noop,footer:ut.noop,afterFooter:ut.noop}}});var qe={average:function(t){if(!t.length)return!1;var e,i,n=0,a=0,o=0;for(e=0,i=t.length;e<i;++e){var r=t[e];if(r&&r.hasValue()){var s=r.tooltipPosition();n+=s.x,a+=s.y,++o}}return{x:n/o,y:a/o}},nearest:function(t,e){var i,n,a,o=e.x,r=e.y,s=Number.POSITIVE_INFINITY;for(i=0,n=t.length;i<n;++i){var l=t[i];if(l&&l.hasValue()){var d=l.getCenterPoint(),u=ut.distanceBetweenPoints(e,d);u<s&&(s=u,a=l)}}if(a){var h=a.tooltipPosition();o=h.x,r=h.y}return{x:o,y:r}}};function Ye(t,e){return e&&(ut.isArray(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Ue(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function Xe(t){var e=st.global;return{xPadding:t.xPadding,yPadding:t.yPadding,xAlign:t.xAlign,yAlign:t.yAlign,bodyFontColor:t.bodyFontColor,_bodyFontFamily:je(t.bodyFontFamily,e.defaultFontFamily),_bodyFontStyle:je(t.bodyFontStyle,e.defaultFontStyle),_bodyAlign:t.bodyAlign,bodyFontSize:je(t.bodyFontSize,e.defaultFontSize),bodySpacing:t.bodySpacing,titleFontColor:t.titleFontColor,_titleFontFamily:je(t.titleFontFamily,e.defaultFontFamily),_titleFontStyle:je(t.titleFontStyle,e.defaultFontStyle),titleFontSize:je(t.titleFontSize,e.defaultFontSize),_titleAlign:t.titleAlign,titleSpacing:t.titleSpacing,titleMarginBottom:t.titleMarginBottom,footerFontColor:t.footerFontColor,_footerFontFamily:je(t.footerFontFamily,e.defaultFontFamily),_footerFontStyle:je(t.footerFontStyle,e.defaultFontStyle),footerFontSize:je(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 Ke(t,e){return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-t.xPadding:t.x+t.xPadding}function Ge(t){return Ye([],Ue(t))}var Ze=pt.extend({initialize:function(){this._model=Xe(this._options),this._lastActive=[]},getTitle:function(){var t=this._options.callbacks,e=t.beforeTitle.apply(this,arguments),i=t.title.apply(this,arguments),n=t.afterTitle.apply(this,arguments),a=[];return a=Ye(a,Ue(e)),a=Ye(a,Ue(i)),a=Ye(a,Ue(n))},getBeforeBody:function(){return Ge(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(t,e){var i=this,n=i._options.callbacks,a=[];return ut.each(t,function(t){var o={before:[],lines:[],after:[]};Ye(o.before,Ue(n.beforeLabel.call(i,t,e))),Ye(o.lines,n.label.call(i,t,e)),Ye(o.after,Ue(n.afterLabel.call(i,t,e))),a.push(o)}),a},getAfterBody:function(){return Ge(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var t=this._options.callbacks,e=t.beforeFooter.apply(this,arguments),i=t.footer.apply(this,arguments),n=t.afterFooter.apply(this,arguments),a=[];return a=Ye(a,Ue(e)),a=Ye(a,Ue(i)),a=Ye(a,Ue(n))},update:function(t){var e,i,n,a,o,r,s,l,d,u,h=this,c=h._options,f=h._model,g=h._model=Xe(c),p=h._active,m=h._data,v={xAlign:f.xAlign,yAlign:f.yAlign},b={x:f.x,y:f.y},x={width:f.width,height:f.height},y={x:f.caretX,y:f.caretY};if(p.length){g.opacity=1;var k=[],w=[];y=qe[c.position].call(h,p,h._eventPosition);var M=[];for(e=0,i=p.length;e<i;++e)M.push((n=p[e],a=void 0,o=void 0,r=void 0,s=void 0,l=void 0,d=void 0,u=void 0,a=n._xScale,o=n._yScale||n._scale,r=n._index,s=n._datasetIndex,l=n._chart.getDatasetMeta(s).controller,d=l._getIndexScale(),u=l._getValueScale(),{xLabel:a?a.getLabelForIndex(r,s):"",yLabel:o?o.getLabelForIndex(r,s):"",label:d?""+d.getLabelForIndex(r,s):"",value:u?""+u.getLabelForIndex(r,s):"",index:r,datasetIndex:s,x:n._model.x,y:n._model.y}));c.filter&&(M=M.filter(function(t){return c.filter(t,m)})),c.itemSort&&(M=M.sort(function(t,e){return c.itemSort(t,e,m)})),ut.each(M,function(t){k.push(c.callbacks.labelColor.call(h,t,h._chart)),w.push(c.callbacks.labelTextColor.call(h,t,h._chart))}),g.title=h.getTitle(M,m),g.beforeBody=h.getBeforeBody(M,m),g.body=h.getBody(M,m),g.afterBody=h.getAfterBody(M,m),g.footer=h.getFooter(M,m),g.x=y.x,g.y=y.y,g.caretPadding=c.caretPadding,g.labelColors=k,g.labelTextColors=w,g.dataPoints=M,x=function(t,e){var i=t._chart.ctx,n=2*e.yPadding,a=0,o=e.body,r=o.reduce(function(t,e){return t+e.before.length+e.lines.length+e.after.length},0);r+=e.beforeBody.length+e.afterBody.length;var s=e.title.length,l=e.footer.length,d=e.titleFontSize,u=e.bodyFontSize,h=e.footerFontSize;n+=s*d,n+=s?(s-1)*e.titleSpacing:0,n+=s?e.titleMarginBottom:0,n+=r*u,n+=r?(r-1)*e.bodySpacing:0,n+=l?e.footerMarginTop:0,n+=l*h,n+=l?(l-1)*e.footerSpacing:0;var c=0,f=function(t){a=Math.max(a,i.measureText(t).width+c)};return i.font=ut.fontString(d,e._titleFontStyle,e._titleFontFamily),ut.each(e.title,f),i.font=ut.fontString(u,e._bodyFontStyle,e._bodyFontFamily),ut.each(e.beforeBody.concat(e.afterBody),f),c=e.displayColors?u+2:0,ut.each(o,function(t){ut.each(t.before,f),ut.each(t.lines,f),ut.each(t.after,f)}),c=0,i.font=ut.fontString(h,e._footerFontStyle,e._footerFontFamily),ut.each(e.footer,f),{width:a+=2*e.xPadding,height:n}}(this,g),b=function(t,e,i,n){var a=t.x,o=t.y,r=t.caretSize,s=t.caretPadding,l=t.cornerRadius,d=i.xAlign,u=i.yAlign,h=r+s,c=l+s;return"right"===d?a-=e.width:"center"===d&&((a-=e.width/2)+e.width>n.width&&(a=n.width-e.width),a<0&&(a=0)),"top"===u?o+=h:o-="bottom"===u?e.height+h:e.height/2,"center"===u?"left"===d?a+=h:"right"===d&&(a-=h):"left"===d?a-=c:"right"===d&&(a+=c),{x:a,y:o}}(g,x,v=function(t,e){var i,n,a,o,r,s=t._model,l=t._chart,d=t._chart.chartArea,u="center",h="center";s.y<e.height?h="top":s.y>l.height-e.height&&(h="bottom");var c=(d.left+d.right)/2,f=(d.top+d.bottom)/2;"center"===h?(i=function(t){return t<=c},n=function(t){return t>c}):(i=function(t){return t<=e.width/2},n=function(t){return t>=l.width-e.width/2}),a=function(t){return t+e.width+s.caretSize+s.caretPadding>l.width},o=function(t){return t-e.width-s.caretSize-s.caretPadding<0},r=function(t){return t<=f?"top":"bottom"},i(s.x)?(u="left",a(s.x)&&(u="center",h=r(s.y))):n(s.x)&&(u="right",o(s.x)&&(u="center",h=r(s.y)));var g=t._options;return{xAlign:g.xAlign?g.xAlign:u,yAlign:g.yAlign?g.yAlign:h}}(this,x),h._chart)}else g.opacity=0;return g.xAlign=v.xAlign,g.yAlign=v.yAlign,g.x=b.x,g.y=b.y,g.width=x.width,g.height=x.height,g.caretX=y.x,g.caretY=y.y,h._model=g,t&&c.custom&&c.custom.call(h,g),h},drawCaret:function(t,e){var i=this._chart.ctx,n=this._view,a=this.getCaretPosition(t,e,n);i.lineTo(a.x1,a.y1),i.lineTo(a.x2,a.y2),i.lineTo(a.x3,a.y3)},getCaretPosition:function(t,e,i){var n,a,o,r,s,l,d=i.caretSize,u=i.cornerRadius,h=i.xAlign,c=i.yAlign,f=t.x,g=t.y,p=e.width,m=e.height;if("center"===c)s=g+m/2,"left"===h?(a=(n=f)-d,o=n,r=s+d,l=s-d):(a=(n=f+p)+d,o=n,r=s-d,l=s+d);else if("left"===h?(n=(a=f+u+d)-d,o=a+d):"right"===h?(n=(a=f+p-u-d)-d,o=a+d):(n=(a=i.caretX)-d,o=a+d),"top"===c)s=(r=g)-d,l=r;else{s=(r=g+m)+d,l=r;var v=o;o=n,n=v}return{x1:n,x2:a,x3:o,y1:r,y2:s,y3:l}},drawTitle:function(t,e,i){var n=e.title;if(n.length){t.x=Ke(e,e._titleAlign),i.textAlign=e._titleAlign,i.textBaseline="top";var a,o,r=e.titleFontSize,s=e.titleSpacing;for(i.fillStyle=e.titleFontColor,i.font=ut.fontString(r,e._titleFontStyle,e._titleFontFamily),a=0,o=n.length;a<o;++a)i.fillText(n[a],t.x,t.y),t.y+=r+s,a+1===n.length&&(t.y+=e.titleMarginBottom-s)}},drawBody:function(t,e,i){var n,a=e.bodyFontSize,o=e.bodySpacing,r=e._bodyAlign,s=e.body,l=e.displayColors,d=e.labelColors,u=0,h=l?Ke(e,"left"):0;i.textAlign=r,i.textBaseline="top",i.font=ut.fontString(a,e._bodyFontStyle,e._bodyFontFamily),t.x=Ke(e,r);var c=function(e){i.fillText(e,t.x+u,t.y),t.y+=a+o};i.fillStyle=e.bodyFontColor,ut.each(e.beforeBody,c),u=l&&"right"!==r?"center"===r?a/2+1:a+2:0,ut.each(s,function(o,r){n=e.labelTextColors[r],i.fillStyle=n,ut.each(o.before,c),ut.each(o.lines,function(o){l&&(i.fillStyle=e.legendColorBackground,i.fillRect(h,t.y,a,a),i.lineWidth=1,i.strokeStyle=d[r].borderColor,i.strokeRect(h,t.y,a,a),i.fillStyle=d[r].backgroundColor,i.fillRect(h+1,t.y+1,a-2,a-2),i.fillStyle=n),c(o)}),ut.each(o.after,c)}),u=0,ut.each(e.afterBody,c),t.y-=o},drawFooter:function(t,e,i){var n=e.footer;n.length&&(t.x=Ke(e,e._footerAlign),t.y+=e.footerMarginTop,i.textAlign=e._footerAlign,i.textBaseline="top",i.fillStyle=e.footerFontColor,i.font=ut.fontString(e.footerFontSize,e._footerFontStyle,e._footerFontFamily),ut.each(n,function(n){i.fillText(n,t.x,t.y),t.y+=e.footerFontSize+e.footerSpacing}))},drawBackground:function(t,e,i,n){i.fillStyle=e.backgroundColor,i.strokeStyle=e.borderColor,i.lineWidth=e.borderWidth;var a=e.xAlign,o=e.yAlign,r=t.x,s=t.y,l=n.width,d=n.height,u=e.cornerRadius;i.beginPath(),i.moveTo(r+u,s),"top"===o&&this.drawCaret(t,n),i.lineTo(r+l-u,s),i.quadraticCurveTo(r+l,s,r+l,s+u),"center"===o&&"right"===a&&this.drawCaret(t,n),i.lineTo(r+l,s+d-u),i.quadraticCurveTo(r+l,s+d,r+l-u,s+d),"bottom"===o&&this.drawCaret(t,n),i.lineTo(r+u,s+d),i.quadraticCurveTo(r,s+d,r,s+d-u),"center"===o&&"left"===a&&this.drawCaret(t,n),i.lineTo(r,s+u),i.quadraticCurveTo(r,s,r+u,s),i.closePath(),i.fill(),e.borderWidth>0&&i.stroke()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var i={width:e.width,height:e.height},n={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&&(t.save(),t.globalAlpha=a,this.drawBackground(n,e,t,i),n.y+=e.yPadding,this.drawTitle(n,e,t),this.drawBody(n,e,t),this.drawFooter(n,e,t),t.restore())}},handleEvent:function(t){var e,i=this,n=i._options;return i._lastActive=i._lastActive||[],"mouseout"===t.type?i._active=[]:i._active=i._chart.getElementsAtEventForMode(t,n.mode,n),(e=!ut.arrayEquals(i._active,i._lastActive))&&(i._lastActive=i._active,(n.enabled||n.custom)&&(i._eventPosition={x:t.x,y:t.y},i.update(!0),i.pivot())),e}}),$e=qe,Je=Ze;Je.positioners=$e;var Qe=ut.valueOrDefault;function ti(){return ut.merge({},[].slice.call(arguments),{merger:function(t,e,i,n){if("xAxes"===t||"yAxes"===t){var a,o,r,s=i[t].length;for(e[t]||(e[t]=[]),a=0;a<s;++a)r=i[t][a],o=Qe(r.type,"xAxes"===t?"category":"linear"),a>=e[t].length&&e[t].push({}),!e[t][a].type||r.type&&r.type!==e[t][a].type?ut.merge(e[t][a],[He.getScaleDefaults(o),r]):ut.merge(e[t][a],r)}else ut._merger(t,e,i,n)}})}function ei(){return ut.merge({},[].slice.call(arguments),{merger:function(t,e,i,n){var a=e[t]||{},o=i[t];"scales"===t?e[t]=ti(a,o):"scale"===t?e[t]=ut.merge(a,[He.getScaleDefaults(o.type),o]):ut._merger(t,e,i,n)}})}function ii(t){return"top"===t||"bottom"===t}st._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});var ni=function(t,e){return this.construct(t,e),this};ut.extend(ni.prototype,{construct:function(t,e){var i=this;e=function(t){var e=(t=t||{}).data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=ei(st.global,st[t.type],t.options||{}),t}(e);var n=Ve.acquireContext(t,e),a=n&&n.canvas,o=a&&a.height,r=a&&a.width;i.id=ut.uid(),i.ctx=n,i.canvas=a,i.config=e,i.width=r,i.height=o,i.aspectRatio=o?r/o:null,i.options=e.options,i._bufferedRender=!1,i.chart=i,i.controller=i,ni.instances[i.id]=i,Object.defineProperty(i,"data",{get:function(){return i.config.data},set:function(t){i.config.data=t}}),n&&a?(i.initialize(),i.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return Ee.notify(t,"beforeInit"),ut.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.ensureScalesHaveIDs(),t.buildOrUpdateScales(),t.initToolTip(),Ee.notify(t,"afterInit"),t},clear:function(){return ut.canvas.clear(this),this},stop:function(){return bt.cancelAnimation(this),this},resize:function(t){var e=this,i=e.options,n=e.canvas,a=i.maintainAspectRatio&&e.aspectRatio||null,o=Math.max(0,Math.floor(ut.getMaximumWidth(n))),r=Math.max(0,Math.floor(a?o/a:ut.getMaximumHeight(n)));if((e.width!==o||e.height!==r)&&(n.width=e.width=o,n.height=e.height=r,n.style.width=o+"px",n.style.height=r+"px",ut.retinaScale(e,i.devicePixelRatio),!t)){var s={width:o,height:r};Ee.notify(e,"resize",[s]),i.onResize&&i.onResize(e,s),e.stop(),e.update({duration:i.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},i=t.scale;ut.each(e.xAxes,function(t,e){t.id=t.id||"x-axis-"+e}),ut.each(e.yAxes,function(t,e){t.id=t.id||"y-axis-"+e}),i&&(i.id=i.id||"scale")},buildOrUpdateScales:function(){var t=this,e=t.options,i=t.scales||{},n=[],a=Object.keys(i).reduce(function(t,e){return t[e]=!1,t},{});e.scales&&(n=n.concat((e.scales.xAxes||[]).map(function(t){return{options:t,dtype:"category",dposition:"bottom"}}),(e.scales.yAxes||[]).map(function(t){return{options:t,dtype:"linear",dposition:"left"}}))),e.scale&&n.push({options:e.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),ut.each(n,function(e){var n=e.options,o=n.id,r=Qe(n.type,e.dtype);ii(n.position)!==ii(e.dposition)&&(n.position=e.dposition),a[o]=!0;var s=null;if(o in i&&i[o].type===r)(s=i[o]).options=n,s.ctx=t.ctx,s.chart=t;else{var l=He.getScaleConstructor(r);if(!l)return;s=new l({id:o,type:r,options:n,ctx:t.ctx,chart:t}),i[s.id]=s}s.mergeTicksOptions(),e.isDefault&&(t.scale=s)}),ut.each(a,function(t,e){t||delete i[e]}),t.scales=i,He.addScalesToLayout(this)},buildOrUpdateControllers:function(){var t=this,e=[];return ut.each(t.data.datasets,function(i,n){var a=t.getDatasetMeta(n),o=i.type||t.config.type;if(a.type&&a.type!==o&&(t.destroyDatasetMeta(n),a=t.getDatasetMeta(n)),a.type=o,a.controller)a.controller.updateIndex(n),a.controller.linkScales();else{var r=ue[a.type];if(void 0===r)throw new Error('"'+a.type+'" is not a chart type.');a.controller=new r(t,n),e.push(a.controller)}},t),e},resetElements:function(){var t=this;ut.each(t.data.datasets,function(e,i){t.getDatasetMeta(i).controller.reset()},t)},reset:function(){this.resetElements(),this.tooltip.initialize()},update:function(t){var e,i,n=this;if(t&&"object"==typeof t||(t={duration:t,lazy:arguments[1]}),i=(e=n).options,ut.each(e.scales,function(t){ke.removeBox(e,t)}),i=ei(st.global,st[e.config.type],i),e.options=e.config.options=i,e.ensureScalesHaveIDs(),e.buildOrUpdateScales(),e.tooltip._options=i.tooltips,e.tooltip.initialize(),Ee._invalidate(n),!1!==Ee.notify(n,"beforeUpdate")){n.tooltip._data=n.data;var a=n.buildOrUpdateControllers();ut.each(n.data.datasets,function(t,e){n.getDatasetMeta(e).controller.buildOrUpdateElements()},n),n.updateLayout(),n.options.animation&&n.options.animation.duration&&ut.each(a,function(t){t.reset()}),n.updateDatasets(),n.tooltip.initialize(),n.lastActive=[],Ee.notify(n,"afterUpdate"),n._bufferedRender?n._bufferedRequest={duration:t.duration,easing:t.easing,lazy:t.lazy}:n.render(t)}},updateLayout:function(){!1!==Ee.notify(this,"beforeLayout")&&(ke.update(this,this.width,this.height),Ee.notify(this,"afterScaleUpdate"),Ee.notify(this,"afterLayout"))},updateDatasets:function(){if(!1!==Ee.notify(this,"beforeDatasetsUpdate")){for(var t=0,e=this.data.datasets.length;t<e;++t)this.updateDataset(t);Ee.notify(this,"afterDatasetsUpdate")}},updateDataset:function(t){var e=this.getDatasetMeta(t),i={meta:e,index:t};!1!==Ee.notify(this,"beforeDatasetUpdate",[i])&&(e.controller.update(),Ee.notify(this,"afterDatasetUpdate",[i]))},render:function(t){var e=this;t&&"object"==typeof t||(t={duration:t,lazy:arguments[1]});var i=e.options.animation,n=Qe(t.duration,i&&i.duration),a=t.lazy;if(!1!==Ee.notify(e,"beforeRender")){var o=function(t){Ee.notify(e,"afterRender"),ut.callback(i&&i.onComplete,[t],e)};if(i&&n){var r=new vt({numSteps:n/16.66,easing:t.easing||i.easing,render:function(t,e){var i=ut.easing.effects[e.easing],n=e.currentStep,a=n/e.numSteps;t.draw(i(a),a,n)},onAnimationProgress:i.onProgress,onAnimationComplete:o});bt.addAnimation(e,r,n,a)}else e.draw(),o(new vt({numSteps:0,chart:e}));return e}},draw:function(t){var e=this;e.clear(),ut.isNullOrUndef(t)&&(t=1),e.transition(t),e.width<=0||e.height<=0||!1!==Ee.notify(e,"beforeDraw",[t])&&(ut.each(e.boxes,function(t){t.draw(e.chartArea)},e),e.drawDatasets(t),e._drawTooltip(t),Ee.notify(e,"afterDraw",[t]))},transition:function(t){for(var e=0,i=(this.data.datasets||[]).length;e<i;++e)this.isDatasetVisible(e)&&this.getDatasetMeta(e).controller.transition(t);this.tooltip.transition(t)},drawDatasets:function(t){var e=this;if(!1!==Ee.notify(e,"beforeDatasetsDraw",[t])){for(var i=(e.data.datasets||[]).length-1;i>=0;--i)e.isDatasetVisible(i)&&e.drawDataset(i,t);Ee.notify(e,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var i=this.getDatasetMeta(t),n={meta:i,index:t,easingValue:e};!1!==Ee.notify(this,"beforeDatasetDraw",[n])&&(i.controller.draw(e),Ee.notify(this,"afterDatasetDraw",[n]))},_drawTooltip:function(t){var e=this.tooltip,i={tooltip:e,easingValue:t};!1!==Ee.notify(this,"beforeTooltipDraw",[i])&&(e.draw(),Ee.notify(this,"afterTooltipDraw",[i]))},getElementAtEvent:function(t){return ve.modes.single(this,t)},getElementsAtEvent:function(t){return ve.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return ve.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,i){var n=ve.modes[e];return"function"==typeof n?n(this,t,i):[]},getDatasetAtEvent:function(t){return ve.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this.data.datasets[t];e._meta||(e._meta={});var i=e._meta[this.id];return i||(i=e._meta[this.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null}),i},getVisibleDatasetCount:function(){for(var t=0,e=0,i=this.data.datasets.length;e<i;++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,i=this.data.datasets[t],n=i._meta&&i._meta[e];n&&(n.controller.destroy(),delete i._meta[e])},destroy:function(){var t,e,i=this,n=i.canvas;for(i.stop(),t=0,e=i.data.datasets.length;t<e;++t)i.destroyDatasetMeta(t);n&&(i.unbindEvents(),ut.canvas.clear(i),Ve.releaseContext(i.ctx),i.canvas=null,i.ctx=null),Ee.notify(i,"destroy"),delete ni.instances[i.id]},toBase64Image:function(){return this.canvas.toDataURL.apply(this.canvas,arguments)},initToolTip:function(){var t=this;t.tooltip=new Je({_chart:t,_chartInstance:t,_data:t.data,_options:t.options.tooltips},t)},bindEvents:function(){var t=this,e=t._listeners={},i=function(){t.eventHandler.apply(t,arguments)};ut.each(t.options.events,function(n){Ve.addEventListener(t,n,i),e[n]=i}),t.options.responsive&&(i=function(){t.resize()},Ve.addEventListener(t,"resize",i),e.resize=i)},unbindEvents:function(){var t=this,e=t._listeners;e&&(delete t._listeners,ut.each(e,function(e,i){Ve.removeEventListener(t,i,e)}))},updateHoverStyle:function(t,e,i){var n,a,o,r=i?"setHoverStyle":"removeHoverStyle";for(a=0,o=t.length;a<o;++a)(n=t[a])&&this.getDatasetMeta(n._datasetIndex).controller[r](n)},eventHandler:function(t){var e=this,i=e.tooltip;if(!1!==Ee.notify(e,"beforeEvent",[t])){e._bufferedRender=!0,e._bufferedRequest=null;var n=e.handleEvent(t);i&&(n=i._start?i.handleEvent(t):n|i.handleEvent(t)),Ee.notify(e,"afterEvent",[t]);var a=e._bufferedRequest;return a?e.render(a):n&&!e.animating&&(e.stop(),e.render({duration:e.options.hover.animationDuration,lazy:!0})),e._bufferedRender=!1,e._bufferedRequest=null,e}},handleEvent:function(t){var e,i=this,n=i.options||{},a=n.hover;return i.lastActive=i.lastActive||[],"mouseout"===t.type?i.active=[]:i.active=i.getElementsAtEventForMode(t,a.mode,a),ut.callback(n.onHover||n.hover.onHover,[t.native,i.active],i),"mouseup"!==t.type&&"click"!==t.type||n.onClick&&n.onClick.call(i,t.native,i.active),i.lastActive.length&&i.updateHoverStyle(i.lastActive,a.mode,!1),i.active.length&&a.mode&&i.updateHoverStyle(i.active,a.mode,!0),e=!ut.arrayEquals(i.active,i.lastActive),i.lastActive=i.active,e}}),ni.instances={};var ai=ni;ni.Controller=ni,ni.types={},ut.configMerge=ei,ut.scaleMerge=ti;function oi(){throw new Error("This method is not implemented: either no adapter can be found or an incomplete integration was provided.")}function ri(t){this.options=t||{}}ut.extend(ri.prototype,{formats:oi,parse:oi,format:oi,add:oi,diff:oi,startOf:oi,endOf:oi,_create:function(t){return t}}),ri.override=function(t){ut.extend(ri.prototype,t)};var si={_date:ri},li={formatters:{values:function(t){return ut.isArray(t)?t:""+t},linear:function(t,e,i){var n=i.length>3?i[2]-i[1]:i[1]-i[0];Math.abs(n)>1&&t!==Math.floor(t)&&(n=t-Math.floor(t));var a=ut.log10(Math.abs(n)),o="";if(0!==t)if(Math.max(Math.abs(i[0]),Math.abs(i[i.length-1]))<1e-4){var r=ut.log10(Math.abs(t));o=t.toExponential(Math.floor(r)-Math.floor(a))}else{var s=-1*Math.floor(a);s=Math.max(Math.min(s,20),0),o=t.toFixed(s)}else o="0";return o},logarithmic:function(t,e,i){var n=t/Math.pow(10,Math.floor(ut.log10(t)));return 0===t?"0":1===n||2===n||5===n||0===e||e===i.length-1?t.toExponential():""}}},di=ut.valueOrDefault,ui=ut.valueAtIndexOrDefault;function hi(t){var e,i,n=[];for(e=0,i=t.length;e<i;++e)n.push(t[e].label);return n}function ci(t,e,i){return ut.isArray(e)?ut.longestText(t,i,e):t.measureText(e).width}st._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:"",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:li.formatters.values,minor:{},major:{}}});var fi=pt.extend({getPadding:function(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}},getTicks:function(){return this._ticks},mergeTicksOptions:function(){var t=this.options.ticks;for(var e in!1===t.minor&&(t.minor={display:!1}),!1===t.major&&(t.major={display:!1}),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(){ut.callback(this.options.beforeUpdate,[this])},update:function(t,e,i){var n,a,o,r,s,l,d=this;for(d.beforeUpdate(),d.maxWidth=t,d.maxHeight=e,d.margins=ut.extend({left:0,right:0,top:0,bottom:0},i),d._maxLabelLines=0,d.longestLabelWidth=0,d.longestTextCache=d.longestTextCache||{},d.beforeSetDimensions(),d.setDimensions(),d.afterSetDimensions(),d.beforeDataLimits(),d.determineDataLimits(),d.afterDataLimits(),d.beforeBuildTicks(),s=d.buildTicks()||[],s=d.afterBuildTicks(s)||s,d.beforeTickToLabelConversion(),o=d.convertTicksToLabels(s)||d.ticks,d.afterTickToLabelConversion(),d.ticks=o,n=0,a=o.length;n<a;++n)r=o[n],(l=s[n])?l.label=r:s.push(l={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(){ut.callback(this.options.afterUpdate,[this])},beforeSetDimensions:function(){ut.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(){ut.callback(this.options.afterSetDimensions,[this])},beforeDataLimits:function(){ut.callback(this.options.beforeDataLimits,[this])},determineDataLimits:ut.noop,afterDataLimits:function(){ut.callback(this.options.afterDataLimits,[this])},beforeBuildTicks:function(){ut.callback(this.options.beforeBuildTicks,[this])},buildTicks:ut.noop,afterBuildTicks:function(t){var e=this;return ut.isArray(t)&&t.length?ut.callback(e.options.afterBuildTicks,[e,t]):(e.ticks=ut.callback(e.options.afterBuildTicks,[e,e.ticks])||e.ticks,t)},beforeTickToLabelConversion:function(){ut.callback(this.options.beforeTickToLabelConversion,[this])},convertTicksToLabels:function(){var t=this.options.ticks;this.ticks=this.ticks.map(t.userCallback||t.callback,this)},afterTickToLabelConversion:function(){ut.callback(this.options.afterTickToLabelConversion,[this])},beforeCalculateTickRotation:function(){ut.callback(this.options.beforeCalculateTickRotation,[this])},calculateTickRotation:function(){var t=this,e=t.ctx,i=t.options.ticks,n=hi(t._ticks),a=ut.options._parseFont(i);e.font=a.string;var o=i.minRotation||0;if(n.length&&t.options.display&&t.isHorizontal())for(var r,s=ut.longestText(e,a.string,n,t.longestTextCache),l=s,d=t.getPixelForTick(1)-t.getPixelForTick(0)-6;l>d&&o<i.maxRotation;){var u=ut.toRadians(o);if(r=Math.cos(u),Math.sin(u)*s>t.maxHeight){o--;break}o++,l=r*s}t.labelRotation=o},afterCalculateTickRotation:function(){ut.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){ut.callback(this.options.beforeFit,[this])},fit:function(){var t=this,e=t.minSize={width:0,height:0},i=hi(t._ticks),n=t.options,a=n.ticks,o=n.scaleLabel,r=n.gridLines,s=t._isVisible(),l=n.position,d=t.isHorizontal(),u=ut.options._parseFont,h=u(a),c=n.gridLines.tickMarkLength;if(e.width=d?t.isFullWidth()?t.maxWidth-t.margins.left-t.margins.right:t.maxWidth:s&&r.drawTicks?c:0,e.height=d?s&&r.drawTicks?c:0:t.maxHeight,o.display&&s){var f=u(o),g=ut.options.toPadding(o.padding),p=f.lineHeight+g.height;d?e.height+=p:e.width+=p}if(a.display&&s){var m=ut.longestText(t.ctx,h.string,i,t.longestTextCache),v=ut.numberOfLabelLines(i),b=.5*h.size,x=t.options.ticks.padding;if(t._maxLabelLines=v,t.longestLabelWidth=m,d){var y=ut.toRadians(t.labelRotation),k=Math.cos(y),w=Math.sin(y)*m+h.lineHeight*v+b;e.height=Math.min(t.maxHeight,e.height+w+x),t.ctx.font=h.string;var M,_,C=ci(t.ctx,i[0],h.string),S=ci(t.ctx,i[i.length-1],h.string),P=t.getPixelForTick(0)-t.left,I=t.right-t.getPixelForTick(i.length-1);0!==t.labelRotation?(M="bottom"===l?k*C:k*b,_="bottom"===l?k*b:k*S):(M=C/2,_=S/2),t.paddingLeft=Math.max(M-P,0)+3,t.paddingRight=Math.max(_-I,0)+3}else a.mirror?m=0:m+=x+b,e.width=Math.min(t.maxWidth,e.width+m),t.paddingTop=h.size/2,t.paddingBottom=h.size/2}t.handleMargins(),t.width=e.width,t.height=e.height},handleMargins:function(){var t=this;t.margins&&(t.paddingLeft=Math.max(t.paddingLeft-t.margins.left,0),t.paddingTop=Math.max(t.paddingTop-t.margins.top,0),t.paddingRight=Math.max(t.paddingRight-t.margins.right,0),t.paddingBottom=Math.max(t.paddingBottom-t.margins.bottom,0))},afterFit:function(){ut.callback(this.options.afterFit,[this])},isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){if(ut.isNullOrUndef(t))return NaN;if(("number"==typeof t||t instanceof Number)&&!isFinite(t))return NaN;if(t)if(this.isHorizontal()){if(void 0!==t.x)return this.getRightValue(t.x)}else if(void 0!==t.y)return this.getRightValue(t.y);return t},getLabelForIndex:ut.noop,getPixelForValue:ut.noop,getValueForPixel:ut.noop,getPixelForTick:function(t){var e=this,i=e.options.offset;if(e.isHorizontal()){var n=(e.width-(e.paddingLeft+e.paddingRight))/Math.max(e._ticks.length-(i?0:1),1),a=n*t+e.paddingLeft;i&&(a+=n/2);var o=e.left+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 i=(e.width-(e.paddingLeft+e.paddingRight))*t+e.paddingLeft,n=e.left+i;return n+=e.isFullWidth()?e.margins.left:0}return e.top+t*e.height},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var t=this.min,e=this.max;return this.beginAtZero?0:t<0&&e<0?e:t>0&&e>0?t:0},_autoSkip:function(t){var e,i,n=this,a=n.isHorizontal(),o=n.options.ticks.minor,r=t.length,s=!1,l=o.maxTicksLimit,d=n._tickSize()*(r-1),u=a?n.width-(n.paddingLeft+n.paddingRight):n.height-(n.paddingTop+n.PaddingBottom),h=[];for(d>u&&(s=1+Math.floor(d/u)),r>l&&(s=Math.max(s,1+Math.floor(r/l))),e=0;e<r;e++)i=t[e],s>1&&e%s>0&&delete i.label,h.push(i);return h},_tickSize:function(){var t=this,e=t.isHorizontal(),i=t.options.ticks.minor,n=ut.toRadians(t.labelRotation),a=Math.abs(Math.cos(n)),o=Math.abs(Math.sin(n)),r=i.autoSkipPadding||0,s=t.longestLabelWidth+r||0,l=ut.options._parseFont(i),d=t._maxLabelLines*l.lineHeight+r||0;return e?d*a>s*o?s/a:d/o:d*o<s*a?d/a:s/o},_isVisible:function(){var t,e,i,n=this.chart,a=this.options.display;if("auto"!==a)return!!a;for(t=0,e=n.data.datasets.length;t<e;++t)if(n.isDatasetVisible(t)&&((i=n.getDatasetMeta(t)).xAxisID===this.id||i.yAxisID===this.id))return!0;return!1},draw:function(t){var e=this,i=e.options;if(e._isVisible()){var n,a,o,r=e.chart,s=e.ctx,l=st.global.defaultFontColor,d=i.ticks.minor,u=i.ticks.major||d,h=i.gridLines,c=i.scaleLabel,f=i.position,g=0!==e.labelRotation,p=d.mirror,m=e.isHorizontal(),v=ut.options._parseFont,b=d.display&&d.autoSkip?e._autoSkip(e.getTicks()):e.getTicks(),x=di(d.fontColor,l),y=v(d),k=y.lineHeight,w=di(u.fontColor,l),M=v(u),_=d.padding,C=d.labelOffset,S=h.drawTicks?h.tickMarkLength:0,P=di(c.fontColor,l),I=v(c),A=ut.options.toPadding(c.padding),D=ut.toRadians(e.labelRotation),T=[],F=h.drawBorder?ui(h.lineWidth,0,0):0,L=ut._alignPixel;"top"===f?(n=L(r,e.bottom,F),a=e.bottom-S,o=n-F/2):"bottom"===f?(n=L(r,e.top,F),a=n+F/2,o=e.top+S):"left"===f?(n=L(r,e.right,F),a=e.right-S,o=n-F/2):(n=L(r,e.left,F),a=n+F/2,o=e.left+S);if(ut.each(b,function(n,s){if(!ut.isNullOrUndef(n.label)){var l,d,u,c,v,b,x,y,w,M,P,I,A,R,O,z,B=n.label;s===e.zeroLineIndex&&i.offset===h.offsetGridLines?(l=h.zeroLineWidth,d=h.zeroLineColor,u=h.zeroLineBorderDash||[],c=h.zeroLineBorderDashOffset||0):(l=ui(h.lineWidth,s),d=ui(h.color,s),u=h.borderDash||[],c=h.borderDashOffset||0);var N=ut.isArray(B)?B.length:1,W=function(t,e,i){var n=t.getPixelForTick(e);return i&&(1===t.getTicks().length?n-=t.isHorizontal()?Math.max(n-t.left,t.right-n):Math.max(n-t.top,t.bottom-n):n-=0===e?(t.getPixelForTick(1)-n)/2:(n-t.getPixelForTick(e-1))/2),n}(e,s,h.offsetGridLines);if(m){var V=S+_;W<e.left-1e-7&&(d="rgba(0,0,0,0)"),v=x=w=P=L(r,W,l),b=a,y=o,A=e.getPixelForTick(s)+C,"top"===f?(M=L(r,t.top,F)+F/2,I=t.bottom,O=((g?1:.5)-N)*k,z=g?"left":"center",R=e.bottom-V):(M=t.top,I=L(r,t.bottom,F)-F/2,O=(g?0:.5)*k,z=g?"right":"center",R=e.top+V)}else{var E=(p?0:S)+_;W<e.top-1e-7&&(d="rgba(0,0,0,0)"),v=a,x=o,b=y=M=I=L(r,W,l),R=e.getPixelForTick(s)+C,O=(1-N)*k/2,"left"===f?(w=L(r,t.left,F)+F/2,P=t.right,z=p?"left":"right",A=e.right-E):(w=t.left,P=L(r,t.right,F)-F/2,z=p?"right":"left",A=e.left+E)}T.push({tx1:v,ty1:b,tx2:x,ty2:y,x1:w,y1:M,x2:P,y2:I,labelX:A,labelY:R,glWidth:l,glColor:d,glBorderDash:u,glBorderDashOffset:c,rotation:-1*D,label:B,major:n.major,textOffset:O,textAlign:z})}}),ut.each(T,function(t){var e=t.glWidth,i=t.glColor;if(h.display&&e&&i&&(s.save(),s.lineWidth=e,s.strokeStyle=i,s.setLineDash&&(s.setLineDash(t.glBorderDash),s.lineDashOffset=t.glBorderDashOffset),s.beginPath(),h.drawTicks&&(s.moveTo(t.tx1,t.ty1),s.lineTo(t.tx2,t.ty2)),h.drawOnChartArea&&(s.moveTo(t.x1,t.y1),s.lineTo(t.x2,t.y2)),s.stroke(),s.restore()),d.display){s.save(),s.translate(t.labelX,t.labelY),s.rotate(t.rotation),s.font=t.major?M.string:y.string,s.fillStyle=t.major?w:x,s.textBaseline="middle",s.textAlign=t.textAlign;var n=t.label,a=t.textOffset;if(ut.isArray(n))for(var o=0;o<n.length;++o)s.fillText(""+n[o],0,a),a+=k;else s.fillText(n,0,a);s.restore()}}),c.display){var R,O,z=0,B=I.lineHeight/2;if(m)R=e.left+(e.right-e.left)/2,O="bottom"===f?e.bottom-B-A.bottom:e.top+B+A.top;else{var N="left"===f;R=N?e.left+B+A.top:e.right-B-A.top,O=e.top+(e.bottom-e.top)/2,z=N?-.5*Math.PI:.5*Math.PI}s.save(),s.translate(R,O),s.rotate(z),s.textAlign="center",s.textBaseline="middle",s.fillStyle=P,s.font=I.string,s.fillText(c.labelString,0,0),s.restore()}if(F){var W,V,E,H,j=F,q=ui(h.lineWidth,b.length-1,0);m?(W=L(r,e.left,j)-j/2,V=L(r,e.right,q)+q/2,E=H=n):(E=L(r,e.top,j)-j/2,H=L(r,e.bottom,q)+q/2,W=V=n),s.lineWidth=F,s.strokeStyle=ui(h.color,0),s.beginPath(),s.moveTo(W,E),s.lineTo(V,H),s.stroke()}}}}),gi=fi.extend({getLabels:function(){var t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels},determineDataLimits:function(){var t,e=this,i=e.getLabels();e.minIndex=0,e.maxIndex=i.length-1,void 0!==e.options.ticks.min&&(t=i.indexOf(e.options.ticks.min),e.minIndex=-1!==t?t:e.minIndex),void 0!==e.options.ticks.max&&(t=i.indexOf(e.options.ticks.max),e.maxIndex=-1!==t?t:e.maxIndex),e.min=i[e.minIndex],e.max=i[e.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 i=this,n=i.chart;return n.getDatasetMeta(e).controller._getValueScaleId()===i.id?i.getRightValue(n.data.datasets[e].data[t]):i.ticks[t-i.minIndex]},getPixelForValue:function(t,e){var i,n=this,a=n.options.offset,o=Math.max(n.maxIndex+1-n.minIndex-(a?0:1),1);if(null!=t&&(i=n.isHorizontal()?t.x:t.y),void 0!==i||void 0!==t&&isNaN(e)){t=i||t;var r=n.getLabels().indexOf(t);e=-1!==r?r:e}if(n.isHorizontal()){var s=n.width/o,l=s*(e-n.minIndex);return a&&(l+=s/2),n.left+l}var d=n.height/o,u=d*(e-n.minIndex);return a&&(u+=d/2),n.top+u},getPixelForTick:function(t){return this.getPixelForValue(this.ticks[t],t+this.minIndex,null)},getValueForPixel:function(t){var e=this,i=e.options.offset,n=Math.max(e._ticks.length-(i?0:1),1),a=e.isHorizontal(),o=(a?e.width:e.height)/n;return t-=a?e.left:e.top,i&&(t-=o/2),(t<=0?0:Math.round(t/o))+e.minIndex},getBasePixel:function(){return this.bottom}}),pi={position:"bottom"};gi._defaults=pi;var mi=ut.noop,vi=ut.isNullOrUndef;var bi=fi.extend({getRightValue:function(t){return"string"==typeof t?+t:fi.prototype.getRightValue.call(this,t)},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;if(e.beginAtZero){var i=ut.sign(t.min),n=ut.sign(t.max);i<0&&n<0?t.max=0:i>0&&n>0&&(t.min=0)}var a=void 0!==e.min||void 0!==e.suggestedMin,o=void 0!==e.max||void 0!==e.suggestedMax;void 0!==e.min?t.min=e.min:void 0!==e.suggestedMin&&(null===t.min?t.min=e.suggestedMin:t.min=Math.min(t.min,e.suggestedMin)),void 0!==e.max?t.max=e.max:void 0!==e.suggestedMax&&(null===t.max?t.max=e.suggestedMax:t.max=Math.max(t.max,e.suggestedMax)),a!==o&&t.min>=t.max&&(a?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,e.beginAtZero||t.min--)},getTickLimit:function(){var t,e=this.options.ticks,i=e.stepSize,n=e.maxTicksLimit;return i?t=Math.ceil(this.max/i)-Math.floor(this.min/i)+1:(t=this._computeTickLimit(),n=n||11),n&&(t=Math.min(n,t)),t},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:mi,buildTicks:function(){var t=this,e=t.options.ticks,i=t.getTickLimit(),n={maxTicks:i=Math.max(2,i),min:e.min,max:e.max,precision:e.precision,stepSize:ut.valueOrDefault(e.fixedStepSize,e.stepSize)},a=t.ticks=function(t,e){var i,n,a,o,r=[],s=t.stepSize,l=s||1,d=t.maxTicks-1,u=t.min,h=t.max,c=t.precision,f=e.min,g=e.max,p=ut.niceNum((g-f)/d/l)*l;if(p<1e-14&&vi(u)&&vi(h))return[f,g];(o=Math.ceil(g/p)-Math.floor(f/p))>d&&(p=ut.niceNum(o*p/d/l)*l),s||vi(c)?i=Math.pow(10,ut._decimalPlaces(p)):(i=Math.pow(10,c),p=Math.ceil(p*i)/i),n=Math.floor(f/p)*p,a=Math.ceil(g/p)*p,s&&(!vi(u)&&ut.almostWhole(u/p,p/1e3)&&(n=u),!vi(h)&&ut.almostWhole(h/p,p/1e3)&&(a=h)),o=(a-n)/p,o=ut.almostEquals(o,Math.round(o),p/1e3)?Math.round(o):Math.ceil(o),n=Math.round(n*i)/i,a=Math.round(a*i)/i,r.push(vi(u)?n:u);for(var m=1;m<o;++m)r.push(Math.round((n+m*p)*i)/i);return r.push(vi(h)?a:h),r}(n,t);t.handleDirectionalChanges(),t.max=ut.max(a),t.min=ut.min(a),e.reverse?(a.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max)},convertTicksToLabels:function(){var t=this;t.ticksAsNumbers=t.ticks.slice(),t.zeroLineIndex=t.ticks.indexOf(0),fi.prototype.convertTicksToLabels.call(t)}}),xi={position:"left",ticks:{callback:li.formatters.linear}},yi=bi.extend({determineDataLimits:function(){var t=this,e=t.options,i=t.chart,n=i.data.datasets,a=t.isHorizontal();function o(e){return a?e.xAxisID===t.id:e.yAxisID===t.id}t.min=null,t.max=null;var r=e.stacked;if(void 0===r&&ut.each(n,function(t,e){if(!r){var n=i.getDatasetMeta(e);i.isDatasetVisible(e)&&o(n)&&void 0!==n.stack&&(r=!0)}}),e.stacked||r){var s={};ut.each(n,function(n,a){var r=i.getDatasetMeta(a),l=[r.type,void 0===e.stacked&&void 0===r.stack?a:"",r.stack].join(".");void 0===s[l]&&(s[l]={positiveValues:[],negativeValues:[]});var d=s[l].positiveValues,u=s[l].negativeValues;i.isDatasetVisible(a)&&o(r)&&ut.each(n.data,function(i,n){var a=+t.getRightValue(i);isNaN(a)||r.data[n].hidden||(d[n]=d[n]||0,u[n]=u[n]||0,e.relativePoints?d[n]=100:a<0?u[n]+=a:d[n]+=a)})}),ut.each(s,function(e){var i=e.positiveValues.concat(e.negativeValues),n=ut.min(i),a=ut.max(i);t.min=null===t.min?n:Math.min(t.min,n),t.max=null===t.max?a:Math.max(t.max,a)})}else ut.each(n,function(e,n){var a=i.getDatasetMeta(n);i.isDatasetVisible(n)&&o(a)&&ut.each(e.data,function(e,i){var n=+t.getRightValue(e);isNaN(n)||a.data[i].hidden||(null===t.min?t.min=n:n<t.min&&(t.min=n),null===t.max?t.max=n:n>t.max&&(t.max=n))})});t.min=isFinite(t.min)&&!isNaN(t.min)?t.min:0,t.max=isFinite(t.max)&&!isNaN(t.max)?t.max:1,this.handleTickRangeOptions()},_computeTickLimit:function(){var t;return this.isHorizontal()?Math.ceil(this.width/40):(t=ut.options._parseFont(this.options.ticks),Math.ceil(this.height/t.lineHeight))},handleDirectionalChanges:function(){this.isHorizontal()||this.ticks.reverse()},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},getPixelForValue:function(t){var e=this,i=e.start,n=+e.getRightValue(t),a=e.end-i;return e.isHorizontal()?e.left+e.width/a*(n-i):e.bottom-e.height/a*(n-i)},getValueForPixel:function(t){var e=this,i=e.isHorizontal(),n=i?e.width:e.height,a=(i?t-e.left:e.bottom-t)/n;return e.start+(e.end-e.start)*a},getPixelForTick:function(t){return this.getPixelForValue(this.ticksAsNumbers[t])}}),ki=xi;yi._defaults=ki;var wi=ut.valueOrDefault;var Mi={position:"left",ticks:{callback:li.formatters.logarithmic}};function _i(t,e){return ut.isFinite(t)&&t>=0?t:e}var Ci=fi.extend({determineDataLimits:function(){var t=this,e=t.options,i=t.chart,n=i.data.datasets,a=t.isHorizontal();function o(e){return a?e.xAxisID===t.id:e.yAxisID===t.id}t.min=null,t.max=null,t.minNotZero=null;var r=e.stacked;if(void 0===r&&ut.each(n,function(t,e){if(!r){var n=i.getDatasetMeta(e);i.isDatasetVisible(e)&&o(n)&&void 0!==n.stack&&(r=!0)}}),e.stacked||r){var s={};ut.each(n,function(n,a){var r=i.getDatasetMeta(a),l=[r.type,void 0===e.stacked&&void 0===r.stack?a:"",r.stack].join(".");i.isDatasetVisible(a)&&o(r)&&(void 0===s[l]&&(s[l]=[]),ut.each(n.data,function(e,i){var n=s[l],a=+t.getRightValue(e);isNaN(a)||r.data[i].hidden||a<0||(n[i]=n[i]||0,n[i]+=a)}))}),ut.each(s,function(e){if(e.length>0){var i=ut.min(e),n=ut.max(e);t.min=null===t.min?i:Math.min(t.min,i),t.max=null===t.max?n:Math.max(t.max,n)}})}else ut.each(n,function(e,n){var a=i.getDatasetMeta(n);i.isDatasetVisible(n)&&o(a)&&ut.each(e.data,function(e,i){var n=+t.getRightValue(e);isNaN(n)||a.data[i].hidden||n<0||(null===t.min?t.min=n:n<t.min&&(t.min=n),null===t.max?t.max=n:n>t.max&&(t.max=n),0!==n&&(null===t.minNotZero||n<t.minNotZero)&&(t.minNotZero=n))})});this.handleTickRangeOptions()},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;t.min=_i(e.min,t.min),t.max=_i(e.max,t.max),t.min===t.max&&(0!==t.min&&null!==t.min?(t.min=Math.pow(10,Math.floor(ut.log10(t.min))-1),t.max=Math.pow(10,Math.floor(ut.log10(t.max))+1)):(t.min=1,t.max=10)),null===t.min&&(t.min=Math.pow(10,Math.floor(ut.log10(t.max))-1)),null===t.max&&(t.max=0!==t.min?Math.pow(10,Math.floor(ut.log10(t.min))+1):10),null===t.minNotZero&&(t.min>0?t.minNotZero=t.min:t.max<1?t.minNotZero=Math.pow(10,Math.floor(ut.log10(t.max))):t.minNotZero=1)},buildTicks:function(){var t=this,e=t.options.ticks,i=!t.isHorizontal(),n={min:_i(e.min),max:_i(e.max)},a=t.ticks=function(t,e){var i,n,a=[],o=wi(t.min,Math.pow(10,Math.floor(ut.log10(e.min)))),r=Math.floor(ut.log10(e.max)),s=Math.ceil(e.max/Math.pow(10,r));0===o?(i=Math.floor(ut.log10(e.minNotZero)),n=Math.floor(e.minNotZero/Math.pow(10,i)),a.push(o),o=n*Math.pow(10,i)):(i=Math.floor(ut.log10(o)),n=Math.floor(o/Math.pow(10,i)));var l=i<0?Math.pow(10,Math.abs(i)):1;do{a.push(o),10==++n&&(n=1,l=++i>=0?1:l),o=Math.round(n*Math.pow(10,i)*l)/l}while(i<r||i===r&&n<s);var d=wi(t.max,o);return a.push(d),a}(n,t);t.max=ut.max(a),t.min=ut.min(a),e.reverse?(i=!i,t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),i&&a.reverse()},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),fi.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])},_getFirstTickValue:function(t){var e=Math.floor(ut.log10(t));return Math.floor(t/Math.pow(10,e))*Math.pow(10,e)},getPixelForValue:function(t){var e,i,n,a,o,r=this,s=r.options.ticks,l=s.reverse,d=ut.log10,u=r._getFirstTickValue(r.minNotZero),h=0;return t=+r.getRightValue(t),l?(n=r.end,a=r.start,o=-1):(n=r.start,a=r.end,o=1),r.isHorizontal()?(e=r.width,i=l?r.right:r.left):(e=r.height,o*=-1,i=l?r.top:r.bottom),t!==n&&(0===n&&(e-=h=wi(s.fontSize,st.global.defaultFontSize),n=u),0!==t&&(h+=e/(d(a)-d(n))*(d(t)-d(n))),i+=o*h),i},getValueForPixel:function(t){var e,i,n,a,o=this,r=o.options.ticks,s=r.reverse,l=ut.log10,d=o._getFirstTickValue(o.minNotZero);if(s?(i=o.end,n=o.start):(i=o.start,n=o.end),o.isHorizontal()?(e=o.width,a=s?o.right-t:t-o.left):(e=o.height,a=s?t-o.top:o.bottom-t),a!==i){if(0===i){var u=wi(r.fontSize,st.global.defaultFontSize);a-=u,e-=u,i=d}a*=l(n)-l(i),a/=e,a=Math.pow(10,l(i)+a)}return a}}),Si=Mi;Ci._defaults=Si;var Pi=ut.valueOrDefault,Ii=ut.valueAtIndexOrDefault,Ai=ut.options.resolve,Di={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0, 0, 0, 0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:li.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(t){return t}}};function Ti(t){var e=t.options;return e.angleLines.display||e.pointLabels.display?t.chart.data.labels.length:0}function Fi(t){var e=t.ticks;return e.display&&t.display?Pi(e.fontSize,st.global.defaultFontSize)+2*e.backdropPaddingY:0}function Li(t,e,i,n,a){return t===n||t===a?{start:e-i/2,end:e+i/2}:t<n||t>a?{start:e-i,end:e}:{start:e,end:e+i}}function Ri(t){return 0===t||180===t?"center":t<180?"left":"right"}function Oi(t,e,i,n){var a,o,r=i.y+n/2;if(ut.isArray(e))for(a=0,o=e.length;a<o;++a)t.fillText(e[a],i.x,r),r+=n;else t.fillText(e,i.x,r)}function zi(t,e,i){90===t||270===t?i.y-=e.h/2:(t>270||t<90)&&(i.y-=e.h)}function Bi(t){return ut.isNumber(t)?t:0}var Ni=bi.extend({setDimensions:function(){var t=this;t.width=t.maxWidth,t.height=t.maxHeight,t.paddingTop=Fi(t.options)/2,t.xCenter=Math.floor(t.width/2),t.yCenter=Math.floor((t.height-t.paddingTop)/2),t.drawingArea=Math.min(t.height-t.paddingTop,t.width)/2},determineDataLimits:function(){var t=this,e=t.chart,i=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;ut.each(e.data.datasets,function(a,o){if(e.isDatasetVisible(o)){var r=e.getDatasetMeta(o);ut.each(a.data,function(e,a){var o=+t.getRightValue(e);isNaN(o)||r.data[a].hidden||(i=Math.min(o,i),n=Math.max(o,n))})}}),t.min=i===Number.POSITIVE_INFINITY?0:i,t.max=n===Number.NEGATIVE_INFINITY?0:n,t.handleTickRangeOptions()},_computeTickLimit:function(){return Math.ceil(this.drawingArea/Fi(this.options))},convertTicksToLabels:function(){var t=this;bi.prototype.convertTicksToLabels.call(t),t.pointLabels=t.chart.data.labels.map(t.options.pointLabels.callback,t)},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},fit:function(){var t=this.options;t.display&&t.pointLabels.display?function(t){var e,i,n,a=ut.options._parseFont(t.options.pointLabels),o={l:0,r:t.width,t:0,b:t.height-t.paddingTop},r={};t.ctx.font=a.string,t._pointLabelSizes=[];var s,l,d,u=Ti(t);for(e=0;e<u;e++){n=t.getPointPosition(e,t.drawingArea+5),s=t.ctx,l=a.lineHeight,d=t.pointLabels[e]||"",i=ut.isArray(d)?{w:ut.longestText(s,s.font,d),h:d.length*l}:{w:s.measureText(d).width,h:l},t._pointLabelSizes[e]=i;var h=t.getIndexAngle(e),c=ut.toDegrees(h)%360,f=Li(c,n.x,i.w,0,180),g=Li(c,n.y,i.h,90,270);f.start<o.l&&(o.l=f.start,r.l=h),f.end>o.r&&(o.r=f.end,r.r=h),g.start<o.t&&(o.t=g.start,r.t=h),g.end>o.b&&(o.b=g.end,r.b=h)}t.setReductions(t.drawingArea,o,r)}(this):this.setCenterPoint(0,0,0,0)},setReductions:function(t,e,i){var n=this,a=e.l/Math.sin(i.l),o=Math.max(e.r-n.width,0)/Math.sin(i.r),r=-e.t/Math.cos(i.t),s=-Math.max(e.b-(n.height-n.paddingTop),0)/Math.cos(i.b);a=Bi(a),o=Bi(o),r=Bi(r),s=Bi(s),n.drawingArea=Math.min(Math.floor(t-(a+o)/2),Math.floor(t-(r+s)/2)),n.setCenterPoint(a,o,r,s)},setCenterPoint:function(t,e,i,n){var a=this,o=a.width-e-a.drawingArea,r=t+a.drawingArea,s=i+a.drawingArea,l=a.height-a.paddingTop-n-a.drawingArea;a.xCenter=Math.floor((r+o)/2+a.left),a.yCenter=Math.floor((s+l)/2+a.top+a.paddingTop)},getIndexAngle:function(t){return t*(2*Math.PI/Ti(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 i=e.drawingArea/(e.max-e.min);return e.options.ticks.reverse?(e.max-t)*i:(t-e.min)*i},getPointPosition:function(t,e){var i=this.getIndexAngle(t)-Math.PI/2;return{x:Math.cos(i)*e+this.xCenter,y:Math.sin(i)*e+this.yCenter}},getPointPositionForValue:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))},getBasePosition:function(){var t=this.min,e=this.max;return this.getPointPositionForValue(0,this.beginAtZero?0:t<0&&e<0?e:t>0&&e>0?t:0)},draw:function(){var t=this,e=t.options,i=e.gridLines,n=e.ticks;if(e.display){var a=t.ctx,o=this.getIndexAngle(0),r=ut.options._parseFont(n);(e.angleLines.display||e.pointLabels.display)&&function(t){var e=t.ctx,i=t.options,n=i.angleLines,a=i.gridLines,o=i.pointLabels,r=Pi(n.lineWidth,a.lineWidth),s=Pi(n.color,a.color),l=Fi(i);e.save(),e.lineWidth=r,e.strokeStyle=s,e.setLineDash&&(e.setLineDash(Ai([n.borderDash,a.borderDash,[]])),e.lineDashOffset=Ai([n.borderDashOffset,a.borderDashOffset,0]));var d=t.getDistanceFromCenterForValue(i.ticks.reverse?t.min:t.max),u=ut.options._parseFont(o);e.font=u.string,e.textBaseline="middle";for(var h=Ti(t)-1;h>=0;h--){if(n.display&&r&&s){var c=t.getPointPosition(h,d);e.beginPath(),e.moveTo(t.xCenter,t.yCenter),e.lineTo(c.x,c.y),e.stroke()}if(o.display){var f=0===h?l/2:0,g=t.getPointPosition(h,d+f+5),p=Ii(o.fontColor,h,st.global.defaultFontColor);e.fillStyle=p;var m=t.getIndexAngle(h),v=ut.toDegrees(m);e.textAlign=Ri(v),zi(v,t._pointLabelSizes[h],g),Oi(e,t.pointLabels[h]||"",g,u.lineHeight)}}e.restore()}(t),ut.each(t.ticks,function(e,s){if(s>0||n.reverse){var l=t.getDistanceFromCenterForValue(t.ticksAsNumbers[s]);if(i.display&&0!==s&&function(t,e,i,n){var a,o=t.ctx,r=e.circular,s=Ti(t),l=Ii(e.color,n-1),d=Ii(e.lineWidth,n-1);if((r||s)&&l&&d){if(o.save(),o.strokeStyle=l,o.lineWidth=d,o.setLineDash&&(o.setLineDash(e.borderDash||[]),o.lineDashOffset=e.borderDashOffset||0),o.beginPath(),r)o.arc(t.xCenter,t.yCenter,i,0,2*Math.PI);else{a=t.getPointPosition(0,i),o.moveTo(a.x,a.y);for(var u=1;u<s;u++)a=t.getPointPosition(u,i),o.lineTo(a.x,a.y)}o.closePath(),o.stroke(),o.restore()}}(t,i,l,s),n.display){var d=Pi(n.fontColor,st.global.defaultFontColor);if(a.font=r.string,a.save(),a.translate(t.xCenter,t.yCenter),a.rotate(o),n.showLabelBackdrop){var u=a.measureText(e).width;a.fillStyle=n.backdropColor,a.fillRect(-u/2-n.backdropPaddingX,-l-r.size/2-n.backdropPaddingY,u+2*n.backdropPaddingX,r.size+2*n.backdropPaddingY)}a.textAlign="center",a.textBaseline="middle",a.fillStyle=d,a.fillText(e,0,-l),a.restore()}}})}}}),Wi=Di;Ni._defaults=Wi;var Vi=ut.valueOrDefault,Ei=Number.MIN_SAFE_INTEGER||-9007199254740991,Hi=Number.MAX_SAFE_INTEGER||9007199254740991,ji={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,15,30]},minute:{common:!0,size:6e4,steps:[1,2,5,10,15,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}},qi=Object.keys(ji);function Yi(t,e){return t-e}function Ui(t){var e,i,n,a={},o=[];for(e=0,i=t.length;e<i;++e)a[n=t[e]]||(a[n]=!0,o.push(n));return o}function Xi(t,e,i,n){var a=function(t,e,i){for(var n,a,o,r=0,s=t.length-1;r>=0&&r<=s;){if(a=t[(n=r+s>>1)-1]||null,o=t[n],!a)return{lo:null,hi:o};if(o[e]<i)r=n+1;else{if(!(a[e]>i))return{lo:a,hi:o};s=n-1}}return{lo:o,hi:null}}(t,e,i),o=a.lo?a.hi?a.lo:t[t.length-2]:t[0],r=a.lo?a.hi?a.hi:t[t.length-1]:t[1],s=r[e]-o[e],l=s?(i-o[e])/s:0,d=(r[n]-o[n])*l;return o[n]+d}function Ki(t,e){var i=t._adapter,n=t.options.time,a=n.parser,o=a||n.format,r=e;return"function"==typeof a&&(r=a(r)),ut.isFinite(r)||(r="string"==typeof o?i.parse(r,o):i.parse(r)),null!==r?+r:(a||"function"!=typeof o||(r=o(e),ut.isFinite(r)||(r=i.parse(r))),r)}function Gi(t,e){if(ut.isNullOrUndef(e))return null;var i=t.options.time,n=Ki(t,t.getRightValue(e));return null===n?n:(i.round&&(n=+t._adapter.startOf(n,i.round)),n)}function Zi(t){for(var e=qi.indexOf(t)+1,i=qi.length;e<i;++e)if(ji[qi[e]].common)return qi[e]}function $i(t,e,i,n){var a,o=t._adapter,r=t.options,s=r.time,l=s.unit||function(t,e,i,n){var a,o,r,s=qi.length;for(a=qi.indexOf(t);a<s-1;++a)if(r=(o=ji[qi[a]]).steps?o.steps[o.steps.length-1]:Hi,o.common&&Math.ceil((i-e)/(r*o.size))<=n)return qi[a];return qi[s-1]}(s.minUnit,e,i,n),d=Zi(l),u=Vi(s.stepSize,s.unitStepSize),h="week"===l&&s.isoWeekday,c=r.ticks.major.enabled,f=ji[l],g=e,p=i,m=[];for(u||(u=function(t,e,i,n){var a,o,r,s=e-t,l=ji[i],d=l.size,u=l.steps;if(!u)return Math.ceil(s/(n*d));for(a=0,o=u.length;a<o&&(r=u[a],!(Math.ceil(s/(d*r))<=n));++a);return r}(e,i,l,n)),h&&(g=+o.startOf(g,"isoWeek",h),p=+o.startOf(p,"isoWeek",h)),g=+o.startOf(g,h?"day":l),(p=+o.startOf(p,h?"day":l))<i&&(p=+o.add(p,1,l)),a=g,c&&d&&!h&&!s.round&&(a=+o.startOf(a,d),a=+o.add(a,~~((g-a)/(f.size*u))*u,l));a<p;a=+o.add(a,u,l))m.push(+a);return m.push(+a),m}var Ji=fi.extend({initialize:function(){this.mergeTicksOptions(),fi.prototype.initialize.call(this)},update:function(){var t=this.options,e=t.time||(t.time={}),i=this._adapter=new si._date(t.adapters.date);return e.format&&console.warn("options.time.format is deprecated and replaced by options.time.parser."),ut.mergeIf(e.displayFormats,i.formats()),fi.prototype.update.apply(this,arguments)},getRightValue:function(t){return t&&void 0!==t.t&&(t=t.t),fi.prototype.getRightValue.call(this,t)},determineDataLimits:function(){var t,e,i,n,a,o,r=this,s=r.chart,l=r._adapter,d=r.options.time,u=d.unit||"day",h=Hi,c=Ei,f=[],g=[],p=[],m=s.data.labels||[];for(t=0,i=m.length;t<i;++t)p.push(Gi(r,m[t]));for(t=0,i=(s.data.datasets||[]).length;t<i;++t)if(s.isDatasetVisible(t))if(a=s.data.datasets[t].data,ut.isObject(a[0]))for(g[t]=[],e=0,n=a.length;e<n;++e)o=Gi(r,a[e]),f.push(o),g[t][e]=o;else{for(e=0,n=p.length;e<n;++e)f.push(p[e]);g[t]=p.slice(0)}else g[t]=[];p.length&&(p=Ui(p).sort(Yi),h=Math.min(h,p[0]),c=Math.max(c,p[p.length-1])),f.length&&(f=Ui(f).sort(Yi),h=Math.min(h,f[0]),c=Math.max(c,f[f.length-1])),h=Gi(r,d.min)||h,c=Gi(r,d.max)||c,h=h===Hi?+l.startOf(Date.now(),u):h,c=c===Ei?+l.endOf(Date.now(),u)+1:c,r.min=Math.min(h,c),r.max=Math.max(h+1,c),r._horizontal=r.isHorizontal(),r._table=[],r._timestamps={data:f,datasets:g,labels:p}},buildTicks:function(){var t,e,i,n=this,a=n.min,o=n.max,r=n.options,s=r.time,l=[],d=[];switch(r.ticks.source){case"data":l=n._timestamps.data;break;case"labels":l=n._timestamps.labels;break;case"auto":default:l=$i(n,a,o,n.getLabelCapacity(a))}for("ticks"===r.bounds&&l.length&&(a=l[0],o=l[l.length-1]),a=Gi(n,s.min)||a,o=Gi(n,s.max)||o,t=0,e=l.length;t<e;++t)(i=l[t])>=a&&i<=o&&d.push(i);return n.min=a,n.max=o,n._unit=s.unit||function(t,e,i,n,a){var o,r;for(o=qi.length-1;o>=qi.indexOf(i);o--)if(r=qi[o],ji[r].common&&t._adapter.diff(a,n,r)>=e.length)return r;return qi[i?qi.indexOf(i):0]}(n,d,s.minUnit,n.min,n.max),n._majorUnit=Zi(n._unit),n._table=function(t,e,i,n){if("linear"===n||!t.length)return[{time:e,pos:0},{time:i,pos:1}];var a,o,r,s,l,d=[],u=[e];for(a=0,o=t.length;a<o;++a)(s=t[a])>e&&s<i&&u.push(s);for(u.push(i),a=0,o=u.length;a<o;++a)l=u[a+1],r=u[a-1],s=u[a],void 0!==r&&void 0!==l&&Math.round((l+r)/2)===s||d.push({time:s,pos:a/(o-1)});return d}(n._timestamps.data,a,o,r.distribution),n._offsets=function(t,e,i,n,a){var o,r,s=0,l=0;return a.offset&&e.length&&(a.time.min||(o=Xi(t,"time",e[0],"pos"),s=1===e.length?1-o:(Xi(t,"time",e[1],"pos")-o)/2),a.time.max||(r=Xi(t,"time",e[e.length-1],"pos"),l=1===e.length?r:(r-Xi(t,"time",e[e.length-2],"pos"))/2)),{start:s,end:l}}(n._table,d,0,0,r),r.ticks.reverse&&d.reverse(),function(t,e,i){var n,a,o,r,s=[];for(n=0,a=e.length;n<a;++n)o=e[n],r=!!i&&o===+t._adapter.startOf(o,i),s.push({value:o,major:r});return s}(n,d,n._majorUnit)},getLabelForIndex:function(t,e){var i=this,n=i._adapter,a=i.chart.data,o=i.options.time,r=a.labels&&t<a.labels.length?a.labels[t]:"",s=a.datasets[e].data[t];return ut.isObject(s)&&(r=i.getRightValue(s)),o.tooltipFormat?n.format(Ki(i,r),o.tooltipFormat):"string"==typeof r?r:n.format(Ki(i,r),o.displayFormats.datetime)},tickFormatFunction:function(t,e,i,n){var a=this._adapter,o=this.options,r=o.time.displayFormats,s=r[this._unit],l=this._majorUnit,d=r[l],u=+a.startOf(t,l),h=o.ticks.major,c=h.enabled&&l&&d&&t===u,f=a.format(t,n||(c?d:s)),g=c?h:o.ticks.minor,p=Vi(g.callback,g.userCallback);return p?p(f,e,i):f},convertTicksToLabels:function(t){var e,i,n=[];for(e=0,i=t.length;e<i;++e)n.push(this.tickFormatFunction(t[e].value,e,t));return n},getPixelForOffset:function(t){var e=this,i=e.options.ticks.reverse,n=e._horizontal?e.width:e.height,a=e._horizontal?i?e.right:e.left:i?e.bottom:e.top,o=Xi(e._table,"time",t,"pos"),r=n*(e._offsets.start+o)/(e._offsets.start+1+e._offsets.end);return i?a-r:a+r},getPixelForValue:function(t,e,i){var n=null;if(void 0!==e&&void 0!==i&&(n=this._timestamps.datasets[i][e]),null===n&&(n=Gi(this,t)),null!==n)return this.getPixelForOffset(n)},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,i=e._horizontal?e.width:e.height,n=e._horizontal?e.left:e.top,a=(i?(t-n)/i:0)*(e._offsets.start+1+e._offsets.start)-e._offsets.end,o=Xi(e._table,"pos",a,"time");return e._adapter._create(o)},getLabelWidth:function(t){var e=this.options.ticks,i=this.ctx.measureText(t).width,n=ut.toRadians(e.maxRotation),a=Math.cos(n),o=Math.sin(n);return i*a+Vi(e.fontSize,st.global.defaultFontSize)*o},getLabelCapacity:function(t){var e=this,i=e.options.time.displayFormats.millisecond,n=e.tickFormatFunction(t,0,[],i),a=e.getLabelWidth(n),o=e.isHorizontal()?e.width:e.height,r=Math.floor(o/a);return r>0?r:1}}),Qi={position:"bottom",distribution:"linear",bounds:"data",adapters:{},time:{parser:!1,format:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}};Ji._defaults=Qi;var tn={category:gi,linear:yi,logarithmic:Ci,radialLinear:Ni,time:Ji},en={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};si._date.override("function"==typeof t?{_id:"moment",formats:function(){return en},parse:function(e,i){return"string"==typeof e&&"string"==typeof i?e=t(e,i):e instanceof t||(e=t(e)),e.isValid()?e.valueOf():null},format:function(e,i){return t(e).format(i)},add:function(e,i,n){return t(e).add(i,n).valueOf()},diff:function(e,i,n){return t.duration(t(e).diff(t(i))).as(n)},startOf:function(e,i,n){return e=t(e),"isoWeek"===i?e.isoWeekday(n).valueOf():e.startOf(i).valueOf()},endOf:function(e,i){return t(e).endOf(i).valueOf()},_create:function(e){return t(e)}}:{}),st._set("global",{plugins:{filler:{propagate:!0}}});var nn={dataset:function(t){var e=t.fill,i=t.chart,n=i.getDatasetMeta(e),a=n&&i.isDatasetVisible(e)&&n.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,i=e?e.x:null,n=e?e.y:null;return function(t){return{x:null===i?t.x:i,y:null===n?t.y:n}}}};function an(t,e,i){var n,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(n=parseFloat(o,10),isFinite(n)&&Math.floor(n)===n)return"-"!==o[0]&&"+"!==o[0]||(n=e+n),!(n===e||n<0||n>=i)&&n;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 on(t){var e,i=t.el._model||{},n=t.el._scale||{},a=t.fill,o=null;if(isFinite(a))return null;if("start"===a?o=void 0===i.scaleBottom?n.bottom:i.scaleBottom:"end"===a?o=void 0===i.scaleTop?n.top:i.scaleTop:void 0!==i.scaleZero?o=i.scaleZero:n.getBasePosition?o=n.getBasePosition():n.getBasePixel&&(o=n.getBasePixel()),null!=o){if(void 0!==o.x&&void 0!==o.y)return o;if(ut.isFinite(o))return{x:(e=n.isHorizontal())?o:null,y:e?null:o}}return null}function rn(t,e,i){var n,a=t[e].fill,o=[e];if(!i)return a;for(;!1!==a&&-1===o.indexOf(a);){if(!isFinite(a))return a;if(!(n=t[a]))return!1;if(n.visible)return a;o.push(a),a=n.fill}return!1}function sn(t){var e=t.fill,i="dataset";return!1===e?null:(isFinite(e)||(i="boundary"),nn[i](t))}function ln(t){return t&&!t.skip}function dn(t,e,i,n,a){var o;if(n&&a){for(t.moveTo(e[0].x,e[0].y),o=1;o<n;++o)ut.canvas.lineTo(t,e[o-1],e[o]);for(t.lineTo(i[a-1].x,i[a-1].y),o=a-1;o>0;--o)ut.canvas.lineTo(t,i[o],i[o-1],!0)}}var un={id:"filler",afterDatasetsUpdate:function(t,e){var i,n,a,o,r=(t.data.datasets||[]).length,s=e.propagate,l=[];for(n=0;n<r;++n)o=null,(a=(i=t.getDatasetMeta(n)).dataset)&&a._model&&a instanceof Wt.Line&&(o={visible:t.isDatasetVisible(n),fill:an(a,n,r),chart:t,el:a}),i.$filler=o,l.push(o);for(n=0;n<r;++n)(o=l[n])&&(o.fill=rn(l,n,s),o.boundary=on(o),o.mapper=sn(o))},beforeDatasetDraw:function(t,e){var i=e.meta.$filler;if(i){var n=t.ctx,a=i.el,o=a._view,r=a._children||[],s=i.mapper,l=o.backgroundColor||st.global.defaultColor;s&&l&&r.length&&(ut.canvas.clipArea(n,t.chartArea),function(t,e,i,n,a,o){var r,s,l,d,u,h,c,f=e.length,g=n.spanGaps,p=[],m=[],v=0,b=0;for(t.beginPath(),r=0,s=f+!!o;r<s;++r)u=i(d=e[l=r%f]._view,l,n),h=ln(d),c=ln(u),h&&c?(v=p.push(d),b=m.push(u)):v&&b&&(g?(h&&p.push(d),c&&m.push(u)):(dn(t,p,m,v,b),v=b=0,p=[],m=[]));dn(t,p,m,v,b),t.closePath(),t.fillStyle=a,t.fill()}(n,r,s,o,l,a._loop),ut.canvas.unclipArea(n))}}},hn=ut.noop,cn=ut.valueOrDefault;function fn(t,e){return t.usePointStyle&&t.boxWidth>e?e:t.boxWidth}st._set("global",{legend:{display:!0,position:"top",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(t,e){var i=e.datasetIndex,n=this.chart,a=n.getDatasetMeta(i);a.hidden=null===a.hidden?!n.data.datasets[i].hidden:null,n.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(t){var e=t.data;return ut.isArray(e.datasets)?e.datasets.map(function(e,i){return{text:e.label,fillStyle:ut.isArray(e.backgroundColor)?e.backgroundColor[0]:e.backgroundColor,hidden:!t.isDatasetVisible(i),lineCap:e.borderCapStyle,lineDash:e.borderDash,lineDashOffset:e.borderDashOffset,lineJoin:e.borderJoinStyle,lineWidth:e.borderWidth,strokeStyle:e.borderColor,pointStyle:e.pointStyle,datasetIndex:i}},this):[]}}},legendCallback:function(t){var e=[];e.push('<ul class="'+t.id+'-legend">');for(var i=0;i<t.data.datasets.length;i++)e.push('<li><span style="background-color:'+t.data.datasets[i].backgroundColor+'"></span>'),t.data.datasets[i].label&&e.push(t.data.datasets[i].label),e.push("</li>");return e.push("</ul>"),e.join("")}});var gn=pt.extend({initialize:function(t){ut.extend(this,t),this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1},beforeUpdate:hn,update:function(t,e,i){var n=this;return n.beforeUpdate(),n.maxWidth=t,n.maxHeight=e,n.margins=i,n.beforeSetDimensions(),n.setDimensions(),n.afterSetDimensions(),n.beforeBuildLabels(),n.buildLabels(),n.afterBuildLabels(),n.beforeFit(),n.fit(),n.afterFit(),n.afterUpdate(),n.minSize},afterUpdate:hn,beforeSetDimensions:hn,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:hn,beforeBuildLabels:hn,buildLabels:function(){var t=this,e=t.options.labels||{},i=ut.callback(e.generateLabels,[t.chart],t)||[];e.filter&&(i=i.filter(function(i){return e.filter(i,t.chart.data)})),t.options.reverse&&i.reverse(),t.legendItems=i},afterBuildLabels:hn,beforeFit:hn,fit:function(){var t=this,e=t.options,i=e.labels,n=e.display,a=t.ctx,o=ut.options._parseFont(i),r=o.size,s=t.legendHitBoxes=[],l=t.minSize,d=t.isHorizontal();if(d?(l.width=t.maxWidth,l.height=n?10:0):(l.width=n?10:0,l.height=t.maxHeight),n)if(a.font=o.string,d){var u=t.lineWidths=[0],h=0;a.textAlign="left",a.textBaseline="top",ut.each(t.legendItems,function(t,e){var n=fn(i,r)+r/2+a.measureText(t.text).width;(0===e||u[u.length-1]+n+i.padding>l.width)&&(h+=r+i.padding,u[u.length-(e>0?0:1)]=i.padding),s[e]={left:0,top:0,width:n,height:r},u[u.length-1]+=n+i.padding}),l.height+=h}else{var c=i.padding,f=t.columnWidths=[],g=i.padding,p=0,m=0,v=r+c;ut.each(t.legendItems,function(t,e){var n=fn(i,r)+r/2+a.measureText(t.text).width;e>0&&m+v>l.height-c&&(g+=p+i.padding,f.push(p),p=0,m=0),p=Math.max(p,n),m+=v,s[e]={left:0,top:0,width:n,height:r}}),g+=p,f.push(p),l.width+=g}t.width=l.width,t.height=l.height},afterFit:hn,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var t=this,e=t.options,i=e.labels,n=st.global,a=n.defaultColor,o=n.elements.line,r=t.width,s=t.lineWidths;if(e.display){var l,d=t.ctx,u=cn(i.fontColor,n.defaultFontColor),h=ut.options._parseFont(i),c=h.size;d.textAlign="left",d.textBaseline="middle",d.lineWidth=.5,d.strokeStyle=u,d.fillStyle=u,d.font=h.string;var f=fn(i,c),g=t.legendHitBoxes,p=t.isHorizontal();l=p?{x:t.left+(r-s[0])/2+i.padding,y:t.top+i.padding,line:0}:{x:t.left+i.padding,y:t.top+i.padding,line:0};var m=c+i.padding;ut.each(t.legendItems,function(n,u){var h=d.measureText(n.text).width,v=f+c/2+h,b=l.x,x=l.y;p?u>0&&b+v+i.padding>t.left+t.minSize.width&&(x=l.y+=m,l.line++,b=l.x=t.left+(r-s[l.line])/2+i.padding):u>0&&x+m>t.top+t.minSize.height&&(b=l.x=b+t.columnWidths[l.line]+i.padding,x=l.y=t.top+i.padding,l.line++),function(t,i,n){if(!(isNaN(f)||f<=0)){d.save();var r=cn(n.lineWidth,o.borderWidth);if(d.fillStyle=cn(n.fillStyle,a),d.lineCap=cn(n.lineCap,o.borderCapStyle),d.lineDashOffset=cn(n.lineDashOffset,o.borderDashOffset),d.lineJoin=cn(n.lineJoin,o.borderJoinStyle),d.lineWidth=r,d.strokeStyle=cn(n.strokeStyle,a),d.setLineDash&&d.setLineDash(cn(n.lineDash,o.borderDash)),e.labels&&e.labels.usePointStyle){var s=f*Math.SQRT2/2,l=t+f/2,u=i+c/2;ut.canvas.drawPoint(d,n.pointStyle,s,l,u)}else 0!==r&&d.strokeRect(t,i,f,c),d.fillRect(t,i,f,c);d.restore()}}(b,x,n),g[u].left=b,g[u].top=x,function(t,e,i,n){var a=c/2,o=f+a+t,r=e+a;d.fillText(i.text,o,r),i.hidden&&(d.beginPath(),d.lineWidth=2,d.moveTo(o,r),d.lineTo(o+n,r),d.stroke())}(b,x,n,h),p?l.x+=v+i.padding:l.y+=m})}},_getLegendItemAt:function(t,e){var i,n,a,o=this;if(t>=o.left&&t<=o.right&&e>=o.top&&e<=o.bottom)for(a=o.legendHitBoxes,i=0;i<a.length;++i)if(t>=(n=a[i]).left&&t<=n.left+n.width&&e>=n.top&&e<=n.top+n.height)return o.legendItems[i];return null},handleEvent:function(t){var e,i=this,n=i.options,a="mouseup"===t.type?"click":t.type;if("mousemove"===a){if(!n.onHover&&!n.onLeave)return}else{if("click"!==a)return;if(!n.onClick)return}e=i._getLegendItemAt(t.x,t.y),"click"===a?e&&n.onClick&&n.onClick.call(i,t.native,e):(n.onLeave&&e!==i._hoveredItem&&(i._hoveredItem&&n.onLeave.call(i,t.native,i._hoveredItem),i._hoveredItem=e),n.onHover&&e&&n.onHover.call(i,t.native,e))}});function pn(t,e){var i=new gn({ctx:t.ctx,options:e,chart:t});ke.configure(t,i,e),ke.addBox(t,i),t.legend=i}var mn={id:"legend",_element:gn,beforeInit:function(t){var e=t.options.legend;e&&pn(t,e)},beforeUpdate:function(t){var e=t.options.legend,i=t.legend;e?(ut.mergeIf(e,st.global.legend),i?(ke.configure(t,i,e),i.options=e):pn(t,e)):i&&(ke.removeBox(t,i),delete t.legend)},afterEvent:function(t,e){var i=t.legend;i&&i.handleEvent(e)}},vn=ut.noop;st._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var bn=pt.extend({initialize:function(t){ut.extend(this,t),this.legendHitBoxes=[]},beforeUpdate:vn,update:function(t,e,i){var n=this;return n.beforeUpdate(),n.maxWidth=t,n.maxHeight=e,n.margins=i,n.beforeSetDimensions(),n.setDimensions(),n.afterSetDimensions(),n.beforeBuildLabels(),n.buildLabels(),n.afterBuildLabels(),n.beforeFit(),n.fit(),n.afterFit(),n.afterUpdate(),n.minSize},afterUpdate:vn,beforeSetDimensions:vn,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:vn,beforeBuildLabels:vn,buildLabels:vn,afterBuildLabels:vn,beforeFit:vn,fit:function(){var t=this,e=t.options,i=e.display,n=t.minSize,a=ut.isArray(e.text)?e.text.length:1,o=ut.options._parseFont(e),r=i?a*o.lineHeight+2*e.padding:0;t.isHorizontal()?(n.width=t.maxWidth,n.height=r):(n.width=r,n.height=t.maxHeight),t.width=n.width,t.height=n.height},afterFit:vn,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this,e=t.ctx,i=t.options;if(i.display){var n,a,o,r=ut.options._parseFont(i),s=r.lineHeight,l=s/2+i.padding,d=0,u=t.top,h=t.left,c=t.bottom,f=t.right;e.fillStyle=ut.valueOrDefault(i.fontColor,st.global.defaultFontColor),e.font=r.string,t.isHorizontal()?(a=h+(f-h)/2,o=u+l,n=f-h):(a="left"===i.position?h+l:f-l,o=u+(c-u)/2,n=c-u,d=Math.PI*("left"===i.position?-.5:.5)),e.save(),e.translate(a,o),e.rotate(d),e.textAlign="center",e.textBaseline="middle";var g=i.text;if(ut.isArray(g))for(var p=0,m=0;m<g.length;++m)e.fillText(g[m],0,p,n),p+=s;else e.fillText(g,0,0,n);e.restore()}}});function xn(t,e){var i=new bn({ctx:t.ctx,options:e,chart:t});ke.configure(t,i,e),ke.addBox(t,i),t.titleBlock=i}var yn={},kn=un,wn=mn,Mn={id:"title",_element:bn,beforeInit:function(t){var e=t.options.title;e&&xn(t,e)},beforeUpdate:function(t){var e=t.options.title,i=t.titleBlock;e?(ut.mergeIf(e,st.global.title),i?(ke.configure(t,i,e),i.options=e):xn(t,e)):i&&(ke.removeBox(t,i),delete t.titleBlock)}};for(var _n in yn.filler=kn,yn.legend=wn,yn.title=Mn,ai.helpers=ut,function(){function t(t,e,i){var n;return"string"==typeof t?(n=parseInt(t,10),-1!==t.indexOf("%")&&(n=n/100*e.parentNode[i])):n=t,n}function e(t){return null!=t&&"none"!==t}function i(i,n,a){var o=document.defaultView,r=ut._getParentNode(i),s=o.getComputedStyle(i)[n],l=o.getComputedStyle(r)[n],d=e(s),u=e(l),h=Number.POSITIVE_INFINITY;return d||u?Math.min(d?t(s,i,a):h,u?t(l,r,a):h):"none"}ut.where=function(t,e){if(ut.isArray(t)&&Array.prototype.filter)return t.filter(e);var i=[];return ut.each(t,function(t){e(t)&&i.push(t)}),i},ut.findIndex=Array.prototype.findIndex?function(t,e,i){return t.findIndex(e,i)}:function(t,e,i){i=void 0===i?t:i;for(var n=0,a=t.length;n<a;++n)if(e.call(i,t[n],n,t))return n;return-1},ut.findNextWhere=function(t,e,i){ut.isNullOrUndef(i)&&(i=-1);for(var n=i+1;n<t.length;n++){var a=t[n];if(e(a))return a}},ut.findPreviousWhere=function(t,e,i){ut.isNullOrUndef(i)&&(i=t.length);for(var n=i-1;n>=0;n--){var a=t[n];if(e(a))return a}},ut.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},ut.almostEquals=function(t,e,i){return Math.abs(t-e)<i},ut.almostWhole=function(t,e){var i=Math.round(t);return i-e<t&&i+e>t},ut.max=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.max(t,e)},Number.NEGATIVE_INFINITY)},ut.min=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.min(t,e)},Number.POSITIVE_INFINITY)},ut.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return 0==(t=+t)||isNaN(t)?t:t>0?1:-1},ut.log10=Math.log10?function(t){return Math.log10(t)}:function(t){var e=Math.log(t)*Math.LOG10E,i=Math.round(e);return t===Math.pow(10,i)?i:e},ut.toRadians=function(t){return t*(Math.PI/180)},ut.toDegrees=function(t){return t*(180/Math.PI)},ut._decimalPlaces=function(t){if(ut.isFinite(t)){for(var e=1,i=0;Math.round(t*e)/e!==t;)e*=10,i++;return i}},ut.getAngleFromPoint=function(t,e){var i=e.x-t.x,n=e.y-t.y,a=Math.sqrt(i*i+n*n),o=Math.atan2(n,i);return o<-.5*Math.PI&&(o+=2*Math.PI),{angle:o,distance:a}},ut.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},ut.aliasPixel=function(t){return t%2==0?0:.5},ut._alignPixel=function(t,e,i){var n=t.currentDevicePixelRatio,a=i/2;return Math.round((e-a)*n)/n+a},ut.splineCurve=function(t,e,i,n){var a=t.skip?e:t,o=e,r=i.skip?e:i,s=Math.sqrt(Math.pow(o.x-a.x,2)+Math.pow(o.y-a.y,2)),l=Math.sqrt(Math.pow(r.x-o.x,2)+Math.pow(r.y-o.y,2)),d=s/(s+l),u=l/(s+l),h=n*(d=isNaN(d)?0:d),c=n*(u=isNaN(u)?0:u);return{previous:{x:o.x-h*(r.x-a.x),y:o.y-h*(r.y-a.y)},next:{x:o.x+c*(r.x-a.x),y:o.y+c*(r.y-a.y)}}},ut.EPSILON=Number.EPSILON||1e-14,ut.splineCurveMonotone=function(t){var e,i,n,a,o,r,s,l,d,u=(t||[]).map(function(t){return{model:t._model,deltaK:0,mK:0}}),h=u.length;for(e=0;e<h;++e)if(!(n=u[e]).model.skip){if(i=e>0?u[e-1]:null,(a=e<h-1?u[e+1]:null)&&!a.model.skip){var c=a.model.x-n.model.x;n.deltaK=0!==c?(a.model.y-n.model.y)/c:0}!i||i.model.skip?n.mK=n.deltaK:!a||a.model.skip?n.mK=i.deltaK:this.sign(i.deltaK)!==this.sign(n.deltaK)?n.mK=0:n.mK=(i.deltaK+n.deltaK)/2}for(e=0;e<h-1;++e)n=u[e],a=u[e+1],n.model.skip||a.model.skip||(ut.almostEquals(n.deltaK,0,this.EPSILON)?n.mK=a.mK=0:(o=n.mK/n.deltaK,r=a.mK/n.deltaK,(l=Math.pow(o,2)+Math.pow(r,2))<=9||(s=3/Math.sqrt(l),n.mK=o*s*n.deltaK,a.mK=r*s*n.deltaK)));for(e=0;e<h;++e)(n=u[e]).model.skip||(i=e>0?u[e-1]:null,a=e<h-1?u[e+1]:null,i&&!i.model.skip&&(d=(n.model.x-i.model.x)/3,n.model.controlPointPreviousX=n.model.x-d,n.model.controlPointPreviousY=n.model.y-d*n.mK),a&&!a.model.skip&&(d=(a.model.x-n.model.x)/3,n.model.controlPointNextX=n.model.x+d,n.model.controlPointNextY=n.model.y+d*n.mK))},ut.nextItem=function(t,e,i){return i?e>=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},ut.previousItem=function(t,e,i){return i?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},ut.niceNum=function(t,e){var i=Math.floor(ut.log10(t)),n=t/Math.pow(10,i);return(e?n<1.5?1:n<3?2:n<7?5:10:n<=1?1:n<=2?2:n<=5?5:10)*Math.pow(10,i)},ut.requestAnimFrame="undefined"==typeof window?function(t){t()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msReques
4
  * (c) 2019 Chart.js Contributors
5
  * Released under the MIT License
6
  */
7
+
8
+ /*
9
+ This is NOT the min.js available as part of CDN. This is a custom, patched version, by
10
+ 1. taking https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.js
11
+ 2. Patching as per https://github.com/chartjs/Chart.js/issues/3168#issuecomment-376572696
12
+ 3. Minimizing it
13
+
14
+ So do NOT just replace the min.js of a later version without verifying that the patch is in place. It was still buggy in 2.9.3 (This message updated on 8 Jan 2020).
15
+ */
16
  !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(function(){try{return require("moment")}catch(t){}}()):"function"==typeof define&&define.amd?define(["require"],function(t){return e(function(){try{return t("moment")}catch(t){}}())}):t.Chart=e(t.moment)}(this,function(t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var e={rgb2hsl:i,rgb2hsv:n,rgb2hwb:a,rgb2cmyk:o,rgb2keyword:s,rgb2xyz:l,rgb2lab:d,rgb2lch:function(t){return x(d(t))},hsl2rgb:u,hsl2hsv:function(t){var e=t[0],i=t[1]/100,n=t[2]/100;if(0===n)return[0,0,0];return[e,100*(2*(i*=(n*=2)<=1?n:2-n)/(n+i)),100*((n+i)/2)]},hsl2hwb:function(t){return a(u(t))},hsl2cmyk:function(t){return o(u(t))},hsl2keyword:function(t){return s(u(t))},hsv2rgb:h,hsv2hsl:function(t){var e,i,n=t[0],a=t[1]/100,o=t[2]/100;return e=a*o,[n,100*(e=(e/=(i=(2-a)*o)<=1?i:2-i)||0),100*(i/=2)]},hsv2hwb:function(t){return a(h(t))},hsv2cmyk:function(t){return o(h(t))},hsv2keyword:function(t){return s(h(t))},hwb2rgb:c,hwb2hsl:function(t){return i(c(t))},hwb2hsv:function(t){return n(c(t))},hwb2cmyk:function(t){return o(c(t))},hwb2keyword:function(t){return s(c(t))},cmyk2rgb:f,cmyk2hsl:function(t){return i(f(t))},cmyk2hsv:function(t){return n(f(t))},cmyk2hwb:function(t){return a(f(t))},cmyk2keyword:function(t){return s(f(t))},keyword2rgb:w,keyword2hsl:function(t){return i(w(t))},keyword2hsv:function(t){return n(w(t))},keyword2hwb:function(t){return a(w(t))},keyword2cmyk:function(t){return o(w(t))},keyword2lab:function(t){return d(w(t))},keyword2xyz:function(t){return l(w(t))},xyz2rgb:p,xyz2lab:m,xyz2lch:function(t){return x(m(t))},lab2xyz:v,lab2rgb:y,lab2lch:x,lch2lab:k,lch2xyz:function(t){return v(k(t))},lch2rgb:function(t){return y(k(t))}};function i(t){var e,i,n=t[0]/255,a=t[1]/255,o=t[2]/255,r=Math.min(n,a,o),s=Math.max(n,a,o),l=s-r;return s==r?e=0:n==s?e=(a-o)/l:a==s?e=2+(o-n)/l:o==s&&(e=4+(n-a)/l),(e=Math.min(60*e,360))<0&&(e+=360),i=(r+s)/2,[e,100*(s==r?0:i<=.5?l/(s+r):l/(2-s-r)),100*i]}function n(t){var e,i,n=t[0],a=t[1],o=t[2],r=Math.min(n,a,o),s=Math.max(n,a,o),l=s-r;return i=0==s?0:l/s*1e3/10,s==r?e=0:n==s?e=(a-o)/l:a==s?e=2+(o-n)/l:o==s&&(e=4+(n-a)/l),(e=Math.min(60*e,360))<0&&(e+=360),[e,i,s/255*1e3/10]}function a(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 o(t){var e,i=t[0]/255,n=t[1]/255,a=t[2]/255;return[100*((1-i-(e=Math.min(1-i,1-n,1-a)))/(1-e)||0),100*((1-n-e)/(1-e)||0),100*((1-a-e)/(1-e)||0),100*e]}function s(t){return _[JSON.stringify(t)]}function l(t){var e=t[0]/255,i=t[1]/255,n=t[2]/255;return[100*(.4124*(e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)+.1805*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*e+.7152*i+.0722*n),100*(.0193*e+.1192*i+.9505*n)]}function d(t){var e=l(t),i=e[0],n=e[1],a=e[2];return n/=100,a/=108.883,i=(i/=95.047)>.008856?Math.pow(i,1/3):7.787*i+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(i-n),200*(n-(a=a>.008856?Math.pow(a,1/3):7.787*a+16/116))]}function u(t){var e,i,n,a,o,r=t[0]/360,s=t[1]/100,l=t[2]/100;if(0==s)return[o=255*l,o,o];e=2*l-(i=l<.5?l*(1+s):l+s-l*s),a=[0,0,0];for(var d=0;d<3;d++)(n=r+1/3*-(d-1))<0&&n++,n>1&&n--,o=6*n<1?e+6*(i-e)*n:2*n<1?i:3*n<2?e+(i-e)*(2/3-n)*6:e,a[d]=255*o;return a}function h(t){var e=t[0]/60,i=t[1]/100,n=t[2]/100,a=Math.floor(e)%6,o=e-Math.floor(e),r=255*n*(1-i),s=255*n*(1-i*o),l=255*n*(1-i*(1-o));n*=255;switch(a){case 0:return[n,l,r];case 1:return[s,n,r];case 2:return[r,n,l];case 3:return[r,s,n];case 4:return[l,r,n];case 5:return[n,r,s]}}function c(t){var e,i,n,a,o=t[0]/360,s=t[1]/100,l=t[2]/100,d=s+l;switch(d>1&&(s/=d,l/=d),n=6*o-(e=Math.floor(6*o)),0!=(1&e)&&(n=1-n),a=s+n*((i=1-l)-s),e){default:case 6:case 0:r=i,g=a,b=s;break;case 1:r=a,g=i,b=s;break;case 2:r=s,g=i,b=a;break;case 3:r=s,g=a,b=i;break;case 4:r=a,g=s,b=i;break;case 5:r=i,g=s,b=a}return[255*r,255*g,255*b]}function f(t){var e=t[0]/100,i=t[1]/100,n=t[2]/100,a=t[3]/100;return[255*(1-Math.min(1,e*(1-a)+a)),255*(1-Math.min(1,i*(1-a)+a)),255*(1-Math.min(1,n*(1-a)+a))]}function p(t){var e,i,n,a=t[0]/100,o=t[1]/100,r=t[2]/100;return i=-.9689*a+1.8758*o+.0415*r,n=.0557*a+-.204*o+1.057*r,e=(e=3.2406*a+-1.5372*o+-.4986*r)>.0031308?1.055*Math.pow(e,1/2.4)-.055:e*=12.92,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*=12.92,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n*=12.92,[255*(e=Math.min(Math.max(0,e),1)),255*(i=Math.min(Math.max(0,i),1)),255*(n=Math.min(Math.max(0,n),1))]}function m(t){var e=t[0],i=t[1],n=t[2];return i/=100,n/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116)-16,500*(e-i),200*(i-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]}function v(t){var e,i,n,a,o=t[0],r=t[1],s=t[2];return o<=8?a=(i=100*o/903.3)/100*7.787+16/116:(i=100*Math.pow((o+16)/116,3),a=Math.pow(i/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,n=n/108.883<=.008859?n=108.883*(a-s/200-16/116)/7.787:108.883*Math.pow(a-s/200,3)]}function x(t){var e,i=t[0],n=t[1],a=t[2];return(e=360*Math.atan2(a,n)/2/Math.PI)<0&&(e+=360),[i,Math.sqrt(n*n+a*a),e]}function y(t){return p(v(t))}function k(t){var e,i=t[0],n=t[1];return e=t[2]/360*2*Math.PI,[i,n*Math.cos(e),n*Math.sin(e)]}function w(t){return M[t]}var M={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]},_={};for(var C in M)_[JSON.stringify(M[C])]=C;var S=function(){return new T};for(var P in e){S[P+"Raw"]=function(t){return function(i){return"number"==typeof i&&(i=Array.prototype.slice.call(arguments)),e[t](i)}}(P);var I=/(\w+)2(\w+)/.exec(P),A=I[1],D=I[2];(S[A]=S[A]||{})[D]=S[P]=function(t){return function(i){"number"==typeof i&&(i=Array.prototype.slice.call(arguments));var n=e[t](i);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}}(P)}var T=function(){this.convs={}};T.prototype.routeSpace=function(t,e){var i=e[0];return void 0===i?this.getValues(t):("number"==typeof i&&(i=Array.prototype.slice.call(e)),this.setValues(t,i))},T.prototype.setValues=function(t,e){return this.space=t,this.convs={},this.convs[t]=e,this},T.prototype.getValues=function(t){var e=this.convs[t];if(!e){var i=this.space,n=this.convs[i];e=S[i][t](n),this.convs[t]=e}return e},["rgb","hsl","hsv","cmyk","keyword"].forEach(function(t){T.prototype[t]=function(e){return this.routeSpace(t,arguments)}});var F=S,L={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},R={getRgba:O,getHsla:z,getRgb:function(t){var e=O(t);return e&&e.slice(0,3)},getHsl:function(t){var e=z(t);return e&&e.slice(0,3)},getHwb:B,getAlpha:function(t){var e=O(t);if(e)return e[3];if(e=z(t))return e[3];if(e=B(t))return e[3]},hexString:function(t,e){var e=void 0!==e&&3===t.length?e:t[3];return"#"+H(t[0])+H(t[1])+H(t[2])+(e>=0&&e<1?H(Math.round(255*e)):"")},rgbString:function(t,e){if(e<1||t[3]&&t[3]<1)return N(t,e);return"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},rgbaString:N,percentString:function(t,e){if(e<1||t[3]&&t[3]<1)return W(t,e);var i=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),a=Math.round(t[2]/255*100);return"rgb("+i+"%, "+n+"%, "+a+"%)"},percentaString:W,hslString:function(t,e){if(e<1||t[3]&&t[3]<1)return V(t,e);return"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"},hslaString:V,hwbString:function(t,e){void 0===e&&(e=void 0!==t[3]?t[3]:1);return"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+(void 0!==e&&1!==e?", "+e:"")+")"},keyword:function(t){return j[t.slice(0,3)]}};function O(t){if(t){var e=[0,0,0],i=1,n=t.match(/^#([a-fA-F0-9]{3,4})$/i),a="";if(n){a=(n=n[1])[3];for(var o=0;o<e.length;o++)e[o]=parseInt(n[o]+n[o],16);a&&(i=Math.round(parseInt(a+a,16)/255*100)/100)}else if(n=t.match(/^#([a-fA-F0-9]{6}([a-fA-F0-9]{2})?)$/i)){a=n[2],n=n[1];for(o=0;o<e.length;o++)e[o]=parseInt(n.slice(2*o,2*o+2),16);a&&(i=Math.round(parseInt(a,16)/255*100)/100)}else if(n=t.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(o=0;o<e.length;o++)e[o]=parseInt(n[o+1]);i=parseFloat(n[4])}else if(n=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(o=0;o<e.length;o++)e[o]=Math.round(2.55*parseFloat(n[o+1]));i=parseFloat(n[4])}else if(n=t.match(/(\w+)/)){if("transparent"==n[1])return[0,0,0,0];if(!(e=L[n[1]]))return}for(o=0;o<e.length;o++)e[o]=E(e[o],0,255);return i=i||0==i?E(i,0,1):1,e[3]=i,e}}function z(t){if(t){var e=t.match(/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(e){var i=parseFloat(e[4]);return[E(parseInt(e[1]),0,360),E(parseFloat(e[2]),0,100),E(parseFloat(e[3]),0,100),E(isNaN(i)?1:i,0,1)]}}}function B(t){if(t){var e=t.match(/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(e){var i=parseFloat(e[4]);return[E(parseInt(e[1]),0,360),E(parseFloat(e[2]),0,100),E(parseFloat(e[3]),0,100),E(isNaN(i)?1:i,0,1)]}}}function N(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"rgba("+t[0]+", "+t[1]+", "+t[2]+", "+e+")"}function W(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 V(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+e+")"}function E(t,e,i){return Math.min(Math.max(e,t),i)}function H(t){var e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}var j={};for(var q in L)j[L[q]]=q;var Y=function(t){return t instanceof Y?t:this instanceof Y?(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},void("string"==typeof t?(e=R.getRgba(t))?this.setValues("rgb",e):(e=R.getHsla(t))?this.setValues("hsl",e):(e=R.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)))):new Y(t);var e};Y.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 R.hexString(this.values.rgb)},rgbString:function(){return R.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return R.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return R.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return R.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return R.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return R.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return R.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=[],i=0;i<t.length;i++){var n=t[i]/255;e[i]=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),i=t.luminosity();return e>i?(e+.05)/(i+.05):(i+.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,i=(e[0]+t)%360;return e[0]=i<0?360+i:i,this.setValues("hsl",e),this},mix:function(t,e){var i=t,n=void 0===e?.5:e,a=2*n-1,o=this.alpha()-i.alpha(),r=((a*o==-1?a:(a+o)/(1+a*o))+1)/2,s=1-r;return this.rgb(r*this.red()+s*i.red(),r*this.green()+s*i.green(),r*this.blue()+s*i.blue()).alpha(this.alpha()*n+i.alpha()*(1-n))},toJSON:function(){return this.rgb()},clone:function(){var t,e,i=new Y,n=this.values,a=i.values;for(var o in n)n.hasOwnProperty(o)&&(t=n[o],"[object Array]"===(e={}.toString.call(t))?a[o]=t.slice(0):"[object Number]"===e?a[o]=t:console.error("unexpected color value:",t));return i}},Y.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},Y.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},Y.prototype.getValues=function(t){for(var e=this.values,i={},n=0;n<t.length;n++)i[t.charAt(n)]=e[t][n];return 1!==e.alpha&&(i.a=e.alpha),i},Y.prototype.setValues=function(t,e){var i,n,a=this.values,o=this.spaces,r=this.maxes,s=1;if(this.valid=!0,"alpha"===t)s=e;else if(e.length)a[t]=e.slice(0,t.length),s=e[t.length];else if(void 0!==e[t.charAt(0)]){for(i=0;i<t.length;i++)a[t][i]=e[t.charAt(i)];s=e.a}else if(void 0!==e[o[t][0]]){var l=o[t];for(i=0;i<t.length;i++)a[t][i]=e[l[i]];s=e.alpha}if(a.alpha=Math.max(0,Math.min(1,void 0===s?a.alpha:s)),"alpha"===t)return!1;for(i=0;i<t.length;i++)n=Math.max(0,Math.min(r[t][i],a[t][i])),a[t][i]=Math.round(n);for(var d in o)d!==t&&(a[d]=F[t][d](a[t]));return!0},Y.prototype.setSpace=function(t,e){var i=e[0];return void 0===i?this.getValues(t):("number"==typeof i&&(i=Array.prototype.slice.call(e)),this.setValues(t,i),this)},Y.prototype.setChannel=function(t,e,i){var n=this.values[t];return void 0===i?n[e]:i===n[e]?this:(n[e]=i,this.setValues(t,n),this)},"undefined"!=typeof window&&(window.Chart=window.Chart||{},window.Chart.Color=Y,void 0===window.Color&&(window.Color=Y));var U,X=Y,K={noop:function(){},uid:(U=0,function(){return U++}),isNullOrUndef:function(t){return null==t},isArray:function(t){if(Array.isArray&&Array.isArray(t))return!0;var e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)},isObject:function(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)},isFinite:function(t){return("number"==typeof t||t instanceof Number)&&isFinite(t)},valueOrDefault:function(t,e){return void 0===t?e:t},valueAtIndexOrDefault:function(t,e,i){return K.valueOrDefault(K.isArray(t)?t[e]:t,i)},callback:function(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)},each:function(t,e,i,n){var a,o,r;if(K.isArray(t))if(o=t.length,n)for(a=o-1;a>=0;a--)e.call(i,t[a],a);else for(a=0;a<o;a++)e.call(i,t[a],a);else if(K.isObject(t))for(o=(r=Object.keys(t)).length,a=0;a<o;a++)e.call(i,t[r[a]],r[a])},arrayEquals:function(t,e){var i,n,a,o;if(!t||!e||t.length!==e.length)return!1;for(i=0,n=t.length;i<n;++i)if(a=t[i],o=e[i],a instanceof Array&&o instanceof Array){if(!K.arrayEquals(a,o))return!1}else if(a!==o)return!1;return!0},clone:function(t){if(K.isArray(t))return t.map(K.clone);if(K.isObject(t)){for(var e={},i=Object.keys(t),n=i.length,a=0;a<n;++a)e[i[a]]=K.clone(t[i[a]]);return e}return t},_merger:function(t,e,i,n){var a=e[t],o=i[t];K.isObject(a)&&K.isObject(o)?K.merge(a,o,n):e[t]=K.clone(o)},_mergerIf:function(t,e,i){var n=e[t],a=i[t];K.isObject(n)&&K.isObject(a)?K.mergeIf(n,a):e.hasOwnProperty(t)||(e[t]=K.clone(a))},merge:function(t,e,i){var n,a,o,r,s,l=K.isArray(e)?e:[e],d=l.length;if(!K.isObject(t))return t;for(n=(i=i||{}).merger||K._merger,a=0;a<d;++a)if(e=l[a],K.isObject(e))for(s=0,r=(o=Object.keys(e)).length;s<r;++s)n(o[s],t,e,i);return t},mergeIf:function(t,e){return K.merge(t,e,{merger:K._mergerIf})},extend:function(t){for(var e=function(e,i){t[i]=e},i=1,n=arguments.length;i<n;++i)K.each(arguments[i],e);return t},inherits:function(t){var e=this,i=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return e.apply(this,arguments)},n=function(){this.constructor=i};return n.prototype=e.prototype,i.prototype=new n,i.extend=K.inherits,t&&K.extend(i.prototype,t),i.__super__=e.prototype,i}},G=K;K.callCallback=K.callback,K.indexOf=function(t,e,i){return Array.prototype.indexOf.call(t,e,i)},K.getValueOrDefault=K.valueOrDefault,K.getValueAtIndexOrDefault=K.valueAtIndexOrDefault;var Z={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,i=0,n=1;return 0===t?0:1===t?1:(i||(i=.3),n<1?(n=1,e=i/4):e=i/(2*Math.PI)*Math.asin(1/n),-n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i))},easeOutElastic:function(t){var e=1.70158,i=0,n=1;return 0===t?0:1===t?1:(i||(i=.3),n<1?(n=1,e=i/4):e=i/(2*Math.PI)*Math.asin(1/n),n*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/i)+1)},easeInOutElastic:function(t){var e=1.70158,i=0,n=1;return 0===t?0:2==(t/=.5)?1:(i||(i=.45),n<1?(n=1,e=i/4):e=i/(2*Math.PI)*Math.asin(1/n),t<1?n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*-.5:n*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*.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-Z.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*Z.easeInBounce(2*t):.5*Z.easeOutBounce(2*t-1)+.5}},$={effects:Z};G.easingEffects=Z;var J=Math.PI,Q=J/180,tt=2*J,et=J/2,it=J/4,nt=2*J/3,at={clear:function(t){t.ctx.clearRect(0,0,t.width,t.height)},roundedRect:function(t,e,i,n,a,o){if(o){var r=Math.min(o,a/2,n/2),s=e+r,l=i+r,d=e+n-r,u=i+a-r;t.moveTo(e,l),s<d&&l<u?(t.arc(s,l,r,-J,-et),t.arc(d,l,r,-et,0),t.arc(d,u,r,0,et),t.arc(s,u,r,et,J)):s<d?(t.moveTo(s,i),t.arc(d,l,r,-et,et),t.arc(s,l,r,et,J+et)):l<u?(t.arc(s,l,r,-J,0),t.arc(s,u,r,0,J)):t.arc(s,l,r,-J,J),t.closePath(),t.moveTo(e,i)}else t.rect(e,i,n,a)},drawPoint:function(t,e,i,n,a,o){var r,s,l,d,u,h=(o||0)*Q;if(!e||"object"!=typeof e||"[object HTMLImageElement]"!==(r=e.toString())&&"[object HTMLCanvasElement]"!==r){if(!(isNaN(i)||i<=0)){switch(t.beginPath(),e){default:t.arc(n,a,i,0,tt),t.closePath();break;case"triangle":t.moveTo(n+Math.sin(h)*i,a-Math.cos(h)*i),h+=nt,t.lineTo(n+Math.sin(h)*i,a-Math.cos(h)*i),h+=nt,t.lineTo(n+Math.sin(h)*i,a-Math.cos(h)*i),t.closePath();break;case"rectRounded":d=i-(u=.516*i),s=Math.cos(h+it)*d,l=Math.sin(h+it)*d,t.arc(n-s,a-l,u,h-J,h-et),t.arc(n+l,a-s,u,h-et,h),t.arc(n+s,a+l,u,h,h+et),t.arc(n-l,a+s,u,h+et,h+J),t.closePath();break;case"rect":if(!o){d=Math.SQRT1_2*i,t.rect(n-d,a-d,2*d,2*d);break}h+=it;case"rectRot":s=Math.cos(h)*i,l=Math.sin(h)*i,t.moveTo(n-s,a-l),t.lineTo(n+l,a-s),t.lineTo(n+s,a+l),t.lineTo(n-l,a+s),t.closePath();break;case"crossRot":h+=it;case"cross":s=Math.cos(h)*i,l=Math.sin(h)*i,t.moveTo(n-s,a-l),t.lineTo(n+s,a+l),t.moveTo(n+l,a-s),t.lineTo(n-l,a+s);break;case"star":s=Math.cos(h)*i,l=Math.sin(h)*i,t.moveTo(n-s,a-l),t.lineTo(n+s,a+l),t.moveTo(n+l,a-s),t.lineTo(n-l,a+s),h+=it,s=Math.cos(h)*i,l=Math.sin(h)*i,t.moveTo(n-s,a-l),t.lineTo(n+s,a+l),t.moveTo(n+l,a-s),t.lineTo(n-l,a+s);break;case"line":s=Math.cos(h)*i,l=Math.sin(h)*i,t.moveTo(n-s,a-l),t.lineTo(n+s,a+l);break;case"dash":t.moveTo(n,a),t.lineTo(n+Math.cos(h)*i,a+Math.sin(h)*i)}t.fill(),t.stroke()}}else t.drawImage(e,n-e.width/2,a-e.height/2,e.width,e.height)},_isPointInArea:function(t,e){return t.x>e.left-1e-6&&t.x<e.right+1e-6&&t.y>e.top-1e-6&&t.y<e.bottom+1e-6},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,i,n){var a=i.steppedLine;if(a){if("middle"===a){var o=(e.x+i.x)/2;t.lineTo(o,n?i.y:e.y),t.lineTo(o,n?e.y:i.y)}else"after"===a&&!n||"after"!==a&&n?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}else i.tension?t.bezierCurveTo(n?e.controlPointPreviousX:e.controlPointNextX,n?e.controlPointPreviousY:e.controlPointNextY,n?i.controlPointNextX:i.controlPointPreviousX,n?i.controlPointNextY:i.controlPointPreviousY,i.x,i.y):t.lineTo(i.x,i.y)}},ot=at;G.clear=at.clear,G.drawRoundedRectangle=function(t){t.beginPath(),at.roundedRect.apply(at,arguments)};var rt={_set:function(t,e){return G.merge(this[t]||(this[t]={}),e)}};rt._set("global",{defaultColor:"rgba(0,0,0,0.1)",defaultFontColor:"#666",defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFontStyle:"normal",defaultLineHeight:1.2,showLines:!0});var st=rt,lt=G.valueOrDefault;var dt={toLineHeight:function(t,e){var i=(""+t).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t},toPadding:function(t){var e,i,n,a;return G.isObject(t)?(e=+t.top||0,i=+t.right||0,n=+t.bottom||0,a=+t.left||0):e=i=n=a=+t||0,{top:e,right:i,bottom:n,left:a,height:e+n,width:a+i}},_parseFont:function(t){var e=st.global,i=lt(t.fontSize,e.defaultFontSize),n={family:lt(t.fontFamily,e.defaultFontFamily),lineHeight:G.options.toLineHeight(lt(t.lineHeight,e.defaultLineHeight),i),size:i,style:lt(t.fontStyle,e.defaultFontStyle),weight:null,string:""};return n.string=function(t){return!t||G.isNullOrUndef(t.size)||G.isNullOrUndef(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(n),n},resolve:function(t,e,i){var n,a,o;for(n=0,a=t.length;n<a;++n)if(void 0!==(o=t[n])&&(void 0!==e&&"function"==typeof o&&(o=o(e)),void 0!==i&&G.isArray(o)&&(o=o[i]),void 0!==o))return o}},ut=G,ht=$,ct=ot,ft=dt;ut.easing=ht,ut.canvas=ct,ut.options=ft;var gt=function(t){ut.extend(this,t),this.initialize.apply(this,arguments)};ut.extend(gt.prototype,{initialize:function(){this.hidden=!1},pivot:function(){var t=this;return t._view||(t._view=ut.clone(t._model)),t._start={},t},transition:function(t){var e=this,i=e._model,n=e._start,a=e._view;return i&&1!==t?(a||(a=e._view={}),n||(n=e._start={}),function(t,e,i,n){var a,o,r,s,l,d,u,h,c,f=Object.keys(i);for(a=0,o=f.length;a<o;++a)if(d=i[r=f[a]],e.hasOwnProperty(r)||(e[r]=d),(s=e[r])!==d&&"_"!==r[0]){if(t.hasOwnProperty(r)||(t[r]=s),(u=typeof d)==typeof(l=t[r]))if("string"===u){if((h=X(l)).valid&&(c=X(d)).valid){e[r]=c.mix(h,n).rgbString();continue}}else if(ut.isFinite(l)&&ut.isFinite(d)){e[r]=l+(d-l)*n;continue}e[r]=d}}(n,a,i,t),e):(e._view=i,e._start=null,e)},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return ut.isNumber(this._model.x)&&ut.isNumber(this._model.y)}}),gt.extend=ut.inherits;var pt=gt,mt=pt.extend({chart:null,currentStep:0,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),vt=mt;Object.defineProperty(mt.prototype,"animationObject",{get:function(){return this}}),Object.defineProperty(mt.prototype,"chartInstance",{get:function(){return this.chart},set:function(t){this.chart=t}}),st._set("global",{animation:{duration:1e3,easing:"easeOutQuart",onProgress:ut.noop,onComplete:ut.noop}});var bt={animations:[],request:null,addAnimation:function(t,e,i,n){var a,o,r=this.animations;for(e.chart=t,e.startTime=Date.now(),e.duration=i,n||(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=ut.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=ut.requestAnimFrame.call(window,function(){t.request=null,t.startDigest()}))},startDigest:function(){this.advance(),this.animations.length>0&&this.requestAnimationFrame()},advance:function(){for(var t,e,i,n,a=this.animations,o=0;o<a.length;)e=(t=a[o]).chart,i=t.numSteps,n=Math.floor((Date.now()-t.startTime)/t.duration*i)+1,t.currentStep=Math.min(n,i),ut.callback(t.render,[e,t],e),ut.callback(t.onAnimationProgress,[t],e),t.currentStep>=i?(ut.callback(t.onAnimationComplete,[t],e),e.animating=!1,a.splice(o,1)):++o}},xt=ut.options.resolve,yt=["push","pop","shift","splice","unshift"];function kt(t,e){var i=t._chartjs;if(i){var n=i.listeners,a=n.indexOf(e);-1!==a&&n.splice(a,1),n.length>0||(yt.forEach(function(e){delete t[e]}),delete t._chartjs)}}var wt=function(t,e){this.initialize(t,e)};ut.extend(wt.prototype,{datasetElementType:null,dataElementType:null,initialize:function(t,e){this.chart=t,this.index=e,this.linkScales(),this.addElements()},updateIndex:function(t){this.index=t},linkScales:function(){var t=this,e=t.getMeta(),i=t.getDataset();null!==e.xAxisID&&e.xAxisID in t.chart.scales||(e.xAxisID=i.xAxisID||t.chart.options.scales.xAxes[0].id),null!==e.yAxisID&&e.yAxisID in t.chart.scales||(e.yAxisID=i.yAxisID||t.chart.options.scales.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(t){return this.chart.scales[t]},_getValueScaleId:function(){return this.getMeta().yAxisID},_getIndexScaleId:function(){return this.getMeta().xAxisID},_getValueScale:function(){return this.getScaleForId(this._getValueScaleId())},_getIndexScale:function(){return this.getScaleForId(this._getIndexScaleId())},reset:function(){this.update(!0)},destroy:function(){this._data&&kt(this._data,this)},createMetaDataset:function(){var t=this.datasetElementType;return t&&new t({_chart:this.chart,_datasetIndex:this.index})},createMetaData:function(t){var e=this.dataElementType;return e&&new e({_chart:this.chart,_datasetIndex:this.index,_index:t})},addElements:function(){var t,e,i=this.getMeta(),n=this.getDataset().data||[],a=i.data;for(t=0,e=n.length;t<e;++t)a[t]=a[t]||this.createMetaData(t);i.dataset=i.dataset||this.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,e,i=this,n=i.getDataset(),a=n.data||(n.data=[]);i._data!==a&&(i._data&&kt(i._data,i),a&&Object.isExtensible(a)&&(e=i,(t=a)._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),yt.forEach(function(e){var i="onData"+e.charAt(0).toUpperCase()+e.slice(1),n=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:function(){var e=Array.prototype.slice.call(arguments),a=n.apply(this,e);return ut.each(t._chartjs.listeners,function(t){"function"==typeof t[i]&&t[i].apply(t,e)}),a}})}))),i._data=a),i.resyncElements()},update:ut.noop,transition:function(t){for(var e=this.getMeta(),i=e.data||[],n=i.length,a=0;a<n;++a)i[a].transition(t);e.dataset&&e.dataset.transition(t)},draw:function(){var t=this.getMeta(),e=t.data||[],i=e.length,n=0;for(t.dataset&&t.dataset.draw();n<i;++n)e[n].draw()},removeHoverStyle:function(t){ut.merge(t._model,t.$previousStyle||{}),delete t.$previousStyle},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],i=t._index,n=t.custom||{},a=t._model,o=ut.getHoverColor;t.$previousStyle={backgroundColor:a.backgroundColor,borderColor:a.borderColor,borderWidth:a.borderWidth},a.backgroundColor=xt([n.hoverBackgroundColor,e.hoverBackgroundColor,o(a.backgroundColor)],void 0,i),a.borderColor=xt([n.hoverBorderColor,e.hoverBorderColor,o(a.borderColor)],void 0,i),a.borderWidth=xt([n.hoverBorderWidth,e.hoverBorderWidth,a.borderWidth],void 0,i)},resyncElements:function(){var t=this.getMeta(),e=this.getDataset().data,i=t.data.length,n=e.length;n<i?t.data.splice(n,i-n):n>i&&this.insertElements(i,n-i)},insertElements:function(t,e){for(var i=0;i<e;++i)this.addElementAndReset(t+i)},onDataPush:function(){var t=arguments.length;this.insertElements(this.getDataset().data.length-t,t)},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)}}),wt.extend=ut.inherits;var Mt=wt;st._set("global",{elements:{arc:{backgroundColor:st.global.defaultColor,borderColor:"#fff",borderWidth:2,borderAlign:"center"}}});var _t=pt.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 i=this._view;if(i){for(var n=ut.getAngleFromPoint(i,{x:t,y:e}),a=n.angle,o=n.distance,r=i.startAngle,s=i.endAngle;s<r;)s+=2*Math.PI;for(;a>s;)a-=2*Math.PI;for(;a<r;)a+=2*Math.PI;var l=a>=r&&a<=s,d=o>=i.innerRadius&&o<=i.outerRadius;return l&&d}return!1},getCenterPoint:function(){var t=this._view,e=(t.startAngle+t.endAngle)/2,i=(t.innerRadius+t.outerRadius)/2;return{x:t.x+Math.cos(e)*i,y:t.y+Math.sin(e)*i}},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,i=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*i,y:t.y+Math.sin(e)*i}},draw:function(){var t,e=this._chart.ctx,i=this._view,n=i.startAngle,a=i.endAngle,o="inner"===i.borderAlign?.33:0;e.save(),e.beginPath(),e.arc(i.x,i.y,Math.max(i.outerRadius-o,0),n,a),e.arc(i.x,i.y,i.innerRadius,a,n,!0),e.closePath(),e.fillStyle=i.backgroundColor,e.fill(),i.borderWidth&&("inner"===i.borderAlign?(e.beginPath(),t=o/i.outerRadius,e.arc(i.x,i.y,i.outerRadius,n-t,a+t),i.innerRadius>o?(t=o/i.innerRadius,e.arc(i.x,i.y,i.innerRadius-o,a+t,n-t,!0)):e.arc(i.x,i.y,o,a+Math.PI/2,n-Math.PI/2),e.closePath(),e.clip(),e.beginPath(),e.arc(i.x,i.y,i.outerRadius,n,a),e.arc(i.x,i.y,i.innerRadius,a,n,!0),e.closePath(),e.lineWidth=2*i.borderWidth,e.lineJoin="round"):(e.lineWidth=i.borderWidth,e.lineJoin="bevel"),e.strokeStyle=i.borderColor,e.stroke()),e.restore()}}),Ct=ut.valueOrDefault,St=st.global.defaultColor;st._set("global",{elements:{line:{tension:.4,backgroundColor:St,borderWidth:3,borderColor:St,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0}}});var Pt=pt.extend({draw:function(){var t,e,i,n,a=this._view,o=this._chart.ctx,r=a.spanGaps,s=this._children.slice(),l=st.global,d=l.elements.line,u=-1;for(this._loop&&s.length&&s.push(s[0]),o.save(),o.lineCap=a.borderCapStyle||d.borderCapStyle,o.setLineDash&&o.setLineDash(a.borderDash||d.borderDash),o.lineDashOffset=Ct(a.borderDashOffset,d.borderDashOffset),o.lineJoin=a.borderJoinStyle||d.borderJoinStyle,o.lineWidth=Ct(a.borderWidth,d.borderWidth),o.strokeStyle=a.borderColor||l.defaultColor,o.beginPath(),u=-1,t=0;t<s.length;++t)e=s[t],i=ut.previousItem(s,t),n=e._view,0===t?n.skip||(o.moveTo(n.x,n.y),u=t):(i=-1===u?i:s[u],n.skip||(u!==t-1&&!r||-1===u?o.moveTo(n.x,n.y):ut.canvas.lineTo(o,i._view,e._view),u=t));o.stroke(),o.restore()}}),It=ut.valueOrDefault,At=st.global.defaultColor;function Dt(t){var e=this._view;return!!e&&Math.abs(t-e.x)<e.radius+e.hitRadius}st._set("global",{elements:{point:{radius:3,pointStyle:"circle",backgroundColor:At,borderColor:At,borderWidth:1,hitRadius:1,hoverRadius:4,hoverBorderWidth:1}}});var Tt=pt.extend({inRange:function(t,e){var i=this._view;return!!i&&Math.pow(t-i.x,2)+Math.pow(e-i.y,2)<Math.pow(i.hitRadius+i.radius,2)},inLabelRange:Dt,inXRange:Dt,inYRange:function(t){var e=this._view;return!!e&&Math.abs(t-e.y)<e.radius+e.hitRadius},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,i=this._chart.ctx,n=e.pointStyle,a=e.rotation,o=e.radius,r=e.x,s=e.y,l=st.global,d=l.defaultColor;e.skip||(void 0===t||ut.canvas._isPointInArea(e,t))&&(i.strokeStyle=e.borderColor||d,i.lineWidth=It(e.borderWidth,l.elements.point.borderWidth),i.fillStyle=e.backgroundColor||d,ut.canvas.drawPoint(i,n,o,r,s,a))}}),Ft=st.global.defaultColor;function Lt(t){return t&&void 0!==t.width}function Rt(t){var e,i,n,a,o;return Lt(t)?(o=t.width/2,e=t.x-o,i=t.x+o,n=Math.min(t.y,t.base),a=Math.max(t.y,t.base)):(o=t.height/2,e=Math.min(t.x,t.base),i=Math.max(t.x,t.base),n=t.y-o,a=t.y+o),{left:e,top:n,right:i,bottom:a}}function Ot(t,e,i){return t===e?i:t===i?e:t}function zt(t,e,i){var n,a,o,r,s=t.borderWidth,l=function(t){var e=t.borderSkipped,i={};return e?(t.horizontal?t.base>t.x&&(e=Ot(e,"left","right")):t.base<t.y&&(e=Ot(e,"bottom","top")),i[e]=!0,i):i}(t);return ut.isObject(s)?(n=+s.top||0,a=+s.right||0,o=+s.bottom||0,r=+s.left||0):n=a=o=r=+s||0,{t:l.top||n<0?0:n>i?i:n,r:l.right||a<0?0:a>e?e:a,b:l.bottom||o<0?0:o>i?i:o,l:l.left||r<0?0:r>e?e:r}}function Bt(t,e,i){var n=null===e,a=null===i,o=!(!t||n&&a)&&Rt(t);return o&&(n||e>=o.left&&e<=o.right)&&(a||i>=o.top&&i<=o.bottom)}st._set("global",{elements:{rectangle:{backgroundColor:Ft,borderColor:Ft,borderSkipped:"bottom",borderWidth:0}}});var Nt=pt.extend({draw:function(){var t=this._chart.ctx,e=this._view,i=function(t){var e=Rt(t),i=e.right-e.left,n=e.bottom-e.top,a=zt(t,i/2,n/2);return{outer:{x:e.left,y:e.top,w:i,h:n},inner:{x:e.left+a.l,y:e.top+a.t,w:i-a.l-a.r,h:n-a.t-a.b}}}(e),n=i.outer,a=i.inner;t.fillStyle=e.backgroundColor,t.fillRect(n.x,n.y,n.w,n.h),n.w===a.w&&n.h===a.h||(t.save(),t.beginPath(),t.rect(n.x,n.y,n.w,n.h),t.clip(),t.fillStyle=e.borderColor,t.rect(a.x,a.y,a.w,a.h),t.fill("evenodd"),t.restore())},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){return Bt(this._view,t,e)},inLabelRange:function(t,e){var i=this._view;return Lt(i)?Bt(i,t,null):Bt(i,null,e)},inXRange:function(t){return Bt(this._view,t,null)},inYRange:function(t){return Bt(this._view,null,t)},getCenterPoint:function(){var t,e,i=this._view;return Lt(i)?(t=i.x,e=(i.y+i.base)/2):(t=(i.x+i.base)/2,e=i.y),{x:t,y:e}},getArea:function(){var t=this._view;return Lt(t)?t.width*Math.abs(t.y-t.base):t.height*Math.abs(t.x-t.base)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}}),Wt={},Vt=_t,Et=Pt,Ht=Tt,jt=Nt;Wt.Arc=Vt,Wt.Line=Et,Wt.Point=Ht,Wt.Rectangle=jt;var qt=ut.options.resolve;st._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",categoryPercentage:.8,barPercentage:.9,offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}});var Yt=Mt.extend({dataElementType:Wt.Rectangle,initialize:function(){var t;Mt.prototype.initialize.apply(this,arguments),(t=this.getMeta()).stack=this.getDataset().stack,t.bar=!0},update:function(t){var e,i,n=this.getMeta().data;for(this._ruler=this.getRuler(),e=0,i=n.length;e<i;++e)this.updateElement(n[e],e,t)},updateElement:function(t,e,i){var n=this,a=n.getMeta(),o=n.getDataset(),r=n._resolveElementOptions(t,e);t._xScale=n.getScaleForId(a.xAxisID),t._yScale=n.getScaleForId(a.yAxisID),t._datasetIndex=n.index,t._index=e,t._model={backgroundColor:r.backgroundColor,borderColor:r.borderColor,borderSkipped:r.borderSkipped,borderWidth:r.borderWidth,datasetLabel:o.label,label:n.chart.data.labels[e]},n._updateElementGeometry(t,e,i),t.pivot()},_updateElementGeometry:function(t,e,i){var n=this,a=t._model,o=n._getValueScale(),r=o.getBasePixel(),s=o.isHorizontal(),l=n._ruler||n.getRuler(),d=n.calculateBarValuePixels(n.index,e),u=n.calculateBarIndexPixels(n.index,e,l);a.horizontal=s,a.base=i?r:d.base,a.x=s?i?r:d.head:u.center,a.y=s?u.center:i?r:d.head,a.height=s?u.size:void 0,a.width=s?void 0:u.size},_getStacks:function(t){var e,i,n=this.chart,a=this._getIndexScale().options.stacked,o=void 0===t?n.data.datasets.length:t+1,r=[];for(e=0;e<o;++e)(i=n.getDatasetMeta(e)).bar&&n.isDatasetVisible(e)&&(!1===a||!0===a&&-1===r.indexOf(i.stack)||void 0===a&&(void 0===i.stack||-1===r.indexOf(i.stack)))&&r.push(i.stack);return r},getStackCount:function(){return this._getStacks().length},getStackIndex:function(t,e){var i=this._getStacks(t),n=void 0!==e?i.indexOf(e):-1;return-1===n?i.length-1:n},getRuler:function(){var t,e,i=this._getIndexScale(),n=this.getStackCount(),a=this.index,o=i.isHorizontal(),r=o?i.left:i.top,s=r+(o?i.width:i.height),l=[];for(t=0,e=this.getMeta().data.length;t<e;++t)l.push(i.getPixelForValue(null,t,a));return{min:ut.isNullOrUndef(i.options.barThickness)?function(t,e){var i,n,a,o,r=t.isHorizontal()?t.width:t.height,s=t.getTicks();for(a=1,o=e.length;a<o;++a)r=Math.min(r,Math.abs(e[a]-e[a-1]));for(a=0,o=s.length;a<o;++a)n=t.getPixelForTick(a),r=a>0?Math.min(r,n-i):r,i=n;return r}(i,l):-1,pixels:l,start:r,end:s,stackCount:n,scale:i}},calculateBarValuePixels:function(t,e){var i,n,a,o,r,s,l=this.chart,d=this.getMeta(),u=this._getValueScale(),h=u.isHorizontal(),c=l.data.datasets,f=+u.getRightValue(c[t].data[e]),g=u.options.minBarLength,p=u.options.stacked,m=d.stack,v=0;if(p||void 0===p&&void 0!==m)for(i=0;i<t;++i)(n=l.getDatasetMeta(i)).bar&&n.stack===m&&n.controller._getValueScaleId()===u.id&&l.isDatasetVisible(i)&&(a=+u.getRightValue(c[i].data[e]),(f<0&&a<0||f>=0&&a>0)&&(v+=a));return o=u.getPixelForValue(v),s=(r=u.getPixelForValue(v+f))-o,void 0!==g&&Math.abs(s)<g&&(s=g,r=f>=0&&!h||f<0&&h?o-g:o+g),{size:s,base:o,head:r,center:r+s/2}},calculateBarIndexPixels:function(t,e,i){var n=i.scale.options,a="flex"===n.barThickness?function(t,e,i){var n,a=e.pixels,o=a[t],r=t>0?a[t-1]:null,s=t<a.length-1?a[t+1]:null,l=i.categoryPercentage;return null===r&&(r=o-(null===s?e.end-e.start:s-o)),null===s&&(s=o+o-r),n=o-(o-Math.min(r,s))/2*l,{chunk:Math.abs(s-r)/2*l/e.stackCount,ratio:i.barPercentage,start:n}}(e,i,n):function(t,e,i){var n,a,o=i.barThickness,r=e.stackCount,s=e.pixels[t];return ut.isNullOrUndef(o)?(n=e.min*i.categoryPercentage,a=i.barPercentage):(n=o*r,a=1),{chunk:n/r,ratio:a,start:s-n/2}}(e,i,n),o=this.getStackIndex(t,this.getMeta().stack),r=a.start+a.chunk*o+a.chunk/2,s=Math.min(ut.valueOrDefault(n.maxBarThickness,1/0),a.chunk*a.ratio);return{base:r-s/2,head:r+s/2,center:r,size:s}},draw:function(){var t=this.chart,e=this._getValueScale(),i=this.getMeta().data,n=this.getDataset(),a=i.length,o=0;for(ut.canvas.clipArea(t.ctx,t.chartArea);o<a;++o)isNaN(e.getRightValue(n.data[o]))||i[o].draw();ut.canvas.unclipArea(t.ctx)},_resolveElementOptions:function(t,e){var i,n,a,o=this.chart,r=o.data.datasets[this.index],s=t.custom||{},l=o.options.elements.rectangle,d={},u={chart:o,dataIndex:e,dataset:r,datasetIndex:this.index},h=["backgroundColor","borderColor","borderSkipped","borderWidth"];for(i=0,n=h.length;i<n;++i)d[a=h[i]]=qt([s[a],r[a],l[a]],u,e);return d}}),Ut=ut.valueOrDefault,Xt=ut.options.resolve;st._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 i=e.datasets[t.datasetIndex].label||"",n=e.datasets[t.datasetIndex].data[t.index];return i+": ("+t.xLabel+", "+t.yLabel+", "+n.r+")"}}}});var Kt=Mt.extend({dataElementType:Wt.Point,update:function(t){var e=this,i=e.getMeta().data;ut.each(i,function(i,n){e.updateElement(i,n,t)})},updateElement:function(t,e,i){var n=this,a=n.getMeta(),o=t.custom||{},r=n.getScaleForId(a.xAxisID),s=n.getScaleForId(a.yAxisID),l=n._resolveElementOptions(t,e),d=n.getDataset().data[e],u=n.index,h=i?r.getPixelForDecimal(.5):r.getPixelForValue("object"==typeof d?d:NaN,e,u),c=i?s.getBasePixel():s.getPixelForValue(d,e,u);t._xScale=r,t._yScale=s,t._options=l,t._datasetIndex=u,t._index=e,t._model={backgroundColor:l.backgroundColor,borderColor:l.borderColor,borderWidth:l.borderWidth,hitRadius:l.hitRadius,pointStyle:l.pointStyle,rotation:l.rotation,radius:i?0:l.radius,skip:o.skip||isNaN(h)||isNaN(c),x:h,y:c},t.pivot()},setHoverStyle:function(t){var e=t._model,i=t._options,n=ut.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=Ut(i.hoverBackgroundColor,n(i.backgroundColor)),e.borderColor=Ut(i.hoverBorderColor,n(i.borderColor)),e.borderWidth=Ut(i.hoverBorderWidth,i.borderWidth),e.radius=i.radius+i.hoverRadius},_resolveElementOptions:function(t,e){var i,n,a,o=this.chart,r=o.data.datasets[this.index],s=t.custom||{},l=o.options.elements.point,d=r.data[e],u={},h={chart:o,dataIndex:e,dataset:r,datasetIndex:this.index},c=["backgroundColor","borderColor","borderWidth","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth","hoverRadius","hitRadius","pointStyle","rotation"];for(i=0,n=c.length;i<n;++i)u[a=c[i]]=Xt([s[a],r[a],l[a]],h,e);return u.radius=Xt([s.radius,d?d.r:void 0,r.radius,l.radius],h,e),u}}),Gt=ut.options.resolve,Zt=ut.valueOrDefault;st._set("doughnut",{animation:{animateRotate:!0,animateScale:!1},hover:{mode:"single"},legendCallback:function(t){var e=[];e.push('<ul class="'+t.id+'-legend">');var i=t.data,n=i.datasets,a=i.labels;if(n.length)for(var o=0;o<n[0].data.length;++o)e.push('<li><span style="background-color:'+n[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(i,n){var a=t.getDatasetMeta(0),o=e.datasets[0],r=a.data[n],s=r&&r.custom||{},l=t.options.elements.arc;return{text:i,fillStyle:Gt([s.backgroundColor,o.backgroundColor,l.backgroundColor],void 0,n),strokeStyle:Gt([s.borderColor,o.borderColor,l.borderColor],void 0,n),lineWidth:Gt([s.borderWidth,o.borderWidth,l.borderWidth],void 0,n),hidden:isNaN(o.data[n])||a.data[n].hidden,index:n}}):[]}},onClick:function(t,e){var i,n,a,o=e.index,r=this.chart;for(i=0,n=(r.data.datasets||[]).length;i<n;++i)(a=r.getDatasetMeta(i)).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 i=e.labels[t.index],n=": "+e.datasets[t.datasetIndex].data[t.index];return ut.isArray(i)?(i=i.slice())[0]+=n:i+=n,i}}}});var $t=Mt.extend({dataElementType:Wt.Arc,linkScales:ut.noop,getRingIndex:function(t){for(var e=0,i=0;i<t;++i)this.chart.isDatasetVisible(i)&&++e;return e},update:function(t){var e,i,n=this,a=n.chart,o=a.chartArea,r=a.options,s=o.right-o.left,l=o.bottom-o.top,d=Math.min(s,l),u={x:0,y:0},h=n.getMeta(),c=h.data,f=r.cutoutPercentage,g=r.circumference,p=n._getRingWeight(n.index);if(g<2*Math.PI){var m=r.rotation%(2*Math.PI),v=(m+=2*Math.PI*(m>=Math.PI?-1:m<-Math.PI?1:0))+g,b={x:Math.cos(m),y:Math.sin(m)},x={x:Math.cos(v),y:Math.sin(v)},y=m<=0&&v>=0||m<=2*Math.PI&&2*Math.PI<=v,k=m<=.5*Math.PI&&.5*Math.PI<=v||m<=2.5*Math.PI&&2.5*Math.PI<=v,w=m<=-Math.PI&&-Math.PI<=v||m<=Math.PI&&Math.PI<=v,M=m<=.5*-Math.PI&&.5*-Math.PI<=v||m<=1.5*Math.PI&&1.5*Math.PI<=v,_=f/100,C={x:w?-1:Math.min(b.x*(b.x<0?1:_),x.x*(x.x<0?1:_)),y:M?-1:Math.min(b.y*(b.y<0?1:_),x.y*(x.y<0?1:_))},S={x:y?1:Math.max(b.x*(b.x>0?1:_),x.x*(x.x>0?1:_)),y:k?1:Math.max(b.y*(b.y>0?1:_),x.y*(x.y>0?1:_))},P={width:.5*(S.x-C.x),height:.5*(S.y-C.y)};d=Math.min(s/P.width,l/P.height),u={x:-.5*(S.x+C.x),y:-.5*(S.y+C.y)}}for(e=0,i=c.length;e<i;++e)c[e]._options=n._resolveElementOptions(c[e],e);for(a.borderWidth=n.getMaxBorderWidth(),a.outerRadius=Math.max((d-a.borderWidth)/2,0),a.innerRadius=Math.max(f?a.outerRadius/100*f:0,0),a.radiusLength=(a.outerRadius-a.innerRadius)/(n._getVisibleDatasetWeightTotal()||1),a.offsetX=u.x*a.outerRadius,a.offsetY=u.y*a.outerRadius,h.total=n.calculateTotal(),n.outerRadius=a.outerRadius-a.radiusLength*n._getRingWeightOffset(n.index),n.innerRadius=Math.max(n.outerRadius-a.radiusLength*p,0),e=0,i=c.length;e<i;++e)n.updateElement(c[e],e,t)},updateElement:function(t,e,i){var n=this,a=n.chart,o=a.chartArea,r=a.options,s=r.animation,l=(o.left+o.right)/2,d=(o.top+o.bottom)/2,u=r.rotation,h=r.rotation,c=n.getDataset(),f=i&&s.animateRotate?0:t.hidden?0:n.calculateCircumference(c.data[e])*(r.circumference/(2*Math.PI)),g=i&&s.animateScale?0:n.innerRadius,p=i&&s.animateScale?0:n.outerRadius,m=t._options||{};ut.extend(t,{_datasetIndex:n.index,_index:e,_model:{backgroundColor:m.backgroundColor,borderColor:m.borderColor,borderWidth:m.borderWidth,borderAlign:m.borderAlign,x:l+a.offsetX,y:d+a.offsetY,startAngle:u,endAngle:h,circumference:f,outerRadius:p,innerRadius:g,label:ut.valueAtIndexOrDefault(c.label,e,a.data.labels[e])}});var v=t._model;i&&s.animateRotate||(v.startAngle=0===e?r.rotation:n.getMeta().data[e-1]._model.endAngle,v.endAngle=v.startAngle+v.circumference),t.pivot()},calculateTotal:function(){var t,e=this.getDataset(),i=this.getMeta(),n=0;return ut.each(i.data,function(i,a){t=e.data[a],isNaN(t)||i.hidden||(n+=Math.abs(t))}),n},calculateCircumference:function(t){var e=this.getMeta().total;return e>0&&!isNaN(t)?2*Math.PI*(Math.abs(t)/e):0},getMaxBorderWidth:function(t){var e,i,n,a,o,r,s,l,d=0,u=this.chart;if(!t)for(e=0,i=u.data.datasets.length;e<i;++e)if(u.isDatasetVisible(e)){t=(n=u.getDatasetMeta(e)).data,e!==this.index&&(o=n.controller);break}if(!t)return 0;for(e=0,i=t.length;e<i;++e)a=t[e],"inner"!==(r=o?o._resolveElementOptions(a,e):a._options).borderAlign&&(s=r.borderWidth,d=(l=r.hoverBorderWidth)>(d=s>d?s:d)?l:d);return d},setHoverStyle:function(t){var e=t._model,i=t._options,n=ut.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=Zt(i.hoverBackgroundColor,n(i.backgroundColor)),e.borderColor=Zt(i.hoverBorderColor,n(i.borderColor)),e.borderWidth=Zt(i.hoverBorderWidth,i.borderWidth)},_resolveElementOptions:function(t,e){var i,n,a,o=this.chart,r=this.getDataset(),s=t.custom||{},l=o.options.elements.arc,d={},u={chart:o,dataIndex:e,dataset:r,datasetIndex:this.index},h=["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"];for(i=0,n=h.length;i<n;++i)d[a=h[i]]=Gt([s[a],r[a],l[a]],u,e);return d},_getRingWeightOffset:function(t){for(var e=0,i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e},_getRingWeight:function(t){return Math.max(Zt(this.chart.data.datasets[t].weight,1),0)},_getVisibleDatasetWeightTotal:function(){return this._getRingWeightOffset(this.chart.data.datasets.length)}});st._set("horizontalBar",{hover:{mode:"index",axis:"y"},scales:{xAxes:[{type:"linear",position:"bottom"}],yAxes:[{type:"category",position:"left",categoryPercentage:.8,barPercentage:.9,offset:!0,gridLines:{offsetGridLines:!0}}]},elements:{rectangle:{borderSkipped:"left"}},tooltips:{mode:"index",axis:"y"}});var Jt=Yt.extend({_getValueScaleId:function(){return this.getMeta().xAxisID},_getIndexScaleId:function(){return this.getMeta().yAxisID}}),Qt=ut.valueOrDefault,te=ut.options.resolve,ee=ut.canvas._isPointInArea;function ie(t,e){return Qt(t.showLine,e.showLines)}st._set("line",{showLines:!0,spanGaps:!1,hover:{mode:"label"},scales:{xAxes:[{type:"category",id:"x-axis-0"}],yAxes:[{type:"linear",id:"y-axis-0"}]}});var ne=Mt.extend({datasetElementType:Wt.Line,dataElementType:Wt.Point,update:function(t){var e,i,n=this,a=n.getMeta(),o=a.dataset,r=a.data||[],s=n.getScaleForId(a.yAxisID),l=n.getDataset(),d=ie(l,n.chart.options);for(d&&(void 0!==l.tension&&void 0===l.lineTension&&(l.lineTension=l.tension),o._scale=s,o._datasetIndex=n.index,o._children=r,o._model=n._resolveLineOptions(o),o.pivot()),e=0,i=r.length;e<i;++e)n.updateElement(r[e],e,t);for(d&&0!==o._model.tension&&n.updateBezierControlPoints(),e=0,i=r.length;e<i;++e)r[e].pivot()},updateElement:function(t,e,i){var n,a,o=this,r=o.getMeta(),s=t.custom||{},l=o.getDataset(),d=o.index,u=l.data[e],h=o.getScaleForId(r.yAxisID),c=o.getScaleForId(r.xAxisID),f=r.dataset._model,g=o._resolvePointOptions(t,e);n=c.getPixelForValue("object"==typeof u?u:NaN,e,d),a=i?h.getBasePixel():o.calculatePointY(u,e,d),t._xScale=c,t._yScale=h,t._options=g,t._datasetIndex=d,t._index=e,t._model={x:n,y:a,skip:s.skip||isNaN(n)||isNaN(a),radius:g.radius,pointStyle:g.pointStyle,rotation:g.rotation,backgroundColor:g.backgroundColor,borderColor:g.borderColor,borderWidth:g.borderWidth,tension:Qt(s.tension,f?f.tension:0),steppedLine:!!f&&f.steppedLine,hitRadius:g.hitRadius}},_resolvePointOptions:function(t,e){var i,n,a,o=this.chart,r=o.data.datasets[this.index],s=t.custom||{},l=o.options.elements.point,d={},u={chart:o,dataIndex:e,dataset:r,datasetIndex:this.index},h={backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},c=Object.keys(h);for(i=0,n=c.length;i<n;++i)d[a=c[i]]=te([s[a],r[h[a]],r[a],l[a]],u,e);return d},_resolveLineOptions:function(t){var e,i,n,a=this.chart,o=a.data.datasets[this.index],r=t.custom||{},s=a.options,l=s.elements.line,d={},u=["backgroundColor","borderWidth","borderColor","borderCapStyle","borderDash","borderDashOffset","borderJoinStyle","fill","cubicInterpolationMode"];for(e=0,i=u.length;e<i;++e)d[n=u[e]]=te([r[n],o[n],l[n]]);return d.spanGaps=Qt(o.spanGaps,s.spanGaps),d.tension=Qt(o.lineTension,l.tension),d.steppedLine=te([r.steppedLine,o.steppedLine,l.stepped]),d},calculatePointY:function(t,e,i){var n,a,o,r=this.chart,s=this.getMeta(),l=this.getScaleForId(s.yAxisID),d=0,u=0;if(l.options.stacked){for(n=0;n<i;n++)if(a=r.data.datasets[n],"line"===(o=r.getDatasetMeta(n)).type&&o.yAxisID===l.id&&r.isDatasetVisible(n)){var h=Number(l.getRightValue(a.data[e]));h<0?u+=h||0:d+=h||0}var c=Number(l.getRightValue(t));return c<0?l.getPixelForValue(u+c):l.getPixelForValue(d+c)}return l.getPixelForValue(t)},updateBezierControlPoints:function(){var t,e,i,n,a=this.chart,o=this.getMeta(),r=o.dataset._model,s=a.chartArea,l=o.data||[];function d(t,e,i){return Math.max(Math.min(t,i),e)}if(r.spanGaps&&(l=l.filter(function(t){return!t._model.skip})),"monotone"===r.cubicInterpolationMode)ut.splineCurveMonotone(l);else for(t=0,e=l.length;t<e;++t)i=l[t]._model,n=ut.splineCurve(ut.previousItem(l,t)._model,i,ut.nextItem(l,t)._model,r.tension),i.controlPointPreviousX=n.previous.x,i.controlPointPreviousY=n.previous.y,i.controlPointNextX=n.next.x,i.controlPointNextY=n.next.y;if(a.options.elements.line.capBezierPoints)for(t=0,e=l.length;t<e;++t)i=l[t]._model,ee(i,s)&&(t>0&&ee(l[t-1]._model,s)&&(i.controlPointPreviousX=d(i.controlPointPreviousX,s.left,s.right),i.controlPointPreviousY=d(i.controlPointPreviousY,s.top,s.bottom)),t<l.length-1&&ee(l[t+1]._model,s)&&(i.controlPointNextX=d(i.controlPointNextX,s.left,s.right),i.controlPointNextY=d(i.controlPointNextY,s.top,s.bottom)))},draw:function(){var t,e=this.chart,i=this.getMeta(),n=i.data||[],a=e.chartArea,o=n.length,r=0;for(ie(this.getDataset(),e.options)&&(t=(i.dataset._model.borderWidth||0)/2,ut.canvas.clipArea(e.ctx,{left:a.left,right:a.right,top:a.top-t,bottom:a.bottom+t}),i.dataset.draw(),ut.canvas.unclipArea(e.ctx));r<o;++r)n[r].draw(a)},setHoverStyle:function(t){var e=t._model,i=t._options,n=ut.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=Qt(i.hoverBackgroundColor,n(i.backgroundColor)),e.borderColor=Qt(i.hoverBorderColor,n(i.borderColor)),e.borderWidth=Qt(i.hoverBorderWidth,i.borderWidth),e.radius=Qt(i.hoverRadius,i.radius)}}),ae=ut.options.resolve;st._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 i=t.data,n=i.datasets,a=i.labels;if(n.length)for(var o=0;o<n[0].data.length;++o)e.push('<li><span style="background-color:'+n[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(i,n){var a=t.getDatasetMeta(0),o=e.datasets[0],r=a.data[n].custom||{},s=t.options.elements.arc;return{text:i,fillStyle:ae([r.backgroundColor,o.backgroundColor,s.backgroundColor],void 0,n),strokeStyle:ae([r.borderColor,o.borderColor,s.borderColor],void 0,n),lineWidth:ae([r.borderWidth,o.borderWidth,s.borderWidth],void 0,n),hidden:isNaN(o.data[n])||a.data[n].hidden,index:n}}):[]}},onClick:function(t,e){var i,n,a,o=e.index,r=this.chart;for(i=0,n=(r.data.datasets||[]).length;i<n;++i)(a=r.getDatasetMeta(i)).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}}}});var oe=Mt.extend({dataElementType:Wt.Arc,linkScales:ut.noop,update:function(t){var e,i,n,a=this,o=a.getDataset(),r=a.getMeta(),s=a.chart.options.startAngle||0,l=a._starts=[],d=a._angles=[],u=r.data;for(a._updateRadius(),r.count=a.countVisibleElements(),e=0,i=o.data.length;e<i;e++)l[e]=s,n=a._computeAngle(e),d[e]=n,s+=n;for(e=0,i=u.length;e<i;++e)u[e]._options=a._resolveElementOptions(u[e],e),a.updateElement(u[e],e,t)},_updateRadius:function(){var t=this,e=t.chart,i=e.chartArea,n=e.options,a=Math.min(i.right-i.left,i.bottom-i.top);e.outerRadius=Math.max(a/2,0),e.innerRadius=Math.max(n.cutoutPercentage?e.outerRadius/100*n.cutoutPercentage:1,0),e.radiusLength=(e.outerRadius-e.innerRadius)/e.getVisibleDatasetCount(),t.outerRadius=e.outerRadius-e.radiusLength*t.index,t.innerRadius=t.outerRadius-e.radiusLength},updateElement:function(t,e,i){var n=this,a=n.chart,o=n.getDataset(),r=a.options,s=r.animation,l=a.scale,d=a.data.labels,u=l.xCenter,h=l.yCenter,c=r.startAngle,f=t.hidden?0:l.getDistanceFromCenterForValue(o.data[e]),g=n._starts[e],p=g+(t.hidden?0:n._angles[e]),m=s.animateScale?0:l.getDistanceFromCenterForValue(o.data[e]),v=t._options||{};ut.extend(t,{_datasetIndex:n.index,_index:e,_scale:l,_model:{backgroundColor:v.backgroundColor,borderColor:v.borderColor,borderWidth:v.borderWidth,borderAlign:v.borderAlign,x:u,y:h,innerRadius:0,outerRadius:i?m:f,startAngle:i&&s.animateRotate?c:g,endAngle:i&&s.animateRotate?c:p,label:ut.valueAtIndexOrDefault(d,e,d[e])}}),t.pivot()},countVisibleElements:function(){var t=this.getDataset(),e=this.getMeta(),i=0;return ut.each(e.data,function(e,n){isNaN(t.data[n])||e.hidden||i++}),i},setHoverStyle:function(t){var e=t._model,i=t._options,n=ut.getHoverColor,a=ut.valueOrDefault;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=a(i.hoverBackgroundColor,n(i.backgroundColor)),e.borderColor=a(i.hoverBorderColor,n(i.borderColor)),e.borderWidth=a(i.hoverBorderWidth,i.borderWidth)},_resolveElementOptions:function(t,e){var i,n,a,o=this.chart,r=this.getDataset(),s=t.custom||{},l=o.options.elements.arc,d={},u={chart:o,dataIndex:e,dataset:r,datasetIndex:this.index},h=["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"];for(i=0,n=h.length;i<n;++i)d[a=h[i]]=ae([s[a],r[a],l[a]],u,e);return d},_computeAngle:function(t){var e=this,i=this.getMeta().count,n=e.getDataset(),a=e.getMeta();if(isNaN(n.data[t])||a.data[t].hidden)return 0;var o={chart:e.chart,dataIndex:t,dataset:n,datasetIndex:e.index};return ae([e.chart.options.elements.arc.angle,2*Math.PI/i],o,t)}});st._set("pie",ut.clone(st.doughnut)),st._set("pie",{cutoutPercentage:0});var re=$t,se=ut.valueOrDefault,le=ut.options.resolve;st._set("radar",{scale:{type:"radialLinear"},elements:{line:{tension:0}}});var de=Mt.extend({datasetElementType:Wt.Line,dataElementType:Wt.Point,linkScales:ut.noop,update:function(t){var e,i,n=this,a=n.getMeta(),o=a.dataset,r=a.data||[],s=n.chart.scale,l=n.getDataset();for(void 0!==l.tension&&void 0===l.lineTension&&(l.lineTension=l.tension),o._scale=s,o._datasetIndex=n.index,o._children=r,o._loop=!0,o._model=n._resolveLineOptions(o),o.pivot(),e=0,i=r.length;e<i;++e)n.updateElement(r[e],e,t);for(n.updateBezierControlPoints(),e=0,i=r.length;e<i;++e)r[e].pivot()},updateElement:function(t,e,i){var n=this,a=t.custom||{},o=n.getDataset(),r=n.chart.scale,s=r.getPointPositionForValue(e,o.data[e]),l=n._resolvePointOptions(t,e),d=n.getMeta().dataset._model,u=i?r.xCenter:s.x,h=i?r.yCenter:s.y;t._scale=r,t._options=l,t._datasetIndex=n.index,t._index=e,t._model={x:u,y:h,skip:a.skip||isNaN(u)||isNaN(h),radius:l.radius,pointStyle:l.pointStyle,rotation:l.rotation,backgroundColor:l.backgroundColor,borderColor:l.borderColor,borderWidth:l.borderWidth,tension:se(a.tension,d?d.tension:0),hitRadius:l.hitRadius}},_resolvePointOptions:function(t,e){var i,n,a,o=this.chart,r=o.data.datasets[this.index],s=t.custom||{},l=o.options.elements.point,d={},u={chart:o,dataIndex:e,dataset:r,datasetIndex:this.index},h={backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},c=Object.keys(h);for(i=0,n=c.length;i<n;++i)d[a=c[i]]=le([s[a],r[h[a]],r[a],l[a]],u,e);return d},_resolveLineOptions:function(t){var e,i,n,a=this.chart,o=a.data.datasets[this.index],r=t.custom||{},s=a.options.elements.line,l={},d=["backgroundColor","borderWidth","borderColor","borderCapStyle","borderDash","borderDashOffset","borderJoinStyle","fill"];for(e=0,i=d.length;e<i;++e)l[n=d[e]]=le([r[n],o[n],s[n]]);return l.tension=se(o.lineTension,s.tension),l},updateBezierControlPoints:function(){var t,e,i,n,a=this.getMeta(),o=this.chart.chartArea,r=a.data||[];function s(t,e,i){return Math.max(Math.min(t,i),e)}for(t=0,e=r.length;t<e;++t)i=r[t]._model,n=ut.splineCurve(ut.previousItem(r,t,!0)._model,i,ut.nextItem(r,t,!0)._model,i.tension),i.controlPointPreviousX=s(n.previous.x,o.left,o.right),i.controlPointPreviousY=s(n.previous.y,o.top,o.bottom),i.controlPointNextX=s(n.next.x,o.left,o.right),i.controlPointNextY=s(n.next.y,o.top,o.bottom)},setHoverStyle:function(t){var e=t._model,i=t._options,n=ut.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=se(i.hoverBackgroundColor,n(i.backgroundColor)),e.borderColor=se(i.hoverBorderColor,n(i.borderColor)),e.borderWidth=se(i.hoverBorderWidth,i.borderWidth),e.radius=se(i.hoverRadius,i.radius)}});st._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+")"}}}});var ue={bar:Yt,bubble:Kt,doughnut:$t,horizontalBar:Jt,line:ne,polarArea:oe,pie:re,radar:de,scatter:ne};function he(t,e){return t.native?{x:t.x,y:t.y}:ut.getRelativePosition(t,e)}function ce(t,e){var i,n,a,o,r;for(n=0,o=t.data.datasets.length;n<o;++n)if(t.isDatasetVisible(n))for(a=0,r=(i=t.getDatasetMeta(n)).data.length;a<r;++a){var s=i.data[a];s._view.skip||e(s)}}function fe(t,e){var i=[];return ce(t,function(t){t.inRange(e.x,e.y)&&i.push(t)}),i}function ge(t,e,i,n){var a=Number.POSITIVE_INFINITY,o=[];return ce(t,function(t){if(!i||t.inRange(e.x,e.y)){var r=t.getCenterPoint(),s=n(e,r);s<a?(o=[t],a=s):s===a&&o.push(t)}}),o}function pe(t){var e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,n){var a=e?Math.abs(t.x-n.x):0,o=i?Math.abs(t.y-n.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(o,2))}}function me(t,e,i){var n=he(e,t);i.axis=i.axis||"x";var a=pe(i.axis),o=i.intersect?fe(t,n):ge(t,n,!1,a),r=[];return o.length?(t.data.datasets.forEach(function(e,i){if(t.isDatasetVisible(i)){var n=t.getDatasetMeta(i).data[o[0]._index];n&&!n._view.skip&&r.push(n)}}),r):[]}var ve={modes:{single:function(t,e){var i=he(e,t),n=[];return ce(t,function(t){if(t.inRange(i.x,i.y))return n.push(t),n}),n.slice(0,1)},label:me,index:me,dataset:function(t,e,i){var n=he(e,t);i.axis=i.axis||"xy";var a=pe(i.axis),o=i.intersect?fe(t,n):ge(t,n,!1,a);return o.length>0&&(o=t.getDatasetMeta(o[0]._datasetIndex).data),o},"x-axis":function(t,e){return me(t,e,{intersect:!1})},point:function(t,e){return fe(t,he(e,t))},nearest:function(t,e,i){var n=he(e,t);i.axis=i.axis||"xy";var a=pe(i.axis);return ge(t,n,i.intersect,a)},x:function(t,e,i){var n=he(e,t),a=[],o=!1;return ce(t,function(t){t.inXRange(n.x)&&a.push(t),t.inRange(n.x,n.y)&&(o=!0)}),i.intersect&&!o&&(a=[]),a},y:function(t,e,i){var n=he(e,t),a=[],o=!1;return ce(t,function(t){t.inYRange(n.y)&&a.push(t),t.inRange(n.x,n.y)&&(o=!0)}),i.intersect&&!o&&(a=[]),a}}};function be(t,e){return ut.where(t,function(t){return t.position===e})}function xe(t,e){t.forEach(function(t,e){return t._tmpIndex_=e,t}),t.sort(function(t,i){var n=e?i:t,a=e?t:i;return n.weight===a.weight?n._tmpIndex_-a._tmpIndex_:n.weight-a.weight}),t.forEach(function(t){delete t._tmpIndex_})}function ye(t,e){ut.each(t,function(t){e[t.position]+=t.isHorizontal()?t.height:t.width})}st._set("global",{layout:{padding:{top:0,right:0,bottom:0,left:0}}});var ke={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 i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure:function(t,e,i){for(var n,a=["fullWidth","position","weight"],o=a.length,r=0;r<o;++r)n=a[r],i.hasOwnProperty(n)&&(e[n]=i[n])},update:function(t,e,i){if(t){var n=t.options.layout||{},a=ut.options.toPadding(n.padding),o=a.left,r=a.right,s=a.top,l=a.bottom,d=be(t.boxes,"left"),u=be(t.boxes,"right"),h=be(t.boxes,"top"),c=be(t.boxes,"bottom"),f=be(t.boxes,"chartArea");xe(d,!0),xe(u,!1),xe(h,!0),xe(c,!1);var g,p=d.concat(u),m=h.concat(c),v=p.concat(m),b=e-o-r,x=i-s-l,y=(e-b/2)/p.length,k=b,w=x,M={top:s,left:o,bottom:l,right:r},_=[];ut.each(v,function(t){var e,i=t.isHorizontal();i?(e=t.update(t.fullWidth?b:k,x/2),w-=e.height):(e=t.update(y,w),k-=e.width),_.push({horizontal:i,width:e.width,box:t})}),g=function(t){var e=0,i=0,n=0,a=0;return ut.each(t,function(t){if(t.getPadding){var o=t.getPadding();e=Math.max(e,o.top),i=Math.max(i,o.left),n=Math.max(n,o.bottom),a=Math.max(a,o.right)}}),{top:e,left:i,bottom:n,right:a}}(v),ut.each(p,T),ye(p,M),ut.each(m,T),ye(m,M),ut.each(p,function(t){var e=ut.findNextWhere(_,function(e){return e.box===t}),i={left:0,right:0,top:M.top,bottom:M.bottom};e&&t.update(e.width,w,i)}),ye(v,M={top:s,left:o,bottom:l,right:r});var C=Math.max(g.left-M.left,0);M.left+=C,M.right+=Math.max(g.right-M.right,0);var S=Math.max(g.top-M.top,0);M.top+=S,M.bottom+=Math.max(g.bottom-M.bottom,0);var P=i-M.top-M.bottom,I=e-M.left-M.right;I===k&&P===w||(ut.each(p,function(t){t.height=P}),ut.each(m,function(t){t.fullWidth||(t.width=I)}),w=P,k=I);var A=o+C,D=s+S;ut.each(d.concat(h),F),A+=k,D+=w,ut.each(u,F),ut.each(c,F),t.chartArea={left:M.left,top:M.top,right:M.left+k,bottom:M.top+w},ut.each(f,function(e){e.left=t.chartArea.left,e.top=t.chartArea.top,e.right=t.chartArea.right,e.bottom=t.chartArea.bottom,e.update(k,w)})}function T(t){var e=ut.findNextWhere(_,function(e){return e.box===t});if(e)if(e.horizontal){var i={left:Math.max(M.left,g.left),right:Math.max(M.right,g.right),top:0,bottom:0};t.update(t.fullWidth?b:k,x/2,i)}else t.update(e.width,w)}function F(t){t.isHorizontal()?(t.left=t.fullWidth?o:M.left,t.right=t.fullWidth?e-r:M.left+k,t.top=D,t.bottom=D+t.height,D=t.bottom):(t.left=A,t.right=A+t.width,t.top=M.top,t.bottom=M.top+w,A=t.right)}}};var we,Me=(we=Object.freeze({default:"/*\n * DOM element rendering detection\n * https://davidwalsh.name/detect-node-insertion\n */\n@keyframes chartjs-render-animation {\n\tfrom { opacity: 0.99; }\n\tto { opacity: 1; }\n}\n\n.chartjs-render-monitor {\n\tanimation: chartjs-render-animation 0.001s;\n}\n\n/*\n * DOM element resizing detection\n * https://github.com/marcj/css-element-queries\n */\n.chartjs-size-monitor,\n.chartjs-size-monitor-expand,\n.chartjs-size-monitor-shrink {\n\tposition: absolute;\n\tdirection: ltr;\n\tleft: 0;\n\ttop: 0;\n\tright: 0;\n\tbottom: 0;\n\toverflow: hidden;\n\tpointer-events: none;\n\tvisibility: hidden;\n\tz-index: -1;\n}\n\n.chartjs-size-monitor-expand > div {\n\tposition: absolute;\n\twidth: 1000000px;\n\theight: 1000000px;\n\tleft: 0;\n\ttop: 0;\n}\n\n.chartjs-size-monitor-shrink > div {\n\tposition: absolute;\n\twidth: 200%;\n\theight: 200%;\n\tleft: 0;\n\ttop: 0;\n}\n"}))&&we.default||we,_e="$chartjs",Ce="chartjs-size-monitor",Se="chartjs-render-monitor",Pe="chartjs-render-animation",Ie=["animationstart","webkitAnimationStart"],Ae={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function De(t,e){var i=ut.getStyle(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?Number(n[1]):void 0}var Te=!!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("e",null,e)}catch(t){}return t}()&&{passive:!0};function Fe(t,e,i){t.addEventListener(e,i,Te)}function Le(t,e,i){t.removeEventListener(e,i,Te)}function Re(t,e,i,n,a){return{type:t,chart:e,native:a||null,x:void 0!==i?i:null,y:void 0!==n?n:null}}function Oe(t){var e=document.createElement("div");return e.className=t||"",e}function ze(t,e,i){var n,a,o,r,s=t[_e]||(t[_e]={}),l=s.resizer=function(t){var e=Oe(Ce),i=Oe(Ce+"-expand"),n=Oe(Ce+"-shrink");i.appendChild(Oe()),n.appendChild(Oe()),e.appendChild(i),e.appendChild(n),e._reset=function(){i.scrollLeft=1e6,i.scrollTop=1e6,n.scrollLeft=1e6,n.scrollTop=1e6};var a=function(){e._reset(),t()};return Fe(i,"scroll",a.bind(i,"expand")),Fe(n,"scroll",a.bind(n,"shrink")),e}((n=function(){if(s.resizer){var n=i.options.maintainAspectRatio&&t.parentNode,a=n?n.clientWidth:0;e(Re("resize",i)),n&&n.clientWidth<a&&i.canvas&&e(Re("resize",i))}},o=!1,r=[],function(){r=Array.prototype.slice.call(arguments),a=a||this,o||(o=!0,ut.requestAnimFrame.call(window,function(){o=!1,n.apply(a,r)}))}));!function(t,e){var i=t[_e]||(t[_e]={}),n=i.renderProxy=function(t){t.animationName===Pe&&e()};ut.each(Ie,function(e){Fe(t,e,n)}),i.reflow=!!t.offsetParent,t.classList.add(Se)}(t,function(){if(s.resizer){var e=t.parentNode;e&&e!==l.parentNode&&e.insertBefore(l,e.firstChild),l._reset()}})}function Be(t){var e=t[_e]||{},i=e.resizer;delete e.resizer,function(t){var e=t[_e]||{},i=e.renderProxy;i&&(ut.each(Ie,function(e){Le(t,e,i)}),delete e.renderProxy),t.classList.remove(Se)}(t),i&&i.parentNode&&i.parentNode.removeChild(i)}var Ne={disableCSSInjection:!1,_enabled:"undefined"!=typeof window&&"undefined"!=typeof document,_ensureLoaded:function(){var t,e,i;this._loaded||(this._loaded=!0,this.disableCSSInjection||(e=Me,i=(t=this)._style||document.createElement("style"),t._style||(t._style=i,e="/* Chart.js */\n"+e,i.setAttribute("type","text/css"),document.getElementsByTagName("head")[0].appendChild(i)),i.appendChild(document.createTextNode(e))))},acquireContext:function(t,e){"string"==typeof t?t=document.getElementById(t):t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas);var i=t&&t.getContext&&t.getContext("2d");return this._ensureLoaded(),i&&i.canvas===t?(function(t,e){var i=t.style,n=t.getAttribute("height"),a=t.getAttribute("width");if(t[_e]={initial:{height:n,width:a,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",null===a||""===a){var o=De(t,"width");void 0!==o&&(t.width=o)}if(null===n||""===n)if(""===t.style.height)t.height=t.width/(e.options.aspectRatio||2);else{var r=De(t,"height");void 0!==o&&(t.height=r)}}(t,e),i):null},releaseContext:function(t){var e=t.canvas;if(e[_e]){var i=e[_e].initial;["height","width"].forEach(function(t){var n=i[t];ut.isNullOrUndef(n)?e.removeAttribute(t):e.setAttribute(t,n)}),ut.each(i.style||{},function(t,i){e.style[i]=t}),e.width=e.width,delete e[_e]}},addEventListener:function(t,e,i){var n=t.canvas;if("resize"!==e){var a=i[_e]||(i[_e]={});Fe(n,e,(a.proxies||(a.proxies={}))[t.id+"_"+e]=function(e){i(function(t,e){var i=Ae[t.type]||t.type,n=ut.getRelativePosition(t,e);return Re(i,e,n.x,n.y,t)}(e,t))})}else ze(n,i,t)},removeEventListener:function(t,e,i){var n=t.canvas;if("resize"!==e){var a=((i[_e]||{}).proxies||{})[t.id+"_"+e];a&&Le(n,e,a)}else Be(n)}};ut.addEvent=Fe,ut.removeEvent=Le;var We=Ne._enabled?Ne:{acquireContext:function(t){return t&&t.canvas&&(t=t.canvas),t&&t.getContext("2d")||null}},Ve=ut.extend({initialize:function(){},acquireContext:function(){},releaseContext:function(){},addEventListener:function(){},removeEventListener:function(){}},We);st._set("global",{plugins:{}});var Ee={_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 i=e.indexOf(t);-1!==i&&e.splice(i,1)}),this._cacheId++},clear:function(){this._plugins=[],this._cacheId++},count:function(){return this._plugins.length},getAll:function(){return this._plugins},notify:function(t,e,i){var n,a,o,r,s,l=this.descriptors(t),d=l.length;for(n=0;n<d;++n)if("function"==typeof(s=(o=(a=l[n]).plugin)[e])&&((r=[t].concat(i||[])).push(a.options),!1===s.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 i=[],n=[],a=t&&t.config||{},o=a.options&&a.options.plugins||{};return this._plugins.concat(a.plugins||[]).forEach(function(t){if(-1===i.indexOf(t)){var e=t.id,a=o[e];!1!==a&&(!0===a&&(a=ut.clone(st.global.plugins[e])),i.push(t),n.push({plugin:t,options:a||{}}))}}),e.descriptors=n,e.id=this._cacheId,n},_invalidate:function(t){delete t.$plugins}},He={constructors:{},defaults:{},registerScaleType:function(t,e,i){this.constructors[t]=e,this.defaults[t]=ut.clone(i)},getScaleConstructor:function(t){return this.constructors.hasOwnProperty(t)?this.constructors[t]:void 0},getScaleDefaults:function(t){return this.defaults.hasOwnProperty(t)?ut.merge({},[st.scale,this.defaults[t]]):{}},updateScaleDefaults:function(t,e){this.defaults.hasOwnProperty(t)&&(this.defaults[t]=ut.extend(this.defaults[t],e))},addScalesToLayout:function(t){ut.each(t.scales,function(e){e.fullWidth=e.options.fullWidth,e.position=e.options.position,e.weight=e.options.weight,ke.addBox(t,e)})}},je=ut.valueOrDefault;st._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:ut.noop,title:function(t,e){var i="",n=e.labels,a=n?n.length:0;if(t.length>0){var o=t[0];o.label?i=o.label:o.xLabel?i=o.xLabel:a>0&&o.index<a&&(i=n[o.index])}return i},afterTitle:ut.noop,beforeBody:ut.noop,beforeLabel:ut.noop,label:function(t,e){var i=e.datasets[t.datasetIndex].label||"";return i&&(i+=": "),ut.isNullOrUndef(t.value)?i+=t.yLabel:i+=t.value,i},labelColor:function(t,e){var i=e.getDatasetMeta(t.datasetIndex).data[t.index]._view;return{borderColor:i.borderColor,backgroundColor:i.backgroundColor}},labelTextColor:function(){return this._options.bodyFontColor},afterLabel:ut.noop,afterBody:ut.noop,beforeFooter:ut.noop,footer:ut.noop,afterFooter:ut.noop}}});var qe={average:function(t){if(!t.length)return!1;var e,i,n=0,a=0,o=0;for(e=0,i=t.length;e<i;++e){var r=t[e];if(r&&r.hasValue()){var s=r.tooltipPosition();n+=s.x,a+=s.y,++o}}return{x:n/o,y:a/o}},nearest:function(t,e){var i,n,a,o=e.x,r=e.y,s=Number.POSITIVE_INFINITY;for(i=0,n=t.length;i<n;++i){var l=t[i];if(l&&l.hasValue()){var d=l.getCenterPoint(),u=ut.distanceBetweenPoints(e,d);u<s&&(s=u,a=l)}}if(a){var h=a.tooltipPosition();o=h.x,r=h.y}return{x:o,y:r}}};function Ye(t,e){return e&&(ut.isArray(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Ue(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function Xe(t){var e=st.global;return{xPadding:t.xPadding,yPadding:t.yPadding,xAlign:t.xAlign,yAlign:t.yAlign,bodyFontColor:t.bodyFontColor,_bodyFontFamily:je(t.bodyFontFamily,e.defaultFontFamily),_bodyFontStyle:je(t.bodyFontStyle,e.defaultFontStyle),_bodyAlign:t.bodyAlign,bodyFontSize:je(t.bodyFontSize,e.defaultFontSize),bodySpacing:t.bodySpacing,titleFontColor:t.titleFontColor,_titleFontFamily:je(t.titleFontFamily,e.defaultFontFamily),_titleFontStyle:je(t.titleFontStyle,e.defaultFontStyle),titleFontSize:je(t.titleFontSize,e.defaultFontSize),_titleAlign:t.titleAlign,titleSpacing:t.titleSpacing,titleMarginBottom:t.titleMarginBottom,footerFontColor:t.footerFontColor,_footerFontFamily:je(t.footerFontFamily,e.defaultFontFamily),_footerFontStyle:je(t.footerFontStyle,e.defaultFontStyle),footerFontSize:je(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 Ke(t,e){return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-t.xPadding:t.x+t.xPadding}function Ge(t){return Ye([],Ue(t))}var Ze=pt.extend({initialize:function(){this._model=Xe(this._options),this._lastActive=[]},getTitle:function(){var t=this._options.callbacks,e=t.beforeTitle.apply(this,arguments),i=t.title.apply(this,arguments),n=t.afterTitle.apply(this,arguments),a=[];return a=Ye(a,Ue(e)),a=Ye(a,Ue(i)),a=Ye(a,Ue(n))},getBeforeBody:function(){return Ge(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(t,e){var i=this,n=i._options.callbacks,a=[];return ut.each(t,function(t){var o={before:[],lines:[],after:[]};Ye(o.before,Ue(n.beforeLabel.call(i,t,e))),Ye(o.lines,n.label.call(i,t,e)),Ye(o.after,Ue(n.afterLabel.call(i,t,e))),a.push(o)}),a},getAfterBody:function(){return Ge(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var t=this._options.callbacks,e=t.beforeFooter.apply(this,arguments),i=t.footer.apply(this,arguments),n=t.afterFooter.apply(this,arguments),a=[];return a=Ye(a,Ue(e)),a=Ye(a,Ue(i)),a=Ye(a,Ue(n))},update:function(t){var e,i,n,a,o,r,s,l,d,u,h=this,c=h._options,f=h._model,g=h._model=Xe(c),p=h._active,m=h._data,v={xAlign:f.xAlign,yAlign:f.yAlign},b={x:f.x,y:f.y},x={width:f.width,height:f.height},y={x:f.caretX,y:f.caretY};if(p.length){g.opacity=1;var k=[],w=[];y=qe[c.position].call(h,p,h._eventPosition);var M=[];for(e=0,i=p.length;e<i;++e)M.push((n=p[e],a=void 0,o=void 0,r=void 0,s=void 0,l=void 0,d=void 0,u=void 0,a=n._xScale,o=n._yScale||n._scale,r=n._index,s=n._datasetIndex,l=n._chart.getDatasetMeta(s).controller,d=l._getIndexScale(),u=l._getValueScale(),{xLabel:a?a.getLabelForIndex(r,s):"",yLabel:o?o.getLabelForIndex(r,s):"",label:d?""+d.getLabelForIndex(r,s):"",value:u?""+u.getLabelForIndex(r,s):"",index:r,datasetIndex:s,x:n._model.x,y:n._model.y}));c.filter&&(M=M.filter(function(t){return c.filter(t,m)})),c.itemSort&&(M=M.sort(function(t,e){return c.itemSort(t,e,m)})),ut.each(M,function(t){k.push(c.callbacks.labelColor.call(h,t,h._chart)),w.push(c.callbacks.labelTextColor.call(h,t,h._chart))}),g.title=h.getTitle(M,m),g.beforeBody=h.getBeforeBody(M,m),g.body=h.getBody(M,m),g.afterBody=h.getAfterBody(M,m),g.footer=h.getFooter(M,m),g.x=y.x,g.y=y.y,g.caretPadding=c.caretPadding,g.labelColors=k,g.labelTextColors=w,g.dataPoints=M,x=function(t,e){var i=t._chart.ctx,n=2*e.yPadding,a=0,o=e.body,r=o.reduce(function(t,e){return t+e.before.length+e.lines.length+e.after.length},0);r+=e.beforeBody.length+e.afterBody.length;var s=e.title.length,l=e.footer.length,d=e.titleFontSize,u=e.bodyFontSize,h=e.footerFontSize;n+=s*d,n+=s?(s-1)*e.titleSpacing:0,n+=s?e.titleMarginBottom:0,n+=r*u,n+=r?(r-1)*e.bodySpacing:0,n+=l?e.footerMarginTop:0,n+=l*h,n+=l?(l-1)*e.footerSpacing:0;var c=0,f=function(t){a=Math.max(a,i.measureText(t).width+c)};return i.font=ut.fontString(d,e._titleFontStyle,e._titleFontFamily),ut.each(e.title,f),i.font=ut.fontString(u,e._bodyFontStyle,e._bodyFontFamily),ut.each(e.beforeBody.concat(e.afterBody),f),c=e.displayColors?u+2:0,ut.each(o,function(t){ut.each(t.before,f),ut.each(t.lines,f),ut.each(t.after,f)}),c=0,i.font=ut.fontString(h,e._footerFontStyle,e._footerFontFamily),ut.each(e.footer,f),{width:a+=2*e.xPadding,height:n}}(this,g),b=function(t,e,i,n){var a=t.x,o=t.y,r=t.caretSize,s=t.caretPadding,l=t.cornerRadius,d=i.xAlign,u=i.yAlign,h=r+s,c=l+s;return"right"===d?a-=e.width:"center"===d&&((a-=e.width/2)+e.width>n.width&&(a=n.width-e.width),a<0&&(a=0)),"top"===u?o+=h:o-="bottom"===u?e.height+h:e.height/2,"center"===u?"left"===d?a+=h:"right"===d&&(a-=h):"left"===d?a-=c:"right"===d&&(a+=c),{x:a,y:o}}(g,x,v=function(t,e){var i,n,a,o,r,s=t._model,l=t._chart,d=t._chart.chartArea,u="center",h="center";s.y<e.height?h="top":s.y>l.height-e.height&&(h="bottom");var c=(d.left+d.right)/2,f=(d.top+d.bottom)/2;"center"===h?(i=function(t){return t<=c},n=function(t){return t>c}):(i=function(t){return t<=e.width/2},n=function(t){return t>=l.width-e.width/2}),a=function(t){return t+e.width+s.caretSize+s.caretPadding>l.width},o=function(t){return t-e.width-s.caretSize-s.caretPadding<0},r=function(t){return t<=f?"top":"bottom"},i(s.x)?(u="left",a(s.x)&&(u="center",h=r(s.y))):n(s.x)&&(u="right",o(s.x)&&(u="center",h=r(s.y)));var g=t._options;return{xAlign:g.xAlign?g.xAlign:u,yAlign:g.yAlign?g.yAlign:h}}(this,x),h._chart)}else g.opacity=0;return g.xAlign=v.xAlign,g.yAlign=v.yAlign,g.x=b.x,g.y=b.y,g.width=x.width,g.height=x.height,g.caretX=y.x,g.caretY=y.y,h._model=g,t&&c.custom&&c.custom.call(h,g),h},drawCaret:function(t,e){var i=this._chart.ctx,n=this._view,a=this.getCaretPosition(t,e,n);i.lineTo(a.x1,a.y1),i.lineTo(a.x2,a.y2),i.lineTo(a.x3,a.y3)},getCaretPosition:function(t,e,i){var n,a,o,r,s,l,d=i.caretSize,u=i.cornerRadius,h=i.xAlign,c=i.yAlign,f=t.x,g=t.y,p=e.width,m=e.height;if("center"===c)s=g+m/2,"left"===h?(a=(n=f)-d,o=n,r=s+d,l=s-d):(a=(n=f+p)+d,o=n,r=s-d,l=s+d);else if("left"===h?(n=(a=f+u+d)-d,o=a+d):"right"===h?(n=(a=f+p-u-d)-d,o=a+d):(n=(a=i.caretX)-d,o=a+d),"top"===c)s=(r=g)-d,l=r;else{s=(r=g+m)+d,l=r;var v=o;o=n,n=v}return{x1:n,x2:a,x3:o,y1:r,y2:s,y3:l}},drawTitle:function(t,e,i){var n=e.title;if(n.length){t.x=Ke(e,e._titleAlign),i.textAlign=e._titleAlign,i.textBaseline="top";var a,o,r=e.titleFontSize,s=e.titleSpacing;for(i.fillStyle=e.titleFontColor,i.font=ut.fontString(r,e._titleFontStyle,e._titleFontFamily),a=0,o=n.length;a<o;++a)i.fillText(n[a],t.x,t.y),t.y+=r+s,a+1===n.length&&(t.y+=e.titleMarginBottom-s)}},drawBody:function(t,e,i){var n,a=e.bodyFontSize,o=e.bodySpacing,r=e._bodyAlign,s=e.body,l=e.displayColors,d=e.labelColors,u=0,h=l?Ke(e,"left"):0;i.textAlign=r,i.textBaseline="top",i.font=ut.fontString(a,e._bodyFontStyle,e._bodyFontFamily),t.x=Ke(e,r);var c=function(e){i.fillText(e,t.x+u,t.y),t.y+=a+o};i.fillStyle=e.bodyFontColor,ut.each(e.beforeBody,c),u=l&&"right"!==r?"center"===r?a/2+1:a+2:0,ut.each(s,function(o,r){n=e.labelTextColors[r],i.fillStyle=n,ut.each(o.before,c),ut.each(o.lines,function(o){l&&(i.fillStyle=e.legendColorBackground,i.fillRect(h,t.y,a,a),i.lineWidth=1,i.strokeStyle=d[r].borderColor,i.strokeRect(h,t.y,a,a),i.fillStyle=d[r].backgroundColor,i.fillRect(h+1,t.y+1,a-2,a-2),i.fillStyle=n),c(o)}),ut.each(o.after,c)}),u=0,ut.each(e.afterBody,c),t.y-=o},drawFooter:function(t,e,i){var n=e.footer;n.length&&(t.x=Ke(e,e._footerAlign),t.y+=e.footerMarginTop,i.textAlign=e._footerAlign,i.textBaseline="top",i.fillStyle=e.footerFontColor,i.font=ut.fontString(e.footerFontSize,e._footerFontStyle,e._footerFontFamily),ut.each(n,function(n){i.fillText(n,t.x,t.y),t.y+=e.footerFontSize+e.footerSpacing}))},drawBackground:function(t,e,i,n){i.fillStyle=e.backgroundColor,i.strokeStyle=e.borderColor,i.lineWidth=e.borderWidth;var a=e.xAlign,o=e.yAlign,r=t.x,s=t.y,l=n.width,d=n.height,u=e.cornerRadius;i.beginPath(),i.moveTo(r+u,s),"top"===o&&this.drawCaret(t,n),i.lineTo(r+l-u,s),i.quadraticCurveTo(r+l,s,r+l,s+u),"center"===o&&"right"===a&&this.drawCaret(t,n),i.lineTo(r+l,s+d-u),i.quadraticCurveTo(r+l,s+d,r+l-u,s+d),"bottom"===o&&this.drawCaret(t,n),i.lineTo(r+u,s+d),i.quadraticCurveTo(r,s+d,r,s+d-u),"center"===o&&"left"===a&&this.drawCaret(t,n),i.lineTo(r,s+u),i.quadraticCurveTo(r,s,r+u,s),i.closePath(),i.fill(),e.borderWidth>0&&i.stroke()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var i={width:e.width,height:e.height},n={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&&(t.save(),t.globalAlpha=a,this.drawBackground(n,e,t,i),n.y+=e.yPadding,this.drawTitle(n,e,t),this.drawBody(n,e,t),this.drawFooter(n,e,t),t.restore())}},handleEvent:function(t){var e,i=this,n=i._options;return i._lastActive=i._lastActive||[],"mouseout"===t.type?i._active=[]:i._active=i._chart.getElementsAtEventForMode(t,n.mode,n),(e=!ut.arrayEquals(i._active,i._lastActive))&&(i._lastActive=i._active,(n.enabled||n.custom)&&(i._eventPosition={x:t.x,y:t.y},i.update(!0),i.pivot())),e}}),$e=qe,Je=Ze;Je.positioners=$e;var Qe=ut.valueOrDefault;function ti(){return ut.merge({},[].slice.call(arguments),{merger:function(t,e,i,n){if("xAxes"===t||"yAxes"===t){var a,o,r,s=i[t].length;for(e[t]||(e[t]=[]),a=0;a<s;++a)r=i[t][a],o=Qe(r.type,"xAxes"===t?"category":"linear"),a>=e[t].length&&e[t].push({}),!e[t][a].type||r.type&&r.type!==e[t][a].type?ut.merge(e[t][a],[He.getScaleDefaults(o),r]):ut.merge(e[t][a],r)}else ut._merger(t,e,i,n)}})}function ei(){return ut.merge({},[].slice.call(arguments),{merger:function(t,e,i,n){var a=e[t]||{},o=i[t];"scales"===t?e[t]=ti(a,o):"scale"===t?e[t]=ut.merge(a,[He.getScaleDefaults(o.type),o]):ut._merger(t,e,i,n)}})}function ii(t){return"top"===t||"bottom"===t}st._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});var ni=function(t,e){return this.construct(t,e),this};ut.extend(ni.prototype,{construct:function(t,e){var i=this;e=function(t){var e=(t=t||{}).data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=ei(st.global,st[t.type],t.options||{}),t}(e);var n=Ve.acquireContext(t,e),a=n&&n.canvas,o=a&&a.height,r=a&&a.width;i.id=ut.uid(),i.ctx=n,i.canvas=a,i.config=e,i.width=r,i.height=o,i.aspectRatio=o?r/o:null,i.options=e.options,i._bufferedRender=!1,i.chart=i,i.controller=i,ni.instances[i.id]=i,Object.defineProperty(i,"data",{get:function(){return i.config.data},set:function(t){i.config.data=t}}),n&&a?(i.initialize(),i.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return Ee.notify(t,"beforeInit"),ut.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.ensureScalesHaveIDs(),t.buildOrUpdateScales(),t.initToolTip(),Ee.notify(t,"afterInit"),t},clear:function(){return ut.canvas.clear(this),this},stop:function(){return bt.cancelAnimation(this),this},resize:function(t){var e=this,i=e.options,n=e.canvas,a=i.maintainAspectRatio&&e.aspectRatio||null,o=Math.max(0,Math.floor(ut.getMaximumWidth(n))),r=Math.max(0,Math.floor(a?o/a:ut.getMaximumHeight(n)));if((e.width!==o||e.height!==r)&&(n.width=e.width=o,n.height=e.height=r,n.style.width=o+"px",n.style.height=r+"px",ut.retinaScale(e,i.devicePixelRatio),!t)){var s={width:o,height:r};Ee.notify(e,"resize",[s]),i.onResize&&i.onResize(e,s),e.stop(),e.update({duration:i.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},i=t.scale;ut.each(e.xAxes,function(t,e){t.id=t.id||"x-axis-"+e}),ut.each(e.yAxes,function(t,e){t.id=t.id||"y-axis-"+e}),i&&(i.id=i.id||"scale")},buildOrUpdateScales:function(){var t=this,e=t.options,i=t.scales||{},n=[],a=Object.keys(i).reduce(function(t,e){return t[e]=!1,t},{});e.scales&&(n=n.concat((e.scales.xAxes||[]).map(function(t){return{options:t,dtype:"category",dposition:"bottom"}}),(e.scales.yAxes||[]).map(function(t){return{options:t,dtype:"linear",dposition:"left"}}))),e.scale&&n.push({options:e.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),ut.each(n,function(e){var n=e.options,o=n.id,r=Qe(n.type,e.dtype);ii(n.position)!==ii(e.dposition)&&(n.position=e.dposition),a[o]=!0;var s=null;if(o in i&&i[o].type===r)(s=i[o]).options=n,s.ctx=t.ctx,s.chart=t;else{var l=He.getScaleConstructor(r);if(!l)return;s=new l({id:o,type:r,options:n,ctx:t.ctx,chart:t}),i[s.id]=s}s.mergeTicksOptions(),e.isDefault&&(t.scale=s)}),ut.each(a,function(t,e){t||delete i[e]}),t.scales=i,He.addScalesToLayout(this)},buildOrUpdateControllers:function(){var t=this,e=[];return ut.each(t.data.datasets,function(i,n){var a=t.getDatasetMeta(n),o=i.type||t.config.type;if(a.type&&a.type!==o&&(t.destroyDatasetMeta(n),a=t.getDatasetMeta(n)),a.type=o,a.controller)a.controller.updateIndex(n),a.controller.linkScales();else{var r=ue[a.type];if(void 0===r)throw new Error('"'+a.type+'" is not a chart type.');a.controller=new r(t,n),e.push(a.controller)}},t),e},resetElements:function(){var t=this;ut.each(t.data.datasets,function(e,i){t.getDatasetMeta(i).controller.reset()},t)},reset:function(){this.resetElements(),this.tooltip.initialize()},update:function(t){var e,i,n=this;if(t&&"object"==typeof t||(t={duration:t,lazy:arguments[1]}),i=(e=n).options,ut.each(e.scales,function(t){ke.removeBox(e,t)}),i=ei(st.global,st[e.config.type],i),e.options=e.config.options=i,e.ensureScalesHaveIDs(),e.buildOrUpdateScales(),e.tooltip._options=i.tooltips,e.tooltip.initialize(),Ee._invalidate(n),!1!==Ee.notify(n,"beforeUpdate")){n.tooltip._data=n.data;var a=n.buildOrUpdateControllers();ut.each(n.data.datasets,function(t,e){n.getDatasetMeta(e).controller.buildOrUpdateElements()},n),n.updateLayout(),n.options.animation&&n.options.animation.duration&&ut.each(a,function(t){t.reset()}),n.updateDatasets(),n.tooltip.initialize(),n.lastActive=[],Ee.notify(n,"afterUpdate"),n._bufferedRender?n._bufferedRequest={duration:t.duration,easing:t.easing,lazy:t.lazy}:n.render(t)}},updateLayout:function(){!1!==Ee.notify(this,"beforeLayout")&&(ke.update(this,this.width,this.height),Ee.notify(this,"afterScaleUpdate"),Ee.notify(this,"afterLayout"))},updateDatasets:function(){if(!1!==Ee.notify(this,"beforeDatasetsUpdate")){for(var t=0,e=this.data.datasets.length;t<e;++t)this.updateDataset(t);Ee.notify(this,"afterDatasetsUpdate")}},updateDataset:function(t){var e=this.getDatasetMeta(t),i={meta:e,index:t};!1!==Ee.notify(this,"beforeDatasetUpdate",[i])&&(e.controller.update(),Ee.notify(this,"afterDatasetUpdate",[i]))},render:function(t){var e=this;t&&"object"==typeof t||(t={duration:t,lazy:arguments[1]});var i=e.options.animation,n=Qe(t.duration,i&&i.duration),a=t.lazy;if(!1!==Ee.notify(e,"beforeRender")){var o=function(t){Ee.notify(e,"afterRender"),ut.callback(i&&i.onComplete,[t],e)};if(i&&n){var r=new vt({numSteps:n/16.66,easing:t.easing||i.easing,render:function(t,e){var i=ut.easing.effects[e.easing],n=e.currentStep,a=n/e.numSteps;t.draw(i(a),a,n)},onAnimationProgress:i.onProgress,onAnimationComplete:o});bt.addAnimation(e,r,n,a)}else e.draw(),o(new vt({numSteps:0,chart:e}));return e}},draw:function(t){var e=this;e.clear(),ut.isNullOrUndef(t)&&(t=1),e.transition(t),e.width<=0||e.height<=0||!1!==Ee.notify(e,"beforeDraw",[t])&&(ut.each(e.boxes,function(t){t.draw(e.chartArea)},e),e.drawDatasets(t),e._drawTooltip(t),Ee.notify(e,"afterDraw",[t]))},transition:function(t){for(var e=0,i=(this.data.datasets||[]).length;e<i;++e)this.isDatasetVisible(e)&&this.getDatasetMeta(e).controller.transition(t);this.tooltip.transition(t)},drawDatasets:function(t){var e=this;if(!1!==Ee.notify(e,"beforeDatasetsDraw",[t])){for(var i=(e.data.datasets||[]).length-1;i>=0;--i)e.isDatasetVisible(i)&&e.drawDataset(i,t);Ee.notify(e,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var i=this.getDatasetMeta(t),n={meta:i,index:t,easingValue:e};!1!==Ee.notify(this,"beforeDatasetDraw",[n])&&(i.controller.draw(e),Ee.notify(this,"afterDatasetDraw",[n]))},_drawTooltip:function(t){var e=this.tooltip,i={tooltip:e,easingValue:t};!1!==Ee.notify(this,"beforeTooltipDraw",[i])&&(e.draw(),Ee.notify(this,"afterTooltipDraw",[i]))},getElementAtEvent:function(t){return ve.modes.single(this,t)},getElementsAtEvent:function(t){return ve.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return ve.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,i){var n=ve.modes[e];return"function"==typeof n?n(this,t,i):[]},getDatasetAtEvent:function(t){return ve.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this.data.datasets[t];e._meta||(e._meta={});var i=e._meta[this.id];return i||(i=e._meta[this.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null}),i},getVisibleDatasetCount:function(){for(var t=0,e=0,i=this.data.datasets.length;e<i;++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,i=this.data.datasets[t],n=i._meta&&i._meta[e];n&&(n.controller.destroy(),delete i._meta[e])},destroy:function(){var t,e,i=this,n=i.canvas;for(i.stop(),t=0,e=i.data.datasets.length;t<e;++t)i.destroyDatasetMeta(t);n&&(i.unbindEvents(),ut.canvas.clear(i),Ve.releaseContext(i.ctx),i.canvas=null,i.ctx=null),Ee.notify(i,"destroy"),delete ni.instances[i.id]},toBase64Image:function(){return this.canvas.toDataURL.apply(this.canvas,arguments)},initToolTip:function(){var t=this;t.tooltip=new Je({_chart:t,_chartInstance:t,_data:t.data,_options:t.options.tooltips},t)},bindEvents:function(){var t=this,e=t._listeners={},i=function(){t.eventHandler.apply(t,arguments)};ut.each(t.options.events,function(n){Ve.addEventListener(t,n,i),e[n]=i}),t.options.responsive&&(i=function(){t.resize()},Ve.addEventListener(t,"resize",i),e.resize=i)},unbindEvents:function(){var t=this,e=t._listeners;e&&(delete t._listeners,ut.each(e,function(e,i){Ve.removeEventListener(t,i,e)}))},updateHoverStyle:function(t,e,i){var n,a,o,r=i?"setHoverStyle":"removeHoverStyle";for(a=0,o=t.length;a<o;++a)(n=t[a])&&this.getDatasetMeta(n._datasetIndex).controller[r](n)},eventHandler:function(t){var e=this,i=e.tooltip;if(!1!==Ee.notify(e,"beforeEvent",[t])){e._bufferedRender=!0,e._bufferedRequest=null;var n=e.handleEvent(t);i&&(n=i._start?i.handleEvent(t):n|i.handleEvent(t)),Ee.notify(e,"afterEvent",[t]);var a=e._bufferedRequest;return a?e.render(a):n&&!e.animating&&(e.stop(),e.render({duration:e.options.hover.animationDuration,lazy:!0})),e._bufferedRender=!1,e._bufferedRequest=null,e}},handleEvent:function(t){var e,i=this,n=i.options||{},a=n.hover;return i.lastActive=i.lastActive||[],"mouseout"===t.type?i.active=[]:i.active=i.getElementsAtEventForMode(t,a.mode,a),ut.callback(n.onHover||n.hover.onHover,[t.native,i.active],i),"mouseup"!==t.type&&"click"!==t.type||n.onClick&&n.onClick.call(i,t.native,i.active),i.lastActive.length&&i.updateHoverStyle(i.lastActive,a.mode,!1),i.active.length&&a.mode&&i.updateHoverStyle(i.active,a.mode,!0),e=!ut.arrayEquals(i.active,i.lastActive),i.lastActive=i.active,e}}),ni.instances={};var ai=ni;ni.Controller=ni,ni.types={},ut.configMerge=ei,ut.scaleMerge=ti;function oi(){throw new Error("This method is not implemented: either no adapter can be found or an incomplete integration was provided.")}function ri(t){this.options=t||{}}ut.extend(ri.prototype,{formats:oi,parse:oi,format:oi,add:oi,diff:oi,startOf:oi,endOf:oi,_create:function(t){return t}}),ri.override=function(t){ut.extend(ri.prototype,t)};var si={_date:ri},li={formatters:{values:function(t){return ut.isArray(t)?t:""+t},linear:function(t,e,i){var n=i.length>3?i[2]-i[1]:i[1]-i[0];Math.abs(n)>1&&t!==Math.floor(t)&&(n=t-Math.floor(t));var a=ut.log10(Math.abs(n)),o="";if(0!==t)if(Math.max(Math.abs(i[0]),Math.abs(i[i.length-1]))<1e-4){var r=ut.log10(Math.abs(t));o=t.toExponential(Math.floor(r)-Math.floor(a))}else{var s=-1*Math.floor(a);s=Math.max(Math.min(s,20),0),o=t.toFixed(s)}else o="0";return o},logarithmic:function(t,e,i){var n=t/Math.pow(10,Math.floor(ut.log10(t)));return 0===t?"0":1===n||2===n||5===n||0===e||e===i.length-1?t.toExponential():""}}},di=ut.valueOrDefault,ui=ut.valueAtIndexOrDefault;function hi(t){var e,i,n=[];for(e=0,i=t.length;e<i;++e)n.push(t[e].label);return n}function ci(t,e,i){return ut.isArray(e)?ut.longestText(t,i,e):t.measureText(e).width}st._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:"",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:li.formatters.values,minor:{},major:{}}});var fi=pt.extend({getPadding:function(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}},getTicks:function(){return this._ticks},mergeTicksOptions:function(){var t=this.options.ticks;for(var e in!1===t.minor&&(t.minor={display:!1}),!1===t.major&&(t.major={display:!1}),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(){ut.callback(this.options.beforeUpdate,[this])},update:function(t,e,i){var n,a,o,r,s,l,d=this;for(d.beforeUpdate(),d.maxWidth=t,d.maxHeight=e,d.margins=ut.extend({left:0,right:0,top:0,bottom:0},i),d._maxLabelLines=0,d.longestLabelWidth=0,d.longestTextCache=d.longestTextCache||{},d.beforeSetDimensions(),d.setDimensions(),d.afterSetDimensions(),d.beforeDataLimits(),d.determineDataLimits(),d.afterDataLimits(),d.beforeBuildTicks(),s=d.buildTicks()||[],s=d.afterBuildTicks(s)||s,d.beforeTickToLabelConversion(),o=d.convertTicksToLabels(s)||d.ticks,d.afterTickToLabelConversion(),d.ticks=o,n=0,a=o.length;n<a;++n)r=o[n],(l=s[n])?l.label=r:s.push(l={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(){ut.callback(this.options.afterUpdate,[this])},beforeSetDimensions:function(){ut.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(){ut.callback(this.options.afterSetDimensions,[this])},beforeDataLimits:function(){ut.callback(this.options.beforeDataLimits,[this])},determineDataLimits:ut.noop,afterDataLimits:function(){ut.callback(this.options.afterDataLimits,[this])},beforeBuildTicks:function(){ut.callback(this.options.beforeBuildTicks,[this])},buildTicks:ut.noop,afterBuildTicks:function(t){var e=this;return ut.isArray(t)&&t.length?ut.callback(e.options.afterBuildTicks,[e,t]):(e.ticks=ut.callback(e.options.afterBuildTicks,[e,e.ticks])||e.ticks,t)},beforeTickToLabelConversion:function(){ut.callback(this.options.beforeTickToLabelConversion,[this])},convertTicksToLabels:function(){var t=this.options.ticks;this.ticks=this.ticks.map(t.userCallback||t.callback,this)},afterTickToLabelConversion:function(){ut.callback(this.options.afterTickToLabelConversion,[this])},beforeCalculateTickRotation:function(){ut.callback(this.options.beforeCalculateTickRotation,[this])},calculateTickRotation:function(){var t=this,e=t.ctx,i=t.options.ticks,n=hi(t._ticks),a=ut.options._parseFont(i);e.font=a.string;var o=i.minRotation||0;if(n.length&&t.options.display&&t.isHorizontal())for(var r,s=ut.longestText(e,a.string,n,t.longestTextCache),l=s,d=t.getPixelForTick(1)-t.getPixelForTick(0)-6;l>d&&o<i.maxRotation;){var u=ut.toRadians(o);if(r=Math.cos(u),Math.sin(u)*s>t.maxHeight){o--;break}o++,l=r*s}t.labelRotation=o},afterCalculateTickRotation:function(){ut.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){ut.callback(this.options.beforeFit,[this])},fit:function(){var t=this,e=t.minSize={width:0,height:0},i=hi(t._ticks),n=t.options,a=n.ticks,o=n.scaleLabel,r=n.gridLines,s=t._isVisible(),l=n.position,d=t.isHorizontal(),u=ut.options._parseFont,h=u(a),c=n.gridLines.tickMarkLength;if(e.width=d?t.isFullWidth()?t.maxWidth-t.margins.left-t.margins.right:t.maxWidth:s&&r.drawTicks?c:0,e.height=d?s&&r.drawTicks?c:0:t.maxHeight,o.display&&s){var f=u(o),g=ut.options.toPadding(o.padding),p=f.lineHeight+g.height;d?e.height+=p:e.width+=p}if(a.display&&s){var m=ut.longestText(t.ctx,h.string,i,t.longestTextCache),v=ut.numberOfLabelLines(i),b=.5*h.size,x=t.options.ticks.padding;if(t._maxLabelLines=v,t.longestLabelWidth=m,d){var y=ut.toRadians(t.labelRotation),k=Math.cos(y),w=Math.sin(y)*m+h.lineHeight*v+b;e.height=Math.min(t.maxHeight,e.height+w+x),t.ctx.font=h.string;var M,_,C=ci(t.ctx,i[0],h.string),S=ci(t.ctx,i[i.length-1],h.string),P=t.getPixelForTick(0)-t.left,I=t.right-t.getPixelForTick(i.length-1);0!==t.labelRotation?(M="bottom"===l?k*C:k*b,_="bottom"===l?k*b:k*S):(M=C/2,_=S/2),t.paddingLeft=Math.max(M-P,0)+3,t.paddingRight=Math.max(_-I,0)+3}else a.mirror?m=0:m+=x+b,e.width=Math.min(t.maxWidth,e.width+m),t.paddingTop=h.size/2,t.paddingBottom=h.size/2}t.handleMargins(),t.width=e.width,t.height=e.height},handleMargins:function(){var t=this;t.margins&&(t.paddingLeft=Math.max(t.paddingLeft-t.margins.left,0),t.paddingTop=Math.max(t.paddingTop-t.margins.top,0),t.paddingRight=Math.max(t.paddingRight-t.margins.right,0),t.paddingBottom=Math.max(t.paddingBottom-t.margins.bottom,0))},afterFit:function(){ut.callback(this.options.afterFit,[this])},isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){if(ut.isNullOrUndef(t))return NaN;if(("number"==typeof t||t instanceof Number)&&!isFinite(t))return NaN;if(t)if(this.isHorizontal()){if(void 0!==t.x)return this.getRightValue(t.x)}else if(void 0!==t.y)return this.getRightValue(t.y);return t},getLabelForIndex:ut.noop,getPixelForValue:ut.noop,getValueForPixel:ut.noop,getPixelForTick:function(t){var e=this,i=e.options.offset;if(e.isHorizontal()){var n=(e.width-(e.paddingLeft+e.paddingRight))/Math.max(e._ticks.length-(i?0:1),1),a=n*t+e.paddingLeft;i&&(a+=n/2);var o=e.left+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 i=(e.width-(e.paddingLeft+e.paddingRight))*t+e.paddingLeft,n=e.left+i;return n+=e.isFullWidth()?e.margins.left:0}return e.top+t*e.height},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var t=this.min,e=this.max;return this.beginAtZero?0:t<0&&e<0?e:t>0&&e>0?t:0},_autoSkip:function(t){var e,i,n=this,a=n.isHorizontal(),o=n.options.ticks.minor,r=t.length,s=!1,l=o.maxTicksLimit,d=n._tickSize()*(r-1),u=a?n.width-(n.paddingLeft+n.paddingRight):n.height-(n.paddingTop+n.PaddingBottom),h=[];for(d>u&&(s=1+Math.floor(d/u)),r>l&&(s=Math.max(s,1+Math.floor(r/l))),e=0;e<r;e++)i=t[e],s>1&&e%s>0&&delete i.label,h.push(i);return h},_tickSize:function(){var t=this,e=t.isHorizontal(),i=t.options.ticks.minor,n=ut.toRadians(t.labelRotation),a=Math.abs(Math.cos(n)),o=Math.abs(Math.sin(n)),r=i.autoSkipPadding||0,s=t.longestLabelWidth+r||0,l=ut.options._parseFont(i),d=t._maxLabelLines*l.lineHeight+r||0;return e?d*a>s*o?s/a:d/o:d*o<s*a?d/a:s/o},_isVisible:function(){var t,e,i,n=this.chart,a=this.options.display;if("auto"!==a)return!!a;for(t=0,e=n.data.datasets.length;t<e;++t)if(n.isDatasetVisible(t)&&((i=n.getDatasetMeta(t)).xAxisID===this.id||i.yAxisID===this.id))return!0;return!1},draw:function(t){var e=this,i=e.options;if(e._isVisible()){var n,a,o,r=e.chart,s=e.ctx,l=st.global.defaultFontColor,d=i.ticks.minor,u=i.ticks.major||d,h=i.gridLines,c=i.scaleLabel,f=i.position,g=0!==e.labelRotation,p=d.mirror,m=e.isHorizontal(),v=ut.options._parseFont,b=d.display&&d.autoSkip?e._autoSkip(e.getTicks()):e.getTicks(),x=di(d.fontColor,l),y=v(d),k=y.lineHeight,w=di(u.fontColor,l),M=v(u),_=d.padding,C=d.labelOffset,S=h.drawTicks?h.tickMarkLength:0,P=di(c.fontColor,l),I=v(c),A=ut.options.toPadding(c.padding),D=ut.toRadians(e.labelRotation),T=[],F=h.drawBorder?ui(h.lineWidth,0,0):0,L=ut._alignPixel;"top"===f?(n=L(r,e.bottom,F),a=e.bottom-S,o=n-F/2):"bottom"===f?(n=L(r,e.top,F),a=n+F/2,o=e.top+S):"left"===f?(n=L(r,e.right,F),a=e.right-S,o=n-F/2):(n=L(r,e.left,F),a=n+F/2,o=e.left+S);if(ut.each(b,function(n,s){if(!ut.isNullOrUndef(n.label)){var l,d,u,c,v,b,x,y,w,M,P,I,A,R,O,z,B=n.label;s===e.zeroLineIndex&&i.offset===h.offsetGridLines?(l=h.zeroLineWidth,d=h.zeroLineColor,u=h.zeroLineBorderDash||[],c=h.zeroLineBorderDashOffset||0):(l=ui(h.lineWidth,s),d=ui(h.color,s),u=h.borderDash||[],c=h.borderDashOffset||0);var N=ut.isArray(B)?B.length:1,W=function(t,e,i){var n=t.getPixelForTick(e);return i&&(1===t.getTicks().length?n-=t.isHorizontal()?Math.max(n-t.left,t.right-n):Math.max(n-t.top,t.bottom-n):n-=0===e?(t.getPixelForTick(1)-n)/2:(n-t.getPixelForTick(e-1))/2),n}(e,s,h.offsetGridLines);if(m){var V=S+_;W<e.left-1e-7&&(d="rgba(0,0,0,0)"),v=x=w=P=L(r,W,l),b=a,y=o,A=e.getPixelForTick(s)+C,"top"===f?(M=L(r,t.top,F)+F/2,I=t.bottom,O=((g?1:.5)-N)*k,z=g?"left":"center",R=e.bottom-V):(M=t.top,I=L(r,t.bottom,F)-F/2,O=(g?0:.5)*k,z=g?"right":"center",R=e.top+V)}else{var E=(p?0:S)+_;W<e.top-1e-7&&(d="rgba(0,0,0,0)"),v=a,x=o,b=y=M=I=L(r,W,l),R=e.getPixelForTick(s)+C,O=(1-N)*k/2,"left"===f?(w=L(r,t.left,F)+F/2,P=t.right,z=p?"left":"right",A=e.right-E):(w=t.left,P=L(r,t.right,F)-F/2,z=p?"right":"left",A=e.left+E)}T.push({tx1:v,ty1:b,tx2:x,ty2:y,x1:w,y1:M,x2:P,y2:I,labelX:A,labelY:R,glWidth:l,glColor:d,glBorderDash:u,glBorderDashOffset:c,rotation:-1*D,label:B,major:n.major,textOffset:O,textAlign:z})}}),ut.each(T,function(t){var e=t.glWidth,i=t.glColor;if(h.display&&e&&i&&(s.save(),s.lineWidth=e,s.strokeStyle=i,s.setLineDash&&(s.setLineDash(t.glBorderDash),s.lineDashOffset=t.glBorderDashOffset),s.beginPath(),h.drawTicks&&(s.moveTo(t.tx1,t.ty1),s.lineTo(t.tx2,t.ty2)),h.drawOnChartArea&&(s.moveTo(t.x1,t.y1),s.lineTo(t.x2,t.y2)),s.stroke(),s.restore()),d.display){s.save(),s.translate(t.labelX,t.labelY),s.rotate(t.rotation),s.font=t.major?M.string:y.string,s.fillStyle=t.major?w:x,s.textBaseline="middle",s.textAlign=t.textAlign;var n=t.label,a=t.textOffset;if(ut.isArray(n))for(var o=0;o<n.length;++o)s.fillText(""+n[o],0,a),a+=k;else s.fillText(n,0,a);s.restore()}}),c.display){var R,O,z=0,B=I.lineHeight/2;if(m)R=e.left+(e.right-e.left)/2,O="bottom"===f?e.bottom-B-A.bottom:e.top+B+A.top;else{var N="left"===f;R=N?e.left+B+A.top:e.right-B-A.top,O=e.top+(e.bottom-e.top)/2,z=N?-.5*Math.PI:.5*Math.PI}s.save(),s.translate(R,O),s.rotate(z),s.textAlign="center",s.textBaseline="middle",s.fillStyle=P,s.font=I.string,s.fillText(c.labelString,0,0),s.restore()}if(F){var W,V,E,H,j=F,q=ui(h.lineWidth,b.length-1,0);m?(W=L(r,e.left,j)-j/2,V=L(r,e.right,q)+q/2,E=H=n):(E=L(r,e.top,j)-j/2,H=L(r,e.bottom,q)+q/2,W=V=n),s.lineWidth=F,s.strokeStyle=ui(h.color,0),s.beginPath(),s.moveTo(W,E),s.lineTo(V,H),s.stroke()}}}}),gi=fi.extend({getLabels:function(){var t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels},determineDataLimits:function(){var t,e=this,i=e.getLabels();e.minIndex=0,e.maxIndex=i.length-1,void 0!==e.options.ticks.min&&(t=i.indexOf(e.options.ticks.min),e.minIndex=-1!==t?t:e.minIndex),void 0!==e.options.ticks.max&&(t=i.indexOf(e.options.ticks.max),e.maxIndex=-1!==t?t:e.maxIndex),e.min=i[e.minIndex],e.max=i[e.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 i=this,n=i.chart;return n.getDatasetMeta(e).controller._getValueScaleId()===i.id?i.getRightValue(n.data.datasets[e].data[t]):i.ticks[t-i.minIndex]},getPixelForValue:function(t,e){var i,n=this,a=n.options.offset,o=Math.max(n.maxIndex+1-n.minIndex-(a?0:1),1);if(null!=t&&(i=n.isHorizontal()?t.x:t.y),void 0!==i||void 0!==t&&isNaN(e)){t=i||t;var r=n.getLabels().indexOf(t);e=-1!==r?r:e}if(n.isHorizontal()){var s=n.width/o,l=s*(e-n.minIndex);return a&&(l+=s/2),n.left+l}var d=n.height/o,u=d*(e-n.minIndex);return a&&(u+=d/2),n.top+u},getPixelForTick:function(t){return this.getPixelForValue(this.ticks[t],t+this.minIndex,null)},getValueForPixel:function(t){var e=this,i=e.options.offset,n=Math.max(e._ticks.length-(i?0:1),1),a=e.isHorizontal(),o=(a?e.width:e.height)/n;return t-=a?e.left:e.top,i&&(t-=o/2),(t<=0?0:Math.round(t/o))+e.minIndex},getBasePixel:function(){return this.bottom}}),pi={position:"bottom"};gi._defaults=pi;var mi=ut.noop,vi=ut.isNullOrUndef;var bi=fi.extend({getRightValue:function(t){return"string"==typeof t?+t:fi.prototype.getRightValue.call(this,t)},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;if(e.beginAtZero){var i=ut.sign(t.min),n=ut.sign(t.max);i<0&&n<0?t.max=0:i>0&&n>0&&(t.min=0)}var a=void 0!==e.min||void 0!==e.suggestedMin,o=void 0!==e.max||void 0!==e.suggestedMax;void 0!==e.min?t.min=e.min:void 0!==e.suggestedMin&&(null===t.min?t.min=e.suggestedMin:t.min=Math.min(t.min,e.suggestedMin)),void 0!==e.max?t.max=e.max:void 0!==e.suggestedMax&&(null===t.max?t.max=e.suggestedMax:t.max=Math.max(t.max,e.suggestedMax)),a!==o&&t.min>=t.max&&(a?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,e.beginAtZero||t.min--)},getTickLimit:function(){var t,e=this.options.ticks,i=e.stepSize,n=e.maxTicksLimit;return i?t=Math.ceil(this.max/i)-Math.floor(this.min/i)+1:(t=this._computeTickLimit(),n=n||11),n&&(t=Math.min(n,t)),t},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:mi,buildTicks:function(){var t=this,e=t.options.ticks,i=t.getTickLimit(),n={maxTicks:i=Math.max(2,i),min:e.min,max:e.max,precision:e.precision,stepSize:ut.valueOrDefault(e.fixedStepSize,e.stepSize)},a=t.ticks=function(t,e){var i,n,a,o,r=[],s=t.stepSize,l=s||1,d=t.maxTicks-1,u=t.min,h=t.max,c=t.precision,f=e.min,g=e.max,p=ut.niceNum((g-f)/d/l)*l;if(p<1e-14&&vi(u)&&vi(h))return[f,g];(o=Math.ceil(g/p)-Math.floor(f/p))>d&&(p=ut.niceNum(o*p/d/l)*l),s||vi(c)?i=Math.pow(10,ut._decimalPlaces(p)):(i=Math.pow(10,c),p=Math.ceil(p*i)/i),n=Math.floor(f/p)*p,a=Math.ceil(g/p)*p,s&&(!vi(u)&&ut.almostWhole(u/p,p/1e3)&&(n=u),!vi(h)&&ut.almostWhole(h/p,p/1e3)&&(a=h)),o=(a-n)/p,o=ut.almostEquals(o,Math.round(o),p/1e3)?Math.round(o):Math.ceil(o),n=Math.round(n*i)/i,a=Math.round(a*i)/i,r.push(vi(u)?n:u);for(var m=1;m<o;++m)r.push(Math.round((n+m*p)*i)/i);return r.push(vi(h)?a:h),r}(n,t);t.handleDirectionalChanges(),t.max=ut.max(a),t.min=ut.min(a),e.reverse?(a.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max)},convertTicksToLabels:function(){var t=this;t.ticksAsNumbers=t.ticks.slice(),t.zeroLineIndex=t.ticks.indexOf(0),fi.prototype.convertTicksToLabels.call(t)}}),xi={position:"left",ticks:{callback:li.formatters.linear}},yi=bi.extend({determineDataLimits:function(){var t=this,e=t.options,i=t.chart,n=i.data.datasets,a=t.isHorizontal();function o(e){return a?e.xAxisID===t.id:e.yAxisID===t.id}t.min=null,t.max=null;var r=e.stacked;if(void 0===r&&ut.each(n,function(t,e){if(!r){var n=i.getDatasetMeta(e);i.isDatasetVisible(e)&&o(n)&&void 0!==n.stack&&(r=!0)}}),e.stacked||r){var s={};ut.each(n,function(n,a){var r=i.getDatasetMeta(a),l=[r.type,void 0===e.stacked&&void 0===r.stack?a:"",r.stack].join(".");void 0===s[l]&&(s[l]={positiveValues:[],negativeValues:[]});var d=s[l].positiveValues,u=s[l].negativeValues;i.isDatasetVisible(a)&&o(r)&&ut.each(n.data,function(i,n){var a=+t.getRightValue(i);isNaN(a)||r.data[n].hidden||(d[n]=d[n]||0,u[n]=u[n]||0,e.relativePoints?d[n]=100:a<0?u[n]+=a:d[n]+=a)})}),ut.each(s,function(e){var i=e.positiveValues.concat(e.negativeValues),n=ut.min(i),a=ut.max(i);t.min=null===t.min?n:Math.min(t.min,n),t.max=null===t.max?a:Math.max(t.max,a)})}else ut.each(n,function(e,n){var a=i.getDatasetMeta(n);i.isDatasetVisible(n)&&o(a)&&ut.each(e.data,function(e,i){var n=+t.getRightValue(e);isNaN(n)||a.data[i].hidden||(null===t.min?t.min=n:n<t.min&&(t.min=n),null===t.max?t.max=n:n>t.max&&(t.max=n))})});t.min=isFinite(t.min)&&!isNaN(t.min)?t.min:0,t.max=isFinite(t.max)&&!isNaN(t.max)?t.max:1,this.handleTickRangeOptions()},_computeTickLimit:function(){var t;return this.isHorizontal()?Math.ceil(this.width/40):(t=ut.options._parseFont(this.options.ticks),Math.ceil(this.height/t.lineHeight))},handleDirectionalChanges:function(){this.isHorizontal()||this.ticks.reverse()},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},getPixelForValue:function(t){var e=this,i=e.start,n=+e.getRightValue(t),a=e.end-i;return e.isHorizontal()?e.left+e.width/a*(n-i):e.bottom-e.height/a*(n-i)},getValueForPixel:function(t){var e=this,i=e.isHorizontal(),n=i?e.width:e.height,a=(i?t-e.left:e.bottom-t)/n;return e.start+(e.end-e.start)*a},getPixelForTick:function(t){return this.getPixelForValue(this.ticksAsNumbers[t])}}),ki=xi;yi._defaults=ki;var wi=ut.valueOrDefault;var Mi={position:"left",ticks:{callback:li.formatters.logarithmic}};function _i(t,e){return ut.isFinite(t)&&t>=0?t:e}var Ci=fi.extend({determineDataLimits:function(){var t=this,e=t.options,i=t.chart,n=i.data.datasets,a=t.isHorizontal();function o(e){return a?e.xAxisID===t.id:e.yAxisID===t.id}t.min=null,t.max=null,t.minNotZero=null;var r=e.stacked;if(void 0===r&&ut.each(n,function(t,e){if(!r){var n=i.getDatasetMeta(e);i.isDatasetVisible(e)&&o(n)&&void 0!==n.stack&&(r=!0)}}),e.stacked||r){var s={};ut.each(n,function(n,a){var r=i.getDatasetMeta(a),l=[r.type,void 0===e.stacked&&void 0===r.stack?a:"",r.stack].join(".");i.isDatasetVisible(a)&&o(r)&&(void 0===s[l]&&(s[l]=[]),ut.each(n.data,function(e,i){var n=s[l],a=+t.getRightValue(e);isNaN(a)||r.data[i].hidden||a<0||(n[i]=n[i]||0,n[i]+=a)}))}),ut.each(s,function(e){if(e.length>0){var i=ut.min(e),n=ut.max(e);t.min=null===t.min?i:Math.min(t.min,i),t.max=null===t.max?n:Math.max(t.max,n)}})}else ut.each(n,function(e,n){var a=i.getDatasetMeta(n);i.isDatasetVisible(n)&&o(a)&&ut.each(e.data,function(e,i){var n=+t.getRightValue(e);isNaN(n)||a.data[i].hidden||n<0||(null===t.min?t.min=n:n<t.min&&(t.min=n),null===t.max?t.max=n:n>t.max&&(t.max=n),0!==n&&(null===t.minNotZero||n<t.minNotZero)&&(t.minNotZero=n))})});this.handleTickRangeOptions()},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;t.min=_i(e.min,t.min),t.max=_i(e.max,t.max),t.min===t.max&&(0!==t.min&&null!==t.min?(t.min=Math.pow(10,Math.floor(ut.log10(t.min))-1),t.max=Math.pow(10,Math.floor(ut.log10(t.max))+1)):(t.min=1,t.max=10)),null===t.min&&(t.min=Math.pow(10,Math.floor(ut.log10(t.max))-1)),null===t.max&&(t.max=0!==t.min?Math.pow(10,Math.floor(ut.log10(t.min))+1):10),null===t.minNotZero&&(t.min>0?t.minNotZero=t.min:t.max<1?t.minNotZero=Math.pow(10,Math.floor(ut.log10(t.max))):t.minNotZero=1)},buildTicks:function(){var t=this,e=t.options.ticks,i=!t.isHorizontal(),n={min:_i(e.min),max:_i(e.max)},a=t.ticks=function(t,e){var i,n,a=[],o=wi(t.min,Math.pow(10,Math.floor(ut.log10(e.min)))),r=Math.floor(ut.log10(e.max)),s=Math.ceil(e.max/Math.pow(10,r));0===o?(i=Math.floor(ut.log10(e.minNotZero)),n=Math.floor(e.minNotZero/Math.pow(10,i)),a.push(o),o=n*Math.pow(10,i)):(i=Math.floor(ut.log10(o)),n=Math.floor(o/Math.pow(10,i)));var l=i<0?Math.pow(10,Math.abs(i)):1;do{a.push(o),10==++n&&(n=1,l=++i>=0?1:l),o=Math.round(n*Math.pow(10,i)*l)/l}while(i<r||i===r&&n<s);var d=wi(t.max,o);return a.push(d),a}(n,t);t.max=ut.max(a),t.min=ut.min(a),e.reverse?(i=!i,t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),i&&a.reverse()},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),fi.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])},_getFirstTickValue:function(t){var e=Math.floor(ut.log10(t));return Math.floor(t/Math.pow(10,e))*Math.pow(10,e)},getPixelForValue:function(t){var e,i,n,a,o,r=this,s=r.options.ticks,l=s.reverse,d=ut.log10,u=r._getFirstTickValue(r.minNotZero),h=0;return t=+r.getRightValue(t),l?(n=r.end,a=r.start,o=-1):(n=r.start,a=r.end,o=1),r.isHorizontal()?(e=r.width,i=l?r.right:r.left):(e=r.height,o*=-1,i=l?r.top:r.bottom),t!==n&&(0===n&&(e-=h=wi(s.fontSize,st.global.defaultFontSize),n=u),0!==t&&(h+=e/(d(a)-d(n))*(d(t)-d(n))),i+=o*h),i},getValueForPixel:function(t){var e,i,n,a,o=this,r=o.options.ticks,s=r.reverse,l=ut.log10,d=o._getFirstTickValue(o.minNotZero);if(s?(i=o.end,n=o.start):(i=o.start,n=o.end),o.isHorizontal()?(e=o.width,a=s?o.right-t:t-o.left):(e=o.height,a=s?t-o.top:o.bottom-t),a!==i){if(0===i){var u=wi(r.fontSize,st.global.defaultFontSize);a-=u,e-=u,i=d}a*=l(n)-l(i),a/=e,a=Math.pow(10,l(i)+a)}return a}}),Si=Mi;Ci._defaults=Si;var Pi=ut.valueOrDefault,Ii=ut.valueAtIndexOrDefault,Ai=ut.options.resolve,Di={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0, 0, 0, 0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:li.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(t){return t}}};function Ti(t){var e=t.options;return e.angleLines.display||e.pointLabels.display?t.chart.data.labels.length:0}function Fi(t){var e=t.ticks;return e.display&&t.display?Pi(e.fontSize,st.global.defaultFontSize)+2*e.backdropPaddingY:0}function Li(t,e,i,n,a){return t===n||t===a?{start:e-i/2,end:e+i/2}:t<n||t>a?{start:e-i,end:e}:{start:e,end:e+i}}function Ri(t){return 0===t||180===t?"center":t<180?"left":"right"}function Oi(t,e,i,n){var a,o,r=i.y+n/2;if(ut.isArray(e))for(a=0,o=e.length;a<o;++a)t.fillText(e[a],i.x,r),r+=n;else t.fillText(e,i.x,r)}function zi(t,e,i){90===t||270===t?i.y-=e.h/2:(t>270||t<90)&&(i.y-=e.h)}function Bi(t){return ut.isNumber(t)?t:0}var Ni=bi.extend({setDimensions:function(){var t=this;t.width=t.maxWidth,t.height=t.maxHeight,t.paddingTop=Fi(t.options)/2,t.xCenter=Math.floor(t.width/2),t.yCenter=Math.floor((t.height-t.paddingTop)/2),t.drawingArea=Math.min(t.height-t.paddingTop,t.width)/2},determineDataLimits:function(){var t=this,e=t.chart,i=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;ut.each(e.data.datasets,function(a,o){if(e.isDatasetVisible(o)){var r=e.getDatasetMeta(o);ut.each(a.data,function(e,a){var o=+t.getRightValue(e);isNaN(o)||r.data[a].hidden||(i=Math.min(o,i),n=Math.max(o,n))})}}),t.min=i===Number.POSITIVE_INFINITY?0:i,t.max=n===Number.NEGATIVE_INFINITY?0:n,t.handleTickRangeOptions()},_computeTickLimit:function(){return Math.ceil(this.drawingArea/Fi(this.options))},convertTicksToLabels:function(){var t=this;bi.prototype.convertTicksToLabels.call(t),t.pointLabels=t.chart.data.labels.map(t.options.pointLabels.callback,t)},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},fit:function(){var t=this.options;t.display&&t.pointLabels.display?function(t){var e,i,n,a=ut.options._parseFont(t.options.pointLabels),o={l:0,r:t.width,t:0,b:t.height-t.paddingTop},r={};t.ctx.font=a.string,t._pointLabelSizes=[];var s,l,d,u=Ti(t);for(e=0;e<u;e++){n=t.getPointPosition(e,t.drawingArea+5),s=t.ctx,l=a.lineHeight,d=t.pointLabels[e]||"",i=ut.isArray(d)?{w:ut.longestText(s,s.font,d),h:d.length*l}:{w:s.measureText(d).width,h:l},t._pointLabelSizes[e]=i;var h=t.getIndexAngle(e),c=ut.toDegrees(h)%360,f=Li(c,n.x,i.w,0,180),g=Li(c,n.y,i.h,90,270);f.start<o.l&&(o.l=f.start,r.l=h),f.end>o.r&&(o.r=f.end,r.r=h),g.start<o.t&&(o.t=g.start,r.t=h),g.end>o.b&&(o.b=g.end,r.b=h)}t.setReductions(t.drawingArea,o,r)}(this):this.setCenterPoint(0,0,0,0)},setReductions:function(t,e,i){var n=this,a=e.l/Math.sin(i.l),o=Math.max(e.r-n.width,0)/Math.sin(i.r),r=-e.t/Math.cos(i.t),s=-Math.max(e.b-(n.height-n.paddingTop),0)/Math.cos(i.b);a=Bi(a),o=Bi(o),r=Bi(r),s=Bi(s),n.drawingArea=Math.min(Math.floor(t-(a+o)/2),Math.floor(t-(r+s)/2)),n.setCenterPoint(a,o,r,s)},setCenterPoint:function(t,e,i,n){var a=this,o=a.width-e-a.drawingArea,r=t+a.drawingArea,s=i+a.drawingArea,l=a.height-a.paddingTop-n-a.drawingArea;a.xCenter=Math.floor((r+o)/2+a.left),a.yCenter=Math.floor((s+l)/2+a.top+a.paddingTop)},getIndexAngle:function(t){return t*(2*Math.PI/Ti(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 i=e.drawingArea/(e.max-e.min);return e.options.ticks.reverse?(e.max-t)*i:(t-e.min)*i},getPointPosition:function(t,e){var i=this.getIndexAngle(t)-Math.PI/2;return{x:Math.cos(i)*e+this.xCenter,y:Math.sin(i)*e+this.yCenter}},getPointPositionForValue:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))},getBasePosition:function(){var t=this.min,e=this.max;return this.getPointPositionForValue(0,this.beginAtZero?0:t<0&&e<0?e:t>0&&e>0?t:0)},draw:function(){var t=this,e=t.options,i=e.gridLines,n=e.ticks;if(e.display){var a=t.ctx,o=this.getIndexAngle(0),r=ut.options._parseFont(n);(e.angleLines.display||e.pointLabels.display)&&function(t){var e=t.ctx,i=t.options,n=i.angleLines,a=i.gridLines,o=i.pointLabels,r=Pi(n.lineWidth,a.lineWidth),s=Pi(n.color,a.color),l=Fi(i);e.save(),e.lineWidth=r,e.strokeStyle=s,e.setLineDash&&(e.setLineDash(Ai([n.borderDash,a.borderDash,[]])),e.lineDashOffset=Ai([n.borderDashOffset,a.borderDashOffset,0]));var d=t.getDistanceFromCenterForValue(i.ticks.reverse?t.min:t.max),u=ut.options._parseFont(o);e.font=u.string,e.textBaseline="middle";for(var h=Ti(t)-1;h>=0;h--){if(n.display&&r&&s){var c=t.getPointPosition(h,d);e.beginPath(),e.moveTo(t.xCenter,t.yCenter),e.lineTo(c.x,c.y),e.stroke()}if(o.display){var f=0===h?l/2:0,g=t.getPointPosition(h,d+f+5),p=Ii(o.fontColor,h,st.global.defaultFontColor);e.fillStyle=p;var m=t.getIndexAngle(h),v=ut.toDegrees(m);e.textAlign=Ri(v),zi(v,t._pointLabelSizes[h],g),Oi(e,t.pointLabels[h]||"",g,u.lineHeight)}}e.restore()}(t),ut.each(t.ticks,function(e,s){if(s>0||n.reverse){var l=t.getDistanceFromCenterForValue(t.ticksAsNumbers[s]);if(i.display&&0!==s&&function(t,e,i,n){var a,o=t.ctx,r=e.circular,s=Ti(t),l=Ii(e.color,n-1),d=Ii(e.lineWidth,n-1);if((r||s)&&l&&d){if(o.save(),o.strokeStyle=l,o.lineWidth=d,o.setLineDash&&(o.setLineDash(e.borderDash||[]),o.lineDashOffset=e.borderDashOffset||0),o.beginPath(),r)o.arc(t.xCenter,t.yCenter,i,0,2*Math.PI);else{a=t.getPointPosition(0,i),o.moveTo(a.x,a.y);for(var u=1;u<s;u++)a=t.getPointPosition(u,i),o.lineTo(a.x,a.y)}o.closePath(),o.stroke(),o.restore()}}(t,i,l,s),n.display){var d=Pi(n.fontColor,st.global.defaultFontColor);if(a.font=r.string,a.save(),a.translate(t.xCenter,t.yCenter),a.rotate(o),n.showLabelBackdrop){var u=a.measureText(e).width;a.fillStyle=n.backdropColor,a.fillRect(-u/2-n.backdropPaddingX,-l-r.size/2-n.backdropPaddingY,u+2*n.backdropPaddingX,r.size+2*n.backdropPaddingY)}a.textAlign="center",a.textBaseline="middle",a.fillStyle=d,a.fillText(e,0,-l),a.restore()}}})}}}),Wi=Di;Ni._defaults=Wi;var Vi=ut.valueOrDefault,Ei=Number.MIN_SAFE_INTEGER||-9007199254740991,Hi=Number.MAX_SAFE_INTEGER||9007199254740991,ji={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,15,30]},minute:{common:!0,size:6e4,steps:[1,2,5,10,15,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}},qi=Object.keys(ji);function Yi(t,e){return t-e}function Ui(t){var e,i,n,a={},o=[];for(e=0,i=t.length;e<i;++e)a[n=t[e]]||(a[n]=!0,o.push(n));return o}function Xi(t,e,i,n){var a=function(t,e,i){for(var n,a,o,r=0,s=t.length-1;r>=0&&r<=s;){if(a=t[(n=r+s>>1)-1]||null,o=t[n],!a)return{lo:null,hi:o};if(o[e]<i)r=n+1;else{if(!(a[e]>i))return{lo:a,hi:o};s=n-1}}return{lo:o,hi:null}}(t,e,i),o=a.lo?a.hi?a.lo:t[t.length-2]:t[0],r=a.lo?a.hi?a.hi:t[t.length-1]:t[1],s=r[e]-o[e],l=s?(i-o[e])/s:0,d=(r[n]-o[n])*l;return o[n]+d}function Ki(t,e){var i=t._adapter,n=t.options.time,a=n.parser,o=a||n.format,r=e;return"function"==typeof a&&(r=a(r)),ut.isFinite(r)||(r="string"==typeof o?i.parse(r,o):i.parse(r)),null!==r?+r:(a||"function"!=typeof o||(r=o(e),ut.isFinite(r)||(r=i.parse(r))),r)}function Gi(t,e){if(ut.isNullOrUndef(e))return null;var i=t.options.time,n=Ki(t,t.getRightValue(e));return null===n?n:(i.round&&(n=+t._adapter.startOf(n,i.round)),n)}function Zi(t){for(var e=qi.indexOf(t)+1,i=qi.length;e<i;++e)if(ji[qi[e]].common)return qi[e]}function $i(t,e,i,n){var a,o=t._adapter,r=t.options,s=r.time,l=s.unit||function(t,e,i,n){var a,o,r,s=qi.length;for(a=qi.indexOf(t);a<s-1;++a)if(r=(o=ji[qi[a]]).steps?o.steps[o.steps.length-1]:Hi,o.common&&Math.ceil((i-e)/(r*o.size))<=n)return qi[a];return qi[s-1]}(s.minUnit,e,i,n),d=Zi(l),u=Vi(s.stepSize,s.unitStepSize),h="week"===l&&s.isoWeekday,c=r.ticks.major.enabled,f=ji[l],g=e,p=i,m=[];for(u||(u=function(t,e,i,n){var a,o,r,s=e-t,l=ji[i],d=l.size,u=l.steps;if(!u)return Math.ceil(s/(n*d));for(a=0,o=u.length;a<o&&(r=u[a],!(Math.ceil(s/(d*r))<=n));++a);return r}(e,i,l,n)),h&&(g=+o.startOf(g,"isoWeek",h),p=+o.startOf(p,"isoWeek",h)),g=+o.startOf(g,h?"day":l),(p=+o.startOf(p,h?"day":l))<i&&(p=+o.add(p,1,l)),a=g,c&&d&&!h&&!s.round&&(a=+o.startOf(a,d),a=+o.add(a,~~((g-a)/(f.size*u))*u,l));a<p;a=+o.add(a,u,l))m.push(+a);return m.push(+a),m}var Ji=fi.extend({initialize:function(){this.mergeTicksOptions(),fi.prototype.initialize.call(this)},update:function(){var t=this.options,e=t.time||(t.time={}),i=this._adapter=new si._date(t.adapters.date);return e.format&&console.warn("options.time.format is deprecated and replaced by options.time.parser."),ut.mergeIf(e.displayFormats,i.formats()),fi.prototype.update.apply(this,arguments)},getRightValue:function(t){return t&&void 0!==t.t&&(t=t.t),fi.prototype.getRightValue.call(this,t)},determineDataLimits:function(){var t,e,i,n,a,o,r=this,s=r.chart,l=r._adapter,d=r.options.time,u=d.unit||"day",h=Hi,c=Ei,f=[],g=[],p=[],m=s.data.labels||[];for(t=0,i=m.length;t<i;++t)p.push(Gi(r,m[t]));for(t=0,i=(s.data.datasets||[]).length;t<i;++t)if(s.isDatasetVisible(t))if(a=s.data.datasets[t].data,ut.isObject(a[0]))for(g[t]=[],e=0,n=a.length;e<n;++e)o=Gi(r,a[e]),f.push(o),g[t][e]=o;else{for(e=0,n=p.length;e<n;++e)f.push(p[e]);g[t]=p.slice(0)}else g[t]=[];p.length&&(p=Ui(p).sort(Yi),h=Math.min(h,p[0]),c=Math.max(c,p[p.length-1])),f.length&&(f=Ui(f).sort(Yi),h=Math.min(h,f[0]),c=Math.max(c,f[f.length-1])),h=Gi(r,d.min)||h,c=Gi(r,d.max)||c,h=h===Hi?+l.startOf(Date.now(),u):h,c=c===Ei?+l.endOf(Date.now(),u)+1:c,r.min=Math.min(h,c),r.max=Math.max(h+1,c),r._horizontal=r.isHorizontal(),r._table=[],r._timestamps={data:f,datasets:g,labels:p}},buildTicks:function(){var t,e,i,n=this,a=n.min,o=n.max,r=n.options,s=r.time,l=[],d=[];switch(r.ticks.source){case"data":l=n._timestamps.data;break;case"labels":l=n._timestamps.labels;break;case"auto":default:l=$i(n,a,o,n.getLabelCapacity(a))}for("ticks"===r.bounds&&l.length&&(a=l[0],o=l[l.length-1]),a=Gi(n,s.min)||a,o=Gi(n,s.max)||o,t=0,e=l.length;t<e;++t)(i=l[t])>=a&&i<=o&&d.push(i);return n.min=a,n.max=o,n._unit=s.unit||function(t,e,i,n,a){var o,r;for(o=qi.length-1;o>=qi.indexOf(i);o--)if(r=qi[o],ji[r].common&&t._adapter.diff(a,n,r)>=e.length)return r;return qi[i?qi.indexOf(i):0]}(n,d,s.minUnit,n.min,n.max),n._majorUnit=Zi(n._unit),n._table=function(t,e,i,n){if("linear"===n||!t.length)return[{time:e,pos:0},{time:i,pos:1}];var a,o,r,s,l,d=[],u=[e];for(a=0,o=t.length;a<o;++a)(s=t[a])>e&&s<i&&u.push(s);for(u.push(i),a=0,o=u.length;a<o;++a)l=u[a+1],r=u[a-1],s=u[a],void 0!==r&&void 0!==l&&Math.round((l+r)/2)===s||d.push({time:s,pos:a/(o-1)});return d}(n._timestamps.data,a,o,r.distribution),n._offsets=function(t,e,i,n,a){var o,r,s=0,l=0;return a.offset&&e.length&&(a.time.min||(o=Xi(t,"time",e[0],"pos"),s=1===e.length?1-o:(Xi(t,"time",e[1],"pos")-o)/2),a.time.max||(r=Xi(t,"time",e[e.length-1],"pos"),l=1===e.length?r:(r-Xi(t,"time",e[e.length-2],"pos"))/2)),{start:s,end:l}}(n._table,d,0,0,r),r.ticks.reverse&&d.reverse(),function(t,e,i){var n,a,o,r,s=[];for(n=0,a=e.length;n<a;++n)o=e[n],r=!!i&&o===+t._adapter.startOf(o,i),s.push({value:o,major:r});return s}(n,d,n._majorUnit)},getLabelForIndex:function(t,e){var i=this,n=i._adapter,a=i.chart.data,o=i.options.time,r=a.labels&&t<a.labels.length?a.labels[t]:"",s=a.datasets[e].data[t];return ut.isObject(s)&&(r=i.getRightValue(s)),o.tooltipFormat?n.format(Ki(i,r),o.tooltipFormat):"string"==typeof r?r:n.format(Ki(i,r),o.displayFormats.datetime)},tickFormatFunction:function(t,e,i,n){var a=this._adapter,o=this.options,r=o.time.displayFormats,s=r[this._unit],l=this._majorUnit,d=r[l],u=+a.startOf(t,l),h=o.ticks.major,c=h.enabled&&l&&d&&t===u,f=a.format(t,n||(c?d:s)),g=c?h:o.ticks.minor,p=Vi(g.callback,g.userCallback);return p?p(f,e,i):f},convertTicksToLabels:function(t){var e,i,n=[];for(e=0,i=t.length;e<i;++e)n.push(this.tickFormatFunction(t[e].value,e,t));return n},getPixelForOffset:function(t){var e=this,i=e.options.ticks.reverse,n=e._horizontal?e.width:e.height,a=e._horizontal?i?e.right:e.left:i?e.bottom:e.top,o=Xi(e._table,"time",t,"pos"),r=n*(e._offsets.start+o)/(e._offsets.start+1+e._offsets.end);return i?a-r:a+r},getPixelForValue:function(t,e,i){var n=null;if(void 0!==e&&void 0!==i&&(n=this._timestamps.datasets[i][e]),null===n&&(n=Gi(this,t)),null!==n)return this.getPixelForOffset(n)},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,i=e._horizontal?e.width:e.height,n=e._horizontal?e.left:e.top,a=(i?(t-n)/i:0)*(e._offsets.start+1+e._offsets.start)-e._offsets.end,o=Xi(e._table,"pos",a,"time");return e._adapter._create(o)},getLabelWidth:function(t){var e=this.options.ticks,i=this.ctx.measureText(t).width,n=ut.toRadians(e.maxRotation),a=Math.cos(n),o=Math.sin(n);return i*a+Vi(e.fontSize,st.global.defaultFontSize)*o},getLabelCapacity:function(t){var e=this,i=e.options.time.displayFormats.millisecond,n=e.tickFormatFunction(t,0,[],i),a=e.getLabelWidth(n),o=e.isHorizontal()?e.width:e.height,r=Math.floor(o/a);return r>0?r:1}}),Qi={position:"bottom",distribution:"linear",bounds:"data",adapters:{},time:{parser:!1,format:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}};Ji._defaults=Qi;var tn={category:gi,linear:yi,logarithmic:Ci,radialLinear:Ni,time:Ji},en={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};si._date.override("function"==typeof t?{_id:"moment",formats:function(){return en},parse:function(e,i){return"string"==typeof e&&"string"==typeof i?e=t(e,i):e instanceof t||(e=t(e)),e.isValid()?e.valueOf():null},format:function(e,i){return t(e).format(i)},add:function(e,i,n){return t(e).add(i,n).valueOf()},diff:function(e,i,n){return t.duration(t(e).diff(t(i))).as(n)},startOf:function(e,i,n){return e=t(e),"isoWeek"===i?e.isoWeekday(n).valueOf():e.startOf(i).valueOf()},endOf:function(e,i){return t(e).endOf(i).valueOf()},_create:function(e){return t(e)}}:{}),st._set("global",{plugins:{filler:{propagate:!0}}});var nn={dataset:function(t){var e=t.fill,i=t.chart,n=i.getDatasetMeta(e),a=n&&i.isDatasetVisible(e)&&n.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,i=e?e.x:null,n=e?e.y:null;return function(t){return{x:null===i?t.x:i,y:null===n?t.y:n}}}};function an(t,e,i){var n,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(n=parseFloat(o,10),isFinite(n)&&Math.floor(n)===n)return"-"!==o[0]&&"+"!==o[0]||(n=e+n),!(n===e||n<0||n>=i)&&n;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 on(t){var e,i=t.el._model||{},n=t.el._scale||{},a=t.fill,o=null;if(isFinite(a))return null;if("start"===a?o=void 0===i.scaleBottom?n.bottom:i.scaleBottom:"end"===a?o=void 0===i.scaleTop?n.top:i.scaleTop:void 0!==i.scaleZero?o=i.scaleZero:n.getBasePosition?o=n.getBasePosition():n.getBasePixel&&(o=n.getBasePixel()),null!=o){if(void 0!==o.x&&void 0!==o.y)return o;if(ut.isFinite(o))return{x:(e=n.isHorizontal())?o:null,y:e?null:o}}return null}function rn(t,e,i){var n,a=t[e].fill,o=[e];if(!i)return a;for(;!1!==a&&-1===o.indexOf(a);){if(!isFinite(a))return a;if(!(n=t[a]))return!1;if(n.visible)return a;o.push(a),a=n.fill}return!1}function sn(t){var e=t.fill,i="dataset";return!1===e?null:(isFinite(e)||(i="boundary"),nn[i](t))}function ln(t){return t&&!t.skip}function dn(t,e,i,n,a){var o;if(n&&a){for(t.moveTo(e[0].x,e[0].y),o=1;o<n;++o)ut.canvas.lineTo(t,e[o-1],e[o]);for(t.lineTo(i[a-1].x,i[a-1].y),o=a-1;o>0;--o)ut.canvas.lineTo(t,i[o],i[o-1],!0)}}var un={id:"filler",afterDatasetsUpdate:function(t,e){var i,n,a,o,r=(t.data.datasets||[]).length,s=e.propagate,l=[];for(n=0;n<r;++n)o=null,(a=(i=t.getDatasetMeta(n)).dataset)&&a._model&&a instanceof Wt.Line&&(o={visible:t.isDatasetVisible(n),fill:an(a,n,r),chart:t,el:a}),i.$filler=o,l.push(o);for(n=0;n<r;++n)(o=l[n])&&(o.fill=rn(l,n,s),o.boundary=on(o),o.mapper=sn(o))},beforeDatasetDraw:function(t,e){var i=e.meta.$filler;if(i){var n=t.ctx,a=i.el,o=a._view,r=a._children||[],s=i.mapper,l=o.backgroundColor||st.global.defaultColor;s&&l&&r.length&&(ut.canvas.clipArea(n,t.chartArea),function(t,e,i,n,a,o){var r,s,l,d,u,h,c,f=e.length,g=n.spanGaps,p=[],m=[],v=0,b=0;for(t.beginPath(),r=0,s=f+!!o;r<s;++r)u=i(d=e[l=r%f]._view,l,n),h=ln(d),c=ln(u),h&&c?(v=p.push(d),b=m.push(u)):v&&b&&(g?(h&&p.push(d),c&&m.push(u)):(dn(t,p,m,v,b),v=b=0,p=[],m=[]));dn(t,p,m,v,b),t.closePath(),t.fillStyle=a,t.fill()}(n,r,s,o,l,a._loop),ut.canvas.unclipArea(n))}}},hn=ut.noop,cn=ut.valueOrDefault;function fn(t,e){return t.usePointStyle&&t.boxWidth>e?e:t.boxWidth}st._set("global",{legend:{display:!0,position:"top",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(t,e){var i=e.datasetIndex,n=this.chart,a=n.getDatasetMeta(i);a.hidden=null===a.hidden?!n.data.datasets[i].hidden:null,n.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(t){var e=t.data;return ut.isArray(e.datasets)?e.datasets.map(function(e,i){return{text:e.label,fillStyle:ut.isArray(e.backgroundColor)?e.backgroundColor[0]:e.backgroundColor,hidden:!t.isDatasetVisible(i),lineCap:e.borderCapStyle,lineDash:e.borderDash,lineDashOffset:e.borderDashOffset,lineJoin:e.borderJoinStyle,lineWidth:e.borderWidth,strokeStyle:e.borderColor,pointStyle:e.pointStyle,datasetIndex:i}},this):[]}}},legendCallback:function(t){var e=[];e.push('<ul class="'+t.id+'-legend">');for(var i=0;i<t.data.datasets.length;i++)e.push('<li><span style="background-color:'+t.data.datasets[i].backgroundColor+'"></span>'),t.data.datasets[i].label&&e.push(t.data.datasets[i].label),e.push("</li>");return e.push("</ul>"),e.join("")}});var gn=pt.extend({initialize:function(t){ut.extend(this,t),this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1},beforeUpdate:hn,update:function(t,e,i){var n=this;return n.beforeUpdate(),n.maxWidth=t,n.maxHeight=e,n.margins=i,n.beforeSetDimensions(),n.setDimensions(),n.afterSetDimensions(),n.beforeBuildLabels(),n.buildLabels(),n.afterBuildLabels(),n.beforeFit(),n.fit(),n.afterFit(),n.afterUpdate(),n.minSize},afterUpdate:hn,beforeSetDimensions:hn,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:hn,beforeBuildLabels:hn,buildLabels:function(){var t=this,e=t.options.labels||{},i=ut.callback(e.generateLabels,[t.chart],t)||[];e.filter&&(i=i.filter(function(i){return e.filter(i,t.chart.data)})),t.options.reverse&&i.reverse(),t.legendItems=i},afterBuildLabels:hn,beforeFit:hn,fit:function(){var t=this,e=t.options,i=e.labels,n=e.display,a=t.ctx,o=ut.options._parseFont(i),r=o.size,s=t.legendHitBoxes=[],l=t.minSize,d=t.isHorizontal();if(d?(l.width=t.maxWidth,l.height=n?10:0):(l.width=n?10:0,l.height=t.maxHeight),n)if(a.font=o.string,d){var u=t.lineWidths=[0],h=0;a.textAlign="left",a.textBaseline="top",ut.each(t.legendItems,function(t,e){var n=fn(i,r)+r/2+a.measureText(t.text).width;(0===e||u[u.length-1]+n+i.padding>l.width)&&(h+=r+i.padding,u[u.length-(e>0?0:1)]=i.padding),s[e]={left:0,top:0,width:n,height:r},u[u.length-1]+=n+i.padding}),l.height+=h}else{var c=i.padding,f=t.columnWidths=[],g=i.padding,p=0,m=0,v=r+c;ut.each(t.legendItems,function(t,e){var n=fn(i,r)+r/2+a.measureText(t.text).width;e>0&&m+v>l.height-c&&(g+=p+i.padding,f.push(p),p=0,m=0),p=Math.max(p,n),m+=v,s[e]={left:0,top:0,width:n,height:r}}),g+=p,f.push(p),l.width+=g}t.width=l.width,t.height=l.height},afterFit:hn,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var t=this,e=t.options,i=e.labels,n=st.global,a=n.defaultColor,o=n.elements.line,r=t.width,s=t.lineWidths;if(e.display){var l,d=t.ctx,u=cn(i.fontColor,n.defaultFontColor),h=ut.options._parseFont(i),c=h.size;d.textAlign="left",d.textBaseline="middle",d.lineWidth=.5,d.strokeStyle=u,d.fillStyle=u,d.font=h.string;var f=fn(i,c),g=t.legendHitBoxes,p=t.isHorizontal();l=p?{x:t.left+(r-s[0])/2+i.padding,y:t.top+i.padding,line:0}:{x:t.left+i.padding,y:t.top+i.padding,line:0};var m=c+i.padding;ut.each(t.legendItems,function(n,u){var h=d.measureText(n.text).width,v=f+c/2+h,b=l.x,x=l.y;p?u>0&&b+v+i.padding>t.left+t.minSize.width&&(x=l.y+=m,l.line++,b=l.x=t.left+(r-s[l.line])/2+i.padding):u>0&&x+m>t.top+t.minSize.height&&(b=l.x=b+t.columnWidths[l.line]+i.padding,x=l.y=t.top+i.padding,l.line++),function(t,i,n){if(!(isNaN(f)||f<=0)){d.save();var r=cn(n.lineWidth,o.borderWidth);if(d.fillStyle=cn(n.fillStyle,a),d.lineCap=cn(n.lineCap,o.borderCapStyle),d.lineDashOffset=cn(n.lineDashOffset,o.borderDashOffset),d.lineJoin=cn(n.lineJoin,o.borderJoinStyle),d.lineWidth=r,d.strokeStyle=cn(n.strokeStyle,a),d.setLineDash&&d.setLineDash(cn(n.lineDash,o.borderDash)),e.labels&&e.labels.usePointStyle){var s=f*Math.SQRT2/2,l=t+f/2,u=i+c/2;ut.canvas.drawPoint(d,n.pointStyle,s,l,u)}else 0!==r&&d.strokeRect(t,i,f,c),d.fillRect(t,i,f,c);d.restore()}}(b,x,n),g[u].left=b,g[u].top=x,function(t,e,i,n){var a=c/2,o=f+a+t,r=e+a;d.fillText(i.text,o,r),i.hidden&&(d.beginPath(),d.lineWidth=2,d.moveTo(o,r),d.lineTo(o+n,r),d.stroke())}(b,x,n,h),p?l.x+=v+i.padding:l.y+=m})}},_getLegendItemAt:function(t,e){var i,n,a,o=this;if(t>=o.left&&t<=o.right&&e>=o.top&&e<=o.bottom)for(a=o.legendHitBoxes,i=0;i<a.length;++i)if(t>=(n=a[i]).left&&t<=n.left+n.width&&e>=n.top&&e<=n.top+n.height)return o.legendItems[i];return null},handleEvent:function(t){var e,i=this,n=i.options,a="mouseup"===t.type?"click":t.type;if("mousemove"===a){if(!n.onHover&&!n.onLeave)return}else{if("click"!==a)return;if(!n.onClick)return}e=i._getLegendItemAt(t.x,t.y),"click"===a?e&&n.onClick&&n.onClick.call(i,t.native,e):(n.onLeave&&e!==i._hoveredItem&&(i._hoveredItem&&n.onLeave.call(i,t.native,i._hoveredItem),i._hoveredItem=e),n.onHover&&e&&n.onHover.call(i,t.native,e))}});function pn(t,e){var i=new gn({ctx:t.ctx,options:e,chart:t});ke.configure(t,i,e),ke.addBox(t,i),t.legend=i}var mn={id:"legend",_element:gn,beforeInit:function(t){var e=t.options.legend;e&&pn(t,e)},beforeUpdate:function(t){var e=t.options.legend,i=t.legend;e?(ut.mergeIf(e,st.global.legend),i?(ke.configure(t,i,e),i.options=e):pn(t,e)):i&&(ke.removeBox(t,i),delete t.legend)},afterEvent:function(t,e){var i=t.legend;i&&i.handleEvent(e)}},vn=ut.noop;st._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var bn=pt.extend({initialize:function(t){ut.extend(this,t),this.legendHitBoxes=[]},beforeUpdate:vn,update:function(t,e,i){var n=this;return n.beforeUpdate(),n.maxWidth=t,n.maxHeight=e,n.margins=i,n.beforeSetDimensions(),n.setDimensions(),n.afterSetDimensions(),n.beforeBuildLabels(),n.buildLabels(),n.afterBuildLabels(),n.beforeFit(),n.fit(),n.afterFit(),n.afterUpdate(),n.minSize},afterUpdate:vn,beforeSetDimensions:vn,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:vn,beforeBuildLabels:vn,buildLabels:vn,afterBuildLabels:vn,beforeFit:vn,fit:function(){var t=this,e=t.options,i=e.display,n=t.minSize,a=ut.isArray(e.text)?e.text.length:1,o=ut.options._parseFont(e),r=i?a*o.lineHeight+2*e.padding:0;t.isHorizontal()?(n.width=t.maxWidth,n.height=r):(n.width=r,n.height=t.maxHeight),t.width=n.width,t.height=n.height},afterFit:vn,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this,e=t.ctx,i=t.options;if(i.display){var n,a,o,r=ut.options._parseFont(i),s=r.lineHeight,l=s/2+i.padding,d=0,u=t.top,h=t.left,c=t.bottom,f=t.right;e.fillStyle=ut.valueOrDefault(i.fontColor,st.global.defaultFontColor),e.font=r.string,t.isHorizontal()?(a=h+(f-h)/2,o=u+l,n=f-h):(a="left"===i.position?h+l:f-l,o=u+(c-u)/2,n=c-u,d=Math.PI*("left"===i.position?-.5:.5)),e.save(),e.translate(a,o),e.rotate(d),e.textAlign="center",e.textBaseline="middle";var g=i.text;if(ut.isArray(g))for(var p=0,m=0;m<g.length;++m)e.fillText(g[m],0,p,n),p+=s;else e.fillText(g,0,0,n);e.restore()}}});function xn(t,e){var i=new bn({ctx:t.ctx,options:e,chart:t});ke.configure(t,i,e),ke.addBox(t,i),t.titleBlock=i}var yn={},kn=un,wn=mn,Mn={id:"title",_element:bn,beforeInit:function(t){var e=t.options.title;e&&xn(t,e)},beforeUpdate:function(t){var e=t.options.title,i=t.titleBlock;e?(ut.mergeIf(e,st.global.title),i?(ke.configure(t,i,e),i.options=e):xn(t,e)):i&&(ke.removeBox(t,i),delete t.titleBlock)}};for(var _n in yn.filler=kn,yn.legend=wn,yn.title=Mn,ai.helpers=ut,function(){function t(t,e,i){var n;return"string"==typeof t?(n=parseInt(t,10),-1!==t.indexOf("%")&&(n=n/100*e.parentNode[i])):n=t,n}function e(t){return null!=t&&"none"!==t}function i(i,n,a){var o=document.defaultView,r=ut._getParentNode(i),s=o.getComputedStyle(i)[n],l=o.getComputedStyle(r)[n],d=e(s),u=e(l),h=Number.POSITIVE_INFINITY;return d||u?Math.min(d?t(s,i,a):h,u?t(l,r,a):h):"none"}ut.where=function(t,e){if(ut.isArray(t)&&Array.prototype.filter)return t.filter(e);var i=[];return ut.each(t,function(t){e(t)&&i.push(t)}),i},ut.findIndex=Array.prototype.findIndex?function(t,e,i){return t.findIndex(e,i)}:function(t,e,i){i=void 0===i?t:i;for(var n=0,a=t.length;n<a;++n)if(e.call(i,t[n],n,t))return n;return-1},ut.findNextWhere=function(t,e,i){ut.isNullOrUndef(i)&&(i=-1);for(var n=i+1;n<t.length;n++){var a=t[n];if(e(a))return a}},ut.findPreviousWhere=function(t,e,i){ut.isNullOrUndef(i)&&(i=t.length);for(var n=i-1;n>=0;n--){var a=t[n];if(e(a))return a}},ut.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},ut.almostEquals=function(t,e,i){return Math.abs(t-e)<i},ut.almostWhole=function(t,e){var i=Math.round(t);return i-e<t&&i+e>t},ut.max=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.max(t,e)},Number.NEGATIVE_INFINITY)},ut.min=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.min(t,e)},Number.POSITIVE_INFINITY)},ut.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return 0==(t=+t)||isNaN(t)?t:t>0?1:-1},ut.log10=Math.log10?function(t){return Math.log10(t)}:function(t){var e=Math.log(t)*Math.LOG10E,i=Math.round(e);return t===Math.pow(10,i)?i:e},ut.toRadians=function(t){return t*(Math.PI/180)},ut.toDegrees=function(t){return t*(180/Math.PI)},ut._decimalPlaces=function(t){if(ut.isFinite(t)){for(var e=1,i=0;Math.round(t*e)/e!==t;)e*=10,i++;return i}},ut.getAngleFromPoint=function(t,e){var i=e.x-t.x,n=e.y-t.y,a=Math.sqrt(i*i+n*n),o=Math.atan2(n,i);return o<-.5*Math.PI&&(o+=2*Math.PI),{angle:o,distance:a}},ut.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},ut.aliasPixel=function(t){return t%2==0?0:.5},ut._alignPixel=function(t,e,i){var n=t.currentDevicePixelRatio,a=i/2;return Math.round((e-a)*n)/n+a},ut.splineCurve=function(t,e,i,n){var a=t.skip?e:t,o=e,r=i.skip?e:i,s=Math.sqrt(Math.pow(o.x-a.x,2)+Math.pow(o.y-a.y,2)),l=Math.sqrt(Math.pow(r.x-o.x,2)+Math.pow(r.y-o.y,2)),d=s/(s+l),u=l/(s+l),h=n*(d=isNaN(d)?0:d),c=n*(u=isNaN(u)?0:u);return{previous:{x:o.x-h*(r.x-a.x),y:o.y-h*(r.y-a.y)},next:{x:o.x+c*(r.x-a.x),y:o.y+c*(r.y-a.y)}}},ut.EPSILON=Number.EPSILON||1e-14,ut.splineCurveMonotone=function(t){var e,i,n,a,o,r,s,l,d,u=(t||[]).map(function(t){return{model:t._model,deltaK:0,mK:0}}),h=u.length;for(e=0;e<h;++e)if(!(n=u[e]).model.skip){if(i=e>0?u[e-1]:null,(a=e<h-1?u[e+1]:null)&&!a.model.skip){var c=a.model.x-n.model.x;n.deltaK=0!==c?(a.model.y-n.model.y)/c:0}!i||i.model.skip?n.mK=n.deltaK:!a||a.model.skip?n.mK=i.deltaK:this.sign(i.deltaK)!==this.sign(n.deltaK)?n.mK=0:n.mK=(i.deltaK+n.deltaK)/2}for(e=0;e<h-1;++e)n=u[e],a=u[e+1],n.model.skip||a.model.skip||(ut.almostEquals(n.deltaK,0,this.EPSILON)?n.mK=a.mK=0:(o=n.mK/n.deltaK,r=a.mK/n.deltaK,(l=Math.pow(o,2)+Math.pow(r,2))<=9||(s=3/Math.sqrt(l),n.mK=o*s*n.deltaK,a.mK=r*s*n.deltaK)));for(e=0;e<h;++e)(n=u[e]).model.skip||(i=e>0?u[e-1]:null,a=e<h-1?u[e+1]:null,i&&!i.model.skip&&(d=(n.model.x-i.model.x)/3,n.model.controlPointPreviousX=n.model.x-d,n.model.controlPointPreviousY=n.model.y-d*n.mK),a&&!a.model.skip&&(d=(a.model.x-n.model.x)/3,n.model.controlPointNextX=n.model.x+d,n.model.controlPointNextY=n.model.y+d*n.mK))},ut.nextItem=function(t,e,i){return i?e>=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},ut.previousItem=function(t,e,i){return i?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},ut.niceNum=function(t,e){var i=Math.floor(ut.log10(t)),n=t/Math.pow(10,i);return(e?n<1.5?1:n<3?2:n<7?5:10:n<=1?1:n<=2?2:n<=5?5:10)*Math.pow(10,i)},ut.requestAnimFrame="undefined"==typeof window?function(t){t()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msReques