WordPress Charts and Graphs Lite - Version 3.4.6

Version Description

  • 2020-08-11
Download this release

Release Info

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

Code changes from version 3.4.5 to 3.4.6

Files changed (36) hide show
  1. CHANGELOG.md +7 -2
  2. classes/Visualizer/Gutenberg/Block.php +45 -31
  3. classes/Visualizer/Gutenberg/build/block.js +2 -2
  4. classes/Visualizer/Gutenberg/src/Components/ChartPermissions.js +1 -5
  5. classes/Visualizer/Gutenberg/src/Components/ChartRender.js +3 -1
  6. classes/Visualizer/Gutenberg/src/Components/ChartSelect.js +3 -1
  7. classes/Visualizer/Gutenberg/src/Components/Charts.js +3 -1
  8. classes/Visualizer/Gutenberg/src/Components/Sidebar/GeneralSettings.js +6 -1
  9. classes/Visualizer/Gutenberg/src/Components/Sidebar/SeriesSettings.js +11 -4
  10. classes/Visualizer/Gutenberg/src/Editor.js +40 -19
  11. classes/Visualizer/Gutenberg/src/utils.js +75 -0
  12. classes/Visualizer/Module/Admin.php +1 -2
  13. classes/Visualizer/Module/Frontend.php +21 -4
  14. classes/Visualizer/Plugin.php +1 -1
  15. classes/Visualizer/Render/Library.php +2 -2
  16. classes/Visualizer/Render/Sidebar.php +1 -1
  17. classes/Visualizer/Render/Sidebar/Google.php +4 -6
  18. classes/Visualizer/Source/Query.php +7 -2
  19. css/media.css +1 -1
  20. index.php +1 -1
  21. js/lib/clipboardjs/clipboard.min.js +0 -7
  22. js/lib/moment.min.js +0 -1
  23. js/render-facade.js +5 -2
  24. js/render-google.js +9 -6
  25. readme.md +10 -1
  26. readme.txt +13 -4
  27. themeisle-hash.json +1 -1
  28. vendor/autoload.php +1 -1
  29. vendor/autoload_52.php +1 -1
  30. vendor/codeinwp/themeisle-sdk/CHANGELOG.md +4 -0
  31. vendor/codeinwp/themeisle-sdk/load.php +1 -1
  32. vendor/codeinwp/themeisle-sdk/src/Loader.php +0 -1
  33. vendor/codeinwp/themeisle-sdk/src/Modules/Endpoint.php +0 -358
  34. vendor/composer/autoload_real.php +5 -5
  35. vendor/composer/autoload_real_52.php +3 -3
  36. vendor/composer/installed.json +4 -4
CHANGELOG.md CHANGED
@@ -1,7 +1,12 @@
1
 
2
- ### v3.4.5 - 2020-07-21
3
  **Changes:**
4
-
 
 
 
 
 
5
  ### v3.4.5 - 2020-07-08
6
  **Changes:**
7
  * [Feat] New Google Table Charts
1
 
2
+ ### v3.4.6 - 2020-08-11
3
  **Changes:**
4
+ * - [Feat] Show chart ID in the chart library
5
+ * - [Fix] Compatibility with WP 5.5
6
+ * - [Fix] Google charts: Series number format not applying in the Gutenberg editor
7
+ * - [Fix] Google Table chart does not display chart if boolean values are specified
8
+ * - [Fix] Duplicated enque for jsapi loader
9
+
10
  ### v3.4.5 - 2020-07-08
11
  **Changes:**
12
  * [Feat] New Google Table Charts
classes/Visualizer/Gutenberg/Block.php CHANGED
@@ -352,6 +352,12 @@ class Visualizer_Gutenberg_Block {
352
  // handle data filter hooks
353
  $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'] );
354
 
 
 
 
 
 
 
355
  $data['visualizer-data-exploded'] = '';
356
  // handle annotations for google charts
357
  if ( 'GoogleCharts' === $library ) {
@@ -440,9 +446,16 @@ class Visualizer_Gutenberg_Block {
440
  if ( Visualizer_Module::is_pro() ) {
441
  $permissions = get_post_meta( $post_id, Visualizer_PRO::CF_PERMISSIONS, true );
442
 
443
- if ( ! empty( $permissions ) ) {
444
- $data['visualizer-permissions'] = $permissions;
 
 
 
 
 
445
  }
 
 
446
  }
447
 
448
  return $data;
@@ -646,6 +659,8 @@ class Visualizer_Gutenberg_Block {
646
 
647
  /**
648
  * Format chart data.
 
 
649
  */
650
  public function format_chart_data( $data, $series ) {
651
  foreach ( $series as $i => $row ) {
@@ -658,36 +673,35 @@ class Visualizer_Gutenberg_Block {
658
  continue;
659
  }
660
 
661
- if ( $row['type'] === 'number' ) {
662
- foreach ( $data as $o => $col ) {
663
- $data[ $o ][ $i ] = ( is_numeric( $col[ $i ] ) ) ? floatval( $col[ $i ] ) : ( is_numeric( str_replace( ',', '', $col[ $i ] ) ) ? floatval( str_replace( ',', '', $col[ $i ] ) ) : null );
664
- }
665
- }
666
-
667
- if ( $row['type'] === 'boolean' ) {
668
- foreach ( $data as $o => $col ) {
669
- $data[ $o ][ $i ] = ! empty( $col[ $i ] ) ? filter_var( $col[ $i ], FILTER_VALIDATE_BOOLEAN ) : null;
670
- }
671
- }
672
-
673
- if ( $row['type'] === 'timeofday' ) {
674
- foreach ( $data as $o => $col ) {
675
- $date = new DateTime( '1984-03-16T' . $col[ $i ] );
676
- if ( $date ) {
677
- $data[ $o ][ $i ] = array(
678
- intval( $date->format( 'H' ) ),
679
- intval( $date->format( 'i' ) ),
680
- intval( $date->format( 's' ) ),
681
- 0,
682
- );
683
  }
684
- }
685
- }
686
-
687
- if ( $row['type'] === 'string' ) {
688
- foreach ( $data as $o => $col ) {
689
- $data[ $o ][ $i ] = $this->toUTF8( $col[ $i ] );
690
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
691
  }
692
  }
693
 
352
  // handle data filter hooks
353
  $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'] );
354
 
355
+ // we are going to format only for tabular charts, because we are not sure of the effect on others.
356
+ // this is to solve the case where boolean data shows up as all-ticks on gutenberg.
357
+ if ( in_array( $data['visualizer-chart-type'], array( 'tabular' ), true ) ) {
358
+ $data['visualizer-data'] = $this->format_chart_data( $data['visualizer-data'], $data['visualizer-series'] );
359
+ }
360
+
361
  $data['visualizer-data-exploded'] = '';
362
  // handle annotations for google charts
363
  if ( 'GoogleCharts' === $library ) {
446
  if ( Visualizer_Module::is_pro() ) {
447
  $permissions = get_post_meta( $post_id, Visualizer_PRO::CF_PERMISSIONS, true );
448
 
449
+ if ( empty( $permissions ) ) {
450
+ $permissions = array( 'permissions' => array(
451
+ 'read' => 'all',
452
+ 'edit' => 'roles',
453
+ 'edit-specific' => array( 'administrator' ),
454
+ ),
455
+ );
456
  }
457
+
458
+ $data['visualizer-permissions'] = $permissions;
459
  }
460
 
461
  return $data;
659
 
660
  /**
661
  * Format chart data.
662
+ *
663
+ * Note: No matter how tempted, don't use the similar method from Visualizer_Source. That works on a different structure.
664
  */
665
  public function format_chart_data( $data, $series ) {
666
  foreach ( $series as $i => $row ) {
673
  continue;
674
  }
675
 
676
+ switch ( $row['type'] ) {
677
+ case 'number':
678
+ foreach ( $data as $o => $col ) {
679
+ $data[ $o ][ $i ] = ( is_numeric( $col[ $i ] ) ) ? floatval( $col[ $i ] ) : ( is_numeric( str_replace( ',', '', $col[ $i ] ) ) ? floatval( str_replace( ',', '', $col[ $i ] ) ) : null );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
680
  }
681
+ break;
682
+ case 'boolean':
683
+ foreach ( $data as $o => $col ) {
684
+ $data[ $o ][ $i ] = ! empty( $col[ $i ] ) ? filter_var( $col[ $i ], FILTER_VALIDATE_BOOLEAN ) : false;
685
+ }
686
+ break;
687
+ case 'timeofday':
688
+ foreach ( $data as $o => $col ) {
689
+ $date = new DateTime( '1984-03-16T' . $col[ $i ] );
690
+ if ( $date ) {
691
+ $data[ $o ][ $i ] = array(
692
+ intval( $date->format( 'H' ) ),
693
+ intval( $date->format( 'i' ) ),
694
+ intval( $date->format( 's' ) ),
695
+ 0,
696
+ );
697
+ }
698
+ }
699
+ break;
700
+ case 'string':
701
+ foreach ( $data as $o => $col ) {
702
+ $data[ $o ][ $i ] = $this->toUTF8( $col[ $i ] );
703
+ }
704
+ break;
705
  }
706
  }
707
 
classes/Visualizer/Gutenberg/build/block.js CHANGED
@@ -61,9 +61,9 @@ object-assign
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=_(a,n),e.dispatchEvent(a)):r.createEventObject&&(a=r.createEventObject(),a=_(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)},f=function(e,t){return e.getTime()===t.getTime()},_=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]=_({},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>"},w=function(e,t){return"<tr>"+(t?e.reverse():e).join("")+"</tr>"},M=function(e,t,n,r,a,i){var o,s,l,c,d,m=e._o,p=n===m.minYear,h=n===m.maxYear,f='<div id="'+i+'" class="pika-title" role="heading" aria-live="assertive">',_=!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?f+=d+c:f+=c+d,p&&(0===r||m.minMonth>=r)&&(_=!1),h&&(11===r||m.maxMonth<=r)&&(y=!1),0===t&&(f+='<button class="pika-prev'+(_?"":" is-disabled")+'" type="button">'+m.i18n.previousMonth+"</button>"),t===e._o.numberOfMonths-1&&(f+='<button class="pika-next'+(y?"":" is-disabled")+'" type="button">'+m.i18n.nextMonth+"</button>"),f+"</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=_({},g,!0));var t=_(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">'+M(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,_,y,g=0===t?11:t-1,M=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)&&f(j,this._d),E=f(j,a),C=S<o||S>=i+o,P=S-o+1,H=t,z=e,A=r.startRange&&f(r.startRange,j),N=r.endRange&&f(r.endRange,j),F=r.startRange&&r.endRange&&r.startRange<j&&j<r.endRange;C&&(S<o?(P=Y+P,H=g,z=k):(P-=i,H=M,z=L));var R={day:P,month:H,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,_=e,y=void 0,void 0,y=new Date(_,0,1),'<td class="pika-week">'+Math.ceil(((new Date(_,m,u)-y)/864e5+y.getDay()+1)/7)+"</td>")),s.push(w(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,f=function(){return"reactgooglegraph-"+(h+=1)},_=["#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,w=function(e){var t=e.children,n=e.value;return Object(r.createElement)(b,{value:n},t)},M=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,w,M,k,L,Y,D;return d(this,(function(d){switch(d.label){case 0:return e=this.props,t=e.google,c=e.googleChartWrapper,_=null,null!==r&&(g=t.visualization.arrayToDataTable(r.old),b=t.visualization.arrayToDataTable(r.new),_=t.visualization[u].prototype.computeDiff(g,b)),null===n?[3,1]:(f=Array.isArray(n)?t.visualization.arrayToDataTable(n):new t.visualization.DataTable(n),[3,5]);case 1:return null===a||null===i?[3,2]:(f=t.visualization.arrayToDataTable([i].concat(a)),[3,5]);case 2:return null===p?[3,4]:[4,y(t,p,h)];case 3:return f=d.sent(),[3,5];case 4:f=t.visualization.arrayToDataTable([]),d.label=5;case 5:for(v=f.getNumberOfColumns(),w=0;w<v;w+=1)M=this.getColumnID(f,w),this.state.hiddenColumns.includes(M)&&(k=f.getColumnLabel(w),L=f.getColumnId(w),Y=f.getColumnType(w),f.removeColumn(w),f.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(f),c.draw(),null!==this.props.googleChartDashboard&&this.props.googleChartDashboard.draw(f),null!==_&&(c.setDataTable(_),c.draw()),null!==m&&(this.applyFormatters(f,m),c.setDataTable(f),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]:_[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)(M,{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)(M,{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?f():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)(w,{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 P(e){return(P=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function H(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?H(e):t}(this,P(t).apply(this,arguments))).initDataTable=e.initDataTable.bind(H(e)),e.dataRenderer=e.dataRenderer.bind(H(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(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){var n,r=this.props.options,a=null;if(void 0===r.series||void 0===r.series[t]||void 0===r.series[t].format)return a;switch(e){case"date":case"datetime":case"timeofday":a=r.series[t].format&&r.series[t].format.from&&r.series[t].format.to?jQuery.fn.dataTable.render.moment(r.series[t].format.from,r.series[t].format.to):jQuery.fn.dataTable.render.moment("MM-DD-YYYY");break;case"num":var i=["","","","",""];r.series[t].format.thousands&&(i[0]=r.series[t].format.thousands),r.series[t].format.decimal&&(i[1]=r.series[t].format.decimal),r.series[t].format.precision&&0<parseInt(r.series[t].format.precision)&&(i[2]=r.series[t].format.precision),r.series[t].format.prefix&&(i[3]=r.series[t].format.prefix),r.series[t].format.suffix&&(i[4]=r.series[t].format.suffix),a=(n=jQuery.fn.dataTable.render).number.apply(n,i);break;case"boolean":jQuery.fn.dataTable.render.extra=function(e,n,a){return!0!==e&&"true"!==e||""===r.series[t].format.truthy?!1!==e&&"false"!==e||""===r.series[t].format.falsy?e:r.series[t].format.falsy.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,""):r.series[t].format.truthy.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"")},a=jQuery.fn.dataTable.render.extra}return a}},{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},K=function(e,t){return!0===e[t]||"true"===e[t]||"1"===e[t]||1===e[t]};function Z(e){return(Z="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 Q(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 X(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){Q(i,r,a,o,s,"next",e)}function s(e){Q(i,r,a,o,s,"throw",e)}o(void 0)}))}}function ee(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 te(e){return(te=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ne(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function re(e,t){return(re=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ae=lodash.startCase,ie=wp.i18n.__,oe=wp.apiFetch,se=wp.element,le=se.Component,ue=se.Fragment,ce=wp.components,de=ce.Button,me=ce.Dashicon,pe=ce.ExternalLink,he=ce.Notice,fe=ce.Placeholder,_e=ce.Spinner,ye=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"!==Z(t)&&"function"!=typeof t?ne(e):t}(this,te(t).apply(this,arguments))).loadMoreCharts=e.loadMoreCharts.bind(ne(e)),e.state={charts:null,isBusy:!1,chartsLoaded:!1,perPage:visualizerLocalize.chartsPerPage},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&&re(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:(o=X(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=visualizerLocalize.chartsPerPage,e.next=3,oe({path:"wp/v2/visualizer/?per_page="+t+"&meta_key=visualizer-chart-library&meta_value=ChartJS"});case 3:n=e.sent,this.setState({charts:n});case 5:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"loadMoreCharts",value:(i=X(regeneratorRuntime.mark((function e(){var t,n,r,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.state.charts.length,n=this.state.chartsLoaded,r=this.state.perPage,this.setState({isBusy:!0}),e.next=6,oe({path:"wp/v2/visualizer/?per_page=".concat(r,"&meta_key=visualizer-chart-library&meta_value=ChartJS&offset=").concat(t)});case 6:a=e.sent,r>a.length&&(n=!0),this.setState({charts:this.state.charts.concat(a),isBusy:!1,chartsLoaded:n});case 9: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,i=t.perPage;return wp.element.createElement("div",{className:"visualizer-settings__charts"},wp.element.createElement(he,{status:"warning",isDismissible:!1},ie("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(pe,{href:visualizerLocalize.adminPage},ie("Click here to visit Visualizer Charts Library."))),null!==n?1<=n.length?wp.element.createElement(ue,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),0<=["gauge","tabular","timeline"].indexOf(o["visualizer-chart-type"])?"DataTable"===o["visualizer-chart-library"]?a=o["visualizer-chart-type"]:("tabular"===(a=o["visualizer-chart-type"])&&(a="table"),a=ae(a)):a="".concat(ae(o["visualizer-chart-type"]),"Chart"),!o["visualizer-chart-library"]||"ChartJS"!==o["visualizer-chart-library"])return o["visualizer-data-exploded"]&&(i=ie("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",key:"chart-".concat(n[t].id)},wp.element.createElement("div",{className:"visualizer-settings__charts-title"},r),"DataTable"===o["visualizer-chart-library"]?wp.element.createElement(R,{id:n[t].id,rows:o["visualizer-data"],columns:o["visualizer-series"],chartsScreen:!0,options: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:ie("Insert Chart"),onClick:function(){return e.props.getChart(n[t].id)}},wp.element.createElement(me,{icon:"upload"})))}))),!a&&i-1<n.length&&wp.element.createElement(de,{isPrimary:!0,isLarge:!0,onClick:this.loadMoreCharts,isBusy:r},ie("Load More"))):wp.element.createElement("p",{className:"visualizer-no-charts"},ie("No charts found.")):wp.element.createElement(fe,null,wp.element.createElement(_e,null)))}}])&&ee(n.prototype,r),a&&ee(n,a),t}(le);function ge(e){return(ge="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 be(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 ve(e){return(ve=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function we(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 ke=wp.i18n.__,Le=wp.element.Component,Ye=wp.components,De=Ye.Button,Te=Ye.ExternalLink,Se=Ye.PanelBody,Oe=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"!==ge(t)&&"function"!=typeof t?we(e):t}(this,ve(t).apply(this,arguments))).uploadInput=React.createRef(),e.fileUploaded=e.fileUploaded.bind(we(e)),e.uploadImport=e.uploadImport.bind(we(e)),e.state={uploadLabel:ke("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:ke("Upload")})}},{key:"uploadImport",value:function(){this.props.readUploadedFile(this.uploadInput),this.setState({uploadLabel:ke("Uploaded")})}},{key:"render",value:function(){return wp.element.createElement(Se,{title:ke("Import data from file"),initialOpen:!1},wp.element.createElement("p",null,ke("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,ke("If you are unsure about how to format your data CSV then please take a look at this sample: "),wp.element.createElement(Te,{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(De,{isPrimary:!0,onClick:this.uploadImport},this.state.uploadLabel))}}])&&be(n.prototype,r),a&&be(n,a),t}(Le);function je(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 xe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?je(n,!0).forEach((function(t){Ee(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):je(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ee(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ce(e){return(Ce="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 Pe(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){Pe(i,r,a,o,s,"next",e)}function s(e){Pe(i,r,a,o,s,"throw",e)}o(void 0)}))}}function ze(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 Ae(e){return(Ae=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ne(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Fe(e,t){return(Fe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Re=wp.i18n.__,We=wp,Ie=(We.apiFetch,We.apiRequest),Be=wp.element.Component,Je=wp.components,Ue=Je.Button,qe=Je.ExternalLink,Ve=Je.IconButton,Ge=Je.Modal,$e=Je.PanelBody,Ke=Je.SelectControl,Ze=Je.TextControl,Qe=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"!==Ce(t)&&"function"!=typeof t?Ne(e):t}(this,Ae(t).apply(this,arguments))).openModal=e.openModal.bind(Ne(e)),e.initTable=e.initTable.bind(Ne(e)),e.onToggle=e.onToggle.bind(Ne(e)),e.toggleHeaders=e.toggleHeaders.bind(Ne(e)),e.getJSONRoot=e.getJSONRoot.bind(Ne(e)),e.getJSONData=e.getJSONData.bind(Ne(e)),e.getTableData=e.getTableData.bind(Ne(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&&Fe(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,Ie({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"===Ce(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"===Ce(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"!==Ce(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,Ie({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"===Ce(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"===Ce(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"!==Ce(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:Re("Don't use pagination"),value:0}],t.data.paging&&"root>next"===t.data.paging[0]&&n.push({label:Re("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,Ie({path:"/visualizer/v1/set-json-data",data:xe({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"===Ce(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"===Ce(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"!==Ce(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($e,{title:Re("Import from JSON"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,Re("You can choose here to import or synchronize your chart data with a remote JSON source.")),wp.element.createElement("p",null,wp.element.createElement(qe,{href:"https://docs.themeisle.com/article/1052-how-to-generate-charts-from-json-data-rest-endpoints"},Re("For more info check this tutorial."))),wp.element.createElement(Ke,{label:Re("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:Re("One-time"),value:"-1"},{label:Re("Live"),value:"0"},{label:Re("Each hour"),value:"1"},{label:Re("Each 12 hours"),value:"12"},{label:Re("Each day"),value:"24"},{label:Re("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(Ue,{isPrimary:!0,isLarge:!0,onClick:this.openModal},Re("Modify Parameters")),this.state.isOpen&&wp.element.createElement(Ge,{title:Re("Import from JSON"),className:"visualizer-json-query-modal",shouldCloseOnClickOutside:!1,onRequestClose:function(){e.setState({isOpen:!1,isTableRendered:!1})}},wp.element.createElement($e,{title:Re("Step 1: Specify the JSON endpoint/URL"),opened:this.state.isFirstStepOpen,onToggle:function(){return e.onToggle("isFirstStepOpen")}},wp.element.createElement("p",null,Re("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(qe,{href:"https://docs.themeisle.com/article/1043-visualizer-how-to-extend-rest-endpoints-with-json-response"},Re("How to extend REST endpoints with JSON response"))),wp.element.createElement(Ze,{placeholder:Re("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(Ve,{icon:"arrow-right-alt2",label:Re("Add Headers"),onClick:this.toggleHeaders},Re("Add Headers")),this.state.isHeaderPanelOpen&&wp.element.createElement("div",{className:"visualizer-json-query-modal-headers-panel"},wp.element.createElement(Ke,{label:Re("Request Type"),value:this.props.chart["visualizer-json-headers"]?this.props.chart["visualizer-json-headers"].method:this.state.requestHeaders.method,options:[{value:"GET",label:Re("GET")},{value:"POST",label:Re("POST")}],onChange:function(t){var n=xe({},e.state.requestHeaders),r=e.state.requestHeaders;n.method=t,r=xe({},r,{method:t}),e.setState({requestHeaders:r}),e.props.editJSONHeaders(n)}}),wp.element.createElement("p",null,Re("Credentials")),wp.element.createElement(Ze,{label:Re("Username"),placeholder:Re("Username/Access Key"),value:this.props.chart["visualizer-json-headers"]&&"object"===Ce(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.username:this.state.requestHeaders.username,onChange:function(t){var n=xe({},e.state.requestHeaders),r=e.state.requestHeaders;n.auth={username:t,password:e.props.chart["visualizer-json-headers"]&&"object"===Ce(e.props.chart["visualizer-json-headers"].auth)?e.props.chart["visualizer-json-headers"].auth.password:e.state.requestHeaders.password},r=xe({},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"},Re("&")),wp.element.createElement(Ze,{label:Re("Password"),placeholder:Re("Password/Secret Key"),type:"password",value:this.props.chart["visualizer-json-headers"]&&"object"===Ce(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.password:this.state.requestHeaders.password,onChange:function(t){var n=xe({},e.state.requestHeaders),r=e.state.requestHeaders;n.auth={username:e.props.chart["visualizer-json-headers"]&&"object"===Ce(e.props.chart["visualizer-json-headers"].auth)?e.props.chart["visualizer-json-headers"].auth.username:e.state.requestHeaders.username,password:t},r=xe({},r,{username:n.username,password:t}),e.setState({requestHeaders:r}),e.props.editJSONHeaders(n)}}),wp.element.createElement("p",null,Re("OR")),wp.element.createElement(Ze,{label:Re("Authorization"),placeholder:Re("e.g. SharedKey <AccountName>:<Signature>"),value:this.props.chart["visualizer-json-headers"]&&"object"!==Ce(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth:this.state.requestHeaders.auth,onChange:function(t){var n=xe({},e.state.requestHeaders),r=e.state.requestHeaders;n.auth=t,r=xe({},r,{auth:t}),e.setState({requestHeaders:r}),e.props.editJSONHeaders(n)}})),wp.element.createElement(Ue,{isPrimary:!0,isLarge:!0,isBusy:this.state.isLoading,disabled:this.state.isLoading,onClick:this.getJSONRoot},Re("Fetch Endpoint"))),wp.element.createElement($e,{title:Re("Step 2: Choose the JSON root"),initialOpen:!1,opened:this.state.isSecondStepOpen,onToggle:function(){return e.onToggle("isSecondStepOpen")}},wp.element.createElement("p",null,Re("If you see Invalid Data, you may have selected the wrong root to fetch data from. Please select an alternative.")),wp.element.createElement(Ke,{value:this.props.chart["visualizer-json-root"],options:this.state.endpointRoots,onChange:this.props.editJSONRoot}),wp.element.createElement(Ue,{isPrimary:!0,isLarge:!0,isBusy:this.state.isLoading,disabled:this.state.isLoading,onClick:this.getJSONData},Re("Parse Endpoint"))),wp.element.createElement($e,{title:Re("Step 3: Specify miscellaneous parameters"),initialOpen:!1,opened:this.state.isThirdStepOpen,onToggle:function(){return e.onToggle("isThirdStepOpen")}},"community"!==visualizerLocalize.isPro?wp.element.createElement(Ke,{value:this.props.chart["visualizer-json-paging"]||0,options:this.state.endpointPaging,onChange:this.props.editJSONPaging}):wp.element.createElement("p",null,Re("Enable this feature in PRO version!"))),wp.element.createElement($e,{title:Re("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,Re("Select whether to include the data in the chart. Each column selected will form one series.")),wp.element.createElement("li",null,Re("If a column is selected to be included, specify its data type.")),wp.element.createElement("li",null,Re("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,Re("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(Ue,{isPrimary:!0,isLarge:!0,isBusy:this.state.isLoading,disabled:this.state.isLoading,onClick:this.getTableData},Re("Save & Show Chart")))))}}])&&ze(n.prototype,r),a&&ze(n,a),t}(Be);function Xe(e){return(Xe="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 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 tt(e,t){return!t||"object"!==Xe(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 nt(e){return(nt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function rt(e,t){return(rt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var at=wp.i18n.__,it=wp.element.Component,ot=wp.components,st=ot.Button,lt=ot.ExternalLink,ut=ot.PanelBody,ct=ot.SelectControl,dt=ot.TextControl,mt=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),tt(this,nt(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&&rt(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this;return wp.element.createElement(ut,{title:at("Import data from URL"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(ut,{title:at("One Time Import"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,at("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,at("If you are unsure about how to format your data CSV then please take a look at this sample: "),wp.element.createElement(lt,{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,at("You can also import data from Google Spreadsheet.")),wp.element.createElement(dt,{placeholder:at("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(st,{isPrimary:!0,isLarge:!0,isBusy:"uploadData"===this.props.isLoading,disabled:"uploadData"===this.props.isLoading,onClick:function(){return e.props.uploadData(!1)}},at("Import Data"))),"business"===visualizerLocalize.isPro?wp.element.createElement(ut,{title:at("Schedule Import"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,at("You can choose here to synchronize your chart data with a remote CSV file. ")),wp.element.createElement("p",null,at("You can also synchronize with your Google Spreadsheet file.")),wp.element.createElement("p",null,at("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(dt,{placeholder:at("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(ct,{label:at("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:at("Each hour"),value:"1"},{label:at("Each 12 hours"),value:"12"},{label:at("Each day"),value:"24"},{label:at("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(st,{isPrimary:!0,isLarge:!0,isBusy:"uploadData"===this.props.isLoading,disabled:"uploadData"===this.props.isLoading,onClick:function(){return e.props.uploadData(!0)}},at("Save Schedule"))):wp.element.createElement(ut,{title:at("Schedule Import"),icon:"lock",className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,at("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(st,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},at("Buy Now"))),wp.element.createElement(Qe,{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}))}}])&&et(n.prototype,r),a&&et(n,a),t}(it);function pt(e){return(pt="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,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 ft(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"!==pt(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 yt(e){return(yt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function gt(e,t){return(gt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var bt=wp.i18n.__,vt=wp.apiFetch,wt=wp.element,Mt=wt.Component,kt=wt.Fragment,Lt=wp.components,Yt=Lt.Button,Dt=Lt.PanelBody,Tt=Lt.Placeholder,St=Lt.SelectControl,Ot=Lt.Spinner,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=_t(this,yt(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&&gt(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,vt({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){ht(a,n,r,o,s,"next",e)}function s(e){ht(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(Dt,{title:bt("Import from other chart"),initialOpen:!1},1<=this.state.charts.length?wp.element.createElement(kt,null,wp.element.createElement(St,{label:bt("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(Yt,{isPrimary:!0,isLarge:!0,isBusy:"getChartData"===this.props.isLoading,onClick:function(){return e.props.getChartData(e.state.id)}},bt("Import Chart"))):wp.element.createElement(Tt,null,wp.element.createElement(Ot,null))):wp.element.createElement(Dt,{title:bt("Import from other chart"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,bt("Enable this feature in PRO version!")),wp.element.createElement(Yt,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},bt("Buy Now")))}}])&&ft(n.prototype,r),a&&ft(n,a),t}(Mt);function xt(e){return(xt="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 Et(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 Ct(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){return(Pt=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 zt(e,t){return(zt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var At=wp.i18n.__,Nt=wp.apiRequest,Ft=wp.components,Rt=Ft.Button,Wt=Ft.ExternalLink,It=wp.element,Bt=It.Component,Jt=It.Fragment,Ut=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"!==xt(t)&&"function"!=typeof t?Ht(e):t}(this,Pt(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&&zt(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,Nt({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){Et(a,n,r,o,s,"next",e)}function s(e){Et(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(Jt,null,wp.element.createElement("textarea",{className:"visualizer-db-query",placeholder:At("Your query goes here…")},this.props.chart["visualizer-db-query"]),wp.element.createElement("div",{className:"visualizer-db-query-actions"},wp.element.createElement(Rt,{isLarge:!0,isDefault:!0,isBusy:this.state.isLoading,onClick:this.onSave},At("Show Results")),wp.element.createElement(Rt,{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)}},At("Save"))),wp.element.createElement("ul",null,wp.element.createElement("li",null,wp.element.createElement(Wt,{href:"https://docs.themeisle.com/article/970-visualizer-sample-queries-to-generate-charts"},At("Examples of queries and links to resources that you can use with this feature."))),wp.element.createElement("li",null,At("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"}))}}])&&Ct(n.prototype,r),a&&Ct(n,a),t}(Bt);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 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 Gt(e){return(Gt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function $t(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 Zt=wp.i18n.__,Qt=wp.element.Component,Xt=wp.components,en=Xt.Button,tn=Xt.Modal,nn=Xt.PanelBody,rn=Xt.SelectControl,an=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"!==qt(t)&&"function"!=typeof t?$t(e):t}(this,Gt(t).apply(this,arguments))).save=e.save.bind($t(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:"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(nn,{title:Zt("Import data from database"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,Zt("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(en,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},Zt("Buy Now"))):wp.element.createElement(nn,{title:Zt("Import data from database"),initialOpen:!1},wp.element.createElement("p",null,Zt("You can import data from the database here.")),wp.element.createElement("p",null,Zt("How often do you want to refresh the data from the database.")),wp.element.createElement(rn,{label:Zt("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:Zt("Live"),value:"0"},{label:Zt("Each hour"),value:"1"},{label:Zt("Each 12 hours"),value:"12"},{label:Zt("Each day"),value:"24"},{label:Zt("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(en,{isPrimary:!0,isLarge:!0,onClick:function(){return e.setState({isOpen:!0})}},Zt("Create Query")),this.state.isOpen&&wp.element.createElement(tn,{title:Zt("Import from database"),onRequestClose:function(){return e.setState({isOpen:!1})},className:"visualizer-db-query-modal",shouldCloseOnClickOutside:!1},wp.element.createElement(Ut,{chart:this.props.chart,changeQuery:this.props.changeQuery,save:this.save})))}}])&&Vt(n.prototype,r),a&&Vt(n,a),t}(Qt),on=n(132);n(152);function sn(e){return(sn="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 ln(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 un(e,t){return!t||"object"!==sn(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 cn(e){return(cn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function dn(e,t){return(dn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var mn=wp.i18n.__,pn=wp.element.Component,hn=wp.components,fn=hn.Button,_n=hn.ButtonGroup,yn=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=un(this,cn(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&&dn(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(on.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(fn,{isDefault:!0,isLarge:!0,onClick:this.props.toggleModal},mn("Close")),wp.element.createElement(fn,{isPrimary:!0,isLarge:!0,onClick:function(t){e.props.toggleModal(),e.props.editChartData(e.data,"Visualizer_Source_Csv")}},mn("Save"))))}}])&&ln(n.prototype,r),a&&ln(n,a),t}(pn);function gn(e){return(gn="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 bn(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 vn(e){return(vn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function wn(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 kn=wp.i18n.__,Ln=wp.element,Yn=Ln.Component,Dn=Ln.Fragment,Tn=wp.components,Sn=Tn.Button,On=Tn.Modal,jn=Tn.PanelBody,xn=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"!==gn(t)&&"function"!=typeof t?wn(e):t}(this,vn(t).apply(this,arguments))).toggleModal=e.toggleModal.bind(wn(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(Dn,null,wp.element.createElement(jn,{title:kn("Manual Data"),initialOpen:!1},wp.element.createElement("p",null,kn("You can manually edit the chart data using a spreadsheet like editor.")),wp.element.createElement(Sn,{isPrimary:!0,isLarge:!0,isBusy:this.state.isOpen,onClick:this.toggleModal},kn("View Editor"))),this.state.isOpen&&wp.element.createElement(On,{title:"Chart Editor",onRequestClose:this.toggleModal,shouldCloseOnClickOutside:!1},wp.element.createElement(yn,{chart:this.props.chart,editChartData:this.props.editChartData,toggleModal:this.toggleModal}))):wp.element.createElement(jn,{title:kn("Manual Data"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,kn("Enable this feature in PRO version!")),wp.element.createElement(Sn,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},kn("Buy Now")))}}])&&bn(n.prototype,r),a&&bn(n,a),t}(Yn);function En(e){return(En="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 Cn(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 Pn(e,t){return!t||"object"!==En(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 zn(e,t){return(zn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var An=wp.i18n.__,Nn=wp.element.Component,Fn=(wp.blockEditor||wp.editor).ColorPalette,Rn=wp.components,Wn=Rn.BaseControl,In=Rn.CheckboxControl,Bn=Rn.PanelBody,Jn=Rn.SelectControl,Un=Rn.TextControl,qn=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Pn(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&&zn(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:An("The tooltip will be displayed when the user hovers over an element"),value:"focus"}];-1>=["timeline"].indexOf(t)&&(r[1]={label:An("The tooltip will be displayed when the user selects an element"),value:"selection"}),r[2]={label:An("The tooltip will not be displayed"),value:"none"};var a=[{label:An("Left of the chart"),value:"left"},{label:An("Right of the chart"),value:"right"},{label:An("Above the chart"),value:"top"},{label:An("Below the chart"),value:"bottom"},{label:An("Omit the legend"),value:"none"}];return"pie"!==t&&a.push({label:An("Inside the chart"),value:"in"}),wp.element.createElement(Bn,{title:An("General Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Bn,{title:An("Title"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Un,{label:An("Chart Title"),help:An("Text to display above the chart."),value:n.title,onChange:function(t){n.title=t,e.props.edit(n)}}),-1>=["tabular","dataTable","gauge","geo","pie","timeline"].indexOf(t)&&wp.element.createElement(Jn,{label:An("Chart Title Position"),help:An("Where to place the chart title, compared to the chart area."),value:n.titlePosition?n.titlePosition:"out",options:[{label:An("Inside the chart"),value:"in"},{label:An("Outside the chart"),value:"out"},{label:An("None"),value:"none"}],onChange:function(t){n.titlePosition=t,e.props.edit(n)}}),-1>=["tabular","dataTable","gauge","geo","timeline"].indexOf(t)&&wp.element.createElement(Wn,{label:An("Chart Title Color")},wp.element.createElement(Fn,{value:n.titleTextStyle.color,onChange:function(t){n.titleTextStyle.color=t,e.props.edit(n)}})),-1>=["tabular","dataTable","gauge","geo","pie","timeline"].indexOf(t)&&wp.element.createElement(Jn,{label:An("Axes Titles Position"),help:An("Determines where to place the axis titles, compared to the chart area."),value:n.axisTitlesPosition?n.axisTitlesPosition:"out",options:[{label:An("Inside the chart"),value:"in"},{label:An("Outside the chart"),value:"out"},{label:An("None"),value:"none"}],onChange:function(t){n.axisTitlesPosition=t,e.props.edit(n)}})),-1>=["tabular","dataTable","gauge","geo","pie","timeline"].indexOf(t)&&wp.element.createElement(Bn,{title:An("Font Styles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Jn,{label:An("Font Family"),help:An("The default font family for all text in the chart."),value:n.fontName?n.fontName:"Arial",options:[{label:An("Arial"),value:"Arial"},{label:An("Sans Serif"),value:"Sans Serif"},{label:An("Serif"),value:"serif"},{label:An("Arial"),value:"Arial"},{label:An("Wide"),value:"Arial black"},{label:An("Narrow"),value:"Arial Narrow"},{label:An("Comic Sans MS"),value:"Comic Sans MS"},{label:An("Courier New"),value:"Courier New"},{label:An("Garamond"),value:"Garamond"},{label:An("Georgia"),value:"Georgia"},{label:An("Tahoma"),value:"Tahoma"},{label:An("Verdana"),value:"Verdana"}],onChange:function(t){n.fontName=t,e.props.edit(n)}}),wp.element.createElement(Jn,{label:An("Font Size"),help:An("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>=["tabular","dataTable","gauge","geo","timeline"].indexOf(t)&&wp.element.createElement(Bn,{title:An("Legend"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Jn,{label:An("Position"),help:An("Determines where to place the legend, compared to the chart area."),value:n.legend.position?n.legend.position:"right",options:a,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(Jn,{label:An("Alignment"),help:An("Determines the alignment of the legend."),value:n.legend.alignment?n.legend.alignment:"15",options:[{label:An("Aligned to the start of the allocated area"),value:"start"},{label:An("Centered in the allocated area"),value:"center"},{label:An("Aligned to the end of the allocated area"),value:"end"}],onChange:function(t){n.legend.alignment=t,e.props.edit(n)}}),wp.element.createElement(Wn,{label:An("Font Color")},wp.element.createElement(Fn,{value:n.legend.textStyle.color,onChange:function(t){n.legend.textStyle.color=t,e.props.edit(n)}}))),-1>=["tabular","gauge","geo","dataTable","timeline"].indexOf(t)&&wp.element.createElement(Bn,{title:An("Tooltip"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Jn,{label:An("Trigger"),help:An("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(Jn,{label:An("Show Color Code"),help:An("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:An("Yes"),value:"1"},{label:An("No"),value:"0"}],onChange:function(t){n.tooltip.showColorCode=t,e.props.edit(n)}}),0<=["pie"].indexOf(t)&&wp.element.createElement(Jn,{label:An("Text"),help:An("Determines what information to display when the user hovers over a pie slice."),value:n.tooltip.text?n.tooltip.text:"both",options:[{label:An("Display both the absolute value of the slice and the percentage of the whole"),value:"both"},{label:An("Display only the absolute value of the slice"),value:"value"},{label:An("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>=["tabular","dataTable","gauge","geo","pie","timeline"].indexOf(t)&&wp.element.createElement(Bn,{title:An("Animation"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(In,{label:An("Animate on startup?"),help:An("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(Un,{label:An("Duration"),help:An("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(Jn,{label:An("Easing"),help:An("The easing function applied to the animation."),value:n.animation.easing?n.animation.easing:"linear",options:[{label:An("Constant speed"),value:"linear"},{label:An("Start slow and speed up"),value:"in"},{label:An("Start fast and slow down"),value:"out"},{label:An("Start slow, speed up, then slow down"),value:"inAndOut"}],onChange:function(t){n.animation.easing=t,e.props.edit(n)}})))}}])&&Cn(n.prototype,r),a&&Cn(n,a),t}(Nn);function Vn(e){return(Vn="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 $n(e,t){return!t||"object"!==Vn(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 Kn(e){return(Kn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Zn(e,t){return(Zn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Qn=wp.i18n.__,Xn=wp.element.Component,er=wp.components,tr=er.PanelBody,nr=er.Notice,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),$n(this,Kn(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&&Zn(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:Qn("Instance Settings"),initialOpen:!0,className:"visualizer-instance-panel"},wp.element.createElement(nr,{status:"info",isDismissible:!1},wp.element.createElement("p",null,Qn("These settings are valid only for this instance of the chart.")),wp.element.createElement("p",null,Qn("This means that if you insert this chart again elsewhere, these values will not persist."))),wp.element.createElement(rr,{label:Qn("Should this instance lazy Load?"),help:Qn("-1: do not lazy load. Any number greater than -1 will lazy load the chart once the viewport is that many pixels away from the chart"),value:this.props.attributes.lazy?Number(this.props.attributes.lazy):-1,type:"number",min:"-1",max:"1000",step:"1",onChange:function(n){e.props.attributes.lazy=n,e.props.edit(t)}}))}}])&&Gn(n.prototype,r),a&&Gn(n,a),t}(Xn);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.blockEditor||wp.editor).ColorPalette,fr=wp.components,_r=fr.BaseControl,yr=fr.ExternalLink,gr=fr.PanelBody,br=fr.SelectControl,vr=fr.TextControl,wr=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(gr,{title:cr("Horizontal Axis Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(gr,{title:cr("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(vr,{label:cr("Axis Title"),help:cr("The title of the horizontal axis."),value:n.hAxis.title,onChange:function(t){n.hAxis.title=t,e.props.edit(n)}}),wp.element.createElement(br,{label:cr("Text Position"),help:cr("Position of the horizontal axis text, relative to the chart area."),value:n.hAxis.textPosition?n.hAxis.textPosition:"out",options:[{label:cr("Inside the chart"),value:"in"},{label:cr("Outside the chart"),value:"out"},{label:cr("None"),value:"none"}],onChange:function(t){n.hAxis.textPosition=t,e.props.edit(n)}}),wp.element.createElement(br,{label:cr("Direction"),help:cr("The direction in which the values along the horizontal axis grow."),value:n.hAxis.direction?n.hAxis.direction:"1",options:[{label:cr("Identical Direction"),value:"1"},{label:cr("Reverse Direction"),value:"-1"}],onChange:function(t){n.hAxis.direction=t,e.props.edit(n)}}),wp.element.createElement(_r,{label:cr("Base Line Color")},wp.element.createElement(hr,{value:n.hAxis.baselineColor,onChange:function(t){n.hAxis.baselineColor=t,e.props.edit(n)}})),wp.element.createElement(_r,{label:cr("Axis Text Color")},wp.element.createElement(hr,{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(pr,null,wp.element.createElement(vr,{label:cr("Number Format"),help:cr("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,cr("For number axis labels, this is a subset of the formatting "),wp.element.createElement(yr,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},cr("ICU pattern set.")),cr(" 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,cr("For date axis labels, this is a subset of the date formatting "),wp.element.createElement(yr,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},cr("ICU date and time format."))))),-1>=["column"].indexOf(t)&&wp.element.createElement(pr,null,wp.element.createElement(gr,{title:cr("Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(vr,{label:cr("Count"),help:cr("The approximate number of horizontal gridlines inside the chart area. You can specify a value of -1 to automatically compute the number of gridlines, 0 or 1 to draw no gridlines, or 2 or more to only draw gridline. Any number greater than 2 will be used to compute the minSpacing between 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(_r,{label:cr("Color")},wp.element.createElement(hr,{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(gr,{title:cr("Minor Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(vr,{label:cr("Count"),help:cr("Specify 0 to disable the minor gridlines."),value:n.hAxis.minorGridlines?n.hAxis.minorGridlines.count:"",onChange:function(t){n.hAxis.minorGridlines||(n.hAxis.minorGridlines={}),n.hAxis.minorGridlines.count=t,e.props.edit(n)}}),wp.element.createElement(_r,{label:cr("Color")},wp.element.createElement(hr,{value:n.hAxis.minorGridlines?n.hAxis.minorGridlines.color:"",onChange:function(t){n.hAxis.minorGridlines||(n.hAxis.minorGridlines={}),n.hAxis.minorGridlines.color=t,e.props.edit(n)}}))),wp.element.createElement(gr,{title:cr("View Window"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(vr,{label:cr("Maximun Value"),help:cr("The maximum vertical data value to render."),value:n.hAxis.viewWindow?n.hAxis.viewWindow.max:"",onChange:function(t){n.hAxis.viewWindow||(n.hAxis.viewWindow={}),n.hAxis.viewWindow.max=t,e.props.edit(n)}}),wp.element.createElement(vr,{label:cr("Minimum Value"),help:cr("The minimum vertical data value to render."),value:n.hAxis.viewWindow?n.hAxis.viewWindow.min:"",onChange:function(t){n.hAxis.viewWindow||(n.hAxis.viewWindow={}),n.hAxis.viewWindow.min=t,e.props.edit(n)}}))))}}])&&or(n.prototype,r),a&&or(n,a),t}(mr);function Mr(e){return(Mr="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 kr(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 Lr(e,t){return!t||"object"!==Mr(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 Yr(e){return(Yr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Dr(e,t){return(Dr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Tr=wp.i18n.__,Sr=wp.element,Or=Sr.Component,jr=Sr.Fragment,xr=(wp.blockEditor||wp.editor).ColorPalette,Er=wp.components,Cr=Er.BaseControl,Pr=Er.ExternalLink,Hr=Er.PanelBody,zr=Er.SelectControl,Ar=Er.TextControl,Nr=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Lr(this,Yr(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&&Dr(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(Hr,{title:Tr("Vertical Axis Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Hr,{title:Tr("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Ar,{label:Tr("Axis Title"),help:Tr("The title of the Vertical axis."),value:n.vAxis.title,onChange:function(t){n.vAxis.title=t,e.props.edit(n)}}),wp.element.createElement(zr,{label:Tr("Text Position"),help:Tr("Position of the Vertical axis text, relative to the chart area."),value:n.vAxis.textPosition?n.vAxis.textPosition:"out",options:[{label:Tr("Inside the chart"),value:"in"},{label:Tr("Outside the chart"),value:"out"},{label:Tr("None"),value:"none"}],onChange:function(t){n.vAxis.textPosition=t,e.props.edit(n)}}),wp.element.createElement(zr,{label:Tr("Direction"),help:Tr("The direction in which the values along the Vertical axis grow."),value:n.vAxis.direction?n.vAxis.direction:"1",options:[{label:Tr("Identical Direction"),value:"1"},{label:Tr("Reverse Direction"),value:"-1"}],onChange:function(t){n.vAxis.direction=t,e.props.edit(n)}}),wp.element.createElement(Cr,{label:Tr("Base Line Color")},wp.element.createElement(xr,{value:n.vAxis.baselineColor,onChange:function(t){n.vAxis.baselineColor=t,e.props.edit(n)}})),wp.element.createElement(Cr,{label:Tr("Axis Text Color")},wp.element.createElement(xr,{value:n.vAxis.textStyle.color||n.vAxis.textStyle,onChange:function(t){n.vAxis.textStyle={},n.vAxis.textStyle.color=t,e.props.edit(n)}})),-1>=["bar"].indexOf(t)&&wp.element.createElement(jr,null,wp.element.createElement(Ar,{label:Tr("Number Format"),help:Tr("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,Tr("For number axis labels, this is a subset of the formatting "),wp.element.createElement(Pr,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},Tr("ICU pattern set.")),Tr(" 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,Tr("For date axis labels, this is a subset of the date formatting "),wp.element.createElement(Pr,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},Tr("ICU date and time format."))))),-1>=["bar"].indexOf(t)&&wp.element.createElement(jr,null,wp.element.createElement(Hr,{title:Tr("Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Ar,{label:Tr("Count"),help:Tr("The approximate number of vertical gridlines inside the chart area. You can specify a value of -1 to automatically compute the number of gridlines, 0 or 1 to draw no gridlines, or 2 or more to only draw gridline. Any number greater than 2 will be used to compute the minSpacing between 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(Cr,{label:Tr("Color")},wp.element.createElement(xr,{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(Hr,{title:Tr("Minor Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Ar,{label:Tr("Count"),help:Tr("Specify 0 to disable the minor gridlines."),value:n.vAxis.minorGridlines?n.vAxis.minorGridlines.count:"",onChange:function(t){n.vAxis.minorGridlines||(n.vAxis.minorGridlines={}),n.vAxis.minorGridlines.count=t,e.props.edit(n)}}),wp.element.createElement(Cr,{label:Tr("Color")},wp.element.createElement(xr,{value:n.vAxis.minorGridlines?n.vAxis.minorGridlines.color:"",onChange:function(t){n.vAxis.minorGridlines||(n.vAxis.minorGridlines={}),n.vAxis.minorGridlines.color=t,e.props.edit(n)}}))),wp.element.createElement(Hr,{title:Tr("View Window"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Ar,{label:Tr("Maximun Value"),help:Tr("The maximum vertical data value to render."),value:n.vAxis.viewWindow?n.vAxis.viewWindow.max:"",onChange:function(t){n.vAxis.viewWindow||(n.vAxis.viewWindow={}),n.vAxis.viewWindow.max=t,e.props.edit(n)}}),wp.element.createElement(Ar,{label:Tr("Minimum Value"),help:Tr("The minimum vertical data value to render."),value:n.vAxis.viewWindow?n.vAxis.viewWindow.min:"",onChange:function(t){n.vAxis.viewWindow||(n.vAxis.viewWindow={}),n.vAxis.viewWindow.min=t,e.props.edit(n)}}))))}}])&&kr(n.prototype,r),a&&kr(n,a),t}(Or);function Fr(e){return(Fr="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 Rr(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 Wr(e,t){return!t||"object"!==Fr(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 Ir(e){return(Ir=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Br(e,t){return(Br=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Jr=wp.i18n.__,Ur=wp.element,qr=Ur.Component,Vr=Ur.Fragment,Gr=(wp.blockEditor||wp.editor).ColorPalette,$r=wp.components,Kr=$r.BaseControl,Zr=$r.ExternalLink,Qr=$r.PanelBody,Xr=$r.SelectControl,ea=$r.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),Wr(this,Ir(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&&Br(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Qr,{title:Jr("Pie Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Vr,null,wp.element.createElement(ea,{label:Jr("Number Format"),help:Jr("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,Jr("For number axis labels, this is a subset of the formatting "),wp.element.createElement(Zr,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},Jr("ICU pattern set.")),Jr(" 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,Jr("For date axis labels, this is a subset of the date formatting "),wp.element.createElement(Zr,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},Jr("ICU date and time format.")))),wp.element.createElement(Xr,{label:Jr("Is 3D"),help:Jr("If set to yes, displays a three-dimensional chart."),value:t.is3D?t.is3D:"0",options:[{label:Jr("Yes"),value:"1"},{label:Jr("No"),value:"0"}],onChange:function(n){t.is3D=n,e.props.edit(t)}}),wp.element.createElement(Xr,{label:Jr("Reverse Categories"),help:Jr("If set to yes, will draw slices counterclockwise."),value:t.reverseCategories?t.reverseCategories:"0",options:[{label:Jr("Yes"),value:"1"},{label:Jr("No"),value:"0"}],onChange:function(n){t.reverseCategories=n,e.props.edit(t)}}),wp.element.createElement(Xr,{label:Jr("Slice Text"),help:Jr("The content of the text displayed on the slice."),value:t.pieSliceText?t.pieSliceText:"percentage",options:[{label:Jr("The percentage of the slice size out of the total"),value:"percentage"},{label:Jr("The quantitative value of the slice"),value:"value"},{label:Jr("The name of the slice"),value:"label"},{label:Jr("The quantitative value and percentage of the slice"),value:"value-and-percentage"},{label:Jr("No text is displayed"),value:"none"}],onChange:function(n){t.pieSliceText=n,e.props.edit(t)}}),wp.element.createElement(ea,{label:Jr("Pie Hole"),help:Jr("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:Jr("0.5"),value:t.pieHole,onChange:function(n){t.pieHole=n,e.props.edit(t)}}),wp.element.createElement(ea,{label:Jr("Start Angle"),help:Jr("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(Kr,{label:Jr("Slice Border Color")},wp.element.createElement(Gr,{value:t.pieSliceBorderColor,onChange:function(n){t.pieSliceBorderColor=n,e.props.edit(t)}})))}}])&&Rr(n.prototype,r),a&&Rr(n,a),t}(qr);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.Component,ua=(wp.blockEditor||wp.editor).ColorPalette,ca=wp.components,da=ca.BaseControl,ma=ca.PanelBody,pa=ca.TextControl,ha=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-settings"];return wp.element.createElement(ma,{title:sa("Residue Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(pa,{label:sa("Visibility Threshold"),help:sa("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:sa("0.001388889"),value:t.sliceVisibilityThreshold,onChange:function(n){t.sliceVisibilityThreshold=n,e.props.edit(t)}}),wp.element.createElement(pa,{label:sa("Residue Slice Label"),help:sa("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(da,{label:sa("Residue Slice Color")},wp.element.createElement(ua,{value:t.pieResidueSliceColor,onChange:function(n){t.pieResidueSliceColor=n,e.props.edit(t)}})))}}])&&ra(n.prototype,r),a&&ra(n,a),t}(la);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 _a(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 ya(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 ga(e){return(ga=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ba(e,t){return(ba=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var va=wp.i18n.__,wa=wp.element,Ma=wa.Component,ka=wa.Fragment,La=wp.components,Ya=La.PanelBody,Da=La.SelectControl,Ta=La.TextControl,Sa=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ya(this,ga(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&&ba(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(Ya,{title:va("Lines Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Ta,{label:va("Line Width"),help:va("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(Ta,{label:va("Point Size"),help:va("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(Da,{label:va("Curve Type"),help:va("Determines whether the series has to be presented in the legend or not."),value:n.curveType?n.curveType:"none",options:[{label:va("Straight line without curve"),value:"none"},{label:va("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(Da,{label:va("Focus Target"),help:va("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:va("Focus on a single data point."),value:"datum"},{label:va("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(Da,{label:va("Selection Mode"),help:va("Determines how many data points an user can select on a chart."),value:n.selectionMode?n.selectionMode:"single",options:[{label:va("Single data point"),value:"single"},{label:va("Multiple data points"),value:"multiple"}],onChange:function(t){n.selectionMode=t,e.props.edit(n)}}),wp.element.createElement(Da,{label:va("Aggregation Target"),help:va("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:va("Group selected data by x-value"),value:"category"},{label:va("Group selected data by series"),value:"series"},{label:va("Group selected data by x-value if all selections have the same x-value, and by series otherwise"),value:"auto"},{label:va("Show only one tooltip per selection"),value:"none"}],onChange:function(t){n.aggregationTarget=t,e.props.edit(n)}}),wp.element.createElement(Ta,{label:va("Point Opacity"),help:va("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(ka,null,wp.element.createElement(Ta,{label:va("Area Opacity"),help:va("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(Da,{label:va("Is Stacked"),help:va("If set to yes, series elements are stacked."),value:n.isStacked?n.isStacked:"0",options:[{label:va("Yes"),value:"1"},{label:va("No"),value:"0"}],onChange:function(t){n.isStacked=t,e.props.edit(n)}})),-1>=["scatter","area"].indexOf(t)&&wp.element.createElement(Da,{label:va("Interpolate Nulls"),help:va("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:va("Yes"),value:"1"},{label:va("No"),value:"0"}],onChange:function(t){n.interpolateNulls=t,e.props.edit(n)}}))}}])&&_a(n.prototype,r),a&&_a(n,a),t}(Ma);function Oa(e){return(Oa="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 ja(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 xa(e,t){return!t||"object"!==Oa(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 Ea(e){return(Ea=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ca(e,t){return(Ca=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Pa=wp.i18n.__,Ha=wp.element.Component,za=wp.components,Aa=za.PanelBody,Na=za.SelectControl,Fa=za.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),xa(this,Ea(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&&Ca(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Aa,{title:Pa("Bars Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Na,{label:Pa("Focus Target"),help:Pa("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:Pa("Focus on a single data point."),value:"datum"},{label:Pa("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(Na,{label:Pa("Is Stacked"),help:Pa("If set to yes, series elements are stacked."),value:t.isStacked?t.isStacked:"0",options:[{label:Pa("Yes"),value:"1"},{label:Pa("No"),value:"0"}],onChange:function(n){t.isStacked=n,e.props.edit(t)}}),wp.element.createElement(Fa,{label:Pa("Bars Opacity"),help:Pa("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)}}))}}])&&ja(n.prototype,r),a&&ja(n,a),t}(Ha);function Wa(e){return(Wa="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 Ba(e,t){return!t||"object"!==Wa(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 Ua(e,t){return(Ua=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var qa=wp.i18n.__,Va=wp.element.Component,Ga=(wp.blockEditor||wp.editor).ColorPalette,$a=wp.components,Ka=$a.BaseControl,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),Ba(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&&Ua(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:qa("Candles Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Za,{title:qa("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Qa,{label:qa("Focus Target"),help:qa("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:qa("Focus on a single data point."),value:"datum"},{label:qa("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(Qa,{label:qa("Selection Mode"),help:qa("Determines how many data points an user can select on a chart."),value:t.selectionMode?t.selectionMode:"single",options:[{label:qa("Single data point"),value:"single"},{label:qa("Multiple data points"),value:"multiple"}],onChange:function(n){t.selectionMode=n,e.props.edit(t)}}),wp.element.createElement(Qa,{label:qa("Aggregation Target"),help:qa("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:qa("Group selected data by x-value"),value:"category"},{label:qa("Group selected data by series"),value:"series"},{label:qa("Group selected data by x-value if all selections have the same x-value, and by series otherwise"),value:"auto"},{label:qa("Show only one tooltip per selection"),value:"none"}],onChange:function(n){t.aggregationTarget=n,e.props.edit(t)}})),wp.element.createElement(Za,{title:qa("Failing Candles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Xa,{label:qa("Stroke Width"),help:qa("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(Ka,{label:qa("Stroke Color")},wp.element.createElement(Ga,{value:t.candlestick.fallingColor.stroke,onChange:function(n){t.candlestick.fallingColor.stroke=n,e.props.edit(t)}})),wp.element.createElement(Ka,{label:qa("Fill Color")},wp.element.createElement(Ga,{value:t.candlestick.fallingColor.fill,onChange:function(n){t.candlestick.fallingColor.fill=n,e.props.edit(t)}}))),wp.element.createElement(Za,{title:qa("Rising Candles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Xa,{label:qa("Stroke Width"),help:qa("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(Ka,{label:qa("Stroke Color")},wp.element.createElement(Ga,{value:t.candlestick.risingColor.stroke,onChange:function(n){t.candlestick.risingColor.stroke=n,e.props.edit(t)}})),wp.element.createElement(Ka,{label:qa("Fill Color")},wp.element.createElement(Ga,{value:t.candlestick.risingColor.fill,onChange:function(n){t.candlestick.risingColor.fill=n,e.props.edit(t)}}))))}}])&&Ia(n.prototype,r),a&&Ia(n,a),t}(Va);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.components,ui=li.ExternalLink,ci=li.PanelBody,di=li.SelectControl,mi=li.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(ci,{title:oi("Map Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(ci,{title:oi("API"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(mi,{label:oi("API Key"),help:oi("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(ui,{href:"https://developers.google.com/maps/documentation/javascript/get-api-key"},oi("Get API Keys"))),wp.element.createElement(ci,{title:oi("Region"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,oi("A map of the entire world using 'world'.")),wp.element.createElement("li",null,oi("A continent or a sub-continent, specified by its 3-digit code, e.g., '011' for Western Africa. "),wp.element.createElement(ui,{href:"https://google-developers.appspot.com/chart/interactive/docs/gallery/geochart#Continent_Hierarchy"},oi("More info here."))),wp.element.createElement("li",null,oi("A country, specified by its ISO 3166-1 alpha-2 code, e.g., 'AU' for Australia. "),wp.element.createElement(ui,{href:"http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2"},oi("More info here."))),wp.element.createElement("li",null,oi("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(ui,{href:"http://en.wikipedia.org/wiki/ISO_3166-2:US"},oi("More info here.")))),wp.element.createElement(mi,{label:oi("Reigion"),help:oi("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(ci,{title:oi("Resolution"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,oi("'countries' - Supported for all regions, except for US state regions.")),wp.element.createElement("li",null,oi("'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,oi("'metros' - Supported for the US country region and US state regions only."))),wp.element.createElement(di,{label:oi("Resolution"),help:oi("The resolution of the map borders."),value:t.resolution?t.resolution:"countries",options:[{label:oi("Countries"),value:"countries"},{label:oi("Provinces"),value:"provinces"},{label:oi("Metros"),value:"metros"}],onChange:function(n){t.resolution=n,e.props.edit(t)}})),wp.element.createElement(ci,{title:oi("Display Mode"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,oi("'auto' - Choose based on the format of the data.")),wp.element.createElement("li",null,oi("'regions' - This is a region map.")),wp.element.createElement("li",null,oi("'markers' - This is a marker map."))),wp.element.createElement(di,{label:oi("Display Mode"),help:oi("Determines which type of map this is."),value:t.displayMode?t.displayMode:"auto",options:[{label:oi("Auto"),value:"auto"},{label:oi("Regions"),value:"regions"},{label:oi("Markers"),value:"markers"}],onChange:function(n){t.displayMode=n,e.props.edit(t)}})),wp.element.createElement(ci,{title:oi("Tooltip"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(di,{label:oi("Trigger"),help:oi("Determines the user interaction that causes the tooltip to be displayed."),value:t.tooltip.trigger?t.tooltip.trigger:"focus",options:[{label:oi("The tooltip will be displayed when the user hovers over an element"),value:"focus"},{label:oi("The tooltip will not be displayed"),value:"none"}],onChange:function(n){t.tooltip.trigger=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 fi(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 _i(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.Component,wi=(wp.blockEditor||wp.editor).ColorPalette,Mi=wp.components,ki=Mi.BaseControl,Li=Mi.PanelBody,Yi=Mi.TextControl,Di=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),_i(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(Li,{title:bi("Color Axis"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Yi,{label:bi("Minimum Values"),help:bi("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(Yi,{label:bi("Maximum Values"),help:bi("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(ki,{label:bi("Minimum Value")},wp.element.createElement(wi,{value:t.colorAxis.colors[0],onChange:function(n){t.colorAxis.colors[0]=n,e.props.edit(t)}})),wp.element.createElement(ki,{label:bi("Intermediate Value")},wp.element.createElement(wi,{value:t.colorAxis.colors[1],onChange:function(n){t.colorAxis.colors[1]=n,e.props.edit(t)}})),wp.element.createElement(ki,{label:bi("Maximum Value")},wp.element.createElement(wi,{value:t.colorAxis.colors[2],onChange:function(n){t.colorAxis.colors[2]=n,e.props.edit(t)}})),wp.element.createElement(ki,{label:bi("Dateless Region")},wp.element.createElement(wi,{value:t.datalessRegionColor,onChange:function(n){t.datalessRegionColor=n,e.props.edit(t)}})))}}])&&fi(n.prototype,r),a&&fi(n,a),t}(vi);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 Si(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 Oi(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 ji(e){return(ji=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function xi(e,t){return(xi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ei=wp.i18n.__,Ci=wp.element,Pi=Ci.Component,Hi=Ci.Fragment,zi=wp.components,Ai=zi.ExternalLink,Ni=zi.PanelBody,Fi=zi.TextControl,Ri=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Oi(this,ji(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&&xi(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:Ei("Size Axis"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Fi,{label:Ei("Minimum Values"),help:Ei("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(Fi,{label:Ei("Maximum Values"),help:Ei("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(Fi,{label:Ei("Minimum Marker Radius"),help:Ei("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(Fi,{label:Ei("Maximum Marker Radius"),help:Ei("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(Fi,{label:Ei("Marker Opacity"),help:Ei("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(Hi,null,wp.element.createElement(Fi,{label:Ei("Number Format"),help:Ei("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,Ei("For number axis labels, this is a subset of the formatting "),wp.element.createElement(Ai,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},Ei("ICU pattern set.")),Ei(" 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."))))}}])&&Si(n.prototype,r),a&&Si(n,a),t}(Pi);function Wi(e){return(Wi="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 Ii(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 Bi(e,t){return!t||"object"!==Wi(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 Ji(e){return(Ji=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ui(e,t){return(Ui=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var qi=wp.i18n.__,Vi=wp.element.Component,Gi=wp.components,$i=Gi.PanelBody,Ki=Gi.SelectControl,Zi=Gi.TextControl,Qi=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Bi(this,Ji(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&&Ui(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement($i,{title:qi("Magnifying Glass"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Ki,{label:qi("Enabled"),help:qi("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:qi("Yes"),value:"1"},{label:qi("No"),value:"0"}],onChange:function(n){t.magnifyingGlass.enable=n,e.props.edit(t)}}),wp.element.createElement(Zi,{label:qi("Zoom Factor"),help:qi("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)}}))}}])&&Ii(n.prototype,r),a&&Ii(n,a),t}(Vi);function Xi(e){return(Xi="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 to(e,t){return!t||"object"!==Xi(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 no(e){return(no=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ro(e,t){return(ro=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ao=wp.i18n.__,io=wp.element,oo=io.Component,so=io.Fragment,lo=(wp.blockEditor||wp.editor).ColorPalette,uo=wp.components,co=uo.BaseControl,mo=uo.ExternalLink,po=uo.PanelBody,ho=uo.TextControl,fo=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),to(this,no(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&&ro(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(po,{title:ao("Gauge Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(po,{title:ao("Tick Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ho,{label:ao("Minimum Values"),help:ao("Determines the minimum values of gauge."),value:t.min,onChange:function(n){t.min=n,e.props.edit(t)}}),wp.element.createElement(ho,{label:ao("Maximum Values"),help:ao("Determines the maximum values of gauge."),value:t.max,onChange:function(n){t.max=n,e.props.edit(t)}}),wp.element.createElement(ho,{label:ao("Minor Ticks"),help:ao("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(so,null,wp.element.createElement(ho,{label:ao("Number Format"),help:ao("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,ao("For number axis labels, this is a subset of the formatting "),wp.element.createElement(mo,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},ao("ICU pattern set.")),ao(" 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(po,{title:ao("Green Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ho,{label:ao("Minimum Range"),help:ao("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(ho,{label:ao("Maximum Range"),help:ao("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(co,{label:ao("Green Color")},wp.element.createElement(lo,{value:t.greenColor,onChange:function(n){t.greenColor=n,e.props.edit(t)}}))),wp.element.createElement(po,{title:ao("Yellow Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ho,{label:ao("Minimum Range"),help:ao("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(ho,{label:ao("Maximum Range"),help:ao("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(co,{label:ao("Yellow Color")},wp.element.createElement(lo,{value:t.yellowColor,onChange:function(n){t.yellowColor=n,e.props.edit(t)}}))),wp.element.createElement(po,{title:ao("Red Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ho,{label:ao("Minimum Range"),help:ao("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(ho,{label:ao("Maximum Range"),help:ao("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(co,{label:ao("Red Color")},wp.element.createElement(lo,{value:t.redColor,onChange:function(n){t.redColor=n,e.props.edit(t)}}))))}}])&&eo(n.prototype,r),a&&eo(n,a),t}(oo);function _o(e){return(_o="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){return(go=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function bo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vo(e,t){return(vo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var wo=wp.i18n.__,Mo=wp.element.Component,ko=(wp.blockEditor||wp.editor).ColorPalette,Lo=wp.components,Yo=Lo.BaseControl,Do=Lo.CheckboxControl,To=Lo.PanelBody,So=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"!==_o(t)&&"function"!=typeof t?bo(e):t}(this,go(t).apply(this,arguments))).mapValues=e.mapValues.bind(bo(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&&vo(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(To,{title:wo("Timeline Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Do,{label:wo("Show Row Label"),help:wo("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(Do,{label:wo("Group by Row Label"),help:wo("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(Do,{label:wo("Color by Row Label"),help:wo("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(Yo,{label:wo("Single Color")},wp.element.createElement(ko,{value:this.mapValues(t,"singleColor"),onChange:function(n){void 0===t.timeline&&(t.timeline={}),t.timeline.singleColor=n,e.props.edit(t)}})))}}])&&yo(n.prototype,r),a&&yo(n,a),t}(Mo);function Oo(e){return(Oo="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 jo(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 xo(e,t){return!t||"object"!==Oo(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 Eo(e){return(Eo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Co(e,t){return(Co=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Po=wp.i18n.__,Ho=wp.element,zo=Ho.Component,Ao=Ho.Fragment,No=wp.components,Fo=No.CheckboxControl,Ro=No.PanelBody,Wo=No.SelectControl,Io=No.TextControl,Bo=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),xo(this,Eo(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&&Co(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"],this.props.chart["visualizer-chart-library"]);return wp.element.createElement(Ro,{title:Po("Table Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},"DataTable"===n?wp.element.createElement(Ao,null,wp.element.createElement(Fo,{label:Po("Enable Pagination"),help:Po("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(Io,{label:Po("Number of rows per page"),help:Po("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(Wo,{label:Po("Pagination type"),help:Po("Determines what type of pagination options to show."),value:t.pagingType,options:[{label:Po("Page number buttons only"),value:"numbers"},{label:Po("'Previous' and 'Next' buttons only"),value:"simple"},{label:Po("'Previous' and 'Next' buttons, plus page numbers"),value:"simple_numbers"},{label:Po("'First', 'Previous', 'Next' and 'Last' buttons"),value:"full"},{label:Po("'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers"),value:"full_numbers"},{label:Po("'First' and 'Last' buttons, plus page numbers"),value:"first_last_numbers"}],onChange:function(n){t.pagingType=n,e.props.edit(t)}}),wp.element.createElement(Fo,{label:Po("Scroll Collapse"),help:Po("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(Io,{label:Po("Vertical Height"),help:Po("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(Fo,{label:Po("Disable Sort"),help:Po("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(Fo,{label:Po("Freeze Header/Footer"),help:Po("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(Fo,{label:Po("Responsive"),help:Po("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(Ao,null,wp.element.createElement(Wo,{label:Po("Enable Pagination"),help:Po("To enable paging through the data."),value:t.page?t.page:"disable",options:[{label:Po("Enable"),value:"enable"},{label:Po("Disable"),value:"disable"}],onChange:function(n){t.page=n,e.props.edit(t)}}),wp.element.createElement(Io,{label:Po("Number of rows per page"),help:Po("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(Wo,{label:Po("Disable Sort"),help:Po("To disable sorting on columns."),value:t.sort?t.sort:"enable",options:[{label:Po("Enable"),value:"enable"},{label:Po("Disable"),value:"disable"}],onChange:function(n){t.sort=n,e.props.edit(t)}}),wp.element.createElement(Io,{label:Po("Freeze Columns"),help:Po("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(Fo,{label:Po("Allow HTML"),help:Po("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(Fo,{label:Po("Right to Left table"),help:Po("Adds basic support for right-to-left languages."),checked:Number(t.rtlTable),onChange:function(n){t.rtlTable=!Number(t.rtlTable),e.props.edit(t)}})))}}])&&jo(n.prototype,r),a&&jo(n,a),t}(zo);function Jo(e){return(Jo="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 Uo(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"!==Jo(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 Vo(e){return(Vo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Go(e,t){return(Go=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var $o=wp.i18n.__,Ko=wp.element,Zo=Ko.Component,Qo=Ko.Fragment,Xo=(wp.blockEditor||wp.editor).ColorPalette,es=wp.components,ts=es.BaseControl,ns=es.PanelBody,rs=es.TextControl,as=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,Vo(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&&Go(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"],this.props.chart["visualizer-chart-library"]);return wp.element.createElement(ns,{title:$o("Row/Cell Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},"DataTable"===n?wp.element.createElement(Qo,null,wp.element.createElement(ns,{title:$o("Odd Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ts,{label:$o("Background Color")},wp.element.createElement(Xo,{value:t.customcss.oddTableRow["background-color"],onChange:function(n){t.customcss.oddTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(ts,{label:$o("Color")},wp.element.createElement(Xo,{value:t.customcss.oddTableRow.color,onChange:function(n){t.customcss.oddTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(rs,{label:$o("Text Orientation"),help:$o("In degrees."),type:"number",value:t.customcss.oddTableRow.transform,onChange:function(n){t.customcss.oddTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ns,{title:$o("Even Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ts,{label:$o("Background Color")},wp.element.createElement(Xo,{value:t.customcss.evenTableRow["background-color"],onChange:function(n){t.customcss.evenTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(ts,{label:$o("Color")},wp.element.createElement(Xo,{value:t.customcss.evenTableRow.color,onChange:function(n){t.customcss.evenTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(rs,{label:$o("Text Orientation"),help:$o("In degrees."),type:"number",value:t.customcss.evenTableRow.transform,onChange:function(n){t.customcss.evenTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ns,{title:$o("Table Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ts,{label:$o("Background Color")},wp.element.createElement(Xo,{value:t.customcss.tableCell["background-color"],onChange:function(n){t.customcss.tableCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(ts,{label:$o("Color")},wp.element.createElement(Xo,{value:t.customcss.tableCell.color,onChange:function(n){t.customcss.tableCell.color=n,e.props.edit(t)}})),wp.element.createElement(rs,{label:$o("Text Orientation"),help:$o("In degrees."),type:"number",value:t.customcss.tableCell.transform,onChange:function(n){t.customcss.tableCell.transform=n,e.props.edit(t)}}))):wp.element.createElement(Qo,null,wp.element.createElement(ns,{title:$o("Header Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ts,{label:$o("Background Color")},wp.element.createElement(Xo,{value:t.customcss.headerRow["background-color"],onChange:function(n){t.customcss.headerRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(ts,{label:$o("Color")},wp.element.createElement(Xo,{value:t.customcss.headerRow.color,onChange:function(n){t.customcss.headerRow.color=n,e.props.edit(t)}})),wp.element.createElement(rs,{label:$o("Text Orientation"),help:$o("In degrees."),type:"number",value:t.customcss.headerRow.transform,onChange:function(n){t.customcss.headerRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ns,{title:$o("Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ts,{label:$o("Background Color")},wp.element.createElement(Xo,{value:t.customcss.tableRow["background-color"],onChange:function(n){t.customcss.tableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(ts,{label:$o("Color")},wp.element.createElement(Xo,{value:t.customcss.tableRow.color,onChange:function(n){t.customcss.tableRow.color=n,e.props.edit(t)}})),wp.element.createElement(rs,{label:$o("Text Orientation"),help:$o("In degrees."),type:"number",value:t.customcss.tableRow.transform,onChange:function(n){t.customcss.tableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ns,{title:$o("Odd Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ts,{label:$o("Background Color")},wp.element.createElement(Xo,{value:t.customcss.oddTableRow["background-color"],onChange:function(n){t.customcss.oddTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(ts,{label:$o("Color")},wp.element.createElement(Xo,{value:t.customcss.oddTableRow.color,onChange:function(n){t.customcss.oddTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(rs,{label:$o("Text Orientation"),help:$o("In degrees."),type:"number",value:t.customcss.oddTableRow.transform,onChange:function(n){t.customcss.oddTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ns,{title:$o("Selected Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ts,{label:$o("Background Color")},wp.element.createElement(Xo,{value:t.customcss.selectedTableRow["background-color"],onChange:function(n){t.customcss.selectedTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(ts,{label:$o("Color")},wp.element.createElement(Xo,{value:t.customcss.selectedTableRow.color,onChange:function(n){t.customcss.selectedTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(rs,{label:$o("Text Orientation"),help:$o("In degrees."),type:"number",value:t.customcss.selectedTableRow.transform,onChange:function(n){t.customcss.selectedTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ns,{title:$o("Hover Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ts,{label:$o("Background Color")},wp.element.createElement(Xo,{value:t.customcss.hoverTableRow["background-color"],onChange:function(n){t.customcss.hoverTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(ts,{label:$o("Color")},wp.element.createElement(Xo,{value:t.customcss.hoverTableRow.color,onChange:function(n){t.customcss.hoverTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(rs,{label:$o("Text Orientation"),help:$o("In degrees."),type:"number",value:t.customcss.hoverTableRow.transform,onChange:function(n){t.customcss.hoverTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(ns,{title:$o("Header Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ts,{label:$o("Background Color")},wp.element.createElement(Xo,{value:t.customcss.headerCell["background-color"],onChange:function(n){t.customcss.headerCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(ts,{label:$o("Color")},wp.element.createElement(Xo,{value:t.customcss.headerCell.color,onChange:function(n){t.customcss.headerCell.color=n,e.props.edit(t)}})),wp.element.createElement(rs,{label:$o("Text Orientation"),help:$o("In degrees."),type:"number",value:t.customcss.headerCell.transform,onChange:function(n){t.customcss.headerCell.transform=n,e.props.edit(t)}})),wp.element.createElement(ns,{title:$o("Table Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ts,{label:$o("Background Color")},wp.element.createElement(Xo,{value:t.customcss.tableCell["background-color"],onChange:function(n){t.customcss.tableCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(ts,{label:$o("Color")},wp.element.createElement(Xo,{value:t.customcss.tableCell.color,onChange:function(n){t.customcss.tableCell.color=n,e.props.edit(t)}})),wp.element.createElement(rs,{label:$o("Text Orientation"),help:$o("In degrees."),type:"number",value:t.customcss.tableCell.transform,onChange:function(n){t.customcss.tableCell.transform=n,e.props.edit(t)}}))))}}])&&Uo(n.prototype,r),a&&Uo(n,a),t}(Zo);function is(e){return(is="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 os(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 ss(e,t){return!t||"object"!==is(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 ls(e){return(ls=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function us(e,t){return(us=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var cs=wp.i18n.__,ds=wp.element.Component,ms=wp.components,ps=ms.PanelBody,hs=ms.SelectControl,fs=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ss(this,ls(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&&us(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(ps,{title:cs("Combo Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(hs,{label:cs("Chart Type"),help:cs("Select the default chart type."),value:t.seriesType?t.seriesType:"area",options:[{label:cs("Area"),value:"area"},{label:cs("Bar"),value:"bars"},{label:cs("Candlesticks"),value:"candlesticks"},{label:cs("Line"),value:"line"},{label:cs("Stepped Area"),value:"steppedArea"}],onChange:function(n){t.seriesType=n,e.props.edit(t)}}))}}])&&os(n.prototype,r),a&&os(n,a),t}(ds);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 ys(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 gs(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 bs(e){return(bs=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function vs(e,t){return(vs=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ws=wp.i18n.__,Ms=wp.element,ks=Ms.Component,Ls=Ms.Fragment,Ys=(wp.blockEditor||wp.editor).ColorPalette,Ds=wp.components,Ts=Ds.BaseControl,Ss=Ds.ExternalLink,Os=Ds.PanelBody,js=Ds.SelectControl,xs=Ds.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),gs(this,bs(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&&vs(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(Os,{title:ws("Series Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(n.series).map((function(a,i){return a++,wp.element.createElement(Os,{title:r[a].label,className:"visualizer-inner-sections",initialOpen:!1},-1>=["tabular","pie"].indexOf(t)&&wp.element.createElement(js,{label:ws("Visible In Legend"),help:ws("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:ws("Yes"),value:"1"},{label:ws("No"),value:"0"}],onChange:function(t){n.series[i].visibleInLegend=t,e.props.edit(n)}}),-1>=["tabular","candlestick","combo","column","bar"].indexOf(t)&&wp.element.createElement(Ls,null,wp.element.createElement(xs,{label:ws("Line Width"),help:ws("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(xs,{label:ws("Point Size"),help:ws("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(Ls,null,wp.element.createElement(xs,{label:ws("Format"),help:ws("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,ws("For number axis labels, this is a subset of the formatting "),wp.element.createElement(Ss,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},ws("ICU pattern set.")),ws(" 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."))):0<=["date","datetime","timeofday"].indexOf(r[a].type)&&wp.element.createElement(Ls,null,wp.element.createElement(xs,{label:ws("Date Format"),help:ws("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,ws("This is a subset of the date formatting "),wp.element.createElement(Ss,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},ws("ICU date and time format.")))),0<=["scatter","line"].indexOf(t)&&wp.element.createElement(js,{label:ws("Curve Type"),help:ws("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:ws("Straight line without curve"),value:"none"},{label:ws("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(xs,{label:ws("Area Opacity"),help:ws("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(js,{label:ws("Chart Type"),help:ws("Select the type of chart to show for this series."),value:n.series[i].type?n.series[i].type:"area",options:[{label:ws("Area"),value:"area"},{label:ws("Bar"),value:"bars"},{label:ws("Candlesticks"),value:"candlesticks"},{label:ws("Line"),value:"line"},{label:ws("Stepped Area"),value:"steppedArea"}],onChange:function(t){n.series[i].type=t,e.props.edit(n)}}),-1>=["tabular"].indexOf(t)&&wp.element.createElement(Ts,{label:ws("Color")},wp.element.createElement(Ys,{value:n.series[i].color,onChange:function(t){n.series[i].color=t,e.props.edit(n)}})))})))}}])&&ys(n.prototype,r),a&&ys(n,a),t}(ks);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 Ps(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 Hs(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.Component,Rs=(wp.blockEditor||wp.editor).ColorPalette,Ws=wp.components,Is=Ws.BaseControl,Bs=Ws.PanelBody,Js=Ws.TextControl,Us=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Hs(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.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(Bs,{title:Ns("Slices Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(t.slices).map((function(r){return wp.element.createElement(Bs,{title:n[r][0],className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Js,{label:Ns("Slice Offset"),help:Ns("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(Is,{label:Ns("Format")},wp.element.createElement(Rs,{value:t.slices[r].color,onChange:function(n){t.slices[r].color=n,e.props.edit(t)}})))})))}}])&&Ps(n.prototype,r),a&&Ps(n,a),t}(Fs);function qs(e){return(qs="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 Vs(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 Gs(e,t){return!t||"object"!==qs(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 $s(e){return($s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ks(e,t){return(Ks=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Zs=wp.i18n.__,Qs=wp.element.Component,Xs=(wp.blockEditor||wp.editor).ColorPalette,el=wp.components,tl=el.CheckboxControl,nl=el.BaseControl,rl=el.PanelBody,al=el.TextControl,il=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Gs(this,$s(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&&Ks(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(rl,{title:Zs("Bubble Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(al,{label:Zs("Opacity"),help:Zs("The default opacity of the bubbles, where 0.0 is fully transparent and 1.0 is fully opaque."),type:"number",min:"0",max:"1",step:"0.1",value:t.bubble.opacity,onChange:function(n){t.bubble||(t.bubble={}),t.bubble.opacity=n,e.props.edit(t)}}),wp.element.createElement(nl,{label:Zs("Stroke Color")},wp.element.createElement(Xs,{value:t.bubble.stroke,onChange:function(n){t.bubble||(t.bubble={}),t.bubble.stroke=n,e.props.edit(t)}})),wp.element.createElement(tl,{label:Zs("Sort Bubbles by Size"),help:Zs("If checked, sorts the bubbles by size so the smaller bubbles appear above the larger bubbles. If unchecked, bubbles are sorted according to their order in the table."),checked:K(t,"sortBubblesBySize"),onChange:function(n){t.sortBubblesBySize=n,e.props.edit(t)}}),wp.element.createElement(al,{label:Zs("Size (max)"),help:Zs("The size value (as appears in the chart data) to be mapped to sizeAxis.maxSize. Larger values will be cropped to this value."),type:"number",step:"1",value:t.sizeAxis.maxValue,onChange:function(n){t.sizeAxis||(t.sizeAxis={}),t.sizeAxis.maxValue=n,e.props.edit(t)}}),wp.element.createElement(al,{label:Zs("Size (min)"),help:Zs("The size value (as appears in the chart data) to be mapped to sizeAxis.minSize. Smaller values will be cropped to this value."),type:"number",step:"1",value:t.sizeAxis.minValue,onChange:function(n){t.sizeAxis||(t.sizeAxis={}),t.sizeAxis.minValue=n,e.props.edit(t)}}))}}])&&Vs(n.prototype,r),a&&Vs(n,a),t}(Qs);function ol(e){return(ol="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 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,t){return!t||"object"!==ol(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 ul(e){return(ul=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(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.element,pl=ml.Component,hl=ml.Fragment,fl=wp.components,_l=fl.ExternalLink,yl=fl.PanelBody,gl=fl.TextControl,bl=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ll(this,ul(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&&cl(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];e.series&&(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 this.props.chart["visualizer-chart-type"],t.series?wp.element.createElement(yl,{title:dl("Column Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(t.series).map((function(r){return"string"===n[r].type?null:wp.element.createElement(yl,{title:n[r].label,className:"visualizer-inner-sections",initialOpen:!1},0<=["date","datetime","timeofday"].indexOf(n[r].type)&&wp.element.createElement(hl,null,wp.element.createElement(gl,{label:dl("Display Date Format"),help:dl("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(gl,{label:dl("Source Date Format"),help:dl("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,dl("You can find more info on "),wp.element.createElement(_l,{href:"https://momentjs.com/docs/#/displaying/"},dl("date and time formats here.")))),"number"===n[r].type&&wp.element.createElement(hl,null,wp.element.createElement(gl,{label:dl("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(gl,{label:dl("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(gl,{label:dl("Precision"),help:dl("Round values to how many decimal places?"),value:t.series[r].format?t.series[r].format.precision:"",type:"number",min:"0",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(gl,{label:dl("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(gl,{label:dl("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)}})),"boolean"===n[r].type&&wp.element.createElement(hl,null,wp.element.createElement(gl,{label:dl("Truthy value"),help:dl("Provide the HTML entity code for the value the table should display when the value of the column is true. e.g. tick mark (Code: &#10004;) instead of true"),value:t.series[r].format?t.series[r].format.truthy:"",onChange:function(n){t.series[r].truthy||(t.series[r].truthy={}),t.series[r].format.truthy=n,e.props.edit(t)}}),wp.element.createElement(gl,{label:dl("Falsy value"),help:dl("Provide the HTML entity code for the value the table should display when the value of the column is false. e.g. cross mark (Code: &#10006;) instead of false"),value:t.series[r].format?t.series[r].format.falsy:"",onChange:function(n){t.series[r].falsy||(t.series[r].falsy={}),t.series[r].format.falsy=n,e.props.edit(t)}})))}))):null}}])&&sl(n.prototype,r),a&&sl(n,a),t}(pl);function vl(e){return(vl="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 wl(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"!==vl(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 kl(e){return(kl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ll(e,t){return(Ll=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Yl=wp.i18n.__,Dl=wp.element,Tl=Dl.Component,Sl=Dl.Fragment,Ol=(wp.blockEditor||wp.editor).ColorPalette,jl=wp.components,xl=jl.BaseControl,El=jl.CheckboxControl,Cl=jl.PanelBody,Pl=jl.SelectControl,Hl=jl.TextControl,zl=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,kl(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&&Ll(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(Cl,{title:Yl("Layout And Chart Area"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Cl,{title:Yl("Layout"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Hl,{label:Yl("Width of Chart"),help:Yl("Determines the total width of the chart."),value:n.width,onChange:function(t){n.width=t,e.props.edit(n)}}),wp.element.createElement(Hl,{label:Yl("Height of Chart"),help:Yl("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(Pl,{label:Yl("Keep Aspect Ratio"),help:Yl("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:Yl("Yes"),value:"1"},{label:Yl("No"),value:"0"}],onChange:function(t){n.keepAspectRatio=t,e.props.edit(n)}}),-1>=["gauge"].indexOf(t)&&wp.element.createElement(Sl,null,wp.element.createElement(Hl,{label:Yl("Stroke Width"),help:Yl("The chart border width in pixels."),value:n.backgroundColor.strokeWidth,onChange:function(t){n.backgroundColor.strokeWidth=t,e.props.edit(n)}}),wp.element.createElement(xl,{label:Yl("Stroke Color")},wp.element.createElement(Ol,{value:n.backgroundColor.stroke,onChange:function(t){n.backgroundColor.stroke=t,e.props.edit(n)}})),wp.element.createElement(xl,{label:Yl("Background Color")},wp.element.createElement(Ol,{value:n.backgroundColor.fill,onChange:function(t){n.backgroundColor.fill=t,e.props.edit(n)}})),wp.element.createElement(El,{label:Yl("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(Cl,{title:Yl("Chart Area"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Hl,{label:Yl("Left Margin"),help:Yl("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(Hl,{label:Yl("Top Margin"),help:Yl("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(Hl,{label:Yl("Width Of Chart Area"),help:Yl("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(Hl,{label:Yl("Height Of Chart Area"),help:Yl("Determines the hight of the chart area."),value:n.chartArea.height,onChange:function(t){n.chartArea.height=t,e.props.edit(n)}})))}}])&&wl(n.prototype,r),a&&wl(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 Nl(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 Fl(e,t){return!t||"object"!==Al(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 Rl(e){return(Rl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Wl(e,t){return(Wl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Il=wp.i18n.__,Bl=wp.element,Jl=Bl.Component,Ul=Bl.Fragment,ql=wp.components,Vl=ql.CheckboxControl,Gl=ql.PanelBody,$l=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Fl(this,Rl(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&&Wl(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"],n=this.props.chart["visualizer-chart-type"];return wp.element.createElement(Gl,{title:Il("Frontend Actions"),initialOpen:!1,className:"visualizer-advanced-panel"},void 0!==t.actions&&wp.element.createElement(Ul,null,wp.element.createElement(Vl,{label:Il("Print"),help:Il("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:Il("CSV"),help:Il("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:Il("Excel"),help:Il("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:Il("Copy"),help:Il("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)}}),-1>=["dataTable","tabular","gauge","table"].indexOf(n)&&wp.element.createElement(Vl,{label:Il("Download Image"),help:Il("To download the chart as an image."),checked:0<=t.actions.indexOf("image"),onChange:function(n){if(0<=t.actions.indexOf("image")){var r=t.actions.indexOf("image");-1!==r&&t.actions.splice(r,1)}else t.actions.push("image");e.props.edit(t)}})))}}])&&Nl(n.prototype,r),a&&Nl(n,a),t}(Jl);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 Zl(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 Ql={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"}},Xl=n(2);const eu={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&&eu.throwError(eu.getCaller(2),e)},isFalsy:(e="<unknown parameter>",t)=>{t||eu.throwError(eu.getCaller(2),e)},isNoneOf:(e="<unknown parameter>",t,n=[])=>{-1===n.indexOf(t)&&eu.throwError(eu.getCaller(2),e,"to be any of"+JSON.stringify(n))},isAnyOf:(e="<unknown parameter>",t,n=[])=>{n.indexOf(t)>-1&&eu.throwError(eu.getCaller(2),e,"not to be any of"+JSON.stringify(n))},isNotType:(e="<unknown parameter>",t,n="")=>{Object(Xl.getType)(t)!==n.toLowerCase()&&eu.throwError(eu.getCaller(2),e,"to be type "+n.toLowerCase())},isAnyTypeOf:(e="<unknown parameter>",t,n=[])=>{n.forEach(n=>{Object(Xl.getType)(t)===n&&eu.throwError(eu.getCaller(2),e,"not to be type of "+n.toLowerCase())})},missingKey:(e="<unknown parameter>",t,n="")=>{eu.isUndefined(e,t),-1===Object.keys(t).indexOf(n)&&eu.throwError(eu.getCaller(2),e,"to contain '"+n+"' key")},missingAnyKeys:(e="<unknown parameter>",t,n=[""])=>{eu.isUndefined(e,t);const r=Object.keys(t);n.forEach(t=>{-1===r.indexOf(t)&&eu.throwError(eu.getCaller(2),e,"to contain '"+t+"' key")})},containsUndefined:(e="<unknown parameter>",t)=>{[void 0,null].forEach(n=>{const r=Object(Xl.locate)(t,n);r&&eu.throwError(eu.getCaller(2),e,"not to contain '"+JSON.stringify(n)+"' at "+r)})},isInvalidPath:(e="<unknown parameter>",t)=>{eu.isUndefined(e,t),eu.isNotType(e,t,"string"),eu.isAnyOf(e,t,["","/"]),".$[]#".split().forEach(n=>{t.indexOf(n)>-1&&eu.throwError(eu.getCaller(2),e,"not to contain invalid character '"+n+"'")}),t.match(/\/{2,}/g)&&eu.throwError(eu.getCaller(2),e,"not to contain consecutive forward slash characters")},isInvalidWriteData:(e="<unknown parameter>",t)=>{eu.isUndefined(e,t),eu.containsUndefined(e,t)}};var tu=eu;const nu=(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 ru={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 au 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=Ql.dark_vscode_tribute;"theme"in this.props&&"string"==typeof this.props.theme&&this.props.theme in Ql&&(n=Ql[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:Zl({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:Zl({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:Zl({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:Zl({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:Zl({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:Zl({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||ru,t=this.state.error,n=this.style;if(t)return a.a.createElement("p",{style:Zl({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)},nu(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:Zl({},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(Xl.getType)(e);-1===["object","array"].indexOf(a)&&tu.throwError("showPlaceholder","placeholder","either an object or an array");let i=!Object(Xl.identical)(e,t);if(i||r&&void 0!==n&&(i=!Object(Xl.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||ru,n=this.newSpan;if("nodeType"in e){const M=e.cloneNode(!0);if(!M.hasChildNodes())return"";const k=M.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,nu(t.invalidToken.tokenSequence.prohibited,{firstToken:L.tokens_merge[i].string,secondToken:n}));break}if("["===n&&r>0&&!m(r,[":","[",","])){c(r,nu(t.invalidToken.tokenSequence.permitted,{firstToken:"[",secondToken:[":","[",","]}));break}if("{"===n&&m(r,["{"])){c(r,nu(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,nu(t.brace.curly.missingOpen));break}if("}"===n&&m(r,[","])){c(r,nu(t.invalidToken.tokenSequence.prohibited,{firstToken:",",secondToken:"}"}));break}if("]"===n&&"["!==Y.brackets[Y.brackets.length-1]){c(r,nu(t.brace.square.missingOpen));break}if("]"===n&&m(r,[":"])){c(r,nu(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,nu(t.brace.curly.cannotWrap,{token:","}));break}c(r,nu(t.invalidToken.tokenSequence.prohibited,{firstToken:"{",secondToken:","}));break}if(d(r,["}",",","]"])){c(r,nu(t.noTrailingOrLeadingComma));break}switch(i=p(r)){case"key":case"colon":c(r,nu(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,nu(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,nu(t.brace.square.cannotWrap,{token:":"}));break}if(i){c(r,nu(t.invalidToken.tokenSequence.prohibited,{firstToken:"[",secondToken:":"}));break}if("key"!==p(r)){c(r,nu(t.invalidToken.termSequence.permitted,{firstTerm:t.symbols.colon,secondTerm:t.types.key}));break}if(d(r,["}","]"])){c(r,nu(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,nu(t.string.missingOpen,{quote:e}));break}if(-1===D.indexOf(o)&&-1!==D.indexOf(e)){c(r,nu(t.string.missingClose,{quote:e}));break}if(D.indexOf(e)>-1&&e!==o){c(r,nu(t.string.missingClose,{quote:e}));break}if("string"===a&&-1===D.indexOf(e)&&-1===D.indexOf(o)){c(r,nu(t.string.mustBeWrappedByQuotes));break}if("key"===a&&d(r,["}","]"])&&c(r,nu(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,nu(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,nu(t.key.numberAndLetterMissingQuotes));break}c(r,nu(t.key.spaceMissingQuotes));break}if("key"===a&&!m(r,["{",","])){c(r,nu(t.invalidToken.tokenSequence.permitted,{firstToken:a,secondToken:["{",","]}));break}if("string"===a&&!m(r,["[",":",","])){c(r,nu(t.invalidToken.tokenSequence.permitted,{firstToken:a,secondToken:["[",":",","]}));break}if("key"===a&&Y.isValue){c(r,nu(t.string.unexpectedKey));break}if("string"===a&&!Y.isValue){c(r,nu(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,nu(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,nu(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 f(e){S.splice(e+1,1),S.splice(e,1),r||(r=!0)}for(;S.length>0;){r=!1;for(var _=0;_<S.length-1;_++){const e=S[_].string+S[_+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,nu(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,nu(t.invalidToken.unexpected,{token:"\\"})),h=0)}l||c(s,nu(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&&((w=this.props.modifyErrorText)&&"[object Function]"==={}.toString.call(w)&&(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 w;if(!("nodeType"in e)){let t={inputText:JSON.stringify(e),position:0,currentChar:"",tokenPrimary:"",tokenSecondary:"",brackets:[],isValue:!1,stringOpen:!1,stringStart:0,tokens:[]};function M(){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=M();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 iu=au,ou=n(133),su=n.n(ou);function lu(e){return(lu="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 uu(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 cu(e){return(cu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function du(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mu(e,t){return(mu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var pu=wp.i18n.__,hu=wp.element.Component,fu=wp.components,_u=fu.ExternalLink,yu=fu.PanelBody,gu=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"!==lu(t)&&"function"!=typeof t?du(e):t}(this,cu(t).apply(this,arguments))).isValidJSON=e.isValidJSON.bind(du(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&&mu(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","tabular","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(yu,{title:pu("Manual Configuration"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement("p",null,pu("Configure the graph by providing configuration variables right from the Google Visualization API.")),wp.element.createElement("p",null,wp.element.createElement(_u,{href:"https://developers.google.com/chart/interactive/docs/gallery/".concat(e,"#configuration-options")},pu("Google Visualization API"))),wp.element.createElement(iu,{locale:su.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))}}))}}])&&uu(n.prototype,r),a&&uu(n,a),t}(hu);function bu(e){return(bu="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 vu(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 wu(e,t){return!t||"object"!==bu(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 Mu(e){return(Mu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ku(e,t){return(ku=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Lu=wp.element,Yu=Lu.Component,Du=Lu.Fragment,Tu=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),wu(this,Mu(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&&ku(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this.props.chart["visualizer-chart-type"],t=this.props.chart["visualizer-chart-library"];return wp.element.createElement(Du,null,wp.element.createElement(ar,{chart:this.props.chart,attributes:this.props.attributes,edit:this.props.edit}),wp.element.createElement(qn,{chart:this.props.chart,edit:this.props.edit}),-1>=["tabular","dataTable","gauge","geo","pie","timeline"].indexOf(e)&&wp.element.createElement(wr,{chart:this.props.chart,edit:this.props.edit}),-1>=["tabular","dataTable","gauge","geo","pie","timeline"].indexOf(e)&&wp.element.createElement(Nr,{chart:this.props.chart,edit:this.props.edit}),0<=["pie"].indexOf(e)&&wp.element.createElement(Du,null,wp.element.createElement(ta,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(ha,{chart:this.props.chart,edit:this.props.edit})),0<=["area","scatter","line"].indexOf(e)&&wp.element.createElement(Sa,{chart:this.props.chart,edit:this.props.edit}),0<=["bar","column"].indexOf(e)&&wp.element.createElement(Ra,{chart:this.props.chart,edit:this.props.edit}),0<=["candlestick"].indexOf(e)&&wp.element.createElement(ei,{chart:this.props.chart,edit:this.props.edit}),0<=["geo"].indexOf(e)&&wp.element.createElement(Du,null,wp.element.createElement(pi,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(Di,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(Ri,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(Qi,{chart:this.props.chart,edit:this.props.edit})),0<=["gauge"].indexOf(e)&&wp.element.createElement(fo,{chart:this.props.chart,edit:this.props.edit}),0<=["timeline"].indexOf(e)&&wp.element.createElement(So,{chart:this.props.chart,edit:this.props.edit}),0<=["tabular","dataTable"].indexOf(e)&&wp.element.createElement(Du,null,wp.element.createElement(Bo,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(as,{chart:this.props.chart,edit:this.props.edit})),0<=["combo"].indexOf(e)&&wp.element.createElement(fs,{chart:this.props.chart,edit:this.props.edit}),-1>=["timeline","bubble","gauge","geo","pie","tabular","dataTable"].indexOf(e)&&wp.element.createElement(Es,{chart:this.props.chart,edit:this.props.edit}),"tabular"===e&&"GoogleCharts"===t&&wp.element.createElement(Es,{chart:this.props.chart,edit:this.props.edit}),0<=["bubble"].indexOf(e)&&wp.element.createElement(il,{chart:this.props.chart,edit:this.props.edit}),0<=["pie"].indexOf(e)&&wp.element.createElement(Us,{chart:this.props.chart,edit:this.props.edit}),"DataTable"===t&&wp.element.createElement(bl,{chart:this.props.chart,edit:this.props.edit}),"DataTable"!==t&&wp.element.createElement(zl,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement($l,{chart:this.props.chart,edit:this.props.edit}),"DataTable"!==t&&wp.element.createElement(gu,{chart:this.props.chart,edit:this.props.edit}))}}])&&vu(n.prototype,r),a&&vu(n,a),t}(Yu);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 Ou(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 ju(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){Ou(i,r,a,o,s,"next",e)}function s(e){Ou(i,r,a,o,s,"throw",e)}o(void 0)}))}}function xu(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 Eu(e){return(Eu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Cu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Pu(e,t){return(Pu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Hu=wp.i18n.__,zu=wp.apiFetch,Au=wp.element,Nu=Au.Component,Fu=Au.Fragment,Ru=wp.components,Wu=Ru.Button,Iu=Ru.PanelBody,Bu=Ru.SelectControl,Ju=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?Cu(e):t}(this,Eu(t).apply(this,arguments))).getPermissionData=e.getPermissionData.bind(Cu(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&&Pu(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:(o=ju(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,zu({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,zu({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=ju(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,zu({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,zu({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(Fu,null,"business"===visualizerLocalize.isPro?wp.element.createElement(Iu,{title:Hu("Who can see this chart?"),initialOpen:!1},wp.element.createElement(Bu,{label:Hu("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(Bu,{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(Iu,{title:Hu("Who can see this chart?"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,Hu("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(Wu,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},Hu("Buy Now"))),"business"===visualizerLocalize.isPro?wp.element.createElement(Iu,{title:Hu("Who can edit this chart?"),initialOpen:!1},wp.element.createElement(Bu,{label:Hu("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(Bu,{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(Iu,{title:Hu("Who can edit this chart?"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,Hu("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(Wu,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},Hu("Buy Now"))))}}])&&xu(n.prototype,r),a&&xu(n,a),t}(Nu),Uu=n(134),qu=n.n(Uu),Vu=wp.components,Gu=Vu.Button,$u=Vu.Dashicon,Ku=Vu.G,Zu=Vu.Path,Qu=Vu.SVG;var Xu=function(e){var t=e.label,n=e.icon,r=e.className,a=e.isBack,i=e.onClick,o=qu()("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(Gu,{className:"components-panel__body-toggle",onClick:i},wp.element.createElement(Qu,{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(Zu,{fill:"none",d:"M0,0h24v24H0V0z"})),wp.element.createElement(Ku,null,wp.element.createElement(Zu,{d:"M7.41,8.59L12,13.17l4.59-4.58L18,10l-6,6l-6-6L7.41,8.59z"}))),n&&wp.element.createElement($u,{icon:n,className:"components-panel__icon"}),t)))},ec=n(3),tc=n.n(ec);function nc(e){return(nc="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 rc(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 ac(e,t){return!t||"object"!==nc(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 ic(e){return(ic=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function oc(e,t){return(oc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var sc=lodash.startCase,lc=wp.i18n.__,uc=wp.element,cc=uc.Component,dc=uc.Fragment,mc=(wp.blockEditor||wp.editor).InspectorControls,pc=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=ac(this,ic(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&&oc(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 0<=["gauge","tabular","timeline"].indexOf(this.props.chart["visualizer-chart-type"])?"DataTable"===r["visualizer-chart-library"]?e=r["visualizer-chart-type"]:("tabular"===(e=this.props.chart["visualizer-chart-type"])&&(e="table"),e=sc(e)):e="".concat(sc(this.props.chart["visualizer-chart-type"]),"Chart"),r["visualizer-data-exploded"]&&(t=lc("Annotations in this chart may not display here but they will display in the front end.")),wp.element.createElement(dc,null,"home"===this.state.route&&wp.element.createElement(mc,null,wp.element.createElement(Oe,{chart:this.props.chart,readUploadedFile:this.props.readUploadedFile}),wp.element.createElement(mt,{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(jt,{getChartData:this.props.getChartData,isLoading:this.props.isLoading}),wp.element.createElement(an,{chart:this.props.chart,editSchedule:this.props.editDatabaseSchedule,databaseImportData:this.props.databaseImportData}),wp.element.createElement(xn,{chart:this.props.chart,editChartData:this.props.editChartData}),wp.element.createElement(Xu,{label:lc("Advanced Options"),className:"visualizer-advanced-options",icon:"admin-tools",onClick:function(){return n.setState({route:"showAdvanced"})}}),wp.element.createElement(Xu,{label:lc("Chart Permissions"),icon:"admin-users",onClick:function(){return n.setState({route:"showPermissions"})}})),("showAdvanced"===this.state.route||"showPermissions"===this.state.route)&&wp.element.createElement(mc,null,wp.element.createElement(Xu,{label:lc("Chart Settings"),onClick:function(){return n.setState({route:"home"})},isBack:!0}),"showAdvanced"===this.state.route&&wp.element.createElement(Tu,{chart:this.props.chart,attributes:this.props.attributes,edit:this.props.editSettings}),"showPermissions"===this.state.route&&wp.element.createElement(Ju,{chart:this.props.chart,edit:this.props.editPermissions})),wp.element.createElement("div",{className:"visualizer-settings__chart"},null!==this.props.chart&&"DataTable"===r["visualizer-chart-library"]?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)?tc()(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))))}}])&&rc(n.prototype,r),a&&rc(n,a),t}(cc);function hc(e){return(hc="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 fc(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 _c(e,t){return!t||"object"!==hc(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 yc(e){return(yc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function gc(e,t){return(gc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var bc=lodash.startCase,vc=wp.i18n.__,wc=wp.element,Mc=wc.Component,kc=wc.Fragment,Lc=wp.components,Yc=Lc.Button,Dc=Lc.Dashicon,Tc=Lc.Toolbar,Sc=Lc.Tooltip,Oc=(wp.blockEditor||wp.editor).BlockControls,jc=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),_c(this,yc(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&&gc(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e,t,n=U(JSON.parse(JSON.stringify(this.props.chart)));return 0<=["gauge","tabular","timeline"].indexOf(this.props.chart["visualizer-chart-type"])?"DataTable"===n["visualizer-chart-library"]?e=n["visualizer-chart-type"]:("tabular"===(e=this.props.chart["visualizer-chart-type"])&&(e="table"),e=bc(e)):e="".concat(bc(this.props.chart["visualizer-chart-type"]),"Chart"),n["visualizer-data-exploded"]&&(t=vc("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(kc,null,wp.element.createElement(Oc,{key:"toolbar-controls"},wp.element.createElement(Tc,{className:"components-toolbar"},wp.element.createElement(Sc,{text:vc("Edit Chart")},wp.element.createElement(Yc,{className:"components-icon-button components-toolbar__control edit-pie-chart",onClick:this.props.editChart},wp.element.createElement(Dc,{icon:"edit"}))))),"DataTable"===n["visualizer-chart-library"]?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)?tc()(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))))}}])&&fc(n.prototype,r),a&&fc(n,a),t}(Mc);function xc(e){return(xc="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 Ec(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 Cc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ec(n,!0).forEach((function(t){Pc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ec(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Pc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hc(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 zc(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){Hc(i,r,a,o,s,"next",e)}function s(e){Hc(i,r,a,o,s,"throw",e)}o(void 0)}))}}function Ac(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 Nc(e){return(Nc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Fc(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rc(e,t){return(Rc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Wc=wp.i18n.__,Ic=wp,Bc=Ic.apiFetch,Jc=Ic.apiRequest,Uc=wp.element,qc=Uc.Component,Vc=Uc.Fragment,Gc=wp.components,$c=Gc.Button,Kc=Gc.ButtonGroup,Zc=Gc.Dashicon,Qc=Gc.Placeholder,Xc=Gc.Notice,ed=Gc.Spinner,td=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"!==xc(t)&&"function"!=typeof t?Fc(e):t}(this,Nc(t).apply(this,arguments))).getChart=e.getChart.bind(Fc(e)),e.editChart=e.editChart.bind(Fc(e)),e.editSettings=e.editSettings.bind(Fc(e)),e.editPermissions=e.editPermissions.bind(Fc(e)),e.readUploadedFile=e.readUploadedFile.bind(Fc(e)),e.editURL=e.editURL.bind(Fc(e)),e.editSchedule=e.editSchedule.bind(Fc(e)),e.editJSONSchedule=e.editJSONSchedule.bind(Fc(e)),e.editJSONURL=e.editJSONURL.bind(Fc(e)),e.editJSONHeaders=e.editJSONHeaders.bind(Fc(e)),e.editJSONRoot=e.editJSONRoot.bind(Fc(e)),e.editJSONPaging=e.editJSONPaging.bind(Fc(e)),e.JSONImportData=e.JSONImportData.bind(Fc(e)),e.editDatabaseSchedule=e.editDatabaseSchedule.bind(Fc(e)),e.databaseImportData=e.databaseImportData.bind(Fc(e)),e.uploadData=e.uploadData.bind(Fc(e)),e.getChartData=e.getChartData.bind(Fc(e)),e.editChartData=e.editChartData.bind(Fc(e)),e.updateChart=e.updateChart.bind(Fc(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&&Rc(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:(s=zc(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,Bc({path:"wp/v2/visualizer/".concat(this.props.attributes.id)}).catch((function(e){}));case 3:(t=e.sent)?this.setState({chart:t.chart_data}):this.setState({route:"error"});case 5:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"getChart",value:(o=zc(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,Bc({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",lazy:-1});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=Cc({},this.state.chart);t["visualizer-settings"]=e,this.setState({chart:t,isModified:!0})}},{key:"editPermissions",value:function(e){var t=Cc({},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=Cc({},this.state.chart);t["visualizer-chart-url"]=e,this.setState({chart:t})}},{key:"editSchedule",value:function(e){var t=Cc({},this.state.chart);t["visualizer-chart-schedule"]=e,this.setState({chart:t,isModified:!0})}},{key:"editJSONSchedule",value:function(e){var t=Cc({},this.state.chart);t["visualizer-json-schedule"]=e,this.setState({chart:t,isModified:!0})}},{key:"editJSONURL",value:function(e){var t=Cc({},this.state.chart);t["visualizer-json-url"]=e,this.setState({chart:t})}},{key:"editJSONHeaders",value:function(e){var t=Cc({},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=Cc({},this.state.chart);t["visualizer-json-root"]=e,this.setState({chart:t})}},{key:"editJSONPaging",value:function(e){var t=Cc({},this.state.chart);t["visualizer-json-paging"]=e,this.setState({chart:t})}},{key:"JSONImportData",value:function(e,t,n){var r=Cc({},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=Cc({},this.state.chart);t["visualizer-db-schedule"]=e,this.setState({chart:t,isModified:!0})}},{key:"databaseImportData",value:function(e,t,n,r){var a=Cc({},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}),Jc({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=Cc({},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=zc(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,Bc({path:"wp/v2/visualizer/".concat(t)});case 4:n=e.sent,(r=Cc({},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=Cc({},this.state.chart),r=[],a=Cc({},n["visualizer-settings"]),i=n["visualizer-chart-type"];e[0].map((function(t,n){r[n]={label:t,type:e[1][n]}})),e.splice(0,2);var o=r,s="series";"pie"===i&&(o=e,s="slices",e.map((function(e,t){switch(r[1].type){case"number":e[1]=parseFloat(e[1])}}))),o.map((function(e,t){if("pie"===i||0!==t){var n="pie"!==i?t-1:t;void 0===a[s][n]&&(a[s][n]={},a[s][n].temp=1)}})),a[s]=a[s].filter((function(e,t){return t<(-1>=["pie","tabular","dataTable"].indexOf(i)?o.length-1:o.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"),-1>=["bubble","timeline"].indexOf(t["visualizer-chart-type"])&&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})),Jc({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"error"===this.state.route?wp.element.createElement(Xc,{status:"error",isDismissible:!1},wp.element.createElement(Zc,{icon:"chart-pie"}),Wc("This chart is not available; it might have been deleted. Please delete this block and resubmit your chart.")):"renderChart"===this.state.route&&null!==this.state.chart?wp.element.createElement(jc,{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(Zc,{icon:"chart-pie"}),Wc("Visualizer")),"home"===this.state.route&&wp.element.createElement("div",{className:"visualizer-settings__content"},wp.element.createElement("div",{className:"visualizer-settings__content-description"},Wc("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"},Wc("Create a new chart")),wp.element.createElement("div",{className:"visualizer-settings__content-option-icon"},wp.element.createElement(Zc,{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"},Wc("Display an existing chart")),wp.element.createElement("div",{className:"visualizer-settings__content-option-icon"},wp.element.createElement(Zc,{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(Qc,null,wp.element.createElement(ed,null)),"showCharts"===this.state.route&&!1===this.state.isLoading&&wp.element.createElement(ye,{getChart:this.getChart}),"chartSelect"===this.state.route&&null!==this.state.chart&&wp.element.createElement(pc,{id:this.props.attributes.id,attributes:this.props.attributes,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($c,{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})}},Wc("Back")),"chartSelect"===this.state.route&&wp.element.createElement(Vc,null,!1===this.state.isModified?wp.element.createElement($c,{isDefault:!0,isLarge:!0,className:"visualizer-bttn-done",onClick:function(){e.setState({route:"renderChart"}),e.props.setAttributes({route:"renderChart"})}},Wc("Done")):wp.element.createElement($c,{isPrimary:!0,isLarge:!0,className:"visualizer-bttn-save",isBusy:"updateChart"===this.state.isLoading,disabled:"updateChart"===this.state.isLoading,onClick:this.updateChart},Wc("Save"))))))}}])&&Ac(n.prototype,r),a&&Ac(n,a),t}(qc),nd=(n(153),wp.i18n.__),rd=wp.blocks.registerBlockType;t.default=rd("visualizer/chart",{title:nd("Visualizer Chart"),description:nd("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:[nd("Visualizer"),nd("Chart"),nd("Google Charts")],attributes:{id:{type:"number"},lazy:{default:"-1",type:"string"},route:{type:"string"}},supports:{customClassName:!1},edit:td,save:function(){return null}})}]);
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=_(a,n),e.dispatchEvent(a)):r.createEventObject&&(a=r.createEventObject(),a=_(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)},f=function(e,t){return e.getTime()===t.getTime()},_=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]=_({},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>"},w=function(e,t){return"<tr>"+(t?e.reverse():e).join("")+"</tr>"},M=function(e,t,n,r,a,i){var o,s,l,c,d,m=e._o,p=n===m.minYear,h=n===m.maxYear,f='<div id="'+i+'" class="pika-title" role="heading" aria-live="assertive">',_=!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?f+=d+c:f+=c+d,p&&(0===r||m.minMonth>=r)&&(_=!1),h&&(11===r||m.maxMonth<=r)&&(y=!1),0===t&&(f+='<button class="pika-prev'+(_?"":" is-disabled")+'" type="button">'+m.i18n.previousMonth+"</button>"),t===e._o.numberOfMonths-1&&(f+='<button class="pika-next'+(y?"":" is-disabled")+'" type="button">'+m.i18n.nextMonth+"</button>"),f+"</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=_({},g,!0));var t=_(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">'+M(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,_,y,g=0===t?11:t-1,M=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)&&f(j,this._d),E=f(j,a),C=S<o||S>=i+o,P=S-o+1,H=t,z=e,A=r.startRange&&f(r.startRange,j),N=r.endRange&&f(r.endRange,j),F=r.startRange&&r.endRange&&r.startRange<j&&j<r.endRange;C&&(S<o?(P=Y+P,H=g,z=k):(P-=i,H=M,z=L));var R={day:P,month:H,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,_=e,y=void 0,void 0,y=new Date(_,0,1),'<td class="pika-week">'+Math.ceil(((new Date(_,m,u)-y)/864e5+y.getDay()+1)/7)+"</td>")),s.push(w(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,f=function(){return"reactgooglegraph-"+(h+=1)},_=["#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,w=function(e){var t=e.children,n=e.value;return Object(r.createElement)(b,{value:n},t)},M=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,w,M,k,L,Y,D;return d(this,(function(d){switch(d.label){case 0:return e=this.props,t=e.google,c=e.googleChartWrapper,_=null,null!==r&&(g=t.visualization.arrayToDataTable(r.old),b=t.visualization.arrayToDataTable(r.new),_=t.visualization[u].prototype.computeDiff(g,b)),null===n?[3,1]:(f=Array.isArray(n)?t.visualization.arrayToDataTable(n):new t.visualization.DataTable(n),[3,5]);case 1:return null===a||null===i?[3,2]:(f=t.visualization.arrayToDataTable([i].concat(a)),[3,5]);case 2:return null===p?[3,4]:[4,y(t,p,h)];case 3:return f=d.sent(),[3,5];case 4:f=t.visualization.arrayToDataTable([]),d.label=5;case 5:for(v=f.getNumberOfColumns(),w=0;w<v;w+=1)M=this.getColumnID(f,w),this.state.hiddenColumns.includes(M)&&(k=f.getColumnLabel(w),L=f.getColumnId(w),Y=f.getColumnType(w),f.removeColumn(w),f.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(f),c.draw(),null!==this.props.googleChartDashboard&&this.props.googleChartDashboard.draw(f),null!==_&&(c.setDataTable(_),c.draw()),null!==m&&(this.applyFormatters(f,m),c.setDataTable(f),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]:_[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)(M,{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)(M,{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?f():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)(w,{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 P(e){return(P=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function H(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?H(e):t}(this,P(t).apply(this,arguments))).initDataTable=e.initDataTable.bind(H(e)),e.dataRenderer=e.dataRenderer.bind(H(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(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){var n,r=this.props.options,a=null;if(void 0===r.series||void 0===r.series[t]||void 0===r.series[t].format)return a;switch(e){case"date":case"datetime":case"timeofday":a=r.series[t].format&&r.series[t].format.from&&r.series[t].format.to?jQuery.fn.dataTable.render.moment(r.series[t].format.from,r.series[t].format.to):jQuery.fn.dataTable.render.moment("MM-DD-YYYY");break;case"num":var i=["","","","",""];r.series[t].format.thousands&&(i[0]=r.series[t].format.thousands),r.series[t].format.decimal&&(i[1]=r.series[t].format.decimal),r.series[t].format.precision&&0<parseInt(r.series[t].format.precision)&&(i[2]=r.series[t].format.precision),r.series[t].format.prefix&&(i[3]=r.series[t].format.prefix),r.series[t].format.suffix&&(i[4]=r.series[t].format.suffix),a=(n=jQuery.fn.dataTable.render).number.apply(n,i);break;case"boolean":jQuery.fn.dataTable.render.extra=function(e,n,a){return!0!==e&&"true"!==e||""===r.series[t].format.truthy?!1!==e&&"false"!==e||""===r.series[t].format.falsy?e:r.series[t].format.falsy.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,""):r.series[t].format.truthy.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"")},a=jQuery.fn.dataTable.render.extra}return a}},{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},K=function(e,t){return!0===e[t]||"true"===e[t]||"1"===e[t]||1===e[t]},Z=function(e){switch(e["visualizer-chart-library"]){case"GoogleCharts":return Q(e)}},Q=function(e){var t=e["visualizer-settings"],n=e["visualizer-chart-type"],r=e["visualizer-series"],a=[];if(t.series)switch(n){case"tabular":for(var i in t.series)if(r[(i=parseInt(i))+1]&&t.series[i].format&&""!==t.series[i].format){var o=i+1,s=X(r[i+1].type);s&&a.push({type:s,options:{pattern:t.series[i].format},column:o})}break;default:for(var l=0;l<t.series.length;l++)if(r[l+1]&&void 0!==t.series[l]&&t.series[l].format&&""!==t.series[l].format){var u=l+1,c=X(r[l+1].type);c&&a.push({type:c,options:{pattern:t.series[l].format},column:u})}}else"pie"===n&&t.format&&""!==t.format&&a.push({type:X("number"),options:{pattern:t.format},column:1});if(t.hAxis&&r[0]){var d=X(r[0].type);d&&a.push({type:d,options:{pattern:t.hAxis.format},column:0})}return a},X=function(e){switch(e){case"number":return"NumberFormat";case"date":case"datetime":case"timeofday":return"DateFormat"}return null};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 te(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 ne(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){te(i,r,a,o,s,"next",e)}function s(e){te(i,r,a,o,s,"throw",e)}o(void 0)}))}}function re(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 ae(e){return(ae=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ie(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oe(e,t){return(oe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var se=lodash.startCase,le=wp.i18n.__,ue=wp.apiFetch,ce=wp.element,de=ce.Component,me=ce.Fragment,pe=wp.components,he=pe.Button,fe=pe.Dashicon,_e=pe.ExternalLink,ye=pe.Notice,ge=pe.Placeholder,be=pe.Spinner,ve=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?ie(e):t}(this,ae(t).apply(this,arguments))).loadMoreCharts=e.loadMoreCharts.bind(ie(e)),e.state={charts:null,isBusy:!1,chartsLoaded:!1,perPage:visualizerLocalize.chartsPerPage},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&&oe(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:(o=ne(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=visualizerLocalize.chartsPerPage,e.next=3,ue({path:"wp/v2/visualizer/?per_page="+t+"&meta_key=visualizer-chart-library&meta_value=ChartJS"});case 3:n=e.sent,this.setState({charts:n});case 5:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"loadMoreCharts",value:(i=ne(regeneratorRuntime.mark((function e(){var t,n,r,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.state.charts.length,n=this.state.chartsLoaded,r=this.state.perPage,this.setState({isBusy:!0}),e.next=6,ue({path:"wp/v2/visualizer/?per_page=".concat(r,"&meta_key=visualizer-chart-library&meta_value=ChartJS&offset=").concat(t)});case 6:a=e.sent,r>a.length&&(n=!0),this.setState({charts:this.state.charts.concat(a),isBusy:!1,chartsLoaded:n});case 9: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,i=t.perPage;return wp.element.createElement("div",{className:"visualizer-settings__charts"},wp.element.createElement(ye,{status:"warning",isDismissible:!1},le("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(_e,{href:visualizerLocalize.adminPage},le("Click here to visit Visualizer Charts Library."))),null!==n?1<=n.length?wp.element.createElement(me,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),0<=["gauge","tabular","timeline"].indexOf(o["visualizer-chart-type"])?"DataTable"===o["visualizer-chart-library"]?a=o["visualizer-chart-type"]:("tabular"===(a=o["visualizer-chart-type"])&&(a="table"),a=se(a)):a="".concat(se(o["visualizer-chart-type"]),"Chart"),!o["visualizer-chart-library"]||"ChartJS"!==o["visualizer-chart-library"])return o["visualizer-data-exploded"]&&(i=le("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",key:"chart-".concat(n[t].id)},wp.element.createElement("div",{className:"visualizer-settings__charts-title"},r),"DataTable"===o["visualizer-chart-library"]?wp.element.createElement(R,{id:n[t].id,rows:o["visualizer-data"],columns:o["visualizer-series"],chartsScreen:!0,options: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"]),formatters:Z(o)})),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:le("Insert Chart"),onClick:function(){return e.props.getChart(n[t].id)}},wp.element.createElement(fe,{icon:"upload"})))}))),!a&&i-1<n.length&&wp.element.createElement(he,{isPrimary:!0,isLarge:!0,onClick:this.loadMoreCharts,isBusy:r},le("Load More"))):wp.element.createElement("p",{className:"visualizer-no-charts"},le("No charts found.")):wp.element.createElement(ge,null,wp.element.createElement(be,null)))}}])&&re(n.prototype,r),a&&re(n,a),t}(de);function we(e){return(we="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 Me(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 ke(e){return(ke=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Le(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ye(e,t){return(Ye=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var De=wp.i18n.__,Te=wp.element.Component,Se=wp.components,Oe=Se.Button,je=Se.ExternalLink,xe=Se.PanelBody,Ee=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"!==we(t)&&"function"!=typeof t?Le(e):t}(this,ke(t).apply(this,arguments))).uploadInput=React.createRef(),e.fileUploaded=e.fileUploaded.bind(Le(e)),e.uploadImport=e.uploadImport.bind(Le(e)),e.state={uploadLabel:De("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&&Ye(e,t)}(t,e),n=t,(r=[{key:"fileUploaded",value:function(e){"text/csv"===e.target.files[0].type&&this.setState({uploadLabel:De("Upload")})}},{key:"uploadImport",value:function(){this.props.readUploadedFile(this.uploadInput),this.setState({uploadLabel:De("Uploaded")})}},{key:"render",value:function(){return wp.element.createElement(xe,{title:De("Import data from file"),initialOpen:!1},wp.element.createElement("p",null,De("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,De("If you are unsure about how to format your data CSV then please take a look at this sample: "),wp.element.createElement(je,{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(Oe,{isPrimary:!0,onClick:this.uploadImport},this.state.uploadLabel))}}])&&Me(n.prototype,r),a&&Me(n,a),t}(Te);function Ce(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 Pe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ce(n,!0).forEach((function(t){He(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ce(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function He(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ze(e){return(ze="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 Ae(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 Ne(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){Ae(i,r,a,o,s,"next",e)}function s(e){Ae(i,r,a,o,s,"throw",e)}o(void 0)}))}}function Fe(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 Re(e){return(Re=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function We(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ie(e,t){return(Ie=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Be=wp.i18n.__,Je=wp,Ue=(Je.apiFetch,Je.apiRequest),qe=wp.element.Component,Ve=wp.components,Ge=Ve.Button,$e=Ve.ExternalLink,Ke=Ve.IconButton,Ze=Ve.Modal,Qe=Ve.PanelBody,Xe=Ve.SelectControl,et=Ve.TextControl,tt=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"!==ze(t)&&"function"!=typeof t?We(e):t}(this,Re(t).apply(this,arguments))).openModal=e.openModal.bind(We(e)),e.initTable=e.initTable.bind(We(e)),e.onToggle=e.onToggle.bind(We(e)),e.toggleHeaders=e.toggleHeaders.bind(We(e)),e.getJSONRoot=e.getJSONRoot.bind(We(e)),e.getJSONData=e.getJSONData.bind(We(e)),e.getTableData=e.getTableData.bind(We(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&&Ie(e,t)}(t,e),n=t,(r=[{key:"openModal",value:(u=Ne(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=Ne(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=Ne(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,Ue({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"===ze(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"===ze(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"!==ze(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=Ne(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,Ue({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"===ze(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"===ze(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"!==ze(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:Be("Don't use pagination"),value:0}],t.data.paging&&"root>next"===t.data.paging[0]&&n.push({label:Be("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=Ne(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,Ue({path:"/visualizer/v1/set-json-data",data:Pe({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"===ze(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"===ze(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"!==ze(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(Qe,{title:Be("Import from JSON"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,Be("You can choose here to import or synchronize your chart data with a remote JSON source.")),wp.element.createElement("p",null,wp.element.createElement($e,{href:"https://docs.themeisle.com/article/1052-how-to-generate-charts-from-json-data-rest-endpoints"},Be("For more info check this tutorial."))),wp.element.createElement(Xe,{label:Be("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:Be("One-time"),value:"-1"},{label:Be("Live"),value:"0"},{label:Be("Each hour"),value:"1"},{label:Be("Each 12 hours"),value:"12"},{label:Be("Each day"),value:"24"},{label:Be("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(Ge,{isPrimary:!0,isLarge:!0,onClick:this.openModal},Be("Modify Parameters")),this.state.isOpen&&wp.element.createElement(Ze,{title:Be("Import from JSON"),className:"visualizer-json-query-modal",shouldCloseOnClickOutside:!1,onRequestClose:function(){e.setState({isOpen:!1,isTableRendered:!1})}},wp.element.createElement(Qe,{title:Be("Step 1: Specify the JSON endpoint/URL"),opened:this.state.isFirstStepOpen,onToggle:function(){return e.onToggle("isFirstStepOpen")}},wp.element.createElement("p",null,Be("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($e,{href:"https://docs.themeisle.com/article/1043-visualizer-how-to-extend-rest-endpoints-with-json-response"},Be("How to extend REST endpoints with JSON response"))),wp.element.createElement(et,{placeholder:Be("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(Ke,{icon:"arrow-right-alt2",label:Be("Add Headers"),onClick:this.toggleHeaders},Be("Add Headers")),this.state.isHeaderPanelOpen&&wp.element.createElement("div",{className:"visualizer-json-query-modal-headers-panel"},wp.element.createElement(Xe,{label:Be("Request Type"),value:this.props.chart["visualizer-json-headers"]?this.props.chart["visualizer-json-headers"].method:this.state.requestHeaders.method,options:[{value:"GET",label:Be("GET")},{value:"POST",label:Be("POST")}],onChange:function(t){var n=Pe({},e.state.requestHeaders),r=e.state.requestHeaders;n.method=t,r=Pe({},r,{method:t}),e.setState({requestHeaders:r}),e.props.editJSONHeaders(n)}}),wp.element.createElement("p",null,Be("Credentials")),wp.element.createElement(et,{label:Be("Username"),placeholder:Be("Username/Access Key"),value:this.props.chart["visualizer-json-headers"]&&"object"===ze(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.username:this.state.requestHeaders.username,onChange:function(t){var n=Pe({},e.state.requestHeaders),r=e.state.requestHeaders;n.auth={username:t,password:e.props.chart["visualizer-json-headers"]&&"object"===ze(e.props.chart["visualizer-json-headers"].auth)?e.props.chart["visualizer-json-headers"].auth.password:e.state.requestHeaders.password},r=Pe({},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"},Be("&")),wp.element.createElement(et,{label:Be("Password"),placeholder:Be("Password/Secret Key"),type:"password",value:this.props.chart["visualizer-json-headers"]&&"object"===ze(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth.password:this.state.requestHeaders.password,onChange:function(t){var n=Pe({},e.state.requestHeaders),r=e.state.requestHeaders;n.auth={username:e.props.chart["visualizer-json-headers"]&&"object"===ze(e.props.chart["visualizer-json-headers"].auth)?e.props.chart["visualizer-json-headers"].auth.username:e.state.requestHeaders.username,password:t},r=Pe({},r,{username:n.username,password:t}),e.setState({requestHeaders:r}),e.props.editJSONHeaders(n)}}),wp.element.createElement("p",null,Be("OR")),wp.element.createElement(et,{label:Be("Authorization"),placeholder:Be("e.g. SharedKey <AccountName>:<Signature>"),value:this.props.chart["visualizer-json-headers"]&&"object"!==ze(this.props.chart["visualizer-json-headers"].auth)?this.props.chart["visualizer-json-headers"].auth:this.state.requestHeaders.auth,onChange:function(t){var n=Pe({},e.state.requestHeaders),r=e.state.requestHeaders;n.auth=t,r=Pe({},r,{auth:t}),e.setState({requestHeaders:r}),e.props.editJSONHeaders(n)}})),wp.element.createElement(Ge,{isPrimary:!0,isLarge:!0,isBusy:this.state.isLoading,disabled:this.state.isLoading,onClick:this.getJSONRoot},Be("Fetch Endpoint"))),wp.element.createElement(Qe,{title:Be("Step 2: Choose the JSON root"),initialOpen:!1,opened:this.state.isSecondStepOpen,onToggle:function(){return e.onToggle("isSecondStepOpen")}},wp.element.createElement("p",null,Be("If you see Invalid Data, you may have selected the wrong root to fetch data from. Please select an alternative.")),wp.element.createElement(Xe,{value:this.props.chart["visualizer-json-root"],options:this.state.endpointRoots,onChange:this.props.editJSONRoot}),wp.element.createElement(Ge,{isPrimary:!0,isLarge:!0,isBusy:this.state.isLoading,disabled:this.state.isLoading,onClick:this.getJSONData},Be("Parse Endpoint"))),wp.element.createElement(Qe,{title:Be("Step 3: Specify miscellaneous parameters"),initialOpen:!1,opened:this.state.isThirdStepOpen,onToggle:function(){return e.onToggle("isThirdStepOpen")}},"community"!==visualizerLocalize.isPro?wp.element.createElement(Xe,{value:this.props.chart["visualizer-json-paging"]||0,options:this.state.endpointPaging,onChange:this.props.editJSONPaging}):wp.element.createElement("p",null,Be("Enable this feature in PRO version!"))),wp.element.createElement(Qe,{title:Be("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,Be("Select whether to include the data in the chart. Each column selected will form one series.")),wp.element.createElement("li",null,Be("If a column is selected to be included, specify its data type.")),wp.element.createElement("li",null,Be("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,Be("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(Ge,{isPrimary:!0,isLarge:!0,isBusy:this.state.isLoading,disabled:this.state.isLoading,onClick:this.getTableData},Be("Save & Show Chart")))))}}])&&Fe(n.prototype,r),a&&Fe(n,a),t}(qe);function nt(e){return(nt="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 rt(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 at(e,t){return!t||"object"!==nt(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 it(e){return(it=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ot(e,t){return(ot=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var st=wp.i18n.__,lt=wp.element.Component,ut=wp.components,ct=ut.Button,dt=ut.ExternalLink,mt=ut.PanelBody,pt=ut.SelectControl,ht=ut.TextControl,ft=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),at(this,it(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&&ot(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this;return wp.element.createElement(mt,{title:st("Import data from URL"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(mt,{title:st("One Time Import"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,st("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,st("If you are unsure about how to format your data CSV then please take a look at this sample: "),wp.element.createElement(dt,{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,st("You can also import data from Google Spreadsheet.")),wp.element.createElement(ht,{placeholder:st("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(ct,{isPrimary:!0,isLarge:!0,isBusy:"uploadData"===this.props.isLoading,disabled:"uploadData"===this.props.isLoading,onClick:function(){return e.props.uploadData(!1)}},st("Import Data"))),"business"===visualizerLocalize.isPro?wp.element.createElement(mt,{title:st("Schedule Import"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,st("You can choose here to synchronize your chart data with a remote CSV file. ")),wp.element.createElement("p",null,st("You can also synchronize with your Google Spreadsheet file.")),wp.element.createElement("p",null,st("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(ht,{placeholder:st("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(pt,{label:st("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:st("Each hour"),value:"1"},{label:st("Each 12 hours"),value:"12"},{label:st("Each day"),value:"24"},{label:st("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(ct,{isPrimary:!0,isLarge:!0,isBusy:"uploadData"===this.props.isLoading,disabled:"uploadData"===this.props.isLoading,onClick:function(){return e.props.uploadData(!0)}},st("Save Schedule"))):wp.element.createElement(mt,{title:st("Schedule Import"),icon:"lock",className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("p",null,st("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(ct,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},st("Buy Now"))),wp.element.createElement(tt,{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}))}}])&&rt(n.prototype,r),a&&rt(n,a),t}(lt);function _t(e){return(_t="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 yt(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 gt(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 bt(e,t){return!t||"object"!==_t(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 vt(e){return(vt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function wt(e,t){return(wt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Mt=wp.i18n.__,kt=wp.apiFetch,Lt=wp.element,Yt=Lt.Component,Dt=Lt.Fragment,Tt=wp.components,St=Tt.Button,Ot=Tt.PanelBody,jt=Tt.Placeholder,xt=Tt.SelectControl,Et=Tt.Spinner,Ct=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=bt(this,vt(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&&wt(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,kt({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){yt(a,n,r,o,s,"next",e)}function s(e){yt(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(Ot,{title:Mt("Import from other chart"),initialOpen:!1},1<=this.state.charts.length?wp.element.createElement(Dt,null,wp.element.createElement(xt,{label:Mt("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(St,{isPrimary:!0,isLarge:!0,isBusy:"getChartData"===this.props.isLoading,onClick:function(){return e.props.getChartData(e.state.id)}},Mt("Import Chart"))):wp.element.createElement(jt,null,wp.element.createElement(Et,null))):wp.element.createElement(Ot,{title:Mt("Import from other chart"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,Mt("Enable this feature in PRO version!")),wp.element.createElement(St,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},Mt("Buy Now")))}}])&&gt(n.prototype,r),a&&gt(n,a),t}(Yt);function Pt(e){return(Pt="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,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 zt(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 At(e){return(At=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Nt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ft(e,t){return(Ft=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Rt=wp.i18n.__,Wt=wp.apiRequest,It=wp.components,Bt=It.Button,Jt=It.ExternalLink,Ut=wp.element,qt=Ut.Component,Vt=Ut.Fragment,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=function(e,t){return!t||"object"!==Pt(t)&&"function"!=typeof t?Nt(e):t}(this,At(t).apply(this,arguments))).onSave=e.onSave.bind(Nt(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&&Ft(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,Wt({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){Ht(a,n,r,o,s,"next",e)}function s(e){Ht(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(Vt,null,wp.element.createElement("textarea",{className:"visualizer-db-query",placeholder:Rt("Your query goes here…")},this.props.chart["visualizer-db-query"]),wp.element.createElement("div",{className:"visualizer-db-query-actions"},wp.element.createElement(Bt,{isLarge:!0,isDefault:!0,isBusy:this.state.isLoading,onClick:this.onSave},Rt("Show Results")),wp.element.createElement(Bt,{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)}},Rt("Save"))),wp.element.createElement("ul",null,wp.element.createElement("li",null,wp.element.createElement(Jt,{href:"https://docs.themeisle.com/article/970-visualizer-sample-queries-to-generate-charts"},Rt("Examples of queries and links to resources that you can use with this feature."))),wp.element.createElement("li",null,Rt("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"}))}}])&&zt(n.prototype,r),a&&zt(n,a),t}(qt);function $t(e){return($t="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 Kt(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 Zt(e){return(Zt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Qt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xt(e,t){return(Xt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var en=wp.i18n.__,tn=wp.element.Component,nn=wp.components,rn=nn.Button,an=nn.Modal,on=nn.PanelBody,sn=nn.SelectControl,ln=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"!==$t(t)&&"function"!=typeof t?Qt(e):t}(this,Zt(t).apply(this,arguments))).save=e.save.bind(Qt(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&&Xt(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(on,{title:en("Import data from database"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,en("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(rn,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},en("Buy Now"))):wp.element.createElement(on,{title:en("Import data from database"),initialOpen:!1},wp.element.createElement("p",null,en("You can import data from the database here.")),wp.element.createElement("p",null,en("How often do you want to refresh the data from the database.")),wp.element.createElement(sn,{label:en("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:en("Live"),value:"0"},{label:en("Each hour"),value:"1"},{label:en("Each 12 hours"),value:"12"},{label:en("Each day"),value:"24"},{label:en("Each 3 days"),value:"72"}],onChange:this.props.editSchedule}),wp.element.createElement(rn,{isPrimary:!0,isLarge:!0,onClick:function(){return e.setState({isOpen:!0})}},en("Create Query")),this.state.isOpen&&wp.element.createElement(an,{title:en("Import from database"),onRequestClose:function(){return e.setState({isOpen:!1})},className:"visualizer-db-query-modal",shouldCloseOnClickOutside:!1},wp.element.createElement(Gt,{chart:this.props.chart,changeQuery:this.props.changeQuery,save:this.save})))}}])&&Kt(n.prototype,r),a&&Kt(n,a),t}(tn),un=n(132);n(152);function cn(e){return(cn="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 dn(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 mn(e,t){return!t||"object"!==cn(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 pn(e){return(pn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function hn(e,t){return(hn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var fn=wp.i18n.__,_n=wp.element.Component,yn=wp.components,gn=yn.Button,bn=yn.ButtonGroup,vn=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=mn(this,pn(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&&hn(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(un.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(bn,null,wp.element.createElement(gn,{isDefault:!0,isLarge:!0,onClick:this.props.toggleModal},fn("Close")),wp.element.createElement(gn,{isPrimary:!0,isLarge:!0,onClick:function(t){e.props.toggleModal(),e.props.editChartData(e.data,"Visualizer_Source_Csv")}},fn("Save"))))}}])&&dn(n.prototype,r),a&&dn(n,a),t}(_n);function wn(e){return(wn="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 Mn(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 kn(e){return(kn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ln(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Yn(e,t){return(Yn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Dn=wp.i18n.__,Tn=wp.element,Sn=Tn.Component,On=Tn.Fragment,jn=wp.components,xn=jn.Button,En=jn.Modal,Cn=jn.PanelBody,Pn=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"!==wn(t)&&"function"!=typeof t?Ln(e):t}(this,kn(t).apply(this,arguments))).toggleModal=e.toggleModal.bind(Ln(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&&Yn(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(On,null,wp.element.createElement(Cn,{title:Dn("Manual Data"),initialOpen:!1},wp.element.createElement("p",null,Dn("You can manually edit the chart data using a spreadsheet like editor.")),wp.element.createElement(xn,{isPrimary:!0,isLarge:!0,isBusy:this.state.isOpen,onClick:this.toggleModal},Dn("View Editor"))),this.state.isOpen&&wp.element.createElement(En,{title:"Chart Editor",onRequestClose:this.toggleModal,shouldCloseOnClickOutside:!1},wp.element.createElement(vn,{chart:this.props.chart,editChartData:this.props.editChartData,toggleModal:this.toggleModal}))):wp.element.createElement(Cn,{title:Dn("Manual Data"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,Dn("Enable this feature in PRO version!")),wp.element.createElement(xn,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},Dn("Buy Now")))}}])&&Mn(n.prototype,r),a&&Mn(n,a),t}(Sn);function Hn(e){return(Hn="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 zn(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 An(e,t){return!t||"object"!==Hn(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 Nn(e){return(Nn=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 Rn=wp.i18n.__,Wn=wp.element.Component,In=(wp.blockEditor||wp.editor).ColorPalette,Bn=wp.components,Jn=Bn.BaseControl,Un=Bn.CheckboxControl,qn=Bn.PanelBody,Vn=Bn.SelectControl,Gn=Bn.TextControl,$n=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),An(this,Nn(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"],r=[{label:Rn("The tooltip will be displayed when the user hovers over an element"),value:"focus"}];-1>=["timeline"].indexOf(t)&&(r[1]={label:Rn("The tooltip will be displayed when the user selects an element"),value:"selection"}),r[2]={label:Rn("The tooltip will not be displayed"),value:"none"};var a=[{label:Rn("Left of the chart"),value:"left"},{label:Rn("Right of the chart"),value:"right"},{label:Rn("Above the chart"),value:"top"},{label:Rn("Below the chart"),value:"bottom"},{label:Rn("Omit the legend"),value:"none"}];"pie"!==t&&a.push({label:Rn("Inside the chart"),value:"in"});var i=Rn("Text to display above the chart.");return 0<=["tabular","dataTable","gauge","geo","timeline"].indexOf(t)&&(i=Rn("Text to display in the back-end admin area")),wp.element.createElement(qn,{title:Rn("General Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(qn,{title:Rn("Title"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Gn,{label:Rn("Chart Title"),help:i,value:n.title,onChange:function(t){n.title=t,e.props.edit(n)}}),-1>=["tabular","dataTable","gauge","geo","pie","timeline"].indexOf(t)&&wp.element.createElement(Vn,{label:Rn("Chart Title Position"),help:Rn("Where to place the chart title, compared to the chart area."),value:n.titlePosition?n.titlePosition:"out",options:[{label:Rn("Inside the chart"),value:"in"},{label:Rn("Outside the chart"),value:"out"},{label:Rn("None"),value:"none"}],onChange:function(t){n.titlePosition=t,e.props.edit(n)}}),-1>=["tabular","dataTable","gauge","geo","timeline"].indexOf(t)&&wp.element.createElement(Jn,{label:Rn("Chart Title Color")},wp.element.createElement(In,{value:n.titleTextStyle.color,onChange:function(t){n.titleTextStyle.color=t,e.props.edit(n)}})),-1>=["tabular","dataTable","gauge","geo","pie","timeline"].indexOf(t)&&wp.element.createElement(Vn,{label:Rn("Axes Titles Position"),help:Rn("Determines where to place the axis titles, compared to the chart area."),value:n.axisTitlesPosition?n.axisTitlesPosition:"out",options:[{label:Rn("Inside the chart"),value:"in"},{label:Rn("Outside the chart"),value:"out"},{label:Rn("None"),value:"none"}],onChange:function(t){n.axisTitlesPosition=t,e.props.edit(n)}})),-1>=["tabular","dataTable","gauge","geo","pie","timeline"].indexOf(t)&&wp.element.createElement(qn,{title:Rn("Font Styles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Vn,{label:Rn("Font Family"),help:Rn("The default font family for all text in the chart."),value:n.fontName?n.fontName:"Arial",options:[{label:Rn("Arial"),value:"Arial"},{label:Rn("Sans Serif"),value:"Sans Serif"},{label:Rn("Serif"),value:"serif"},{label:Rn("Arial"),value:"Arial"},{label:Rn("Wide"),value:"Arial black"},{label:Rn("Narrow"),value:"Arial Narrow"},{label:Rn("Comic Sans MS"),value:"Comic Sans MS"},{label:Rn("Courier New"),value:"Courier New"},{label:Rn("Garamond"),value:"Garamond"},{label:Rn("Georgia"),value:"Georgia"},{label:Rn("Tahoma"),value:"Tahoma"},{label:Rn("Verdana"),value:"Verdana"}],onChange:function(t){n.fontName=t,e.props.edit(n)}}),wp.element.createElement(Vn,{label:Rn("Font Size"),help:Rn("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>=["tabular","dataTable","gauge","geo","timeline"].indexOf(t)&&wp.element.createElement(qn,{title:Rn("Legend"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Vn,{label:Rn("Position"),help:Rn("Determines where to place the legend, compared to the chart area."),value:n.legend.position?n.legend.position:"right",options:a,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(Vn,{label:Rn("Alignment"),help:Rn("Determines the alignment of the legend."),value:n.legend.alignment?n.legend.alignment:"15",options:[{label:Rn("Aligned to the start of the allocated area"),value:"start"},{label:Rn("Centered in the allocated area"),value:"center"},{label:Rn("Aligned to the end of the allocated area"),value:"end"}],onChange:function(t){n.legend.alignment=t,e.props.edit(n)}}),wp.element.createElement(Jn,{label:Rn("Font Color")},wp.element.createElement(In,{value:n.legend.textStyle.color,onChange:function(t){n.legend.textStyle.color=t,e.props.edit(n)}}))),-1>=["tabular","gauge","geo","dataTable","timeline"].indexOf(t)&&wp.element.createElement(qn,{title:Rn("Tooltip"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Vn,{label:Rn("Trigger"),help:Rn("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(Vn,{label:Rn("Show Color Code"),help:Rn("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:Rn("Yes"),value:"1"},{label:Rn("No"),value:"0"}],onChange:function(t){n.tooltip.showColorCode=t,e.props.edit(n)}}),0<=["pie"].indexOf(t)&&wp.element.createElement(Vn,{label:Rn("Text"),help:Rn("Determines what information to display when the user hovers over a pie slice."),value:n.tooltip.text?n.tooltip.text:"both",options:[{label:Rn("Display both the absolute value of the slice and the percentage of the whole"),value:"both"},{label:Rn("Display only the absolute value of the slice"),value:"value"},{label:Rn("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>=["tabular","dataTable","gauge","geo","pie","timeline"].indexOf(t)&&wp.element.createElement(qn,{title:Rn("Animation"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Un,{label:Rn("Animate on startup?"),help:Rn("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(Gn,{label:Rn("Duration"),help:Rn("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(Vn,{label:Rn("Easing"),help:Rn("The easing function applied to the animation."),value:n.animation.easing?n.animation.easing:"linear",options:[{label:Rn("Constant speed"),value:"linear"},{label:Rn("Start slow and speed up"),value:"in"},{label:Rn("Start fast and slow down"),value:"out"},{label:Rn("Start slow, speed up, then slow down"),value:"inAndOut"}],onChange:function(t){n.animation.easing=t,e.props.edit(n)}})))}}])&&zn(n.prototype,r),a&&zn(n,a),t}(Wn);function Kn(e){return(Kn="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 Zn(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"!==Kn(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 Xn(e){return(Xn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function er(e,t){return(er=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var tr=wp.i18n.__,nr=wp.element.Component,rr=wp.components,ar=rr.PanelBody,ir=rr.Notice,or=rr.TextControl,sr=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,Xn(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&&er(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(ar,{title:tr("Instance Settings"),initialOpen:!0,className:"visualizer-instance-panel"},wp.element.createElement(ir,{status:"info",isDismissible:!1},wp.element.createElement("p",null,tr("These settings are valid only for this instance of the chart.")),wp.element.createElement("p",null,tr("This means that if you insert this chart again elsewhere, these values will not persist."))),wp.element.createElement(or,{label:tr("Should this instance lazy Load?"),help:tr("-1: do not lazy load. Any number greater than -1 will lazy load the chart once the viewport is that many pixels away from the chart"),value:this.props.attributes.lazy?Number(this.props.attributes.lazy):-1,type:"number",min:"-1",max:"1000",step:"1",onChange:function(n){e.props.attributes.lazy=n,e.props.edit(t)}}))}}])&&Zn(n.prototype,r),a&&Zn(n,a),t}(nr);function lr(e){return(lr="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 ur(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"!==lr(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 dr(e){return(dr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function mr(e,t){return(mr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var pr=wp.i18n.__,hr=wp.element,fr=hr.Component,_r=hr.Fragment,yr=(wp.blockEditor||wp.editor).ColorPalette,gr=wp.components,br=gr.BaseControl,vr=gr.ExternalLink,wr=gr.PanelBody,Mr=gr.SelectControl,kr=gr.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),cr(this,dr(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&&mr(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:pr("Horizontal Axis Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(wr,{title:pr("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(kr,{label:pr("Axis Title"),help:pr("The title of the horizontal axis."),value:n.hAxis.title,onChange:function(t){n.hAxis.title=t,e.props.edit(n)}}),wp.element.createElement(Mr,{label:pr("Text Position"),help:pr("Position of the horizontal axis text, relative to the chart area."),value:n.hAxis.textPosition?n.hAxis.textPosition:"out",options:[{label:pr("Inside the chart"),value:"in"},{label:pr("Outside the chart"),value:"out"},{label:pr("None"),value:"none"}],onChange:function(t){n.hAxis.textPosition=t,e.props.edit(n)}}),wp.element.createElement(Mr,{label:pr("Direction"),help:pr("The direction in which the values along the horizontal axis grow."),value:n.hAxis.direction?n.hAxis.direction:"1",options:[{label:pr("Identical Direction"),value:"1"},{label:pr("Reverse Direction"),value:"-1"}],onChange:function(t){n.hAxis.direction=t,e.props.edit(n)}}),wp.element.createElement(br,{label:pr("Base Line Color")},wp.element.createElement(yr,{value:n.hAxis.baselineColor,onChange:function(t){n.hAxis.baselineColor=t,e.props.edit(n)}})),wp.element.createElement(br,{label:pr("Axis Text Color")},wp.element.createElement(yr,{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(_r,null,wp.element.createElement(kr,{label:pr("Number Format"),help:pr("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,pr("For number axis labels, this is a subset of the formatting "),wp.element.createElement(vr,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},pr("ICU pattern set.")),pr(" 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,pr("For date axis labels, this is a subset of the date formatting "),wp.element.createElement(vr,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},pr("ICU date and time format."))))),-1>=["column"].indexOf(t)&&wp.element.createElement(_r,null,wp.element.createElement(wr,{title:pr("Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(kr,{label:pr("Count"),help:pr("The approximate number of horizontal gridlines inside the chart area. You can specify a value of -1 to automatically compute the number of gridlines, 0 or 1 to draw no gridlines, or 2 or more to only draw gridline. Any number greater than 2 will be used to compute the minSpacing between 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(br,{label:pr("Color")},wp.element.createElement(yr,{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(wr,{title:pr("Minor Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(kr,{label:pr("Count"),help:pr("Specify 0 to disable the minor gridlines."),value:n.hAxis.minorGridlines?n.hAxis.minorGridlines.count:"",onChange:function(t){n.hAxis.minorGridlines||(n.hAxis.minorGridlines={}),n.hAxis.minorGridlines.count=t,e.props.edit(n)}}),wp.element.createElement(br,{label:pr("Color")},wp.element.createElement(yr,{value:n.hAxis.minorGridlines?n.hAxis.minorGridlines.color:"",onChange:function(t){n.hAxis.minorGridlines||(n.hAxis.minorGridlines={}),n.hAxis.minorGridlines.color=t,e.props.edit(n)}}))),wp.element.createElement(wr,{title:pr("View Window"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(kr,{label:pr("Maximun Value"),help:pr("The maximum vertical data value to render."),value:n.hAxis.viewWindow?n.hAxis.viewWindow.max:"",onChange:function(t){n.hAxis.viewWindow||(n.hAxis.viewWindow={}),n.hAxis.viewWindow.max=t,e.props.edit(n)}}),wp.element.createElement(kr,{label:pr("Minimum Value"),help:pr("The minimum vertical data value to render."),value:n.hAxis.viewWindow?n.hAxis.viewWindow.min:"",onChange:function(t){n.hAxis.viewWindow||(n.hAxis.viewWindow={}),n.hAxis.viewWindow.min=t,e.props.edit(n)}}))))}}])&&ur(n.prototype,r),a&&ur(n,a),t}(fr);function Yr(e){return(Yr="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 Dr(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 Tr(e,t){return!t||"object"!==Yr(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 Sr(e){return(Sr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Or(e,t){return(Or=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var jr=wp.i18n.__,xr=wp.element,Er=xr.Component,Cr=xr.Fragment,Pr=(wp.blockEditor||wp.editor).ColorPalette,Hr=wp.components,zr=Hr.BaseControl,Ar=Hr.ExternalLink,Nr=Hr.PanelBody,Fr=Hr.SelectControl,Rr=Hr.TextControl,Wr=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Tr(this,Sr(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&&Or(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(Nr,{title:jr("Vertical Axis Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Nr,{title:jr("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Rr,{label:jr("Axis Title"),help:jr("The title of the Vertical axis."),value:n.vAxis.title,onChange:function(t){n.vAxis.title=t,e.props.edit(n)}}),wp.element.createElement(Fr,{label:jr("Text Position"),help:jr("Position of the Vertical axis text, relative to the chart area."),value:n.vAxis.textPosition?n.vAxis.textPosition:"out",options:[{label:jr("Inside the chart"),value:"in"},{label:jr("Outside the chart"),value:"out"},{label:jr("None"),value:"none"}],onChange:function(t){n.vAxis.textPosition=t,e.props.edit(n)}}),wp.element.createElement(Fr,{label:jr("Direction"),help:jr("The direction in which the values along the Vertical axis grow."),value:n.vAxis.direction?n.vAxis.direction:"1",options:[{label:jr("Identical Direction"),value:"1"},{label:jr("Reverse Direction"),value:"-1"}],onChange:function(t){n.vAxis.direction=t,e.props.edit(n)}}),wp.element.createElement(zr,{label:jr("Base Line Color")},wp.element.createElement(Pr,{value:n.vAxis.baselineColor,onChange:function(t){n.vAxis.baselineColor=t,e.props.edit(n)}})),wp.element.createElement(zr,{label:jr("Axis Text Color")},wp.element.createElement(Pr,{value:n.vAxis.textStyle.color||n.vAxis.textStyle,onChange:function(t){n.vAxis.textStyle={},n.vAxis.textStyle.color=t,e.props.edit(n)}})),-1>=["bar"].indexOf(t)&&wp.element.createElement(Cr,null,wp.element.createElement(Rr,{label:jr("Number Format"),help:jr("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,jr("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"},jr("ICU pattern set.")),jr(" 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,jr("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"},jr("ICU date and time format."))))),-1>=["bar"].indexOf(t)&&wp.element.createElement(Cr,null,wp.element.createElement(Nr,{title:jr("Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Rr,{label:jr("Count"),help:jr("The approximate number of vertical gridlines inside the chart area. You can specify a value of -1 to automatically compute the number of gridlines, 0 or 1 to draw no gridlines, or 2 or more to only draw gridline. Any number greater than 2 will be used to compute the minSpacing between 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(zr,{label:jr("Color")},wp.element.createElement(Pr,{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(Nr,{title:jr("Minor Grid Lines"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Rr,{label:jr("Count"),help:jr("Specify 0 to disable the minor gridlines."),value:n.vAxis.minorGridlines?n.vAxis.minorGridlines.count:"",onChange:function(t){n.vAxis.minorGridlines||(n.vAxis.minorGridlines={}),n.vAxis.minorGridlines.count=t,e.props.edit(n)}}),wp.element.createElement(zr,{label:jr("Color")},wp.element.createElement(Pr,{value:n.vAxis.minorGridlines?n.vAxis.minorGridlines.color:"",onChange:function(t){n.vAxis.minorGridlines||(n.vAxis.minorGridlines={}),n.vAxis.minorGridlines.color=t,e.props.edit(n)}}))),wp.element.createElement(Nr,{title:jr("View Window"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Rr,{label:jr("Maximun Value"),help:jr("The maximum vertical data value to render."),value:n.vAxis.viewWindow?n.vAxis.viewWindow.max:"",onChange:function(t){n.vAxis.viewWindow||(n.vAxis.viewWindow={}),n.vAxis.viewWindow.max=t,e.props.edit(n)}}),wp.element.createElement(Rr,{label:jr("Minimum Value"),help:jr("The minimum vertical data value to render."),value:n.vAxis.viewWindow?n.vAxis.viewWindow.min:"",onChange:function(t){n.vAxis.viewWindow||(n.vAxis.viewWindow={}),n.vAxis.viewWindow.min=t,e.props.edit(n)}}))))}}])&&Dr(n.prototype,r),a&&Dr(n,a),t}(Er);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 Br(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 Jr(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 Ur(e){return(Ur=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function qr(e,t){return(qr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Vr=wp.i18n.__,Gr=wp.element,$r=Gr.Component,Kr=Gr.Fragment,Zr=(wp.blockEditor||wp.editor).ColorPalette,Qr=wp.components,Xr=Qr.BaseControl,ea=Qr.ExternalLink,ta=Qr.PanelBody,na=Qr.SelectControl,ra=Qr.TextControl,aa=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Jr(this,Ur(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&&qr(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(ta,{title:Vr("Pie Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Kr,null,wp.element.createElement(ra,{label:Vr("Number Format"),help:Vr("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,Vr("For number axis labels, this is a subset of the formatting "),wp.element.createElement(ea,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},Vr("ICU pattern set.")),Vr(" 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,Vr("For date axis labels, this is a subset of the date formatting "),wp.element.createElement(ea,{href:"http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax"},Vr("ICU date and time format.")))),wp.element.createElement(na,{label:Vr("Is 3D"),help:Vr("If set to yes, displays a three-dimensional chart."),value:t.is3D?t.is3D:"0",options:[{label:Vr("Yes"),value:"1"},{label:Vr("No"),value:"0"}],onChange:function(n){t.is3D=n,e.props.edit(t)}}),wp.element.createElement(na,{label:Vr("Reverse Categories"),help:Vr("If set to yes, will draw slices counterclockwise."),value:t.reverseCategories?t.reverseCategories:"0",options:[{label:Vr("Yes"),value:"1"},{label:Vr("No"),value:"0"}],onChange:function(n){t.reverseCategories=n,e.props.edit(t)}}),wp.element.createElement(na,{label:Vr("Slice Text"),help:Vr("The content of the text displayed on the slice."),value:t.pieSliceText?t.pieSliceText:"percentage",options:[{label:Vr("The percentage of the slice size out of the total"),value:"percentage"},{label:Vr("The quantitative value of the slice"),value:"value"},{label:Vr("The name of the slice"),value:"label"},{label:Vr("The quantitative value and percentage of the slice"),value:"value-and-percentage"},{label:Vr("No text is displayed"),value:"none"}],onChange:function(n){t.pieSliceText=n,e.props.edit(t)}}),wp.element.createElement(ra,{label:Vr("Pie Hole"),help:Vr("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:Vr("0.5"),value:t.pieHole,onChange:function(n){t.pieHole=n,e.props.edit(t)}}),wp.element.createElement(ra,{label:Vr("Start Angle"),help:Vr("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(Xr,{label:Vr("Slice Border Color")},wp.element.createElement(Zr,{value:t.pieSliceBorderColor,onChange:function(n){t.pieSliceBorderColor=n,e.props.edit(t)}})))}}])&&Br(n.prototype,r),a&&Br(n,a),t}($r);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 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 sa(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 la(e){return(la=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ua(e,t){return(ua=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ca=wp.i18n.__,da=wp.element.Component,ma=(wp.blockEditor||wp.editor).ColorPalette,pa=wp.components,ha=pa.BaseControl,fa=pa.PanelBody,_a=pa.TextControl,ya=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),sa(this,la(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&&ua(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(fa,{title:ca("Residue Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(_a,{label:ca("Visibility Threshold"),help:ca("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:ca("0.001388889"),value:t.sliceVisibilityThreshold,onChange:function(n){t.sliceVisibilityThreshold=n,e.props.edit(t)}}),wp.element.createElement(_a,{label:ca("Residue Slice Label"),help:ca("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(ha,{label:ca("Residue Slice Color")},wp.element.createElement(ma,{value:t.pieResidueSliceColor,onChange:function(n){t.pieResidueSliceColor=n,e.props.edit(t)}})))}}])&&oa(n.prototype,r),a&&oa(n,a),t}(da);function ga(e){return(ga="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 va(e,t){return!t||"object"!==ga(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 wa(e){return(wa=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 ka=wp.i18n.__,La=wp.element,Ya=La.Component,Da=La.Fragment,Ta=wp.components,Sa=Ta.PanelBody,Oa=Ta.SelectControl,ja=Ta.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),va(this,wa(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-chart-type"],n=this.props.chart["visualizer-settings"];return wp.element.createElement(Sa,{title:ka("Lines Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(ja,{label:ka("Line Width"),help:ka("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(ja,{label:ka("Point Size"),help:ka("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(Oa,{label:ka("Curve Type"),help:ka("Determines whether the series has to be presented in the legend or not."),value:n.curveType?n.curveType:"none",options:[{label:ka("Straight line without curve"),value:"none"},{label:ka("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(Oa,{label:ka("Focus Target"),help:ka("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:ka("Focus on a single data point."),value:"datum"},{label:ka("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(Oa,{label:ka("Selection Mode"),help:ka("Determines how many data points an user can select on a chart."),value:n.selectionMode?n.selectionMode:"single",options:[{label:ka("Single data point"),value:"single"},{label:ka("Multiple data points"),value:"multiple"}],onChange:function(t){n.selectionMode=t,e.props.edit(n)}}),wp.element.createElement(Oa,{label:ka("Aggregation Target"),help:ka("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:ka("Group selected data by x-value"),value:"category"},{label:ka("Group selected data by series"),value:"series"},{label:ka("Group selected data by x-value if all selections have the same x-value, and by series otherwise"),value:"auto"},{label:ka("Show only one tooltip per selection"),value:"none"}],onChange:function(t){n.aggregationTarget=t,e.props.edit(n)}}),wp.element.createElement(ja,{label:ka("Point Opacity"),help:ka("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(Da,null,wp.element.createElement(ja,{label:ka("Area Opacity"),help:ka("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(Oa,{label:ka("Is Stacked"),help:ka("If set to yes, series elements are stacked."),value:n.isStacked?n.isStacked:"0",options:[{label:ka("Yes"),value:"1"},{label:ka("No"),value:"0"}],onChange:function(t){n.isStacked=t,e.props.edit(n)}})),-1>=["scatter","area"].indexOf(t)&&wp.element.createElement(Oa,{label:ka("Interpolate Nulls"),help:ka("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:ka("Yes"),value:"1"},{label:ka("No"),value:"0"}],onChange:function(t){n.interpolateNulls=t,e.props.edit(n)}}))}}])&&ba(n.prototype,r),a&&ba(n,a),t}(Ya);function Ea(e){return(Ea="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 Ca(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 Pa(e,t){return!t||"object"!==Ea(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 za(e,t){return(za=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Aa=wp.i18n.__,Na=wp.element.Component,Fa=wp.components,Ra=Fa.PanelBody,Wa=Fa.SelectControl,Ia=Fa.TextControl,Ba=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Pa(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&&za(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Ra,{title:Aa("Bars Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Wa,{label:Aa("Focus Target"),help:Aa("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:Aa("Focus on a single data point."),value:"datum"},{label:Aa("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(Wa,{label:Aa("Is Stacked"),help:Aa("If set to yes, series elements are stacked."),value:t.isStacked?t.isStacked:"0",options:[{label:Aa("Yes"),value:"1"},{label:Aa("No"),value:"0"}],onChange:function(n){t.isStacked=n,e.props.edit(t)}}),wp.element.createElement(Ia,{label:Aa("Bars Opacity"),help:Aa("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)}}))}}])&&Ca(n.prototype,r),a&&Ca(n,a),t}(Na);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 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 qa(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 Va(e){return(Va=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 $a=wp.i18n.__,Ka=wp.element.Component,Za=(wp.blockEditor||wp.editor).ColorPalette,Qa=wp.components,Xa=Qa.BaseControl,ei=Qa.PanelBody,ti=Qa.SelectControl,ni=Qa.TextControl,ri=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),qa(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&&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(ei,{title:$a("Candles Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(ei,{title:$a("General Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ti,{label:$a("Focus Target"),help:$a("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:$a("Focus on a single data point."),value:"datum"},{label:$a("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(ti,{label:$a("Selection Mode"),help:$a("Determines how many data points an user can select on a chart."),value:t.selectionMode?t.selectionMode:"single",options:[{label:$a("Single data point"),value:"single"},{label:$a("Multiple data points"),value:"multiple"}],onChange:function(n){t.selectionMode=n,e.props.edit(t)}}),wp.element.createElement(ti,{label:$a("Aggregation Target"),help:$a("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:$a("Group selected data by x-value"),value:"category"},{label:$a("Group selected data by series"),value:"series"},{label:$a("Group selected data by x-value if all selections have the same x-value, and by series otherwise"),value:"auto"},{label:$a("Show only one tooltip per selection"),value:"none"}],onChange:function(n){t.aggregationTarget=n,e.props.edit(t)}})),wp.element.createElement(ei,{title:$a("Failing Candles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ni,{label:$a("Stroke Width"),help:$a("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(Xa,{label:$a("Stroke Color")},wp.element.createElement(Za,{value:t.candlestick.fallingColor.stroke,onChange:function(n){t.candlestick.fallingColor.stroke=n,e.props.edit(t)}})),wp.element.createElement(Xa,{label:$a("Fill Color")},wp.element.createElement(Za,{value:t.candlestick.fallingColor.fill,onChange:function(n){t.candlestick.fallingColor.fill=n,e.props.edit(t)}}))),wp.element.createElement(ei,{title:$a("Rising Candles"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(ni,{label:$a("Stroke Width"),help:$a("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(Xa,{label:$a("Stroke Color")},wp.element.createElement(Za,{value:t.candlestick.risingColor.stroke,onChange:function(n){t.candlestick.risingColor.stroke=n,e.props.edit(t)}})),wp.element.createElement(Xa,{label:$a("Fill Color")},wp.element.createElement(Za,{value:t.candlestick.risingColor.fill,onChange:function(n){t.candlestick.risingColor.fill=n,e.props.edit(t)}}))))}}])&&Ua(n.prototype,r),a&&Ua(n,a),t}(Ka);function ai(e){return(ai="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 ii(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 oi(e,t){return!t||"object"!==ai(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 si(e){return(si=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function li(e,t){return(li=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ui=wp.i18n.__,ci=wp.element.Component,di=wp.components,mi=di.ExternalLink,pi=di.PanelBody,hi=di.SelectControl,fi=di.TextControl,_i=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),oi(this,si(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&&li(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(pi,{title:ui("Map Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(pi,{title:ui("API"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(fi,{label:ui("API Key"),help:ui("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(mi,{href:"https://developers.google.com/maps/documentation/javascript/get-api-key"},ui("Get API Keys"))),wp.element.createElement(pi,{title:ui("Region"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,ui("A map of the entire world using 'world'.")),wp.element.createElement("li",null,ui("A continent or a sub-continent, specified by its 3-digit code, e.g., '011' for Western Africa. "),wp.element.createElement(mi,{href:"https://google-developers.appspot.com/chart/interactive/docs/gallery/geochart#Continent_Hierarchy"},ui("More info here."))),wp.element.createElement("li",null,ui("A country, specified by its ISO 3166-1 alpha-2 code, e.g., 'AU' for Australia. "),wp.element.createElement(mi,{href:"http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2"},ui("More info here."))),wp.element.createElement("li",null,ui("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(mi,{href:"http://en.wikipedia.org/wiki/ISO_3166-2:US"},ui("More info here.")))),wp.element.createElement(fi,{label:ui("Reigion"),help:ui("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(pi,{title:ui("Resolution"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,ui("'countries' - Supported for all regions, except for US state regions.")),wp.element.createElement("li",null,ui("'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,ui("'metros' - Supported for the US country region and US state regions only."))),wp.element.createElement(hi,{label:ui("Resolution"),help:ui("The resolution of the map borders."),value:t.resolution?t.resolution:"countries",options:[{label:ui("Countries"),value:"countries"},{label:ui("Provinces"),value:"provinces"},{label:ui("Metros"),value:"metros"}],onChange:function(n){t.resolution=n,e.props.edit(t)}})),wp.element.createElement(pi,{title:ui("Display Mode"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement("ul",{className:"visualizer-list"},wp.element.createElement("li",null,ui("'auto' - Choose based on the format of the data.")),wp.element.createElement("li",null,ui("'regions' - This is a region map.")),wp.element.createElement("li",null,ui("'markers' - This is a marker map."))),wp.element.createElement(hi,{label:ui("Display Mode"),help:ui("Determines which type of map this is."),value:t.displayMode?t.displayMode:"auto",options:[{label:ui("Auto"),value:"auto"},{label:ui("Regions"),value:"regions"},{label:ui("Markers"),value:"markers"}],onChange:function(n){t.displayMode=n,e.props.edit(t)}})),wp.element.createElement(pi,{title:ui("Tooltip"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(hi,{label:ui("Trigger"),help:ui("Determines the user interaction that causes the tooltip to be displayed."),value:t.tooltip.trigger?t.tooltip.trigger:"focus",options:[{label:ui("The tooltip will be displayed when the user hovers over an element"),value:"focus"},{label:ui("The tooltip will not be displayed"),value:"none"}],onChange:function(n){t.tooltip.trigger=n,e.props.edit(t)}})))}}])&&ii(n.prototype,r),a&&ii(n,a),t}(ci);function yi(e){return(yi="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 gi(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 bi(e,t){return!t||"object"!==yi(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 vi(e){return(vi=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 Mi=wp.i18n.__,ki=wp.element.Component,Li=(wp.blockEditor||wp.editor).ColorPalette,Yi=wp.components,Di=Yi.BaseControl,Ti=Yi.PanelBody,Si=Yi.TextControl,Oi=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),bi(this,vi(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"];return wp.element.createElement(Ti,{title:Mi("Color Axis"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Si,{label:Mi("Minimum Values"),help:Mi("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(Si,{label:Mi("Maximum Values"),help:Mi("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(Di,{label:Mi("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(Di,{label:Mi("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(Di,{label:Mi("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(Di,{label:Mi("Dateless Region")},wp.element.createElement(Li,{value:t.datalessRegionColor,onChange:function(n){t.datalessRegionColor=n,e.props.edit(t)}})))}}])&&gi(n.prototype,r),a&&gi(n,a),t}(ki);function ji(e){return(ji="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 xi(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 Ei(e,t){return!t||"object"!==ji(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 Ci(e){return(Ci=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Pi(e,t){return(Pi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Hi=wp.i18n.__,zi=wp.element,Ai=zi.Component,Ni=zi.Fragment,Fi=wp.components,Ri=Fi.ExternalLink,Wi=Fi.PanelBody,Ii=Fi.TextControl,Bi=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Ei(this,Ci(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&&Pi(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(Wi,{title:Hi("Size Axis"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Ii,{label:Hi("Minimum Values"),help:Hi("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(Ii,{label:Hi("Maximum Values"),help:Hi("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(Ii,{label:Hi("Minimum Marker Radius"),help:Hi("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(Ii,{label:Hi("Maximum Marker Radius"),help:Hi("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(Ii,{label:Hi("Marker Opacity"),help:Hi("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(Ni,null,wp.element.createElement(Ii,{label:Hi("Number Format"),help:Hi("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,Hi("For number axis labels, this is a subset of the formatting "),wp.element.createElement(Ri,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},Hi("ICU pattern set.")),Hi(" 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."))))}}])&&xi(n.prototype,r),a&&xi(n,a),t}(Ai);function Ji(e){return(Ji="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 Ui(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 qi(e,t){return!t||"object"!==Ji(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 Vi(e){return(Vi=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 $i=wp.i18n.__,Ki=wp.element.Component,Zi=wp.components,Qi=Zi.PanelBody,Xi=Zi.SelectControl,eo=Zi.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),qi(this,Vi(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(Qi,{title:$i("Magnifying Glass"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Xi,{label:$i("Enabled"),help:$i("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:$i("Yes"),value:"1"},{label:$i("No"),value:"0"}],onChange:function(n){t.magnifyingGlass.enable=n,e.props.edit(t)}}),wp.element.createElement(eo,{label:$i("Zoom Factor"),help:$i("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)}}))}}])&&Ui(n.prototype,r),a&&Ui(n,a),t}(Ki);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,t){return!t||"object"!==no(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 io(e){return(io=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(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,uo=lo.Component,co=lo.Fragment,mo=(wp.blockEditor||wp.editor).ColorPalette,po=wp.components,ho=po.BaseControl,fo=po.ExternalLink,_o=po.PanelBody,yo=po.TextControl,go=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ao(this,io(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&&oo(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(_o,{title:so("Gauge Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(_o,{title:so("Tick Settings"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(yo,{label:so("Minimum Values"),help:so("Determines the minimum values of gauge."),value:t.min,onChange:function(n){t.min=n,e.props.edit(t)}}),wp.element.createElement(yo,{label:so("Maximum Values"),help:so("Determines the maximum values of gauge."),value:t.max,onChange:function(n){t.max=n,e.props.edit(t)}}),wp.element.createElement(yo,{label:so("Minor Ticks"),help:so("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(co,null,wp.element.createElement(yo,{label:so("Number Format"),help:so("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,so("For number axis labels, this is a subset of the formatting "),wp.element.createElement(fo,{href:"http://icu-project.org/apiref/icu4c/classDecimalFormat.html#_details"},so("ICU pattern set.")),so(" 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(_o,{title:so("Green Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(yo,{label:so("Minimum Range"),help:so("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(yo,{label:so("Maximum Range"),help:so("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(ho,{label:so("Green Color")},wp.element.createElement(mo,{value:t.greenColor,onChange:function(n){t.greenColor=n,e.props.edit(t)}}))),wp.element.createElement(_o,{title:so("Yellow Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(yo,{label:so("Minimum Range"),help:so("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(yo,{label:so("Maximum Range"),help:so("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(ho,{label:so("Yellow Color")},wp.element.createElement(mo,{value:t.yellowColor,onChange:function(n){t.yellowColor=n,e.props.edit(t)}}))),wp.element.createElement(_o,{title:so("Red Color"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(yo,{label:so("Minimum Range"),help:so("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(yo,{label:so("Maximum Range"),help:so("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(ho,{label:so("Red Color")},wp.element.createElement(mo,{value:t.redColor,onChange:function(n){t.redColor=n,e.props.edit(t)}}))))}}])&&ro(n.prototype,r),a&&ro(n,a),t}(uo);function bo(e){return(bo="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 wo(e){return(wo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Mo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ko(e,t){return(ko=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Lo=wp.i18n.__,Yo=wp.element.Component,Do=(wp.blockEditor||wp.editor).ColorPalette,To=wp.components,So=To.BaseControl,Oo=To.CheckboxControl,jo=To.PanelBody,xo=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"!==bo(t)&&"function"!=typeof t?Mo(e):t}(this,wo(t).apply(this,arguments))).mapValues=e.mapValues.bind(Mo(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&&ko(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(jo,{title:Lo("Timeline Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(Oo,{label:Lo("Show Row Label"),help:Lo("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(Oo,{label:Lo("Group by Row Label"),help:Lo("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(Oo,{label:Lo("Color by Row Label"),help:Lo("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(So,{label:Lo("Single Color")},wp.element.createElement(Do,{value:this.mapValues(t,"singleColor"),onChange:function(n){void 0===t.timeline&&(t.timeline={}),t.timeline.singleColor=n,e.props.edit(t)}})))}}])&&vo(n.prototype,r),a&&vo(n,a),t}(Yo);function Eo(e){return(Eo="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 Co(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 Po(e,t){return!t||"object"!==Eo(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 zo(e,t){return(zo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ao=wp.i18n.__,No=wp.element,Fo=No.Component,Ro=No.Fragment,Wo=wp.components,Io=Wo.CheckboxControl,Bo=Wo.PanelBody,Jo=Wo.SelectControl,Uo=Wo.TextControl,qo=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Po(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&&zo(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"],this.props.chart["visualizer-chart-library"]);return wp.element.createElement(Bo,{title:Ao("Table Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},"DataTable"===n?wp.element.createElement(Ro,null,wp.element.createElement(Io,{label:Ao("Enable Pagination"),help:Ao("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(Uo,{label:Ao("Number of rows per page"),help:Ao("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(Jo,{label:Ao("Pagination type"),help:Ao("Determines what type of pagination options to show."),value:t.pagingType,options:[{label:Ao("Page number buttons only"),value:"numbers"},{label:Ao("'Previous' and 'Next' buttons only"),value:"simple"},{label:Ao("'Previous' and 'Next' buttons, plus page numbers"),value:"simple_numbers"},{label:Ao("'First', 'Previous', 'Next' and 'Last' buttons"),value:"full"},{label:Ao("'First', 'Previous', 'Next' and 'Last' buttons, plus page numbers"),value:"full_numbers"},{label:Ao("'First' and 'Last' buttons, plus page numbers"),value:"first_last_numbers"}],onChange:function(n){t.pagingType=n,e.props.edit(t)}}),wp.element.createElement(Io,{label:Ao("Scroll Collapse"),help:Ao("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(Uo,{label:Ao("Vertical Height"),help:Ao("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(Io,{label:Ao("Disable Sort"),help:Ao("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(Io,{label:Ao("Freeze Header/Footer"),help:Ao("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(Io,{label:Ao("Responsive"),help:Ao("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(Ro,null,wp.element.createElement(Jo,{label:Ao("Enable Pagination"),help:Ao("To enable paging through the data."),value:t.page?t.page:"disable",options:[{label:Ao("Enable"),value:"enable"},{label:Ao("Disable"),value:"disable"}],onChange:function(n){t.page=n,e.props.edit(t)}}),wp.element.createElement(Uo,{label:Ao("Number of rows per page"),help:Ao("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(Jo,{label:Ao("Disable Sort"),help:Ao("To disable sorting on columns."),value:t.sort?t.sort:"enable",options:[{label:Ao("Enable"),value:"enable"},{label:Ao("Disable"),value:"disable"}],onChange:function(n){t.sort=n,e.props.edit(t)}}),wp.element.createElement(Uo,{label:Ao("Freeze Columns"),help:Ao("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(Io,{label:Ao("Allow HTML"),help:Ao("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(Io,{label:Ao("Right to Left table"),help:Ao("Adds basic support for right-to-left languages."),checked:Number(t.rtlTable),onChange:function(n){t.rtlTable=!Number(t.rtlTable),e.props.edit(t)}})))}}])&&Co(n.prototype,r),a&&Co(n,a),t}(Fo);function Vo(e){return(Vo="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 Go(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 $o(e,t){return!t||"object"!==Vo(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 Ko(e){return(Ko=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Zo(e,t){return(Zo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Qo=wp.i18n.__,Xo=wp.element,es=Xo.Component,ts=Xo.Fragment,ns=(wp.blockEditor||wp.editor).ColorPalette,rs=wp.components,as=rs.BaseControl,is=rs.PanelBody,os=rs.TextControl,ss=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),$o(this,Ko(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&&Zo(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"],this.props.chart["visualizer-chart-library"]);return wp.element.createElement(is,{title:Qo("Row/Cell Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},"DataTable"===n?wp.element.createElement(ts,null,wp.element.createElement(is,{title:Qo("Odd Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(as,{label:Qo("Background Color")},wp.element.createElement(ns,{value:t.customcss.oddTableRow["background-color"],onChange:function(n){t.customcss.oddTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(as,{label:Qo("Color")},wp.element.createElement(ns,{value:t.customcss.oddTableRow.color,onChange:function(n){t.customcss.oddTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(os,{label:Qo("Text Orientation"),help:Qo("In degrees."),type:"number",value:t.customcss.oddTableRow.transform,onChange:function(n){t.customcss.oddTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(is,{title:Qo("Even Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(as,{label:Qo("Background Color")},wp.element.createElement(ns,{value:t.customcss.evenTableRow["background-color"],onChange:function(n){t.customcss.evenTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(as,{label:Qo("Color")},wp.element.createElement(ns,{value:t.customcss.evenTableRow.color,onChange:function(n){t.customcss.evenTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(os,{label:Qo("Text Orientation"),help:Qo("In degrees."),type:"number",value:t.customcss.evenTableRow.transform,onChange:function(n){t.customcss.evenTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(is,{title:Qo("Table Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(as,{label:Qo("Background Color")},wp.element.createElement(ns,{value:t.customcss.tableCell["background-color"],onChange:function(n){t.customcss.tableCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(as,{label:Qo("Color")},wp.element.createElement(ns,{value:t.customcss.tableCell.color,onChange:function(n){t.customcss.tableCell.color=n,e.props.edit(t)}})),wp.element.createElement(os,{label:Qo("Text Orientation"),help:Qo("In degrees."),type:"number",value:t.customcss.tableCell.transform,onChange:function(n){t.customcss.tableCell.transform=n,e.props.edit(t)}}))):wp.element.createElement(ts,null,wp.element.createElement(is,{title:Qo("Header Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(as,{label:Qo("Background Color")},wp.element.createElement(ns,{value:t.customcss.headerRow["background-color"],onChange:function(n){t.customcss.headerRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(as,{label:Qo("Color")},wp.element.createElement(ns,{value:t.customcss.headerRow.color,onChange:function(n){t.customcss.headerRow.color=n,e.props.edit(t)}})),wp.element.createElement(os,{label:Qo("Text Orientation"),help:Qo("In degrees."),type:"number",value:t.customcss.headerRow.transform,onChange:function(n){t.customcss.headerRow.transform=n,e.props.edit(t)}})),wp.element.createElement(is,{title:Qo("Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(as,{label:Qo("Background Color")},wp.element.createElement(ns,{value:t.customcss.tableRow["background-color"],onChange:function(n){t.customcss.tableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(as,{label:Qo("Color")},wp.element.createElement(ns,{value:t.customcss.tableRow.color,onChange:function(n){t.customcss.tableRow.color=n,e.props.edit(t)}})),wp.element.createElement(os,{label:Qo("Text Orientation"),help:Qo("In degrees."),type:"number",value:t.customcss.tableRow.transform,onChange:function(n){t.customcss.tableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(is,{title:Qo("Odd Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(as,{label:Qo("Background Color")},wp.element.createElement(ns,{value:t.customcss.oddTableRow["background-color"],onChange:function(n){t.customcss.oddTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(as,{label:Qo("Color")},wp.element.createElement(ns,{value:t.customcss.oddTableRow.color,onChange:function(n){t.customcss.oddTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(os,{label:Qo("Text Orientation"),help:Qo("In degrees."),type:"number",value:t.customcss.oddTableRow.transform,onChange:function(n){t.customcss.oddTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(is,{title:Qo("Selected Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(as,{label:Qo("Background Color")},wp.element.createElement(ns,{value:t.customcss.selectedTableRow["background-color"],onChange:function(n){t.customcss.selectedTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(as,{label:Qo("Color")},wp.element.createElement(ns,{value:t.customcss.selectedTableRow.color,onChange:function(n){t.customcss.selectedTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(os,{label:Qo("Text Orientation"),help:Qo("In degrees."),type:"number",value:t.customcss.selectedTableRow.transform,onChange:function(n){t.customcss.selectedTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(is,{title:Qo("Hover Table Row"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(as,{label:Qo("Background Color")},wp.element.createElement(ns,{value:t.customcss.hoverTableRow["background-color"],onChange:function(n){t.customcss.hoverTableRow["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(as,{label:Qo("Color")},wp.element.createElement(ns,{value:t.customcss.hoverTableRow.color,onChange:function(n){t.customcss.hoverTableRow.color=n,e.props.edit(t)}})),wp.element.createElement(os,{label:Qo("Text Orientation"),help:Qo("In degrees."),type:"number",value:t.customcss.hoverTableRow.transform,onChange:function(n){t.customcss.hoverTableRow.transform=n,e.props.edit(t)}})),wp.element.createElement(is,{title:Qo("Header Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(as,{label:Qo("Background Color")},wp.element.createElement(ns,{value:t.customcss.headerCell["background-color"],onChange:function(n){t.customcss.headerCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(as,{label:Qo("Color")},wp.element.createElement(ns,{value:t.customcss.headerCell.color,onChange:function(n){t.customcss.headerCell.color=n,e.props.edit(t)}})),wp.element.createElement(os,{label:Qo("Text Orientation"),help:Qo("In degrees."),type:"number",value:t.customcss.headerCell.transform,onChange:function(n){t.customcss.headerCell.transform=n,e.props.edit(t)}})),wp.element.createElement(is,{title:Qo("Table Cell"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(as,{label:Qo("Background Color")},wp.element.createElement(ns,{value:t.customcss.tableCell["background-color"],onChange:function(n){t.customcss.tableCell["background-color"]=n,e.props.edit(t)}})),wp.element.createElement(as,{label:Qo("Color")},wp.element.createElement(ns,{value:t.customcss.tableCell.color,onChange:function(n){t.customcss.tableCell.color=n,e.props.edit(t)}})),wp.element.createElement(os,{label:Qo("Text Orientation"),help:Qo("In degrees."),type:"number",value:t.customcss.tableCell.transform,onChange:function(n){t.customcss.tableCell.transform=n,e.props.edit(t)}}))))}}])&&Go(n.prototype,r),a&&Go(n,a),t}(es);function ls(e){return(ls="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 us(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 cs(e,t){return!t||"object"!==ls(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 ds(e){return(ds=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ms(e,t){return(ms=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ps=wp.i18n.__,hs=wp.element.Component,fs=wp.components,_s=fs.PanelBody,ys=fs.SelectControl,gs=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),cs(this,ds(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&&ms(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(_s,{title:ps("Combo Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(ys,{label:ps("Chart Type"),help:ps("Select the default chart type."),value:t.seriesType?t.seriesType:"area",options:[{label:ps("Area"),value:"area"},{label:ps("Bar"),value:"bars"},{label:ps("Candlesticks"),value:"candlesticks"},{label:ps("Line"),value:"line"},{label:ps("Stepped Area"),value:"steppedArea"}],onChange:function(n){t.seriesType=n,e.props.edit(t)}}))}}])&&us(n.prototype,r),a&&us(n,a),t}(hs);function bs(e){return(bs="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 vs(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"!==bs(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 Ms(e){return(Ms=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ks(e,t){return(ks=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ls=wp.i18n.__,Ys=wp.element,Ds=Ys.Component,Ts=Ys.Fragment,Ss=(wp.blockEditor||wp.editor).ColorPalette,Os=wp.components,js=Os.BaseControl,xs=Os.ExternalLink,Es=Os.PanelBody,Cs=Os.SelectControl,Ps=Os.TextControl,Hs=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,Ms(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&&ks(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(Es,{title:Ls("Series Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(n.series).map((function(a,i){var o=parseInt(a);return"tabular"!==t&&(o=i),a++,wp.element.createElement(Es,{title:r[a].label,className:"visualizer-inner-sections",initialOpen:!1},-1>=["tabular","pie"].indexOf(t)&&wp.element.createElement(Cs,{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>=["tabular","candlestick","combo","column","bar"].indexOf(t)&&wp.element.createElement(Ts,null,wp.element.createElement(Ps,{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(Ps,{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(Ts,null,wp.element.createElement(Ps,{label:Ls("Format"),help:Ls("Enter custom format pattern to apply to this series value."),value:n.series[o].format,onChange:function(t){n.series[o].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(xs,{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."))):0<=["date","datetime","timeofday"].indexOf(r[a].type)&&wp.element.createElement(Ts,null,wp.element.createElement(Ps,{label:Ls("Date Format"),help:Ls("Enter custom format pattern to apply to this series value."),placeholder:"dd LLLL yyyy",value:n.series[o].format,onChange:function(t){n.series[o].format=t,e.props.edit(n)}}),wp.element.createElement("p",null,Ls("This is a subset of the date formatting "),wp.element.createElement(xs,{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(Cs,{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(Ps,{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(Cs,{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>=["tabular"].indexOf(t)&&wp.element.createElement(js,{label:Ls("Color")},wp.element.createElement(Ss,{value:n.series[i].color,onChange:function(t){n.series[i].color=t,e.props.edit(n)}})))})))}}])&&vs(n.prototype,r),a&&vs(n,a),t}(Ds);function zs(e){return(zs="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 Ns(e,t){return!t||"object"!==zs(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 Rs(e,t){return(Rs=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ws=wp.i18n.__,Is=wp.element.Component,Bs=(wp.blockEditor||wp.editor).ColorPalette,Js=wp.components,Us=Js.BaseControl,qs=Js.PanelBody,Vs=Js.TextControl,Gs=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Ns(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&&Rs(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(qs,{title:Ws("Slices Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(t.slices).map((function(r){return wp.element.createElement(qs,{title:n[r][0],className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Vs,{label:Ws("Slice Offset"),help:Ws("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(Us,{label:Ws("Format")},wp.element.createElement(Bs,{value:t.slices[r].color,onChange:function(n){t.slices[r].color=n,e.props.edit(t)}})))})))}}])&&As(n.prototype,r),a&&As(n,a),t}(Is);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.i18n.__,tl=wp.element.Component,nl=(wp.blockEditor||wp.editor).ColorPalette,rl=wp.components,al=rl.CheckboxControl,il=rl.BaseControl,ol=rl.PanelBody,sl=rl.TextControl,ll=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:"componentDidMount",value:function(){}},{key:"render",value:function(){var e=this,t=this.props.chart["visualizer-settings"];return wp.element.createElement(ol,{title:el("Bubble Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(sl,{label:el("Opacity"),help:el("The default opacity of the bubbles, where 0.0 is fully transparent and 1.0 is fully opaque."),type:"number",min:"0",max:"1",step:"0.1",value:t.bubble.opacity,onChange:function(n){t.bubble||(t.bubble={}),t.bubble.opacity=n,e.props.edit(t)}}),wp.element.createElement(il,{label:el("Stroke Color")},wp.element.createElement(nl,{value:t.bubble.stroke,onChange:function(n){t.bubble||(t.bubble={}),t.bubble.stroke=n,e.props.edit(t)}})),wp.element.createElement(al,{label:el("Sort Bubbles by Size"),help:el("If checked, sorts the bubbles by size so the smaller bubbles appear above the larger bubbles. If unchecked, bubbles are sorted according to their order in the table."),checked:K(t,"sortBubblesBySize"),onChange:function(n){t.sortBubblesBySize=n,e.props.edit(t)}}),wp.element.createElement(sl,{label:el("Size (max)"),help:el("The size value (as appears in the chart data) to be mapped to sizeAxis.maxSize. Larger values will be cropped to this value."),type:"number",step:"1",value:t.sizeAxis.maxValue,onChange:function(n){t.sizeAxis||(t.sizeAxis={}),t.sizeAxis.maxValue=n,e.props.edit(t)}}),wp.element.createElement(sl,{label:el("Size (min)"),help:el("The size value (as appears in the chart data) to be mapped to sizeAxis.minSize. Smaller values will be cropped to this value."),type:"number",step:"1",value:t.sizeAxis.minValue,onChange:function(n){t.sizeAxis||(t.sizeAxis={}),t.sizeAxis.minValue=n,e.props.edit(t)}}))}}])&&Ks(n.prototype,r),a&&Ks(n,a),t}(tl);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 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 dl(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 ml(e){return(ml=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function pl(e,t){return(pl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var hl=wp.i18n.__,fl=wp.element,_l=fl.Component,yl=fl.Fragment,gl=wp.components,bl=gl.ExternalLink,vl=gl.PanelBody,wl=gl.TextControl,Ml=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),dl(this,ml(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&&pl(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){var e=this.props.chart["visualizer-settings"];e.series&&(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 this.props.chart["visualizer-chart-type"],t.series?wp.element.createElement(vl,{title:hl("Column Settings"),initialOpen:!1,className:"visualizer-advanced-panel"},Object.keys(t.series).map((function(r){return"string"===n[r].type?null:wp.element.createElement(vl,{title:n[r].label,className:"visualizer-inner-sections",initialOpen:!1},0<=["date","datetime","timeofday"].indexOf(n[r].type)&&wp.element.createElement(yl,null,wp.element.createElement(wl,{label:hl("Display Date Format"),help:hl("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(wl,{label:hl("Source Date Format"),help:hl("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,hl("You can find more info on "),wp.element.createElement(bl,{href:"https://momentjs.com/docs/#/displaying/"},hl("date and time formats here.")))),"number"===n[r].type&&wp.element.createElement(yl,null,wp.element.createElement(wl,{label:hl("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(wl,{label:hl("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(wl,{label:hl("Precision"),help:hl("Round values to how many decimal places?"),value:t.series[r].format?t.series[r].format.precision:"",type:"number",min:"0",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(wl,{label:hl("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(wl,{label:hl("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)}})),"boolean"===n[r].type&&wp.element.createElement(yl,null,wp.element.createElement(wl,{label:hl("Truthy value"),help:hl("Provide the HTML entity code for the value the table should display when the value of the column is true. e.g. tick mark (Code: &#10004;) instead of true"),value:t.series[r].format?t.series[r].format.truthy:"",onChange:function(n){t.series[r].truthy||(t.series[r].truthy={}),t.series[r].format.truthy=n,e.props.edit(t)}}),wp.element.createElement(wl,{label:hl("Falsy value"),help:hl("Provide the HTML entity code for the value the table should display when the value of the column is false. e.g. cross mark (Code: &#10006;) instead of false"),value:t.series[r].format?t.series[r].format.falsy:"",onChange:function(n){t.series[r].falsy||(t.series[r].falsy={}),t.series[r].format.falsy=n,e.props.edit(t)}})))}))):null}}])&&cl(n.prototype,r),a&&cl(n,a),t}(_l);function kl(e){return(kl="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 Ll(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 Yl(e,t){return!t||"object"!==kl(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 Dl(e){return(Dl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Tl(e,t){return(Tl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Sl=wp.i18n.__,Ol=wp.element,jl=Ol.Component,xl=Ol.Fragment,El=(wp.blockEditor||wp.editor).ColorPalette,Cl=wp.components,Pl=Cl.BaseControl,Hl=Cl.CheckboxControl,zl=Cl.PanelBody,Al=Cl.SelectControl,Nl=Cl.TextControl,Fl=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Yl(this,Dl(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&&Tl(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(zl,{title:Sl("Layout And Chart Area"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement(zl,{title:Sl("Layout"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Nl,{label:Sl("Width of Chart"),help:Sl("Determines the total width of the chart."),value:n.width,onChange:function(t){n.width=t,e.props.edit(n)}}),wp.element.createElement(Nl,{label:Sl("Height of Chart"),help:Sl("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(Al,{label:Sl("Keep Aspect Ratio"),help:Sl("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:Sl("Yes"),value:"1"},{label:Sl("No"),value:"0"}],onChange:function(t){n.keepAspectRatio=t,e.props.edit(n)}}),-1>=["gauge"].indexOf(t)&&wp.element.createElement(xl,null,wp.element.createElement(Nl,{label:Sl("Stroke Width"),help:Sl("The chart border width in pixels."),value:n.backgroundColor.strokeWidth,onChange:function(t){n.backgroundColor.strokeWidth=t,e.props.edit(n)}}),wp.element.createElement(Pl,{label:Sl("Stroke Color")},wp.element.createElement(El,{value:n.backgroundColor.stroke,onChange:function(t){n.backgroundColor.stroke=t,e.props.edit(n)}})),wp.element.createElement(Pl,{label:Sl("Background Color")},wp.element.createElement(El,{value:n.backgroundColor.fill,onChange:function(t){n.backgroundColor.fill=t,e.props.edit(n)}})),wp.element.createElement(Hl,{label:Sl("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(zl,{title:Sl("Chart Area"),className:"visualizer-inner-sections",initialOpen:!1},wp.element.createElement(Nl,{label:Sl("Left Margin"),help:Sl("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(Nl,{label:Sl("Top Margin"),help:Sl("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(Nl,{label:Sl("Width Of Chart Area"),help:Sl("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(Nl,{label:Sl("Height Of Chart Area"),help:Sl("Determines the hight of the chart area."),value:n.chartArea.height,onChange:function(t){n.chartArea.height=t,e.props.edit(n)}})))}}])&&Ll(n.prototype,r),a&&Ll(n,a),t}(jl);function Rl(e){return(Rl="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 Wl(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 Il(e,t){return!t||"object"!==Rl(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 Bl(e){return(Bl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Jl(e,t){return(Jl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ul=wp.i18n.__,ql=wp.element,Vl=ql.Component,Gl=ql.Fragment,$l=wp.components,Kl=$l.CheckboxControl,Zl=$l.PanelBody,Ql=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Il(this,Bl(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&&Jl(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"],n=this.props.chart["visualizer-chart-type"];return wp.element.createElement(Zl,{title:Ul("Frontend Actions"),initialOpen:!1,className:"visualizer-advanced-panel"},void 0!==t.actions&&wp.element.createElement(Gl,null,wp.element.createElement(Kl,{label:Ul("Print"),help:Ul("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(Kl,{label:Ul("CSV"),help:Ul("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(Kl,{label:Ul("Excel"),help:Ul("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(Kl,{label:Ul("Copy"),help:Ul("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)}}),-1>=["dataTable","tabular","gauge","table"].indexOf(n)&&wp.element.createElement(Kl,{label:Ul("Download Image"),help:Ul("To download the chart as an image."),checked:0<=t.actions.indexOf("image"),onChange:function(n){if(0<=t.actions.indexOf("image")){var r=t.actions.indexOf("image");-1!==r&&t.actions.splice(r,1)}else t.actions.push("image");e.props.edit(t)}})))}}])&&Wl(n.prototype,r),a&&Wl(n,a),t}(Vl);function Xl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eu(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){Xl(e,t,n[t])}))}return e}var tu={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"}},nu=n(2);const ru={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&&ru.throwError(ru.getCaller(2),e)},isFalsy:(e="<unknown parameter>",t)=>{t||ru.throwError(ru.getCaller(2),e)},isNoneOf:(e="<unknown parameter>",t,n=[])=>{-1===n.indexOf(t)&&ru.throwError(ru.getCaller(2),e,"to be any of"+JSON.stringify(n))},isAnyOf:(e="<unknown parameter>",t,n=[])=>{n.indexOf(t)>-1&&ru.throwError(ru.getCaller(2),e,"not to be any of"+JSON.stringify(n))},isNotType:(e="<unknown parameter>",t,n="")=>{Object(nu.getType)(t)!==n.toLowerCase()&&ru.throwError(ru.getCaller(2),e,"to be type "+n.toLowerCase())},isAnyTypeOf:(e="<unknown parameter>",t,n=[])=>{n.forEach(n=>{Object(nu.getType)(t)===n&&ru.throwError(ru.getCaller(2),e,"not to be type of "+n.toLowerCase())})},missingKey:(e="<unknown parameter>",t,n="")=>{ru.isUndefined(e,t),-1===Object.keys(t).indexOf(n)&&ru.throwError(ru.getCaller(2),e,"to contain '"+n+"' key")},missingAnyKeys:(e="<unknown parameter>",t,n=[""])=>{ru.isUndefined(e,t);const r=Object.keys(t);n.forEach(t=>{-1===r.indexOf(t)&&ru.throwError(ru.getCaller(2),e,"to contain '"+t+"' key")})},containsUndefined:(e="<unknown parameter>",t)=>{[void 0,null].forEach(n=>{const r=Object(nu.locate)(t,n);r&&ru.throwError(ru.getCaller(2),e,"not to contain '"+JSON.stringify(n)+"' at "+r)})},isInvalidPath:(e="<unknown parameter>",t)=>{ru.isUndefined(e,t),ru.isNotType(e,t,"string"),ru.isAnyOf(e,t,["","/"]),".$[]#".split().forEach(n=>{t.indexOf(n)>-1&&ru.throwError(ru.getCaller(2),e,"not to contain invalid character '"+n+"'")}),t.match(/\/{2,}/g)&&ru.throwError(ru.getCaller(2),e,"not to contain consecutive forward slash characters")},isInvalidWriteData:(e="<unknown parameter>",t)=>{ru.isUndefined(e,t),ru.containsUndefined(e,t)}};var au=ru;const iu=(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 ou={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 su 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=tu.dark_vscode_tribute;"theme"in this.props&&"string"==typeof this.props.theme&&this.props.theme in tu&&(n=tu[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:eu({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:eu({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:eu({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:eu({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:eu({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:eu({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||ou,t=this.state.error,n=this.style;if(t)return a.a.createElement("p",{style:eu({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)},iu(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:eu({},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(nu.getType)(e);-1===["object","array"].indexOf(a)&&au.throwError("showPlaceholder","placeholder","either an object or an array");let i=!Object(nu.identical)(e,t);if(i||r&&void 0!==n&&(i=!Object(nu.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||ou,n=this.newSpan;if("nodeType"in e){const M=e.cloneNode(!0);if(!M.hasChildNodes())return"";const k=M.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,iu(t.invalidToken.tokenSequence.prohibited,{firstToken:L.tokens_merge[i].string,secondToken:n}));break}if("["===n&&r>0&&!m(r,[":","[",","])){c(r,iu(t.invalidToken.tokenSequence.permitted,{firstToken:"[",secondToken:[":","[",","]}));break}if("{"===n&&m(r,["{"])){c(r,iu(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,iu(t.brace.curly.missingOpen));break}if("}"===n&&m(r,[","])){c(r,iu(t.invalidToken.tokenSequence.prohibited,{firstToken:",",secondToken:"}"}));break}if("]"===n&&"["!==Y.brackets[Y.brackets.length-1]){c(r,iu(t.brace.square.missingOpen));break}if("]"===n&&m(r,[":"])){c(r,iu(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,iu(t.brace.curly.cannotWrap,{token:","}));break}c(r,iu(t.invalidToken.tokenSequence.prohibited,{firstToken:"{",secondToken:","}));break}if(d(r,["}",",","]"])){c(r,iu(t.noTrailingOrLeadingComma));break}switch(i=p(r)){case"key":case"colon":c(r,iu(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,iu(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,iu(t.brace.square.cannotWrap,{token:":"}));break}if(i){c(r,iu(t.invalidToken.tokenSequence.prohibited,{firstToken:"[",secondToken:":"}));break}if("key"!==p(r)){c(r,iu(t.invalidToken.termSequence.permitted,{firstTerm:t.symbols.colon,secondTerm:t.types.key}));break}if(d(r,["}","]"])){c(r,iu(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,iu(t.string.missingOpen,{quote:e}));break}if(-1===D.indexOf(o)&&-1!==D.indexOf(e)){c(r,iu(t.string.missingClose,{quote:e}));break}if(D.indexOf(e)>-1&&e!==o){c(r,iu(t.string.missingClose,{quote:e}));break}if("string"===a&&-1===D.indexOf(e)&&-1===D.indexOf(o)){c(r,iu(t.string.mustBeWrappedByQuotes));break}if("key"===a&&d(r,["}","]"])&&c(r,iu(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,iu(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,iu(t.key.numberAndLetterMissingQuotes));break}c(r,iu(t.key.spaceMissingQuotes));break}if("key"===a&&!m(r,["{",","])){c(r,iu(t.invalidToken.tokenSequence.permitted,{firstToken:a,secondToken:["{",","]}));break}if("string"===a&&!m(r,["[",":",","])){c(r,iu(t.invalidToken.tokenSequence.permitted,{firstToken:a,secondToken:["[",":",","]}));break}if("key"===a&&Y.isValue){c(r,iu(t.string.unexpectedKey));break}if("string"===a&&!Y.isValue){c(r,iu(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,iu(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,iu(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 f(e){S.splice(e+1,1),S.splice(e,1),r||(r=!0)}for(;S.length>0;){r=!1;for(var _=0;_<S.length-1;_++){const e=S[_].string+S[_+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,iu(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,iu(t.invalidToken.unexpected,{token:"\\"})),h=0)}l||c(s,iu(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&&((w=this.props.modifyErrorText)&&"[object Function]"==={}.toString.call(w)&&(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 w;if(!("nodeType"in e)){let t={inputText:JSON.stringify(e),position:0,currentChar:"",tokenPrimary:"",tokenSecondary:"",brackets:[],isValue:!1,stringOpen:!1,stringStart:0,tokens:[]};function M(){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=M();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 lu=su,uu=n(133),cu=n.n(uu);function du(e){return(du="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 mu(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 pu(e){return(pu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function hu(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 _u=wp.i18n.__,yu=wp.element.Component,gu=wp.components,bu=gu.ExternalLink,vu=gu.PanelBody,wu=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"!==du(t)&&"function"!=typeof t?hu(e):t}(this,pu(t).apply(this,arguments))).isValidJSON=e.isValidJSON.bind(hu(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&&fu(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","tabular","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(vu,{title:_u("Manual Configuration"),initialOpen:!1,className:"visualizer-advanced-panel"},wp.element.createElement("p",null,_u("Configure the graph by providing configuration variables right from the Google Visualization API.")),wp.element.createElement("p",null,wp.element.createElement(bu,{href:"https://developers.google.com/chart/interactive/docs/gallery/".concat(e,"#configuration-options")},_u("Google Visualization API"))),wp.element.createElement(lu,{locale:cu.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))}}))}}])&&mu(n.prototype,r),a&&mu(n,a),t}(yu);function Mu(e){return(Mu="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 ku(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 Lu(e,t){return!t||"object"!==Mu(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 Yu(e){return(Yu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Du(e,t){return(Du=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Tu=wp.element,Su=Tu.Component,Ou=Tu.Fragment,ju=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Lu(this,Yu(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&&Du(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this.props.chart["visualizer-chart-type"],t=this.props.chart["visualizer-chart-library"];return wp.element.createElement(Ou,null,wp.element.createElement(sr,{chart:this.props.chart,attributes:this.props.attributes,edit:this.props.edit}),wp.element.createElement($n,{chart:this.props.chart,edit:this.props.edit}),-1>=["tabular","dataTable","gauge","geo","pie","timeline"].indexOf(e)&&wp.element.createElement(Lr,{chart:this.props.chart,edit:this.props.edit}),-1>=["tabular","dataTable","gauge","geo","pie","timeline"].indexOf(e)&&wp.element.createElement(Wr,{chart:this.props.chart,edit:this.props.edit}),0<=["pie"].indexOf(e)&&wp.element.createElement(Ou,null,wp.element.createElement(aa,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(ya,{chart:this.props.chart,edit:this.props.edit})),0<=["area","scatter","line"].indexOf(e)&&wp.element.createElement(xa,{chart:this.props.chart,edit:this.props.edit}),0<=["bar","column"].indexOf(e)&&wp.element.createElement(Ba,{chart:this.props.chart,edit:this.props.edit}),0<=["candlestick"].indexOf(e)&&wp.element.createElement(ri,{chart:this.props.chart,edit:this.props.edit}),0<=["geo"].indexOf(e)&&wp.element.createElement(Ou,null,wp.element.createElement(_i,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(Oi,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(Bi,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(to,{chart:this.props.chart,edit:this.props.edit})),0<=["gauge"].indexOf(e)&&wp.element.createElement(go,{chart:this.props.chart,edit:this.props.edit}),0<=["timeline"].indexOf(e)&&wp.element.createElement(xo,{chart:this.props.chart,edit:this.props.edit}),0<=["tabular","dataTable"].indexOf(e)&&wp.element.createElement(Ou,null,wp.element.createElement(qo,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(ss,{chart:this.props.chart,edit:this.props.edit})),0<=["combo"].indexOf(e)&&wp.element.createElement(gs,{chart:this.props.chart,edit:this.props.edit}),-1>=["timeline","bubble","gauge","geo","pie","tabular","dataTable"].indexOf(e)&&wp.element.createElement(Hs,{chart:this.props.chart,edit:this.props.edit}),"tabular"===e&&"GoogleCharts"===t&&wp.element.createElement(Hs,{chart:this.props.chart,edit:this.props.edit}),0<=["bubble"].indexOf(e)&&wp.element.createElement(ll,{chart:this.props.chart,edit:this.props.edit}),0<=["pie"].indexOf(e)&&wp.element.createElement(Gs,{chart:this.props.chart,edit:this.props.edit}),"DataTable"===t&&wp.element.createElement(Ml,{chart:this.props.chart,edit:this.props.edit}),"DataTable"!==t&&wp.element.createElement(Fl,{chart:this.props.chart,edit:this.props.edit}),wp.element.createElement(Ql,{chart:this.props.chart,edit:this.props.edit}),"DataTable"!==t&&wp.element.createElement(wu,{chart:this.props.chart,edit:this.props.edit}))}}])&&ku(n.prototype,r),a&&ku(n,a),t}(Su);function xu(e){return(xu="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 Eu(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 Cu(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){Eu(i,r,a,o,s,"next",e)}function s(e){Eu(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 zu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Au(e,t){return(Au=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Nu=wp.i18n.__,Fu=wp.apiFetch,Ru=wp.element,Wu=Ru.Component,Iu=Ru.Fragment,Bu=wp.components,Ju=Bu.Button,Uu=Bu.PanelBody,qu=Bu.SelectControl,Vu=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"!==xu(t)&&"function"!=typeof t?zu(e):t}(this,Hu(t).apply(this,arguments))).getPermissionData=e.getPermissionData.bind(zu(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&&Au(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:(o=Cu(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,Fu({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,Fu({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=Cu(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,Fu({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,Fu({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=this,t=this.props.chart["visualizer-permissions"];return wp.element.createElement(Iu,null,"business"===visualizerLocalize.isPro?wp.element.createElement(Uu,{title:Nu("Who can see this chart?"),initialOpen:!1},wp.element.createElement(qu,{label:Nu("Select who can view the chart on the front-end."),value:t.permissions.read,options:[{value:"all",label:"All Users"},{value:"users",label:"Select Users"},{value:"roles",label:"Select Roles"}],onChange:function(n){t.permissions.read=n,e.props.edit(t),"users"!==n&&"roles"!==n||e.getPermissionData(n)}}),("users"===t.permissions.read||"roles"===t.permissions.read)&&wp.element.createElement(qu,{multiple:!0,value:t.permissions["read-specific"],options:"users"===t.permissions.read&&this.state.users||"roles"===t.permissions.read&&this.state.roles,onChange:function(n){t.permissions["read-specific"]=n,e.props.edit(t)}})):wp.element.createElement(Uu,{title:Nu("Who can see this chart?"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,Nu("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(Ju,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},Nu("Buy Now"))),"business"===visualizerLocalize.isPro?wp.element.createElement(Uu,{title:Nu("Who can edit this chart?"),initialOpen:!1},wp.element.createElement(qu,{label:Nu("Select who can edit the chart on the front-end."),value:t.permissions.edit,options:[{value:"all",label:"All Users"},{value:"users",label:"Select Users"},{value:"roles",label:"Select Roles"}],onChange:function(n){t.permissions.edit=n,e.props.edit(t),"users"!==n&&"roles"!==n||e.getPermissionData(n)}}),("users"===t.permissions.edit||"roles"===t.permissions.edit)&&wp.element.createElement(qu,{multiple:!0,value:t.permissions["edit-specific"],options:"users"===t.permissions.edit&&this.state.users||"roles"===t.permissions.edit&&this.state.roles,onChange:function(n){t.permissions["edit-specific"]=n,e.props.edit(t)}})):wp.element.createElement(Uu,{title:Nu("Who can edit this chart?"),icon:"lock",initialOpen:!1},wp.element.createElement("p",null,Nu("Upgrade your license to at least the DEVELOPER version to activate this feature!")),wp.element.createElement(Ju,{isPrimary:!0,href:visualizerLocalize.proTeaser,target:"_blank"},Nu("Buy Now"))))}}])&&Pu(n.prototype,r),a&&Pu(n,a),t}(Wu),Gu=n(134),$u=n.n(Gu),Ku=wp.components,Zu=Ku.Button,Qu=Ku.Dashicon,Xu=Ku.G,ec=Ku.Path,tc=Ku.SVG;var nc=function(e){var t=e.label,n=e.icon,r=e.className,a=e.isBack,i=e.onClick,o=$u()("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(Zu,{className:"components-panel__body-toggle",onClick:i},wp.element.createElement(tc,{className:"components-panel__arrow",width:"24px",height:"24px",viewBox:"-12 -12 48 48",xmlns:"http://www.w3.org/2000/svg"},wp.element.createElement(Xu,null,wp.element.createElement(ec,{fill:"none",d:"M0,0h24v24H0V0z"})),wp.element.createElement(Xu,null,wp.element.createElement(ec,{d:"M7.41,8.59L12,13.17l4.59-4.58L18,10l-6,6l-6-6L7.41,8.59z"}))),n&&wp.element.createElement(Qu,{icon:n,className:"components-panel__icon"}),t)))},rc=n(3),ac=n.n(rc);function ic(e){return(ic="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 oc(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 sc(e,t){return!t||"object"!==ic(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 lc(e){return(lc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function uc(e,t){return(uc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var cc=lodash.startCase,dc=wp.i18n.__,mc=wp.element,pc=mc.Component,hc=mc.Fragment,fc=(wp.blockEditor||wp.editor).InspectorControls,_c=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=sc(this,lc(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&&uc(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 0<=["gauge","tabular","timeline"].indexOf(this.props.chart["visualizer-chart-type"])?"DataTable"===r["visualizer-chart-library"]?e=r["visualizer-chart-type"]:("tabular"===(e=this.props.chart["visualizer-chart-type"])&&(e="table"),e=cc(e)):e="".concat(cc(this.props.chart["visualizer-chart-type"]),"Chart"),r["visualizer-data-exploded"]&&(t=dc("Annotations in this chart may not display here but they will display in the front end.")),wp.element.createElement(hc,null,"home"===this.state.route&&wp.element.createElement(fc,null,wp.element.createElement(Ee,{chart:this.props.chart,readUploadedFile:this.props.readUploadedFile}),wp.element.createElement(ft,{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(Ct,{getChartData:this.props.getChartData,isLoading:this.props.isLoading}),wp.element.createElement(ln,{chart:this.props.chart,editSchedule:this.props.editDatabaseSchedule,databaseImportData:this.props.databaseImportData}),wp.element.createElement(Pn,{chart:this.props.chart,editChartData:this.props.editChartData}),wp.element.createElement(nc,{label:dc("Advanced Options"),className:"visualizer-advanced-options",icon:"admin-tools",onClick:function(){return n.setState({route:"showAdvanced"})}}),wp.element.createElement(nc,{label:dc("Chart Permissions"),icon:"admin-users",onClick:function(){return n.setState({route:"showPermissions"})}})),("showAdvanced"===this.state.route||"showPermissions"===this.state.route)&&wp.element.createElement(fc,null,wp.element.createElement(nc,{label:dc("Chart Settings"),onClick:function(){return n.setState({route:"home"})},isBack:!0}),"showAdvanced"===this.state.route&&wp.element.createElement(ju,{chart:this.props.chart,attributes:this.props.attributes,edit:this.props.editSettings}),"showPermissions"===this.state.route&&wp.element.createElement(Vu,{chart:this.props.chart,edit:this.props.editPermissions})),wp.element.createElement("div",{className:"visualizer-settings__chart"},null!==this.props.chart&&"DataTable"===r["visualizer-chart-library"]?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)?ac()(V(this.props.chart["visualizer-settings"]),JSON.parse(this.props.chart["visualizer-settings"].manual)):V(this.props.chart["visualizer-settings"]),height:"500px",formatters:Z(r)})),wp.element.createElement("div",{className:"visualizer-settings__charts-footer"},wp.element.createElement("sub",null,t))))}}])&&oc(n.prototype,r),a&&oc(n,a),t}(pc);function yc(e){return(yc="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 gc(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 bc(e,t){return!t||"object"!==yc(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 vc(e){return(vc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function wc(e,t){return(wc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Mc=lodash.startCase,kc=wp.i18n.__,Lc=wp.element,Yc=Lc.Component,Dc=Lc.Fragment,Tc=wp.components,Sc=Tc.Button,Oc=Tc.Dashicon,jc=Tc.Toolbar,xc=Tc.Tooltip,Ec=(wp.blockEditor||wp.editor).BlockControls,Cc=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),bc(this,vc(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&&wc(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e,t,n=U(JSON.parse(JSON.stringify(this.props.chart)));return 0<=["gauge","tabular","timeline"].indexOf(this.props.chart["visualizer-chart-type"])?"DataTable"===n["visualizer-chart-library"]?e=n["visualizer-chart-type"]:("tabular"===(e=this.props.chart["visualizer-chart-type"])&&(e="table"),e=Mc(e)):e="".concat(Mc(this.props.chart["visualizer-chart-type"]),"Chart"),n["visualizer-data-exploded"]&&(t=kc("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(Dc,null,wp.element.createElement(Ec,{key:"toolbar-controls"},wp.element.createElement(jc,{className:"components-toolbar"},wp.element.createElement(xc,{text:kc("Edit Chart")},wp.element.createElement(Sc,{className:"components-icon-button components-toolbar__control edit-pie-chart",onClick:this.props.editChart},wp.element.createElement(Oc,{icon:"edit"}))))),"DataTable"===n["visualizer-chart-library"]?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)?ac()(V(this.props.chart["visualizer-settings"]),JSON.parse(this.props.chart["visualizer-settings"].manual)):V(this.props.chart["visualizer-settings"]),height:"500px",formatters:Z(n)})),wp.element.createElement("div",{className:"visualizer-settings__charts-footer"},wp.element.createElement("sub",null,t))))}}])&&gc(n.prototype,r),a&&gc(n,a),t}(Yc);function Pc(e){return(Pc="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 Hc(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 zc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Hc(n,!0).forEach((function(t){Ac(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hc(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ac(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nc(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 Fc(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){Nc(i,r,a,o,s,"next",e)}function s(e){Nc(i,r,a,o,s,"throw",e)}o(void 0)}))}}function Rc(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 Wc(e){return(Wc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ic(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Bc(e,t){return(Bc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Jc=wp.i18n.__,Uc=wp,qc=Uc.apiFetch,Vc=Uc.apiRequest,Gc=wp.element,$c=Gc.Component,Kc=Gc.Fragment,Zc=wp.components,Qc=Zc.Button,Xc=Zc.ButtonGroup,ed=Zc.Dashicon,td=Zc.Placeholder,nd=Zc.Notice,rd=Zc.Spinner,ad=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"!==Pc(t)&&"function"!=typeof t?Ic(e):t}(this,Wc(t).apply(this,arguments))).getChart=e.getChart.bind(Ic(e)),e.editChart=e.editChart.bind(Ic(e)),e.editSettings=e.editSettings.bind(Ic(e)),e.editPermissions=e.editPermissions.bind(Ic(e)),e.readUploadedFile=e.readUploadedFile.bind(Ic(e)),e.editURL=e.editURL.bind(Ic(e)),e.editSchedule=e.editSchedule.bind(Ic(e)),e.editJSONSchedule=e.editJSONSchedule.bind(Ic(e)),e.editJSONURL=e.editJSONURL.bind(Ic(e)),e.editJSONHeaders=e.editJSONHeaders.bind(Ic(e)),e.editJSONRoot=e.editJSONRoot.bind(Ic(e)),e.editJSONPaging=e.editJSONPaging.bind(Ic(e)),e.JSONImportData=e.JSONImportData.bind(Ic(e)),e.editDatabaseSchedule=e.editDatabaseSchedule.bind(Ic(e)),e.databaseImportData=e.databaseImportData.bind(Ic(e)),e.uploadData=e.uploadData.bind(Ic(e)),e.getChartData=e.getChartData.bind(Ic(e)),e.editChartData=e.editChartData.bind(Ic(e)),e.updateChart=e.updateChart.bind(Ic(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&&Bc(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:(s=Fc(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,qc({path:"wp/v2/visualizer/".concat(this.props.attributes.id)}).catch((function(e){}));case 3:(t=e.sent)?this.setState({chart:t.chart_data}):this.setState({route:"error"});case 5:case"end":return e.stop()}}),e,this)}))),function(){return s.apply(this,arguments)})},{key:"getChart",value:(o=Fc(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,qc({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",lazy:-1});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=zc({},this.state.chart);t["visualizer-settings"]=e,this.setState({chart:t,isModified:!0})}},{key:"editPermissions",value:function(e){var t=zc({},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=zc({},this.state.chart);t["visualizer-chart-url"]=e,this.setState({chart:t})}},{key:"editSchedule",value:function(e){var t=zc({},this.state.chart);t["visualizer-chart-schedule"]=e,this.setState({chart:t,isModified:!0})}},{key:"editJSONSchedule",value:function(e){var t=zc({},this.state.chart);t["visualizer-json-schedule"]=e,this.setState({chart:t,isModified:!0})}},{key:"editJSONURL",value:function(e){var t=zc({},this.state.chart);t["visualizer-json-url"]=e,this.setState({chart:t})}},{key:"editJSONHeaders",value:function(e){var t=zc({},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=zc({},this.state.chart);t["visualizer-json-root"]=e,this.setState({chart:t})}},{key:"editJSONPaging",value:function(e){var t=zc({},this.state.chart);t["visualizer-json-paging"]=e,this.setState({chart:t})}},{key:"JSONImportData",value:function(e,t,n){var r=zc({},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=zc({},this.state.chart);t["visualizer-db-schedule"]=e,this.setState({chart:t,isModified:!0})}},{key:"databaseImportData",value:function(e,t,n,r){var a=zc({},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}),Vc({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=zc({},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=Fc(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,qc({path:"wp/v2/visualizer/".concat(t)});case 4:n=e.sent,(r=zc({},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=zc({},this.state.chart),r=[],a=zc({},n["visualizer-settings"]),i=n["visualizer-chart-type"];e[0].map((function(t,n){r[n]={label:t,type:e[1][n]}})),e.splice(0,2);var o=r,s="series";switch(i){case"pie":o=e,s="slices",e.map((function(e,t){switch(r[1].type){case"number":e[1]=parseFloat(e[1])}}));break;case"tabular":e.map((function(e,t){r.map((function(t,n){switch(t.type){case"boolean":"string"==typeof e[n]&&(e[n]="true"===e[n])}}))}))}o.map((function(e,t){if("pie"===i||0!==t){var n="pie"!==i?t-1:t;Array.isArray(a[s])&&void 0===a[s][n]&&(a[s][n]={},a[s][n].temp=1)}})),Array.isArray(a[s])&&(a[s]=a[s].filter((function(e,t){return t<(-1>=["pie","tabular","dataTable"].indexOf(i)?o.length-1:o.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"),-1>=["bubble","timeline"].indexOf(t["visualizer-chart-type"])&&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})),Vc({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"error"===this.state.route?wp.element.createElement(nd,{status:"error",isDismissible:!1},wp.element.createElement(ed,{icon:"chart-pie"}),Jc("This chart is not available; it might have been deleted. Please delete this block and resubmit your chart.")):"renderChart"===this.state.route&&null!==this.state.chart?wp.element.createElement(Cc,{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(ed,{icon:"chart-pie"}),Jc("Visualizer")),"home"===this.state.route&&wp.element.createElement("div",{className:"visualizer-settings__content"},wp.element.createElement("div",{className:"visualizer-settings__content-description"},Jc("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"},Jc("Create a new chart")),wp.element.createElement("div",{className:"visualizer-settings__content-option-icon"},wp.element.createElement(ed,{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"},Jc("Display an existing chart")),wp.element.createElement("div",{className:"visualizer-settings__content-option-icon"},wp.element.createElement(ed,{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(td,null,wp.element.createElement(rd,null)),"showCharts"===this.state.route&&!1===this.state.isLoading&&wp.element.createElement(ve,{getChart:this.getChart}),"chartSelect"===this.state.route&&null!==this.state.chart&&wp.element.createElement(_c,{id:this.props.attributes.id,attributes:this.props.attributes,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(Xc,null,wp.element.createElement(Qc,{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})}},Jc("Back")),"chartSelect"===this.state.route&&wp.element.createElement(Kc,null,!1===this.state.isModified?wp.element.createElement(Qc,{isDefault:!0,isLarge:!0,className:"visualizer-bttn-done",onClick:function(){e.setState({route:"renderChart"}),e.props.setAttributes({route:"renderChart"})}},Jc("Done")):wp.element.createElement(Qc,{isPrimary:!0,isLarge:!0,className:"visualizer-bttn-save",isBusy:"updateChart"===this.state.isLoading,disabled:"updateChart"===this.state.isLoading,onClick:this.updateChart},Jc("Save"))))))}}])&&Rc(n.prototype,r),a&&Rc(n,a),t}($c),id=(n(153),wp.i18n.__),od=wp.blocks.registerBlockType;t.default=od("visualizer/chart",{title:id("Visualizer Chart"),description:id("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:[id("Visualizer"),id("Chart"),id("Google Charts")],attributes:{id:{type:"number"},lazy:{default:"-1",type:"string"},route:{type:"string"}},supports:{customClassName:!1},edit:ad,save:function(){return null}})}]);
classes/Visualizer/Gutenberg/src/Components/ChartPermissions.js CHANGED
@@ -64,11 +64,7 @@ class ChartPermissions extends Component {
64
 
65
  render() {
66
 
67
- let permissions;
68
-
69
- if ( 'business' === visualizerLocalize.isPro ) {
70
- permissions = this.props.chart['visualizer-permissions'];
71
- }
72
 
73
  return (
74
  <Fragment>
64
 
65
  render() {
66
 
67
+ let permissions = this.props.chart['visualizer-permissions'];
 
 
 
 
68
 
69
  return (
70
  <Fragment>
classes/Visualizer/Gutenberg/src/Components/ChartRender.js CHANGED
@@ -7,7 +7,7 @@ import DataTable from './DataTable.js';
7
 
8
  import merge from 'merge';
9
 
10
- import { compact, formatDate, isValidJSON } from '../utils.js';
11
 
12
  /**
13
  * WordPress dependencies
@@ -97,6 +97,7 @@ class ChartRender extends Component {
97
  compact( this.props.chart['visualizer-settings'])
98
  }
99
  height="500px"
 
100
  />
101
  ) : (
102
  <Chart
@@ -109,6 +110,7 @@ class ChartRender extends Component {
109
  compact( this.props.chart['visualizer-settings'])
110
  }
111
  height="500px"
 
112
  />
113
  ) ) }
114
 
7
 
8
  import merge from 'merge';
9
 
10
+ import { compact, formatDate, isValidJSON, formatData } from '../utils.js';
11
 
12
  /**
13
  * WordPress dependencies
97
  compact( this.props.chart['visualizer-settings'])
98
  }
99
  height="500px"
100
+ formatters={ formatData( data ) }
101
  />
102
  ) : (
103
  <Chart
110
  compact( this.props.chart['visualizer-settings'])
111
  }
112
  height="500px"
113
+ formatters={ formatData( data ) }
114
  />
115
  ) ) }
116
 
classes/Visualizer/Gutenberg/src/Components/ChartSelect.js CHANGED
@@ -23,7 +23,7 @@ import PanelButton from './PanelButton.js';
23
 
24
  import merge from 'merge';
25
 
26
- import { compact, formatDate, isValidJSON } from '../utils.js';
27
 
28
  /**
29
  * WordPress dependencies
@@ -169,6 +169,7 @@ class ChartSelect extends Component {
169
  compact( this.props.chart['visualizer-settings'])
170
  }
171
  height="500px"
 
172
  />
173
  ) : (
174
  <Chart
@@ -181,6 +182,7 @@ class ChartSelect extends Component {
181
  compact( this.props.chart['visualizer-settings'])
182
  }
183
  height="500px"
 
184
  />
185
  )
186
  ) }
23
 
24
  import merge from 'merge';
25
 
26
+ import { compact, formatDate, isValidJSON, formatData } from '../utils.js';
27
 
28
  /**
29
  * WordPress dependencies
169
  compact( this.props.chart['visualizer-settings'])
170
  }
171
  height="500px"
172
+ formatters={ formatData( data ) }
173
  />
174
  ) : (
175
  <Chart
182
  compact( this.props.chart['visualizer-settings'])
183
  }
184
  height="500px"
185
+ formatters={ formatData( data ) }
186
  />
187
  )
188
  ) }
classes/Visualizer/Gutenberg/src/Components/Charts.js CHANGED
@@ -5,7 +5,7 @@ import { Chart } from 'react-google-charts';
5
 
6
  import DataTable from './DataTable.js';
7
 
8
- import { formatDate, filterCharts } from '../utils.js';
9
 
10
  /**
11
  * WordPress dependencies
@@ -152,6 +152,7 @@ class Charts extends Component {
152
  rows={ data['visualizer-data'] }
153
  columns={ data['visualizer-series'] }
154
  options={ filterCharts( data['visualizer-settings']) }
 
155
  />
156
  ) : (
157
  <Chart
@@ -159,6 +160,7 @@ class Charts extends Component {
159
  rows={ data['visualizer-data'] }
160
  columns={ data['visualizer-series'] }
161
  options={ filterCharts( data['visualizer-settings']) }
 
162
  />
163
  ) ) }
164
 
5
 
6
  import DataTable from './DataTable.js';
7
 
8
+ import { formatDate, filterCharts, formatData } from '../utils.js';
9
 
10
  /**
11
  * WordPress dependencies
152
  rows={ data['visualizer-data'] }
153
  columns={ data['visualizer-series'] }
154
  options={ filterCharts( data['visualizer-settings']) }
155
+ formatters={ formatData( data ) }
156
  />
157
  ) : (
158
  <Chart
160
  rows={ data['visualizer-data'] }
161
  columns={ data['visualizer-series'] }
162
  options={ filterCharts( data['visualizer-settings']) }
163
+ formatters={ formatData( data ) }
164
  />
165
  ) ) }
166
 
classes/Visualizer/Gutenberg/src/Components/Sidebar/GeneralSettings.js CHANGED
@@ -46,6 +46,11 @@ class GeneralSettings extends Component {
46
  positions.push({ label: __( 'Inside the chart' ), value: 'in' });
47
  }
48
 
 
 
 
 
 
49
  return (
50
  <PanelBody
51
  title={ __( 'General Settings' ) }
@@ -61,7 +66,7 @@ class GeneralSettings extends Component {
61
 
62
  <TextControl
63
  label={ __( 'Chart Title' ) }
64
- help={ __( 'Text to display above the chart.' ) }
65
  value={ settings.title }
66
  onChange={ e => {
67
  settings.title = e;
46
  positions.push({ label: __( 'Inside the chart' ), value: 'in' });
47
  }
48
 
49
+ let titleHelp = __( 'Text to display above the chart.' );
50
+ if ( 0 <= [ 'tabular', 'dataTable', 'gauge', 'geo', 'timeline' ].indexOf( type ) ) {
51
+ titleHelp = __( 'Text to display in the back-end admin area' );
52
+ }
53
+
54
  return (
55
  <PanelBody
56
  title={ __( 'General Settings' ) }
66
 
67
  <TextControl
68
  label={ __( 'Chart Title' ) }
69
+ help={ titleHelp }
70
  value={ settings.title }
71
  onChange={ e => {
72
  settings.title = e;
classes/Visualizer/Gutenberg/src/Components/Sidebar/SeriesSettings.js CHANGED
@@ -60,7 +60,14 @@ class SeriesSettings extends Component {
60
 
61
  { Object.keys( settings.series )
62
  .map( ( i, index ) => {
 
 
 
 
 
 
63
  i++;
 
64
  return (
65
  <PanelBody
66
  title={ series[i].label }
@@ -121,9 +128,9 @@ class SeriesSettings extends Component {
121
  <TextControl
122
  label={ __( 'Format' ) }
123
  help={ __( 'Enter custom format pattern to apply to this series value.' ) }
124
- value={ settings.series[index].format }
125
  onChange={ e => {
126
- settings.series[index].format = e;
127
  this.props.edit( settings );
128
  } }
129
  />
@@ -148,9 +155,9 @@ class SeriesSettings extends Component {
148
  label={ __( 'Date Format' ) }
149
  help={ __( 'Enter custom format pattern to apply to this series value.' ) }
150
  placeholder="dd LLLL yyyy"
151
- value={ settings.series[index].format }
152
  onChange={ e => {
153
- settings.series[index].format = e;
154
  this.props.edit( settings );
155
  } }
156
  />
60
 
61
  { Object.keys( settings.series )
62
  .map( ( i, index ) => {
63
+ let indexToFormat = parseInt( i );
64
+
65
+ if ( 'tabular' !== type ) {
66
+ indexToFormat = index;
67
+ }
68
+
69
  i++;
70
+
71
  return (
72
  <PanelBody
73
  title={ series[i].label }
128
  <TextControl
129
  label={ __( 'Format' ) }
130
  help={ __( 'Enter custom format pattern to apply to this series value.' ) }
131
+ value={ settings.series[indexToFormat].format }
132
  onChange={ e => {
133
+ settings.series[indexToFormat].format = e;
134
  this.props.edit( settings );
135
  } }
136
  />
155
  label={ __( 'Date Format' ) }
156
  help={ __( 'Enter custom format pattern to apply to this series value.' ) }
157
  placeholder="dd LLLL yyyy"
158
+ value={ settings.series[indexToFormat].format }
159
  onChange={ e => {
160
+ settings.series[indexToFormat].format = e;
161
  this.props.edit( settings );
162
  } }
163
  />
classes/Visualizer/Gutenberg/src/Editor.js CHANGED
@@ -339,20 +339,39 @@ class Editor extends Component {
339
  let map = series;
340
  let fieldName = 'series';
341
 
342
- if ( 'pie' === type ) {
343
- map = chartData;
344
- fieldName = 'slices';
345
-
346
- // pie charts are finicky about a number being a number
347
- // and editing a number makes it a string
348
- // so let's convert it back into a number.
349
- chartData.map( ( i, index ) => {
350
- switch ( series[1].type ) {
351
- case 'number':
352
- i[1] = parseFloat( i[1]);
353
- break;
354
- }
355
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
356
  }
357
 
358
  map.map( ( i, index ) => {
@@ -362,16 +381,18 @@ class Editor extends Component {
362
 
363
  const seriesIndex = 'pie' !== type ? index - 1 : index;
364
 
365
- if ( settings[fieldName][seriesIndex] === undefined ) {
366
  settings[fieldName][seriesIndex] = {};
367
  settings[fieldName][seriesIndex].temp = 1;
368
  }
369
  });
370
 
371
- settings[fieldName] = settings[fieldName].filter( ( i, index ) => {
372
- const length = -1 >= [ 'pie', 'tabular', 'dataTable' ].indexOf( type ) ? map.length - 1 : map.length;
373
- return index < length;
374
- });
 
 
375
 
376
  chart['visualizer-source'] = source;
377
  chart['visualizer-default-data'] = 0;
339
  let map = series;
340
  let fieldName = 'series';
341
 
342
+ switch ( type ) {
343
+ case 'pie':
344
+ map = chartData;
345
+ fieldName = 'slices';
346
+
347
+ // pie charts are finicky about a number being a number
348
+ // and editing a number makes it a string
349
+ // so let's convert it back into a number.
350
+ chartData.map( ( i, index ) => {
351
+ switch ( series[1].type ) {
352
+ case 'number':
353
+ i[1] = parseFloat( i[1]);
354
+ break;
355
+ }
356
+ });
357
+ break;
358
+ case 'tabular':
359
+
360
+ // table charts are finicky about a boolean being a boolean
361
+ // and editing a boolean makes it a string
362
+ // so let's convert it back into a boolean.
363
+ chartData.map( ( i, index ) => {
364
+ series.map( ( seriesObject, seriesIndex ) => {
365
+ switch ( seriesObject.type ) {
366
+ case 'boolean':
367
+ if ( 'string' === typeof i[seriesIndex]) {
368
+ i[seriesIndex] = 'true' === i[seriesIndex];
369
+ }
370
+ break;
371
+ }
372
+ });
373
+ });
374
+ break;
375
  }
376
 
377
  map.map( ( i, index ) => {
381
 
382
  const seriesIndex = 'pie' !== type ? index - 1 : index;
383
 
384
+ if ( Array.isArray( settings[fieldName]) && settings[fieldName][seriesIndex] === undefined ) {
385
  settings[fieldName][seriesIndex] = {};
386
  settings[fieldName][seriesIndex].temp = 1;
387
  }
388
  });
389
 
390
+ if ( Array.isArray( settings[fieldName]) ) {
391
+ settings[fieldName] = settings[fieldName].filter( ( i, index ) => {
392
+ const length = -1 >= [ 'pie', 'tabular', 'dataTable' ].indexOf( type ) ? map.length - 1 : map.length;
393
+ return index < length;
394
+ });
395
+ }
396
 
397
  chart['visualizer-source'] = source;
398
  chart['visualizer-default-data'] = 0;
classes/Visualizer/Gutenberg/src/utils.js CHANGED
@@ -103,3 +103,78 @@ export const CSVToArray = ( strData, strDelimiter ) => {
103
  export const isChecked = ( settings, param ) => {
104
  return true === settings[param] || 'true' === settings[param] || '1' === settings[param] || 1 === settings[param];
105
  };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  export const isChecked = ( settings, param ) => {
104
  return true === settings[param] || 'true' === settings[param] || '1' === settings[param] || 1 === settings[param];
105
  };
106
+
107
+
108
+ export const formatData = ( chart ) => {
109
+ let library = chart['visualizer-chart-library'];
110
+
111
+ switch ( library ) {
112
+ case 'GoogleCharts':
113
+ return formatDataForGoogleCharts( chart );
114
+ }
115
+ };
116
+
117
+ export const formatDataForGoogleCharts = ( chart ) => {
118
+ let settings = chart['visualizer-settings'];
119
+ let type = chart['visualizer-chart-type'];
120
+ let series = chart['visualizer-series'];
121
+
122
+ let formatters = [];
123
+
124
+ if ( settings.series ) {
125
+ switch ( type ) {
126
+ case 'tabular':
127
+ for ( let i in settings.series ) {
128
+ i = parseInt( i );
129
+ if ( ! series[i + 1]) {
130
+ continue;
131
+ }
132
+ if ( settings.series[i].format && '' !== settings.series[i].format ) {
133
+ let col = i + 1;
134
+ let formatter = getFormatterForGoogle( series[i + 1].type );
135
+ if ( formatter ) {
136
+ formatters.push({ type: formatter, options: { pattern: settings.series[i].format }, column: col });
137
+ }
138
+ }
139
+ }
140
+ break;
141
+ default:
142
+ for ( let i = 0; i < settings.series.length; i++ ) {
143
+ if ( ! series[i + 1] || 'undefined' === typeof settings.series[i]) {
144
+ continue;
145
+ }
146
+ if ( settings.series[i].format && '' !== settings.series[i].format ) {
147
+ let col = i + 1;
148
+ let formatter = getFormatterForGoogle( series[i + 1].type );
149
+ if ( formatter ) {
150
+ formatters.push({ type: formatter, options: { pattern: settings.series[i].format }, column: col });
151
+ }
152
+ }
153
+ }
154
+ break;
155
+ }
156
+ } else if ( 'pie' === type && settings.format && '' !== settings.format ) {
157
+ formatters.push({ type: getFormatterForGoogle( 'number' ), options: { pattern: settings.format }, column: 1 });
158
+ }
159
+
160
+ if ( settings.hAxis && series[0]) {
161
+ let formatter = getFormatterForGoogle( series[0].type );
162
+ if ( formatter ) {
163
+ formatters.push({ type: formatter, options: { pattern: settings.hAxis.format }, column: 0 });
164
+ }
165
+ }
166
+
167
+ return formatters;
168
+ };
169
+
170
+ export const getFormatterForGoogle = ( dataType ) => {
171
+ switch ( dataType ) {
172
+ case 'number':
173
+ return 'NumberFormat';
174
+ case 'date':
175
+ case 'datetime':
176
+ case 'timeofday':
177
+ return 'DateFormat';
178
+ }
179
+ return null;
180
+ };
classes/Visualizer/Module/Admin.php CHANGED
@@ -598,7 +598,6 @@ class Visualizer_Module_Admin extends Visualizer_Module {
598
  */
599
  public function enqueueLibraryScripts( $suffix ) {
600
  if ( $suffix === $this->_libraryPage ) {
601
- wp_register_script( 'visualizer-clipboardjs', VISUALIZER_ABSURL . 'js/lib/clipboardjs/clipboard.min.js', array( 'jquery' ), Visualizer_Plugin::VERSION, true );
602
  wp_enqueue_style( 'visualizer-library', VISUALIZER_ABSURL . 'css/library.css', array(), Visualizer_Plugin::VERSION );
603
  $this->_addFilter( 'media_upload_tabs', 'setupVisualizerTab' );
604
  wp_enqueue_media();
@@ -608,7 +607,7 @@ class Visualizer_Module_Admin extends Visualizer_Module {
608
  array(
609
  'jquery',
610
  'media-views',
611
- 'visualizer-clipboardjs',
612
  ),
613
  Visualizer_Plugin::VERSION,
614
  true
598
  */
599
  public function enqueueLibraryScripts( $suffix ) {
600
  if ( $suffix === $this->_libraryPage ) {
 
601
  wp_enqueue_style( 'visualizer-library', VISUALIZER_ABSURL . 'css/library.css', array(), Visualizer_Plugin::VERSION );
602
  $this->_addFilter( 'media_upload_tabs', 'setupVisualizerTab' );
603
  wp_enqueue_media();
607
  array(
608
  'jquery',
609
  'media-views',
610
+ 'clipboard',
611
  ),
612
  Visualizer_Plugin::VERSION,
613
  true
classes/Visualizer/Module/Frontend.php CHANGED
@@ -81,7 +81,7 @@ class Visualizer_Module_Frontend extends Visualizer_Module {
81
  return $tag;
82
  }
83
 
84
- $scripts = array( 'google-jsapi-new', 'google-jsapi-old', 'visualizer-render-google-lib', 'visualizer-render-google' );
85
 
86
  foreach ( $scripts as $async ) {
87
  if ( $async === $handle ) {
@@ -108,7 +108,24 @@ class Visualizer_Module_Frontend extends Visualizer_Module {
108
  'visualizer/v' . VISUALIZER_REST_VERSION,
109
  '/action/(?P<chart>\d+)/(?P<type>.+)/',
110
  array(
111
- 'methods' => array( 'GET', 'POST' ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  'callback' => array( $this, 'perform_action' ),
113
  )
114
  );
@@ -219,7 +236,6 @@ class Visualizer_Module_Frontend extends Visualizer_Module {
219
  */
220
  public function enqueueScripts() {
221
  wp_register_script( 'visualizer-customization', $this->get_user_customization_js(), array(), null, true );
222
- wp_register_script( 'visualizer-clipboardjs', VISUALIZER_ABSURL . 'js/lib/clipboardjs/clipboard.min.js', array( 'jquery' ), Visualizer_Plugin::VERSION, true );
223
  wp_register_style( 'visualizer-front', VISUALIZER_ABSURL . 'css/front.css', array(), Visualizer_Plugin::VERSION );
224
  do_action( 'visualizer_pro_frontend_load_resources' );
225
  }
@@ -349,7 +365,7 @@ class Visualizer_Module_Frontend extends Visualizer_Module {
349
  if ( 'copy' === $key ) {
350
  $copy = $this->_getDataAs( $atts['id'], 'csv' );
351
  $actions_div .= ' data-clipboard-text="' . esc_attr( $copy['csv'] ) . '"';
352
- wp_enqueue_script( 'visualizer-clipboardjs' );
353
  }
354
 
355
  $actions_div .= apply_filters( 'visualizer_action_attributes', '', $key, $atts['id'] );
@@ -380,6 +396,7 @@ class Visualizer_Module_Frontend extends Visualizer_Module {
380
  'language' => $this->get_language(),
381
  'map_api_key' => get_option( 'visualizer-map-api-key' ),
382
  'rest_url' => version_compare( $wp_version, '4.7.0', '>=' ) ? rest_url( 'visualizer/v' . VISUALIZER_REST_VERSION . '/action/#id#/#type#/' ) : '',
 
383
  'i10n' => array(
384
  'copied' => __( 'The data has been copied to your clipboard. Hit Ctrl-V/Cmd-V in your spreadsheet editor to paste the data.', 'visualizer' ),
385
  ),
81
  return $tag;
82
  }
83
 
84
+ $scripts = array( 'google-jsapi', 'visualizer-render-google-lib', 'visualizer-render-google' );
85
 
86
  foreach ( $scripts as $async ) {
87
  if ( $async === $handle ) {
108
  'visualizer/v' . VISUALIZER_REST_VERSION,
109
  '/action/(?P<chart>\d+)/(?P<type>.+)/',
110
  array(
111
+ 'methods' => 'GET',
112
+ 'args' => array(
113
+ 'chart' => array(
114
+ 'required' => true,
115
+ 'sanitize_callback' => function( $param ) {
116
+ return is_numeric( $param ) ? $param : null;
117
+ },
118
+ ),
119
+ 'type' => array(
120
+ 'required' => true,
121
+ 'type' => 'string',
122
+ 'enum' => array_keys( $this->get_actions() ),
123
+ ),
124
+ ),
125
+ 'permission_callback' => function ( WP_REST_Request $request ) {
126
+ $chart_id = filter_var( sanitize_text_field( $request->get_param( 'chart' ), FILTER_VALIDATE_INT ) );
127
+ return ! empty( $chart_id ) && apply_filters( 'visualizer_pro_show_chart', true, $chart_id );
128
+ },
129
  'callback' => array( $this, 'perform_action' ),
130
  )
131
  );
236
  */
237
  public function enqueueScripts() {
238
  wp_register_script( 'visualizer-customization', $this->get_user_customization_js(), array(), null, true );
 
239
  wp_register_style( 'visualizer-front', VISUALIZER_ABSURL . 'css/front.css', array(), Visualizer_Plugin::VERSION );
240
  do_action( 'visualizer_pro_frontend_load_resources' );
241
  }
365
  if ( 'copy' === $key ) {
366
  $copy = $this->_getDataAs( $atts['id'], 'csv' );
367
  $actions_div .= ' data-clipboard-text="' . esc_attr( $copy['csv'] ) . '"';
368
+ wp_enqueue_script( 'clipboard' );
369
  }
370
 
371
  $actions_div .= apply_filters( 'visualizer_action_attributes', '', $key, $atts['id'] );
396
  'language' => $this->get_language(),
397
  'map_api_key' => get_option( 'visualizer-map-api-key' ),
398
  'rest_url' => version_compare( $wp_version, '4.7.0', '>=' ) ? rest_url( 'visualizer/v' . VISUALIZER_REST_VERSION . '/action/#id#/#type#/' ) : '',
399
+ 'wp_nonce' => wp_create_nonce( 'wp_rest' ),
400
  'i10n' => array(
401
  'copied' => __( 'The data has been copied to your clipboard. Hit Ctrl-V/Cmd-V in your spreadsheet editor to paste the data.', 'visualizer' ),
402
  ),
classes/Visualizer/Plugin.php CHANGED
@@ -28,7 +28,7 @@
28
  class Visualizer_Plugin {
29
 
30
  const NAME = 'visualizer';
31
- const VERSION = '3.4.5';
32
 
33
  // custom post types
34
  const CPT_VISUALIZER = 'visualizer';
28
  class Visualizer_Plugin {
29
 
30
  const NAME = 'visualizer';
31
+ const VERSION = '3.4.6';
32
 
33
  // custom post types
34
  const CPT_VISUALIZER = 'visualizer';
classes/Visualizer/Render/Library.php CHANGED
@@ -319,7 +319,7 @@ class Visualizer_Render_Library extends Visualizer_Render {
319
  admin_url( 'admin-ajax.php' )
320
  );
321
 
322
- $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' => '' );
323
  if ( ! empty( $chart_status['error'] ) ) {
324
  $chart_status['icon'] = 'error dashicons-dismiss';
325
  $chart_status['title'] = __( 'Click to view the error', 'visualizer' );
@@ -340,7 +340,7 @@ class Visualizer_Render_Library extends Visualizer_Render {
340
  }
341
  echo '<a class="visualizer-chart-action visualizer-chart-shortcode" href="javascript:;" title="', esc_attr__( 'Click to copy shortcode', 'visualizer' ), '" data-clipboard-text="', esc_attr( $shortcode ), '"></a>';
342
  echo '<span>&nbsp;</span>';
343
- 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>';
344
  echo '</div>';
345
  echo '</div>';
346
  }
319
  admin_url( 'admin-ajax.php' )
320
  );
321
 
322
+ $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' => 'A-OK!' );
323
  if ( ! empty( $chart_status['error'] ) ) {
324
  $chart_status['icon'] = 'error dashicons-dismiss';
325
  $chart_status['title'] = __( 'Click to view the error', 'visualizer' );
340
  }
341
  echo '<a class="visualizer-chart-action visualizer-chart-shortcode" href="javascript:;" title="', esc_attr__( 'Click to copy shortcode', 'visualizer' ), '" data-clipboard-text="', esc_attr( $shortcode ), '"></a>';
342
  echo '<span>&nbsp;</span>';
343
+ echo '<hr><div class="visualizer-chart-status"><span title="' . __( 'Chart ID', 'visualizer' ) . '">(' . $chart_id . '):</span> <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>';
344
  echo '</div>';
345
  echo '</div>';
346
  }
classes/Visualizer/Render/Sidebar.php CHANGED
@@ -502,7 +502,7 @@ abstract class Visualizer_Render_Sidebar extends Visualizer_Render {
502
  */
503
  protected function load_dependent_assets( $libs ) {
504
  if ( in_array( 'moment', $libs, true ) && ! wp_script_is( 'moment', 'registered' ) ) {
505
- wp_register_script( 'moment', VISUALIZER_ABSURL . 'js/lib/moment.min.js', array(), Visualizer_Plugin::VERSION );
506
  }
507
 
508
  if ( in_array( 'numeral', $libs, true ) && ! wp_script_is( 'numeral', 'registered' ) ) {
502
  */
503
  protected function load_dependent_assets( $libs ) {
504
  if ( in_array( 'moment', $libs, true ) && ! wp_script_is( 'moment', 'registered' ) ) {
505
+ wp_register_script( 'moment' );
506
  }
507
 
508
  if ( in_array( 'numeral', $libs, true ) && ! wp_script_is( 'numeral', 'registered' ) ) {
classes/Visualizer/Render/Sidebar/Google.php CHANGED
@@ -95,13 +95,12 @@ abstract class Visualizer_Render_Sidebar_Google extends Visualizer_Render_Sideba
95
  * Loads the assets.
96
  */
97
  function load_google_assets( $deps, $is_frontend ) {
98
- wp_register_script( 'google-jsapi-new', '//www.gstatic.com/charts/loader.js', array(), null, true );
99
- wp_register_script( 'google-jsapi-old', '//www.google.com/jsapi', array( 'google-jsapi-new' ), null, true );
100
  wp_register_script(
101
  'visualizer-render-google-lib',
102
  VISUALIZER_ABSURL . 'js/render-google.js',
103
  array(
104
- 'google-jsapi-old',
105
  ),
106
  Visualizer_Plugin::VERSION,
107
  true
@@ -118,9 +117,8 @@ abstract class Visualizer_Render_Sidebar_Google extends Visualizer_Render_Sideba
118
  * Enqueue assets.
119
  */
120
  public static function enqueue_assets( $deps = array() ) {
121
- wp_enqueue_script( 'visualizer-google-jsapi-new', '//www.gstatic.com/charts/loader.js', array(), null, true );
122
- wp_enqueue_script( 'visualizer-google-jsapi-old', '//www.google.com/jsapi', array( 'visualizer-google-jsapi-new' ), null, true );
123
- wp_enqueue_script( 'visualizer-render-google-lib', VISUALIZER_ABSURL . 'js/render-google.js', array_merge( $deps, array( 'visualizer-google-jsapi-old' ) ), Visualizer_Plugin::VERSION, true );
124
  return 'visualizer-render-google-lib';
125
  }
126
 
95
  * Loads the assets.
96
  */
97
  function load_google_assets( $deps, $is_frontend ) {
98
+ wp_register_script( 'google-jsapi', '//www.gstatic.com/charts/loader.js', array(), null, true );
 
99
  wp_register_script(
100
  'visualizer-render-google-lib',
101
  VISUALIZER_ABSURL . 'js/render-google.js',
102
  array(
103
+ 'google-jsapi',
104
  ),
105
  Visualizer_Plugin::VERSION,
106
  true
117
  * Enqueue assets.
118
  */
119
  public static function enqueue_assets( $deps = array() ) {
120
+ wp_enqueue_script( 'visualizer-google-jsapi', '//www.gstatic.com/charts/loader.js', array(), null, true );
121
+ wp_enqueue_script( 'visualizer-render-google-lib', VISUALIZER_ABSURL . 'js/render-google.js', array_merge( $deps, array( 'visualizer-google-jsapi' ) ), Visualizer_Plugin::VERSION, true );
 
122
  return 'visualizer-render-google-lib';
123
  }
124
 
classes/Visualizer/Source/Query.php CHANGED
@@ -90,6 +90,8 @@ class Visualizer_Source_Query extends Visualizer_Source {
90
  $this->_query .= ' LIMIT ' . apply_filters( 'visualizer_sql_query_limit', 1000, $this->_chart_id );
91
  }
92
 
 
 
93
  $results = array();
94
  $headers = array();
95
 
@@ -145,9 +147,12 @@ class Visualizer_Source_Query extends Visualizer_Source {
145
  }
146
 
147
  if ( $as_html ) {
148
- return $this->html( $headers, $results );
 
 
149
  }
150
- return $this->object( $headers, $results );
 
151
  }
152
 
153
  /**
90
  $this->_query .= ' LIMIT ' . apply_filters( 'visualizer_sql_query_limit', 1000, $this->_chart_id );
91
  }
92
 
93
+ $this->_query = apply_filters( 'visualizer_db_query', $this->_query, $this->_chart_id, $this->_params );
94
+
95
  $results = array();
96
  $headers = array();
97
 
147
  }
148
 
149
  if ( $as_html ) {
150
+ $results = $this->html( $headers, $results );
151
+ } else {
152
+ $results = $this->object( $headers, $results );
153
  }
154
+
155
+ return apply_filters( 'visualizer_db_query_results', $results, $headers, $as_html, $results_as_numeric_array, $raw_results, $this->_query, $this->_chart_id, $this->_params );
156
  }
157
 
158
  /**
css/media.css CHANGED
@@ -1,5 +1,5 @@
1
  /*
2
- Version: 3.4.5
3
  */
4
  #visualizer-library-view {
5
  padding: 30px 10px 10px 30px;
1
  /*
2
+ Version: 3.4.6
3
  */
4
  #visualizer-library-view {
5
  padding: 30px 10px 10px 30px;
index.php CHANGED
@@ -4,7 +4,7 @@
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.5
8
  Author: Themeisle
9
  Author URI: http://themeisle.com
10
  License: GPL v2.0 or later
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.6
8
  Author: Themeisle
9
  Author URI: http://themeisle.com
10
  License: GPL v2.0 or later
js/lib/clipboardjs/clipboard.min.js DELETED
@@ -1,7 +0,0 @@
1
- /*!
2
- * clipboard.js v1.7.1
3
- * https://zenorocha.github.io/clipboard.js
4
- *
5
- * Licensed MIT © Zeno Rocha
6
- */
7
- !function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Clipboard=t()}}(function(){var t,e,n;return function t(e,n,o){function i(a,c){if(!n[a]){if(!e[a]){var l="function"==typeof require&&require;if(!c&&l)return l(a,!0);if(r)return r(a,!0);var s=new Error("Cannot find module '"+a+"'");throw s.code="MODULE_NOT_FOUND",s}var u=n[a]={exports:{}};e[a][0].call(u.exports,function(t){var n=e[a][1][t];return i(n||t)},u,u.exports,t,e,n,o)}return n[a].exports}for(var r="function"==typeof require&&require,a=0;a<o.length;a++)i(o[a]);return i}({1:[function(t,e,n){function o(t,e){for(;t&&t.nodeType!==i;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}var i=9;if("undefined"!=typeof Element&&!Element.prototype.matches){var r=Element.prototype;r.matches=r.matchesSelector||r.mozMatchesSelector||r.msMatchesSelector||r.oMatchesSelector||r.webkitMatchesSelector}e.exports=o},{}],2:[function(t,e,n){function o(t,e,n,o,r){var a=i.apply(this,arguments);return t.addEventListener(n,a,r),{destroy:function(){t.removeEventListener(n,a,r)}}}function i(t,e,n,o){return function(n){n.delegateTarget=r(n.target,e),n.delegateTarget&&o.call(t,n)}}var r=t("./closest");e.exports=o},{"./closest":1}],3:[function(t,e,n){n.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},n.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||n.node(t[0]))},n.string=function(t){return"string"==typeof t||t instanceof String},n.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},{}],4:[function(t,e,n){function o(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!c.string(e))throw new TypeError("Second argument must be a String");if(!c.fn(n))throw new TypeError("Third argument must be a Function");if(c.node(t))return i(t,e,n);if(c.nodeList(t))return r(t,e,n);if(c.string(t))return a(t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function i(t,e,n){return t.addEventListener(e,n),{destroy:function(){t.removeEventListener(e,n)}}}function r(t,e,n){return Array.prototype.forEach.call(t,function(t){t.addEventListener(e,n)}),{destroy:function(){Array.prototype.forEach.call(t,function(t){t.removeEventListener(e,n)})}}}function a(t,e,n){return l(document.body,t,e,n)}var c=t("./is"),l=t("delegate");e.exports=o},{"./is":3,delegate:2}],5:[function(t,e,n){function o(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var o=window.getSelection(),i=document.createRange();i.selectNodeContents(t),o.removeAllRanges(),o.addRange(i),e=o.toString()}return e}e.exports=o},{}],6:[function(t,e,n){function o(){}o.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){function o(){i.off(t,o),e.apply(n,arguments)}var i=this;return o._=e,this.on(t,o,n)},emit:function(t){var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,i=n.length;for(o;o<i;o++)n[o].fn.apply(n[o].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),o=n[t],i=[];if(o&&e)for(var r=0,a=o.length;r<a;r++)o[r].fn!==e&&o[r].fn._!==e&&i.push(o[r]);return i.length?n[t]=i:delete n[t],this}},e.exports=o},{}],7:[function(e,n,o){!function(i,r){if("function"==typeof t&&t.amd)t(["module","select"],r);else if(void 0!==o)r(n,e("select"));else{var a={exports:{}};r(a,i.select),i.clipboardAction=a.exports}}(this,function(t,e){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=n(e),r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),c=function(){function t(e){o(this,t),this.resolveOptions(e),this.initSelection()}return a(t,[{key:"resolveOptions",value:function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action=e.action,this.container=e.container,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""}},{key:"initSelection",value:function t(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function t(){var e=this,n="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[n?"right":"left"]="-9999px";var o=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=o+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,i.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function t(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function t(){this.selectedText=(0,i.default)(this.target),this.copyText()}},{key:"copyText",value:function t(){var e=void 0;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function t(e){this.emitter.emit(e?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function t(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function t(){this.removeFake()}},{key:"action",set:function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function t(){return this._action}},{key:"target",set:function t(e){if(void 0!==e){if(!e||"object"!==(void 0===e?"undefined":r(e))||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function t(){return this._target}}]),t}();t.exports=c})},{select:5}],8:[function(e,n,o){!function(i,r){if("function"==typeof t&&t.amd)t(["module","./clipboard-action","tiny-emitter","good-listener"],r);else if(void 0!==o)r(n,e("./clipboard-action"),e("tiny-emitter"),e("good-listener"));else{var a={exports:{}};r(a,i.clipboardAction,i.tinyEmitter,i.goodListener),i.clipboard=a.exports}}(this,function(t,e,n,o){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function l(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}var s=i(e),u=i(n),f=i(o),d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),p=function(t){function e(t,n){r(this,e);var o=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return o.resolveOptions(n),o.listenClick(t),o}return c(e,t),h(e,[{key:"resolveOptions",value:function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===d(e.container)?e.container:document.body}},{key:"listenClick",value:function t(e){var n=this;this.listener=(0,f.default)(e,"click",function(t){return n.onClick(t)})}},{key:"onClick",value:function t(e){var n=e.delegateTarget||e.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new s.default({action:this.action(n),target:this.target(n),text:this.text(n),container:this.container,trigger:n,emitter:this})}},{key:"defaultAction",value:function t(e){return l("action",e)}},{key:"defaultTarget",value:function t(e){var n=l("target",e);if(n)return document.querySelector(n)}},{key:"defaultText",value:function t(e){return l("text",e)}},{key:"destroy",value:function t(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],n="string"==typeof e?[e]:e,o=!!document.queryCommandSupported;return n.forEach(function(t){o=o&&!!document.queryCommandSupported(t)}),o}}]),e}(u.default);t.exports=p})},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8)});
 
 
 
 
 
 
 
js/lib/moment.min.js DELETED
@@ -1 +0,0 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";var e,i;function c(){return e.apply(null,arguments)}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function u(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function l(e){return void 0===e}function d(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function h(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function f(e,t){var n,s=[];for(n=0;n<e.length;++n)s.push(t(e[n],n));return s}function m(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function _(e,t){for(var n in t)m(t,n)&&(e[n]=t[n]);return m(t,"toString")&&(e.toString=t.toString),m(t,"valueOf")&&(e.valueOf=t.valueOf),e}function y(e,t,n,s){return Ot(e,t,n,s,!0).utc()}function g(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 p(e){if(null==e._isValid){var t=g(e),n=i.call(t.parsedDateParts,function(e){return null!=e}),s=!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&&(s=s&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return s;e._isValid=s}return e._isValid}function v(e){var t=y(NaN);return null!=e?_(g(t),e):g(t).userInvalidated=!0,t}i=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1};var r=c.momentProperties=[];function w(e,t){var n,s,i;if(l(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),l(t._i)||(e._i=t._i),l(t._f)||(e._f=t._f),l(t._l)||(e._l=t._l),l(t._strict)||(e._strict=t._strict),l(t._tzm)||(e._tzm=t._tzm),l(t._isUTC)||(e._isUTC=t._isUTC),l(t._offset)||(e._offset=t._offset),l(t._pf)||(e._pf=g(t)),l(t._locale)||(e._locale=t._locale),0<r.length)for(n=0;n<r.length;n++)l(i=t[s=r[n]])||(e[s]=i);return e}var t=!1;function M(e){w(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===t&&(t=!0,c.updateOffset(this),t=!1)}function S(e){return e instanceof M||null!=e&&null!=e._isAMomentObject}function D(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=D(t)),n}function a(e,t,n){var s,i=Math.min(e.length,t.length),r=Math.abs(e.length-t.length),a=0;for(s=0;s<i;s++)(n&&e[s]!==t[s]||!n&&k(e[s])!==k(t[s]))&&a++;return a+r}function Y(e){!1===c.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function n(i,r){var a=!0;return _(function(){if(null!=c.deprecationHandler&&c.deprecationHandler(null,i),a){for(var e,t=[],n=0;n<arguments.length;n++){if(e="","object"==typeof arguments[n]){for(var s in e+="\n["+n+"] ",arguments[0])e+=s+": "+arguments[0][s]+", ";e=e.slice(0,-2)}else e=arguments[n];t.push(e)}Y(i+"\nArguments: "+Array.prototype.slice.call(t).join("")+"\n"+(new Error).stack),a=!1}return r.apply(this,arguments)},r)}var s,O={};function T(e,t){null!=c.deprecationHandler&&c.deprecationHandler(e,t),O[e]||(Y(t),O[e]=!0)}function x(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function b(e,t){var n,s=_({},e);for(n in t)m(t,n)&&(u(e[n])&&u(t[n])?(s[n]={},_(s[n],e[n]),_(s[n],t[n])):null!=t[n]?s[n]=t[n]:delete s[n]);for(n in e)m(e,n)&&!m(t,n)&&u(e[n])&&(s[n]=_({},s[n]));return s}function P(e){null!=e&&this.set(e)}c.suppressDeprecationWarnings=!1,c.deprecationHandler=null,s=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)m(e,t)&&n.push(t);return n};var W={};function H(e,t){var n=e.toLowerCase();W[n]=W[n+"s"]=W[t]=e}function R(e){return"string"==typeof e?W[e]||W[e.toLowerCase()]:void 0}function C(e){var t,n,s={};for(n in e)m(e,n)&&(t=R(n))&&(s[t]=e[n]);return s}var F={};function L(e,t){F[e]=t}function U(e,t,n){var s=""+Math.abs(e),i=t-s.length;return(0<=e?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+s}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,G=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,V={},E={};function I(e,t,n,s){var i=s;"string"==typeof s&&(i=function(){return this[s]()}),e&&(E[e]=i),t&&(E[t[0]]=function(){return U(i.apply(this,arguments),t[1],t[2])}),n&&(E[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function A(e,t){return e.isValid()?(t=j(t,e.localeData()),V[t]=V[t]||function(s){var e,i,t,r=s.match(N);for(e=0,i=r.length;e<i;e++)E[r[e]]?r[e]=E[r[e]]:r[e]=(t=r[e]).match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"");return function(e){var t,n="";for(t=0;t<i;t++)n+=x(r[t])?r[t].call(e,s):r[t];return n}}(t),V[t](e)):e.localeData().invalidDate()}function j(e,t){var n=5;function s(e){return t.longDateFormat(e)||e}for(G.lastIndex=0;0<=n&&G.test(e);)e=e.replace(G,s),G.lastIndex=0,n-=1;return e}var Z=/\d/,z=/\d\d/,$=/\d{3}/,q=/\d{4}/,J=/[+-]?\d{6}/,B=/\d\d?/,Q=/\d\d\d\d?/,X=/\d\d\d\d\d\d?/,K=/\d{1,3}/,ee=/\d{1,4}/,te=/[+-]?\d{1,6}/,ne=/\d+/,se=/[+-]?\d+/,ie=/Z|[+-]\d\d:?\d\d/gi,re=/Z|[+-]\d\d(?::?\d\d)?/gi,ae=/[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,oe={};function ue(e,n,s){oe[e]=x(n)?n:function(e,t){return e&&s?s:n}}function le(e,t){return m(oe,e)?oe[e](t._strict,t._locale):new RegExp(de(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,s,i){return t||n||s||i})))}function de(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var he={};function ce(e,n){var t,s=n;for("string"==typeof e&&(e=[e]),d(n)&&(s=function(e,t){t[n]=k(e)}),t=0;t<e.length;t++)he[e[t]]=s}function fe(e,i){ce(e,function(e,t,n,s){n._w=n._w||{},i(e,n._w,n,s)})}var me=0,_e=1,ye=2,ge=3,pe=4,ve=5,we=6,Me=7,Se=8;function De(e){return ke(e)?366:365}function ke(e){return e%4==0&&e%100!=0||e%400==0}I("Y",0,0,function(){var e=this.year();return e<=9999?""+e:"+"+e}),I(0,["YY",2],0,function(){return this.year()%100}),I(0,["YYYY",4],0,"year"),I(0,["YYYYY",5],0,"year"),I(0,["YYYYYY",6,!0],0,"year"),H("year","y"),L("year",1),ue("Y",se),ue("YY",B,z),ue("YYYY",ee,q),ue("YYYYY",te,J),ue("YYYYYY",te,J),ce(["YYYYY","YYYYYY"],me),ce("YYYY",function(e,t){t[me]=2===e.length?c.parseTwoDigitYear(e):k(e)}),ce("YY",function(e,t){t[me]=c.parseTwoDigitYear(e)}),ce("Y",function(e,t){t[me]=parseInt(e,10)}),c.parseTwoDigitYear=function(e){return k(e)+(68<k(e)?1900:2e3)};var Ye,Oe=Te("FullYear",!0);function Te(t,n){return function(e){return null!=e?(be(this,t,e),c.updateOffset(this,n),this):xe(this,t)}}function xe(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function be(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&ke(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),Pe(n,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function Pe(e,t){if(isNaN(e)||isNaN(t))return NaN;var n,s=(t%(n=12)+n)%n;return e+=(t-s)/12,1===s?ke(e)?29:28:31-s%7%2}Ye=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},I("M",["MM",2],"Mo",function(){return this.month()+1}),I("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),I("MMMM",0,0,function(e){return this.localeData().months(this,e)}),H("month","M"),L("month",8),ue("M",B),ue("MM",B,z),ue("MMM",function(e,t){return t.monthsShortRegex(e)}),ue("MMMM",function(e,t){return t.monthsRegex(e)}),ce(["M","MM"],function(e,t){t[_e]=k(e)-1}),ce(["MMM","MMMM"],function(e,t,n,s){var i=n._locale.monthsParse(e,s,n._strict);null!=i?t[_e]=i:g(n).invalidMonth=e});var We=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,He="January_February_March_April_May_June_July_August_September_October_November_December".split("_");var Re="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function Ce(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=k(t);else if(!d(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),Pe(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function Fe(e){return null!=e?(Ce(this,e),c.updateOffset(this,!0),this):xe(this,"Month")}var Le=ae;var Ue=ae;function Ne(){function e(e,t){return t.length-e.length}var t,n,s=[],i=[],r=[];for(t=0;t<12;t++)n=y([2e3,t]),s.push(this.monthsShort(n,"")),i.push(this.months(n,"")),r.push(this.months(n,"")),r.push(this.monthsShort(n,""));for(s.sort(e),i.sort(e),r.sort(e),t=0;t<12;t++)s[t]=de(s[t]),i[t]=de(i[t]);for(t=0;t<24;t++)r[t]=de(r[t]);this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+s.join("|")+")","i")}function Ge(e){var t=new Date(Date.UTC.apply(null,arguments));return e<100&&0<=e&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function Ve(e,t,n){var s=7+t-n;return-((7+Ge(e,0,s).getUTCDay()-t)%7)+s-1}function Ee(e,t,n,s,i){var r,a,o=1+7*(t-1)+(7+n-s)%7+Ve(e,s,i);return o<=0?a=De(r=e-1)+o:o>De(e)?(r=e+1,a=o-De(e)):(r=e,a=o),{year:r,dayOfYear:a}}function Ie(e,t,n){var s,i,r=Ve(e.year(),t,n),a=Math.floor((e.dayOfYear()-r-1)/7)+1;return a<1?s=a+Ae(i=e.year()-1,t,n):a>Ae(e.year(),t,n)?(s=a-Ae(e.year(),t,n),i=e.year()+1):(i=e.year(),s=a),{week:s,year:i}}function Ae(e,t,n){var s=Ve(e,t,n),i=Ve(e+1,t,n);return(De(e)-s+i)/7}I("w",["ww",2],"wo","week"),I("W",["WW",2],"Wo","isoWeek"),H("week","w"),H("isoWeek","W"),L("week",5),L("isoWeek",5),ue("w",B),ue("ww",B,z),ue("W",B),ue("WW",B,z),fe(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=k(e)});I("d",0,"do","day"),I("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),I("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),I("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),I("e",0,0,"weekday"),I("E",0,0,"isoWeekday"),H("day","d"),H("weekday","e"),H("isoWeekday","E"),L("day",11),L("weekday",11),L("isoWeekday",11),ue("d",B),ue("e",B),ue("E",B),ue("dd",function(e,t){return t.weekdaysMinRegex(e)}),ue("ddd",function(e,t){return t.weekdaysShortRegex(e)}),ue("dddd",function(e,t){return t.weekdaysRegex(e)}),fe(["dd","ddd","dddd"],function(e,t,n,s){var i=n._locale.weekdaysParse(e,s,n._strict);null!=i?t.d=i:g(n).invalidWeekday=e}),fe(["d","e","E"],function(e,t,n,s){t[s]=k(e)});var je="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");var Ze="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");var ze="Su_Mo_Tu_We_Th_Fr_Sa".split("_");var $e=ae;var qe=ae;var Je=ae;function Be(){function e(e,t){return t.length-e.length}var t,n,s,i,r,a=[],o=[],u=[],l=[];for(t=0;t<7;t++)n=y([2e3,1]).day(t),s=this.weekdaysMin(n,""),i=this.weekdaysShort(n,""),r=this.weekdays(n,""),a.push(s),o.push(i),u.push(r),l.push(s),l.push(i),l.push(r);for(a.sort(e),o.sort(e),u.sort(e),l.sort(e),t=0;t<7;t++)o[t]=de(o[t]),u[t]=de(u[t]),l[t]=de(l[t]);this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Qe(){return this.hours()%12||12}function Xe(e,t){I(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function Ke(e,t){return t._meridiemParse}I("H",["HH",2],0,"hour"),I("h",["hh",2],0,Qe),I("k",["kk",2],0,function(){return this.hours()||24}),I("hmm",0,0,function(){return""+Qe.apply(this)+U(this.minutes(),2)}),I("hmmss",0,0,function(){return""+Qe.apply(this)+U(this.minutes(),2)+U(this.seconds(),2)}),I("Hmm",0,0,function(){return""+this.hours()+U(this.minutes(),2)}),I("Hmmss",0,0,function(){return""+this.hours()+U(this.minutes(),2)+U(this.seconds(),2)}),Xe("a",!0),Xe("A",!1),H("hour","h"),L("hour",13),ue("a",Ke),ue("A",Ke),ue("H",B),ue("h",B),ue("k",B),ue("HH",B,z),ue("hh",B,z),ue("kk",B,z),ue("hmm",Q),ue("hmmss",X),ue("Hmm",Q),ue("Hmmss",X),ce(["H","HH"],ge),ce(["k","kk"],function(e,t,n){var s=k(e);t[ge]=24===s?0:s}),ce(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),ce(["h","hh"],function(e,t,n){t[ge]=k(e),g(n).bigHour=!0}),ce("hmm",function(e,t,n){var s=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s)),g(n).bigHour=!0}),ce("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s,2)),t[ve]=k(e.substr(i)),g(n).bigHour=!0}),ce("Hmm",function(e,t,n){var s=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s))}),ce("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[ge]=k(e.substr(0,s)),t[pe]=k(e.substr(s,2)),t[ve]=k(e.substr(i))});var et,tt=Te("Hours",!0),nt={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:He,monthsShort:Re,week:{dow:0,doy:6},weekdays:je,weekdaysMin:ze,weekdaysShort:Ze,meridiemParse:/[ap]\.?m?\.?/i},st={},it={};function rt(e){return e?e.toLowerCase().replace("_","-"):e}function at(e){var t=null;if(!st[e]&&"undefined"!=typeof module&&module&&module.exports)try{t=et._abbr,require("./locale/"+e),ot(t)}catch(e){}return st[e]}function ot(e,t){var n;return e&&((n=l(t)?lt(e):ut(e,t))?et=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),et._abbr}function ut(e,t){if(null!==t){var n,s=nt;if(t.abbr=e,null!=st[e])T("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."),s=st[e]._config;else if(null!=t.parentLocale)if(null!=st[t.parentLocale])s=st[t.parentLocale]._config;else{if(null==(n=at(t.parentLocale)))return it[t.parentLocale]||(it[t.parentLocale]=[]),it[t.parentLocale].push({name:e,config:t}),null;s=n._config}return st[e]=new P(b(s,t)),it[e]&&it[e].forEach(function(e){ut(e.name,e.config)}),ot(e),st[e]}return delete st[e],null}function lt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return et;if(!o(e)){if(t=at(e))return t;e=[e]}return function(e){for(var t,n,s,i,r=0;r<e.length;){for(t=(i=rt(e[r]).split("-")).length,n=(n=rt(e[r+1]))?n.split("-"):null;0<t;){if(s=at(i.slice(0,t).join("-")))return s;if(n&&n.length>=t&&a(i,n,!0)>=t-1)break;t--}r++}return et}(e)}function dt(e){var t,n=e._a;return n&&-2===g(e).overflow&&(t=n[_e]<0||11<n[_e]?_e:n[ye]<1||n[ye]>Pe(n[me],n[_e])?ye:n[ge]<0||24<n[ge]||24===n[ge]&&(0!==n[pe]||0!==n[ve]||0!==n[we])?ge:n[pe]<0||59<n[pe]?pe:n[ve]<0||59<n[ve]?ve:n[we]<0||999<n[we]?we:-1,g(e)._overflowDayOfYear&&(t<me||ye<t)&&(t=ye),g(e)._overflowWeeks&&-1===t&&(t=Me),g(e)._overflowWeekday&&-1===t&&(t=Se),g(e).overflow=t),e}function ht(e,t,n){return null!=e?e:null!=t?t:n}function ct(e){var t,n,s,i,r,a=[];if(!e._d){var o,u;for(o=e,u=new Date(c.now()),s=o._useUTC?[u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()]:[u.getFullYear(),u.getMonth(),u.getDate()],e._w&&null==e._a[ye]&&null==e._a[_e]&&function(e){var t,n,s,i,r,a,o,u;if(null!=(t=e._w).GG||null!=t.W||null!=t.E)r=1,a=4,n=ht(t.GG,e._a[me],Ie(Tt(),1,4).year),s=ht(t.W,1),((i=ht(t.E,1))<1||7<i)&&(u=!0);else{r=e._locale._week.dow,a=e._locale._week.doy;var l=Ie(Tt(),r,a);n=ht(t.gg,e._a[me],l.year),s=ht(t.w,l.week),null!=t.d?((i=t.d)<0||6<i)&&(u=!0):null!=t.e?(i=t.e+r,(t.e<0||6<t.e)&&(u=!0)):i=r}s<1||s>Ae(n,r,a)?g(e)._overflowWeeks=!0:null!=u?g(e)._overflowWeekday=!0:(o=Ee(n,s,i,r,a),e._a[me]=o.year,e._dayOfYear=o.dayOfYear)}(e),null!=e._dayOfYear&&(r=ht(e._a[me],s[me]),(e._dayOfYear>De(r)||0===e._dayOfYear)&&(g(e)._overflowDayOfYear=!0),n=Ge(r,0,e._dayOfYear),e._a[_e]=n.getUTCMonth(),e._a[ye]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=s[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ge]&&0===e._a[pe]&&0===e._a[ve]&&0===e._a[we]&&(e._nextDay=!0,e._a[ge]=0),e._d=(e._useUTC?Ge:function(e,t,n,s,i,r,a){var o=new Date(e,t,n,s,i,r,a);return e<100&&0<=e&&isFinite(o.getFullYear())&&o.setFullYear(e),o}).apply(null,a),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ge]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(g(e).weekdayMismatch=!0)}}var ft=/^\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=/^\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)?)?$/,_t=/Z|[+-]\d\d(?::?\d\d)?/,yt=[["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}/]],gt=[["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/]],pt=/^\/?Date\((\-?\d+)/i;function vt(e){var t,n,s,i,r,a,o=e._i,u=ft.exec(o)||mt.exec(o);if(u){for(g(e).iso=!0,t=0,n=yt.length;t<n;t++)if(yt[t][1].exec(u[1])){i=yt[t][0],s=!1!==yt[t][2];break}if(null==i)return void(e._isValid=!1);if(u[3]){for(t=0,n=gt.length;t<n;t++)if(gt[t][1].exec(u[3])){r=(u[2]||" ")+gt[t][0];break}if(null==r)return void(e._isValid=!1)}if(!s&&null!=r)return void(e._isValid=!1);if(u[4]){if(!_t.exec(u[4]))return void(e._isValid=!1);a="Z"}e._f=i+(r||"")+(a||""),kt(e)}else e._isValid=!1}var wt=/^(?:(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 Mt(e,t,n,s,i,r){var a=[function(e){var t=parseInt(e,10);{if(t<=49)return 2e3+t;if(t<=999)return 1900+t}return t}(e),Re.indexOf(t),parseInt(n,10),parseInt(s,10),parseInt(i,10)];return r&&a.push(parseInt(r,10)),a}var St={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Dt(e){var t,n,s,i=wt.exec(e._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(i){var r=Mt(i[4],i[3],i[2],i[5],i[6],i[7]);if(t=i[1],n=r,s=e,t&&Ze.indexOf(t)!==new Date(n[0],n[1],n[2]).getDay()&&(g(s).weekdayMismatch=!0,!(s._isValid=!1)))return;e._a=r,e._tzm=function(e,t,n){if(e)return St[e];if(t)return 0;var s=parseInt(n,10),i=s%100;return(s-i)/100*60+i}(i[8],i[9],i[10]),e._d=Ge.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),g(e).rfc2822=!0}else e._isValid=!1}function kt(e){if(e._f!==c.ISO_8601)if(e._f!==c.RFC_2822){e._a=[],g(e).empty=!0;var t,n,s,i,r,a,o,u,l=""+e._i,d=l.length,h=0;for(s=j(e._f,e._locale).match(N)||[],t=0;t<s.length;t++)i=s[t],(n=(l.match(le(i,e))||[])[0])&&(0<(r=l.substr(0,l.indexOf(n))).length&&g(e).unusedInput.push(r),l=l.slice(l.indexOf(n)+n.length),h+=n.length),E[i]?(n?g(e).empty=!1:g(e).unusedTokens.push(i),a=i,u=e,null!=(o=n)&&m(he,a)&&he[a](o,u._a,u,a)):e._strict&&!n&&g(e).unusedTokens.push(i);g(e).charsLeftOver=d-h,0<l.length&&g(e).unusedInput.push(l),e._a[ge]<=12&&!0===g(e).bigHour&&0<e._a[ge]&&(g(e).bigHour=void 0),g(e).parsedDateParts=e._a.slice(0),g(e).meridiem=e._meridiem,e._a[ge]=function(e,t,n){var s;if(null==n)return t;return null!=e.meridiemHour?e.meridiemHour(t,n):(null!=e.isPM&&((s=e.isPM(n))&&t<12&&(t+=12),s||12!==t||(t=0)),t)}(e._locale,e._a[ge],e._meridiem),ct(e),dt(e)}else Dt(e);else vt(e)}function Yt(e){var t,n,s,i,r=e._i,a=e._f;return e._locale=e._locale||lt(e._l),null===r||void 0===a&&""===r?v({nullInput:!0}):("string"==typeof r&&(e._i=r=e._locale.preparse(r)),S(r)?new M(dt(r)):(h(r)?e._d=r:o(a)?function(e){var t,n,s,i,r;if(0===e._f.length)return g(e).invalidFormat=!0,e._d=new Date(NaN);for(i=0;i<e._f.length;i++)r=0,t=w({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],kt(t),p(t)&&(r+=g(t).charsLeftOver,r+=10*g(t).unusedTokens.length,g(t).score=r,(null==s||r<s)&&(s=r,n=t));_(e,n||t)}(e):a?kt(e):l(n=(t=e)._i)?t._d=new Date(c.now()):h(n)?t._d=new Date(n.valueOf()):"string"==typeof n?(s=t,null===(i=pt.exec(s._i))?(vt(s),!1===s._isValid&&(delete s._isValid,Dt(s),!1===s._isValid&&(delete s._isValid,c.createFromInputFallback(s)))):s._d=new Date(+i[1])):o(n)?(t._a=f(n.slice(0),function(e){return parseInt(e,10)}),ct(t)):u(n)?function(e){if(!e._d){var t=C(e._i);e._a=f([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),ct(e)}}(t):d(n)?t._d=new Date(n):c.createFromInputFallback(t),p(e)||(e._d=null),e))}function Ot(e,t,n,s,i){var r,a={};return!0!==n&&!1!==n||(s=n,n=void 0),(u(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)||o(e)&&0===e.length)&&(e=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=i,a._l=n,a._i=e,a._f=t,a._strict=s,(r=new M(dt(Yt(a))))._nextDay&&(r.add(1,"d"),r._nextDay=void 0),r}function Tt(e,t,n,s){return Ot(e,t,n,s,!1)}c.createFromInputFallback=n("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":""))}),c.ISO_8601=function(){},c.RFC_2822=function(){};var xt=n("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Tt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:v()}),bt=n("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Tt.apply(null,arguments);return this.isValid()&&e.isValid()?this<e?this:e:v()});function Pt(e,t){var n,s;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return Tt();for(n=t[0],s=1;s<t.length;++s)t[s].isValid()&&!t[s][e](n)||(n=t[s]);return n}var Wt=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ht(e){var t=C(e),n=t.year||0,s=t.quarter||0,i=t.month||0,r=t.week||0,a=t.day||0,o=t.hour||0,u=t.minute||0,l=t.second||0,d=t.millisecond||0;this._isValid=function(e){for(var t in e)if(-1===Ye.call(Wt,t)||null!=e[t]&&isNaN(e[t]))return!1;for(var n=!1,s=0;s<Wt.length;++s)if(e[Wt[s]]){if(n)return!1;parseFloat(e[Wt[s]])!==k(e[Wt[s]])&&(n=!0)}return!0}(t),this._milliseconds=+d+1e3*l+6e4*u+1e3*o*60*60,this._days=+a+7*r,this._months=+i+3*s+12*n,this._data={},this._locale=lt(),this._bubble()}function Rt(e){return e instanceof Ht}function Ct(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Ft(e,n){I(e,0,0,function(){var e=this.utcOffset(),t="+";return e<0&&(e=-e,t="-"),t+U(~~(e/60),2)+n+U(~~e%60,2)})}Ft("Z",":"),Ft("ZZ",""),ue("Z",re),ue("ZZ",re),ce(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Ut(re,e)});var Lt=/([\+\-]|\d\d)/gi;function Ut(e,t){var n=(t||"").match(e);if(null===n)return null;var s=((n[n.length-1]||[])+"").match(Lt)||["-",0,0],i=60*s[1]+k(s[2]);return 0===i?0:"+"===s[0]?i:-i}function Nt(e,t){var n,s;return t._isUTC?(n=t.clone(),s=(S(e)||h(e)?e.valueOf():Tt(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+s),c.updateOffset(n,!1),n):Tt(e).local()}function Gt(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Vt(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}c.updateOffset=function(){};var Et=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,It=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function At(e,t){var n,s,i,r=e,a=null;return Rt(e)?r={ms:e._milliseconds,d:e._days,M:e._months}:d(e)?(r={},t?r[t]=e:r.milliseconds=e):(a=Et.exec(e))?(n="-"===a[1]?-1:1,r={y:0,d:k(a[ye])*n,h:k(a[ge])*n,m:k(a[pe])*n,s:k(a[ve])*n,ms:k(Ct(1e3*a[we]))*n}):(a=It.exec(e))?(n="-"===a[1]?-1:(a[1],1),r={y:jt(a[2],n),M:jt(a[3],n),w:jt(a[4],n),d:jt(a[5],n),h:jt(a[6],n),m:jt(a[7],n),s:jt(a[8],n)}):null==r?r={}:"object"==typeof r&&("from"in r||"to"in r)&&(i=function(e,t){var n;if(!e.isValid()||!t.isValid())return{milliseconds:0,months:0};t=Nt(t,e),e.isBefore(t)?n=Zt(e,t):((n=Zt(t,e)).milliseconds=-n.milliseconds,n.months=-n.months);return n}(Tt(r.from),Tt(r.to)),(r={}).ms=i.milliseconds,r.M=i.months),s=new Ht(r),Rt(e)&&m(e,"_locale")&&(s._locale=e._locale),s}function jt(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 zt(s,i){return function(e,t){var n;return null===t||isNaN(+t)||(T(i,"moment()."+i+"(period, number) is deprecated. Please use moment()."+i+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),n=e,e=t,t=n),$t(this,At(e="string"==typeof e?+e:e,t),s),this}}function $t(e,t,n,s){var i=t._milliseconds,r=Ct(t._days),a=Ct(t._months);e.isValid()&&(s=null==s||s,a&&Ce(e,xe(e,"Month")+a*n),r&&be(e,"Date",xe(e,"Date")+r*n),i&&e._d.setTime(e._d.valueOf()+i*n),s&&c.updateOffset(e,r||a))}At.fn=Ht.prototype,At.invalid=function(){return At(NaN)};var qt=zt(1,"add"),Jt=zt(-1,"subtract");function Bt(e,t){var n=12*(t.year()-e.year())+(t.month()-e.month()),s=e.clone().add(n,"months");return-(n+(t-s<0?(t-s)/(s-e.clone().add(n-1,"months")):(t-s)/(e.clone().add(n+1,"months")-s)))||0}function Qt(e){var t;return void 0===e?this._locale._abbr:(null!=(t=lt(e))&&(this._locale=t),this)}c.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",c.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Xt=n("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 Kt(){return this._locale}function en(e,t){I(0,[e,e.length],0,t)}function tn(e,t,n,s,i){var r;return null==e?Ie(this,s,i).year:((r=Ae(e,s,i))<t&&(t=r),function(e,t,n,s,i){var r=Ee(e,t,n,s,i),a=Ge(r.year,0,r.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}.call(this,e,t,n,s,i))}I(0,["gg",2],0,function(){return this.weekYear()%100}),I(0,["GG",2],0,function(){return this.isoWeekYear()%100}),en("gggg","weekYear"),en("ggggg","weekYear"),en("GGGG","isoWeekYear"),en("GGGGG","isoWeekYear"),H("weekYear","gg"),H("isoWeekYear","GG"),L("weekYear",1),L("isoWeekYear",1),ue("G",se),ue("g",se),ue("GG",B,z),ue("gg",B,z),ue("GGGG",ee,q),ue("gggg",ee,q),ue("GGGGG",te,J),ue("ggggg",te,J),fe(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,s){t[s.substr(0,2)]=k(e)}),fe(["gg","GG"],function(e,t,n,s){t[s]=c.parseTwoDigitYear(e)}),I("Q",0,"Qo","quarter"),H("quarter","Q"),L("quarter",7),ue("Q",Z),ce("Q",function(e,t){t[_e]=3*(k(e)-1)}),I("D",["DD",2],"Do","date"),H("date","D"),L("date",9),ue("D",B),ue("DD",B,z),ue("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),ce(["D","DD"],ye),ce("Do",function(e,t){t[ye]=k(e.match(B)[0])});var nn=Te("Date",!0);I("DDD",["DDDD",3],"DDDo","dayOfYear"),H("dayOfYear","DDD"),L("dayOfYear",4),ue("DDD",K),ue("DDDD",$),ce(["DDD","DDDD"],function(e,t,n){n._dayOfYear=k(e)}),I("m",["mm",2],0,"minute"),H("minute","m"),L("minute",14),ue("m",B),ue("mm",B,z),ce(["m","mm"],pe);var sn=Te("Minutes",!1);I("s",["ss",2],0,"second"),H("second","s"),L("second",15),ue("s",B),ue("ss",B,z),ce(["s","ss"],ve);var rn,an=Te("Seconds",!1);for(I("S",0,0,function(){return~~(this.millisecond()/100)}),I(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),I(0,["SSS",3],0,"millisecond"),I(0,["SSSS",4],0,function(){return 10*this.millisecond()}),I(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),I(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),I(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),I(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),I(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),H("millisecond","ms"),L("millisecond",16),ue("S",K,Z),ue("SS",K,z),ue("SSS",K,$),rn="SSSS";rn.length<=9;rn+="S")ue(rn,ne);function on(e,t){t[we]=k(1e3*("0."+e))}for(rn="S";rn.length<=9;rn+="S")ce(rn,on);var un=Te("Milliseconds",!1);I("z",0,0,"zoneAbbr"),I("zz",0,0,"zoneName");var ln=M.prototype;function dn(e){return e}ln.add=qt,ln.calendar=function(e,t){var n=e||Tt(),s=Nt(n,this).startOf("day"),i=c.calendarFormat(this,s)||"sameElse",r=t&&(x(t[i])?t[i].call(this,n):t[i]);return this.format(r||this.localeData().calendar(i,this,Tt(n)))},ln.clone=function(){return new M(this)},ln.diff=function(e,t,n){var s,i,r;if(!this.isValid())return NaN;if(!(s=Nt(e,this)).isValid())return NaN;switch(i=6e4*(s.utcOffset()-this.utcOffset()),t=R(t)){case"year":r=Bt(this,s)/12;break;case"month":r=Bt(this,s);break;case"quarter":r=Bt(this,s)/3;break;case"second":r=(this-s)/1e3;break;case"minute":r=(this-s)/6e4;break;case"hour":r=(this-s)/36e5;break;case"day":r=(this-s-i)/864e5;break;case"week":r=(this-s-i)/6048e5;break;default:r=this-s}return n?r:D(r)},ln.endOf=function(e){return void 0===(e=R(e))||"millisecond"===e?this:("date"===e&&(e="day"),this.startOf(e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms"))},ln.format=function(e){e||(e=this.isUtc()?c.defaultFormatUtc:c.defaultFormat);var t=A(this,e);return this.localeData().postformat(t)},ln.from=function(e,t){return this.isValid()&&(S(e)&&e.isValid()||Tt(e).isValid())?At({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},ln.fromNow=function(e){return this.from(Tt(),e)},ln.to=function(e,t){return this.isValid()&&(S(e)&&e.isValid()||Tt(e).isValid())?At({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},ln.toNow=function(e){return this.to(Tt(),e)},ln.get=function(e){return x(this[e=R(e)])?this[e]():this},ln.invalidAt=function(){return g(this).overflow},ln.isAfter=function(e,t){var n=S(e)?e:Tt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=R(l(t)?"millisecond":t))?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},ln.isBefore=function(e,t){var n=S(e)?e:Tt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=R(l(t)?"millisecond":t))?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},ln.isBetween=function(e,t,n,s){return("("===(s=s||"()")[0]?this.isAfter(e,n):!this.isBefore(e,n))&&(")"===s[1]?this.isBefore(t,n):!this.isAfter(t,n))},ln.isSame=function(e,t){var n,s=S(e)?e:Tt(e);return!(!this.isValid()||!s.isValid())&&("millisecond"===(t=R(t||"millisecond"))?this.valueOf()===s.valueOf():(n=s.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},ln.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},ln.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},ln.isValid=function(){return p(this)},ln.lang=Xt,ln.locale=Qt,ln.localeData=Kt,ln.max=bt,ln.min=xt,ln.parsingFlags=function(){return _({},g(this))},ln.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:F[n]});return t.sort(function(e,t){return e.priority-t.priority}),t}(e=C(e)),s=0;s<n.length;s++)this[n[s].unit](e[n[s].unit]);else if(x(this[e=R(e)]))return this[e](t);return this},ln.startOf=function(e){switch(e=R(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},ln.subtract=Jt,ln.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},ln.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()}},ln.toDate=function(){return new Date(this.valueOf())},ln.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||9999<n.year()?A(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.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",A(n,"Z")):A(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},ln.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+'("]',s=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i=t+'[")]';return this.format(n+s+"-MM-DD[T]HH:mm:ss.SSS"+i)},ln.toJSON=function(){return this.isValid()?this.toISOString():null},ln.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},ln.unix=function(){return Math.floor(this.valueOf()/1e3)},ln.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},ln.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},ln.year=Oe,ln.isLeapYear=function(){return ke(this.year())},ln.weekYear=function(e){return tn.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},ln.isoWeekYear=function(e){return tn.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},ln.quarter=ln.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},ln.month=Fe,ln.daysInMonth=function(){return Pe(this.year(),this.month())},ln.week=ln.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},ln.isoWeek=ln.isoWeeks=function(e){var t=Ie(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},ln.weeksInYear=function(){var e=this.localeData()._week;return Ae(this.year(),e.dow,e.doy)},ln.isoWeeksInYear=function(){return Ae(this.year(),1,4)},ln.date=nn,ln.day=ln.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t,n,s=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(t=e,n=this.localeData(),e="string"!=typeof t?t:isNaN(t)?"number"==typeof(t=n.weekdaysParse(t))?t:null:parseInt(t,10),this.add(e-s,"d")):s},ln.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")},ln.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=(n=e,s=this.localeData(),"string"==typeof n?s.weekdaysParse(n)%7||7:isNaN(n)?null:n);return this.day(this.day()%7?t:t-7)}return this.day()||7;var n,s},ln.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")},ln.hour=ln.hours=tt,ln.minute=ln.minutes=sn,ln.second=ln.seconds=an,ln.millisecond=ln.milliseconds=un,ln.utcOffset=function(e,t,n){var s,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=Ut(re,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(s=Gt(this)),this._offset=e,this._isUTC=!0,null!=s&&this.add(s,"m"),i!==e&&(!t||this._changeInProgress?$t(this,At(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,c.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?i:Gt(this)},ln.utc=function(e){return this.utcOffset(0,e)},ln.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Gt(this),"m")),this},ln.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=Ut(ie,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},ln.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Tt(e).utcOffset():0,(this.utcOffset()-e)%60==0)},ln.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},ln.isLocal=function(){return!!this.isValid()&&!this._isUTC},ln.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},ln.isUtc=Vt,ln.isUTC=Vt,ln.zoneAbbr=function(){return this._isUTC?"UTC":""},ln.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},ln.dates=n("dates accessor is deprecated. Use date instead.",nn),ln.months=n("months accessor is deprecated. Use month instead",Fe),ln.years=n("years accessor is deprecated. Use year instead",Oe),ln.zone=n("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()}),ln.isDSTShifted=n("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!l(this._isDSTShifted))return this._isDSTShifted;var e={};if(w(e,this),(e=Yt(e))._a){var t=e._isUTC?y(e._a):Tt(e._a);this._isDSTShifted=this.isValid()&&0<a(e._a,t.toArray())}else this._isDSTShifted=!1;return this._isDSTShifted});var hn=P.prototype;function cn(e,t,n,s){var i=lt(),r=y().set(s,t);return i[n](r,e)}function fn(e,t,n){if(d(e)&&(t=e,e=void 0),e=e||"",null!=t)return cn(e,t,n,"month");var s,i=[];for(s=0;s<12;s++)i[s]=cn(e,s,n,"month");return i}function mn(e,t,n,s){"boolean"==typeof e?d(t)&&(n=t,t=void 0):(t=e,e=!1,d(n=t)&&(n=t,t=void 0)),t=t||"";var i,r=lt(),a=e?r._week.dow:0;if(null!=n)return cn(t,(n+a)%7,s,"day");var o=[];for(i=0;i<7;i++)o[i]=cn(t,(i+a)%7,s,"day");return o}hn.calendar=function(e,t,n){var s=this._calendar[e]||this._calendar.sameElse;return x(s)?s.call(t,n):s},hn.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])},hn.invalidDate=function(){return this._invalidDate},hn.ordinal=function(e){return this._ordinal.replace("%d",e)},hn.preparse=dn,hn.postformat=dn,hn.relativeTime=function(e,t,n,s){var i=this._relativeTime[n];return x(i)?i(e,t,n,s):i.replace(/%d/i,e)},hn.pastFuture=function(e,t){var n=this._relativeTime[0<e?"future":"past"];return x(n)?n(t):n.replace(/%s/i,t)},hn.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)},hn.months=function(e,t){return e?o(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||We).test(t)?"format":"standalone"][e.month()]:o(this._months)?this._months:this._months.standalone},hn.monthsShort=function(e,t){return e?o(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[We.test(t)?"format":"standalone"][e.month()]:o(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},hn.monthsParse=function(e,t,n){var s,i,r;if(this._monthsParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)r=y([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(r,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(i=Ye.call(this._shortMonthsParse,a))?i:null:-1!==(i=Ye.call(this._longMonthsParse,a))?i:null:"MMM"===t?-1!==(i=Ye.call(this._shortMonthsParse,a))?i:-1!==(i=Ye.call(this._longMonthsParse,a))?i:null:-1!==(i=Ye.call(this._longMonthsParse,a))?i:-1!==(i=Ye.call(this._shortMonthsParse,a))?i:null}.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(i=y([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[s]||(r="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[s]=new RegExp(r.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[s].test(e))return s;if(n&&"MMM"===t&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}},hn.monthsRegex=function(e){return this._monthsParseExact?(m(this,"_monthsRegex")||Ne.call(this),e?this._monthsStrictRegex:this._monthsRegex):(m(this,"_monthsRegex")||(this._monthsRegex=Ue),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},hn.monthsShortRegex=function(e){return this._monthsParseExact?(m(this,"_monthsRegex")||Ne.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(m(this,"_monthsShortRegex")||(this._monthsShortRegex=Le),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},hn.week=function(e){return Ie(e,this._week.dow,this._week.doy).week},hn.firstDayOfYear=function(){return this._week.doy},hn.firstDayOfWeek=function(){return this._week.dow},hn.weekdays=function(e,t){return e?o(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"][e.day()]:o(this._weekdays)?this._weekdays:this._weekdays.standalone},hn.weekdaysMin=function(e){return e?this._weekdaysMin[e.day()]:this._weekdaysMin},hn.weekdaysShort=function(e){return e?this._weekdaysShort[e.day()]:this._weekdaysShort},hn.weekdaysParse=function(e,t,n){var s,i,r;if(this._weekdaysParseExact)return function(e,t,n){var s,i,r,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)r=y([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=Ye.call(this._weekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:"dddd"===t?-1!==(i=Ye.call(this._weekdaysParse,a))?i:-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:"ddd"===t?-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:-1!==(i=Ye.call(this._weekdaysParse,a))?i:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:null:-1!==(i=Ye.call(this._minWeekdaysParse,a))?i:-1!==(i=Ye.call(this._weekdaysParse,a))?i:-1!==(i=Ye.call(this._shortWeekdaysParse,a))?i:null}.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(i=y([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(r="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[s]=new RegExp(r.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[s].test(e))return s;if(n&&"ddd"===t&&this._shortWeekdaysParse[s].test(e))return s;if(n&&"dd"===t&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}},hn.weekdaysRegex=function(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Be.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(m(this,"_weekdaysRegex")||(this._weekdaysRegex=$e),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},hn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Be.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(m(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=qe),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},hn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(m(this,"_weekdaysRegex")||Be.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(m(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Je),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},hn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},hn.meridiem=function(e,t,n){return 11<e?n?"pm":"PM":n?"am":"AM"},ot("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")}}),c.lang=n("moment.lang is deprecated. Use moment.locale instead.",ot),c.langData=n("moment.langData is deprecated. Use moment.localeData instead.",lt);var _n=Math.abs;function yn(e,t,n,s){var i=At(t,n);return e._milliseconds+=s*i._milliseconds,e._days+=s*i._days,e._months+=s*i._months,e._bubble()}function gn(e){return e<0?Math.floor(e):Math.ceil(e)}function pn(e){return 4800*e/146097}function vn(e){return 146097*e/4800}function wn(e){return function(){return this.as(e)}}var Mn=wn("ms"),Sn=wn("s"),Dn=wn("m"),kn=wn("h"),Yn=wn("d"),On=wn("w"),Tn=wn("M"),xn=wn("y");function bn(e){return function(){return this.isValid()?this._data[e]:NaN}}var Pn=bn("milliseconds"),Wn=bn("seconds"),Hn=bn("minutes"),Rn=bn("hours"),Cn=bn("days"),Fn=bn("months"),Ln=bn("years");var Un=Math.round,Nn={ss:44,s:45,m:45,h:22,d:26,M:11};var Gn=Math.abs;function Vn(e){return(0<e)-(e<0)||+e}function En(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n=Gn(this._milliseconds)/1e3,s=Gn(this._days),i=Gn(this._months);t=D((e=D(n/60))/60),n%=60,e%=60;var r=D(i/12),a=i%=12,o=s,u=t,l=e,d=n?n.toFixed(3).replace(/\.?0+$/,""):"",h=this.asSeconds();if(!h)return"P0D";var c=h<0?"-":"",f=Vn(this._months)!==Vn(h)?"-":"",m=Vn(this._days)!==Vn(h)?"-":"",_=Vn(this._milliseconds)!==Vn(h)?"-":"";return c+"P"+(r?f+r+"Y":"")+(a?f+a+"M":"")+(o?m+o+"D":"")+(u||l||d?"T":"")+(u?_+u+"H":"")+(l?_+l+"M":"")+(d?_+d+"S":"")}var In=Ht.prototype;return In.isValid=function(){return this._isValid},In.abs=function(){var e=this._data;return this._milliseconds=_n(this._milliseconds),this._days=_n(this._days),this._months=_n(this._months),e.milliseconds=_n(e.milliseconds),e.seconds=_n(e.seconds),e.minutes=_n(e.minutes),e.hours=_n(e.hours),e.months=_n(e.months),e.years=_n(e.years),this},In.add=function(e,t){return yn(this,e,t,1)},In.subtract=function(e,t){return yn(this,e,t,-1)},In.as=function(e){if(!this.isValid())return NaN;var t,n,s=this._milliseconds;if("month"===(e=R(e))||"year"===e)return t=this._days+s/864e5,n=this._months+pn(t),"month"===e?n:n/12;switch(t=this._days+Math.round(vn(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return 24*t+s/36e5;case"minute":return 1440*t+s/6e4;case"second":return 86400*t+s/1e3;case"millisecond":return Math.floor(864e5*t)+s;default:throw new Error("Unknown unit "+e)}},In.asMilliseconds=Mn,In.asSeconds=Sn,In.asMinutes=Dn,In.asHours=kn,In.asDays=Yn,In.asWeeks=On,In.asMonths=Tn,In.asYears=xn,In.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*k(this._months/12):NaN},In._bubble=function(){var e,t,n,s,i,r=this._milliseconds,a=this._days,o=this._months,u=this._data;return 0<=r&&0<=a&&0<=o||r<=0&&a<=0&&o<=0||(r+=864e5*gn(vn(o)+a),o=a=0),u.milliseconds=r%1e3,e=D(r/1e3),u.seconds=e%60,t=D(e/60),u.minutes=t%60,n=D(t/60),u.hours=n%24,o+=i=D(pn(a+=D(n/24))),a-=gn(vn(i)),s=D(o/12),o%=12,u.days=a,u.months=o,u.years=s,this},In.clone=function(){return At(this)},In.get=function(e){return e=R(e),this.isValid()?this[e+"s"]():NaN},In.milliseconds=Pn,In.seconds=Wn,In.minutes=Hn,In.hours=Rn,In.days=Cn,In.weeks=function(){return D(this.days()/7)},In.months=Fn,In.years=Ln,In.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var t,n,s,i,r,a,o,u,l,d,h,c=this.localeData(),f=(n=!e,s=c,i=At(t=this).abs(),r=Un(i.as("s")),a=Un(i.as("m")),o=Un(i.as("h")),u=Un(i.as("d")),l=Un(i.as("M")),d=Un(i.as("y")),(h=r<=Nn.ss&&["s",r]||r<Nn.s&&["ss",r]||a<=1&&["m"]||a<Nn.m&&["mm",a]||o<=1&&["h"]||o<Nn.h&&["hh",o]||u<=1&&["d"]||u<Nn.d&&["dd",u]||l<=1&&["M"]||l<Nn.M&&["MM",l]||d<=1&&["y"]||["yy",d])[2]=n,h[3]=0<+t,h[4]=s,function(e,t,n,s,i){return i.relativeTime(t||1,!!n,e,s)}.apply(null,h));return e&&(f=c.pastFuture(+this,f)),c.postformat(f)},In.toISOString=En,In.toString=En,In.toJSON=En,In.locale=Qt,In.localeData=Kt,In.toIsoString=n("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",En),In.lang=Xt,I("X",0,0,"unix"),I("x",0,0,"valueOf"),ue("x",se),ue("X",/[+-]?\d+(\.\d{1,3})?/),ce("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),ce("x",function(e,t,n){n._d=new Date(k(e))}),c.version="2.22.2",e=Tt,c.fn=ln,c.min=function(){return Pt("isBefore",[].slice.call(arguments,0))},c.max=function(){return Pt("isAfter",[].slice.call(arguments,0))},c.now=function(){return Date.now?Date.now():+new Date},c.utc=y,c.unix=function(e){return Tt(1e3*e)},c.months=function(e,t){return fn(e,t,"months")},c.isDate=h,c.locale=ot,c.invalid=v,c.duration=At,c.isMoment=S,c.weekdays=function(e,t,n){return mn(e,t,n,"weekdays")},c.parseZone=function(){return Tt.apply(null,arguments).parseZone()},c.localeData=lt,c.isDuration=Rt,c.monthsShort=function(e,t){return fn(e,t,"monthsShort")},c.weekdaysMin=function(e,t,n){return mn(e,t,n,"weekdaysMin")},c.defineLocale=ut,c.updateLocale=function(e,t){if(null!=t){var n,s,i=nt;null!=(s=at(e))&&(i=s._config),(n=new P(t=b(i,t))).parentLocale=st[e],st[e]=n,ot(e)}else null!=st[e]&&(null!=st[e].parentLocale?st[e]=st[e].parentLocale:null!=st[e]&&delete st[e]);return st[e]},c.locales=function(){return s(st)},c.weekdaysShort=function(e,t,n){return mn(e,t,n,"weekdaysShort")},c.normalizeUnits=R,c.relativeTimeRounding=function(e){return void 0===e?Un:"function"==typeof e&&(Un=e,!0)},c.relativeTimeThreshold=function(e,t){return void 0!==Nn[e]&&(void 0===t?Nn[e]:(Nn[e]=t,"s"===e&&(Nn.ss=t-1),!0))},c.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"},c.prototype=ln,c.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"},c});
 
js/render-facade.js CHANGED
@@ -6,7 +6,7 @@
6
 
7
  function initActionsButtons(v) {
8
  if($('a.visualizer-chart-shortcode').length > 0) {
9
- var clipboard1 = new Clipboard('a.visualizer-chart-shortcode'); // jshint ignore:line
10
  clipboard1.on('success', function(e) {
11
  window.alert(v.i10n['copied']);
12
  });
@@ -16,7 +16,7 @@
16
  $('a.visualizer-action[data-visualizer-type=copy]').on('click', function(e) {
17
  e.preventDefault();
18
  });
19
- var clipboard = new Clipboard('a.visualizer-action[data-visualizer-type=copy]'); // jshint ignore:line
20
  clipboard.on('success', function(e) {
21
  window.alert(v.i10n['copied']);
22
  });
@@ -31,6 +31,9 @@
31
  e.preventDefault();
32
  $.ajax({
33
  url : v.rest_url.replace('#id#', chart).replace('#type#', type),
 
 
 
34
  success: function(data) {
35
  if (data && data.data) {
36
  switch(type){
6
 
7
  function initActionsButtons(v) {
8
  if($('a.visualizer-chart-shortcode').length > 0) {
9
+ var clipboard1 = new ClipboardJS('a.visualizer-chart-shortcode'); // jshint ignore:line
10
  clipboard1.on('success', function(e) {
11
  window.alert(v.i10n['copied']);
12
  });
16
  $('a.visualizer-action[data-visualizer-type=copy]').on('click', function(e) {
17
  e.preventDefault();
18
  });
19
+ var clipboard = new ClipboardJS('a.visualizer-action[data-visualizer-type=copy]'); // jshint ignore:line
20
  clipboard.on('success', function(e) {
21
  window.alert(v.i10n['copied']);
22
  });
31
  e.preventDefault();
32
  $.ajax({
33
  url : v.rest_url.replace('#id#', chart).replace('#type#', type),
34
+ beforeSend: function ( xhr ) {
35
+ xhr.setRequestHeader( 'X-WP-Nonce', v.wp_nonce );
36
+ },
37
  success: function(data) {
38
  if (data && data.data) {
39
  switch(type){
js/render-google.js CHANGED
@@ -14,15 +14,17 @@ var __visualizer_chart_images = [];
14
  function renderChart(id) {
15
  var chart = all_charts[id];
16
  var hasAnnotation = false;
17
- if(id !== 'canvas' && typeof chart.series !== 'undefined' && typeof chart.settings.series !== 'undefined'){
18
- hasAnnotation = chart.series.length - chart.settings.series.length > 1;
19
- }
20
  // re-render the chart only if it doesn't have annotations and it is on the front-end
21
  // this is to prevent the chart from showing "All series on a given axis must be of the same data type" during resize.
22
- if(hasAnnotation){
23
- return;
 
 
 
 
 
24
  }
25
- renderSpecificChart(id, all_charts[id]);
26
  }
27
 
28
  function renderSpecificChart(id, chart) {
@@ -259,6 +261,7 @@ var __visualizer_chart_images = [];
259
  if (settings.series) {
260
  switch(chart.type){
261
  case 'table':
 
262
  for(i in settings.series){
263
  i = parseInt(i);
264
  if (!series[i + 1]) {
14
  function renderChart(id) {
15
  var chart = all_charts[id];
16
  var hasAnnotation = false;
17
+
 
 
18
  // re-render the chart only if it doesn't have annotations and it is on the front-end
19
  // this is to prevent the chart from showing "All series on a given axis must be of the same data type" during resize.
20
+ // table/tabular charts do not have annotations.
21
+ if(id !== 'canvas' && typeof chart.series !== 'undefined' && typeof chart.settings.series !== 'undefined' && chart.type !== 'tabular'){
22
+ hasAnnotation = chart.series.length - chart.settings.series.length > 1;
23
+ }
24
+
25
+ if(! hasAnnotation){
26
+ renderSpecificChart(id, all_charts[id]);
27
  }
 
28
  }
29
 
30
  function renderSpecificChart(id, chart) {
261
  if (settings.series) {
262
  switch(chart.type){
263
  case 'table':
264
+ case 'tabular':
265
  for(i in settings.series){
266
  i = parseInt(i);
267
  if (!series[i + 1]) {
readme.md CHANGED
@@ -2,7 +2,7 @@
2
  **Contributors:** [codeinwp](https://profiles.wordpress.org/codeinwp), [themeisle](https://profiles.wordpress.org/themeisle), [marius2012](https://profiles.wordpress.org/marius2012), [marius_codeinwp](https://profiles.wordpress.org/marius_codeinwp), [hardeepasrani](https://profiles.wordpress.org/hardeepasrani), [rozroz](https://profiles.wordpress.org/rozroz), [Madalin_ThemeIsle](https://profiles.wordpress.org/Madalin_ThemeIsle)
3
  **Tags:** tables, charts, pie, visualization, graphs
4
  **Requires at least:** 3.5
5
- **Tested up to:** 5.4
6
  **Requires PHP:** 5.6
7
  **Stable tag:** trunk
8
  **License:** GPL v2.0 or later
@@ -162,6 +162,15 @@ Pay attention that to turn your shortcodes into graphs, your theme has to have `
162
  13. Bar chart
163
 
164
  ## Changelog ##
 
 
 
 
 
 
 
 
 
165
  ### 3.4.5 - 2020-07-08 ###
166
 
167
  * [Feat] New Google Table Charts
2
  **Contributors:** [codeinwp](https://profiles.wordpress.org/codeinwp), [themeisle](https://profiles.wordpress.org/themeisle), [marius2012](https://profiles.wordpress.org/marius2012), [marius_codeinwp](https://profiles.wordpress.org/marius_codeinwp), [hardeepasrani](https://profiles.wordpress.org/hardeepasrani), [rozroz](https://profiles.wordpress.org/rozroz), [Madalin_ThemeIsle](https://profiles.wordpress.org/Madalin_ThemeIsle)
3
  **Tags:** tables, charts, pie, visualization, graphs
4
  **Requires at least:** 3.5
5
+ **Tested up to:** 5.5
6
  **Requires PHP:** 5.6
7
  **Stable tag:** trunk
8
  **License:** GPL v2.0 or later
162
  13. Bar chart
163
 
164
  ## Changelog ##
165
+ ### 3.4.6 - 2020-08-11 ###
166
+
167
+ * - [Feat] Show chart ID in the chart library
168
+ * - [Fix] Compatibility with WP 5.5
169
+ * - [Fix] Google charts: Series number format not applying in the Gutenberg editor
170
+ * - [Fix] Google Table chart does not display chart if boolean values are specified
171
+ * - [Fix] Duplicated enque for jsapi loader
172
+
173
+
174
  ### 3.4.5 - 2020-07-08 ###
175
 
176
  * [Feat] New Google Table Charts
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: codeinwp,themeisle,marius2012,marius_codeinwp,hardeepasrani,rozroz,Madalin_ThemeIsle
3
  Tags: tables, charts, pie, visualization, graphs
4
  Requires at least: 3.5
5
- Tested up to: 5.4
6
  Requires PHP: 5.6
7
  Stable tag: trunk
8
  License: GPL v2.0 or later
@@ -162,6 +162,15 @@ Pay attention that to turn your shortcodes into graphs, your theme has to have `
162
  13. Bar chart
163
 
164
  == Changelog ==
 
 
 
 
 
 
 
 
 
165
  = 3.4.5 - 2020-07-08 =
166
 
167
  * [Feat] New Google Table Charts
@@ -183,7 +192,7 @@ Pay attention that to turn your shortcodes into graphs, your theme has to have `
183
  * [Fix] Missing posts revisions on chart update
184
 
185
 
186
- = 3.4.3 - 2020-05-04 =
187
 
188
  * [Feat] Improved chart creation UX
189
  * [Feat] New option to control the number of charts per page in the Charts Library
@@ -194,12 +203,12 @@ Pay attention that to turn your shortcodes into graphs, your theme has to have `
194
  * [Fix] Bulk activation of plugin aborts activation of subsequent plugins
195
 
196
 
197
- = 3.4.2 - 2020-02-17 =
198
 
199
  * New Cypress tests for the Gutenberg block
200
 
201
 
202
- = 3.4.1 - 2020-02-14 =
203
 
204
  * [Fix] Insert chart button in the classic block
205
  * [Fix for Pro version] Import from chart did not work
2
  Contributors: codeinwp,themeisle,marius2012,marius_codeinwp,hardeepasrani,rozroz,Madalin_ThemeIsle
3
  Tags: tables, charts, pie, visualization, graphs
4
  Requires at least: 3.5
5
+ Tested up to: 5.5
6
  Requires PHP: 5.6
7
  Stable tag: trunk
8
  License: GPL v2.0 or later
162
  13. Bar chart
163
 
164
  == Changelog ==
165
+ = 3.4.6 - 2020-08-11 =
166
+
167
+ * - [Feat] Show chart ID in the chart library
168
+ * - [Fix] Compatibility with WP 5.5
169
+ * - [Fix] Google charts: Series number format not applying in the Gutenberg editor
170
+ * - [Fix] Google Table chart does not display chart if boolean values are specified
171
+ * - [Fix] Duplicated enque for jsapi loader
172
+
173
+
174
  = 3.4.5 - 2020-07-08 =
175
 
176
  * [Feat] New Google Table Charts
192
  * [Fix] Missing posts revisions on chart update
193
 
194
 
195
+ = 3.4.3 - 2020-05-04 =
196
 
197
  * [Feat] Improved chart creation UX
198
  * [Feat] New option to control the number of charts per page in the Charts Library
203
  * [Fix] Bulk activation of plugin aborts activation of subsequent plugins
204
 
205
 
206
+ = 3.4.2 - 2020-02-17 =
207
 
208
  * New Cypress tests for the Gutenberg block
209
 
210
 
211
+ = 3.4.1 - 2020-02-14 =
212
 
213
  * [Fix] Insert chart button in the classic block
214
  * [Fix for Pro version] Import from chart did not work
themeisle-hash.json CHANGED
@@ -1 +1 @@
1
- {"index.php":"64e4974dec6e9116afa64bc621e1fd7a"}
1
+ {"index.php":"b493b166833119e101db1bcfcc963f50"}
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit9c2f489713ee3c270bae3f731d01fae5::getLoader();
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit67c486f10b4d0c71bbf9c99cf513f4e4::getLoader();
vendor/autoload_52.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
- return ComposerAutoloaderInit55f9c9963512f748825aed25c3b622df::getLoader();
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
+ return ComposerAutoloaderInita3ad5fe0febeabe4837fba2a37e4e871::getLoader();
vendor/codeinwp/themeisle-sdk/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
 
 
 
 
1
  ##### [Version 3.2.14](https://github.com/Codeinwp/themeisle-sdk/compare/v3.2.13...v3.2.14) (2020-06-10)
2
 
3
  > Things are getting better every day. 🚀
1
+ ##### [Version 3.2.15](https://github.com/Codeinwp/themeisle-sdk/compare/v3.2.14...v3.2.15) (2020-07-23)
2
+
3
+ * remove no redundant module
4
+
5
  ##### [Version 3.2.14](https://github.com/Codeinwp/themeisle-sdk/compare/v3.2.13...v3.2.14) (2020-06-10)
6
 
7
  > Things are getting better every day. 🚀
vendor/codeinwp/themeisle-sdk/load.php CHANGED
@@ -14,7 +14,7 @@ if ( ! defined( 'ABSPATH' ) ) {
14
  return;
15
  }
16
  // Current SDK version and path.
17
- $themeisle_sdk_version = '3.2.14';
18
  $themeisle_sdk_path = dirname( __FILE__ );
19
 
20
  global $themeisle_sdk_max_version;
14
  return;
15
  }
16
  // Current SDK version and path.
17
+ $themeisle_sdk_version = '3.2.15';
18
  $themeisle_sdk_path = dirname( __FILE__ );
19
 
20
  global $themeisle_sdk_max_version;
vendor/codeinwp/themeisle-sdk/src/Loader.php CHANGED
@@ -50,7 +50,6 @@ final class Loader {
50
  'rollback',
51
  'uninstall_feedback',
52
  'licenser',
53
- 'endpoint',
54
  'logger',
55
  'translate',
56
  'review',
50
  'rollback',
51
  'uninstall_feedback',
52
  'licenser',
 
53
  'logger',
54
  'translate',
55
  'review',
vendor/codeinwp/themeisle-sdk/src/Modules/Endpoint.php DELETED
@@ -1,358 +0,0 @@
1
- <?php
2
- /**
3
- * The class that exposes endpoints.
4
- *
5
- * @package ThemeIsleSDK
6
- * @subpackage Rollback
7
- * @copyright Copyright (c) 2017, Marius Cristea
8
- * @license http://opensource.org/licenses/gpl-3.0.php GNU Public License
9
- * @since 1.0.0
10
- */
11
-
12
- namespace ThemeisleSDK\Modules;
13
-
14
- // Exit if accessed directly.
15
- use ThemeisleSDK\Common\Abstract_Module;
16
- use ThemeisleSDK\Loader;
17
- use ThemeisleSDK\Product;
18
-
19
- if ( ! defined( 'ABSPATH' ) ) {
20
- exit;
21
- }
22
-
23
- /**
24
- * Expose endpoints for ThemeIsle SDK.
25
- */
26
- class Endpoint extends Abstract_Module {
27
- /**
28
- * Endpoint slug.
29
- */
30
- const SDK_ENDPOINT = 'themeisle-sdk';
31
- /**
32
- * Endpoint version.
33
- */
34
- const SDK_ENDPOINT_VERSION = 1;
35
- /**
36
- * Hash file which contains the checksum.
37
- */
38
- const HASH_FILE = 'themeisle-hash.json';
39
-
40
- /*
41
- * If true, the endpoint will expect a product slug and will return the value only for that.
42
- */
43
- const PRODUCT_SPECIFIC = false;
44
-
45
- /**
46
- * Registers the endpoints.
47
- */
48
- function rest_register() {
49
- register_rest_route(
50
- self::SDK_ENDPOINT . '/v' . self::SDK_ENDPOINT_VERSION,
51
- '/checksum/' . ( self::PRODUCT_SPECIFIC ? '(?P<slug>.*)/' : '' ),
52
- array(
53
- 'methods' => 'GET',
54
- 'callback' => array( $this, 'checksum' ),
55
- )
56
- );
57
- }
58
-
59
- /**
60
- * The checksum endpoint.
61
- *
62
- * @param \WP_REST_Request $data the request.
63
- *
64
- * @return \WP_REST_Response Response or the error
65
- */
66
- function checksum( \WP_REST_Request $data ) {
67
- $products = Loader::get_products();
68
- if ( self::PRODUCT_SPECIFIC ) {
69
- $params = $this->validate_params( $data, array( 'slug' ) );
70
- foreach ( $products as $product ) {
71
- if ( $params['slug'] === $product->get_slug() ) {
72
- $products = array( $product );
73
- break;
74
- }
75
- }
76
- }
77
- $response = array();
78
- $custom_css = $this->has_custom_css();
79
- if ( is_bool( $custom_css ) ) {
80
- $response['custom_css'] = $custom_css;
81
- }
82
-
83
- $response['child_theme'] = $this->get_theme_properties();
84
-
85
- foreach ( $products as $product ) {
86
- $files = array();
87
- switch ( $product->get_type() ) {
88
- case 'plugin':
89
- $files = array();
90
- break;
91
- case 'theme':
92
- $files = array( 'style.css', 'functions.php' );
93
- break;
94
- }
95
-
96
- $error = '';
97
-
98
- // if any element in the $files array contains a '/', this would imply recursion is required.
99
- $diff = $this->generate_diff(
100
- $product,
101
- $files,
102
- array_reduce(
103
- $files,
104
- array(
105
- $this,
106
- 'is_recursion_required',
107
- ),
108
- false
109
- )
110
- );
111
- if ( is_wp_error( $diff ) ) {
112
- /**
113
- * Error returner by the diff checker method.
114
- *
115
- * @var \WP_Error $diff Error returned.
116
- */
117
- $error = $diff->get_error_message();
118
- $diff = array();
119
- }
120
-
121
- $response['products'][] = array(
122
- 'slug' => $product->get_slug(),
123
- 'version' => $product->get_version(),
124
- 'diffs' => $diff,
125
- 'error' => $error,
126
- );
127
- }
128
-
129
- return new \WP_REST_Response( array( 'checksum' => $response ) );
130
- }
131
-
132
- /**
133
- * Validates the parameters to the API
134
- *
135
- * @param \WP_REST_Request $data the request.
136
- * @param array $params the parameters to validate.
137
- *
138
- * @return array of parameter name=>value
139
- */
140
- private function validate_params( \WP_REST_Request $data, $params ) {
141
- $collect = array();
142
- foreach ( $params as $param ) {
143
- $value = sanitize_text_field( $data[ $param ] );
144
- if ( empty( $value ) ) {
145
- return rest_ensure_response(
146
- new \WP_Error(
147
- 'themeisle_' . $param . '_invalid',
148
- sprintf( 'Invalid %', $param ),
149
- array(
150
- 'status' => 403,
151
- )
152
- )
153
- );
154
- } else {
155
- $collect[ $param ] = $value;
156
- }
157
- }
158
-
159
- return $collect;
160
- }
161
-
162
- /**
163
- * Check if custom css has been added to the theme.
164
- *
165
- * @return bool Whether custom css has been added to the theme.
166
- */
167
- private function has_custom_css() {
168
- $query = new \WP_Query(
169
- array(
170
- 'post_type' => 'custom_css',
171
- 'post_status' => 'publish',
172
- 'numberposts' => 1,
173
- 'update_post_meta_cache' => false,
174
- 'update_post_term_cache' => false,
175
- )
176
- );
177
-
178
- if ( $query->have_posts() ) {
179
- $query->the_post();
180
- $content = get_the_content();
181
-
182
- // if the content contains a colon, a CSS rule has been added.
183
- return strpos( $content, ':' ) === false ? false : true;
184
- }
185
-
186
- return false;
187
- }
188
-
189
- /**
190
- * Get the current theme properties.
191
- *
192
- * @return mixed Properties of the current theme.
193
- */
194
- function get_theme_properties() {
195
- if ( ! is_child_theme() ) {
196
- return false;
197
- }
198
-
199
- $properties = array();
200
- $theme = wp_get_theme();
201
- // @codingStandardsIgnoreStart
202
- $properties['name'] = $theme->Name;
203
- // @codingStandardsIgnoreEnd
204
-
205
- // get the files in the child theme.
206
- require_once( ABSPATH . 'wp-admin/includes/file.php' );
207
- WP_Filesystem();
208
- global $wp_filesystem;
209
- $path = str_replace( ABSPATH, $wp_filesystem->abspath(), get_stylesheet_directory() );
210
- $list = $wp_filesystem->dirlist( $path, false, false );
211
- if ( $list ) {
212
- $list = array_keys( self::flatten_dirlist( $list ) );
213
- $properties['files'] = $list;
214
- }
215
-
216
- return $properties;
217
- }
218
-
219
- /**
220
- * Flatten the results of WP_Filesystem::dirlist() for iterating over.
221
- *
222
- * @access private
223
- *
224
- * @param array $nested_files Array of files as returned by WP_Filesystem::dirlist().
225
- * @param string $path Relative path to prepend to child nodes. Optional.
226
- *
227
- * @return array $files A flattened array of the $nested_files specified.
228
- */
229
- private static function flatten_dirlist( $nested_files, $path = '' ) {
230
- $files = array();
231
- foreach ( $nested_files as $name => $details ) {
232
- $files[ $path . $name ] = $details;
233
- // Append children recursively.
234
- if ( ! empty( $details['files'] ) ) {
235
- $children = self::flatten_dirlist( $details['files'], $path . $name . '/' );
236
- // Merge keeping possible numeric keys, which array_merge() will reindex from 0..n.
237
- $files = $files + $children;
238
- }
239
- }
240
-
241
- return $files;
242
- }
243
-
244
- /**
245
- * Generate the diff of the files.
246
- *
247
- * @param Product $product Themeisle Product.
248
- * @param array $files Array of files.
249
- * @param bool $recurse Whether to recurse or not.
250
- *
251
- * @return mixed Diff data.
252
- */
253
- private function generate_diff( $product, $files, $recurse = false ) {
254
- require_once( ABSPATH . 'wp-admin/includes/file.php' );
255
- WP_Filesystem();
256
- global $wp_filesystem;
257
-
258
- $diff = array();
259
- $path = str_replace( ABSPATH, $wp_filesystem->abspath(), plugin_dir_path( $product->get_basefile() ) );
260
- $list = $wp_filesystem->dirlist( $path, false, $recurse );
261
- // nothing found.
262
- if ( ! $list ) {
263
- return $diff;
264
- }
265
- $list = array_keys( self::flatten_dirlist( $list ) );
266
-
267
- // now let's get the valid files that actually exist.
268
- if ( empty( $files ) ) {
269
- $files = $list;
270
- } else {
271
- $files = array_intersect( $files, $list );
272
- }
273
-
274
- // fetch the calculated hashes.
275
- if ( ! $wp_filesystem->is_readable( $path . '/' . self::HASH_FILE ) ) {
276
- return new \WP_Error( 'themeisle_sdk_hash_not_found', sprintf( '%s not found', self::HASH_FILE ) );
277
- }
278
-
279
- $hashes = json_decode( $wp_filesystem->get_contents( $path . '/' . self::HASH_FILE ), true );
280
- ksort( $hashes );
281
-
282
- $diff = array();
283
- foreach ( $files as $file ) {
284
- // file does not exist in the hashes.
285
- if ( ! array_key_exists( $file, $hashes ) ) {
286
- continue;
287
- }
288
- $new = md5( $wp_filesystem->get_contents( $path . $file ) );
289
- $old = $hashes[ $file ];
290
-
291
- // same hash, bail.
292
- if ( $new === $old ) {
293
- continue;
294
- }
295
- $diff[] = $file;
296
- }
297
-
298
- return $diff;
299
- }
300
-
301
- /**
302
- * Check if recursion needs to be enabled on the WP_Filesystem by reducing the array of files to a boolean.
303
- *
304
- * @param string $carry Value of the previous iteration.
305
- * @param string $item Value of the current iteration.
306
- *
307
- * @return bool Whether to recurse or not.
308
- */
309
- function is_recursion_required( $carry, $item ) {
310
- if ( ! $carry ) {
311
- return ( strpos( $item, '/' ) !== false );
312
- }
313
-
314
- return $carry;
315
- }
316
-
317
- /**
318
- * Load module for this product.
319
- *
320
- * @param Product $product Product to check.
321
- *
322
- * @return bool Should we load this?
323
- */
324
- public function can_load( $product ) {
325
- return true;
326
- }
327
-
328
- /**
329
- * Load module logic.
330
- *
331
- * @param Product $product Product to load.
332
- */
333
- public function load( $product ) {
334
- $this->setup_endpoints();
335
-
336
- return $this;
337
- }
338
-
339
- /**
340
- * Setup endpoints.
341
- */
342
- private function setup_endpoints() {
343
- global $wp_version;
344
- if ( version_compare( $wp_version, '4.4', '<' ) ) {
345
- // no REST support.
346
- return;
347
- }
348
-
349
- $this->setup_rest();
350
- }
351
-
352
- /**
353
- * Setup REST endpoints.
354
- */
355
- private function setup_rest() {
356
- add_action( 'rest_api_init', array( $this, 'rest_register' ) );
357
- }
358
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit9c2f489713ee3c270bae3f731d01fae5
6
  {
7
  private static $loader;
8
 
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit9c2f489713ee3c270bae3f731d01fae5
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit9c2f489713ee3c270bae3f731d01fae5', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit9c2f489713ee3c270bae3f731d01fae5', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
@@ -42,14 +42,14 @@ class ComposerAutoloaderInit9c2f489713ee3c270bae3f731d01fae5
42
 
43
  $includeFiles = require __DIR__ . '/autoload_files.php';
44
  foreach ($includeFiles as $fileIdentifier => $file) {
45
- composerRequire9c2f489713ee3c270bae3f731d01fae5($fileIdentifier, $file);
46
  }
47
 
48
  return $loader;
49
  }
50
  }
51
 
52
- function composerRequire9c2f489713ee3c270bae3f731d01fae5($fileIdentifier, $file)
53
  {
54
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
55
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit67c486f10b4d0c71bbf9c99cf513f4e4
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit67c486f10b4d0c71bbf9c99cf513f4e4', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit67c486f10b4d0c71bbf9c99cf513f4e4', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
42
 
43
  $includeFiles = require __DIR__ . '/autoload_files.php';
44
  foreach ($includeFiles as $fileIdentifier => $file) {
45
+ composerRequire67c486f10b4d0c71bbf9c99cf513f4e4($fileIdentifier, $file);
46
  }
47
 
48
  return $loader;
49
  }
50
  }
51
 
52
+ function composerRequire67c486f10b4d0c71bbf9c99cf513f4e4($fileIdentifier, $file)
53
  {
54
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
55
  require $file;
vendor/composer/autoload_real_52.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real_52.php generated by xrstf/composer-php52
4
 
5
- class ComposerAutoloaderInit55f9c9963512f748825aed25c3b622df {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit55f9c9963512f748825aed25c3b622df {
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit55f9c9963512f748825aed25c3b622df', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit55f9c9963512f748825aed25c3b622df', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(dirname(__FILE__));
27
  $baseDir = dirname($vendorDir);
2
 
3
  // autoload_real_52.php generated by xrstf/composer-php52
4
 
5
+ class ComposerAutoloaderInita3ad5fe0febeabe4837fba2a37e4e871 {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInita3ad5fe0febeabe4837fba2a37e4e871', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInita3ad5fe0febeabe4837fba2a37e4e871', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(dirname(__FILE__));
27
  $baseDir = dirname($vendorDir);
vendor/composer/installed.json CHANGED
@@ -6,12 +6,12 @@
6
  "source": {
7
  "type": "git",
8
  "url": "https://github.com/Codeinwp/themeisle-sdk.git",
9
- "reference": "992f5e8347836e325ffc50760da1d550b79831c4"
10
  },
11
  "dist": {
12
  "type": "zip",
13
- "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/992f5e8347836e325ffc50760da1d550b79831c4",
14
- "reference": "992f5e8347836e325ffc50760da1d550b79831c4",
15
  "shasum": ""
16
  },
17
  "require-dev": {
@@ -19,7 +19,7 @@
19
  "squizlabs/php_codesniffer": "^3.1",
20
  "wp-coding-standards/wpcs": "^1.0.0"
21
  },
22
- "time": "2020-06-10 16:25:09",
23
  "type": "library",
24
  "installation-source": "source",
25
  "notification-url": "https://packagist.org/downloads/",
6
  "source": {
7
  "type": "git",
8
  "url": "https://github.com/Codeinwp/themeisle-sdk.git",
9
+ "reference": "95b7447a5f4faba410c281c4bf278fbd740fed71"
10
  },
11
  "dist": {
12
  "type": "zip",
13
+ "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/95b7447a5f4faba410c281c4bf278fbd740fed71",
14
+ "reference": "95b7447a5f4faba410c281c4bf278fbd740fed71",
15
  "shasum": ""
16
  },
17
  "require-dev": {
19
  "squizlabs/php_codesniffer": "^3.1",
20
  "wp-coding-standards/wpcs": "^1.0.0"
21
  },
22
+ "time": "2020-07-23 15:02:10",
23
  "type": "library",
24
  "installation-source": "source",
25
  "notification-url": "https://packagist.org/downloads/",